-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (28 loc) · 695 Bytes
/
main.cpp
File metadata and controls
33 lines (28 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include "src/Game.hpp"
int main(int argc, char *argv[]){
if(argc > 3){
std::cout << "USAGE: " << argv[0] << " [<nickname> <server address>]" << std::endl;
return 1;
}
try{
Game *game;
if(argc == 1)
game = new Game();
else if(argc == 2)
game = new Game(argv[1]);
else
game = new Game(argv[1], argv[2]);
game->go();
delete game;
}
catch(Ogre::Exception& e){
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
std::cerr << "An exception has occured: " <<
e.getFullDescription().c_str() << std::endl;
#endif
}
return 0;
}