aboutsummaryrefslogtreecommitdiff
path: root/engines/dm
diff options
context:
space:
mode:
Diffstat (limited to 'engines/dm')
-rw-r--r--engines/dm/champion.cpp2
-rw-r--r--engines/dm/dm.cpp22
-rw-r--r--engines/dm/dm.h2
-rw-r--r--engines/dm/dungeonman.cpp14
-rw-r--r--engines/dm/eventman.cpp4
-rw-r--r--engines/dm/group.cpp2
-rw-r--r--engines/dm/loadsave.cpp6
-rw-r--r--engines/dm/text.cpp14
-rw-r--r--engines/dm/text.h4
-rw-r--r--engines/dm/timeline.cpp2
10 files changed, 36 insertions, 36 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index 8a63113431..344940b0b6 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -1828,7 +1828,7 @@ ChampionIndex ChampionMan::getIndexInCell(int16 cell) {
}
void ChampionMan::resetDataToStartGame() {
- if (!_vm->_newGameFl) {
+ if (_vm->_gameMode = k0_modeLoadSavedGame) {
Thing handThing = _leaderHandObject;
if (handThing == Thing::_none) {
_leaderEmptyHanded = true;
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index 41611d730a..dbf7e8568d 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -137,7 +137,7 @@ DMEngine::DMEngine(OSystem *syst, const DMADGameDescription *desc) : Engine(syst
_engineShouldQuit = false;
_dungeonId = 0;
- _newGameFl = 0;
+ _gameMode = k0_modeLoadSavedGame;
_restartGameRequest = false;
_stopWaitingForPlayerInput = true;
_gameTimeTicking = false;
@@ -205,7 +205,7 @@ Common::Error DMEngine::loadGameState(int slot) {
if (loadgame(slot) != kDMLoadgameFailure) {
_displayMan->fillScreen(kDMColorBlack);
_displayMan->startEndFadeToPalette(_displayMan->_palDungeonView[0]);
- _newGameFl = k0_modeLoadSavedGame;
+ _gameMode = k0_modeLoadSavedGame;
startGame();
_restartGameRequest = false;
@@ -259,7 +259,7 @@ void DMEngine::initializeGame() {
if (_engineShouldQuit)
return;
- if (_newGameFl == k0_modeLoadSavedGame) { // if resume was clicked, bring up ScummVM load screen
+ if (_gameMode == k0_modeLoadSavedGame) { // if resume was clicked, bring up ScummVM load screen
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
saveSlot = dialog->runModalWithCurrentTarget();
delete dialog;
@@ -273,7 +273,7 @@ void DMEngine::initializeGame() {
_displayMan->allocateFlippedWallBitmaps();
startGame();
- if (_newGameFl)
+ if (_gameMode != k0_modeLoadSavedGame)
_moveSens->getMoveResult(Thing::_party, kDMMapXNotOnASquare, 0, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY);
_eventMan->showMouse();
_eventMan->discardAllInput();
@@ -312,7 +312,7 @@ void DMEngine::startGame() {
processNewPartyMap(_dungeonMan->_partyMapIndex);
- if (!_newGameFl) {
+ if (_gameMode == k0_modeLoadSavedGame) {
_displayMan->startEndFadeToPalette(_displayMan->_paletteTopAndBottomScreen);
_displayMan->_useByteBoxCoordinates = false;
delay(1);
@@ -535,21 +535,21 @@ void DMEngine::processEntrance() {
drawEntrance();
_eventMan->showMouse();
_eventMan->discardAllInput();
- _newGameFl = k99_modeWaitingOnEntrance;
+ _gameMode = k99_modeWaitingOnEntrance;
do {
_eventMan->processInput();
if (_engineShouldQuit)
return;
_eventMan->processCommandQueue();
_displayMan->updateScreen();
- } while (_newGameFl == k99_modeWaitingOnEntrance);
- } while (_newGameFl == kDMCommandEntranceDrawCredits);
+ } while (_gameMode == k99_modeWaitingOnEntrance);
+ } while (_gameMode == kDMCommandEntranceDrawCredits);
//Strangerke: CHECKME: Earlier versions were using G0566_puc_Graphic534_Sound01Switch
_sound->play(kDMSoundIndexSwitch, 112, 0x40, 0x40);
delay(20);
_eventMan->showMouse();
- if (_newGameFl)
+ if (_gameMode != k0_modeLoadSavedGame)
openEntranceDoors();
delete[] _entranceDoorAnimSteps[0];
@@ -701,7 +701,7 @@ T0444017:
_displayMan->startEndFadeToPalette(darkBluePalette);
_displayMan->fillScreen(kDMColorBlack);
_displayMan->startEndFadeToPalette(_displayMan->_palDungeonView[0]);
- _newGameFl = k0_modeLoadSavedGame;
+ _gameMode = k0_modeLoadSavedGame;
if (loadgame(1) != kDMLoadgameFailure) {
startGame();
_restartGameRequest = false;
@@ -891,7 +891,7 @@ void DMEngine::entranceDrawCredits() {
_displayMan->startEndFadeToPalette(_displayMan->_palCredits);
delay(50);
_eventMan->waitForMouseOrKeyActivity();
- _newGameFl = k202_modeEntranceDrawCredits;
+ _gameMode = k202_modeEntranceDrawCredits;
}
void DMEngine::fuseSequence() {
diff --git a/engines/dm/dm.h b/engines/dm/dm.h
index e2f5f4186c..d8b62bd436 100644
--- a/engines/dm/dm.h
+++ b/engines/dm/dm.h
@@ -304,7 +304,7 @@ public:
bool _engineShouldQuit;
int _loadSaveSlotAtRuntime;
- int16 _newGameFl; // @ G0298_B_NewGame
+ GameMode _gameMode; // @ G0298_B_NewGame
bool _restartGameRequest; // @ G0523_B_RestartGameRequested
bool _stopWaitingForPlayerInput; // @ G0321_B_StopWaitingForPlayerInput
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index 349388c822..f76f6635db 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -562,7 +562,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
50 /* Explosion */
};
- if (_vm->_newGameFl)
+ if (_vm->_gameMode != k0_modeLoadSavedGame)
decompressDungeonFile();
Common::ReadStream *dunDataStream = nullptr;
@@ -587,7 +587,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
_dungeonFileHeader._thingCounts[i] = dunDataStream->readUint16BE();
// init party position and mapindex
- if (_vm->_newGameFl) {
+ if (_vm->_gameMode != k0_modeLoadSavedGame) {
uint16 startLoc = _dungeonFileHeader._partyStartLocation;
_partyDir = (Direction)((startLoc >> 10) & 3);
_partyMapX = startLoc & 0x1F;
@@ -643,7 +643,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
_dungeonColumCount = columCount;
uint32 actualSquareFirstThingCount = _dungeonFileHeader._squareFirstThingCount;
- if (_vm->_newGameFl)
+ if (_vm->_gameMode != k0_modeLoadSavedGame)
_dungeonFileHeader._squareFirstThingCount += 300;
if (!_vm->_restartGameRequest) {
@@ -662,7 +662,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
for (uint16 i = 0; i < actualSquareFirstThingCount; ++i)
_squareFirstThings[i].set(dunDataStream->readUint16BE());
- if (_vm->_newGameFl) {
+ if (_vm->_gameMode != k0_modeLoadSavedGame) {
for (uint16 i = 0; i < 300; ++i)
_squareFirstThings[actualSquareFirstThingCount + i] = Thing::_none;
}
@@ -676,13 +676,13 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
for (uint16 i = 0; i < _dungeonFileHeader._textDataWordCount; ++i)
_dungeonTextData[i] = dunDataStream->readUint16BE();
- if (_vm->_newGameFl)
+ if (_vm->_gameMode != k0_modeLoadSavedGame)
_vm->_timeline->_eventMaxCount = 100;
// load things
for (uint16 thingType = kDMThingTypeDoor; thingType < kDMThingTypeTotal; ++thingType) {
uint16 thingCount = _dungeonFileHeader._thingCounts[thingType];
- if (_vm->_newGameFl)
+ if (_vm->_gameMode != k0_modeLoadSavedGame)
_dungeonFileHeader._thingCounts[thingType] = MIN((thingType == kDMThingTypeExplosion) ? 768 : 1024, thingCount + additionalThingCounts[thingType]);
uint16 thingStoreWordCount = _thingDataWordCount[thingType];
@@ -713,7 +713,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
}
}
- if (_vm->_newGameFl) {
+ if (_vm->_gameMode != k0_modeLoadSavedGame) {
if ((thingType == kDMThingTypeGroup) || thingType >= kDMThingTypeProjectile)
_vm->_timeline->_eventMaxCount += _dungeonFileHeader._thingCounts[thingType];
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index c6a2e8b985..67187d226d 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -904,12 +904,12 @@ void EventManager::processCommandQueue() {
}
if (cmdType == kDMCommandEntranceEnterDungeon) {
- _vm->_newGameFl = k1_modeLoadDungeon;
+ _vm->_gameMode = k1_modeLoadDungeon;
return;
}
if (cmdType == kDMCommandEntranceResume) {
- _vm->_newGameFl = k0_modeLoadSavedGame;
+ _vm->_gameMode = k0_modeLoadSavedGame;
return;
}
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index b8106f4784..e0d23037b0 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -76,7 +76,7 @@ uint16 GroupMan::toggleFlag(uint16& val, uint16 mask) {
}
void GroupMan::initActiveGroups() {
- if (_vm->_newGameFl)
+ if (_vm->_gameMode != k0_modeLoadSavedGame)
_maxActiveGroupCount = 60;
if (_activeGroups)
diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp
index 6e9d98656d..46c1355193 100644
--- a/engines/dm/loadsave.cpp
+++ b/engines/dm/loadsave.cpp
@@ -43,7 +43,7 @@
namespace DM {
LoadgameResult DMEngine::loadgame(int16 slot) {
- if (slot == -1 && _newGameFl == k0_modeLoadSavedGame)
+ if (slot == -1 && _gameMode == k0_modeLoadSavedGame)
return kDMLoadgameFailure;
bool fadePalette = true;
@@ -59,7 +59,7 @@ LoadgameResult DMEngine::loadgame(int16 slot) {
uint16 _dungeonId;
} dmSaveHeader;
- if (_newGameFl) {
+ if (_gameMode != k0_modeLoadSavedGame) {
//L1366_B_FadePalette = !F0428_DIALOG_RequireGameDiskInDrive_NoDialogDrawn(C0_DO_NOT_FORCE_DIALOG_DM_CSB, true);
_restartGameAllowed = false;
_championMan->_partyChampionCount = 0;
@@ -123,7 +123,7 @@ LoadgameResult DMEngine::loadgame(int16 slot) {
_dungeonMan->loadDungeonFile(file);
delete file;
- if (_newGameFl) {
+ if (_gameMode != k0_modeLoadSavedGame) {
_timeline->initTimeline();
_groupMan->initActiveGroups();
diff --git a/engines/dm/text.cpp b/engines/dm/text.cpp
index c3cadd39db..922b3acf91 100644
--- a/engines/dm/text.cpp
+++ b/engines/dm/text.cpp
@@ -63,26 +63,26 @@ void TextMan::printTextToBitmap(byte *destBitmap, uint16 destByteWidth, int16 de
byte *srcBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(k557_FontGraphicIndice);
byte *tmp = _vm->_displayMan->_tmpBitmap;
- for (uint16 i = 0; i < (k5_LetterWidth + 1) * k6_LetterHeight * 128; ++i)
+ for (uint16 i = 0; i < (kDMFontLetterWidth + 1) * kDMFontLetterHeight * 128; ++i)
tmp[i] = srcBitmap[i] ? textColor : bgColor;
srcBitmap = tmp;
for (const char *begin = text, *end = text + textLength; begin != end; ++begin) {
- if (nextX + k5_LetterWidth + 1 >= destPixelWidth || (*begin == '\n')) {
+ if (nextX + kDMFontLetterWidth + 1 >= destPixelWidth || (*begin == '\n')) {
nextX = destX;
- nextY += k6_LetterHeight + 1;
+ nextY += kDMFontLetterHeight + 1;
}
- if (nextY + k6_LetterHeight >= destHeight)
+ if (nextY + kDMFontLetterHeight >= destHeight)
break;
uint16 srcX = (1 + 5) * *begin; // 1 + 5 is not the letter width, arbitrary choice of the unpacking code
- Box box((nextX == destX) ? (nextX + 1) : nextX, nextX + k5_LetterWidth + 1, nextY, nextY + k6_LetterHeight - 1);
+ Box box((nextX == destX) ? (nextX + 1) : nextX, nextX + kDMFontLetterWidth + 1, nextY, nextY + kDMFontLetterHeight - 1);
_vm->_displayMan->blitToBitmap(srcBitmap, destBitmap, box, (nextX == destX) ? (srcX + 1) : srcX, 0, 6 * 128 / 2, destByteWidth, kDMColorNoTransparency,
- k6_LetterHeight, destHeight);
+ kDMFontLetterHeight, destHeight);
- nextX += k5_LetterWidth + 1;
+ nextX += kDMFontLetterWidth + 1;
}
}
diff --git a/engines/dm/text.h b/engines/dm/text.h
index 94a1266235..b90e09058e 100644
--- a/engines/dm/text.h
+++ b/engines/dm/text.h
@@ -37,8 +37,8 @@ struct TextScroller {
// Placeholder, empty for now
}; // @ Text_Scroller
-#define k5_LetterWidth 5
-#define k6_LetterHeight 6
+#define kDMFontLetterWidth 5
+#define kDMFontLetterHeight 6
class TextMan {
DMEngine *_vm;
diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp
index 49f82892de..24b0b290ed 100644
--- a/engines/dm/timeline.cpp
+++ b/engines/dm/timeline.cpp
@@ -110,7 +110,7 @@ Timeline::~Timeline() {
void Timeline::initTimeline() {
_events = new TimelineEvent[_eventMaxCount];
_timeline = new uint16[_eventMaxCount];
- if (_vm->_newGameFl) {
+ if (_vm->_gameMode != k0_modeLoadSavedGame) {
for (int16 i = 0; i < _eventMaxCount; ++i)
_events[i]._type = k0_TMEventTypeNone;
_eventCount = 0;