Skip to content

Commit 9451e96

Browse files
committed
Merge branch 'xd_dev' of https://github.com/OpenXRay/xray-16 into sync
2 parents ce5510e + f3b5bd6 commit 9451e96

File tree

172 files changed

+4411
-4358
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+4411
-4358
lines changed

Externals/luabind.vcxproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@
172172
<ClInclude Include="luabind\luabind\scope.hpp" />
173173
<ClInclude Include="luabind\luabind\set_package_preload.hpp" />
174174
<ClInclude Include="luabind\luabind\shared_ptr_converter.hpp" />
175-
<ClInclude Include="luabind\luabind\tag_function.hpp" />
176175
<ClInclude Include="luabind\luabind\typeid.hpp" />
177176
<ClInclude Include="luabind\luabind\types.hpp" />
178177
<ClInclude Include="luabind\luabind\version.hpp" />

Externals/luabind.vcxproj.filters

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,6 @@
355355
<ClInclude Include="luabind\luabind\shared_ptr_converter.hpp">
356356
<Filter>include</Filter>
357357
</ClInclude>
358-
<ClInclude Include="luabind\luabind\tag_function.hpp">
359-
<Filter>include</Filter>
360-
</ClInclude>
361358
<ClInclude Include="luabind\luabind\typeid.hpp">
362359
<Filter>include</Filter>
363360
</ClInclude>

src/Include/xrAPI/xrAPI.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class CRender;
1111
class CScriptEngine;
1212
class AISpaceBase;
1313
class ISoundManager;
14-
class ui_core;
14+
class UICore;
1515

1616
class XRAPI_API EngineGlobalEnvironment
1717
{
@@ -28,7 +28,7 @@ class XRAPI_API EngineGlobalEnvironment
2828
CScriptEngine* ScriptEngine;
2929
AISpaceBase* AISpace;
3030
ISoundManager* Sound;
31-
ui_core* UI;
31+
UICore* UI;
3232

3333
bool isEditor;
3434
bool isDedicatedServer;

src/Layers/xrRender/HW.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ class CHW
128128
void UpdateViews();
129129
#endif
130130
#if defined(USE_DX10) || defined(USE_DX11)
131+
bool CheckFormatSupport(DXGI_FORMAT format, D3D_FORMAT_SUPPORT feature) const;
132+
DXGI_FORMAT SelectFormat(D3D_FORMAT_SUPPORT feature, const DXGI_FORMAT formats[], size_t count) const;
131133
virtual void OnAppActivate();
132134
virtual void OnAppDeactivate();
133135
#endif // USE_DX10

src/Layers/xrRender/ResourceManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class ECORE_API CResourceManager
258258
T* CreateShader(const char* name, const char* filename = nullptr, const bool searchForEntryAndTarget = false);
259259

260260
template <typename T>
261-
void DestroyShader(const T* sh);
261+
bool DestroyShader(const T* sh);
262262
};
263263

264264
#endif // ResourceManagerH

src/Layers/xrRender/ShaderResourceTraits.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,14 +392,13 @@ inline T* CResourceManager::CreateShader(const char* name, const char* filename
392392
FS.update_path(cname, "$game_shaders$", cname);
393393
file = FS.r_open(cname);
394394
}
395-
R_ASSERT2(file, cname);
395+
R_ASSERT3(file, "Shader file doesnt exist:", cname);
396396

397397
// Duplicate and zero-terminate
398398
const auto size = file->length();
399399
char* const data = (LPSTR)_alloca(size + 1);
400400
CopyMemory(data, file->pointer(), size);
401401
data[size] = 0;
402-
FS.r_close(file);
403402

