Skip to content

Commit

Permalink
Remaster merge commit 'd4b42667'
Browse files Browse the repository at this point in the history
  • Loading branch information
0lvin committed Dec 14, 2024
2 parents 23088ba + d4b4266 commit 6904047
Show file tree
Hide file tree
Showing 52 changed files with 297 additions and 247 deletions.
8 changes: 8 additions & 0 deletions src/client/cl_entities.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ CL_AddPacketEntities(frame_t *frame)
cent = &cl_entities[s1->number];

effects = s1->effects;
#if _RREXTEND
rr_effects = s1->rr_effects;
#else
rr_effects = 0;
#endif
renderfx = s1->renderfx;

/* set frame */
Expand Down Expand Up @@ -215,7 +219,11 @@ CL_AddPacketEntities(frame_t *frame)
}

/* store scale */
#if _RREXTEND
VectorCopy(s1->scale, ent.scale);
#else
VectorClear(ent.scale);
#endif
}

/* only used for black hole model right now */
Expand Down
6 changes: 6 additions & 0 deletions src/client/cl_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
}
}

#if _RREXTEND
if (cls.serverProtocol != PROTOCOL_VERSION)
{
int i;
Expand All @@ -167,6 +168,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
to->scale[i] = 1.0f;
}
}
#endif

if (IS_QII97_PROTOCOL(cls.serverProtocol))
{
Expand Down Expand Up @@ -236,6 +238,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
{
to->skinnum = MSG_ReadLong(&net_message);
/* Additional scale with skinnum */
#if _RREXTEND
if (cls.serverProtocol == PROTOCOL_VERSION)
{
int i;
Expand All @@ -245,6 +248,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
to->scale[i] = MSG_ReadFloat(&net_message);
}
}
#endif
}
else if (bits & U_SKIN8)
{
Expand All @@ -269,6 +273,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
}

/* ReRelease effects */
#if _RREXTEND
if (cls.serverProtocol != PROTOCOL_VERSION)
{
to->rr_effects = 0;
Expand All @@ -288,6 +293,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
to->rr_effects = MSG_ReadShort(&net_message);
}
}
#endif

if ((bits & (U_RENDERFX8 | U_RENDERFX16)) == (U_RENDERFX8 | U_RENDERFX16))
{
Expand Down
11 changes: 8 additions & 3 deletions src/common/header/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -1442,9 +1442,6 @@ typedef struct entity_state_s
int event; /* impulse events -- muzzle flashes, footsteps, etc */
/* events only go out for a single frame, they */
/* are automatically cleared each frame */
/* New protocol fields */
vec3_t scale; /* model scale */
unsigned int rr_effects;

short clientnum; // In Quake 2, the client num was passed in skinnum. We need this value, however.

Expand Down Expand Up @@ -1480,6 +1477,14 @@ typedef struct entity_state_s
byte usageCount;
} entity_state_t;

/* ReRelease states */
typedef struct entity_rrstate_s
{
/* New protocol fields */
vec3_t scale; /* model scale */
unsigned int effects;
} entity_rrstate_t;

/* ============================================== */

