aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBendegúz Nagy2016-08-26 22:50:21 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commitdce7465ad53fcf3179b47099e873b7d2b858b1d1 (patch)
tree29c731d82b6380c2f4225aee50c6e99b08de3534 /engines
parent3447af80f8a48413958f64e60890138c9dbe12da (diff)
downloadscummvm-rg350-dce7465ad53fcf3179b47099e873b7d2b858b1d1.tar.gz
scummvm-rg350-dce7465ad53fcf3179b47099e873b7d2b858b1d1.tar.bz2
scummvm-rg350-dce7465ad53fcf3179b47099e873b7d2b858b1d1.zip
DM: Silent some more CppCheck warnings
Diffstat (limited to 'engines')
-rw-r--r--engines/dm/dungeonman.cpp229
-rw-r--r--engines/dm/eventman.cpp4
-rw-r--r--engines/dm/gfx.cpp32
-rw-r--r--engines/dm/group.h2
-rw-r--r--engines/dm/projexpl.h2
-rw-r--r--engines/dm/timeline.h2
6 files changed, 121 insertions, 150 deletions
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index 8a49d957ed..3b009c2e31 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -419,6 +419,8 @@ DungeonMan::~DungeonMan() {
delete[] _g260_dungeonTextData;
delete[] _g279_dungeonMapData;
for (uint16 i = 0; i < 16; ++i) {
+ if (_g284_thingData[i])
+ delete[] _g284_thingData[i][0];
delete[] _g284_thingData[i];
}
}
@@ -651,34 +653,34 @@ void DungeonMan::f434_loadDungeonFile() {
continue;
if (_g284_thingData[thingType]) {
+ delete[] _g284_thingData[thingType][0];
delete[] _g284_thingData[thingType];
}
- _g284_thingData[thingType] = new uint16[_g278_dungeonFileHeader._thingCounts[thingType] * thingStoreWordCount];
+ _g284_thingData[thingType] = new uint16*[_g278_dungeonFileHeader._thingCounts[thingType]];
+ _g284_thingData[thingType][0] = new uint16[_g278_dungeonFileHeader._thingCounts[thingType] * thingStoreWordCount];
+ for (uint16 i = 0; i < _g278_dungeonFileHeader._thingCounts[thingType]; ++i)
+ _g284_thingData[thingType][i] = _g284_thingData[thingType][0] + i * thingStoreWordCount;
if (thingType == k4_GroupThingType) {
- for (uint16 i = 0; i < thingCount; ++i) {
- uint16 *nextSlot = _g284_thingData[thingType] + i *thingStoreWordCount;
+ for (uint16 i = 0; i < thingCount; ++i)
for (uint16 j = 0; j < thingStoreWordCount; ++j) {
if (j == 2 || j == 3)
- nextSlot[j] = dunDataStream.readByte();
+ _g284_thingData[thingType][i][j] = dunDataStream.readByte();
else
- nextSlot[j] = dunDataStream.readUint16BE();
+ _g284_thingData[thingType][i][j] = dunDataStream.readUint16BE();
}
- }
} else if (thingType == k14_ProjectileThingType) {
for (uint16 i = 0; i < thingCount; ++i) {
- uint16 *nextSlot = _g284_thingData[thingType] + i * thingStoreWordCount;
- nextSlot[0] = dunDataStream.readUint16BE();
- nextSlot[1] = dunDataStream.readUint16BE();
- nextSlot[2] = dunDataStream.readByte();
- nextSlot[3] = dunDataStream.readByte();
- nextSlot[4] = dunDataStream.readUint16BE();
+ _g284_thingData[thingType][i][0] = dunDataStream.readUint16BE();
+ _g284_thingData[thingType][i][1] = dunDataStream.readUint16BE();
+ _g284_thingData[thingType][i][2] = dunDataStream.readByte();
+ _g284_thingData[thingType][i][3] = dunDataStream.readByte();
+ _g284_thingData[thingType][i][4] = dunDataStream.readUint16BE();
}
} else {
for (uint16 i = 0; i < thingCount; ++i) {
- uint16 *nextSlot = _g284_thingData[thingType] + i *thingStoreWordCount;
for (uint16 j = 0; j < thingStoreWordCount; ++j)
- nextSlot[j] = dunDataStream.readUint16BE();
+ _g284_thingData[thingType][i][j] = dunDataStream.readUint16BE();
}
}
@@ -686,7 +688,7 @@ void DungeonMan::f434_loadDungeonFile() {
if ((thingType == k4_GroupThingType) || thingType >= k14_ProjectileThingType)
_vm->_timeline->_g369_eventMaxCount += _g278_dungeonFileHeader._thingCounts[thingType];
for (uint16 i = 0; i < g236_AdditionalThingCounts[thingType]; ++i) {
- (_g284_thingData[thingType] + (thingCount + i) * thingStoreWordCount)[0] = Thing::_none.toUint16();
+ _g284_thingData[thingType][thingCount + i][0] = Thing::_none.toUint16();
}
}
}
@@ -755,36 +757,33 @@ void DungeonMan::f174_setCurrentMapAndPartyMap(uint16 mapIndex) {
Square DungeonMan::f151_getSquare(int16 mapX, int16 mapY) {
- int16 L0248_i_Multiple;
-#define AL0248_B_IsMapXInBounds L0248_i_Multiple
-#define AL0248_i_SquareType L0248_i_Multiple
- int16 L0249_i_Multiple;
-#define AL0249_B_IsMapYInBounds L0249_i_Multiple
-#define AL0249_i_SquareType L0249_i_Multiple
-
- AL0249_B_IsMapYInBounds = (mapY >= 0) && (mapY < _vm->_dungeonMan->_g274_currMapHeight);
- if ((AL0248_B_IsMapXInBounds = (mapX >= 0) && (mapX < _vm->_dungeonMan->_g273_currMapWidth)) && AL0249_B_IsMapYInBounds) {
- return Square(_vm->_dungeonMan->_g271_currMapData[mapX][mapY]);
+ bool isInXBounds = (mapX >= 0) && (mapX < _g273_currMapWidth);
+ bool isInYBounds = (mapY >= 0) && (mapY < _g274_currMapHeight);
+
+ if (isInXBounds && isInYBounds)
+ return Square(_g271_currMapData[mapX][mapY]);
+
+
+ Square tmpSquare;
+ if (isInYBounds) {
+ tmpSquare.set(_g271_currMapData[0][mapY]);
+ if (mapX == -1 && (tmpSquare.getType() == k1_CorridorElemType || tmpSquare.getType() == k2_PitElemType))
+ return Square(k0_WallElemType).set(k0x0004_WallEastRandOrnAllowed);
+
+ tmpSquare.set(_g271_currMapData[_g273_currMapWidth - 1][mapY]);
+ if (mapX == _g273_currMapWidth && (tmpSquare.getType() == k1_CorridorElemType || tmpSquare.getType() == k2_PitElemType))
+ return Square(k0_WallElemType).set(k0x0001_WallWestRandOrnAllowed);
+ } else if (isInXBounds) {
+ tmpSquare.set(_g271_currMapData[mapX][0]);
+ if (mapY == -1 && (tmpSquare.getType() == k1_CorridorElemType || tmpSquare.getType() == k2_PitElemType))
+ return Square(k0_WallElemType).set(k0x0002_WallSouthRandOrnAllowed);
+
+ tmpSquare.set(_g271_currMapData[mapX][_g274_currMapHeight - 1]);
+ if (mapY == _g274_currMapHeight && (tmpSquare.getType() == k1_CorridorElemType || tmpSquare.getType() == k2_PitElemType))
+ return Square((k0_WallElemType << 5) | k0x0008_WallNorthRandOrnAllowed);
}
- if (AL0249_B_IsMapYInBounds) {
- if (((mapX == -1) && ((AL0249_i_SquareType = Square(_vm->_dungeonMan->_g271_currMapData[0][mapY]).getType()) == k1_CorridorElemType)) || (AL0249_i_SquareType == k2_ElementTypePit)) {
- return Square(k0_ElementTypeWall, k0x0004_WallEastRandOrnAllowed);
- }
- if (((mapX == _vm->_dungeonMan->_g273_currMapWidth) && ((AL0249_i_SquareType = Square(_vm->_dungeonMan->_g271_currMapData[_vm->_dungeonMan->_g273_currMapWidth - 1][mapY]).getType()) == k1_CorridorElemType)) || (AL0249_i_SquareType == k2_ElementTypePit)) {
- return Square(k0_ElementTypeWall, k0x0001_WallWestRandOrnAllowed);
- }
- } else {
- if (AL0248_B_IsMapXInBounds) {
- if (((mapY == -1) && ((AL0248_i_SquareType = Square(_vm->_dungeonMan->_g271_currMapData[mapX][0]).getType()) == k1_CorridorElemType)) || (AL0248_i_SquareType == k2_ElementTypePit)) {
- return Square(k0_ElementTypeWall, k0x0002_WallSouthRandOrnAllowed);
- }
- if (((mapY == _vm->_dungeonMan->_g274_currMapHeight) && ((AL0248_i_SquareType = Square(_vm->_dungeonMan->_g271_currMapData[mapX][_vm->_dungeonMan->_g274_currMapHeight - 1]).getType()) == k1_CorridorElemType)) || (AL0248_i_SquareType == k2_ElementTypePit)) {
- return Square(k0_ElementTypeWall, k0x0008_WallNorthRandOrnAllowed);
- }
- }
- }
- return Square(k0_ElementTypeWall, 0);
+ return Square(k0_WallElemType);
}
Square DungeonMan::f152_getRelSquare(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) {
@@ -793,23 +792,17 @@ Square DungeonMan::f152_getRelSquare(direction dir, int16 stepsForward, int16 st
}
int16 DungeonMan::f160_getSquareFirstThingIndex(int16 mapX, int16 mapY) {
- uint16 L0260_ui_ThingIndex;
- int16 L0261_i_MapY;
- register unsigned char* L0262_puc_Square;
+ if (mapX < 0 || mapX >= _g273_currMapWidth || mapY < 0 || mapY >= _g274_currMapHeight || !Square(_g271_currMapData[mapX][mapY]).get(k0x0010_ThingListPresent))
+ return -1;
+ int16 y = 0;
+ uint16 index = _g270_currMapColCumulativeSquareFirstThingCount[mapX];
+ byte* square = _g271_currMapData[mapX];
+ while (y++ != mapY)
+ if (Square(*square++).get(k0x0010_ThingListPresent))
+ index++;
- L0262_puc_Square = _vm->_dungeonMan->_g271_currMapData[mapX];
- if ((mapX < 0) || (mapX >= _vm->_dungeonMan->_g273_currMapWidth) || (mapY < 0) || (mapY >= _vm->_dungeonMan->_g274_currMapHeight) || !getFlag(L0262_puc_Square[mapY], k0x0010_ThingListPresent)) {
- return -1;
- }
- L0261_i_MapY = 0;
- L0260_ui_ThingIndex = _vm->_dungeonMan->_g270_currMapColCumulativeSquareFirstThingCount[mapX];
- while (L0261_i_MapY++ != mapY) {
- if (getFlag(*L0262_puc_Square++, k0x0010_ThingListPresent)) {
- L0260_ui_ThingIndex++;
- }
- }
- return L0260_ui_ThingIndex;
+ return index;
}
Thing DungeonMan::f161_getSquareFirstThing(int16 mapX, int16 mapY) {
@@ -966,33 +959,31 @@ T0172049_Footprints:
aspectArray[k1_FirstGroupOrObjectAspect] = thing.toUint16();
}
-void DungeonMan::f171_setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, int16 dir,
+void DungeonMan::f171_setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, direction dir,
int16 mapX, int16 mapY, bool isFakeWall) {
- int16 L0306_i_Multiple;
-#define AL0306_i_RandomWallOrnamentCount L0306_i_Multiple
-#define AL0306_i_SideIndex L0306_i_Multiple
-
-
- AL0306_i_RandomWallOrnamentCount = _vm->_dungeonMan->_g269_currMap->_randWallOrnCount;
- aspectArray[k2_RightWallOrnOrdAspect] = _vm->_dungeonMan->f170_getRandomOrnOrdinal(leftAllowed, AL0306_i_RandomWallOrnamentCount, mapX, ++mapY * (M21_normalizeModulo4(++dir) + 1), 30);
- aspectArray[k3_FrontWallOrnOrdAspect] = _vm->_dungeonMan->f170_getRandomOrnOrdinal(frontAllowed, AL0306_i_RandomWallOrnamentCount, mapX, mapY * (M21_normalizeModulo4(++dir) + 1), 30);
- aspectArray[k4_LeftWallOrnOrdAspect] = _vm->_dungeonMan->f170_getRandomOrnOrdinal(rightAllowed, AL0306_i_RandomWallOrnamentCount, mapX, mapY-- * (M21_normalizeModulo4(++dir) + 1), 30);
- if (isFakeWall || (mapX < 0) || (mapX >= _vm->_dungeonMan->_g273_currMapWidth) || (mapY < 0) || (mapY >= _vm->_dungeonMan->_g274_currMapHeight)) { /* If square is a fake wall or is out of map bounds */
- for (AL0306_i_SideIndex = k2_RightWallOrnOrdAspect; AL0306_i_SideIndex <= k4_LeftWallOrnOrdAspect; AL0306_i_SideIndex++) { /* Loop to remove any random ornament that is an alcove */
- if (_vm->_dungeonMan->f149_isWallOrnAnAlcove(_vm->M1_ordinalToIndex(aspectArray[AL0306_i_SideIndex]))) {
- aspectArray[AL0306_i_SideIndex] = 0;
- }
+ int16 ornCount = _g269_currMap->_randWallOrnCount;
+
+ turnDirRight(dir);
+ aspectArray[k2_RightWallOrnOrdAspect] = f170_getRandomOrnOrdinal(leftAllowed, ornCount, mapX, ++mapY * (dir + 1), 30);
+ turnDirRight(dir);
+ aspectArray[k3_FrontWallOrnOrdAspect] = f170_getRandomOrnOrdinal(frontAllowed, ornCount, mapX, ++mapY * (dir + 1), 30);
+ turnDirRight(dir);
+ aspectArray[k4_LeftWallOrnOrdAspect] = f170_getRandomOrnOrdinal(rightAllowed, ornCount, mapX, ++mapY * (dir + 1), 30);
+
+ if (isFakeWall || mapX < 0 || mapX >= _g273_currMapWidth || mapY < 0 || mapY >= _g274_currMapHeight) {
+ for (uint16 i = k2_RightWallOrnOrdAspect; i <= k4_LeftWallOrnOrdAspect; ++i) {
+ if (f149_isWallOrnAnAlcove(_vm->M1_ordinalToIndex(aspectArray[i])))
+ aspectArray[i] = 0;
}
}
}
int16 DungeonMan::f170_getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo) {
- int16 L0305_i_RandomOrnamentIndex;
-
-
- if (allowed && ((L0305_i_RandomOrnamentIndex = f169_getRandomOrnamentIndex((int16)2000 + (mapX << 5) + mapY, (int16)3000 + (_vm->_dungeonMan->_g272_currMapIndex << (int16)6) + _vm->_dungeonMan->_g273_currMapWidth + _vm->_dungeonMan->_g274_currMapHeight, modulo)) < count)) {
- return _vm->M0_indexToOrdinal(L0305_i_RandomOrnamentIndex);
- }
+ int16 index = (((((2000 + (mapX << 5) + mapY) * 31417) >> 1)
+ + (3000 + (_g272_currMapIndex << 6) + _g273_currMapWidth + _g274_currMapHeight) * 11
+ + _g278_dungeonFileHeader._ornamentRandomSeed) >> 2) % modulo;
+ if (allowed && index < count)
+ return _vm->M0_indexToOrdinal(index);
return 0;
}
@@ -1006,7 +997,7 @@ bool DungeonMan::f149_isWallOrnAnAlcove(int16 wallOrnIndex) {
}
uint16 *DungeonMan::f156_getThingData(Thing thing) {
- return _g284_thingData[thing.getType()] + thing.getIndex() * g235_ThingDataWordCount[thing.getType()];
+ return _g284_thingData[thing.getType()][thing.getIndex()];
}
uint16* DungeonMan::f157_getSquareFirstThingData(int16 mapX, int16 mapY) {
@@ -1014,7 +1005,7 @@ uint16* DungeonMan::f157_getSquareFirstThingData(int16 mapX, int16 mapY) {
}
Thing DungeonMan::f159_getNextThing(Thing thing) {
- return Thing(f156_getThingData(thing)[0]);
+ return Thing(f156_getThingData(thing)[0]); // :)
}
char g255_MessageAndScrollEscReplacementStrings[32][8] = { // @ G0255_aac_Graphic559_MessageAndScrollEscapeReplacementStrings
@@ -1119,10 +1110,10 @@ char g257_InscriptionEscReplacementStrings[32][8] = { // @ G0257_aac_Graphic559_
void DungeonMan::f168_decodeText(char *destString, Thing thing, TextType type) {
- char sepChar;
- TextString textString(_g284_thingData[k2_TextstringType] + thing.getIndex() * g235_ThingDataWordCount[k2_TextstringType]);
+ TextString textString(_g284_thingData[k2_TextstringType][thing.getIndex()]);
if ((textString.isVisible()) || (type & k0x8000_DecodeEvenIfInvisible)) {
type = (TextType)(type & ~k0x8000_DecodeEvenIfInvisible);
+ char sepChar;
if (type == k1_TextTypeMessage) {
*destString++ = '\n';
sepChar = ' ';
@@ -1313,56 +1304,46 @@ int16 DungeonMan::f141_getObjectInfoIndex(Thing thing) {
}
void DungeonMan::f163_linkThingToList(Thing thingToLink, Thing thingInList, int16 mapX, int16 mapY) {
- Thing L0265_T_Thing;
- uint16 L0266_ui_Multiple;
-#define AL0266_ui_Column L0266_ui_Multiple
-#define AL0266_ui_SquareFirstThingIndex L0266_ui_Multiple
- Thing* L0267_pT_Thing;
- byte* L0268_puc_Square;
- Thing* L0269_ps_Generic;
- uint16 L0270_ui_MapY;
+ if (thingToLink == Thing::_endOfList)
+ return;
+ uint16 *rawObjPtr = f156_getThingData(thingToLink);
+ *rawObjPtr = Thing::_endOfList.toUint16();
- if (thingToLink == Thing::_endOfList) {
- return;
- }
- L0269_ps_Generic = (Thing*)f156_getThingData(thingToLink);
- *L0269_ps_Generic = Thing::_endOfList;
- /* If mapX >= 0 then the thing is linked to the list of things on the specified square else it is linked at the end of the specified thing list */
if (mapX >= 0) {
- L0268_puc_Square = &_g271_currMapData[mapX][mapY];
- if (getFlag(*L0268_puc_Square, k0x0010_ThingListPresent)) {
+ Square *squarePtr = (Square*)&_g271_currMapData[mapX][mapY];
+ if (squarePtr->get(k0x0010_ThingListPresent)) {
thingInList = f161_getSquareFirstThing(mapX, mapY);
} else {
- setFlag(*L0268_puc_Square, k0x0010_ThingListPresent);
- uint16 * tmp = _g270_currMapColCumulativeSquareFirstThingCount + mapX + 1;
- AL0266_ui_Column = _g282_dungeonColumCount - (_g281_dungeonMapsFirstColumnIndex[_g272_currMapIndex] + mapX) - 1;
- while (AL0266_ui_Column--) { /* For each column starting from and after the column containing the square where the thing is added */
- (*tmp++)++; /* Increment the cumulative first thing count */
+ squarePtr->set(k0x0010_ThingListPresent);
+ uint16 *cumulativeCount = &_g270_currMapColCumulativeSquareFirstThingCount[mapX + 1];
+ uint16 column = _g282_dungeonColumCount - (_g281_dungeonMapsFirstColumnIndex[_g272_currMapIndex] + mapX) - 1;
+ while (column--) {
+ (*cumulativeCount++)++;
}
- L0270_ui_MapY = 0;
- L0268_puc_Square -= mapY;
- AL0266_ui_SquareFirstThingIndex = _g270_currMapColCumulativeSquareFirstThingCount[mapX];
- while (L0270_ui_MapY++ != mapY) {
- if (getFlag(*L0268_puc_Square++, k0x0010_ThingListPresent)) {
- AL0266_ui_SquareFirstThingIndex++;
+ uint16 mapYStep = 0;
+ squarePtr -= mapY;
+ uint16 squareFirstThingIndex = _g270_currMapColCumulativeSquareFirstThingCount[mapX];
+ while (mapYStep++ != mapY) {
+ if (squarePtr->get(k0x0010_ThingListPresent)) {
+ squareFirstThingIndex++;
}
+ squarePtr++;
}
- L0267_pT_Thing = &_g283_squareFirstThings[AL0266_ui_SquareFirstThingIndex];
- // the second '- 1' is for the loop initialization, > 0 is because we are copying from one behind
- for (int16 i = _g278_dungeonFileHeader._squareFirstThingCount - AL0266_ui_SquareFirstThingIndex - 1 - 1; i > 0; --i)
- L0267_pT_Thing[i] = L0267_pT_Thing[i - 1];
-
- *L0267_pT_Thing = thingToLink;
+ Thing* thingPtr = &_g283_squareFirstThings[squareFirstThingIndex];
+ memmove(thingPtr + 1, thingPtr, sizeof(Thing) * (_g278_dungeonFileHeader._squareFirstThingCount - squareFirstThingIndex - 1));
+ *thingPtr = thingToLink;
return;
}
}
- L0265_T_Thing = f159_getNextThing(thingInList);
- while (L0265_T_Thing != Thing::_endOfList) {
- L0265_T_Thing = f159_getNextThing(thingInList = L0265_T_Thing);
+
+ Thing thing = f159_getNextThing(thingInList);
+ while (thing != Thing::_endOfList) {
+ thing = f159_getNextThing(thing);
+ thingInList = thing;
}
- L0269_ps_Generic = (Thing*)f156_getThingData(thingInList);
- *L0269_ps_Generic = thingToLink;
+ rawObjPtr = f156_getThingData(thingInList);
+ *rawObjPtr = thingToLink.toUint16();
}
WeaponInfo* DungeonMan::f158_getWeaponInfo(Thing thing) {
@@ -1714,10 +1695,4 @@ Thing DungeonMan::f167_getObjForProjectileLaucherOrObjGen(uint16 iconIndex) {
}
return L0295_T_Thing;
}
-
-int16 DungeonMan::f169_getRandomOrnamentIndex(uint16 val1, uint16 val2, int16 modulo) {
- return ((((((val1 * 31417) & 0xFFFF) >> 1) + ((val2 * 11) & 0xFFFF)
- + _vm->_dungeonMan->_g278_dungeonFileHeader._ornamentRandomSeed) & 0xFFFF) >> 2) % modulo; /* Pseudorandom number generator */
-}
-
}
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index 86b30d55dd..204a29640e 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -305,6 +305,10 @@ EventManager::EventManager(DMEngine *vm) : _vm(vm) {
_g326_refreshMousePointerInMainLoop = false;
_g341_highlightBoxEnabled = false;
_g599_useChampionIconOrdinalAsMousePointerBitmap = 0;
+ _g439_pendingClickButton = k0_NoneMouseButton;
+ _g600_useObjectAsMousePointerBitmap = false;
+ _g601_useHandAsMousePointerBitmap = false;
+ _gK100_preventBuildPointerScreenArea = false;
}
EventManager::~EventManager() {
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index a6dd0874f5..e90b3a34aa 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -1009,16 +1009,13 @@ void DisplayMan::f103_drawDoorFrameBitmapFlippedHorizontally(byte* bitmap, Frame
}
void DisplayMan::f110_drawDoorButton(int16 doorButtonOrdinal, int16 viewDoorButtonIndex) {
- int16 nativeBitmapIndex;
- int coordSet;
- uint16* coordSetRedEagle;
- byte* bitmap;
- byte* bitmapNative;
-
if (doorButtonOrdinal) {
doorButtonOrdinal--;
- nativeBitmapIndex = doorButtonOrdinal + k315_firstDoorButton_GraphicIndice;
- coordSetRedEagle = g208_doorButtonCoordSets[coordSet = g197_doorButtonCoordSet[doorButtonOrdinal]][viewDoorButtonIndex];
+ int16 nativeBitmapIndex = doorButtonOrdinal + k315_firstDoorButton_GraphicIndice;
+ int coordSet = g197_doorButtonCoordSet[doorButtonOrdinal];
+ uint16 *coordSetRedEagle = g208_doorButtonCoordSets[coordSet][viewDoorButtonIndex];
+
+ byte* bitmap = nullptr;
if (viewDoorButtonIndex == k3_viewDoorButton_D1C) {
bitmap = f489_getNativeBitmapOrGraphic(nativeBitmapIndex);
@@ -1028,8 +1025,8 @@ void DisplayMan::f110_drawDoorButton(int16 doorButtonOrdinal, int16 viewDoorButt
_vm->_dungeonMan->_g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._y2 = coordSetRedEagle[3];
} else {
if (!f491_isDerivedBitmapInCache(doorButtonOrdinal = k102_DerivedBitmapFirstDoorButton + (doorButtonOrdinal * 2) + ((!viewDoorButtonIndex) ? 0 : viewDoorButtonIndex - 1))) {
- uint16* coordSetBlueGoat = g208_doorButtonCoordSets[coordSet][k3_viewDoorButton_D1C];
- bitmapNative = f489_getNativeBitmapOrGraphic(nativeBitmapIndex);
+ uint16 *coordSetBlueGoat = g208_doorButtonCoordSets[coordSet][k3_viewDoorButton_D1C];
+ byte *bitmapNative = f489_getNativeBitmapOrGraphic(nativeBitmapIndex);
f129_blitToBitmapShrinkWithPalChange(bitmapNative, f492_getDerivedBitmap(doorButtonOrdinal),
coordSetBlueGoat[4] << 1, coordSetBlueGoat[5],
coordSetRedEagle[1] - coordSetRedEagle[0] + 1,
@@ -1383,18 +1380,13 @@ void DisplayMan::f109_drawDoorOrnament(int16 doorOrnOrdinal, int16 viewDoorOrnIn
#define height doorOrnOrdinal
#define byteWidth viewDoorOrnIndex
- int16 nativeBitmapIndex;
- int16 coordSetGreenToad;
- uint16* coordSetOrangeElk;
- byte* L0107_puc_Multiple;
-#define bitmap L0107_puc_Multiple
- byte* bitmapNative;
-
if (doorOrnOrdinal) {
doorOrnOrdinal--;
- nativeBitmapIndex = _g103_currMapDoorOrnInfo[doorOrnOrdinal][k0_NativeBitmapIndex];
- coordSetOrangeElk = g207_doorOrnCoordSets[coordSetGreenToad = _g103_currMapDoorOrnInfo[doorOrnOrdinal][k1_CoordinateSet]][viewDoorOrnIndex];
+ int16 nativeBitmapIndex = _g103_currMapDoorOrnInfo[doorOrnOrdinal][k0_NativeBitmapIndex];
+ int16 coordSetGreenToad = _g103_currMapDoorOrnInfo[doorOrnOrdinal][k1_CoordinateSet];
+ uint16 *coordSetOrangeElk = g207_doorOrnCoordSets[coordSetGreenToad][viewDoorOrnIndex];
+ byte *bitmap = nullptr;
if (viewDoorOrnIndex == k2_ViewDoorOrnament_D1LCR) {
bitmap = f489_getNativeBitmapOrGraphic(nativeBitmapIndex);
byteWidth = 48;
@@ -1402,7 +1394,7 @@ void DisplayMan::f109_drawDoorOrnament(int16 doorOrnOrdinal, int16 viewDoorOrnIn
} else {
if (!f491_isDerivedBitmapInCache(doorOrnOrdinal = k68_DerivedBitmapFirstDoorOrnament_D3 + (doorOrnOrdinal * 2) + viewDoorOrnIndex)) {
uint16 *coordSetRedEagle = g207_doorOrnCoordSets[coordSetGreenToad][k2_ViewDoorOrnament_D1LCR];
- bitmapNative = f489_getNativeBitmapOrGraphic(nativeBitmapIndex);
+ byte* bitmapNative = f489_getNativeBitmapOrGraphic(nativeBitmapIndex);
f129_blitToBitmapShrinkWithPalChange(bitmapNative,
f492_getDerivedBitmap(doorOrnOrdinal),
coordSetRedEagle[4] << 1, coordSetRedEagle[5],
diff --git a/engines/dm/group.h b/engines/dm/group.h
index f9aa038aee..ca7cb527ed 100644
--- a/engines/dm/group.h
+++ b/engines/dm/group.h
@@ -175,7 +175,7 @@ public:
uint16 _g376_maxActiveGroupCount; // @ G0376_ui_MaximumActiveGroupCount
ActiveGroup *_g375_activeGroups; // @ G0375_ps_ActiveGroups
uint16 _g377_currActiveGroupCount; // @ G0377_ui_CurrentActiveGroupCount
- GroupMan(DMEngine *vm);
+ explicit GroupMan(DMEngine *vm);
~GroupMan();
void f196_initActiveGroups(); // @ F0196_GROUP_InitializeActiveGroups
diff --git a/engines/dm/projexpl.h b/engines/dm/projexpl.h
index 15f74543fc..32829f15af 100644
--- a/engines/dm/projexpl.h
+++ b/engines/dm/projexpl.h
@@ -83,7 +83,7 @@ public:
int16 _g366_projectilePoisonAttack; // @ G0366_i_ProjectilePoisonAttack
int16 _g367_projectileAttackType; // @ G0367_i_ProjectileAttackType
int32 _g362_lastPartyMovementTime; // @ G0362_l_LastPartyMovementTime
- ProjExpl(DMEngine *vm);
+ explicit ProjExpl(DMEngine *vm);
void f212_projectileCreate(Thing thing, int16 mapX, int16 mapY, uint16 cell, direction dir,
byte kineticEnergy, byte attack, byte stepEnergy); // @ F0212_PROJECTILE_Create
bool f217_projectileHasImpactOccurred(int16 impactType, int16 mapXCombo, int16 mapYCombo,
diff --git a/engines/dm/timeline.h b/engines/dm/timeline.h
index 5cf3f85a18..b77c0d1081 100644
--- a/engines/dm/timeline.h
+++ b/engines/dm/timeline.h
@@ -151,7 +151,7 @@ public:
uint16 *_g371_timeline; // @ G0371_pui_Timeline
uint16 _g373_firstUnusedEventIndex; // @ G0373_ui_FirstUnusedEventIndex
- Timeline(DMEngine *vm);
+ explicit Timeline(DMEngine *vm);
~Timeline();
void f233_initTimeline(); // @ F0233_TIMELINE_Initialize
void f237_deleteEvent(uint16 eventIndex);// @ F0237_TIMELINE_DeleteEvent