[Scummvm-git-logs] scummvm master -> 706b1b27a4bba85cff87daddf7901e9428d6177c

Strangerke Strangerke at scummvm.org
Mon Sep 19 22:03:27 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
706b1b27a4 DM: Fix 2 GCC warnings, some renaming


Commit: 706b1b27a4bba85cff87daddf7901e9428d6177c
    https://github.com/scummvm/scummvm/commit/706b1b27a4bba85cff87daddf7901e9428d6177c
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-09-19T21:52:37+02:00

Commit Message:
DM: Fix 2 GCC warnings, some renaming

Changed paths:
    engines/dm/champion.cpp
    engines/dm/dm.cpp
    engines/dm/dm.h
    engines/dm/dungeonman.cpp
    engines/dm/eventman.cpp
    engines/dm/group.cpp
    engines/dm/loadsave.cpp
    engines/dm/timeline.cpp



diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index 344940b..0fd3acd 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 dbf7e85..4029c5e 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 d8b62bd..91684da 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 f76f663..325f756 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 67187d2..1f0ec04 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 e0d2303..20babca 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 46c1355..9f19b92 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 24b0b29..330bb4c 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;





More information about the Scummvm-git-logs mailing list