00001
00002 #ifndef CONFIGURATION_H
00003 #define CONFIGURATION_H
00004
00005 #include <plib/ssg.h>
00006
00007 #define MAX_CAMPOS 4
00008
00009 #define MODEL_PATH "data/models"
00010 #define TEXTURE_PATH "data/textures"
00011 #define WINDOW_TITLE "glPirates"
00012
00013 static char* default_resolutions[] = {
00014 "640x480",
00015 "800x600",
00016 "1024x768",
00017 "1280x960",
00018 "1280x1024",
00019 NULL
00020 };
00021
00022 static char* default_bpp[] = { "8", "16", "24", "32", NULL };
00023 static char* default_refresh[] = {"60", "65", "70", "72", "75", "80", NULL};
00024
00025
00026 class configuration : public ssgBase {
00027 public:
00028 configuration(char*) ;
00029 virtual ~configuration();
00030
00031 int save(FILE* fd);
00032 int load(FILE* fd);
00033 void print(FILE* fd, char *indent = "", int how_much = 2 ) {};
00034 char* getTypeName() { return "configuration"; }
00035
00036 bool get_fullscreen() { return is_fullscreen; }
00037 int get_window_width() { return window_width; }
00038 int get_window_height() { return window_height; }
00039 char* get_game_mode_string();
00040 char* get_config_fname();
00041 unsigned int get_nearwp() { return near_water_polygons;}
00042 unsigned int get_nextwp() { return next_water_polygons;}
00043 void set_nearwp(unsigned int v) { near_water_polygons = v;}
00044 void set_nextwp(unsigned int v) { next_water_polygons = v;}
00045 void set_fullscreen(bool v) { is_fullscreen = v; }
00046 void set_window_width(int v) { window_width = v; }
00047 void set_window_height(int v) { window_height = v;}
00048 void set_game_mode_string(char* v);
00049 configuration* clone(int clone_flags);
00050 sgVec3* get_campos(int i);
00051 void set_campos(int i, float vw, float xa, float za);
00052 protected:
00053 void copy_from (configuration* other, int clone_flags);
00054 private:
00055 char* game_mode_string;
00056 int window_height;
00057 int window_width;
00058 bool is_fullscreen;
00059
00060 unsigned int near_water_polygons;
00061 unsigned int next_water_polygons;
00062 char* config_file;
00063 sgVec3 camera_positions[MAX_CAMPOS];
00064 };
00065 #endif