[Scummvm-git-logs] scummvm master -> 47e2e347e2ba6e4a93959bed9d01cd1499c29bd1

Strangerke noreply at scummvm.org
Thu Jan 23 07:43: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:
47e2e347e2 GOT: Some renaming in vars.h (WIP)


Commit: 47e2e347e2ba6e4a93959bed9d01cd1499c29bd1
    https://github.com/scummvm/scummvm/commit/47e2e347e2ba6e4a93959bed9d01cd1499c29bd1
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-23T08:43:02+01:00

Commit Message:
GOT: Some renaming in vars.h (WIP)

Changed paths:
    engines/got/events.cpp
    engines/got/game/back.cpp
    engines/got/game/boss1.cpp
    engines/got/game/boss3.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/select_slow.cpp
    engines/got/views/game_content.cpp


diff --git a/engines/got/events.cpp b/engines/got/events.cpp
index 78f1938d470..702e231e0df 100644
--- a/engines/got/events.cpp
+++ b/engines/got/events.cpp
@@ -173,7 +173,7 @@ void Events::processEvent(Common::Event &ev) {
 	case Common::EVENT_KEYDOWN:
 		if (!_G(demo)) {
 			if (ev.kbd.keycode < 100)
-				_G(key_flag[ev.kbd.keycode]) = true;
+				_G(keyFlag[ev.kbd.keycode]) = true;
 
 			if (ev.kbd.keycode < Common::KEYCODE_NUMLOCK)
 				msgKeypress(KeypressMessage(ev.kbd));
@@ -181,11 +181,11 @@ void Events::processEvent(Common::Event &ev) {
 		break;
 	case Common::EVENT_KEYUP:
 		if (!_G(demo) && ev.kbd.keycode < 100)
-			_G(key_flag[ev.kbd.keycode]) = false;
+			_G(keyFlag[ev.kbd.keycode]) = false;
 		break;
 	case Common::EVENT_CUSTOM_ENGINE_ACTION_START:
 		if (!_G(demo)) {
-			_G(key_flag[actionToKeyFlag(ev.customType)]) = true;
+			_G(keyFlag[actionToKeyFlag(ev.customType)]) = true;
 			msgAction(ActionMessage(ev.customType));
 		} else if (ev.customType == KEYBIND_ESCAPE) {
 			// The Escape action will return to main menu from demo
@@ -195,7 +195,7 @@ void Events::processEvent(Common::Event &ev) {
 		break;
 	case Common::EVENT_CUSTOM_ENGINE_ACTION_END:
 		if (!_G(demo))
-			_G(key_flag[actionToKeyFlag(ev.customType)]) = false;
+			_G(keyFlag[actionToKeyFlag(ev.customType)]) = false;
 		break;
 	case Common::EVENT_LBUTTONDOWN:
 	case Common::EVENT_RBUTTONDOWN:
@@ -256,7 +256,7 @@ void Events::processDemoEvent(byte ev) {
 		break;
 	}
 
-	_G(key_flag[ev]) = flag;
+	_G(keyFlag[ev]) = flag;
 
 	if (flag && action != -1)
 		msgAction(ActionMessage(action));
diff --git a/engines/got/game/back.cpp b/engines/got/game/back.cpp
index aca958bf049..ad42dfbaadf 100644
--- a/engines/got/game/back.cpp
+++ b/engines/got/game/back.cpp
@@ -182,7 +182,7 @@ static void odin_speaks_end() {
 	// In case Thor is now dead, flag as such
 	if (!_G(thor)->_health) {
 		_G(thor)->_show = 0;
-		_G(exit_flag) = 2;
+		_G(exitFlag) = 2;
 	}
 
 	// If there's an end message, pass it on to the view hierarchy.
@@ -330,7 +330,7 @@ void actorSpeaks(const Actor *actor, int index, int item) {
 
 	if (!_G(thor)->_health) {
 		_G(thor)->_show = 0;
-		_G(exit_flag) = 2;
+		_G(exitFlag) = 2;
 	}
 }
 
diff --git a/engines/got/game/boss1.cpp b/engines/got/game/boss1.cpp
index ae0482f7f3e..82a286affba 100644
--- a/engines/got/game/boss1.cpp
+++ b/engines/got/game/boss1.cpp
@@ -183,7 +183,7 @@ void boss1CheckHit(const Actor *actor, int x1, int y1, int x2, int y2, int act_n
 		if ((!_G(actor[3])._vulnerableCountdown) && (_G(actor[3])._nextFrame != 3) &&
 			overlap(x1, y1, x2, y2, actor->_x + 6, actor->_y + 4, actor->_x + 14, actor->_y + 20)) {
 			actorDamaged(&_G(actor[3]), _G(hammer)->_hitStrength);
-			if (_G(cheat) && _G(key_flag[_Z]))
+			if (_G(cheat) && _G(keyFlag[_Z]))
 				_G(actor[3])._health = 0;
 			else
 				_G(actor[3])._health -= 10;
diff --git a/engines/got/game/boss3.cpp b/engines/got/game/boss3.cpp
index 6f7fcdac166..45393b84673 100644
--- a/engines/got/game/boss3.cpp
+++ b/engines/got/game/boss3.cpp
@@ -420,7 +420,7 @@ static void boss3CheckHit() {
 		if (!_G(actor[3])._temp2) {
 			actorDamaged(&_G(actor[3]), 10);
 
-			if (_G(cheat) && _G(key_flag[_Z]))
+			if (_G(cheat) && _G(keyFlag[_Z]))
 				_G(actor[3])._health -= 50;
 			else
 				_G(actor[3])._health -= 10;
@@ -463,10 +463,10 @@ static void boss3CheckHit() {
 }
 
 static void bossChangeMode() {
-	if (!_G(boss_intro2)) {
+	if (!_G(bossIntro2)) {
 		Gfx::Pics loki("FACE18", 262);
 		executeScript(1003, loki);
-		_G(boss_intro2) = true;
+		_G(bossIntro2) = true;
 	}
 	
 	bossMode = 0;
@@ -481,10 +481,10 @@ void boss3SetupLevel() {
 
 	g_events->send("Game", GameMessage("PAUSE", 40));
 
-	if (!_G(boss_intro1)) {
+	if (!_G(bossIntro1)) {
 		Gfx::Pics loki("FACE18", 262);
 		executeScript(1002, loki);
-		_G(boss_intro1) = true;
+		_G(bossIntro1) = true;
 	}
 
 	musicPlay(7, true);
@@ -551,7 +551,7 @@ void boss3ClosingSequence3() {
 	_G(scrn)._music = 6;
 	showLevel(BOSS_LEVEL3);
 
-	_G(exit_flag) = 0;
+	_G(exitFlag) = 0;
 	musicPause();
 
 	_G(new_level) = ENDING_SCREEN;
diff --git a/engines/got/game/move.cpp b/engines/got/game/move.cpp
index aad4304b92b..bbbf4ee6853 100644
--- a/engines/got/game/move.cpp
+++ b/engines/got/game/move.cpp
@@ -173,7 +173,7 @@ void thorDamaged(Actor *actor) {
 			_G(thor)->_vulnerableCountdown = 40;
 			_G(thor)->_show = 0;
 			_G(thor)->_health = 0;
-			_G(exit_flag) = 2;
+			_G(exitFlag) = 2;
 			g_events->send(GameMessage("THOR_DIES"));
 		} else if (damage) {
 			_G(thor)->_vulnerableCountdown = 40;
diff --git a/engines/got/game/move_patterns.cpp b/engines/got/game/move_patterns.cpp
index 648d37efc59..a778222b152 100644
--- a/engines/got/game/move_patterns.cpp
+++ b/engines/got/game/move_patterns.cpp
@@ -285,13 +285,13 @@ int checkMove0(const int x, const int y, Actor *actor) {
 
 	if (!_G(slipFlag)) {
 		_G(slipping) = false;
-		_G(slip_cnt) = 0;
+		_G(slipCount) = 0;
 	}
 	
 	if (_G(slipFlag) && !_G(slipping))
-		_G(slip_cnt++);
+		_G(slipCount++);
 	
-	if (_G(slip_cnt) > 8)
+	if (_G(slipCount) > 8)
 		_G(slipping) = true;
 	
 	_G(slipFlag) = false;
@@ -333,7 +333,7 @@ int checkMove0(const int x, const int y, Actor *actor) {
 				if (!act->_vulnerableCountdown && (!(act->_type & 1)))
 					playSound(PUNCH1, false);
 
-				if (!_G(hammer)->_active && _G(key_flag[key_fire]))
+				if (!_G(hammer)->_active && _G(keyFlag[key_fire]))
 					actorDamaged(act, _G(hammer)->_hitStrength);
 				else
 					actorDamaged(act, _G(thor)->_hitStrength);
@@ -614,7 +614,7 @@ int check_thor_move(const int x, const int y, Actor *actor) {
 	if (checkMove0(x, y, actor))
 		return 1;
 	
-	if (_G(diag_flag) || _G(thor_special_flag))
+	if (_G(diagFlag) || _G(thor_special_flag))
 		return 0;
 
 	if (_G(thor_icon1) + _G(thor_icon2) + _G(thor_icon3) + _G(thor_icon4) > 1)
@@ -697,17 +697,17 @@ int movementZero(Actor *actor) {
 	}
 	int x = actor->_x;
 	int y = actor->_y;
-	_G(diag_flag) = false;
+	_G(diagFlag) = false;
 	if (actor->_moveCounter)
 		actor->_moveCounter--;
 
 	if (_G(slipping)) {
-		if (_G(slip_cnt) == 8)
+		if (_G(slipCount) == 8)
 			playSound(FALL, true);
 
 		y += 2;
-		_G(slip_cnt--);
-		if (!_G(slip_cnt))
+		_G(slipCount--);
+		if (!_G(slipCount))
 			_G(slipping) = false;
 
 		check_thor_move(x, y, actor);
@@ -715,46 +715,46 @@ int movementZero(Actor *actor) {
 		return d;
 	}
 
-	if (_G(key_flag[key_up]) && _G(key_flag[key_left])) {
+	if (_G(keyFlag[key_up]) && _G(keyFlag[key_left])) {
 		d = 2;
 		actor->_dir = d;
 		_G(diag) = 1;
-		_G(diag_flag) = true;
+		_G(diagFlag) = true;
 		if (check_thor_move(x - 2, y - 2, actor)) {
 			nextFrame(actor);
 			return d;
 		}
-	} else if (_G(key_flag[key_up]) && _G(key_flag[key_right])) {
+	} else if (_G(keyFlag[key_up]) && _G(keyFlag[key_right])) {
 		d = 3;
 		actor->_dir = d;
 		_G(diag) = 2;
-		_G(diag_flag) = true;
+		_G(diagFlag) = true;
 		if (check_thor_move(x + 2, y - 2, actor)) {
 			nextFrame(actor);
 			return d;
 		}
-	} else if (_G(key_flag[key_down]) && _G(key_flag[key_left])) {
+	} else if (_G(keyFlag[key_down]) && _G(keyFlag[key_left])) {
 		d = 2;
 		actor->_dir = d;
 		_G(diag) = 4;
-		_G(diag_flag) = true;
+		_G(diagFlag) = true;
 		if (check_thor_move(x - 2, y + 2, actor)) {
 			nextFrame(actor);
 			return d;
 		}
-	} else if (_G(key_flag[key_down]) && _G(key_flag[key_right])) {
+	} else if (_G(keyFlag[key_down]) && _G(keyFlag[key_right])) {
 		d = 3;
 		actor->_dir = d;
 		_G(diag) = 3;
-		_G(diag_flag) = true;
+		_G(diagFlag) = true;
 		if (check_thor_move(x + 2, y + 2, actor)) {
 			nextFrame(actor);
 			return d;
 		}
 	}
 	_G(diag) = 0;
-	if (_G(key_flag[key_right])) {
-		if (!_G(key_flag[key_left])) {
+	if (_G(keyFlag[key_right])) {
+		if (!_G(keyFlag[key_left])) {
 			d = 3;
 			actor->_dir = d;
 			if (check_thor_move(x + 2, y, actor)) {
@@ -763,8 +763,8 @@ int movementZero(Actor *actor) {
 			}
 		}
 	}
-	if (_G(key_flag[key_left])) {
-		if (!_G(key_flag[key_right])) {
+	if (_G(keyFlag[key_left])) {
+		if (!_G(keyFlag[key_right])) {
 			d = 2;
 			actor->_dir = d;
 			if (check_thor_move(x - 2, y, actor)) {
@@ -773,8 +773,8 @@ int movementZero(Actor *actor) {
 			}
 		}
 	}
-	if (_G(key_flag[key_down])) {
-		if (!_G(key_flag[key_up])) {
+	if (_G(keyFlag[key_down])) {
+		if (!_G(keyFlag[key_up])) {
 			d = 1;
 			actor->_dir = d;
 			if (check_thor_move(x, y + 2, actor)) {
@@ -783,8 +783,8 @@ int movementZero(Actor *actor) {
 			}
 		}
 	}
-	if (_G(key_flag[key_up])) {
-		if (!_G(key_flag[key_down])) {
+	if (_G(keyFlag[key_up])) {
+		if (!_G(keyFlag[key_down])) {
 			d = 0;
 			actor->_dir = d;
 			if (check_thor_move(x, y - 2, actor)) {
@@ -889,7 +889,7 @@ int checkSpecialMove1(const int x, const int y, Actor *actor) {
 
 // Block
 int specialMovementOne(Actor *actor) {
-	if (_G(diag_flag))
+	if (_G(diagFlag))
 		return 0;
 
 	const int d = _G(thor)->_dir;
@@ -1005,7 +1005,7 @@ int specialMovementFour(Actor *actor) {
 int specialMovementFive(Actor *actor) {
 	int d = _G(thor)->_dir;
 
-	if (_G(diag_flag)) {
+	if (_G(diagFlag)) {
 		switch (_G(diag)) {
 		case 1:
 			if (_G(thor_x1) < (actor->_x + 15))
@@ -1061,7 +1061,7 @@ int specialMovementSeven(Actor *actor) {
 }
 
 int specialMovementEight(Actor *actor) {
-	if (_G(thor)->_dir < 2 || _G(diag_flag))
+	if (_G(thor)->_dir < 2 || _G(diagFlag))
 		return 0;
 
 	actor->_lastDir = _G(thor)->_dir;
@@ -1070,7 +1070,7 @@ int specialMovementEight(Actor *actor) {
 }
 
 int specialMovementNine(Actor *actor) {
-	if (_G(thor)->_dir > 1 || _G(diag_flag))
+	if (_G(thor)->_dir > 1 || _G(diagFlag))
 		return 0;
 
 	actor->_lastDir = _G(thor)->_dir;
diff --git a/engines/got/game/object.cpp b/engines/got/game/object.cpp
index 83ee24c39b0..c2d4e3b0ede 100644
--- a/engines/got/game/object.cpp
+++ b/engines/got/game/object.cpp
@@ -378,7 +378,7 @@ bool useObject(int flag) {
 void useItem() {
 	bool ret = false;
 
-	int kf = _G(key_flag[key_magic]);
+	int kf = _G(keyFlag[key_magic]);
 
 	if (!kf && _G(tornado_used)) {
 		actorDestroyed(&_G(actor[2]));
diff --git a/engines/got/game/script.cpp b/engines/got/game/script.cpp
index e1c4e185496..2ae125d7e9d 100644
--- a/engines/got/game/script.cpp
+++ b/engines/got/game/script.cpp
@@ -141,7 +141,7 @@ void Scripts::runScript(bool firstTime) {
 
 void Scripts::scriptLoop() {
 	while (_paused == SCRIPT_READY) {
-		if (_G(cheat) && _G(key_flag[_B]))
+		if (_G(cheat) && _G(keyFlag[_B]))
 			break;
 
 		int ret = getCommand();
@@ -1049,12 +1049,12 @@ void Scripts::scr_func3() {
 
 	if (y < 0 || x < 0 || y > 11) {
 		playSound(BRAAPP, true);
-		_G(key_flag[key_magic]) = false;
+		_G(keyFlag[key_magic]) = false;
 		return;
 	}
 	if (_G(scrn)._iconGrid[y][x] < 174 || _G(scrn)._iconGrid[y][x] > 178) {
 		playSound(BRAAPP, true);
-		_G(key_flag[key_magic]) = false;
+		_G(keyFlag[key_magic]) = false;
 		return;
 	}
 
@@ -1062,11 +1062,11 @@ void Scripts::scr_func3() {
 	playSound(WOOP, true);
 	if (_G(current_level) == 106 && p == 69) {
 		placeTile(x, y, 220);
-		_G(key_flag[key_magic]) = false;
+		_G(keyFlag[key_magic]) = false;
 		return;
 	}
 
-	_G(key_flag[key_magic]) = false;
+	_G(keyFlag[key_magic]) = false;
 	placeTile(x, y, 191);
 
 	if ((g_events->getRandomNumber(99)) < 25 ||
diff --git a/engines/got/game/special_tile.cpp b/engines/got/game/special_tile.cpp
index 453819dc2ad..c164519ce2f 100644
--- a/engines/got/game/special_tile.cpp
+++ b/engines/got/game/special_tile.cpp
@@ -104,7 +104,7 @@ int specialTileThor(const int x, const int y, const int icon) {
 	case 211:
 		if (GAME1) {
 			placeTile(y, x, 79);
-			_G(exit_flag) = 2;
+			_G(exitFlag) = 2;
 		} else if (GAME2) {
 			if (_G(thor)->_dir == 0 && _G(setup).f29 && _G(setup).f21 && !_G(setup).f22) {
 				actorVisible(1);
diff --git a/engines/got/got.cpp b/engines/got/got.cpp
index 972cb14b0e1..442e23c1e16 100644
--- a/engines/got/got.cpp
+++ b/engines/got/got.cpp
@@ -170,7 +170,7 @@ void GotEngine::savegameLoaded() {
 	}
 
 	_G(game_over) = _G(setup)._gameOver != 0;
-	_G(slow_mode) = _G(setup)._slowMode != 0;
+	_G(slowMode) = _G(setup)._slowMode != 0;
 
 	g_events->replaceView("Game", true);
 	setupLoad();
diff --git a/engines/got/vars.cpp b/engines/got/vars.cpp
index d2ea75f1bf7..9173f20339b 100644
--- a/engines/got/vars.cpp
+++ b/engines/got/vars.cpp
@@ -64,7 +64,7 @@ void Vars::load() {
 	_setup._digitalSound = _sound_flag;
 	_setup._speakerSound = false;
 	_setup._scrollFlag = true;
-	_setup._slowMode = _slow_mode ? 1 : 0;
+	_setup._slowMode = _slowMode ? 1 : 0;
 	_setup._difficultyLevel = 1;
 
 	_tmp_buff = new byte[TMP_SIZE];
@@ -107,7 +107,7 @@ void Vars::setArea(int areaNum) {
 }
 
 void Vars::clearKeyFlags() {
-	Common::fill(_key_flag, _key_flag + 100, 0);
+	Common::fill(_keyFlag, _keyFlag + 100, 0);
 }
 
 void Vars::resetEndgameFlags() {
@@ -116,7 +116,7 @@ void Vars::resetEndgameFlags() {
 	_end_tile = false;
 	_boss_dead = false;
 	_game_over = false;
-	_boss_intro1 = _boss_intro2 = false;
+	_bossIntro1 = _bossIntro2 = false;
 }
 
 } // namespace Got
diff --git a/engines/got/vars.h b/engines/got/vars.h
index 944c594de1b..b8840ff14bc 100644
--- a/engines/got/vars.h
+++ b/engines/got/vars.h
@@ -114,16 +114,16 @@ public:
 	bool _useItemFlag = false;
 	bool _slipFlag = false;
 	bool _slipping = false;
-	int _slip_cnt = 0;
-	bool _boss_intro1 = false, _boss_intro2 = false;
+	int _slipCount = 0;
+	bool _bossIntro1 = false, _bossIntro2 = false;
 
 	int8 _pge = 0;
-	int _exit_flag = 0;
+	int _exitFlag = 0;
 
-	byte _key_flag[100] = {};
+	byte _keyFlag[100] = {};
 	int8 _diag = 0;
-	bool _diag_flag = false;
-	bool _slow_mode = false, _startup = true;
+	bool _diagFlag = false;
+	bool _slowMode = false, _startup = true;
 	bool _shot_ok = false;
 	int _thor_x1 = 0, _thor_y1 = 0, _thor_x2 = 0, _thor_y2 = 0, _thor_real_y1 = 0;
 	int _thor_pos = 0;
diff --git a/engines/got/views/dialogs/select_slow.cpp b/engines/got/views/dialogs/select_slow.cpp
index 105784bca95..f2169b1e4ce 100644
--- a/engines/got/views/dialogs/select_slow.cpp
+++ b/engines/got/views/dialogs/select_slow.cpp
@@ -34,10 +34,10 @@ SelectSlow::SelectSlow() : SelectOption("SelectSlow", "Fast Mode", OPTIONS) {
 void SelectSlow::selected() {
 	switch (_selectedItem) {
 	case 0:
-		_G(slow_mode) = true;
+		_G(slowMode) = true;
 		break;
 	case 1:
-		_G(slow_mode) = false;
+		_G(slowMode) = false;
 		break;
 	default:
 		break;
diff --git a/engines/got/views/game_content.cpp b/engines/got/views/game_content.cpp
index 9eacfecf330..ee457dca6de 100644
--- a/engines/got/views/game_content.cpp
+++ b/engines/got/views/game_content.cpp
@@ -395,7 +395,7 @@ void GameContent::checkForBossDead() {
 		if (loop == 7) {
 			_G(boss_dead) = false;
 
-			_G(exit_flag) = 0;
+			_G(exitFlag) = 0;
 
 			if (_G(boss_active)) {
 				switch (_G(area)) {




More information about the Scummvm-git-logs mailing list