From 1fe3202f0b7e2f52e50c430caa744b029fd5bcef Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sat, 2 Feb 2008 12:38:36 +0000 Subject: cleaned up the console code. added the ability to tune the game in runtime. --- src/game/g_game.h | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'src/game/g_game.h') 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 #include -#include #include +#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]; }; -- cgit 1.4.1