OpenMortal Apocalypse mirror
Sourceforge mirror
SourceForge.net Logo
      News | Info | Characters | Arenas | Screenshots | Forums | Download  
Developer: Making of | Character-HOWTO | AI Design | Submit a Character
Documentation: Main Page | Modules | Class Hierarchy | Class List | File List

State.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           State.h  -  description
00003                              -------------------
00004     begin                : Mon Aug 12 2003
00005     copyright            : (C) 2003 by upi
00006     email                : upi@apocalypse.rulez.org
00007  ***************************************************************************/
00008 
00009 
00010 #ifndef STATE_H
00011 #define STATE_H
00012 
00013 
00014 #define MAXPLAYERS 4
00015 
00044 struct SState
00045 {
00046     enum TGameMode {
00047         IN_DEMO,                
00048         IN_SINGLE,              
00049         IN_MULTI,               
00050         IN_NETWORK,             
00051         IN_CHAT,                
00052     } m_enGameMode;
00053 
00054     bool    m_bQuitFlag;        // true if quit event came
00055     const char* m_pcArgv0;      // Set by main to argv[0]
00056     
00057 
00058     // CONFIGURATION VARIABLES
00059     
00060     int     m_iNumPlayers;      // The number of players =2
00061     enum TTeamModeEnum {
00062         Team_ONE_VS_ONE,
00063         Team_GOOD_VS_EVIL,
00064         Team_CUSTOM,
00065     } m_enTeamMode;             // Team mode
00066     int     m_iTeamSize;        // The size of each team.
00067     int     m_bTeamMultiselect; // Can the same player be selected twice?
00068     
00069     int     m_iGameTime;        // Time of rounds in seconds.
00070     int     m_iHitPoints;       // The initial number of hit points.
00071     int     m_iGameSpeed;       // The speed of the game (fps = 1000/GameSpeed)
00072     
00073     bool    m_bFullscreen;      // True in fullscreen mode.
00074     
00075     int     m_iChannels;        // 1: mono, 2: stereo
00076     int     m_iMixingRate;      // The mixing rate, in kHz
00077     int     m_iMixingBits;      // 1: 8bit, 2: 16bit
00078     int     m_iMusicVolume;     // Volume of music; 0: off, 100: max
00079     int     m_iSoundVolume;     // Volume of sound effects; 0: off, 100: max
00080     
00081     int     m_aiPlayerKeys[MAXPLAYERS][9];  // Player keysyms
00082     char    m_acLanguage[10];   // Language ID (en,hu,fr,es,..)
00083     int     m_iLanguageCode;    // Non-persistend language code (set by backend based on the language)
00084     
00085     char    m_acLatestServer[256];  // Last server
00086     bool    m_bServer;          // We were server in the last network game
00087     char    m_acNick[128];      // The user name on the last server.
00088     
00089     SState();
00090     
00091     void Load();
00092     void Save();
00093     void ToggleFullscreen();
00094     void SetLanguage( const char* a_pcLanguage );
00095     void SetServer( const char* a_pcServer );
00096 };
00097 
00098 
00099 extern SState g_oState;
00100 
00101 #endif