REGISTRY_RESERVE(Stats, m_id, STAT_##id, z); \
} \
} \
- [[accumulate]] void stats_get() \
+ ACCUMULATE void stats_get() \
{ \
T it = getstat_##T(STAT_##id.m_id); \
/* if (it != CAT(_STAT(id), _prev)) \
#define addstat_int(id, fld) addstat(id, AS_INT, fld)
#define addstat_bool(id, fld) addstat(id, AS_INT, fld)
#define addstat_float(id, fld) addstat(id, AS_FLOAT, fld)
- #define addstat_vector(id, fld) MACRO_BEGIN { \
+ #define addstat_vector(id, fld) MACRO_BEGIN \
addstat_float(id + 0, fld##_x); \
addstat_float(id + 1, fld##_y); \
addstat_float(id + 2, fld##_z); \
- } MACRO_END
- #define addstat_vectori(id, fld) MACRO_BEGIN { \
+ MACRO_END
+ #define addstat_vectori(id, fld) MACRO_BEGIN \
addstat_int(id + 0, fld##_x); \
addstat_int(id + 1, fld##_y); \
addstat_int(id + 2, fld##_z); \
- } MACRO_END
+ MACRO_END
const int AS_STRING = 1;
const int AS_INT = 2;
const int AS_FLOAT = 8;
REGISTRY_RESERVE(Stats, m_id, STAT_##id, z); \
} \
} \
- [[accumulate]] void stats_add() \
+ ACCUMULATE void stats_add() \
{ \
.T fld = _STAT(id); \
addstat_##T(STAT_##id.m_id, fld); \
/** TODO: do we want the global copy to update? */
#define REGISTER_STAT_3(id, T, expr) \
REGISTER_STAT_2(id, T); \
- [[accumulate]] void GlobalStats_update(entity this) { STAT(id, this) = (expr); } \
+ ACCUMULATE void GlobalStats_update(entity this) { STAT(id, this) = (expr); } \
STATIC_INIT(worldstat_##id) { entity this = STATS; STAT(id, this) = (expr); }
#else
#define REGISTER_STAT_2(id, type)
REGISTER_REGISTRY(Stats)
REGISTRY_SORT(Stats)
REGISTRY_CHECK(Stats)
-STATIC_INIT(RegisterStats_renumber)
+STATIC_INIT(Stats_renumber)
{
FOREACH(Stats, true, {
it.m_id = STATS_ENGINE_RESERVE + i;