Skip to content

Commit dd7e5e8

Browse files
committed
Reduce differences between files.
1 parent 9b9526a commit dd7e5e8

16 files changed

+53
-119
lines changed

src/Layers/xrRenderPC_R1/FStaticRender.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,7 @@ void CRender::DumpStatistics(IGameFont& font, IPerformanceAlert* alert)
723723
Sectors_xrc.DumpStatistics(font, alert);
724724
}
725725

726-
static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 const buffer_size, LPCSTR const file_name,
727-
void*& result, bool const disasm)
726+
static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 const buffer_size, LPCSTR const file_name, void*& result, bool const disasm)
728727
{
729728
HRESULT _result = E_FAIL;
730729
if (pTarget[0] == 'p')
@@ -751,7 +750,7 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
751750
Msg("! D3DXFindShaderComment hr == 0x%08x", _result);
752751
}
753752
}
754-
else
753+
else if (pTarget[0] == 'v')
755754
{
756755
SVS* svs_result = (SVS*)result;
757756
_result = HW.pDevice->CreateVertexShader(buffer, &svs_result->vs);
@@ -775,6 +774,10 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
775774
Msg("! D3DXFindShaderComment hr == 0x%08x", _result);
776775
}
777776
}
777+
else
778+
{
779+
NODEFAULT;
780+
}
778781

779782
if (disasm)
780783
{
@@ -791,9 +794,6 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
791794
return _result;
792795
}
793796

794-
static inline bool match_shader_id(
795-
LPCSTR const debug_shader_id, LPCSTR const full_shader_id, FS_FileSet const& file_set, string_path& result);
796-
797797
class includer : public ID3DXInclude
798798
{
799799
public:
@@ -829,6 +829,9 @@ class includer : public ID3DXInclude
829829
}
830830
};
831831

832+
static inline bool match_shader_id(
833+
LPCSTR const debug_shader_id, LPCSTR const full_shader_id, FS_FileSet const& file_set, string_path& result);
834+
832835
HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcDataLen, LPCSTR pFunctionName,
833836
LPCSTR pTarget, DWORD Flags, void*& result)
834837
{
@@ -837,7 +840,6 @@ HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcData
837840

838841
char sh_name[MAX_PATH] = "";
839842
u32 len = 0;
840-
841843
// options
842844
if (o.forceskinw)
843845
{

src/Layers/xrRenderPC_R1/stdafx.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,9 @@
66
#define D3D_DEBUG_INFO
77
#endif
88

9-
#pragma warning(push)
10-
#pragma warning(disable : 4995)
119
#include "xrEngine/stdafx.h"
1210
#include <d3d9.h>
1311
#include <d3dx9.h>
14-
#pragma warning(pop)
15-
16-
#pragma warning(disable : 4714)
17-
#pragma warning(4 : 4018)
18-
#pragma warning(4 : 4244)
1912

2013
#include "Layers/xrRender/xrD3DDefs.h"
2114
#include "Layers/xrRender/HW.h"
@@ -35,8 +28,8 @@
3528
#include "Common/_d3d_extensions.h"
3629
#ifndef _EDITOR
3730
#include "xrEngine/IGame_Level.h"
38-
#include "Layers/xrRender/blenders\Blender.h"
39-
#include "Layers/xrRender/blenders\Blender_CLSID.h"
31+
#include "Layers/xrRender/blenders/Blender.h"
32+
#include "Layers/xrRender/blenders/Blender_CLSID.h"
4033
#include "xrParticles/psystem.h"
4134
#include "Layers/xrRender/xrRender_console.h"
4235
#include "FStaticRender.h"

src/Layers/xrRenderPC_R2/Light_Render_Direct_ComputeXFS.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,5 @@ void CLight_Compute_XFORM_and_VIS::compute_xf_spot(light* L)
8989
// _min(L->cone + deg2rad(4.5f), PI*0.98f) - Here, it is needed to enlarge the shadow map frustum to include also
9090
// displaced pixels and the pixels neighbor to the examining one.
9191
L->X.S.project.build_projection(std::min(L->cone + deg2rad(5.f), PI * 0.98f), 1.f, SMAP_near_plane, L->range + EPS_S);
92-
9392
L->X.S.combine.mul(L->X.S.project, L->X.S.view);
9493
}

src/Layers/xrRenderPC_R2/r2.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@ void CRender::reset_begin()
374374
}
375375
//-AVO
376376

