00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #if !defined(_OPENCITY_MAIN_H_)
00021 #define _OPENCITY_MAIN_H_ 1
00022
00023 #include "header.h"
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #include "SDL.h"
00045 #include "SDL_thread.h"
00046 #include "SDL_opengl.h"
00047
00048 #include <string>
00049 using std::string;
00050
00051 #include "macros.h"
00052 #include "enum.h"
00053
00054 class UI;
00055
00056
00057
00058 #define OC_LINT long int
00059 #define OC_ULINT unsigned long int
00060 #define OC_SUINT short unsigned int
00061 #define OC_FLOAT float
00062 #define OC_CHAR char
00063 #define OC_BYTE char
00064 #define OC_UBYTE unsigned char
00065
00066 #define OC_DATE int
00067
00068
00069 #define OC_FUND_START 15000
00070 #define OC_R_INCOME_TAX 8
00071 #define OC_C_INCOME_TAX 8
00072 #define OC_I_INCOME_TAX 9
00073 #define OC_INCOME_HELP 10 // let's say this is government help ;)
00074
00075 #define OC_MAP_HEIGHT_MAX 10
00076 #define OC_MAP_HEIGHT_MIN -10
00077
00078 #define OC_CITY_W 100 // Watch out ! if you change this you must change
00079 #define OC_CITY_L 100 // the value of OC_SIMULATOR_LAG* too,
00080
00081
00082
00083 #define OC_CHANCE_COUNTER_MAX 300 // help the random method to find a structure
00084
00085
00086
00087 #define OC_MUSIC_LIST_FILENAME "music/music.m3u"
00088 #define OC_SOUND_LIST_FILENAME "sound/sound.m3u"
00089
00090
00091 #define OC_GRAPHISM_FILE_FILENAME "config/graphism.conf"
00092
00093
00094
00095 #define OC_MS_PER_FRAME 10 // milliseconds delay per frame
00096 #define OC_MS_PER_DAY 1750 // Milliseconds delay per day
00097 #define OC_MS_GLOBAL_LOG_FACTOR 500
00098 #define OC_MS_STRUCTURE_LOG_FACTOR 400
00099
00100
00101 #define OC_EYE_X_START 200.0 // used for gluLookAt();
00102 #define OC_EYE_Y_START 100.0
00103 #define OC_EYE_Z_START 200.0
00104
00105 #define OC_DELTA_X_START 0.0 // used for the translation
00106 #define OC_DELTA_Z_START 0.0
00107 #define OC_DELTA_X_STEP 2.0
00108 #define OC_DELTA_Z_STEP 2.0
00109
00110 #define OC_Y_ROTATE_ANGLE 0.0 // used for the rotation
00111 #define OC_Y_ROTATE_STEP 10.0
00112
00113 #define OC_CLEAR_COLOR .0, .0, 0.25, 1.0
00114 #define OC_RED_COLOR 255, 0, 0
00115 #define OC_GREEN_COLOR 0, 255, 0
00116 #define OC_BLUE_COLOR 0, 0, 255
00117 #define OC_YELLOW_COLOR 255, 255, 0
00118 #define OC_PINK_COLOR 255, 0, 255
00119 #define OC_WHITE_COLOR 255, 255, 255
00120 #define OC_BLACK_COLOR 0, 0, 0
00121
00122 #define OC_LIGHT_MODEL_AMBIENT 0.7, 0.7, 0.7, 1.0
00123
00124
00125
00126
00127
00128
00129
00130
00135 string ocHomeDirPrefix( const string & s );
00136
00137
00138
00143 string ocSaveDirPrefix( const string & s );
00144
00145
00146
00147
00148
00149
00150 void ocPerror( const OPENCITY_ERR_CODE & err_code );
00151
00152
00153 void ocKeyboard( const SDL_KeyboardEvent & );
00154 void ocMouseButton( const SDL_MouseButtonEvent & );
00155 void ocMouseMotion( const SDL_MouseMotionEvent & );
00156 void ocResize( const SDL_ResizeEvent & );
00157 void ocExpose( const SDL_ExposeEvent & );
00158 void ocQuit( const int & = 0 );
00159 void ocProcessSDLEvents( void );
00160 void ocSetNewUI( UI* );
00161
00162 #endif
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190