From 242e3bb8d92def67d5c30f2f2fd974cfb117ec04 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 5 Feb 2010 22:15:43 +0100 Subject: Merged the Engine class into the Game class There was little point in keeping the Engine class separate. It wasn't an engine at all, but only kept track of the currently active map, a job more suitable for the Game class anyway. --- src/gui/debugwindow.cpp | 21 ++++++--------------- src/gui/debugwindow.h | 1 - src/gui/setup_video.cpp | 4 ++-- 3 files changed, 8 insertions(+), 18 deletions(-) (limited to 'src/gui') diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp index 2b5616cb..f4f2fd14 100644 --- a/src/gui/debugwindow.cpp +++ b/src/gui/debugwindow.cpp @@ -21,7 +21,6 @@ #include "gui/debugwindow.h" -#include "engine.h" #include "game.h" #include "particle.h" #include "main.h" @@ -93,24 +92,16 @@ void DebugWindow::logic() mFPSLabel->setCaption(strprintf(mFPSText.c_str(), fps)); - mTileMouseLabel->setCaption(strprintf(_("Cursor: (%d, %d)"), mouseTileX, + mTileMouseLabel->setCaption(strprintf(_("Cursor: (%d, %d)"), + mouseTileX, mouseTileY)); - Map *currentMap = engine->getCurrentMap(); - if (currentMap) + if (const Map *map = Game::instance()->getCurrentMap()) { // TODO: Add gettext support below - const std::string music = - "Music: " + currentMap->getProperty("music"); - mMusicFileLabel->setCaption(music); - - const std::string minimap = - "Minimap: " + currentMap->getProperty("minimap"); - mMinimapLabel->setCaption(minimap); - - const std::string map = - "Map: " + currentMap->getProperty("_filename"); - mMapLabel->setCaption(map); + mMusicFileLabel->setCaption("Music: " + map->getProperty("music")); + mMinimapLabel->setCaption("Minimap: " + map->getProperty("minimap")); + mMapLabel->setCaption("Map: " + map->getProperty("_filename")); } mParticleCountLabel->setCaption(strprintf(_("Particle count: %d"), diff --git a/src/gui/debugwindow.h b/src/gui/debugwindow.h index 50a5fc06..1ef32e02 100644 --- a/src/gui/debugwindow.h +++ b/src/gui/debugwindow.h @@ -50,7 +50,6 @@ class DebugWindow : public Window Label *mParticleCountLabel, *mParticleDetailLabel; Label *mAmbientDetailLabel; - std::string mFPSText; }; diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index aaa3ea35..f5bff9ba 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -22,7 +22,7 @@ #include "gui/setup_video.h" #include "configuration.h" -#include "engine.h" +#include "game.h" #include "graphics.h" #include "localplayer.h" #include "log.h" @@ -502,7 +502,7 @@ void Setup_Video::action(const gcn::ActionEvent &event) mParticleEffectsCheckBox->isSelected()); Particle::enabled = mParticleEffectsCheckBox->isSelected(); - if (engine) + if (Game::instance()) { new OkDialog(_("Particle Effect Settings Changed."), _("Changes will take effect on map change.")); -- cgit v1.2.3-70-g09d2