diff options
Diffstat (limited to 'src/universe.cpp')
-rw-r--r-- | src/universe.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/universe.cpp b/src/universe.cpp index 4c53987..a02a5e6 100644 --- a/src/universe.cpp +++ b/src/universe.cpp | |||
@@ -41,7 +41,7 @@ static constexpr UniqueKey UNIVERSE_FULL_REGKEY{ 0x99CA130C09EDC074ull }; | |||
41 | // xxh64 of string "UNIVERSE_LIGHT_REGKEY" generated at http://www.nitrxgen.net/hashgen/ | 41 | // xxh64 of string "UNIVERSE_LIGHT_REGKEY" generated at http://www.nitrxgen.net/hashgen/ |
42 | static constexpr UniqueKey UNIVERSE_LIGHT_REGKEY{ 0x3663C07C742CEB81ull }; | 42 | static constexpr UniqueKey UNIVERSE_LIGHT_REGKEY{ 0x3663C07C742CEB81ull }; |
43 | 43 | ||
44 | // ################################################################################################ | 44 | // ################################################################################################# |
45 | 45 | ||
46 | Universe::Universe() | 46 | Universe::Universe() |
47 | { | 47 | { |
@@ -70,13 +70,13 @@ Universe::Universe() | |||
70 | #endif // PLATFORM_LINUX | 70 | #endif // PLATFORM_LINUX |
71 | } | 71 | } |
72 | 72 | ||
73 | // ################################################################################################ | 73 | // ################################################################################################# |
74 | 74 | ||
75 | // only called from the master state | 75 | // only called from the master state |
76 | Universe* universe_create(lua_State* L) | 76 | Universe* universe_create(lua_State* L) |
77 | { | 77 | { |
78 | ASSERT_L(universe_get(L) == nullptr); | 78 | ASSERT_L(universe_get(L) == nullptr); |
79 | Universe* const U = static_cast<Universe*>(lua_newuserdatauv(L, sizeof(Universe), 0)); // universe | 79 | Universe* const U{ lua_newuserdatauv<Universe>(L, 0) }; // universe |
80 | U->Universe::Universe(); | 80 | U->Universe::Universe(); |
81 | STACK_CHECK_START_REL(L, 1); | 81 | STACK_CHECK_START_REL(L, 1); |
82 | UNIVERSE_FULL_REGKEY.setValue(L, [](lua_State* L) { lua_pushvalue(L, -2); }); | 82 | UNIVERSE_FULL_REGKEY.setValue(L, [](lua_State* L) { lua_pushvalue(L, -2); }); |
@@ -85,7 +85,7 @@ Universe* universe_create(lua_State* L) | |||
85 | return U; | 85 | return U; |
86 | } | 86 | } |
87 | 87 | ||
88 | // ################################################################################################ | 88 | // ################################################################################################# |
89 | 89 | ||
90 | void universe_store(lua_State* L, Universe* U) | 90 | void universe_store(lua_State* L, Universe* U) |
91 | { | 91 | { |
@@ -95,7 +95,7 @@ void universe_store(lua_State* L, Universe* U) | |||
95 | STACK_CHECK(L, 0); | 95 | STACK_CHECK(L, 0); |
96 | } | 96 | } |
97 | 97 | ||
98 | // ################################################################################################ | 98 | // ################################################################################################# |
99 | 99 | ||
100 | Universe* universe_get(lua_State* L) | 100 | Universe* universe_get(lua_State* L) |
101 | { | 101 | { |