|
@@ -1,5 +1,6 @@
|
|
|
#include <iostream>
|
|
|
#include <cstring>
|
|
|
+#include <fstream>
|
|
|
|
|
|
#include "rendering/GLFW.h"
|
|
|
#include "rendering/Window.h"
|
|
@@ -8,6 +9,7 @@
|
|
|
#include "rendering/GL.h"
|
|
|
#include "rendering/Renderer.h"
|
|
|
#include "Game.h"
|
|
|
+#include "utils/Random.h"
|
|
|
|
|
|
bool initGLEW() {
|
|
|
GLenum err = glewInit();
|
|
@@ -34,18 +36,26 @@ void initCallbacks(Window& w, Keys& keys) {
|
|
|
}
|
|
|
|
|
|
int main(int argAmount, const char** args) {
|
|
|
- const char* file = nullptr;
|
|
|
- if(argAmount >= 2 && strcmp(args[1], "-r") != 0) {
|
|
|
- file = args[1];
|
|
|
+ if(argAmount < 2 || strcmp(args[1], "-r") == 0) {
|
|
|
+ std::cout << "expecting at least one argument: filename or number\n";
|
|
|
+ return 0;
|
|
|
}
|
|
|
bool steps = true;
|
|
|
+ bool skip = true;
|
|
|
for(int i = 1; i < argAmount; i++) {
|
|
|
if(strcmp(args[i], "-r") == 0) {
|
|
|
steps = false;
|
|
|
- break;
|
|
|
+ } else if(strcmp(args[i], "-v") == 0) {
|
|
|
+ skip = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if(skip) {
|
|
|
+ Keys keys;
|
|
|
+ Game game(keys, args[1], steps);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
if(GLFW::hasError()) {
|
|
|
return 0;
|
|
|
}
|
|
@@ -61,7 +71,7 @@ int main(int argAmount, const char** args) {
|
|
|
}
|
|
|
|
|
|
Keys keys;
|
|
|
- Game game(keys, file, steps);
|
|
|
+ Game game(keys, args[1], steps);
|
|
|
|
|
|
initCallbacks(window, keys);
|
|
|
window.show();
|