From 822b35027ebbcc850b566acafb18a9d2b54063c8 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Mon, 1 Oct 2018 19:02:33 +0500 Subject: [PATCH 01/42] Added ReSharper caches to .gitignore --- src/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/src/.gitignore b/src/.gitignore index 845aba9db94..6ad884fad16 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -3,6 +3,7 @@ xrCore/.GitInfo.hpp # exclude binaries and temporary files ipch/ packages/ +_ReSharper.Caches/ # User-specific files *.suo From 84e1800dcbd7af1e200d24aa3263dec843725b28 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Mon, 1 Oct 2018 21:05:09 +0500 Subject: [PATCH 02/42] xrRender_R1: rename L_DB -> Lights Also changed the type from pointer to an object to be the same as in other renderers --- src/Layers/xrRender/LightTrack.cpp | 7 ++----- src/Layers/xrRenderPC_R1/FStaticRender.cpp | 9 ++++----- src/Layers/xrRenderPC_R1/FStaticRender.h | 2 +- src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp | 7 ++----- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/Layers/xrRender/LightTrack.cpp b/src/Layers/xrRender/LightTrack.cpp index f8a4ac9d9c6..4dc18e18569 100644 --- a/src/Layers/xrRender/LightTrack.cpp +++ b/src/Layers/xrRender/LightTrack.cpp @@ -365,11 +365,8 @@ void CROS_impl::update_smooth(IRenderable* O) void CROS_impl::calc_sun_value(Fvector& position, IGameObject* _object) { -#if RENDER == R_R1 - light* sun = (light*)RImplementation.L_DB->sun._get(); -#else light* sun = (light*)RImplementation.Lights.sun._get(); -#endif + if (MODE & IRender_ObjectSpecific::TRACE_SUN) { if (--result_sun < 0) @@ -530,7 +527,7 @@ void CROS_impl::prepare_lights(Fvector& position, IRenderable* O) } #if RENDER == R_R1 - light* sun = (light*)RImplementation.L_DB->sun._get(); + light* sun = (light*)RImplementation.Lights.sun._get(); // Sun float E = sun_smooth * sun->color.intensity(); diff --git a/src/Layers/xrRenderPC_R1/FStaticRender.cpp b/src/Layers/xrRenderPC_R1/FStaticRender.cpp index 76aef9ab85f..56dec35c71c 100644 --- a/src/Layers/xrRenderPC_R1/FStaticRender.cpp +++ b/src/Layers/xrRenderPC_R1/FStaticRender.cpp @@ -52,7 +52,6 @@ ShaderElement* CRender::rimp_select_sh_static(dxRender_Visual* pVisual, float cd ////////////////////////////////////////////////////////////////////////// void CRender::create() { - L_DB = nullptr; L_Shadows = nullptr; L_Projector = nullptr; @@ -272,7 +271,7 @@ FSlideWindowItem* CRender::getSWI(int id) return &SWIs[id]; } IRender_Target* CRender::getTarget() { return Target; } -IRender_Light* CRender::light_create() { return L_DB->Create(); } +IRender_Light* CRender::light_create() { return Lights.Create(); } IRender_Glow* CRender::glow_create() { return new CGlow(); } void CRender::flush() { r_dsgraph_render_graph(0); } BOOL CRender::occ_visible(vis_data& P) { return HOM.visible(P); } @@ -476,9 +475,9 @@ void CRender::Calculate() pPortal->bDualRender = TRUE; } } + // - if (L_DB) - L_DB->Update(); + Lights.Update(); // Main process marker++; @@ -609,7 +608,7 @@ void CRender::Calculate() { vis_data& vis = L->get_homdata(); if (HOM.visible(vis)) - L_DB->add_light(L); + Lights.add_light(L); } } } diff --git a/src/Layers/xrRenderPC_R1/FStaticRender.h b/src/Layers/xrRenderPC_R1/FStaticRender.h index 82f9bbe047b..482a13394ed 100644 --- a/src/Layers/xrRenderPC_R1/FStaticRender.h +++ b/src/Layers/xrRenderPC_R1/FStaticRender.h @@ -55,7 +55,7 @@ class CRender : public D3DXRenderBase xr_vector IB; xr_vector Visuals; CPSLibrary PSLibrary; - CLight_DB* L_DB; + CLight_DB Lights; CLightR_Manager* L_Dynamic; CLightShadows* L_Shadows; CLightProjector* L_Projector; diff --git a/src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp b/src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp index 646bb86c644..eef0e4c7d1f 100644 --- a/src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp +++ b/src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp @@ -46,10 +46,8 @@ void CRender::level_Load(IReader* fs) } // Components - L_Shadows = new CLightShadows(); L_Projector = new CLightProjector(); - L_DB = new CLight_DB(); L_Glows = new CGlowManager(); Wallmarks = new CWallmarksEngine(); Details = new CDetailManager(); @@ -133,7 +131,7 @@ void CRender::level_Unload() //*** Lights L_Glows->Unload(); - L_DB->Unload(); + Lights.Unload(); //*** Visuals for (I = 0; I < Visuals.size(); I++) @@ -161,7 +159,6 @@ void CRender::level_Unload() xr_delete(Details); xr_delete(Wallmarks); xr_delete(L_Glows); - xr_delete(L_DB); xr_delete(L_Projector); xr_delete(L_Shadows); @@ -278,7 +275,7 @@ void CRender::LoadVisuals(IReader* fs) void CRender::LoadLights(IReader* fs) { // lights - L_DB->Load(fs); + Lights.Load(fs); // glows IReader* chunk = fs->open_chunk(fsL_GLOWS); From 71b5db579bb6c7bb6e684cb5adf22d086c259532 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Mon, 1 Oct 2018 21:11:30 +0500 Subject: [PATCH 03/42] xrRender_RX: removed software processor from details manager It was only used when your GPU doesn't support the vertex shaders.... --- src/Layers/xrRender/DetailManager.cpp | 19 +- src/Layers/xrRender/DetailManager.h | 7 - .../xrRender/DetailManager_Decompress.cpp | 17 +- src/Layers/xrRender/DetailManager_soft.cpp | 174 ------------------ src/Layers/xrRenderPC_GL/xrRender_GL.vcxproj | 1 - .../xrRenderPC_GL/xrRender_GL.vcxproj.filters | 3 - src/Layers/xrRenderPC_R1/xrRender_R1.vcxproj | 1 - .../xrRenderPC_R1/xrRender_R1.vcxproj.filters | 3 - src/Layers/xrRenderPC_R2/xrRender_R2.vcxproj | 1 - .../xrRenderPC_R2/xrRender_R2.vcxproj.filters | 3 - src/Layers/xrRenderPC_R3/xrRender_R3.vcxproj | 1 - .../xrRenderPC_R3/xrRender_R3.vcxproj.filters | 3 - src/Layers/xrRenderPC_R4/xrRender_R4.vcxproj | 1 - .../xrRenderPC_R4/xrRender_R4.vcxproj.filters | 3 - 14 files changed, 10 insertions(+), 227 deletions(-) delete mode 100644 src/Layers/xrRender/DetailManager_soft.cpp diff --git a/src/Layers/xrRender/DetailManager.cpp b/src/Layers/xrRender/DetailManager.cpp index f14ea1f765f..dbc205a8ec7 100644 --- a/src/Layers/xrRender/DetailManager.cpp +++ b/src/Layers/xrRender/DetailManager.cpp @@ -78,7 +78,6 @@ CDetailManager::CDetailManager() : xrc("detail manager") { dtFS = nullptr; dtSlots = nullptr; - soft_Geom = nullptr; hw_Geom = nullptr; hw_BatchSize = 0; hw_VB = 0; @@ -194,11 +193,7 @@ void CDetailManager::Load() // Make dither matrix bwdithermap(2, dither); - // Hardware specific optimizations - if (UseVS()) - hw_Load(); - else - soft_Load(); + hw_Load(); // swing desc // normal @@ -217,10 +212,7 @@ void CDetailManager::Load() #endif void CDetailManager::Unload() { - if (UseVS()) - hw_Unload(); - else - soft_Unload(); + hw_Unload(); for (DetailIt it = objects.begin(); it != objects.end(); it++) { @@ -399,10 +391,9 @@ void CDetailManager::Render() RCache.set_CullMode(CULL_NONE); RCache.set_xform_world(Fidentity); - if (UseVS()) - hw_Render(); - else - soft_Render(); + + hw_Render(); + RCache.set_CullMode(CULL_CCW); g_pGamePersistent->m_pGShaderConstants->m_blender_mode.w = 0.0f; //--#SM+#-- Флаг конца рендера травы [end of grass render] diff --git a/src/Layers/xrRender/DetailManager.h b/src/Layers/xrRender/DetailManager.h index 6730141fa01..ce93368531a 100644 --- a/src/Layers/xrRender/DetailManager.h +++ b/src/Layers/xrRender/DetailManager.h @@ -184,13 +184,6 @@ class ECORE_API CDetailManager virtual ObjectList* GetSnapList() = 0; #endif - bool UseVS() { return HW.Caps.geometry_major >= 1; } - // Software processor - ref_geom soft_Geom; - void soft_Load(); - void soft_Unload(); - void soft_Render(); - // Hardware processor ref_geom hw_Geom; u32 hw_BatchSize; diff --git a/src/Layers/xrRender/DetailManager_Decompress.cpp b/src/Layers/xrRender/DetailManager_Decompress.cpp index e96af1b1a4f..4dfbec1a71d 100644 --- a/src/Layers/xrRender/DetailManager_Decompress.cpp +++ b/src/Layers/xrRender/DetailManager_Decompress.cpp @@ -299,24 +299,17 @@ gray255[3] = 255.f*float(c_pal->a3)/15.f; // Vis-sorting #ifndef DBG_SWITCHOFF_RANDOMIZE - if (!UseVS()) - { - // Always still on CPU pipe + if (Dobj->m_Flags.is(DO_NO_WAVING)) Item.vis_ID = 0; - } else { - if (Dobj->m_Flags.is(DO_NO_WAVING)) - Item.vis_ID = 0; + if (::Random.randI(0, 3) == 0) + Item.vis_ID = 2; // Second wave else - { - if (::Random.randI(0, 3) == 0) - Item.vis_ID = 2; // Second wave - else - Item.vis_ID = 1; // First wave - } + Item.vis_ID = 1; // First wave } #else + // Always still on CPU pipe Item.vis_ID = 0; #endif // Save it diff --git a/src/Layers/xrRender/DetailManager_soft.cpp b/src/Layers/xrRender/DetailManager_soft.cpp deleted file mode 100644 index 28f74fc0fcf..00000000000 --- a/src/Layers/xrRender/DetailManager_soft.cpp +++ /dev/null @@ -1,174 +0,0 @@ -#include "stdafx.h" -#pragma hdrstop - -#include "detailmanager.h" - -const u32 vs_size = 3000; - -void CDetailManager::soft_Load() -{ - R_ASSERT(RCache.Vertex.Buffer()); - R_ASSERT(RCache.Index.Buffer()); - // Vertex Stream - soft_Geom.create(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1, RCache.Vertex.Buffer(), RCache.Index.Buffer()); -} - -void CDetailManager::soft_Unload() { soft_Geom.destroy(); } -void CDetailManager::soft_Render() -{ - // Render itself - // float fPhaseRange = PI/16; - // float fPhaseX = _sin(RDEVICE.fTimeGlobal*0.1f) *fPhaseRange; - // float fPhaseZ = _sin(RDEVICE.fTimeGlobal*0.11f)*fPhaseRange; - - // Get index-stream - _IndexStream& _IS = RCache.Index; - _VertexStream& _VS = RCache.Vertex; - for (u32 O = 0; O < objects.size(); O++) - { - CDetail& Object = *objects[O]; - u32 vCount_Object = Object.number_vertices; - u32 iCount_Object = Object.number_indices; - - xr_vector& _vis = m_visibles[0][O]; - xr_vector::iterator _vI = _vis.begin(); - xr_vector::iterator _vE = _vis.end(); - for (; _vI != _vE; _vI++) - { - SlotItemVec* items = *_vI; - u32 vCount_Total = items->size() * vCount_Object; - // calculate lock count needed - u32 lock_count = vCount_Total / vs_size; - if (vCount_Total > (lock_count * vs_size)) - lock_count++; - - // calculate objects per lock - u32 o_total = items->size(); - u32 o_per_lock = o_total / lock_count; - if (o_total > (o_per_lock * lock_count)) - o_per_lock++; - - // Fill VB (and flush it as nesessary) - RCache.set_Shader(Object.shader); - - Fmatrix mXform; - for (u32 L_ID = 0; L_ID < lock_count; L_ID++) - { - // Calculate params - u32 item_start = L_ID * o_per_lock; - u32 item_end = item_start + o_per_lock; - if (item_end > o_total) - item_end = o_total; - if (item_end <= item_start) - break; - u32 item_range = item_end - item_start; - - // Calc Lock params - u32 vCount_Lock = item_range * vCount_Object; - u32 iCount_Lock = item_range * iCount_Object; - - // Lock buffers - u32 vBase, iBase, iOffset = 0; - CDetail::fvfVertexOut* vDest = - (CDetail::fvfVertexOut*)_VS.Lock(vCount_Lock, soft_Geom->vb_stride, vBase); - u16* iDest = (u16*)_IS.Lock(iCount_Lock, iBase); - - // Filling itself - for (u32 item_idx = item_start; item_idx < item_end; ++item_idx) - { - SlotItem& Instance = *items->at(item_idx); - float scale = Instance.scale_calculated; - - // Build matrix - Fmatrix& M = Instance.mRotY; - mXform._11 = M._11 * scale; - mXform._12 = M._12 * scale; - mXform._13 = M._13 * scale; - mXform._14 = M._14; - mXform._21 = M._21 * scale; - mXform._22 = M._22 * scale; - mXform._23 = M._23 * scale; - mXform._24 = M._24; - mXform._31 = M._31 * scale; - mXform._32 = M._32 * scale; - mXform._33 = M._33 * scale; - mXform._34 = M._34; - mXform._41 = M._41; - mXform._42 = M._42; - mXform._43 = M._43; - mXform._44 = 1; - - // Transfer vertices - { - u32 C = 0xffffffff; - CDetail::fvfVertexIn *srcIt = Object.vertices, - *srcEnd = Object.vertices + Object.number_vertices; - CDetail::fvfVertexOut* dstIt = vDest; - - for (; srcIt != srcEnd; srcIt++, dstIt++) - { - mXform.transform_tiny(dstIt->P, srcIt->P); - dstIt->C = C; - dstIt->u = srcIt->u; - dstIt->v = srcIt->v; - } - } - - // Transfer indices (in 32bit lines) - VERIFY(iOffset < 65535); - { - u32 item = (iOffset << 16) | iOffset; - u32 count = Object.number_indices / 2; - LPDWORD sit = LPDWORD(Object.indices); - LPDWORD send = sit + count; - LPDWORD dit = LPDWORD(iDest); - for (; sit != send; dit++, sit++) - *dit = *sit + item; - if (Object.number_indices & 1) - { - iDest[Object.number_indices - 1] = - (u16)(Object.indices[Object.number_indices - 1] + u16(iOffset)); - } - } - - // Increment counters - vDest += vCount_Object; - iDest += iCount_Object; - iOffset += vCount_Object; - } - _VS.Unlock(vCount_Lock, soft_Geom->vb_stride); - _IS.Unlock(iCount_Lock); - - // Render - u32 dwNumPrimitives = iCount_Lock / 3; - RCache.set_Geometry(soft_Geom); - RCache.Render(D3DPT_TRIANGLELIST, vBase, 0, vCount_Lock, iBase, dwNumPrimitives); - } - } - // Clean up - _vis.clear(); - } -} - -/* - VERIFY(sizeof(CDetail::fvfVertexOut)==soft_Geom->vb_stride); - CDetail::fvfVertexOut* dstIt = vDest; - VERIFY(items->size()*Object.number_vertices==vCount_Lock); - for (u32 k = 0; kP, srcIt->P); - dstIt->C = C; - dstIt->u = srcIt->u; - dstIt->v = srcIt->v; - } - } - } -*/ diff --git a/src/Layers/xrRenderPC_GL/xrRender_GL.vcxproj b/src/Layers/xrRenderPC_GL/xrRender_GL.vcxproj index 90f1a316255..47551a30ca1 100644 --- a/src/Layers/xrRenderPC_GL/xrRender_GL.vcxproj +++ b/src/Layers/xrRenderPC_GL/xrRender_GL.vcxproj @@ -248,7 +248,6 @@ - diff --git a/src/Layers/xrRenderPC_GL/xrRender_GL.vcxproj.filters b/src/Layers/xrRenderPC_GL/xrRender_GL.vcxproj.filters index 7e4a35f6fdd..047b190e318 100644 --- a/src/Layers/xrRenderPC_GL/xrRender_GL.vcxproj.filters +++ b/src/Layers/xrRenderPC_GL/xrRender_GL.vcxproj.filters @@ -336,9 +336,6 @@ Details - - Details - Details diff --git a/src/Layers/xrRenderPC_R1/xrRender_R1.vcxproj b/src/Layers/xrRenderPC_R1/xrRender_R1.vcxproj index de7b2ee0aad..f991f2e3468 100644 --- a/src/Layers/xrRenderPC_R1/xrRender_R1.vcxproj +++ b/src/Layers/xrRenderPC_R1/xrRender_R1.vcxproj @@ -329,7 +329,6 @@ - diff --git a/src/Layers/xrRenderPC_R1/xrRender_R1.vcxproj.filters b/src/Layers/xrRenderPC_R1/xrRender_R1.vcxproj.filters index e3d9dd3f3d4..eb36308ed49 100644 --- a/src/Layers/xrRenderPC_R1/xrRender_R1.vcxproj.filters +++ b/src/Layers/xrRenderPC_R1/xrRender_R1.vcxproj.filters @@ -632,9 +632,6 @@ Details - - Details - Details diff --git a/src/Layers/xrRenderPC_R2/xrRender_R2.vcxproj b/src/Layers/xrRenderPC_R2/xrRender_R2.vcxproj index ecdc314ca54..1576d6bd55a 100644 --- a/src/Layers/xrRenderPC_R2/xrRender_R2.vcxproj +++ b/src/Layers/xrRenderPC_R2/xrRender_R2.vcxproj @@ -341,7 +341,6 @@ - diff --git a/src/Layers/xrRenderPC_R2/xrRender_R2.vcxproj.filters b/src/Layers/xrRenderPC_R2/xrRender_R2.vcxproj.filters index d8018a5d75c..4ec7eb8c112 100644 --- a/src/Layers/xrRenderPC_R2/xrRender_R2.vcxproj.filters +++ b/src/Layers/xrRenderPC_R2/xrRender_R2.vcxproj.filters @@ -686,9 +686,6 @@ Details - - Details - Details diff --git a/src/Layers/xrRenderPC_R3/xrRender_R3.vcxproj b/src/Layers/xrRenderPC_R3/xrRender_R3.vcxproj index 68bf8fab6d6..4d16571bc7d 100644 --- a/src/Layers/xrRenderPC_R3/xrRender_R3.vcxproj +++ b/src/Layers/xrRenderPC_R3/xrRender_R3.vcxproj @@ -391,7 +391,6 @@ - diff --git a/src/Layers/xrRenderPC_R3/xrRender_R3.vcxproj.filters b/src/Layers/xrRenderPC_R3/xrRender_R3.vcxproj.filters index 3ca8882d585..8da215d5645 100644 --- a/src/Layers/xrRenderPC_R3/xrRender_R3.vcxproj.filters +++ b/src/Layers/xrRenderPC_R3/xrRender_R3.vcxproj.filters @@ -773,9 +773,6 @@ Details - - Details - Details diff --git a/src/Layers/xrRenderPC_R4/xrRender_R4.vcxproj b/src/Layers/xrRenderPC_R4/xrRender_R4.vcxproj index 3b99ed6e41c..f21486eacbe 100644 --- a/src/Layers/xrRenderPC_R4/xrRender_R4.vcxproj +++ b/src/Layers/xrRenderPC_R4/xrRender_R4.vcxproj @@ -396,7 +396,6 @@ - diff --git a/src/Layers/xrRenderPC_R4/xrRender_R4.vcxproj.filters b/src/Layers/xrRenderPC_R4/xrRender_R4.vcxproj.filters index 6703c86f2a9..a372d258e85 100644 --- a/src/Layers/xrRenderPC_R4/xrRender_R4.vcxproj.filters +++ b/src/Layers/xrRenderPC_R4/xrRender_R4.vcxproj.filters @@ -794,9 +794,6 @@ Details - - Details - Details From 2d234ac1ec57edc77d6e86d299fad55ddec0dde9 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Mon, 1 Oct 2018 23:06:12 +0500 Subject: [PATCH 04/42] xrRender_RX: replaced BOOL with bool Replaced IDirect3DIndexBuffer9 and IDirect3DVertexBuffer9 with ID3DVertexBuffer and ID3DIndexBuffer. --- .../xrRender/ResourceManager_Resources.cpp | 4 ++-- src/Layers/xrRenderDX10/dx10R_Backend_Runtime.h | 2 +- src/Layers/xrRenderPC_GL/gl_loader.cpp | 12 ++++++------ src/Layers/xrRenderPC_GL/rgl.h | 2 +- src/Layers/xrRenderPC_R1/FStaticRender.cpp | 4 ++-- src/Layers/xrRenderPC_R1/FStaticRender.h | 8 ++++---- src/Layers/xrRenderPC_R2/r2.cpp | 12 ++++++------ src/Layers/xrRenderPC_R2/r2.h | 12 ++++++------ src/Layers/xrRenderPC_R2/r2_loader.cpp | 12 ++++++------ src/Layers/xrRenderPC_R2/r2_rendertarget.h | 16 ++++++++-------- src/Layers/xrRenderPC_R3/r3.cpp | 12 ++++++------ src/Layers/xrRenderPC_R3/r3.h | 8 ++++---- src/Layers/xrRenderPC_R3/r3_loader.cpp | 12 ++++++------ src/Layers/xrRenderPC_R4/r4.cpp | 12 ++++++------ src/Layers/xrRenderPC_R4/r4.h | 8 ++++---- src/Layers/xrRenderPC_R4/r4_loader.cpp | 12 ++++++------ 16 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/Layers/xrRender/ResourceManager_Resources.cpp b/src/Layers/xrRender/ResourceManager_Resources.cpp index bc553bf3d27..6ecca9ee0a6 100644 --- a/src/Layers/xrRender/ResourceManager_Resources.cpp +++ b/src/Layers/xrRender/ResourceManager_Resources.cpp @@ -284,7 +284,7 @@ void CResourceManager::DBG_VerifyGeoms() */ } -SGeometry* CResourceManager::CreateGeom(D3DVERTEXELEMENT9* decl, IDirect3DVertexBuffer9* vb, IDirect3DIndexBuffer9* ib) +SGeometry* CResourceManager::CreateGeom(D3DVERTEXELEMENT9* decl, ID3DVertexBuffer* vb, ID3DIndexBuffer* ib) { R_ASSERT(decl && vb); @@ -308,7 +308,7 @@ SGeometry* CResourceManager::CreateGeom(D3DVERTEXELEMENT9* decl, IDirect3DVertex v_geoms.push_back(Geom); return Geom; } -SGeometry* CResourceManager::CreateGeom(u32 FVF, IDirect3DVertexBuffer9* vb, IDirect3DIndexBuffer9* ib) +SGeometry* CResourceManager::CreateGeom(u32 FVF, ID3DVertexBuffer* vb, ID3DIndexBuffer* ib) { D3DVERTEXELEMENT9 dcl[MAX_FVF_DECL_SIZE]; CHK_DX(D3DXDeclaratorFromFVF(FVF, dcl)); diff --git a/src/Layers/xrRenderDX10/dx10R_Backend_Runtime.h b/src/Layers/xrRenderDX10/dx10R_Backend_Runtime.h index 4be638237e7..830cb02fffe 100644 --- a/src/Layers/xrRenderDX10/dx10R_Backend_Runtime.h +++ b/src/Layers/xrRenderDX10/dx10R_Backend_Runtime.h @@ -180,7 +180,7 @@ ICF void CBackend::set_Vertices(ID3DVertexBuffer* _vb, u32 _vb_stride) vb_stride = _vb_stride; // CHK_DX (HW.pDevice->SetStreamSource(0,vb,0,vb_stride)); // UINT StreamNumber, - // IDirect3DVertexBuffer9 * pStreamData, + // ID3DVertexBuffer * pStreamData, // UINT OffsetInBytes, // UINT Stride diff --git a/src/Layers/xrRenderPC_GL/gl_loader.cpp b/src/Layers/xrRenderPC_GL/gl_loader.cpp index 4bb8159e73b..27a78b42789 100644 --- a/src/Layers/xrRenderPC_GL/gl_loader.cpp +++ b/src/Layers/xrRenderPC_GL/gl_loader.cpp @@ -60,7 +60,7 @@ void CRender::level_Load(IReader* fs) { CStreamReader* geom = FS.rs_open("$level$", "level.geom"); R_ASSERT2 (geom, "level.geom"); - LoadBuffers(geom,FALSE); + LoadBuffers(geom, false); LoadSWIs(geom); FS.r_close(geom); } @@ -69,7 +69,7 @@ void CRender::level_Load(IReader* fs) { CStreamReader* geom = FS.rs_open("$level$", "level.geomx"); R_ASSERT2 (geom, "level.geomX"); - LoadBuffers(geom,TRUE); + LoadBuffers(geom, true); FS.r_close(geom); } @@ -172,15 +172,15 @@ void CRender::level_Unload() b_loaded = FALSE; } -void CRender::LoadBuffers(CStreamReader* base_fs, BOOL _alternative) +void CRender::LoadBuffers(CStreamReader* base_fs, bool alternative) { R_ASSERT2 (base_fs,"Could not load geometry. File not found."); Resources->Evict(); // u32 dwUsage = D3DUSAGE_WRITEONLY; - xr_vector& _DC = _alternative ? xDC : nDC; - xr_vector& _VB = _alternative ? xVB : nVB; - xr_vector& _IB = _alternative ? xIB : nIB; + xr_vector& _DC = alternative ? xDC : nDC; + xr_vector& _VB = alternative ? xVB : nVB; + xr_vector& _IB = alternative ? xIB : nIB; // Vertex buffers { diff --git a/src/Layers/xrRenderPC_GL/rgl.h b/src/Layers/xrRenderPC_GL/rgl.h index 31edb8ef59d..bad4263745e 100644 --- a/src/Layers/xrRenderPC_GL/rgl.h +++ b/src/Layers/xrRenderPC_GL/rgl.h @@ -188,7 +188,7 @@ class CRender : public D3DXRenderBase private: // Loading / Unloading - void LoadBuffers(CStreamReader* fs, BOOL _alternative); + void LoadBuffers(CStreamReader* fs, bool alternative); void LoadVisuals(IReader* fs); void LoadLights(IReader* fs); void LoadPortals(IReader* fs); diff --git a/src/Layers/xrRenderPC_R1/FStaticRender.cpp b/src/Layers/xrRenderPC_R1/FStaticRender.cpp index 56dec35c71c..3d2f66aa84d 100644 --- a/src/Layers/xrRenderPC_R1/FStaticRender.cpp +++ b/src/Layers/xrRenderPC_R1/FStaticRender.cpp @@ -255,12 +255,12 @@ D3DVERTEXELEMENT9* CRender::getVB_Format(int id) VERIFY(id < int(DCL.size())); return DCL[id].begin(); } -IDirect3DVertexBuffer9* CRender::getVB(int id) +ID3DVertexBuffer* CRender::getVB(int id) { VERIFY(id < int(VB.size())); return VB[id]; } -IDirect3DIndexBuffer9* CRender::getIB(int id) +ID3DIndexBuffer* CRender::getIB(int id) { VERIFY(id < int(IB.size())); return IB[id]; diff --git a/src/Layers/xrRenderPC_R1/FStaticRender.h b/src/Layers/xrRenderPC_R1/FStaticRender.h index 482a13394ed..4f36203404c 100644 --- a/src/Layers/xrRenderPC_R1/FStaticRender.h +++ b/src/Layers/xrRenderPC_R1/FStaticRender.h @@ -51,8 +51,8 @@ class CRender : public D3DXRenderBase xr_vector Shaders; typedef svector VertexDeclarator; xr_vector DCL; - xr_vector VB; - xr_vector IB; + xr_vector VB; + xr_vector IB; xr_vector Visuals; CPSLibrary PSLibrary; CLight_DB Lights; @@ -92,8 +92,8 @@ class CRender : public D3DXRenderBase ShaderElement* rimp_select_sh_static(dxRender_Visual* pVisual, float cdist_sq); ShaderElement* rimp_select_sh_dynamic(dxRender_Visual* pVisual, float cdist_sq); D3DVERTEXELEMENT9* getVB_Format(int id); - IDirect3DVertexBuffer9* getVB(int id); - IDirect3DIndexBuffer9* getIB(int id); + ID3DVertexBuffer* getVB(int id); + ID3DIndexBuffer* getIB(int id); FSlideWindowItem* getSWI(int id); IRender_Portal* getPortal(int id); IRender_Sector* getSectorActive(); diff --git a/src/Layers/xrRenderPC_R2/r2.cpp b/src/Layers/xrRenderPC_R2/r2.cpp index 415c36b2531..cf6d8ff21a9 100644 --- a/src/Layers/xrRenderPC_R2/r2.cpp +++ b/src/Layers/xrRenderPC_R2/r2.cpp @@ -491,9 +491,9 @@ IRenderVisual* CRender::getVisual(int id) VERIFY(id < int(Visuals.size())); return Visuals[id]; } -D3DVERTEXELEMENT9* CRender::getVB_Format(int id, BOOL _alt) +D3DVERTEXELEMENT9* CRender::getVB_Format(int id, bool alternative) { - if (_alt) + if (alternative) { VERIFY(id < int(xDC.size())); return xDC[id].begin(); @@ -504,9 +504,9 @@ D3DVERTEXELEMENT9* CRender::getVB_Format(int id, BOOL _alt) return nDC[id].begin(); } } -IDirect3DVertexBuffer9* CRender::getVB(int id, BOOL _alt) +ID3DVertexBuffer* CRender::getVB(int id, bool alternative) { - if (_alt) + if (alternative) { VERIFY(id < int(xVB.size())); return xVB[id]; @@ -517,9 +517,9 @@ IDirect3DVertexBuffer9* CRender::getVB(int id, BOOL _alt) return nVB[id]; } } -IDirect3DIndexBuffer9* CRender::getIB(int id, BOOL _alt) +ID3DIndexBuffer* CRender::getIB(int id, bool alternative) { - if (_alt) + if (alternative) { VERIFY(id < int(xIB.size())); return xIB[id]; diff --git a/src/Layers/xrRenderPC_R2/r2.h b/src/Layers/xrRenderPC_R2/r2.h index 77926a5067b..028f607946b 100644 --- a/src/Layers/xrRenderPC_R2/r2.h +++ b/src/Layers/xrRenderPC_R2/r2.h @@ -118,8 +118,8 @@ class CRender : public D3DXRenderBase xr_vector Shaders; typedef svector VertexDeclarator; xr_vector nDC, xDC; - xr_vector nVB, xVB; - xr_vector nIB, xIB; + xr_vector nVB, xVB; + xr_vector nIB, xIB; xr_vector Visuals; CPSLibrary PSLibrary; @@ -153,7 +153,7 @@ class CRender : public D3DXRenderBase private: // Loading / Unloading - void LoadBuffers(CStreamReader* fs, BOOL _alternative); + void LoadBuffers(CStreamReader* fs, bool alternative); void LoadVisuals(IReader* fs); void LoadLights(IReader* fs); void LoadPortals(IReader* fs); @@ -183,9 +183,9 @@ class CRender : public D3DXRenderBase public: ShaderElement* rimp_select_sh_static(dxRender_Visual* pVisual, float cdist_sq); ShaderElement* rimp_select_sh_dynamic(dxRender_Visual* pVisual, float cdist_sq); - D3DVERTEXELEMENT9* getVB_Format(int id, BOOL _alt = FALSE); - IDirect3DVertexBuffer9* getVB(int id, BOOL _alt = FALSE); - IDirect3DIndexBuffer9* getIB(int id, BOOL _alt = FALSE); + D3DVERTEXELEMENT9* getVB_Format(int id, bool alternative = false); + ID3DVertexBuffer* getVB(int id, bool alternative = false); + ID3DIndexBuffer* getIB(int id, bool alternative = false); FSlideWindowItem* getSWI(int id); IRender_Portal* getPortal(int id); IRender_Sector* getSectorActive(); diff --git a/src/Layers/xrRenderPC_R2/r2_loader.cpp b/src/Layers/xrRenderPC_R2/r2_loader.cpp index 1c3eb2aa576..315ea7f4e9d 100644 --- a/src/Layers/xrRenderPC_R2/r2_loader.cpp +++ b/src/Layers/xrRenderPC_R2/r2_loader.cpp @@ -59,7 +59,7 @@ void CRender::level_Load(IReader* fs) { CStreamReader* geom = FS.rs_open("$level$", "level.geom"); R_ASSERT2(geom, "level.geom"); - LoadBuffers(geom, FALSE); + LoadBuffers(geom, false); LoadSWIs(geom); FS.r_close(geom); } @@ -68,7 +68,7 @@ void CRender::level_Load(IReader* fs) { CStreamReader* geom = FS.rs_open("$level$", "level.geomx"); R_ASSERT2(geom, "level.geomX"); - LoadBuffers(geom, TRUE); + LoadBuffers(geom, true); FS.r_close(geom); } @@ -203,15 +203,15 @@ void CRender::level_Unload() */ } -void CRender::LoadBuffers(CStreamReader* base_fs, BOOL _alternative) +void CRender::LoadBuffers(CStreamReader* base_fs, bool alternative) { R_ASSERT2(base_fs, "Could not load geometry. File not found."); Resources->Evict(); u32 dwUsage = D3DUSAGE_WRITEONLY; - xr_vector& _DC = _alternative ? xDC : nDC; - xr_vector& _VB = _alternative ? xVB : nVB; - xr_vector& _IB = _alternative ? xIB : nIB; + xr_vector& _DC = alternative ? xDC : nDC; + xr_vector& _VB = alternative ? xVB : nVB; + xr_vector& _IB = alternative ? xIB : nIB; // Vertex buffers { diff --git a/src/Layers/xrRenderPC_R2/r2_rendertarget.h b/src/Layers/xrRenderPC_R2/r2_rendertarget.h index f2eb54f3c9d..9fd78348cec 100644 --- a/src/Layers/xrRenderPC_R2/r2_rendertarget.h +++ b/src/Layers/xrRenderPC_R2/r2_rendertarget.h @@ -108,17 +108,17 @@ class CRenderTarget : public IRender_Target ref_geom g_accum_omnipart; ref_geom g_accum_volumetric; - IDirect3DVertexBuffer9* g_accum_point_vb; - IDirect3DIndexBuffer9* g_accum_point_ib; + ID3DVertexBuffer* g_accum_point_vb; + ID3DIndexBuffer* g_accum_point_ib; - IDirect3DVertexBuffer9* g_accum_omnip_vb; - IDirect3DIndexBuffer9* g_accum_omnip_ib; + ID3DVertexBuffer* g_accum_omnip_vb; + ID3DIndexBuffer* g_accum_omnip_ib; - IDirect3DVertexBuffer9* g_accum_spot_vb; - IDirect3DIndexBuffer9* g_accum_spot_ib; + ID3DVertexBuffer* g_accum_spot_vb; + ID3DIndexBuffer* g_accum_spot_ib; - IDirect3DVertexBuffer9* g_accum_volumetric_vb; - IDirect3DIndexBuffer9* g_accum_volumetric_ib; + ID3DVertexBuffer* g_accum_volumetric_vb; + ID3DIndexBuffer* g_accum_volumetric_ib; // SSAO ref_shader s_ssao; diff --git a/src/Layers/xrRenderPC_R3/r3.cpp b/src/Layers/xrRenderPC_R3/r3.cpp index efb1d0e24df..44d6983ec3c 100644 --- a/src/Layers/xrRenderPC_R3/r3.cpp +++ b/src/Layers/xrRenderPC_R3/r3.cpp @@ -616,9 +616,9 @@ IRenderVisual* CRender::getVisual(int id) VERIFY(id < int(Visuals.size())); return Visuals[id]; } -D3DVERTEXELEMENT9* CRender::getVB_Format(int id, BOOL _alt) +D3DVERTEXELEMENT9* CRender::getVB_Format(int id, bool alternative) { - if (_alt) + if (alternative) { VERIFY(id < int(xDC.size())); return xDC[id].begin(); @@ -629,9 +629,9 @@ D3DVERTEXELEMENT9* CRender::getVB_Format(int id, BOOL _alt) return nDC[id].begin(); } } -ID3DVertexBuffer* CRender::getVB(int id, BOOL _alt) +ID3DVertexBuffer* CRender::getVB(int id, bool alternative) { - if (_alt) + if (alternative) { VERIFY(id < int(xVB.size())); return xVB[id]; @@ -642,9 +642,9 @@ ID3DVertexBuffer* CRender::getVB(int id, BOOL _alt) return nVB[id]; } } -ID3DIndexBuffer* CRender::getIB(int id, BOOL _alt) +ID3DIndexBuffer* CRender::getIB(int id, bool alternative) { - if (_alt) + if (alternative) { VERIFY(id < int(xIB.size())); return xIB[id]; diff --git a/src/Layers/xrRenderPC_R3/r3.h b/src/Layers/xrRenderPC_R3/r3.h index baae9923cb1..8325f3ad165 100644 --- a/src/Layers/xrRenderPC_R3/r3.h +++ b/src/Layers/xrRenderPC_R3/r3.h @@ -185,7 +185,7 @@ class CRender : public D3DXRenderBase private: // Loading / Unloading - void LoadBuffers(CStreamReader* fs, BOOL _alternative); + void LoadBuffers(CStreamReader* fs, bool alternative); void LoadVisuals(IReader* fs); void LoadLights(IReader* fs); void LoadPortals(IReader* fs); @@ -217,9 +217,9 @@ class CRender : public D3DXRenderBase ShaderElement* rimp_select_sh_static(dxRender_Visual* pVisual, float cdist_sq); ShaderElement* rimp_select_sh_dynamic(dxRender_Visual* pVisual, float cdist_sq); - D3DVERTEXELEMENT9* getVB_Format(int id, BOOL _alt = FALSE); - ID3DVertexBuffer* getVB(int id, BOOL _alt = FALSE); - ID3DIndexBuffer* getIB(int id, BOOL _alt = FALSE); + D3DVERTEXELEMENT9* getVB_Format(int id, bool alternative = false); + ID3DVertexBuffer* getVB(int id, bool alternative = false); + ID3DIndexBuffer* getIB(int id, bool alternative = false); FSlideWindowItem* getSWI(int id); IRender_Portal* getPortal(int id); IRender_Sector* getSectorActive(); diff --git a/src/Layers/xrRenderPC_R3/r3_loader.cpp b/src/Layers/xrRenderPC_R3/r3_loader.cpp index 97c573c71e7..6bc6c07f605 100644 --- a/src/Layers/xrRenderPC_R3/r3_loader.cpp +++ b/src/Layers/xrRenderPC_R3/r3_loader.cpp @@ -62,7 +62,7 @@ void CRender::level_Load(IReader* fs) { CStreamReader* geom = FS.rs_open("$level$", "level.geom"); R_ASSERT2(geom, "level.geom"); - LoadBuffers(geom, FALSE); + LoadBuffers(geom, false); LoadSWIs(geom); FS.r_close(geom); } @@ -71,7 +71,7 @@ void CRender::level_Load(IReader* fs) { CStreamReader* geom = FS.rs_open("$level$", "level.geomx"); R_ASSERT2(geom, "level.geomX"); - LoadBuffers(geom, TRUE); + LoadBuffers(geom, true); FS.r_close(geom); } @@ -207,15 +207,15 @@ void CRender::level_Unload() b_loaded = FALSE; } -void CRender::LoadBuffers(CStreamReader* base_fs, BOOL _alternative) +void CRender::LoadBuffers(CStreamReader* base_fs, bool alternative) { R_ASSERT2(base_fs, "Could not load geometry. File not found."); Resources->Evict(); // u32 dwUsage = D3DUSAGE_WRITEONLY; - xr_vector& _DC = _alternative ? xDC : nDC; - xr_vector& _VB = _alternative ? xVB : nVB; - xr_vector& _IB = _alternative ? xIB : nIB; + xr_vector& _DC = alternative ? xDC : nDC; + xr_vector& _VB = alternative ? xVB : nVB; + xr_vector& _IB = alternative ? xIB : nIB; // Vertex buffers { diff --git a/src/Layers/xrRenderPC_R4/r4.cpp b/src/Layers/xrRenderPC_R4/r4.cpp index 2d8b24bff1b..ecc0dff3606 100644 --- a/src/Layers/xrRenderPC_R4/r4.cpp +++ b/src/Layers/xrRenderPC_R4/r4.cpp @@ -627,9 +627,9 @@ IRenderVisual* CRender::getVisual(int id) VERIFY(id < int(Visuals.size())); return Visuals[id]; } -D3DVERTEXELEMENT9* CRender::getVB_Format(int id, BOOL _alt) +D3DVERTEXELEMENT9* CRender::getVB_Format(int id, bool alternative) { - if (_alt) + if (alternative) { VERIFY(id < int(xDC.size())); return xDC[id].begin(); @@ -640,9 +640,9 @@ D3DVERTEXELEMENT9* CRender::getVB_Format(int id, BOOL _alt) return nDC[id].begin(); } } -ID3DVertexBuffer* CRender::getVB(int id, BOOL _alt) +ID3DVertexBuffer* CRender::getVB(int id, bool alternative) { - if (_alt) + if (alternative) { VERIFY(id < int(xVB.size())); return xVB[id]; @@ -653,9 +653,9 @@ ID3DVertexBuffer* CRender::getVB(int id, BOOL _alt) return nVB[id]; } } -ID3DIndexBuffer* CRender::getIB(int id, BOOL _alt) +ID3DIndexBuffer* CRender::getIB(int id, bool alternative) { - if (_alt) + if (alternative) { VERIFY(id < int(xIB.size())); return xIB[id]; diff --git a/src/Layers/xrRenderPC_R4/r4.h b/src/Layers/xrRenderPC_R4/r4.h index 2bf37297ea5..7a38a3410e7 100644 --- a/src/Layers/xrRenderPC_R4/r4.h +++ b/src/Layers/xrRenderPC_R4/r4.h @@ -193,7 +193,7 @@ class CRender : public D3DXRenderBase private: // Loading / Unloading - void LoadBuffers(CStreamReader* fs, BOOL _alternative); + void LoadBuffers(CStreamReader* fs, bool alternative); void LoadVisuals(IReader* fs); void LoadLights(IReader* fs); void LoadPortals(IReader* fs); @@ -226,9 +226,9 @@ class CRender : public D3DXRenderBase public: ShaderElement* rimp_select_sh_static(dxRender_Visual* pVisual, float cdist_sq); ShaderElement* rimp_select_sh_dynamic(dxRender_Visual* pVisual, float cdist_sq); - D3DVERTEXELEMENT9* getVB_Format(int id, BOOL _alt = FALSE); - ID3DVertexBuffer* getVB(int id, BOOL _alt = FALSE); - ID3DIndexBuffer* getIB(int id, BOOL _alt = FALSE); + D3DVERTEXELEMENT9* getVB_Format(int id, bool alternative = false); + ID3DVertexBuffer* getVB(int id, bool alternative = false); + ID3DIndexBuffer* getIB(int id, bool alternative = false); FSlideWindowItem* getSWI(int id); IRender_Portal* getPortal(int id); IRender_Sector* getSectorActive(); diff --git a/src/Layers/xrRenderPC_R4/r4_loader.cpp b/src/Layers/xrRenderPC_R4/r4_loader.cpp index 71b59e8511c..88aad26ad8d 100644 --- a/src/Layers/xrRenderPC_R4/r4_loader.cpp +++ b/src/Layers/xrRenderPC_R4/r4_loader.cpp @@ -62,7 +62,7 @@ void CRender::level_Load(IReader* fs) { CStreamReader* geom = FS.rs_open("$level$", "level.geom"); R_ASSERT2(geom, "level.geom"); - LoadBuffers(geom, FALSE); + LoadBuffers(geom, false); LoadSWIs(geom); FS.r_close(geom); } @@ -71,7 +71,7 @@ void CRender::level_Load(IReader* fs) { CStreamReader* geom = FS.rs_open("$level$", "level.geomx"); R_ASSERT2(geom, "level.geomX"); - LoadBuffers(geom, TRUE); + LoadBuffers(geom, true); FS.r_close(geom); } @@ -186,15 +186,15 @@ void CRender::level_Unload() b_loaded = FALSE; } -void CRender::LoadBuffers(CStreamReader* base_fs, BOOL _alternative) +void CRender::LoadBuffers(CStreamReader* base_fs, bool alternative) { R_ASSERT2(base_fs, "Could not load geometry. File not found."); RImplementation.Resources->Evict(); // u32 dwUsage = D3DUSAGE_WRITEONLY; - xr_vector& _DC = _alternative ? xDC : nDC; - xr_vector& _VB = _alternative ? xVB : nVB; - xr_vector& _IB = _alternative ? xIB : nIB; + xr_vector& _DC = alternative ? xDC : nDC; + xr_vector& _VB = alternative ? xVB : nVB; + xr_vector& _IB = alternative ? xIB : nIB; // Vertex buffers { From e14ec3dab44a98bf9a610b2407bebbec6083f115 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Tue, 2 Oct 2018 00:09:48 +0500 Subject: [PATCH 05/42] xrRender_R1: support for fast geometry Only for debugging purpose for now. (requires level reload to apply) New console command r1_force_geomx allows you to force render fast geometry on all renderers --- src/Layers/xrRender/FVisual.cpp | 18 ++-- src/Layers/xrRender/xrRender_console.cpp | 2 + src/Layers/xrRender/xrRender_console.h | 1 + src/Layers/xrRenderPC_R1/FStaticRender.cpp | 42 +++++++-- src/Layers/xrRenderPC_R1/FStaticRender.h | 14 +-- .../xrRenderPC_R1/FStaticRender_Loader.cpp | 91 +++++++++++++------ 6 files changed, 117 insertions(+), 51 deletions(-) diff --git a/src/Layers/xrRender/FVisual.cpp b/src/Layers/xrRender/FVisual.cpp index 454b282cdf4..4d4473831ce 100644 --- a/src/Layers/xrRender/FVisual.cpp +++ b/src/Layers/xrRender/FVisual.cpp @@ -60,9 +60,12 @@ void Fvisual::Load(const char* N, IReader* data, u32 dwFlags) p_rm_Indices->AddRef(); #endif #endif -#if (RENDER == R_R2) || (RENDER == R_R3) || (RENDER == R_R4) || (RENDER == R_GL) // check for fast-vertices +#if RENDER == R_R1 + if (data->find_chunk(OGF_FASTPATH) && ps_r1_force_geomx) +#else if (data->find_chunk(OGF_FASTPATH)) +#endif { destructor geomdef(data->open_chunk(OGF_FASTPATH)); destructor def(geomdef().open_chunk(OGF_GCONTAINER)); @@ -97,7 +100,6 @@ void Fvisual::Load(const char* N, IReader* data, u32 dwFlags) // geom m_fast->rm_geom.create(fmt, m_fast->p_rm_Vertices, m_fast->p_rm_Indices); } -#endif // (RENDER==R_R2) || (RENDER==R_R3) || (RENDER==R_R4) || (RENDER==R_GL) } // read vertices @@ -222,8 +224,11 @@ void Fvisual::Load(const char* N, IReader* data, u32 dwFlags) void Fvisual::Render(float) { -#if (RENDER == R_R2) || (RENDER == R_R3) || (RENDER == R_R4) || (RENDER==R_GL) - if (m_fast && RImplementation.phase == CRender::PHASE_SMAP && !RCache.is_TessEnabled()) +#if RENDER == R_R1 + if (m_fast && ps_r1_force_geomx) +#else + if (m_fast && (ps_r1_force_geomx || RImplementation.phase == CRender::PHASE_SMAP && !RCache.is_TessEnabled())) +#endif { RCache.set_Geometry(m_fast->rm_geom); RCache.Render(D3DPT_TRIANGLELIST, m_fast->vBase, 0, m_fast->vCount, m_fast->iBase, m_fast->dwPrimitives); @@ -235,11 +240,6 @@ void Fvisual::Render(float) RCache.Render(D3DPT_TRIANGLELIST, vBase, 0, vCount, iBase, dwPrimitives); RCache.stat.r.s_static.add(vCount); } -#else // (RENDER==R_R2) || (RENDER==R_R3) || (RENDER==R_R4) || (RENDER==R_GL) - RCache.set_Geometry(rm_geom); - RCache.Render(D3DPT_TRIANGLELIST, vBase, 0, vCount, iBase, dwPrimitives); - RCache.stat.r.s_static.add(vCount); -#endif // (RENDER==R_R2) || (RENDER==R_R3) || (RENDER==R_R4) || (RENDER==R_GL) } #define PCOPY(a) a = pFrom->a diff --git a/src/Layers/xrRender/xrRender_console.cpp b/src/Layers/xrRender/xrRender_console.cpp index 146b5f63a45..92c7092597f 100644 --- a/src/Layers/xrRender/xrRender_console.cpp +++ b/src/Layers/xrRender/xrRender_console.cpp @@ -116,6 +116,7 @@ float ps_r1_lmodel_lerp = 0.1f; float ps_r1_dlights_clip = 40.f; float ps_r1_pps_u = 0.f; float ps_r1_pps_v = 0.f; +int ps_r1_force_geomx = 0; // R1-specific int ps_r1_GlowsPerFrame = 16; // r1-only @@ -743,6 +744,7 @@ void xrRender_initconsole() CMD4(CCC_Float, "r1_dlights_clip", &ps_r1_dlights_clip, 10.f, 150.f); CMD4(CCC_Float, "r1_pps_u", &ps_r1_pps_u, -1.f, +1.f); CMD4(CCC_Float, "r1_pps_v", &ps_r1_pps_v, -1.f, +1.f); + CMD4(CCC_Integer, "r1_force_geomx", &ps_r1_force_geomx, 0, 1); // R1-specific CMD4(CCC_Integer, "r1_glows_per_frame", &ps_r1_GlowsPerFrame, 2, 32); diff --git a/src/Layers/xrRender/xrRender_console.h b/src/Layers/xrRender/xrRender_console.h index ce5d7e3c43f..972a4671aad 100644 --- a/src/Layers/xrRender/xrRender_console.h +++ b/src/Layers/xrRender/xrRender_console.h @@ -63,6 +63,7 @@ extern ECORE_API float ps_r1_lmodel_lerp; extern ECORE_API float ps_r1_dlights_clip; extern ECORE_API float ps_r1_pps_u; extern ECORE_API float ps_r1_pps_v; +extern ECORE_API int ps_r1_force_geomx; // R1-specific extern ECORE_API int ps_r1_GlowsPerFrame; // r1-only diff --git a/src/Layers/xrRenderPC_R1/FStaticRender.cpp b/src/Layers/xrRenderPC_R1/FStaticRender.cpp index 3d2f66aa84d..875e2b942af 100644 --- a/src/Layers/xrRenderPC_R1/FStaticRender.cpp +++ b/src/Layers/xrRenderPC_R1/FStaticRender.cpp @@ -250,20 +250,44 @@ IRenderVisual* CRender::getVisual(int id) VERIFY(id < int(Visuals.size())); return Visuals[id]; } -D3DVERTEXELEMENT9* CRender::getVB_Format(int id) +D3DVERTEXELEMENT9* CRender::getVB_Format(int id, bool alternative) { - VERIFY(id < int(DCL.size())); - return DCL[id].begin(); + if (alternative) + { + VERIFY(id < int(xDC.size())); + return xDC[id].begin(); + } + else + { + VERIFY(id < int(nDC.size())); + return nDC[id].begin(); + } } -ID3DVertexBuffer* CRender::getVB(int id) +ID3DVertexBuffer* CRender::getVB(int id, bool alternative) { - VERIFY(id < int(VB.size())); - return VB[id]; + if (alternative) + { + VERIFY(id < int(xVB.size())); + return xVB[id]; + } + else + { + VERIFY(id < int(nVB.size())); + return nVB[id]; + } } -ID3DIndexBuffer* CRender::getIB(int id) +ID3DIndexBuffer* CRender::getIB(int id, bool alternative) { - VERIFY(id < int(IB.size())); - return IB[id]; + if (alternative) + { + VERIFY(id < int(xIB.size())); + return xIB[id]; + } + else + { + VERIFY(id < int(nIB.size())); + return nIB[id]; + } } FSlideWindowItem* CRender::getSWI(int id) { diff --git a/src/Layers/xrRenderPC_R1/FStaticRender.h b/src/Layers/xrRenderPC_R1/FStaticRender.h index 4f36203404c..e4e50ff31ae 100644 --- a/src/Layers/xrRenderPC_R1/FStaticRender.h +++ b/src/Layers/xrRenderPC_R1/FStaticRender.h @@ -50,9 +50,9 @@ class CRender : public D3DXRenderBase xr_vector SWIs; xr_vector Shaders; typedef svector VertexDeclarator; - xr_vector DCL; - xr_vector VB; - xr_vector IB; + xr_vector nDC, xDC; + xr_vector nVB, xVB; + xr_vector nIB, xIB; xr_vector Visuals; CPSLibrary PSLibrary; CLight_DB Lights; @@ -78,7 +78,7 @@ class CRender : public D3DXRenderBase private: // Loading / Unloading - void LoadBuffers(CStreamReader* fs); + void LoadBuffers(CStreamReader* fs, bool alternative = false); void LoadVisuals(IReader* fs); void LoadLights(IReader* fs); void LoadSectors(IReader* fs); @@ -91,9 +91,9 @@ class CRender : public D3DXRenderBase public: ShaderElement* rimp_select_sh_static(dxRender_Visual* pVisual, float cdist_sq); ShaderElement* rimp_select_sh_dynamic(dxRender_Visual* pVisual, float cdist_sq); - D3DVERTEXELEMENT9* getVB_Format(int id); - ID3DVertexBuffer* getVB(int id); - ID3DIndexBuffer* getIB(int id); + D3DVERTEXELEMENT9* getVB_Format(int id, bool alternative = false); + ID3DVertexBuffer* getVB(int id, bool alternative = false); + ID3DIndexBuffer* getIB(int id, bool alternative = false); FSlideWindowItem* getSWI(int id); IRender_Portal* getPortal(int id); IRender_Sector* getSectorActive(); diff --git a/src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp b/src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp index eef0e4c7d1f..40d9f358095 100644 --- a/src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp +++ b/src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp @@ -62,10 +62,22 @@ void CRender::level_Load(IReader* fs) // VB,IB,SWI g_pGamePersistent->SetLoadStageTitle("st_loading_geometry"); g_pGamePersistent->LoadTitle(); - CStreamReader* geom = FS.rs_open("$level$", "level.geom"); - LoadBuffers(geom); - LoadSWIs(geom); - FS.r_close(geom); + { + CStreamReader* geom = FS.rs_open("$level$", "level.geom"); + R_ASSERT2(geom, "level.geom"); + LoadBuffers(geom, false); + LoadSWIs(geom); + FS.r_close(geom); + } + + //...and alternate/fast geometry + if (ps_r1_force_geomx) + { + CStreamReader* geom = FS.rs_open("$level$", "level.geomx"); + R_ASSERT2(geom, "level.geomX"); + LoadBuffers(geom, true); + FS.r_close(geom); + } // Visuals g_pGamePersistent->SetLoadStageTitle("st_loading_spatial_db"); @@ -147,13 +159,36 @@ void CRender::level_Unload() SWIs.clear(); //*** VB/IB - for (I = 0; I < VB.size(); I++) - _RELEASE(VB[I]); - for (I = 0; I < IB.size(); I++) - _RELEASE(IB[I]); - DCL.clear(); - VB.clear(); - IB.clear(); + for (I = 0; I < nVB.size(); I++) + { + HW.stats_manager.decrement_stats_vb(nVB[I]); + _RELEASE(nVB[I]); + } + + for (I = 0; I < xVB.size(); I++) + { + HW.stats_manager.decrement_stats_vb(xVB[I]); + _RELEASE(xVB[I]); + } + nVB.clear(); + xVB.clear(); + + for (I = 0; I < nIB.size(); I++) + { + HW.stats_manager.decrement_stats_ib(nIB[I]); + _RELEASE(nIB[I]); + } + + for (I = 0; I < xIB.size(); I++) + { + HW.stats_manager.decrement_stats_ib(xIB[I]); + _RELEASE(xIB[I]); + } + + nIB.clear(); + xIB.clear(); + nDC.clear(); + xDC.clear(); //*** Components xr_delete(Details); @@ -172,19 +207,23 @@ void CRender::level_Unload() b_loaded = FALSE; } -void CRender::LoadBuffers(CStreamReader* base_fs) +void CRender::LoadBuffers(CStreamReader* base_fs, bool alternative) { Resources->Evict(); u32 dwUsage = D3DUSAGE_WRITEONLY | (HW.Caps.geometry.bSoftware ? D3DUSAGE_SOFTWAREPROCESSING : 0); + xr_vector& _DC = alternative ? xDC : nDC; + xr_vector& _VB = alternative ? xVB : nVB; + xr_vector& _IB = alternative ? xIB : nIB; + // Vertex buffers if (base_fs->find_chunk(fsL_VB)) { // Use DX9-style declarators CStreamReader* fs = base_fs->open_chunk(fsL_VB); u32 count = fs->r_u32(); - DCL.resize(count); - VB.resize(count); + _DC.resize(count); + _VB.resize(count); u32 buffer_size = (MAXD3DDECLLENGTH + 1) * sizeof(D3DVERTEXELEMENT9); D3DVERTEXELEMENT9* dcl = (D3DVERTEXELEMENT9*)_alloca(buffer_size); @@ -200,9 +239,9 @@ void CRender::LoadBuffers(CStreamReader* base_fs) u32 dcl_len = D3DXGetDeclLength(dcl) + 1; - DCL[i].resize(dcl_len); - fs->r(DCL[i].begin(), dcl_len * sizeof(D3DVERTEXELEMENT9)); - //.????????? remove T&B from DCL[] + _DC[i].resize(dcl_len); + fs->r(_DC[i].begin(), dcl_len * sizeof(D3DVERTEXELEMENT9)); + //.????????? remove T&B from _DC[] // count, size u32 vCount = fs->r_u32(); @@ -211,12 +250,12 @@ void CRender::LoadBuffers(CStreamReader* base_fs) // Create and fill BYTE* pData = nullptr; - R_CHK(HW.pDevice->CreateVertexBuffer(vCount * vSize, dwUsage, 0, D3DPOOL_MANAGED, &VB[i], nullptr)); - HW.stats_manager.increment_stats(vCount * vSize, enum_stats_buffer_type_vertex, D3DPOOL_MANAGED); - R_CHK(VB[i]->Lock(0, 0, (void**)&pData, 0)); + R_CHK(HW.pDevice->CreateVertexBuffer(vCount * vSize, dwUsage, 0, D3DPOOL_MANAGED, &_VB[i], nullptr)); + HW.stats_manager.increment_stats_vb(_VB[i]); + R_CHK(_VB[i]->Lock(0, 0, (void**)&pData, 0)); fs->r(pData, vCount * vSize); // CopyMemory (pData,fs->pointer(),vCount*vSize); //.???? copy while skip T&B - VB[i]->Unlock(); + _VB[i]->Unlock(); // fs->advance (vCount*vSize); } @@ -232,7 +271,7 @@ void CRender::LoadBuffers(CStreamReader* base_fs) { CStreamReader* fs = base_fs->open_chunk(fsL_IB); u32 count = fs->r_u32(); - IB.resize(count); + _IB.resize(count); for (u32 i = 0; i < count; i++) { u32 iCount = fs->r_u32(); @@ -240,12 +279,12 @@ void CRender::LoadBuffers(CStreamReader* base_fs) // Create and fill BYTE* pData = nullptr; - R_CHK(HW.pDevice->CreateIndexBuffer(iCount * 2, dwUsage, D3DFMT_INDEX16, D3DPOOL_MANAGED, &IB[i], nullptr)); - HW.stats_manager.increment_stats(iCount * 2, enum_stats_buffer_type_index, D3DPOOL_MANAGED); - R_CHK(IB[i]->Lock(0, 0, (void**)&pData, 0)); + R_CHK(HW.pDevice->CreateIndexBuffer(iCount * 2, dwUsage, D3DFMT_INDEX16, D3DPOOL_MANAGED, &_IB[i], nullptr)); + HW.stats_manager.increment_stats_ib(_IB[i]); + R_CHK(_IB[i]->Lock(0, 0, (void**)&pData, 0)); // CopyMemory (pData,fs->pointer(),iCount*2); fs->r(pData, iCount * 2); - IB[i]->Unlock(); + _IB[i]->Unlock(); // fs->advance (iCount*2); } From 3cb7820baba9e2771f7e731ee4a8ea277ec56fad Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Tue, 2 Oct 2018 22:02:59 +0500 Subject: [PATCH 06/42] xrRenderDX10/dx10HW.cpp: correct format support check --- src/Layers/xrRender/HW.h | 2 +- src/Layers/xrRenderDX10/dx10HW.cpp | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Layers/xrRender/HW.h b/src/Layers/xrRender/HW.h index 4c8037d7d69..df306ba545a 100644 --- a/src/Layers/xrRender/HW.h +++ b/src/Layers/xrRender/HW.h @@ -126,7 +126,7 @@ class CHW void UpdateViews(); #endif #if defined(USE_DX10) || defined(USE_DX11) - bool CheckFormatSupport(DXGI_FORMAT format, D3D_FORMAT_SUPPORT feature) const; + bool CheckFormatSupport(DXGI_FORMAT format, UINT feature) const; DXGI_FORMAT SelectFormat(D3D_FORMAT_SUPPORT feature, const DXGI_FORMAT formats[], size_t count) const; virtual void OnAppActivate(); virtual void OnAppDeactivate(); diff --git a/src/Layers/xrRenderDX10/dx10HW.cpp b/src/Layers/xrRenderDX10/dx10HW.cpp index b296116d07a..ff2e308db49 100644 --- a/src/Layers/xrRenderDX10/dx10HW.cpp +++ b/src/Layers/xrRenderDX10/dx10HW.cpp @@ -260,11 +260,16 @@ void CHW::Reset() UpdateViews(); } -bool CHW::CheckFormatSupport(const DXGI_FORMAT format, const D3D_FORMAT_SUPPORT feature) const +bool CHW::CheckFormatSupport(const DXGI_FORMAT format, const UINT feature) const { - UINT feature_bit = feature; - if (SUCCEEDED(pDevice->CheckFormatSupport(format, &feature_bit))) - return true; + UINT supports; + + if (SUCCEEDED(pDevice->CheckFormatSupport(format, &supports))) + { + if (supports & feature) + return true; + } + return false; } From 0d2c68b46aa7d36dcedb2d9e5ebca9f51ba15fd2 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Tue, 2 Oct 2018 22:22:36 +0500 Subject: [PATCH 07/42] xrRenderDX10/dx10SH_RT.cpp: enabled format support check Renamed bUseAsDepth -> useAsDepth --- src/Layers/xrRenderDX10/DXCommonTypes.h | 4 +++ src/Layers/xrRenderDX10/dx10SH_RT.cpp | 41 ++++++++++--------------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/src/Layers/xrRenderDX10/DXCommonTypes.h b/src/Layers/xrRenderDX10/DXCommonTypes.h index cfb8e1e62e5..58a3c0a8088 100644 --- a/src/Layers/xrRenderDX10/DXCommonTypes.h +++ b/src/Layers/xrRenderDX10/DXCommonTypes.h @@ -150,6 +150,8 @@ typedef ID3D11DeviceContext ID3DDeviceContext; #define D3D_FILL_WIREFRAME D3D11_FILL_WIREFRAME #define D3D_FORMAT_SUPPORT D3D11_FORMAT_SUPPORT +#define D3D_FORMAT_SUPPORT_TEXTURE2D D3D11_FORMAT_SUPPORT_TEXTURE2D +#define D3D_FORMAT_SUPPORT_RENDER_TARGET D3D11_FORMAT_SUPPORT_RENDER_TARGET #define D3D_FORMAT_SUPPORT_DEPTH_STENCIL D3D11_FORMAT_SUPPORT_DEPTH_STENCIL #define D3D_FORMAT_SUPPORT_DISPLAY D3D11_FORMAT_SUPPORT_DISPLAY @@ -410,6 +412,8 @@ typedef ID3D10Resource ID3DResource; #define D3D_FILL_WIREFRAME D3D10_FILL_WIREFRAME #define D3D_FORMAT_SUPPORT D3D10_FORMAT_SUPPORT +#define D3D_FORMAT_SUPPORT_TEXTURE2D D3D10_FORMAT_SUPPORT_TEXTURE2D +#define D3D_FORMAT_SUPPORT_RENDER_TARGET D3D10_FORMAT_SUPPORT_RENDER_TARGET #define D3D_FORMAT_SUPPORT_DEPTH_STENCIL D3D10_FORMAT_SUPPORT_DEPTH_STENCIL #define D3D_FORMAT_SUPPORT_DISPLAY D3D10_FORMAT_SUPPORT_DISPLAY diff --git a/src/Layers/xrRenderDX10/dx10SH_RT.cpp b/src/Layers/xrRenderDX10/dx10SH_RT.cpp index b42f139db26..1274e10220e 100644 --- a/src/Layers/xrRenderDX10/dx10SH_RT.cpp +++ b/src/Layers/xrRenderDX10/dx10SH_RT.cpp @@ -36,8 +36,6 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount) R_ASSERT(HW.pDevice && Name && Name[0] && w && h); _order = CPU::GetCLK(); // Device.GetTimerGlobal()->GetElapsed_clk(); - // HRESULT _hr; - dwWidth = w; dwHeight = h; fmt = f; @@ -88,31 +86,24 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount) usage = D3DUSAGE_DEPTHSTENCIL; } - bool bUseAsDepth = (usage == D3DUSAGE_RENDERTARGET) ? false : true; + const bool useAsDepth = usage != D3DUSAGE_RENDERTARGET; // Validate render-target usage - //_hr = HW.pD3D->CheckDeviceFormat( - // HW.DevAdapter, - // HW.m_DriverType, - // HW.Caps.fTarget, - // usage, - // D3DRTYPE_TEXTURE, - // f - //); - // TODO: DX10: implement format support check - // UINT FormatSupport; - //_hr = HW.pDevice->CheckFormatSupport( dx10FMT, &FormatSupport); - // if (FAILED(_hr)) return; - // if (!( - //(FormatSupport&D3Dxx_FORMAT_SUPPORT_TEXTURE2D) - //&& (FormatSupport&(bUseAsDepth?D3Dxx_FORMAT_SUPPORT_DEPTH_STENCIL:D3Dxx_FORMAT_SUPPORT_RENDER_TARGET)) - //)) - // return; + UINT required = D3D_FORMAT_SUPPORT_TEXTURE2D; + + if (useAsDepth) + required |= D3D_FORMAT_SUPPORT_DEPTH_STENCIL; + else + required |= D3D_FORMAT_SUPPORT_RENDER_TARGET; + + if (!HW.CheckFormatSupport(dx10FMT, required)) + return; // Try to create texture/surface RImplementation.Resources->Evict(); //_hr = HW.pDevice->CreateTexture (w, h, 1, usage, f, D3DPOOL_DEFAULT, &pSurface,NULL); // if (FAILED(_hr) || (0==pSurface)) return; + // Create the render target texture D3D_TEXTURE2D_DESC desc; ZeroMemory(&desc, sizeof(desc)); @@ -124,10 +115,10 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount) desc.SampleDesc.Count = SampleCount; desc.Usage = D3D_USAGE_DEFAULT; if (SampleCount <= 1) - desc.BindFlags = D3D_BIND_SHADER_RESOURCE | (bUseAsDepth ? D3D_BIND_DEPTH_STENCIL : D3D_BIND_RENDER_TARGET); + desc.BindFlags = D3D_BIND_SHADER_RESOURCE | (useAsDepth ? D3D_BIND_DEPTH_STENCIL : D3D_BIND_RENDER_TARGET); else { - desc.BindFlags = (bUseAsDepth ? D3D_BIND_DEPTH_STENCIL : (D3D_BIND_SHADER_RESOURCE | D3D_BIND_RENDER_TARGET)); + desc.BindFlags = (useAsDepth ? D3D_BIND_DEPTH_STENCIL : (D3D_BIND_SHADER_RESOURCE | D3D_BIND_RENDER_TARGET)); if (RImplementation.o.dx10_msaa_opt) { desc.SampleDesc.Quality = UINT(D3D_STANDARD_MULTISAMPLE_PATTERN); @@ -135,7 +126,7 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount) } #ifdef USE_DX11 - if (HW.FeatureLevel >= D3D_FEATURE_LEVEL_11_0 && !bUseAsDepth && SampleCount == 1 && useUAV) + if (HW.FeatureLevel >= D3D_FEATURE_LEVEL_11_0 && !useAsDepth && SampleCount == 1 && useUAV) desc.BindFlags |= D3D11_BIND_UNORDERED_ACCESS; #endif @@ -146,7 +137,7 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount) Msg("* created RT(%s), %dx%d, format = %d samples = %d", Name, w, h, dx10FMT, SampleCount); #endif // DEBUG // R_CHK (pSurface->GetSurfaceLevel (0,&pRT)); - if (bUseAsDepth) + if (useAsDepth) { D3D_DEPTH_STENCIL_VIEW_DESC ViewDesc; ZeroMemory(&ViewDesc, sizeof(ViewDesc)); @@ -175,7 +166,7 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount) CHK_DX(HW.pDevice->CreateRenderTargetView(pSurface, 0, &pRT)); #ifdef USE_DX11 - if (HW.FeatureLevel >= D3D_FEATURE_LEVEL_11_0 && !bUseAsDepth && SampleCount == 1 && useUAV) + if (HW.FeatureLevel >= D3D_FEATURE_LEVEL_11_0 && !useAsDepth && SampleCount == 1 && useUAV) { D3D11_UNORDERED_ACCESS_VIEW_DESC UAVDesc; ZeroMemory(&UAVDesc, sizeof(D3D11_UNORDERED_ACCESS_VIEW_DESC)); From 15ff1d7e03719ad9d008cc0f9f3b3a9523a995f9 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Tue, 2 Oct 2018 22:29:28 +0500 Subject: [PATCH 08/42] xrRenderDX10: select the best available format for depth-stencil buffer --- src/Layers/xrRenderDX10/dx10HW.cpp | 7 +-- src/Layers/xrRenderDX10/dx10SH_RT.cpp | 59 +++++++++++++++----- src/Layers/xrRenderDX10/dx10SH_Texture.cpp | 19 ++++++- src/Layers/xrRenderDX10/dx10TextureUtils.cpp | 9 +-- src/Layers/xrRenderDX10/dx10TextureUtils.h | 4 ++ 5 files changed, 74 insertions(+), 24 deletions(-) diff --git a/src/Layers/xrRenderDX10/dx10HW.cpp b/src/Layers/xrRenderDX10/dx10HW.cpp index ff2e308db49..e114cf3fd96 100644 --- a/src/Layers/xrRenderDX10/dx10HW.cpp +++ b/src/Layers/xrRenderDX10/dx10HW.cpp @@ -319,13 +319,12 @@ void CHW::UpdateViews() descDepth.ArraySize = 1; // Select depth-stencil format - // TODO: DX10: test and support other formats constexpr DXGI_FORMAT formats[] = { - //DXGI_FORMAT_D32_FLOAT_S8X24_UINT, + DXGI_FORMAT_D32_FLOAT_S8X24_UINT, DXGI_FORMAT_D24_UNORM_S8_UINT, - //DXGI_FORMAT_D32_FLOAT, - //DXGI_FORMAT_D16_UNORM + DXGI_FORMAT_D32_FLOAT, + DXGI_FORMAT_D16_UNORM }; descDepth.Format = SelectFormat(D3D_FORMAT_SUPPORT_DEPTH_STENCIL, formats, std::size(formats)); Caps.fDepth = dx10TextureUtils::ConvertTextureFormat(descDepth.Format); diff --git a/src/Layers/xrRenderDX10/dx10SH_RT.cpp b/src/Layers/xrRenderDX10/dx10SH_RT.cpp index 1274e10220e..868c3e82509 100644 --- a/src/Layers/xrRenderDX10/dx10SH_RT.cpp +++ b/src/Layers/xrRenderDX10/dx10SH_RT.cpp @@ -61,16 +61,8 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount) u32 usage = 0; if (D3DFMT_D24X8 == fmt) usage = D3DUSAGE_DEPTHSTENCIL; - else if (D3DFMT_D24S8 == fmt) - usage = D3DUSAGE_DEPTHSTENCIL; else if (D3DFMT_D15S1 == fmt) usage = D3DUSAGE_DEPTHSTENCIL; - else if (D3DFMT_D16 == fmt) - usage = D3DUSAGE_DEPTHSTENCIL; - else if (D3DFMT_D16_LOCKABLE == fmt) - usage = D3DUSAGE_DEPTHSTENCIL; - else if (D3DFMT_D32F_LOCKABLE == fmt) - usage = D3DUSAGE_DEPTHSTENCIL; else if ((D3DFORMAT)MAKEFOURCC('D', 'F', '2', '4') == fmt) usage = D3DUSAGE_DEPTHSTENCIL; else @@ -78,12 +70,39 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount) DXGI_FORMAT dx10FMT; - if (fmt != D3DFMT_D24S8) - dx10FMT = dx10TextureUtils::ConvertTextureFormat(fmt); - else + switch (fmt) { + case D3DFMT_D32S8X24: + dx10FMT = DXGI_FORMAT_R32G8X24_TYPELESS; + usage = D3DUSAGE_DEPTHSTENCIL; + break; + + case D3DFMT_D24S8: dx10FMT = DXGI_FORMAT_R24G8_TYPELESS; usage = D3DUSAGE_DEPTHSTENCIL; + break; + + case D3DFMT_D32: + VERIFY(false, "What? How this happen?"); + [[fallthrough]]; + + case D3DFMT_D32F_LOCKABLE: + dx10FMT = DXGI_FORMAT_R32_TYPELESS; + usage = D3DUSAGE_DEPTHSTENCIL; + break; + + case D3DFMT_D16: + VERIFY(false, "What? How this happen?"); + [[fallthrough]]; + + case D3DFMT_D16_LOCKABLE: + dx10FMT = DXGI_FORMAT_R16_TYPELESS; + usage = D3DUSAGE_DEPTHSTENCIL; + break; + + default: + dx10FMT = dx10TextureUtils::ConvertTextureFormat(fmt); + break; } const bool useAsDepth = usage != D3DUSAGE_RENDERTARGET; @@ -154,10 +173,24 @@ void CRT::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount) } ViewDesc.Texture2D.MipSlice = 0; + switch (desc.Format) { - case DXGI_FORMAT_R24G8_TYPELESS: ViewDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; break; - case DXGI_FORMAT_R32_TYPELESS: ViewDesc.Format = DXGI_FORMAT_D32_FLOAT; break; + case DXGI_FORMAT_R16_TYPELESS: + ViewDesc.Format = DXGI_FORMAT_D16_UNORM; + break; + + case DXGI_FORMAT_R24G8_TYPELESS: + ViewDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; + break; + + case DXGI_FORMAT_R32_TYPELESS: + ViewDesc.Format = DXGI_FORMAT_D32_FLOAT; + break; + + case DXGI_FORMAT_R32G8X24_TYPELESS: + ViewDesc.Format = DXGI_FORMAT_D32_FLOAT_S8X24_UINT; + break; } CHK_DX(HW.pDevice->CreateDepthStencilView(pSurface, &ViewDesc, &pZRT)); diff --git a/src/Layers/xrRenderDX10/dx10SH_Texture.cpp b/src/Layers/xrRenderDX10/dx10SH_Texture.cpp index bddb370759d..203b2d4ea7d 100644 --- a/src/Layers/xrRenderDX10/dx10SH_Texture.cpp +++ b/src/Layers/xrRenderDX10/dx10SH_Texture.cpp @@ -89,11 +89,24 @@ void CTexture::surface_set(ID3DBaseTexture* surf) switch (desc.Format) { - case DXGI_FORMAT_R24G8_TYPELESS: ViewDesc.Format = DXGI_FORMAT_R24_UNORM_X8_TYPELESS; break; - case DXGI_FORMAT_R32_TYPELESS: ViewDesc.Format = DXGI_FORMAT_R32_FLOAT; break; + case DXGI_FORMAT_R32G8X24_TYPELESS: + ViewDesc.Format = DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS; + break; + + case DXGI_FORMAT_R24G8_TYPELESS: + ViewDesc.Format = DXGI_FORMAT_R24_UNORM_X8_TYPELESS; + break; + + case DXGI_FORMAT_R32_TYPELESS: + ViewDesc.Format = DXGI_FORMAT_R32_FLOAT; + break; + + case DXGI_FORMAT_R16_TYPELESS: + ViewDesc.Format = DXGI_FORMAT_R16_FLOAT; + break; } - // this would be supported by DX10.1 but is not needed for stalker + // this would be supported by DX10.1 but is not needed for stalker // XXX: why? // if( ViewDesc.Format != DXGI_FORMAT_R24_UNORM_X8_TYPELESS ) if ((desc.SampleDesc.Count <= 1) || (ViewDesc.Format != DXGI_FORMAT_R24_UNORM_X8_TYPELESS)) CHK_DX(HW.pDevice->CreateShaderResourceView(pSurface, &ViewDesc, &m_pSRView)); diff --git a/src/Layers/xrRenderDX10/dx10TextureUtils.cpp b/src/Layers/xrRenderDX10/dx10TextureUtils.cpp index 08ffd47a089..b64a62de501 100644 --- a/src/Layers/xrRenderDX10/dx10TextureUtils.cpp +++ b/src/Layers/xrRenderDX10/dx10TextureUtils.cpp @@ -65,12 +65,13 @@ TextureFormatPairs TextureFormatList[] = { // D3DFMT_D32 Not available // D3DFMT_D15S1 Not available // D3DFMT_D24S8 Not available - {D3DFMT_D24S8, DXGI_FORMAT_D24_UNORM_S8_UINT}, // XXX: documentation says that D3DFMT_D24S8 is unavailable + {D3DFMT_D24S8, DXGI_FORMAT_D24_UNORM_S8_UINT}, {D3DFMT_D24X8, DXGI_FORMAT_R24G8_TYPELESS}, // DXGI_FORMAT_D24_UNORM_S8_UINT}, // Not available // D3DFMT_D24X4S4 Not available - // D3DFMT_D16 DXGI_FORMAT_D16_UNORM - //{ D3DFMT_D32F_LOCKABLE, DXGI_FORMAT_D32_FLOAT}, - {D3DFMT_D32F_LOCKABLE, DXGI_FORMAT_R32_TYPELESS}, + { D3DFMT_D16_LOCKABLE, DXGI_FORMAT_D16_UNORM }, + { D3DFMT_D32F_LOCKABLE, DXGI_FORMAT_R32_TYPELESS }, + { D3DFMT_D32F_LOCKABLE, DXGI_FORMAT_D32_FLOAT }, + { D3DFMT_D32S8X24, DXGI_FORMAT_D32_FLOAT_S8X24_UINT}, // D3DFMT_D24FS8 Not available // D3DFMT_S1D15 Not available // D3DFMT_S8D24 DXGI_FORMAT_D24_UNORM_S8_UINT diff --git a/src/Layers/xrRenderDX10/dx10TextureUtils.h b/src/Layers/xrRenderDX10/dx10TextureUtils.h index 3614193eb1e..68f9054c5be 100644 --- a/src/Layers/xrRenderDX10/dx10TextureUtils.h +++ b/src/Layers/xrRenderDX10/dx10TextureUtils.h @@ -2,6 +2,10 @@ #define dx10TextureUtils_included #pragma once +// hack for dx9... That's it. I don't know if there's already DS64 format. +// If true, then replace with another 4 chars +#define D3DFMT_D32S8X24 (D3DFORMAT)MAKEFOURCC('D', 'S', '6', '4') + namespace dx10TextureUtils { DXGI_FORMAT ConvertTextureFormat(D3DFORMAT dx9FMT); From 6fa5530ca8db255e1311c9e4ebfa47f21530739d Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Tue, 2 Oct 2018 22:57:21 +0500 Subject: [PATCH 09/42] xrRenderDX10/dx10HW.cpp: Added one more format support for backbuffer Add comments.. --- src/Layers/xrRenderDX10/dx10HW.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Layers/xrRenderDX10/dx10HW.cpp b/src/Layers/xrRenderDX10/dx10HW.cpp index e114cf3fd96..df04738248d 100644 --- a/src/Layers/xrRenderDX10/dx10HW.cpp +++ b/src/Layers/xrRenderDX10/dx10HW.cpp @@ -145,9 +145,9 @@ void CHW::CreateDevice(SDL_Window* m_sdlWnd) // TODO: DX10: implement dynamic format selection constexpr DXGI_FORMAT formats[] = { - //DXGI_FORMAT_R16G16B16A16_FLOAT, - //DXGI_FORMAT_R10G10B10A2_UNORM, - //DXGI_FORMAT_B8G8R8X8_UNORM, + //DXGI_FORMAT_R16G16B16A16_FLOAT, // Do we even need this? + //DXGI_FORMAT_R10G10B10A2_UNORM, // D3DX11SaveTextureToMemory fails on this format + DXGI_FORMAT_B8G8R8X8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM, }; From 44f45a446e45d51a64ce41f396e97379cb7b048d Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Wed, 3 Oct 2018 00:24:51 +0500 Subject: [PATCH 10/42] xrRender/HW.h: cleanup --- src/Layers/xrRender/HW.h | 69 +++++++++++---------------------- src/Layers/xrRender/xrD3DDefs.h | 2 + 2 files changed, 25 insertions(+), 46 deletions(-) diff --git a/src/Layers/xrRender/HW.h b/src/Layers/xrRender/HW.h index df306ba545a..4d1f7a2916c 100644 --- a/src/Layers/xrRender/HW.h +++ b/src/Layers/xrRender/HW.h @@ -36,21 +36,20 @@ class CHW BOOL support(D3DFORMAT fmt, DWORD type, DWORD usage); #endif // !USE_OGL -#ifdef DEBUG -#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL) - void Validate(void){}; -#else // USE_DX10 - void Validate(void) +#if defined(DEBUG) && defined(USE_DX9) + void Validate() { VERIFY(pDevice); VERIFY(pD3D); }; -#endif // USE_DX10 #else - void Validate(void){}; + void Validate() {} #endif -// Variables section + // Variables section +public: + CHWCaps Caps; + #if defined(USE_OGL) CHW* pDevice; CHW* pContext; @@ -61,62 +60,40 @@ class CHW GLuint pFB; GLuint pCFB; - CHWCaps Caps; - SDL_Window* m_hWnd; HDC m_hDC; SDL_GLContext m_hRC; -#elif defined(USE_DX11) -public: - IDXGIFactory1* m_pFactory = nullptr; - IDXGIAdapter1* m_pAdapter = nullptr; // pD3D equivalent - ID3D11Device* pDevice = nullptr; // combine with DX9 pDevice via typedef - ID3D11DeviceContext* pContext = nullptr; // combine with DX9 pDevice via typedef - IDXGISwapChain* m_pSwapChain = nullptr; - ID3D11RenderTargetView* pBaseRT = nullptr; // combine with DX9 pBaseRT via typedef - ID3D11DepthStencilView* pBaseZB = nullptr; - - CHWCaps Caps; +#else // General DirectX + ID3DDevice* pDevice = nullptr; // render device + ID3DRenderTargetView* pBaseRT = nullptr; // base render target + ID3DDepthStencilView* pBaseZB = nullptr; // base depth-stencil buffer D3D_DRIVER_TYPE m_DriverType; - DXGI_SWAP_CHAIN_DESC m_ChainDesc; // DevPP equivalent - D3D_FEATURE_LEVEL FeatureLevel; -#elif defined(USE_DX10) -public: +#ifndef USE_DX9 IDXGIFactory1* m_pFactory = nullptr; - IDXGIAdapter1* m_pAdapter = nullptr; // pD3D equivalent - ID3D10Device1* pDevice1 = nullptr; // combine with DX9 pDevice via typedef - ID3D10Device* pDevice = nullptr; // combine with DX9 pDevice via typedef - ID3D10Device1* pContext1 = nullptr; // combine with DX9 pDevice via typedef - ID3D10Device* pContext = nullptr; // combine with DX9 pDevice via typedef + IDXGIAdapter1* m_pAdapter = nullptr; // pD3D equivalent + ID3DDeviceContext* pContext = nullptr; IDXGISwapChain* m_pSwapChain = nullptr; - ID3D10RenderTargetView* pBaseRT = nullptr; // combine with DX9 pBaseRT via typedef - ID3D10DepthStencilView* pBaseZB = nullptr; - - CHWCaps Caps; - - D3D10_DRIVER_TYPE m_DriverType; - DXGI_SWAP_CHAIN_DESC m_ChainDesc; // DevPP equivalent + DXGI_SWAP_CHAIN_DESC m_ChainDesc; // DevPP equivalent D3D_FEATURE_LEVEL FeatureLevel; -#else -private: +#if defined(USE_DX10) + ID3D10Device1* pDevice1 = nullptr; + ID3D10Device1* pContext1 = nullptr; +#endif +#else // USE_DX9 #ifdef DEBUG IDirect3DStateBlock9* dwDebugSB = nullptr; #endif +private: XRay::Module hD3D = nullptr; public: IDirect3D9* pD3D = nullptr; // D3D - IDirect3DDevice9* pDevice = nullptr; // render device - IDirect3DSurface9* pBaseRT = nullptr; - IDirect3DSurface9* pBaseZB = nullptr; - - CHWCaps Caps; UINT DevAdapter; - D3DDEVTYPE m_DriverType; D3DPRESENT_PARAMETERS DevPP; -#endif // USE_DX10 +#endif // USE_DX9 +#endif // USE_OGL #if !defined(_MAYA_EXPORT) && !defined(USE_OGL) stats_manager stats_manager; diff --git a/src/Layers/xrRender/xrD3DDefs.h b/src/Layers/xrRender/xrD3DDefs.h index 6b37e8812a2..e490357bab1 100644 --- a/src/Layers/xrRender/xrD3DDefs.h +++ b/src/Layers/xrRender/xrD3DDefs.h @@ -35,12 +35,14 @@ typedef IDirect3DVertexShader9 ID3DVertexShader; typedef IDirect3DPixelShader9 ID3DPixelShader; typedef ID3DXBuffer ID3DBlob; typedef D3DXMACRO D3D_SHADER_MACRO; +typedef D3DDEVTYPE D3D_DRIVER_TYPE; typedef IDirect3DQuery9 ID3DQuery; typedef D3DVIEWPORT9 D3D_VIEWPORT; typedef ID3DXInclude ID3DInclude; typedef IDirect3DTexture9 ID3DTexture2D; typedef IDirect3DSurface9 ID3DRenderTargetView; typedef IDirect3DSurface9 ID3DDepthStencilView; +typedef IDirect3DDevice9 ID3DDevice; typedef IDirect3DBaseTexture9 ID3DBaseTexture; typedef D3DSURFACE_DESC D3D_TEXTURE2D_DESC; typedef IDirect3DVertexBuffer9 ID3DVertexBuffer; From 985af7569ac18fef490c1d780997ddca5446ad29 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Wed, 3 Oct 2018 00:56:30 +0500 Subject: [PATCH 11/42] Fix R3 compilation There IS already type named D3D_DRIVER_TYPE!!! I'll fix this if we would really need this exact type.. --- src/Layers/xrRenderDX10/DXCommonTypes.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Layers/xrRenderDX10/DXCommonTypes.h b/src/Layers/xrRenderDX10/DXCommonTypes.h index 58a3c0a8088..0156d3419b7 100644 --- a/src/Layers/xrRenderDX10/DXCommonTypes.h +++ b/src/Layers/xrRenderDX10/DXCommonTypes.h @@ -330,6 +330,7 @@ typedef ID3D10Resource ID3DResource; #define D3D_STANDARD_MULTISAMPLE_PATTERN D3D10_STANDARD_MULTISAMPLE_PATTERN +#define D3D_DRIVER_TYPE D3D10_DRIVER_TYPE // There IS already type named D3D_DRIVER_TYPE!!! Fix it later if we would need it #define D3D_DRIVER_TYPE_REFERENCE D3D10_DRIVER_TYPE_REFERENCE #define D3D_DRIVER_TYPE_HARDWARE D3D10_DRIVER_TYPE_HARDWARE From 529684f21c63dc921cb26ed33ac13cbdd7477e00 Mon Sep 17 00:00:00 2001 From: "DESKTOP-JN7AG79\\qweasdd" Date: Tue, 2 Oct 2018 21:49:58 +0300 Subject: [PATCH 12/42] Game objects testing functions replaced with game object casting (e.g. 'bool is_car' -> 'CCar* cast_Car') --- src/Common/Config.hpp | 2 +- src/xrGame/script_game_object.h | 43 --- src/xrGame/script_game_object4.cpp | 325 +--------------------- src/xrGame/script_game_object_script3.cpp | 100 ++++--- 4 files changed, 61 insertions(+), 409 deletions(-) diff --git a/src/Common/Config.hpp b/src/Common/Config.hpp index a456a1d3d82..9e2f90a00d0 100644 --- a/src/Common/Config.hpp +++ b/src/Common/Config.hpp @@ -16,7 +16,7 @@ /* Scripts */ #define MORE_INVENTORY_SLOTS // Adds 5 more slots CUSTOM_SLOT_1..5 #define GAME_OBJECT_EXTENDED_EXPORTS // see: script_game_object*.cpp/h -#define GAME_OBJECT_TESTING_EXPORTS // see: script_game_object4.cpp functions for object testing (ie. is_stalker(), is_heli()) +#define GAME_OBJECT_CASTING_EXPORTS // see: script_game_object4.cpp functions for object casting (ie. cast_Car(), cast_Heli()) #define NAMESPACE_LEVEL_EXPORTS // see: level_script.cpp /* Visual */ diff --git a/src/xrGame/script_game_object.h b/src/xrGame/script_game_object.h index d97b1246791..96b6553efe4 100644 --- a/src/xrGame/script_game_object.h +++ b/src/xrGame/script_game_object.h @@ -787,49 +787,6 @@ class CScriptGameObject void unlock_door_for_npc(); bool is_door_blocked_by_npc() const; bool is_weapon_going_to_be_strapped(CScriptGameObject const* object) const; - - //AVO: functions for object testing -#ifdef GAME_OBJECT_TESTING_EXPORTS - //bool isGameObject() const; - //bool isCar() const; - //bool isHeli() const; - //bool isHolderCustom() const; - bool isEntityAlive() const; - bool isInventoryItem() const; - bool isInventoryOwner() const; - bool isActor() const; - bool isCustomMonster() const; - bool isWeapon() const; - //bool isMedkit() const; - //bool isEatableItem() const; - //bool isAntirad() const; - bool isCustomOutfit() const; - bool isScope() const; - bool isSilencer() const; - bool isGrenadeLauncher() const; - bool isWeaponMagazined() const; - bool isSpaceRestrictor() const; - bool isStalker() const; - bool isAnomaly() const; - bool isMonster() const; - //bool isExplosive() const; - //bool isScriptZone() const; - //bool isProjector() const; - bool isTrader() const; - bool isHudItem() const; - //bool isFoodItem() const; - bool isArtefact() const; - bool isAmmo() const; - //bool isMissile() const; - //bool isPhysicsShellHolder() const; - //bool isGrenade() const; - //bool isBottleItem() const; - //bool isTorch() const; - bool isWeaponGL() const; - bool isInventoryBox() const; - -#endif // GAME_OBJECT_TESTING_EXPORTS - //-AVO #ifdef GAME_OBJECT_EXTENDED_EXPORTS void SetHealthEx(float hp); //AVO diff --git a/src/xrGame/script_game_object4.cpp b/src/xrGame/script_game_object4.cpp index 6e751222ee7..d723c238548 100644 --- a/src/xrGame/script_game_object4.cpp +++ b/src/xrGame/script_game_object4.cpp @@ -368,7 +368,7 @@ void CScriptGameObject::stop_particles(LPCSTR pname, LPCSTR bone) LuaMessageType::Error, "Cant stop particles, bone [%s] is not visible now", bone); } -#ifdef GAME_OBJECT_TESTING_EXPORTS +#ifdef GAME_OBJECT_EXTENDED_EXPORTS //AVO: directly set entity health instead of going through normal health property which operates on delta void CScriptGameObject::SetHealthEx(float hp) { @@ -378,327 +378,4 @@ void CScriptGameObject::SetHealthEx(float hp) obj->SetfHealth(hp); } //-AVO - -// AVO: functions for testing object class -// Credits: KD -//#include "Car.h" -//#include "helicopter.h" -#include "Actor.h" -#include "CustomOutfit.h" -//#include "CustomZone.h" -#include "ai/Monsters/BaseMonster/base_monster.h" -//#include "medkit.h" -//#include "antirad.h" -#include "Scope.h" -#include "Silencer.h" -//#include "Torch.h" -#include "GrenadeLauncher.h" -#include "searchlight.h" -//#include "WeaponAmmo.h" -//#include "Grenade.h" -//#include "BottleItem.h" -#include "WeaponMagazinedWGrenade.h" - -// Xottab_DUTY: commented this macro, because of substituting it -/* -#define TEST_OBJECT_CLASS(A, B)\ -bool A() const\ -{\ - auto l_tpEntity = smart_cast(&object());\ - if (!l_tpEntity)\ - return false;\ - return true;\ -}\ -*/ - -/* -bool CScriptGameObject::isGameObject() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -/* -bool CScriptGameObject::isCar() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -/* -bool CScriptGameObject::isHeli() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -/* -bool CScriptGameObject::isHolderCustom() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -bool CScriptGameObject::isEntityAlive() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isInventoryItem() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isInventoryOwner() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isActor() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isCustomMonster() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isWeapon() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -/* -bool CScriptGameObject::isMedkit() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -/* -bool CScriptGameObject::isEatableItem() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -/* -bool CScriptGameObject::isAntirad() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -bool CScriptGameObject::isCustomOutfit() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isScope() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isSilencer() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isGrenadeLauncher() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isWeaponMagazined() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isSpaceRestrictor() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isStalker() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isAnomaly() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isMonster() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -/* -bool CScriptGameObject::isExplosive() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -/* -bool CScriptGameObject::isScriptZone() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -/* -bool CScriptGameObject::isProjector() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -bool CScriptGameObject::isTrader() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isHudItem() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -/* -bool CScriptGameObject::isFoodItem() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -bool CScriptGameObject::isArtefact() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isAmmo() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -/* -bool CScriptGameObject::isMissile() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -/* -bool CScriptGameObject::isPhysicsShellHolder() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -/* -bool CScriptGameObject::isGrenade() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -/* -bool CScriptGameObject::isBottleItem() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -/* -bool CScriptGameObject::isTorch() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} -*/ - -bool CScriptGameObject::isWeaponGL() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} - -bool CScriptGameObject::isInventoryBox() const -{ - auto l_tpEntity = smart_cast(&object()); - if (!l_tpEntity) return false; - return true; -} #endif -//-AVO diff --git a/src/xrGame/script_game_object_script3.cpp b/src/xrGame/script_game_object_script3.cpp index c5d8caa4c8a..0e78ca59ced 100644 --- a/src/xrGame/script_game_object_script3.cpp +++ b/src/xrGame/script_game_object_script3.cpp @@ -37,6 +37,24 @@ using namespace luabind; using namespace luabind::policy; +/* + New luabind makes incorrect casts in this case. He makes casts only to 'true derived class'. + For example: + db.actor:cast_GameObject() returns NOT object of class CGameObject* + it returns CActor* ! + Also, we can't to use just 'return smart_cast(&script_obj->object())' here, because + db.actor:cast_Weapon() returns not 'nil', it returns CActor*. +*/ +template +TClass* ObjectCast(CScriptGameObject* scriptObj) +{ + TClass* obj = smart_cast(&scriptObj->object()); + if (obj) + return obj; + + return nullptr; +} + class_& script_register_game_object2(class_& instance) { instance @@ -397,46 +415,47 @@ class_& script_register_game_object2(class_) + .def("cast_Car", &ObjectCast) + .def("cast_Heli", &ObjectCast) + .def("cast_HolderCustom", &ObjectCast) + .def("cast_EntityAlive", &ObjectCast) + .def("cast_InventoryItem", &ObjectCast) + .def("cast_InventoryOwner", &ObjectCast) + .def("cast_Actor", &ObjectCast) + .def("cast_Weapon", &ObjectCast) + //.def("cast_Medkit", &ObjectCast) + //.def("cast_EatableItem", &ObjectCast) + //.def("cast_Antirad", &ObjectCast) + //.def("cast_CustomOutfit", &ObjectCast) + //.def("cast_Scope", &ObjectCast) + //.def("cast_Silencer", &ObjectCast) + //.def("cast_GrenadeLauncher", &ObjectCast) + .def("cast_WeaponMagazined", &ObjectCast) + .def("cast_SpaceRestrictor", &ObjectCast) + .def("cast_Stalker", &ObjectCast) + .def("cast_CustomZone", &ObjectCast) + .def("cast_Monster", &ObjectCast) + .def("cast_Explosive", &ObjectCast) + .def("cast_ScriptZone", &ObjectCast) + //.def("cast_Projector", &ObjectCast) + //.def("cast_Trader", &ObjectCast) + //.def("cast_HudItem", &ObjectCast) + //.def("cast_FoodItem", &ObjectCast) + .def("cast_Artefact", &ObjectCast) + .def("cast_Ammo", &ObjectCast) + //.def("cast_Missile", &ObjectCast) + .def("cast_PhysicsShellHolder", &ObjectCast) + //.def("cast_Grenade", &ObjectCast) + //.def("cast_BottleItem", &ObjectCast) + //.def("cast_Torch", &ObjectCast) + //.def("cast_WeaponMagazinedWGrenade", &ObjectCast) + //.def("cast_InventoryBox", &ObjectCast) +#endif // GAME_OBJECT_CASTING_EXPORTS + + .def("is_on_belt", &CScriptGameObject::IsOnBelt) .def("item_on_belt", &CScriptGameObject::ItemOnBelt) .def("belt_count", &CScriptGameObject::BeltSize) @@ -460,7 +479,6 @@ class_& script_register_game_object2(class_ Date: Tue, 2 Oct 2018 21:59:24 +0300 Subject: [PATCH 13/42] Trying to fix GitInfo --- src/xrCore/.GitInfo.cmd | 5 ---- src/xrCore/xrCore.vcxproj | 48 ++++++++++++++++++++++++++++++++++----- 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/src/xrCore/.GitInfo.cmd b/src/xrCore/.GitInfo.cmd index 6d8348deb29..63a571cd495 100644 --- a/src/xrCore/.GitInfo.cmd +++ b/src/xrCore/.GitInfo.cmd @@ -1,8 +1,3 @@ -where git >nul 2>nul -if %errorLevel% neq 0 ( - goto :EOF -) - echo | set /p dummyName=#define GIT_INFO_CURRENT_COMMIT > .GitInfo.hpp git rev-parse --verify HEAD >> .GitInfo.hpp diff --git a/src/xrCore/xrCore.vcxproj b/src/xrCore/xrCore.vcxproj index 41aca4fe250..e4a3605ef2d 100644 --- a/src/xrCore/xrCore.vcxproj +++ b/src/xrCore/xrCore.vcxproj @@ -116,7 +116,13 @@ Copying the required libraries ... - call .GitInfo.cmd + where /q git +if errorlevel 1 ( + echo git is not founded + goto :EOF +) +echo git is founded +call .GitInfo.cmd @@ -132,7 +138,13 @@ Copying the required libraries ... - call .GitInfo.cmd + where /q git +if errorlevel 1 ( + echo git is not founded + goto :EOF +) +echo git is founded +call .GitInfo.cmd @@ -151,7 +163,13 @@ Copying the required libraries ... - call .GitInfo.cmd + where /q git +if errorlevel 1 ( + echo git is not founded + goto :EOF +) +echo git is founded +call .GitInfo.cmd @@ -167,7 +185,13 @@ Copying the required libraries ... - call .GitInfo.cmd + where /q git +if errorlevel 1 ( + echo git is not founded + goto :EOF +) +echo git is founded +call .GitInfo.cmd @@ -185,7 +209,13 @@ Copying the required libraries ... - call .GitInfo.cmd + where /q git +if errorlevel 1 ( + echo git is not founded + goto :EOF +) +echo git is founded +call .GitInfo.cmd @@ -201,7 +231,13 @@ Copying the required libraries ... - call .GitInfo.cmd + where /q git +if errorlevel 1 ( + echo git is not founded + goto :EOF +) +echo git is founded +call .GitInfo.cmd From 587c66c14609e6e2419333c2fc7d639f578d808e Mon Sep 17 00:00:00 2001 From: "DESKTOP-JN7AG79\\qweasdd" Date: Tue, 2 Oct 2018 22:24:37 +0300 Subject: [PATCH 14/42] Added new console commands: set_weather, r__sunshafts_intensity --- src/Layers/xrRender/xrRender_console.cpp | 13 +++++ src/xrEngine/Environment.h | 1 + src/xrEngine/Environment_misc.cpp | 66 ++++++++++++++---------- src/xrGame/console_commands.cpp | 17 ++++++ 4 files changed, 69 insertions(+), 28 deletions(-) diff --git a/src/Layers/xrRender/xrRender_console.cpp b/src/Layers/xrRender/xrRender_console.cpp index 92c7092597f..de058fc81f5 100644 --- a/src/Layers/xrRender/xrRender_console.cpp +++ b/src/Layers/xrRender/xrRender_console.cpp @@ -664,6 +664,15 @@ class CCC_DumpResources : public IConsole_Command } }; +#ifdef DEBUG +class CCC_SunshaftsIntensity : public CCC_Float +{ +public: + CCC_SunshaftsIntensity(LPCSTR N, float* V, float _min, float _max) : CCC_Float(N, V, _min, _max) {} + virtual void Save(IWriter*) { ; } +}; +#endif + // Allow real-time fog config reload #if (RENDER == R_R3) || (RENDER == R_R4) #ifdef DEBUG @@ -874,6 +883,10 @@ void xrRender_initconsole() //float ps_r2_dof_near = 0.f; // 0.f //float ps_r2_dof_focus = 1.4f; // 1.4f +#ifdef DEBUG + CMD4(CCC_SunshaftsIntensity, "r__sunshafts_intensity", &SunshaftsIntensity, 0.f, 1.f); +#endif + CMD3(CCC_Mask, "r2_volumetric_lights", &ps_r2_ls_flags, R2FLAG_VOLUMETRIC_LIGHTS); //CMD3(CCC_Mask, "r2_sun_shafts", &ps_r2_ls_flags, R2FLAG_SUN_SHAFTS); CMD3(CCC_Token, "r2_sun_shafts", &ps_r_sun_shafts, qsun_shafts_token); diff --git a/src/xrEngine/Environment.h b/src/xrEngine/Environment.h index 6fda0623ab0..5bc0d018068 100644 --- a/src/xrEngine/Environment.h +++ b/src/xrEngine/Environment.h @@ -387,5 +387,6 @@ class ENGINE_API CEnvironment ENGINE_API extern Flags32 psEnvFlags; ENGINE_API extern float psVisDistance; +ENGINE_API extern float SunshaftsIntensity; #endif // EnvironmentH diff --git a/src/xrEngine/Environment_misc.cpp b/src/xrEngine/Environment_misc.cpp index 5a6033ca8a4..8bb039de0f3 100644 --- a/src/xrEngine/Environment_misc.cpp +++ b/src/xrEngine/Environment_misc.cpp @@ -10,6 +10,8 @@ #include "Common/object_broker.h" #include "Common/LevelGameDef.h" +ENGINE_API float SunshaftsIntensity = 0.f; + void CEnvModifier::load(IReader* fs, u32 version) { use_flags.one(); @@ -438,42 +440,50 @@ void CEnvDescriptorMixer::lerp( wind_velocity = fi * A.wind_velocity + f * B.wind_velocity; wind_direction = fi * A.wind_direction + f * B.wind_direction; - m_fSunShaftsIntensity = fi * A.m_fSunShaftsIntensity + f * B.m_fSunShaftsIntensity; - m_fWaterIntensity = fi * A.m_fWaterIntensity + f * B.m_fWaterIntensity; +#ifdef DEBUG + if (SunshaftsIntensity > 0.f) + m_fSunShaftsIntensity = SunshaftsIntensity; + else +#endif + { + m_fSunShaftsIntensity = fi * A.m_fSunShaftsIntensity + f * B.m_fSunShaftsIntensity; + } - m_fTreeAmplitudeIntensity = fi * A.m_fTreeAmplitudeIntensity + f * B.m_fTreeAmplitudeIntensity; +m_fWaterIntensity = fi * A.m_fWaterIntensity + f * B.m_fWaterIntensity; - // colors - //. sky_color.lerp (A.sky_color,B.sky_color,f).add(Mdf.sky_color).mul(modif_power); - sky_color.lerp(A.sky_color, B.sky_color, f); - if (Mdf.use_flags.test(eSkyColor)) - sky_color.add(Mdf.sky_color).mul(modif_power); +m_fTreeAmplitudeIntensity = fi * A.m_fTreeAmplitudeIntensity + f * B.m_fTreeAmplitudeIntensity; - //. ambient.lerp (A.ambient,B.ambient,f).add(Mdf.ambient).mul(modif_power); - ambient.lerp(A.ambient, B.ambient, f); - if (Mdf.use_flags.test(eAmbientColor)) - ambient.add(Mdf.ambient).mul(modif_power); +// colors +//. sky_color.lerp (A.sky_color,B.sky_color,f).add(Mdf.sky_color).mul(modif_power); +sky_color.lerp(A.sky_color, B.sky_color, f); +if (Mdf.use_flags.test(eSkyColor)) + sky_color.add(Mdf.sky_color).mul(modif_power); - hemi_color.lerp(A.hemi_color, B.hemi_color, f); +//. ambient.lerp (A.ambient,B.ambient,f).add(Mdf.ambient).mul(modif_power); +ambient.lerp(A.ambient, B.ambient, f); +if (Mdf.use_flags.test(eAmbientColor)) + ambient.add(Mdf.ambient).mul(modif_power); - if (Mdf.use_flags.test(eHemiColor)) - { - hemi_color.x += Mdf.hemi_color.x; - hemi_color.y += Mdf.hemi_color.y; - hemi_color.z += Mdf.hemi_color.z; - hemi_color.x *= modif_power; - hemi_color.y *= modif_power; - hemi_color.z *= modif_power; - } +hemi_color.lerp(A.hemi_color, B.hemi_color, f); - sun_color.lerp(A.sun_color, B.sun_color, f); +if (Mdf.use_flags.test(eHemiColor)) +{ + hemi_color.x += Mdf.hemi_color.x; + hemi_color.y += Mdf.hemi_color.y; + hemi_color.z += Mdf.hemi_color.z; + hemi_color.x *= modif_power; + hemi_color.y *= modif_power; + hemi_color.z *= modif_power; +} - R_ASSERT(_valid(A.sun_dir)); - R_ASSERT(_valid(B.sun_dir)); - sun_dir.lerp(A.sun_dir, B.sun_dir, f).normalize(); - R_ASSERT(_valid(sun_dir)); +sun_color.lerp(A.sun_color, B.sun_color, f); + +R_ASSERT(_valid(A.sun_dir)); +R_ASSERT(_valid(B.sun_dir)); +sun_dir.lerp(A.sun_dir, B.sun_dir, f).normalize(); +R_ASSERT(_valid(sun_dir)); - VERIFY2(sun_dir.y < 0, "Invalid sun direction settings while lerp"); +VERIFY2(sun_dir.y < 0, "Invalid sun direction settings while lerp"); } //----------------------------------------------------------------------------- diff --git a/src/xrGame/console_commands.cpp b/src/xrGame/console_commands.cpp index 5a6fb1d774b..d2fee1a85ff 100644 --- a/src/xrGame/console_commands.cpp +++ b/src/xrGame/console_commands.cpp @@ -1726,6 +1726,22 @@ class CCC_DbgVar : public IConsole_Command } }; +// Change weather immediately +class CCC_SetWeather : public IConsole_Command +{ +public: + CCC_SetWeather(LPCSTR N) : IConsole_Command(N){}; + virtual void Execute(LPCSTR args) + { + if (!xr_strlen(args)) + return; + if (!g_pGamePersistent) + return; + if (!Device.editor()) + g_pGamePersistent->Environment().SetWeather(args, true); + } +}; + void CCC_RegisterCommands() { // options @@ -1898,6 +1914,7 @@ void CCC_RegisterCommands() CMD4(CCC_Integer, "ph_tri_clear_disable_count", &ph_console::ph_tri_clear_disable_count, 0, 255); CMD4(CCC_FloatBlock, "ph_tri_query_ex_aabb_rate", &ph_console::ph_tri_query_ex_aabb_rate, 1.01f, 3.f); CMD3(CCC_Mask, "g_no_clip", &psActorFlags, AF_NO_CLIP); + CMD1(CCC_SetWeather, "set_weather"); #endif // DEBUG #ifndef MASTER_GOLD From e5d87a1e91292fe66e8c2bcb250a32ecec6af7e4 Mon Sep 17 00:00:00 2001 From: "DESKTOP-JN7AG79\\qweasdd" Date: Sat, 6 Oct 2018 17:50:28 +0300 Subject: [PATCH 15/42] Added new startup command "-force_flushlog". Allows write to log file immediately (Thx alpet, RvP) Environment_misc: fixed formatting Added USE_LOG_TIMING. When used, log message is written in the following format: '[H:M:S.MS] log msg' (e.g. '[16:09:58.603] Loading DLL: xrRender_R2') --- src/Common/Config.hpp | 4 ++ src/xrCore/log.cpp | 74 +++++++++++++++++++++++++------ src/xrEngine/Environment_misc.cpp | 54 +++++++++++----------- 3 files changed, 92 insertions(+), 40 deletions(-) diff --git a/src/Common/Config.hpp b/src/Common/Config.hpp index 9e2f90a00d0..e71989b9e5a 100644 --- a/src/Common/Config.hpp +++ b/src/Common/Config.hpp @@ -33,6 +33,10 @@ #define NEW_SOUNDS // use new sounds. Please enclose any new sound additions with this define #define LAYERED_SND_SHOOT// see comment down below +/* Debug: */ +//#define USE_LOG_TIMING + + /* LAYERED_SND_SHOOT by Alundaio When defined, it will allow you to play a group of sounds from a specified section for snd_shoot. You can have as many layers as you want, but you must follow naming convention, diff --git a/src/xrCore/log.cpp b/src/xrCore/log.cpp index 9d9767ef404..e1f734c4f21 100644 --- a/src/xrCore/log.cpp +++ b/src/xrCore/log.cpp @@ -21,21 +21,18 @@ Lock logCS; xr_vector LogFile; LogCallback LogCB = 0; +bool ForceFlushLog = false; +IWriter* LogWriter = nullptr; +size_t CachedLog = 0; + void FlushLog() { if (!no_log) { logCS.Enter(); - IWriter* f = FS.w_open(logFName); - if (f) - { - for (const auto &i : LogFile) - { - LPCSTR s = i.c_str(); - f->w_string(s ? s : ""); - } - FS.w_close(f); - } + if (LogWriter) + LogWriter->flush(); + CachedLog = 0; logCS.Leave(); } } @@ -55,6 +52,33 @@ void AddOne(const char* split) if (LogExecCB && LogCB) LogCB(split); + if (LogWriter) + { +#ifdef USE_LOG_TIMING + char buf[64]; + char curTime[64]; + + auto now = std::chrono::system_clock::now(); + auto time = std::chrono::system_clock::to_time_t(now); + auto ms = std::chrono::duration_cast(now.time_since_epoch()) - + std::chrono::duration_cast(now.time_since_epoch()); + + std::strftime(buf, sizeof(buf), "%H:%M:%S", std::localtime(&time)); + int len = xr_sprintf(curTime, 64, "[%s.%03lld] ", buf, ms.count()); + + LogWriter->w_printf("%s%s\r\n", curTime, split); + CachedLog += len; +#else + LogWriter->w_printf("%s\r\n", split); +#endif + CachedLog += xr_strlen(split) + 2; + + if (ForceFlushLog || CachedLog >= 32768) + FlushLog(); + + //-RvP + } + logCS.Leave(); } @@ -194,20 +218,44 @@ void CreateLog(BOOL nl) FS.update_path(logFName, "$logs$", log_file_name); if (!no_log) { - IWriter* f = FS.w_open(logFName); - if (f == NULL) + // Alun: Backup existing log + xr_string backup_logFName = EFS.ChangeFileExt(logFName, ".bkp"); + FS.file_rename(logFName, backup_logFName.c_str(), true); + //-Alun + + LogWriter = FS.w_open(logFName); + if (LogWriter == nullptr) { #if defined(WINDOWS) MessageBox(NULL, "Can't create log file.", "Error", MB_ICONERROR); #endif abort(); } - FS.w_close(f); + + time_t t = time(NULL); + tm* ti = localtime(&t); + char buf[64]; + strftime(buf, 64, "[%x %X]\t", ti); + + for (u32 it = 0; it < LogFile.size(); it++) + { + LPCSTR s = LogFile[it].c_str(); + LogWriter->w_printf("%s%s\n", buf, s ? s : ""); + } + LogWriter->flush(); } + + LogFile.reserve(128); + + if (strstr(Core.Params, "-force_flushlog")) + ForceFlushLog = true; } void CloseLog(void) { FlushLog(); + if (LogWriter) + FS.w_close(LogWriter); + LogFile.clear(); } diff --git a/src/xrEngine/Environment_misc.cpp b/src/xrEngine/Environment_misc.cpp index 8bb039de0f3..f59ac8fe10a 100644 --- a/src/xrEngine/Environment_misc.cpp +++ b/src/xrEngine/Environment_misc.cpp @@ -449,41 +449,41 @@ void CEnvDescriptorMixer::lerp( m_fSunShaftsIntensity = fi * A.m_fSunShaftsIntensity + f * B.m_fSunShaftsIntensity; } -m_fWaterIntensity = fi * A.m_fWaterIntensity + f * B.m_fWaterIntensity; + m_fWaterIntensity = fi * A.m_fWaterIntensity + f * B.m_fWaterIntensity; -m_fTreeAmplitudeIntensity = fi * A.m_fTreeAmplitudeIntensity + f * B.m_fTreeAmplitudeIntensity; + m_fTreeAmplitudeIntensity = fi * A.m_fTreeAmplitudeIntensity + f * B.m_fTreeAmplitudeIntensity; -// colors -//. sky_color.lerp (A.sky_color,B.sky_color,f).add(Mdf.sky_color).mul(modif_power); -sky_color.lerp(A.sky_color, B.sky_color, f); -if (Mdf.use_flags.test(eSkyColor)) - sky_color.add(Mdf.sky_color).mul(modif_power); + // colors + //. sky_color.lerp (A.sky_color,B.sky_color,f).add(Mdf.sky_color).mul(modif_power); + sky_color.lerp(A.sky_color, B.sky_color, f); + if (Mdf.use_flags.test(eSkyColor)) + sky_color.add(Mdf.sky_color).mul(modif_power); -//. ambient.lerp (A.ambient,B.ambient,f).add(Mdf.ambient).mul(modif_power); -ambient.lerp(A.ambient, B.ambient, f); -if (Mdf.use_flags.test(eAmbientColor)) - ambient.add(Mdf.ambient).mul(modif_power); + //. ambient.lerp (A.ambient,B.ambient,f).add(Mdf.ambient).mul(modif_power); + ambient.lerp(A.ambient, B.ambient, f); + if (Mdf.use_flags.test(eAmbientColor)) + ambient.add(Mdf.ambient).mul(modif_power); -hemi_color.lerp(A.hemi_color, B.hemi_color, f); + hemi_color.lerp(A.hemi_color, B.hemi_color, f); -if (Mdf.use_flags.test(eHemiColor)) -{ - hemi_color.x += Mdf.hemi_color.x; - hemi_color.y += Mdf.hemi_color.y; - hemi_color.z += Mdf.hemi_color.z; - hemi_color.x *= modif_power; - hemi_color.y *= modif_power; - hemi_color.z *= modif_power; -} + if (Mdf.use_flags.test(eHemiColor)) + { + hemi_color.x += Mdf.hemi_color.x; + hemi_color.y += Mdf.hemi_color.y; + hemi_color.z += Mdf.hemi_color.z; + hemi_color.x *= modif_power; + hemi_color.y *= modif_power; + hemi_color.z *= modif_power; + } -sun_color.lerp(A.sun_color, B.sun_color, f); + sun_color.lerp(A.sun_color, B.sun_color, f); -R_ASSERT(_valid(A.sun_dir)); -R_ASSERT(_valid(B.sun_dir)); -sun_dir.lerp(A.sun_dir, B.sun_dir, f).normalize(); -R_ASSERT(_valid(sun_dir)); + R_ASSERT(_valid(A.sun_dir)); + R_ASSERT(_valid(B.sun_dir)); + sun_dir.lerp(A.sun_dir, B.sun_dir, f).normalize(); + R_ASSERT(_valid(sun_dir)); -VERIFY2(sun_dir.y < 0, "Invalid sun direction settings while lerp"); + VERIFY2(sun_dir.y < 0, "Invalid sun direction settings while lerp"); } //----------------------------------------------------------------------------- From 94e0a7a8fa4b00249772fb6fce7f0e9d8e3a9318 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Fri, 5 Oct 2018 20:32:21 +0500 Subject: [PATCH 16/42] xrRender/D3DUtils.cpp: replaced D3DPT_TRIANGLEFAN with D3DPT_TRIANGLESTRIP xrRender/r__sector.cpp: removed unnecessary macro usage, it's better to directly use xr_vector. --- src/Layers/xrRender/D3DUtils.cpp | 6 +++--- src/Layers/xrRender/r__sector.cpp | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Layers/xrRender/D3DUtils.cpp b/src/Layers/xrRender/D3DUtils.cpp index 7893448e8f5..6e6ef452779 100644 --- a/src/Layers/xrRender/D3DUtils.cpp +++ b/src/Layers/xrRender/D3DUtils.cpp @@ -1409,15 +1409,15 @@ void CDrawUtilities::DrawSelectionRect(const Ivector2& m_SelStart, const Ivector pv++; pv->set(m_SelStart.x * SCREEN_QUALITY, m_SelEnd.y * SCREEN_QUALITY, m_SelectionRect, 0.f, 0.f); pv++; - pv->set(m_SelEnd.x * SCREEN_QUALITY, m_SelEnd.y * SCREEN_QUALITY, m_SelectionRect, 0.f, 0.f); - pv++; pv->set(m_SelEnd.x * SCREEN_QUALITY, m_SelStart.y * SCREEN_QUALITY, m_SelectionRect, 0.f, 0.f); pv++; + pv->set(m_SelEnd.x * SCREEN_QUALITY, m_SelEnd.y * SCREEN_QUALITY, m_SelectionRect, 0.f, 0.f); + pv++; Stream->Unlock(4, vs_TL->vb_stride); // Render it as triangle list DU_DRAW_RS(D3DRS_CULLMODE, D3DCULL_NONE); DU_DRAW_SH(RImplementation.m_SelectionShader); - DU_DRAW_DP(D3DPT_TRIANGLEFAN, vs_TL, vBase, 2); + DU_DRAW_DP(D3DPT_TRIANGLESTRIP, vs_TL, vBase, 2); DU_DRAW_RS(D3DRS_CULLMODE, D3DCULL_CCW); } diff --git a/src/Layers/xrRender/r__sector.cpp b/src/Layers/xrRender/r__sector.cpp index 9aaf9f011a4..206ef9a7936 100644 --- a/src/Layers/xrRender/r__sector.cpp +++ b/src/Layers/xrRender/r__sector.cpp @@ -33,8 +33,7 @@ void CPortal::OnRender() { VERIFY(poly.size()); // draw rect - DEFINE_VECTOR(FVF::L, LVec, LVecIt); - static LVec V; + static xr_vector V; V.resize(poly.size() + 2); Fvector C = {0, 0, 0}; for (u32 k = 0; k < poly.size(); k++) From 2135e184afd770171a1172beab24cb8d49366c29 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Sat, 6 Oct 2018 22:51:21 +0500 Subject: [PATCH 17/42] Probably fixed problems with allocation/deallocation of std::locale --- src/xrCore/Text/StringConversion.cpp | 4 ++-- src/xrCore/Text/StringConversion.hpp | 4 ++-- src/xrEngine/edit_actions.cpp | 2 +- src/xrEngine/xr_input.cpp | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/xrCore/Text/StringConversion.cpp b/src/xrCore/Text/StringConversion.cpp index 3982dbb41e1..bcbd0db2142 100644 --- a/src/xrCore/Text/StringConversion.cpp +++ b/src/xrCore/Text/StringConversion.cpp @@ -131,7 +131,7 @@ u16 mbhMulti2Wide(wchar_t* WideStr, wchar_t* WidePos, u16 WideStrSize, const cha return dpos; } -xr_string StringFromUTF8(const char* in, const std::locale& locale /*= std::locale("")*/) +xr_string StringFromUTF8(const char* in, const std::locale& locale) { using wcvt = std::wstring_convert, wchar_t>; auto wstr = wcvt{}.from_bytes(in); @@ -140,7 +140,7 @@ xr_string StringFromUTF8(const char* in, const std::locale& locale /*= std::loca return result; } -xr_string StringToUTF8(const char* in, const std::locale& locale /*= std::locale("")*/) +xr_string StringToUTF8(const char* in, const std::locale& locale) { using wcvt = std::wstring_convert, wchar_t>; std::wstring wstr(xr_strlen(in), L'\0'); diff --git a/src/xrCore/Text/StringConversion.hpp b/src/xrCore/Text/StringConversion.hpp index 582a912aa70..37ccfebadcc 100644 --- a/src/xrCore/Text/StringConversion.hpp +++ b/src/xrCore/Text/StringConversion.hpp @@ -30,5 +30,5 @@ IC bool IsAlphaCharacter(wchar_t wc) ((wc >= 0xFF21) && (wc <= 0xFF3A)) || ((wc >= 0xFF41) && (wc <= 0xFF5A))); } -XRCORE_API xr_string StringFromUTF8(const char* string, const std::locale& locale = std::locale("")); -XRCORE_API xr_string StringToUTF8(const char* string, const std::locale& locale = std::locale("")); +XRCORE_API xr_string StringFromUTF8(const char* string, const std::locale& locale); +XRCORE_API xr_string StringToUTF8(const char* string, const std::locale& locale); diff --git a/src/xrEngine/edit_actions.cpp b/src/xrEngine/edit_actions.cpp index 589d3881177..8f58d1402e7 100644 --- a/src/xrEngine/edit_actions.cpp +++ b/src/xrEngine/edit_actions.cpp @@ -70,7 +70,7 @@ void type_pair::on_key_press(line_edit_control* const control) { case SDL_TEXTINPUT: { - const std::locale locale(""); + static std::locale locale(""); auto str = StringFromUTF8(event.text.text, locale); if (std::isalpha(str[0], locale) || str[0] == char(-1)) // "я" = -1 diff --git a/src/xrEngine/xr_input.cpp b/src/xrEngine/xr_input.cpp index 1bcc0074fbc..b7d202d94c9 100644 --- a/src/xrEngine/xr_input.cpp +++ b/src/xrEngine/xr_input.cpp @@ -195,9 +195,10 @@ pcstr KeyToMouseButtonName(const int dik) bool CInput::get_dik_name(int dik, LPSTR dest_str, int dest_sz) { xr_string keyname; + static std::locale locale(""); if (dik < SDL_NUM_SCANCODES) - keyname = StringFromUTF8(SDL_GetKeyName(SDL_GetKeyFromScancode((SDL_Scancode)dik))); + keyname = StringFromUTF8(SDL_GetKeyName(SDL_GetKeyFromScancode((SDL_Scancode)dik)), locale); else keyname = KeyToMouseButtonName(dik); From 1ec7971423d7ecf55ffd8400cc62ff917e9a2603 Mon Sep 17 00:00:00 2001 From: Aleksey Komarov Date: Sat, 6 Oct 2018 22:05:37 +0300 Subject: [PATCH 18/42] add doxygen by Zegeri --- .gitignore | 6 +- doc/doxygen/Doxyfile | 2450 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2454 insertions(+), 2 deletions(-) create mode 100644 doc/doxygen/Doxyfile diff --git a/.gitignore b/.gitignore index 066def7d0a3..a5d6ed66752 100644 --- a/.gitignore +++ b/.gitignore @@ -5,11 +5,13 @@ !.travis.yml # exclude binaries and temporary files -bin/ -bin_plugs/ +bin*/ intermediate/ intermediate_plugs/ lib/ *.aps *.user *.PVS-Studio.* + +# exclude doxygen output +doc/doxygen/html/* diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile new file mode 100644 index 00000000000..590aacb6538 --- /dev/null +++ b/doc/doxygen/Doxyfile @@ -0,0 +1,2450 @@ +# Doxyfile 1.8.14 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = OpenXRay + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "X-Ray Engine 1.6 expansion." + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = . + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = YES + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 2 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = ../../src/ + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via Javascript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have Javascript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: https://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/ + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , / + + pch_script.h + $(IntDir)$(ProjectName)_script.pch + diff --git a/src/xrGame/xrGame.vcxproj.filters b/src/xrGame/xrGame.vcxproj.filters index 4c3689ae7dc..5b313fba009 100644 --- a/src/xrGame/xrGame.vcxproj.filters +++ b/src/xrGame/xrGame.vcxproj.filters @@ -6042,6 +6042,9 @@ UI\UIWindows\ScriptWnd + + UI\UIWindows\ScriptWnd + UI\UIWindows\DragDrop @@ -6458,7 +6461,6 @@ UI\UIWindows\Static - @@ -9365,6 +9367,9 @@ UI\UIWindows\ScriptWnd + + UI\UIWindows\ScriptWnd + UI\UIWindows\DragDrop @@ -9787,6 +9792,9 @@ Core\Client\Objects\items & weapons\Weapons\WeaponScript + + UI\Common\LoadingScreen + UI\UIWindows\Static