forked from OpenXcom/OpenXcom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
71 lines (66 loc) · 2.23 KB
/
Copy pathmain.cpp
File metadata and controls
71 lines (66 loc) · 2.23 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* Copyright 2010 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom 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 3 of the License, or
* (at your option) any later version.
*
* OpenXcom is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
*/
#include <exception>
#include "Engine/CrossPlatform.h"
#include "Engine/Game.h"
#include "Engine/Screen.h"
#include "Engine/Options.h"
#include "Menu/StartState.h"
/** @mainpage
* @author SupSuper
*
* OpenXcom is an open-source reimplementation of the original X-Com
* written entirely in C++ and SDL. This documentation contains info
* on every class contained in the source code and its public methods.
* The code itself also contains in-line comments for more complicated
* code blocks. Hopefully all of this will make the code a lot more
* readable for you in case you which to learn or make use of it in
* your own projects, though note that all the source code is licensed
* under the GNU General Public License. Enjoy!
*/
using namespace OpenXcom;
Game *game = 0;
// If you can't tell what the main() is for you should have your
// programming license revoked...
int main(int argc, char** args)
{
#ifndef _DEBUG
try
{
#endif
Options::init(argc, args);
game = new Game("OpenXcom " + Options::getVersion(), 320, 200, 8);
game->getScreen()->setFullscreen(Options::getBool("fullscreen"));
game->getScreen()->setResolution(Options::getInt("displayWidth"), Options::getInt("displayHeight"));
game->setVolume(Options::getInt("soundVolume"), Options::getInt("musicVolume"));
game->setState(new StartState(game));
game->run();
#ifndef _DEBUG
}
catch (std::exception &e)
{
CrossPlatform::showError(e.what());
exit(EXIT_FAILURE);
}
#endif
Options::save();
// Comment this for faster exit.
delete game;
return EXIT_SUCCESS;
}