From 706b1b27a4bba85cff87daddf7901e9428d6177c Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 19 Sep 2016 21:45:14 +0200 Subject: DM: Fix 2 GCC warnings, some renaming --- engines/dm/champion.cpp | 2 +- engines/dm/dm.cpp | 22 +++++++++++----------- engines/dm/dm.h | 8 ++++---- engines/dm/dungeonman.cpp | 14 +++++++------- engines/dm/eventman.cpp | 4 ++-- engines/dm/group.cpp | 2 +- engines/dm/loadsave.cpp | 6 +++--- engines/dm/timeline.cpp | 2 +- 8 files changed, 30 insertions(+), 30 deletions(-) (limited to 'engines') diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index 344940b0b6..0fd3acdb0a 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->_gameMode = k0_modeLoadSavedGame) { + if (_vm->_gameMode == kDMModeLoadSavedGame) { Thing handThing = _leaderHandObject; if (handThing == Thing::_none) { _leaderEmptyHanded = true; diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index dbf7e8568d..4029c5ea9c 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; - _gameMode = k0_modeLoadSavedGame; + _gameMode = kDMModeLoadSavedGame; _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]); - _gameMode = k0_modeLoadSavedGame; + _gameMode = kDMModeLoadSavedGame; startGame(); _restartGameRequest = false; @@ -259,7 +259,7 @@ void DMEngine::initializeGame() { if (_engineShouldQuit) return; - if (_gameMode == k0_modeLoadSavedGame) { // if resume was clicked, bring up ScummVM load screen + if (_gameMode == kDMModeLoadSavedGame) { // 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 (_gameMode != k0_modeLoadSavedGame) + if (_gameMode != kDMModeLoadSavedGame) _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 (_gameMode == k0_modeLoadSavedGame) { + if (_gameMode == kDMModeLoadSavedGame) { _displayMan->startEndFadeToPalette(_displayMan->_paletteTopAndBottomScreen); _displayMan->_useByteBoxCoordinates = false; delay(1); @@ -535,21 +535,21 @@ void DMEngine::processEntrance() { drawEntrance(); _eventMan->showMouse(); _eventMan->discardAllInput(); - _gameMode = k99_modeWaitingOnEntrance; + _gameMode = kDMModeWaitingOnEntrance; do { _eventMan->processInput(); if (_engineShouldQuit) return; _eventMan->processCommandQueue(); _displayMan->updateScreen(); - } while (_gameMode == k99_modeWaitingOnEntrance); - } while (_gameMode == kDMCommandEntranceDrawCredits); + } while (_gameMode == kDMModeWaitingOnEntrance); + } while (_gameMode == kDMModeEntranceDrawCredits); //Strangerke: CHECKME: Earlier versions were using G0566_puc_Graphic534_Sound01Switch _sound->play(kDMSoundIndexSwitch, 112, 0x40, 0x40); delay(20); _eventMan->showMouse(); - if (_gameMode != k0_modeLoadSavedGame) + if (_gameMode != kDMModeLoadSavedGame) openEntranceDoors(); delete[] _entranceDoorAnimSteps[0]; @@ -701,7 +701,7 @@ T0444017: _displayMan->startEndFadeToPalette(darkBluePalette); _displayMan->fillScreen(kDMColorBlack); _displayMan->startEndFadeToPalette(_displayMan->_palDungeonView[0]); - _gameMode = k0_modeLoadSavedGame; + _gameMode = kDMModeLoadSavedGame; if (loadgame(1) != kDMLoadgameFailure) { startGame(); _restartGameRequest = false; @@ -891,7 +891,7 @@ void DMEngine::entranceDrawCredits() { _displayMan->startEndFadeToPalette(_displayMan->_palCredits); delay(50); _eventMan->waitForMouseOrKeyActivity(); - _gameMode = k202_modeEntranceDrawCredits; + _gameMode = kDMModeEntranceDrawCredits; } void DMEngine::fuseSequence() { diff --git a/engines/dm/dm.h b/engines/dm/dm.h index d8b62bd436..91684dafa3 100644 --- a/engines/dm/dm.h +++ b/engines/dm/dm.h @@ -129,10 +129,10 @@ enum Cell { }; enum GameMode { - k0_modeLoadSavedGame = 0, // @ C000_MODE_LOAD_SAVED_GAME - k1_modeLoadDungeon = 1, // @ C001_MODE_LOAD_DUNGEON - k99_modeWaitingOnEntrance = 99, // @ C099_MODE_WAITING_ON_ENTRANCE - k202_modeEntranceDrawCredits = 202 // @ C202_MODE_ENTRANCE_DRAW_CREDITS + kDMModeLoadSavedGame = 0, // @ C000_MODE_LOAD_SAVED_GAME + kDMModeLoadDungeon = 1, // @ C001_MODE_LOAD_DUNGEON + kDMModeWaitingOnEntrance = 99, // @ C099_MODE_WAITING_ON_ENTRANCE + kDMModeEntranceDrawCredits = 202 // @ C202_MODE_ENTRANCE_DRAW_CREDITS }; enum LoadgameResult { diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index f76f6635db..325f7568ab 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->_gameMode != k0_modeLoadSavedGame) + if (_vm->_gameMode != kDMModeLoadSavedGame) 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->_gameMode != k0_modeLoadSavedGame) { + if (_vm->_gameMode != kDMModeLoadSavedGame) { 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->_gameMode != k0_modeLoadSavedGame) + if (_vm->_gameMode != kDMModeLoadSavedGame) _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->_gameMode != k0_modeLoadSavedGame) { + if (_vm->_gameMode != kDMModeLoadSavedGame) { 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->_gameMode != k0_modeLoadSavedGame) + if (_vm->_gameMode != kDMModeLoadSavedGame) _vm->_timeline->_eventMaxCount = 100; // load things for (uint16 thingType = kDMThingTypeDoor; thingType < kDMThingTypeTotal; ++thingType) { uint16 thingCount = _dungeonFileHeader._thingCounts[thingType]; - if (_vm->_gameMode != k0_modeLoadSavedGame) + if (_vm->_gameMode != kDMModeLoadSavedGame) _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->_gameMode != k0_modeLoadSavedGame) { + if (_vm->_gameMode != kDMModeLoadSavedGame) { if ((thingType == kDMThingTypeGroup) || thingType >= kDMThingTypeProjectile) _vm->_timeline->_eventMaxCount += _dungeonFileHeader._thingCounts[thingType]; diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index 67187d226d..1f0ec0481f 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -904,12 +904,12 @@ void EventManager::processCommandQueue() { } if (cmdType == kDMCommandEntranceEnterDungeon) { - _vm->_gameMode = k1_modeLoadDungeon; + _vm->_gameMode = kDMModeLoadDungeon; return; } if (cmdType == kDMCommandEntranceResume) { - _vm->_gameMode = k0_modeLoadSavedGame; + _vm->_gameMode = kDMModeLoadSavedGame; return; } diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp index e0d23037b0..20babca23d 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->_gameMode != k0_modeLoadSavedGame) + if (_vm->_gameMode != kDMModeLoadSavedGame) _maxActiveGroupCount = 60; if (_activeGroups) diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp index 46c1355193..9f19b92bf2 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 && _gameMode == k0_modeLoadSavedGame) + if (slot == -1 && _gameMode == kDMModeLoadSavedGame) return kDMLoadgameFailure; bool fadePalette = true; @@ -59,7 +59,7 @@ LoadgameResult DMEngine::loadgame(int16 slot) { uint16 _dungeonId; } dmSaveHeader; - if (_gameMode != k0_modeLoadSavedGame) { + if (_gameMode != kDMModeLoadSavedGame) { //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 (_gameMode != k0_modeLoadSavedGame) { + if (_gameMode != kDMModeLoadSavedGame) { _timeline->initTimeline(); _groupMan->initActiveGroups(); diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp index 24b0b290ed..330bb4c46f 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->_gameMode != k0_modeLoadSavedGame) { + if (_vm->_gameMode != kDMModeLoadSavedGame) { for (int16 i = 0; i < _eventMaxCount; ++i) _events[i]._type = k0_TMEventTypeNone; _eventCount = 0; -- cgit v1.2.3