forked from nillerusr/source-engine
-
Notifications
You must be signed in to change notification settings - Fork 2
/
cl_null.cpp
194 lines (164 loc) · 5.95 KB
/
cl_null.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: replaces the cl_*.cpp files with stubs
//
//=============================================================================//
#include "client_pch.h"
#ifdef SWDS
#include "igame.h"
#include "hltvclientstate.h"
#include "convar.h"
#include "enginestats.h"
#include "bspfile.h" // dworldlight_t
#include "soundservice.h"
#include "tier0/systeminformation.h"
ISoundServices *g_pSoundServices = NULL;
Vector listener_origin;
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#define MAXPRINTMSG 4096
CEngineStats g_EngineStats;
ClientClass *g_pClientClassHead = NULL;
bool CL_IsHL2Demo()
{
return false;
}
bool CL_IsPortalDemo()
{
return false;
}
bool HandleRedirectAndDebugLog( const char *msg );
//void BeginLoadingUpdates( MaterialNonInteractiveMode_t mode ) {}
//void EndLoadingUpdates() {}
void RefreshScreenIfNecessary() {}
void Con_ColorPrintf( const Color& clr, const char *fmt, ... )
{
va_list argptr;
char msg[MAXPRINTMSG];
static bool inupdate;
if ( !host_initialized )
return;
va_start (argptr,fmt);
Q_vsnprintf (msg,sizeof( msg ), fmt,argptr);
va_end (argptr);
if ( !HandleRedirectAndDebugLog( msg ) )
{
return;
}
return;
// printf( "%s", msg );
}
void Con_NPrintf( int pos, const char *fmt, ... )
{
va_list argptr;
char text[4096];
va_start (argptr, fmt);
Q_vsnprintf(text, sizeof( text ), fmt, argptr);
va_end (argptr);
return;
// printf( "%s", text );
}
void SCR_UpdateScreen (void)
{
}
void SCR_EndLoadingPlaque (void)
{
}
void ClientDLL_FrameStageNotify( ClientFrameStage_t frameStage )
{
}
ClientClass *ClientDLL_GetAllClasses( void )
{
return g_pClientClassHead;
}
#define LIGHT_MIN_LIGHT_VALUE 0.03f
float ComputeLightRadius( dworldlight_t *pLight, bool bIsHDR )
{
float flLightRadius = pLight->radius;
if (flLightRadius == 0.0f)
{
// Compute the light range based on attenuation factors
float flIntensity = sqrtf( DotProduct( pLight->intensity, pLight->intensity ) );
if (pLight->quadratic_attn == 0.0f)
{
if (pLight->linear_attn == 0.0f)
{
// Infinite, but we're not going to draw it as such
flLightRadius = 2000;
}
else
{
flLightRadius = (flIntensity / LIGHT_MIN_LIGHT_VALUE - pLight->constant_attn) / pLight->linear_attn;
}
}
else
{
float a = pLight->quadratic_attn;
float b = pLight->linear_attn;
float c = pLight->constant_attn - flIntensity / LIGHT_MIN_LIGHT_VALUE;
float discrim = b * b - 4 * a * c;
if (discrim < 0.0f)
{
// Infinite, but we're not going to draw it as such
flLightRadius = 2000;
}
else
{
flLightRadius = (-b + sqrtf(discrim)) / (2.0f * a);
if (flLightRadius < 0)
flLightRadius = 0;
}
}
}
return flLightRadius;
}
CClientState::CClientState() {}
CClientState::~CClientState() {}
void CClientState::ConnectionClosing( const char * reason ) {}
void CClientState::ConnectionCrashed( const char * reason ) {}
bool CClientState::ProcessConnectionlessPacket( netpacket_t *packet ){ return false; }
void CClientState::PacketStart(int incoming_sequence, int outgoing_acknowledged) {}
void CClientState::PacketEnd( void ) {}
void CClientState::FileReceived( const char *fileName, unsigned int transferID ) {}
void CClientState::FileRequested( const char *fileName, unsigned int transferID ) {}
void CClientState::FileDenied(const char *fileName, unsigned int transferID ) {}
void CClientState::FileSent( const char *fileName, unsigned int transferID ) {}
void CClientState::Disconnect( const char *pszReason, bool showmainmenu ) {}
void CClientState::FullConnect( netadr_t &adr ) {}
bool CClientState::SetSignonState ( int state, int count ) { return false;}
void CClientState::SendClientInfo( void ) {}
void CClientState::SendServerCmdKeyValues( KeyValues *pKeyValues ) {}
void CClientState::InstallStringTableCallback( char const *tableName ) {}
bool CClientState::InstallEngineStringTableCallback( char const *tableName ) { return false;}
void CClientState::ReadEnterPVS( CEntityReadInfo &u ) {}
void CClientState::ReadLeavePVS( CEntityReadInfo &u ) {}
void CClientState::ReadDeltaEnt( CEntityReadInfo &u ) {}
void CClientState::ReadPreserveEnt( CEntityReadInfo &u ) {}
void CClientState::ReadDeletions( CEntityReadInfo &u ) {}
const char *CClientState::GetCDKeyHash( void ) { return "123";}
void CClientState::Clear( void ) {}
bool CClientState::ProcessGameEvent(SVC_GameEvent *msg) { return true; }
bool CClientState::ProcessUserMessage(SVC_UserMessage *msg) { return true; }
bool CClientState::ProcessEntityMessage(SVC_EntityMessage *msg) { return true; }
bool CClientState::ProcessBSPDecal( SVC_BSPDecal *msg ) { return true; }
bool CClientState::ProcessCrosshairAngle( SVC_CrosshairAngle *msg ) { return true; }
bool CClientState::ProcessFixAngle( SVC_FixAngle *msg ) { return true; }
bool CClientState::ProcessVoiceData( SVC_VoiceData *msg ) { return true; }
bool CClientState::ProcessVoiceInit( SVC_VoiceInit *msg ) { return true; }
bool CClientState::ProcessSetPause( SVC_SetPause *msg ) { return true; }
bool CClientState::ProcessSetPauseTimed( SVC_SetPauseTimed *msg ) { return true; }
bool CClientState::ProcessClassInfo( SVC_ClassInfo *msg ) { return true; }
bool CClientState::ProcessStringCmd( NET_StringCmd *msg ) { return true; }
bool CClientState::ProcessServerInfo( SVC_ServerInfo *msg ) { return true; }
bool CClientState::ProcessTick( NET_Tick *msg ) { return true; }
bool CClientState::ProcessTempEntities( SVC_TempEntities *msg ) { return true; }
bool CClientState::ProcessPacketEntities( SVC_PacketEntities *msg ) { return true; }
bool CClientState::ProcessSounds( SVC_Sounds *msg ) { return true; }
bool CClientState::ProcessPrefetch( SVC_Prefetch *msg ) {return true;}
float CClientState::GetTime() const { return 0.0f;}
void CClientState::RunFrame() {}
bool CClientState::HookClientStringTable( char const *tableName ) { return false; }
CClientState cl;
char g_minidumpinfo[ 4096 ] = {0};
PAGED_POOL_INFO_t g_pagedpoolinfo = { 0 };
#endif