X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=svvm_cmds.c;h=4a0dae564bbf61370f3851968ffca03297ea0154;hb=59a9465f1205a694b0a2fbc36000735329b0497e;hp=37d1698525dddc3d07ea17776cd6046ff5547583;hpb=1ca21e57f3f3a57569b977f9b39dc35ff427f61d;p=xonotic%2Fdarkplaces.git diff --git a/svvm_cmds.c b/svvm_cmds.c index 37d16985..4a0dae56 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -147,6 +147,8 @@ char *vm_sv_extensions = "FTE_STRINGS " "DP_CON_BESTWEAPON " "DP_QC_STRREPLACE " +"DP_QC_CRC16 " +"DP_SV_SHUTDOWN " ; /* @@ -181,8 +183,8 @@ static void VM_SV_setorigin (void) SV_LinkEdict (e, false); } - -void SetMinMaxSize (prvm_edict_t *e, float *min, float *max, qboolean rotate) +// TODO: rotate param isnt used.. could be a bug. please check this and remove it if possible [1/10/2008 Black] +static void SetMinMaxSize (prvm_edict_t *e, float *min, float *max, qboolean rotate) { int i; @@ -866,8 +868,7 @@ static void VM_SV_findradius (void) static void VM_SV_precache_sound (void) { VM_SAFEPARMCOUNT(1, VM_SV_precache_sound); - SV_SoundIndex(PRVM_G_STRING(OFS_PARM0), 2); - PRVM_G_INT(OFS_RETURN) = PRVM_G_INT(OFS_PARM0); + PRVM_G_FLOAT(OFS_RETURN) = SV_SoundIndex(PRVM_G_STRING(OFS_PARM0), 2); } static void VM_SV_precache_model (void) @@ -2155,8 +2156,8 @@ static void VM_SV_getsurfacepoint(void) //PF_getsurfacepointattribute, // #486 vector(entity e, float s, float n, float a) getsurfacepointattribute = #486; // float SPA_POSITION = 0; // float SPA_S_AXIS = 1; -// float SPA_R_AXIS = 2; -// float SPA_T_AXIS = 3; // same as SPA_NORMAL +// float SPA_T_AXIS = 2; +// float SPA_R_AXIS = 3; // same as SPA_NORMAL // float SPA_TEXCOORDS0 = 4; // float SPA_LIGHTMAP0_TEXCOORDS = 5; // float SPA_LIGHTMAP0_COLOR = 6; @@ -2168,7 +2169,7 @@ static void VM_SV_getsurfacepointattribute(void) int pointnum; int attributetype; - VM_SAFEPARMCOUNT(3, VM_SV_getsurfacepoint); + VM_SAFEPARMCOUNT(4, VM_SV_getsurfacepoint); VectorClear(PRVM_G_VECTOR(OFS_RETURN)); ed = PRVM_G_EDICT(OFS_PARM0); if (!(model = getmodel(ed)) || !(surface = getsurface(model, (int)PRVM_G_FLOAT(OFS_PARM1)))) @@ -2189,11 +2190,11 @@ static void VM_SV_getsurfacepointattribute(void) case 1: VectorCopy(&(model->surfmesh.data_svector3f + 3 * surface->num_firstvertex)[pointnum * 3], PRVM_G_VECTOR(OFS_RETURN)); break; - // float SPA_R_AXIS = 2; + // float SPA_T_AXIS = 2; case 2: VectorCopy(&(model->surfmesh.data_tvector3f + 3 * surface->num_firstvertex)[pointnum * 3], PRVM_G_VECTOR(OFS_RETURN)); break; - // float SPA_T_AXIS = 3; // same as SPA_NORMAL + // float SPA_R_AXIS = 3; // same as SPA_NORMAL case 3: VectorCopy(&(model->surfmesh.data_normal3f + 3 * surface->num_firstvertex)[pointnum * 3], PRVM_G_VECTOR(OFS_RETURN)); break; @@ -2218,7 +2219,7 @@ static void VM_SV_getsurfacepointattribute(void) // float SPA_LIGHTMAP0_COLOR = 6; case 6: // ignore alpha for now.. - VectorCopy( &(model->surfmesh.data_normal3f + 4 * surface->num_firstvertex)[pointnum * 4], PRVM_G_VECTOR(OFS_RETURN)); + VectorCopy( &(model->surfmesh.data_lightmapcolor4f + 4 * surface->num_firstvertex)[pointnum * 4], PRVM_G_VECTOR(OFS_RETURN)); break; default: VectorSet( PRVM_G_VECTOR(OFS_RETURN), 0.0f, 0.0f, 0.0f ); @@ -2561,7 +2562,8 @@ static void VM_SV_gettagindex (void) { tag_index = SV_GetTagIndex(ent, tag_name); if (tag_index == 0) - Con_DPrintf("gettagindex(entity #%i): tag \"%s\" not found\n", PRVM_NUM_FOR_EDICT(ent), tag_name); + if(developer.integer >= 100) + Con_Printf("gettagindex(entity #%i): tag \"%s\" not found\n", PRVM_NUM_FOR_EDICT(ent), tag_name); } PRVM_G_FLOAT(OFS_RETURN) = tag_index; }; @@ -3303,7 +3305,7 @@ NULL, // #490 NULL, // #491 NULL, // #492 NULL, // #493 -NULL, // #494 +VM_crc16, // #494 float(float caseinsensitive, string s, ...) crc16 = #494 (DP_QC_CRC16) NULL, // #495 NULL, // #496 NULL, // #497 @@ -3320,6 +3322,13 @@ void VM_SV_Cmd_Init(void) void VM_SV_Cmd_Reset(void) { + if(prog->funcoffsets.SV_Shutdown) + { + func_t s = prog->funcoffsets.SV_Shutdown; + prog->funcoffsets.SV_Shutdown = 0; // prevent it from getting called again + PRVM_ExecuteProgram(s,"SV_Shutdown() required"); + } + VM_Cmd_Reset(); }