diff options
author | Ludvig Strigeus | 2001-12-04 21:44:41 +0000 |
---|---|---|
committer | Ludvig Strigeus | 2001-12-04 21:44:41 +0000 |
commit | a117505403bf1c7bd2ac206d74f423c42bb953e5 (patch) | |
tree | f5f6f35ac973da19c9adce9d2375631644d9b020 | |
parent | 761fe5d7bd92f7224fe12b4cdf912b55ef1fb768 (diff) | |
download | scummvm-rg350-a117505403bf1c7bd2ac206d74f423c42bb953e5.tar.gz scummvm-rg350-a117505403bf1c7bd2ac206d74f423c42bb953e5.tar.bz2 scummvm-rg350-a117505403bf1c7bd2ac206d74f423c42bb953e5.zip |
fixed some stuff related to in what order objects are drawn as well as a bug with object parents
svn-id: r3525
-rw-r--r-- | object.cpp | 46 | ||||
-rw-r--r-- | scumm.h | 2 | ||||
-rw-r--r-- | scummvm.cpp | 2 |
3 files changed, 31 insertions, 19 deletions
diff --git a/object.cpp b/object.cpp index 3438dcb26d..783336492d 100644 --- a/object.cpp +++ b/object.cpp @@ -225,23 +225,33 @@ int Scumm::findObject(int x, int y) { return 0; } -void Scumm::drawRoomObjects(int arg) { - int i; +void Scumm::drawRoomObject(int i, int arg) { ObjectData *od; byte a; - for(i=1; i<=_numObjectsInRoom; i++) { - od = &_objs[i]; - if (!od->obj_nr || !od->state) - continue; - do { - a = od->parentstate; - if (!od->parent) { - drawObject(i, arg); - break; - } - od = &_objs[od->parent]; - } while (od->state==a); + od = &_objs[i]; + if (!od->obj_nr || !od->state) + return; + + do { + a = od->parentstate; + if (!od->parent) { + drawObject(i, arg); + break; + } + od = &_objs[od->parent]; + } while (od->state==a); +} + +void Scumm::drawRoomObjects(int arg) { + int i; + + if (_features & GF_DRAWOBJ_OTHER_ORDER) { + for(i=1; i<=_numObjectsInRoom; i++) + drawRoomObject(i,arg); + } else { + for(i=_numObjectsInRoom; i!=0; i--) + drawRoomObject(i,arg); } } @@ -407,9 +417,9 @@ void Scumm::setupRoomObject(ObjectData *od, byte *room) { od->x_pos = ((int16)READ_LE_UINT16(&cdhd->v6.x)); od->y_pos = ((int16)READ_LE_UINT16(&cdhd->v6.y)); if (cdhd->v6.flags == 0x80) { - od->parentstate = 1<<4; + od->parentstate = 1; } else { - od->parentstate = (cdhd->v6.flags&0xF)<<OF_STATE_SHL; + od->parentstate = (cdhd->v6.flags&0xF); } od->parent = cdhd->v6.parent; od->actordir = cdhd->v6.actordir; @@ -419,9 +429,9 @@ void Scumm::setupRoomObject(ObjectData *od, byte *room) { od->x_pos = cdhd->v5.x<<3; od->y_pos = cdhd->v5.y<<3; if (cdhd->v5.flags == 0x80) { - od->parentstate = 1<<4; + od->parentstate = 1; } else { - od->parentstate = (cdhd->v5.flags&0xF)<<OF_STATE_SHL; + od->parentstate = (cdhd->v5.flags&0xF); } od->parent = cdhd->v5.parent; od->walk_x = READ_LE_UINT16(&cdhd->v5.walk_x); @@ -881,6 +881,7 @@ enum GameFeatures { GF_HAS_ROOMTABLE = GF_AFTER_V7, GF_USE_KEY = 8, GF_USE_ANGLES = GF_AFTER_V7, + GF_DRAWOBJ_OTHER_ORDER = 16, GF_DEFAULT = GF_USE_KEY, }; @@ -1659,6 +1660,7 @@ struct Scumm { void redrawBGAreas(); void drawRoomObjects(int arg); + void drawRoomObject(int i, int arg); void redrawBGStrip(int start, int num); void drawObject(int obj, int arg); diff --git a/scummvm.cpp b/scummvm.cpp index 479282d8d7..8e36f04e19 100644 --- a/scummvm.cpp +++ b/scummvm.cpp @@ -409,7 +409,7 @@ static const VersionSettings version_settings[] = { {"dottdemo", "Day Of The Tentacle (Demo)", GID_TENTACLE, 6, 3, 2, GF_NEW_OPCODES|GF_AFTER_V6|GF_USE_KEY}, {"samnmax", "Sam & Max", GID_SAMNMAX, 6, 4, 2, - GF_NEW_OPCODES|GF_AFTER_V6|GF_USE_KEY}, + GF_NEW_OPCODES|GF_AFTER_V6|GF_USE_KEY|GF_DRAWOBJ_OTHER_ORDER}, {"snmdemo", "Sam & Max (Demo)", GID_SAMNMAX, 6, 3, 0, GF_NEW_OPCODES|GF_AFTER_V6|GF_USE_KEY}, {"ft", "Full Throttle", GID_SAMNMAX, 7, 3, 0, |