1 /* 2 * XPilot NG, a multiplayer space war game. 3 * 4 * Copyright (C) 1991-2001 by 5 * 6 * Bj�rn Stabell <bjoern@xpilot.org> 7 * Ken Ronny Schouten <ken@xpilot.org> 8 * Bert Gijsbers <bert@xpilot.org> 9 * Dick Balaska <dick@xpilot.org> 10 * 11 * This program is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation; either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program; if not, write to the Free Software 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 */ 25 26 #ifndef XPCONFIG_H 27 #define XPCONFIG_H 28 29 #ifdef _WINDOWS 30 # /* kps - what about this ???? */ 31 # undef CONF_DATADIR 32 # define CONF_DATADIR "lib/" 33 #endif 34 35 #ifndef CONF_DATADIR 36 # error "CONF_DATADIR NOT DEFINED. GIVING UP." 37 #endif 38 39 #ifndef CONF_LOCALGURU 40 # define CONF_LOCALGURU PACKAGE_BUGREPORT 41 #endif 42 43 #ifndef CONF_DEFAULT_MAP 44 # define CONF_DEFAULT_MAP "ndh.xp2" 45 #endif 46 47 #ifndef CONF_MAPDIR 48 # define CONF_MAPDIR CONF_DATADIR "maps/" 49 #endif 50 51 #ifndef CONF_TEXTUREDIR 52 # define CONF_TEXTUREDIR CONF_DATADIR "textures/" 53 #endif 54 55 #ifndef CONF_SOUNDDIR 56 # define CONF_SOUNDDIR CONF_DATADIR "sound/" 57 #endif 58 59 #ifndef CONF_FONTDIR 60 # define CONF_FONTDIR CONF_DATADIR "fonts/" 61 #endif 62 63 #ifndef CONF_DEFAULTS_FILE_NAME 64 # define CONF_DEFAULTS_FILE_NAME CONF_DATADIR "defaults.txt" 65 #endif 66 67 #ifndef CONF_PASSWORD_FILE_NAME 68 # define CONF_PASSWORD_FILE_NAME CONF_DATADIR "password.txt" 69 #endif 70 71 /* not used currently */ 72 #ifndef CONF_PLAYER_PASSWORDS_FILE_NAME 73 # define CONF_PLAYER_PASSWORDS_FILE_NAME CONF_DATADIR "player_passwords.txt" 74 #endif 75 76 #ifndef CONF_ROBOTFILE 77 # define CONF_ROBOTFILE CONF_DATADIR "robots.txt" 78 #endif 79 80 #ifndef CONF_SERVERMOTDFILE 81 # define CONF_SERVERMOTDFILE CONF_DATADIR "servermotd.txt" 82 #endif 83 84 #ifndef CONF_LOCALMOTDFILE 85 # define CONF_LOCALMOTDFILE CONF_DATADIR "localmotd.txt" 86 #endif 87 88 #ifndef CONF_LOGFILE 89 # define CONF_LOGFILE CONF_DATADIR "log.txt" 90 #endif 91 92 #ifndef CONF_SOUNDFILE 93 # define CONF_SOUNDFILE CONF_SOUNDDIR "sounds.txt" 94 #endif 95 96 #ifndef CONF_SHIP_FILE 97 # define CONF_SHIP_FILE CONF_DATADIR "shipshapes.txt" 98 #endif 99 100 101 102 #ifndef _WINDOWS 103 104 # ifdef DEBUG 105 # define D(x) x ; fflush(stdout); 106 # else 107 # define D(x) 108 # endif 109 110 #else /* _WINDOWS */ 111 112 # ifdef _DEBUG 113 # define DEBUG 1 114 # define D(x) x 115 # else 116 # define D(x) 117 # endif 118 119 #endif /* _WINDOWS */ 120 121 /* 122 * Uncomment this if your machine doesn't use 123 * two's complement negative numbers. 124 */ 125 /* #define MOD2(x, m) mod(x, m) */ 126 127 /* 128 * The following macros decide the speed of the game and 129 * how often the server should draw a frame. (Hmm...) 130 */ 131 132 #define CONF_UPDATES_PR_FRAME 1 133 134 /* 135 * If COMPRESSED_MAPS is defined, the server will attempt to uncompress 136 * maps on the fly (but only if neccessary). CONF_ZCAT_FORMAT should produce 137 * a command that will unpack the given .gz file to stdout (for use in popen). 138 * CONF_ZCAT_EXT should define the proper compressed file extension. 139 */ 140 #ifndef _WINDOWS 141 # define CONF_COMPRESSED_MAPS 142 #else 143 /* Couldn't find a popen(), also compress and gzip don't exist. */ 144 # undef CONF_COMPRESSED_MAPS 145 #endif 146 #define CONF_ZCAT_EXT ".gz" 147 #define CONF_ZCAT_FORMAT "gzip -d -c < %s" 148 149 /* 150 * Windows doesn't play with stdin/out well at all... 151 * So for the client i route the "debug" printfs to the debug stream 152 * The server gets 'real' messages routed to the messages window 153 */ 154 #ifdef _WINDOWS 155 # ifdef _XPILOTNTSERVER_ 156 # define xpprintf xpprintfW 157 /* # define xpprintf _Trace */ 158 # endif 159 #endif 160 161 /* 162 * XPilot on Windows does lots of double to int conversions. So we have: 163 * warning C4244: 'initializing' : conversion from 'double ' to 'int ', 164 * possible loss of data a million times. I used to fix each warning 165 * added by the Unix people, but this makes for harder to read code (and 166 * was tiring with each patch) 167 */ 168 #ifdef _WINDOWS 169 # pragma warning (disable : 4244 4761) 170 #endif 171 172 void Conf_print(void); 173 char *Conf_datadir(void); 174 char *Conf_defaults_file_name(void); 175 char *Conf_password_file_name(void); 176 char *Conf_player_passwords_file_name(void); 177 char *Conf_mapdir(void); 178 char *Conf_fontdir(void); 179 char *Conf_default_map(void); 180 char *Conf_servermotdfile(void); 181 char *Conf_localmotdfile(void); 182 char *Conf_logfile(void); 183 char *Conf_ship_file(void); 184 char *Conf_texturedir(void); 185 char *Conf_sounddir(void); 186 char *Conf_soundfile(void); 187 char *Conf_localguru(void); 188 char *Conf_robotfile(void); 189 char *Conf_zcat_ext(void); 190 char *Conf_zcat_format(void); 191 192 #endif /* XPCONFIG_H */ 193