]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
s/make_pure/new_pure/
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 28 Dec 2015 07:45:03 +0000 (18:45 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 28 Dec 2015 07:49:23 +0000 (18:49 +1100)
14 files changed:
qcsrc/client/hud/hud.qh
qcsrc/common/deathtypes/all.qh
qcsrc/common/effects/effect.qh
qcsrc/common/effects/qc/globalsound.qh
qcsrc/common/impulses/all.qh
qcsrc/common/minigames/cl_minigames.qh
qcsrc/common/minigames/sv_minigames.qh
qcsrc/common/mutators/mutator/waypoints/all.qh
qcsrc/common/notifications.qc
qcsrc/common/weapons/all.qh
qcsrc/lib/arraylist.qh
qcsrc/lib/oo.qh
qcsrc/lib/registry.qh
qcsrc/lib/stats.qh

index 0526fccc2aa497ef41e45d1ad1e9e1b34b2884a5..7baed9e91af89a7faac1a9589210f7d14f1e229d 100644 (file)
@@ -12,8 +12,7 @@ REGISTER_REGISTRY(hud_panels)
 
 #define REGISTER_HUD_PANEL(id, draw_func, name, configflags, showflags) \
        void draw_func(); \
-       REGISTER(hud_panels, HUD_PANEL, id, m_id, new(hud_panel)) { \
-               make_pure(this); \
+       REGISTER(hud_panels, HUD_PANEL, id, m_id, new_pure(hud_panel)) { \
                this.panel_id = this.m_id; \
                this.panel_draw = draw_func; \
                this.panel_name = #name; \
index 14304992a2273200878117c54c2eab2397cd80f6..b662b7e76feb041f960def35e8f224b59495bea9 100644 (file)
@@ -15,8 +15,7 @@ REGISTRY_CHECK(Deathtypes)
 int dt_identity(int i) { return i; }
 
 #define REGISTER_DEATHTYPE(id, msg_death, msg_death_by, extra) \
-    REGISTER(Deathtypes, DEATH, id, m_id, new(deathtype)) { \
-        make_pure(this); \
+    REGISTER(Deathtypes, DEATH, id, m_id, new_pure(deathtype)) { \
         this.m_id += DT_FIRST; \
         this.nent_name = #id; \
         this.death_msgextra = extra; \
index 0ae9b489360d84b58df2ecddbef48f9af100ca22..e58d42ca7b4ba55f9ed82af6b623bd1d21a6b883 100644 (file)
@@ -27,8 +27,7 @@
 
 entity Create_Effect_Entity(string eff_name, bool eff_trail)
 {
-       entity this = new(effect_entity);
-       make_pure(this);
+       entity this = new_pure(effect_entity);
        this.eent_eff_name = eff_name;
        this.eent_eff_trail = eff_trail;
        return this;
index 1708f912e67fbd47af8a722b8fa08078efc1c658..1c2aa64612a089652596da6014814890d752de1f 100644 (file)
@@ -10,9 +10,8 @@ REGISTRY(PlayerSounds, BITS(8) - 1)
 #define PlayerSounds_from(i) _PlayerSounds_from(i, NULL)
 #define REGISTER_PLAYERSOUND(id) \
        .string _playersound_##id; \
-       REGISTER(PlayerSounds, playersound, id, m_id, new(PlayerSound)) \
+       REGISTER(PlayerSounds, playersound, id, m_id, new_pure(PlayerSound)) \
        { \
-               make_pure(this); \
                this.m_playersoundstr = #id; \
                this.m_playersoundfld = _playersound_##id; \
        }
@@ -41,9 +40,8 @@ REGISTER_PLAYERSOUND(pain75)
 .int m_playersoundvt;
 #define REGISTER_VOICEMSG(id, vt) \
        .string _playersound_##id; \
-       REGISTER(PlayerSounds, playersound, id, m_id, new(VoiceMessage)) \
+       REGISTER(PlayerSounds, playersound, id, m_id, new_pure(VoiceMessage)) \
        { \
-               make_pure(this); \
                this.instanceOfVoiceMessage = true; \
                this.m_playersoundstr = #id; \
                this.m_playersoundfld = _playersound_##id; \
@@ -86,9 +84,8 @@ REGISTER_VOICEMSG(teamshoot, VOICETYPE_LASTATTACKER)
 REGISTRY(GlobalSounds, BITS(8) - 1)
 #define GlobalSounds_from(i) _GlobalSounds_from(i, NULL)
 #define REGISTER_GLOBALSOUND(id, str) \
-       REGISTER(GlobalSounds, GS, id, m_id, new(GlobalSound)) \
+       REGISTER(GlobalSounds, GS, id, m_id, new_pure(GlobalSound)) \
        { \
-               make_pure(this); \
                this.m_globalsoundstr = str; \
        }
 REGISTER_REGISTRY(GlobalSounds)
index 7f277b63b32fe5c261318856e47d72d4aa87f9b6..433f2318dc4b170c390357fac0328d4a2a5960be 100644 (file)
@@ -20,9 +20,8 @@ REGISTRY_CHECK(IMPULSES)
 
 #define REGISTER_IMPULSE(id, n) _REGISTER_IMPULSE(IMP_##id, id, n)
 #define _REGISTER_IMPULSE(id, alias, n) \
-       REGISTER(IMPULSES, id, m_id, new(Impulse)) \
+       REGISTER(IMPULSES, id, m_id, new_pure(Impulse)) \
        { \
-               make_pure(this); \
                this.impulse = n; \
                IMPULSE_ALIAS(alias, "impulse " #n); \
        }
@@ -205,9 +204,8 @@ LEGACY_IMPULSE(g_waypointeditor_unreachable, 107, "navwaypoint_unreachable")
 
 #define CHIMPULSE(id, n) _CHIMPULSE(CHIMPULSE_##id, n)
 #define _CHIMPULSE(id, n) \
-       REGISTER(IMPULSES, id, m_id, new(Impulse)) \
+       REGISTER(IMPULSES, id, m_id, new_pure(Impulse)) \
        { \
-               make_pure(this); \
                this.impulse = n; \
        }
 
index 3f10e89e93d09c9627e065af7e6533dde76862f7..a97cabbf9923ceb5de5045a1819778c55fec64ae 100644 (file)
@@ -116,7 +116,7 @@ REGISTRY(Minigames, BITS(4))
 REGISTER_REGISTRY(Minigames)
 REGISTRY_CHECK(Minigames)
 #define REGISTER_MINIGAME(name,nicename) \
-    REGISTER(Minigames, MINIGAME_##name, m_id, new(minigame_descriptor)); \
+    REGISTER(Minigames, MINIGAME_##name, m_id, new_pure(minigame_descriptor)); \
     void name##_hud_board(vector, vector); \
     void name##_hud_status(vector, vector); \
     int name##_client_event(entity, string, ...); \
index 2a8496932c177d6b928f85982c2054aa2a00dd00..cde6144162866321be9c8b733a082d093e871f98 100644 (file)
@@ -51,7 +51,7 @@ REGISTRY(Minigames, BITS(4))
 REGISTER_REGISTRY(Minigames)
 REGISTRY_CHECK(Minigames)
 #define REGISTER_MINIGAME(name,nicename) \
-    REGISTER(Minigames, MINIGAME_##name, m_id, new(minigame_descriptor)); \
+    REGISTER(Minigames, MINIGAME_##name, m_id, new_pure(minigame_descriptor)); \
     int name##_server_event(entity, string, ...); \
     REGISTER_INIT_POST(MINIGAME_##name) { \
         make_pure(this); \
index 9693d2809050cb5ff88b7d0072981795dfccb18c..17a103dd448dec20df1a0dafeef5daa2b3314604 100644 (file)
@@ -34,7 +34,7 @@ REGISTER_REGISTRY(RadarIcons)
 REGISTRY_CHECK(RadarIcons)
 
 .int m_radaricon;
-#define REGISTER_RADARICON(id, num) REGISTER(RadarIcons, RADARICON, id, m_id, new(RadarIcon)) { make_pure(this); this.m_radaricon = num; this.netname = #id; }
+#define REGISTER_RADARICON(id, num) REGISTER(RadarIcons, RADARICON, id, m_id, new_pure(RadarIcon)) { this.m_radaricon = num; this.netname = #id; }
 
 REGISTER_WAYPOINT(Null, "", '0 0 0', 1);
 
index 2343206caa18d20596ec8617715aa252a9dcb872..6181edcec817efb32ecabd0ecc7819b19487461a 100644 (file)
@@ -523,8 +523,7 @@ void Create_Notification_Entity(
        // =====================
        //  Global Entity Setup
        // =====================
-       entity notif = spawn();
-       make_pure(notif);
+       entity notif = new_pure(notification);
        switch(typeId)
        {
                case MSG_ANNCE:
index 954c55473fa137ec3d2ffbe431c85aae1dbebd27..742607177dbb2c8c104a3727bf28d0cca6a50e93 100644 (file)
@@ -205,8 +205,7 @@ X(reload_time, float)
             noref entity b = this.baseline; \
             if (!b) \
             { \
-                b = this.baseline = new(baseline); \
-                make_pure(b); \
+                b = this.baseline = new_pure(baseline); \
                 b.baseline_target = this; \
             }
         #ifdef SVQC
index 1209ef5af4f1c1b8ba5b3b86a2cc0d75251b96fe..f9df9e6bfc5c60a97ff5a55d911f3f015914de8b 100644 (file)
@@ -8,8 +8,7 @@ typedef entity ArrayList;
 #define AL_NEW(this, n, default, T) \
        MACRO_BEGIN \
        { \
-               ArrayList _al = this = new(ArrayList); \
-               make_pure(_al); \
+               ArrayList _al = this = new_pure(ArrayList); \
                _al.al_buf = buf_create(); \
                for (int i = 0, _n = _al.al_len = n; i < _n; ++i) \
                { \
index 2f871ccf17a3a6d73191dda69ea7d50f5fdfc7bc..a2cc17e2382101dcdb00daa7d077a6832cbe1f30 100644 (file)
 .string sourceLocFile;
 .int sourceLocLine;
 entity _spawn();
+
+#ifndef SPAWN_PURE
+#define SPAWN_PURE 0
+#endif
+
+#if SPAWN_PURE
+entity spawn_pure() = #600;
+#else
+#define spawn_pure() _spawn()
+#endif
+
 entity __spawn(string _classname, string _sourceFile, int _sourceLine, bool pure)
 {
-       entity this = _spawn();
+       entity this = pure ? spawn_pure() : _spawn();
        this.classname = _classname;
        this.sourceLocFile = _sourceFile;
        this.sourceLocLine = _sourceLine;
index 037cfe193fc4e537197160df56a30ee5fc2b0bd1..344ee83fbe67fea5d8511e44fa68a4cebecabe88 100644 (file)
@@ -81,8 +81,7 @@ REGISTRY(Registries, BITS(8))
 } MACRO_END
 
 #define REGISTRY_RESERVE(registry, fld, id, suffix) MACRO_BEGIN { \
-       entity e = new(registry_reserved); \
-       make_pure(e); \
+       entity e = new_pure(registry_reserved); \
        e.registered_id = #id "/" #suffix; \
        REGISTRY_PUSH(registry, fld, e); \
 } MACRO_END
index 22aff1b63626d25348f132da602849f70656c5dc..7e0dec5b2a3685e4c35f4f4c87b01e6264c35e9c 100644 (file)
@@ -27,9 +27,8 @@ typedef vector vectori;
        #define REGISTER_STAT_2(id, T) \
                T _STAT(id); \
                T CAT(_STAT(id), _prev); \
-               REGISTER(Stats, STAT_##id, m_id, new(stat)) \
+               REGISTER(Stats, STAT_##id, m_id, new_pure(stat)) \
                { \
-                       make_pure(this); \
                        if (#T == "vector" || #T == "vectori") { \
                                REGISTRY_RESERVE(Stats, m_id, STAT_##id, y); \
                                REGISTRY_RESERVE(Stats, m_id, STAT_##id, z); \
@@ -77,9 +76,8 @@ typedef vector vectori;
        #define _STAT(id) stat_##id
        #define REGISTER_STAT_2(id, T) \
                .T _STAT(id); \
-               REGISTER(Stats, STAT_##id, m_id, new(stat)) \
+               REGISTER(Stats, STAT_##id, m_id, new_pure(stat)) \
                { \
-                       make_pure(this); \
                        if (#T == "vector" || #T == "vectori") { \
                                REGISTRY_RESERVE(Stats, m_id, STAT_##id, y); \
                                REGISTRY_RESERVE(Stats, m_id, STAT_##id, z); \