/// config file and command line parsing #ifndef __CONFIG_H__ #define __CONFIG_H__ typedef enum { F_NONE = 0, F_2D, F_3D, F_WRAP } Frontend; // A script will parse this in the build process typedef struct { //// PLAYERCONFIG (things that cannot be altered by a level) //% boolean % default=0 % set fullscreen mode on startup int fullscreen; //% enum % sdl=F_2D,ogl=F_3D,none=F_NONE % set display mode at start (sdl, ogl or none) Frontend display; //% boolean % default=0 % [OpenGL] draw grids only int grid; //% string % default= % dns or ip of server to play on (default: local game) char * server; //% int % min=0,default=3223 % server port number to connect to (tcp and udp) int serverPort; //% int % min=0,default=0 % udp port to listen (+1 until success); 0 random int udpPort; //% int % min=1,default=2,max=MAX_PLAYERS % wait for that many players before starting int players; //% string % default= % replay this logfile (usually mass.rep) char * replay; //% int % min=0,default=2,max=4 % [debug] how verbose to tell what is happening int debugLevel; //% boolean % default=0 % [debug] show statistic of time spent on each mass class int profile; //% int % min=0,default=0 % [debug] exit after this number of frames, set randseed 0 int exitFrame; //% int % min=-1,default=-1 % [debug] enable HEAVY_DEBUG checks at the given frame number int heavyDebug; //% string % default=default % default levelfile to start with, if none is given char * levelfile; //% int % min=0,default=120 % [framecontrol] maximum game cycles per second (0 unlimited) int maxCPS; //% int % min=0,default=20 % [framecontrol] maximum number of not displayed game cycles int maxSkip; } ConfigData; extern ConfigData config; // system dependent path to prepend to the config file name // also used for savegames, downloaded levels and replay files extern char * confpath; extern void InitConfig(int argc, char ** argv); extern void FreeConfig(void); // Give the filename without leading "data/", returns the full // path+filename or terminates the program with error messages. // returned buffer must not be altered or freed extern char * FindData(char * relative_path); #endif