aboutsummaryrefslogtreecommitdiff
path: root/src/client/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/game.cpp')
-rw-r--r--src/client/game.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index 4426c50cd..953eb1287 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -110,6 +110,10 @@ Game::Game() :
&settingChangedCallback, this);
g_settings->registerChangedCallback("freecam",
&freecamChangedCallback, this);
+ g_settings->registerChangedCallback("xray",
+ &updateAllMapBlocksCallback, this);
+ g_settings->registerChangedCallback("fullbright",
+ &updateAllMapBlocksCallback, this);
readSettings();
@@ -168,6 +172,8 @@ Game::~Game()
&settingChangedCallback, this);
g_settings->deregisterChangedCallback("camera_smoothing",
&settingChangedCallback, this);
+ g_settings->deregisterChangedCallback("freecam",
+ &freecamChangedCallback, this);
}
bool Game::startup(bool *kill,
@@ -335,6 +341,12 @@ void Game::shutdown()
if (gui_chat_console)
gui_chat_console->drop();
+ if (m_cheat_menu)
+ delete m_cheat_menu;
+
+ if (m_tracers)
+ delete m_tracers;
+
if (sky)
sky->drop();
@@ -609,6 +621,14 @@ bool Game::initGui()
errorstream << *error_message << std::endl;
return false;
}
+
+ m_tracers = new Tracers();
+
+ if (!m_tracers) {
+ *error_message = "Could not allocate memory for tracers";
+ errorstream << *error_message << std::endl;
+ return false;
+ }
#ifdef HAVE_TOUCHSCREENGUI
@@ -3214,6 +3234,12 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
if (m_game_ui->m_flags.show_cheat_menu && ! gui_chat_console->isOpen())
m_cheat_menu->draw(driver, m_game_ui->m_flags.show_debug);
+
+ /*
+ Tracers
+ */
+
+ m_tracers->draw(driver);
/*
Damage flash
@@ -3323,6 +3349,11 @@ void Game::settingChangedCallback(const std::string &setting_name, void *data)
((Game *)data)->readSettings();
}
+void Game::updateAllMapBlocksCallback(const std::string &setting_name, void *data)
+{
+ ((Game *) data)->client->updateAllMapBlocks();
+}
+
void Game::freecamChangedCallback(const std::string &setting_name, void *data)
{
Game *game = (Game *) data;