]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/ecs/lib.qh
take3: format 903 files
[xonotic/xonotic-data.pk3dir.git] / qcsrc / ecs / lib.qh
index 2d48e577b8da2bf72b5ae3fa8cf19da46d8b89aa..04df3d3fde1f1fb8d5ee152ce9187e65ef8c7087 100644 (file)
 
 #define emit(T, ...) \
        MACRO_BEGIN \
-       FOREACH_ENTITY_FLOAT_ORDERED(evt_##T##_listener, true, it.evt_##T(__VA_ARGS__)); \
+               FOREACH_ENTITY_FLOAT_ORDERED(evt_##T##_listener, true, it.evt_##T(__VA_ARGS__)); \
        MACRO_END
 
 #define subscribe(listener, T, fn) \
        MACRO_BEGIN \
-       listener.evt_##T = (fn); \
-       listener.evt_##T##_listener = true; \
+               listener.evt_##T = (fn); \
+               listener.evt_##T##_listener = true; \
        MACRO_END
 
 
 
 #define SYSTEM_UPDATE(sys) \
        MACRO_BEGIN \
-       static float t = 0; \
-       float dt = autocvar_xon_sys_##sys##_dt; \
-       float minfps = autocvar_xon_sys_##sys##_minfps; \
-       static float accumulator = 0; \
-       float a = 0; \
-       if (dt) { \
-               accumulator += min(frametime, 1 / (minfps)); \
-       } else { \
-               accumulator += frametime; \
-               dt = accumulator; \
-               a = 1; \
-       } \
-       while (accumulator >= dt) \
-       { \
-               time = t; \
-               FOREACH_COMPONENT(sys, sys_##sys##_update(it, dt)); \
-               t += dt; \
-               accumulator -= dt; \
-       } \
-       if (!a) a = accumulator / dt; \
-       FOREACH_COMPONENT(sys, com_##sys##_interpolate(it, a)); \
+               static float t = 0; \
+               float dt = autocvar_xon_sys_##sys##_dt; \
+               float minfps = autocvar_xon_sys_##sys##_minfps; \
+               static float accumulator = 0; \
+               float a = 0; \
+               if (dt) { \
+                       accumulator += min(frametime, 1 / (minfps)); \
+               } else { \
+                       accumulator += frametime; \
+                       dt = accumulator; \
+                       a = 1; \
+               } \
+               while (accumulator >= dt) { \
+                       time = t; \
+                       FOREACH_COMPONENT(sys, sys_##sys##_update(it, dt)); \
+                       t += dt; \
+                       accumulator -= dt; \
+               } \
+               if (!a) { a = accumulator / dt; } \
+               FOREACH_COMPONENT(sys, com_##sys##_interpolate(it, a)); \
        MACRO_END