mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-26 13:50:53 +00:00
custom tent change
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@74 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
4df881b0c9
commit
fe53615900
3 changed files with 26 additions and 1 deletions
|
@ -804,12 +804,14 @@ typedef struct {
|
|||
vec3_t dlightrgb;
|
||||
float dlightradius;
|
||||
float dlighttime;
|
||||
vec3_t dlightcfade;
|
||||
} clcustomtents_t;
|
||||
|
||||
#define CTE_CUSTOMCOUNT 1
|
||||
#define CTE_CUSTOMDIRECTION 2
|
||||
#define CTE_STAINS 4
|
||||
#define CTE_GLOWS 8
|
||||
#define CTE_CHANNELFADE 16
|
||||
#define CTE_ISBEAM 128
|
||||
|
||||
clcustomtents_t customtenttype[255]; //network based.
|
||||
|
@ -850,6 +852,12 @@ void CL_ParseCustomTEnt(void)
|
|||
t->dlightrgb[2] = MSG_ReadByte()/255.0f;
|
||||
t->dlightradius = MSG_ReadByte();
|
||||
t->dlighttime = MSG_ReadByte()/16.0f;
|
||||
if (t->netstyle & CTE_CHANNELFADE)
|
||||
{
|
||||
t->dlightcfade[0] = MSG_ReadByte()/64.0f;
|
||||
t->dlightcfade[1] = MSG_ReadByte()/64.0f;
|
||||
t->dlightcfade[2] = MSG_ReadByte()/64.0f;
|
||||
}
|
||||
}
|
||||
else
|
||||
t->dlighttime = 0;
|
||||
|
@ -901,7 +909,14 @@ void CL_ParseCustomTEnt(void)
|
|||
dl->color[1] = t->dlightrgb[1];
|
||||
dl->color[2] = t->dlightrgb[2];
|
||||
|
||||
// let darklights work since they get no control over this just yet
|
||||
if (t->netstyle & CTE_CHANNELFADE)
|
||||
{
|
||||
dl->channelfade[0] = t->dlightcfade[0];
|
||||
dl->channelfade[1] = t->dlightcfade[1];
|
||||
dl->channelfade[2] = t->dlightcfade[2];
|
||||
}
|
||||
|
||||
/*
|
||||
if (dl->color[0] < 0)
|
||||
dl->channelfade[0] = 0;
|
||||
else
|
||||
|
@ -916,6 +931,7 @@ void CL_ParseCustomTEnt(void)
|
|||
dl->channelfade[2] = 0;
|
||||
else
|
||||
dl->channelfade[2] = dl->color[0]/t->dlighttime;
|
||||
*/
|
||||
}
|
||||
}
|
||||
void CL_ClearCustomTEnts(void)
|
||||
|
|
|
@ -6112,6 +6112,13 @@ void PF_RegisterTEnt(progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
sv.customtents[i].dlightradius = G_FLOAT(OFS_PARM1+arg*3)/4;
|
||||
sv.customtents[i].dlighttime = G_FLOAT(OFS_PARM2+arg*3)*16;
|
||||
arg += 3;
|
||||
if (nettype & CTE_CHANNELFADE)
|
||||
{
|
||||
sv.customtents[i].dlightcfade[0] = G_FLOAT(OFS_PARM0+arg*3+0)*64;
|
||||
sv.customtents[i].dlightcfade[1] = G_FLOAT(OFS_PARM0+arg*3+1)*64;
|
||||
sv.customtents[i].dlightcfade[2] = G_FLOAT(OFS_PARM0+arg*3+2)*64;
|
||||
arg++; // we're out now..
|
||||
}
|
||||
}
|
||||
|
||||
if (arg != *prinst->callargc)
|
||||
|
|
|
@ -71,11 +71,13 @@ typedef struct {
|
|||
qbyte dlightrgb[3];
|
||||
qbyte dlightradius;
|
||||
qbyte dlighttime;
|
||||
qbyte dlightcfade[3];
|
||||
} svcustomtents_t;
|
||||
#define CTE_CUSTOMCOUNT 1
|
||||
#define CTE_CUSTOMDIRECTION 2
|
||||
#define CTE_STAINS 4
|
||||
#define CTE_GLOWS 8
|
||||
#define CTE_CHANNELFADE 16
|
||||
#define CTE_ISBEAM 128
|
||||
|
||||
typedef struct
|
||||
|
|
Loading…
Reference in a new issue