Skip to content

Commit

Permalink
Remove obsolete client code
Browse files Browse the repository at this point in the history
  • Loading branch information
Toodles2You committed Oct 10, 2024
1 parent e760b9f commit 2e868e1
Show file tree
Hide file tree
Showing 40 changed files with 25 additions and 1,900 deletions.
2 changes: 0 additions & 2 deletions cl_dll/GameStudioModelRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ Export this function for the engine to use the studio renderer class to render o
*/
int DLLEXPORT HUD_GetStudioModelInterface(int version, struct r_studio_interface_s** ppinterface, struct engine_studio_api_s* pstudio)
{
// RecClStudioInterface(version, ppinterface, pstudio);

if (version != STUDIO_INTERFACE_VERSION)
return 0;

Expand Down
70 changes: 1 addition & 69 deletions cl_dll/StudioModelRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ extern extra_player_info_t g_PlayerExtraInfo[MAX_PLAYERS_HUD + 1];
#define TEAM3_COLOR 45
#define TEAM4_COLOR 100

int m_nPlayerGaitSequences[MAX_PLAYERS];

// Global engine <-> studio model rendering code interface
engine_studio_api_t IEngineStudio;

Expand Down Expand Up @@ -144,15 +142,13 @@ void CStudioModelRenderer::StudioCalcBoneAdj(float dadt, float* adj, const byte*
value = 1.0;
value = (1.0 - value) * pbonecontroller[j].start + value * pbonecontroller[j].end;
}
// Con_DPrintf( "%d %d %f : %f\n", m_pCurrentEntity->curstate.controller[j], m_pCurrentEntity->latched.prevcontroller[j], value, dadt );
}
else
{
value = mouthopen / 64.0;
if (value > 1.0)
value = 1.0;
value = (1.0 - value) * pbonecontroller[j].start + value * pbonecontroller[j].end;
// Con_DPrintf("%d %f\n", mouthopen, value );
}
switch (pbonecontroller[j].type & STUDIO_TYPES)
{
Expand Down Expand Up @@ -274,10 +270,6 @@ void CStudioModelRenderer::StudioCalcBonePosition(int frame, float s, mstudiobon
if (panim->offset[j] != 0)
{
panimvalue = (mstudioanimvalue_t*)((byte*)panim + panim->offset[j]);
/*
if (i == 0 && j == 0)
Con_DPrintf("%d %d:%d %f\n", frame, panimvalue->num.valid, panimvalue->num.total, s );
*/

k = frame;
// DEBUG
Expand Down Expand Up @@ -434,8 +426,6 @@ void CStudioModelRenderer::StudioSetUpTransform(bool trivial_accept)
Vector modelpos;

// tweek model origin
//for (i = 0; i < 3; i++)
// modelpos[i] = m_pCurrentEntity->origin[i];

VectorCopy(m_pCurrentEntity->origin, modelpos);

Expand All @@ -446,8 +436,6 @@ void CStudioModelRenderer::StudioSetUpTransform(bool trivial_accept)
angles[PITCH] = m_pCurrentEntity->curstate.angles[PITCH];
angles[YAW] = m_pCurrentEntity->curstate.angles[YAW];

//Con_DPrintf("Angles %4.2f prev %4.2f for %i\n", angles[PITCH], m_pCurrentEntity->index);
//Con_DPrintf("movetype %d %d\n", m_pCurrentEntity->movetype, m_pCurrentEntity->aiment );
if (m_pCurrentEntity->curstate.movetype == MOVETYPE_STEP)
{
float f = 0;
Expand All @@ -462,7 +450,6 @@ void CStudioModelRenderer::StudioSetUpTransform(bool trivial_accept)
(m_pCurrentEntity->curstate.animtime != m_pCurrentEntity->latched.prevanimtime))
{
f = (m_clTime - m_pCurrentEntity->curstate.animtime) / (m_pCurrentEntity->curstate.animtime - m_pCurrentEntity->latched.prevanimtime);
//Con_DPrintf("%4.2f %.2f %.2f\n", f, m_pCurrentEntity->curstate.animtime, m_clTime);
}

if (m_fDoInterp)
Expand All @@ -485,11 +472,6 @@ void CStudioModelRenderer::StudioSetUpTransform(bool trivial_accept)
}
}

// NOTE: Because multiplayer lag can be relatively large, we don't want to cap
// f at 1.5 anymore.
//if (f > -1.0 && f < 1.5) {}

// Con_DPrintf("%.0f %.0f\n",m_pCurrentEntity->msg_angles[0][YAW], m_pCurrentEntity->msg_angles[1][YAW] );
for (i = 0; i < 3; i++)
{
float ang1, ang2;
Expand All @@ -509,16 +491,12 @@ void CStudioModelRenderer::StudioSetUpTransform(bool trivial_accept)

angles[i] += d * f;
}
//Con_DPrintf("%.3f \n", f );
}
else if (m_pCurrentEntity->curstate.movetype != MOVETYPE_NONE)
{
VectorCopy(m_pCurrentEntity->angles, angles);
}

