Skip to content

Commit 2d37233

Browse files
committed
Move dedicated server out *_DEDICATED configuration
Now you can run dedicated server with -dedicated command line key Enabled xrD3D9-Null build on x64 platform
1 parent d4c02af commit 2d37233

File tree

16 files changed

+148
-902
lines changed

16 files changed

+148
-902
lines changed

src/Layers/xrRender/HW.cpp

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ void CHW::Reset(HWND hwnd)
4242
_RELEASE(pBaseRT);
4343

4444
#ifndef _EDITOR
45-
//#ifndef DEDICATED_SERVER
46-
// BOOL bWindowed = !psDeviceFlags.is (rsFullscreen);
47-
//#else
48-
// BOOL bWindowed = TRUE;
49-
//#endif
50-
BOOL bWindowed = TRUE;
45+
bool bWindowed = true;
5146
if (!GEnv.isDedicatedServer)
5247
bWindowed = !psDeviceFlags.is(rsFullscreen);
5348

@@ -67,7 +62,7 @@ void CHW::Reset(HWND hwnd)
6762
}
6863
#endif
6964

70-
while (TRUE)
65+
while (true)
7166
{
7267
HRESULT _hr = HW.pDevice->Reset(&DevPP);
7368
if (SUCCEEDED(_hr))
@@ -199,20 +194,11 @@ void CHW::CreateDevice(HWND m_hWnd, bool move_window)
199194
m_move_window = move_window;
200195
CreateD3D();
201196

202-
// General - select adapter and device
203-
//#ifdef DEDICATED_SERVER
204-
// BOOL bWindowed = TRUE;
205-
//#else
206-
// BOOL bWindowed = !psDeviceFlags.is(rsFullscreen);
207-
//#endif
208-
209-
BOOL bWindowed = TRUE;
197+
bool bWindowed = true;
210198

211199
#ifndef _EDITOR
212200
if (!GEnv.isDedicatedServer)
213201
bWindowed = !psDeviceFlags.is(rsFullscreen);
214-
#else
215-
bWindowed = 1;
216202
#endif
217203

218204
DevAdapter = D3DADAPTER_DEFAULT;
@@ -512,14 +498,7 @@ BOOL CHW::support(D3DFORMAT fmt, DWORD type, DWORD usage)
512498

513499
void CHW::updateWindowProps(HWND m_hWnd)
514500
{
515-
//BOOL bWindowed = strstr(Core.Params,"-dedicated") ? TRUE : !psDeviceFlags.is(rsFullscreen);
516-
//#ifndef DEDICATED_SERVER
517-
//BOOL bWindowed = !psDeviceFlags.is(rsFullscreen);
518-
//#else
519-
//BOOL bWindowed = TRUE;
520-
//#endif
521-
522-
BOOL bWindowed = TRUE;
501+
bool bWindowed = true;
523502
#ifndef _EDITOR
524503
if (!GEnv.isDedicatedServer)
525504
bWindowed = !psDeviceFlags.is(rsFullscreen);

src/Layers/xrRender/R_Backend_Runtime.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515

1616
void CBackend::OnFrameEnd()
1717
{
18-
//#ifndef DEDICATED_SERVER
19-
#ifndef _EDITOR
2018
if (!GEnv.isDedicatedServer)
21-
#endif
2219
{
2320
#if defined(USE_DX10) || defined(USE_DX11)
2421
HW.pContext->ClearState();
@@ -34,15 +31,11 @@ void CBackend::OnFrameEnd()
3431
Invalidate();
3532
#endif // USE_DX10
3633
}
37-
//#endif
3834
}
3935

4036
void CBackend::OnFrameBegin()
4137
{
42-
//#ifndef DEDICATED_SERVER
43-
#ifndef _EDITOR
4438
if (!GEnv.isDedicatedServer)
45-
#endif
4639
{
4740
PGO(Msg("PGO:*****frame[%d]*****", RDEVICE.dwFrame));
4841
#if defined(USE_DX10) || defined(USE_DX11)
@@ -57,7 +50,6 @@ void CBackend::OnFrameBegin()
5750
Index.Flush();
5851
set_Stencil(FALSE);
5952
}
60-
//#endif
6153
}
6254

6355
void CBackend::Invalidate()

src/Layers/xrRender/ResourceManager.cpp

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -268,56 +268,33 @@ Shader* CResourceManager::_cpp_Create(
268268

269269
Shader* CResourceManager::_cpp_Create(LPCSTR s_shader, LPCSTR s_textures, LPCSTR s_constants, LPCSTR s_matrices)
270270
{
271-
//#ifndef DEDICATED_SERVER
272-
#ifndef _EDITOR
273271
if (!GEnv.isDedicatedServer)
274-
#endif
275272
{
276273
// TODO: DX10: When all shaders are ready switch to common path
277274
#if defined(USE_DX10) || defined(USE_DX11)
278275
IBlender* pBlender = _GetBlender(s_shader ? s_shader : "null");
279276
if (!pBlender)
280-
return NULL;
277+
return nullptr;
281278
return _cpp_Create(pBlender, s_shader, s_textures, s_constants, s_matrices);
282279
#else // USE_DX10
283280
return _cpp_Create(_GetBlender(s_shader ? s_shader : "null"), s_shader, s_textures, s_constants, s_matrices);
284281
#endif // USE_DX10
285282
//#else
286283
}
287-
#ifndef _EDITOR
288-
else
289-
#endif
290-
{
291-
return nullptr;
292-
}
293-
//#endif
284+
return nullptr;
294285
}
295286

296287
Shader* CResourceManager::Create(IBlender* B, LPCSTR s_shader, LPCSTR s_textures, LPCSTR s_constants, LPCSTR s_matrices)
297288
{
298-
//#ifndef DEDICATED_SERVER
299-
#ifndef _EDITOR
300-
if (!GEnv.isDedicatedServer)
301-
#endif
302-
{
303-
return _cpp_Create(B, s_shader, s_textures, s_constants, s_matrices);
304-
//#else
305-
}
306-
#ifndef _EDITOR
307-
else
308-
#endif
309-
{
289+
if (GEnv.isDedicatedServer)
310290
return nullptr;
311-
//#endif
312-
}
291+
292+
return _cpp_Create(B, s_shader, s_textures, s_constants, s_matrices);
313293
}
314294

315295
Shader* CResourceManager::Create(LPCSTR s_shader, LPCSTR s_textures, LPCSTR s_constants, LPCSTR s_matrices)
316296
{
317-
//#ifndef DEDICATED_SERVER
318-
#ifndef _EDITOR
319297
if (!GEnv.isDedicatedServer)
320-
#endif
321298
{
322299
// TODO: DX10: When all shaders are ready switch to common path
323300
#if defined(USE_DX10) || defined(USE_DX11)
@@ -348,14 +325,7 @@ Shader* CResourceManager::Create(LPCSTR s_shader, LPCSTR s_textures, LPCSTR s_co
348325
return _cpp_Create(s_shader, s_textures, s_constants, s_matrices);
349326
#endif // USE_DX10
350327
}
351-
//#else
352-
#ifndef _EDITOR
353-
else
354-
#endif
355-
{
356-
return nullptr;
357-
}
358-
//#endif
328+
return nullptr;
359329
}
360330

361331
void CResourceManager::Delete(const Shader* S)

src/Layers/xrRender/SH_Texture.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,7 @@ void CTexture::Load()
167167
}
168168

169169
Preload();
170-
//#ifndef DEDICATED_SERVER
171-
#ifndef _EDITOR
172170
if (!GEnv.isDedicatedServer)
173-
#endif
174171
{
175172
// Check for OGM
176173
string_path fn;
@@ -286,7 +283,6 @@ void CTexture::Load()
286283
flags.MemoryUsage = mem;
287284
}
288285
}
289-
//#endif
290286
}
291287
PostLoad();
292288
}

0 commit comments

Comments
 (0)