[Scummvm-git-logs] scummvm master -> 1ec1f88c525fbadaea265393abb02f83766e77c7
sev-
noreply at scummvm.org
Sun Oct 27 23:17:30 UTC 2024
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:
1ec1f88c52 QDENGINE: Rename class variables in minigames/adv/RunTime.cpp
Commit: 1ec1f88c525fbadaea265393abb02f83766e77c7
https://github.com/scummvm/scummvm/commit/1ec1f88c525fbadaea265393abb02f83766e77c7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-28T00:17:17+01:00
Commit Message:
QDENGINE: Rename class variables in minigames/adv/RunTime.cpp
Changed paths:
engines/qdengine/minigames/adv/RunTime.cpp
engines/qdengine/minigames/adv/RunTime.h
diff --git a/engines/qdengine/minigames/adv/RunTime.cpp b/engines/qdengine/minigames/adv/RunTime.cpp
index 942d317185a..2078724e8c4 100644
--- a/engines/qdengine/minigames/adv/RunTime.cpp
+++ b/engines/qdengine/minigames/adv/RunTime.cpp
@@ -58,7 +58,7 @@ public:
void quant(float dt);
private:
- float gameTime_;
+ float _gameTime;
float timeCost_;
int lastEventTime_;
mgVect3f startPos_;
@@ -68,43 +68,43 @@ private:
};
MinigameManager::MinigameManager(MinigameConsCallback callback)
- : currentGameIndex_(-1, -1) {
- state_container_name_ = Common::String::format("%s.min", g_engine->getTargetName().c_str());
-
- engine_ = 0;
- scene_ = 0;
-
- timeManager_ = 0;
- textManager_ = 0;
- eventManager_ = 0;
- effectManager_ = 0;
- state_flag_ = 0;
- pause_flag_ = 0;
- complete_help_ = 0;
- complete_help_miniature_ = 0;
- game_help_ = 0;
- game_help_trigger_ = 0;
- game_help_enabled_ = true;
- game_ = 0;
- gameTime_ = 0;
-
- currentGameInfo_ = 0;
-
- invertMouseButtons_ = false;
- debugMode_ = false;
- seed_ = 0;
+ : _currentGameIndex(-1, -1) {
+ _state_container_name = Common::String::format("%s.min", g_engine->getTargetName().c_str());
+
+ _engine = 0;
+ _scene = 0;
+
+ _timeManager = 0;
+ _textManager = 0;
+ _eventManager = 0;
+ _effectManager = 0;
+ _state_flag = 0;
+ _pause_flag = 0;
+ _complete_help = 0;
+ _complete_help_miniature = 0;
+ _game_help = 0;
+ _game_help_trigger = 0;
+ _game_help_enabled = true;
+ _game = 0;
+ _gameTime = 0;
+
+ _currentGameInfo = 0;
+
+ _invertMouseButtons = false;
+ _debugMode = false;
+ _seed = 0;
for (int idx = 0; idx < 256; ++idx)
- lastKeyChecked_[idx] = false;
+ _lastKeyChecked[idx] = false;
_callback = callback;
}
MinigameManager::~MinigameManager() {
- assert(!engine_ && !scene_);
+ assert(!_engine && !_scene);
- for (auto &it : gameInfos_) {
- debugC(5, kDebugMinigames, "~MinigameManager(): free: (%d,%d)", it._key.gameLevel_, it._key.gameNum_);
+ for (auto &it : _gameInfos) {
+ debugC(5, kDebugMinigames, "~MinigameManager(): free: (%d,%d)", it._key._gameLevel, it._key._gameNum);
it._value.free();
}
}
@@ -117,18 +117,18 @@ bool MinigameManager::init(const qdEngineInterface *engine_interface) {
if (g_runtime != this)
return false;
- assert(!engine_ && !scene_);
+ assert(!_engine && !_scene);
assert(engine_interface);
if (!engine_interface)
return false;
- engine_ = engine_interface;
- scene_ = engine_->current_scene_interface();
+ _engine = engine_interface;
+ _scene = _engine->current_scene_interface();
- assert(scene_);
- if (!scene_) {
- engine_ = 0;
+ assert(_scene);
+ if (!_scene) {
+ _engine = 0;
return false;
}
@@ -144,48 +144,48 @@ bool MinigameManager::init(const qdEngineInterface *engine_interface) {
}
bool MinigameManager::createGame() {
- assert(engine_ && scene_);
- assert(!game_);
+ assert(_engine && _scene);
+ assert(!_game);
- screenSize_ = engine_->screen_size();
+ _screenSize = _engine->screen_size();
#ifdef _DEBUG
- debugMode_ = getParameter("debug_mode", false);
+ _debugMode = getParameter("debug_mode", false);
#endif
- seed_ = 0;
+ _seed = 0;
if (!loadState())
return false;
- if (currentGameInfo_) {
- debugC(2, kDebugMinigames, "MinigameManager::createGame(): level: %d, game: %d, index: %d", currentGameIndex_.gameLevel_, currentGameIndex_.gameNum_, currentGameInfo_->game_.sequenceIndex_);
- debugC(2, kDebugMinigames, "MinigameManager::createGame(): %s", currentGameInfo_->game_.sequenceIndex_ == -1 ? "FIRST TIME PLAY" : "RePlay game");
+ if (_currentGameInfo) {
+ debugC(2, kDebugMinigames, "MinigameManager::createGame(): level: %d, game: %d, index: %d", _currentGameIndex._gameLevel, _currentGameIndex._gameNum, _currentGameInfo->_game._sequenceIndex);
+ debugC(2, kDebugMinigames, "MinigameManager::createGame(): %s", _currentGameInfo->_game._sequenceIndex == -1 ? "FIRST TIME PLAY" : "RePlay game");
}
int s = getParameter("random_seed", -1);
- seed_ = debugMode_ ? 0 : (s >= 0 ? s : seed_);
+ _seed = _debugMode ? 0 : (s >= 0 ? s : _seed);
- engine_->rnd_init(seed_);
- debugC(2, kDebugMinigames, "MinigameManager::createGame(): seed = %d", seed_);
+ _engine->rnd_init(_seed);
+ debugC(2, kDebugMinigames, "MinigameManager::createGame(): seed = %d", _seed);
- invertMouseButtons_ = getParameter("invert_mouse_buttons", false);
- mouseAdjast_ = getParameter("ajast_mouse", mgVect2f());
+ _invertMouseButtons = getParameter("invert_mouse_buttons", false);
+ _mouseAdjast = getParameter("ajast_mouse", mgVect2f());
- HoldData<TimeManagerData> timeData(currentGameInfo_ ? ¤tGameInfo_->timeManagerData_ : 0, !currentGameInfo_ || currentGameInfo_->empty_);
- timeManager_ = new TimeManager(timeData);
+ HoldData<TimeManagerData> timeData(_currentGameInfo ? &_currentGameInfo->_timeManagerData : 0, !_currentGameInfo || _currentGameInfo->_empty);
+ _timeManager = new TimeManager(timeData);
- textManager_ = new TextManager();
+ _textManager = new TextManager();
- eventManager_ = new EventManager();
+ _eventManager = new EventManager();
- HoldData<EffectManagerData> effectData(currentGameInfo_ ? ¤tGameInfo_->effectManagerData_ : 0, !currentGameInfo_ || currentGameInfo_->empty_);
- effectManager_ = new EffectManager(effectData);
+ HoldData<EffectManagerData> effectData(_currentGameInfo ? &_currentGameInfo->_effectManagerData : 0, !_currentGameInfo || _currentGameInfo->_empty);
+ _effectManager = new EffectManager(effectData);
- const char *stateFlagName = parameter("state_flag_name", "state_flag");
+ const char *stateFlagName = parameter("_state_flagname", "state_flag");
- if ((state_flag_ = scene_->object_interface(stateFlagName))) {
- if (!state_flag_->has_state("game") || !state_flag_->has_state("win") || !state_flag_->has_state("lose")) {
+ if ((_state_flag = _scene->object_interface(stateFlagName))) {
+ if (!_state_flag->has_state("game") || !_state_flag->has_state("win") || !_state_flag->has_state("lose")) {
warning("MinigameManager::createGame(): The object %s must have state: game, win, lose", transCyrillic(stateFlagName));
return false;
}
@@ -194,21 +194,21 @@ bool MinigameManager::createGame() {
return false;
}
- const char *pauseFlagName = parameter("pause_flag_name", "BackHelp");
+ const char *pauseFlagName = parameter("_pause_flagname", "BackHelp");
- if ((pause_flag_ = scene_->object_interface(pauseFlagName))) {
- if (!pause_flag_->has_state("on")) {
+ if ((_pause_flag = _scene->object_interface(pauseFlagName))) {
+ if (!_pause_flag->has_state("on")) {
warning("MinigameManager::createGame(): The object %s must have state: on", transCyrillic(pauseFlagName));
return false;
}
}
- complete_help_state_name_ = "01";
+ _complete_help_state_name = "01";
if (testObject(parameter("complete_help_miniatute", "miniature"))) {
- complete_help_miniature_ = getObject(parameter("complete_help_miniatute", "miniature"));
- if ((complete_help_ = getObject(parameter("complete_help", "complete")))) {
- if (!complete_help_->has_state("off") || !complete_help_->has_state("01")) {
+ _complete_help_miniature = getObject(parameter("complete_help_miniatute", "miniature"));
+ if ((_complete_help = getObject(parameter("complete_help", "complete")))) {
+ if (!_complete_help->has_state("off") || !_complete_help->has_state("01")) {
warning("MinigameManager::createGame(): The object for completed game must have state: off, 01");
return false;
}
@@ -218,26 +218,26 @@ bool MinigameManager::createGame() {
}
}
- game_help_state_name_ = "off";
+ _game_help_state_name = "off";
if (testObject(parameter("tips_object", "tips"))) {
- game_help_ = getObject(parameter("tips_object", "tips"));
- game_help_.setState(game_help_state_name_.c_str());
+ _game_help = getObject(parameter("tips_object", "tips"));
+ _game_help.setState(_game_help_state_name.c_str());
}
if (testObject(parameter("tips_switcher", "tips_button"))) {
- game_help_trigger_ = getObject(parameter("tips_switcher", "tips_button"));
- game_help_trigger_.setState(game_help_enabled_ ? "01" : "02");
+ _game_help_trigger = getObject(parameter("tips_switcher", "tips_button"));
+ _game_help_trigger.setState(_game_help_enabled ? "01" : "02");
}
// Here we instantiate the specific game
- game_ = _callback();
+ _game = _callback();
- if (currentGameInfo_)
- currentGameInfo_->empty_ = false;
+ if (_currentGameInfo)
+ _currentGameInfo->_empty = false;
- if (game_ && game_->state() != MinigameInterface::NOT_INITED) {
- textManager_->updateScore(eventManager_->score());
- state_flag_->set_state("game");
+ if (_game && _game->state() != MinigameInterface::NOT_INITED) {
+ _textManager->updateScore(_eventManager->score());
+ _state_flag->set_state("game");
return true;
}
@@ -246,66 +246,66 @@ bool MinigameManager::createGame() {
#define SAFE_RELEASE(name) \
if (name) { \
- scene_->release_object_interface(name); \
+ _scene->release_object_interface(name); \
name = 0; \
}
bool MinigameManager::finit() {
debugC(2, kDebugMinigames, "MinigameManager::finit(): finit game");
- if (!engine_)
+ if (!_engine)
return false;
- delete game_;
- game_ = 0;
+ delete _game;
+ _game = 0;
- delete effectManager_;
- effectManager_ = 0;
+ delete _effectManager;
+ _effectManager = 0;
- delete eventManager_;
- eventManager_ = 0;
+ delete _eventManager;
+ _eventManager = 0;
- delete textManager_;
- textManager_ = 0;
+ delete _textManager;
+ _textManager = 0;
- delete timeManager_;
- timeManager_ = 0;
+ delete _timeManager;
+ _timeManager = 0;
- if (scene_) {
- SAFE_RELEASE(state_flag_)
- SAFE_RELEASE(pause_flag_)
+ if (_scene) {
+ SAFE_RELEASE(_state_flag)
+ SAFE_RELEASE(_pause_flag)
- release(complete_help_miniature_);
- release(complete_help_);
+ release(_complete_help_miniature);
+ release(_complete_help);
- release(game_help_);
- release(game_help_trigger_);
+ release(_game_help);
+ release(_game_help_trigger);
}
- game_help_enabled_ = true;
+ _game_help_enabled = true;
- complete_help_state_name_.clear();
- game_help_state_name_.clear();
+ _complete_help_state_name.clear();
+ _game_help_state_name.clear();
- completeCounters_.clear();
+ _completeCounters.clear();
- currentGameInfo_ = 0;
- currentGameIndex_ = GameInfoIndex(-1, -1);
+ _currentGameInfo = 0;
+ _currentGameIndex = GameInfoIndex(-1, -1);
- gameInfos_.clear();
+ _gameInfos.clear();
- seed_ = 0;
- debugMode_ = false;
- invertMouseButtons_ = false;
- mouseAdjast_ = mgVect2f();
+ _seed = 0;
+ _debugMode = false;
+ _invertMouseButtons = false;
+ _mouseAdjast = mgVect2f();
- if (scene_) {
- engine_->release_scene_interface(scene_);
- scene_ = 0;
+ if (_scene) {
+ _engine->release_scene_interface(_scene);
+ _scene = 0;
}
- gameTime_ = 0;
+ _gameTime = 0;
- engine_ = 0;
+ _engine = 0;
return true;
}
@@ -319,9 +319,9 @@ bool MinigameManager::new_game(const qdEngineInterface *engine_interface) {
}
debugC(2, kDebugMinigames, "MinigameManager::new_game(): new game");
- for (auto &it : gameInfos_) {
- debugC(3, kDebugMinigames, "MinigameManager::new_game(): clean game data (%d, %d)", it._key.gameLevel_, it._key.gameNum_);
- it._value.game_ = MinigameData();
+ for (auto &it : _gameInfos) {
+ debugC(3, kDebugMinigames, "MinigameManager::new_game(): clean game data (%d, %d)", it._key._gameLevel, it._key._gameNum);
+ it._value._game = MinigameData();
}
saveState(true);
@@ -330,7 +330,7 @@ bool MinigameManager::new_game(const qdEngineInterface *engine_interface) {
class TempValue {
const qdEngineInterface *pre_engine_;
- qdMinigameSceneInterface *pre_scene_;
+ qdMinigameSceneInterface *pre__scene;
MinigameManager *pre_runtime_;
public:
TempValue(MinigameManager *new_runtime, const qdEngineInterface *new_engine, qdMinigameSceneInterface *new_scene) {
@@ -339,32 +339,32 @@ public:
g_runtime = new_runtime;
assert(new_engine && new_scene);
- pre_engine_ = g_runtime->engine_;
- pre_scene_ = g_runtime->scene_;
+ pre_engine_ = g_runtime->_engine;
+ pre__scene = g_runtime->_scene;
- g_runtime->engine_ = new_engine;
- g_runtime->scene_ = new_scene;
+ g_runtime->_engine = new_engine;
+ g_runtime->_scene = new_scene;
}
~TempValue() {
- g_runtime->engine_ = pre_engine_;
- g_runtime->scene_ = pre_scene_;
+ g_runtime->_engine = pre_engine_;
+ g_runtime->_scene = pre__scene;
g_runtime = pre_runtime_;
}
};
-#define TEMP_SCENE_ENTER() TempValue tempSceneObject(this, engine, const_cast<qdMinigameSceneInterface*>(scene))
+#define TEMP__sceneENTER() TempValue tempSceneObject(this, engine, const_cast<qdMinigameSceneInterface*>(scene))
int MinigameManager::save_game(const qdEngineInterface *engine, const qdMinigameSceneInterface *scene, char *buffer, int buffer_size) {
debugC(2, kDebugMinigames, "MinigameManager::save_game(): save game");
- TEMP_SCENE_ENTER();
+ TEMP__sceneENTER();
loadState();
- if (currentGameInfo_ && !currentGameInfo_->empty()) {
- debugC(2, kDebugMinigames, "MinigameManager::save_game(): save game (%d, %d)", currentGameIndex_.gameLevel_, currentGameIndex_.gameNum_);
+ if (_currentGameInfo && !_currentGameInfo->empty()) {
+ debugC(2, kDebugMinigames, "MinigameManager::save_game(): save game (%d, %d)", _currentGameIndex._gameLevel, _currentGameIndex._gameNum);
Common::MemoryWriteStream out((byte *)buffer, buffer_size);
out.writeUint32LE(GameInfo::version());
- currentGameInfo_->game_.write(out);
+ _currentGameInfo->_game.write(out);
return out.pos();
}
return 0;
@@ -372,28 +372,28 @@ int MinigameManager::save_game(const qdEngineInterface *engine, const qdMinigame
}
int MinigameManager::load_game(const qdEngineInterface *engine, const qdMinigameSceneInterface *scene, const char *buffer, int buffer_size) {
- assert(!game_);
- if (game_) {
+ assert(!_game);
+ if (_game) {
debugC(2, kDebugMinigames, "MinigameManager::load_game(): load game skiped");
return buffer_size;
}
debugC(2, kDebugMinigames, "MinigameManager::load_game(): load game");
- TEMP_SCENE_ENTER();
+ TEMP__sceneENTER();
loadState();
- if (currentGameInfo_) {
+ if (_currentGameInfo) {
if (buffer_size > 0) {
- debugC(2, kDebugMinigames, "MinigameManager::load_game(): load game (%d, %d)", currentGameIndex_.gameLevel_, currentGameIndex_.gameNum_);
+ debugC(2, kDebugMinigames, "MinigameManager::load_game(): load game (%d, %d)", _currentGameIndex._gameLevel, _currentGameIndex._gameNum);
Common::MemoryReadStream in((const byte *)buffer, buffer_size);
int version;
version = in.readUint32LE();
if (version == GameInfo::version()) {
- currentGameInfo_->game_.read(in);
+ _currentGameInfo->_game.read(in);
- if (currentGameInfo_->empty_)
+ if (_currentGameInfo->_empty)
warning("MinigameManager::load_game(): Attempt to load minigame without a scene");
if (in.pos() != buffer_size) {
- currentGameInfo_->game_ = MinigameData();
+ _currentGameInfo->_game = MinigameData();
warning("MinigameManager::load_game(): Data size mismatch");
return 0;
}
@@ -402,8 +402,8 @@ int MinigameManager::load_game(const qdEngineInterface *engine, const qdMinigame
return 0;
}
} else {
- debugC(2, kDebugMinigames, "MinigameManager::load_game(): clean game (%d, %d)", currentGameIndex_.gameLevel_, currentGameIndex_.gameNum_);
- currentGameInfo_->game_ = MinigameData();
+ debugC(2, kDebugMinigames, "MinigameManager::load_game(): clean game (%d, %d)", _currentGameIndex._gameLevel, _currentGameIndex._gameNum);
+ _currentGameInfo->_game = MinigameData();
}
saveState();
}
@@ -413,7 +413,7 @@ int MinigameManager::load_game(const qdEngineInterface *engine, const qdMinigame
}
bool MinigameManager::loadState(bool current) {
- if (game_) {
+ if (_game) {
debugC(2, kDebugMinigames, "MinigameManager::loadState(): load state skiped");
return false;
}
@@ -424,26 +424,26 @@ bool MinigameManager::loadState(bool current) {
if (gameNumber >= 0)
if (!getParameter("game_level", gameLevel, true))
return false;
- currentGameIndex_ = GameInfoIndex(gameNumber, gameLevel);
+ _currentGameIndex = GameInfoIndex(gameNumber, gameLevel);
} else
- currentGameIndex_ = GameInfoIndex(-1, -1);
+ _currentGameIndex = GameInfoIndex(-1, -1);
- if (!current || currentGameIndex_.gameNum_ >= 0) {
+ if (!current || _currentGameIndex._gameNum >= 0) {
if (current)
- debugC(2, kDebugMinigames, "MinigameManager::loadState(): current game: (%d,%d)", currentGameIndex_.gameLevel_, currentGameIndex_.gameNum_);
+ debugC(2, kDebugMinigames, "MinigameManager::loadState(): current game: (%d,%d)", _currentGameIndex._gameLevel, _currentGameIndex._gameNum);
- Common::InSaveFile *file = g_engine->getSaveFileManager()->openForLoading(state_container_name_);
+ Common::InSaveFile *file = g_engine->getSaveFileManager()->openForLoading(_state_container_name);
if (file) {
int version = file->readUint32LE();
if (version != GameInfo::version()) {
- warning("MinigameManager::loadState(): Minigame savestate version mismatch. Remove '%s'", state_container_name_.c_str());
+ warning("MinigameManager::loadState(): Minigame savestate version mismatch. Remove '%s'", _state_container_name.c_str());
delete file;
return false;
}
- seed_ = file->readUint32LE();
+ _seed = file->readUint32LE();
GameInfoIndex index(0, 0);
@@ -453,18 +453,18 @@ bool MinigameManager::loadState(bool current) {
GameInfo data;
data.read(*file);
- debugC(2, kDebugMinigames, "MinigameManager::loadState(): read game info: (%d,%d), index: %d, game data:%d", index.gameLevel_, index.gameNum_, data.game_.sequenceIndex_, data.empty_ ? 0 : 1);
+ debugC(2, kDebugMinigames, "MinigameManager::loadState(): read game info: (%d,%d), index: %d, game data:%d", index._gameLevel, index._gameNum, data._game._sequenceIndex, data._empty ? 0 : 1);
- if (data.game_.sequenceIndex_ >= 0)
- completeCounters_[index.gameLevel_]++;
+ if (data._game._sequenceIndex >= 0)
+ _completeCounters[index._gameLevel]++;
- gameInfos_[index] = data;
+ _gameInfos[index] = data;
}
delete file;
}
- currentGameInfo_ = current ? &gameInfos_[currentGameIndex_] : 0;
+ _currentGameInfo = current ? &_gameInfos[_currentGameIndex] : 0;
}
return true;
@@ -473,16 +473,16 @@ bool MinigameManager::loadState(bool current) {
void MinigameManager::saveState(bool force) {
debugC(2, kDebugMinigames, "MinigameManager::save_state(): save state");
- if (force || currentGameIndex_.gameNum_ >= 0) {
- Common::OutSaveFile *file = g_engine->getSaveFileManager()->openForSaving(state_container_name_);
+ if (force || _currentGameIndex._gameNum >= 0) {
+ Common::OutSaveFile *file = g_engine->getSaveFileManager()->openForSaving(_state_container_name);
if (file) {
file->writeUint32LE(GameInfo::version());
- file->writeUint32LE(engine_ ? engine_->rnd(999999) : seed_);
+ file->writeUint32LE(_engine ? _engine->rnd(999999) : _seed);
- for (auto &it : gameInfos_) {
+ for (auto &it : _gameInfos) {
if (!it._value.empty()) {
- debugC(2, kDebugMinigames, "MinigameManager::save_state(): write game info: (%d,%d), index: %d, game data: %d", it._key.gameLevel_, it._key.gameNum_, it._value.game_.sequenceIndex_, it._value.empty_ ? 0 : 1);
+ debugC(2, kDebugMinigames, "MinigameManager::save_state(): write game info: (%d,%d), index: %d, game data: %d", it._key._gameLevel, it._key._gameNum, it._value._game._sequenceIndex, it._value._empty ? 0 : 1);
it._key.write(*file);
it._value.write(*file);
}
@@ -491,61 +491,61 @@ void MinigameManager::saveState(bool force) {
file->finalize();
delete file;
} else {
- warning("MinigameManager::saveState(): Failed to save file '%s'", state_container_name_.c_str());
+ warning("MinigameManager::saveState(): Failed to save file '%s'", _state_container_name.c_str());
}
}
}
bool MinigameManager::quant(float dt) {
- if (!game_)
+ if (!_game)
return false;
- if (pause_flag_ && pause_flag_->is_state_active("on"))
+ if (_pause_flag && _pause_flag->is_state_active("on"))
return true;
- gameTime_ += dt;
+ _gameTime += dt;
- mgVect2i pos = engine_->mouse_cursor_position();
- mousePos_ = mgVect2f(pos.x, pos.y);
- mousePos_ += mouseAdjast_;
+ mgVect2i pos = _engine->mouse_cursor_position();
+ _mousePos = mgVect2f(pos.x, pos.y);
+ _mousePos += _mouseAdjast;
- if (game_->state() == MinigameInterface::RUNNING) {
- timeManager_->quant(dt);
+ if (_game->state() == MinigameInterface::RUNNING) {
+ _timeManager->quant(dt);
- if (complete_help_miniature_) {
- assert(complete_help_);
- if (complete_help_miniature_.hit(mousePos_))
- complete_help_.setState(complete_help_state_name_.c_str());
+ if (_complete_help_miniature) {
+ assert(_complete_help);
+ if (_complete_help_miniature.hit(_mousePos))
+ _complete_help.setState(_complete_help_state_name.c_str());
else
- complete_help_.setState("off");
+ _complete_help.setState("off");
}
- if (game_help_trigger_) {
- if (game_help_trigger_.hit(mousePosition())) {
- game_help_trigger_.setState(game_help_enabled_ ? "01_sel" : "02_sel");
+ if (_game_help_trigger) {
+ if (_game_help_trigger.hit(mousePosition())) {
+ _game_help_trigger.setState(_game_help_enabled ? "01_sel" : "02_sel");
if (mouseLeftPressed())
- game_help_enabled_ = !game_help_enabled_;
+ _game_help_enabled = !_game_help_enabled;
} else
- game_help_trigger_.setState(game_help_enabled_ ? "01" : "02");
+ _game_help_trigger.setState(_game_help_enabled ? "01" : "02");
}
- if (timeManager_->timeIsOut()) {
+ if (_timeManager->timeIsOut()) {
signal(EVENT_TIME_OUT);
- game_->setState(MinigameInterface::GAME_LOST);
+ _game->setState(MinigameInterface::GAME_LOST);
} else
- game_->quant(dt);
+ _game->quant(dt);
- if (game_help_)
- game_help_.setState(game_help_enabled_ ? game_help_state_name_.c_str() : "off");
+ if (_game_help)
+ _game_help.setState(_game_help_enabled ? _game_help_state_name.c_str() : "off");
#ifdef _DEBUG
if (keyPressed(VK_MULTIPLY, true))
- game_->setState(MinigameInterface::GAME_WIN);
+ _game->setState(MinigameInterface::GAME_WIN);
#endif
- switch (game_->state()) {
+ switch (_game->state()) {
case MinigameInterface::GAME_LOST:
- if (!timeManager_->timeIsOut())
+ if (!_timeManager->timeIsOut())
signal(EVENT_GAME_LOSE);
// fallthrough
case MinigameInterface::NOT_INITED:
@@ -563,12 +563,12 @@ bool MinigameManager::quant(float dt) {
}
for (int vKey = 0; vKey < 256; ++vKey)
- if (lastKeyChecked_[vKey])
- lastKeyChecked_[vKey] = engine_->is_key_pressed(vKey);
+ if (_lastKeyChecked[vKey])
+ _lastKeyChecked[vKey] = _engine->is_key_pressed(vKey);
- if (game_->state() != MinigameInterface::NOT_INITED) {
- textManager_->quant(dt);
- effectManager_->quant(dt);
+ if (_game->state() != MinigameInterface::NOT_INITED) {
+ _textManager->quant(dt);
+ _effectManager->quant(dt);
return true;
}
@@ -580,7 +580,7 @@ void MinigameManager::setCompleteHelpVariant(int idx) {
char buf[32];
buf[31] = 0;
snprintf(buf, 31, "%02d", idx + 1);
- complete_help_state_name_ = buf;
+ _complete_help_state_name = buf;
}
void MinigameManager::setGameHelpVariant(int idx) {
@@ -588,23 +588,23 @@ void MinigameManager::setGameHelpVariant(int idx) {
char buf[32];
buf[31] = 0;
snprintf(buf, 31, "%02d", idx + 1);
- game_help_state_name_ = buf;
+ _game_help_state_name = buf;
} else
- game_help_state_name_ = "off";
+ _game_help_state_name = "off";
}
void MinigameManager::event(int eventID, const mgVect2f& pos, int factor) {
- eventManager_->event(eventID, pos, factor);
+ _eventManager->event(eventID, pos, factor);
}
void MinigameManager::signal(SystemEvent id) {
- eventManager_->sysEvent(id);
+ _eventManager->sysEvent(id);
}
const MinigameData *MinigameManager::getScore(int level, int game) const {
- GameInfoMap::const_iterator it = gameInfos_.find(GameInfoIndex(game, level));
- if (it != gameInfos_.end())
- return &it->_value.game_;
+ GameInfoMap::const_iterator it = _gameInfos.find(GameInfoIndex(game, level));
+ if (it != _gameInfos.end())
+ return &it->_value._game;
return 0;
}
@@ -635,7 +635,7 @@ bool MinigameManager::testAllGamesWin() {
int game;
xbuf >= game;
const MinigameData *data = getScore(level, game);
- if (!data || data->sequenceIndex_ == -1)
+ if (!data || data->_sequenceIndex == -1)
return false;
}
}
@@ -647,40 +647,40 @@ bool MinigameManager::testAllGamesWin() {
void MinigameManager::gameWin() {
debugC(2, kDebugMinigames, "MinigameManager::gameWin(): Game Win");
- state_flag_->set_state("win");
+ _state_flag->set_state("win");
- if (debugMode() || !currentGameInfo_)
+ if (debugMode() || !_currentGameInfo)
return;
- assert(currentGameIndex_.gameNum_ >= 0);
+ assert(_currentGameIndex._gameNum >= 0);
- effectManager_->start(EFFECT_1);
+ _effectManager->start(EFFECT_1);
- if (currentGameIndex_.gameNum_ == 0)
+ if (_currentGameIndex._gameNum == 0)
return;
int gameTime = round(getTime());
- eventManager_->addScore(round(timeManager_->leftTime() * timeManager_->timeCost()));
+ _eventManager->addScore(round(_timeManager->leftTime() * _timeManager->timeCost()));
- currentGameInfo_->game_.lastTime_ = gameTime;
- currentGameInfo_->game_.lastScore_ = eventManager_->score();
+ _currentGameInfo->_game._lastTime = gameTime;
+ _currentGameInfo->_game._lastScore = _eventManager->score();
- if (currentGameInfo_->game_.sequenceIndex_ >= 0) { // ÑÑо пеÑеигÑовка
- if (eventManager_->score() > currentGameInfo_->game_.bestScore_) {
+ if (_currentGameInfo->_game._sequenceIndex >= 0) { // ÑÑо пеÑеигÑовка
+ if (_eventManager->score() > _currentGameInfo->_game._bestScore) {
debugC(2, kDebugMinigames, "MinigameManager::gameWin(): new high score");
- currentGameInfo_->game_.bestScore_ = eventManager_->score();
- currentGameInfo_->game_.bestTime_ = gameTime;
+ _currentGameInfo->_game._bestScore = _eventManager->score();
+ _currentGameInfo->_game._bestTime = gameTime;
}
} else {
- debugC(2, kDebugMinigames, "MinigameManager::gameWin(): adding score to the sum: %d", eventManager_->score());
- currentGameInfo_->game_.sequenceIndex_ = completeCounters_[currentGameIndex_.gameLevel_];
- currentGameInfo_->game_.bestScore_ = eventManager_->score();
- currentGameInfo_->game_.bestTime_ = gameTime;
+ debugC(2, kDebugMinigames, "MinigameManager::gameWin(): adding score to the sum: %d", _eventManager->score());
+ _currentGameInfo->_game._sequenceIndex = _completeCounters[_currentGameIndex._gameLevel];
+ _currentGameInfo->_game._bestScore = _eventManager->score();
+ _currentGameInfo->_game._bestTime = gameTime;
if (QDCounter all_score = getCounter("all_score")) {
- all_score->add_value(eventManager_->score());
+ all_score->add_value(_eventManager->score());
if (testAllGamesWin()) {
debugC(2, kDebugMinigames, "MinigameManager::gameWin(): All games are won, adding record to the score table: %d", all_score->value());
- engine_->add_hall_of_fame_entry(all_score->value());
+ _engine->add_hall_of_fame_entry(all_score->value());
}
release(all_score);
}
@@ -695,14 +695,14 @@ void MinigameManager::gameWin() {
void MinigameManager::gameLose() {
debugC(2, kDebugMinigames, "MinigameManager: Game Lose");
- state_flag_->set_state("lose");
+ _state_flag->set_state("lose");
}
const char *MinigameManager::parameter(const char *name, bool required) const {
- if (!scene_)
+ if (!_scene)
error("MinigameManager::parameter(): Scene is undefined");
- const char *txt = scene_->minigame_parameter(name);
+ const char *txt = _scene->minigame_parameter(name);
if (required && !txt)
warning("MinigameManager::parameter(): Required parameter '%s' is missing in the ini file", transCyrillic(name));
@@ -714,7 +714,7 @@ const char *MinigameManager::parameter(const char *name, const char *def) const
if (!def)
warning("MinigameManager::parameter(): Default value for parameter '%s' is missing", transCyrillic(name));
- const char *txt = scene_->minigame_parameter(name);
+ const char *txt = _scene->minigame_parameter(name);
if (!def && !txt)
warning("MinigameManager::parameter(): Required parameter '%s' is missing in the ini file", transCyrillic(name));
@@ -723,47 +723,47 @@ const char *MinigameManager::parameter(const char *name, const char *def) const
}
bool MinigameManager::mouseLeftPressed() const {
- if (invertMouseButtons_)
- return engine_->is_mouse_event_active(qdEngineInterface::MOUSE_EV_RIGHT_DOWN);
- return engine_->is_mouse_event_active(qdEngineInterface::MOUSE_EV_LEFT_DOWN);
+ if (_invertMouseButtons)
+ return _engine->is_mouse_event_active(qdEngineInterface::MOUSE_EV_RIGHT_DOWN);
+ return _engine->is_mouse_event_active(qdEngineInterface::MOUSE_EV_LEFT_DOWN);
}
bool MinigameManager::mouseRightPressed() const {
- if (invertMouseButtons_)
- return engine_->is_mouse_event_active(qdEngineInterface::MOUSE_EV_LEFT_DOWN);
- return engine_->is_mouse_event_active(qdEngineInterface::MOUSE_EV_RIGHT_DOWN);
+ if (_invertMouseButtons)
+ return _engine->is_mouse_event_active(qdEngineInterface::MOUSE_EV_LEFT_DOWN);
+ return _engine->is_mouse_event_active(qdEngineInterface::MOUSE_EV_RIGHT_DOWN);
}
bool MinigameManager::keyPressed(int vKey, bool once) const {
assert(vKey >= 0 && vKey <= 255);
- if (engine_->is_key_pressed(vKey)) {
- if (once && lastKeyChecked_[vKey])
+ if (_engine->is_key_pressed(vKey)) {
+ if (once && _lastKeyChecked[vKey])
return false;
- return lastKeyChecked_[vKey] = true;
+ return _lastKeyChecked[vKey] = true;
}
- return lastKeyChecked_[vKey] = false;
+ return _lastKeyChecked[vKey] = false;
}
mgVect3f MinigameManager::game2world(const mgVect3i& coord) const {
- return scene_->screen2world_coords(reinterpret_cast<const mgVect2i &>(coord), coord.z);
+ return _scene->screen2world_coords(reinterpret_cast<const mgVect2i &>(coord), coord.z);
}
mgVect3f MinigameManager::game2world(const mgVect3f& coord) const {
- return scene_->screen2world_coords(mgVect2i(round(coord.x), round(coord.y)), round(coord.z));
+ return _scene->screen2world_coords(mgVect2i(round(coord.x), round(coord.y)), round(coord.z));
}
mgVect3f MinigameManager::game2world(const mgVect2i& coord, int depth) const {
- return scene_->screen2world_coords(coord, depth);
+ return _scene->screen2world_coords(coord, depth);
}
mgVect3f MinigameManager::game2world(const mgVect2f& coord, int depth) const {
- return scene_->screen2world_coords(mgVect2i(round(coord.x), round(coord.y)), depth);
+ return _scene->screen2world_coords(mgVect2i(round(coord.x), round(coord.y)), depth);
}
mgVect2f MinigameManager::world2game(const mgVect3f& pos) const {
- mgVect2i scr = scene_->world2screen_coords(pos);
+ mgVect2i scr = _scene->world2screen_coords(pos);
return mgVect2f(scr.x, scr.y);
}
@@ -782,15 +782,15 @@ mgVect2f MinigameManager::getSize(qdMinigameObjectInterface *obj) const {
void MinigameManager::setDepth(qdMinigameObjectInterface *obj, int depth) const {
mgVect2i scr = obj->screen_R();
- obj->set_R(scene_->screen2world_coords(scr, depth));
+ obj->set_R(_scene->screen2world_coords(scr, depth));
}
float MinigameManager::getDepth(qdMinigameObjectInterface *obj) const {
- return scene_->screen_depth(obj->R());
+ return _scene->screen_depth(obj->R());
}
float MinigameManager::getDepth(const mgVect3f& pos) const {
- return scene_->screen_depth(pos);
+ return _scene->screen_depth(pos);
}
QDObject MinigameManager::getObject(const char *name) const {
@@ -799,7 +799,7 @@ QDObject MinigameManager::getObject(const char *name) const {
return QDObject::ZERO;
}
- qdMinigameObjectInterface *obj = scene_->object_interface(name);
+ qdMinigameObjectInterface *obj = _scene->object_interface(name);
if (!obj)
warning("MinigameManager::getObject(): Object '%s' not found", transCyrillic(name));
@@ -809,8 +809,8 @@ QDObject MinigameManager::getObject(const char *name) const {
}
bool MinigameManager::testObject(const char *name) const {
- if (qdMinigameObjectInterface *obj = scene_->object_interface(name)) {
- scene_->release_object_interface(obj);
+ if (qdMinigameObjectInterface *obj = _scene->object_interface(name)) {
+ _scene->release_object_interface(obj);
return true;
}
return false;
@@ -818,13 +818,13 @@ bool MinigameManager::testObject(const char *name) const {
void MinigameManager::release(QDObject& obj) {
if (obj) {
- scene_->release_object_interface(obj);
+ _scene->release_object_interface(obj);
obj = 0;
}
}
QDCounter MinigameManager::getCounter(const char *name) {
- qdMinigameCounterInterface *counter = engine_->counter_interface(name);
+ qdMinigameCounterInterface *counter = _engine->counter_interface(name);
if (!counter)
warning("MinigameManager::getCounter(): Counter '%s' not found", transCyrillic(name));
@@ -836,12 +836,12 @@ void MinigameManager::release(QDCounter& counter) {
if (!counter)
warning("MinigameManager::release(): Null counter");
- engine_->release_counter_interface(counter);
+ _engine->release_counter_interface(counter);
counter = 0;
}
void MinigameManager::setText(const char *name, const char *text) const {
- engine_->set_interface_text(0, name, text);
+ _engine->set_interface_text(0, name, text);
}
void MinigameManager::setText(const char *name, int toText, const char *format) const {
@@ -852,15 +852,15 @@ void MinigameManager::setText(const char *name, int toText, const char *format)
}
void MinigameManager::hide(qdMinigameObjectInterface *obj) const {
- obj->set_R(scene_->screen2world_coords(mgVect2i(-10000, -10000), getDepth(obj)));
+ obj->set_R(_scene->screen2world_coords(mgVect2i(-10000, -10000), getDepth(obj)));
}
float MinigameManager::rnd(float min, float max) const {
- return min + engine_->fabs_rnd(max - min);
+ return min + _engine->fabs_rnd(max - min);
}
int MinigameManager::rnd(int min, int max) const {
- return min + round(engine_->fabs_rnd(max - min));
+ return min + round(_engine->fabs_rnd(max - min));
}
int MinigameManager::rnd(const Std::vector<float> &prob) const {
@@ -894,17 +894,17 @@ int MinigameManager::rnd(const Std::vector<float> &prob) const {
bool MinigameManager::processGameData(Common::SeekableReadStream &data) {
data.seek(0);
- if (currentGameInfo_) {
- if (currentGameInfo_->empty_) {
- currentGameInfo_->empty_ = false;
+ if (_currentGameInfo) {
+ if (_currentGameInfo->_empty) {
+ _currentGameInfo->_empty = false;
assert(data.pos());
- currentGameInfo_->persist(data);
+ _currentGameInfo->persist(data);
} else {
- if (data.pos() != currentGameInfo_->dataSize_)
- warning("MinigameManager::processGameData(): Old minigame save detected. Remove '%s'", state_container_name_.c_str());
+ if (data.pos() != _currentGameInfo->_dataSize)
+ warning("MinigameManager::processGameData(): Old minigame save detected. Remove '%s'", _state_container_name.c_str());
- if (data.pos() == currentGameInfo_->dataSize_) {
- currentGameInfo_->persist(data);
+ if (data.pos() == _currentGameInfo->_dataSize) {
+ _currentGameInfo->persist(data);
} else {
data.seek(0);
return false;
@@ -917,98 +917,98 @@ bool MinigameManager::processGameData(Common::SeekableReadStream &data) {
}
MinigameData::MinigameData() {
- sequenceIndex_ = -1;
- lastScore_ = 0;
- lastTime_ = 0;
- bestTime_ = 0;
- bestScore_ = 0;
+ _sequenceIndex = -1;
+ _lastScore = 0;
+ _lastTime = 0;
+ _bestTime = 0;
+ _bestScore = 0;
}
void MinigameData::write(Common::WriteStream &out) const {
- out.writeSint32LE(sequenceIndex_);
- out.writeSint32LE(lastScore_);
- out.writeSint32LE(lastTime_);
- out.writeSint32LE(bestTime_);
- out.writeSint32LE(bestScore_);
+ out.writeSint32LE(_sequenceIndex);
+ out.writeSint32LE(_lastScore);
+ out.writeSint32LE(_lastTime);
+ out.writeSint32LE(_bestTime);
+ out.writeSint32LE(_bestScore);
}
void MinigameData::read(Common::ReadStream &out) {
- sequenceIndex_ = out.readSint32LE();
- lastScore_ = out.readSint32LE();
- lastTime_ = out.readSint32LE();
- bestTime_ = out.readSint32LE();
- bestScore_ = out.readSint32LE();
+ _sequenceIndex = out.readSint32LE();
+ _lastScore = out.readSint32LE();
+ _lastTime = out.readSint32LE();
+ _bestTime = out.readSint32LE();
+ _bestScore = out.readSint32LE();
}
GameInfo::GameInfo() {
- empty_ = true;
- dataSize_ = 0;
- gameData_ = 0;
+ _empty = true;
+ _dataSize = 0;
+ _gameData = 0;
}
void GameInfo::free() {
- if (gameData_) {
- assert(dataSize_ > 0);
+ if (_gameData) {
+ assert(_dataSize > 0);
- ::free(gameData_);
- gameData_ = 0;
+ ::free(_gameData);
+ _gameData = 0;
}
- dataSize_ = 0;
+ _dataSize = 0;
}
void GameInfo::persist(Common::SeekableReadStream &in) {
- if (dataSize_ != in.size()) {
+ if (_dataSize != in.size()) {
free();
if (in.size() > 0) {
- dataSize_ = in.size();
- gameData_ = malloc(dataSize_);
+ _dataSize = in.size();
+ _gameData = malloc(_dataSize);
}
}
- if (dataSize_ > 0)
- in.read(gameData_, dataSize_);
+ if (_dataSize > 0)
+ in.read(_gameData, _dataSize);
}
void GameInfo::write(Common::WriteStream &out) const {
- game_.write(out);
- out.writeByte(empty_);
+ _game.write(out);
+ out.writeByte(_empty);
- if (!empty_) {
- timeManagerData_.crd.write(out);
- effectManagerData_.crd.write(out);
+ if (!_empty) {
+ _timeManagerData.crd.write(out);
+ _effectManagerData.crd.write(out);
- out.writeUint32LE(dataSize_);
- if (dataSize_ > 0)
- out.write(gameData_, dataSize_);
+ out.writeUint32LE(_dataSize);
+ if (_dataSize > 0)
+ out.write(_gameData, _dataSize);
}
}
void GameInfo::read(Common::ReadStream &in) {
- game_.read(in);
- empty_ = in.readByte();
+ _game.read(in);
+ _empty = in.readByte();
- if (!empty_) {
- timeManagerData_.crd.read(in);
- effectManagerData_.crd.read(in);
+ if (!_empty) {
+ _timeManagerData.crd.read(in);
+ _effectManagerData.crd.read(in);
free();
- dataSize_ = in.readUint32LE();
+ _dataSize = in.readUint32LE();
- if (dataSize_) {
- gameData_ = malloc(dataSize_);
- in.read(gameData_, dataSize_);
+ if (_dataSize) {
+ _gameData = malloc(_dataSize);
+ in.read(_gameData, _dataSize);
}
}
}
void MinigameManager::GameInfoIndex::write(Common::WriteStream &out) const {
- out.writeUint32LE(gameNum_);
- out.writeUint32LE(gameLevel_);
+ out.writeUint32LE(_gameNum);
+ out.writeUint32LE(_gameLevel);
}
void MinigameManager::GameInfoIndex::read(Common::ReadStream &in) {
- gameNum_ = in.readUint32LE();
- gameLevel_ = in.readUint32LE();
+ _gameNum = in.readUint32LE();
+ _gameLevel = in.readUint32LE();
}
//========================================================================================================================
@@ -1016,14 +1016,14 @@ void MinigameManager::GameInfoIndex::read(Common::ReadStream &in) {
TimeManager::TimeManager(HoldData<TimeManagerData> &data_) {
if (const char *data = g_runtime->parameter("game_time", false)) {
- if (sscanf(data, "%f", &gameTime_) != 1)
- gameTime_ = -1.f;
+ if (sscanf(data, "%f", &_gameTime) != 1)
+ _gameTime = -1.f;
} else
- gameTime_ = -1.f;
+ _gameTime = -1.f;
timeCost_ = 0.f;
- if (gameTime_ > 0) {
+ if (_gameTime > 0) {
if (const char *data = g_runtime->parameter("time_bar"))
timeBar_ = g_runtime->getObject(data);
@@ -1064,16 +1064,16 @@ TimeManager::~TimeManager() {
}
bool TimeManager::timeIsOut() const {
- if (gameTime_ > 0.f)
- return g_runtime->getTime() > gameTime_;
+ if (_gameTime > 0.f)
+ return g_runtime->getTime() > _gameTime;
return false;
}
float TimeManager::leftTime() const {
- if (gameTime_ <= 0.f)
+ if (_gameTime <= 0.f)
return 0;
- return g_runtime->getTime() > gameTime_ ? 0 : gameTime_ - g_runtime->getTime();
+ return g_runtime->getTime() > _gameTime ? 0 : _gameTime - g_runtime->getTime();
}
@@ -1083,7 +1083,7 @@ void TimeManager::quant(float dt) {
lastEventTime_ = seconds;
g_runtime->textManager().updateTime(seconds);
int amountSeconds = round(leftTime());
- if (gameTime_ < 0.f || amountSeconds > 10)
+ if (_gameTime < 0.f || amountSeconds > 10)
if (seconds % 60 == 0)
g_runtime->signal(EVENT_TIME_60_SECOND_TICK);
else if (seconds % 10 == 0)
@@ -1096,10 +1096,10 @@ void TimeManager::quant(float dt) {
g_runtime->signal(EVENT_TIME_LESS_10_SECOND_LEFT_SECOND_TICK);
}
- if (gameTime_ <= 0.f || !timeBar_)
+ if (_gameTime <= 0.f || !timeBar_)
return;
- float phase = clamp(g_runtime->getTime() / gameTime_, 0.f, 1.f);
+ float phase = clamp(g_runtime->getTime() / _gameTime, 0.f, 1.f);
mgVect3f pos;
switch (direction_) {
case UP:
diff --git a/engines/qdengine/minigames/adv/RunTime.h b/engines/qdengine/minigames/adv/RunTime.h
index 1bd5adc6900..6f6581bb6f2 100644
--- a/engines/qdengine/minigames/adv/RunTime.h
+++ b/engines/qdengine/minigames/adv/RunTime.h
@@ -52,11 +52,11 @@ struct EffectManagerData {
struct MinigameData {
MinigameData();
- int sequenceIndex_;
- int lastScore_;
- int lastTime_;
- int bestTime_;
- int bestScore_;
+ int _sequenceIndex;
+ int _lastScore;
+ int _lastTime;
+ int _bestTime;
+ int _bestScore;
void write(Common::WriteStream &out) const;
void read(Common::ReadStream &out);
@@ -74,15 +74,15 @@ struct GameInfo {
return 9;
}
bool empty() const {
- return empty_ && game_.sequenceIndex_ < 0;
+ return _empty && _game._sequenceIndex < 0;
}
- MinigameData game_;
- bool empty_;
- TimeManagerData timeManagerData_;
- EffectManagerData effectManagerData_;
- uint dataSize_;
- void *gameData_;
+ MinigameData _game;
+ bool _empty;
+ TimeManagerData _timeManagerData;
+ EffectManagerData _effectManagerData;
+ uint _dataSize;
+ void *_gameData;
};
typedef MinigameInterface *(*MinigameConsCallback)();
@@ -111,27 +111,27 @@ public:
bool processGameData(Common::SeekableReadStream &data);
mgVect2f mousePosition() const {
- return mousePos_;
+ return _mousePos;
}
bool mouseLeftPressed() const;
bool mouseRightPressed() const;
bool keyPressed(int vKey, bool once = false) const;
mgVect2i screenSize() const {
- return screenSize_;
+ return _screenSize;
}
float getTime() const {
- return gameTime_;
+ return _gameTime;
}
const MinigameData *getScore(int level, int game) const;
bool debugMode() const {
- return debugMode_;
+ return _debugMode;
}
TextManager &textManager() const {
- return *textManager_;
+ return *_textManager;
}
void signal(SystemEvent id);
@@ -189,98 +189,98 @@ public:
// Ñайл Ñо ÑпиÑком Ð¸Ð³Ñ Ð¿Ð¾ ÑÑовнÑм
const char *gameListFileName() const {
- return "resource//minigames.lst";
+ return "resource/minigames.lst";
}
private:
- MinigameInterface *game_;
+ MinigameInterface *_game;
// ÐÑвод ÑекÑÑа Ñ Ð¿Ð¾Ð¼Ð¾ÑÑÑ Ð¾Ð±ÑекÑов
- TextManager *textManager_;
+ TextManager *_textManager;
// ÐодÑÑÐµÑ Ð¸ визÑализаÑÐ¸Ñ Ð²Ñемени
- TimeManager *timeManager_;
+ TimeManager *_timeManager;
// ÐбÑабоÑка ÑобÑÑий игÑÑ
- EventManager *eventManager_;
+ EventManager *_eventManager;
// вÑводимÑе ÑÑÑекÑÑ
- EffectManager *effectManager_;
+ EffectManager *_effectManager;
// ÐÑÐµÐ¼Ñ Ð² ÑекÑндаÑ
Ñ Ð¼Ð¾Ð¼ÐµÐ½Ñа ÑÑаÑа игÑÑ
- float gameTime_;
+ float _gameTime;
// ÐºÐµÑ Ð¿ÑовеÑеннÑÑ
на нажаÑие клавиÑ, Ð´Ð»Ñ Ð¾ÑÑÐ»ÐµÐ¶Ð¸Ð²Ð°Ð½Ð¸Ñ Ð½ÐµÐ¿Ð¾ÑÑедÑÑвенно нажаÑиÑ
- mutable bool lastKeyChecked_[256];
+ mutable bool _lastKeyChecked[256];
// Ð Ð°Ð·Ð¼ÐµÑ Ð¸Ð³Ñана
- mgVect2i screenSize_;
+ mgVect2i _screenSize;
// ÑекÑÑее положение мÑÑи
- mgVect2f mousePos_;
+ mgVect2f _mousePos;
// подÑÑÑойка мÑÑи
- mgVect2f mouseAdjast_;
+ mgVect2f _mouseAdjast;
// обÑÐµÐºÑ Ð´Ð»Ñ Ð¿ÐµÑедаÑи Ñигнала об оконÑании игÑÑ Ð² ÑÑиггеÑÑ
- qdMinigameObjectInterface *state_flag_;
+ qdMinigameObjectInterface *_state_flag;
// обÑÐµÐºÑ Ð´Ð»Ñ Ð¿Ð¾Ð»ÑÑÐµÐ½Ð¸Ñ Ñигнала о поÑÑановке на паÑзÑ
- qdMinigameObjectInterface *pause_flag_;
+ qdMinigameObjectInterface *_pause_flag;
// ÑпÑавка по победе
- QDObject complete_help_;
- QDObject complete_help_miniature_;
+ QDObject _complete_help;
+ QDObject _complete_help_miniature;
// ÑекÑÑее ÑоÑÑоÑние Ð´Ð»Ñ Ð²ÐºÐ»ÑÑÐµÐ½Ð¸Ñ ÑпÑавки
- Common::String complete_help_state_name_;
+ Common::String _complete_help_state_name;
// ÑпÑавка по игÑе
- QDObject game_help_;
- QDObject game_help_trigger_;
- bool game_help_enabled_;
+ QDObject _game_help;
+ QDObject _game_help_trigger;
+ bool _game_help_enabled;
// ÑекÑÑее ÑоÑÑоÑние Ð´Ð»Ñ Ð²ÐºÐ»ÑÑÐµÐ½Ð¸Ñ ÑпÑавки
- Common::String game_help_state_name_;
+ Common::String _game_help_state_name;
// инÑеÑÑÐµÐ¹Ñ Ðº движкÑ
- const qdEngineInterface *engine_;
+ const qdEngineInterface *_engine;
// инÑеÑÑÐµÐ¹Ñ Ðº ÑекÑÑей ÑÑене
- qdMinigameSceneInterface *scene_;
+ qdMinigameSceneInterface *_scene;
// игÑа запÑÑена Ð´Ð»Ñ Ð¾Ñладки
- bool debugMode_;
+ bool _debugMode;
// rnd seed
- int seed_;
+ int _seed;
// кнопки мÑÑи инвеÑÑиÑованÑ
- bool invertMouseButtons_;
+ bool _invertMouseButtons;
// Ð¸Ð¼Ñ Ñайла и инÑоÑмаÑией о миниигÑаÑ
- Common::String state_container_name_;
+ Common::String _state_container_name;
// колиÑеÑÑво пÑойденнÑÑ
Ð¸Ð³Ñ Ð½Ð° каждом ÑÑовне
typedef Common::HashMap<int, int> Counters;
- Counters completeCounters_;
+ Counters _completeCounters;
struct GameInfoIndex {
- GameInfoIndex(int idx, int level) : gameNum_(idx), gameLevel_(level) {}
- int gameNum_;
- int gameLevel_;
+ GameInfoIndex(int idx, int level) : _gameNum(idx), _gameLevel(level) {}
+ int _gameNum;
+ int _gameLevel;
void write(Common::WriteStream &out) const;
void read(Common::ReadStream &in);
bool operator< (const GameInfoIndex& rs) const {
- return gameLevel_ == rs.gameLevel_ ? gameNum_ < rs.gameNum_ : gameLevel_ < rs.gameLevel_;
+ return _gameLevel == rs._gameLevel ? _gameNum < rs._gameNum : _gameLevel < rs._gameLevel;
}
};
struct GameInfoIndex_Hash {
uint operator()(const GameInfoIndex& x) const {
- return (x.gameNum_ << 16) + x.gameLevel_;
+ return (x._gameNum << 16) + x._gameLevel;
}
};
struct GameInfoIndex_EqualTo {
uint operator()(const GameInfoIndex& x, const GameInfoIndex& y) const {
- return x.gameNum_ == y.gameNum_ && x.gameLevel_ == y.gameLevel_;
+ return x._gameNum == y._gameNum && x._gameLevel == y._gameLevel;
}
};
// инÑоÑмаÑÐ¸Ñ Ð¾ пÑойденнÑÑ
игÑаÑ
typedef Common::HashMap<GameInfoIndex, GameInfo, GameInfoIndex_Hash, GameInfoIndex_EqualTo> GameInfoMap;
- GameInfoMap gameInfos_;
+ GameInfoMap _gameInfos;
// ÐнÑоÑмаÑÐ¸Ñ Ð¾ ÑекÑÑей игÑе, пÑи вÑÑ
оде запиÑеÑÑÑ
- GameInfoIndex currentGameIndex_;
- GameInfo *currentGameInfo_;
+ GameInfoIndex _currentGameIndex;
+ GameInfo *_currentGameInfo;
// пÑовеÑиÑÑ ÑÑо вÑе необÑ
одимÑе игÑÑ Ð¿ÑойденÑ
bool testAllGamesWin();
More information about the Scummvm-git-logs
mailing list