diff options
author | Eugene Sandulenko | 2016-09-10 21:54:22 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-09-10 21:54:22 +0200 |
commit | 2fd23749924d0ee23f0fe9e48b8bc7831df54853 (patch) | |
tree | 2f89f68d0b768cf6929164df436317fd7631c447 | |
parent | 786f2449293faaa914522239fafc74559dfb5c60 (diff) | |
download | scummvm-rg350-2fd23749924d0ee23f0fe9e48b8bc7831df54853.tar.gz scummvm-rg350-2fd23749924d0ee23f0fe9e48b8bc7831df54853.tar.bz2 scummvm-rg350-2fd23749924d0ee23f0fe9e48b8bc7831df54853.zip |
DM: Rename _C to _Cu
-rw-r--r-- | engines/dm/eventman.cpp | 4 | ||||
-rw-r--r-- | engines/dm/gfx.cpp | 20 | ||||
-rw-r--r-- | engines/dm/group.cpp | 10 | ||||
-rw-r--r-- | engines/dm/movesens.cpp | 8 | ||||
-rw-r--r-- | engines/dm/projexpl.cpp | 28 | ||||
-rw-r--r-- | engines/dm/sounds.cpp | 2 | ||||
-rw-r--r-- | engines/dm/timeline.cpp | 96 | ||||
-rw-r--r-- | engines/dm/timeline.h | 2 |
8 files changed, 85 insertions, 85 deletions
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index 508f95946b..e95f7e3bf1 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -1388,8 +1388,8 @@ void EventManager::processType80_clickInDungeonViewDropLeaderHandObject(uint16 v newEvent._priority = removedJunk->getChargeCount(); newEvent._Bu._location._mapX = mapX; newEvent._Bu._location._mapY = mapY; - newEvent._C.A._cell = currCell; - newEvent._C.A._effect = k2_SensorEffToggle; + newEvent._Cu.A._cell = currCell; + newEvent._Cu.A._effect = k2_SensorEffToggle; _vm->_timeline->addEventGetEventIndex(&newEvent); } _vm->_stopWaitingForPlayerInput = true; diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index 3c992a8c65..e02baa7632 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -163,7 +163,7 @@ void DisplayMan::initConstants() { }; const ExplosionAspect explosionAspects[k4_ExplosionAspectCount] = { // @ G0211_as_Graphic558_ExplosionAspects - // ByteWidth, Height + // ByteWidth, Height ExplosionAspect(80, 111), // Fire ExplosionAspect(64, 97), // Spell ExplosionAspect(80, 91), // Poison @@ -411,7 +411,7 @@ void DisplayMan::initConstants() { Frame(124, 159, 17, 102, 48, 88, 48, 0) /* Right Horizontal Closed three fourth */ ); - _boxThievesEyeViewPortVisibleArea = Box(64, 159, 19, 113); // @ G0106_s_Graphic558_Box_ThievesEye_ViewportVisibleArea + _boxThievesEyeViewPortVisibleArea = Box(64, 159, 19, 113); // @ G0106_s_Graphic558_Box_ThievesEye_ViewportVisibleArea _boxMovementArrows = Box(224, 319, 124, 168); // @ G0002_s_Graphic562_Box_MovementArrows } @@ -1475,7 +1475,7 @@ void DisplayMan::drawSquareD2L(Direction dir, int16 posX, int16 posY) { isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k5_ViewWall_D2L_RIGHT); if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k7_ViewWall_D2L_FRONT)) order = k0x0000_CellOrder_Alcove; - else + else return; break; case k18_ElementTypeStairsSide: @@ -1860,7 +1860,7 @@ void DisplayMan::drawSquareD1C(Direction dir, int16 posX, int16 posY) { static Frame frameStairsDownFrontD1C = Frame(32, 191, 18, 108, 80, 91, 0, 0); // @ G0128_s_Graphic558_Frame_StairsDownFront_D1C static Frame frameFloorPitD1C = Frame(32, 191, 93, 116, 80, 24, 0, 0); // @ G0147_s_Graphic558_Frame_FloorPit_D1C static Frame frameCeilingPitD1C = Frame(32, 191, 8, 16, 80, 9, 0, 0); // @ G0156_s_Graphic558_Frame_CeilingPit_D1C - static Box boxThievesEyeVisibleArea(0, 95, 0, 94); // @ G0107_s_Graphic558_Box_ThievesEye_VisibleArea + static Box boxThievesEyeVisibleArea(0, 95, 0, 94); // @ G0107_s_Graphic558_Box_ThievesEye_VisibleArea int16 order; uint16 squareAspect[5]; @@ -2007,7 +2007,7 @@ void DisplayMan::drawSquareD0C(Direction dir, int16 posX, int16 posY) { static Frame frameStairsDownFrontD0R = Frame(192, 223, 76, 135, 16, 60, 0, 0); // @ G0131_s_Graphic558_Frame_StairsDownFront_D0R static Frame frameFloorPitD0C = Frame(16, 207, 124, 135, 96, 12, 0, 0); // @ G0150_s_Graphic558_Frame_FloorPit_D0C static Frame frameCeilingPitD0C = Frame(16, 207, 0, 3, 96, 4, 0, 0); // @ G0159_s_Graphic558_Frame_CeilingPit_D0C - static Box boxThievesEyeHoleInDoorFrame(0, 31, 19, 113); // @ G0108_s_Graphic558_Box_ThievesEye_HoleInDoorFrame + static Box boxThievesEyeHoleInDoorFrame(0, 31, 19, 113); // @ G0108_s_Graphic558_Box_ThievesEye_HoleInDoorFrame uint16 squareAspect[5]; @@ -2700,7 +2700,7 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex copyBitmapAndFlipHorizontal(ornBlitBitmap, _tmpBitmap, ornCoordSet[4], ornCoordSet[5]); ornBlitBitmap = _tmpBitmap; blitPosX = 15 - (blitPosX & 0x000F); - } else if (viewWallIndex == k7_ViewWall_D2L_FRONT) + } else if (viewWallIndex == k7_ViewWall_D2L_FRONT) blitPosX -= ornCoordSet[1] - ornCoordSet[0]; else blitPosX = 0; @@ -2871,7 +2871,7 @@ void DisplayMan::drawObjectsCreaturesProjectilesExplosions(Thing thingParam, Dir bool projectileFlipVertical = false; /* This is the full dungeon view */ - static Box boxExplosionPatternD0C = Box(0, 223, 0, 135); // @ G0105_s_Graphic558_Box_ExplosionPattern_D0C + static Box boxExplosionPatternD0C = Box(0, 223, 0, 135); // @ G0105_s_Graphic558_Box_ExplosionPattern_D0C static byte explosionBaseScales[5] = { // @ G0216_auc_Graphic558_ExplosionBaseScales 10, /* D4 */ @@ -3507,7 +3507,7 @@ T0115129_DrawProjectiles: if (projectileAspectType == k3_ProjectileAspectHasNone) { projectileBitmapIndexDelta = 0; flipVertical = flipHorizontal = false; - } else if (isOrientedWestEast(Direction(projectileDirection = _vm->_timeline->_events[projectile->_eventIndex]._C._projectile.getDir())) != isOrientedWestEast(directionParam)) { + } else if (isOrientedWestEast(Direction(projectileDirection = _vm->_timeline->_events[projectile->_eventIndex]._Cu._projectile.getDir())) != isOrientedWestEast(directionParam)) { if (projectileAspectType == k2_ProjectileAspectHasRotation) projectileBitmapIndexDelta = 1; else @@ -3757,7 +3757,7 @@ bool DisplayMan::isDerivedBitmapInCache(int16 derivedBitmapIndex) { // * 2, because the original uses 4 bits instead of 8 bits to store a pixel _derivedBitmaps[derivedBitmapIndex] = new byte[_derivedBitmapByteCount[derivedBitmapIndex] * 2]; return false; - } + } return true; } @@ -3790,7 +3790,7 @@ uint16 DisplayMan::getDarkenedColor(uint16 RGBcolor) { void DisplayMan::startEndFadeToPalette(uint16* P0849_pui_Palette) { uint16 *paletteRegister = _paletteFadeTemporary; - for (int16 i = 0; i < 16; i++) + for (int16 i = 0; i < 16; i++) paletteRegister[i] = _paletteFadeFrom[i]; for (int16 i = 0; i < 8; i++) { diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp index 416c91ba7d..f8d175ad4a 100644 --- a/engines/dm/group.cpp +++ b/engines/dm/group.cpp @@ -636,7 +636,7 @@ T0209005_AddEventAndReturn: if (eventType < 0) return; nextEvent._type = eventType; - nextEvent._C._ticks = ticks; + nextEvent._Cu._ticks = ticks; AL0446_i_Ticks = 4; /* Retry in 4 ticks */ goto T0209005_AddEventAndReturn; } @@ -1336,10 +1336,10 @@ void GroupMan::addGroupEvent(TimelineEvent *event, uint32 time) { warning("potentially dangerous cast to uint32 below"); if (time < (uint32)filterTime(event->_mapTime)) { event->_type -= 5; - event->_C._ticks = filterTime(event->_mapTime) - time; + event->_Cu._ticks = filterTime(event->_mapTime) - time; M32_setTime(event->_mapTime, time); } else { - event->_C._ticks = time - filterTime(event->_mapTime); + event->_Cu._ticks = time - filterTime(event->_mapTime); } _vm->_timeline->addEventGetEventIndex(event); } @@ -1643,7 +1643,7 @@ void GroupMan::startWandering(int16 mapX, int16 mapY) { setMapAndTime(nextEvent._mapTime, _vm->_dungeonMan->_currMapIndex, (_vm->_gameTime + 1)); nextEvent._type = k37_TMEventTypeUpdateBehaviourGroup; nextEvent._priority = 255 - _vm->_dungeonMan->_creatureInfos[L0332_ps_Group->_type]._movementTicks; /* The fastest creatures (with small MovementTicks value) get higher event priority */ - nextEvent._C._ticks = 0; + nextEvent._Cu._ticks = 0; nextEvent._Bu._location._mapX = mapX; nextEvent._Bu._location._mapY = mapY; _vm->_timeline->addEventGetEventIndex(&nextEvent); @@ -1887,7 +1887,7 @@ void GroupMan::fluxCageAction(int16 mapX, int16 mapY) { setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + 100); newEvent._type = k24_TMEventTypeRemoveFluxcage; newEvent._priority = 0; - newEvent._C._slot = unusedThing.toUint16(); + newEvent._Cu._slot = unusedThing.toUint16(); newEvent._Bu._location._mapX = mapX; newEvent._Bu._location._mapY = mapY; newEvent._Bu._location._mapY = mapY; diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp index d28b540bca..5e41a1cd18 100644 --- a/engines/dm/movesens.cpp +++ b/engines/dm/movesens.cpp @@ -256,7 +256,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM if (thingType == k14_ProjectileThingType) { Teleporter *L0712_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->getThingData(thing); - _moveResultDir = (_vm->_timeline->_events[((Projectile *)L0712_ps_Teleporter)->_eventIndex])._C._projectile.getDir(); + _moveResultDir = (_vm->_timeline->_events[((Projectile *)L0712_ps_Teleporter)->_eventIndex])._Cu._projectile.getDir(); } int16 destinationSquareData = 0; @@ -594,8 +594,8 @@ void MovesensMan::addEvent(byte type, byte mapX, byte mapY, byte cell, byte effe newEvent._priority = 0; newEvent._Bu._location._mapX = mapX; newEvent._Bu._location._mapY = mapY; - newEvent._C.A._cell = cell; - newEvent._C.A._effect = effect; + newEvent._Cu.A._cell = cell; + newEvent._Cu.A._effect = effect; _vm->_timeline->addEventGetEventIndex(&newEvent); } @@ -992,7 +992,7 @@ void MovesensMan::createEventMoveGroup(Thing groupThing, int16 mapX, int16 mapY, newEvent._priority = 0; newEvent._Bu._location._mapX = mapX; newEvent._Bu._location._mapY = mapY; - newEvent._C._slot = groupThing.toUint16(); + newEvent._Cu._slot = groupThing.toUint16(); _vm->_timeline->addEventGetEventIndex(&newEvent); } diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp index 131e015656..26d63673dc 100644 --- a/engines/dm/projexpl.cpp +++ b/engines/dm/projexpl.cpp @@ -65,10 +65,10 @@ void ProjExpl::createProjectile(Thing thing, int16 mapX, int16 mapY, uint16 cell newEvent._priority = 0; newEvent._Bu._slot = projectileThing.toUint16(); - newEvent._C._projectile.setMapX(mapX); - newEvent._C._projectile.setMapY(mapY); - newEvent._C._projectile.setStepEnergy(stepEnergy); - newEvent._C._projectile.setDir(dir); + newEvent._Cu._projectile.setMapX(mapX); + newEvent._Cu._projectile.setMapY(mapY); + newEvent._Cu._projectile.setStepEnergy(stepEnergy); + newEvent._Cu._projectile.setDir(dir); projectilePtr->_eventIndex = _vm->_timeline->addEventGetEventIndex(&newEvent); } @@ -314,7 +314,7 @@ void ProjExpl::createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo, setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + ((explThing == Thing::_explRebirthStep1) ? 5 : 1)); newEvent._type = k25_TMEventTypeExplosion; newEvent._priority = 0; - newEvent._C._slot = unusedThing.toUint16(); + newEvent._Cu._slot = unusedThing.toUint16(); newEvent._Bu._location._mapX = projectileMapX; newEvent._Bu._location._mapY = projectileMapY; _vm->_timeline->addEventGetEventIndex(&newEvent); @@ -397,8 +397,8 @@ void ProjExpl::processEvents48To49(TimelineEvent *event) { Thing projectileThingNewCell = Thing(curEvent->_Bu._slot); Thing projectileThing = projectileThingNewCell; Projectile *projectile = (Projectile *)_vm->_dungeonMan->getThingData(projectileThing); - int16 destinationMapX = curEvent->_C._projectile.getMapX(); - int16 destinationMapY = curEvent->_C._projectile.getMapY(); + int16 destinationMapX = curEvent->_Cu._projectile.getMapX(); + int16 destinationMapY = curEvent->_Cu._projectile.getMapY(); if (curEvent->_type == k48_TMEventTypeMoveProjectileIgnoreImpacts) curEvent->_type = k49_TMEventTypeMoveProjectile; @@ -410,7 +410,7 @@ void ProjExpl::processEvents48To49(TimelineEvent *event) { if ((_vm->_groupMan->groupGetThing(destinationMapX, destinationMapY) != Thing::_endOfList) && hasProjectileImpactOccurred(kM1_CreatureElemType, destinationMapX, destinationMapY, projectileCurCell, projectileThing)) return; - uint16 stepEnergy = curEvent->_C._projectile.getStepEnergy(); + uint16 stepEnergy = curEvent->_Cu._projectile.getStepEnergy(); if (projectile->_kineticEnergy <= stepEnergy) { _vm->_dungeonMan->unlinkThingFromList(projectileThingNewCell = projectileThing, Thing(0), destinationMapX, destinationMapY); projectileDelete(projectileThingNewCell, NULL, destinationMapX, destinationMapY); @@ -422,7 +422,7 @@ void ProjExpl::processEvents48To49(TimelineEvent *event) { else projectile->_attack -= stepEnergy; } - uint16 projectileDirection = curEvent->_C._projectile.getDir(); + uint16 projectileDirection = curEvent->_Cu._projectile.getDir(); projectileThingNewCell = Thing(curEvent->_Bu._slot); uint16 projectileNewCell = projectileThingNewCell.getCell(); bool projectileMovesToOtherSquare = (projectileDirection == projectileNewCell) || (returnNextVal(projectileDirection) == projectileNewCell); @@ -449,9 +449,9 @@ void ProjExpl::processEvents48To49(TimelineEvent *event) { projectileThingNewCell = thingWithNewCell(projectileThingNewCell, projectileNewCell &= 0x0003); if (projectileMovesToOtherSquare) { _vm->_moveSens->getMoveResult(projectileThingNewCell, sourceMapX, sourceMapY, destinationMapX, destinationMapY); - curEvent->_C._projectile.setMapX(_vm->_moveSens->_moveResultMapX); - curEvent->_C._projectile.setMapY(_vm->_moveSens->_moveResultMapY); - curEvent->_C._projectile.setDir((Direction)_vm->_moveSens->_moveResultDir); + curEvent->_Cu._projectile.setMapX(_vm->_moveSens->_moveResultMapX); + curEvent->_Cu._projectile.setMapY(_vm->_moveSens->_moveResultMapY); + curEvent->_Cu._projectile.setDir((Direction)_vm->_moveSens->_moveResultDir); projectileThingNewCell = thingWithNewCell(projectileThingNewCell, _vm->_moveSens->_moveResultCell); M31_setMap(curEvent->_mapTime, _vm->_moveSens->_moveResultMapIndex); } else { @@ -472,7 +472,7 @@ void ProjExpl::processEvents48To49(TimelineEvent *event) { void ProjExpl::processEvent25(TimelineEvent *event) { uint16 mapX = event->_Bu._location._mapX; uint16 mapY = event->_Bu._location._mapY; - Explosion *explosion = &((Explosion *)_vm->_dungeonMan->_thingData[k15_ExplosionThingType])[Thing((event->_C._slot)).getIndex()]; + Explosion *explosion = &((Explosion *)_vm->_dungeonMan->_thingData[k15_ExplosionThingType])[Thing((event->_Cu._slot)).getIndex()]; int16 curSquareType = Square(_vm->_dungeonMan->_currMapData[mapX][mapY]).getType(); bool explosionOnPartySquare = (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (mapX == _vm->_dungeonMan->_partyMapX) && (mapY == _vm->_dungeonMan->_partyMapY); Thing groupThing = _vm->_groupMan->groupGetThing(mapX, mapY); @@ -555,7 +555,7 @@ void ProjExpl::processEvent25(TimelineEvent *event) { newEvent._mapTime++; _vm->_timeline->addEventGetEventIndex(&newEvent); } else { - _vm->_dungeonMan->unlinkThingFromList(Thing(event->_C._slot), Thing(0), mapX, mapY); + _vm->_dungeonMan->unlinkThingFromList(Thing(event->_Cu._slot), Thing(0), mapX, mapY); explosion->setNextThing(Thing::_none); } } diff --git a/engines/dm/sounds.cpp b/engines/dm/sounds.cpp index 1a8b9a3b0f..4cb8eaf26f 100644 --- a/engines/dm/sounds.cpp +++ b/engines/dm/sounds.cpp @@ -205,7 +205,7 @@ void SoundMan::requestPlay(uint16 soundIndex, int16 mapX, int16 mapY, uint16 mod setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + mode - 1); newEvent._type = k20_TMEventTypePlaySound; newEvent._priority = sound->_priority; - newEvent._C._soundIndex = soundIndex; + newEvent._Cu._soundIndex = soundIndex; newEvent._Bu._location._mapX = mapX; newEvent._Bu._location._mapY = mapY; _vm->_timeline->addEventGetEventIndex(&newEvent); diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp index adb8825355..127ba0d435 100644 --- a/engines/dm/timeline.cpp +++ b/engines/dm/timeline.cpp @@ -203,14 +203,14 @@ uint16 Timeline::addEventGetEventIndex(TimelineEvent *event) { TimelineEvent *curEvent = _events; for (uint16 eventIndex = 0; eventIndex < _eventMaxCount; eventIndex++, curEvent++) { if ((curEvent->_type >= k5_TMEventTypeCorridor) && (curEvent->_type <= k10_TMEventTypeDoor)) { - if ((event->_mapTime == curEvent->_mapTime) && (event->getMapXY() == curEvent->getMapXY()) && ((curEvent->_type != k6_TMEventTypeWall) || (curEvent->_C.A._cell == event->_C.A._cell))) { - curEvent->_C.A._effect = event->_C.A._effect; + if ((event->_mapTime == curEvent->_mapTime) && (event->getMapXY() == curEvent->getMapXY()) && ((curEvent->_type != k6_TMEventTypeWall) || (curEvent->_Cu.A._cell == event->_Cu.A._cell))) { + curEvent->_Cu.A._effect = event->_Cu.A._effect; return eventIndex; } continue; } else if ((curEvent->_type == k1_TMEventTypeDoorAnimation) && (event->_mapTime == curEvent->_mapTime) && (event->getMapXY() == curEvent->getMapXY())) { - if (event->_C.A._effect == k2_SensorEffToggle) - event->_C.A._effect = 1 - curEvent->_C.A._effect; + if (event->_Cu.A._effect == k2_SensorEffToggle) + event->_Cu.A._effect = 1 - curEvent->_Cu.A._effect; deleteEvent(eventIndex); break; @@ -221,13 +221,13 @@ uint16 Timeline::addEventGetEventIndex(TimelineEvent *event) { for (uint16 eventIndex = 0; eventIndex < _eventMaxCount; eventIndex++, curEvent++) { if ((event->_mapTime == curEvent->_mapTime) && (event->getMapXY() == curEvent->getMapXY())) { if (curEvent->_type == k10_TMEventTypeDoor) { - if (curEvent->_C.A._effect == k2_SensorEffToggle) - curEvent->_C.A._effect = 1 - event->_C.A._effect; + if (curEvent->_Cu.A._effect == k2_SensorEffToggle) + curEvent->_Cu.A._effect = 1 - event->_Cu.A._effect; return eventIndex; } if (curEvent->_type == k1_TMEventTypeDoorAnimation) { - curEvent->_C.A._effect = event->_C.A._effect; + curEvent->_Cu.A._effect = event->_Cu.A._effect; return eventIndex; } } @@ -262,7 +262,7 @@ void Timeline::processTimeline() { _vm->_dungeonMan->setCurrentMap(getMap(newEvent._mapTime)); uint16 curEventType = newEvent._type; if ((curEventType > (k29_TMEventTypeGroupReactionDangerOnSquare - 1)) && (curEventType < (k41_TMEventTypeUpdateBehaviour_3 + 1))) - _vm->_groupMan->processEvents29to41(newEvent._Bu._location._mapX, newEvent._Bu._location._mapY, curEventType, newEvent._C._ticks); + _vm->_groupMan->processEvents29to41(newEvent._Bu._location._mapX, newEvent._Bu._location._mapY, curEventType, newEvent._Cu._ticks); else { switch (curEventType) { case k48_TMEventTypeMoveProjectileIgnoreImpacts: @@ -304,12 +304,12 @@ void Timeline::processTimeline() { procesEventEnableGroupGenerator(curEvent); break; case k20_TMEventTypePlaySound: - _vm->_sound->requestPlay(newEvent._C._soundIndex, newEvent._Bu._location._mapX, newEvent._Bu._location._mapY, k1_soundModePlayIfPrioritized); + _vm->_sound->requestPlay(newEvent._Cu._soundIndex, newEvent._Bu._location._mapX, newEvent._Bu._location._mapY, k1_soundModePlayIfPrioritized); break; case k24_TMEventTypeRemoveFluxcage: if (!_vm->_gameWon) { - _vm->_dungeonMan->unlinkThingFromList(Thing(newEvent._C._slot), Thing(0), newEvent._Bu._location._mapX, newEvent._Bu._location._mapY); - curEvent = (TimelineEvent *)_vm->_dungeonMan->getThingData(Thing(newEvent._C._slot)); + _vm->_dungeonMan->unlinkThingFromList(Thing(newEvent._Cu._slot), Thing(0), newEvent._Bu._location._mapX, newEvent._Bu._location._mapY); + curEvent = (TimelineEvent *)_vm->_dungeonMan->getThingData(Thing(newEvent._Cu._slot)); ((Explosion *)curEvent)->setNextThing(Thing::_none); } break; @@ -388,7 +388,7 @@ void Timeline::processEventDoorAnimation(TimelineEvent *event) { return; event->_mapTime++; - int16 sensorEffect = event->_C.A._effect; + int16 sensorEffect = event->_Cu.A._effect; if (sensorEffect == k1_SensorEffClear) { Door *curDoor = (Door *)_vm->_dungeonMan->getSquareFirstThingData(mapX, mapY); bool verticalDoorFl = curDoor->opensVertically(); @@ -447,7 +447,7 @@ void Timeline::processEventSquareFakewall(TimelineEvent *event) { uint16 mapX = event->_Bu._location._mapX; uint16 mapY = event->_Bu._location._mapY; byte *curSquare = &_vm->_dungeonMan->_currMapData[mapX][mapY]; - int16 effect = event->_C.A._effect; + int16 effect = event->_Cu.A._effect; if (effect == k2_SensorEffToggle) effect = getFlag(*curSquare, k0x0004_FakeWallOpen) ? k1_SensorEffClear : k0_SensorEffSet; @@ -477,9 +477,9 @@ void Timeline::processEventSquareDoor(TimelineEvent *event) { if (doorState == k5_doorState_DESTROYED) return; - if (event->_C.A._effect == k2_SensorEffToggle) - event->_C.A._effect = (doorState == k0_doorState_OPEN) ? k1_SensorEffClear : k0_SensorEffSet; - else if (event->_C.A._effect == k0_SensorEffSet) { + if (event->_Cu.A._effect == k2_SensorEffToggle) + event->_Cu.A._effect = (doorState == k0_doorState_OPEN) ? k1_SensorEffClear : k0_SensorEffSet; + else if (event->_Cu.A._effect == k0_SensorEffSet) { if ((doorState == k0_doorState_OPEN) || (doorState == k4_doorState_CLOSED)) return; } @@ -492,10 +492,10 @@ void Timeline::processEventSquarePit(TimelineEvent *event) { uint16 mapY = event->_Bu._location._mapY; byte *square = &_vm->_dungeonMan->_currMapData[mapX][mapY]; - if (event->_C.A._effect == k2_SensorEffToggle) - event->_C.A._effect = getFlag(*square, k0x0008_PitOpen) ? k1_SensorEffClear : k0_SensorEffSet; + if (event->_Cu.A._effect == k2_SensorEffToggle) + event->_Cu.A._effect = getFlag(*square, k0x0008_PitOpen) ? k1_SensorEffClear : k0_SensorEffSet; - if (event->_C.A._effect == k0_SensorEffSet) { + if (event->_Cu.A._effect == k0_SensorEffSet) { setFlag(*square, k0x0008_PitOpen); moveTeleporterOrPitSquareThings(mapX, mapY); } else @@ -534,18 +534,18 @@ void Timeline::moveTeleporterOrPitSquareThings(uint16 mapX, uint16 mapY) { Projectile *projectile = (Projectile *)_vm->_dungeonMan->getThingData(curThing); TimelineEvent *newEvent; newEvent = &_events[projectile->_eventIndex]; - newEvent->_C._projectile.setMapX(_vm->_moveSens->_moveResultMapX); - newEvent->_C._projectile.setMapY(_vm->_moveSens->_moveResultMapY); - newEvent->_C._projectile.setDir((Direction)_vm->_moveSens->_moveResultDir); + newEvent->_Cu._projectile.setMapX(_vm->_moveSens->_moveResultMapX); + newEvent->_Cu._projectile.setMapY(_vm->_moveSens->_moveResultMapY); + newEvent->_Cu._projectile.setDir((Direction)_vm->_moveSens->_moveResultDir); newEvent->_Bu._slot = thingWithNewCell(curThing, _vm->_moveSens->_moveResultCell).toUint16(); M31_setMap(newEvent->_mapTime, _vm->_moveSens->_moveResultMapIndex); } else if (curThingType == k15_ExplosionThingType) { TimelineEvent *newEvent = _events; for (uint16 i = 0; i < _eventMaxCount; newEvent++, i++) { - if ((newEvent->_type == k25_TMEventTypeExplosion) && (newEvent->_C._slot == curThing.toUint16())) { /* BUG0_23 A Fluxcage explosion remains on a square forever. If you open a pit or teleporter on a square where there is a Fluxcage explosion, the Fluxcage explosion is moved but the associated event is not updated (because Fluxcage explosions do not use k25_TMEventTypeExplosion but rather k24_TMEventTypeRemoveFluxcage) causing the Fluxcage explosion to remain in the dungeon forever on its destination square. When the k24_TMEventTypeRemoveFluxcage expires the explosion thing is not removed, but it is marked as unused. Consequently, any objects placed on the Fluxcage square after it was moved but before it expires become orphans upon expiration. After expiration, any object placed on the fluxcage square is cloned when picked up */ + if ((newEvent->_type == k25_TMEventTypeExplosion) && (newEvent->_Cu._slot == curThing.toUint16())) { /* BUG0_23 A Fluxcage explosion remains on a square forever. If you open a pit or teleporter on a square where there is a Fluxcage explosion, the Fluxcage explosion is moved but the associated event is not updated (because Fluxcage explosions do not use k25_TMEventTypeExplosion but rather k24_TMEventTypeRemoveFluxcage) causing the Fluxcage explosion to remain in the dungeon forever on its destination square. When the k24_TMEventTypeRemoveFluxcage expires the explosion thing is not removed, but it is marked as unused. Consequently, any objects placed on the Fluxcage square after it was moved but before it expires become orphans upon expiration. After expiration, any object placed on the fluxcage square is cloned when picked up */ newEvent->_Bu._location._mapX = _vm->_moveSens->_moveResultMapX; newEvent->_Bu._location._mapY = _vm->_moveSens->_moveResultMapY; - newEvent->_C._slot = thingWithNewCell(curThing, _vm->_moveSens->_moveResultCell).toUint16(); + newEvent->_Cu._slot = thingWithNewCell(curThing, _vm->_moveSens->_moveResultCell).toUint16(); M31_setMap(newEvent->_mapTime, _vm->_moveSens->_moveResultMapIndex); } } @@ -559,10 +559,10 @@ void Timeline::processEventSquareTeleporter(TimelineEvent *event) { uint16 mapY = event->_Bu._location._mapY; byte *curSquare = &_vm->_dungeonMan->_currMapData[mapX][mapY]; - if (event->_C.A._effect == k2_SensorEffToggle) - event->_C.A._effect = getFlag(*curSquare, k0x0008_TeleporterOpen) ? k1_SensorEffClear : k0_SensorEffSet; + if (event->_Cu.A._effect == k2_SensorEffToggle) + event->_Cu.A._effect = getFlag(*curSquare, k0x0008_TeleporterOpen) ? k1_SensorEffClear : k0_SensorEffSet; - if (event->_C.A._effect == k0_SensorEffSet) { + if (event->_Cu.A._effect == k0_SensorEffSet) { setFlag(*curSquare, k0x0008_TeleporterOpen); moveTeleporterOrPitSquareThings(mapX, mapY); } else @@ -573,22 +573,22 @@ void Timeline::processEventSquareWall(TimelineEvent *event) { int16 mapX = event->_Bu._location._mapX; int16 mapY = event->_Bu._location._mapY; Thing curThing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY); - uint16 curCell = event->_C.A._cell; + uint16 curCell = event->_Cu.A._cell; while (curThing != Thing::_endOfList) { int16 curThingType = curThing.getType(); - if ((curThingType == k2_TextstringType) && (curThing.getCell() == event->_C.A._cell)) { + if ((curThingType == k2_TextstringType) && (curThing.getCell() == event->_Cu.A._cell)) { TextString *textString = (TextString *)_vm->_dungeonMan->getThingData(curThing); - if (event->_C.A._effect == k2_SensorEffToggle) + if (event->_Cu.A._effect == k2_SensorEffToggle) textString->setVisible(!textString->isVisible()); else - textString->setVisible(event->_C.A._effect == k0_SensorEffSet); + textString->setVisible(event->_Cu.A._effect == k0_SensorEffSet); } else if (curThingType == k3_SensorThingType) { Sensor *curThingSensor = (Sensor *)_vm->_dungeonMan->getThingData(curThing); uint16 curSensorType = curThingSensor->getType(); uint16 curSensorData = curThingSensor->getData(); if (curSensorType == k6_SensorWallCountdown) { if (curSensorData > 0) { - if (event->_C.A._effect == k0_SensorEffSet) { + if (event->_Cu.A._effect == k0_SensorEffSet) { if (curSensorData < 511) curSensorData++; } else @@ -602,13 +602,13 @@ void Timeline::processEventSquareWall(TimelineEvent *event) { _vm->_moveSens->triggerEffect(curThingSensor, curThingSensor->getAttrEffectA(), mapX, mapY, curCell); } } else if (curSensorType == k5_SensorWallAndOrGate) { - int16 bitMask = 1 << (event->_C.A._cell); - if (event->_C.A._effect == k2_SensorEffToggle) { + int16 bitMask = 1 << (event->_Cu.A._cell); + if (event->_Cu.A._effect == k2_SensorEffToggle) { if (getFlag(curSensorData, bitMask)) clearFlag(curSensorData, bitMask); else setFlag(curSensorData, bitMask); - } else if (event->_C.A._effect) + } else if (event->_Cu.A._effect) clearFlag(curSensorData, bitMask); else setFlag(curSensorData, bitMask); @@ -619,7 +619,7 @@ void Timeline::processEventSquareWall(TimelineEvent *event) { _vm->_moveSens->triggerEffect(curThingSensor, triggerSetEffect ? k0_SensorEffSet : k1_SensorEffClear, mapX, mapY, curCell); else if (triggerSetEffect) _vm->_moveSens->triggerEffect(curThingSensor, curThingSensor->getAttrEffectA(), mapX, mapY, curCell); - } else if ((((curSensorType >= k7_SensorWallSingleProjLauncherNewObj) && (curSensorType <= k10_SensorWallDoubleProjLauncherExplosion)) || (curSensorType == k14_SensorWallSingleProjLauncherSquareObj) || (curSensorType == k15_SensorWallDoubleProjLauncherSquareObj)) && (curThing.getCell() == event->_C.A._cell)) { + } else if ((((curSensorType >= k7_SensorWallSingleProjLauncherNewObj) && (curSensorType <= k10_SensorWallDoubleProjLauncherExplosion)) || (curSensorType == k14_SensorWallSingleProjLauncherSquareObj) || (curSensorType == k15_SensorWallDoubleProjLauncherSquareObj)) && (curThing.getCell() == event->_Cu.A._cell)) { triggerProjectileLauncher(curThingSensor, event); if (curThingSensor->getAttrOnlyOnce()) curThingSensor->setTypeDisabled(); @@ -638,7 +638,7 @@ void Timeline::processEventSquareWall(TimelineEvent *event) { void Timeline::triggerProjectileLauncher(Sensor *sensor, TimelineEvent *event) { int16 mapX = event->_Bu._location._mapX; int16 mapY = event->_Bu._location._mapY; - uint16 cell = event->_C.A._cell; + uint16 cell = event->_Cu.A._cell; uint16 projectileCell = returnOppositeDir((Direction)cell); int16 sensorType = sensor->getType(); int16 sensorData = sensor->getData(); @@ -709,10 +709,10 @@ void Timeline::processEventSquareCorridor(TimelineEvent *event) { if (curThingType == k2_TextstringType) { TextString *textString = (TextString *)_vm->_dungeonMan->getThingData(curThing); bool textCurrentlyVisible = textString->isVisible(); - if (event->_C.A._effect == k2_SensorEffToggle) + if (event->_Cu.A._effect == k2_SensorEffToggle) textString->setVisible(!textCurrentlyVisible); else - textString->setVisible((event->_C.A._effect == k0_SensorEffSet)); + textString->setVisible((event->_Cu.A._effect == k0_SensorEffSet)); if (!textCurrentlyVisible && textString->isVisible() && (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (mapX == _vm->_dungeonMan->_partyMapX) && (mapY == _vm->_dungeonMan->_partyMapY)) { _vm->_dungeonMan->decodeText(_vm->_stringBuildBuffer, curThing, k1_TextTypeMessage); @@ -770,11 +770,11 @@ T0252001: if (event->_type == k61_TMEventTypeMoveGroupAudible) _vm->_sound->requestPlay(k17_soundBUZZ, mapX, mapY, k1_soundModePlayIfPrioritized); - _vm->_moveSens->getMoveResult(Thing(event->_C._slot), kM1_MapXNotOnASquare, 0, mapX, mapY); + _vm->_moveSens->getMoveResult(Thing(event->_Cu._slot), kM1_MapXNotOnASquare, 0, mapX, mapY); } else { if (!randomDirectionMoveRetried) { randomDirectionMoveRetried = true; - Group *group = (Group *)_vm->_dungeonMan->getThingData(Thing(event->_C._slot)); + Group *group = (Group *)_vm->_dungeonMan->getThingData(Thing(event->_Cu._slot)); if ((group->_type == k23_CreatureTypeLordChaos) && !_vm->getRandomNumber(4)) { switch (_vm->getRandomNumber(4)) { case 0: @@ -913,16 +913,16 @@ void Timeline::refreshAllChampionStatusBoxes() { void Timeline::processEventViAltarRebirth(TimelineEvent *event) { int16 mapX = event->_Bu._location._mapX; int16 mapY = event->_Bu._location._mapY; - uint16 cell = event->_C.A._cell; + uint16 cell = event->_Cu.A._cell; uint16 championIndex = event->_priority; - uint16 rebirthStep = event->_C.A._effect; + uint16 rebirthStep = event->_Cu.A._effect; switch (rebirthStep) { /* Rebirth is a 3 steps process (Step 2 -> Step 1 -> Step 0). Step is stored in the Effect value of the event */ case 2: _vm->_projexpl->createExplosion(Thing::_explRebirthStep1, 0, mapX, mapY, cell); event->_mapTime += 5; T0255002: rebirthStep--; - event->_C.A._effect = rebirthStep; + event->_Cu.A._effect = rebirthStep; addEventGetEventIndex(event); break; case 1: { @@ -957,8 +957,8 @@ void Timeline::saveEventsPart(Common::OutSaveFile *file) { file->writeByte(event->_priority); file->writeByte(event->_Bu._location._mapX); // writing bytes of the union I think should preserve the union's identity file->writeByte(event->_Bu._location._mapY); - file->writeUint16BE(event->_C.A._cell); // writing bytes of the union I think should preserve the union's identity - file->writeUint16BE(event->_C.A._effect); + file->writeUint16BE(event->_Cu.A._cell); // writing bytes of the union I think should preserve the union's identity + file->writeUint16BE(event->_Cu.A._effect); } } @@ -975,8 +975,8 @@ void Timeline::loadEventsPart(Common::InSaveFile *file) { event->_priority = file->readByte(); event->_Bu._location._mapX = file->readByte(); event->_Bu._location._mapY = file->readByte(); - event->_C.A._cell = file->readUint16BE(); - event->_C.A._effect = file->readUint16BE(); + event->_Cu.A._cell = file->readUint16BE(); + event->_Cu.A._effect = file->readUint16BE(); } } diff --git a/engines/dm/timeline.h b/engines/dm/timeline.h index 168ae3f04c..22e563d853 100644 --- a/engines/dm/timeline.h +++ b/engines/dm/timeline.h @@ -146,7 +146,7 @@ public: byte _ticks; }; - C_uionTimelineEvent _C; + C_uionTimelineEvent _Cu; }; // @ EVENT class Timeline { |