diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-02-02 12:38:36 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-02-02 12:38:36 +0000 |
| commit | 1fe3202f0b7e2f52e50c430caa744b029fd5bcef (patch) | |
| tree | e238b0f211badb35fecdc3f87fe32978fd512b5e /src/game/g_game.h | |
| parent | 307c2cfae8fd678b10235bdc0c1a8cfc7da6adae (diff) | |
| download | zcatch-1fe3202f0b7e2f52e50c430caa744b029fd5bcef.tar.gz zcatch-1fe3202f0b7e2f52e50c430caa744b029fd5bcef.zip | |
cleaned up the console code. added the ability to tune the game in runtime.
Diffstat (limited to 'src/game/g_game.h')
| -rw-r--r-- | src/game/g_game.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/game/g_game.h b/src/game/g_game.h index 5cece9d9..a9fddde7 100644 --- a/src/game/g_game.h +++ b/src/game/g_game.h @@ -4,12 +4,35 @@ #include <engine/e_system.h> #include <engine/e_common_interface.h> -#include <game/g_math.h> #include <math.h> +#include "g_math.h" #include "g_collision.h" - #include "g_protocol.h" +struct tuning_params +{ + tuning_params() + { + const float ticks_per_second = 50.0f; + #define MACRO_TUNING_PARAM(name,value) name = value; + #include "g_tuning.h" + #undef MACRO_TUNING_PARAM + } + + static const char *names[]; + + #define MACRO_TUNING_PARAM(name,value) tune_param name; + #include "g_tuning.h" + #undef MACRO_TUNING_PARAM + + static int num() { return sizeof(tuning_params)/sizeof(int); } + bool set(int index, float value); + bool set(const char *name, float value); + bool get(int index, float *value); + bool get(const char *name, float *value); +}; + + inline vec2 get_direction(int angle) { float a = angle/256.0f; @@ -90,7 +113,8 @@ public: { mem_zero(players, sizeof(players)); } - + + tuning_params tuning; class player_core *players[MAX_CLIENTS]; }; |