[Scummvm-git-logs] scummvm master -> 4a1c737a7fcf2d49d581ef04f54c4a92499e5887
Strangerke
noreply at scummvm.org
Sat Jan 18 17:21:40 UTC 2025
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
53cf022b62 GOT: Small refactoring in Setup, start renaming thor_info
4a1c737a7f GOT: Some more renaming
Commit: 53cf022b626b857de7fd312b8668c91c4615fab2
https://github.com/scummvm/scummvm/commit/53cf022b626b857de7fd312b8668c91c4615fab2
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-18T18:20:15+01:00
Commit Message:
GOT: Small refactoring in Setup, start renaming thor_info
Changed paths:
engines/got/console.cpp
engines/got/data/setup.cpp
engines/got/data/setup.h
engines/got/data/thor_info.cpp
engines/got/data/thor_info.h
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_patterns.cpp
engines/got/game/object.cpp
engines/got/game/script.cpp
engines/got/game/status.cpp
engines/got/got.cpp
engines/got/vars.cpp
engines/got/vars.h
engines/got/views/dialogs/select_scroll.cpp
engines/got/views/game_content.cpp
engines/got/views/game_status.cpp
diff --git a/engines/got/console.cpp b/engines/got/console.cpp
index ebbcc42d9c9..cfb95490b8b 100644
--- a/engines/got/console.cpp
+++ b/engines/got/console.cpp
@@ -107,7 +107,7 @@ bool Console::cmdSave(int argc, const char **argv) {
}
bool Console::cmdMagic(int argc, const char **argv) {
- _G(thor_info).magic = (argc == 2) ? CLIP(atoi(argv[1]), 0, 150) : 150;
+ _G(thor_info)._magic = (argc == 2) ? CLIP(atoi(argv[1]), 0, 150) : 150;
return false;
}
diff --git a/engines/got/data/setup.cpp b/engines/got/data/setup.cpp
index 8eeba2682f8..f2a6cfb3e59 100644
--- a/engines/got/data/setup.cpp
+++ b/engines/got/data/setup.cpp
@@ -58,7 +58,8 @@ void Setup::sync(Common::Serializer &s) {
s.syncAsByte(_musicEnabled);
s.syncAsByte(_slowMode);
s.syncAsByte(_scrollFlag);
- s.syncBytes(_bossDead, 3);
+ for (int i = 0; i < 3 ; ++i)
+ s.syncAsByte(_bossDead[i]);
s.syncAsByte(_difficultyLevel);
s.syncAsByte(_gameOver);
s.syncBytes(_filler2, 19);
diff --git a/engines/got/data/setup.h b/engines/got/data/setup.h
index 3c545db9e6f..1969c4096db 100644
--- a/engines/got/data/setup.h
+++ b/engines/got/data/setup.h
@@ -102,15 +102,15 @@ struct SetupFlags {
struct Setup : public SetupFlags {
byte _value[16] = {};
byte _filler1 = 0;
- byte _game = 0;
- byte _areaNum = 0; //1,2,3
- byte _speakerSound = 0; //1=enabled
- byte _digitalSound = 0; //1 & !_speakerSound = enabled
- byte _musicEnabled = 0; //1=enabled
- byte _slowMode = 0; //1=slow mode (for slower 286's)
- byte _scrollFlag = 0; //unused
- byte _bossDead[3] = {};
- byte _difficultyLevel = 0; //0=easy, 1=normal, 2=hard
+ byte _game = 0; // Unused
+ byte _areaNum = 0; // 1,2,3
+ bool _speakerSound = false; // always disabled
+ bool _digitalSound = false; // true = enabled
+ bool _musicEnabled = false; // true = enabled
+ bool _slowMode = false; // true = slow mode (for slower 286's)
+ bool _scrollFlag = false; // true = scroll when changing from a room to the other
+ bool _bossDead[3] = {false, false, false};
+ byte _difficultyLevel = 0; // 0=easy, 1=normal, 2=hard
byte _gameOver = 0;
byte _filler2[19] = {};
diff --git a/engines/got/data/thor_info.cpp b/engines/got/data/thor_info.cpp
index 1294743fe08..f6b97a08122 100644
--- a/engines/got/data/thor_info.cpp
+++ b/engines/got/data/thor_info.cpp
@@ -26,7 +26,7 @@
namespace Got {
void THOR_INFO::clear() {
- magic = 0;
+ _magic = 0;
keys = 0;
jewels = 0;
last_area = 0;
@@ -55,7 +55,7 @@ void THOR_INFO::clear() {
void THOR_INFO::sync(Common::Serializer &s) {
uint32 ptr = 0;
- s.syncAsByte(magic);
+ s.syncAsByte(_magic);
s.syncAsByte(keys);
s.syncAsSint16LE(jewels);
s.syncAsByte(last_area);
diff --git a/engines/got/data/thor_info.h b/engines/got/data/thor_info.h
index f0bb6d64996..6e14adeec07 100644
--- a/engines/got/data/thor_info.h
+++ b/engines/got/data/thor_info.h
@@ -27,7 +27,7 @@
namespace Got {
struct THOR_INFO {
- byte magic = 0;
+ byte _magic = 0;
byte keys = 0;
int jewels = 0;
byte last_area = 0;
diff --git a/engines/got/game/back.cpp b/engines/got/game/back.cpp
index c584eafa5aa..003e671379d 100644
--- a/engines/got/game/back.cpp
+++ b/engines/got/game/back.cpp
@@ -128,7 +128,7 @@ void show_level_done() {
_G(current_level) = _G(new_level);
_G(thor_info).last_health = _G(thor)->_health;
- _G(thor_info).last_magic = _G(thor_info).magic;
+ _G(thor_info).last_magic = _G(thor_info)._magic;
_G(thor_info).last_jewels = _G(thor_info).jewels;
_G(thor_info).last_keys = _G(thor_info).keys;
_G(thor_info).last_score = _G(thor_info).score;
diff --git a/engines/got/game/boss1.cpp b/engines/got/game/boss1.cpp
index f9c5fed33b9..1b5fa375be0 100644
--- a/engines/got/game/boss1.cpp
+++ b/engines/got/game/boss1.cpp
@@ -282,7 +282,7 @@ void closing_sequence1_4() {
_G(scrn)._actorType[rep] = 0;
_G(boss_dead) = false;
- _G(setup)._bossDead[0] = 1;
+ _G(setup)._bossDead[0] = true;
_G(boss_active) = false;
_G(scrn)._music = 4;
show_level(BOSS_LEVEL1);
diff --git a/engines/got/game/boss2.cpp b/engines/got/game/boss2.cpp
index 90de3b494fa..586a50caa6a 100644
--- a/engines/got/game/boss2.cpp
+++ b/engines/got/game/boss2.cpp
@@ -405,7 +405,7 @@ void closing_sequence2_4() {
_G(scrn)._actorType[rep] = 0;
_G(boss_dead) = false;
- _G(setup)._bossDead[1] = 1;
+ _G(setup)._bossDead[1] = true;
_G(game_over) = true;
_G(boss_active) = false;
_G(scrn)._music = 6;
diff --git a/engines/got/game/boss3.cpp b/engines/got/game/boss3.cpp
index 9ed3658711f..d27e2c73e1b 100644
--- a/engines/got/game/boss3.cpp
+++ b/engines/got/game/boss3.cpp
@@ -534,7 +534,7 @@ void closing_sequence3_3() {
_G(scrn)._actorType[rep] = 0;
_G(boss_dead) = false;
- _G(setup)._bossDead[2] = 1;
+ _G(setup)._bossDead[2] = true;
_G(game_over) = true;
_G(boss_active) = false;
_G(scrn)._music = 6;
diff --git a/engines/got/game/init.cpp b/engines/got/game/init.cpp
index c1231216e75..61696bf9c91 100644
--- a/engines/got/game/init.cpp
+++ b/engines/got/game/init.cpp
@@ -40,7 +40,7 @@ void setup_player() {
_G(thor_info).inventory |= BOOTS_MAGIC + WIND_MAGIC;
_G(thor)->_health = 150;
- _G(thor_info).magic = _G(area) > 1 ? 150 : 0;
+ _G(thor_info)._magic = _G(area) > 1 ? 150 : 0;
_G(thor_info).jewels = 0;
_G(thor_info).score = 0;
_G(thor_info).keys = 0;
@@ -80,7 +80,7 @@ void initialize_game() {
if (_G(demo)) {
g_vars->setArea(1);
_G(thor)->_health = 100;
- _G(thor_info).magic = 100;
+ _G(thor_info)._magic = 100;
_G(thor_info).jewels = 463;
_G(thor_info).score = 12455;
_G(setup)._difficultyLevel = 0;
diff --git a/engines/got/game/main.cpp b/engines/got/game/main.cpp
index 617f313629b..feb17a749dd 100644
--- a/engines/got/game/main.cpp
+++ b/engines/got/game/main.cpp
@@ -41,7 +41,7 @@ void setup_load() {
_G(thor)->_dir = _G(thor_info).last_dir;
_G(thor)->_lastDir = _G(thor_info).last_dir;
_G(thor)->_health = _G(thor_info).last_health;
- _G(thor_info).magic = _G(thor_info).last_magic;
+ _G(thor_info)._magic = _G(thor_info).last_magic;
_G(thor_info).jewels = _G(thor_info).last_jewels;
_G(thor_info).keys = _G(thor_info).last_keys;
_G(thor_info).score = _G(thor_info).last_score;
diff --git a/engines/got/game/move_patterns.cpp b/engines/got/game/move_patterns.cpp
index 7af05300842..336dc409fcd 100644
--- a/engines/got/game/move_patterns.cpp
+++ b/engines/got/game/move_patterns.cpp
@@ -960,10 +960,10 @@ int special_movement_two(Actor *actr) {
play_sound(ANGEL, false);
_G(thor)->_health += 1;
}
- } else if (_G(thor_info).magic < 150) {
+ } else if (_G(thor_info)._magic < 150) {
if (!sound_playing())
play_sound(ANGEL, false);
- _G(thor_info).magic += 1;
+ _G(thor_info)._magic += 1;
}
return 1;
diff --git a/engines/got/game/object.cpp b/engines/got/game/object.cpp
index 80e76366b4c..dc5b5e8287e 100644
--- a/engines/got/game/object.cpp
+++ b/engines/got/game/object.cpp
@@ -65,14 +65,14 @@ void pick_up_object(int p) {
add_jewels(1);
break;
case 3: // Red potion
- if (_G(thor_info).magic >= 150) {
+ if (_G(thor_info)._magic >= 150) {
cannot_carry_more();
return;
}
add_magic(10);
break;
case 4: // Blue potion
- if (_G(thor_info).magic >= 150) {
+ if (_G(thor_info)._magic >= 150) {
cannot_carry_more();
return;
}
@@ -215,7 +215,7 @@ int use_apple(int flag) {
if (_G(thor)->_health == 150)
return 0;
- if (flag && _G(thor_info).magic > 0) {
+ if (flag && _G(thor_info)._magic > 0) {
if (!_G(apple_flag)) {
_G(magic_cnt) = 0;
add_magic(-2);
@@ -241,7 +241,7 @@ int use_apple(int flag) {
int use_thunder(int flag) {
- if (flag && _G(thor_info).magic > 29) {
+ if (flag && _G(thor_info)._magic > 29) {
if (!_G(thunder_flag)) {
add_magic(-30);
play_sound(THUNDER, false);
@@ -260,7 +260,7 @@ int use_thunder(int flag) {
int use_boots(int flag) {
if (flag) {
- if (_G(thor_info).magic > 0) {
+ if (_G(thor_info)._magic > 0) {
if (_G(thor)->_numMoves == 1) {
_G(magic_cnt) = 0;
add_magic(-1);
@@ -286,7 +286,7 @@ int use_boots(int flag) {
int use_shield(int flag) {
if (flag) {
- if (_G(thor_info).magic) {
+ if (_G(thor_info)._magic) {
if (!_G(shield_on)) {
_G(magic_cnt) = 0;
add_magic(-1);
@@ -319,7 +319,7 @@ int use_shield(int flag) {
int use_lightning(int flag) {
if (flag) {
- if (_G(thor_info).magic > 14) {
+ if (_G(thor_info)._magic > 14) {
add_magic(-15);
g_events->send("Game", GameMessage("THROW_LIGHTNING"));
} else {
@@ -332,7 +332,7 @@ int use_lightning(int flag) {
int use_tornado(int flag) {
if (flag) {
- if (_G(thor_info).magic > 10) {
+ if (_G(thor_info)._magic > 10) {
if (!_G(tornado_used) && !_G(actor[2])._dead && _G(magic_cnt) > 20) {
_G(magic_cnt) = 0;
add_magic(-10);
@@ -355,7 +355,7 @@ int use_tornado(int flag) {
add_magic(-1);
}
}
- if (_G(thor_info).magic < 1) {
+ if (_G(thor_info)._magic < 1) {
actor_destroyed(&_G(actor[2]));
_G(tornado_used) = false;
not_enough_magic();
diff --git a/engines/got/game/script.cpp b/engines/got/game/script.cpp
index 7817520be11..cbfb22a7086 100644
--- a/engines/got/game/script.cpp
+++ b/engines/got/game/script.cpp
@@ -408,7 +408,7 @@ int Scripts::get_internal_variable() {
_lTemp = _G(thor)->_health;
break;
case 2:
- _lTemp = _G(thor_info).magic;
+ _lTemp = _G(thor_info)._magic;
break;
case 3:
_lTemp = _G(thor_info).score;
diff --git a/engines/got/game/status.cpp b/engines/got/game/status.cpp
index 481078bccc4..293d3a8c750 100644
--- a/engines/got/game/status.cpp
+++ b/engines/got/game/status.cpp
@@ -34,7 +34,7 @@ void add_score(int num) {
}
void add_magic(int num) {
- _G(thor_info).magic = CLIP(_G(thor_info).magic + num, 0, 150);
+ _G(thor_info)._magic = CLIP(_G(thor_info)._magic + num, 0, 150);
}
void add_health(int num) {
diff --git a/engines/got/got.cpp b/engines/got/got.cpp
index 3ce14014554..de399fa80d8 100644
--- a/engines/got/got.cpp
+++ b/engines/got/got.cpp
@@ -21,7 +21,6 @@
#include "got/got.h"
#include "common/config-manager.h"
-#include "common/debug-channels.h"
#include "common/events.h"
#include "common/scummsys.h"
#include "common/system.h"
@@ -156,20 +155,19 @@ void GotEngine::savegameLoaded() {
g_vars->resetEndgameFlags();
- if (!_G(music_flag))
- _G(setup)._musicEnabled = 0;
- if (!_G(sound_flag))
- _G(setup)._digitalSound = 0;
- if (_G(setup)._musicEnabled == 1) {
+ _G(setup)._musicEnabled = _G(music_flag);
+ _G(setup)._digitalSound = _G(sound_flag);
+
+ if (_G(setup)._musicEnabled) {
if (GAME1 && _G(current_area) == 59) {
music_play(5, true);
} else {
music_play(_G(levelMusic), true);
}
} else {
- _G(setup)._musicEnabled = 1;
+ _G(setup)._musicEnabled = true;
music_pause();
- _G(setup)._musicEnabled = 0;
+ _G(setup)._musicEnabled = false;
}
_G(game_over) = _G(setup)._gameOver != 0;
diff --git a/engines/got/vars.cpp b/engines/got/vars.cpp
index 3ada6b1fcaa..e90a5569830 100644
--- a/engines/got/vars.cpp
+++ b/engines/got/vars.cpp
@@ -50,7 +50,7 @@ void Vars::load() {
_highScores.load();
_music_flag = !ConfMan.getBool("music_mute");
- _sound_flag = _pcsound_flag = !ConfMan.getBool("sfx_mute");
+ _sound_flag = !ConfMan.getBool("sfx_mute");
if (g_engine->isDemo()) {
_demo = _cheat = true;
@@ -62,9 +62,7 @@ void Vars::load() {
_setup._musicEnabled = _music_flag;
_setup._digitalSound = _sound_flag;
- _setup._speakerSound = _pcsound_flag;
- if (_sound_flag)
- _setup._speakerSound = false;
+ _setup._speakerSound = false;
_setup._scrollFlag = true;
_setup._slowMode = _slow_mode ? 1 : 0;
_setup._difficultyLevel = 1;
diff --git a/engines/got/vars.h b/engines/got/vars.h
index 0fc2bafd6cd..014a4981dac 100644
--- a/engines/got/vars.h
+++ b/engines/got/vars.h
@@ -184,7 +184,7 @@ public:
int _switch_flag = 0;
byte _res_file[16] = {};
- bool _music_flag = false, _sound_flag = false, _pcsound_flag = false;
+ bool _music_flag = false, _sound_flag = false;
bool _cash1_inform = false;
bool _cash2_inform = false;
bool _door_inform = false;
diff --git a/engines/got/views/dialogs/select_scroll.cpp b/engines/got/views/dialogs/select_scroll.cpp
index cb6d9464503..076d5dd173e 100644
--- a/engines/got/views/dialogs/select_scroll.cpp
+++ b/engines/got/views/dialogs/select_scroll.cpp
@@ -30,12 +30,12 @@ SelectScroll::SelectScroll() : SelectOption("SelectScroll", "Scroll Between Scre
}
bool SelectScroll::msgFocus(const FocusMessage &msg) {
- _selectedItem = 1 - _G(setup)._scrollFlag;
+ _selectedItem = 1 - (_G(setup)._scrollFlag ? 1 : 0);
return true;
}
void SelectScroll::selected() {
- _G(setup)._scrollFlag = (_selectedItem == 0) ? 1 : 0;
+ _G(setup)._scrollFlag = (_selectedItem == 0);
_G(last_setup) = _G(setup);
}
diff --git a/engines/got/views/game_content.cpp b/engines/got/views/game_content.cpp
index 1d978ffc971..c1d2d482f54 100644
--- a/engines/got/views/game_content.cpp
+++ b/engines/got/views/game_content.cpp
@@ -183,8 +183,8 @@ bool GameContent::tick() {
add_health(-1);
add_score(10);
- } else if (_G(thor_info).magic > 0) {
- _G(thor_info).magic--;
+ } else if (_G(thor_info)._magic > 0) {
+ _G(thor_info)._magic--;
play_sound(WOOP, 1);
add_magic(-1);
add_score(10);
@@ -525,7 +525,7 @@ void GameContent::thorDead() {
_G(thor)->_dir = _G(thor_info).last_dir;
_G(thor)->_lastDir = _G(thor_info).last_dir;
_G(thor)->_health = _G(thor_info).last_health;
- _G(thor_info).magic = _G(thor_info).last_magic;
+ _G(thor_info)._magic = _G(thor_info).last_magic;
_G(thor_info).jewels = _G(thor_info).last_jewels;
_G(thor_info).keys = _G(thor_info).last_keys;
_G(thor_info).score = _G(thor_info).last_score;
@@ -571,7 +571,7 @@ void GameContent::checkForCheats() {
if (_G(cheats).freezeHealth)
_G(thor)->_health = 150;
if (_G(cheats).freezeMagic)
- _G(thor_info).magic = 150;
+ _G(thor_info)._magic = 150;
if (_G(cheats).freezeJewels)
_G(thor_info).jewels = 999;
}
diff --git a/engines/got/views/game_status.cpp b/engines/got/views/game_status.cpp
index d6a4cffbf62..24301d48780 100644
--- a/engines/got/views/game_status.cpp
+++ b/engines/got/views/game_status.cpp
@@ -53,7 +53,7 @@ void GameStatus::displayHealth(GfxSurface &s) {
}
void GameStatus::displayMagic(GfxSurface &s) {
- int b = 59 + _G(thor_info).magic;
+ int b = 59 + _G(thor_info)._magic;
s.fillRect(Common::Rect(59, 20, b, 24), 96);
s.fillRect(Common::Rect(b, 20, 209, 24), STAT_COLOR);
Commit: 4a1c737a7fcf2d49d581ef04f54c4a92499e5887
https://github.com/scummvm/scummvm/commit/4a1c737a7fcf2d49d581ef04f54c4a92499e5887
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-18T18:21:20+01:00
Commit Message:
GOT: Some more renaming
Changed paths:
A engines/got/data/highscores.cpp
A engines/got/data/highscores.h
A engines/got/data/thorinfo.cpp
A engines/got/data/thorinfo.h
R engines/got/data/high_scores.cpp
R engines/got/data/high_scores.h
R engines/got/data/thor_info.cpp
R engines/got/data/thor_info.h
engines/got/game/back.cpp
engines/got/game/back.h
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/game/status.cpp
engines/got/gfx/image.cpp
engines/got/got.cpp
engines/got/module.mk
engines/got/vars.h
engines/got/views/dialogs/options_menu.cpp
engines/got/views/dialogs/select_item.cpp
engines/got/views/game.cpp
engines/got/views/game_content.cpp
engines/got/views/game_status.cpp
diff --git a/engines/got/data/high_scores.cpp b/engines/got/data/highscores.cpp
similarity index 98%
rename from engines/got/data/high_scores.cpp
rename to engines/got/data/highscores.cpp
index 67145269848..5692506d2d3 100644
--- a/engines/got/data/high_scores.cpp
+++ b/engines/got/data/highscores.cpp
@@ -19,10 +19,10 @@
*
*/
-#include "got/data/high_scores.h"
#include "common/file.h"
#include "common/savefile.h"
#include "common/system.h"
+#include "got/data/highscores.h"
#include "got/got.h"
namespace Got {
diff --git a/engines/got/data/high_scores.h b/engines/got/data/highscores.h
similarity index 100%
rename from engines/got/data/high_scores.h
rename to engines/got/data/highscores.h
diff --git a/engines/got/data/thor_info.cpp b/engines/got/data/thor_info.cpp
deleted file mode 100644
index f6b97a08122..00000000000
--- a/engines/got/data/thor_info.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * as.syncAsUint32LE(with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "got/data/thor_info.h"
-#include "common/algorithm.h"
-#include "got/game/back.h"
-
-namespace Got {
-
-void THOR_INFO::clear() {
- _magic = 0;
- keys = 0;
- jewels = 0;
- last_area = 0;
- last_screen = 0;
- last_icon = 0;
- last_dir = 0;
- inventory = 0;
- item = 0;
- last_health = 0;
- last_magic = 0;
- last_jewels = 0;
- last_keys = 0;
- last_item = 0;
- last_inventory = 0;
- level = 0;
- score = 0;
- last_score = 0;
- object = 0;
- object_name = nullptr;
- last_object = 0;
- last_object_name = nullptr;
- armor = 0;
- Common::fill(future, future + 65, 0);
-}
-
-void THOR_INFO::sync(Common::Serializer &s) {
- uint32 ptr = 0;
-
- s.syncAsByte(_magic);
- s.syncAsByte(keys);
- s.syncAsSint16LE(jewels);
- s.syncAsByte(last_area);
- s.syncAsByte(last_screen);
- s.syncAsByte(last_icon);
- s.syncAsByte(last_dir);
- s.syncAsSint16LE(inventory);
- s.syncAsByte(item);
- s.syncAsByte(last_health);
- s.syncAsByte(last_magic);
- s.syncAsSint16LE(last_jewels);
- s.syncAsByte(last_keys);
- s.syncAsByte(last_item);
- s.syncAsSint16LE(last_inventory);
- s.syncAsByte(level);
- s.syncAsUint32LE(score);
- s.syncAsUint32LE(last_score);
-
- s.syncAsByte(object);
- s.syncAsUint16LE(ptr);
- s.syncAsByte(last_object);
- s.syncAsUint16LE(ptr);
-
- s.syncAsByte(armor);
- s.syncBytes(future, 65);
-
- if (s.isLoading()) {
- object_name = (object == 0) ? nullptr : OBJECT_NAMES[object - 1];
- last_object_name = (last_object == 0) ? nullptr : OBJECT_NAMES[last_object - 1];
- }
-}
-
-} // namespace Got
diff --git a/engines/got/data/thorinfo.cpp b/engines/got/data/thorinfo.cpp
new file mode 100644
index 00000000000..acca6cd7c13
--- /dev/null
+++ b/engines/got/data/thorinfo.cpp
@@ -0,0 +1,91 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * as.syncAsUint32LE(with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/algorithm.h"
+#include "got/data/thorinfo.h"
+#include "got/game/back.h"
+
+namespace Got {
+
+void ThorInfo::clear() {
+ _magic = 0;
+ _keys = 0;
+ _jewels = 0;
+ _lastArea = 0;
+ _lastScreen = 0;
+ _lastIcon = 0;
+ _lastDir = 0;
+ _inventory = 0;
+ _selectedItem = 0;
+ _lastHealth = 0;
+ _lastMagic = 0;
+ _lastJewels = 0;
+ _lastKeys = 0;
+ _lastItem = 0;
+ _lastInventory = 0;
+ _level = 0;
+ _score = 0;
+ _lastScore = 0;
+ _object = 0;
+ _objectName = nullptr;
+ _lastObject = 0;
+ _lastObjectName = nullptr;
+ _armor = 0;
+ Common::fill(_filler, _filler + 65, 0);
+}
+
+void ThorInfo::sync(Common::Serializer &s) {
+ uint32 ptr = 0;
+
+ s.syncAsByte(_magic);
+ s.syncAsByte(_keys);
+ s.syncAsSint16LE(_jewels);
+ s.syncAsByte(_lastArea);
+ s.syncAsByte(_lastScreen);
+ s.syncAsByte(_lastIcon);
+ s.syncAsByte(_lastDir);
+ s.syncAsSint16LE(_inventory);
+ s.syncAsByte(_selectedItem);
+ s.syncAsByte(_lastHealth);
+ s.syncAsByte(_lastMagic);
+ s.syncAsSint16LE(_lastJewels);
+ s.syncAsByte(_lastKeys);
+ s.syncAsByte(_lastItem);
+ s.syncAsSint16LE(_lastInventory);
+ s.syncAsByte(_level);
+ s.syncAsUint32LE(_score);
+ s.syncAsUint32LE(_lastScore);
+
+ s.syncAsByte(_object);
+ s.syncAsUint16LE(ptr);
+ s.syncAsByte(_lastObject);
+ s.syncAsUint16LE(ptr);
+
+ s.syncAsByte(_armor);
+ s.syncBytes(_filler, 65);
+
+ if (s.isLoading()) {
+ _objectName = (_object == 0) ? nullptr : OBJECT_NAMES[_object - 1];
+ _lastObjectName = (_lastObject == 0) ? nullptr : OBJECT_NAMES[_lastObject - 1];
+ }
+}
+
+} // namespace Got
diff --git a/engines/got/data/thor_info.h b/engines/got/data/thorinfo.h
similarity index 64%
rename from engines/got/data/thor_info.h
rename to engines/got/data/thorinfo.h
index 6e14adeec07..89437b4c225 100644
--- a/engines/got/data/thor_info.h
+++ b/engines/got/data/thorinfo.h
@@ -26,31 +26,31 @@
namespace Got {
-struct THOR_INFO {
+struct ThorInfo {
byte _magic = 0;
- byte keys = 0;
- int jewels = 0;
- byte last_area = 0;
- byte last_screen = 0;
- byte last_icon = 0;
- byte last_dir = 0;
- int inventory = 0;
- byte item = 0; //currently selected item
- byte last_health = 0;
- byte last_magic = 0;
- int last_jewels = 0;
- byte last_keys = 0;
- byte last_item = 0;
- int last_inventory = 0;
- byte level = 0; //current level (1,2,3)
- long score = 0;
- long last_score = 0;
- byte object = 0;
- const char *object_name = nullptr;
- byte last_object = 0;
- const char *last_object_name = nullptr;
- byte armor = 0;
- byte future[65] = {};
+ byte _keys = 0;
+ int _jewels = 0;
+ byte _lastArea = 0;
+ byte _lastScreen = 0;
+ byte _lastIcon = 0;
+ byte _lastDir = 0;
+ int _inventory = 0;
+ byte _selectedItem = 0; //currently selected item
+ byte _lastHealth = 0;
+ byte _lastMagic = 0;
+ int _lastJewels = 0;
+ byte _lastKeys = 0;
+ byte _lastItem = 0;
+ int _lastInventory = 0;
+ byte _level = 0; //current level (1,2,3)
+ long _score = 0;
+ long _lastScore = 0;
+ byte _object = 0;
+ const char *_objectName = nullptr;
+ byte _lastObject = 0;
+ const char *_lastObjectName = nullptr;
+ byte _armor = 0;
+ byte _filler[65] = {};
void clear();
void sync(Common::Serializer &s);
diff --git a/engines/got/game/back.cpp b/engines/got/game/back.cpp
index 003e671379d..bd86703b7c1 100644
--- a/engines/got/game/back.cpp
+++ b/engines/got/game/back.cpp
@@ -45,7 +45,7 @@ const char *ITEM_NAMES[] = {
static const char *odinEndMessage;
-void show_level(int new_level) {
+void showLevel(int new_level) {
_G(boss_active) = false;
if (!_G(shield_on))
_G(actor[2])._active = false;
@@ -72,7 +72,7 @@ void show_level(int new_level) {
// The original was probably shortly displaying Thor in direction 0 before switching back to its prior position.
// This behavior wasn't noticed during initial playthrough by Dreammaster - Warning has been added so it can be checked eventually.
if (_G(scrn)._iconGrid[_G(thor)->_centerY][_G(thor)->_centerX] == 154)
- warning("show_level - Potential short move missing");
+ warning("showLevel - Potential short move missing");
if (_G(warp_flag))
_G(current_level) = new_level - 5; // Force phase
@@ -99,7 +99,7 @@ void show_level(int new_level) {
switch (_G(new_level) - _G(current_level)) {
case 0:
// Nothing to do
- show_level_done();
+ showLevelDone();
break;
case -1:
_G(gameMode) = MODE_AREA_CHANGE;
@@ -124,21 +124,21 @@ void show_level(int new_level) {
}
}
-void show_level_done() {
+void showLevelDone() {
_G(current_level) = _G(new_level);
- _G(thor_info).last_health = _G(thor)->_health;
- _G(thor_info).last_magic = _G(thor_info)._magic;
- _G(thor_info).last_jewels = _G(thor_info).jewels;
- _G(thor_info).last_keys = _G(thor_info).keys;
- _G(thor_info).last_score = _G(thor_info).score;
- _G(thor_info).last_item = _G(thor_info).item;
- _G(thor_info).last_screen = _G(current_level);
- _G(thor_info).last_icon = ((_G(thor)->_x + 8) / 16) + (((_G(thor)->_y + 14) / 16) * 20);
- _G(thor_info).last_dir = _G(thor)->_dir;
- _G(thor_info).last_inventory = _G(thor_info).inventory;
- _G(thor_info).last_object = _G(thor_info).object;
- _G(thor_info).last_object_name = _G(thor_info).object_name;
+ _G(thor_info)._lastHealth = _G(thor)->_health;
+ _G(thor_info)._lastMagic = _G(thor_info)._magic;
+ _G(thor_info)._lastJewels = _G(thor_info)._jewels;
+ _G(thor_info)._lastKeys = _G(thor_info)._keys;
+ _G(thor_info)._lastScore = _G(thor_info)._score;
+ _G(thor_info)._lastItem = _G(thor_info)._selectedItem;
+ _G(thor_info)._lastScreen = _G(current_level);
+ _G(thor_info)._lastIcon = ((_G(thor)->_x + 8) / 16) + (((_G(thor)->_y + 14) / 16) * 20);
+ _G(thor_info)._lastDir = _G(thor)->_dir;
+ _G(thor_info)._lastInventory = _G(thor_info)._inventory;
+ _G(thor_info)._lastObject = _G(thor_info)._object;
+ _G(thor_info)._lastObjectName = _G(thor_info)._objectName;
_G(last_setup) = _G(setup);
@@ -186,18 +186,18 @@ static void odin_speaks_end() {
// If there's an end message, pass it on to the view hierarchy.
// This is used in cases like the game end where multiple
- // odin_speaks are done in sequence
+ // odinSpeaks are done in sequence
if (odinEndMessage)
g_events->send(GameMessage(odinEndMessage));
}
-void odin_speaks(int index, int item, const char *endMessage) {
+void odinSpeaks(int index, int item, const char *endMessage) {
odinEndMessage = endMessage;
execute_script((long)index, _G(odin), odin_speaks_end);
}
-int switch_icons() {
+int switchIcons() {
play_sound(WOOP, false);
for (int y = 0; y < 12; y++) {
@@ -205,16 +205,16 @@ int switch_icons() {
int ix = x * 16;
int iy = y * 16;
if (_G(scrn)._iconGrid[y][x] == 93) {
- place_tile(x, y, 144);
+ placeTile(x, y, 144);
} else if (_G(scrn)._iconGrid[y][x] == 144) {
- place_tile(x, y, 93);
- kill_enemies(iy, ix);
+ placeTile(x, y, 93);
+ killEnemies(iy, ix);
}
if (_G(scrn)._iconGrid[y][x] == 94) {
- place_tile(x, y, 146);
+ placeTile(x, y, 146);
} else if (_G(scrn)._iconGrid[y][x] == 146) {
- place_tile(x, y, 94);
- kill_enemies(iy, ix);
+ placeTile(x, y, 94);
+ killEnemies(iy, ix);
}
}
}
@@ -222,26 +222,26 @@ int switch_icons() {
return 0;
}
-int rotate_arrows() {
+int rotateArrows() {
play_sound(WOOP, false);
for (int y = 0; y < 12; y++) {
for (int x = 0; x < 20; x++) {
if (_G(scrn)._iconGrid[y][x] == 205)
- place_tile(x, y, 208);
+ placeTile(x, y, 208);
else if (_G(scrn)._iconGrid[y][x] == 206)
- place_tile(x, y, 207);
+ placeTile(x, y, 207);
else if (_G(scrn)._iconGrid[y][x] == 207)
- place_tile(x, y, 205);
+ placeTile(x, y, 205);
else if (_G(scrn)._iconGrid[y][x] == 208)
- place_tile(x, y, 206);
+ placeTile(x, y, 206);
}
}
return 0;
}
-void kill_enemies(int iy, int ix) {
+void killEnemies(int iy, int ix) {
int x1, y1, x2, y2;
for (int i = 3; i < MAX_ACTORS; i++) {
@@ -275,7 +275,7 @@ void kill_enemies(int iy, int ix) {
}
}
-void remove_objects(int y, int x) {
+void removeObjects(int y, int x) {
int p = (y * 20) + x;
if (_G(object_map[p]) > 0) {
@@ -284,12 +284,12 @@ void remove_objects(int y, int x) {
}
}
-void place_tile(int x, int y, int tile) {
+void placeTile(int x, int y, int tile) {
_G(scrn)._iconGrid[y][x] = tile;
- remove_objects(y, x);
+ removeObjects(y, x);
}
-int bgtile(int x, int y) {
+int backgroundTile(int x, int y) {
if (x < 0 || x >= 319 || y < 0 || y >= 191)
return 0;
@@ -299,24 +299,24 @@ int bgtile(int x, int y) {
return _G(scrn)._iconGrid[y][x];
}
-void select_item() {
+void selectItem() {
// Only allow opening the dialog if something isn't currently going on
if (g_engine->canSaveAutosaveCurrently()) {
g_events->addView("SelectItem");
}
}
-int actor_speaks(Actor *actr, int index, int item) {
- if (actr->_type != 4)
+int actorSpeaks(Actor *actor, int index, int item) {
+ if (actor->_type != 4)
return 0;
- int v = atoi(actr->_name);
+ int v = atoi(actor->_name);
if (v < 1 || v > 20)
return 0;
long lind = (long)_G(current_level);
lind = lind * 1000;
- lind += (long)actr->_actorNum;
+ lind += (long)actor->_actorNum;
Common::String str = Common::String::format("FACE%d", v);
if (Common::File::exists(Common::Path(str))) {
diff --git a/engines/got/game/back.h b/engines/got/game/back.h
index 290b5f4d341..00674f45c5b 100644
--- a/engines/got/game/back.h
+++ b/engines/got/game/back.h
@@ -35,17 +35,17 @@ extern const char *ITEM_NAMES[];
* Now in ScummVM, it only does the setup portions, since the
* GameContent view takes care of the scene rendering.
*/
-extern void show_level(int new_level);
-extern void show_level_done();
-extern void odin_speaks(int index, int item, const char *endMessage = nullptr);
-extern int switch_icons();
-extern int rotate_arrows();
-extern void kill_enemies(int iy, int ix);
-extern void remove_objects(int y, int x);
-extern void place_tile(int x, int y, int tile);
-extern int bgtile(int x, int y);
-extern void select_item();
-extern int actor_speaks(Actor *actr, int index, int item);
+extern void showLevel(int new_level);
+extern void showLevelDone();
+extern void odinSpeaks(int index, int item, const char *endMessage = nullptr);
+extern int switchIcons();
+extern int rotateArrows();
+extern void killEnemies(int iy, int ix);
+extern void removeObjects(int y, int x);
+extern void placeTile(int x, int y, int tile);
+extern int backgroundTile(int x, int y);
+extern void selectItem();
+extern int actorSpeaks(Actor *actor, int index, int item);
} // namespace Got
diff --git a/engines/got/game/boss1.cpp b/engines/got/game/boss1.cpp
index 1b5fa375be0..509e840da47 100644
--- a/engines/got/game/boss1.cpp
+++ b/engines/got/game/boss1.cpp
@@ -260,11 +260,11 @@ static int boss1_dead() {
void closing_sequence1() {
_G(game_over) = true;
music_play(4, true);
- odin_speaks(1001, 13, "CLOSING");
+ odinSpeaks(1001, 13, "CLOSING");
}
void closing_sequence1_2() {
- _G(thor_info).armor = 1;
+ _G(thor_info)._armor = 1;
load_new_thor();
_G(thor)->_dir = 1;
_G(thor)->_nextFrame = 0;
@@ -274,7 +274,7 @@ void closing_sequence1_2() {
void closing_sequence1_3() {
fill_health();
fill_magic();
- odin_speaks(1002, 0, "CLOSING");
+ odinSpeaks(1002, 0, "CLOSING");
}
void closing_sequence1_4() {
@@ -285,11 +285,11 @@ void closing_sequence1_4() {
_G(setup)._bossDead[0] = true;
_G(boss_active) = false;
_G(scrn)._music = 4;
- show_level(BOSS_LEVEL1);
+ showLevel(BOSS_LEVEL1);
play_sound(ANGEL, true);
- place_tile(18, 6, 148);
- place_tile(19, 6, 202);
+ placeTile(18, 6, 148);
+ placeTile(19, 6, 202);
actor_visible(1);
actor_visible(2);
diff --git a/engines/got/game/boss2.cpp b/engines/got/game/boss2.cpp
index 586a50caa6a..f7aa451e530 100644
--- a/engines/got/game/boss2.cpp
+++ b/engines/got/game/boss2.cpp
@@ -382,11 +382,11 @@ done:
void closing_sequence2() {
music_play(6, true);
- odin_speaks(1001, 0, "CLOSING");
+ odinSpeaks(1001, 0, "CLOSING");
}
void closing_sequence2_2() {
- _G(thor_info).armor = 10;
+ _G(thor_info)._armor = 10;
load_new_thor();
_G(thor)->_dir = 1;
_G(thor)->_nextFrame = 0;
@@ -397,7 +397,7 @@ void closing_sequence2_2() {
void closing_sequence2_3() {
fill_health();
fill_magic();
- odin_speaks(1002, 0, "CLOSING");
+ odinSpeaks(1002, 0, "CLOSING");
}
void closing_sequence2_4() {
@@ -410,11 +410,11 @@ void closing_sequence2_4() {
_G(boss_active) = false;
_G(scrn)._music = 6;
- show_level(BOSS_LEVEL2);
+ showLevel(BOSS_LEVEL2);
play_sound(ANGEL, true);
- place_tile(18, 10, 152);
- place_tile(19, 10, 202);
+ placeTile(18, 10, 152);
+ placeTile(19, 10, 202);
actor_visible(1);
actor_visible(2);
_G(actor[7])._x = 288;
diff --git a/engines/got/game/boss3.cpp b/engines/got/game/boss3.cpp
index d27e2c73e1b..e9545eaea81 100644
--- a/engines/got/game/boss3.cpp
+++ b/engines/got/game/boss3.cpp
@@ -519,7 +519,7 @@ static int boss_die() {
void closing_sequence3() {
music_play(6, true);
- odin_speaks(1001, 0, "CLOSING");
+ odinSpeaks(1001, 0, "CLOSING");
}
void closing_sequence3_2() {
@@ -538,7 +538,7 @@ void closing_sequence3_3() {
_G(game_over) = true;
_G(boss_active) = false;
_G(scrn)._music = 6;
- show_level(BOSS_LEVEL3);
+ showLevel(BOSS_LEVEL3);
_G(exit_flag) = 0;
music_pause();
diff --git a/engines/got/game/init.cpp b/engines/got/game/init.cpp
index 61696bf9c91..9f99bbe63a1 100644
--- a/engines/got/game/init.cpp
+++ b/engines/got/game/init.cpp
@@ -33,26 +33,26 @@ namespace Got {
void setup_player() {
_G(thor_info).clear();
- _G(thor_info).inventory = 0;
+ _G(thor_info)._inventory = 0;
if (_G(area) > 1)
- _G(thor_info).inventory |= APPLE_MAGIC + LIGHTNING_MAGIC;
+ _G(thor_info)._inventory |= APPLE_MAGIC + LIGHTNING_MAGIC;
if (_G(area) > 2)
- _G(thor_info).inventory |= BOOTS_MAGIC + WIND_MAGIC;
+ _G(thor_info)._inventory |= BOOTS_MAGIC + WIND_MAGIC;
_G(thor)->_health = 150;
_G(thor_info)._magic = _G(area) > 1 ? 150 : 0;
- _G(thor_info).jewels = 0;
- _G(thor_info).score = 0;
- _G(thor_info).keys = 0;
- _G(thor_info).last_item = 0;
- _G(thor_info).object = 0;
- _G(thor_info).object_name = nullptr;
+ _G(thor_info)._jewels = 0;
+ _G(thor_info)._score = 0;
+ _G(thor_info)._keys = 0;
+ _G(thor_info)._lastItem = 0;
+ _G(thor_info)._object = 0;
+ _G(thor_info)._objectName = nullptr;
_G(thor)->_lastX[0] = _G(thor)->_x;
_G(thor)->_lastX[1] = _G(thor)->_x;
_G(thor)->_lastY[0] = _G(thor)->_y;
_G(thor)->_lastY[1] = _G(thor)->_y;
- _G(thor_info).last_icon = (6 * 20) + 8;
- _G(thor_info).last_screen = 23;
+ _G(thor_info)._lastIcon = (6 * 20) + 8;
+ _G(thor_info)._lastScreen = 23;
_G(thor)->_dir = 1;
switch (_G(area)) {
@@ -81,12 +81,12 @@ void initialize_game() {
g_vars->setArea(1);
_G(thor)->_health = 100;
_G(thor_info)._magic = 100;
- _G(thor_info).jewels = 463;
- _G(thor_info).score = 12455;
+ _G(thor_info)._jewels = 463;
+ _G(thor_info)._score = 12455;
_G(setup)._difficultyLevel = 0;
- _G(thor_info).inventory = 1 + 2;
+ _G(thor_info)._inventory = 1 + 2;
_G(current_level) = 54;
- _G(thor_info).item = 2;
+ _G(thor_info)._selectedItem = 2;
File f("DEMO");
_G(demoKeys).clear();
@@ -105,7 +105,7 @@ void initialize_game() {
// Load level data
_G(new_level) = _G(current_level);
_G(scrn).load(_G(current_level));
- show_level(_G(current_level));
+ showLevel(_G(current_level));
if (!_G(auto_load)) {
_G(sound).music_play(_G(levelMusic), 1);
diff --git a/engines/got/game/main.cpp b/engines/got/game/main.cpp
index feb17a749dd..bd32031e7be 100644
--- a/engines/got/game/main.cpp
+++ b/engines/got/game/main.cpp
@@ -27,9 +27,9 @@ namespace Got {
void setup_load() {
_G(thor)->_active = true;
- _G(new_level) = _G(thor_info).last_screen;
- _G(thor)->_x = (_G(thor_info).last_icon % 20) * 16;
- _G(thor)->_y = ((_G(thor_info).last_icon / 20) * 16) - 1;
+ _G(new_level) = _G(thor_info)._lastScreen;
+ _G(thor)->_x = (_G(thor_info)._lastIcon % 20) * 16;
+ _G(thor)->_y = ((_G(thor_info)._lastIcon / 20) * 16) - 1;
if (_G(thor)->_x < 1)
_G(thor)->_x = 1;
if (_G(thor)->_y < 0)
@@ -38,17 +38,17 @@ void setup_load() {
_G(thor)->_lastX[1] = _G(thor)->_x;
_G(thor)->_lastY[0] = _G(thor)->_y;
_G(thor)->_lastY[1] = _G(thor)->_y;
- _G(thor)->_dir = _G(thor_info).last_dir;
- _G(thor)->_lastDir = _G(thor_info).last_dir;
- _G(thor)->_health = _G(thor_info).last_health;
- _G(thor_info)._magic = _G(thor_info).last_magic;
- _G(thor_info).jewels = _G(thor_info).last_jewels;
- _G(thor_info).keys = _G(thor_info).last_keys;
- _G(thor_info).score = _G(thor_info).last_score;
- _G(thor_info).item = _G(thor_info).last_item;
- _G(thor_info).inventory = _G(thor_info).last_inventory;
- _G(thor_info).object = _G(thor_info).last_object;
- _G(thor_info).object_name = _G(thor_info).last_object_name;
+ _G(thor)->_dir = _G(thor_info)._lastDir;
+ _G(thor)->_lastDir = _G(thor_info)._lastDir;
+ _G(thor)->_health = _G(thor_info)._lastHealth;
+ _G(thor_info)._magic = _G(thor_info)._lastMagic;
+ _G(thor_info)._jewels = _G(thor_info)._lastJewels;
+ _G(thor_info)._keys = _G(thor_info)._lastKeys;
+ _G(thor_info)._score = _G(thor_info)._lastScore;
+ _G(thor_info)._selectedItem = _G(thor_info)._lastItem;
+ _G(thor_info)._inventory = _G(thor_info)._lastInventory;
+ _G(thor_info)._object = _G(thor_info)._lastObject;
+ _G(thor_info)._objectName = _G(thor_info)._lastObjectName;
_G(thor)->_numMoves = 1;
_G(thor)->_vulnerableCountdown = 60;
_G(thor)->_show = 60;
@@ -66,7 +66,7 @@ void setup_load() {
_G(scrn).load(_G(new_level));
_G(current_level) = _G(new_level);
- show_level(_G(new_level));
+ showLevel(_G(new_level));
}
void pause(int delay) {
diff --git a/engines/got/game/move.cpp b/engines/got/game/move.cpp
index e1a2185c03a..7ebac71eca2 100644
--- a/engines/got/game/move.cpp
+++ b/engines/got/game/move.cpp
@@ -98,7 +98,7 @@ void thor_shoots() {
int kill_good_guy(void) {
if (!_G(killgg_inform) && !_G(thunder_flag)) {
- odin_speaks(2010, 0);
+ odinSpeaks(2010, 0);
_G(killgg_inform) = true;
}
@@ -132,10 +132,10 @@ void actor_damaged(Actor *actr, int damage) {
actr->_vulnerableCountdown = STAMINA;
if (actr->_funcNum == 4) {
- switch_icons();
+ switchIcons();
}
if (actr->_funcNum == 7) {
- rotate_arrows();
+ rotateArrows();
}
}
}
@@ -155,7 +155,7 @@ void thor_damaged(Actor *actr) {
int t = actr->_type;
actr->_type = 4;
- actor_speaks(actr, 0, 0);
+ actorSpeaks(actr, 0, 0);
actr->_type = t;
actr->_talkCounter = 30;
return;
diff --git a/engines/got/game/move_patterns.cpp b/engines/got/game/move_patterns.cpp
index 336dc409fcd..98df4ea5514 100644
--- a/engines/got/game/move_patterns.cpp
+++ b/engines/got/game/move_patterns.cpp
@@ -1075,7 +1075,7 @@ int special_movement_ten(Actor *actr) {
return 0;
actor_ctr = 10;
- actor_speaks(actr, 0 - actr->_passValue, 0);
+ actorSpeaks(actr, 0 - actr->_passValue, 0);
return 0;
}
@@ -1088,7 +1088,7 @@ int special_movement_eleven(Actor *actr) {
const int oldType = actr->_type;
actr->_type = 4;
- actor_speaks(actr, 0, 0);
+ actorSpeaks(actr, 0, 0);
actr->_type = oldType;
actr->_talkCounter = 10;
@@ -1781,7 +1781,7 @@ redo:
switch (actr->_temp2) {
case 0:
- if (bgtile(actr->_x, actr->_y) >= TILE_SOLID)
+ if (backgroundTile(actr->_x, actr->_y) >= TILE_SOLID)
actr->_nextFrame = 1;
else {
actr->_temp2 = 6;
@@ -1829,28 +1829,28 @@ redo:
actr->_x += 16;
actr->_y += 16;
d = 3;
- if (bgtile(actr->_x, actr->_y) < TILE_SOLID)
+ if (backgroundTile(actr->_x, actr->_y) < TILE_SOLID)
goto redo;
break;
case 1:
actr->_x -= 16;
actr->_y -= 16;
d = 2;
- if (bgtile(actr->_x, actr->_y) < TILE_SOLID)
+ if (backgroundTile(actr->_x, actr->_y) < TILE_SOLID)
goto redo;
break;
case 2:
actr->_x += 16;
actr->_y -= 16;
d = 0;
- if (bgtile(actr->_x, actr->_y) < TILE_SOLID)
+ if (backgroundTile(actr->_x, actr->_y) < TILE_SOLID)
goto redo;
break;
case 3:
actr->_x -= 16;
actr->_y += 16;
d = 1;
- if (bgtile(actr->_x, actr->_y) < TILE_SOLID)
+ if (backgroundTile(actr->_x, actr->_y) < TILE_SOLID)
goto redo;
break;
}
@@ -1870,15 +1870,15 @@ int movement_twentythree(Actor *actr) {
switch (d) {
case 0:
- if (bgtile(actr->_x - 2, actr->_y) >= TILE_FLY &&
- bgtile(actr->_x - 2, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
+ if (backgroundTile(actr->_x - 2, actr->_y) >= TILE_FLY &&
+ backgroundTile(actr->_x - 2, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 2;
actr->_x -= 2;
} else {
- if (bgtile(actr->_x, actr->_y - 2) < TILE_FLY ||
- bgtile(actr->_x + actr->_sizeX - 1, actr->_y - 2) < TILE_FLY) {
- if (bgtile(actr->_x + actr->_sizeX + 1, actr->_y) >= TILE_FLY &&
- bgtile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
+ if (backgroundTile(actr->_x, actr->_y - 2) < TILE_FLY ||
+ backgroundTile(actr->_x + actr->_sizeX - 1, actr->_y - 2) < TILE_FLY) {
+ if (backgroundTile(actr->_x + actr->_sizeX + 1, actr->_y) >= TILE_FLY &&
+ backgroundTile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 3;
actr->_x += 2;
} else {
@@ -1890,15 +1890,15 @@ int movement_twentythree(Actor *actr) {
}
break;
case 1:
- if (bgtile(actr->_x + actr->_sizeX + 1, actr->_y) >= TILE_FLY &&
- bgtile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
+ if (backgroundTile(actr->_x + actr->_sizeX + 1, actr->_y) >= TILE_FLY &&
+ backgroundTile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 3;
actr->_x += 2;
} else {
- if (bgtile(actr->_x, actr->_y + actr->_sizeY + 1) < TILE_FLY ||
- bgtile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) < TILE_FLY) {
- if (bgtile(actr->_x - 2, actr->_y) >= TILE_FLY &&
- bgtile(actr->_x - 2, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
+ if (backgroundTile(actr->_x, actr->_y + actr->_sizeY + 1) < TILE_FLY ||
+ backgroundTile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) < TILE_FLY) {
+ if (backgroundTile(actr->_x - 2, actr->_y) >= TILE_FLY &&
+ backgroundTile(actr->_x - 2, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 2;
actr->_x -= 2;
} else {
@@ -1910,15 +1910,15 @@ int movement_twentythree(Actor *actr) {
}
break;
case 2:
- if (bgtile(actr->_x, actr->_y + actr->_sizeY + 1) >= TILE_FLY &&
- bgtile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) >= TILE_FLY) {
+ if (backgroundTile(actr->_x, actr->_y + actr->_sizeY + 1) >= TILE_FLY &&
+ backgroundTile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) >= TILE_FLY) {
d = 1;
actr->_y += 2;
} else {
- if (bgtile(actr->_x - 2, actr->_y) < TILE_FLY ||
- bgtile(actr->_x - 2, actr->_y + actr->_sizeY - 1) < TILE_FLY) {
- if (bgtile(actr->_x, actr->_y - 2) >= TILE_FLY &&
- bgtile(actr->_x + actr->_sizeX - 1, actr->_y - 2) >= TILE_FLY) {
+ if (backgroundTile(actr->_x - 2, actr->_y) < TILE_FLY ||
+ backgroundTile(actr->_x - 2, actr->_y + actr->_sizeY - 1) < TILE_FLY) {
+ if (backgroundTile(actr->_x, actr->_y - 2) >= TILE_FLY &&
+ backgroundTile(actr->_x + actr->_sizeX - 1, actr->_y - 2) >= TILE_FLY) {
d = 0;
actr->_y -= 2;
} else {
@@ -1930,15 +1930,15 @@ int movement_twentythree(Actor *actr) {
}
break;
case 3:
- if (bgtile(actr->_x, actr->_y - 2) >= TILE_FLY &&
- bgtile(actr->_x + actr->_sizeX - 1, actr->_y - 2) >= TILE_FLY) {
+ if (backgroundTile(actr->_x, actr->_y - 2) >= TILE_FLY &&
+ backgroundTile(actr->_x + actr->_sizeX - 1, actr->_y - 2) >= TILE_FLY) {
d = 0;
actr->_y -= 2;
} else {
- if (bgtile(actr->_x + actr->_sizeX + 1, actr->_y) < TILE_FLY ||
- bgtile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) < TILE_FLY) {
- if (bgtile(actr->_x, actr->_y + actr->_sizeY + 1) >= TILE_FLY &&
- bgtile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) >= TILE_FLY) {
+ if (backgroundTile(actr->_x + actr->_sizeX + 1, actr->_y) < TILE_FLY ||
+ backgroundTile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) < TILE_FLY) {
+ if (backgroundTile(actr->_x, actr->_y + actr->_sizeY + 1) >= TILE_FLY &&
+ backgroundTile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) >= TILE_FLY) {
d = 1;
actr->_y += 2;
} else {
@@ -1966,15 +1966,15 @@ int movement_twentyfour(Actor *actr) {
switch (d) {
case 0:
- if (bgtile(actr->_x + actr->_sizeX + 1, actr->_y) >= TILE_FLY &&
- bgtile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
+ if (backgroundTile(actr->_x + actr->_sizeX + 1, actr->_y) >= TILE_FLY &&
+ backgroundTile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 3;
actr->_x += 2;
} else {
- if (bgtile(actr->_x, actr->_y - 2) < TILE_FLY ||
- bgtile(actr->_x + actr->_sizeX - 1, actr->_y - 2) < TILE_FLY) {
- if (bgtile(actr->_x - 2, actr->_y) >= TILE_FLY &&
- bgtile(actr->_x - 2, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
+ if (backgroundTile(actr->_x, actr->_y - 2) < TILE_FLY ||
+ backgroundTile(actr->_x + actr->_sizeX - 1, actr->_y - 2) < TILE_FLY) {
+ if (backgroundTile(actr->_x - 2, actr->_y) >= TILE_FLY &&
+ backgroundTile(actr->_x - 2, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 2;
actr->_x -= 2;
} else {
@@ -1986,15 +1986,15 @@ int movement_twentyfour(Actor *actr) {
}
break;
case 1:
- if (bgtile(actr->_x - 2, actr->_y) >= TILE_FLY &&
- bgtile(actr->_x - 2, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
+ if (backgroundTile(actr->_x - 2, actr->_y) >= TILE_FLY &&
+ backgroundTile(actr->_x - 2, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 2;
actr->_x -= 2;
} else {
- if (bgtile(actr->_x, actr->_y + actr->_sizeY + 1) < TILE_FLY ||
- bgtile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) < TILE_FLY) {
- if (bgtile(actr->_x + actr->_sizeX + 1, actr->_y) >= TILE_FLY &&
- bgtile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
+ if (backgroundTile(actr->_x, actr->_y + actr->_sizeY + 1) < TILE_FLY ||
+ backgroundTile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) < TILE_FLY) {
+ if (backgroundTile(actr->_x + actr->_sizeX + 1, actr->_y) >= TILE_FLY &&
+ backgroundTile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 3;
actr->_x += 2;
} else {
@@ -2006,15 +2006,15 @@ int movement_twentyfour(Actor *actr) {
}
break;
case 2:
- if (bgtile(actr->_x, actr->_y - 2) >= TILE_FLY &&
- bgtile(actr->_x + actr->_sizeX - 1, actr->_y - 2) >= TILE_FLY) {
+ if (backgroundTile(actr->_x, actr->_y - 2) >= TILE_FLY &&
+ backgroundTile(actr->_x + actr->_sizeX - 1, actr->_y - 2) >= TILE_FLY) {
d = 0;
actr->_y -= 2;
} else {
- if (bgtile(actr->_x - 2, actr->_y) < TILE_FLY ||
- bgtile(actr->_x - 2, actr->_y + actr->_sizeY - 1) < TILE_FLY) {
- if (bgtile(actr->_x, actr->_y + actr->_sizeY + 1) >= TILE_FLY &&
- bgtile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) >= TILE_FLY) {
+ if (backgroundTile(actr->_x - 2, actr->_y) < TILE_FLY ||
+ backgroundTile(actr->_x - 2, actr->_y + actr->_sizeY - 1) < TILE_FLY) {
+ if (backgroundTile(actr->_x, actr->_y + actr->_sizeY + 1) >= TILE_FLY &&
+ backgroundTile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) >= TILE_FLY) {
d = 1;
actr->_y += 2;
} else {
@@ -2026,15 +2026,15 @@ int movement_twentyfour(Actor *actr) {
}
break;
case 3:
- if (bgtile(actr->_x, actr->_y + actr->_sizeY + 1) >= TILE_FLY &&
- bgtile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) >= TILE_FLY) {
+ if (backgroundTile(actr->_x, actr->_y + actr->_sizeY + 1) >= TILE_FLY &&
+ backgroundTile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) >= TILE_FLY) {
d = 1;
actr->_y += 2;
} else {
- if (bgtile(actr->_x + actr->_sizeX + 1, actr->_y) < TILE_FLY ||
- bgtile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) < TILE_FLY) {
- if (bgtile(actr->_x, actr->_y - 2) >= TILE_FLY &&
- bgtile(actr->_x + actr->_sizeX - 1, actr->_y - 2) >= TILE_FLY) {
+ if (backgroundTile(actr->_x + actr->_sizeX + 1, actr->_y) < TILE_FLY ||
+ backgroundTile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) < TILE_FLY) {
+ if (backgroundTile(actr->_x, actr->_y - 2) >= TILE_FLY &&
+ backgroundTile(actr->_x + actr->_sizeX - 1, actr->_y - 2) >= TILE_FLY) {
d = 0;
actr->_y -= 2;
} else {
@@ -2153,16 +2153,16 @@ int movement_twentyeight(Actor *actr) {
break;
}
- ret = bgtile(x1, y1);
+ ret = backgroundTile(x1, y1);
if (ret != 100 && ret != 106 && ret != 110 && ret != 111 && ret != 113)
goto chg_dir;
- ret = bgtile((x1 + actr->_sizeX) - 1, y1);
+ ret = backgroundTile((x1 + actr->_sizeX) - 1, y1);
if (ret != 100 && ret != 106 && ret != 110 && ret != 111 && ret != 113)
goto chg_dir;
- ret = bgtile(x1, (y1 + actr->_sizeY) - 1);
+ ret = backgroundTile(x1, (y1 + actr->_sizeY) - 1);
if (ret != 100 && ret != 106 && ret != 110 && ret != 111 && ret != 113)
goto chg_dir;
- ret = bgtile((x1 + actr->_sizeX) - 1, (y1 + actr->_sizeY) - 1);
+ ret = backgroundTile((x1 + actr->_sizeX) - 1, (y1 + actr->_sizeY) - 1);
if (ret != 100 && ret != 106 && ret != 110 && ret != 111 && ret != 113)
goto chg_dir;
@@ -2474,14 +2474,14 @@ int movement_forty(Actor *actr) {
int d = actr->_lastDir;
if (actr->_lastDir == 2) {
- if (bgtile(x1 - 2, actr->_y) >= TILE_SOLID) {
+ if (backgroundTile(x1 - 2, actr->_y) >= TILE_SOLID) {
_G(actor[a]._x) -= 2;
_G(actor[a - 1])._x -= 2;
_G(actor[a - 2])._x -= 2;
_G(actor[a + 1])._x -= 2;
} else
d = 3;
- } else if (bgtile(_G(actor[a + 1])._x + 14, _G(actor[a + 1])._y) >= TILE_SOLID) {
+ } else if (backgroundTile(_G(actor[a + 1])._x + 14, _G(actor[a + 1])._y) >= TILE_SOLID) {
_G(actor[a])._x += 2;
_G(actor[a - 1])._x += 2;
_G(actor[a - 2])._x += 2;
diff --git a/engines/got/game/object.cpp b/engines/got/game/object.cpp
index dc5b5e8287e..931e495d726 100644
--- a/engines/got/game/object.cpp
+++ b/engines/got/game/object.cpp
@@ -51,14 +51,14 @@ void pick_up_object(int p) {
switch (_G(object_map[p])) {
case 1: // Red jewel
- if (_G(thor_info).jewels >= 999) {
+ if (_G(thor_info)._jewels >= 999) {
cannot_carry_more();
return;
}
add_jewels(10);
break;
case 2: // Blue jewel
- if (_G(thor_info).jewels >= 999) {
+ if (_G(thor_info)._jewels >= 999) {
cannot_carry_more();
return;
}
@@ -94,7 +94,7 @@ void pick_up_object(int p) {
add_keys(1);
break;
case 8: // Treasure
- if (_G(thor_info).jewels >= 999) {
+ if (_G(thor_info)._jewels >= 999) {
cannot_carry_more();
return;
}
@@ -128,11 +128,11 @@ void pick_up_object(int p) {
_G(actor[2])._active = false;
_G(shield_on) = false;
_G(tornado_used) = false;
- _G(thor_info).inventory |= 64;
- _G(thor_info).item = 7;
- _G(thor_info).object = _G(object_map[p]) - 11;
- _G(thor_info).object_name = OBJECT_NAMES[_G(thor_info).object - 1];
- odin_speaks((_G(object_map[p]) - 12) + 501, _G(object_map[p]) - 1);
+ _G(thor_info)._inventory |= 64;
+ _G(thor_info)._selectedItem = 7;
+ _G(thor_info)._object = _G(object_map[p]) - 11;
+ _G(thor_info)._objectName = OBJECT_NAMES[_G(thor_info)._object - 1];
+ odinSpeaks((_G(object_map[p]) - 12) + 501, _G(object_map[p]) - 1);
break;
case 27:
case 28:
@@ -149,9 +149,9 @@ void pick_up_object(int p) {
_G(thor)->_numMoves = 1;
_G(actor[2])._active = false;
s = 1 << (_G(object_map[p]) - 27);
- _G(thor_info).inventory |= s;
- odin_speaks((_G(object_map[p]) - 27) + 516, _G(object_map[p]) - 1);
- _G(thor_info).item = _G(object_map[p]) - 26;
+ _G(thor_info)._inventory |= s;
+ odinSpeaks((_G(object_map[p]) - 27) + 516, _G(object_map[p]) - 1);
+ _G(thor_info)._selectedItem = _G(object_map[p]) - 26;
add_magic(150);
fill_score(5);
break;
@@ -369,10 +369,10 @@ int use_tornado(int flag) {
int use_object(int flag) {
if (!flag)
return 0;
- if (!(_G(thor_info).inventory & 64))
+ if (!(_G(thor_info)._inventory & 64))
return 0;
- odin_speaks((_G(thor_info).object - 1) + 5501, _G(thor_info).object - 1);
+ odinSpeaks((_G(thor_info)._object - 1) + 5501, _G(thor_info)._object - 1);
return 1;
}
@@ -387,7 +387,7 @@ void use_item() {
}
bool mf = _G(magic_inform);
- switch (_G(thor_info).item) {
+ switch (_G(thor_info)._selectedItem) {
case 1:
ret = use_apple(kf);
break;
@@ -423,21 +423,21 @@ void use_item() {
void not_enough_magic() {
if (!_G(magic_inform))
- odin_speaks(2006, 0);
+ odinSpeaks(2006, 0);
_G(magic_inform) = true;
}
void cannot_carry_more() {
if (!_G(carry_inform))
- odin_speaks(2007, 0);
+ odinSpeaks(2007, 0);
_G(carry_inform) = true;
}
void delete_object() {
- _G(thor_info).inventory &= 0xbf;
- _G(thor_info).item = 1;
+ _G(thor_info)._inventory &= 0xbf;
+ _G(thor_info)._selectedItem = 1;
}
} // namespace Got
diff --git a/engines/got/game/script.cpp b/engines/got/game/script.cpp
index cbfb22a7086..4f62a0cf031 100644
--- a/engines/got/game/script.cpp
+++ b/engines/got/game/script.cpp
@@ -402,7 +402,7 @@ int Scripts::get_internal_variable() {
}
switch (i) {
case 0:
- _lTemp = _G(thor_info).jewels;
+ _lTemp = _G(thor_info)._jewels;
break;
case 1:
_lTemp = _G(thor)->_health;
@@ -411,13 +411,13 @@ int Scripts::get_internal_variable() {
_lTemp = _G(thor_info)._magic;
break;
case 3:
- _lTemp = _G(thor_info).score;
+ _lTemp = _G(thor_info)._score;
break;
case 4:
_lTemp = _G(current_level);
break;
case 5:
- _lTemp = _G(thor_info).keys;
+ _lTemp = _G(thor_info)._keys;
break;
case 6:
case 7:
@@ -447,8 +447,8 @@ int Scripts::get_internal_variable() {
_lTemp = _G(setup)._flags[i - 1] ? 1 : 0;
break;
case 23:
- if (_G(thor_info).inventory & 64)
- _lTemp = _G(thor_info).object;
+ if (_G(thor_info)._inventory & 64)
+ _lTemp = _G(thor_info)._object;
else
_lTemp = 0;
break;
@@ -897,7 +897,7 @@ int Scripts::cmd_settile() {
return 6;
if (screen == _G(current_level)) {
- place_tile(pos % 20, pos / 20, tile);
+ placeTile(pos % 20, pos / 20, tile);
} else {
Level tmp;
tmp.load(screen);
@@ -916,10 +916,10 @@ int Scripts::cmd_itemgive() {
if (i < 1 || i > 15)
return 6;
- _G(thor_info).inventory |= 64;
- _G(thor_info).item = 7;
- _G(thor_info).object = i;
- _G(thor_info).object_name = OBJECT_NAMES[_G(thor_info).object - 1];
+ _G(thor_info)._inventory |= 64;
+ _G(thor_info)._selectedItem = 7;
+ _G(thor_info)._object = i;
+ _G(thor_info)._objectName = OBJECT_NAMES[_G(thor_info)._object - 1];
return 0;
}
@@ -1054,13 +1054,13 @@ void Scripts::scr_func3() {
_numVar[0] = 1;
play_sound(WOOP, true);
if (_G(current_level) == 106 && p == 69) {
- place_tile(x, y, 220);
+ placeTile(x, y, 220);
_G(key_flag[key_magic]) = false;
return;
}
_G(key_flag[key_magic]) = false;
- place_tile(x, y, 191);
+ placeTile(x, y, 191);
if ((g_events->getRandomNumber(99)) < 25 ||
(_G(current_level) == 13 && p == 150 && !_G(setup).f26 && _G(setup).f28)) {
diff --git a/engines/got/game/special_tile.cpp b/engines/got/game/special_tile.cpp
index d4a38fff31b..b44de83c8de 100644
--- a/engines/got/game/special_tile.cpp
+++ b/engines/got/game/special_tile.cpp
@@ -41,8 +41,8 @@ int special_tile_thor(int x, int y, int icon) {
return open_door1(x, y);
case 202:
if (GAME3) {
- if (_G(thor_info).inventory & 64) {
- if (_G(thor_info).object == 4) {
+ if (_G(thor_info)._inventory & 64) {
+ if (_G(thor_info)._object == 4) {
erase_door(y, x);
delete_object();
return 1;
@@ -57,12 +57,12 @@ int special_tile_thor(int x, int y, int icon) {
return 1;
case 203:
if (!GAME1) {
- if ((_G(thor_info).inventory & 64) && _G(thor_info).object == 5) {
- odin_speaks(2012, 0);
+ if ((_G(thor_info)._inventory & 64) && _G(thor_info)._object == 5) {
+ odinSpeaks(2012, 0);
delete_object();
_G(setup).f10 = 1;
} else if (!_G(setup).f10) {
- odin_speaks(2011, 0);
+ odinSpeaks(2011, 0);
_G(setup).f10 = 1;
}
return 1;
@@ -101,7 +101,7 @@ int special_tile_thor(int x, int y, int icon) {
return cash_door1(x, y, 100);
case 211:
if (GAME1) {
- place_tile(y, x, 79);
+ placeTile(y, x, 79);
_G(exit_flag) = 2;
} else if (GAME2) {
if (_G(thor)->_dir == 0 && _G(setup).f29 && _G(setup).f21 && !_G(setup).f22) {
@@ -247,14 +247,14 @@ void erase_door(int x, int y) {
}
int open_door1(int y, int x) {
- if (_G(thor_info).keys > 0) {
+ if (_G(thor_info)._keys > 0) {
erase_door(x, y);
- _G(thor_info).keys--;
+ _G(thor_info)._keys--;
return 1;
} else {
if (!_G(door_inform)) {
- odin_speaks(2003, 0);
+ odinSpeaks(2003, 0);
_G(door_inform) = true;
}
}
@@ -263,18 +263,18 @@ int open_door1(int y, int x) {
}
int cash_door1(int y, int x, int amount) {
- if (_G(thor_info).jewels >= amount) {
+ if (_G(thor_info)._jewels >= amount) {
erase_door(x, y);
- _G(thor_info).jewels -= amount;
+ _G(thor_info)._jewels -= amount;
return 1;
} else {
if (amount == 10 && !_G(cash1_inform)) {
- odin_speaks(2005, 0);
+ odinSpeaks(2005, 0);
_G(cash1_inform) = true;
}
if (amount == 100 && !_G(cash2_inform)) {
- odin_speaks(2004, 0);
+ odinSpeaks(2004, 0);
_G(cash2_inform) = true;
}
}
diff --git a/engines/got/game/status.cpp b/engines/got/game/status.cpp
index 293d3a8c750..b84308361fd 100644
--- a/engines/got/game/status.cpp
+++ b/engines/got/game/status.cpp
@@ -26,11 +26,11 @@
namespace Got {
void add_jewels(int num) {
- _G(thor_info).jewels = CLIP(_G(thor_info).jewels + num, 0, 999);
+ _G(thor_info)._jewels = CLIP(_G(thor_info)._jewels + num, 0, 999);
}
void add_score(int num) {
- _G(thor_info).score = CLIP(_G(thor_info).score + num, 0l, 999999l);
+ _G(thor_info)._score = CLIP(_G(thor_info)._score + num, 0l, 999999l);
}
void add_magic(int num) {
@@ -45,7 +45,7 @@ void add_health(int num) {
}
void add_keys(int num) {
- _G(thor_info).keys = CLIP(_G(thor_info).keys + num, 0, 99);
+ _G(thor_info)._keys = CLIP(_G(thor_info)._keys + num, 0, 99);
}
void fill_health() {
diff --git a/engines/got/gfx/image.cpp b/engines/got/gfx/image.cpp
index 4980d46dab7..7d47cd7d811 100644
--- a/engines/got/gfx/image.cpp
+++ b/engines/got/gfx/image.cpp
@@ -93,7 +93,7 @@ void make_actor_surface(Actor *actr) {
}
int load_standard_actors() {
- load_actor(0, 100 + _G(thor_info).armor); // Load Thor
+ load_actor(0, 100 + _G(thor_info)._armor); // Load Thor
_G(actor[0]).loadFixed(_G(tmp_buff) + 5120);
setup_actor(&_G(actor[0]), 0, 0, 100, 100);
_G(thor) = &_G(actor[0]);
@@ -105,7 +105,7 @@ int load_standard_actors() {
_G(thor_x2) = _G(thor)->_x + 14;
_G(thor_y2) = _G(thor)->_y + 14;
- load_actor(0, 103 + _G(thor_info).armor); // Load hammer
+ load_actor(0, 103 + _G(thor_info)._armor); // Load hammer
_G(actor[1]).loadFixed(_G(tmp_buff) + 5120);
setup_actor(&_G(actor[1]), 1, 0, 100, 100);
_G(actor[1])._active = false;
@@ -265,7 +265,7 @@ void setup_magic_item(int item) {
}
void load_new_thor() {
- load_actor(0, 100 + _G(thor_info).armor); // Load Thor
+ load_actor(0, 100 + _G(thor_info)._armor); // Load Thor
make_actor_surface(&_G(actor[0]));
}
diff --git a/engines/got/got.cpp b/engines/got/got.cpp
index de399fa80d8..993ca86d665 100644
--- a/engines/got/got.cpp
+++ b/engines/got/got.cpp
@@ -136,17 +136,17 @@ Common::Error GotEngine::syncGame(Common::Serializer &s) {
}
void GotEngine::savegameLoaded() {
- _G(current_area) = _G(thor_info).last_screen;
+ _G(current_area) = _G(thor_info)._lastScreen;
- _G(thor)->_x = (_G(thor_info).last_icon % 20) * 16;
- _G(thor)->_y = ((_G(thor_info).last_icon / 20) * 16) - 1;
+ _G(thor)->_x = (_G(thor_info)._lastIcon % 20) * 16;
+ _G(thor)->_y = ((_G(thor_info)._lastIcon / 20) * 16) - 1;
if (_G(thor)->_x < 1)
_G(thor)->_x = 1;
if (_G(thor)->_y < 0)
_G(thor)->_y = 0;
- _G(thor)->_dir = _G(thor_info).last_dir;
- _G(thor)->_lastDir = _G(thor_info).last_dir;
- _G(thor)->_health = _G(thor_info).last_health;
+ _G(thor)->_dir = _G(thor_info)._lastDir;
+ _G(thor)->_lastDir = _G(thor_info)._lastDir;
+ _G(thor)->_health = _G(thor_info)._lastHealth;
_G(thor)->_numMoves = 1;
_G(thor)->_vulnerableCountdown = 60;
_G(thor)->_show = 60;
diff --git a/engines/got/module.mk b/engines/got/module.mk
index c8ee7e4710e..6343d4a1577 100644
--- a/engines/got/module.mk
+++ b/engines/got/module.mk
@@ -9,11 +9,11 @@ MODULE_OBJS = \
sound.o \
vars.o \
data/actor.o \
- data/high_scores.o \
+ data/highscores.o \
data/level.o \
data/sd_data.o \
data/setup.o \
- data/thor_info.o \
+ data/thorinfo.o \
game/boss1.o \
game/boss2.o \
game/boss3.o \
diff --git a/engines/got/vars.h b/engines/got/vars.h
index 014a4981dac..39700e19fb0 100644
--- a/engines/got/vars.h
+++ b/engines/got/vars.h
@@ -25,11 +25,11 @@
#include "common/events.h"
#include "common/queue.h"
#include "got/data/defines.h"
-#include "got/data/high_scores.h"
+#include "got/data/highscores.h"
#include "got/data/level.h"
#include "got/data/sd_data.h"
#include "got/data/setup.h"
-#include "got/data/thor_info.h"
+#include "got/data/thorinfo.h"
#include "got/game/script.h"
#include "got/gfx/font.h"
#include "got/gfx/gfx_chunks.h"
@@ -162,7 +162,7 @@ public:
Actor *_hammer = nullptr;
Actor _explosion;
Actor _sparkle;
- THOR_INFO _thor_info;
+ ThorInfo _thor_info;
bool _boss_dead = false;
byte _endgame = 0;
diff --git a/engines/got/views/dialogs/options_menu.cpp b/engines/got/views/dialogs/options_menu.cpp
index 8c6f7e7a1de..c5f49f4eb0d 100644
--- a/engines/got/views/dialogs/options_menu.cpp
+++ b/engines/got/views/dialogs/options_menu.cpp
@@ -54,7 +54,7 @@ void OptionsMenu::selected() {
break;
case 6:
// Help
- odin_speaks(2008, -1);
+ odinSpeaks(2008, -1);
break;
case 7:
addView("QuitGame");
diff --git a/engines/got/views/dialogs/select_item.cpp b/engines/got/views/dialogs/select_item.cpp
index 1bdf99d9941..aded5d0451a 100644
--- a/engines/got/views/dialogs/select_item.cpp
+++ b/engines/got/views/dialogs/select_item.cpp
@@ -43,18 +43,18 @@ void SelectItem::draw() {
Dialog::draw();
GfxSurface s = getSurface();
- if (_G(thor_info).inventory == 0) {
+ if (_G(thor_info)._inventory == 0) {
s.print(Common::Point(44, 52), "No Items Found", 14);
return;
}
int b = 1;
for (int l = 0; l < 7; l++, b = b << 1) {
- if (_G(thor_info).inventory & b) {
+ if (_G(thor_info)._inventory & b) {
if (l < 6)
s.simpleBlitFrom(_G(objects[l + 26]), Common::Point(82 - 56 + (l * _HRZSP), 72 - 48));
else {
- int objId = _G(thor_info).object + 10;
+ int objId = _G(thor_info)._object + 10;
s.simpleBlitFrom(_G(objects[objId]), Common::Point(82 - 56 + (l * _HRZSP), 72 - 48));
}
}
@@ -64,7 +64,7 @@ void SelectItem::draw() {
if (_selectedItem < 6)
objName = ITEM_NAMES[_selectedItem];
else
- objName = _G(thor_info).object_name;
+ objName = _G(thor_info)._objectName;
s.print(Common::Point((s.w - (strlen(objName) * 8)) / 2, 66), objName, 12);
s.frameRect(Common::Rect(26 + (_selectedItem * _HRZSP), 22,
@@ -73,16 +73,16 @@ void SelectItem::draw() {
}
bool SelectItem::msgFocus(const FocusMessage &msg) {
- if (_G(thor_info).inventory == 0) {
+ if (_G(thor_info)._inventory == 0) {
_selectedItem = -1;
} else {
- _selectedItem = _G(thor_info).item - 1;
+ _selectedItem = _G(thor_info)._selectedItem - 1;
if (_selectedItem < 1)
_selectedItem = 0;
int b = 1 << _selectedItem;
for (;;) {
- if (_G(thor_info).inventory & b)
+ if (_G(thor_info)._inventory & b)
break;
if (_selectedItem < 7)
_selectedItem++;
@@ -99,7 +99,7 @@ bool SelectItem::msgFocus(const FocusMessage &msg) {
bool SelectItem::msgAction(const ActionMessage &msg) {
int b;
- if (_G(thor_info).inventory == 0) {
+ if (_G(thor_info)._inventory == 0) {
close();
return true;
}
@@ -123,7 +123,7 @@ bool SelectItem::msgAction(const ActionMessage &msg) {
_selectedItem = 8;
b = 1 << _selectedItem;
- if (_G(thor_info).inventory & b)
+ if (_G(thor_info)._inventory & b)
break;
}
@@ -139,7 +139,7 @@ bool SelectItem::msgAction(const ActionMessage &msg) {
_selectedItem = 0;
b = 1 << _selectedItem;
- if (_G(thor_info).inventory & b)
+ if (_G(thor_info)._inventory & b)
break;
}
@@ -155,7 +155,7 @@ bool SelectItem::msgAction(const ActionMessage &msg) {
}
void SelectItem::selectItem() {
- _G(thor_info).item = _selectedItem + 1;
+ _G(thor_info)._selectedItem = _selectedItem + 1;
close();
}
diff --git a/engines/got/views/game.cpp b/engines/got/views/game.cpp
index 8bf08672af6..c1a5d0928de 100644
--- a/engines/got/views/game.cpp
+++ b/engines/got/views/game.cpp
@@ -49,7 +49,7 @@ bool Game::msgKeypress(const KeypressMessage &msg) {
switch (msg.keycode) {
case Common::KEYCODE_F1:
- odin_speaks(2008, -1);
+ odinSpeaks(2008, -1);
return true;
case Common::KEYCODE_f:
@@ -95,7 +95,7 @@ bool Game::msgAction(const ActionMessage &msg) {
break;
case KEYBIND_SELECT:
- select_item();
+ selectItem();
return true;
case KEYBIND_THOR_DIES:
diff --git a/engines/got/views/game_content.cpp b/engines/got/views/game_content.cpp
index c1d2d482f54..7aaf560e1b4 100644
--- a/engines/got/views/game_content.cpp
+++ b/engines/got/views/game_content.cpp
@@ -189,8 +189,8 @@ bool GameContent::tick() {
add_magic(-1);
add_score(10);
- } else if (_G(thor_info).jewels) {
- _G(thor_info).jewels--;
+ } else if (_G(thor_info)._jewels) {
+ _G(thor_info)._jewels--;
play_sound(WOOP, 1);
add_jewels(-1);
add_score(10);
@@ -215,7 +215,7 @@ bool GameContent::tick() {
Gfx::fade_out();
// Add name to high scores list if necessary, and then show it
- _G(highScores).add(_G(area), _G(playerName), _G(thor_info).score);
+ _G(highScores).add(_G(area), _G(playerName), _G(thor_info)._score);
g_events->send("HighScores", GameMessage("HIGH_SCORES", _G(area)));
}
@@ -332,10 +332,10 @@ void GameContent::checkSwitchFlag() {
if (_G(switch_flag)) {
switch (_G(switch_flag)) {
case 1:
- switch_icons();
+ switchIcons();
break;
case 2:
- rotate_arrows();
+ rotateArrows();
break;
default:
break;
@@ -460,7 +460,7 @@ void GameContent::checkForAreaChange() {
if (_G(gameMode) == MODE_NORMAL) {
_transitionPos = 0;
- show_level_done();
+ showLevelDone();
}
} else if (_G(new_level) != _G(current_level)) {
@@ -477,7 +477,7 @@ void GameContent::checkForAreaChange() {
// Set up new level
_G(thor)->_active = true;
- show_level(_G(new_level));
+ showLevel(_G(new_level));
}
}
@@ -508,12 +508,12 @@ void GameContent::spinThor() {
}
void GameContent::thorDead() {
- int li = _G(thor_info).item;
- int ln = _G(thor_info).inventory;
+ int li = _G(thor_info)._selectedItem;
+ int ln = _G(thor_info)._inventory;
- _G(new_level) = _G(thor_info).last_screen;
- _G(thor)->_x = (_G(thor_info).last_icon % 20) * 16;
- _G(thor)->_y = ((_G(thor_info).last_icon / 20) * 16) - 1;
+ _G(new_level) = _G(thor_info)._lastScreen;
+ _G(thor)->_x = (_G(thor_info)._lastIcon % 20) * 16;
+ _G(thor)->_y = ((_G(thor_info)._lastIcon / 20) * 16) - 1;
if (_G(thor)->_x < 1)
_G(thor)->_x = 1;
if (_G(thor)->_y < 0)
@@ -522,21 +522,21 @@ void GameContent::thorDead() {
_G(thor)->_lastX[1] = _G(thor)->_x;
_G(thor)->_lastY[0] = _G(thor)->_y;
_G(thor)->_lastY[1] = _G(thor)->_y;
- _G(thor)->_dir = _G(thor_info).last_dir;
- _G(thor)->_lastDir = _G(thor_info).last_dir;
- _G(thor)->_health = _G(thor_info).last_health;
- _G(thor_info)._magic = _G(thor_info).last_magic;
- _G(thor_info).jewels = _G(thor_info).last_jewels;
- _G(thor_info).keys = _G(thor_info).last_keys;
- _G(thor_info).score = _G(thor_info).last_score;
- _G(thor_info).object = _G(thor_info).last_object;
- _G(thor_info).object_name = _G(thor_info).last_object_name;
-
- if (ln == _G(thor_info).last_inventory) {
- _G(thor_info).item = li;
+ _G(thor)->_dir = _G(thor_info)._lastDir;
+ _G(thor)->_lastDir = _G(thor_info)._lastDir;
+ _G(thor)->_health = _G(thor_info)._lastHealth;
+ _G(thor_info)._magic = _G(thor_info)._lastMagic;
+ _G(thor_info)._jewels = _G(thor_info)._lastJewels;
+ _G(thor_info)._keys = _G(thor_info)._lastKeys;
+ _G(thor_info)._score = _G(thor_info)._lastScore;
+ _G(thor_info)._object = _G(thor_info)._lastObject;
+ _G(thor_info)._objectName = _G(thor_info)._lastObjectName;
+
+ if (ln == _G(thor_info)._lastInventory) {
+ _G(thor_info)._selectedItem = li;
} else {
- _G(thor_info).item = _G(thor_info).last_item;
- _G(thor_info).inventory = _G(thor_info).last_inventory;
+ _G(thor_info)._selectedItem = _G(thor_info)._lastItem;
+ _G(thor_info)._inventory = _G(thor_info)._lastInventory;
}
_G(setup) = _G(last_setup);
@@ -563,7 +563,7 @@ void GameContent::thorDead() {
_G(gameMode) = MODE_NORMAL;
_deathCtr = 0;
- show_level(_G(new_level));
+ showLevel(_G(new_level));
set_thor_vars();
}
@@ -573,7 +573,7 @@ void GameContent::checkForCheats() {
if (_G(cheats).freezeMagic)
_G(thor_info)._magic = 150;
if (_G(cheats).freezeJewels)
- _G(thor_info).jewels = 999;
+ _G(thor_info)._jewels = 999;
}
void GameContent::placePixel(GfxSurface &s, int dir, int num) {
diff --git a/engines/got/views/game_status.cpp b/engines/got/views/game_status.cpp
index 24301d48780..0d06737f236 100644
--- a/engines/got/views/game_status.cpp
+++ b/engines/got/views/game_status.cpp
@@ -60,7 +60,7 @@ void GameStatus::displayMagic(GfxSurface &s) {
}
void GameStatus::displayJewels(GfxSurface &s) {
- Common::String str = Common::String::format("%d", _G(thor_info).jewels);
+ Common::String str = Common::String::format("%d", _G(thor_info)._jewels);
int x;
if (str.size() == 1)
x = 70;
@@ -74,7 +74,7 @@ void GameStatus::displayJewels(GfxSurface &s) {
}
void GameStatus::displayScore(GfxSurface &s) {
- Common::String str = Common::String::format("%ld", _G(thor_info).score);
+ Common::String str = Common::String::format("%ld", _G(thor_info)._score);
int x = 276 - (str.size() * 8);
s.fillRect(Common::Rect(223, 32, 279, 42), STAT_COLOR);
@@ -82,7 +82,7 @@ void GameStatus::displayScore(GfxSurface &s) {
}
void GameStatus::displayKeys(GfxSurface &s) {
- Common::String str = Common::String::format("%d", _G(thor_info).keys);
+ Common::String str = Common::String::format("%d", _G(thor_info)._keys);
int x;
if (str.size() == 1)
@@ -99,12 +99,12 @@ void GameStatus::displayKeys(GfxSurface &s) {
void GameStatus::displayItem(GfxSurface &s) {
s.fillRect(Common::Rect(280, 8, 296, 24), STAT_COLOR);
- THOR_INFO thorInfo = _G(thor_info);
- if (thorInfo.item) {
- if (thorInfo.item == 7)
- s.simpleBlitFrom(_G(objects[thorInfo.object + 10]), Common::Point(280, 8));
+ ThorInfo thorInfo = _G(thor_info);
+ if (thorInfo._selectedItem) {
+ if (thorInfo._selectedItem == 7)
+ s.simpleBlitFrom(_G(objects[thorInfo._object + 10]), Common::Point(280, 8));
else
- s.simpleBlitFrom(_G(objects[thorInfo.item + 25]), Common::Point(280, 8));
+ s.simpleBlitFrom(_G(objects[thorInfo._selectedItem + 25]), Common::Point(280, 8));
}
}
More information about the Scummvm-git-logs
mailing list