1 #ifndef _global_h 2 #define _global_h 3 4 // Directory, in which to put the bitmap files for deluxe-playing 5 #define DATA_DIRECTORY "fly.dta" 6 7 // name of the file to look for static data of the classes 8 #define PRESET_FILE "presets.txt" 9 10 #define LOG_FILE DATA_DIRECTORY"/logfile.txt" 11 12 // 13 // As an optimization, every DynObj gets a storage for caching the calculated 14 // collision-times with other objects. At the moment of a collision, only 15 // the 2 objects taking part in the collision have to update their cache 16 // and probably inform other objects about their changes. 17 #define TIME_CACHE 1 18 19 // 20 // The collision detection can be aborted at an early stage, when a minimum 21 // time can be estimated which lies beyond a limit. 22 // Problem: - The check, if to abort, already takes too much time. 23 // - When time-caching is on, advanced collision times, which aren't 24 // of any use at the moment of calculation, might be used later on. 25 #define ABORT_CALC 0 26 #if (ABORT_CALC) 27 # define ABORT_CALC_WALL 0 28 # define ABORT_CALC_BALL 0 29 #endif 30 31 // 32 // The basic floating point class can be exchanged between doubles and 33 // floats. The latter one is faster on my 386. 34 #ifndef __TURBOC__ 35 # define REAL_IS_FLOAT 0 36 #else 37 # define REAL_IS_FLOAT 1 38 #endif 39 40 // 41 // A real C++-Class can be used for real arithmetic. Unfortunately 42 // that really slows the calculation down, even though the whole class 43 // is defined inline. 44 #define REAL_IS_CLASS 0 45 46 // 47 // There are some specialized vector classes for 2 and 3 dimensionaL 48 // vectors, which can also be realized by inheriting from an universaL 49 // vector-class (but again, that's expensive) 50 #define Vec2IsVector 0 51 #define Vec3IsVector 0 52 53 // 54 // Switch to pre-existing (better to understand) algorithms for 55 // collision detection, instead of the special algortithm (which is 56 // a bit faster). 57 #define EasyWall 0 58 59 // 60 // special constants instead of the collision time 61 #define MAX_TIME 1e10 62 #define NO_HIT MAX_TIME 63 #define NO_TARGET MAX_TIME 64 #define RUNNING_LOSE 4e10 65 #if (ABORT_CALC) 66 # define NOT_REACHABLE 2e10 67 #endif 68 69 // 70 // constants to overcome the problem with unprecise real-arithmetics 71 #if (REAL_IS_FLOAT) 72 # define EPS 1e-4 73 #else 74 # define EPS 1e-10 75 #endif 76 77 // 78 // current time in calculation 79 // not to mix up with the realtime of GetCurrentTime() 80 // 81 extern double current_time; 82 83 #ifndef __TURBOC__ 84 # define _DEBUG 85 #endif 86 // 87 // debugging switches, the main switch DEBUG enables all successive 88 // options, mainly leading to traces on stdout 89 #ifdef DEBUG 90 91 #include <stdio.h> 92 #include <stdlib.h> 93 #include <string.h> 94 95 extern long debug; // Variable der anzuzeigenden modes 96 #define ShowLight 0x00000001L 97 #define ShowColors 0x00000002L 98 #define ShowRings 0x00000004L 99 #define ObjectInfo 0x00000008L 100 #define BeforCollision 0x00000010L 101 #define AfterCollision 0x00000020L 102 #define CheckBoundary 0x00000040L 103 #define MoveAll 0x00000080L 104 #define __Moves 0x000000f8L 105 #define PBallHit 0x00000100L 106 #define PointerMove 0x00000200L 107 #define XWallHit 0x00000400L 108 #define YWallHit 0x00000800L 109 #define CollCalc 0x00001000L 110 #define AbortCalc 0x00002000L 111 #define AbortReCalc 0x00004000L 112 #define StickLevel 0x00008000L 113 #define GameState 0x00010000L 114 #define BMover 0x00020000L 115 #define BState 0x00040000L 116 #define Sync 0x00080000L 117 #define ShowTurns 0x00100000L 118 #define Loops 0x00200000L 119 #define __ShowAll 0x00100007L 120 #define __Rings 0x00100004L 121 #define Intro 0x00400000L 122 #define xdb 0x00800000L 123 #define xwd 0x02000000L 124 #define ForceCalc 0x01000000L 125 #define Motion 0x04000000L 126 127 #define TCTrace 0x40000000L 128 #define UnixTrace 0x80000000L 129 130 #define ShowSubWindow (ShowLight|ShowColors|ShowRings|ShowTurns) 131 132 #define DBG0(m,f) if (debug&m) printf( f ) 133 #define DBG1(m,f,a) if (debug&m) printf( f,a ) 134 #define DBG2(m,f,a,b) if (debug&m) printf( f,a,b ) 135 #define DBG3(m,f,a,b,c) if (debug&m) printf( f,a,b,c ) 136 #define DBG4(m,f,a,b,c,d) if (debug&m) printf( f,a,b,c,d ) 137 138 int set_debug( const char *flag_name ); 139 void show_flags(); 140 141 #else 142 143 #define DBG0(m,f) 144 #define DBG1(m,f,a) 145 #define DBG2(m,f,a,b) 146 #define DBG3(m,f,a,b,c) 147 #define DBG4(m,f,a,b,c,d) 148 149 #endif 150 151 #include "stdinc.h" 152 153 // 154 // F�r Zeitmessungen kann das Zeichnen der sich bewegenden B�lle komplett 155 // unterdr�ckt werden, indem die DrawCircle()-Funktion durch eine leere 156 // Funktion ersetzt wird. 157 #define STATISTICS 158 #define _NO_DRAW 159 160 // 161 // Reibungsimplementierung, in dem schrittweise 162 // die Geschwindigkeit verkleinert wird. Das Problem ist allerdings, das mit 163 // jedem Schritt die Zeiten des TIME-CACHE ung�ltig werden, und daher 164 // nicht zu viele Schritte pro Sekunden eingelegt werden sollten. 165 // Die Parametrierung der Reibung und der Aufl�sung der Schrittberechnung 166 // geschieht durch virtuelle Funktionen der Game-Klasse 167 // 168 // Einschalten der Reibungssimulation durch stufige Verlangsamung: 169 #define SIM_SLOW 1 170 171 #if (SIM_SLOW) 172 # define SUPPRESS_SLOWSTEP -1.0 173 #endif 174 175 176 // =========================================================================== 177 // 'Wissenswertes' aus verschiedenen Bereichen (reduziert Abh�ngigkeiten) 178 // =========================================================================== 179 180 extern double w2n; // Fensterskalierung (graph.C) 181 182 typedef long ColorId; 183 184 185 #define SOUND_SUBSYSTEM 1 186 #if (SOUND_SUBSYSTEM) 187 extern int sound_request; // sound einschalten (main.C) 188 #endif 189 extern int size; // gew�nschte (aktuelle) Fenstergr��e (main.C) 190 extern int deluxe; // Luxus-Flag (main.C) 191 extern int light_flag; // Light-Sources (main.C) 192 extern int color_flag; // table color (main.C) 193 extern int nohint_flag; // aiming hint (main.C) 194 extern int enhanced_mover; // flag for desired mover class (main.C) 195 extern int frames_per_sec; // flag for limited frames (main.C) 196 #define ON_ROOT -1 197 198 199 void show_defaults(); 200 void load_konfi(); 201 202 #endif 203