Skip to content

Commit ade05ab

Browse files
committed
dedicated(win32): fix build issues #322
1 parent 7c863a3 commit ade05ab

File tree

9 files changed

+55
-47
lines changed

9 files changed

+55
-47
lines changed

dedicated_main/dedicated_main.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88
// Generated from the TEXTINCLUDE 2 resource.
99
//
10-
#include "afxres.h"
10+
#include "windows.h"
1111

1212
/////////////////////////////////////////////////////////////////////////////
1313
#undef APSTUDIO_READONLY_SYMBOLS

engine/baseclient.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,11 +706,13 @@ bool CBaseClient::SendServerInfo( void )
706706

707707
serverinfo.WriteToBuffer( msg );
708708

709-
if ( IsX360() && serverinfo.m_nMaxClients > 1 )
709+
#ifdef _X360
710+
if ( serverinfo.m_nMaxClients > 1 )
710711
{
711712
Msg( "Telling clients to connect" );
712713
g_pMatchmaking->TellClientsToConnect();
713714
}
715+
#endif
714716

715717
// send first tick
716718
m_nSignonTick = m_Server->m_nTickCount;

engine/cl_null.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "client_pch.h"
88
#ifdef SWDS
9+
#include "igame.h"
910
#include "hltvclientstate.h"
1011
#include "convar.h"
1112
#include "enginestats.h"
@@ -37,9 +38,9 @@ bool CL_IsPortalDemo()
3738

3839
bool HandleRedirectAndDebugLog( const char *msg );
3940

40-
void BeginLoadingUpdates( MaterialNonInteractiveMode_t mode ) {}
41+
//void BeginLoadingUpdates( MaterialNonInteractiveMode_t mode ) {}
42+
//void EndLoadingUpdates() {}
4143
void RefreshScreenIfNecessary() {}
42-
void EndLoadingUpdates() {}
4344

4445

4546
void Con_ColorPrintf( const Color& clr, const char *fmt, ... )
@@ -190,4 +191,8 @@ CClientState cl;
190191
char g_minidumpinfo[ 4096 ] = {0};
191192
PAGED_POOL_INFO_t g_pagedpoolinfo = { 0 };
192193

194+
int g_iVCRPlaybackSleepInterval = 0;
195+
IGame *game = NULL;
196+
197+
193198
#endif

