[Scummvm-git-logs] scummvm master -> 9a5374898f5a171177cb435eefb3356dd9b57c41
Strangerke
noreply at scummvm.org
Thu Jan 23 07:55:38 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:
9a5374898f GOT: Check _slowMode usage, simplify some checks on keyFlag
Commit: 9a5374898f5a171177cb435eefb3356dd9b57c41
https://github.com/scummvm/scummvm/commit/9a5374898f5a171177cb435eefb3356dd9b57c41
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-23T08:55:33+01:00
Commit Message:
GOT: Check _slowMode usage, simplify some checks on keyFlag
Changed paths:
engines/got/game/move_patterns.cpp
engines/got/got.cpp
engines/got/vars.cpp
engines/got/vars.h
diff --git a/engines/got/game/move_patterns.cpp b/engines/got/game/move_patterns.cpp
index a778222b152..3a48d51935c 100644
--- a/engines/got/game/move_patterns.cpp
+++ b/engines/got/game/move_patterns.cpp
@@ -753,46 +753,42 @@ int movementZero(Actor *actor) {
}
}
_G(diag) = 0;
- if (_G(keyFlag[key_right])) {
- if (!_G(keyFlag[key_left])) {
- d = 3;
- actor->_dir = d;
- if (check_thor_move(x + 2, y, actor)) {
- nextFrame(actor);
- return d;
- }
+ if (_G(keyFlag[key_right]) && !_G(keyFlag[key_left])) {
+ d = 3;
+ actor->_dir = d;
+ if (check_thor_move(x + 2, y, actor)) {
+ nextFrame(actor);
+ return d;
}
}
- if (_G(keyFlag[key_left])) {
- if (!_G(keyFlag[key_right])) {
- d = 2;
- actor->_dir = d;
- if (check_thor_move(x - 2, y, actor)) {
- nextFrame(actor);
- return d;
- }
+
+ if (_G(keyFlag[key_left]) && !_G(keyFlag[key_right])) {
+ d = 2;
+ actor->_dir = d;
+ if (check_thor_move(x - 2, y, actor)) {
+ nextFrame(actor);
+ return d;
}
}
- if (_G(keyFlag[key_down])) {
- if (!_G(keyFlag[key_up])) {
- d = 1;
- actor->_dir = d;
- if (check_thor_move(x, y + 2, actor)) {
- nextFrame(actor);
- return d;
- }
+
+ if (_G(keyFlag[key_down]) && !_G(keyFlag[key_up])) {
+ d = 1;
+ actor->_dir = d;
+ if (check_thor_move(x, y + 2, actor)) {
+ nextFrame(actor);
+ return d;
}
}
- if (_G(keyFlag[key_up])) {
- if (!_G(keyFlag[key_down])) {
- d = 0;
- actor->_dir = d;
- if (check_thor_move(x, y - 2, actor)) {
- nextFrame(actor);
- return d;
- }
+
+ if (_G(keyFlag[key_up]) && !_G(keyFlag[key_down])) {
+ d = 0;
+ actor->_dir = d;
+ if (check_thor_move(x, y - 2, actor)) {
+ nextFrame(actor);
+ return d;
}
}
+
actor->_moveCounter = 5;
actor->_nextFrame = 0;
actor->_dir = oldDir;
diff --git a/engines/got/got.cpp b/engines/got/got.cpp
index 442e23c1e16..4211a3373a9 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(slowMode) = _G(setup)._slowMode != 0;
+ _G(slowMode) = _G(setup)._slowMode;
g_events->replaceView("Game", true);
setupLoad();
diff --git a/engines/got/vars.cpp b/engines/got/vars.cpp
index 9173f20339b..145b1b1cc5d 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 = _slowMode ? 1 : 0;
+ _setup._slowMode = _slowMode;
_setup._difficultyLevel = 1;
_tmp_buff = new byte[TMP_SIZE];
diff --git a/engines/got/vars.h b/engines/got/vars.h
index b8840ff14bc..600a82e4de1 100644
--- a/engines/got/vars.h
+++ b/engines/got/vars.h
@@ -115,7 +115,8 @@ public:
bool _slipFlag = false;
bool _slipping = false;
int _slipCount = 0;
- bool _bossIntro1 = false, _bossIntro2 = false;
+ bool _bossIntro1 = false;
+ bool _bossIntro2 = false;
int8 _pge = 0;
int _exitFlag = 0;
@@ -123,7 +124,8 @@ public:
byte _keyFlag[100] = {};
int8 _diag = 0;
bool _diagFlag = false;
- bool _slowMode = false, _startup = true;
+ bool _slowMode = false;
+ bool _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;
More information about the Scummvm-git-logs
mailing list