/*************************************************************************** main.h - description ------------------- begin : may 28th, 2003 copyright : (C) 2003-2008 by Duong Khang NGUYEN email : neoneurone @ gmail com $Id: main.h 467 2014-04-18 17:25:19Z neoneurone $ ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * any later version. * * * ***************************************************************************/ #ifndef _OPENCITY_MAIN_H_ #define _OPENCITY_MAIN_H_ 1 #ifndef __WIN32__ #ifdef HAVE_CONFIG_H #include "config.h" // Checks for headers generated by configure #endif #else #include "../win32/config.h" #endif /* for reference, included by "SDL_opengl.h" #include // OpenGL #include *--- Under Windows, OpenGL 1.2 & 1.3 functionalities are not defined. They are treated as extensions, that's why we have the following lines Without this, glEnable( GL_RESCALE_NORMAL ) doesn't work under win32 ----* #ifdef __WIN32__ #include #endif // Use glext prototypes from SDL library #if defined(__WIN32__) && !defined(GL_GLEXT_PROTOTYPES) #define GL_GLEXT_PROTOTYPES 1 #endif */ /* for reference, included by GCC's option "-ansi" #ifndef __STRICT_ANSI__ #define __STRICT_ANSI__ 1 // Let's stay with the standard // This avoids "long long" from SDL.h #endif */ #include "SDL.h" // Simple Directmedia Library #include "SDL_thread.h" // Portable thread #include "SDL_opengl.h" // Portable OpenGL headers #include // New standard not something.h ok ? using std::string; #include "macros.h" // Our macros #include "enum.h" // Our enums class UI; // OpenCity's types --> for future releases and porting work #define OC_SHORT short int #define OC_USHORT short unsigned int #define OC_INT int #define OC_UINT unsigned int #define OC_LINT long int #define OC_ULINT unsigned long int #define OC_CHAR char #define OC_UCHAR unsigned char #define OC_BYTE unsigned char #define OC_FLOAT float #define OC_DATE int // game default parameters #define OC_FUND_START 15000 #define OC_R_INCOME_TAX 8 #define OC_C_INCOME_TAX 8 #define OC_I_INCOME_TAX 9 #define OC_INCOME_HELP 10 // let's say this is government help ;) #define OC_MAP_HEIGHT_MAX 10 #define OC_MAP_HEIGHT_MIN -10 #define OC_CITY_W 100 // Watch out ! if you change this you must change #define OC_CITY_L 100 // the value of OC_SIMULATOR_LAG* too, // It's dangerous ! // Don't touch it if you don't know what you do #define OC_CHANCE_COUNTER_MAX 300 // help the random method to find a structure // should be equal to 3% of city surface // Sound & Music list file's name #define OC_MUSIC_LIST_FILENAME "music/music.m3u" #define OC_SOUND_LIST_FILENAME "sound/sound.m3u" // OpenCity's config file #define OC_GRAPHISM_FILE_FILENAME "config/graphism.conf" // Simulators' defines. // Bad values can block your system, don't change them ! #define OC_MS_PER_FRAME 10 // Milliseconds delay per frame #define OC_MS_PER_DAY 1750 // Milliseconds delay per day #define OC_MS_GLOBAL_LOG_FACTOR 500 #define OC_MS_STRUCTURE_LOG_FACTOR 400 // Color defines #define OC_CLEAR_COLOR .0, .0, 0.25, 1.0 #define OC_RED_COLOR 255, 0, 0 #define OC_GREEN_COLOR 0, 255, 0 #define OC_BLUE_COLOR 0, 0, 255 #define OC_YELLOW_COLOR 255, 255, 0 #define OC_PINK_COLOR 255, 0, 255 #define OC_WHITE_COLOR 255, 255, 255 #define OC_BLACK_COLOR 0, 0, 0 #define OC_LIGHT_MODEL_AMBIENT 0.7, 0.7, 0.7, 1.0 /*=====================================================================*/ /* GLOBAL FUNCTIONS */ /*=====================================================================*/ //======================================================================== /** Prefix the specified path "s" with the data home directory \param s The path to be prefixed \return The modified path */ string ocDataDirPrefix( const string& s ); string ocConfigDirPrefix( const string& s ); //======================================================================== /** Prefix the specified path "s" with the save directory \param s The path to be prefixed \return The modified path */ string ocSaveDirPrefix( const string& s ); //======================================================================== /** Get the current version of the application as a string value. \return The string value of the current version. */ string ocStrVersion(); //======================================================================== /** Get the current version of the application as a long value. \return The long value of the current version. */ long ocLongVersion(); /*=====================================================================*/ /* MAIN FUNCTIONS */ /*=====================================================================*/ void ocRestart(); void ocQuit( const int = 0 ); void ocSetNewUI( UI* ); #endif