404403
// Select target
405404
LPCSTR c_target = ShaderTypeTraits<T>::GetCompilationTarget();
@@ -417,8 +416,9 @@ inline T* CResourceManager::CreateShader(const char* name, const char* filename
417416
#endif
418417

419418
// Compile
420-
HRESULT const _hr = GEnv.Render->shader_compile(name, (DWORD const*)data, size,
421-
c_entry, c_target, flags, (void*&)sh);
419+
HRESULT const _hr = GEnv.Render->shader_compile(name, file, c_entry, c_target, flags, (void*&)sh);
420+
421+
FS.r_close(file);
422422

423423
VERIFY(SUCCEEDED(_hr));
424424

@@ -432,10 +432,10 @@ inline T* CResourceManager::CreateShader(const char* name, const char* filename
432432
}
433433

434434
template <typename T>
435-
inline void CResourceManager::DestroyShader(const T* sh)
435+
bool CResourceManager::DestroyShader(const T* sh)
436436
{
437437
if (0 == (sh->dwFlags & xr_resource_flagged::RF_REGISTERED))
438-
return;
438+
return false;
439439

440440
typename ShaderTypeTraits<T>::MapType& sh_map = GetShaderMap<typename ShaderTypeTraits<T>::MapType>();
441441

@@ -445,7 +445,9 @@ inline void CResourceManager::DestroyShader(const T* sh)
445445
if (iterator != sh_map.end())
446446
{
447447
sh_map.erase(iterator);
448-
return;
448+
return true;
449449
}
450+
450451
Msg("! ERROR: Failed to find compiled shader '%s'", sh->cName.c_str());
452+
return false;
451453
}

src/Layers/xrRenderDX10/3DFluid/dx103DFluidData.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,17 @@
55

66
namespace
77
{
8-
const xr_token simulation_type_token[] = {{"Fog", dx103DFluidData::ST_FOG}, {"Fire", dx103DFluidData::ST_FIRE}, {0, 0}};
8+
const xr_token simulation_type_token[] = {
9+
{"Fog", dx103DFluidData::ST_FOG},
10+
{"Fire", dx103DFluidData::ST_FIRE},
11+
{0, 0}
12+
};
913

10-
const xr_token emitter_type_token[] = {{"SimpleGaussian", dx103DFluidEmitters::ET_SimpleGausian},
11-
{"SimpleDraught", dx103DFluidEmitters::ET_SimpleDraught}, {0, 0}};
14+
const xr_token emitter_type_token[] = {
15+
{"SimpleGaussian", dx103DFluidEmitters::ET_SimpleGausian},
16+
{"SimpleDraught", dx103DFluidEmitters::ET_SimpleDraught},
17+
{0, 0}
18+
};
1219
}
1320

1421
DXGI_FORMAT dx103DFluidData::m_VPRenderTargetFormats[VP_NUM_TARGETS] = {
@@ -20,7 +27,7 @@ DXGI_FORMAT dx103DFluidData::m_VPRenderTargetFormats[VP_NUM_TARGETS] = {
2027
dx103DFluidData::dx103DFluidData()
2128
{
2229
D3D_TEXTURE3D_DESC desc;
23-
desc.BindFlags = D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET;
30+
desc.BindFlags = D3D_BIND_SHADER_RESOURCE | D3D_BIND_RENDER_TARGET;
2431
desc.CPUAccessFlags = 0;
2532
desc.MipLevels = 1;
2633
desc.MiscFlags = 0;

src/Layers/xrRenderDX10/3DFluid/dx103DFluidManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void dx103DFluidManager::Initialize(int width, int height, int depth)
104104
InitShaders();
105105

106106
D3D_TEXTURE3D_DESC desc;
107-
desc.BindFlags = D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET;
107+
desc.BindFlags = D3D_BIND_SHADER_RESOURCE | D3D_BIND_RENDER_TARGET;
108108
desc.CPUAccessFlags = 0;
109109
desc.MipLevels = 1;
110110
desc.MiscFlags = 0;

src/Layers/xrRenderDX10/Blender_Recorder_R3.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ void CBlender_Compile::r_Pass(LPCSTR _vs, LPCSTR _gs, LPCSTR _ps, bool bFog, BOO
197197
#ifdef USE_DX11
198198
dest.hs = RImplementation.Resources->_CreateHS("null");
199199
dest.ds = RImplementation.Resources->_CreateDS("null");
200+
dest.cs = RImplementation.Resources->_CreateCS("null");
200201
#endif
201202
ctable.merge(&ps->constants);
202203
ctable.merge(&vs->constants);

src/Layers/xrRenderDX10/DXCommonTypes.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ typedef ID3D11DeviceContext ID3DDeviceContext;
8888
#define D3D_CULL_FRONT D3D11_CULL_FRONT
8989
#define D3D_CULL_BACK D3D11_CULL_BACK
9090

91+
#define D3D_CREATE_DEVICE_DEBUG D3D11_CREATE_DEVICE_DEBUG
92+
9193
#define D3D_COMPARISON_NEVER D3D11_COMPARISON_NEVER
9294
#define D3D_COMPARISON_LESS D3D11_COMPARISON_LESS
9395
#define D3D_COMPARISON_EQUAL D3D11_COMPARISON_EQUAL
@@ -147,6 +149,10 @@ typedef ID3D11DeviceContext ID3DDeviceContext;
147149
#define D3D_FILL_SOLID D3D11_FILL_SOLID
148150
#define D3D_FILL_WIREFRAME D3D11_FILL_WIREFRAME
149151

152+
#define D3D_FORMAT_SUPPORT D3D11_FORMAT_SUPPORT
153+
#define D3D_FORMAT_SUPPORT_DEPTH_STENCIL D3D11_FORMAT_SUPPORT_DEPTH_STENCIL
154+
#define D3D_FORMAT_SUPPORT_DISPLAY D3D11_FORMAT_SUPPORT_DISPLAY
155+
150156
#define D3D_INPUT_PER_VERTEX_DATA D3D11_INPUT_PER_VERTEX_DATA
151157

152158
#define D3D_BIND_INDEX_BUFFER D3D11_BIND_INDEX_BUFFER
@@ -342,6 +348,8 @@ typedef ID3D10Resource ID3DResource;
342348
#define D3D_CULL_FRONT D3D10_CULL_FRONT
343349
#define D3D_CULL_BACK D3D10_CULL_BACK
344350

351+
#define D3D_CREATE_DEVICE_DEBUG D3D10_CREATE_DEVICE_DEBUG
352+
345353
#define D3D_COMPARISON_NEVER D3D10_COMPARISON_NEVER
346354
#define D3D_COMPARISON_LESS D3D10_COMPARISON_LESS
347355
#define D3D_COMPARISON_EQUAL D3D10_COMPARISON_EQUAL
@@ -401,6 +409,10 @@ typedef ID3D10Resource ID3DResource;
401409
#define D3D_FILL_SOLID D3D10_FILL_SOLID
402410
#define D3D_FILL_WIREFRAME D3D10_FILL_WIREFRAME
403411

412+
#define D3D_FORMAT_SUPPORT D3D10_FORMAT_SUPPORT
413+
#define D3D_FORMAT_SUPPORT_DEPTH_STENCIL D3D10_FORMAT_SUPPORT_DEPTH_STENCIL
414+
#define D3D_FORMAT_SUPPORT_DISPLAY D3D10_FORMAT_SUPPORT_DISPLAY
415+
404416
#define D3D_INPUT_PER_VERTEX_DATA D3D10_INPUT_PER_VERTEX_DATA
405417

406418
#define D3D_BIND_INDEX_BUFFER D3D10_BIND_INDEX_BUFFER

0 commit comments

Comments
 (0)