From 76bdf43c2fbbd31091fd71baeba9ade7596d9292 Mon Sep 17 00:00:00 2001 From: black Date: Sun, 27 Jan 2008 17:23:08 +0000 Subject: [PATCH] Pass the name of the instance to Gecko_Query, too. 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 | 3 ++- clvm_cmds.c | 8 ++++---- clvm_cmds.h | 6 +++++- mvm_cmds.c | 14 +++++++------- svvm_cmds.c | 2 ++ 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/cl_gecko.c b/cl_gecko.c index 43ba96e1..aca0cbfb 100644 --- a/cl_gecko.c +++ b/cl_gecko.c @@ -536,7 +536,8 @@ static OSGK_ScriptResult dpGlobal_query (void* objTag, void* methTag, OSGK_String* paramStr, *resultStr; if (!osgk_variant_get_string (strVal, ¶mStr)) 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); diff --git a/clvm_cmds.c b/clvm_cmds.c index cbc95c32..5283ffb6 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -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); diff --git a/clvm_cmds.h b/clvm_cmds.h index 8ec57742..f0813812 100644 --- a/clvm_cmds.h +++ b/clvm_cmds.h @@ -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__ */ diff --git a/mvm_cmds.c b/mvm_cmds.c index 5d142ac8..07cd69e1 100644 --- a/mvm_cmds.c +++ b/mvm_cmds.c @@ -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 diff --git a/svvm_cmds.c b/svvm_cmds.c index 4a0dae56..2d23a5dd 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -149,6 +149,8 @@ char *vm_sv_extensions = "DP_QC_STRREPLACE " "DP_QC_CRC16 " "DP_SV_SHUTDOWN " +"DP_GECKO_SUPPORT " +"DP_QC_GETSURFACEPOINTATTRIBUTE " ; /* -- 2.39.2