Pass the name of the instance to Gecko_Query, too.
authorblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 27 Jan 2008 17:23:08 +0000 (17:23 +0000)
committerblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 27 Jan 2008 17:23:08 +0000 (17:23 +0000)
Add setattachment, gettaginfo and gettagindex to menu builtin list, too.
Add DP_GECKO_SUPPORT and DP_QC_GETSURFACEPOINTATTRIB to dpextensions.qc.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8025 d7cf8633-e32d-0410-b094-e92efae38249

cl_gecko.c
clvm_cmds.c
clvm_cmds.h
mvm_cmds.c
svvm_cmds.c

index 43ba96e..aca0cbf 100644 (file)
@@ -536,7 +536,8 @@ static OSGK_ScriptResult dpGlobal_query (void* objTag, void* methTag,
     OSGK_String* paramStr, *resultStr;
 
     if (!osgk_variant_get_string (strVal, &paramStr)) return srFailed;
-    *((string_t*)&prog->globals.generic[OFS_PARM0]) = PRVM_SetTempString (osgk_string_get (paramStr));
+        PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString (instance->name);
+        PRVM_G_INT(OFS_PARM1) = PRVM_SetTempString (osgk_string_get (paramStr));
     PRVM_ExecuteProgram(prog->funcoffsets.Gecko_Query,"Gecko_Query() required");
     resultStr = osgk_string_create (PRVM_G_STRING (OFS_RETURN));
     *returnVal = osgk_variant_create_string (cl_geckoembedding, resultStr);
index cbc95c3..5283ffb 100644 (file)
@@ -1988,7 +1988,7 @@ static void VM_CL_getsurfaceclippedpoint(void)
 }
 
 // #443 void(entity e, entity tagentity, string tagname) setattachment
-static void VM_CL_setattachment (void)
+void VM_CL_setattachment (void)
 {
        prvm_edict_t *e;
        prvm_edict_t *tagentity;
@@ -2180,7 +2180,7 @@ int CL_GetTagMatrix (matrix4x4_t *out, prvm_edict_t *ent, int tagindex)
 }
 
 // #451 float(entity ent, string tagname) gettagindex (DP_QC_GETTAGINFO)
-static void VM_CL_gettagindex (void)
+void VM_CL_gettagindex (void)
 {
        prvm_edict_t *ent;
        const char *tag_name;
@@ -2215,7 +2215,7 @@ static void VM_CL_gettagindex (void)
 }
 
 // #452 vector(entity ent, float tagindex) gettaginfo (DP_QC_GETTAGINFO)
-static void VM_CL_gettaginfo (void)
+void VM_CL_gettaginfo (void)
 {
        prvm_edict_t *e;
        int tagindex;
@@ -2451,7 +2451,7 @@ void VM_CL_R_PolygonBegin (void)
                VM_InitPolygons(polys);
        if (polys->begin_active)
        {
-               VM_Warning("VM_CL_R_PolygonBegin: called twice without VM_CL_R_PolygonEnd after first\n");
+               VM_Warning("VM_CL_R_PolygonBegin: called twice without VM_CL_R_PolygonBegin after first\n");
                return;
        }
        picname = PRVM_G_STRING(OFS_PARM0);
index 8ec5774..f081381 100644 (file)
@@ -22,6 +22,10 @@ void VM_CL_R_PolygonBegin (void);
 void VM_CL_R_PolygonVertex (void);
 void VM_CL_R_PolygonEnd (void);
 /* VMs exposing the polygon calls must call this on Init/Reset */
-void VM_Polygons_Reset();
+void VM_Polygons_Reset(void);
+
+void VM_CL_setattachment(void);
+void VM_CL_gettagindex(void);
+void VM_CL_gettaginfo(void);
 
 #endif /* __CLVM_CMDS_H__ */
index 5d142ac..07cd69e 100644 (file)
@@ -20,9 +20,8 @@ char *vm_m_extensions =
 "DP_QC_CMD "
 "DP_QC_STRREPLACE "
 "DP_FONT_VARIABLEWIDTH "
-// FIXME: rename this extension maybe? [12/5/2007 Black]
 "DP_GECKO_SUPPORT "
-"DP_QC_RENDER_SCENE"
+"DP_QC_RENDER_SCENE "
 "DP_QC_STRINGBUFFERS "
 "DP_QC_CRC16 "
 "FTE_STRINGS "
@@ -1092,13 +1091,14 @@ VM_CL_R_AddEntity,                              // #302 void(entity ent) addentity (DP_QC_RENDER_SCENE)
 VM_CL_R_SetView,                               // #303 float(float property, ...) setproperty (DP_QC_RENDER_SCENE)
 VM_CL_R_RenderScene,                   // #304 void() renderscene (DP_QC_RENDER_SCENE)
 VM_CL_R_AddDynamicLight,               // #305 void(vector org, float radius, vector lightcolours) adddynamiclight (DP_QC_RENDER_SCENE)
-VM_CL_R_PolygonBegin,                  // #306 void(string texturename, float flag[, float is2d, float lines]) R_BeginPolygon
-VM_CL_R_PolygonVertex,                 // #307 void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex
+VM_CL_R_PolygonBegin,                  // #306 void(string texturename, float flag[, float is2d, float lines]) R_BeginPolygon (DP_QC_RENDER_SCENE)
+VM_CL_R_PolygonVertex,                 // #307 void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex (DP_QC_RENDER_SCENE)
 VM_CL_R_PolygonEnd,                            // #308 void() R_EndPolygon
 NULL/*VM_CL_R_LoadWorldModel*/,                                // #309 void(string modelname) R_LoadWorldModel
-NULL,                                                                  // #310
-NULL,                                                                  // #311
-NULL,                                                                  // #312
+// TODO: rearrange and merge all builtin lists and share as many extensions as possible between all VM instances [1/27/2008 Andreas]
+VM_CL_setattachment,                           // #310 void(entity e, entity tagentity, string tagname) setattachment (DP_GFX_QUAKE3MODELTAGS) (DP_QC_RENDER_SCENE)
+VM_CL_gettagindex,                             // #311 float(entity ent, string tagname) gettagindex (DP_QC_GETTAGINFO) (DP_QC_RENDER_SCENE)
+VM_CL_gettaginfo,                                      // #312 vector(entity ent, float tagindex) gettaginfo (DP_QC_GETTAGINFO) (DP_QC_RENDER_SCENE)
 NULL,                                                                  // #313
 NULL,                                                                  // #314
 NULL,                                                                  // #315
index 4a0dae5..2d23a5d 100644 (file)
@@ -149,6 +149,8 @@ char *vm_sv_extensions =
 "DP_QC_STRREPLACE "
 "DP_QC_CRC16 "
 "DP_SV_SHUTDOWN "
+"DP_GECKO_SUPPORT "
+"DP_QC_GETSURFACEPOINTATTRIBUTE "
 ;
 
 /*