diff --git a/source/cl_parse.c b/source/cl_parse.c index a16e638..5cdc6ed 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -518,6 +518,11 @@ if (bits&(1<msg_angles[0][2] = ent->baseline.angles[2]; + if (bits & U_SCALE) + ent->scale = MSG_ReadFloat(); + else + ent->scale = 1; + // Tomaz - QC Alpha Scale Glow Begin if (bits & U_RENDERAMT) ent->renderamt = MSG_ReadFloat(); @@ -571,6 +576,7 @@ void CL_ParseBaseline (entity_t *ent) ent->baseline.frame = MSG_ReadByte (); ent->baseline.colormap = MSG_ReadByte(); ent->baseline.skin = MSG_ReadByte(); + ent->baseline.scale = MSG_ReadByte(); for (i=0 ; i<3 ; i++) { ent->baseline.origin[i] = MSG_ReadCoord (); @@ -939,6 +945,7 @@ void CL_ParseStatic (void) ent->colormap = vid.colormap; ent->skinnum = ent->baseline.skin; ent->effects = ent->baseline.effects; + ent->scale = ent->baseline.scale; VectorCopy (ent->baseline.origin, ent->origin); VectorCopy (ent->baseline.angles, ent->angles); diff --git a/source/gl_rmain.c b/source/gl_rmain.c index 71d62c8..9230818 100644 --- a/source/gl_rmain.c +++ b/source/gl_rmain.c @@ -776,7 +776,7 @@ void R_DrawAliasModel (entity_t *e) glScalef (paliashdr->scale[0] * scale, paliashdr->scale[1], paliashdr->scale[2]); } else { glTranslatef (paliashdr->scale_origin[0], paliashdr->scale_origin[1], paliashdr->scale_origin[2]); - glScalef (paliashdr->scale[0], paliashdr->scale[1], paliashdr->scale[2]); + glScalef (paliashdr->scale[0] * e->v.scale, paliashdr->scale[1], paliashdr->scale[2]); } } diff --git a/source/protocol.h b/source/protocol.h index 96b5642..27c5734 100644 --- a/source/protocol.h +++ b/source/protocol.h @@ -51,6 +51,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define U_FRAMETIME (1<<22) // another byte to follow // Tomaz - QC Alpha Scale Glow Control End +// motolegacy -- scale shit +#define U_SCALE (1<<23) +// motolegacy -- end scale + #define SU_VIEWHEIGHT (1<<0) #define SU_IDEALPITCH (1<<1) #define SU_PUNCH1 (1<<2) diff --git a/source/quakedef.h b/source/quakedef.h index 78fc484..2cd1964 100644 --- a/source/quakedef.h +++ b/source/quakedef.h @@ -298,6 +298,7 @@ typedef struct int colormap; int skin; int effects; + unsigned short scale; // dr_mabuse1981: HalfLife rendermodes fixed START unsigned short renderamt; unsigned short rendermode; diff --git a/source/render.h b/source/render.h index 18269a1..b1d46d6 100644 --- a/source/render.h +++ b/source/render.h @@ -63,6 +63,10 @@ typedef struct entity_s float rendercolor[3]; //Crow_bar + // motolegacy -- scale shit from FTE + float scale; /* Multiplier that resizes the entity. 1 is normal sized, 2 is double sized. scale 0 is remapped to 1. In SSQC, this is limited to 1/16th precision, with a maximum just shy of 16.*/ + // motolegacy -- end scale + struct model_s *model; // NULL = no model struct efrag_s *efrag; // linked list of efrags int frame; diff --git a/source/sv_main.c b/source/sv_main.c index 5bac80a..48d5040 100644 --- a/source/sv_main.c +++ b/source/sv_main.c @@ -437,6 +437,7 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg) eval_t *val; float renderamt = 0; float rendermode = 0; + float scale = 1; float rendercolor[3]; memset(rendercolor, 0, sizeof(rendercolor)); @@ -514,6 +515,16 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg) if (ent->baseline.modelindex != ent->v.modelindex) bits |= U_MODEL; + if (ent->baseline.scale != ent->v.scale) { + if (ent->v.scale == 0) + ent->v.scale = 1; + + if (ent->v.scale > 16) + ent->v.scale = 16; + + bits |= U_SCALE; + } + // Tomaz - QC Alpha Scale Glow Begin { @@ -609,6 +620,8 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg) MSG_WriteCoord (msg, ent->v.origin[2]); if (bits & U_ANGLE3) MSG_WriteAngle(msg, ent->v.angles[2]); + if (bits & U_SCALE) + MSG_WriteFloat(msg, ent->v.scale); // Tomaz - QC Alpha Scale Glow Begin if (bits & U_RENDERAMT) MSG_WriteFloat(msg, renderamt); @@ -1030,11 +1043,13 @@ void SV_CreateBaseline (void) if (entnum > 0 && entnum <= svs.maxclients) { svent->baseline.colormap = entnum; + svent->baseline.scale = 1; svent->baseline.modelindex = SV_ModelIndex("models/player.mdl"); } else { svent->baseline.colormap = 0; + svent->baseline.scale = 1; svent->baseline.modelindex = SV_ModelIndex(pr_strings + svent->v.model); } @@ -1049,6 +1064,7 @@ void SV_CreateBaseline (void) MSG_WriteByte (&sv.signon, svent->baseline.frame); MSG_WriteByte (&sv.signon, svent->baseline.colormap); MSG_WriteByte (&sv.signon, svent->baseline.skin); + MSG_WriteByte (&sv.signon, svent->baseline.scale); for (i=0 ; i<3 ; i++) { MSG_WriteCoord(&sv.signon, svent->baseline.origin[i]);