]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - clvm_cmds.c
Gecko resizing support
[xonotic/darkplaces.git] / clvm_cmds.c
index 9afd7812cdf3c20dcf81592b0ce499ecb3502dc6..478bcabe9b042e7e3b8a97df3b445f85a062bb5b 100644 (file)
@@ -1,3 +1,5 @@
+#include "quakedef.h"
+
 #include "prvm_cmds.h"
 #include "csprogs.h"
 #include "cl_collision.h"
@@ -22,7 +24,7 @@ void Sbar_SortFrags (void);
 void CL_FindNonSolidLocation(const vec3_t in, vec3_t out, vec_t radius);
 void CSQC_RelinkAllEntities (int drawmask);
 void CSQC_RelinkCSQCEntities (void);
-char *Key_GetBind (int key);
+const char *Key_GetBind (int key);
 
 
 
@@ -344,7 +346,7 @@ static void VM_CL_precache_model (void)
        VM_SAFEPARMCOUNT(1, VM_CL_precache_model);
 
        name = PRVM_G_STRING(OFS_PARM0);
-       for (i = 1;i < MAX_MODELS && cl.csqc_model_precache[i];i++)
+       for (i = 0;i < MAX_MODELS && cl.csqc_model_precache[i];i++)
        {
                if(!strcmp(cl.csqc_model_precache[i]->name, name))
                {
@@ -356,7 +358,7 @@ static void VM_CL_precache_model (void)
        m = Mod_ForName(name, false, false, false);
        if(m && m->loaded)
        {
-               for (i = 1;i < MAX_MODELS;i++)
+               for (i = 0;i < MAX_MODELS;i++)
                {
                        if (!cl.csqc_model_precache[i])
                        {
@@ -1652,7 +1654,7 @@ static void VM_CL_te_explosion2 (void)
        colorLength = (int)PRVM_G_FLOAT(OFS_PARM2);
        CL_FindNonSolidLocation(pos, pos2, 10);
        CL_ParticleExplosion2(pos2, colorStart, colorLength);
-       tempcolor = (unsigned char *)&palette_complete[(rand()%colorLength) + colorStart];
+       tempcolor = palette_rgb[(rand()%colorLength) + colorStart];
        color[0] = tempcolor[0] * (2.0f / 255.0f);
        color[1] = tempcolor[1] * (2.0f / 255.0f);
        color[2] = tempcolor[2] * (2.0f / 255.0f);
@@ -3076,8 +3078,8 @@ VM_drawfill,                                      // #323 float(vector position, vector size, vector rgb, float a
 VM_drawsetcliparea,                            // #324 void(float x, float y, float width, float height) drawsetcliparea
 VM_drawresetcliparea,                  // #325 void(void) drawresetcliparea
 VM_drawcolorcodedstring,               // #326 float drawcolorcodedstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) (EXT_CSQC)
-NULL,                                                  // #327
-NULL,                                                  // #328
+NULL,                                                  // #327 // FIXME add stringwidth() here?
+NULL,                                                  // #328 // FIXME add drawsubpic() here?
 NULL,                                                  // #329
 VM_CL_getstatf,                                        // #330 float(float stnum) getstatf (EXT_CSQC)
 VM_CL_getstati,                                        // #331 float(float stnum) getstati (EXT_CSQC)
@@ -3234,14 +3236,22 @@ VM_strtolower,                                  // #480 string(string s) VM_strtolower (DP_QC_STRING_CASE_FUN
 VM_strtoupper,                                 // #481 string(string s) VM_strtoupper (DP_QC_STRING_CASE_FUNCTIONS)
 VM_cvar_defstring,                             // #482 string(string s) cvar_defstring (DP_QC_CVAR_DEFSTRING)
 VM_CL_pointsound,                              // #483 void(vector origin, string sample, float volume, float attenuation) (DP_SV_POINTSOUND)
-NULL,                                                  // #484
-NULL,                                                  // #485
+VM_strreplace,                                 // #484 string(string search, string replace, string subject) strreplace (DP_QC_STRREPLACE)
+VM_strireplace,                                        // #485 string(string search, string replace, string subject) strireplace (DP_QC_STRREPLACE)
 NULL,                                                  // #486
-NULL,                                                  // #487
-NULL,                                                  // #488
-NULL,                                                  // #489
-NULL,                                                  // #490
-NULL,                                                  // #491
+#ifdef SUPPORT_GECKO
+VM_gecko_create,                                       // #487
+VM_gecko_destroy,                                      // #488
+VM_gecko_navigate,                             // #489
+VM_gecko_keyevent,                             // #490
+VM_gecko_movemouse,                            // #491
+#else
+NULL,                                                                  // #487
+NULL,                                                                  // #488
+NULL,                                                                  // #489
+NULL,                                                                  // #490
+NULL,                                                                  // #491
+#endif
 NULL,                                                  // #492
 NULL,                                                  // #493
 NULL,                                                  // #494