011d6659d541e3d625c66f090925548baf03e719
[neverball] / share / base_config.h
1 /*
2  * Copyright (C) 2003 Robert Kooima
3  *
4  * NEVERBALL is  free software; you can redistribute  it and/or modify
5  * it under the  terms of the GNU General  Public License as published
6  * by the Free  Software Foundation; either version 2  of the License,
7  * or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT  ANY  WARRANTY;  without   even  the  implied  warranty  of
11  * MERCHANTABILITY or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU
12  * General Public License for more details.
13  */
14
15 #ifndef BASE_CONFIG_H
16 #define BASE_CONFIG_H
17
18 /*
19  * This file contains some constants
20  * And the way to access to directories
21  */
22
23 #include <stdio.h>
24 #include "i18n.h"
25
26 /*---------------------------------------------------------------------------*/
27
28 #define CONFIG_DATA   "./data"        /* Game data directory */
29 #define CONFIG_LOCALE "./locale"      /* Game localisation */
30 #define CONFIG_USER   ".neverball"    /* User config directory */
31
32 /*
33  * Global settings are stored in USER_CONFIG_FILE.  Replays are stored
34  * in  USER_REPLAY_FILE.  These files  are placed  in the  user's home
35  * directory as given by the HOME environment var.  If the config file
36  * is deleted, it will be recreated using the defaults.
37  */
38 #define USER_CONFIG_FILE "neverballrc"
39 #define USER_REPLAY_FILE _("Last")
40 #define ALLOW_CHEAT      1
41
42 /*---------------------------------------------------------------------------*/
43
44 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
45 #define RMASK 0xFF000000
46 #define GMASK 0x00FF0000
47 #define BMASK 0x0000FF00
48 #define AMASK 0x000000FF
49 #else
50 #define RMASK 0x000000FF
51 #define GMASK 0x0000FF00
52 #define BMASK 0x00FF0000
53 #define AMASK 0xFF000000
54 #endif
55
56 #ifdef _WIN32
57 #define FMODE_RB "rb"
58 #define FMODE_WB "wb"
59 #else
60 #define FMODE_RB "r"
61 #define FMODE_WB "w"
62 #endif
63
64 #define AUDIO_BUFF_HI 2048
65 #define AUDIO_BUFF_LO 1024
66
67 #define JOY_MAX 32767
68 #define JOY_MID 16383
69
70 #define MAXSTR 256
71 #define MAXLVL 26
72 #define MAXNAM 9
73
74 #define GUI_FACE                    _("ttf/DejaVuSans-Bold.ttf")
75
76 /*---------------------------------------------------------------------------*/
77
78 const char *config_data(const char *);
79 const char *config_user(const char *);
80
81 int  config_data_path(const char *, const char *);
82 int  config_user_path(const char *);
83
84 /*---------------------------------------------------------------------------*/
85
86 #endif