engine/common.cpp

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -97,22 +97,19 @@ COM_ExplainDisconnection
9797
*/
9898
void COM_ExplainDisconnection( bool bPrint, const char *fmt, ... )
9999
{
100-
if ( IsX360() )
101-
{
102-
g_pMatchmaking->SessionNotification( SESSION_NOTIFY_LOST_SERVER );
103-
}
104-
else
105-
{
106-
va_list argptr;
107-
char string[1024];
100+
#ifdef _X360
101+
g_pMatchmaking->SessionNotification( SESSION_NOTIFY_LOST_SERVER );
102+
#else
103+
va_list argptr;
104+
char string[1024];
108105

109-
va_start (argptr, fmt);
110-
Q_vsnprintf(string, sizeof( string ), fmt,argptr);
111-
va_end (argptr);
106+
va_start (argptr, fmt);
107+
Q_vsnprintf(string, sizeof( string ), fmt,argptr);
108+
va_end (argptr);
112109

113-
Q_strncpy( gszDisconnectReason, string, 256 );
114-
gfExtendedError = true;
115-
}
110+
Q_strncpy( gszDisconnectReason, string, 256 );
111+
gfExtendedError = true;
112+
#endif
116113

117114
if ( bPrint )
118115
{
@@ -146,21 +143,18 @@ COM_ExtendedExplainDisconnection
146143
*/
147144
void COM_ExtendedExplainDisconnection( bool bPrint, const char *fmt, ... )
148145
{
149-
if ( IsX360() )
150-
{
151-
g_pMatchmaking->SessionNotification( SESSION_NOTIFY_LOST_SERVER );
152-
}
153-
else
154-
{
155-
va_list argptr;
156-
char string[1024];
157-
158-
va_start (argptr, fmt);
159-
Q_vsnprintf(string, sizeof( string ), fmt,argptr);
160-
va_end (argptr);
146+
#ifdef _X360
147+
g_pMatchmaking->SessionNotification( SESSION_NOTIFY_LOST_SERVER );
148+
#else
149+
va_list argptr;
150+
char string[1024];
161151

162-
Q_strncpy( gszExtendedDisconnectReason, string, 256 );
163-
}
152+
va_start (argptr, fmt);
153+
Q_vsnprintf(string, sizeof( string ), fmt,argptr);
154+
va_end (argptr);
155+
156+
Q_strncpy( gszExtendedDisconnectReason, string, 256 );
157+
#endif
164158

165159
if ( bPrint )
166160
{

engine/host.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3500,10 +3500,12 @@ void _Host_RunFrame (float time)
35003500
//-------------------
35013501
_Host_RunFrame_Sound();
35023502

3503+
#ifndef DEDICATED
35033504
if ( g_bVCRSingleStep )
35043505
{
35053506
VCR_EnterPausedState();
35063507
}
3508+
#endif
35073509
}
35083510
else
35093511
{

engine/l_studio.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4353,20 +4353,20 @@ ModelInstanceHandle_t CModelRender::CreateInstance( IClientRenderable *pRenderab
43534353

43544354
// validate static color meshes once, now at load/create time
43554355
ValidateStaticPropColorData( handle );
4356-
4356+
43574357
// 360 persists the color meshes across same map loads
4358-
if ( !IsX360() || instance.m_ColorMeshHandle == DC_INVALID_HANDLE )
4358+
#ifdef _X360
4359+
if ( r_decalstaticprops.GetBool() && instance.m_LightCacheHandle )
4360+
instance.m_AmbientLightingState = *(LightcacheGetStatic( *pCache, NULL, LIGHTCACHEFLAGS_STATIC ));
4361+
#else
4362+
if ( instance.m_ColorMeshHandle == DC_INVALID_HANDLE )
43594363
{
43604364
// builds out color meshes or loads disk colors, now at load/create time
43614365
RecomputeStaticLighting( handle );
43624366
}
4363-
else
4364-
if ( r_decalstaticprops.GetBool() && instance.m_LightCacheHandle )
4365-
{
4366-
instance.m_AmbientLightingState = *(LightcacheGetStatic( *pCache, NULL, LIGHTCACHEFLAGS_STATIC ));
4367-
}
4367+
#endif
43684368
}
4369-
4369+
43704370
return handle;
43714371
}
43724372

engine/sys_dll.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,7 @@ void Sys_NoCrashDialog()
15341534

15351535
void Sys_TestSendKey( const char *pKey )
15361536
{
1537-
#if defined(_WIN32) && !defined(USE_SDL) && !defined(_XBOX)
1537+
#if defined(_WIN32) && !defined(USE_SDL) && !defined(_XBOX) && !defined(DEDICATED)
15381538
int key = pKey[0];
15391539
if ( pKey[0] == '\\' && pKey[1] == 'r' )
15401540
{

engine/wscript

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,17 @@ def build(bld):
212212
]
213213
if bld.env.DEST_OS != "darwin":
214214
source += ['audio/snd_dev_sdl.cpp']
215-
215+
216+
source_win = [
217+
'audio/snd_dev_direct.cpp',
218+
'audio/snd_dev_wave.cpp',
219+
'audio/voice_mixer_controls.cpp',
220+
'audio/voice_record_dsound.cpp'
221+
]
216222

217223
if bld.env.DEST_OS == 'win32':
218-
source += [
224+
source += [
219225
'../public/tier0/memoverride.cpp',
220-
'audio/snd_dev_direct.cpp',
221-
'audio/snd_dev_wave.cpp',
222-
'audio/voice_mixer_controls.cpp',
223-
'audio/voice_record_dsound.cpp',
224226
]
225227
else:
226228
source += [
@@ -231,6 +233,8 @@ def build(bld):
231233
if bld.env.DEDICATED:
232234
source += ['cl_null.cpp']
233235
else:
236+
source += source_win if bld.env.DEST_OS == 'win32' else []
237+
234238
source += [
235239
'client_pch.cpp',
236240
'cl_rcon.cpp',

wscript

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ projects={
140140
'tier1',
141141
'tier2',
142142
'tier3',
143+
'vgui2/vgui_controls',
143144
'vphysics',
144145
'vpklib',
145146
'vstdlib',

0 commit comments

Comments
 (0)