]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
ArrayList: redefine builtins so they can be profiled separately
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 23 Dec 2015 23:56:42 +0000 (10:56 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 23 Dec 2015 23:56:42 +0000 (10:56 +1100)
qcsrc/lib/arraylist.qh

index a560474174c3ef742ebe2b711d7fe2142643e2ef..1209ef5af4f1c1b8ba5b3b86a2cc0d75251b96fe 100644 (file)
@@ -30,13 +30,35 @@ typedef entity ArrayList;
 #define AL_gets(this, idx) bufstr_get(this.al_buf, idx)
 #define AL_sets(this, idx, val) bufstr_set(this.al_buf, idx, val)
 
+#if defined(CSQC)
+string al_ftos(float f) = #26;
+float al_stof(string s) = #81;
+#elif defined(SVQC)
+string al_ftos(float f) = #26;
+float al_stof(string s) = #81;
+#elif defined(MENUQC)
+string al_ftos(float f) = #17;
+float al_stof(string s) = #21;
+#endif
+
 #define _AL_type__f() float
-#define AL_getf(this, idx) stof(AL_gets(this, idx))
-#define AL_setf(this, idx, val) AL_sets(this, idx, ftos(val))
+#define AL_getf(this, idx) al_stof(AL_gets(this, idx))
+#define AL_setf(this, idx, val) AL_sets(this, idx, al_ftos(val))
+
+#if defined(CSQC)
+int al_etof(entity e) = #512;
+entity al_ftoe(int i) = #459;
+#elif defined(SVQC)
+int al_etof(entity e) = #512;
+entity al_ftoe(int i) = #459;
+#elif defined(MENUQC)
+int al_etof(entity e) = #79;
+entity al_ftoe(int i) = #80;
+#endif
 
 #define _AL_type__e() entity
-#define AL_gete(this, idx) ftoe(AL_getf(this, idx))
-#define AL_sete(this, idx, val) AL_setf(this, idx, etof(val))
+#define AL_gete(this, idx) al_ftoe(AL_getf(this, idx))
+#define AL_sete(this, idx, val) AL_setf(this, idx, al_etof(val))
 
 #define AL_EACH(this, T, cond, body) \
        MACRO_BEGIN \