377-
378377
xr_delete(Target);
379378
HWOCC.occq_destroy();
380379
//_RELEASE (q_sync_point[1]);
@@ -629,8 +628,7 @@ void CRender::DumpStatistics(IGameFont& font, IPerformanceAlert* alert)
629628
Sectors_xrc.DumpStatistics(font, alert);
630629
}
631630

632-
static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 const buffer_size, LPCSTR const file_name,
633-
void*& result, bool const disasm)
631+
static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 const buffer_size, LPCSTR const file_name, void*& result, bool const disasm)
634632
{
635633
HRESULT _result = E_FAIL;
636634
if (pTarget[0] == 'p')
@@ -657,7 +655,7 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
657655
Msg("! D3DXFindShaderComment hr == 0x%08x", _result);
658656
}
659657
}
660-
else
658+
else if (pTarget[0] == 'v')
661659
{
662660
SVS* svs_result = (SVS*)result;
663661
_result = HW.pDevice->CreateVertexShader(buffer, &svs_result->vs);
@@ -681,6 +679,10 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
681679
Msg("! D3DXFindShaderComment hr == 0x%08x", _result);
682680
}
683681
}
682+
else
683+
{
684+
NODEFAULT;
685+
}
684686

685687
if (disasm)
686688
{
@@ -697,9 +699,6 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
697699
return _result;
698700
}
699701

700-
static inline bool match_shader_id(
701-
LPCSTR const debug_shader_id, LPCSTR const full_shader_id, FS_FileSet const& file_set, string_path& result);
702-
703702
class includer : public ID3DXInclude
704703
{
705704
public:
@@ -735,6 +734,9 @@ class includer : public ID3DXInclude
735734
}
736735
};
737736

737+
static inline bool match_shader_id(
738+
LPCSTR const debug_shader_id, LPCSTR const full_shader_id, FS_FileSet const& file_set, string_path& result);
739+
738740
HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcDataLen, LPCSTR pFunctionName,
739741
LPCSTR pTarget, DWORD Flags, void*& result)
740742
{
@@ -748,7 +750,6 @@ HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcData
748750

749751
char sh_name[MAX_PATH] = "";
750752
u32 len = 0;
751-
752753
// options
753754
{
754755
xr_sprintf(c_smapsize, "%04d", u32(o.smapsize));

src/Layers/xrRenderPC_R2/r2_sector_detect.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "stdafx.h"
2-
#include "r2.h"
32

43
int CRender::translateSector(IRender_Sector* pSector)
54
{

src/Layers/xrRenderPC_R2/stdafx.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,9 @@
66
#define D3D_DEBUG_INFO
77
#endif
88

9-
#pragma warning(push)
10-
#pragma warning(disable : 4995)
119
#include "xrEngine/stdafx.h"
1210
#include <d3d9.h>
1311
#include <d3dx9.h>
14-
#pragma warning(pop)
15-
16-
#pragma warning(disable : 4714)
17-
#pragma warning(4 : 4018)
18-
#pragma warning(4 : 4244)
19-
#pragma warning(disable : 4237)
2012

2113
#include "Layers/xrRender/xrD3DDefs.h"
2214
#include "Layers/xrRender/HW.h"

src/Layers/xrRenderPC_R3/Light_Render_Direct_ComputeXFS.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,5 @@ void CLight_Compute_XFORM_and_VIS::compute_xf_spot(light* L)
8989
// _min(L->cone + deg2rad(4.5f), PI*0.98f) - Here, it is needed to enlarge the shadow map frustum to include also
9090
// displaced pixels and the pixels neighbor to the examining one.
9191
L->X.S.project.build_projection(std::min(L->cone + deg2rad(5.f), PI * 0.98f), 1.f, SMAP_near_plane, L->range + EPS_S);
92-
9392
L->X.S.combine.mul(L->X.S.project, L->X.S.view);
9493
}

src/Layers/xrRenderPC_R3/blender_light_occq.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void CBlender_light_occq::Compile(CBlender_Compile& C)
3535
// Clear all bits except the last one
3636
C.r_Stencil(TRUE, D3DCMP_ALWAYS, 0x00, 0xFE, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO);
3737
}
38-
//C.r_Stencil(TRUE,D3DCMP_ALWAYS,0x00,0xFF, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO);
38+
// C.r_Stencil(TRUE,D3DCMP_ALWAYS,0x00,0xFF, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO);
3939
// keep/keep/keep
4040
C.r_End();
4141
break;

src/Layers/xrRenderPC_R3/r2_sector_detect.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "stdafx.h"
2-
#include "r3.h"
32

43
int CRender::translateSector(IRender_Sector* pSector)
54
{

src/Layers/xrRenderPC_R3/r3.cpp

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ void CRender::destroy()
451451
//_RELEASE (q_sync_point[0]);
452452
for (u32 i = 0; i < HW.Caps.iGPUNum; ++i)
453453
_RELEASE(q_sync_point[i]);
454-
455454
HWOCC.occq_destroy();
456455
xr_delete(Models);
457456
xr_delete(Target);
@@ -531,15 +530,7 @@ void CRender::reset_end()
531530
// that some data is not ready in the first frame (for example device camera position)
532531
m_bFirstFrameAfterReset = true;
533532
}
534-
/*
535-
void CRender::OnFrame()
536-
{
537-
Models->DeleteQueue ();
538-
if (ps_r2_ls_flags.test(R2FLAG_EXP_MT_CALC)) {
539-
Device.seqParallel.insert (Device.seqParallel.begin(),
540-
fastdelegate::FastDelegate0<>(&HOM,&CHOM::MT_RENDER));
541-
}
542-
}*/
533+
543534
void CRender::OnFrame()
544535
{
545536
Models->DeleteQueue();
@@ -564,7 +555,7 @@ void CRender::model_Delete(IRenderVisual*& V, BOOL bDiscard)
564555
{
565556
dxRender_Visual* pVisual = (dxRender_Visual*)V;
566557
Models->Delete(pVisual, bDiscard);
567-
V = 0;
558+
V = nullptr;
568559
}
569560
IRender_DetailModel* CRender::model_CreateDM(IReader* F)
570561
{
@@ -579,7 +570,7 @@ void CRender::model_Delete(IRender_DetailModel*& F)
579570
CDetail* D = (CDetail*)F;
580571
D->Unload();
581572
xr_delete(D);
582-
F = NULL;
573+
F = nullptr;
583574
}
584575
}
585576
IRenderVisual* CRender::model_CreatePE(LPCSTR name)
@@ -919,7 +910,6 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
919910
return _result;
920911
}
921912

