diff options
author | Strangerke | 2016-08-28 00:33:32 +0200 |
---|---|---|
committer | Strangerke | 2016-08-28 00:33:32 +0200 |
commit | 8c9eed7bac935bf901c5fde5f9ed0f2e4e11daa4 (patch) | |
tree | d5de837ef1807ca1c81fbd08b6a05d2763f95f17 | |
parent | 361722d459b1afff6b12ba722420e86703b06dea (diff) | |
download | scummvm-rg350-8c9eed7bac935bf901c5fde5f9ed0f2e4e11daa4.tar.gz scummvm-rg350-8c9eed7bac935bf901c5fde5f9ed0f2e4e11daa4.tar.bz2 scummvm-rg350-8c9eed7bac935bf901c5fde5f9ed0f2e4e11daa4.zip |
DM: Some renaming
-rw-r--r-- | engines/dm/dungeonman.cpp | 6 | ||||
-rw-r--r-- | engines/dm/eventman.cpp | 3 | ||||
-rw-r--r-- | engines/dm/gfx.cpp | 17 | ||||
-rw-r--r-- | engines/dm/group.cpp | 91 |
4 files changed, 52 insertions, 65 deletions
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index eff761a825..f41ccf2f19 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -954,7 +954,8 @@ T0172010_ClosedFakeWall: curThing = getNextThing(curThing); } - if (AL0307_uc_FootprintsAllowed && (AL0307_uc_ScentOrdinal = _vm->_championMan->getScentOrdinal(mapX, mapY)) && (--AL0307_uc_ScentOrdinal >= _vm->_championMan->_party._firstScentIndex) && (AL0307_uc_ScentOrdinal < _vm->_championMan->_party._lastScentIndex)) + AL0307_uc_ScentOrdinal = _vm->_championMan->getScentOrdinal(mapX, mapY); + if (AL0307_uc_FootprintsAllowed && (AL0307_uc_ScentOrdinal) && (--AL0307_uc_ScentOrdinal >= _vm->_championMan->_party._firstScentIndex) && (AL0307_uc_ScentOrdinal < _vm->_championMan->_party._lastScentIndex)) setFlag(aspectArray[k4_FloorOrnOrdAspect], k0x8000_FootprintsAspect); break; @@ -978,7 +979,8 @@ T0172010_ClosedFakeWall: while ((curThing != Thing::_endOfList) && (curThing.getType() <= k3_SensorThingType)) curThing = getNextThing(curThing); - if (AL0307_uc_FootprintsAllowed && (AL0307_uc_ScentOrdinal = _vm->_championMan->getScentOrdinal(mapX, mapY)) && (--AL0307_uc_ScentOrdinal >= _vm->_championMan->_party._firstScentIndex) && (AL0307_uc_ScentOrdinal < _vm->_championMan->_party._lastScentIndex)) + AL0307_uc_ScentOrdinal = _vm->_championMan->getScentOrdinal(mapX, mapY); + if (AL0307_uc_FootprintsAllowed && (AL0307_uc_ScentOrdinal) && (--AL0307_uc_ScentOrdinal >= _vm->_championMan->_party._firstScentIndex) && (AL0307_uc_ScentOrdinal < _vm->_championMan->_party._lastScentIndex)) setFlag(aspectArray[k4_FloorOrnOrdAspect], k0x8000_FootprintsAspect); break; } diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index c267b735e2..01f6567b18 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -1559,7 +1559,8 @@ void EventManager::commandProcessTypes101To108_clickInSpellSymbolsArea(CommandTy Box(277, 289, 51, 61), /* Symbol 4 */ Box(291, 303, 51, 61), /* Symbol 5 */ Box(305, 317, 51, 61), /* Symbol 6 */ - Box(305, 318, 63, 73)}; /* Delete */ + Box(305, 318, 63, 73) /* Delete */ + }; if (cmdType == k108_CommandClickInSpeallAreaCastSpell) { if (_vm->_championMan->_champions[_vm->_championMan->_magicCasterChampionIndex]._symbols[0] == '\0') diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index 296ee96cf1..264fa29e8e 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -749,7 +749,8 @@ void DisplayMan::drawDoorButton(int16 doorButtonOrdinal, int16 viewDoorButtonInd _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._y1 = coordSetRedEagle[2]; _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._y2 = coordSetRedEagle[3]; } else { - if (!isDerivedBitmapInCache(doorButtonOrdinal = k102_DerivedBitmapFirstDoorButton + (doorButtonOrdinal * 2) + ((!viewDoorButtonIndex) ? 0 : viewDoorButtonIndex - 1))) { + doorButtonOrdinal = k102_DerivedBitmapFirstDoorButton + (doorButtonOrdinal * 2) + ((!viewDoorButtonIndex) ? 0 : viewDoorButtonIndex - 1); + if (!isDerivedBitmapInCache(doorButtonOrdinal)) { uint16 *coordSetBlueGoat = doorButtonCoordSets[coordSet][k3_viewDoorButton_D1C]; byte *bitmapNative = getNativeBitmapOrGraphic(nativeBitmapIndex); blitToBitmapShrinkWithPalChange(bitmapNative, getDerivedBitmap(doorButtonOrdinal), @@ -776,7 +777,7 @@ void DisplayMan::viewportSetPalette(uint16* middleScreenPalette, uint16* topAndB } void DisplayMan::viewportBlitToScreen() { - Box box(0, 223, 33, 33 + 135); + Box box(0, 223, 33, 168); blitToBitmap(_bitmapViewport, _bitmapScreen, box, 0, 0, k112_byteWidthViewport, k160_byteWidthScreen, kM1_ColorNoTransparency, k136_heightViewport, k200_heightScreen); @@ -863,11 +864,9 @@ void DisplayMan::blitBoxFilledWithMaskedBitmap(byte *src, byte *dest, byte *mask int16 lastUnitIndex, int16 firstUnitIndex, int16 destByteWidth, Color transparent, int16 xPos, int16 yPos, int16 destHeight, int16 height2) { // make sure to take care of inclusive boundaries, color can have 0x8000 flag to not use mask - warning("STUB: f133_blitBoxFilledWithMaskedBitmap"); + warning("STUB: blitBoxFilledWithMaskedBitmap"); } - - void DisplayMan::flipBitmapHorizontal(byte *bitmap, uint16 byteWidth, uint16 height) { uint16 width = byteWidth * 2; for (uint16 y = 0; y < height; ++y) { @@ -2208,8 +2207,8 @@ void DisplayMan::loadWallSet(WallSet set) { } void DisplayMan::loadCurrentMapGraphics() { - static Box BoxWallD3LCR = Box(0, 115, 0, 50); // @ G0161_s_Graphic558_Box_WallBitmap_D3LCR - static Box BoxWallD2LCR = Box(0, 135, 0, 70); // @ G0162_s_Graphic558_Box_WallBitmap_D2LCR + static Box boxWallD3LCR = Box(0, 115, 0, 50); // @ G0161_s_Graphic558_Box_WallBitmap_D3LCR + static Box boxWallD2LCR = Box(0, 135, 0, 70); // @ G0162_s_Graphic558_Box_WallBitmap_D2LCR static byte doorOrnCoordIndices[12] = { // @ G0196_auc_Graphic558_DoorOrnamentCoordinateSetIndices 0, /* Door Ornament #00 Square Grid */ 1, /* Door Ornament #01 Iron Bars */ @@ -2311,12 +2310,12 @@ void DisplayMan::loadCurrentMapGraphics() { copyBitmapAndFlipHorizontal(_bitmapWallD3LCRNative = _bitmapWallSetD3LCR, _tmpBitmap, _frameWalls163[k0_ViewSquare_D3C]._srcByteWidth, _frameWalls163[k0_ViewSquare_D3C]._srcHeight); fillBitmap(_bitmapWallD3LCRFlipped, k10_ColorFlesh, 64, 51); - blitToBitmap(_tmpBitmap, _bitmapWallD3LCRFlipped, BoxWallD3LCR, 11, 0, 64, 64, kM1_ColorNoTransparency, 51, 51); + blitToBitmap(_tmpBitmap, _bitmapWallD3LCRFlipped, boxWallD3LCR, 11, 0, 64, 64, kM1_ColorNoTransparency, 51, 51); copyBitmapAndFlipHorizontal(_bitmapWallD2LCRNative = _bitmapWallSetD2LCR, _tmpBitmap, _frameWalls163[k3_ViewSquare_D2C]._srcByteWidth, _frameWalls163[k3_ViewSquare_D2C]._srcHeight); fillBitmap(_bitmapWallD2LCRFlipped, k10_ColorFlesh, 72, 71); - blitToBitmap(_tmpBitmap, _bitmapWallD2LCRFlipped, BoxWallD2LCR, 8, 0, 72, 72, kM1_ColorNoTransparency, 71, 71); + blitToBitmap(_tmpBitmap, _bitmapWallD2LCRFlipped, boxWallD2LCR, 8, 0, 72, 72, kM1_ColorNoTransparency, 71, 71); copyBitmapAndFlipHorizontal(_bitmapWallD1LCRNative = _bitmapWallSetD1LCR, _bitmapWallD1LCRFlipped, _frameWalls163[k6_ViewSquare_D1C]._srcByteWidth, _frameWalls163[k6_ViewSquare_D1C]._srcHeight); diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp index 519a62e564..6c119464ae 100644 --- a/engines/dm/group.cpp +++ b/engines/dm/group.cpp @@ -291,9 +291,6 @@ void GroupMan::dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int } int16 GroupMan::getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY) { -#define AP0483_i_PrimaryDirection srcMapX - int16 L0556_i_Direction; - if (srcMapX == destMapX) { _vm->_projexpl->_secondaryDirToOrFromParty = (_vm->getRandomNumber(65536) & 0x0002) + 1; /* Resulting direction may be 1 or 3 (East or West) */ if (srcMapY > destMapY) { @@ -308,75 +305,65 @@ int16 GroupMan::getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 srcMapY } return kDirEast; } - L0556_i_Direction = kDirNorth; + + int16 curDirection = kDirNorth; for (;;) { - if (isDestVisibleFromSource(L0556_i_Direction, srcMapX, srcMapY, destMapX, destMapY)) { - if (!isDestVisibleFromSource(_vm->_projexpl->_secondaryDirToOrFromParty = returnNextVal(L0556_i_Direction), srcMapX, srcMapY, destMapX, destMapY)) { - if ((L0556_i_Direction != kDirNorth) || !isDestVisibleFromSource(_vm->_projexpl->_secondaryDirToOrFromParty = returnPrevVal(L0556_i_Direction), srcMapX, srcMapY, destMapX, destMapY)) { - _vm->_projexpl->_secondaryDirToOrFromParty = returnNextVal((_vm->getRandomNumber(65536) & 0x0002) + L0556_i_Direction); - return L0556_i_Direction; + if (isDestVisibleFromSource(curDirection, srcMapX, srcMapY, destMapX, destMapY)) { + _vm->_projexpl->_secondaryDirToOrFromParty = returnNextVal(curDirection); + if (!isDestVisibleFromSource(_vm->_projexpl->_secondaryDirToOrFromParty, srcMapX, srcMapY, destMapX, destMapY)) { + _vm->_projexpl->_secondaryDirToOrFromParty = returnPrevVal(curDirection); + if ((curDirection != kDirNorth) || !isDestVisibleFromSource(_vm->_projexpl->_secondaryDirToOrFromParty, srcMapX, srcMapY, destMapX, destMapY)) { + _vm->_projexpl->_secondaryDirToOrFromParty = returnNextVal((_vm->getRandomNumber(65536) & 0x0002) + curDirection); + return curDirection; } } if (_vm->getRandomNumber(2)) { - AP0483_i_PrimaryDirection = _vm->_projexpl->_secondaryDirToOrFromParty; - _vm->_projexpl->_secondaryDirToOrFromParty = L0556_i_Direction; - return AP0483_i_PrimaryDirection; + int16 primaryDirection = _vm->_projexpl->_secondaryDirToOrFromParty; + _vm->_projexpl->_secondaryDirToOrFromParty = curDirection; + return primaryDirection; } - return L0556_i_Direction; + return curDirection; } - L0556_i_Direction++; + curDirection++; } } bool GroupMan::isDestVisibleFromSource(uint16 dir, int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY) { - int L1637_i_Temp; - switch (dir) { /* If direction is not 'West' then swap variables so that the same test as for west can be applied */ case kDirSouth: - L1637_i_Temp = srcMapX; - srcMapX = destMapY; - destMapY = L1637_i_Temp; - L1637_i_Temp = destMapX; - destMapX = srcMapY; - srcMapY = L1637_i_Temp; + SWAP(srcMapX, destMapY); + SWAP(destMapX, srcMapY); break; case kDirEast: - L1637_i_Temp = srcMapX; - srcMapX = destMapX; - destMapX = L1637_i_Temp; - L1637_i_Temp = destMapY; - destMapY = srcMapY; - srcMapY = L1637_i_Temp; + SWAP(srcMapX, destMapX); + SWAP(destMapY, srcMapY); break; case kDirNorth: - L1637_i_Temp = srcMapX; - srcMapX = srcMapY; - srcMapY = L1637_i_Temp; - L1637_i_Temp = destMapX; - destMapX = destMapY; - destMapY = L1637_i_Temp; + SWAP(srcMapX, srcMapY); + SWAP(destMapX, destMapY); + break; } return ((srcMapX -= (destMapX - 1)) > 0) && ((((srcMapY -= destMapY) < 0) ? -srcMapY : srcMapY) <= srcMapX); } bool GroupMan::groupIsDoorDestoryedByAttack(uint16 mapX, uint16 mapY, int16 attack, bool magicAttack, int16 ticks) { - Door *L0573_ps_Door = (Door *)_vm->_dungeonMan->getSquareFirstThingData(mapX, mapY); - if ((magicAttack && !L0573_ps_Door->isMagicDestructible()) || (!magicAttack && !L0573_ps_Door->isMeleeDestructible())) { + Door *curDoor = (Door *)_vm->_dungeonMan->getSquareFirstThingData(mapX, mapY); + if ((magicAttack && !curDoor->isMagicDestructible()) || (!magicAttack && !curDoor->isMeleeDestructible())) { return false; } - if (attack >= _vm->_dungeonMan->_currMapDoorInfo[L0573_ps_Door->getType()]._defense) { - byte *L0574_puc_Square = &_vm->_dungeonMan->_currMapData[mapX][mapY]; - if (Square(*L0574_puc_Square).getDoorState() == k4_doorState_CLOSED) { + if (attack >= _vm->_dungeonMan->_currMapDoorInfo[curDoor->getType()]._defense) { + byte *curSquare = &_vm->_dungeonMan->_currMapData[mapX][mapY]; + if (Square(*curSquare).getDoorState() == k4_doorState_CLOSED) { if (ticks) { - TimelineEvent L0575_s_Event; - setMapAndTime(L0575_s_Event._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + ticks); - L0575_s_Event._type = k2_TMEventTypeDoorDestruction; - L0575_s_Event._priority = 0; - L0575_s_Event._B._location._mapX = mapX; - L0575_s_Event._B._location._mapY = mapY; - _vm->_timeline->addEventGetEventIndex(&L0575_s_Event); + TimelineEvent newEvent; + setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + ticks); + newEvent._type = k2_TMEventTypeDoorDestruction; + newEvent._priority = 0; + newEvent._B._location._mapX = mapX; + newEvent._B._location._mapY = mapY; + _vm->_timeline->addEventGetEventIndex(&newEvent); } else { - ((Square *)L0574_puc_Square)->setDoorState(k5_doorState_DESTROYED); + ((Square *)curSquare)->setDoorState(k5_doorState_DESTROYED); } return true; } @@ -385,13 +372,11 @@ bool GroupMan::groupIsDoorDestoryedByAttack(uint16 mapX, uint16 mapY, int16 atta } Thing GroupMan::groupGetThing(int16 mapX, int16 mapY) { - Thing L0317_T_Thing; - - L0317_T_Thing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY); - while ((L0317_T_Thing != Thing::_endOfList) && ((L0317_T_Thing).getType() != k4_GroupThingType)) { - L0317_T_Thing = _vm->_dungeonMan->getNextThing(L0317_T_Thing); + Thing curThing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY); + while ((curThing != Thing::_endOfList) && ((curThing).getType() != k4_GroupThingType)) { + curThing = _vm->_dungeonMan->getNextThing(curThing); } - return L0317_T_Thing; + return curThing; } int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex, int16 mapX, int16 mapY, int16 damage, bool notMoving) { |