aboutsummaryrefslogtreecommitdiff
path: root/src/universe.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/universe.h')
-rw-r--r--src/universe.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/universe.h b/src/universe.h
index 113ed21..eb85133 100644
--- a/src/universe.h
+++ b/src/universe.h
@@ -188,3 +188,31 @@ class Universe
188[[nodiscard]] Universe* universe_get(lua_State* L); 188[[nodiscard]] Universe* universe_get(lua_State* L);
189[[nodiscard]] Universe* universe_create(lua_State* L); 189[[nodiscard]] Universe* universe_create(lua_State* L);
190void universe_store(lua_State* L, Universe* U); 190void universe_store(lua_State* L, Universe* U);
191
192// ################################################################################################
193
194#if USE_DEBUG_SPEW()
195class DebugSpewIndentScope
196{
197 private:
198
199 Universe* const U;
200
201 public:
202
203 static char const* const debugspew_indent;
204
205 DebugSpewIndentScope(Universe* U_)
206 : U{ U_ }
207 {
208 if (U)
209 U->debugspew_indent_depth.fetch_add(1, std::memory_order_relaxed);
210 }
211
212 ~DebugSpewIndentScope()
213 {
214 if (U)
215 U->debugspew_indent_depth.fetch_sub(1, std::memory_order_relaxed);
216 }
217};
218#endif // USE_DEBUG_SPEW()