level.h string fstream cctype cmath iostream cstdio mydefs.h bmp.h tga.h list.h vector.h camera.h geometry.h myglFont.h myglTexture.h player.h strmanip.h keys.h src/level.cpp src/main.h src/worlddefs.h OpenArena::Level OpenArena #ifndef__LEVEL_H__ #define__LEVEL_H__ #ifdefWIN32 #include<windows.h>//prollyusedforalotbutshouldberemoved #endif #include<string> #include<fstream> #include<cctype> #include<cmath> #include<iostream> #ifdefWIN32 #include<GL/gl.h> #endif #ifdef__linux #include<GL/gl.h> #endif #ifdef__APPLE___ #include<gl.h> #endif #include<cstdio>//forfileI/O #include"mydefs.h" #include"bmp.h" #include"tga.h" #include"list.h" #ifdefWIN32 #include"../lib/bass.h"//foraudioinwindowsonlythisshouldbereplacedbyoa_audio #endif #include"vector.h" #include"camera.h" #include"geometry.h" #include"myglFont.h" #include"myglTexture.h" #include"player.h" #include"strmanip.h" #include"keys.h" usingnamespacestd; usingOpenArena::Triangle; namespaceOpenArena { constfloatpiover180=0.0174532925f; conststringDEFAULT_TEXTURE_NAME="oa/textures/default.bmp"; constunsignedintMAX_CONSOLE_LINES=30;//Themaxnumberoflinestobedisplayedintheconsole constunsignedintMAX_CONSOLE_HISTORY_LINES=MAX_CONSOLE_LINES+20;//Themaxnumberofconsolelinestostoreinthehistory constunsignedintMAX_CONSOLE_OUTPUT_LINES=MAX_CONSOLE_LINES; constunsignedintMAX_OUTPUT_TEXT_LINES=4;//Themaxnumberofoutputlinestobedisplayedonthescreen enum{GL_MY_TEXTURE_CONSOLEBACKGROUND=0,NUM_MENU_TEXTURES}; classLevel { public: Level(); ~Level(); boolLoadMap(stringmapname); boolLoadMap(); voidSaveMap(stringmapname); boolLoadConfig(stringcfgname); voidLoadConfig(); voidSaveConfig(stringcfgname); voidExecute(stringcmd); voidLoadGLTextures(); voidRender(); voidUnloadMap(); voidUpdateConsole(char); uint32FPS(); voidParseCmds(constchar*); voidPrint(intx,inty,constchar*string,unsignedintset); voidSetWindow(Window*); Window*GetWindow(); /*NotYetImplemented voidPlayerConnect();//implementlater voidPlayerDisconnect();//implementlater */ Screenscreen; FontglFont; stringnextLevel; Player*defaultPlayer; uint32numTextures; string*textureNames; stringbgm; #ifdefWIN32 HSTREAMbgmStream; #endif unsignedcharbgmCDA; stringgamedir; floatgravity; boolmlook; boolshowFPS; boolshowConsole; boolsound; floatturnSpeed; floatmoveSpeed; floatmouseSpeed; unsignedcharmaxFPS; //Map Triangle*triangles; uint32numTriangles; list<Player>players; //list<ENTITY>ents; list<Texture*>textures; TexturemenuTextures[NUM_MENU_TEXTURES]; Window*_window; //private: voidConsolePrint(string); private: stringconsoleHistory[MAX_CONSOLE_HISTORY_LINES]; stringconsoleOutput[MAX_CONSOLE_OUTPUT_LINES]; stringoutputText[MAX_OUTPUT_TEXT_LINES]; }; }; #endif