]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Improve QCC compatibility
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 8 Apr 2018 10:42:55 +0000 (20:42 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 8 Apr 2018 10:44:10 +0000 (20:44 +1000)
40 files changed:
qcsrc/client/bgmscript.qc
qcsrc/client/bgmscript.qh
qcsrc/client/hud/hud.qh
qcsrc/client/player_skeleton.qc
qcsrc/client/player_skeleton.qh
qcsrc/client/shownames.qh
qcsrc/client/teamradar.qh
qcsrc/client/wall.qh
qcsrc/client/weapons/projectile.qh
qcsrc/common/effects/effectinfo.qc
qcsrc/common/effects/qc/casings.qc
qcsrc/common/effects/qc/modeleffects.qc
qcsrc/common/effects/qc/rubble.qh
qcsrc/common/mutators/base.qh
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh
qcsrc/common/triggers/func/pointparticles.qc
qcsrc/common/triggers/misc/laser.qc
qcsrc/common/triggers/target/music.qh
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/tuba.qh
qcsrc/lib/_all.inc
qcsrc/lib/accumulate.qh
qcsrc/lib/compiler.qh
qcsrc/lib/cvar.qh
qcsrc/lib/defer.qh
qcsrc/lib/misc.qh
qcsrc/lib/net.qh
qcsrc/lib/noise.qh
qcsrc/lib/oo.qh
qcsrc/lib/registry.qh
qcsrc/lib/replicate.qh
qcsrc/lib/self.qh
qcsrc/lib/sortlist.qh
qcsrc/lib/spawnfunc.qh
qcsrc/lib/static.qh
qcsrc/lib/stats.qh
qcsrc/lib/test.qh
qcsrc/lib/warpzone/mathlib.qc
qcsrc/server/client.qh
qcsrc/server/g_models.qc

index 2db9e54cf1af01dfd8bf9e0348a204f11d9e4f47..ba1fdd268d86f67dfd42ded858aaf97cc42527b7 100644 (file)
@@ -11,12 +11,12 @@ float bgmscriptbuf;
 float bgmscriptbufsize;
 float bgmscriptbufloaded;
 
-class(BGMScript) .float bgmscriptline;
-class(BGMScript) .float bgmscriptline0;
-class(BGMScript) .float bgmscriptvolume;
-class(BGMScript) .float bgmscripttime;
-class(BGMScript) .float bgmscriptstate;
-class(BGMScript) .float bgmscriptstatetime;
+classfield(BGMScript) .float bgmscriptline;
+classfield(BGMScript) .float bgmscriptline0;
+classfield(BGMScript) .float bgmscriptvolume;
+classfield(BGMScript) .float bgmscripttime;
+classfield(BGMScript) .float bgmscriptstate;
+classfield(BGMScript) .float bgmscriptstatetime;
 
 float GetAttackDecaySustainAmplitude(float a, float d, float s, float t)
 {
index 18b0d5ee4231c5c9e95998fdad5be86331b0b1e8..a3044d537cd3200bedd070f38be867b801456e9e 100644 (file)
@@ -1,13 +1,13 @@
 #pragma once
 
 entityclass(BGMScript);
-class(BGMScript) .string bgmscript;
-class(BGMScript) .float bgmscriptattack;
-class(BGMScript) .float bgmscriptdecay;
-class(BGMScript) .float bgmscriptsustain;
-class(BGMScript) .float bgmscriptrelease;
+classfield(BGMScript) .string bgmscript;
+classfield(BGMScript) .float bgmscriptattack;
+classfield(BGMScript) .float bgmscriptdecay;
+classfield(BGMScript) .float bgmscriptsustain;
+classfield(BGMScript) .float bgmscriptrelease;
 
-class(BGMScript) .float just_toggled;
+classfield(BGMScript) .float just_toggled;
 
 #ifdef CSQC
 void BGMScript_InitEntity(entity e);
index dcc72efff555a45389af73cb0da5fc46f98a4a59..496d775efe4f3ad39c0a1a26196753bfb089b82a 100644 (file)
@@ -120,18 +120,18 @@ vector panel_size_copied;
 
 entity panel;
 entityclass(HUDPanel);
-class(HUDPanel) .string panel_name;
-class(HUDPanel) .int panel_id;
-class(HUDPanel) .vector current_panel_pos;
-class(HUDPanel) .vector current_panel_size;
-class(HUDPanel) .string current_panel_bg;
-class(HUDPanel) .float current_panel_bg_alpha;
-class(HUDPanel) .float current_panel_bg_border;
-class(HUDPanel) .vector current_panel_bg_color;
-class(HUDPanel) .float current_panel_bg_color_team;
-class(HUDPanel) .float current_panel_bg_padding;
-class(HUDPanel) .float current_panel_fg_alpha;
-class(HUDPanel) .float update_time;
+classfield(HUDPanel) .string panel_name;
+classfield(HUDPanel) .int panel_id;
+classfield(HUDPanel) .vector current_panel_pos;
+classfield(HUDPanel) .vector current_panel_size;
+classfield(HUDPanel) .string current_panel_bg;
+classfield(HUDPanel) .float current_panel_bg_alpha;
+classfield(HUDPanel) .float current_panel_bg_border;
+classfield(HUDPanel) .vector current_panel_bg_color;
+classfield(HUDPanel) .float current_panel_bg_color_team;
+classfield(HUDPanel) .float current_panel_bg_padding;
+classfield(HUDPanel) .float current_panel_fg_alpha;
+classfield(HUDPanel) .float update_time;
 float panel_enabled;
 vector panel_pos;
 vector panel_size;
@@ -148,7 +148,7 @@ string panel_bg_border_str;
 float panel_bg_padding;
 string panel_bg_padding_str;
 
-class(HUDPanel) .void() panel_draw;
+classfield(HUDPanel) .void() panel_draw;
 
 // chat panel can be reduced / moved while the mapvote is active
 // let know the mapvote panel about chat pos and size
index 55e54d8ac2c641ad49b10bf03a979f0603eff9d3..220b9c6127ef958dd0b07c6312b44842240ac6e5 100644 (file)
@@ -8,13 +8,13 @@
 
 .float v_angle_save_x;
 
-class(Skeleton) .float skeleton_info_modelindex;
-class(Skeleton) .float skeleton_info_skin;
+classfield(Skeleton) .float skeleton_info_modelindex;
+classfield(Skeleton) .float skeleton_info_skin;
 const int BONETYPE_LOWER = 0;
 const int BONETYPE_UPPER = 1;
 const int MAX_BONES = 128;
-class(Skeleton) .float skeleton_bonetype[MAX_BONES];
-class(Skeleton) .float skeleton_numbones;
+classfield(Skeleton) .float skeleton_bonetype[MAX_BONES];
+classfield(Skeleton) .float skeleton_numbones;
 
 void skeleton_loadinfo(entity e)
 {
index 8c5969b09fb4db0ae068b7aa50338215be07b2dd..082335e4b0f61bedbdd39a62b6bc16f8376c9870 100644 (file)
@@ -7,8 +7,8 @@ void skeleton_from_frames(entity e, float is_dead);
 void skeleton_loadinfo(entity e);
 
 entityclass(Skeleton);
-class(Skeleton) .float bone_upperbody;
-class(Skeleton) .int bone_weapon;
-class(Skeleton) .float bone_aim[MAX_AIM_BONES];
-class(Skeleton) .float bone_aimweight[MAX_AIM_BONES];
-class(Skeleton) .float fixbone;
+classfield(Skeleton) .float bone_upperbody;
+classfield(Skeleton) .int bone_weapon;
+classfield(Skeleton) .float bone_aim[MAX_AIM_BONES];
+classfield(Skeleton) .float bone_aimweight[MAX_AIM_BONES];
+classfield(Skeleton) .float fixbone;
index 24f6568d26629396ff7322bfae3b97695f545d3d..a05ca701d03ab2abfc08495fffc6afb469d7f149 100644 (file)
@@ -1,10 +1,10 @@
 #pragma once
 
 entityclass(ShowNames);
-class(ShowNames) .float healthvalue;
-class(ShowNames) .float armorvalue;
-class(ShowNames) .float sameteam;
-class(ShowNames) .float fadedelay;
-class(ShowNames) .float pointtime;
+classfield(ShowNames) .float healthvalue;
+classfield(ShowNames) .float armorvalue;
+classfield(ShowNames) .float sameteam;
+classfield(ShowNames) .float fadedelay;
+classfield(ShowNames) .float pointtime;
 
 void Draw_ShowNames_All();
index 251c1a53f12a9185f0c5274839479066a4d7e759..41c7d46c564465924e272e585f249db640639b23 100644 (file)
@@ -4,10 +4,10 @@ const int MAX_TEAMRADAR_TIMES = 32;
 
 entityclass(TeamRadar);
 // to make entities have dots on the team radar
-class(TeamRadar) .float teamradar_icon;
-class(TeamRadar) .float teamradar_times[MAX_TEAMRADAR_TIMES];
-class(TeamRadar) .int teamradar_time_index;
-class(TeamRadar) .vector teamradar_color;
+classfield(TeamRadar) .float teamradar_icon;
+classfield(TeamRadar) .float teamradar_times[MAX_TEAMRADAR_TIMES];
+classfield(TeamRadar) .int teamradar_time_index;
+classfield(TeamRadar) .vector teamradar_color;
 
 float teamradar_angle; // player yaw angle
 vector teamradar_origin3d_in_texcoord; // player origin
index 11aebd0ed5e25df349f6fa12a8288e345e47f27f..e55bc489b3e7d6c1ac66c6936dc306ddd7d2e067 100644 (file)
@@ -1,11 +1,11 @@
 #pragma once
 
 entityclass(Wall);
-class(Wall) .float lip;
-class(Wall) .float bgmscriptangular;
-class(Wall) .int lodmodelindex0, lodmodelindex1, lodmodelindex2;
-class(Wall) .float loddistance1, loddistance2;
-class(Wall) .vector saved;
+classfield(Wall) .float lip;
+classfield(Wall) .float bgmscriptangular;
+classfield(Wall) .int lodmodelindex0, lodmodelindex1, lodmodelindex2;
+classfield(Wall) .float loddistance1, loddistance2;
+classfield(Wall) .vector saved;
 
 // Needed for interactive clientwalls
 .float inactive; // Clientwall disappears when inactive
index a6ae463477d51162d7364c55e35a4646d1ce20a5..eaa80d05f0a6ae2b9b6d5ebefb0c6041473b6488 100644 (file)
@@ -3,20 +3,20 @@
 #include <common/sounds/sound.qh>
 
 entityclass(Projectile);
-class(Projectile).int traileffect;
-
-class(Projectile).vector iorigin1, iorigin2;
-class(Projectile).float spawntime;
-class(Projectile).vector trail_oldorigin;
-class(Projectile).float trail_oldtime;
-class(Projectile).float fade_time, fade_rate;
-
-class(Projectile).float alphamod;
-class(Projectile).int count; // set if clientside projectile
-class(Projectile).int cnt;   // sound index
-class(Projectile).float gravity;
-class(Projectile).int snd_looping;
-class(Projectile).bool silent;
+classfield(Projectile).int traileffect;
+
+classfield(Projectile).vector iorigin1, iorigin2;
+classfield(Projectile).float spawntime;
+classfield(Projectile).vector trail_oldorigin;
+classfield(Projectile).float trail_oldtime;
+classfield(Projectile).float fade_time, fade_rate;
+
+classfield(Projectile).float alphamod;
+classfield(Projectile).int count; // set if clientside projectile
+classfield(Projectile).int cnt;   // sound index
+classfield(Projectile).float gravity;
+classfield(Projectile).int snd_looping;
+classfield(Projectile).bool silent;
 
 void SUB_Stop(entity this, entity toucher);
 
index 71260eb3d04fa49ae2ffaeaca9c5b001ec8f8070..a1b27873053917e1ba6613d9939bc36d39f0395d 100644 (file)
@@ -327,7 +327,7 @@ REGISTRY(EffectInfos, BITS(9))
 #define EffectInfos_from(i) _EffectInfos_from(i, NULL)
 REGISTER_REGISTRY(EffectInfos)
 #define EFFECTINFO(name) \
-    [[accumulate]] void effectinfo_##name(EffectInfoGroup parent, EffectInfo this) { } \
+    ACCUMULATE void effectinfo_##name(EffectInfoGroup parent, EffectInfo this) { } \
     REGISTER(EffectInfos, EFFECTINFO, name, m_id, NEW(EffectInfoGroup)) { \
         effectinfo_##name(this, NULL); \
     }
@@ -335,8 +335,8 @@ REGISTER_REGISTRY(EffectInfos)
 #define MY(f) this.effectinfo_##f
 #define DEF(name) EFFECTINFO(name)
 #define SUB(name) \
-    [[accumulate]] void effectinfo_##name(EffectInfoGroup parent, EffectInfo this) { parent = EFFECTINFO_##name; parent.children[parent.children_count++] = this = NEW(EffectInfo, #name); } \
-    [[accumulate]] void effectinfo_##name(EffectInfoGroup parent, EffectInfo this)
+    ACCUMULATE void effectinfo_##name(EffectInfoGroup parent, EffectInfo this) { parent = EFFECTINFO_##name; parent.children[parent.children_count++] = this = NEW(EffectInfo, #name); } \
+    ACCUMULATE void effectinfo_##name(EffectInfoGroup parent, EffectInfo this)
 #include "effectinfo.inc"
 #undef MY
 #undef DEF
index 2abf2122c26553b86634a85eb7be3bd3ef1a5a3f..d225b337bc70bfd46d5dd55445d2ba6668b3bd7e 100644 (file)
@@ -30,10 +30,10 @@ void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float ran
 
 #ifdef CSQC
 entityclass(Casing);
-class(Casing) .float alpha;
-class(Casing) .bool silent;
-class(Casing) .int state;
-class(Casing) .float cnt;
+classfield(Casing) .float alpha;
+classfield(Casing) .bool silent;
+classfield(Casing) .int state;
+classfield(Casing) .float cnt;
 
 void Casing_Delete(entity this)
 {
index 26b3ec9f5285744b9f21d72abd82cab86669c5c0..9849b5be73f8ebf3d1aef3ff5b1e61ec4dfea2d0 100644 (file)
@@ -80,10 +80,10 @@ void modeleffect_spawn(string m, float s, float f, vector o, vector v, vector an
 #ifdef CSQC
 
 entityclass(ModelEffect);
-class(ModelEffect) .float frame1time;
-class(ModelEffect) .float lifetime, fadetime;
-class(ModelEffect) .float teleport_time;
-class(ModelEffect) .float scale1, scale2;
+classfield(ModelEffect) .float frame1time;
+classfield(ModelEffect) .float lifetime, fadetime;
+classfield(ModelEffect) .float teleport_time;
+classfield(ModelEffect) .float scale1, scale2;
 
 .float cnt;
 .float scale;
index dd3785b68ea2cf65af3fb5ecc5c77f86c0b102e0..6eda9b15ef29d2b5c60a7b48e3651fcb5a538485 100644 (file)
@@ -3,7 +3,7 @@
 #ifdef CSQC
 
 entityclass(Rubble);
-class(Rubble).float creationtime;
+classfield(Rubble).float creationtime;
 
 IntrusiveList g_rubble;
 STATIC_INIT(g_rubble) { g_rubble = IL_NEW(); }
index 4f940c42b3c016f3e9131e0c6d3b213bc4d5497a..565e39998d7d4186d20ef3937f60ceddc9d53830 100644 (file)
@@ -135,7 +135,7 @@ void RegisterCallbacks() {};
         params(_MUTATOR_HANDLE_NOP,     _MUTATOR_HANDLE_POPOUT) \
         return ret; \
     } \
-    [[accumulate]] void RegisterHooks() { HOOK_##id = NEW(CallbackChain, #id); }
+    ACCUMULATE void RegisterHooks() { HOOK_##id = NEW(CallbackChain, #id); }
 
 #define MUTATOR_CALLHOOK(id, ...) _MUTATOR_CALLHOOK(id, __VA_ARGS__)
 #ifdef __STDC__
@@ -265,7 +265,7 @@ void Mutator_Remove(Mutator mut)
     bool MUTATOR_##id##_check() { return dependence; } \
     REGISTER(Mutators, MUTATOR, id, m_id, NEW(Mutator, #id, MUTATORFUNCTION_##id)) \
     { this.mutatorcheck = MUTATOR_##id##_check; } \
-    [[accumulate]] bool MUTATORFUNCTION_##id(int mode)
+    ACCUMULATE bool MUTATORFUNCTION_##id(int mode)
 
 STATIC_INIT(Mutators) {
     RegisterHooks();
@@ -301,7 +301,7 @@ STATIC_INIT_LATE(Mutators) {
 #define _MUTATOR_CALLBACK(name, func) \
     Callback CALLBACK_##name; \
     bool func(); \
-    [[accumulate]] void RegisterCallbacks() { CALLBACK_##name = NEW(Callback, func); }
+    ACCUMULATE void RegisterCallbacks() { CALLBACK_##name = NEW(Callback, func); }
 
 #define MUTATOR_HOOKFUNCTION(...) \
     EVAL_MUTATOR_HOOKFUNCTION(OVERLOAD(MUTATOR_HOOKFUNCTION, __VA_ARGS__))
@@ -312,9 +312,9 @@ STATIC_INIT_LATE(Mutators) {
 
 #define MUTATOR_HOOKFUNCTION_3(mut, cb, order) \
     _MUTATOR_CALLBACK(mut##_##cb, mut##_##cb) \
-    [[accumulate]] bool MUTATORFUNCTION_##mut##_hooks(int mode) { MUTATOR_HOOK(cb, mut##_##cb, order); } \
+    ACCUMULATE bool MUTATORFUNCTION_##mut##_hooks(int mode) { MUTATOR_HOOK(cb, mut##_##cb, order); } \
     bool mut##_##cb() { return = false; } \
-    [[accumulate]] bool mut##_##cb()
+    ACCUMULATE bool mut##_##cb()
 
 #define MUTATOR_HOOK(cb, func, order) MACRO_BEGIN {                     \
     MUTATOR_ONADD {                                                     \
index 95b8890ccce07b10765c5dae8218d9d265b223bc..94d735a1f6096b2f3a77a0b712e4124912bb0aa3 100644 (file)
@@ -11,21 +11,21 @@ const int SPRITERULE_SPECTATOR = 2;
 
 #ifdef CSQC
 entityclass(WaypointSprite);
-class(WaypointSprite) .float helpme;
-class(WaypointSprite) .float rule;
-class(WaypointSprite) .string netname; // primary picture
-class(WaypointSprite) .string netname2; // secondary picture
-class(WaypointSprite) .string netname3; // tertiary picture
-class(WaypointSprite) .int team; // team that gets netname2
-class(WaypointSprite) .float lifetime;
-class(WaypointSprite) .float fadetime;
-class(WaypointSprite) .float maxdistance;
-class(WaypointSprite) .int hideflags;
-class(WaypointSprite) .float spawntime;
-class(WaypointSprite) .float health;
-class(WaypointSprite) .float build_started;
-class(WaypointSprite) .float build_starthealth;
-class(WaypointSprite) .float build_finished;
+classfield(WaypointSprite) .float helpme;
+classfield(WaypointSprite) .float rule;
+classfield(WaypointSprite) .string netname; // primary picture
+classfield(WaypointSprite) .string netname2; // secondary picture
+classfield(WaypointSprite) .string netname3; // tertiary picture
+classfield(WaypointSprite) .int team; // team that gets netname2
+classfield(WaypointSprite) .float lifetime;
+classfield(WaypointSprite) .float fadetime;
+classfield(WaypointSprite) .float maxdistance;
+classfield(WaypointSprite) .int hideflags;
+classfield(WaypointSprite) .float spawntime;
+classfield(WaypointSprite) .float health;
+classfield(WaypointSprite) .float build_started;
+classfield(WaypointSprite) .float build_starthealth;
+classfield(WaypointSprite) .float build_finished;
 
 float autocvar_g_waypointsprite_alpha;
 float autocvar_g_waypointsprite_crosshairfadealpha;
index 93eb836108bee22e68d1d2e642fa25ff75ef8316..9286f2adbce19fb8ec741d1c827fa1ad2b2b63fc 100644 (file)
@@ -169,17 +169,17 @@ spawnfunc(func_sparks)
 .int dphitcontentsmask;
 
 entityclass(PointParticles);
-class(PointParticles) .int cnt; // effect number
-class(PointParticles) .vector velocity; // particle velocity
-class(PointParticles) .float waterlevel; // direction jitter
-class(PointParticles) .int count; // count multiplier
-class(PointParticles) .int impulse; // density
-class(PointParticles) .string noise; // sound
-class(PointParticles) .float atten;
-class(PointParticles) .float volume;
-class(PointParticles) .float absolute; // 1 = count per second is absolute, 2 = only spawn at toggle
-class(PointParticles) .vector movedir; // trace direction
-class(PointParticles) .float glow_color; // palette index
+classfield(PointParticles) .int cnt; // effect number
+classfield(PointParticles) .vector velocity; // particle velocity
+classfield(PointParticles) .float waterlevel; // direction jitter
+classfield(PointParticles) .int count; // count multiplier
+classfield(PointParticles) .int impulse; // density
+classfield(PointParticles) .string noise; // sound
+classfield(PointParticles) .float atten;
+classfield(PointParticles) .float volume;
+classfield(PointParticles) .float absolute; // 1 = count per second is absolute, 2 = only spawn at toggle
+classfield(PointParticles) .vector movedir; // trace direction
+classfield(PointParticles) .float glow_color; // palette index
 
 void Draw_PointParticles(entity this)
 {
index 3d5ef42d848bd7c745a7316690cb5271436baced..b7bdede728211a77f0df4adf05211f3e11770ab4 100644 (file)
@@ -252,14 +252,14 @@ spawnfunc(misc_laser)
 // it has color 'colormod'
 // and stops when something is in the way
 entityclass(Laser);
-class(Laser) .int cnt; // end effect
-class(Laser) .vector colormod;
-class(Laser) .int state; // on-off
-class(Laser) .int count; // flags for the laser
-class(Laser) .vector velocity;
-class(Laser) .float alpha;
-class(Laser) .float scale; // scaling factor of the thickness
-class(Laser) .float modelscale; // scaling factor of the dlight
+classfield(Laser) .int cnt; // end effect
+classfield(Laser) .vector colormod;
+classfield(Laser) .int state; // on-off
+classfield(Laser) .int count; // flags for the laser
+classfield(Laser) .vector velocity;
+classfield(Laser) .float alpha;
+classfield(Laser) .float scale; // scaling factor of the thickness
+classfield(Laser) .float modelscale; // scaling factor of the dlight
 
 void Draw_Laser(entity this)
 {
index 80b3684a4e9a768b8ef17e4ea596f463d9cc886d..1cb32ea39c180b4c05f0095a3c58535669248084 100644 (file)
@@ -10,8 +10,8 @@ entity music_trigger;
 // FIXME also control bgmvolume here, to not require a target_music for the default track.
 
 entityclass(TargetMusic);
-class(TargetMusic) .int state;
-class(TargetMusic) .float lastvol;
+classfield(TargetMusic) .int state;
+classfield(TargetMusic) .float lastvol;
 
 void TargetMusic_Advance();
 
index 8d569d04e253f798debe0b17747233432166bf92..985d2ae59ef3faabdd7fce020d09d0310ddfb3a0 100644 (file)
@@ -261,11 +261,11 @@ float autocvar_cl_grapplehook_alpha = 1;
 void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg);
 
 entityclass(Hook);
-class(Hook) .entity HookType; // ENT_CLIENT_*
-class(Hook) .vector origin;
-class(Hook) .vector velocity;
-class(Hook) .float HookSilent;
-class(Hook) .float HookRange;
+classfield(Hook) .entity HookType; // ENT_CLIENT_*
+classfield(Hook) .vector origin;
+classfield(Hook) .vector velocity;
+classfield(Hook) .float HookSilent;
+classfield(Hook) .float HookRange;
 
 string Draw_GrapplingHook_trace_callback_tex;
 float Draw_GrapplingHook_trace_callback_rnd;
@@ -281,7 +281,7 @@ void Draw_GrapplingHook_trace_callback(vector start, vector hit, vector end)
        Draw_GrapplingHook_trace_callback_rnd += 0.25 * vlen(hit - start) / 8;
 }
 
-class(Hook) .float teleport_time;
+classfield(Hook) .float teleport_time;
 void Draw_GrapplingHook(entity this)
 {
        vector a, b, atrans;
index ffa1dd6e2dd5589e5623611655bce63a87bf4042..d932d98bd16f6d7554c32fb7f447ca9419be3c15 100644 (file)
@@ -45,9 +45,9 @@ SPAWNFUNC_WEAPON(weapon_tuba, WEP_TUBA)
 
 #ifdef CSQC
 entityclass(Tuba);
-class(Tuba) .int note;
-class(Tuba) .bool tuba_attenuate;
-class(Tuba) .float tuba_volume;
-class(Tuba) .float tuba_volume_initial;
-class(Tuba) .int tuba_instrument;
+classfield(Tuba) .int note;
+classfield(Tuba) .bool tuba_attenuate;
+classfield(Tuba) .float tuba_volume;
+classfield(Tuba) .float tuba_volume_initial;
+classfield(Tuba) .int tuba_instrument;
 #endif
index d44c5e89cdda2acacbd1b615bfbc55dc8bb93b9f..d45dc208e0149d24c195bc5bc71bcf5271bad793 100644 (file)
        #define bool float
 #endif
 
+#ifndef QCC_SUPPORT_ACCUMULATE
+       #warning "QCC does not support accumulate, may not compile correctly"
+       #define ACCUMULATE
+#else
+       #define ACCUMULATE [[accumulate]]
+#endif
+
 #ifndef QCC_SUPPORT_ERASEABLE
        #define ERASEABLE
 #else
        #define ERASEABLE [[eraseable]]
 #endif
 
+#ifndef QCC_SUPPORT_ALIAS
+    #warning "QCC does not support alias, may not compile correctly"
+    #define ALIAS(var)
+#else
+    #define ALIAS(var) [[alias(var)]]
+#endif
+
 #include <dpdefs/pre.qh>
 
 #if defined(CSQC)
 
 #include <dpdefs/post.qh>
 
+#ifndef QCC_SUPPORT_POW
+    #define pow(a, b) pow(a, b)
+#else
+    #define pow(a, b) (a ** b)
+#endif
+
 #include "self.qh"
 
 #define USING(name, T) typedef T name
index c265325f8f6c75d20de492fcf1c81211195e5849..2d1e40212fba3c9cd2d9f28216a5a3c2071c3d7e 100644 (file)
@@ -2,7 +2,7 @@
 
 #ifdef QCC_SUPPORT_ACCUMULATE
        #define ACCUMULATE_FUNCTION(func, otherfunc) \
-               [[accumulate]] void func() \
+               ACCUMULATE void func() \
                { \
                        otherfunc(); \
                }
index d1bdc4fe5b55e609bc4d02b32dc0f55b0761f21a..5ca0ed56525ee33886c46a0a7c27ecfd7763068b 100644 (file)
        #endif
 #endif
 
+#ifndef QCC_SUPPORT_ALIAS
+       #ifdef GMQCC
+               #define QCC_SUPPORT_ALIAS
+       #endif
+#endif
+
+#ifndef QCC_SUPPORT_POW
+    #ifdef GMQCC
+        #define QCC_SUPPORT_POW
+    #endif
+#endif
+
 #ifdef GMQCC
     #define LABEL(id) :id
 #else
index a17f2bad72397d55a470fc32bb64851cfcbe5152..e8e2c54880a1a29eed6c48d50a6ac0cd44c016ff 100644 (file)
@@ -87,7 +87,7 @@ const noref vector default_vector = '0 0 0';
 //  e.g.: AUTOCVAR(mycvar, float, 2.5, "cvar description")
 
 #define __AUTOCVAR(file, archive, var, type, desc, default) \
-       [[accumulate]] void RegisterCvars(void(string, string, string, bool, string) f) \
+       ACCUMULATE void RegisterCvars(void(string, string, string, bool, string) f) \
        { \
                f( #var, repr_cvar_##type(default), desc, archive, file); \
        } \
index 4f34bb4853ade7f0149274ebdb3c325d4468147a..5d6473080a60d9b470856efb27fc1344056764c3 100644 (file)
@@ -6,8 +6,8 @@
        #include "self.qh"
 
        entityclass(Defer);
-       class(Defer).entity owner;
-       class(Defer).void(entity) defer_func;
+       classfield(Defer).entity owner;
+       classfield(Defer).void(entity) defer_func;
 
        /** Remove entity */
        void SUB_Remove(entity this)
index 6c29a4b88dd100f74ded51a0fe91ad82179c7d25..cbb1079244d2ef5a6806f94387a8826380dc9589 100644 (file)
 
        #include "p99.qh"
        #define OVERLOAD(F, ...) P99_IF_EMPTY(__VA_ARGS__)(P99_PASTE2(F, _00)())(P99_PASTE3(F, _, P00_NARG(__VA_ARGS__))(__VA_ARGS__))
-       /** for use within a macro */
+       /** for use within macros */
        #define OVERLOAD_(F, ...) P99_IF_EMPTY(__VA_ARGS__)(P99_PASTE2(F, _00)())(P99_PASTE3(F, _, P00_NARG(__VA_ARGS__))(__VA_ARGS__))
+       #define OVERLOAD__(F, ...) P99_IF_EMPTY(__VA_ARGS__)(P99_PASTE2(F, _00)())(P99_PASTE3(F, _, P00_NARG(__VA_ARGS__))(__VA_ARGS__))
 #else
        #define EVAL(...) __VA_ARGS__
 
-       #define OVERLOAD_(F, ...) F##_##__VA_COUNT__(__VA_ARGS__)
        #define OVERLOAD(F, ...) F##_##__VA_COUNT__(__VA_ARGS__)
+       #define OVERLOAD_(F, ...) F##_##__VA_COUNT__(__VA_ARGS__)
+       #define OVERLOAD__(F, ...) F##_##__VA_COUNT__(__VA_ARGS__)
 #endif
 
 #if defined(CSQC)
index fe2952e2c4025c3d5f84854627824cc3f4ab3d6f..4769a21388e77d677fa6a8dc38a52298ff51af4c 100644 (file)
@@ -50,7 +50,7 @@ STATIC_INIT(RegisterTempEntities_renumber) { FOREACH(TempEntities, true, it.m_id
 
 #ifdef CSQC
        #define REGISTER_NET_LINKED(id) \
-               [[accumulate]] NET_HANDLE(id, bool isnew) \
+               ACCUMULATE NET_HANDLE(id, bool isnew) \
                { \
                        this = __self; \
                        this.sourceLoc = __FILE__ ":" STR(__LINE__); \
index 782798c9fe5c492799d0892f4f1f5cc3f155731d..5ef9cf8b6b17708b6bed1bb664b593d049496e53 100644 (file)
@@ -2,11 +2,11 @@
 
 // noises "usually" start in the range -1..1
 entityclass(Noise);
-class(Noise).float noise_baccum;
-class(Noise).float noise_paccum;
-class(Noise).float noise_paccum2;
-class(Noise).float noise_paccum3;
-class(Noise).float noise_bstate;
+classfield(Noise).float noise_baccum;
+classfield(Noise).float noise_paccum;
+classfield(Noise).float noise_paccum2;
+classfield(Noise).float noise_paccum3;
+classfield(Noise).float noise_bstate;
 
 ERASEABLE
 float Noise_Brown(entity e, float dt)
index 08de3747494465e5063416e95ccb931f1d00bebf..b22ff791501c9a990c93e5d9c7f3dabc2c35f661 100644 (file)
@@ -5,19 +5,16 @@
 #include "static.qh"
 
 .vector origin;
+
 .bool pure_data;
-/** @deprecated use new_pure or NEW(class) */
-#define make_pure(e) \
-       MACRO_BEGIN \
-       { \
-               (e).pure_data = true; \
-       } MACRO_END
-#define make_impure(e) \
-       MACRO_BEGIN \
-       { \
-               (e).pure_data = false; \
-       } MACRO_END
 #define is_pure(e) ((e).pure_data)
+/** @deprecated use new_pure or NEW(class) */
+#define make_pure(e) MACRO_BEGIN \
+       (e).pure_data = true; \
+MACRO_END
+#define make_impure(e) MACRO_BEGIN \
+       (e).pure_data = false; \
+MACRO_END
 
 .string classname;
 /** Location entity was spawned from in source */
@@ -58,11 +55,11 @@ entity __spawn(string _classname, string _sourceLoc, bool pure)
 #define entityclass_1(name) entityclass_2(name, Object)
 #ifndef QCC_SUPPORT_ENTITYCLASS
        #define entityclass_2(name, base) USING(name, entity)
-       #define class(name)
+       #define classfield(name)
        #define _new(class, pure) __spawn( #class, __FILE__ ":" STR(__LINE__), pure)
 #else
        #define entityclass_2(name, base) entityclass name : base {}
-       #define class(name) [[class(name)]]
+       #define classfield(name) [[class(name)]]
        #define _new(class, pure) ((class) __spawn( #class, __FILE__ ":" STR(__LINE__), pure))
 #endif
 /** entities you care about seeing (.origin works) */
@@ -71,12 +68,13 @@ entity __spawn(string _classname, string _sourceLoc, bool pure)
 #define new_pure(class) _new(class, true)
 #define spawn() __spawn("entity", __FILE__ ":" STR(__LINE__), false)
 
-[[accumulate]] void ONREMOVE(entity this) {}
+ACCUMULATE void ONREMOVE(entity this) {}
 
 #ifndef SVQC
        #define delete_fn builtin_remove
 #endif
 
+.void(entity this) dtor;
 #define delete(this) MACRO_BEGIN { \
     entity _this = (this); \
     void(entity) _dtor = _this.dtor; \
@@ -104,7 +102,7 @@ void clearentity(entity e)
 }
 
 // Classes have a `spawn##cname(entity)` constructor
-// The parameter is used across [[accumulate]] functions
+// The parameter is used across ACCUMULATE functions
 
 .bool transmute;
 
@@ -138,12 +136,149 @@ void clearentity(entity e)
     } \
     MACRO_END
 
-#define CONSTRUCTOR(cname, ...) \
-       cname OVERLOAD(spawn##cname, cname this, __VA_ARGS__) \
-       { \
-               return = this; \
-       } \
-       [[accumulate]] cname OVERLOAD(spawn##cname, cname this, __VA_ARGS__)
+#define CLASS(...) EVAL_CLASS(OVERLOAD__(CLASS, __VA_ARGS__))
+#define EVAL_CLASS(...) __VA_ARGS__
+
+#define ATTRIB(...) EVAL_ATTRIB(OVERLOAD_(ATTRIB, __VA_ARGS__))
+#define EVAL_ATTRIB(...) __VA_ARGS__
+
+#ifdef QCC_SUPPORT_CLASS
+
+#warning "QCC_SUPPORT_CLASS not implemented"
+
+#define CLASS_1(name)                               CLASS_2(name, entity)
+#define CLASS_2(name, base)                         class name : base {
+
+#define INIT(class)                                     void class::class()
+#define CONSTRUCTOR(class, ...)                         void class::class(__VA_ARGS__)
+#define DESTRUCTOR(class)                               class::~class()
+
+#define SUPER(class)                                    super
+
+#define ATTRIB_3(class, name, T)                        T name
+#define ATTRIB_4(class, name, T, val)                   ATTRIB_3(class, name, T) = val
+#define STATIC_ATTRIB(class, name, T, val)              static T name = val
+
+#define ATTRIB_STRZONE(class, name, T, val)             T name = val
+#define STATIC_ATTRIB_STRZONE(class, name, T, val)      static T name = val
+
+#define ATTRIBARRAY(class, name, T, val)                T name[val]
+
+#define METHOD(class, name, prototype)                  virtual void class::name()
+#define STATIC_METHOD(class, name, prototype)           static void class::name()
+
+#define ENDCLASS(class)                             };
+
+#else
+
+#define CLASS_1(cname) CLASS_2(cname, )
+#define CLASS_2(cname, base)                                                                       \
+       entityclass(cname, base);                                                                      \
+       classfield(cname).bool instanceOf##cname;                                                      \
+       DEBUG_STUFF(cname)                                                                             \
+       VTBL(cname, base)                                                                              \
+       _INIT_STATIC(cname)                                                                            \
+       {                                                                                              \
+               if (cname##_vtbl && !this.transmute)                                                       \
+               {                                                                                          \
+                       copyentity(cname##_vtbl, this);                                                        \
+                       return;                                                                                \
+               }                                                                                          \
+               spawn##base##_static(this);                                                                \
+               this.instanceOf##cname = true;                                                             \
+       }                                                                                              \
+       INIT(cname)                                                                                    \
+       {                                                                                              \
+               /* Only statically initialize the current class, it contains everything it inherits */     \
+               if (cname##_vtbl.vtblname == this.classname)                                               \
+               {                                                                                          \
+                       spawn##cname##_static(this);                                                           \
+                       this.transmute = false;                                                                \
+                       this.classname = #cname;                                                               \
+                       this.vtblname = string_null;                                                           \
+                       this.vtblbase = cname##_vtbl;                                                          \
+               }                                                                                          \
+               spawn##base##_1(this);                                                                     \
+       }
+
+#define INIT(cname)                                                                                \
+       ACCUMULATE cname spawn##cname##_1(cname this)
+
+#define CONSTRUCTOR(cname, ...)                                                                    \
+       cname OVERLOAD(spawn##cname, cname this, __VA_ARGS__)                                          \
+       {                                                                                              \
+               return = this;                                                                             \
+       }                                                                                              \
+       ACCUMULATE cname OVERLOAD(spawn##cname, cname this, __VA_ARGS__)
+
+#define DESTRUCTOR(cname)                                                                          \
+       STATIC_METHOD(cname, dtorimpl, void(cname this));                                              \
+    METHOD(cname, dtor, void(cname this))                                                          \
+    {                                                                                              \
+        METHOD_REFERENCE(cname, dtorimpl)(this);                                                   \
+        this.instanceOf##cname = false;                                                            \
+        entity super = SUPER(cname);                                                               \
+        if (super != cname##_vtbl) super.dtor(this);                                               \
+    }                                                                                              \
+       STATIC_METHOD(cname, dtorimpl, void(cname this))
+
+#define SUPER(cname) (cname##_vtbl.vtblbase)
+
+#define ATTRIB_3(cname, name, type) classfield(cname) .type name
+#define ATTRIB_4(cname, name, type, val)                                                           \
+       ATTRIB_3(cname, name, type);                                                                   \
+       INIT(cname)                                                                                    \
+       {                                                                                              \
+               noref bool strzone; /* Error on strzone() calls. */                                        \
+               this.name = val;                                                                           \
+       }                                                                                              \
+       ATTRIB_3(cname, name, type)
+
+#define STATIC_ATTRIB(cname, name, type, val)                                                      \
+       type cname##_##name;                                                                           \
+       _INIT_STATIC(cname)                                                                            \
+       {                                                                                              \
+               noref bool strzone; /* Error on strzone() calls. */                                        \
+               cname##_##name = val;                                                                      \
+       }
+
+// cleanup potentially zoned strings from base classes
+#define ATTRIB_STRZONE(cname, name, type, val)                                                     \
+       classfield(cname).type name;                                                                   \
+       INIT(cname)                                                                                    \
+       {                                                                                              \
+               strcpy(this.name, val);                                                                    \
+       }
+
+#define STATIC_ATTRIB_STRZONE(cname, name, type, val)                                              \
+       type cname##_##name;                                                                           \
+       _INIT_STATIC(cname)                                                                            \
+       {                                                                                              \
+               strcpy(cname##_##name, val);                                                               \
+       }
+
+#define ATTRIBARRAY(cname, name, type, cnt)                                                        \
+       classfield(cname) .type name[cnt]
+
+#define METHOD(cname, name, prototype)                                                             \
+       STATIC_METHOD(cname, name, prototype);                                                         \
+       classfield(cname) .prototype name;                                                             \
+       _INIT_STATIC(cname)                                                                            \
+       {                                                                                              \
+               this.name = METHOD_REFERENCE(cname, name);                                                 \
+       }                                                                                              \
+       STATIC_METHOD(cname, name, prototype)
+
+#define STATIC_METHOD(cname, name, prototype)                                                      \
+       prototype METHOD_REFERENCE(cname, name)
+
+#define ENDCLASS(cname)                                                                            \
+       INIT(cname)                                                                                    \
+       {                                                                                              \
+               return this;                                                                               \
+       }
+
+// impl
 
 .string vtblname;
 .entity vtblbase;
@@ -168,124 +303,25 @@ STATIC_INIT(RegisterClasses)
        } \
        ACCUMULATE_FUNCTION(RegisterClasses, cname##_vtbl_init)
 
-#define _INIT_STATIC(cname) [[accumulate]] void spawn##cname##_static(cname this)
-#define INIT(cname) [[accumulate]] cname spawn##cname##_1(cname this)
+#define _INIT_STATIC(cname) ACCUMULATE void spawn##cname##_static(cname this)
 
 #if NDEBUG
        #define DEBUG_STUFF(cname)
 #else
        #define DEBUG_STUFF(cname) \
-               bool is_##cname(entity e) { return e.instanceOf##cname; } \
-               void isnt_##cname(entity e) { eprint(e); }
+               ERASEABLE bool is_##cname(entity e) { return e.instanceOf##cname; } \
+               ERASEABLE void isnt_##cname(entity e) { eprint(e); }
 #endif
 
-
-#define CLASS(cname, base)                  \
-       entityclass(cname, base);               \
-       class(cname).bool instanceOf##cname;    \
-       DEBUG_STUFF(cname)                      \
-       VTBL(cname, base)                       \
-       _INIT_STATIC(cname)                     \
-       {                                       \
-               if (cname##_vtbl && !this.transmute)\
-               {                                   \
-                       copyentity(cname##_vtbl, this); \
-                       return;                         \
-               }                                   \
-               spawn##base##_static(this);         \
-               this.instanceOf##cname = true;      \
-       }                                       \
-       INIT(cname)                             \
-       {                                       \
-               /* Only statically initialize the current class, it contains everything it inherits */ \
-               if (cname##_vtbl.vtblname == this.classname) \
-               {                                   \
-                       spawn##cname##_static(this);    \
-                       this.transmute = false;         \
-                       this.classname = #cname;        \
-                       this.vtblname = string_null;    \
-                       this.vtblbase = cname##_vtbl;   \
-               }                                   \
-               spawn##base##_1(this);              \
-       }
-
 #define METHOD_REFERENCE(cname, name) \
        cname##_##name
 
-#define STATIC_METHOD(cname, name, prototype) \
-       prototype METHOD_REFERENCE(cname, name)
-
-#define METHOD(cname, name, prototype) \
-       STATIC_METHOD(cname, name, prototype); \
-       class(cname) .prototype name; \
-       _INIT_STATIC(cname) \
-       { \
-               this.name = METHOD_REFERENCE(cname, name); \
-       } \
-       STATIC_METHOD(cname, name, prototype)
-
-#define DESTRUCTOR(cname) \
-       STATIC_METHOD(cname, dtorimpl, void(cname this)); \
-    METHOD(cname, dtor, void(cname this)) \
-    { \
-        METHOD_REFERENCE(cname, dtorimpl)(this); \
-        this.instanceOf##cname = false; \
-        entity super = SUPER(cname); \
-        if (super != cname##_vtbl) super.dtor(this); \
-    } \
-       STATIC_METHOD(cname, dtorimpl, void(cname this))
-
-#define ATTRIB(...) EVAL_ATTRIB(OVERLOAD_(ATTRIB, __VA_ARGS__))
-#define EVAL_ATTRIB(...) __VA_ARGS__
-#define ATTRIB_3(cname, name, type) class(cname) .type name
-#define ATTRIB_4(cname, name, type, val) \
-       ATTRIB_3(cname, name, type); \
-       INIT(cname) \
-       { \
-               noref bool strzone; /* Error on strzone() calls. */ \
-               this.name = val; \
-       } \
-       ATTRIB_3(cname, name, type)
-
-#define STATIC_ATTRIB(cname, name, type, val) \
-       type cname##_##name; \
-       _INIT_STATIC(cname) \
-       { \
-               noref bool strzone; /* Error on strzone() calls. */ \
-               cname##_##name = val; \
-       }
-
-// cleanup potentially zoned strings from base classes
-
-#define ATTRIB_STRZONE(cname, name, type, val)      \
-       class(cname).type name;                \
-       INIT(cname) \
-       { \
-               strcpy(this.name, val); \
-       }
-
-#define STATIC_ATTRIB_STRZONE(cname, name, type, val) \
-       type cname##_##name; \
-       _INIT_STATIC(cname) \
-       { \
-               strcpy(cname##_##name, val); \
-       }
-
-#define ATTRIBARRAY(cname, name, type, cnt) \
-       class(cname) .type name[cnt]
-
-#define ENDCLASS(cname) \
-       INIT(cname) \
-       { \
-               return this; \
-       }
-
-#define SUPER(cname) (cname##_vtbl.vtblbase)
+#endif
 
 #define spawn_static(this)
 #define spawn_1(this)
 #define _vtbl NULL
-CLASS(Object, );
+CLASS(Object)
     DESTRUCTOR(Object) { builtin_remove(this); }
     #define remove(this) delete(this)
        METHOD(Object, describe, string(Object this))
index 306a107d7e722bc4b6706bd447249d0588e1a694..d8f18a02c96e4ab98b749530dd5f1f58550609b5 100644 (file)
@@ -22,7 +22,7 @@
  */
 #define REGISTRY(id, max) \
        void Register##id(); \
-       [[accumulate]] void REGISTRY_DEPENDS_(id) {} \
+       ACCUMULATE void REGISTRY_DEPENDS_(id) {} \
        REGISTRY_BEGIN(id) {} \
        REGISTRY_END(id) {} \
        void _Register##id() {} \
 #define REGISTRY_DEPENDS_(id) Register##id##_Depends()
 
 /** Called before initializing a registry. */
-#define REGISTRY_BEGIN(id) [[accumulate]] void REGISTRY_BEGIN_(id) { noref void() f = Register##id; } void REGISTRY_BEGIN_(id)
+#define REGISTRY_BEGIN(id) ACCUMULATE void REGISTRY_BEGIN_(id) { noref void() f = Register##id; } void REGISTRY_BEGIN_(id)
 #define REGISTRY_BEGIN_(id) Register##id##_First()
 
 /** Called after initializing a registry. */
-#define REGISTRY_END(id) [[accumulate]] void REGISTRY_END_(id) { noref void() f = Register##id; } void REGISTRY_END_(id)
+#define REGISTRY_END(id) ACCUMULATE void REGISTRY_END_(id) { noref void() f = Register##id; } void REGISTRY_END_(id)
 #define REGISTRY_END_(id) Register##id##_Done()
 
 REGISTRY(Registries, BITS(8))
@@ -104,7 +104,7 @@ REGISTRY(Registries, BITS(8))
        REGISTRY_PUSH(registry, fld, e); \
 } MACRO_END
 
-#define REGISTER_INIT(id) [[accumulate]] void Register_##id##_init(entity this)
+#define REGISTER_INIT(id) ACCUMULATE void Register_##id##_init(entity this)
 
 /** internal next pointer */
 #define REGISTRY_NEXT enemy
@@ -147,9 +147,9 @@ REGISTRY(Registries, BITS(8))
 #define REGISTRY_HASH(id) Registry_hash_##id
 
 ERASEABLE
-[[accumulate]] void Registry_check(string r, string server) { }
+ACCUMULATE void Registry_check(string r, string server) { }
 ERASEABLE
-[[accumulate]] void Registry_send_all() { }
+ACCUMULATE void Registry_send_all() { }
 
 #ifdef SVQC
 void Registry_send(string id, string hash);
index 3dc3cf22b48e580edb31a2d1f06bf45575256fc0..4031352fedbe8c34eb264ca20c22682c4f2e1c0a 100644 (file)
@@ -12,7 +12,7 @@
        #define REPLICATE(...) EVAL_REPLICATE(OVERLOAD(REPLICATE, __VA_ARGS__))
        #define EVAL_REPLICATE(...) __VA_ARGS__
 
-       [[accumulate]] void ReplicateVars(entity this, entity store, string thisname, int i) {}
+       ACCUMULATE void ReplicateVars(entity this, entity store, string thisname, int i) {}
 
        #define REPLICATE_3(fld, type, var) REPLICATE_4(fld, type, var, )
        #define REPLICATE_4(fld, type, var, func) REPLICATE_##type(fld, var, func)
index 0a61cc003dfdc9046acf24dc7b33b057115732e8..4299c19cd3674a286d3b5eea310a0754f3db0ad1 100644 (file)
@@ -12,7 +12,7 @@
 // Step 2: const self
 #if 1
     #define self (RVALUE, self)
-    [[alias("self")]] entity __self;
+    ALIAS("self") entity __self;
     #define setself(s) (__self = s)
     #define WITHSELF(value, block) WITH(entity, __self, value, (RVALUE, block))
 #endif
index af4b47ab8058ad35a8f8b6405538cc3f4ed32a31..8c362d4305cd98721075bfe84aa8a7a1ab0c4910 100644 (file)
@@ -2,7 +2,7 @@
 
 entityclass(Sort);
 // .float(entity,entity) sort_cmp;
-class(Sort).entity chain, sort_next, sort_prev;
+classfield(Sort).entity chain, sort_next, sort_prev;
 
 entity Sort_Spawn();
 
index e14002a6d5b3812f59533e82ae5346463a610ec5..614f7efb1b13c246c1679587d4a6bd405b7e7535 100644 (file)
@@ -86,7 +86,7 @@ noref bool require_spawnfunc_prefix;
        #define spawnfunc_1(id) spawnfunc_2(id, FIELDS_UNION)
        #define spawnfunc_2(id, whitelist) \
                void __spawnfunc_##id(entity this); \
-               [[accumulate]] void spawnfunc_##id(entity this) \
+               ACCUMULATE void spawnfunc_##id(entity this) \
                { \
                    if (!__spawnfunc_first) { \
                 __spawnfunc_first = true; \
index 6f511fcecfa1c9c1f2ef842ad5fe47ac44fbd7ef..e0ec96b8ec0c43872992e12523329c0be74e8f5d 100644 (file)
@@ -17,7 +17,9 @@ void profile(string s)
 }
 
 #define _STATIC_INIT(func, where) \
-       [[accumulate]] void _static_##func() { profile(#func); } \
+       ACCUMULATE void _static_##func##profile() { profile(#func); } \
+       ACCUMULATE_FUNCTION(where, _static_##func##profile) \
+       ACCUMULATE void _static_##func(); \
        ACCUMULATE_FUNCTION(where, _static_##func) \
        void _static_##func()
 
index 1100c474cb9eb49074cd85d08431fd0f0ba61012..03bd34b813af0714b0380c0aa3ea423713b86bd3 100644 (file)
@@ -53,7 +53,7 @@ int g_magic_stats_hole = 0;
                                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)) \
@@ -111,7 +111,7 @@ int g_magic_stats_hole = 0;
                                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); \
@@ -120,7 +120,7 @@ int g_magic_stats_hole = 0;
     /** 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)
index ff6f2d23d5b52f1e00d75ba699c6552031ba8f5b..8d8de76ec6119abecd88093b0bd52bd8e1bb08e3 100644 (file)
@@ -5,7 +5,7 @@
 /** Use UpperCamelCase for suite and test only */
 #define TEST(suite, test) \
        void _TEST_##suite##_##test(); \
-       [[accumulate]] int TEST_RunAll_accumulated(int f) { \
+       ACCUMULATE int TEST_RunAll_accumulated(int f) { \
                if (!TEST_Run(#suite "_" #test)) ++f; \
                return = f; \
        } \
index acbc1c61d4dda0f69cb0d256467f16bc2808cb07..4a7c8861069f7eb8420ec819b9525d606ffbe2d2 100644 (file)
@@ -63,11 +63,11 @@ float tanh(float e)
 
 float exp(float e)
 {
-       return (M_E ** e);
+       return pow(M_E, e);
 }
 float exp2(float e)
 {
-       return (2 ** e);
+       return pow(2, e);
 }
 float expm1(float e)
 {
@@ -79,16 +79,16 @@ vector frexp(float e)
        vector v;
        v.z = 0;
        v.y = ilogb(e) + 1;
-       v.x = e / (2 ** v.y);
+       v.x = e / pow(2, v.y);
        return v;
 }
 int ilogb(float e)
 {
        return floor(log2(fabs(e)));
 }
-float ldexp(float e, int e)
+float ldexp(float x, int e)
 {
-       return e * (2 ** e);
+       return x * pow(2, e);
 }
 float logn(float e, float base)
 {
@@ -117,12 +117,12 @@ vector modf(float f)
 
 float scalbn(float e, int n)
 {
-       return e * (2 ** n);
+       return e * pow(2, n);
 }
 
 float cbrt(float e)
 {
-       return copysign((fabs(e) ** (1.0/3.0)), e);
+       return copysign(pow(fabs(e), (1.0/3.0)), e);
 }
 float hypot(float e, float f)
 {
index 48d42da0092d2f8cf059d1f2037e8aace3bbc372..7499ee8ddfac0e0fbbd299ab4de285b53c62ea83 100644 (file)
@@ -231,5 +231,5 @@ float CalcRotRegen(float current, float regenstable, float regenfactor, float re
 
 bool Spectate(entity this, entity pl);
 
-#define SPECTATE_COPY() [[accumulate]] void SpectateCopy(entity this, entity spectatee)
+#define SPECTATE_COPY() ACCUMULATE void SpectateCopy(entity this, entity spectatee)
 #define SPECTATE_COPYFIELD(fld) SPECTATE_COPY() { this.(fld) = spectatee.(fld); }
index 1026e3aa7a2dfaa6b0a139c3ad75eca12e141f94..c8f85247c8aa775cd3c63d9d3d2c980800db807f 100644 (file)
@@ -8,11 +8,11 @@
 #include "../common/triggers/triggers.qh"
 
 entityclass(BGMScript);
-class(BGMScript) .string bgmscript;
-class(BGMScript) .float bgmscriptattack;
-class(BGMScript) .float bgmscriptdecay;
-class(BGMScript) .float bgmscriptsustain;
-class(BGMScript) .float bgmscriptrelease;
+classfield(BGMScript) .string bgmscript;
+classfield(BGMScript) .float bgmscriptattack;
+classfield(BGMScript) .float bgmscriptdecay;
+classfield(BGMScript) .float bgmscriptsustain;
+classfield(BGMScript) .float bgmscriptrelease;
 
 #include "../common/constants.qh"
 #include "../lib/csqcmodel/sv_model.qh"