//Con_DPrintf("%.0f %0.f %0.f\n", modelpos[0], modelpos[1], modelpos[2] );
//Con_DPrintf("%.0f %0.f %0.f\n", angles[0], angles[1], angles[2] );

angles[PITCH] = -angles[PITCH];
AngleMatrix(angles, (*m_protationmatrix));

Expand Down Expand Up @@ -612,13 +590,6 @@ void CStudioModelRenderer::StudioCalcRotations(float pos[][3], vec4_t* q, mstudi

frame = (int)f;

// Con_DPrintf("%d %.4f %.4f %.4f %.4f %d\n", m_pCurrentEntity->curstate.sequence, m_clTime, m_pCurrentEntity->animtime, m_pCurrentEntity->frame, f, frame );

// Con_DPrintf( "%f %f %f\n", m_pCurrentEntity->angles[ROLL], m_pCurrentEntity->angles[PITCH], m_pCurrentEntity->angles[YAW] );

// Con_DPrintf("frame %d %d\n", frame1, frame2 );


dadt = StudioEstimateInterpolant();
s = (f - frame);

Expand All @@ -632,8 +603,6 @@ void CStudioModelRenderer::StudioCalcRotations(float pos[][3], vec4_t* q, mstudi
StudioCalcBoneQuaterion(frame, s, pbone, panim, adj, q[i]);

StudioCalcBonePosition(frame, s, pbone, panim, adj, pos[i]);
// if (0 && i == 0)
// Con_DPrintf("%d %d %d %d\n", m_pCurrentEntity->curstate.sequence, frame, j, k );
}

if ((pseqdesc->motiontype & STUDIO_X) != 0)
Expand Down Expand Up @@ -804,29 +773,8 @@ void CStudioModelRenderer::StudioSetupBones()

pseqdesc = (mstudioseqdesc_t*)((byte*)m_pStudioHeader + m_pStudioHeader->seqindex) + m_pCurrentEntity->curstate.sequence;

// always want new gait sequences to start on frame zero
/* if ( m_pPlayerInfo )
{
int playerNum = m_pCurrentEntity->index - 1;
// new jump gaitsequence? start from frame zero
if ( m_nPlayerGaitSequences[ playerNum ] != m_pPlayerInfo->gaitsequence )
{
// m_pPlayerInfo->gaitframe = 0.0;
gEngfuncs.Con_Printf( "Setting gaitframe to 0\n" );
}
m_nPlayerGaitSequences[ playerNum ] = m_pPlayerInfo->gaitsequence;
// gEngfuncs.Con_Printf( "index: %d gaitsequence: %d\n",playerNum, m_pPlayerInfo->gaitsequence);
}
*/
f = StudioEstimateFrame(pseqdesc);

if (m_pCurrentEntity->latched.prevframe > f)
{
//Con_DPrintf("%f %f\n", m_pCurrentEntity->prevframe, f );
}

panim = StudioGetAnim(m_pRenderModel, pseqdesc);
StudioCalcRotations(pos, q, pseqdesc, panim, f);

Expand Down Expand Up @@ -908,7 +856,6 @@ void CStudioModelRenderer::StudioSetupBones()
}
else
{
//Con_DPrintf("prevframe = %4.2f\n", f);
m_pCurrentEntity->latched.prevframe = f;
}

Expand Down Expand Up @@ -976,9 +923,6 @@ void CStudioModelRenderer::StudioSetupBones()
if (0 != IEngineStudio.IsHardware())
{
ConcatTransforms((*m_protationmatrix), bonematrix, (*m_pbonetransform)[i]);

// MatrixCopy should be faster...
//ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_plighttransform)[i]);
MatrixCopy((*m_pbonetransform)[i], (*m_plighttransform)[i]);
}
else
Expand Down Expand Up @@ -1051,11 +995,6 @@ void CStudioModelRenderer::StudioMergeBones(model_t* m_pSubModel)

f = StudioEstimateFrame(pseqdesc);

if (m_pCurrentEntity->latched.prevframe > f)
{
//Con_DPrintf("%f %f\n", m_pCurrentEntity->prevframe, f );
}

