[Scummvm-git-logs] scummvm master -> a2f0db9840b2cfcda2019f3e8c8b2f7b2827ea98

Strangerke noreply at scummvm.org
Sat Jan 25 23:23:11 UTC 2025


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:
a2f0db9840 GOT: remove more unused variables, renaming


Commit: a2f0db9840b2cfcda2019f3e8c8b2f7b2827ea98
    https://github.com/scummvm/scummvm/commit/a2f0db9840b2cfcda2019f3e8c8b2f7b2827ea98
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-26T00:21:31+01:00

Commit Message:
GOT: remove more unused variables, renaming

Changed paths:
    engines/got/console.cpp
    engines/got/game/back.cpp
    engines/got/game/boss1.cpp
    engines/got/game/boss2.cpp
    engines/got/game/boss3.cpp
    engines/got/game/init.cpp
    engines/got/game/main.cpp
    engines/got/game/move.cpp
    engines/got/game/move_patterns.cpp
    engines/got/game/object.cpp
    engines/got/game/script.cpp
    engines/got/game/special_tile.cpp
    engines/got/got.cpp
    engines/got/vars.cpp
    engines/got/vars.h
    engines/got/views/dialogs/main_menu.cpp
    engines/got/views/game.cpp
    engines/got/views/game_content.cpp
    engines/got/views/story.cpp


