-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmain.cpp
More file actions
49 lines (38 loc) · 1.01 KB
/
main.cpp
File metadata and controls
49 lines (38 loc) · 1.01 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
/*
* File: main.cpp
* Author: cyril
*
* Created on January 2, 2012, 12:02 PM
*/
#include <SFML/Graphics.hpp>
#include "Screen.h"
#include "Game.h"
#include <iostream>
/*
*
*/
int main(int argc, char** argv) {
//Init ImageManager
ImageManager::getInstance();
std::vector<Screen*> screens;
int screen = Screen::GAME;
sf::RenderWindow app(sf::VideoMode(800,600), "LodeRunner");
app.setMouseCursorVisible(false);
Game game(&app);
screens.push_back(&game);
//Check arguments
if(argc != 0) {
for(int i = 0; i < argc; i++) {
std::string arg = std::string(argv[i]);
if(arg.compare("-m") == 0 && i + 1 < argc) {
std::cout << "Loading Map : " << argv[i + 1] << std::endl;
game.loadMap(argv[i+1]);
}
}
}
while(screen != Screen::EXIT) {
screen = screens[screen]->run();
}
ImageManager::release();
return EXIT_SUCCESS;
}