maybe add scale field to entities

This commit is contained in:
Steam Deck User 2022-12-21 20:57:32 -05:00
parent 896ca8814e
commit ab9d9cc5b1
6 changed files with 33 additions and 1 deletions

View file

@ -518,6 +518,11 @@ if (bits&(1<<i))
else
ent->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);

View file

@ -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]);
}
}

View file

@ -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)

View file

@ -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;

View file

@ -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;

View file

@ -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]);