diff --git a/engines/got/console.cpp b/engines/got/console.cpp
index 9098c50447e..93188fc2919 100644
--- a/engines/got/console.cpp
+++ b/engines/got/console.cpp
@@ -135,11 +135,11 @@ bool Console::cmdFreeze(int argc, const char **argv) {
 
 bool Console::cmdLevel(int argc, const char **argv) {
 	if (argc != 2) {
-		debugPrintf("Current level = %d\n", _G(current_level));
+		debugPrintf("Current level = %d\n", _G(currentLevel));
 		return true;
 	}
 
-	_G(new_level) = atoi(argv[1]);
+	_G(newLevel) = atoi(argv[1]);
 	_G(warpFlag) = true;
 	return false;
 }
diff --git a/engines/got/game/back.cpp b/engines/got/game/back.cpp
index be8f608951f..bf6043e6526 100644
--- a/engines/got/game/back.cpp
+++ b/engines/got/game/back.cpp
@@ -46,7 +46,7 @@ const char *ITEM_NAMES[] = {
 static const char *odinEndMessage;
 
 void showLevel(const int newLevel) {
-	_G(boss_active) = false;
+	_G(bossActive) = false;
 	if (!_G(shieldOn))
 		_G(actor[2])._active = false;
 	_G(slipping) = false;
@@ -58,8 +58,8 @@ void showLevel(const int newLevel) {
 	// This doesn't make sense, because that would put the ending in the middle of _staticY.
 	// Plus, it follows with an entire copy of scrn into sd_data anyway, so the first
 	// move seems entirely redundant.
-	_G(scrn).save(_G(current_level));
-	_G(scrn).load(_G(new_level));
+	_G(scrn).save(_G(currentLevel));
+	_G(scrn).load(_G(newLevel));
 
 	_G(levelMusic) = _G(scrn)._music;
 
@@ -74,28 +74,28 @@ void showLevel(const int newLevel) {
 		warning("showLevel - Potential short move missing");
 
 	if (_G(warpFlag))
-		_G(current_level) = newLevel - 5; // Force phase
+		_G(currentLevel) = newLevel - 5; // Force phase
 	_G(warpFlag) = false;
 
 	if (_G(warpScroll)) {
 		_G(warpScroll) = false;
 		if (_G(thor)->_dir == 0)
-			_G(current_level) = newLevel + 10;
+			_G(currentLevel) = newLevel + 10;
 		else if (_G(thor)->_dir == 1)
-			_G(current_level) = newLevel - 10;
+			_G(currentLevel) = newLevel - 10;
 		else if (_G(thor)->_dir == 2)
-			_G(current_level) = newLevel + 1;
+			_G(currentLevel) = newLevel + 1;
 		else if (_G(thor)->_dir == 3)
-			_G(current_level) = newLevel - 1;
+			_G(currentLevel) = newLevel - 1;
 	}
 
 	if (!_G(setup)._scrollFlag)
-		_G(current_level) = newLevel; // Force no scroll
+		_G(currentLevel) = newLevel; // Force no scroll
 
 	if (_G(currentMusic) != _G(levelMusic))
 		_G(sound).musicPause();
 
-	switch (_G(new_level) - _G(current_level)) {
+	switch (_G(newLevel) - _G(currentLevel)) {
 	case 0:
 		// Nothing to do
 		showLevelDone();
@@ -124,7 +124,7 @@ void showLevel(const int newLevel) {
 }
 
 void showLevelDone() {
-	_G(current_level) = _G(new_level);
+	_G(currentLevel) = _G(newLevel);
 
 	_G(thorInfo)._lastHealth = _G(thor)->_health;
 	_G(thorInfo)._lastMagic = _G(thorInfo)._magic;
@@ -132,7 +132,7 @@ void showLevelDone() {
 	_G(thorInfo)._lastKeys = _G(thorInfo)._keys;
 	_G(thorInfo)._lastScore = _G(thorInfo)._score;
 	_G(thorInfo)._lastItem = _G(thorInfo)._selectedItem;
-	_G(thorInfo)._lastScreen = _G(current_level);
+	_G(thorInfo)._lastScreen = _G(currentLevel);
 	_G(thorInfo)._lastIcon = ((_G(thor)->_x + 8) / 16) + (((_G(thor)->_y + 14) / 16) * 20);
 	_G(thorInfo)._lastDir = _G(thor)->_dir;
 	_G(thorInfo)._lastInventory = _G(thorInfo)._inventory;
@@ -142,29 +142,23 @@ void showLevelDone() {
 	_G(lastSetup) = _G(setup);
 
 	bool f = true;
-	if (GAME1 && _G(new_level) == BOSS_LEVEL1) {
-		if (!_G(setup)._bossDead[0]) {
-			if (!_G(auto_load))
-				boss1SetupLevel();
-			f = false;
-		}
+	if (GAME1 && _G(newLevel) == BOSS_LEVEL1 && !_G(setup)._bossDead[0]) {
+		boss1SetupLevel();
+		f = false;
 	}
-	if (GAME2 && _G(new_level) == BOSS_LEVEL2) {
-		if (!_G(setup)._bossDead[1]) {
-			if (!_G(auto_load))
-				boss2SetupLevel();
-			f = false;
-		}
+
+	if (GAME2 && _G(newLevel) == BOSS_LEVEL2 && !_G(setup)._bossDead[1]) {
+		boss2SetupLevel();
+		f = false;
 	}
+
 	if (GAME3) {
-		if (_G(new_level) == BOSS_LEVEL3) {
-			if (!_G(setup)._bossDead[2]) {
-				if (!_G(auto_load))
-					boss3SetupLevel();
-				f = false;
-			}
+		if (_G(newLevel) == BOSS_LEVEL3 && !_G(setup)._bossDead[2]) {
+			boss3SetupLevel();
+			f = false;
 		}
-		if (_G(current_level) == ENDING_SCREEN) {
+
+		if (_G(currentLevel) == ENDING_SCREEN) {
 			endingScreen();
 			f = false;
 		}
@@ -311,7 +305,7 @@ void actorSpeaks(const Actor *actor, int index, int item) {
 	if (v < 1 || v > 20)
 		return;
 
-	long lind = (long)_G(current_level);
+	long lind = (long)_G(currentLevel);
 	lind = lind * 1000;
 	lind += (long)actor->_actorNum;
 
diff --git a/engines/got/game/boss1.cpp b/engines/got/game/boss1.cpp
index e454948eff4..78fcf498ae7 100644
--- a/engines/got/game/boss1.cpp
+++ b/engines/got/game/boss1.cpp
@@ -22,7 +22,6 @@
 #include "got/game/boss1.h"
 #include "got/events.h"
 #include "got/game/back.h"
-#include "got/game/init.h"
 #include "got/game/move.h"
 #include "got/game/move_patterns.h"
 #include "got/game/status.h"
@@ -37,7 +36,7 @@ static int boss1_dead();
 int boss1Movement(Actor *actor) {
 	bool f = false;
 	
-	if (_G(boss_dead))
+	if (_G(bossDead))
 		return boss1_dead();
 
 	int d = actor->_lastDir;
@@ -196,14 +195,14 @@ void boss1CheckHit(const Actor *actor, int x1, int y1, int x2, int y2, int act_n
 			}
 
 			if (_G(actor[3])._health == 0)
-				_G(boss_dead) = true;
+				_G(bossDead) = true;
 		}
 	}
 }
 
 void boss1SetupLevel() {
 	setupBoss(1);
-	_G(boss_active) = true;
+	_G(bossActive) = true;
 	musicPause();
 	playSound(BOSS11, true);
 	g_events->send("Game", GameMessage("PAUSE", 40));
@@ -211,7 +210,7 @@ void boss1SetupLevel() {
 }
 
 static int boss1_dead() {
-	if (_G(boss_dead)) {
+	if (_G(bossDead)) {
 		for (int rep = 0; rep < 4; rep++) {
 			const int x1 = _G(actor[3 + rep])._lastX[_G(pge)];
 			const int y1 = _G(actor[3 + rep])._lastY[_G(pge)];
@@ -238,7 +237,7 @@ static int boss1_dead() {
 			_G(actor[3 + rep])._moveCountdown = _G(actor[3 + rep])._speed;
 		}
 		playSound(EXPLODE, true);
-		_G(boss_dead) = true;
+		_G(bossDead) = true;
 
 		for (int rep = 7; rep < MAX_ACTORS; rep++) {
 			if (_G(actor[rep])._active)
@@ -250,7 +249,7 @@ static int boss1_dead() {
 }
 
 void boss1ClosingSequence1() {
-	_G(game_over) = true;
+	_G(gameOver) = true;
 	musicPlay(4, true);
 	odinSpeaks(1001, 13, "CLOSING");
 }
@@ -273,9 +272,9 @@ void boss1ClosingSequence4() {
 	for (int rep = 0; rep < 16; rep++)
 		_G(scrn)._actorType[rep] = 0;
 
-	_G(boss_dead) = false;
+	_G(bossDead) = false;
 	_G(setup)._bossDead[0] = true;
-	_G(boss_active) = false;
+	_G(bossActive) = false;
 	_G(scrn)._music = 4;
 	showLevel(BOSS_LEVEL1);
 
diff --git a/engines/got/game/boss2.cpp b/engines/got/game/boss2.cpp
index 751382269b5..adaf0bca656 100644
--- a/engines/got/game/boss2.cpp
+++ b/engines/got/game/boss2.cpp
@@ -71,7 +71,7 @@ int boss2Movement(Actor *actor) {
 	default:
 		break;
 	}
-	if (_G(boss_dead))
+	if (_G(bossDead))
 		return boss2Die();
 
 	if (actor->_i1) {
@@ -199,7 +199,7 @@ void boss2CheckHit(Actor *actor, int x1, int y1, int x2, int y2, int act_num) {
 		}
 		
 		if (_G(actor[3])._health == 0) {
-			_G(boss_dead) = true;
+			_G(bossDead) = true;
 			for (int rep = 7; rep < MAX_ACTORS; rep++) {
 				if (_G(actor[rep])._active)
 					actorDestroyed(&_G(actor[rep]));
@@ -210,7 +210,7 @@ void boss2CheckHit(Actor *actor, int x1, int y1, int x2, int y2, int act_num) {
 
 void boss2SetupLevel() {
 	setupBoss(2);
-	_G(boss_active) = true;
+	_G(bossActive) = true;
 	musicPause();
 	playSound(BOSS11, true);
 
@@ -223,7 +223,7 @@ void boss2SetupLevel() {
 
 static int boss2Die() {
 	_G(thunderSnakeCounter) = 0;
-	if (_G(boss_dead)) {
+	if (_G(bossDead)) {
 		for (int rep = 0; rep < 4; rep++) {
 			const int x1 = _G(actor[3 + rep])._lastX[_G(pge)];
 			const int y1 = _G(actor[3 + rep])._lastY[_G(pge)];
@@ -252,7 +252,7 @@ static int boss2Die() {
 		}
 
 		playSound(EXPLODE, true);
-		_G(boss_dead) = true;
+		_G(bossDead) = true;
 	}
 
 	return _G(actor[3])._lastDir;
@@ -405,10 +405,10 @@ void boss2ClosingSequence4() {
 	for (int rep = 0; rep < 16; rep++)
 		_G(scrn)._actorType[rep] = 0;
 
-	_G(boss_dead) = false;
+	_G(bossDead) = false;
 	_G(setup)._bossDead[1] = true;
-	_G(game_over) = true;
-	_G(boss_active) = false;
+	_G(gameOver) = true;
+	_G(bossActive) = false;
 	_G(scrn)._music = 6;
 
 	showLevel(BOSS_LEVEL2);
diff --git a/engines/got/game/boss3.cpp b/engines/got/game/boss3.cpp
index 074897b8608..f8f6b43e0d3 100644
--- a/engines/got/game/boss3.cpp
+++ b/engines/got/game/boss3.cpp
@@ -224,7 +224,7 @@ int boss3Movement(Actor *actor) {
 
 	if (actor->_temp2)
 		actor->_temp2--;
-	if (_G(boss_dead))
+	if (_G(bossDead))
 		return bossDie();
 	boss3CheckHit();
 
@@ -436,7 +436,7 @@ static void boss3CheckHit() {
 			}
 
 			if (_G(actor[3])._health == 0) {
-				_G(boss_dead) = true;
+				_G(bossDead) = true;
 				for (int rep = 7; rep < MAX_ACTORS; rep++) {
 					if (_G(actor[rep])._active)
 						actorDestroyed(&_G(actor[rep]));
@@ -473,7 +473,7 @@ static void bossChangeMode() {
 
 void boss3SetupLevel() {
 	setupBoss(3);
-	_G(boss_active) = true;
+	_G(bossActive) = true;
 	musicPause();
 	playSound(BOSS11, true);
 
@@ -491,7 +491,7 @@ void boss3SetupLevel() {
 }
 
 static int bossDie() {
-	if (_G(boss_dead)) {
+	if (_G(bossDead)) {
 		for (int rep = 0; rep < 4; rep++) {
 			const int x1 = _G(actor[3 + rep])._lastX[_G(pge)];
 			const int y1 = _G(actor[3 + rep])._lastY[_G(pge)];
@@ -520,7 +520,7 @@ static int bossDie() {
 		}
 
 		playSound(EXPLODE, true);
-		_G(boss_dead) = true;
+		_G(bossDead) = true;
 	}
 
 	return _G(actor[3])._lastDir;
@@ -542,17 +542,17 @@ void boss3ClosingSequence3() {
 	for (int rep = 0; rep < 16; rep++)
 		_G(scrn)._actorType[rep] = 0;
 
-	_G(boss_dead) = false;
+	_G(bossDead) = false;
 	_G(setup)._bossDead[2] = true;
-	_G(game_over) = true;
-	_G(boss_active) = false;
+	_G(gameOver) = true;
+	_G(bossActive) = false;
 	_G(scrn)._music = 6;
 	showLevel(BOSS_LEVEL3);
 
 	_G(exitFlag) = 0;
 	musicPause();
 
-	_G(new_level) = ENDING_SCREEN;
+	_G(newLevel) = ENDING_SCREEN;
 	_G(thor)->_x = 152;
 	_G(thor)->_y = 160;
 	_G(thor)->_dir = 1;
@@ -565,7 +565,7 @@ void endingScreen() {
 	musicPlay(6, true);
 
 	memset(expf, 0, 4 * 8);
-	_G(endgame) = 1;
+	_G(endGame) = 1;
 
 	_G(exprow) = 0;
 	expCounter = 0;
@@ -606,17 +606,17 @@ int endgame_one() {
 
 	_G(scrn)._iconGrid[y / 16][x / 16] = _G(scrn)._backgroundColor;
 
-	_G(endgame++);
-	if (_G(endgame) > 32) {
+	_G(endGame++);
+	if (_G(endGame) > 32) {
 		_G(actor[34])._active = false;
-		_G(endgame) = 0;
+		_G(endGame) = 0;
 	}
 	return 1;
 }
 
 // Explode
 int endGameMovement() {
-	if (!_G(endgame))
+	if (!_G(endGame))
 		return 0;
 	if (expCounter > 3) {
 		endgame_one();
@@ -647,9 +647,9 @@ int endGameMovement() {
 	_G(scrn)._iconGrid[y / 16][x / 16] = _G(scrn)._backgroundColor;
 	_G(scrn)._iconGrid[(y / 16) - 4][x / 16] = _G(scrn)._backgroundColor;
 
-	_G(endgame++);
-	if (_G(endgame) > 8) {
-		_G(endgame) = 1;
+	_G(endGame++);
+	if (_G(endGame) > 8) {
+		_G(endGame) = 1;
 		_G(exprow++);
 		expCounter++;
 		if (expCounter > 3) {
diff --git a/engines/got/game/init.cpp b/engines/got/game/init.cpp
index 8aabf5cfa08..48914f5fcac 100644
--- a/engines/got/game/init.cpp
+++ b/engines/got/game/init.cpp
@@ -85,7 +85,7 @@ void initGame() {
 		_G(thorInfo)._score = 12455;
 		_G(setup)._difficultyLevel = 0;
 		_G(thorInfo)._inventory = 1 + 2;
-		_G(current_level) = 54;
+		_G(currentLevel) = 54;
 		_G(thorInfo)._selectedItem = 2;
 
 		File f("DEMO");
@@ -103,15 +103,12 @@ void initGame() {
 	_G(thor)->_moveCountdown = 6;
 
 	// Load level data
-	_G(new_level) = _G(current_level);
-	_G(scrn).load(_G(current_level));
-	showLevel(_G(current_level));
+	_G(newLevel) = _G(currentLevel);
+	_G(scrn).load(_G(currentLevel));
+	showLevel(_G(currentLevel));
+	_G(sound).musicPlay(_G(levelMusic), true);
 
-	if (!_G(auto_load)) {
-		_G(sound).musicPlay(_G(levelMusic), true);
-	}
-
-	g_vars->resetEndgameFlags();
+	g_vars->resetEndGameFlags();
 	_G(startup) = false;
 }
 
diff --git a/engines/got/game/main.cpp b/engines/got/game/main.cpp
index d6fe617e46d..52e2ca79efe 100644
--- a/engines/got/game/main.cpp
+++ b/engines/got/game/main.cpp
@@ -27,7 +27,7 @@ namespace Got {
 
 void setupLoad() {
 	_G(thor)->_active = true;
-	_G(new_level) = _G(thorInfo)._lastScreen;
+	_G(newLevel) = _G(thorInfo)._lastScreen;
 	_G(thor)->_x = (_G(thorInfo)._lastIcon % 20) * 16;
 	_G(thor)->_y = ((_G(thorInfo)._lastIcon / 20) * 16) - 1;
 	if (_G(thor)->_x < 1)
@@ -60,10 +60,10 @@ void setupLoad() {
 	_G(actor[2])._active = false;
 	_G(thor)->_moveCountdown = 6;
 
-	_G(scrn).load(_G(new_level));
+	_G(scrn).load(_G(newLevel));
 
-	_G(current_level) = _G(new_level);
-	showLevel(_G(new_level));
+	_G(currentLevel) = _G(newLevel);
+	showLevel(_G(newLevel));
 }
 
 void pause(int delay) {
diff --git a/engines/got/game/move.cpp b/engines/got/game/move.cpp
index 323c48f5d90..1c2a0a1a62e 100644
--- a/engines/got/game/move.cpp
+++ b/engines/got/game/move.cpp
@@ -97,9 +97,9 @@ void thorShoots() {
 }
 
 int killGoodGuy() {
-	if (!_G(killgg_inform) && !_G(thunderSnakeCounter)) {
+	if (!_G(killGoodGuyInform) && !_G(thunderSnakeCounter)) {
 		odinSpeaks(2010, 0);
-		_G(killgg_inform) = true;
+		_G(killGoodGuyInform) = true;
 	}
 
 	addScore(-1000);
@@ -361,7 +361,7 @@ void moveActor(Actor *actor) {
 		if (i != actor->_dir)
 			actor->_dir = i;
 
-		if (actor->_moveType == 0 && _G(current_level) != _G(new_level) && _G(shieldOn)) {
+		if (actor->_moveType == 0 && _G(currentLevel) != _G(newLevel) && _G(shieldOn)) {
 			_G(actor[2])._x = actor->_x - 2;
 			if (_G(actor[2])._x < 0)
 				_G(actor[2])._x = 0;
diff --git a/engines/got/game/move_patterns.cpp b/engines/got/game/move_patterns.cpp
index 9bba5fd0420..b8f4738f441 100644
--- a/engines/got/game/move_patterns.cpp
+++ b/engines/got/game/move_patterns.cpp
@@ -161,8 +161,8 @@ int checkMove0(const int x, const int y, Actor *actor) {
 	_G(thorIcon4) = 0;
 
 	if (x < 0) {
-		if (_G(current_level) > 0) {
-			_G(new_level) = _G(current_level) - 1;
+		if (_G(currentLevel) > 0) {
+			_G(newLevel) = _G(currentLevel) - 1;
 			actor->_x = 304;
 			actor->_lastX[0] = 304;
 			actor->_lastX[1] = 304;
@@ -176,8 +176,8 @@ int checkMove0(const int x, const int y, Actor *actor) {
 	}
 	
 	if (x > 306) {
-		if (_G(current_level) < 119) {
-			_G(new_level) = _G(current_level) + 1;
+		if (_G(currentLevel) < 119) {
+			_G(newLevel) = _G(currentLevel) + 1;
 			actor->_x = 0;
 			actor->_lastX[0] = 0;
 			actor->_lastX[1] = 0;
@@ -191,8 +191,8 @@ int checkMove0(const int x, const int y, Actor *actor) {
 	}
 	
 	if (y < 0) {
-		if (_G(current_level) > 9) {
-			_G(new_level) = _G(current_level) - 10;
+		if (_G(currentLevel) > 9) {
+			_G(newLevel) = _G(currentLevel) - 10;
 			actor->_y = 175;
 			actor->_lastY[0] = 175;
 			actor->_show = 0;
@@ -206,8 +206,8 @@ int checkMove0(const int x, const int y, Actor *actor) {
 	}
 	
 	if (y > 175) {
-		if (_G(current_level) < 110) {
-			_G(new_level) = _G(current_level) + 10;
+		if (_G(currentLevel) < 110) {
+			_G(newLevel) = _G(currentLevel) + 10;
 			actor->_y = 0;
 			actor->_lastY[0] = 0;
 			actor->_lastY[1] = 0;
@@ -405,7 +405,7 @@ int checkMove1(const int x, const int y, Actor *actor) {
 		const int y4 = act->_y + act->_sizeY - 1;
 
 		if (overlap(x1, y1, x2, y2, x3, y3, x4, y4)) {
-			if (_G(boss_active) && !GAME3) {
+			if (_G(bossActive) && !GAME3) {
 				switch (_G(area)) {
 				case 1:
 					boss1CheckHit(act, x1, y1, x2, y2, i);
@@ -979,7 +979,7 @@ int specialMovementThree(Actor *actor) {
 	if (_G(thunderSnakeCounter))
 		return 0;
 
-	long lind = (long)_G(current_level);
+	long lind = (long)_G(currentLevel);
 	lind *= 1000;
 	lind += (long)actor->_actorNum;
 	executeScript(lind, _G(odin));
@@ -1379,14 +1379,14 @@ int movementSix(Actor *actor) {
 		actor->_nextFrame++;
 		if (actor->_nextFrame > 2) {
 			actor->_nextFrame = 0;
-			if (_G(boss_dead))
+			if (_G(bossDead))
 				playSound(EXPLODE, false);
 		}
 		actor->_currNumShots--;
 	} else {
 		actor->_dead = 2;
 		actor->_active = false;
-		if (!_G(boss_dead) && !_G(endgame)) {
+		if (!_G(bossDead) && !_G(endGame)) {
 			if (actor->_type == 2)
 				dropRandomObject(actor);
 		}
diff --git a/engines/got/game/object.cpp b/engines/got/game/object.cpp
index f81f93c8ff9..afd164832cd 100644
--- a/engines/got/game/object.cpp
+++ b/engines/got/game/object.cpp
@@ -375,7 +375,7 @@ void useItem() {
 		_G(tornadoUsed) = false;
 	}
 
-	bool mf = _G(magic_inform);
+	const bool mf = _G(magicMissingInform);
 	switch (_G(thorInfo)._selectedItem) {
 	case 1:
 		ret = useApple(kf);
@@ -414,16 +414,19 @@ void useItem() {
 }
 
 void notEnoughMagic() {
-	if (!_G(magic_inform))
-		odinSpeaks(2006, 0);
+	if (_G(magicMissingInform))
+		return;
 
-	_G(magic_inform) = true;
+	odinSpeaks(2006, 0);
+	_G(magicMissingInform) = true;
 }
 
 void cannotCarryMore() {
-	if (!_G(carry_inform))
-		odinSpeaks(2007, 0);
-	_G(carry_inform) = true;
+	if (_G(cantCarryInform))
+		return;
+
+	odinSpeaks(2007, 0);
+	_G(cantCarryInform) = true;
 }
 
 void deleteObject() {
diff --git a/engines/got/game/script.cpp b/engines/got/game/script.cpp
index b1ed99a6b73..2c83342fb92 100644
--- a/engines/got/game/script.cpp
+++ b/engines/got/game/script.cpp
@@ -421,7 +421,7 @@ int Scripts::getInternalVariable() {
 		_lTemp = _G(thorInfo)._score;
 		break;
 	case 4:
-		_lTemp = _G(current_level);
+		_lTemp = _G(currentLevel);
 		break;
 	case 5:
 		_lTemp = _G(thorInfo)._keys;
@@ -906,7 +906,7 @@ int Scripts::cmd_setTile() {
 	if (tile < 0 || tile > 230)
 		return 6;
 
-	if (screen == _G(current_level)) {
+	if (screen == _G(currentLevel)) {
 		placeTile(pos % 20, pos / 20, tile);
 	} else {
 		Level tmp;
@@ -1027,10 +1027,10 @@ int Scripts::cmd_random() {
 void Scripts::scr_func1() {
 	playSound(FALL, true);
 
-	_G(new_level) = 109;
-	_G(new_level_tile) = 215;
-	_G(thor)->_x = (_G(new_level_tile) % 20) * 16;
-	_G(thor)->_y = ((_G(new_level_tile) / 20) * 16) - 2;
+	_G(newLevel) = 109;
+	_G(newLevelTile) = 215;
+	_G(thor)->_x = (_G(newLevelTile) % 20) * 16;
+	_G(thor)->_y = ((_G(newLevelTile) / 20) * 16) - 2;
 
 	_G(thor)->_lastX[0] = _G(thor)->_x;
 	_G(thor)->_lastX[1] = _G(thor)->_x;
@@ -1063,7 +1063,7 @@ void Scripts::scr_func3() {
 
 	_numVar[0] = 1;
 	playSound(WOOP, true);
-	if (_G(current_level) == 106 && p == 69) {
+	if (_G(currentLevel) == 106 && p == 69) {
 		placeTile(x, y, 220);
 		_G(keyFlag[key_magic]) = false;
 		return;
@@ -1073,10 +1073,10 @@ void Scripts::scr_func3() {
 	placeTile(x, y, 191);
 
 	if ((g_events->getRandomNumber(99)) < 25 ||
-		(_G(current_level) == 13 && p == 150 && !_G(setup).f26 && _G(setup).f28)) {
+		(_G(currentLevel) == 13 && p == 150 && !_G(setup).f26 && _G(setup).f28)) {
 		if (!_G(objectMap[p]) && _G(scrn)._iconGrid[y][x] >= 140) { // nothing there and solid
 			int o = g_events->getRandomNumber(1, 5);
-			if (_G(current_level) == 13 && p == 150 && !_G(setup).f26 && _G(setup).f28)
+			if (_G(currentLevel) == 13 && p == 150 && !_G(setup).f26 && _G(setup).f28)
 				o = 20;
 
 			_G(objectMap[p]) = o;
diff --git a/engines/got/game/special_tile.cpp b/engines/got/game/special_tile.cpp
index 315e28dff9b..e0ea8bc0f89 100644
--- a/engines/got/game/special_tile.cpp
+++ b/engines/got/game/special_tile.cpp
@@ -53,7 +53,7 @@ int specialTileThor(const int x, const int y, const int icon) {
 
 		if (_G(thor)->_x > 300)
 			// Ending bridge
-			_G(end_tile) = true;
+			_G(endTile) = true;
 		return 1;
 	case 203:
 		if (!GAME1) {
@@ -77,7 +77,7 @@ int specialTileThor(const int x, const int y, const int icon) {
 
 		if (GAME3) {
 			if (_G(thor)->_x < 4)
-				_G(end_tile) = true;
+				_G(endTile) = true;
 			return 1;
 		}
 		return 0;
@@ -174,14 +174,14 @@ int specialTileThor(const int x, const int y, const int icon) {
 			if (icon < 224 && icon > 219)
 				playSound(FALL, false);
 
-			_G(new_level) = _G(scrn)._newLevel[icon - 220 + (f * 6)];
+			_G(newLevel) = _G(scrn)._newLevel[icon - 220 + (f * 6)];
 			_G(warpScroll) = false;
-			if (_G(new_level) > 119) {
+			if (_G(newLevel) > 119) {
 				_G(warpScroll) = true;
-				_G(new_level) -= 128;
+				_G(newLevel) -= 128;
 			}
 
-			_G(new_level_tile) = _G(scrn)._newLevelLocation[icon - 220 + (f * 6)];
+			_G(newLevelTile) = _G(scrn)._newLevelLocation[icon - 220 + (f * 6)];
 			_G(warpFlag) = true;
 
 			if (_G(warpScroll)) {
@@ -194,8 +194,8 @@ int specialTileThor(const int x, const int y, const int icon) {
 				else if (_G(thor)->_dir == 3)
 					_G(thor)->_x = 0;
 			} else {
-				_G(thor)->_x = (_G(new_level_tile) % 20) * 16;
-				_G(thor)->_y = ((_G(new_level_tile) / 20) * 16) - 2;
+				_G(thor)->_x = (_G(newLevelTile) % 20) * 16;
+				_G(thor)->_y = ((_G(newLevelTile) / 20) * 16) - 2;
 			}
 			_G(thor)->_lastX[0] = _G(thor)->_x;
 			_G(thor)->_lastX[1] = _G(thor)->_x;
@@ -258,9 +258,9 @@ int openDoor1(const int y, const int x) {
 		return 1;
 	}
 
-	if (!_G(door_inform)) {
+	if (!_G(keyDoorInform)) {
 		odinSpeaks(2003, 0);
-		_G(door_inform) = true;
+		_G(keyDoorInform) = true;
 	}
 
 	return 0;
@@ -274,14 +274,14 @@ int cashDoor1(const int y, const int x, const int amount) {
 		return 1;
 	}
 
-	if (amount == 10 && !_G(cash1_inform)) {
+	if (amount == 10 && !_G(cashDoor1Inform)) {
 		odinSpeaks(2005, 0);
-		_G(cash1_inform) = true;
+		_G(cashDoor1Inform) = true;
 	}
 
-	if (amount == 100 && !_G(cash2_inform)) {
+	if (amount == 100 && !_G(cashDoor2Inform)) {
 		odinSpeaks(2004, 0);
-		_G(cash2_inform) = true;
+		_G(cashDoor2Inform) = true;
 	}
 
 	return 0;
diff --git a/engines/got/got.cpp b/engines/got/got.cpp
index c13632dd879..d2ce6e7acba 100644
--- a/engines/got/got.cpp
+++ b/engines/got/got.cpp
@@ -152,10 +152,10 @@ void GotEngine::savegameLoaded() {
 	_G(thor)->_moveCountdown = 6;
 	loadNewThor();
 
-	g_vars->resetEndgameFlags();
+	g_vars->resetEndGameFlags();
 
-	_G(setup)._musicEnabled = _G(music_flag);
-	_G(setup)._digitalSound = _G(sound_flag);
+	_G(setup)._musicEnabled = _G(musicFlag);
+	_G(setup)._digitalSound = _G(soundFlag);
 
 	if (_G(setup)._musicEnabled) {
 		if (GAME1 && _G(current_area) == 59) {
@@ -169,7 +169,7 @@ void GotEngine::savegameLoaded() {
 		_G(setup)._musicEnabled = false;
 	}
 
-	_G(game_over) = _G(setup)._gameOver != 0;
+	_G(gameOver) = _G(setup)._gameOver != 0;
 	_G(slowMode) = _G(setup)._slowMode;
 
 	g_events->replaceView("Game", true);
@@ -193,7 +193,7 @@ bool GotEngine::canSaveGameStateCurrently(Common::U32String *msg) {
 	}
 
 	// Don't allowing saving when not in-game
-	if (!firstView() || firstView()->getName() != "Game" || _G(game_over))
+	if (!firstView() || firstView()->getName() != "Game" || _G(gameOver))
 		return false;
 
 	// Only allow if not in the middle of area transition, dying, etc.
@@ -203,12 +203,10 @@ bool GotEngine::canSaveGameStateCurrently(Common::U32String *msg) {
 void GotEngine::syncSoundSettings() {
 	Engine::syncSoundSettings();
 
-	bool allSoundIsMuted = ConfMan.getBool("mute");
+	const bool allSoundIsMuted = ConfMan.getBool("mute");
 
-	_mixer->muteSoundType(Audio::Mixer::kSFXSoundType,
-						  ConfMan.getBool("sfx_mute") || allSoundIsMuted);
-	_mixer->muteSoundType(Audio::Mixer::kMusicSoundType,
-						  ConfMan.getBool("music_mute") || allSoundIsMuted);
+	_mixer->muteSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getBool("sfx_mute") || allSoundIsMuted);
+	_mixer->muteSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getBool("music_mute") || allSoundIsMuted);
 }
 
 void GotEngine::pauseEngineIntern(bool pause) {
diff --git a/engines/got/vars.cpp b/engines/got/vars.cpp
index cb2ff68bc37..2ee4b383f22 100644
--- a/engines/got/vars.cpp
+++ b/engines/got/vars.cpp
@@ -49,19 +49,18 @@ void Vars::load() {
 	_status.load();
 	_highScores.load();
 
-	_music_flag = !ConfMan.getBool("music_mute");
-	_sound_flag = !ConfMan.getBool("sfx_mute");
+	_musicFlag = !ConfMan.getBool("music_mute");
+	_soundFlag = !ConfMan.getBool("sfx_mute");
 
 	if (g_engine->isDemo()) {
 		_demo = _cheat = true;
-		_rdemo = ConfMan.getBool("rdemo");
 	}
 
-	if (_current_level != 23)
-		_story_flag = false;
+	if (_currentLevel != 23)
+		_storyFlag = false;
 
-	_setup._musicEnabled = _music_flag;
-	_setup._digitalSound = _sound_flag;
+	_setup._musicEnabled = _musicFlag;
+	_setup._digitalSound = _soundFlag;
 	_setup._speakerSound = false;
 	_setup._scrollFlag = true;
 	_setup._slowMode = _slowMode;
@@ -69,8 +68,6 @@ void Vars::load() {
 
 	_tmpBuff = new byte[TMP_SIZE];
 
-	resourceRead("RANDOM", _rnd_array);
-
 	Gfx::loadPalette();
 }
 
@@ -89,15 +86,15 @@ void Vars::setArea(int areaNum) {
 
 		switch (areaNum) {
 		case 1:
-			_current_level = 23;
+			_currentLevel = 23;
 			break;
 
 		case 2:
-			_current_level = 51;
+			_currentLevel = 51;
 			break;
 
 		case 3:
-			_current_level = 33;
+			_currentLevel = 33;
 			break;
 
 		default:
@@ -110,12 +107,11 @@ void Vars::clearKeyFlags() {
 	Common::fill(_keyFlag, _keyFlag + 100, 0);
 }
 
-void Vars::resetEndgameFlags() {
+void Vars::resetEndGameFlags() {
 	_gameMode = MODE_NORMAL;
-	_auto_load = false;
-	_end_tile = false;
-	_boss_dead = false;
-	_game_over = false;
+	_endTile = false;
+	_bossDead = false;
+	_gameOver = false;
 	_bossIntro1 = _bossIntro2 = false;
 }
 
diff --git a/engines/got/vars.h b/engines/got/vars.h
index 31ed87be505..d6a935c7b7f 100644
--- a/engines/got/vars.h
+++ b/engines/got/vars.h
@@ -93,7 +93,7 @@ public:
 	void load();
 	void setArea(int areaNum);
 	void clearKeyFlags();
-	void resetEndgameFlags();
+	void resetEndGameFlags();
 
 	Common::String _playerName = "ScummVM";
 	Gfx::GfxChunks _gfx;
@@ -169,8 +169,8 @@ public:
 	Actor _explosion;
 	Actor _sparkle;
 	ThorInfo _thorInfo;
-	bool _boss_dead = false;
-	byte _endgame = 0;
+	bool _bossDead = false;
+	byte _endGame = 0;
 
 	bool _warpFlag = false;
 
@@ -182,31 +182,25 @@ public:
 	bool _appleFlag = false;
 	int _switchUsed = 0;
 
-	byte _res_file[16] = {};
-	bool _music_flag = false, _sound_flag = false;
-	bool _cash1_inform = false;
-	bool _cash2_inform = false;
-	bool _door_inform = false;
-	bool _magic_inform = false;
-	bool _carry_inform = false;
-	bool _killgg_inform = false;
-
-	bool _boss_active = false;
-	bool _story_flag = true;
+	bool _musicFlag = false;
+	bool _soundFlag = false;
+	bool _cashDoor1Inform = false;
+	bool _cashDoor2Inform = false;
+	bool _keyDoorInform = false;
+	bool _magicMissingInform = false;
+	bool _cantCarryInform = false;
+	bool _killGoodGuyInform = false;
+
+	bool _bossActive = false;
+	bool _storyFlag = true;
 	int8 *_scr = nullptr;
 	bool _demo = false;
-	int _rnd_index = 0;
-	int _rnd_array[100] = {};
-	bool _rdemo = false;
-	int8 _test_sdf[80] = {};
-	bool _game_over = false;
-	char _tempstr[80] = {};
-	bool _auto_load = false;
-	bool _end_tile = false;
-	byte _pbuff[PALETTE_SIZE] = {};
-	int _current_level = 23;
-	int _new_level = 0;
-	int _new_level_tile = 0, _current_area = 0;
+	bool _gameOver = false;
+	bool _endTile = false;
+	int _currentLevel = 23;
+	int _newLevel = 0;
+	int _newLevelTile = 0;
+	int _current_area = 0;
 	char _sd_header[128] = {};
 	char _play_speed = 0;
 	bool _thor_special_flag = false;
diff --git a/engines/got/views/dialogs/main_menu.cpp b/engines/got/views/dialogs/main_menu.cpp
index d0ad3c96641..bc50336ada1 100644
--- a/engines/got/views/dialogs/main_menu.cpp
+++ b/engines/got/views/dialogs/main_menu.cpp
@@ -35,7 +35,7 @@ MainMenu::MainMenu() : SelectOption("MainMenu", "God of Thunder Menu",
 }
 
 bool MainMenu::msgFocus(const FocusMessage &msg) {
-	g_vars->resetEndgameFlags();
+	g_vars->resetEndGameFlags();
 	return SelectOption::msgFocus(msg);
 }
 
diff --git a/engines/got/views/game.cpp b/engines/got/views/game.cpp
index 3786f1394c5..41d19a6db3d 100644
--- a/engines/got/views/game.cpp
+++ b/engines/got/views/game.cpp
@@ -55,11 +55,11 @@ bool Game::msgKeypress(const KeypressMessage &msg) {
 	case Common::KEYCODE_f:
 		if (gDebugLevel > 0) {
 			// Hack used for testing end-game sequence
-			if (GAME1 && _G(current_level) == BOSS_LEVEL1)
+			if (GAME1 && _G(currentLevel) == BOSS_LEVEL1)
 				boss1ClosingSequence1();
-			else if (GAME2 && _G(current_level) == BOSS_LEVEL2)
+			else if (GAME2 && _G(currentLevel) == BOSS_LEVEL2)
 				boss2ClosingSequence1();
-			else if (GAME3 && _G(current_level) == BOSS_LEVEL3)
+			else if (GAME3 && _G(currentLevel) == BOSS_LEVEL3)
 				boss3ClosingSequence1();
 		}
 		break;
diff --git a/engines/got/views/game_content.cpp b/engines/got/views/game_content.cpp
index 582053caa16..e5ed77a9bda 100644
--- a/engines/got/views/game_content.cpp
+++ b/engines/got/views/game_content.cpp
@@ -54,9 +54,9 @@ void GameContent::draw() {
 	drawObjects(s);
 	drawActors(s);
 
-	if ((GAME1 && _G(current_level) == BOSS_LEVEL1) ||
-		(GAME2 && _G(current_level) == BOSS_LEVEL2) ||
-		(GAME3 && _G(current_level) == BOSS_LEVEL3))
+	if ((GAME1 && _G(currentLevel) == BOSS_LEVEL1) ||
+		(GAME2 && _G(currentLevel) == BOSS_LEVEL2) ||
+		(GAME3 && _G(currentLevel) == BOSS_LEVEL3))
 		drawBossHealth(s);
 
 	// If we're shaking the screen, render the content with the shake X/Y
@@ -147,7 +147,7 @@ bool GameContent::tick() {
 		checkForBossDead();
 		checkForCheats();
 
-		if (_G(endgame))
+		if (_G(endGame))
 			endGameMovement();
 		break;
 
@@ -210,8 +210,8 @@ bool GameContent::tick() {
 	checkForAreaChange();
 
 	// Check for end of game area
-	if (_G(end_tile)) {
-		_G(end_tile) = false;
+	if (_G(endTile)) {
+		_G(endTile) = false;
 		Gfx::fadeOut();
 
 		// Add name to high scores list if necessary, and then show it
@@ -362,7 +362,7 @@ void GameContent::moveActors() {
 			if (i == 0)
 				setThorVars();
 
-			if (_G(new_level) != _G(current_level))
+			if (_G(newLevel) != _G(currentLevel))
 				return;
 		}
 	}
@@ -382,7 +382,7 @@ void GameContent::updateActors() {
 }
 
 void GameContent::checkForBossDead() {
-	if (_G(boss_dead)) {
+	if (_G(bossDead)) {
 		int loop;
 		for (loop = 3; loop < 7; loop++) {
 			if (_G(actor[loop])._active)
@@ -390,11 +390,11 @@ void GameContent::checkForBossDead() {
 		}
 
 		if (loop == 7) {
-			_G(boss_dead) = false;
+			_G(bossDead) = false;
 
 			_G(exitFlag) = 0;
 
-			if (_G(boss_active)) {
+			if (_G(bossActive)) {
 				switch (_G(area)) {
 				case 1:
 					boss1ClosingSequence1();
@@ -409,7 +409,7 @@ void GameContent::checkForBossDead() {
 					break;
 				}
 
-				_G(boss_active) = false;
+				_G(bossActive) = false;
 			}
 		}
 	}
@@ -460,7 +460,7 @@ void GameContent::checkForAreaChange() {
 			showLevelDone();
 		}
 
-	} else if (_G(new_level) != _G(current_level)) {
+	} else if (_G(newLevel) != _G(currentLevel)) {
 		// Area transition beginning
 		_G(thor)->_show = 0;
 		_G(thor)->_active = false;
@@ -474,7 +474,7 @@ void GameContent::checkForAreaChange() {
 
 		// Set up new level
 		_G(thor)->_active = true;
-		showLevel(_G(new_level));
+		showLevel(_G(newLevel));
 	}
 }
 
@@ -508,7 +508,7 @@ void GameContent::thorDead() {
 	int li = _G(thorInfo)._selectedItem;
 	int ln = _G(thorInfo)._inventory;
 
-	_G(new_level) = _G(thorInfo)._lastScreen;
+	_G(newLevel) = _G(thorInfo)._lastScreen;
 	_G(thor)->_x = (_G(thorInfo)._lastIcon % 20) * 16;
 	_G(thor)->_y = ((_G(thorInfo)._lastIcon / 20) * 16) - 1;
 	if (_G(thor)->_x < 1)
@@ -552,12 +552,12 @@ void GameContent::thorDead() {
 	_G(thor)->_active = true;
 
 	// Load saved data for new level back into scrn
-	_G(scrn).load(_G(new_level));
+	_G(scrn).load(_G(newLevel));
 
 	_G(gameMode) = MODE_NORMAL;
 	_deathCtr = 0;
 
-	showLevel(_G(new_level));
+	showLevel(_G(newLevel));
 	setThorVars();
 }
 
diff --git a/engines/got/views/story.cpp b/engines/got/views/story.cpp
index 866eb55f1aa..19858327a55 100644
--- a/engines/got/views/story.cpp
+++ b/engines/got/views/story.cpp
@@ -33,11 +33,12 @@ namespace Views {
 bool Story::msgFocus(const FocusMessage &msg) {
 	resourceRead(Common::String::format("STORY%d", _G(area)), _G(tmpBuff));
 
-	resourceRead("STORYPAL", _G(pbuff));
+	byte paletteBuffer[PALETTE_SIZE] = {};
+	resourceRead("STORYPAL", paletteBuffer);
 
 	for (int i = 0; i < PALETTE_SIZE; ++i)
-		_G(pbuff[i]) = ((int)_G(pbuff[i]) * 255 + 31) / 63;
-	Gfx::setPalette(_G(pbuff));
+		paletteBuffer[i] = ((int)paletteBuffer[i] * 255 + 31) / 63;
+	Gfx::setPalette(paletteBuffer);
 
 	// Create story image and load in it's fragments
 	_surface.create(320, 240 * 2);




More information about the Scummvm-git-logs mailing list