Skip to content

Commit

Permalink
Move dedicated server out *_DEDICATED configuration
Browse files Browse the repository at this point in the history
Now you can run dedicated server with -dedicated command line key
Enabled xrD3D9-Null build on x64 platform
  • Loading branch information
Xottab-DUTY committed Jan 7, 2018
1 parent d4c02af commit 2d37233
Show file tree
Hide file tree
Showing 16 changed files with 148 additions and 902 deletions.
29 changes: 4 additions & 25 deletions src/Layers/xrRender/HW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ void CHW::Reset(HWND hwnd)
_RELEASE(pBaseRT);

#ifndef _EDITOR
//#ifndef DEDICATED_SERVER
// BOOL bWindowed = !psDeviceFlags.is (rsFullscreen);
//#else
// BOOL bWindowed = TRUE;
//#endif
BOOL bWindowed = TRUE;
bool bWindowed = true;
if (!GEnv.isDedicatedServer)
bWindowed = !psDeviceFlags.is(rsFullscreen);

Expand All @@ -67,7 +62,7 @@ void CHW::Reset(HWND hwnd)
}
#endif

while (TRUE)
while (true)
{
HRESULT _hr = HW.pDevice->Reset(&DevPP);
if (SUCCEEDED(_hr))
Expand Down Expand Up @@ -199,20 +194,11 @@ void CHW::CreateDevice(HWND m_hWnd, bool move_window)
m_move_window = move_window;
CreateD3D();

// General - select adapter and device
//#ifdef DEDICATED_SERVER
// BOOL bWindowed = TRUE;
//#else
// BOOL bWindowed = !psDeviceFlags.is(rsFullscreen);
//#endif

BOOL bWindowed = TRUE;
bool bWindowed = true;

#ifndef _EDITOR
if (!GEnv.isDedicatedServer)
bWindowed = !psDeviceFlags.is(rsFullscreen);
#else
bWindowed = 1;
#endif

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

void CHW::updateWindowProps(HWND m_hWnd)
{
//BOOL bWindowed = strstr(Core.Params,"-dedicated") ? TRUE : !psDeviceFlags.is(rsFullscreen);
//#ifndef DEDICATED_SERVER
//BOOL bWindowed = !psDeviceFlags.is(rsFullscreen);
//#else
//BOOL bWindowed = TRUE;
//#endif

BOOL bWindowed = TRUE;
bool bWindowed = true;
#ifndef _EDITOR
if (!GEnv.isDedicatedServer)
bWindowed = !psDeviceFlags.is(rsFullscreen);
Expand Down
8 changes: 0 additions & 8 deletions src/Layers/xrRender/R_Backend_Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@

void CBackend::OnFrameEnd()
{
//#ifndef DEDICATED_SERVER
#ifndef _EDITOR
if (!GEnv.isDedicatedServer)
#endif
{
#if defined(USE_DX10) || defined(USE_DX11)
HW.pContext->ClearState();
Expand All @@ -34,15 +31,11 @@ void CBackend::OnFrameEnd()
Invalidate();
#endif // USE_DX10
}
//#endif
}

void CBackend::OnFrameBegin()
{
//#ifndef DEDICATED_SERVER
#ifndef _EDITOR
if (!GEnv.isDedicatedServer)
#endif
{
PGO(Msg("PGO:*****frame[%d]*****", RDEVICE.dwFrame));
#if defined(USE_DX10) || defined(USE_DX11)
Expand All @@ -57,7 +50,6 @@ void CBackend::OnFrameBegin()
Index.Flush();
set_Stencil(FALSE);
}
//#endif
}

void CBackend::Invalidate()
Expand Down
42 changes: 6 additions & 36 deletions src/Layers/xrRender/ResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,56 +268,33 @@ Shader* CResourceManager::_cpp_Create(

Shader* CResourceManager::_cpp_Create(LPCSTR s_shader, LPCSTR s_textures, LPCSTR s_constants, LPCSTR s_matrices)
{
//#ifndef DEDICATED_SERVER
#ifndef _EDITOR
if (!GEnv.isDedicatedServer)
#endif
{
// TODO: DX10: When all shaders are ready switch to common path
#if defined(USE_DX10) || defined(USE_DX11)
IBlender* pBlender = _GetBlender(s_shader ? s_shader : "null");
if (!pBlender)
return NULL;
return nullptr;
return _cpp_Create(pBlender, s_shader, s_textures, s_constants, s_matrices);
#else // USE_DX10
return _cpp_Create(_GetBlender(s_shader ? s_shader : "null"), s_shader, s_textures, s_constants, s_matrices);
#endif // USE_DX10
//#else
}
#ifndef _EDITOR
else
#endif
{
return nullptr;
}
//#endif
return nullptr;
}

Shader* CResourceManager::Create(IBlender* B, LPCSTR s_shader, LPCSTR s_textures, LPCSTR s_constants, LPCSTR s_matrices)
{
//#ifndef DEDICATED_SERVER
#ifndef _EDITOR
if (!GEnv.isDedicatedServer)
#endif
{
return _cpp_Create(B, s_shader, s_textures, s_constants, s_matrices);
//#else
}
#ifndef _EDITOR
else
#endif
{
if (GEnv.isDedicatedServer)
return nullptr;
//#endif
}

return _cpp_Create(B, s_shader, s_textures, s_constants, s_matrices);
}

Shader* CResourceManager::Create(LPCSTR s_shader, LPCSTR s_textures, LPCSTR s_constants, LPCSTR s_matrices)
{
//#ifndef DEDICATED_SERVER
#ifndef _EDITOR
if (!GEnv.isDedicatedServer)
#endif
{
// TODO: DX10: When all shaders are ready switch to common path
#if defined(USE_DX10) || defined(USE_DX11)
Expand Down Expand Up @@ -348,14 +325,7 @@ Shader* CResourceManager::Create(LPCSTR s_shader, LPCSTR s_textures, LPCSTR s_co
return _cpp_Create(s_shader, s_textures, s_constants, s_matrices);
#endif // USE_DX10
}
//#else
#ifndef _EDITOR
else
#endif
{
return nullptr;
}
//#endif
return nullptr;
}

void CResourceManager::Delete(const Shader* S)
Expand Down
4 changes: 0 additions & 4 deletions src/Layers/xrRender/SH_Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ void CTexture::Load()
}

Preload();
//#ifndef DEDICATED_SERVER
#ifndef _EDITOR
if (!GEnv.isDedicatedServer)
#endif
{
// Check for OGM
string_path fn;
Expand Down Expand Up @@ -286,7 +283,6 @@ void CTexture::Load()
flags.MemoryUsage = mem;
}
}
//#endif
}
PostLoad();
}
Expand Down
Loading

0 comments on commit 2d37233

Please sign in to comment.