mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 14:42:13 +00:00
vweps.
added builtin float(float modidx, float framenum) getframeduration = #277; to both csqc and ssqc. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3236 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
3b8c5d74bc
commit
18b617f4a1
17 changed files with 187 additions and 108 deletions
|
@ -2524,6 +2524,9 @@ void CL_ParsePlayerinfo (void)
|
|||
state->viewangles[0] = state->command.angles[0] * (360.0/65536);
|
||||
state->viewangles[1] = state->command.angles[1] * (360.0/65536);
|
||||
state->viewangles[2] = state->command.angles[2] * (360.0/65536);
|
||||
|
||||
if (!(cls.z_ext & Z_EXT_VWEP))
|
||||
state->command.impulse = 0;
|
||||
}
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
|
@ -2744,7 +2747,7 @@ void CL_AddFlagModels (entity_t *ent, int team)
|
|||
VectorInverse(newent->axis[1]);
|
||||
}
|
||||
|
||||
void CL_AddVWeapModel(entity_t *player, int model)
|
||||
void CL_AddVWeapModel(entity_t *player, model_t *model)
|
||||
{
|
||||
entity_t *newent;
|
||||
vec3_t angles;
|
||||
|
@ -2753,7 +2756,7 @@ void CL_AddVWeapModel(entity_t *player, int model)
|
|||
VectorCopy(player->origin, newent->origin);
|
||||
VectorCopy(player->angles, newent->angles);
|
||||
newent->skinnum = player->skinnum;
|
||||
newent->model = cl.model_precache[model];
|
||||
newent->model = model;
|
||||
newent->framestate = player->framestate;
|
||||
|
||||
VectorCopy(newent->angles, angles);
|
||||
|
@ -2881,6 +2884,9 @@ void CL_LinkPlayers (void)
|
|||
ent->forcedshader = NULL;
|
||||
#endif
|
||||
|
||||
if (state->command.impulse && cl.model_precache_vwep[0])
|
||||
ent->model = cl.model_precache_vwep[0];
|
||||
else
|
||||
ent->model = cl.model_precache[state->modelindex];
|
||||
ent->skinnum = state->skinnum;
|
||||
|
||||
|
@ -3003,7 +3009,9 @@ void CL_LinkPlayers (void)
|
|||
else if (state->effects & QWEF_FLAG2)
|
||||
CL_AddFlagModels (ent, 1);
|
||||
else if (info->vweapindex)
|
||||
CL_AddVWeapModel (ent, info->vweapindex);
|
||||
CL_AddVWeapModel (ent, cl.model_precache[info->vweapindex]);
|
||||
else if (state->command.impulse)
|
||||
CL_AddVWeapModel (ent, cl.model_precache_vwep[state->command.impulse]);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -510,6 +510,14 @@ void CL_DownloadFinished(void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < MAX_VWEP_MODELS; i++)
|
||||
{
|
||||
if (!strcmp(cl.model_name_vwep[i], filename))
|
||||
{
|
||||
cl.model_precache_vwep[i] = Mod_ForName(cl.model_name_vwep[i], false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
S_ResetFailedLoad(); //okay, so this can still get a little spammy in bad places...
|
||||
|
||||
|
@ -793,6 +801,17 @@ void Model_CheckDownloads (void)
|
|||
CL_CheckOrEnqueDownloadFile(s, s, (i==1)?DLLF_REQUIRED:0); //world is required to be loaded.
|
||||
CL_CheckModelResources(s);
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_VWEP_MODELS; i++)
|
||||
{
|
||||
s = cl.model_name_vwep[i];
|
||||
|
||||
if (!stricmp(COM_FileExtension(s), "dsp")) //doom sprites are weird, and not really downloadable via this system
|
||||
continue;
|
||||
|
||||
CL_CheckOrEnqueDownloadFile(s, s, 0);
|
||||
CL_CheckModelResources(s);
|
||||
}
|
||||
}
|
||||
|
||||
int CL_LoadModels(int stage, qboolean dontactuallyload)
|
||||
|
@ -911,6 +930,18 @@ int CL_LoadModels(int stage, qboolean dontactuallyload)
|
|||
endstage();
|
||||
}
|
||||
}
|
||||
for (i = 0; i < MAX_VWEP_MODELS; i++)
|
||||
{
|
||||
if (!cl.model_name_vwep[i][0])
|
||||
continue;
|
||||
|
||||
if (atstage())
|
||||
{
|
||||
CSQC_LoadResource(cl.model_name_vwep[i], "model");
|
||||
cl.model_precache_vwep[i] = Mod_ForName (cl.model_name_vwep[i], false);
|
||||
endstage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -4429,9 +4460,21 @@ void CL_ParseStuffCmd(char *msg, int destsplit) //this protects stuffcmds from n
|
|||
Cbuf_AddText ("\n", RESTRICT_SERVER+destsplit);
|
||||
}
|
||||
}
|
||||
else if (!strncmp(stufftext, "//vweap ", 8))
|
||||
else if (!strncmp(stufftext, "//vwep ", 7))
|
||||
{
|
||||
Con_Printf("vweap!: %s\n", stufftext);
|
||||
int i;
|
||||
char *mname;
|
||||
Cmd_TokenizeString(stufftext+7, false, false);
|
||||
for (i = 0; i < Cmd_Argc(); i++)
|
||||
{
|
||||
mname = va("progs/%s.mdl", Cmd_Argv(i));
|
||||
Q_strncpyz(cl.model_name_vwep[i], mname, sizeof(cl.model_name_vwep[i]));
|
||||
if (cls.state == ca_active)
|
||||
{
|
||||
CL_CheckOrEnqueDownloadFile(mname, NULL, 0);
|
||||
cl.model_precache_vwep[i] = Mod_ForName(mname, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!strncmp(stufftext, "//exectrigger ", 14))
|
||||
{
|
||||
|
|
|
@ -551,10 +551,12 @@ typedef struct
|
|||
//
|
||||
// information that is static for the entire time connected to a server
|
||||
//
|
||||
char model_name_vwep[MAX_VWEP_MODELS][MAX_QPATH];
|
||||
char model_name[MAX_MODELS][MAX_QPATH];
|
||||
char sound_name[MAX_SOUNDS][MAX_QPATH];
|
||||
char image_name[Q2MAX_IMAGES][MAX_QPATH];
|
||||
|
||||
struct model_s *model_precache_vwep[MAX_VWEP_MODELS];
|
||||
struct model_s *model_precache[MAX_MODELS];
|
||||
struct sfx_s *sound_precache[MAX_SOUNDS];
|
||||
|
||||
|
@ -1134,7 +1136,8 @@ void SCR_StringToRGB (char *rgbstring, float *rgb, float rgbinputscale);
|
|||
int SCR_StringToPalIndex (char *rgbstring, float rgbinputscale);
|
||||
|
||||
|
||||
void CL_AddVWeapModel(entity_t *player, int model);
|
||||
struct model_s;
|
||||
void CL_AddVWeapModel(entity_t *player, struct model_s *model);
|
||||
|
||||
|
||||
qboolean Media_PlayingFullScreen(void);
|
||||
|
|
|
@ -134,6 +134,7 @@ extern void FNC(Mod_NowLoadExternal) (void);
|
|||
extern void FNC(Mod_Think) (void);
|
||||
extern int FNC(Mod_SkinForName) (struct model_s *model, char *name);
|
||||
extern int FNC(Mod_FrameForName) (struct model_s *model, char *name);
|
||||
extern float FNC(Mod_GetFrameDuration) (struct model_s *model, int framenum);
|
||||
|
||||
#undef FNC
|
||||
|
||||
|
@ -223,6 +224,7 @@ typedef struct {
|
|||
int (*Mod_TagNumForName) (struct model_s *model, char *name);
|
||||
int (*Mod_SkinForName) (struct model_s *model, char *name);
|
||||
int (*Mod_FrameForName) (struct model_s *model, char *name);
|
||||
float (*Mod_GetFrameDuration) (struct model_s *model, int frame);
|
||||
|
||||
|
||||
qboolean (*VID_Init) (rendererstate_t *info, unsigned char *palette);
|
||||
|
|
|
@ -1365,6 +1365,9 @@ void MasterInfo_Begin(void)
|
|||
Master_AddMaster("195.74.0.8", MT_MASTERQW, "unknown2 master server.");
|
||||
Master_AddMaster("204.182.161.2", MT_MASTERQW, "unknown5 master server.");
|
||||
|
||||
Master_AddMaster("asgaard.morphos-team.net:27000",MT_MASTERQW, "Asgaard");
|
||||
Master_AddMaster("master.quakeservers.net:27000",MT_MASTERQW, "QuakeServers.net");
|
||||
|
||||
Master_AddMaster("255.255.255.255:27500", MT_BCASTQW, "Nearby QuakeWorld UDP servers.");
|
||||
}
|
||||
|
||||
|
|
|
@ -3627,6 +3627,17 @@ static void PF_frameforname (progfuncs_t *prinst, struct globalvars_s *pr_global
|
|||
else
|
||||
G_FLOAT(OFS_RETURN) = -1;
|
||||
}
|
||||
static void PF_frameduration (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
int modelindex = G_FLOAT(OFS_PARM0);
|
||||
char *str = PF_VarString(prinst, 1, pr_globals);
|
||||
model_t *mod = CSQC_GetModelForIndex(modelindex);
|
||||
|
||||
if (mod && Mod_GetFrameDuration)
|
||||
G_FLOAT(OFS_RETURN) = Mod_GetFrameDuration(mod, str);
|
||||
else
|
||||
G_FLOAT(OFS_RETURN) = 0;
|
||||
}
|
||||
static void PF_skinforname (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
int modelindex = G_FLOAT(OFS_PARM0);
|
||||
|
@ -5126,6 +5137,7 @@ static struct {
|
|||
{"skel_copybones", PF_skel_copybones, 274},//void(float skeldst, float skelsrc, float startbone, float entbone) skel_copybones = #273; // (FTE_CSQC_SKELETONOBJECTS)
|
||||
{"skel_delete", PF_skel_delete, 275},//void(float skel) skel_delete = #274; // (FTE_CSQC_SKELETONOBJECTS)
|
||||
{"frameforname", PF_frameforname, 276},//void(float modidx, string framename) frameforname = #275 (FTE_CSQC_SKELETONOBJECTS)
|
||||
{"frameduration", PF_frameduration, 277},//void(float modidx, float framenum) frameduration = #276 (FTE_CSQC_SKELETONOBJECTS)
|
||||
|
||||
//300
|
||||
{"clearscene", PF_R_ClearScene, 300}, // #300 void() clearscene (EXT_CSQC)
|
||||
|
|
|
@ -384,6 +384,7 @@ void GLMod_Init (void);
|
|||
int Mod_TagNumForName(struct model_s *model, char *name);
|
||||
int Mod_SkinNumForName(struct model_s *model, char *name);
|
||||
int Mod_FrameNumForName(struct model_s *model, char *name);
|
||||
float Mod_FrameDuration(struct model_s *model, int frameno);
|
||||
|
||||
void GLMod_ClearAll (void);
|
||||
struct model_s *GLMod_ForName (char *name, qboolean crash);
|
||||
|
|
|
@ -788,6 +788,7 @@ void (*Mod_Think) (void);
|
|||
//int (*Mod_TagNumForName) (struct model_s *model, char *name);
|
||||
int (*Mod_SkinForName) (struct model_s *model, char *name);
|
||||
int (*Mod_FrameForName) (struct model_s *model, char *name);
|
||||
float (*Mod_GetFrameDuration) (struct model_s *model, int framenum);
|
||||
|
||||
|
||||
|
||||
|
@ -882,6 +883,12 @@ rendererinfo_t dedicatedrendererinfo = {
|
|||
|
||||
SWMod_NowLoadExternal,
|
||||
SWMod_Think,
|
||||
|
||||
NULL, //Mod_GetTag
|
||||
NULL, //fixme: server will need this one at some point.
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
#elif defined(RGLQUAKE) || defined(D3DQUAKE)
|
||||
GLMod_Init,
|
||||
GLMod_ClearAll,
|
||||
|
@ -892,14 +899,16 @@ rendererinfo_t dedicatedrendererinfo = {
|
|||
|
||||
GLMod_NowLoadExternal,
|
||||
GLMod_Think,
|
||||
#else
|
||||
#error "Need logic here!"
|
||||
#endif
|
||||
|
||||
NULL, //Mod_GetTag
|
||||
NULL, //fixme: server will need this one at some point.
|
||||
NULL,
|
||||
NULL,
|
||||
Mod_FrameDuration,
|
||||
|
||||
#else
|
||||
#error "Need logic here!"
|
||||
#endif
|
||||
|
||||
NULL, //VID_Init,
|
||||
NULL, //VID_DeInit,
|
||||
|
@ -994,6 +1003,7 @@ rendererinfo_t softwarerendererinfo = {
|
|||
NULL, //Mod_TagForName
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
||||
SWVID_Init,
|
||||
SWVID_Shutdown,
|
||||
|
@ -1092,6 +1102,7 @@ rendererinfo_t openglrendererinfo = {
|
|||
Mod_TagNumForName,
|
||||
Mod_SkinNumForName,
|
||||
Mod_FrameNumForName,
|
||||
Mod_FrameDuration,
|
||||
|
||||
GLVID_Init,
|
||||
GLVID_DeInit,
|
||||
|
@ -1548,6 +1559,8 @@ void R_SetRenderer(int wanted)
|
|||
// Mod_GetTag = ri->Mod_GetTag;
|
||||
// Mod_TagNumForName = ri->Mod_TagNumForName;
|
||||
Mod_SkinForName = ri->Mod_SkinForName;
|
||||
Mod_FrameForName = ri->Mod_FrameForName;
|
||||
Mod_GetFrameDuration = ri->Mod_GetFrameDuration;
|
||||
|
||||
SCR_UpdateScreen = ri->SCR_UpdateScreen;
|
||||
}
|
||||
|
|
|
@ -394,6 +394,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define MAX_STANDARDLIGHTSTYLES 64
|
||||
#define MAX_MODELS 512 // these are sent over the net as bytes
|
||||
#define MAX_SOUNDS 512 // so they cannot be blindly increased
|
||||
#define MAX_VWEP_MODELS 32
|
||||
|
||||
#define MAX_CSQCMODELS 256 // these live entirly clientside
|
||||
|
||||
|
|
|
@ -2835,9 +2835,9 @@ int Mod_FrameNumForName(model_t *model, char *name)
|
|||
|
||||
inf = Mod_Extradata(model);
|
||||
|
||||
for (i = 0; i < model->numframes; i++)
|
||||
{
|
||||
group = (galiasgroup_t*)((char*)inf + inf->groupofs);
|
||||
for (i = 0; i < inf->groups; i++, group++)
|
||||
{
|
||||
if (!strcmp(group->name, name))
|
||||
return i;
|
||||
}
|
||||
|
@ -2863,6 +2863,23 @@ int Mod_SkinNumForName(model_t *model, char *name)
|
|||
|
||||
return -1;
|
||||
}
|
||||
|
||||
float Mod_FrameDuration(model_t *model, int frameno)
|
||||
{
|
||||
int i;
|
||||
galiasinfo_t *inf;
|
||||
galiasgroup_t *group;
|
||||
|
||||
if (!model || model->type != mod_alias)
|
||||
return 0;
|
||||
inf = Mod_Extradata(model);
|
||||
|
||||
group = (galiasgroup_t*)((char*)inf + inf->groupofs);
|
||||
if (frameno < 0 || frameno >= inf->groups)
|
||||
return 0;
|
||||
group += frameno;
|
||||
return group->numposes/group->rate;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define Z_EXT_VWEP (1<<7)
|
||||
//#define Z_EXT_PF_SOLID (1<<8) //conflicts with many FTE extensions.
|
||||
|
||||
#define SUPPORTED_Z_EXTENSIONS (Z_EXT_PM_TYPE|Z_EXT_PM_TYPE_NEW|Z_EXT_VIEWHEIGHT|Z_EXT_SERVERTIME|Z_EXT_PITCHLIMITS|Z_EXT_JOIN_OBSERVE)
|
||||
#define SUPPORTED_Z_EXTENSIONS (Z_EXT_PM_TYPE|Z_EXT_PM_TYPE_NEW|Z_EXT_VIEWHEIGHT|Z_EXT_SERVERTIME|Z_EXT_PITCHLIMITS|Z_EXT_JOIN_OBSERVE|Z_EXT_VWEP)
|
||||
|
||||
|
||||
#define PROTOCOL_VERSION_FTE (('F'<<0) + ('T'<<8) + ('E'<<16) + ('X' << 24)) //fte extensions.
|
||||
|
|
|
@ -688,51 +688,6 @@ void (D3D7_R_LessenStains) (void)
|
|||
{
|
||||
}
|
||||
|
||||
void (D3D7_Mod_Init) (void)
|
||||
{
|
||||
}
|
||||
void (D3D7_Mod_ClearAll) (void)
|
||||
{
|
||||
}
|
||||
struct model_s *(D3D7_Mod_ForName) (char *name, qboolean crash)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
struct model_s *(D3D7_Mod_FindName) (char *name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
void *(D3D7_Mod_Extradata) (struct model_s *mod)
|
||||
{
|
||||
return NULL;
|
||||
} // handles caching
|
||||
void (D3D7_Mod_TouchModel) (char *name)
|
||||
{
|
||||
}
|
||||
|
||||
void (D3D7_Mod_NowLoadExternal) (void)
|
||||
{
|
||||
}
|
||||
void (D3D7_Mod_Think) (void)
|
||||
{
|
||||
}
|
||||
qboolean(D3D7_Mod_GetTag) (struct model_s *model, int tagnum, framestate_t *fstate, float *result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int (D3D7_Mod_TagNumForName) (struct model_s *model, char *name)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int (D3D7_Mod_SkinForName) (struct model_s *model, char *name)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int (D3D7_Mod_FrameForName) (struct model_s *model, char *name)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void (D3D7_VID_DeInit) (void)
|
||||
{
|
||||
if (pPrimary)
|
||||
|
@ -1094,7 +1049,6 @@ void (D3D7_Mod_TouchModel) (char *name);
|
|||
|
||||
void (D3D7_Mod_NowLoadExternal) (void);
|
||||
void (D3D7_Mod_Think) (void);
|
||||
qboolean(D3D7_Mod_GetTag) (struct model_s *model, int tagnum, int frame1, int frame2, float f2ness, float f1time, float f2time, float *result);
|
||||
int (D3D7_Mod_TagNumForName) (struct model_s *model, char *name);
|
||||
int (D3D7_Mod_SkinForName) (struct model_s *model, char *name);
|
||||
|
||||
|
@ -1186,10 +1140,11 @@ rendererinfo_t d3d7rendererinfo =
|
|||
|
||||
GLMod_NowLoadExternal,
|
||||
GLMod_Think,
|
||||
D3D7_Mod_GetTag,
|
||||
D3D7_Mod_TagNumForName,
|
||||
D3D7_Mod_SkinForName,
|
||||
D3D7_Mod_FrameForName,
|
||||
Mod_GetTag,
|
||||
Mod_TagNumForName,
|
||||
Mod_SkinNumForName,
|
||||
Mod_FrameNumForName,
|
||||
Mod_FrameDuration,
|
||||
|
||||
|
||||
D3D7_VID_Init,
|
||||
|
|
|
@ -864,44 +864,6 @@ void (D3D9_R_LessenStains) (void)
|
|||
{
|
||||
}
|
||||
|
||||
void (D3D9_Mod_Init) (void)
|
||||
{
|
||||
}
|
||||
void (D3D9_Mod_ClearAll) (void)
|
||||
{
|
||||
}
|
||||
struct model_s *(D3D9_Mod_ForName) (char *name, qboolean crash)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
struct model_s *(D3D9_Mod_FindName) (char *name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
void *(D3D9_Mod_Extradata) (struct model_s *mod)
|
||||
{
|
||||
return NULL;
|
||||
} // handles caching
|
||||
void (D3D9_Mod_TouchModel) (char *name)
|
||||
{
|
||||
}
|
||||
|
||||
void (D3D9_Mod_NowLoadExternal) (void)
|
||||
{
|
||||
}
|
||||
void (D3D9_Mod_Think) (void)
|
||||
{
|
||||
}
|
||||
|
||||
int (D3D9_Mod_SkinForName) (struct model_s *model, char *name)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int (D3D9_Mod_FrameForName) (struct model_s *model, char *name)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void (D3D9_VID_DeInit) (void)
|
||||
{
|
||||
if (pD3DDev9)
|
||||
|
@ -1452,8 +1414,9 @@ rendererinfo_t d3d9rendererinfo =
|
|||
GLMod_Think,
|
||||
Mod_GetTag,
|
||||
Mod_TagNumForName,
|
||||
D3D9_Mod_SkinForName,
|
||||
D3D9_Mod_FrameForName,
|
||||
Mod_SkinNumForName,
|
||||
Mod_FrameNumForName,
|
||||
Mod_FrameDuration,
|
||||
|
||||
|
||||
D3D9_VID_Init,
|
||||
|
|
|
@ -4143,8 +4143,9 @@ rendererinfo_t d3drendererinfo = {
|
|||
|
||||
Mod_GetTag,
|
||||
Mod_TagNumForName,
|
||||
NULL,
|
||||
NULL,
|
||||
Mod_SkinForName,
|
||||
Mod_FrameForName,
|
||||
Mod_GetFrameDuration,
|
||||
|
||||
D3DVID_Init,
|
||||
GLVID_DeInit,
|
||||
|
|
|
@ -1990,6 +1990,50 @@ void PF_set_puzzle_model (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
PF_setmodel_Internal(prinst, e, fullname);
|
||||
}
|
||||
|
||||
static void PF_frameforname (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
unsigned int modelindex = G_FLOAT(OFS_PARM0);
|
||||
char *str = PF_VarString(prinst, 1, pr_globals);
|
||||
model_t *mod = (modelindex>= MAX_MODELS)?NULL:sv.models[modelindex];
|
||||
|
||||
if (mod && Mod_FrameForName)
|
||||
G_FLOAT(OFS_RETURN) = Mod_FrameForName(mod, str);
|
||||
else
|
||||
G_FLOAT(OFS_RETURN) = -1;
|
||||
}
|
||||
static void PF_frameduration (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
unsigned int modelindex = G_FLOAT(OFS_PARM0);
|
||||
unsigned int framenum = G_FLOAT(OFS_PARM1);
|
||||
model_t *mod;
|
||||
|
||||
if (modelindex >= MAX_MODELS)
|
||||
G_FLOAT(OFS_RETURN) = 0;
|
||||
else
|
||||
{
|
||||
mod = sv.models[modelindex];
|
||||
if (!mod)
|
||||
mod = sv.models[modelindex] = Mod_ForName(sv.strings.model_precache[modelindex], false);
|
||||
|
||||
if (mod && Mod_GetFrameDuration)
|
||||
G_FLOAT(OFS_RETURN) = Mod_GetFrameDuration(mod, framenum);
|
||||
else
|
||||
G_FLOAT(OFS_RETURN) = 0;
|
||||
}
|
||||
}
|
||||
static void PF_skinforname (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
unsigned int modelindex = G_FLOAT(OFS_PARM0);
|
||||
char *str = PF_VarString(prinst, 1, pr_globals);
|
||||
model_t *mod = (modelindex>= MAX_MODELS)?NULL:sv.models[modelindex];
|
||||
|
||||
|
||||
if (mod && Mod_SkinForName)
|
||||
G_FLOAT(OFS_RETURN) = Mod_SkinForName(mod, str);
|
||||
else
|
||||
G_FLOAT(OFS_RETURN) = -1;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PF_bprint
|
||||
|
@ -9126,6 +9170,7 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
|
|||
{"globalstat", PF_globalstat, 0, 0, 0, 233}, //EXT_CSQC_1 actually
|
||||
//END EXT_CSQC
|
||||
{"isbackbuffered", PF_isbackbuffered, 0, 0, 0, 234},
|
||||
{"skinforname", PF_skinforname, 0, 0, 0, 237}, // #237
|
||||
{"te_bloodqw", PF_te_bloodqw, 0, 0, 0, 239},
|
||||
|
||||
{"checkpvs", PF_checkpvs, 0, 0, 0, 240},
|
||||
|
@ -9151,6 +9196,10 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
|
|||
{"stoh", PF_stoh, 0, 0, 0, 261},
|
||||
{"htos", PF_htos, 0, 0, 0, 262},
|
||||
|
||||
{"frameforname", PF_frameforname, 0, 0, 0, 276},//void(float modidx, string framename) frameforname = #276 (FTE_CSQC_SKELETONOBJECTS)
|
||||
{"frameduration", PF_frameduration, 0, 0, 0, 277},//float(float modidx, float framenum) frameduration = #277 (FTE_CSQC_SKELETONOBJECTS)
|
||||
|
||||
|
||||
//EXT_CSQC
|
||||
// {"setmodelindex", PF_sv_SetModelIndex,0, 0, 0, 333}, // #333 void(entity e, float mdlindex) setmodelindex (EXT_CSQC)
|
||||
// {"modelnameforindex",PF_sv_ModelnameForIndex,0, 0, 0, 334}, // #334 string(float mdlindex) modelnameforindex (EXT_CSQC)
|
||||
|
|
|
@ -137,7 +137,7 @@ typedef enum
|
|||
G_MAKEVECTORS,
|
||||
G_NEXTCLIENT,
|
||||
|
||||
G_PRECAHCE_VWEP_MODEL,
|
||||
G_PRECACHE_VWEP_MODEL,
|
||||
G_SETPAUSE,
|
||||
G_SETUSERINFO,
|
||||
G_MOVETOGOAL,
|
||||
|
@ -502,13 +502,14 @@ void PF_ExecuteCommand (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
|||
void PF_setspawnparms (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_walkmove (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_ForceInfoKey(progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_precache_vwep_model(progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
|
||||
|
||||
int PF_checkclient_Internal (progfuncs_t *prinst);
|
||||
void PF_precache_sound_Internal (progfuncs_t *prinst, char *s);
|
||||
void PF_precache_model_Internal (progfuncs_t *prinst, char *s);
|
||||
void PF_setmodel_Internal (progfuncs_t *prinst, edict_t *e, char *m);
|
||||
char *PF_infokey_Internal (int entnum, char *value);
|
||||
char *PF_infokey_Internal (int entnum, char *value);;
|
||||
|
||||
static int WrapQCBuiltin(builtin_t func, void *offset, unsigned int mask, const int *arg, char *argtypes)
|
||||
{
|
||||
|
@ -816,6 +817,13 @@ static int syscallqvm (void *offset, unsigned int mask, int fn, const int *arg)
|
|||
case G_LOGFRAG:
|
||||
WrapQCBuiltin(PF_logfrag, offset, mask, arg, "nn");
|
||||
break;
|
||||
case G_PRECACHE_VWEP_MODEL:
|
||||
{
|
||||
int i = WrapQCBuiltin(PF_precache_vwep_model, offset, mask, arg, "s");
|
||||
float f = *(float*)&i;
|
||||
return f;
|
||||
}
|
||||
break;
|
||||
|
||||
case G_GETINFOKEY:
|
||||
{
|
||||
|
|
|
@ -931,7 +931,7 @@ void SV_Modellist_f (void)
|
|||
if (n == 0 && (host_client->zquake_extensions & Z_EXT_VWEP))
|
||||
{
|
||||
char mname[MAX_QPATH];
|
||||
char vweaplist[1024] = "//vweap";
|
||||
char vweaplist[1024] = "//vwep";
|
||||
int pos = strlen(vweaplist);
|
||||
|
||||
for (i = 0; sv.strings.vw_model_precache[i]; i++)
|
||||
|
|
Loading…
Reference in a new issue