From ad5cb10c4f5822f86287b97f46eca90ca67ca82c Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 1 Jun 2007 01:33:34 +0000 Subject: [PATCH] added DP_EF_NOGUNBOB extension git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7384 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_main.c | 7 +++++-- protocol.h | 2 +- svvm_cmds.c | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cl_main.c b/cl_main.c index 4be3ee7b..40d9c249 100644 --- a/cl_main.c +++ b/cl_main.c @@ -900,7 +900,10 @@ void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qboolean interpolat else if (e->render.flags & RENDER_VIEWMODEL) { // view-relative entity (guns and such) - matrix = &viewmodelmatrix; + if (e->render.effects & EF_NOGUNBOB) + matrix = &r_view.matrix; // really attached to view + else + matrix = &viewmodelmatrix; // attached to gun bob matrix } else { @@ -1218,7 +1221,7 @@ void CL_UpdateViewModel(void) ent->state_current.modelindex = 0; } ent->state_current.alpha = cl.entities[cl.viewentity].state_current.alpha; - ent->state_current.effects = EF_NOSHADOW | (cl.entities[cl.viewentity].state_current.effects & (EF_ADDITIVE | EF_FULLBRIGHT | EF_NODEPTHTEST)); + ent->state_current.effects = EF_NOSHADOW | (cl.entities[cl.viewentity].state_current.effects & (EF_ADDITIVE | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB)); // reset animation interpolation on weaponmodel if model changed if (ent->state_previous.modelindex != ent->state_current.modelindex) diff --git a/protocol.h b/protocol.h index 17a6c45a..ddc9542c 100644 --- a/protocol.h +++ b/protocol.h @@ -49,7 +49,7 @@ void Protocol_Names(char *buffer, size_t buffersize); #define EF_ADDITIVE 32 #define EF_BLUE 64 #define EF_RED 128 -#define EF_UNUSED8 256 +#define EF_NOGUNBOB 256 // LordHavoc: when used with .viewmodelforclient this makes the entity attach to the view without gun bobbing and such effects, it also works on the player entity to disable gun bobbing of the engine-managed .viewmodel (without affecting any .viewmodelforclient entities attached to the player) #define EF_FULLBRIGHT 512 // LordHavoc: fullbright #define EF_FLAME 1024 // LordHavoc: on fire #define EF_STARDUST 2048 // LordHavoc: showering sparks diff --git a/svvm_cmds.c b/svvm_cmds.c index 76eaf97e..92b004dc 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -23,6 +23,7 @@ char *vm_sv_extensions = "DP_EF_NODEPTHTEST " "DP_EF_NODRAW " "DP_EF_NOSHADOW " +"DP_EF_NOGUNBOB " "DP_EF_RED " "DP_EF_STARDUST " "DP_ENT_ALPHA " -- 2.39.2