/* player_state_t is the information needed in addition to pmove_state_t
Expand Down
19 changes: 16 additions & 3 deletions src/common/movemsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ MSG_WriteDeltaEntity(entity_state_t *from,
}
}

#if _RREXTEND
/* Scale with skins if force or different */
if ((protocol == PROTOCOL_VERSION) &&
((to->scale[0] != from->scale[0]) ||
Expand All @@ -526,6 +527,7 @@ MSG_WriteDeltaEntity(entity_state_t *from,
{
bits |= (U_SKIN8 | U_SKIN16);
}
#endif

if (to->frame != from->frame)
{
Expand All @@ -540,14 +542,14 @@ MSG_WriteDeltaEntity(entity_state_t *from,
}
}

if ((to->effects != from->effects) || (to->rr_effects != from->rr_effects))
if (to->effects != from->effects)
{
if ((to->effects < 256) && (to->rr_effects < 256))
if (to->effects < 256)
{
bits |= U_EFFECTS8;
}

else if ((to->effects < 0x8000) && (to->rr_effects < 0x8000))
else if (to->effects < 0x8000)
{
bits |= U_EFFECTS16;
}
Expand All @@ -558,6 +560,13 @@ MSG_WriteDeltaEntity(entity_state_t *from,
}
}

#if _RREXTEND
if (to->rr_effects != from->rr_effects)
{
bits |= U_EFFECTS8 | U_EFFECTS16;
}
#endif

if (to->renderfx != from->renderfx)
{
if (to->renderfx < 256)
Expand Down Expand Up @@ -733,6 +742,7 @@ MSG_WriteDeltaEntity(entity_state_t *from,
{
MSG_WriteLong(msg, to->skinnum);

#if _RREXTEND
/* Send scale */
if (protocol == PROTOCOL_VERSION)
{
Expand All @@ -743,6 +753,7 @@ MSG_WriteDeltaEntity(entity_state_t *from,
MSG_WriteFloat(msg, to->scale[i]);
}
}
#endif
}

else if (bits & U_SKIN8)
Expand Down Expand Up @@ -770,6 +781,7 @@ MSG_WriteDeltaEntity(entity_state_t *from,
MSG_WriteShort(msg, to->effects);
}

#if _RREXTEND
/* ReRelease effects */
if (protocol == PROTOCOL_VERSION)
{
Expand All @@ -788,6 +800,7 @@ MSG_WriteDeltaEntity(entity_state_t *from,
MSG_WriteShort(msg, to->rr_effects);
}
}
#endif

if ((bits & (U_RENDERFX8 | U_RENDERFX16)) == (U_RENDERFX8 | U_RENDERFX16))
{
Expand Down
4 changes: 2 additions & 2 deletions src/game/character/ai.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void c_corvus_init(edict_t *self,int classId)
if (!self->monsterinfo.scale)
{
self->monsterinfo.scale = 1;
VectorSet(self->s.scale,
VectorSet(self->rrs.scale,
self->monsterinfo.scale,
self->monsterinfo.scale,
self->monsterinfo.scale);
Expand Down Expand Up @@ -265,7 +265,7 @@ void c_character_init(edict_t *self,int classId)
if (!self->monsterinfo.scale)
{
self->monsterinfo.scale = 1;
VectorSet(self->s.scale,
VectorSet(self->rrs.scale,
self->monsterinfo.scale,
self->monsterinfo.scale,
self->monsterinfo.scale);
Expand Down
4 changes: 2 additions & 2 deletions src/game/character/elflord/elflord.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ float mist_yaw;
void Elflord_c_gib(edict_t *self, G_Message_t *msg)
{
gi.CreateEffect(self, FX_WEAPON_SPHEREEXPLODE, CEF_OWNERS_ORIGIN , NULL,
"db", self->movedir, (byte)(AVG_VEC3T(self->s.scale) * 7.5));
"db", self->movedir, (byte)(AVG_VEC3T(self->rrs.scale) * 7.5));

gi.sound(self,CHAN_WEAPON,gi.soundindex("weapons/SphereImpact.wav"),2,ATTN_NORM,0);

Expand Down Expand Up @@ -194,7 +194,7 @@ void SP_character_elflord (edict_t *self)
c_character_init(self,CID_C_ELFLORD);

self->monsterinfo.scale = 2.0;
VectorSet(self->s.scale,
VectorSet(self->rrs.scale,
self->monsterinfo.scale,
self->monsterinfo.scale,
self->monsterinfo.scale);
Expand Down
2 changes: 1 addition & 1 deletion src/game/character/siernan/siernan1.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void SP_character_siernan1 (edict_t *self)
VectorSet(self->maxs, 10, 10, 20);

self->monsterinfo.scale = 1.2;
VectorSet(self->s.scale,
VectorSet(self->rrs.scale,
self->monsterinfo.scale,
self->monsterinfo.scale,
self->monsterinfo.scale);
Expand Down
2 changes: 1 addition & 1 deletion src/game/character/siernan/siernan2.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void SP_character_siernan2 (edict_t *self)
VectorSet(self->maxs, 22, 12, 16);

self->monsterinfo.scale = 1;
VectorSet(self->s.scale,
VectorSet(self->rrs.scale,
self->monsterinfo.scale,
self->monsterinfo.scale,
self->monsterinfo.scale);
Expand Down
9 changes: 9 additions & 0 deletions src/game/effects/fx_sphereofannihlation.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ FXSphereOfAnnihilationSphereThink(struct client_entity_s *Self, centity_t *Owner
else
detail_scale = 1.0;

#if _RREXTEND
scale = AVG_VEC3T(Owner->current.scale) * detail_scale;
#else
scale = detail_scale;
#endif

VectorSet(Self->r.scale, scale, scale, scale);

return true;
Expand Down Expand Up @@ -195,7 +200,11 @@ void FXSphereOfAnnihilation(centity_t *Owner,int Type,int Flags,vec3_t Origin)

SphereThinker->r.model = sphere_models[1];
SphereThinker->r.flags |= RF_TRANSLUCENT;

#if _RREXTEND
VectorCopy(Owner->current.scale, SphereThinker->r.scale);
#endif

SphereThinker->radius = 70.0;
SphereThinker->Update = FXSphereOfAnnihilationSphereThink;
SphereThinker->AddToView = LinkedEntityUpdatePlacement;
Expand Down
4 changes: 4 additions & 0 deletions src/game/effects/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,11 @@ AddServerEntities(frame_t *frame)
ent->skin = NULL; // No custom skin.
}

#if _RREXTEND
VectorCopy(s1->scale, ent->scale);
#else
VectorSet(ent->scale, 1.0, 1.0, 1.0);
#endif

if(s1->color[0] ||
s1->color[1] ||
Expand Down
2 changes: 1 addition & 1 deletion src/game/g_ai.c
Original file line number Diff line number Diff line change
Expand Up @@ -2193,7 +2193,7 @@ old_ai_run(edict_t *self, float dist)
if(trace.ent->takedamage && self->monsterinfo.aiflags & AI_SHOVE && trace.fraction <= 0.5)
{//hurt them some too?
if(self->classID == CID_GORGON &&
(AVG_VEC3T(self->s.scale) > 1.5) &&
(AVG_VEC3T(self->rrs.scale) > 1.5) &&
trace.ent->classID!=self->classID &&
trace.ent->health <= 200&&
infront(self, self->enemy))//chomp!
Expand Down
12 changes: 6 additions & 6 deletions src/game/g_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void smoke_use (edict_t *self, edict_t *other, edict_t *activator)
byte scale,speed,wait,maxrange;
if (self->spawnflags & START_OFF)
{
scale = (byte)(AVG_VEC3T(self->s.scale) * 32.0);
scale = (byte)(AVG_VEC3T(self->rrs.scale) * 32.0);
AngleVectors(self->s.angles, dir, NULL, NULL);

speed = Q_ftol(self->speed);
Expand Down Expand Up @@ -119,14 +119,14 @@ void SP_env_smoke (edict_t *self)
byte scale,speed,wait,maxrange;

// set scale
if (!self->s.scale[0] ||
!self->s.scale[1] ||
!self->s.scale[2])
if (!self->rrs.scale[0] ||
!self->rrs.scale[1] ||
!self->rrs.scale[2])
{
VectorSet(self->s.scale, 1.0, 1.0, 1.0);
VectorSet(self->rrs.scale, 1.0, 1.0, 1.0);
}

scale = (byte)(AVG_VEC3T(self->s.scale) * 32.0);
scale = (byte)(AVG_VEC3T(self->rrs.scale) * 32.0);

// allow us to use this stuff
if (self->targetname)
Expand Down
14 changes: 7 additions & 7 deletions src/game/g_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -4776,10 +4776,10 @@ void monsterspawner_go(edict_t *self)
monster->jump_chance = self->jump_chance;
monster->wakeup_distance = self->wakeup_distance;

VectorCopy(self->s.scale, monster->s.scale);
VectorCopy(self->rrs.scale, monster->rrs.scale);

VectorScale(STDMinsForClass[monster->classID], AVG_VEC3T(monster->s.scale), monster->mins);
VectorScale(STDMaxsForClass[monster->classID], AVG_VEC3T(monster->s.scale), monster->maxs);
VectorScale(STDMinsForClass[monster->classID], AVG_VEC3T(monster->rrs.scale), monster->mins);
VectorScale(STDMaxsForClass[monster->classID], AVG_VEC3T(monster->rrs.scale), monster->maxs);

if (self->attenuation)
{
Expand Down Expand Up @@ -4997,11 +4997,11 @@ void SP_func_monsterspawner (edict_t *self)
if (!self->wait)
self->wait = 10;

if (!self->s.scale[0] ||
!self->s.scale[1] ||
!self->s.scale[2])
if (!self->rrs.scale[0] ||
!self->rrs.scale[1] ||
!self->rrs.scale[2])
{
VectorSet(self->s.scale, 1.0, 1.0, 1.0);
VectorSet(self->rrs.scale, 1.0, 1.0, 1.0);
}

if (self->targetname)
Expand Down
Loading

0 comments on commit 6904047

Please sign in to comment.