diff options
author | James Brown | 2003-01-12 10:20:09 +0000 |
---|---|---|
committer | James Brown | 2003-01-12 10:20:09 +0000 |
commit | a4af93c22ca2a4b570641029624f0b6405feda0c (patch) | |
tree | 94227b40ef57594d7f4d235423658aeef2aba9cb /scumm/object.cpp | |
parent | 65b161b98c20356580cbd0228b3580d7f8128fdc (diff) | |
download | scummvm-rg350-a4af93c22ca2a4b570641029624f0b6405feda0c.tar.gz scummvm-rg350-a4af93c22ca2a4b570641029624f0b6405feda0c.tar.bz2 scummvm-rg350-a4af93c22ca2a4b570641029624f0b6405feda0c.zip |
End of flObject rewrite. It works! It works! :P
svn-id: r6421
Diffstat (limited to 'scumm/object.cpp')
-rw-r--r-- | scumm/object.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp index 6236440a52..15920383b3 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -128,11 +128,11 @@ int Scumm::getObjectIndex(int object) // FIXME: Major HACK. This is probably the worst biggest // hack in the whole engine. It's that bad. // (Workaround flobject 188/189 not loaded bug) - if (_gameId == GID_CMI && ((object == 188 || object == 189))) { + /*if (_gameId == GID_CMI && ((object == 188 || object == 189))) { warning("FIXME MAJOR: Hacking load of FlObject %d\n", object); loadFlObject(object, 3); return getObjectIndex(object); - } + }*/ return -1; } } @@ -446,8 +446,21 @@ void Scumm::loadRoomObjects() // Clear out old room objects (FIXME: Locking/FlObjects stuff?) for (i = 0; i < _numLocalObjects; i++) { - _objs[i].obj_nr = 0; - _objs[i].fl_object_index = 0; + if (_objs[i].obj_nr < 1) // Optimise codepath + continue; + + // Nuke all non-flObjects (flObjects are nuked in script.cpp) + if (!_objs[i].fl_object_index) { + _objs[i].obj_nr = 0; + _objs[i].fl_object_index = 0; + } else { + // Nuke all unlocked flObjects + if (!(res.flags[rtFlObject][_objs[i].fl_object_index] & RF_LOCK)) { + nukeResource(rtFlObject, _objs[i].fl_object_index); + _objs[i].obj_nr = 0; + _objs[i].fl_object_index = 0; + } + } } if (_numObjectsInRoom == 0) @@ -518,7 +531,7 @@ void Scumm::loadRoomObjects() // ENDERFIXME: Switch this one over to numLocals also for (i = 1; i < _numLocalObjects; i++) { - if (_objs[i].obj_nr) + if (_objs[i].obj_nr && !_objs[i].fl_object_index) setupRoomObject(&_objs[i], room); } @@ -583,7 +596,7 @@ void Scumm::loadRoomObjectsSmall() // ENDERFIXME: Switch to numLocals for (i = 1; i < _numLocalObjects; i++) { - if (_objs[i].obj_nr) + if (_objs[i].obj_nr && !_objs[i].fl_object_index) setupRoomObject(&_objs[i], room); } |