Skip to content

Commit

Permalink
Changed USE_DX10, USE_DX11, USE_OGL checks to ifndef USE_DX9
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Oct 21, 2018
1 parent 7bea5f7 commit 1b16b47
Show file tree
Hide file tree
Showing 31 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion src/Layers/xrRender/Blender_Recorder_R2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void CBlender_Compile::r_Pass(LPCSTR _vs, LPCSTR _ps, bool bFog, BOOL bZtest, BO
SVS* vs = RImplementation.Resources->_CreateVS(_vs);
dest.ps = ps;
dest.vs = vs;
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
SGS* gs = RImplementation.Resources->_CreateGS("null");
dest.gs = gs;
#ifdef USE_DX11
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/D3DXRenderBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class D3DXRenderBase : public IRender, public pureFrame

// Runtime structures
xr_vector<R_dsgraph::mapNormalVS::value_type *> nrmVS;
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
xr_vector<R_dsgraph::mapNormalGS::value_type *> nrmGS;
#endif // USE_DX10
xr_vector<R_dsgraph::mapNormalPS::value_type *> nrmPS;
Expand All @@ -60,7 +60,7 @@ class D3DXRenderBase : public IRender, public pureFrame
xr_vector<R_dsgraph::mapNormalTextures::value_type *> nrmTexturesTemp;

xr_vector<R_dsgraph::mapMatrixVS::value_type *> matVS;
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
xr_vector<R_dsgraph::mapMatrixGS::value_type *> matGS;
#endif // USE_DX10
xr_vector<R_dsgraph::mapMatrixPS::value_type *> matPS;
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/DetailManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class ECORE_API CDetailManager
void hw_Load_Shaders();
void hw_Unload();
void hw_Render();
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
void hw_Render_dump(const Fvector4& consts, const Fvector4& wave, const Fvector4& wind, u32 var_id, u32 lod_id);
#else // USE_DX10
void hw_Render_dump(ref_constant array, u32 var_id, u32 lod_id, u32 c_base);
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/DetailManager_VS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void CDetailManager::hw_Load_Geom()
// Fill VB
{
vertHW* pV;
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
vertHW* pVOriginal;
pVOriginal = xr_alloc<vertHW>(dwVerts);
pV = pVOriginal;
Expand Down Expand Up @@ -117,7 +117,7 @@ void CDetailManager::hw_Load_Geom()
// Fill IB
{
u16* pI;
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
u16* pIOriginal;
pIOriginal = xr_alloc<u16>(dwIndices);
pI = pIOriginal;
Expand Down
14 changes: 7 additions & 7 deletions src/Layers/xrRender/FSkinned.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void CSkeletonX_PM::Load(const char* N, IReader* data, u32 dwFlags)
void* _verts_ = data->pointer();
inherited1::Load(N, data, dwFlags | VLOAD_NOVERTICES);
GEnv.Render->shader_option_skinning(-1);
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
_DuplicateIndices(N, data);
#endif // USE_DX10
vBase = 0;
Expand All @@ -367,14 +367,14 @@ void CSkeletonX_ST::Load(const char* N, IReader* data, u32 dwFlags)
void* _verts_ = data->pointer();
inherited1::Load(N, data, dwFlags | VLOAD_NOVERTICES);
GEnv.Render->shader_option_skinning(-1);
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
_DuplicateIndices(N, data);
#endif // USE_DX10
vBase = 0;
_Load_hw(*this, _verts_);
}

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9

void CSkeletonX_ext::_Load_hw(Fvisual& V, void* _verts_)
{
Expand Down Expand Up @@ -765,7 +765,7 @@ void CSkeletonX_ext::_CollectBoneFaces(Fvisual* V, u32 iBase, u32 iCount)
{
u16* indices = nullptr;

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
indices = *m_Indices;
#else // USE_DX10
R_CHK(V->p_rm_Indices->Lock(0, V->dwPrimitives * 3, (void**)&indices, D3DLOCK_READONLY));
Expand Down Expand Up @@ -1083,7 +1083,7 @@ BOOL CSkeletonX_ext::_PickBone(IKinematics::pick_result& r, float dist, const Fv
CBoneData::FacesVec* faces = &BD.child_faces[ChildIDX];
BOOL result = FALSE;
u16* indices = nullptr;
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
indices = *m_Indices;
#else // USE_DX10
CHK_DX(V->p_rm_Indices->Lock(0, V->dwPrimitives * 3, (void**)&indices, D3DLOCK_READONLY));
Expand Down Expand Up @@ -1151,7 +1151,7 @@ void CSkeletonX_PM::EnumBoneVertices(SEnumVerticesCallback& C, u16 bone_id)
inherited2::_EnumBoneVertices(C, this, bone_id, iBase + SW.offset, SW.num_tris * 3);
}

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9

void CSkeletonX_ext::_FillVerticesHW1W(const Fmatrix& view, CSkeletonWallmark& wm, const Fvector& normal, float size,
Fvisual* V, u16* indices, CBoneData::FacesVec& faces)
Expand Down Expand Up @@ -1546,7 +1546,7 @@ void CSkeletonX_ext::_EnumBoneVertices(SEnumVerticesCallback& C, Fvisual* V, u16
u16* indices = nullptr;
//R_CHK(V->pIndices->Lock(iBase, iCount, (void**)&indices, D3DLOCK_READONLY));

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
VERIFY(*m_Indices);
indices = *m_Indices;
#else // USE_DX10
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/HW.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class CHW
stats_manager stats_manager;
#endif

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
void UpdateViews();
#endif
#if defined(USE_DX10) || defined(USE_DX11)
Expand Down
18 changes: 9 additions & 9 deletions src/Layers/xrRender/R_Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class ECORE_API CBackend
#endif // USE_OGL

// Vertices/Indices/etc
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
SDeclaration* decl;
#else // USE_DX10
IDirect3DVertexDeclaration9* decl;
Expand Down Expand Up @@ -151,7 +151,7 @@ class ECORE_API CBackend
#ifdef DEBUG
LPCSTR ps_name;
LPCSTR vs_name;
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
LPCSTR gs_name;
#ifdef USE_DX11
LPCSTR hs_name;
Expand Down Expand Up @@ -183,7 +183,7 @@ class ECORE_API CBackend
CTexture* textures_ps[CTexture::mtMaxPixelShaderTextures]; // stages
//CTexture* textures_vs[5]; // dmap + 4 vs
CTexture* textures_vs[CTexture::mtMaxVertexShaderTextures]; // 4 vs
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
CTexture* textures_gs[CTexture::mtMaxGeometryShaderTextures]; // 4 vs
# ifdef USE_DX11
CTexture* textures_hs[CTexture::mtMaxHullShaderTextures]; // 4 vs
Expand Down Expand Up @@ -303,7 +303,7 @@ class ECORE_API CBackend
ICF void set_States(SState* _state);
ICF void set_States(ref_state& _state) { set_States(&*_state); }

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
ICF void set_Format(SDeclaration* _decl);
#else // USE_DX10
ICF void set_Format(IDirect3DVertexDeclaration9* _decl);
Expand All @@ -316,7 +316,7 @@ class ECORE_API CBackend
#endif // USE_OGL
ICF void set_PS(ref_ps& _ps) { set_PS(_ps->sh, _ps->cName.c_str()); }

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
#ifdef USE_OGL
ICF void set_GS(GLuint _gs, LPCSTR _n = 0);
#else
Expand Down Expand Up @@ -431,7 +431,7 @@ class ECORE_API CBackend
constants.seta(C, e, x, y, z, w);
}

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
ICF void set_c(R_constant* C, float A)
{
if (C)
Expand Down Expand Up @@ -483,7 +483,7 @@ class ECORE_API CBackend
set_ca(&*ctable->get(n), e, x, y, z, w);
}

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
ICF void set_c(LPCSTR n, float A)
{
if (ctable)
Expand Down Expand Up @@ -534,7 +534,7 @@ class ECORE_API CBackend
set_ca(&*ctable->get(n), e, x, y, z, w);
}

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
ICF void set_c(shared_str& n, float A)
{
if (ctable)
Expand Down Expand Up @@ -566,7 +566,7 @@ class ECORE_API CBackend
// Debug render
void dbg_DP(D3DPRIMITIVETYPE pt, ref_geom geom, u32 vBase, u32 pc);
void dbg_DIP(D3DPRIMITIVETYPE pt, ref_geom geom, u32 baseV, u32 startV, u32 countV, u32 startI, u32 PC);
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
// TODO: DX10: Implement this.
IC void dbg_SetRS(D3DRENDERSTATETYPE p1, u32 p2) { VERIFY(!"Not implemented"); }
IC void dbg_SetSS(u32 sampler, D3DSAMPLERSTATETYPE type, u32 value) { VERIFY(!"Not implemented"); }
Expand Down
6 changes: 3 additions & 3 deletions src/Layers/xrRender/R_Backend_DBG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void CBackend::dbg_DIP(D3DPRIMITIVETYPE pt, ref_geom geom, u32 baseV, u32 startV

void CBackend::dbg_Draw(D3DPRIMITIVETYPE T, FVF::L* pVerts, int vcnt, u16* pIdx, int pcnt)
{
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
// TODO: DX10: implement
// VERIFY(!"CBackend::dbg_Draw not implemented.");
UNUSED(T);
Expand All @@ -33,7 +33,7 @@ void CBackend::dbg_Draw(D3DPRIMITIVETYPE T, FVF::L* pVerts, int vcnt, u16* pIdx,
}
void CBackend::dbg_Draw(D3DPRIMITIVETYPE T, FVF::L* pVerts, int pcnt)
{
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
// TODO: DX10: implement
// VERIFY(!"CBackend::dbg_Draw not implemented.");
UNUSED(T);
Expand Down Expand Up @@ -162,7 +162,7 @@ void CBackend::dbg_DrawEllipse(Fmatrix& T, u32 C)

set_xform_world(T);

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
// TODO: DX10: implement
// VERIFY(!"CBackend::dbg_Draw not implemented.");
// dbg_Draw(D3DPT_TRIANGLELIST,verts,vcnt,gFaces,224);
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/R_Backend_Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void CBackend::Invalidate()
void CBackend::set_ClipPlanes(u32 _enable, Fplane* _planes /*=NULL */, u32 count /* =0*/)
{

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
// TODO: DX10: Implement in the corresponding vertex shaders
// Use this to set up location, were shader setup code will get data
// VERIFY(!"CBackend::set_ClipPlanes not implemented!");
Expand Down Expand Up @@ -196,7 +196,7 @@ void CBackend::set_ClipPlanes(u32 _enable, Fmatrix* _xform /*=NULL */, u32 fmask
return;
if (!_enable)
{
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
// TODO: DX10: Implement in the corresponding vertex shaders
// Use this to set up location, were shader setup code will get data
// VERIFY(!"CBackend::set_ClipPlanes not implemented!");
Expand Down
6 changes: 3 additions & 3 deletions src/Layers/xrRender/ResourceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ECORE_API CResourceManager
// DX10 cut DEFINE_MAP_PRED(const char*,CRTC*, map_RTC, map_RTCIt, str_pred);
using map_VS = xr_map<const char*, SVS*, str_pred>;

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
using map_GS = xr_map<const char*, SGS*, str_pred>;
#endif

Expand All @@ -62,7 +62,7 @@ class ECORE_API CResourceManager
map_VS m_vs;
map_PS m_ps;

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
map_GS m_gs;
#endif

Expand Down Expand Up @@ -159,7 +159,7 @@ class ECORE_API CResourceManager

// DX10 cut CRTC* _CreateRTC (LPCSTR Name, u32 size, D3DFORMAT f);
// DX10 cut void _DeleteRTC (const CRTC* RT );
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
SGS* _CreateGS(LPCSTR Name);
void _DeleteGS(const SGS* GS);
#endif // USE_DX10
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/SH_Atomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ SPS::~SPS()
RImplementation.Resources->_DeletePS(this);
}

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
///////////////////////////////////////////////////////////////////////
// SGS
SGS::~SGS()
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/SH_Atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct ECORE_API SPS : public xr_resource_named
};
typedef resptr_core<SPS, resptr_base<SPS>> ref_ps;

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
//////////////////////////////////////////////////////////////////////////
struct ECORE_API SGS : public xr_resource_named
{
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/SH_Texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CTheoraSurface;
class ECORE_API CTexture : public xr_resource_named
{
public:
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
enum MaxTextures
{
// Actually these values are 128
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/Shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ BOOL SPass::equal(const SPass& other)
return FALSE;
if (vs != other.vs)
return FALSE;
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
if (gs != other.gs)
return FALSE;
#ifdef USE_DX11
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/Shader.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct ECORE_API SPass : public xr_resource_flagged
ref_state state; // Generic state, like Z-Buffering, samplers, etc
ref_ps ps; // may be NULL = FFP, in that case "state" must contain TSS setup
ref_vs vs; // may be NULL = FFP, in that case "state" must contain RS setup, *and* FVF-compatible declaration must be used
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
ref_gs gs; // may be NULL = don't use geometry shader at all
#ifdef USE_DX11
ref_hs hs; // may be NULL = don't use hull shader at all
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/ShaderResourceTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ struct ShaderTypeTraits<SPS>
static inline u32 GetShaderDest() { return RC_dest_pixel; }
};

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
template <>
struct ShaderTypeTraits<SGS>
{
Expand Down Expand Up @@ -309,7 +309,7 @@ inline CResourceManager::map_VS& CResourceManager::GetShaderMap()
return m_vs;
}

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
template <>
inline CResourceManager::map_GS& CResourceManager::GetShaderMap()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/SkeletonX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void CSkeletonX::_Copy(CSkeletonX* B)
RMS_boneid = B->RMS_boneid;
RMS_bonecount = B->RMS_bonecount;

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
m_Indices = B->m_Indices;
#endif // USE_DX10
}
Expand Down Expand Up @@ -680,7 +680,7 @@ void CSkeletonX::_FillVerticesSoft4W(const Fmatrix& view, CSkeletonWallmark& wm,
}
}

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
void CSkeletonX::_DuplicateIndices(const char* /*N*/, IReader* data)
{
// We will have trouble with container since don't know were to take readable indices
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/SkeletonX.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class CSkeletonX
virtual void FillVertices(
const Fmatrix& view, CSkeletonWallmark& wm, const Fvector& normal, float size, u16 bone_id) = 0;

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
protected:
void _DuplicateIndices(const char* N, IReader* data);

Expand Down Expand Up @@ -157,7 +157,7 @@ BOOL pick_bone(T_buffer vertices, CKinematics* Parent, IKinematics::pick_result&
return FALSE;
}

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
template <typename T>
BOOL pick_bone(CKinematics* Parent, IKinematics::pick_result& r, float dist, const Fvector& S, const Fvector& D,
Fvisual* V, u16* indices, CBoneData::FacesVec& faces)
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/blenders/Blender_Recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void CBlender_Compile::PassEnd()
proto.vs = RImplementation.Resources->_CreateVS(pass_vs);
ctable.merge(&proto.ps->constants);
ctable.merge(&proto.vs->constants);
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifndef USE_DX9
proto.gs = RImplementation.Resources->_CreateGS(pass_gs);
ctable.merge(&proto.gs->constants);
#ifdef USE_DX11
Expand Down
Loading

0 comments on commit 1b16b47

Please sign in to comment.