From daf84bb6292eb5bf5434889a887535ec54c21b6b Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 23 Aug 2008 10:31:45 +0000 Subject: fixes for gcc 4.3.1, added g_devel --- src/audio/buffers.cc | 2 ++ src/audio/sources.cc | 2 ++ src/core/netclient.cc | 1 + src/core/netconnection.cc | 1 + src/core/netserver.cc | 1 + src/filesystem/filesystem.cc | 3 ++- src/game/game.cc | 5 +++-- src/game/game.h | 2 ++ src/game/ship.cc | 14 +++++++++++--- src/math/matrix4f.cc | 6 +++--- src/model/vertexarray.cc | 2 ++ src/render/textures.cc | 2 +- src/render/tga.cc | 2 +- 13 files changed, 32 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/audio/buffers.cc b/src/audio/buffers.cc index 4e26c33..af14cb1 100644 --- a/src/audio/buffers.cc +++ b/src/audio/buffers.cc @@ -4,6 +4,8 @@ the terms of the GNU General Public License version 2 */ +#include + #include "audio/buffers.h" #include "audio/pcm.h" #include "audio/wav.h" diff --git a/src/audio/sources.cc b/src/audio/sources.cc index b52c5a4..584f366 100644 --- a/src/audio/sources.cc +++ b/src/audio/sources.cc @@ -4,6 +4,8 @@ the terms of the GNU General Public License version 2 */ +#include + #include "audio/sources.h" #include "sys/sys.h" diff --git a/src/core/netclient.cc b/src/core/netclient.cc index fa89e47..1289319 100644 --- a/src/core/netclient.cc +++ b/src/core/netclient.cc @@ -4,6 +4,7 @@ the terms of the GNU General Public License version 2 */ +#include #include #include diff --git a/src/core/netconnection.cc b/src/core/netconnection.cc index 0b33652..ed1a91b 100644 --- a/src/core/netconnection.cc +++ b/src/core/netconnection.cc @@ -5,6 +5,7 @@ */ #include +#include #include diff --git a/src/core/netserver.cc b/src/core/netserver.cc index dd70bcf..dcc152f 100644 --- a/src/core/netserver.cc +++ b/src/core/netserver.cc @@ -4,6 +4,7 @@ the terms of the GNU General Public License version 2 */ +#include #include #include diff --git a/src/filesystem/filesystem.cc b/src/filesystem/filesystem.cc index 0150b66..0fec129 100644 --- a/src/filesystem/filesystem.cc +++ b/src/filesystem/filesystem.cc @@ -4,7 +4,8 @@ the terms of the GNU General Public License version 2 */ -// project headers +#include + #include #include "filesystem/filesystem.h" diff --git a/src/game/game.cc b/src/game/game.cc index 5f754df..d0b4466 100644 --- a/src/game/game.cc +++ b/src/game/game.cc @@ -22,8 +22,6 @@ namespace game { - - ShipModel *default_shipmodel = 0; core::Zone *default_zone = 0; @@ -221,6 +219,9 @@ void Game::init() g_impulseacceleration = core::Cvar::get("g_impulseacceleration", "4", core::Cvar::Game | core::Cvar::Archive); g_impulseacceleration->set_info("[float] standard acceleration of the impulse drive"); + g_devel = core::Cvar::get("g_devel", "0", core::Cvar::Archive); + g_devel->set_info("[bool] enable or disable developer mode"); + // indicate the module is ready to run frames module_running = true; } diff --git a/src/game/game.h b/src/game/game.h index 36f7321..b9e6104 100644 --- a/src/game/game.h +++ b/src/game/game.h @@ -54,6 +54,8 @@ public: core::Cvar *g_impulsespeed; core::Cvar *g_impulseacceleration; + core::Cvar *g_devel; + private: bool load_world(); diff --git a/src/game/ship.cc b/src/game/ship.cc index 4ddd118..e46adc1 100644 --- a/src/game/ship.cc +++ b/src/game/ship.cc @@ -69,7 +69,11 @@ void Ship::impulse() } entity_eventstate = core::Entity::ImpulseInitiate; - entity_timer = 3; + if (Game::instance()->g_devel->value()) { + entity_timer = 0; + } else { + entity_timer = 10; + } ship_impulsedrive_timer = core::server()->time(); entity_dirty = true; } @@ -79,7 +83,7 @@ void Ship::impulse() void Ship::jump(std::string const &args) { - if (!jumpdrive()) { + if (!jumpdrive() && !Game::instance()->g_devel->value()) { core::server()->send(owner(), "This ship is not equiped with a hyperspace drive!"); return; @@ -124,7 +128,11 @@ void Ship::jump(std::string const &args) } entity_eventstate = core::Entity::JumpInitiate; - entity_timer = 10; + if (Game::instance()->g_devel->value()) { + entity_timer = 0; + } else { + entity_timer = 10; + } ship_jumpdrive_timer = core::server()->time(); entity_dirty = true; } diff --git a/src/math/matrix4f.cc b/src/math/matrix4f.cc index d73b12e..094bbd6 100644 --- a/src/math/matrix4f.cc +++ b/src/math/matrix4f.cc @@ -4,12 +4,12 @@ the terms of the GNU General Public License version 2 */ -// project headers -#include "math/matrix4f.h" +#include -// C++ headers #include +#include "math/matrix4f.h" + namespace math { diff --git a/src/model/vertexarray.cc b/src/model/vertexarray.cc index 0562bea..dc5e23e 100644 --- a/src/model/vertexarray.cc +++ b/src/model/vertexarray.cc @@ -5,6 +5,8 @@ the terms of the GNU General Public License version 2 */ +#include + #include "math/mathlib.h" #include "model/vertexarray.h" #include "sys/sys.h" diff --git a/src/render/textures.cc b/src/render/textures.cc index d69fa68..2bc6c05 100644 --- a/src/render/textures.cc +++ b/src/render/textures.cc @@ -4,7 +4,7 @@ the terms of the GNU General Public License version 2 */ - +#include #include "render/gl.h" #include "render/textures.h" diff --git a/src/render/tga.cc b/src/render/tga.cc index fb65910..6a85130 100644 --- a/src/render/tga.cc +++ b/src/render/tga.cc @@ -25,7 +25,7 @@ TGA multi-byte integer values have LSB first */ - +#include #include #include -- cgit v1.2.3