Skip to content

Commit

Permalink
xrRender: replace \\ to DELIMITER macro
Browse files Browse the repository at this point in the history
xrCore: fir wrong replacement to DELIMITER
  • Loading branch information
eagleivg committed Oct 5, 2018
1 parent 76d8518 commit 23d96af
Show file tree
Hide file tree
Showing 25 changed files with 146 additions and 146 deletions.
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R1/Blender_Vertex_aref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void CBlender_Vertex_aref::Compile(CBlender_Compile& C)
{
C.r_Pass(tsv_spot, tsp_spot, FALSE, TRUE, FALSE, TRUE, D3DBLEND_ONE, D3DBLEND_ONE, TRUE, oAREF.value);
C.r_Sampler("s_base", C.L_textures[0]);
C.r_Sampler_clf("s_lmap", "internal\\internal_light_att", true);
C.r_Sampler_clf("s_lmap", "internal" DELIMITER "internal_light_att", true);
C.r_Sampler_clf("s_att", TEX_SPOT_ATT);
if (C.bDetail_Diffuse)
C.r_Sampler("s_detail", C.detail_texture);
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R1/Blender_default_aref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void CBlender_default_aref::Compile(CBlender_Compile& C)
{
C.r_Pass(tsv_spot, tsp_spot, FALSE, TRUE, FALSE, TRUE, D3DBLEND_ONE, D3DBLEND_ONE, TRUE, oAREF.value);
C.r_Sampler("s_base", C.L_textures[0]);
C.r_Sampler_clf("s_lmap", "internal\\internal_light_att", true);
C.r_Sampler_clf("s_lmap", "internal" DELIMITER "internal_light_att", true);
C.r_Sampler_clf("s_att", TEX_SPOT_ATT);
if (C.bDetail_Diffuse)
C.r_Sampler("s_detail", C.detail_texture);
Expand Down
18 changes: 9 additions & 9 deletions src/Layers/xrRenderPC_R1/FStaticRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
ID3DXBuffer* disasm = nullptr;
D3DXDisassembleShader(LPDWORD(buffer), FALSE, nullptr, &disasm);
string_path dname;
strconcat(sizeof(dname), dname, "disasm\\", file_name, ('v' == pTarget[0]) ? ".vs" : ".ps");
strconcat(sizeof(dname), dname, "disasm" DELIMITER "", file_name, ('v' == pTarget[0]) ? ".vs" : ".ps");
IWriter* W = FS.w_open("$logs$", dname);
W->w(disasm->GetBufferPointer(), disasm->GetBufferSize());
FS.w_close(W);
Expand All @@ -797,10 +797,10 @@ inline HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
{
if (pTarget[0] == 'p')
return create_shader(pTarget, buffer, buffer_size, file_name, (SPS*&)result, disasm);

if (pTarget[0] == 'v')
return create_shader(pTarget, buffer, buffer_size, file_name, (SVS*&)result, disasm);

NODEFAULT;
return E_FAIL;
}
Expand Down Expand Up @@ -932,7 +932,7 @@ HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcData
HRESULT _result = E_FAIL;

string_path folder_name, folder;
xr_strcpy(folder, "r1\\objects\\r1\\");
xr_strcpy(folder, "r1" DELIMITER "objects" DELIMITER "r1" DELIMITER "");
xr_strcat(folder, name);
xr_strcat(folder, ".");

Expand All @@ -941,7 +941,7 @@ HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcData
xr_strcat(folder, extension);

FS.update_path(folder_name, "$game_shaders$", folder);
xr_strcat(folder_name, "\\");
xr_strcat(folder_name, "" DELIMITER "");

m_file_set.clear();
FS.file_list(m_file_set, folder_name, FS_ListFiles | FS_RootOnly, "*");
Expand All @@ -950,11 +950,11 @@ HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcData
if (!match_shader_id(name, sh_name, m_file_set, temp_file_name))
{
string_path file;
xr_strcpy(file, "shaders_cache\\r1\\");
xr_strcpy(file, "shaders_cache" DELIMITER "r1" DELIMITER "");
xr_strcat(file, name);
xr_strcat(file, ".");
xr_strcat(file, extension);
xr_strcat(file, "\\");
xr_strcat(file, "" DELIMITER "");
xr_strcat(file, sh_name);
FS.update_path(file_name, "$app_data_root$", file);
}
Expand Down Expand Up @@ -1038,8 +1038,8 @@ static inline bool match_shader_id(
LPCSTR const debug_shader_id, LPCSTR const full_shader_id, FS_FileSet const& file_set, string_path& result)
{
#if 1
strcpy_s ( result, "" );
return false;
strcpy_s ( result, "" );
return false;
#else // #if 1
#ifdef DEBUG
LPCSTR temp = "";
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R1/FStaticRender.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class CRender : public D3DXRenderBase

// Information
virtual void DumpStatistics(class IGameFont& font, class IPerformanceAlert* alert) override;
virtual LPCSTR getShaderPath() override { return "r1\\"; }
virtual LPCSTR getShaderPath() override { return "r1" DELIMITER ""; }
virtual ref_shader getShader(int id);
virtual IRender_Sector* getSector(int id) override;
virtual IRenderVisual* getVisual(int id) override;
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R1/GlowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void CGlow::set_radius(float R)
radius = R;
spatial_move();
};
void CGlow::set_texture(LPCSTR name) { shader.create("effects\\glow", name); }
void CGlow::set_texture(LPCSTR name) { shader.create("effects" DELIMITER "glow", name); }
void CGlow::set_color(const Fcolor& C) { color = C; }
void CGlow::set_color(float r, float g, float b) { color.set(r, g, b, 1); }
void CGlow::spatial_move()
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRenderPC_R1/LightShadows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ CLightShadows::CLightShadows() : xrc("LightShadows")
//
RT.create(RTname, S_rt_size, S_rt_size, S_rtf);
RT_temp.create(RTtemp, S_rt_size, S_rt_size, S_rtf);
sh_World.create("effects\\shadow_world", RTname);
sh_World.create("effects" DELIMITER "shadow_world", RTname);
geom_World.create(FVF::F_LIT, RCache.Vertex.Buffer(), nullptr);
sh_BlurTR.create("blur4", RTtemp2);
sh_BlurRT.create("blur4", RTname2);
geom_Blur.create(FVF::F_TL4uv, RCache.Vertex.Buffer(), RCache.QuadIB);

// Debug
sh_Screen.create("effects\\screen_set", RTname);
sh_Screen.create("effects" DELIMITER "screen_set", RTname);
geom_Screen.create(FVF::F_TL, RCache.Vertex.Buffer(), RCache.QuadIB);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRenderPC_R1/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
#include "FStaticRender.h"
#endif

#define TEX_POINT_ATT "internal\\internal_light_attpoint"
#define TEX_SPOT_ATT "internal\\internal_light_attclip"
#define TEX_POINT_ATT "internal" DELIMITER "internal_light_attpoint"
#define TEX_SPOT_ATT "internal" DELIMITER "internal_light_attclip"
16 changes: 8 additions & 8 deletions src/Layers/xrRenderPC_R2/r2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
ID3DXBuffer* disasm = nullptr;
D3DXDisassembleShader(LPDWORD(buffer), FALSE, nullptr, &disasm);
string_path dname;
strconcat(sizeof(dname), dname, "disasm\\", file_name, ('v' == pTarget[0]) ? ".vs" : ".ps");
strconcat(sizeof(dname), dname, "disasm" DELIMITER "", file_name, ('v' == pTarget[0]) ? ".vs" : ".ps");
IWriter* W = FS.w_open("$logs$", dname);
W->w(disasm->GetBufferPointer(), disasm->GetBufferSize());
FS.w_close(W);
Expand All @@ -667,7 +667,7 @@ inline HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
{
if (pTarget[0] == 'p')
return create_shader(pTarget, buffer, buffer_size, file_name, (SPS*&)result, disasm);

if (pTarget[0] == 'v')
return create_shader(pTarget, buffer, buffer_size, file_name, (SVS*&)result, disasm);

Expand Down Expand Up @@ -1066,7 +1066,7 @@ HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcData
HRESULT _result = E_FAIL;

string_path folder_name, folder;
xr_strcpy(folder, "r2\\objects\\r2\\");
xr_strcpy(folder, "r2" DELIMITER "objects" DELIMITER "r2" DELIMITER "");
xr_strcat(folder, name);
xr_strcat(folder, ".");

Expand All @@ -1075,7 +1075,7 @@ HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcData
xr_strcat(folder, extension);

FS.update_path(folder_name, "$game_shaders$", folder);
xr_strcat(folder_name, "\\");
xr_strcat(folder_name, "" DELIMITER "");

m_file_set.clear();
FS.file_list(m_file_set, folder_name, FS_ListFiles | FS_RootOnly, "*");
Expand All @@ -1084,11 +1084,11 @@ HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcData
if (!match_shader_id(name, sh_name, m_file_set, temp_file_name))
{
string_path file;
xr_strcpy(file, "shaders_cache\\r2\\");
xr_strcpy(file, "shaders_cache" DELIMITER "r2" DELIMITER "");
xr_strcat(file, name);
xr_strcat(file, ".");
xr_strcat(file, extension);
xr_strcat(file, "\\");
xr_strcat(file, "" DELIMITER "");
xr_strcat(file, sh_name);
FS.update_path(file_name, "$app_data_root$", file);
}
Expand Down Expand Up @@ -1180,8 +1180,8 @@ static inline bool match_shader_id(
LPCSTR const debug_shader_id, LPCSTR const full_shader_id, FS_FileSet const& file_set, string_path& result)
{
#if 1
strcpy_s ( result, "" );
return false;
strcpy_s ( result, "" );
return false;
#else // #if 1
#ifdef DEBUG
LPCSTR temp = "";
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R2/r2.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class CRender : public D3DXRenderBase

// Information
virtual void DumpStatistics(class IGameFont& font, class IPerformanceAlert* alert) override;
virtual LPCSTR getShaderPath() { return "r2\\"; }
virtual LPCSTR getShaderPath() { return "r2" DELIMITER ""; }
virtual ref_shader getShader(int id);
virtual IRender_Sector* getSector(int id);
virtual IRenderVisual* getVisual(int id);
Expand Down
46 changes: 23 additions & 23 deletions src/Layers/xrRenderPC_R2/r2_rendertarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ CRenderTarget::CRenderTarget()
}

// OCCLUSION
s_occq.create(b_occq, "r2\\occq");
s_occq.create(b_occq, "r2" DELIMITER "occq");

// DIRECT (spot)
D3DFORMAT depth_format = (D3DFORMAT)RImplementation.o.HW_smap_FORMAT;
Expand All @@ -283,9 +283,9 @@ CRenderTarget::CRenderTarget()
rt_smap_depth.create(r2_RT_smap_depth, size, size, depth_format);
rt_smap_surf.create(r2_RT_smap_surf, size, size, nullrt);
rt_smap_ZB = NULL;
s_accum_mask.create(b_accum_mask, "r2\\accum_mask");
s_accum_direct.create(b_accum_direct, "r2\\accum_direct");
s_accum_direct_cascade.create(b_accum_direct_cascade, "r2\\accum_direct_cascade");
s_accum_mask.create(b_accum_mask, "r2" DELIMITER "accum_mask");
s_accum_direct.create(b_accum_direct, "r2" DELIMITER "accum_direct");
s_accum_direct_cascade.create(b_accum_direct_cascade, "r2" DELIMITER "accum_direct_cascade");
if (RImplementation.o.advancedpp)
{
s_accum_direct_volumetric.create("accum_volumetric_sun");
Expand All @@ -299,9 +299,9 @@ CRenderTarget::CRenderTarget()
rt_smap_depth = NULL;
R_CHK(HW.pDevice->CreateDepthStencilSurface(
size, size, D3DFMT_D24X8, D3DMULTISAMPLE_NONE, 0, TRUE, &rt_smap_ZB, NULL));
s_accum_mask.create(b_accum_mask, "r2\\accum_mask");
s_accum_direct.create(b_accum_direct, "r2\\accum_direct");
s_accum_direct_cascade.create(b_accum_direct_cascade, "r2\\accum_direct_cascade");
s_accum_mask.create(b_accum_mask, "r2" DELIMITER "accum_mask");
s_accum_direct.create(b_accum_direct, "r2" DELIMITER "accum_direct");
s_accum_direct_cascade.create(b_accum_direct_cascade, "r2" DELIMITER "accum_direct_cascade");
if (RImplementation.o.advancedpp)
{
s_accum_direct_volumetric.create("accum_volumetric_sun");
Expand All @@ -311,7 +311,7 @@ CRenderTarget::CRenderTarget()

// POINT
{
s_accum_point.create(b_accum_point, "r2\\accum_point_s");
s_accum_point.create(b_accum_point, "r2" DELIMITER "accum_point_s");
accum_point_geom_create();
g_accum_point.create(D3DFVF_XYZ, g_accum_point_vb, g_accum_point_ib);
accum_omnip_geom_create();
Expand All @@ -320,20 +320,20 @@ CRenderTarget::CRenderTarget()

// SPOT
{
s_accum_spot.create(b_accum_spot, "r2\\accum_spot_s", "lights\\lights_spot01");
s_accum_spot.create(b_accum_spot, "r2" DELIMITER "accum_spot_s", "lights" DELIMITER "lights_spot01");
accum_spot_geom_create();
g_accum_spot.create(D3DFVF_XYZ, g_accum_spot_vb, g_accum_spot_ib);
}

{
s_accum_volume.create("accum_volumetric", "lights\\lights_spot01");
s_accum_volume.create("accum_volumetric", "lights" DELIMITER "lights_spot01");
accum_volumetric_geom_create();
g_accum_volumetric.create(D3DFVF_XYZ, g_accum_volumetric_vb, g_accum_volumetric_ib);
}

// REFLECTED
{
s_accum_reflected.create(b_accum_reflected, "r2\\accum_refl");
s_accum_reflected.create(b_accum_reflected, "r2" DELIMITER "accum_refl");
}

// BLOOM
Expand All @@ -349,14 +349,14 @@ CRenderTarget::CRenderTarget()
rt_Bloom_2.create(r2_RT_bloom2, w, h, fmt);
g_bloom_build.create(fvf_build, RCache.Vertex.Buffer(), RCache.QuadIB);
g_bloom_filter.create(fvf_filter, RCache.Vertex.Buffer(), RCache.QuadIB);
s_bloom_dbg_1.create("effects\\screen_set", r2_RT_bloom1);
s_bloom_dbg_2.create("effects\\screen_set", r2_RT_bloom2);
s_bloom.create(b_bloom, "r2\\bloom");
s_bloom_dbg_1.create("effects" DELIMITER "screen_set", r2_RT_bloom1);
s_bloom_dbg_2.create("effects" DELIMITER "screen_set", r2_RT_bloom2);
s_bloom.create(b_bloom, "r2" DELIMITER "bloom");
f_bloom_factor = 0.5f;
}

//FXAA
s_fxaa.create(b_fxaa, "r3\\fxaa");
s_fxaa.create(b_fxaa, "r3" DELIMITER "fxaa");
g_fxaa.create(FVF::F_V, RCache.Vertex.Buffer(), RCache.QuadIB);


Expand All @@ -378,22 +378,22 @@ CRenderTarget::CRenderTarget()
D3DFORMAT fmt = HW.Caps.id_vendor == 0x10DE ? D3DFMT_R32F : D3DFMT_R16F;

rt_half_depth.create(r2_RT_half_depth, w, h, fmt);
s_ssao.create(b_ssao, "r2\\ssao");
s_ssao.create(b_ssao, "r2" DELIMITER "ssao");
}

// SSAO
if (RImplementation.o.ssao_blur_on)
{
u32 w = Device.dwWidth, h = Device.dwHeight;
rt_ssao_temp.create(r2_RT_ssao_temp, w, h, D3DFMT_G16R16F);
s_ssao.create(b_ssao, "r2\\ssao");
s_ssao.create(b_ssao, "r2" DELIMITER "ssao");
}

// TONEMAP
{
rt_LUM_64.create(r2_RT_luminance_t64, 64, 64, D3DFMT_A16B16G16R16F);
rt_LUM_8.create(r2_RT_luminance_t8, 8, 8, D3DFMT_A16B16G16R16F);
s_luminance.create(b_luminance, "r2\\luminance");
s_luminance.create(b_luminance, "r2" DELIMITER "luminance");
f_luminance_adapt = 0.5f;

t_LUM_src.create(r2_RT_luminance_src);
Expand All @@ -417,11 +417,11 @@ CRenderTarget::CRenderTarget()
{0, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, // pos+uv
{0, 16, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0},
{0, 20, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END()};
s_combine.create(b_combine, "r2\\combine");
s_combine.create(b_combine, "r2" DELIMITER "combine");
s_combine_volumetric.create("combine_volumetric");
s_combine_dbg_0.create("effects\\screen_set", r2_RT_smap_surf);
s_combine_dbg_1.create("effects\\screen_set", r2_RT_luminance_t8);
s_combine_dbg_Accumulator.create("effects\\screen_set", r2_RT_accum);
s_combine_dbg_0.create("effects" DELIMITER "screen_set", r2_RT_smap_surf);
s_combine_dbg_1.create("effects" DELIMITER "screen_set", r2_RT_luminance_t8);
s_combine_dbg_Accumulator.create("effects" DELIMITER "screen_set", r2_RT_accum);
g_combine_VP.create(dwDecl, RCache.Vertex.Buffer(), RCache.QuadIB);
g_combine.create(FVF::F_TL, RCache.Vertex.Buffer(), RCache.QuadIB);
g_combine_2UV.create(FVF::F_TL2uv, RCache.Vertex.Buffer(), RCache.QuadIB);
Expand Down Expand Up @@ -510,7 +510,7 @@ CRenderTarget::CRenderTarget()
}
R_CHK(t_material_surf->UnlockBox(0));
// #ifdef DEBUG
// R_CHK (D3DXSaveTextureToFile ("x:\\r2_material.dds",D3DXIFF_DDS,t_material_surf,0));
// R_CHK (D3DXSaveTextureToFile ("x:" DELIMITER "r2_material.dds",D3DXIFF_DDS,t_material_surf,0));
// #endif
}

Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRenderPC_R3/blender_bloom_build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void CBlender_postprocess_msaa::Compile(CBlender_Compile& C)
D3DBLEND_INVSRCALPHA);
C.r_dx10Texture("s_base0", r2_RT_generic);
C.r_dx10Texture("s_base1", r2_RT_generic);
C.r_dx10Texture("s_noise", "fx\\fx_noise2");
C.r_dx10Texture("s_noise", "fx" DELIMITER "fx_noise2");

C.r_dx10Sampler("smp_rtlinear");
C.r_dx10Sampler("smp_linear");
Expand All @@ -122,7 +122,7 @@ void CBlender_postprocess_msaa::Compile(CBlender_Compile& C)
D3DBLEND_INVSRCALPHA);
C.r_dx10Texture("s_base0", r2_RT_generic);
C.r_dx10Texture("s_base1", r2_RT_generic);
C.r_dx10Texture("s_noise", "fx\\fx_noise2");
C.r_dx10Texture("s_noise", "fx" DELIMITER "fx_noise2");
C.r_dx10Texture("s_grad0", "$user$cmap0");
C.r_dx10Texture("s_grad1", "$user$cmap1");

Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R3/blender_light_direct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void CBlender_accum_direct_volumetric_msaa::Compile(CBlender_Compile& C)
C.r_Pass("accum_sun", "accum_volumetric_sun_msaa", false, TRUE, FALSE, blend, D3DBLEND_ONE, dest);
C.r_dx10Texture("s_lmap", C.L_textures[0]);
C.r_dx10Texture("s_smap", r2_RT_smap_depth);
C.r_dx10Texture("s_noise", "fx\\fx_noise");
C.r_dx10Texture("s_noise", "fx" DELIMITER "fx_noise");

C.r_dx10Sampler("smp_rtlinear");
C.r_dx10Sampler("smp_linear");
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R3/blender_light_spot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ void CBlender_accum_volumetric_msaa::Compile(CBlender_Compile& C)

C.r_dx10Texture("s_lmap", C.L_textures[0]);
C.r_dx10Texture("s_smap", r2_RT_smap_depth);
C.r_dx10Texture("s_noise", "fx\\fx_noise");
C.r_dx10Texture("s_noise", "fx" DELIMITER "fx_noise");

C.r_dx10Sampler("smp_rtlinear");
C.r_dx10Sampler("smp_smap");
Expand Down
Loading

0 comments on commit 23d96af

Please sign in to comment.