From 9fa091db4327cbfa99615c7737e05a86137bd4a0 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Wed, 1 Sep 2021 22:41:11 +0200 Subject: [PATCH] Reserve 3 SRC'04 rendermodes, implement RM_DONTRENDER. --- src/client/entry.qc | 7 ------- src/gs-entbase/baseentity.h | 17 ++++++++++------- src/gs-entbase/shared/baseentity.qc | 5 +++++ src/shared/player.qc | 4 ++-- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/client/entry.qc b/src/client/entry.qc index e667f925..96902d8e 100644 --- a/src/client/entry.qc +++ b/src/client/entry.qc @@ -419,13 +419,6 @@ CSQC_UpdateView(float w, float h, float focus) } } -#if 1 - if (pl.flags & FL_INVEHICLE) { - CBaseVehicle veh = (CBaseVehicle)pl.vehicle; - PointMessage_StringAtPos(veh.origin, sprintf("Speed: %d", vlen(veh.velocity))); - } -#endif - if (self.classname == "player") Predict_PlayerPostFrame((player)self); else if (self.classname == "spectator") diff --git a/src/gs-entbase/baseentity.h b/src/gs-entbase/baseentity.h index 21d94734..a245c89a 100644 --- a/src/gs-entbase/baseentity.h +++ b/src/gs-entbase/baseentity.h @@ -17,13 +17,16 @@ #ifdef GS_RENDERFX enum { - RM_NORMAL, - RM_COLOR, - RM_TEXTURE, - RM_GLOW, - RM_SOLID, - RM_ADDITIVE, - RM_FULLBRIGHT, + RM_NORMAL = 0, + RM_COLOR = 1, + RM_TEXTURE = 2, + RM_GLOW = 3, + RM_SOLID = 4, + RM_ADDITIVE = 5, + RM_FULLBRIGHT = 6, + RM_ADDFRAC = 7, /* Source 2004 */ + RM_WORLDGLOW = 9, /* Source 2004 */ + RM_DONTRENDER = 10, /* Source 2004 */ RM_TRIGGER }; diff --git a/src/gs-entbase/shared/baseentity.qc b/src/gs-entbase/shared/baseentity.qc index a3835f3c..43c90467 100644 --- a/src/gs-entbase/shared/baseentity.qc +++ b/src/gs-entbase/shared/baseentity.qc @@ -58,6 +58,7 @@ CBaseEntity::RenderFXPass(void) } break; case RM_GLOW: + case RM_WORLDGLOW: /* TODO: Figure out what this does differently */ if (checkpvs(vecPlayer, this) == FALSE) alpha -= clframetime; @@ -84,6 +85,7 @@ CBaseEntity::RenderFXPass(void) alpha = 1.0f; break; case RM_ADDITIVE: + case RM_ADDFRAC: /* TODO: Figure out what this does differently */ effects = EF_ADDITIVE; if (autocvar_rm_unlit_additive == 0) { drawflags = 0; @@ -107,6 +109,9 @@ CBaseEntity::RenderFXPass(void) alpha = 0.0f; } break; + case RM_DONTRENDER: + /* prevent addentity() from being called */ + alpha = 0.0f; } /* messy hologram imitation */ diff --git a/src/shared/player.qc b/src/shared/player.qc index 7490bd50..802be61d 100644 --- a/src/shared/player.qc +++ b/src/shared/player.qc @@ -56,7 +56,7 @@ base_player::ReceiveEntity(float new, float fl) v_angle[1] = readshort() / (32767 / 360); } if (fl & PLAYER_COLORMAP) - colormap = readfloat(); + colormap = readbyte(); if (fl & PLAYER_VELOCITY) { velocity[0] = readcoord(); @@ -317,7 +317,7 @@ base_player::SendEntity(entity ePEnt, float fChanged) WriteShort(MSG_ENTITY, v_angle[1] * 32767 / 360); } if (fChanged & PLAYER_COLORMAP) - WriteFloat(MSG_ENTITY, colormap); + WriteByte(MSG_ENTITY, colormap); /* similar as with origin, we separate x/y from z */ if (fChanged & PLAYER_VELOCITY) {