panim = StudioGetAnim(m_pSubModel, pseqdesc);
StudioCalcRotations(pos, q, pseqdesc, panim, f);

Expand Down Expand Up @@ -1086,9 +1025,6 @@ void CStudioModelRenderer::StudioMergeBones(model_t* m_pSubModel)
if (0 != IEngineStudio.IsHardware())
{
ConcatTransforms((*m_protationmatrix), bonematrix, (*m_pbonetransform)[i]);

// MatrixCopy should be faster...
//ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_plighttransform)[i]);
MatrixCopy((*m_pbonetransform)[i], (*m_plighttransform)[i]);
}
else
Expand Down Expand Up @@ -1137,7 +1073,7 @@ bool CStudioModelRenderer::StudioDrawModel(int flags)
return false;

// get copy of player
deadplayer = *(IEngineStudio.GetPlayerState(m_pCurrentEntity->curstate.renderamt - 1)); //cl.frames[cl.parsecount & CL_UPDATE_MASK].playerstate[m_pCurrentEntity->curstate.renderamt-1];
deadplayer = *(IEngineStudio.GetPlayerState(m_pCurrentEntity->curstate.renderamt - 1));

// clear weapon, movement state
deadplayer.number = m_pCurrentEntity->curstate.renderamt;
Expand Down Expand Up @@ -1323,8 +1259,6 @@ void CStudioModelRenderer::StudioProcessGait(entity_state_t* pplayer)
m_pCurrentEntity->latched.prevblending[0] = m_pCurrentEntity->curstate.blending[0];
m_pCurrentEntity->latched.prevseqblending[0] = m_pCurrentEntity->curstate.blending[0];

// Con_DPrintf("%f %d\n", m_pCurrentEntity->angles[PITCH], m_pCurrentEntity->blending[0] );

dt = (m_clTime - m_clOldTime);
if (dt < 0)
dt = 0;
Expand All @@ -1333,8 +1267,6 @@ void CStudioModelRenderer::StudioProcessGait(entity_state_t* pplayer)

StudioEstimateGait(pplayer);

// Con_DPrintf("%f %f\n", m_pCurrentEntity->angles[YAW], m_pPlayerInfo->gaityaw );

// calc side to side turning
flYaw = m_pCurrentEntity->angles[YAW] - m_pPlayerInfo->gaityaw;
flYaw = flYaw - (int)(flYaw / 360) * 360;
Expand Down
1 change: 0 additions & 1 deletion cl_dll/ammo.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#define MAX_WEAPON_NAME 128


#define WEAPON_FLAGS_SELECTONEMPTY 1

#define WEAPON_IS_ONTARGET 0x40
Expand Down
30 changes: 0 additions & 30 deletions cl_dll/cdll_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "cl_util.h"
#include "netadr.h"
#include "interface.h"
//#include "vgui_schememanager.h"

#include "pm_shared.h"

Expand All @@ -42,7 +41,6 @@ cl_enginefunc_t gEngfuncs;
CHud gHUD;
TeamFortressViewport* gViewPort = NULL;


#include "particleman.h"
IParticleMan* g_pParticleMan = nullptr;

