aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/seg_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/seg_manager.cpp')
-rw-r--r--engines/sci/engine/seg_manager.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index 402a690e62..c503d7bcd0 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -116,7 +116,7 @@ SegmentObj *SegManager::allocSegment(SegmentType type, SegmentId *segid) {
Script *SegManager::allocateScript(int script_nr, SegmentId *seg_id) {
// Check if the script already has an allocated segment. If it
// does have one, return it.
- *seg_id = _scriptSegMap.getVal(script_nr, -1);
+ *seg_id = _scriptSegMap.getVal(script_nr, 0);
if (*seg_id > 0) {
return (Script *)_heap[*seg_id];
}
@@ -223,7 +223,7 @@ SegmentId SegManager::findSegmentByType(int type) {
for (uint i = 0; i < _heap.size(); i++)
if (_heap[i] && _heap[i]->getType() == type)
return i;
- return -1;
+ return 0;
}
SegmentObj *SegManager::getSegmentObj(SegmentId seg) {
@@ -414,9 +414,9 @@ void Script::heapRelocate(reg_t block) {
}
}
-// return the seg if script_id is valid and in the map, else -1
+// return the seg if script_id is valid and in the map, else 0
SegmentId SegManager::getScriptSegment(int script_id) const {
- return _scriptSegMap.getVal(script_id, -1);
+ return _scriptSegMap.getVal(script_id, 0);
}
SegmentId SegManager::getScriptSegment(int script_nr, ScriptLoadType load) {
@@ -430,10 +430,8 @@ SegmentId SegManager::getScriptSegment(int script_nr, ScriptLoadType load) {
if (segment > 0) {
if ((load & SCRIPT_GET_LOCK) == SCRIPT_GET_LOCK)
getScript(segment)->incrementLockers();
-
- return segment;
- } else
- return -1;
+ }
+ return segment;
}
reg_t SegManager::getClassAddress(int classnr, ScriptLoadType lock, reg_t caller) {