diff options
author | Strangerke | 2016-08-07 17:42:12 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | 6122e199fe6c952661ab7a6884963991094b6bcc (patch) | |
tree | cb82aa1c8f5ecc4e3a85a3ef66452d681c6747a6 /engines/dm/dungeonman.cpp | |
parent | af5e50a837d344d6420338c66315c43d5313e654 (diff) | |
download | scummvm-rg350-6122e199fe6c952661ab7a6884963991094b6bcc.tar.gz scummvm-rg350-6122e199fe6c952661ab7a6884963991094b6bcc.tar.bz2 scummvm-rg350-6122e199fe6c952661ab7a6884963991094b6bcc.zip |
DM: remove some more GOTOs in f172_setSquareAspect
Diffstat (limited to 'engines/dm/dungeonman.cpp')
-rw-r--r-- | engines/dm/dungeonman.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index 057e04c060..dd7081392b 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -822,7 +822,6 @@ Thing DungeonMan::f161_getSquareFirstThing(int16 mapX, int16 mapY) { return _g283_squareFirstThings[index]; } -// TODO: produce more GOTOs void DungeonMan::f172_setSquareAspect(uint16 *aspectArray, Direction dir, int16 mapX, int16 mapY) { unsigned char L0307_uc_Multiple; #define AL0307_uc_Square L0307_uc_Multiple @@ -903,6 +902,7 @@ T0172010_ClosedFakeWall: } aspectArray[k0_ElemAspect] = k1_CorridorElemType; AL0307_uc_FootprintsAllowed = getFlag(AL0307_uc_Square, k0x0008_FakeWallRandOrnOrFootPAllowed) ? 8 : 0; + // No break on purpose case k1_CorridorElemType: case k2_ElementTypePit: case k5_ElementTypeTeleporter: @@ -929,12 +929,18 @@ T0172010_ClosedFakeWall: } curThing = f159_getNextThing(curThing); } - goto T0172049_Footprints; + + if (AL0307_uc_FootprintsAllowed && (AL0307_uc_ScentOrdinal = _vm->_championMan->f315_getScentOrdinal(mapX, mapY)) && (--AL0307_uc_ScentOrdinal >= _vm->_championMan->_g407_party._firstScentIndex) && (AL0307_uc_ScentOrdinal < _vm->_championMan->_g407_party._lastScentIndex)) + setFlag(aspectArray[k4_FloorOrnOrdAspect], k0x8000_FootprintsAspect); + + break; case k3_ElementTypeStairs: aspectArray[k0_ElemAspect] = (bool((getFlag(AL0307_uc_Square, k0x0008_StairsNorthSouthOrient) >> 3)) == isOrientedWestEast(dir)) ? k18_ElementTypeStairsSide : k19_ElementTypeStaisFront; aspectArray[k2_StairsUpAspect] = getFlag(AL0307_uc_Square, k0x0004_StairsUp); AL0307_uc_FootprintsAllowed = false; - goto T0172046_Stairs; + while ((curThing != Thing::_endOfList) && (curThing.getType() <= k3_SensorThingType)) + curThing = f159_getNextThing(curThing); + break; case k4_DoorElemType: if (bool((getFlag(AL0307_uc_Square, k0x0008_DoorNorthSouthOrient) >> 3)) == isOrientedWestEast(dir)) { aspectArray[k0_ElemAspect] = k16_DoorSideElemType; @@ -944,14 +950,12 @@ T0172010_ClosedFakeWall: aspectArray[k3_DoorThingIndexAspect] = f161_getSquareFirstThing(mapX, mapY).getIndex(); } AL0307_uc_FootprintsAllowed = true; -T0172046_Stairs: - while ((curThing != Thing::_endOfList) && (curThing.getType() <= k3_SensorThingType)) { + + while ((curThing != Thing::_endOfList) && (curThing.getType() <= k3_SensorThingType)) curThing = f159_getNextThing(curThing); - } -T0172049_Footprints: - if (AL0307_uc_FootprintsAllowed && (AL0307_uc_ScentOrdinal = _vm->_championMan->f315_getScentOrdinal(mapX, mapY)) && (--AL0307_uc_ScentOrdinal >= _vm->_championMan->_g407_party._firstScentIndex) && (AL0307_uc_ScentOrdinal < _vm->_championMan->_g407_party._lastScentIndex)) { + + if (AL0307_uc_FootprintsAllowed && (AL0307_uc_ScentOrdinal = _vm->_championMan->f315_getScentOrdinal(mapX, mapY)) && (--AL0307_uc_ScentOrdinal >= _vm->_championMan->_g407_party._firstScentIndex) && (AL0307_uc_ScentOrdinal < _vm->_championMan->_g407_party._lastScentIndex)) setFlag(aspectArray[k4_FloorOrnOrdAspect], k0x8000_FootprintsAspect); - } } aspectArray[k1_FirstGroupOrObjectAspect] = curThing.toUint16(); } |