Expand Down Expand Up @@ -75,8 +73,6 @@ HUD_ConnectionlessPacket
*/
int DLLEXPORT HUD_ConnectionlessPacket(const struct netadr_s* net_from, const char* args, char* response_buffer, int* response_buffer_size)
{
// RecClConnectionlessPacket(net_from, args, response_buffer, response_buffer_size);

// Parse stuff from args
int max_buffer_size = *response_buffer_size;

Expand All @@ -91,22 +87,16 @@ int DLLEXPORT HUD_ConnectionlessPacket(const struct netadr_s* net_from, const ch

void DLLEXPORT HUD_PlayerMoveInit(struct playermove_s* ppmove)
{
// RecClClientMoveInit(ppmove);

PM_Init(ppmove);
}

char DLLEXPORT HUD_PlayerMoveTexture(char* name)
{
// RecClClientTextureType(name);

return PM_FindTextureType(name);
}

void DLLEXPORT HUD_PlayerMove(struct playermove_s* ppmove, int server)
{
// RecClClientMove(ppmove, server);

PM_Move(ppmove, server);
}

Expand Down Expand Up @@ -136,8 +126,6 @@ int DLLEXPORT Initialize(cl_enginefunc_t* pEnginefuncs, int iVersion)
{
gEngfuncs = *pEnginefuncs;

// RecClInitialize(pEnginefuncs, iVersion);

if (iVersion != CLDLL_INTERFACE_VERSION)
return 0;

Expand Down Expand Up @@ -168,7 +156,6 @@ so the HUD can reinitialize itself.

int DLLEXPORT HUD_VidInit()
{
// RecClHudVidInit();
gHUD.VidInit();

VGui_Startup();
Expand All @@ -188,7 +175,6 @@ the hud variables.

void DLLEXPORT HUD_Init()
{
// RecClHudInit();
InitInput();
gHUD.Init();
Scheme_Init();
Expand All @@ -206,8 +192,6 @@ redraw the HUD.

int DLLEXPORT HUD_Redraw(float time, int intermission)
{
// RecClHudRedraw(time, intermission);

gHUD.Redraw(time, 0 != intermission);

return 1;
Expand All @@ -229,8 +213,6 @@ returns 1 if anything has been changed, 0 otherwise.

int DLLEXPORT HUD_UpdateClientData(client_data_t* pcldata, float flTime)
{
// RecClHudUpdateClientData(pcldata, flTime);

IN_Commands();

return static_cast<int>(gHUD.UpdateClientData(pcldata, flTime));
Expand All @@ -246,8 +228,6 @@ Called at start and end of demos to restore to "non"HUD state.

void DLLEXPORT HUD_Reset()
{
// RecClHudReset();

gHUD.VidInit();
}

Expand All @@ -261,8 +241,6 @@ Called by engine every frame that client .dll is loaded

void DLLEXPORT HUD_Frame(double time)
{
// RecClHudFrame(time);

GetClientVoiceMgr()->Frame(time);
}

Expand All @@ -277,8 +255,6 @@ Called when a player starts or stops talking.

void DLLEXPORT HUD_VoiceStatus(int entindex, qboolean bTalking)
{
//// RecClVoiceStatus(entindex, bTalking);

GetClientVoiceMgr()->UpdateSpeakerStatus(entindex, 0 != bTalking);
}

Expand All @@ -292,8 +268,6 @@ Called when a director event message was received

void DLLEXPORT HUD_DirectorMessage(int iSize, void* pbuf)
{
// RecClDirectorMessage(iSize, pbuf);

gHUD.m_Spectator.DirectorMessage(iSize, pbuf);
}

Expand Down Expand Up @@ -378,10 +352,6 @@ class CClientExports : public IGameClientExports
// returns the name of the server the user is connected to, if any
const char* GetServerHostName() override
{
/*if (gViewPortInterface)
{
return gViewPortInterface->GetServerName();
}*/
return "";
}

Expand Down
2 changes: 0 additions & 2 deletions cl_dll/cl_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ inline struct cvar_s* CVAR_CREATE(const char* cv, const char* val, const int fla
// ScreenWidth returns the width of the screen, in pixels
#define ScreenWidth (gHUD.m_scrinfo.iWidth)

#define BASE_XRES 640.f

// use this to project world coordinates to screen coordinates
#define XPROJECT(x) ((1.0f + (x)) * ScreenWidth * 0.5f)
#define YPROJECT(y) ((1.0f - (y)) * ScreenHeight * 0.5f)
Expand Down
2 changes: 0 additions & 2 deletions cl_dll/com_weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,4 @@ stub functions for such things as precaching. So we don't have to modify weapon
*/
int stub_PrecacheModel(const char* s) { return 0; }
int stub_PrecacheSound(const char* s) { return 0; }
unsigned short stub_PrecacheEvent(int type, const char* s) { return 0; }
const char* stub_NameForFunction(uint32 function) { return "func"; }
void stub_SetModel(edict_t* e, const char* m) {}
2 changes: 0 additions & 2 deletions cl_dll/com_weapons.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ void HUD_PlaybackEvent(int flags, const struct edict_s* pInvoker, unsigned short
void HUD_SetMaxSpeed(const struct edict_s* ed, float speed);
int stub_PrecacheModel(const char* s);
int stub_PrecacheSound(const char* s);
unsigned short stub_PrecacheEvent(int type, const char* s);
const char* stub_NameForFunction(uint32 function);
void stub_SetModel(struct edict_s* e, const char* m);


Expand Down
2 changes: 0 additions & 2 deletions cl_dll/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ Engine wants us to parse some data from the demo stream
*/
void DLLEXPORT Demo_ReadBuffer(int size, unsigned char* buffer)
{
// RecClReadDemoBuffer(size, buffer);

int type;
int i = 0;

Expand Down
Loading

0 comments on commit 2e868e1

Please sign in to comment.