Public Member Functions | |
gMainCommandLineAnalyzer () | |
Public Attributes | |
bool | daemon_ |
bool | fullscreen_ |
bool | windowed_ |
bool | use_directx_ |
bool | dont_use_directx_ |
Private Member Functions | |
virtual bool | DoAnalyze (tCommandLineParser &parser) |
Analyzes the command line option. | |
virtual void | DoHelp (std::ostream &s) |
Analyzes the command line option. |
Definition at line 79 of file gArmagetron.cpp.
gMainCommandLineAnalyzer::gMainCommandLineAnalyzer | ( | ) | [inline] |
Definition at line 88 of file gArmagetron.cpp.
References daemon_, dont_use_directx_, fullscreen_, use_directx_, and windowed_.
00089 { 00090 daemon_ = false; 00091 windowed_ = false; 00092 fullscreen_ = false; 00093 use_directx_ = false; 00094 dont_use_directx_ = false; 00095 }
virtual bool gMainCommandLineAnalyzer::DoAnalyze | ( | tCommandLineParser & | parser | ) | [inline, private, virtual] |
Analyzes the command line option.
parser | parser to analyze |
Implements tCommandLineAnalyzer.
Definition at line 99 of file gArmagetron.cpp.
References daemon_, dont_use_directx_, fullscreen_, tCommandLineParser::GetSwitch(), use_directx_, and windowed_.
00100 { 00101 if ( parser.GetSwitch( "--daemon","-d") ) 00102 { 00103 daemon_ = true; 00104 } 00105 else if ( parser.GetSwitch( "-fullscreen", "-f" ) ) 00106 { 00107 fullscreen_=true; 00108 } 00109 else if ( parser.GetSwitch( "-window", "-w" ) || parser.GetSwitch( "-windowed") ) 00110 { 00111 windowed_=true; 00112 } 00113 00114 #ifdef WIN32 00115 else if ( parser.GetSwitch( "+directx") ) 00116 { 00117 use_directx_=true; 00118 } 00119 else if ( parser.GetSwitch( "-directx") ) 00120 { 00121 dont_use_directx_=true; 00122 } 00123 #endif 00124 else 00125 { 00126 return false; 00127 } 00128 00129 return true; 00130 }
virtual void gMainCommandLineAnalyzer::DoHelp | ( | std::ostream & | s | ) | [inline, private, virtual] |
Analyzes the command line option.
s | string to write help to |
Implements tCommandLineAnalyzer.
Definition at line 132 of file gArmagetron.cpp.
00133 { // 00134 #ifndef DEDICATED 00135 s << "-f, --fullscreen : start in fullscreen mode\n"; 00136 s << "-w, --window, --windowed : start in windowed mode\n\n"; 00137 #ifdef WIN32 00138 s << "+directx, -directx : enable/disable usage of DirectX for screen\n" 00139 << " initialisation under MS Windows\n\n"; 00140 s << "\n\nYes, I know this looks ugly. Sorry about that.\n"; 00141 #endif 00142 #else 00143 #ifndef WIN32 00144 s << "-d, --daemon : allow the dedicated server to run as a daemon\n" 00145 << " (will not poll for input on stdin)\n"; 00146 #endif 00147 #endif
Definition at line 82 of file gArmagetron.cpp.
Referenced by DoAnalyze(), gMainCommandLineAnalyzer(), and main().
Definition at line 83 of file gArmagetron.cpp.
Referenced by DoAnalyze(), gMainCommandLineAnalyzer(), and main().
Definition at line 84 of file gArmagetron.cpp.
Referenced by DoAnalyze(), gMainCommandLineAnalyzer(), and main().
Definition at line 85 of file gArmagetron.cpp.
Referenced by DoAnalyze(), gMainCommandLineAnalyzer(), and main().
Definition at line 86 of file gArmagetron.cpp.
Referenced by DoAnalyze(), gMainCommandLineAnalyzer(), and main().