DM: Fix 2 GCC warnings, some renaming
This commit is contained in:
parent
a60558071d
commit
706b1b27a4
8 changed files with 30 additions and 30 deletions
|
@ -1828,7 +1828,7 @@ ChampionIndex ChampionMan::getIndexInCell(int16 cell) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChampionMan::resetDataToStartGame() {
|
void ChampionMan::resetDataToStartGame() {
|
||||||
if (_vm->_gameMode = k0_modeLoadSavedGame) {
|
if (_vm->_gameMode == kDMModeLoadSavedGame) {
|
||||||
Thing handThing = _leaderHandObject;
|
Thing handThing = _leaderHandObject;
|
||||||
if (handThing == Thing::_none) {
|
if (handThing == Thing::_none) {
|
||||||
_leaderEmptyHanded = true;
|
_leaderEmptyHanded = true;
|
||||||
|
|
|
@ -137,7 +137,7 @@ DMEngine::DMEngine(OSystem *syst, const DMADGameDescription *desc) : Engine(syst
|
||||||
_engineShouldQuit = false;
|
_engineShouldQuit = false;
|
||||||
_dungeonId = 0;
|
_dungeonId = 0;
|
||||||
|
|
||||||
_gameMode = k0_modeLoadSavedGame;
|
_gameMode = kDMModeLoadSavedGame;
|
||||||
_restartGameRequest = false;
|
_restartGameRequest = false;
|
||||||
_stopWaitingForPlayerInput = true;
|
_stopWaitingForPlayerInput = true;
|
||||||
_gameTimeTicking = false;
|
_gameTimeTicking = false;
|
||||||
|
@ -205,7 +205,7 @@ Common::Error DMEngine::loadGameState(int slot) {
|
||||||
if (loadgame(slot) != kDMLoadgameFailure) {
|
if (loadgame(slot) != kDMLoadgameFailure) {
|
||||||
_displayMan->fillScreen(kDMColorBlack);
|
_displayMan->fillScreen(kDMColorBlack);
|
||||||
_displayMan->startEndFadeToPalette(_displayMan->_palDungeonView[0]);
|
_displayMan->startEndFadeToPalette(_displayMan->_palDungeonView[0]);
|
||||||
_gameMode = k0_modeLoadSavedGame;
|
_gameMode = kDMModeLoadSavedGame;
|
||||||
|
|
||||||
startGame();
|
startGame();
|
||||||
_restartGameRequest = false;
|
_restartGameRequest = false;
|
||||||
|
@ -259,7 +259,7 @@ void DMEngine::initializeGame() {
|
||||||
if (_engineShouldQuit)
|
if (_engineShouldQuit)
|
||||||
return;
|
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);
|
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
|
||||||
saveSlot = dialog->runModalWithCurrentTarget();
|
saveSlot = dialog->runModalWithCurrentTarget();
|
||||||
delete dialog;
|
delete dialog;
|
||||||
|
@ -273,7 +273,7 @@ void DMEngine::initializeGame() {
|
||||||
_displayMan->allocateFlippedWallBitmaps();
|
_displayMan->allocateFlippedWallBitmaps();
|
||||||
|
|
||||||
startGame();
|
startGame();
|
||||||
if (_gameMode != k0_modeLoadSavedGame)
|
if (_gameMode != kDMModeLoadSavedGame)
|
||||||
_moveSens->getMoveResult(Thing::_party, kDMMapXNotOnASquare, 0, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY);
|
_moveSens->getMoveResult(Thing::_party, kDMMapXNotOnASquare, 0, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY);
|
||||||
_eventMan->showMouse();
|
_eventMan->showMouse();
|
||||||
_eventMan->discardAllInput();
|
_eventMan->discardAllInput();
|
||||||
|
@ -312,7 +312,7 @@ void DMEngine::startGame() {
|
||||||
|
|
||||||
processNewPartyMap(_dungeonMan->_partyMapIndex);
|
processNewPartyMap(_dungeonMan->_partyMapIndex);
|
||||||
|
|
||||||
if (_gameMode == k0_modeLoadSavedGame) {
|
if (_gameMode == kDMModeLoadSavedGame) {
|
||||||
_displayMan->startEndFadeToPalette(_displayMan->_paletteTopAndBottomScreen);
|
_displayMan->startEndFadeToPalette(_displayMan->_paletteTopAndBottomScreen);
|
||||||
_displayMan->_useByteBoxCoordinates = false;
|
_displayMan->_useByteBoxCoordinates = false;
|
||||||
delay(1);
|
delay(1);
|
||||||
|
@ -535,21 +535,21 @@ void DMEngine::processEntrance() {
|
||||||
drawEntrance();
|
drawEntrance();
|
||||||
_eventMan->showMouse();
|
_eventMan->showMouse();
|
||||||
_eventMan->discardAllInput();
|
_eventMan->discardAllInput();
|
||||||
_gameMode = k99_modeWaitingOnEntrance;
|
_gameMode = kDMModeWaitingOnEntrance;
|
||||||
do {
|
do {
|
||||||
_eventMan->processInput();
|
_eventMan->processInput();
|
||||||
if (_engineShouldQuit)
|
if (_engineShouldQuit)
|
||||||
return;
|
return;
|
||||||
_eventMan->processCommandQueue();
|
_eventMan->processCommandQueue();
|
||||||
_displayMan->updateScreen();
|
_displayMan->updateScreen();
|
||||||
} while (_gameMode == k99_modeWaitingOnEntrance);
|
} while (_gameMode == kDMModeWaitingOnEntrance);
|
||||||
} while (_gameMode == kDMCommandEntranceDrawCredits);
|
} while (_gameMode == kDMModeEntranceDrawCredits);
|
||||||
|
|
||||||
//Strangerke: CHECKME: Earlier versions were using G0566_puc_Graphic534_Sound01Switch
|
//Strangerke: CHECKME: Earlier versions were using G0566_puc_Graphic534_Sound01Switch
|
||||||
_sound->play(kDMSoundIndexSwitch, 112, 0x40, 0x40);
|
_sound->play(kDMSoundIndexSwitch, 112, 0x40, 0x40);
|
||||||
delay(20);
|
delay(20);
|
||||||
_eventMan->showMouse();
|
_eventMan->showMouse();
|
||||||
if (_gameMode != k0_modeLoadSavedGame)
|
if (_gameMode != kDMModeLoadSavedGame)
|
||||||
openEntranceDoors();
|
openEntranceDoors();
|
||||||
|
|
||||||
delete[] _entranceDoorAnimSteps[0];
|
delete[] _entranceDoorAnimSteps[0];
|
||||||
|
@ -701,7 +701,7 @@ T0444017:
|
||||||
_displayMan->startEndFadeToPalette(darkBluePalette);
|
_displayMan->startEndFadeToPalette(darkBluePalette);
|
||||||
_displayMan->fillScreen(kDMColorBlack);
|
_displayMan->fillScreen(kDMColorBlack);
|
||||||
_displayMan->startEndFadeToPalette(_displayMan->_palDungeonView[0]);
|
_displayMan->startEndFadeToPalette(_displayMan->_palDungeonView[0]);
|
||||||
_gameMode = k0_modeLoadSavedGame;
|
_gameMode = kDMModeLoadSavedGame;
|
||||||
if (loadgame(1) != kDMLoadgameFailure) {
|
if (loadgame(1) != kDMLoadgameFailure) {
|
||||||
startGame();
|
startGame();
|
||||||
_restartGameRequest = false;
|
_restartGameRequest = false;
|
||||||
|
@ -891,7 +891,7 @@ void DMEngine::entranceDrawCredits() {
|
||||||
_displayMan->startEndFadeToPalette(_displayMan->_palCredits);
|
_displayMan->startEndFadeToPalette(_displayMan->_palCredits);
|
||||||
delay(50);
|
delay(50);
|
||||||
_eventMan->waitForMouseOrKeyActivity();
|
_eventMan->waitForMouseOrKeyActivity();
|
||||||
_gameMode = k202_modeEntranceDrawCredits;
|
_gameMode = kDMModeEntranceDrawCredits;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DMEngine::fuseSequence() {
|
void DMEngine::fuseSequence() {
|
||||||
|
|
|
@ -129,10 +129,10 @@ enum Cell {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum GameMode {
|
enum GameMode {
|
||||||
k0_modeLoadSavedGame = 0, // @ C000_MODE_LOAD_SAVED_GAME
|
kDMModeLoadSavedGame = 0, // @ C000_MODE_LOAD_SAVED_GAME
|
||||||
k1_modeLoadDungeon = 1, // @ C001_MODE_LOAD_DUNGEON
|
kDMModeLoadDungeon = 1, // @ C001_MODE_LOAD_DUNGEON
|
||||||
k99_modeWaitingOnEntrance = 99, // @ C099_MODE_WAITING_ON_ENTRANCE
|
kDMModeWaitingOnEntrance = 99, // @ C099_MODE_WAITING_ON_ENTRANCE
|
||||||
k202_modeEntranceDrawCredits = 202 // @ C202_MODE_ENTRANCE_DRAW_CREDITS
|
kDMModeEntranceDrawCredits = 202 // @ C202_MODE_ENTRANCE_DRAW_CREDITS
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LoadgameResult {
|
enum LoadgameResult {
|
||||||
|
|
|
@ -562,7 +562,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
|
||||||
50 /* Explosion */
|
50 /* Explosion */
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_vm->_gameMode != k0_modeLoadSavedGame)
|
if (_vm->_gameMode != kDMModeLoadSavedGame)
|
||||||
decompressDungeonFile();
|
decompressDungeonFile();
|
||||||
|
|
||||||
Common::ReadStream *dunDataStream = nullptr;
|
Common::ReadStream *dunDataStream = nullptr;
|
||||||
|
@ -587,7 +587,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
|
||||||
_dungeonFileHeader._thingCounts[i] = dunDataStream->readUint16BE();
|
_dungeonFileHeader._thingCounts[i] = dunDataStream->readUint16BE();
|
||||||
|
|
||||||
// init party position and mapindex
|
// init party position and mapindex
|
||||||
if (_vm->_gameMode != k0_modeLoadSavedGame) {
|
if (_vm->_gameMode != kDMModeLoadSavedGame) {
|
||||||
uint16 startLoc = _dungeonFileHeader._partyStartLocation;
|
uint16 startLoc = _dungeonFileHeader._partyStartLocation;
|
||||||
_partyDir = (Direction)((startLoc >> 10) & 3);
|
_partyDir = (Direction)((startLoc >> 10) & 3);
|
||||||
_partyMapX = startLoc & 0x1F;
|
_partyMapX = startLoc & 0x1F;
|
||||||
|
@ -643,7 +643,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
|
||||||
_dungeonColumCount = columCount;
|
_dungeonColumCount = columCount;
|
||||||
|
|
||||||
uint32 actualSquareFirstThingCount = _dungeonFileHeader._squareFirstThingCount;
|
uint32 actualSquareFirstThingCount = _dungeonFileHeader._squareFirstThingCount;
|
||||||
if (_vm->_gameMode != k0_modeLoadSavedGame)
|
if (_vm->_gameMode != kDMModeLoadSavedGame)
|
||||||
_dungeonFileHeader._squareFirstThingCount += 300;
|
_dungeonFileHeader._squareFirstThingCount += 300;
|
||||||
|
|
||||||
if (!_vm->_restartGameRequest) {
|
if (!_vm->_restartGameRequest) {
|
||||||
|
@ -662,7 +662,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
|
||||||
for (uint16 i = 0; i < actualSquareFirstThingCount; ++i)
|
for (uint16 i = 0; i < actualSquareFirstThingCount; ++i)
|
||||||
_squareFirstThings[i].set(dunDataStream->readUint16BE());
|
_squareFirstThings[i].set(dunDataStream->readUint16BE());
|
||||||
|
|
||||||
if (_vm->_gameMode != k0_modeLoadSavedGame) {
|
if (_vm->_gameMode != kDMModeLoadSavedGame) {
|
||||||
for (uint16 i = 0; i < 300; ++i)
|
for (uint16 i = 0; i < 300; ++i)
|
||||||
_squareFirstThings[actualSquareFirstThingCount + i] = Thing::_none;
|
_squareFirstThings[actualSquareFirstThingCount + i] = Thing::_none;
|
||||||
}
|
}
|
||||||
|
@ -676,13 +676,13 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
|
||||||
for (uint16 i = 0; i < _dungeonFileHeader._textDataWordCount; ++i)
|
for (uint16 i = 0; i < _dungeonFileHeader._textDataWordCount; ++i)
|
||||||
_dungeonTextData[i] = dunDataStream->readUint16BE();
|
_dungeonTextData[i] = dunDataStream->readUint16BE();
|
||||||
|
|
||||||
if (_vm->_gameMode != k0_modeLoadSavedGame)
|
if (_vm->_gameMode != kDMModeLoadSavedGame)
|
||||||
_vm->_timeline->_eventMaxCount = 100;
|
_vm->_timeline->_eventMaxCount = 100;
|
||||||
|
|
||||||
// load things
|
// load things
|
||||||
for (uint16 thingType = kDMThingTypeDoor; thingType < kDMThingTypeTotal; ++thingType) {
|
for (uint16 thingType = kDMThingTypeDoor; thingType < kDMThingTypeTotal; ++thingType) {
|
||||||
uint16 thingCount = _dungeonFileHeader._thingCounts[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]);
|
_dungeonFileHeader._thingCounts[thingType] = MIN((thingType == kDMThingTypeExplosion) ? 768 : 1024, thingCount + additionalThingCounts[thingType]);
|
||||||
|
|
||||||
uint16 thingStoreWordCount = _thingDataWordCount[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)
|
if ((thingType == kDMThingTypeGroup) || thingType >= kDMThingTypeProjectile)
|
||||||
_vm->_timeline->_eventMaxCount += _dungeonFileHeader._thingCounts[thingType];
|
_vm->_timeline->_eventMaxCount += _dungeonFileHeader._thingCounts[thingType];
|
||||||
|
|
||||||
|
|
|
@ -904,12 +904,12 @@ void EventManager::processCommandQueue() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmdType == kDMCommandEntranceEnterDungeon) {
|
if (cmdType == kDMCommandEntranceEnterDungeon) {
|
||||||
_vm->_gameMode = k1_modeLoadDungeon;
|
_vm->_gameMode = kDMModeLoadDungeon;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmdType == kDMCommandEntranceResume) {
|
if (cmdType == kDMCommandEntranceResume) {
|
||||||
_vm->_gameMode = k0_modeLoadSavedGame;
|
_vm->_gameMode = kDMModeLoadSavedGame;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ uint16 GroupMan::toggleFlag(uint16& val, uint16 mask) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupMan::initActiveGroups() {
|
void GroupMan::initActiveGroups() {
|
||||||
if (_vm->_gameMode != k0_modeLoadSavedGame)
|
if (_vm->_gameMode != kDMModeLoadSavedGame)
|
||||||
_maxActiveGroupCount = 60;
|
_maxActiveGroupCount = 60;
|
||||||
|
|
||||||
if (_activeGroups)
|
if (_activeGroups)
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
namespace DM {
|
namespace DM {
|
||||||
|
|
||||||
LoadgameResult DMEngine::loadgame(int16 slot) {
|
LoadgameResult DMEngine::loadgame(int16 slot) {
|
||||||
if (slot == -1 && _gameMode == k0_modeLoadSavedGame)
|
if (slot == -1 && _gameMode == kDMModeLoadSavedGame)
|
||||||
return kDMLoadgameFailure;
|
return kDMLoadgameFailure;
|
||||||
|
|
||||||
bool fadePalette = true;
|
bool fadePalette = true;
|
||||||
|
@ -59,7 +59,7 @@ LoadgameResult DMEngine::loadgame(int16 slot) {
|
||||||
uint16 _dungeonId;
|
uint16 _dungeonId;
|
||||||
} dmSaveHeader;
|
} dmSaveHeader;
|
||||||
|
|
||||||
if (_gameMode != k0_modeLoadSavedGame) {
|
if (_gameMode != kDMModeLoadSavedGame) {
|
||||||
//L1366_B_FadePalette = !F0428_DIALOG_RequireGameDiskInDrive_NoDialogDrawn(C0_DO_NOT_FORCE_DIALOG_DM_CSB, true);
|
//L1366_B_FadePalette = !F0428_DIALOG_RequireGameDiskInDrive_NoDialogDrawn(C0_DO_NOT_FORCE_DIALOG_DM_CSB, true);
|
||||||
_restartGameAllowed = false;
|
_restartGameAllowed = false;
|
||||||
_championMan->_partyChampionCount = 0;
|
_championMan->_partyChampionCount = 0;
|
||||||
|
@ -123,7 +123,7 @@ LoadgameResult DMEngine::loadgame(int16 slot) {
|
||||||
_dungeonMan->loadDungeonFile(file);
|
_dungeonMan->loadDungeonFile(file);
|
||||||
delete file;
|
delete file;
|
||||||
|
|
||||||
if (_gameMode != k0_modeLoadSavedGame) {
|
if (_gameMode != kDMModeLoadSavedGame) {
|
||||||
_timeline->initTimeline();
|
_timeline->initTimeline();
|
||||||
_groupMan->initActiveGroups();
|
_groupMan->initActiveGroups();
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ Timeline::~Timeline() {
|
||||||
void Timeline::initTimeline() {
|
void Timeline::initTimeline() {
|
||||||
_events = new TimelineEvent[_eventMaxCount];
|
_events = new TimelineEvent[_eventMaxCount];
|
||||||
_timeline = new uint16[_eventMaxCount];
|
_timeline = new uint16[_eventMaxCount];
|
||||||
if (_vm->_gameMode != k0_modeLoadSavedGame) {
|
if (_vm->_gameMode != kDMModeLoadSavedGame) {
|
||||||
for (int16 i = 0; i < _eventMaxCount; ++i)
|
for (int16 i = 0; i < _eventMaxCount; ++i)
|
||||||
_events[i]._type = k0_TMEventTypeNone;
|
_events[i]._type = k0_TMEventTypeNone;
|
||||||
_eventCount = 0;
|
_eventCount = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue