KK-branch, Updated message in intro, merged current trunk (3120) with branch
[neverball] / share / config.h
index 5393df8..64e83da 100644 (file)
 #ifndef CONFIG_H
 #define CONFIG_H
 
-#include <SDL.h>
-#include <stdio.h>
-#include "i18n.h"
-
-/*---------------------------------------------------------------------------*/
-
-#define CONFIG_DATA "./data"
-#define CONFIG_LOCALE "./locale"
-#define CONFIG_USER ".neverball"
-
 /*
- * Global settings are stored in USER_CONFIG_FILE.  Replays are stored
- * in  USER_REPLAY_FILE.  These files  are placed  in the  user's home
- * directory as given by the HOME environment var.  If the config file
- * is deleted, it will be recreated using the defaults.
+ * This file contains:
+ * 1- some global config methods (stored in a config file)
+ * 2- some SDL based functions
+ *
+ * If you're looking for constants, you should also see base_config.h
  */
-#define USER_CONFIG_FILE "neverballrc"
-#define USER_REPLAY_FILE _("Last")
 
-/*---------------------------------------------------------------------------*/
-
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-#define RMASK 0xFF000000
-#define GMASK 0x00FF0000
-#define BMASK 0x0000FF00
-#define AMASK 0x000000FF
-#else
-#define RMASK 0x000000FF
-#define GMASK 0x0000FF00
-#define BMASK 0x00FF0000
-#define AMASK 0xFF000000
-#endif
-
-#ifdef _WIN32
-#define FMODE_RB "rb"
-#define FMODE_WB "wb"
-#else
-#define FMODE_RB "r"
-#define FMODE_WB "w"
-#endif
+#include <SDL.h>
 
-#ifdef _WIN32
-#define AUDIO_BUFF_HI 4096
-#define AUDIO_BUFF_LO 2048
-#else
-#define AUDIO_BUFF_HI 2048
-#define AUDIO_BUFF_LO 1024
-#endif
+#include "base_config.h"
+#include "lang.h"
 
 /*---------------------------------------------------------------------------*/
 
@@ -75,9 +39,11 @@ enum {
     CONFIG_TEXTURES,
     CONFIG_GEOMETRY,
     CONFIG_REFLECTION,
+    CONFIG_MULTISAMPLE,
+    CONFIG_MIPMAP,
+    CONFIG_ANISO,
     CONFIG_BACKGROUND,
     CONFIG_SHADOW,
-    CONFIG_AUDIO_RATE,
     CONFIG_AUDIO_BUFF,
     CONFIG_MOUSE_SENSE,
     CONFIG_MOUSE_INVERT,
@@ -108,8 +74,14 @@ enum {
     CONFIG_VIEW_DZ,
     CONFIG_ROTATE_FAST,
     CONFIG_ROTATE_SLOW,
-    CONFIG_LAST_SET,
-    CONFIG_MODE,
+    CONFIG_KEY_FORWARD,
+    CONFIG_KEY_BACKWARD,
+    CONFIG_KEY_LEFT,
+    CONFIG_KEY_RIGHT,
+    CONFIG_KEY_PAUSE,
+    CONFIG_KEY_RESTART,
+    CONFIG_CHEAT,
+    CONFIG_STATS,
 
     CONFIG_OPTION_D_COUNT
 };
@@ -117,8 +89,6 @@ enum {
 enum {
     CONFIG_PLAYER,
     CONFIG_BALL,
-    CONFIG_COIN,
-    CONFIG_LANG,
 
     CONFIG_OPTION_S_COUNT
 };
@@ -133,9 +103,11 @@ enum {
 #define DEFAULT_TEXTURES             1
 #define DEFAULT_GEOMETRY             1
 #define DEFAULT_REFLECTION           1
+#define DEFAULT_MULTISAMPLE          0
+#define DEFAULT_MIPMAP               0
+#define DEFAULT_ANISO                1
 #define DEFAULT_BACKGROUND           1
 #define DEFAULT_SHADOW               1
-#define DEFAULT_AUDIO_RATE           44100
 #define DEFAULT_AUDIO_BUFF           AUDIO_BUFF_HI
 #define DEFAULT_MOUSE_SENSE          300
 #define DEFAULT_MOUSE_INVERT         0
@@ -158,31 +130,24 @@ enum {
 #define DEFAULT_KEY_CAMERA_1         SDLK_F1
 #define DEFAULT_KEY_CAMERA_2         SDLK_F2
 #define DEFAULT_KEY_CAMERA_3         SDLK_F3
-#define DEFAULT_KEY_CAMERA_R         SDLK_RIGHT
-#define DEFAULT_KEY_CAMERA_L         SDLK_LEFT
+#define DEFAULT_KEY_CAMERA_R         SDLK_d
+#define DEFAULT_KEY_CAMERA_L         SDLK_s
 #define DEFAULT_VIEW_FOV             50
 #define DEFAULT_VIEW_DP              75
 #define DEFAULT_VIEW_DC              25
 #define DEFAULT_VIEW_DZ              200
 #define DEFAULT_ROTATE_SLOW          100
 #define DEFAULT_ROTATE_FAST          200
-#define DEFAULT_LAST_SET             0
-#define DEFAULT_MODE                 0
-#define DEFAULT_PLAYER               _("Player")
+#define DEFAULT_PLAYER               ""
 #define DEFAULT_BALL                 "png/ball.png"
-#define DEFAULT_COIN                 _("png/coin.png")
-#define DEFAULT_LANG                 ""
-
-/*---------------------------------------------------------------------------*/
-
-#define JOY_MAX 32767
-#define JOY_MID 16383
-
-#define MAXSTR 256
-#define MAXLVL 26
-#define MAXNAM 9
-
-#define GUI_FACE                    _("ttf/DejaVuSans-Bold.ttf")
+#define DEFAULT_CHEAT                0
+#define DEFAULT_KEY_FORWARD          SDLK_UP
+#define DEFAULT_KEY_BACKWARD         SDLK_DOWN
+#define DEFAULT_KEY_LEFT             SDLK_LEFT
+#define DEFAULT_KEY_RIGHT            SDLK_RIGHT
+#define DEFAULT_KEY_PAUSE            SDLK_SPACE
+#define DEFAULT_KEY_RESTART          SDLK_r
+#define DEFAULT_STATS                0
 
 /*---------------------------------------------------------------------------*/
 
@@ -191,12 +156,6 @@ void config_load(void);
 void config_save(void);
 int  config_mode(int, int, int);
 
-const char *config_data(const char *);
-const char *config_user(const char *);
-
-int  config_data_path(const char *, const char *);
-int  config_user_path(const char *);
-
 /*---------------------------------------------------------------------------*/
 
 void config_set_d(int, int);
@@ -206,19 +165,18 @@ int  config_get_d(int);
 
 void config_set_s(int, const char *);
 void config_get_s(int, char *, int);
-const char * config_simple_get_s(int i);
-       
 
 /*---------------------------------------------------------------------------*/
 
-void config_set_grab(void);
+void config_set_grab(int w);
 void config_clr_grab(void);
 int  config_get_grab(void);
 
-int  config_get_pause(void);
-void config_set_pause(void);
-void config_clr_pause(void);
-void config_tgl_pause(void);
+/*---------------------------------------------------------------------------*/
+
+int  config_cheat(void);
+void config_set_cheat(void);
+void config_clr_cheat(void);
 
 /*---------------------------------------------------------------------------*/