summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index fb61369..6f649cd 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4,10 +4,9 @@
#include <filesystem>
#include <iostream>
#include <lua.hpp>
-#include <memory>
const char* DEFAULT_PROC = "include/default_proc.lua";
-std::shared_ptr<Level> lvl = std::make_shared<Level>();
+std::shared_ptr<Level> lvl;
bool
call_onkeypress(lua_State* L, char pressedKey);
@@ -25,6 +24,8 @@ main(int argc, char** argv)
std::filesystem::path mapFile{ lvl_pfx + "/dng.map" };
std::filesystem::path luaFile{ lvl_pfx + "/proc.lua" };
+ lvl = std::make_shared<Level>();
+
lvl->loadLevelFromFile(mapFile.c_str());
lua_State* L_lvl = luaL_newstate();