922-
//--------------------------------------------------------------------------------------------------------------
923913
class includer : public ID3DInclude
924914
{
925915
public:
@@ -929,11 +919,11 @@ class includer : public ID3DInclude
929919
string_path pname;
930920
strconcat(sizeof(pname), pname, GEnv.Render->getShaderPath(), pFileName);
931921
IReader* R = FS.r_open("$game_shaders$", pname);
932-
if (0 == R)
922+
if (nullptr == R)
933923
{
934924
// possibly in shared directory or somewhere else - open directly
935925
R = FS.r_open("$game_shaders$", pFileName);
936-
if (0 == R)
926+
if (nullptr == R)
937927
return E_FAIL;
938928
}
939929

@@ -1454,33 +1444,32 @@ HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcData
14541444
sh_name[len] = '\0';
14551445

14561446
// finish
1457-
defines[def_it].Name = 0;
1458-
defines[def_it].Definition = 0;
1447+
defines[def_it].Name = nullptr;
1448+
defines[def_it].Definition = nullptr;
14591449
def_it++;
14601450

1461-
//
14621451
if (0 == xr_strcmp(pFunctionName, "main"))
14631452
{
14641453
if ('v' == pTarget[0])
14651454
{
14661455
if (HW.pDevice1 == 0)
1467-
pTarget = D3D10GetVertexShaderProfile(HW.pDevice); // vertex "vs_4_0"; //
1456+
pTarget = D3D10GetVertexShaderProfile(HW.pDevice); // vertex "vs_4_0";
14681457
else
1469-
pTarget = "vs_4_1"; // pixel "ps_4_0"; //
1458+
pTarget = "vs_4_1"; // pixel "ps_4_0";
14701459
}
14711460
else if ('p' == pTarget[0])
14721461
{
14731462
if (HW.pDevice1 == 0)
1474-
pTarget = D3D10GetPixelShaderProfile(HW.pDevice); // pixel "ps_4_0"; //
1463+
pTarget = D3D10GetPixelShaderProfile(HW.pDevice); // pixel "ps_4_0";
14751464
else
1476-
pTarget = "ps_4_1"; // pixel "ps_4_0"; //
1465+
pTarget = "ps_4_1"; // pixel "ps_4_0";
14771466
}
14781467
else if ('g' == pTarget[0])
14791468
{
14801469
if (HW.pDevice1 == 0)
1481-
pTarget = D3D10GetGeometryShaderProfile(HW.pDevice); // geometry "gs_4_0"; //
1470+
pTarget = D3D10GetGeometryShaderProfile(HW.pDevice); // geometry "gs_4_0";
14821471
else
1483-
pTarget = "gs_4_1"; // pixel "ps_4_0"; //
1472+
pTarget = "gs_4_1"; // pixel "ps_4_0";
14841473
}
14851474
}
14861475

@@ -1549,12 +1538,11 @@ HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcData
15491538
file->w(pShaderBuf->GetBufferPointer(), (u32)pShaderBuf->GetBufferSize());
15501539
FS.w_close(file);
15511540

1552-
_result = create_shader(pTarget, (DWORD*)pShaderBuf->GetBufferPointer(), (u32)pShaderBuf->GetBufferSize(),
1541+
_result = create_shader(pTarget, (DWORD*)pShaderBuf->GetBufferPointer(), pShaderBuf->GetBufferSize(),
15531542
file_name, result, o.disasm);
15541543
}
15551544
else
15561545
{
1557-
// Msg ( "! shader compilation failed" );
15581546
Log("! ", file_name);
15591547
if (pErrorBuf)
15601548
Log("! error: ", (LPCSTR)pErrorBuf->GetBufferPointer());

src/Layers/xrRenderPC_R3/stdafx.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,10 @@
66
#define D3D_DEBUG_INFO
77
#endif
88

9-
#pragma warning(push)
10-
#pragma warning(disable : 4995)
119
#include "xrEngine/stdafx.h"
12-
#include <d3d9.h>
1310
#include <d3dx9.h>
14-
#pragma warning(pop)
1511

16-
#pragma warning(disable : 4714)
17-
#pragma warning(4 : 4018)
18-
#pragma warning(4 : 4244)
19-
#pragma warning(disable : 4237)
20-
21-
#include <d3d10_1.h>
22-
#include <d3d11.h>
12+
#include <D3D10_1.h>
2313
#include <D3Dx10core.h>
2414
#include <D3DCompiler.h>
2515

src/Layers/xrRenderPC_R4/blender_light_occq.cpp

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

66
CBlender_light_occq::CBlender_light_occq() { description.CLS = 0; }
77
CBlender_light_occq::~CBlender_light_occq() {}
8-
// TODO: DX10: if nesessary for NV stencil optimisation implement pass 1
8+
// TODO: DX10: if nesessary for NV stencil optimisation implement pass 1
99
void CBlender_light_occq::Compile(CBlender_Compile& C)
1010
{
1111
IBlender::Compile(C);
@@ -15,7 +15,7 @@ void CBlender_light_occq::Compile(CBlender_Compile& C)
1515
case 0: // occlusion testing
1616
C.r_Pass("dumb", "dumb", false, TRUE, FALSE, FALSE);
1717
C.r_End();
18-
// Color write as well as culling and stencil are set up manually in code.
18+
// Color write as well as culling and stencil are set up manually in code.
1919
break;
2020
case 1: // NV40 optimization :)
2121
C.r_Pass("stub_notransform_t", "dumb", false, FALSE, FALSE, FALSE);
@@ -32,11 +32,10 @@ void CBlender_light_occq::Compile(CBlender_Compile& C)
3232
C.r_Stencil(TRUE, D3DCMP_ALWAYS, 0x00, 0x7E, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO);
3333
else
3434
{
35-
// Clear all bits except the last one
35+
// Clear all bits except the last one
3636
C.r_Stencil(TRUE, D3DCMP_ALWAYS, 0x00, 0xFE, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO);
3737
}
38-
// C.r_Stencil (TRUE,D3DCMP_ALWAYS,0x00,0xFF, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO);
39-
// //
38+
// C.r_Stencil(TRUE,D3DCMP_ALWAYS,0x00,0xFF, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO, D3DSTENCILOP_ZERO);
4039
// keep/keep/keep
4140
C.r_End();
4241
break;

src/Layers/xrRenderPC_R4/r2_blenders.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#include "stdafx.h"
2-
32
#include "Layers/xrRender/uber_deffer.h"
4-
53
#include "Layers/xrRender/blender_BmmD.h"
6-
#include "blender_deffer_flat.h"
7-
#include "blender_deffer_model.h"
8-
#include "blender_deffer_aref.h"
4+
#include "Blender_deffer_flat.h"
5+
#include "Blender_deffer_model.h"
6+
#include "Blender_deffer_aref.h"
97
#include "Layers/xrRender/blender_screen_set.h"
108
#include "Layers/xrRender/blender_editor_wire.h"
119
#include "Layers/xrRender/blender_editor_selection.h"

0 commit comments

Comments
 (0)