From 70b3404b7c68705457961fb786db9f68389da376 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 24 May 2018 20:39:38 -1000 Subject: [PATCH] Windows build fixes and warning avoidance --- CMakeLists.txt | 30 ++++++---- DataSpec/DNACommon/ANIM.cpp | 2 +- DataSpec/DNACommon/CMDL.cpp | 2 + DataSpec/DNACommon/FONT.hpp | 2 +- DataSpec/DNACommon/OBBTreeBuilder.cpp | 1 - DataSpec/DNACommon/PAK.hpp | 1 + DataSpec/DNACommon/ParticleCommon.cpp | 2 + DataSpec/DNACommon/TXTR.cpp | 8 +++ DataSpec/DNAMP1/CMDLMaterials.hpp | 1 + DataSpec/DNAMP1/DNAMP1.cpp | 6 +- DataSpec/DNAMP1/DNAMP1.hpp | 5 +- DataSpec/DNAMP1/MREA.cpp | 8 ++- DataSpec/DNAMP1/STRG.cpp | 10 ---- DataSpec/DNAMP2/DNAMP2.cpp | 5 +- DataSpec/DNAMP2/DNAMP2.hpp | 5 +- DataSpec/DNAMP2/MREA.cpp | 2 +- DataSpec/DNAMP3/ANIM.cpp | 4 +- DataSpec/DNAMP3/DNAMP3.cpp | 5 +- DataSpec/DNAMP3/DNAMP3.hpp | 5 +- DataSpec/SpecMP1.cpp | 4 +- DataSpec/SpecMP2.cpp | 2 +- DataSpec/SpecMP3.cpp | 10 ++-- Editor/ProjectManager.cpp | 2 +- Editor/Resource.hpp | 2 +- Editor/Space.cpp | 1 - Editor/Space.hpp | 8 +-- Editor/SplashScreen.cpp | 4 +- Editor/SplashScreen.hpp | 2 +- Editor/ViewManager.hpp | 2 +- Editor/badging/Badging.cpp | 4 +- Editor/icons/icons.cpp | 4 +- NESEmulator/CNESEmulator.cpp | 20 ++++--- NESEmulator/CNESEmulator.hpp | 2 +- NESEmulator/CNESShader.cpp | 14 ++--- NESEmulator/CNESShader.hpp | 4 +- README.md | 12 +--- Runtime/Audio/CSfxManager.cpp | 1 - Runtime/Audio/CSfxManager.hpp | 2 + Runtime/Audio/CStaticAudioPlayer.hpp | 2 +- Runtime/AutoMapper/CMapArea.cpp | 4 +- Runtime/AutoMapper/CMapUniverse.hpp | 4 +- Runtime/AutoMapper/CMappableObject.cpp | 4 +- Runtime/CArchitectureQueue.cpp | 0 Runtime/CDvdFile.hpp | 5 -- Runtime/CFactoryMgr.cpp | 2 +- Runtime/CGameDebug.cpp | 0 Runtime/CGameOptions.cpp | 1 + Runtime/CGameState.cpp | 4 +- Runtime/CIOWin.hpp | 5 -- Runtime/CMakeLists.txt | 5 +- Runtime/CObjectList.hpp | 1 + Runtime/CStateManager.cpp | 2 +- Runtime/CVirtualDvdFile.cpp | 0 Runtime/CVirtualDvdFile.hpp | 0 Runtime/Camera/CCameraShakeData.cpp | 6 +- Runtime/Character/CAdditiveBodyState.cpp | 4 +- Runtime/Character/CAnimPlaybackParms.hpp | 2 +- Runtime/Character/CAnimSourceReader.hpp | 1 + Runtime/Character/CAnimationDatabaseGame.hpp | 2 +- Runtime/Character/CGroundMovement.cpp | 2 +- Runtime/Character/CIkChain.cpp | 4 +- Runtime/Character/CMakeLists.txt | 4 +- Runtime/Character/CMetaAnimBlend.cpp | 2 +- Runtime/Character/CPASAnimParm.cpp | 0 Runtime/Character/CSegId.cpp | 0 Runtime/Character/CSequenceHelper.cpp | 2 +- Runtime/Character/CTransitionDatabaseGame.hpp | 2 +- Runtime/Character/IMetaAnim.hpp | 2 + Runtime/Collision/CCollisionActor.cpp | 2 +- Runtime/Collision/CCollisionActor.hpp | 2 +- Runtime/Collision/CCollisionInfoList.cpp | 0 .../Collision/CInternalRayCastStructure.cpp | 1 - Runtime/Collision/CMakeLists.txt | 4 +- Runtime/Graphics/CBooRenderer.cpp | 4 +- Runtime/Graphics/CDrawable.cpp | 0 Runtime/Graphics/CDrawablePlaneObject.cpp | 0 Runtime/Graphics/CGraphics.cpp | 15 ++--- Runtime/Graphics/CGraphics.hpp | 6 -- Runtime/Graphics/CGraphicsPalette.cpp | 0 Runtime/Graphics/CGraphicsPalette.hpp | 1 - Runtime/Graphics/CLineRenderer.cpp | 4 +- Runtime/Graphics/CMakeLists.txt | 6 +- Runtime/Graphics/CModelBoo.cpp | 10 ++-- Runtime/Graphics/CMoviePlayer.cpp | 15 +++-- Runtime/Graphics/CRainSplashGenerator.cpp | 4 +- Runtime/Graphics/CTextureBoo.cpp | 58 +++++++++---------- Runtime/Graphics/Shaders/CAABoxShader.cpp | 4 +- Runtime/Graphics/Shaders/CAABoxShaderHLSL.cpp | 6 +- .../Graphics/Shaders/CCameraBlurFilter.cpp | 4 +- .../Shaders/CCameraBlurFilterHLSL.cpp | 6 +- .../Graphics/Shaders/CColoredQuadFilter.cpp | 4 +- .../Shaders/CColoredQuadFilterHLSL.cpp | 6 +- .../Graphics/Shaders/CDecalShadersHLSL.cpp | 4 +- .../Shaders/CElementGenShadersHLSL.cpp | 4 +- Runtime/Graphics/Shaders/CEnergyBarShader.cpp | 4 +- .../Graphics/Shaders/CEnergyBarShaderHLSL.cpp | 6 +- .../Graphics/Shaders/CFluidPlaneShader.cpp | 17 +++--- .../Graphics/Shaders/CFluidPlaneShader.hpp | 6 +- .../Shaders/CFluidPlaneShaderHLSL.cpp | 8 +-- Runtime/Graphics/Shaders/CFogVolumeFilter.cpp | 4 +- .../Graphics/Shaders/CFogVolumeFilterHLSL.cpp | 6 +- .../Shaders/CFogVolumePlaneShader.cpp | 4 +- .../Shaders/CFogVolumePlaneShaderHLSL.cpp | 6 +- .../Graphics/Shaders/CLineRendererShaders.cpp | 7 +-- .../Graphics/Shaders/CLineRendererShaders.hpp | 2 +- .../Shaders/CLineRendererShadersGLSL.cpp | 4 +- .../Shaders/CLineRendererShadersHLSL.cpp | 2 +- .../Shaders/CMapSurfaceShaderHLSL.cpp | 8 +-- Runtime/Graphics/Shaders/CModelShaders.cpp | 1 - .../Shaders/CParticleSwooshShadersHLSL.cpp | 4 +- .../Graphics/Shaders/CPhazonSuitFilter.cpp | 4 +- .../Shaders/CPhazonSuitFilterHLSL.cpp | 6 +- .../Graphics/Shaders/CRadarPaintShader.cpp | 4 +- .../Shaders/CRadarPaintShaderHLSL.cpp | 6 +- .../Graphics/Shaders/CRandomStaticFilter.cpp | 4 +- .../Shaders/CRandomStaticFilterHLSL.cpp | 6 +- Runtime/Graphics/Shaders/CScanLinesFilter.cpp | 4 +- .../Graphics/Shaders/CScanLinesFilterHLSL.cpp | 6 +- Runtime/Graphics/Shaders/CSpaceWarpFilter.cpp | 4 +- .../Graphics/Shaders/CSpaceWarpFilterHLSL.cpp | 6 +- .../Shaders/CTextSupportShaderHLSL.cpp | 4 +- .../Graphics/Shaders/CTexturedQuadFilter.cpp | 8 +-- .../Shaders/CTexturedQuadFilterHLSL.cpp | 12 ++-- .../Graphics/Shaders/CThermalColdFilter.cpp | 4 +- .../Shaders/CThermalColdFilterHLSL.cpp | 6 +- .../Graphics/Shaders/CThermalHotFilter.cpp | 4 +- .../Shaders/CThermalHotFilterHLSL.cpp | 6 +- .../Graphics/Shaders/CWorldShadowShader.cpp | 4 +- .../Shaders/CWorldShadowShaderHLSL.cpp | 6 +- Runtime/Graphics/Shaders/CXRayBlurFilter.cpp | 4 +- .../Graphics/Shaders/CXRayBlurFilterHLSL.cpp | 6 +- .../Graphics/Shaders/TMultiBlendShader.hpp | 10 ++-- .../Shaders/TMultiBlendShaderDecl.hpp | 2 +- Runtime/Graphics/Shaders/TShader.hpp | 10 ++-- Runtime/Graphics/Shaders/TShaderDecl.hpp | 2 +- Runtime/GuiSys/CCompoundTargetReticle.cpp | 4 +- Runtime/GuiSys/CDrawStringOptions.cpp | 0 Runtime/GuiSys/CGuiSliderGroup.cpp | 2 +- Runtime/GuiSys/CGuiSliderGroup.hpp | 2 +- Runtime/GuiSys/CMakeLists.txt | 2 +- Runtime/GuiSys/CRasterFont.hpp | 4 ++ Runtime/GuiSys/CTextExecuteBuffer.cpp | 1 - Runtime/GuiSys/CTextRenderBuffer.cpp | 4 +- Runtime/IOStreams.cpp | 3 +- Runtime/IObjectStore.hpp | 1 + Runtime/Input/CFinalInput.cpp | 30 +++++----- Runtime/MP1/CInGameTweakManager.cpp | 0 Runtime/MP1/CMakeLists.txt | 2 +- Runtime/MP1/CPlayMovie.cpp | 2 +- Runtime/MP1/CSlideShow.cpp | 2 +- Runtime/MP1/CSlideShow.hpp | 8 +++ Runtime/MP1/CTweaks.cpp | 8 --- Runtime/MP1/MP1.cpp | 4 +- Runtime/MP1/MP1.hpp | 4 +- Runtime/Particle/CDecal.cpp | 4 +- Runtime/Particle/CDecalDescription.cpp | 0 Runtime/Particle/CElectricDescription.cpp | 0 Runtime/Particle/CElementGen.cpp | 28 ++++++--- Runtime/Particle/CMakeLists.txt | 10 ++-- Runtime/Particle/CParticleSwoosh.cpp | 4 +- Runtime/Particle/CSwooshDescription.cpp | 0 Runtime/Particle/CWarp.cpp | 0 Runtime/Particle/CWeaponDescription.cpp | 0 Runtime/Weapon/CBeamInfo.cpp | 0 Runtime/Weapon/CIceBeam.hpp | 2 +- Runtime/Weapon/CMakeLists.txt | 2 +- Runtime/Weapon/CPhazonBeam.hpp | 2 +- Runtime/Weapon/CPlasmaBeam.hpp | 2 +- Runtime/Weapon/CPowerBeam.hpp | 2 +- Runtime/Weapon/CWaveBeam.hpp | 2 +- Runtime/World/CActorModelParticles.cpp | 1 - Runtime/World/CAi.hpp | 2 +- Runtime/World/CDamageVulnerability.cpp | 4 -- Runtime/World/CEnvFxManager.hpp | 2 +- Runtime/World/CFluidPlaneCPU.cpp | 2 +- Runtime/World/CFluidPlaneCPU.hpp | 2 +- Runtime/World/CFluidPlaneDoor.hpp | 4 +- Runtime/World/CGameArea.cpp | 8 +-- Runtime/World/CGameArea.hpp | 4 +- Runtime/World/CMakeLists.txt | 5 +- Runtime/World/CPathFindDraw.cpp | 0 Runtime/World/CPathFindDraw.hpp | 0 Runtime/World/CPlayer.cpp | 6 +- Runtime/World/CScriptCoverPoint.hpp | 4 +- Runtime/World/CScriptSpiderBallWaypoint.hpp | 4 +- Runtime/World/CSnakeWeedSwarm.cpp | 0 Runtime/World/CTeamAiTypes.cpp | 0 amuse | 2 +- assetnameparser/main.cpp | 55 ------------------ discord-rpc | 2 +- hecl | 2 +- nod | 2 +- rapidjson | 2 +- specter | 2 +- visigen/VISIRenderer.cpp | 1 + 195 files changed, 428 insertions(+), 502 deletions(-) delete mode 100644 Runtime/CArchitectureQueue.cpp delete mode 100644 Runtime/CGameDebug.cpp delete mode 100644 Runtime/CVirtualDvdFile.cpp delete mode 100644 Runtime/CVirtualDvdFile.hpp delete mode 100644 Runtime/Character/CPASAnimParm.cpp delete mode 100644 Runtime/Character/CSegId.cpp delete mode 100644 Runtime/Collision/CCollisionInfoList.cpp delete mode 100644 Runtime/Collision/CInternalRayCastStructure.cpp delete mode 100644 Runtime/Graphics/CDrawable.cpp delete mode 100644 Runtime/Graphics/CDrawablePlaneObject.cpp delete mode 100644 Runtime/Graphics/CGraphicsPalette.cpp delete mode 100644 Runtime/GuiSys/CDrawStringOptions.cpp delete mode 100644 Runtime/MP1/CInGameTweakManager.cpp delete mode 100644 Runtime/Particle/CDecalDescription.cpp delete mode 100644 Runtime/Particle/CElectricDescription.cpp delete mode 100644 Runtime/Particle/CSwooshDescription.cpp delete mode 100644 Runtime/Particle/CWarp.cpp delete mode 100644 Runtime/Particle/CWeaponDescription.cpp delete mode 100644 Runtime/Weapon/CBeamInfo.cpp delete mode 100644 Runtime/World/CPathFindDraw.cpp delete mode 100644 Runtime/World/CPathFindDraw.hpp delete mode 100644 Runtime/World/CSnakeWeedSwarm.cpp delete mode 100644 Runtime/World/CTeamAiTypes.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index d4fb94777..7a5cc95e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,11 @@ set(BUILD_STATIC_LIBS ON CACHE BOOL "Force static libs on" FORCE) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/sanitizers-cmake/cmake" "${CMAKE_SOURCE_DIR}/cotire/CMake" ${CMAKE_MODULE_PATH}) find_package(Sanitizers) -include(cotire) + +# Don't cotire when using clang-cl +if(NOT MSVC OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") + include(cotire) +endif() set(URDE_VECTOR_ISA "sse2" CACHE STRING "Vector ISA to build for (sse2, sse3, sse41, avx, avx2)") @@ -52,8 +56,8 @@ if(MSVC) # Shaddup MSVC add_definitions(-DUNICODE=1 -D_UNICODE=1 -D__SSE__=1 -D_CRT_SECURE_NO_WARNINGS=1 -DD_SCL_SECURE_NO_WARNINGS=1 - -D_SCL_SECURE_NO_DEPRECATE=1 /IGNORE:4221 /wd4018 /wd4800 /wd4005 /wd4311 /wd4267 /wd4244 /wd4200 /wd4305 - /wd4067 /wd4146 /wd4309 ${VS_DEFINES}) + -D_SCL_SECURE_NO_DEPRECATE=1 -D_CRT_NONSTDC_NO_WARNINGS=1 /IGNORE:4221 /wd4018 /wd4800 /wd4005 /wd4311 + /wd4267 /wd4244 /wd4200 /wd4305 /wd4067 /wd4146 /wd4309 /wd4805 ${VS_DEFINES}) if(WINDOWS_STORE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /AI\"$ENV{PROGRAMFILES\(X86\)}/Microsoft Visual Studio/2017/Community/Common7/IDE/VC/vcpackages\" /AI\"$ENV{PROGRAMFILES\(X86\)}/Windows Kits/10/UnionMetadata\"") @@ -62,15 +66,17 @@ if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") - # Link-time Code Generation for Release builds - set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /O2 /Oy /GL /Gy /MD") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") - set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "/DNDEBUG /Zi /O2 /Oy- /GL /Gy /MD") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") - set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "/LTCG") - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO") - set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG /RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:cv,fixup") + # Link-time Code Generation for Release builds (excluding clang-cl) + if (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") + set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /O2 /Oy /GL /Gy /MD") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "/DNDEBUG /Zi /O2 /Oy- /GL /Gy /MD") + set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG") + set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "/LTCG") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO") + set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG /RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:cv,fixup") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") + endif() else() if(${URDE_VECTOR_ISA} STREQUAL "avx2") diff --git a/DataSpec/DNACommon/ANIM.cpp b/DataSpec/DNACommon/ANIM.cpp index b7fee85ac..091c4e573 100644 --- a/DataSpec/DNACommon/ANIM.cpp +++ b/DataSpec/DNACommon/ANIM.cpp @@ -243,7 +243,7 @@ BitstreamReader::read(const atUint8* data, } case Channel::Type::KfHead: { - bool aBit = dequantizeBit(data); + dequantizeBit(data); break; } case Channel::Type::RotationMP3: diff --git a/DataSpec/DNACommon/CMDL.cpp b/DataSpec/DNACommon/CMDL.cpp index f37ddca03..114cbf37c 100644 --- a/DataSpec/DNACommon/CMDL.cpp +++ b/DataSpec/DNACommon/CMDL.cpp @@ -1651,6 +1651,7 @@ bool WriteHMDLCMDL(const hecl::ProjectPath& outPath, const hecl::ProjectPath& in size_t endOff = 0; for (const hecl::blender::HMDLBuffers::Surface& surf : bufs.m_surfaces) { + (void)surf; head.secSizes.push_back(64); paddingSizes.push_back(0); endOff += 64; @@ -2172,6 +2173,7 @@ bool WriteHMDLMREASecs(std::vector>& secsOut, const hecl::P size_t endOff = 0; for (const hecl::blender::HMDLBuffers::Surface& surf : bufs.m_surfaces) { + (void)surf; endOff += 96; surfEndOffs.push_back(endOff); } diff --git a/DataSpec/DNACommon/FONT.hpp b/DataSpec/DNACommon/FONT.hpp index 1b382678d..5bad8ed66 100644 --- a/DataSpec/DNACommon/FONT.hpp +++ b/DataSpec/DNACommon/FONT.hpp @@ -27,7 +27,7 @@ struct IGlyph : BigDNAVYaml float bottom() const { return m_glyphRect.bottom; } GlyphRect rect() const { return m_glyphRect; } - virtual int layer() { return 0; } + virtual atInt32 layer() const { return 0; } virtual atInt32 leftPadding() const=0; virtual atInt32 advance() const =0; virtual atInt32 rightPadding() const=0; diff --git a/DataSpec/DNACommon/OBBTreeBuilder.cpp b/DataSpec/DNACommon/OBBTreeBuilder.cpp index 88ccc9800..d684c6b38 100644 --- a/DataSpec/DNACommon/OBBTreeBuilder.cpp +++ b/DataSpec/DNACommon/OBBTreeBuilder.cpp @@ -102,7 +102,6 @@ static FittedOBB FitOBB(const ColMesh& mesh, const std::vector& index) // mean location for (int i : index) { - const ColMesh::Triangle& T = mesh.trianges[i]; std::unordered_set verts = GetTriangleVerts(mesh, i); auto it = verts.begin(); zeus::CVector3f p = mesh.verts[*it++].val; diff --git a/DataSpec/DNACommon/PAK.hpp b/DataSpec/DNACommon/PAK.hpp index 686706dbe..4ab7c3375 100644 --- a/DataSpec/DNACommon/PAK.hpp +++ b/DataSpec/DNACommon/PAK.hpp @@ -186,6 +186,7 @@ public: void enterPAKBridge(const BRIDGETYPE& pakBridge); + using PAKRouterBase::getWorking; hecl::ProjectPath getWorking(const EntryType* entry, const ResExtractor& extractor) const; hecl::ProjectPath getWorking(const EntryType* entry) const; diff --git a/DataSpec/DNACommon/ParticleCommon.cpp b/DataSpec/DNACommon/ParticleCommon.cpp index 2a59bc5bf..8903bc7d8 100644 --- a/DataSpec/DNACommon/ParticleCommon.cpp +++ b/DataSpec/DNACommon/ParticleCommon.cpp @@ -1470,6 +1470,7 @@ void SpawnSystemKeyframeData::_read(typename ReadYaml::StreamT& r) spawns.reserve(spawnCount); for (const auto& child : r.getCurNode()->m_seqChildren) { + (void)child; if (auto rec = r.enterSubRecord(nullptr)) { spawns.emplace_back(); @@ -1480,6 +1481,7 @@ void SpawnSystemKeyframeData::_read(typename ReadYaml::StreamT& r) spawns.back().second.reserve(systemCount); for (const auto& in : r.getCurNode()->m_seqChildren) { + (void)in; spawns.back().second.emplace_back(); SpawnSystemKeyframeInfo& info = spawns.back().second.back(); if (auto rec = r.enterSubRecord(nullptr)) diff --git a/DataSpec/DNACommon/TXTR.cpp b/DataSpec/DNACommon/TXTR.cpp index a0f54eb0f..4c1e4c16f 100644 --- a/DataSpec/DNACommon/TXTR.cpp +++ b/DataSpec/DNACommon/TXTR.cpp @@ -235,6 +235,7 @@ static void DecodeI4(png_structp png, png_infop info, } } +#if 0 static void EncodeI4(const uint8_t* rgbaIn, uint8_t* texels, int width, int height) { for (int y=height-1 ; y>=0 ; --y) @@ -244,6 +245,7 @@ static void EncodeI4(const uint8_t* rgbaIn, uint8_t* texels, int width, int heig rgbaIn += width; } } +#endif static void DecodeI8(png_structp png, png_infop info, const uint8_t* texels, int width, int height) @@ -291,6 +293,7 @@ static void DecodeIA4(png_structp png, png_infop info, } } +#if 0 static void EncodeIA4(const uint8_t* rgbaIn, uint8_t* texels, int width, int height) { for (int y=height-1 ; y>=0 ; --y) @@ -304,6 +307,7 @@ static void EncodeIA4(const uint8_t* rgbaIn, uint8_t* texels, int width, int hei } } } +#endif static void DecodeIA8(png_structp png, png_infop info, const uint8_t* texels, int width, int height) @@ -808,6 +812,7 @@ static void DecodeRGB565(png_structp png, png_infop info, } } +#if 0 static void EncodeRGB565(const uint8_t* rgbaIn, uint8_t* texels, int width, int height) { for (int y=height-1 ; y>=0 ; --y) @@ -822,6 +827,7 @@ static void EncodeRGB565(const uint8_t* rgbaIn, uint8_t* texels, int width, int rgbaIn += width * 3; } } +#endif static void DecodeRGB5A3(png_structp png, png_infop info, const uint8_t* texels, int width, int height) @@ -855,6 +861,7 @@ static void DecodeRGB5A3(png_structp png, png_infop info, } } +#if 0 static void EncodeRGB5A3(const uint8_t* rgbaIn, uint8_t* texels, int width, int height) { for (int y=height-1 ; y>=0 ; --y) @@ -881,6 +888,7 @@ static void EncodeRGB5A3(const uint8_t* rgbaIn, uint8_t* texels, int width, int rgbaIn += width * 4; } } +#endif static void DecodeRGBA8(png_structp png, png_infop info, const uint8_t* texels, int width, int height) diff --git a/DataSpec/DNAMP1/CMDLMaterials.hpp b/DataSpec/DNAMP1/CMDLMaterials.hpp index 022126b45..214dab85c 100644 --- a/DataSpec/DNAMP1/CMDLMaterials.hpp +++ b/DataSpec/DNAMP1/CMDLMaterials.hpp @@ -318,6 +318,7 @@ struct MaterialSet : BigDNA int stageIdx = 0; for (const Material::TEVStage& stage : mat.tevStages) { + (void)stage; const Material::TEVStageTexInfo& texInfo = mat.tevStageTexInfo[stageIdx]; if (texInfo.texSlot == 0xff) { diff --git a/DataSpec/DNAMP1/DNAMP1.cpp b/DataSpec/DNAMP1/DNAMP1.cpp index 2c3a3b941..c8e0ad406 100644 --- a/DataSpec/DNAMP1/DNAMP1.cpp +++ b/DataSpec/DNAMP1/DNAMP1.cpp @@ -60,10 +60,8 @@ static bool GetNoShare(std::string_view name) return true; } -PAKBridge::PAKBridge(hecl::Database::Project& project, - const nod::Node& node, - bool doExtract) -: m_project(project), m_node(node), m_pak(false, GetNoShare(node.getName())), m_doExtract(doExtract) +PAKBridge::PAKBridge(const nod::Node& node, bool doExtract) +: m_node(node), m_pak(false, GetNoShare(node.getName())), m_doExtract(doExtract) { nod::AthenaPartReadStream rs(node.beginReadStream()); m_pak.read(rs); diff --git a/DataSpec/DNAMP1/DNAMP1.hpp b/DataSpec/DNAMP1/DNAMP1.hpp index 77621299e..662e0bb6f 100644 --- a/DataSpec/DNAMP1/DNAMP1.hpp +++ b/DataSpec/DNAMP1/DNAMP1.hpp @@ -13,7 +13,6 @@ extern logvisor::Module Log; /* MP1-specific, one-shot PAK traversal/extraction class */ class PAKBridge { - hecl::Database::Project& m_project; const nod::Node& m_node; PAK m_pak; public: @@ -22,9 +21,7 @@ public: std::unordered_map m_levelDeps; hecl::SystemString m_levelString; - PAKBridge(hecl::Database::Project& project, - const nod::Node& node, - bool doExtract=true); + PAKBridge(const nod::Node& node, bool doExtract=true); void build(); static ResExtractor LookupExtractor(const PAK& pak, const PAK::Entry& entry); std::string_view getName() const {return m_node.getName();} diff --git a/DataSpec/DNAMP1/MREA.cpp b/DataSpec/DNAMP1/MREA.cpp index 917585120..7aaba101b 100644 --- a/DataSpec/DNAMP1/MREA.cpp +++ b/DataSpec/DNAMP1/MREA.cpp @@ -11,6 +11,8 @@ #include "ScriptObjects/ScriptTypes.hpp" #include "hecl/Blender/Connection.hpp" +#define DUMP_OCTREE 0 + extern hecl::SystemString ExeDir; namespace DataSpec::DNAMP1 @@ -76,6 +78,7 @@ UniqueID32 MREA::GetPATHId(PAKEntryReadStream& rs) return {rs}; } +#if DUMP_OCTREE /* Collision octree dumper */ static void OutputOctreeNode(hecl::blender::PyOutStream& os, athena::io::MemoryReader& r, BspNodeType type, const zeus::CAABox& aabb) @@ -201,6 +204,7 @@ static void OutputOctreeNode(hecl::blender::PyOutStream& os, athena::io::MemoryR pos.x, pos.y, pos.z, extent.x, extent.y, extent.z); } } +#endif bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, @@ -517,7 +521,7 @@ bool MREA::Cook(const hecl::ProjectPath& outPath, AROTBuilder arotBuilder; arotBuilder.build(secs, fullAabb, meshAabbs, meshes); -#if 0 +#if DUMP_OCTREE hecl::blender::Connection& conn = btok.getBlenderConnection(); if (!conn.createBlend(inPath.getWithExtension(_S(".octree.blend"), true), hecl::blender::Connection::BlendType::Area)) return false; @@ -588,7 +592,7 @@ bool MREA::Cook(const hecl::ProjectPath& outPath, DeafBabe collision = {}; DeafBabeBuildFromBlender(collision, cMesh); -#if 0 +#if DUMP_OCTREE hecl::blender::Connection& conn = btok.getBlenderConnection(); if (!conn.createBlend(inPath.getWithExtension(_S(".octree.blend"), true), hecl::blender::Connection::BlendType::Area)) return false; diff --git a/DataSpec/DNAMP1/STRG.cpp b/DataSpec/DNAMP1/STRG.cpp index 2bce0f5b5..2a1221438 100644 --- a/DataSpec/DNAMP1/STRG.cpp +++ b/DataSpec/DNAMP1/STRG.cpp @@ -7,16 +7,6 @@ namespace DataSpec::DNAMP1 const std::vector skLanguages = {FOURCC('ENGL'), FOURCC('FREN'), FOURCC('GERM'), FOURCC('SPAN'), FOURCC('ITAL'), FOURCC('DUTC'), FOURCC('JAPN')}; -static float u16stof(char16_t* str) -{ - char cstr[16]; - int i; - for (i = 0; i < 15 && str[i] != u'\0'; ++i) - cstr[i] = str[i]; - cstr[i] = '\0'; - return strtof(cstr, nullptr); -} - static uint32_t ParseTag(const char16_t* str) { char parseStr[9]; diff --git a/DataSpec/DNAMP2/DNAMP2.cpp b/DataSpec/DNAMP2/DNAMP2.cpp index c0b5ba4dd..f4308318b 100644 --- a/DataSpec/DNAMP2/DNAMP2.cpp +++ b/DataSpec/DNAMP2/DNAMP2.cpp @@ -32,10 +32,9 @@ static bool GetNoShare(std::string_view name) return true; } -PAKBridge::PAKBridge(hecl::Database::Project& project, - const nod::Node& node, +PAKBridge::PAKBridge(const nod::Node& node, bool doExtract) -: m_project(project), m_node(node), m_pak(true, GetNoShare(node.getName())), m_doExtract(doExtract) +: m_node(node), m_pak(true, GetNoShare(node.getName())), m_doExtract(doExtract) { nod::AthenaPartReadStream rs(node.beginReadStream()); m_pak.read(rs); diff --git a/DataSpec/DNAMP2/DNAMP2.hpp b/DataSpec/DNAMP2/DNAMP2.hpp index 555ffb3c8..4dabb9527 100644 --- a/DataSpec/DNAMP2/DNAMP2.hpp +++ b/DataSpec/DNAMP2/DNAMP2.hpp @@ -12,7 +12,6 @@ extern logvisor::Module Log; /* MP2-specific, one-shot PAK traversal/extraction class */ class PAKBridge { - hecl::Database::Project& m_project; const nod::Node& m_node; DNAMP1::PAK m_pak; public: @@ -21,9 +20,7 @@ public: std::unordered_map m_levelDeps; hecl::SystemString m_levelString; - PAKBridge(hecl::Database::Project& project, - const nod::Node& node, - bool doExtract=true); + PAKBridge(const nod::Node& node, bool doExtract=true); void build(); static ResExtractor LookupExtractor(const DNAMP1::PAK& pak, const DNAMP1::PAK::Entry& entry); std::string_view getName() const {return m_node.getName();} diff --git a/DataSpec/DNAMP2/MREA.cpp b/DataSpec/DNAMP2/MREA.cpp index dcb5cda44..c9ad78dde 100644 --- a/DataSpec/DNAMP2/MREA.cpp +++ b/DataSpec/DNAMP2/MREA.cpp @@ -208,7 +208,7 @@ bool MREA::Extract(const SpecBase& dataSpec, drs.seek(egmcOffset, athena::Begin); UniqueID32 egmcId(drs); DNACommon::EGMC egmc; - bool hasEGMC = pakRouter.lookupAndReadDNA(egmcId, egmc); + pakRouter.lookupAndReadDNA(egmcId, egmc); drs.seek(0, athena::Begin); diff --git a/DataSpec/DNAMP3/ANIM.cpp b/DataSpec/DNAMP3/ANIM.cpp index e84f324c7..20d39c122 100644 --- a/DataSpec/DNAMP3/ANIM.cpp +++ b/DataSpec/DNAMP3/ANIM.cpp @@ -516,8 +516,8 @@ void ANIM::ANIM1::Enumerate(athena::io::IStreamReader& reader) initBlock.push_back(reader.readInt16Big()); atUint32 rawChannelCount = reader.readUint32Big(); - atUint32 scratchSize1 = reader.readUint32Big(); - atUint32 scratchSize2 = reader.readUint32Big(); + reader.readUint32Big(); + reader.readUint32Big(); std::vector chanBitCounts; chanBitCounts.reserve(rawChannelCount); diff --git a/DataSpec/DNAMP3/DNAMP3.cpp b/DataSpec/DNAMP3/DNAMP3.cpp index ae2af0516..db1031fb9 100644 --- a/DataSpec/DNAMP3/DNAMP3.cpp +++ b/DataSpec/DNAMP3/DNAMP3.cpp @@ -30,10 +30,9 @@ static bool GetNoShare(std::string_view name) return true; } -PAKBridge::PAKBridge(hecl::Database::Project& project, - const nod::Node& node, +PAKBridge::PAKBridge(const nod::Node& node, bool doExtract) -: m_project(project), m_node(node), m_pak(GetNoShare(node.getName())), m_doExtract(doExtract) +: m_node(node), m_pak(GetNoShare(node.getName())), m_doExtract(doExtract) { nod::AthenaPartReadStream rs(node.beginReadStream()); m_pak.read(rs); diff --git a/DataSpec/DNAMP3/DNAMP3.hpp b/DataSpec/DNAMP3/DNAMP3.hpp index e2c9425d1..ea8c41cf2 100644 --- a/DataSpec/DNAMP3/DNAMP3.hpp +++ b/DataSpec/DNAMP3/DNAMP3.hpp @@ -12,7 +12,6 @@ extern logvisor::Module Log; /* MP3-specific, one-shot PAK traversal/extraction class */ class PAKBridge { - hecl::Database::Project& m_project; const nod::Node& m_node; PAK m_pak; public: @@ -21,9 +20,7 @@ public: std::unordered_map m_levelDeps; hecl::SystemString m_levelString; - PAKBridge(hecl::Database::Project& project, - const nod::Node& node, - bool doExtract=true); + PAKBridge(const nod::Node& node, bool doExtract=true); void build(); static ResExtractor LookupExtractor(const PAK& pak, const PAK::Entry& entry); std::string_view getName() const {return m_node.getName();} diff --git a/DataSpec/SpecMP1.cpp b/DataSpec/SpecMP1.cpp index caa4b3493..40fc7153f 100644 --- a/DataSpec/SpecMP1.cpp +++ b/DataSpec/SpecMP1.cpp @@ -249,7 +249,7 @@ struct SpecMP1 : SpecBase } } - m_paks.emplace_back(m_project, child, good); + m_paks.emplace_back(child, good); } } @@ -1313,7 +1313,7 @@ struct SpecMP1 : SpecBase auto layerIt = area.depLayers.cbegin(); while (it != area.deps.cend()) { - if (it - area.deps.cbegin() == *layerIt) + if (layerIt != area.depLayers.cend() && it - area.deps.cbegin() == *layerIt) { strippedDepLayers.push_back(atUint32(strippedDeps.size())); ++layerIt; diff --git a/DataSpec/SpecMP2.cpp b/DataSpec/SpecMP2.cpp index 10f7932cb..0c63f66af 100644 --- a/DataSpec/SpecMP2.cpp +++ b/DataSpec/SpecMP2.cpp @@ -100,7 +100,7 @@ struct SpecMP2 : SpecBase } } - m_paks.emplace_back(m_project, child, good); + m_paks.emplace_back(child, good); } } diff --git a/DataSpec/SpecMP3.cpp b/DataSpec/SpecMP3.cpp index 13e869df9..33e32f771 100644 --- a/DataSpec/SpecMP3.cpp +++ b/DataSpec/SpecMP3.cpp @@ -123,9 +123,9 @@ struct SpecMP3 : SpecBase } if (fe) - m_fePaks.emplace_back(m_project, child, good); + m_fePaks.emplace_back(child, good); else - m_paks.emplace_back(m_project, child, good); + m_paks.emplace_back(child, good); } } @@ -410,9 +410,8 @@ struct SpecMP3 : SpecBase auto pakName = hecl::SystemString(sysName.sys_str()); process.addLambdaTransaction([this, &progress, &pak, pakName, force](hecl::blender::Token& btok) { - int threadIdx = hecl::ClientProcess::GetThreadWorkerIdx(); m_pakRouter.extractResources(pak, force, btok, - [&progress, &pakName, threadIdx](const hecl::SystemChar* substr, float factor) + [&progress, &pakName](const hecl::SystemChar* substr, float factor) { progress.print(pakName.c_str(), substr, factor); }); @@ -467,9 +466,8 @@ struct SpecMP3 : SpecBase hecl::SystemString pakName(sysName.sys_str()); process.addLambdaTransaction([this, &progress, &pak, pakName, force](hecl::blender::Token& btok) { - int threadIdx = hecl::ClientProcess::GetThreadWorkerIdx(); m_fePakRouter.extractResources(pak, force, btok, - [&progress, &pakName, threadIdx](const hecl::SystemChar* substr, float factor) + [&progress, &pakName](const hecl::SystemChar* substr, float factor) { progress.print(pakName.c_str(), substr, factor); }); diff --git a/Editor/ProjectManager.cpp b/Editor/ProjectManager.cpp index 4d31c1d6a..91f2f1a07 100644 --- a/Editor/ProjectManager.cpp +++ b/Editor/ProjectManager.cpp @@ -40,7 +40,7 @@ CToken ProjectResourcePool::GetObj(std::string_view name, const CVParamTransfer& bool ProjectManager::m_registeredSpecs = false; ProjectManager::ProjectManager(ViewManager &vm) -: m_vm(vm), m_clientProc(nullptr, 1), +: m_vm(vm), m_clientProc(nullptr), m_factoryMP1(m_clientProc), m_objStore(m_factoryMP1, *this) { if (!m_registeredSpecs) diff --git a/Editor/Resource.hpp b/Editor/Resource.hpp index 636c76fd7..4bd3def17 100644 --- a/Editor/Resource.hpp +++ b/Editor/Resource.hpp @@ -23,7 +23,7 @@ public: private: hecl::ProjectPath m_path; Space::Class m_defaultClass = Space::Class::None; - EditorSpace* m_editingSpace = nullptr; + //EditorSpace* m_editingSpace = nullptr; std::vector m_viewingSpaces; public: static Space::Class DeduceDefaultSpaceClass(const hecl::ProjectPath& path); diff --git a/Editor/Space.cpp b/Editor/Space.cpp index 65a30fd54..e1d59b7b1 100644 --- a/Editor/Space.cpp +++ b/Editor/Space.cpp @@ -24,7 +24,6 @@ specter::View* Space::buildSpaceView(specter::ViewResources& res) specter::View* sview = buildContentView(res); m_spaceView->setContentView(sview); specter::Toolbar& tb = *m_spaceView->toolbar(); - const std::string* classStr = SpaceMenuNode::LookupClassString(m_class); specter::Icon* classIcon = SpaceMenuNode::LookupClassIcon(m_class); const zeus::CColor* classColor = SpaceMenuNode::LookupClassColor(m_class); m_spaceSelectButton.reset(new specter::Button(res, tb, &m_spaceSelectBind, "", classIcon, diff --git a/Editor/Space.hpp b/Editor/Space.hpp index 282919407..d0afcc679 100644 --- a/Editor/Space.hpp +++ b/Editor/Space.hpp @@ -49,9 +49,9 @@ public: static Space* NewSpaceFromConfigStream(ViewManager& vm, Space* parent, ConfigReader& r); static RootSpace* NewRootSpaceFromConfigStream(ViewManager& vm, ConfigReader& r); - struct SpaceMenuNode : specter::IMenuNode + struct SpaceMenuNode final : specter::IMenuNode { - struct SubNodeData : specter::IMenuNode + struct SubNodeData final : specter::IMenuNode { Class m_cls; std::string m_key; @@ -66,7 +66,7 @@ public: }; static std::vector s_subNodeDats; - struct SubNode : specter::IMenuNode + struct SubNode final : specter::IMenuNode { Space& m_space; const SubNodeData& m_data; @@ -402,7 +402,7 @@ public: AT_DECL_DNA_YAML AT_DECL_DNAV } m_state; - Space::State& spaceState() {return m_state;} + const Space::State& spaceState() const {return m_state;} bool usesToolbar() const {return true;} void buildToolbarView(specter::ViewResources& res, specter::Toolbar& tb) diff --git a/Editor/SplashScreen.cpp b/Editor/SplashScreen.cpp index 0c6907ddd..3a06d8a11 100644 --- a/Editor/SplashScreen.cpp +++ b/Editor/SplashScreen.cpp @@ -30,10 +30,10 @@ SplashScreen::SplashScreen(ViewManager& vm, specter::ViewResources& res) m_textColor(res.themeData().uiText()), m_textColorClear(m_textColor), m_newString(m_vm.translateOr("new_project", "New Project")), - m_newProjBind(*this), m_openString(m_vm.translateOr("open_project", "Open Project")), - m_openProjBind(*this), m_extractString(m_vm.translateOr("extract_game", "Extract Game")), + m_newProjBind(*this), + m_openProjBind(*this), m_extractProjBind(*this) { if (GIT_COMMIT_DATE[0] != '\0' && diff --git a/Editor/SplashScreen.hpp b/Editor/SplashScreen.hpp index 24e523140..651107689 100644 --- a/Editor/SplashScreen.hpp +++ b/Editor/SplashScreen.hpp @@ -89,7 +89,7 @@ class SplashScreen : public specter::ModalWindow std::string m_text; const std::string* text() const {return &m_text;} - struct OpenRecentMenuItem : specter::IMenuNode + struct OpenRecentMenuItem final : specter::IMenuNode { OpenRecentMenuRoot& m_parent; diff --git a/Editor/ViewManager.hpp b/Editor/ViewManager.hpp index 8bfa8be36..561e49985 100644 --- a/Editor/ViewManager.hpp +++ b/Editor/ViewManager.hpp @@ -26,7 +26,7 @@ namespace urde { class SplashScreen; -class ViewManager : public specter::IViewManager +class ViewManager final : public specter::IViewManager { friend class ProjectManager; friend class Space; diff --git a/Editor/badging/Badging.cpp b/Editor/badging/Badging.cpp index 307b1e8f8..b1d1e0d1f 100644 --- a/Editor/badging/Badging.cpp +++ b/Editor/badging/Badging.cpp @@ -28,7 +28,7 @@ void InitializeBadging(specter::ViewResources& viewRes) if (uncompress(texels.get(), &destSz, URDE_BADGE + pos, URDE_BADGE_SZ - pos) != Z_OK) Log.report(logvisor::Fatal, "unable to decompress badge"); - viewRes.m_factory->BooCommitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) + viewRes.m_factory->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) { specter::IconAtlas<1, 1> atlas; @@ -37,7 +37,7 @@ void InitializeBadging(specter::ViewResources& viewRes) texels.get(), destSz)); g_BadgeIcon = atlas.getIcon(0, 0); return true; - }); + } BooTrace); } void DestroyBadging() diff --git a/Editor/icons/icons.cpp b/Editor/icons/icons.cpp index fff516980..272c10507 100644 --- a/Editor/icons/icons.cpp +++ b/Editor/icons/icons.cpp @@ -28,14 +28,14 @@ void InitializeIcons(specter::ViewResources& viewRes) if (uncompress(texels.get(), &destSz, URDE_ICONS + pos, URDE_ICONS_SZ - pos) != Z_OK) Log.report(logvisor::Fatal, "unable to decompress icons"); - viewRes.m_factory->BooCommitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) + viewRes.m_factory->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) { g_IconAtlas.initializeAtlas(ctx.newStaticTexture(width, height, mips, boo::TextureFormat::RGBA8, boo::TextureClampMode::Repeat, texels.get(), destSz)); return true; - }); + } BooTrace); } void DestroyIcons() diff --git a/NESEmulator/CNESEmulator.cpp b/NESEmulator/CNESEmulator.cpp index 11661fa7f..c24315b81 100644 --- a/NESEmulator/CNESEmulator.cpp +++ b/NESEmulator/CNESEmulator.cpp @@ -65,7 +65,7 @@ enum { #endif }; -static void nesEmuFdsSetup(uint8_t *src, uint8_t *dst); +//static void nesEmuFdsSetup(uint8_t *src, uint8_t *dst); static int emuFileType = FTYPE_UNK; static char emuFileName[1024]; @@ -82,11 +82,11 @@ bool doOverscan = false; bool nesPAL = false; bool nesEmuNSFPlayback = false; -static bool inPause = false; -static bool inOverscanToggle = false; -static bool inResize = false; -static bool inDiskSwitch = false; -static bool inReset = false; +//static bool inPause = false; +//static bool inOverscanToggle = false; +//static bool inResize = false; +//static bool inDiskSwitch = false; +//static bool inReset = false; #if DEBUG_HZ static int emuFrameStart = 0; @@ -107,7 +107,7 @@ static int emuMainTotalElapsed = 0; static uint32_t linesToDraw = VISIBLE_LINES; static const uint32_t visibleImg = VISIBLE_DOTS*VISIBLE_LINES*4; -static uint8_t scaleFactor = 2; +//static uint8_t scaleFactor = 2; static bool emuSaveEnabled = false; static bool emuFdsHasSideB = false; static uint32_t mainLoopRuns; @@ -252,7 +252,7 @@ void CNESEmulator::InitializeEmulator() //mainLoopRuns *= ppuLinesTotal; mainLoopPos = mainLoopRuns; - CGraphicsCommitResources([this](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([this](boo::IGraphicsDataFactory::Context& ctx) { // Nearest-neighbor FTW! m_texture = ctx.newDynamicTexture(VISIBLE_DOTS, linesToDraw, @@ -269,7 +269,7 @@ void CNESEmulator::InitializeEmulator() m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1); m_shadBind = CNESShader::BuildShaderDataBinding(ctx, m_vbo, m_uniBuf, m_texture); return true; - }); + } BooTrace); //double useFreq = 223740; double useFreq = apuGetFrequency(); @@ -547,6 +547,7 @@ void CNESEmulator::NesEmuMainLoop(bool forceDraw) #endif } +#if 0 static void nesEmuFdsSetup(uint8_t *src, uint8_t *dst) { memcpy(dst, src, 0x38); @@ -567,6 +568,7 @@ static void nesEmuFdsSetup(uint8_t *src, uint8_t *dst) } while(cROMPos < 0xFFDC && cDiskPos < 0xFFFF); printf("%04x -> %04x\n", cROMPos, cDiskPos); } +#endif void CNESEmulator::DecompressROM(u8* dataIn, u8* dataOut, u32 dataOutLen, u8 descrambleSeed, u32 checkDataLen, u32 checksumMagic) diff --git a/NESEmulator/CNESEmulator.hpp b/NESEmulator/CNESEmulator.hpp index 1b3bb4b2d..9df186274 100644 --- a/NESEmulator/CNESEmulator.hpp +++ b/NESEmulator/CNESEmulator.hpp @@ -17,7 +17,7 @@ namespace MP1 #define NUM_AUDIO_BUFFERS 10 -class CNESEmulator : public boo::IAudioVoiceCallback +class CNESEmulator final : public boo::IAudioVoiceCallback { public: enum class EPasswordEntryState diff --git a/NESEmulator/CNESShader.cpp b/NESEmulator/CNESShader.cpp index 556c20d9f..ad85ac983 100644 --- a/NESEmulator/CNESShader.cpp +++ b/NESEmulator/CNESShader.cpp @@ -179,7 +179,7 @@ boo::ObjToken CNESShader::BuildShaderDataBinding(boo::G #endif #if _WIN32 -void CNESShader::Initialize(boo::ID3DDataFactory::Context& ctx) +void CNESShader::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -193,7 +193,7 @@ void CNESShader::Initialize(boo::ID3DDataFactory::Context& ctx) boo::ZTest::None, false, true, false, boo::CullMode::None); } -boo::ObjToken CNESShader::BuildShaderDataBinding(boo::ID3DDataFactory::Context& ctx, +boo::ObjToken CNESShader::BuildShaderDataBinding(boo::D3DDataFactory::Context& ctx, boo::ObjToken vbo, boo::ObjToken uniBuf, boo::ObjToken tex) @@ -274,8 +274,7 @@ boo::ObjToken CNESShader::BuildShaderDataBinding(boo::I #endif #if _WIN32 case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: - return BuildShaderDataBinding(static_cast(ctx), vbo, uniBuf, tex); + return BuildShaderDataBinding(static_cast(ctx), vbo, uniBuf, tex); #endif #if BOO_HAS_METAL case boo::IGraphicsDataFactory::Platform::Metal: @@ -295,7 +294,7 @@ void CNESShader::Initialize() if (!CGraphics::g_BooFactory) return; - CGraphicsCommitResources( + CGraphics::CommitResources( [&](boo::IGraphicsDataFactory::Context& ctx) { switch (ctx.platform()) @@ -307,8 +306,7 @@ void CNESShader::Initialize() #endif #if _WIN32 case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: - Initialize(static_cast(ctx)); + Initialize(static_cast(ctx)); break; #endif #if BOO_HAS_METAL @@ -324,7 +322,7 @@ void CNESShader::Initialize() default: break; } return true; - }); + } BooTrace); } void CNESShader::Shutdown() diff --git a/NESEmulator/CNESShader.hpp b/NESEmulator/CNESShader.hpp index c36cbfc8d..68b263bae 100644 --- a/NESEmulator/CNESShader.hpp +++ b/NESEmulator/CNESShader.hpp @@ -20,8 +20,8 @@ public: boo::ObjToken tex); #endif #if _WIN32 - static void Initialize(boo::ID3DDataFactory::Context& ctx); - static boo::ObjToken BuildShaderDataBinding(boo::ID3DDataFactory::Context& ctx, + static void Initialize(boo::D3DDataFactory::Context& ctx); + static boo::ObjToken BuildShaderDataBinding(boo::D3DDataFactory::Context& ctx, boo::ObjToken vbo, boo::ObjToken uniBuf, boo::ObjToken tex); diff --git a/README.md b/README.md index 6cfff608b..83b9e9846 100644 --- a/README.md +++ b/README.md @@ -55,18 +55,8 @@ Build / Debug / Run on Windows, macOS and Linux in a unified way. #### Visual Studio -Using *Git Shell* with [GitHub for Windows](https://desktop.github.com/) - -Windows 7/8 users should run: - ```sh -cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Debug ../urde -``` - -Windows 10 users should run: - -```sh -cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_BUILD_TYPE=Debug ../urde +cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Debug ../urde ``` Then open `urde.sln` diff --git a/Runtime/Audio/CSfxManager.cpp b/Runtime/Audio/CSfxManager.cpp index bfe278302..b8d791b28 100644 --- a/Runtime/Audio/CSfxManager.cpp +++ b/Runtime/Audio/CSfxManager.cpp @@ -25,7 +25,6 @@ CFactoryFnReturn FAudioTranslationTableFactory(const SObjectTag& tag, CInputStre obj->reserve(count); for (u32 i=0 ; ipush_back(in.readUint16Big()); - CSimplePool* sp = vparms.GetOwnedObj(); return TToken>::GetIObjObjectFor(std::move(obj)); } diff --git a/Runtime/Audio/CSfxManager.hpp b/Runtime/Audio/CSfxManager.hpp index 80f0803fa..73ab18b4b 100644 --- a/Runtime/Audio/CSfxManager.hpp +++ b/Runtime/Audio/CSfxManager.hpp @@ -60,11 +60,13 @@ public: zeus::CVector3f xc_; zeus::CVector3f x18_; zeus::CVector3f x24_; + /* float x30_ = 0.f; float x34_ = 0.f; float x38_ = 0.f; u32 x3c_ = 0; bool x40_ = false; + */ bool x44_listenerActive = false; std::unordered_set x48_handles; }; diff --git a/Runtime/Audio/CStaticAudioPlayer.hpp b/Runtime/Audio/CStaticAudioPlayer.hpp index 9dac0160e..c94455e64 100644 --- a/Runtime/Audio/CStaticAudioPlayer.hpp +++ b/Runtime/Audio/CStaticAudioPlayer.hpp @@ -19,7 +19,7 @@ class CStaticAudioPlayer u32 x18_curSamp = 0; u32 x1c_loopStartSamp; u32 x20_loopEndSamp; - u32 x24_ = 0; + //u32 x24_ = 0; //std::unique_ptr x28_dmaLeft; //std::unique_ptr x30_dmaRight; std::vector> x38_dvdRequests; diff --git a/Runtime/AutoMapper/CMapArea.cpp b/Runtime/AutoMapper/CMapArea.cpp index 691ebe662..0ce0e0275 100644 --- a/Runtime/AutoMapper/CMapArea.cpp +++ b/Runtime/AutoMapper/CMapArea.cpp @@ -54,7 +54,7 @@ void CMapArea::PostConstruct() m_surfaces.back().PostConstruct(x44_buf.get(), index); } - CGraphicsCommitResources([this, &index](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([this, &index](boo::IGraphicsDataFactory::Context& ctx) { m_vbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, m_verts.data(), 16, m_verts.size()); m_ibo = ctx.newStaticBuffer(boo::BufferUse::Index, index.data(), 4, index.size()); @@ -98,7 +98,7 @@ void CMapArea::PostConstruct() mapObj.m_doorSurface.emplace(ctx); } return true; - }); + } BooTrace); } bool CMapArea::GetIsVisibleToAutoMapper(bool worldVis, bool areaVis) const diff --git a/Runtime/AutoMapper/CMapUniverse.hpp b/Runtime/AutoMapper/CMapUniverse.hpp index 4bcefd38e..008542ca5 100644 --- a/Runtime/AutoMapper/CMapUniverse.hpp +++ b/Runtime/AutoMapper/CMapUniverse.hpp @@ -22,7 +22,7 @@ public: CAssetId x8_wldRes; int xc_closestHex; float x10_flashPulse; - const CStateManager& x14_mgr; + //const CStateManager& x14_mgr; const zeus::CTransform& x18_model; const zeus::CTransform& x1c_view; public: @@ -34,7 +34,7 @@ public: x8_wldRes(wldRes), xc_closestHex(closestHex), x10_flashPulse(flashPulse), - x14_mgr(mgr), + //x14_mgr(mgr), x18_model(model), x1c_view(view) {} diff --git a/Runtime/AutoMapper/CMappableObject.cpp b/Runtime/AutoMapper/CMappableObject.cpp index ea607ea73..8b280a7f6 100644 --- a/Runtime/AutoMapper/CMappableObject.cpp +++ b/Runtime/AutoMapper/CMappableObject.cpp @@ -294,12 +294,12 @@ void CMappableObject::ReadAutoMapperTweaks(const ITweakAutoMapper& tweaks) doorVerts[6].assign(.2f * -center.z, center.y, 0.f); doorVerts[7].assign(.2f * -center.z, center.y, 2.f * center.x); - CGraphicsCommitResources([](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([](boo::IGraphicsDataFactory::Context& ctx) { g_doorVbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, skDoorVerts, 16, 8); g_doorIbo = ctx.newStaticBuffer(boo::BufferUse::Index, DoorIndices, 4, 24); return true; - }); + } BooTrace); } void CMappableObject::Shutdown() diff --git a/Runtime/CArchitectureQueue.cpp b/Runtime/CArchitectureQueue.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/CDvdFile.hpp b/Runtime/CDvdFile.hpp index bd043259f..7c141e630 100644 --- a/Runtime/CDvdFile.hpp +++ b/Runtime/CDvdFile.hpp @@ -11,11 +11,6 @@ namespace urde { -static const char* DecodeARAMFile(const char* name) -{ - return (strncmp(name, "aram:", 5) == 0 ? name + 5 : name); -} - enum class ESeekOrigin { Begin = 0, diff --git a/Runtime/CFactoryMgr.cpp b/Runtime/CFactoryMgr.cpp index 0227004fa..c6b20c60f 100644 --- a/Runtime/CFactoryMgr.cpp +++ b/Runtime/CFactoryMgr.cpp @@ -54,7 +54,7 @@ CFactoryFnReturn CFactoryMgr::MakeObjectFromMemory(const SObjectTag& tag, std::u { std::unique_ptr compRead = std::make_unique(localBuf.get(), size); - u32 decompLen = compRead->readUint32Big(); + compRead->readUint32Big(); CZipInputStream r(std::move(compRead)); return search->second(tag, r, paramXfer, selfRef); } diff --git a/Runtime/CGameDebug.cpp b/Runtime/CGameDebug.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/CGameOptions.cpp b/Runtime/CGameOptions.cpp index 4109e464e..457a74227 100644 --- a/Runtime/CGameOptions.cpp +++ b/Runtime/CGameOptions.cpp @@ -605,6 +605,7 @@ CHintOptions::CHintOptions(CBitStreamReader& stream) u32 hintIdx = 0; for (const auto& hint : hints) { + (void)hint; EHintState state = EHintState(stream.ReadEncoded(2)); u32 timeBits = stream.ReadEncoded(32); float time = reinterpret_cast(timeBits); diff --git a/Runtime/CGameState.cpp b/Runtime/CGameState.cpp index 50ab1e51f..7465236b9 100644 --- a/Runtime/CGameState.cpp +++ b/Runtime/CGameState.cpp @@ -160,7 +160,7 @@ CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx) for (u32 i = 0; i < 128; i++) x0_[i] = stream.ReadEncoded(8); - u32 tsSeconds = stream.ReadEncoded(32); + //u32 tsSeconds = stream.ReadEncoded(32); x228_24_hardMode = stream.ReadEncoded(1); x228_25_initPowerupsAtFirstSpawn = stream.ReadEncoded(1); @@ -173,7 +173,7 @@ CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx) xa0_playTime = conv.doub; x98_playerState = std::make_shared(stream); - float currentHealth = x98_playerState->GetHealthInfo().GetHP(); + //float currentHealth = x98_playerState->GetHealthInfo().GetHP(); x17c_gameOptions = CGameOptions(stream); x1f8_hintOptions = CHintOptions(stream); diff --git a/Runtime/CIOWin.hpp b/Runtime/CIOWin.hpp index a6407b256..29b75cc1b 100644 --- a/Runtime/CIOWin.hpp +++ b/Runtime/CIOWin.hpp @@ -33,11 +33,6 @@ public: size_t GetNameHash() const { return m_nameHash; } }; -static bool operator==(std::shared_ptr a, std::shared_ptr b) -{ - return a.get() == b.get(); -} - } #endif // __URDE_CIOWIN_HPP__ diff --git a/Runtime/CMakeLists.txt b/Runtime/CMakeLists.txt index 586203ad2..2b03f4442 100644 --- a/Runtime/CMakeLists.txt +++ b/Runtime/CMakeLists.txt @@ -83,7 +83,6 @@ add_library(RuntimeCommon CResLoader.hpp CResLoader.cpp CDvdRequest.hpp CDvdFile.hpp CDvdFile.cpp - CVirtualDvdFile.hpp CVirtualDvdFile.cpp IObjectStore.hpp CSimplePool.hpp CSimplePool.cpp CGameOptions.hpp CGameOptions.cpp @@ -96,7 +95,7 @@ add_library(RuntimeCommon GameObjectLists.hpp GameObjectLists.cpp CSortedLists.hpp CSortedLists.cpp CArchitectureMessage.hpp - CArchitectureQueue.hpp CArchitectureQueue.cpp + CArchitectureQueue.hpp IObj.hpp IVParamObj.hpp CTimeProvider.hpp CTimeProvider.cpp @@ -109,7 +108,7 @@ add_library(RuntimeCommon CMFGameBase.hpp CInGameTweakManagerBase.hpp CPlayMovieBase.hpp - CGameDebug.hpp CGameDebug.cpp + CGameDebug.hpp CGameHintInfo.hpp CGameHintInfo.cpp rstl.hpp GameGlobalObjects.hpp GameGlobalObjects.cpp diff --git a/Runtime/CObjectList.hpp b/Runtime/CObjectList.hpp index 0a2174a1c..7766fcac4 100644 --- a/Runtime/CObjectList.hpp +++ b/Runtime/CObjectList.hpp @@ -64,6 +64,7 @@ public: const_iterator cend() const { return const_iterator(*this, -1); } CObjectList(EGameObjectList listEnum); + virtual ~CObjectList() = default; void AddObject(CEntity& entity); void RemoveObject(TUniqueId uid); diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index 7a29a6875..9654d557e 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -1208,7 +1208,7 @@ std::pair::const_iterator, std::multimapfirst != id) + if (ret.first != x890_scriptIdMap.cend() && ret.first->first != id) ret.first = x890_scriptIdMap.cend(); return ret; } diff --git a/Runtime/CVirtualDvdFile.cpp b/Runtime/CVirtualDvdFile.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/CVirtualDvdFile.hpp b/Runtime/CVirtualDvdFile.hpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Camera/CCameraShakeData.cpp b/Runtime/Camera/CCameraShakeData.cpp index eca650bbd..b2398d1b7 100644 --- a/Runtime/Camera/CCameraShakeData.cpp +++ b/Runtime/Camera/CCameraShakeData.cpp @@ -149,11 +149,11 @@ float CCameraShakeData::GetMaxFMComponent() const CCameraShakeData CCameraShakeData::LoadCameraShakeData(CInputStream& in) { float xMag = in.readFloatBig(); - float f2 = in.readFloatBig(); + in.readFloatBig(); float yMag = in.readFloatBig(); - float f4 = in.readFloatBig(); + in.readFloatBig(); float zMag = in.readFloatBig(); - float f6 = in.readFloatBig(); + in.readFloatBig(); float duration = in.readFloatBig(); SCameraShakePoint xAM(0, 0.f, 0.f, duration, 2.f * xMag); diff --git a/Runtime/Character/CAdditiveBodyState.cpp b/Runtime/Character/CAdditiveBodyState.cpp index 89aa36b6f..98ee35f9a 100644 --- a/Runtime/Character/CAdditiveBodyState.cpp +++ b/Runtime/Character/CAdditiveBodyState.cpp @@ -10,8 +10,8 @@ namespace urde void CABSAim::Start(CBodyController& bc, CStateManager& mgr) { - const CBCAdditiveAimCmd* cmd = - static_cast(bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveAim)); + //const CBCAdditiveAimCmd* cmd = + // static_cast(bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveAim)); const CPASAnimState* aimState = bc.GetPASDatabase().GetAnimState(22); // Left, Right, Up, Down diff --git a/Runtime/Character/CAnimPlaybackParms.hpp b/Runtime/Character/CAnimPlaybackParms.hpp index fb8ff6c8b..7b92d9a54 100644 --- a/Runtime/Character/CAnimPlaybackParms.hpp +++ b/Runtime/Character/CAnimPlaybackParms.hpp @@ -12,7 +12,7 @@ class CAnimPlaybackParms s32 x4_animB = -1; float x8_blendWeight = 1.f; bool xc_animating = true; - s32 x10_ = 0; + //s32 x10_ = 0; const zeus::CVector3f* x14_targetPos = nullptr; bool x18_useLocator = false; const zeus::CQuaternion* x1c_deltaOrient = nullptr; diff --git a/Runtime/Character/CAnimSourceReader.hpp b/Runtime/Character/CAnimSourceReader.hpp index 65f454972..5e25fba9e 100644 --- a/Runtime/Character/CAnimSourceReader.hpp +++ b/Runtime/Character/CAnimSourceReader.hpp @@ -68,6 +68,7 @@ public: s32 VGetInt32POIState(const char* name) const; CParticleData::EParentedMode VGetParticlePOIState(const char* name) const; + using IAnimReader::VGetOffset; virtual zeus::CVector3f VGetOffset(const CSegId& seg, const CCharAnimTime& b) const=0; virtual bool VSupportsReverseView() const=0; virtual SAdvancementResults VReverseView(const CCharAnimTime& time)=0; diff --git a/Runtime/Character/CAnimationDatabaseGame.hpp b/Runtime/Character/CAnimationDatabaseGame.hpp index a0551fb8f..65d12749d 100644 --- a/Runtime/Character/CAnimationDatabaseGame.hpp +++ b/Runtime/Character/CAnimationDatabaseGame.hpp @@ -7,7 +7,7 @@ namespace urde { class CAnimation; -class CAnimationDatabaseGame : public CAnimationDatabase +class CAnimationDatabaseGame final : public CAnimationDatabase { std::vector> x10_anims; public: diff --git a/Runtime/Character/CGroundMovement.cpp b/Runtime/Character/CGroundMovement.cpp index 48a8dc722..185ac7d4d 100644 --- a/Runtime/Character/CGroundMovement.cpp +++ b/Runtime/Character/CGroundMovement.cpp @@ -803,7 +803,7 @@ CMaterialList CGroundMovement::MoveObjectAnalytical(CStateManager& mgr, CPhysics { if (actor.x15c_force.canBeNormalized()) { - zeus::CVector3f prevForce = actor.x15c_force; + //zeus::CVector3f prevForce = actor.x15c_force; actor.x15c_force = CGroundMovement::CollisionDamping(actor.x15c_force, actor.x15c_force.normalized(), collisionNorm, 0.f, 1.f); diff --git a/Runtime/Character/CIkChain.cpp b/Runtime/Character/CIkChain.cpp index 34dc0b56c..65a3ef5e7 100644 --- a/Runtime/Character/CIkChain.cpp +++ b/Runtime/Character/CIkChain.cpp @@ -19,10 +19,10 @@ void CIkChain::Deactivate() void CIkChain::Activate(const CAnimData& animData, const CSegId& segId, const zeus::CTransform& xf) { - const CHierarchyPoseBuilder& posBuilder = animData.GetPoseBuilder(); + //const CHierarchyPoseBuilder& posBuilder = animData.GetPoseBuilder(); x0_ = segId; - const TLockedToken& info = posBuilder.CharLayoutInfo(); + //const TLockedToken& info = posBuilder.CharLayoutInfo(); } void CIkChain::Solve(zeus::CQuaternion& q1, zeus::CQuaternion& q2, const zeus::CVector3f& vec) diff --git a/Runtime/Character/CMakeLists.txt b/Runtime/Character/CMakeLists.txt index 1d85951bf..d2e4fb957 100644 --- a/Runtime/Character/CMakeLists.txt +++ b/Runtime/Character/CMakeLists.txt @@ -18,7 +18,7 @@ set(CHARACTER_SOURCES CCharLayoutInfo.hpp CCharLayoutInfo.cpp CLayoutDescription.hpp CSegIdList.hpp CSegIdList.cpp - CSegId.hpp CSegId.cpp + CSegId.hpp TSegIdMap.hpp CIkChain.hpp CIkChain.cpp CSkinRules.hpp CSkinRules.cpp @@ -30,7 +30,7 @@ set(CHARACTER_SOURCES CPASAnimState.hpp CPASAnimState.cpp CPASParmInfo.hpp CPASParmInfo.cpp CPASAnimInfo.hpp CPASAnimInfo.cpp - CPASAnimParm.hpp CPASAnimParm.cpp + CPASAnimParm.hpp CPASAnimParmData.hpp CPASAnimParmData.cpp CEffectComponent.hpp CEffectComponent.cpp CAnimation.hpp CAnimation.cpp diff --git a/Runtime/Character/CMetaAnimBlend.cpp b/Runtime/Character/CMetaAnimBlend.cpp index 1a8d1df7c..9f3cfd731 100644 --- a/Runtime/Character/CMetaAnimBlend.cpp +++ b/Runtime/Character/CMetaAnimBlend.cpp @@ -22,7 +22,7 @@ std::shared_ptr CMetaAnimBlend::VGetAnimationTree(const CAnimSysContext& animSys, const CMetaAnimTreeBuildOrders& orders) const { - CMetaAnimTreeBuildOrders buildOrders = CMetaAnimTreeBuildOrders::NoSpecialOrders(); + //CMetaAnimTreeBuildOrders buildOrders = CMetaAnimTreeBuildOrders::NoSpecialOrders(); return {}; } diff --git a/Runtime/Character/CPASAnimParm.cpp b/Runtime/Character/CPASAnimParm.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Character/CSegId.cpp b/Runtime/Character/CSegId.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Character/CSequenceHelper.cpp b/Runtime/Character/CSequenceHelper.cpp index 477c1701f..6abb5f7d9 100644 --- a/Runtime/Character/CSequenceHelper.cpp +++ b/Runtime/Character/CSequenceHelper.cpp @@ -101,7 +101,7 @@ CSequenceFundamentals CSequenceHelper::ComputeSequenceFundamentals() auto simp = node->Simplified(); if (simp) node = CAnimTreeNode::Cast(std::move(*simp)); - CCharAnimTime prevRemTime = remTime; + //CCharAnimTime prevRemTime = remTime; remTime = res.x0_remTime; /* This was originally accumulating uninitialized register values (stack variable misuse?) */ offset += res.x8_deltas.x0_posDelta; diff --git a/Runtime/Character/CTransitionDatabaseGame.hpp b/Runtime/Character/CTransitionDatabaseGame.hpp index c6c9eb1c3..0ef856807 100644 --- a/Runtime/Character/CTransitionDatabaseGame.hpp +++ b/Runtime/Character/CTransitionDatabaseGame.hpp @@ -8,7 +8,7 @@ namespace urde class CTransition; class CHalfTransition; -class CTransitionDatabaseGame : public CTransitionDatabase +class CTransitionDatabaseGame final : public CTransitionDatabase { std::shared_ptr x10_defaultTrans; std::vector, std::shared_ptr>> x14_transitions; diff --git a/Runtime/Character/IMetaAnim.hpp b/Runtime/Character/IMetaAnim.hpp index 703c5a258..515b31201 100644 --- a/Runtime/Character/IMetaAnim.hpp +++ b/Runtime/Character/IMetaAnim.hpp @@ -27,6 +27,7 @@ class CPreAdvanceIndicator bool x0_isTime; CCharAnimTime x4_time; const char* xc_string; + /* u32 x10_; u32 x14_; u32 x18_; @@ -39,6 +40,7 @@ class CPreAdvanceIndicator u32 x34_; u32 x38_; u16 x3c_; + */ public: CPreAdvanceIndicator(const CCharAnimTime& time) : x0_isTime(true), x4_time(time) {} diff --git a/Runtime/Collision/CCollisionActor.cpp b/Runtime/Collision/CCollisionActor.cpp index 0a934e4d2..f2f545e98 100644 --- a/Runtime/Collision/CCollisionActor.cpp +++ b/Runtime/Collision/CCollisionActor.cpp @@ -102,7 +102,7 @@ const CDamageVulnerability* CCollisionActor::GetDamageVulnerability(const zeus:: void CCollisionActor::SetDamageVulnerability(const CDamageVulnerability& vuln) { x294_damageVuln = vuln; } -zeus::CVector3f CCollisionActor::GetScanObjectIndicatorPosition(const CStateManager& mgr) +zeus::CVector3f CCollisionActor::GetScanObjectIndicatorPosition(const CStateManager& mgr) const { const CGameCamera* gameCamera = static_cast(mgr.GetCameraManager()->GetCurrentCamera(mgr)); diff --git a/Runtime/Collision/CCollisionActor.hpp b/Runtime/Collision/CCollisionActor.hpp index 75a3655c5..8c6f770ef 100644 --- a/Runtime/Collision/CCollisionActor.hpp +++ b/Runtime/Collision/CCollisionActor.hpp @@ -54,7 +54,7 @@ public: const zeus::CVector3f& GetBoxSize() const { return x260_boxSize; } TUniqueId GetOwnerId() const { return x25c_owner; } TUniqueId GetLastTouchedObject() const { return x2fc_lastTouched; } - zeus::CVector3f GetScanObjectIndicatorPosition(const CStateManager &); + zeus::CVector3f GetScanObjectIndicatorPosition(const CStateManager &) const; void SetExtendedTouchBounds(const zeus::CVector3f& boundExt) { x304_extendedTouchBounds = boundExt; } float GetSphereRadius() const { return x288_sphereRadius; } }; diff --git a/Runtime/Collision/CCollisionInfoList.cpp b/Runtime/Collision/CCollisionInfoList.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Collision/CInternalRayCastStructure.cpp b/Runtime/Collision/CInternalRayCastStructure.cpp deleted file mode 100644 index ffac94d86..000000000 --- a/Runtime/Collision/CInternalRayCastStructure.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "CInternalRayCastStructure.hpp" diff --git a/Runtime/Collision/CMakeLists.txt b/Runtime/Collision/CMakeLists.txt index 33ce3e4a9..01f705a04 100644 --- a/Runtime/Collision/CMakeLists.txt +++ b/Runtime/Collision/CMakeLists.txt @@ -4,7 +4,7 @@ set(COLLISION_SOURCES CGameCollision.hpp CGameCollision.cpp CCollisionResponseData.hpp CCollisionResponseData.cpp CCollisionInfo.hpp CCollisionInfo.cpp - CCollisionInfoList.hpp CCollisionInfoList.cpp + CCollisionInfoList.hpp CCollisionEdge.hpp CCollisionEdge.cpp CCollisionSurface.hpp CCollisionSurface.cpp InternalColliders.hpp InternalColliders.cpp @@ -18,7 +18,7 @@ set(COLLISION_SOURCES CCollisionPrimitive.hpp CCollisionPrimitive.cpp CMaterialList.hpp CMaterialFilter.hpp CMaterialFilter.cpp - CInternalRayCastStructure.hpp CInternalRayCastStructure.cpp + CInternalRayCastStructure.hpp CRayCastResult.hpp CRayCastResult.cpp CCollisionActor.hpp CCollisionActor.cpp CCollisionActorManager.hpp CCollisionActorManager.cpp diff --git a/Runtime/Graphics/CBooRenderer.cpp b/Runtime/Graphics/CBooRenderer.cpp index 70bc18b8e..7b68e25c7 100644 --- a/Runtime/Graphics/CBooRenderer.cpp +++ b/Runtime/Graphics/CBooRenderer.cpp @@ -712,7 +712,7 @@ CBooRenderer::CBooRenderer(IObjectStore& store, IFactory& resFac) m_staticEntropy = store.GetObj("RandomStaticEntropy"); - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { GenerateFogVolumeRampTex(ctx); GenerateSphereRampTex(ctx); @@ -720,7 +720,7 @@ CBooRenderer::CBooRenderer(IObjectStore& store, IFactory& resFac) x14c_reflectionTex = ctx.newRenderTexture(256, 256, boo::TextureClampMode::Repeat, 1, 0); GenerateScanLinesVBO(ctx); return true; - }); + } BooTrace); LoadThermoPalette(); LoadBallFade(); m_thermHotFilter.emplace(); diff --git a/Runtime/Graphics/CDrawable.cpp b/Runtime/Graphics/CDrawable.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Graphics/CDrawablePlaneObject.cpp b/Runtime/Graphics/CDrawablePlaneObject.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Graphics/CGraphics.cpp b/Runtime/Graphics/CGraphics.cpp index 579701410..94bea14f9 100644 --- a/Runtime/Graphics/CGraphics.cpp +++ b/Runtime/Graphics/CGraphics.cpp @@ -168,7 +168,7 @@ static const zeus::CMatrix4f PlusOneZ(1.f, 0.f, 0.f, 0.f, static const zeus::CMatrix4f VulkanCorrect(1.f, 0.f, 0.f, 0.f, 0.f, -1.f, 0.f, 0.f, - 0.f, 0.f, 0.5f, 0.5f, + 0.f, 0.f, 0.5f, 0.5f + FLT_EPSILON, 0.f, 0.f, 0.f, 1.f); zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect, @@ -210,7 +210,6 @@ zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect, 0.f, 0.f, -1.f, 0.f); } case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: case boo::IGraphicsDataFactory::Platform::Metal: { zeus::CMatrix4f mat2(2.f * st.x14_near / rml, 0.f, rpl / rml, 0.f, @@ -260,7 +259,6 @@ zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix(bool forRenderer) 0.f, 0.f, -1.f, 0.f); } case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: case boo::IGraphicsDataFactory::Platform::Metal: { zeus::CMatrix4f mat2(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f, @@ -307,7 +305,6 @@ zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix(bool forRenderer) 0.f, 0.f, 0.f, 1.f); } case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: case boo::IGraphicsDataFactory::Platform::Metal: { zeus::CMatrix4f mat2(2.f / rml, 0.f, 0.f, -rpl / rml, @@ -427,8 +424,8 @@ SClipScreenRect CGraphics::ClipScreenRectFromVS(const zeus::CVector3f& p1, if (maxX2 <= 0 /* ViewportX origin */) return {}; - int finalMinX = std::max(minX, 0 /* ViewportX origin */); - int finalMaxX = std::min(maxX, int(g_Viewport.x8_width)); + //int finalMinX = std::max(minX, 0 /* ViewportX origin */); + //int finalMaxX = std::min(maxX, int(g_Viewport.x8_width)); if (minY2 >= g_Viewport.xc_height) @@ -439,8 +436,8 @@ SClipScreenRect CGraphics::ClipScreenRectFromVS(const zeus::CVector3f& p1, if (maxY2 <= 0 /* ViewportY origin */) return {}; - int finalMinY = std::max(minY, 0 /* ViewportY origin */); - int finalMaxY = std::min(maxY, int(g_Viewport.xc_height)); + //int finalMinY = std::max(minY, 0 /* ViewportY origin */); + //int finalMaxY = std::min(maxY, int(g_Viewport.xc_height)); int width = maxX2 - minX2; int height = maxY2 - minY2; @@ -453,7 +450,7 @@ SClipScreenRect CGraphics::ClipScreenRectFromVS(const zeus::CVector3f& p1, zeus::CVector3f CGraphics::ProjectModelPointToViewportSpace(const zeus::CVector3f& point) { zeus::CVector3f pt = g_GXModelView * point; - return GetPerspectiveProjectionMatrix(false).multiplyOneOverW(pt); + return GetPerspectiveProjectionMatrix(true).multiplyOneOverW(pt); } void CGraphics::SetViewportResolution(const zeus::CVector2i& res) diff --git a/Runtime/Graphics/CGraphics.hpp b/Runtime/Graphics/CGraphics.hpp index 3bcc5acd0..37ce531fa 100644 --- a/Runtime/Graphics/CGraphics.hpp +++ b/Runtime/Graphics/CGraphics.hpp @@ -339,12 +339,6 @@ public: g_BooFactory->commitTransaction(commitFunc __BooTraceArgsUse); } -#ifndef NDEBUG -#define CGraphicsCommitResources(...) CGraphics::CommitResources(__VA_ARGS__, __FILE__, __LINE__) -#else -#define CGraphicsCommitResources(...) CGraphics::CommitResources(__VA_ARGS__) -#endif - static void SetShaderDataBinding(const boo::ObjToken& binding) { g_BooMainCommandQueue->setShaderDataBinding(binding); diff --git a/Runtime/Graphics/CGraphicsPalette.cpp b/Runtime/Graphics/CGraphicsPalette.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Graphics/CGraphicsPalette.hpp b/Runtime/Graphics/CGraphicsPalette.hpp index a2808733c..683b6964d 100644 --- a/Runtime/Graphics/CGraphicsPalette.hpp +++ b/Runtime/Graphics/CGraphicsPalette.hpp @@ -32,7 +32,6 @@ public: u16 w = in.readUint16Big(); u16 h = in.readUint16Big(); x8_entryCount = w * h; - xc_entries[x8_entryCount]; /* GX Tlut init here */ } diff --git a/Runtime/Graphics/CLineRenderer.cpp b/Runtime/Graphics/CLineRenderer.cpp index f6273493e..54bda70c8 100644 --- a/Runtime/Graphics/CLineRenderer.cpp +++ b/Runtime/Graphics/CLineRenderer.cpp @@ -92,11 +92,11 @@ CLineRenderer::CLineRenderer(EPrimitiveMode mode, u32 maxVerts, m_uniformBuf = s_uniformPool.allocateBlock(CGraphics::g_BooFactory); - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { CLineRendererShaders::BuildShaderDataBinding(ctx, *this, texture, additive, zTest, zGEqual); return true; - }); + } BooTrace); } rstl::reserved_vector CLineRenderer::g_StaticLineVertsTex = {}; diff --git a/Runtime/Graphics/CMakeLists.txt b/Runtime/Graphics/CMakeLists.txt index bb64a4ceb..907833875 100644 --- a/Runtime/Graphics/CMakeLists.txt +++ b/Runtime/Graphics/CMakeLists.txt @@ -84,8 +84,8 @@ set(GRAPHICS_SOURCES IRenderer.hpp IWeaponRenderer.hpp IWeaponRenderer.cpp CBooRenderer.hpp CBooRenderer.cpp - CDrawable.hpp CDrawable.cpp - CDrawablePlaneObject.hpp CDrawablePlaneObject.cpp + CDrawable.hpp + CDrawablePlaneObject.hpp CLineRenderer.hpp CLineRenderer.cpp CMetroidModelInstance.hpp CLight.hpp CLight.cpp @@ -94,7 +94,7 @@ set(GRAPHICS_SOURCES CSkinnedModel.hpp CSkinnedModel.cpp CVertexMorphEffect.hpp CVertexMorphEffect.cpp CMoviePlayer.hpp CMoviePlayer.cpp - CGraphicsPalette.hpp CGraphicsPalette.cpp + CGraphicsPalette.hpp CPVSVisSet.hpp CPVSVisSet.cpp CPVSVisOctree.hpp CPVSVisOctree.cpp CPVSAreaSet.hpp CPVSAreaSet.cpp diff --git a/Runtime/Graphics/CModelBoo.cpp b/Runtime/Graphics/CModelBoo.cpp index 7fcaf0886..dfc411dbc 100644 --- a/Runtime/Graphics/CModelBoo.cpp +++ b/Runtime/Graphics/CModelBoo.cpp @@ -269,6 +269,7 @@ GeometryUniformLayout::GeometryUniformLayout(const CModel* model, const Material /* Animated UV transform matrices */ for (const MaterialSet::Material& mat : matSet->materials) { + (void)mat; size_t thisSz = ROUND_UP_256(/*mat.uvAnims.size()*/ 8 * (sizeof(zeus::CMatrix4f) * 2)); m_uvOffs.push_back(m_geomBufferSize); m_uvSizes.push_back(thisSz); @@ -286,7 +287,7 @@ CBooModel::ModelInstance* CBooModel::PushNewModelInstance(int sharedLayoutBuf) m_instances.emplace_back(); ModelInstance& newInst = m_instances.back(); - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { /* Build geometry uniform buffer if shared not available */ boo::ObjToken geomUniformBuf; @@ -460,7 +461,7 @@ CBooModel::ModelInstance* CBooModel::PushNewModelInstance(int sharedLayoutBuf) } } return true; - }); + } BooTrace); return &newInst; } @@ -870,6 +871,7 @@ void CBooModel::UVAnimationBuffer::Update(u8*& bufOut, const MaterialSet* matSet -flags.mbShadowBox.min.z) * CGraphics::g_GXModelView).toMatrix4f(); for (const MaterialSet::Material& mat : matSet->materials) { + (void)mat; std::array* mtxs = reinterpret_cast*>(bufOut); mtxs[0][0] = texMtx; mtxs[0][1] = MBShadowPost0; @@ -1280,7 +1282,7 @@ CModel::CModel(std::unique_ptr&& in, u32 /* dataLen */, IObjectStore* stor matSet.BuildShaders(m_hmdlMeta); } - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { /* Index buffer is always static */ if (m_hmdlMeta.indexCount) @@ -1306,7 +1308,7 @@ CModel::CModel(std::unique_ptr&& in, u32 /* dataLen */, IObjectStore* stor } return true; - }); + } BooTrace); u32 surfCount = hecl::SBig(*reinterpret_cast(surfInfo)); x8_surfaces.reserve(surfCount); diff --git a/Runtime/Graphics/CMoviePlayer.cpp b/Runtime/Graphics/CMoviePlayer.cpp index 1b8c7dde2..b43ef5e00 100644 --- a/Runtime/Graphics/CMoviePlayer.cpp +++ b/Runtime/Graphics/CMoviePlayer.cpp @@ -57,6 +57,7 @@ BOO_GLSL_BINDING_HEAD " yuv.r+2.017*yuv.g, 1.0) * vtf.color;\n" "}\n"; +#if _WIN32 static const char* VS_HLSL_YUV = "struct VertData\n" "{\n" @@ -101,7 +102,9 @@ static const char* FS_HLSL_YUV = " yuv.r-0.39173*yuv.g-0.81290*yuv.b,\n" " yuv.r+2.017*yuv.g, 1.0) * vtf.color;\n" "}\n"; +#endif +#if BOO_HAS_METAL static const char* VS_METAL_YUV = "#include \n" "using namespace metal;\n" @@ -152,6 +155,7 @@ static const char* FS_METAL_YUV = " yuv.r-0.39173*yuv.g-0.81290*yuv.b,\n" " yuv.r+2.017*yuv.g, 1.0) * vtf.color;\n" "}\n"; +#endif /* used in the original to look up fixed-point dividends on a * MIDI-style volume scale (0-127) -> (n/0x8000) */ @@ -198,7 +202,7 @@ static const char* TexNames[] = {"texY", "texU", "texV"}; void CMoviePlayer::Initialize() { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { if (!ctx.bindingNeedsVertexFormat()) { @@ -222,8 +226,7 @@ void CMoviePlayer::Initialize() #endif #if _WIN32 case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: - YUVShaderPipeline = static_cast(ctx).newShaderPipeline + YUVShaderPipeline = static_cast(ctx).newShaderPipeline (VS_HLSL_YUV, FS_HLSL_YUV, nullptr, nullptr, nullptr, YUVVTXFmt, boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, boo::ZTest::None, false, true, false, boo::CullMode::None); @@ -248,7 +251,7 @@ void CMoviePlayer::Initialize() default: break; } return true; - }); + } BooTrace); TjHandle = tjInitDecompress(); } @@ -426,7 +429,7 @@ CMoviePlayer::CMoviePlayer(const char* path, float preLoadSeconds, bool loop, bo xa0_bufferQueue.reserve(xf0_preLoadFrames); /* All set for GPU resources */ - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_blockBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(m_viewVertBlock), 1); m_vertBuf = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(specter::View::TexShaderVert), 4); @@ -489,7 +492,7 @@ CMoviePlayer::CMoviePlayer(const char* path, float preLoadSeconds, bool loop, bo set.audioBuf.reset(new s16[x28_thpHead.maxAudioSamples * 2]); } return true; - }); + } BooTrace); /* Temporary planar YUV decode buffer, resulting planes copied to Boo */ m_yuvBuf.reset(new uint8_t[tjBufSizeYUV(x6c_videoInfo.width, x6c_videoInfo.height, TJ_420)]); diff --git a/Runtime/Graphics/CRainSplashGenerator.cpp b/Runtime/Graphics/CRainSplashGenerator.cpp index 5a776f488..c6a93eeb9 100644 --- a/Runtime/Graphics/CRainSplashGenerator.cpp +++ b/Runtime/Graphics/CRainSplashGenerator.cpp @@ -14,12 +14,12 @@ CRainSplashGenerator::CRainSplashGenerator(const zeus::CVector3f& scale, u32 max x48_24 = false; x48_25_raining = true; x0_rainSplashes.reserve(maxSplashes); - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { for (int i=0 ; i DecodePalette(int numEntries, CInputStream& in) @@ -366,12 +366,12 @@ void CTexture::BuildC4FromGCN(CInputStream& in) h /= 2; } - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8, boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get(); return true; - }); + } BooTrace); } void CTexture::BuildC8FromGCN(CInputStream& in) @@ -410,12 +410,12 @@ void CTexture::BuildC8FromGCN(CInputStream& in) h /= 2; } - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8, boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get(); return true; - }); + } BooTrace); } void CTexture::BuildC14X2FromGCN(CInputStream& in) @@ -462,12 +462,12 @@ void CTexture::BuildRGB565FromGCN(CInputStream& in) h /= 2; } - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8, boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get(); return true; - }); + } BooTrace); } void CTexture::BuildRGB5A3FromGCN(CInputStream& in) @@ -519,12 +519,12 @@ void CTexture::BuildRGB5A3FromGCN(CInputStream& in) h /= 2; } - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8, boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get(); return true; - }); + } BooTrace); } void CTexture::BuildRGBA8FromGCN(CInputStream& in) @@ -576,12 +576,12 @@ void CTexture::BuildRGBA8FromGCN(CInputStream& in) h /= 2; } - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8, boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get(); return true; - }); + } BooTrace); } struct DXT1Block @@ -640,12 +640,12 @@ void CTexture::BuildDXT1FromGCN(CInputStream& in) h /= 2; } - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::DXT1, boo::TextureClampMode::Repeat, buf.get(), blockCount * 8).get(); return true; - }); + } BooTrace); } void CTexture::BuildRGBA8(const void* data, size_t length) @@ -656,12 +656,12 @@ void CTexture::BuildRGBA8(const void* data, size_t length) Log.report(logvisor::Fatal, "insufficient TXTR length (%" PRISize "/%" PRISize ")", length, expectedSize); - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8, boo::TextureClampMode::Repeat, data, expectedSize).get(); return true; - }); + } BooTrace); } void CTexture::BuildC8(const void* data, size_t length) @@ -671,7 +671,7 @@ void CTexture::BuildC8(const void* data, size_t length) Log.report(logvisor::Fatal, "insufficient TXTR length (%" PRISize "/%" PRISize ")", length, texelCount); - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { uint32_t nentries = hecl::SBig(*reinterpret_cast(data)); const u8* paletteTexels = reinterpret_cast(data) + 4; @@ -681,14 +681,14 @@ void CTexture::BuildC8(const void* data, size_t length) m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::I8, boo::TextureClampMode::Repeat, texels, texelCount).get(); return true; -}); + } BooTrace); } void CTexture::BuildC8Font(const void* data, EFontType ftype) { size_t texelCount = ComputeMippedTexelCount(); - size_t layerCount; + size_t layerCount = 1; switch (ftype) { case EFontType::OneLayer: @@ -778,22 +778,22 @@ void CTexture::BuildC8Font(const void* data, EFontType ftype) h /= 2; } - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_booTex = ctx.newStaticArrayTexture(x4_w, x6_h, layerCount, x8_mips, boo::TextureFormat::RGBA8, boo::TextureClampMode::Repeat, buf.get(), texelCount * layerCount * 4).get(); return true; - }); + } BooTrace); } void CTexture::BuildDXT1(const void* data, size_t length) { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::DXT1, boo::TextureClampMode::Repeat, data, length).get(); return true; - }); + } BooTrace); } CTexture::CTexture(ETexelFormat fmt, s16 w, s16 h, s32 mips) diff --git a/Runtime/Graphics/Shaders/CAABoxShader.cpp b/Runtime/Graphics/Shaders/CAABoxShader.cpp index d51cb2d83..6c4442fe6 100644 --- a/Runtime/Graphics/Shaders/CAABoxShader.cpp +++ b/Runtime/Graphics/Shaders/CAABoxShader.cpp @@ -6,13 +6,13 @@ namespace urde CAABoxShader::CAABoxShader(bool zOnly) : m_zOnly(zOnly) { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(zeus::CVector3f), 34); m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1); m_dataBind = TShader::BuildShaderDataBinding(ctx, *this); return true; - }); + } BooTrace); } void CAABoxShader::setAABB(const zeus::CAABox& aabb) diff --git a/Runtime/Graphics/Shaders/CAABoxShaderHLSL.cpp b/Runtime/Graphics/Shaders/CAABoxShaderHLSL.cpp index 442864bbf..bbc83dd0d 100644 --- a/Runtime/Graphics/Shaders/CAABoxShaderHLSL.cpp +++ b/Runtime/Graphics/Shaders/CAABoxShaderHLSL.cpp @@ -54,7 +54,7 @@ struct CAABoxShaderD3DDataBindingFactory : TShader::IDataBindingFa BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CAABoxShader& filter) { - boo::ID3DDataFactory::Context& cctx = static_cast(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBuf.get()}; return cctx.newShaderDataBinding(filter.m_zOnly ? s_zOnlyPipeline : s_Pipeline, s_VtxFmt, @@ -63,7 +63,7 @@ struct CAABoxShaderD3DDataBindingFactory : TShader::IDataBindingFa } }; -TShader::IDataBindingFactory* CAABoxShader::Initialize(boo::ID3DDataFactory::Context& ctx) +TShader::IDataBindingFactory* CAABoxShader::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -80,7 +80,7 @@ TShader::IDataBindingFactory* CAABoxShader::Initialize(boo::ID3DDa } template <> -void CAABoxShader::Shutdown() +void CAABoxShader::Shutdown() { s_VtxFmt.reset(); s_Pipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CCameraBlurFilter.cpp b/Runtime/Graphics/Shaders/CCameraBlurFilter.cpp index b2357ee34..c90afccbc 100644 --- a/Runtime/Graphics/Shaders/CCameraBlurFilter.cpp +++ b/Runtime/Graphics/Shaders/CCameraBlurFilter.cpp @@ -5,13 +5,13 @@ namespace urde CCameraBlurFilter::CCameraBlurFilter() { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, 32, 4); m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1); m_dataBind = TShader::BuildShaderDataBinding(ctx, *this); return true; - }); + } BooTrace); } void CCameraBlurFilter::draw(float amount, bool clearDepth) diff --git a/Runtime/Graphics/Shaders/CCameraBlurFilterHLSL.cpp b/Runtime/Graphics/Shaders/CCameraBlurFilterHLSL.cpp index 7e8afcf3d..46d3d97b3 100644 --- a/Runtime/Graphics/Shaders/CCameraBlurFilterHLSL.cpp +++ b/Runtime/Graphics/Shaders/CCameraBlurFilterHLSL.cpp @@ -96,7 +96,7 @@ struct CCameraBlurFilterD3DDataBindingFactory : TShader::IDat BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CCameraBlurFilter& filter) { - boo::ID3DDataFactory::Context& cctx = static_cast(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBuf.get()}; boo::ObjToken texs[] = {CGraphics::g_SpareTexture.get()}; @@ -106,7 +106,7 @@ struct CCameraBlurFilterD3DDataBindingFactory : TShader::IDat } }; -TShader::IDataBindingFactory* CCameraBlurFilter::Initialize(boo::ID3DDataFactory::Context& ctx) +TShader::IDataBindingFactory* CCameraBlurFilter::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -122,7 +122,7 @@ TShader::IDataBindingFactory* CCameraBlurFilter::Initialize(b } template <> -void CCameraBlurFilter::Shutdown() +void CCameraBlurFilter::Shutdown() { s_VtxFmt.reset(); s_Pipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CColoredQuadFilter.cpp b/Runtime/Graphics/Shaders/CColoredQuadFilter.cpp index ae2f8f614..3e32bf650 100644 --- a/Runtime/Graphics/Shaders/CColoredQuadFilter.cpp +++ b/Runtime/Graphics/Shaders/CColoredQuadFilter.cpp @@ -5,7 +5,7 @@ namespace urde CColoredQuadFilter::CColoredQuadFilter(EFilterType type) { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { struct Vert { @@ -21,7 +21,7 @@ CColoredQuadFilter::CColoredQuadFilter(EFilterType type) m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1); m_dataBind = TMultiBlendShader::BuildShaderDataBinding(ctx, type, *this); return true; - }); + } BooTrace); } void CColoredQuadFilter::draw(const zeus::CColor& color, const zeus::CRectangle& rect) diff --git a/Runtime/Graphics/Shaders/CColoredQuadFilterHLSL.cpp b/Runtime/Graphics/Shaders/CColoredQuadFilterHLSL.cpp index 486256caf..088d06506 100644 --- a/Runtime/Graphics/Shaders/CColoredQuadFilterHLSL.cpp +++ b/Runtime/Graphics/Shaders/CColoredQuadFilterHLSL.cpp @@ -69,7 +69,7 @@ struct CColoredQuadFilterD3DDataBindingFactory : TMultiBlendShader(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBuf.get()}; return cctx.newShaderDataBinding(SelectPipeline(type), s_VtxFmt, @@ -79,7 +79,7 @@ struct CColoredQuadFilterD3DDataBindingFactory : TMultiBlendShader::IDataBindingFactory* -CColoredQuadFilter::Initialize(boo::ID3DDataFactory::Context& ctx) +CColoredQuadFilter::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -102,7 +102,7 @@ CColoredQuadFilter::Initialize(boo::ID3DDataFactory::Context& ctx) } template <> -void CColoredQuadFilter::Shutdown() +void CColoredQuadFilter::Shutdown() { s_VtxFmt.reset(); s_AlphaPipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CDecalShadersHLSL.cpp b/Runtime/Graphics/Shaders/CDecalShadersHLSL.cpp index 1fc598e3a..66209eecb 100644 --- a/Runtime/Graphics/Shaders/CDecalShadersHLSL.cpp +++ b/Runtime/Graphics/Shaders/CDecalShadersHLSL.cpp @@ -143,7 +143,7 @@ struct D3DDecalDataBindingFactory : TShader::IDataBindingFactory } }; -TShader::IDataBindingFactory* CDecalShaders::Initialize(boo::ID3DDataFactory::Context& ctx) +TShader::IDataBindingFactory* CDecalShaders::Initialize(boo::D3DDataFactory::Context& ctx) { static const boo::VertexElementDescriptor TexFmtTex[] = { @@ -199,7 +199,7 @@ TShader::IDataBindingFactory* CDecalShaders::Initialize(boo::ID3D } template <> -void CDecalShaders::Shutdown() +void CDecalShaders::Shutdown() { m_vtxFormatTex.reset(); m_vtxFormatNoTex.reset(); diff --git a/Runtime/Graphics/Shaders/CElementGenShadersHLSL.cpp b/Runtime/Graphics/Shaders/CElementGenShadersHLSL.cpp index 792dd686c..d9c93a3de 100644 --- a/Runtime/Graphics/Shaders/CElementGenShadersHLSL.cpp +++ b/Runtime/Graphics/Shaders/CElementGenShadersHLSL.cpp @@ -262,7 +262,7 @@ struct D3DElementDataBindingFactory : TShader::IDataBindingF } }; -TShader::IDataBindingFactory* CElementGenShaders::Initialize(boo::ID3DDataFactory::Context& ctx) +TShader::IDataBindingFactory* CElementGenShaders::Initialize(boo::D3DDataFactory::Context& ctx) { static const boo::VertexElementDescriptor TexFmtTex[] = { @@ -436,7 +436,7 @@ TShader::IDataBindingFactory* CElementGenShaders::Initialize } template <> -void CElementGenShaders::Shutdown() +void CElementGenShaders::Shutdown() { m_vtxFormatTex.reset(); m_vtxFormatIndTex.reset(); diff --git a/Runtime/Graphics/Shaders/CEnergyBarShader.cpp b/Runtime/Graphics/Shaders/CEnergyBarShader.cpp index 832551b32..13f78855c 100644 --- a/Runtime/Graphics/Shaders/CEnergyBarShader.cpp +++ b/Runtime/Graphics/Shaders/CEnergyBarShader.cpp @@ -21,14 +21,14 @@ void CEnergyBarShader::draw(const zeus::CColor& color0, const std::vector::BuildShaderDataBinding(ctx, *this); return true; - }); + } BooTrace); } size_t vertIter = 0; diff --git a/Runtime/Graphics/Shaders/CEnergyBarShaderHLSL.cpp b/Runtime/Graphics/Shaders/CEnergyBarShaderHLSL.cpp index 8e902966e..86d1aa014 100644 --- a/Runtime/Graphics/Shaders/CEnergyBarShaderHLSL.cpp +++ b/Runtime/Graphics/Shaders/CEnergyBarShaderHLSL.cpp @@ -61,7 +61,7 @@ struct CEnergyBarShaderD3DDataBindingFactory : TShader::IDataB BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CEnergyBarShader& filter) { - boo::ID3DDataFactory::Context& cctx = static_cast(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[1]; boo::ObjToken texs[] = {filter.m_tex->GetBooTexture()}; @@ -77,7 +77,7 @@ struct CEnergyBarShaderD3DDataBindingFactory : TShader::IDataB }; TShader::IDataBindingFactory* -CEnergyBarShader::Initialize(boo::ID3DDataFactory::Context& ctx) +CEnergyBarShader::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -93,7 +93,7 @@ CEnergyBarShader::Initialize(boo::ID3DDataFactory::Context& ctx) } template <> -void CEnergyBarShader::Shutdown() +void CEnergyBarShader::Shutdown() { s_VtxFmt.reset(); s_Pipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CFluidPlaneShader.cpp b/Runtime/Graphics/Shaders/CFluidPlaneShader.cpp index 4e2c5d7a7..037226796 100644 --- a/Runtime/Graphics/Shaders/CFluidPlaneShader.cpp +++ b/Runtime/Graphics/Shaders/CFluidPlaneShader.cpp @@ -99,7 +99,7 @@ boo::ObjToken CFluidPlaneShader::Cache::GetOrBuildShader(c if (CGraphics::g_BooFactory == nullptr) return nullptr; - CGraphicsCommitResources( + CGraphics::CommitResources( [&](boo::IGraphicsDataFactory::Context& ctx) { switch (ctx.platform()) @@ -111,8 +111,7 @@ boo::ObjToken CFluidPlaneShader::Cache::GetOrBuildShader(c #endif #if _WIN32 case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: - slot = BuildShader(static_cast(ctx), info); + slot = BuildShader(static_cast(ctx), info); break; #endif #if BOO_HAS_METAL @@ -128,7 +127,7 @@ boo::ObjToken CFluidPlaneShader::Cache::GetOrBuildShader(c default: break; } return true; - }); + } BooTrace); return slot; } @@ -148,7 +147,7 @@ void CFluidPlaneShader::Cache::Clear() void CFluidPlaneShader::PrepareBinding(const boo::ObjToken& pipeline, u32 maxVertCount, bool door) { - CGraphicsCommitResources( + CGraphics::CommitResources( [&](boo::IGraphicsDataFactory::Context& ctx) { m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(Vertex), maxVertCount); @@ -163,8 +162,7 @@ void CFluidPlaneShader::PrepareBinding(const boo::ObjToken #endif #if _WIN32 case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: - m_dataBind = BuildBinding(static_cast(ctx), pipeline, door); + m_dataBind = BuildBinding(static_cast(ctx), pipeline, door); break; #endif #if BOO_HAS_METAL @@ -180,7 +178,7 @@ void CFluidPlaneShader::PrepareBinding(const boo::ObjToken default: break; } return true; - }); + } BooTrace); } void CFluidPlaneShader::Shutdown() @@ -195,8 +193,7 @@ void CFluidPlaneShader::Shutdown() #endif #if _WIN32 case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: - CFluidPlaneShader::_Shutdown(); + CFluidPlaneShader::_Shutdown(); break; #endif #if BOO_HAS_METAL diff --git a/Runtime/Graphics/Shaders/CFluidPlaneShader.hpp b/Runtime/Graphics/Shaders/CFluidPlaneShader.hpp index 45fdb50f5..286cb83c1 100644 --- a/Runtime/Graphics/Shaders/CFluidPlaneShader.hpp +++ b/Runtime/Graphics/Shaders/CFluidPlaneShader.hpp @@ -127,11 +127,11 @@ private: const boo::ObjToken& pipeline, bool door); #endif #if _WIN32 - static boo::ObjToken BuildShader(boo::ID3DDataFactory::Context& ctx, + static boo::ObjToken BuildShader(boo::D3DDataFactory::Context& ctx, const SFluidPlaneShaderInfo& info); - static boo::ObjToken BuildShader(boo::ID3DDataFactory::Context& ctx, + static boo::ObjToken BuildShader(boo::D3DDataFactory::Context& ctx, const SFluidPlaneDoorShaderInfo& info); - boo::ObjToken BuildBinding(boo::ID3DDataFactory::Context& ctx, + boo::ObjToken BuildBinding(boo::D3DDataFactory::Context& ctx, const boo::ObjToken& pipeline, bool door); #endif #if BOO_HAS_METAL diff --git a/Runtime/Graphics/Shaders/CFluidPlaneShaderHLSL.cpp b/Runtime/Graphics/Shaders/CFluidPlaneShaderHLSL.cpp index 4c6710532..c3151150f 100644 --- a/Runtime/Graphics/Shaders/CFluidPlaneShaderHLSL.cpp +++ b/Runtime/Graphics/Shaders/CFluidPlaneShaderHLSL.cpp @@ -166,7 +166,7 @@ static const char* FSDoor = "}\n"; boo::ObjToken -CFluidPlaneShader::BuildShader(boo::ID3DDataFactory::Context& ctx, const SFluidPlaneShaderInfo& info) +CFluidPlaneShader::BuildShader(boo::D3DDataFactory::Context& ctx, const SFluidPlaneShaderInfo& info) { if (!s_vtxFmt) { @@ -498,7 +498,7 @@ CFluidPlaneShader::BuildShader(boo::ID3DDataFactory::Context& ctx, const SFluidP } boo::ObjToken -CFluidPlaneShader::BuildShader(boo::ID3DDataFactory::Context& ctx, const SFluidPlaneDoorShaderInfo& info) +CFluidPlaneShader::BuildShader(boo::D3DDataFactory::Context& ctx, const SFluidPlaneDoorShaderInfo& info) { if (!s_vtxFmt) { @@ -559,13 +559,13 @@ CFluidPlaneShader::BuildShader(boo::ID3DDataFactory::Context& ctx, const SFluidP } template <> -void CFluidPlaneShader::_Shutdown() +void CFluidPlaneShader::_Shutdown() { s_vtxFmt.reset(); } boo::ObjToken -CFluidPlaneShader::BuildBinding(boo::ID3DDataFactory::Context& ctx, +CFluidPlaneShader::BuildBinding(boo::D3DDataFactory::Context& ctx, const boo::ObjToken& pipeline, bool door) { boo::ObjToken ubufs[] = { m_uniBuf.get(), m_uniBuf.get(), m_uniBuf.get() }; diff --git a/Runtime/Graphics/Shaders/CFogVolumeFilter.cpp b/Runtime/Graphics/Shaders/CFogVolumeFilter.cpp index ce93e2351..3bc1b1c99 100644 --- a/Runtime/Graphics/Shaders/CFogVolumeFilter.cpp +++ b/Runtime/Graphics/Shaders/CFogVolumeFilter.cpp @@ -5,7 +5,7 @@ namespace urde CFogVolumeFilter::CFogVolumeFilter() { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { struct Vert { @@ -22,7 +22,7 @@ CFogVolumeFilter::CFogVolumeFilter() m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(zeus::CColor), 1); TShader::BuildShaderDataBinding(ctx, *this); return true; - }); + } BooTrace); } void CFogVolumeFilter::draw2WayPass(const zeus::CColor& color) diff --git a/Runtime/Graphics/Shaders/CFogVolumeFilterHLSL.cpp b/Runtime/Graphics/Shaders/CFogVolumeFilterHLSL.cpp index 0444e1dd2..fb75235d1 100644 --- a/Runtime/Graphics/Shaders/CFogVolumeFilterHLSL.cpp +++ b/Runtime/Graphics/Shaders/CFogVolumeFilterHLSL.cpp @@ -93,7 +93,7 @@ struct CFogVolumeFilterD3DDataBindingFactory : TShader::IDataB BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CFogVolumeFilter& filter) { - boo::ID3DDataFactory::Context& cctx = static_cast(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken texs[] = { CGraphics::g_SpareTexture.get(), CGraphics::g_SpareTexture.get(), g_Renderer->GetFogRampTex().get() }; int bindIdxs[] = {0, 1, 0}; @@ -111,7 +111,7 @@ struct CFogVolumeFilterD3DDataBindingFactory : TShader::IDataB }; TShader::IDataBindingFactory* -CFogVolumeFilter::Initialize(boo::ID3DDataFactory::Context& ctx) +CFogVolumeFilter::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -129,7 +129,7 @@ CFogVolumeFilter::Initialize(boo::ID3DDataFactory::Context& ctx) } template <> -void CFogVolumeFilter::Shutdown() +void CFogVolumeFilter::Shutdown() { s_VtxFmt.reset(); s_1WayPipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CFogVolumePlaneShader.cpp b/Runtime/Graphics/Shaders/CFogVolumePlaneShader.cpp index 62c68e0a0..86168185f 100644 --- a/Runtime/Graphics/Shaders/CFogVolumePlaneShader.cpp +++ b/Runtime/Graphics/Shaders/CFogVolumePlaneShader.cpp @@ -6,12 +6,12 @@ namespace urde void CFogVolumePlaneShader::CommitResources(size_t capacity) { m_vertCapacity = capacity; - CGraphicsCommitResources([this, capacity](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([this, capacity](boo::IGraphicsDataFactory::Context& ctx) { m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(zeus::CVector4f), capacity); TShader::BuildShaderDataBinding(ctx, *this); return true; - }); + } BooTrace); } void CFogVolumePlaneShader::addFan(const zeus::CVector3f* verts, int numVerts) diff --git a/Runtime/Graphics/Shaders/CFogVolumePlaneShaderHLSL.cpp b/Runtime/Graphics/Shaders/CFogVolumePlaneShaderHLSL.cpp index b9cb66410..8c1ef1718 100644 --- a/Runtime/Graphics/Shaders/CFogVolumePlaneShaderHLSL.cpp +++ b/Runtime/Graphics/Shaders/CFogVolumePlaneShaderHLSL.cpp @@ -32,7 +32,7 @@ struct CFogVolumePlaneShaderD3DDataBindingFactory : TShader(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); for (int i=0 ; i<4 ; ++i) filter.m_dataBinds[i] = cctx.newShaderDataBinding(s_Pipelines[i], s_VtxFmt, @@ -43,7 +43,7 @@ struct CFogVolumePlaneShaderD3DDataBindingFactory : TShader::IDataBindingFactory* -CFogVolumePlaneShader::Initialize(boo::ID3DDataFactory::Context& ctx) +CFogVolumePlaneShader::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -66,7 +66,7 @@ CFogVolumePlaneShader::Initialize(boo::ID3DDataFactory::Context& ctx) } template <> -void CFogVolumePlaneShader::Shutdown() +void CFogVolumePlaneShader::Shutdown() { s_VtxFmt.reset(); s_Pipelines[0].reset(); diff --git a/Runtime/Graphics/Shaders/CLineRendererShaders.cpp b/Runtime/Graphics/Shaders/CLineRendererShaders.cpp index 2b2001aef..c9e11adb4 100644 --- a/Runtime/Graphics/Shaders/CLineRendererShaders.cpp +++ b/Runtime/Graphics/Shaders/CLineRendererShaders.cpp @@ -27,7 +27,7 @@ void CLineRendererShaders::Initialize() if (!CGraphics::g_BooFactory) return; - CGraphicsCommitResources( + CGraphics::CommitResources( [&](boo::IGraphicsDataFactory::Context& ctx) { switch (ctx.platform()) @@ -39,8 +39,7 @@ void CLineRendererShaders::Initialize() #endif #if _WIN32 case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: - m_bindFactory.reset(Initialize(static_cast(ctx))); + m_bindFactory.reset(Initialize(static_cast(ctx))); break; #endif #if BOO_HAS_METAL @@ -56,7 +55,7 @@ void CLineRendererShaders::Initialize() default: break; } return true; - }); + } BooTrace); } void CLineRendererShaders::Shutdown() diff --git a/Runtime/Graphics/Shaders/CLineRendererShaders.hpp b/Runtime/Graphics/Shaders/CLineRendererShaders.hpp index 4849a6365..ed4c1ff69 100644 --- a/Runtime/Graphics/Shaders/CLineRendererShaders.hpp +++ b/Runtime/Graphics/Shaders/CLineRendererShaders.hpp @@ -48,7 +48,7 @@ public: static IDataBindingFactory* Initialize(boo::GLDataFactory::Context& ctx); #endif #if _WIN32 - static IDataBindingFactory* Initialize(boo::ID3DDataFactory::Context& ctx); + static IDataBindingFactory* Initialize(boo::D3DDataFactory::Context& ctx); #endif #if BOO_HAS_METAL static IDataBindingFactory* Initialize(boo::MetalDataFactory::Context& ctx); diff --git a/Runtime/Graphics/Shaders/CLineRendererShadersGLSL.cpp b/Runtime/Graphics/Shaders/CLineRendererShadersGLSL.cpp index 8c182e17c..4ce6faa8b 100644 --- a/Runtime/Graphics/Shaders/CLineRendererShadersGLSL.cpp +++ b/Runtime/Graphics/Shaders/CLineRendererShadersGLSL.cpp @@ -28,7 +28,7 @@ BOO_GLSL_BINDING_HEAD "{\n" " vtf.color = colorIn * moduColor;\n" " vtf.uv = uvIn.xy;\n" -" gl_Position = FLIPFROMGL(posIn);\n" +" gl_Position = posIn;\n" "}\n"; static const char* FS_GLSL_TEX = @@ -68,7 +68,7 @@ BOO_GLSL_BINDING_HEAD "void main()\n" "{\n" " vtf.color = colorIn * moduColor;\n" -" gl_Position = FLIPFROMGL(posIn);\n" +" gl_Position = posIn;\n" "}\n"; static const char* FS_GLSL_NOTEX = diff --git a/Runtime/Graphics/Shaders/CLineRendererShadersHLSL.cpp b/Runtime/Graphics/Shaders/CLineRendererShadersHLSL.cpp index bd9e31227..ac16db0a1 100644 --- a/Runtime/Graphics/Shaders/CLineRendererShadersHLSL.cpp +++ b/Runtime/Graphics/Shaders/CLineRendererShadersHLSL.cpp @@ -123,7 +123,7 @@ struct HLSLLineDataBindingFactory : CLineRendererShaders::IDataBindingFactory } }; -CLineRendererShaders::IDataBindingFactory* CLineRendererShaders::Initialize(boo::ID3DDataFactory::Context& ctx) +CLineRendererShaders::IDataBindingFactory* CLineRendererShaders::Initialize(boo::D3DDataFactory::Context& ctx) { static const boo::VertexElementDescriptor VtxFmtTex[] = { diff --git a/Runtime/Graphics/Shaders/CMapSurfaceShaderHLSL.cpp b/Runtime/Graphics/Shaders/CMapSurfaceShaderHLSL.cpp index 99e44a894..ac581e7f6 100644 --- a/Runtime/Graphics/Shaders/CMapSurfaceShaderHLSL.cpp +++ b/Runtime/Graphics/Shaders/CMapSurfaceShaderHLSL.cpp @@ -52,7 +52,7 @@ struct CMapSurfaceShaderD3DDataBindingFactory : TShader::IDat BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CMapSurfaceShader& filter) { - boo::ID3DDataFactory::Context& cctx = static_cast(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBuf.get()}; filter.m_dataBind = cctx.newShaderDataBinding(s_Pipeline, s_VtxFmt, @@ -63,7 +63,7 @@ struct CMapSurfaceShaderD3DDataBindingFactory : TShader::IDat }; TShader::IDataBindingFactory* -CMapSurfaceShader::Initialize(boo::ID3DDataFactory::Context& ctx) +CMapSurfaceShader::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -72,12 +72,12 @@ CMapSurfaceShader::Initialize(boo::ID3DDataFactory::Context& ctx) s_VtxFmt = ctx.newVertexFormat(1, VtxVmt); s_Pipeline = ctx.newShaderPipeline(VS, FS, nullptr, nullptr, nullptr, s_VtxFmt, boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, - boo::ZTest::None, false, true, false, boo::CullMode::Backface); + boo::ZTest::GEqual, false, true, false, boo::CullMode::Backface); return new CMapSurfaceShaderD3DDataBindingFactory; } template <> -void CMapSurfaceShader::Shutdown() +void CMapSurfaceShader::Shutdown() { s_VtxFmt.reset(); s_Pipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CModelShaders.cpp b/Runtime/Graphics/Shaders/CModelShaders.cpp index 5abbbd19b..2bd8eb4fe 100644 --- a/Runtime/Graphics/Shaders/CModelShaders.cpp +++ b/Runtime/Graphics/Shaders/CModelShaders.cpp @@ -65,7 +65,6 @@ CModelShaders::GetShaderExtensions(boo::IGraphicsDataFactory::Platform plat) #endif #if _WIN32 case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: return GetShaderExtensionsHLSL(plat); #endif #if BOO_HAS_METAL diff --git a/Runtime/Graphics/Shaders/CParticleSwooshShadersHLSL.cpp b/Runtime/Graphics/Shaders/CParticleSwooshShadersHLSL.cpp index 22fc87787..2865191c6 100644 --- a/Runtime/Graphics/Shaders/CParticleSwooshShadersHLSL.cpp +++ b/Runtime/Graphics/Shaders/CParticleSwooshShadersHLSL.cpp @@ -82,7 +82,7 @@ struct D3DParticleSwooshDataBindingFactory : TShader::ID } }; -TShader::IDataBindingFactory* CParticleSwooshShaders::Initialize(boo::ID3DDataFactory::Context& ctx) +TShader::IDataBindingFactory* CParticleSwooshShaders::Initialize(boo::D3DDataFactory::Context& ctx) { static const boo::VertexElementDescriptor VtxFmt[] = { @@ -130,7 +130,7 @@ TShader::IDataBindingFactory* CParticleSwooshShaders::In } template <> -void CParticleSwooshShaders::Shutdown() +void CParticleSwooshShaders::Shutdown() { m_vtxFormat.reset(); diff --git a/Runtime/Graphics/Shaders/CPhazonSuitFilter.cpp b/Runtime/Graphics/Shaders/CPhazonSuitFilter.cpp index d0412f8a4..fc7c7038c 100644 --- a/Runtime/Graphics/Shaders/CPhazonSuitFilter.cpp +++ b/Runtime/Graphics/Shaders/CPhazonSuitFilter.cpp @@ -10,7 +10,7 @@ void CPhazonSuitFilter::drawBlurPasses(float radius, const CTexture* indTex) if (!m_dataBind || indTex != m_indTex) { m_indTex = indTex; - CGraphicsCommitResources([this](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([this](boo::IGraphicsDataFactory::Context& ctx) { m_uniBufBlurX = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(zeus::CVector4f), 1); m_uniBufBlurY = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(zeus::CVector4f), 1); @@ -47,7 +47,7 @@ void CPhazonSuitFilter::drawBlurPasses(float radius, const CTexture* indTex) m_dataBind = TShader::BuildShaderDataBinding(ctx, *this); return true; - }); + } BooTrace); } SClipScreenRect rect; diff --git a/Runtime/Graphics/Shaders/CPhazonSuitFilterHLSL.cpp b/Runtime/Graphics/Shaders/CPhazonSuitFilterHLSL.cpp index b5879179c..1897e08cb 100644 --- a/Runtime/Graphics/Shaders/CPhazonSuitFilterHLSL.cpp +++ b/Runtime/Graphics/Shaders/CPhazonSuitFilterHLSL.cpp @@ -173,7 +173,7 @@ struct CPhazonSuitFilterD3DDataBindingFactory : TShader::IDat BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CPhazonSuitFilter& filter) { - boo::ID3DDataFactory::Context& cctx = static_cast(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBufBlurX.get()}; boo::PipelineStage stages[] = {boo::PipelineStage::Vertex}; @@ -225,7 +225,7 @@ struct CPhazonSuitFilterD3DDataBindingFactory : TShader::IDat }; TShader::IDataBindingFactory* -CPhazonSuitFilter::Initialize(boo::ID3DDataFactory::Context& ctx) +CPhazonSuitFilter::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -254,7 +254,7 @@ CPhazonSuitFilter::Initialize(boo::ID3DDataFactory::Context& ctx) } template <> -void CPhazonSuitFilter::Shutdown() +void CPhazonSuitFilter::Shutdown() { s_VtxFmt.reset(); s_BlurVtxFmt.reset(); diff --git a/Runtime/Graphics/Shaders/CRadarPaintShader.cpp b/Runtime/Graphics/Shaders/CRadarPaintShader.cpp index 244b4a8a6..e181645b8 100644 --- a/Runtime/Graphics/Shaders/CRadarPaintShader.cpp +++ b/Runtime/Graphics/Shaders/CRadarPaintShader.cpp @@ -12,13 +12,13 @@ void CRadarPaintShader::draw(const std::vector& instances, const CText { m_maxInsts = instances.size(); m_tex = tex; - CGraphicsCommitResources([this](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([this](boo::IGraphicsDataFactory::Context& ctx) { m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(Instance), m_maxInsts); m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(zeus::CMatrix4f), 1); m_dataBind = TShader::BuildShaderDataBinding(ctx, *this); return true; - }); + } BooTrace); } zeus::CMatrix4f uniMtx = CGraphics::GetPerspectiveProjectionMatrix(true) * CGraphics::g_GXModelView.toMatrix4f(); diff --git a/Runtime/Graphics/Shaders/CRadarPaintShaderHLSL.cpp b/Runtime/Graphics/Shaders/CRadarPaintShaderHLSL.cpp index fb062690c..5d08113f7 100644 --- a/Runtime/Graphics/Shaders/CRadarPaintShaderHLSL.cpp +++ b/Runtime/Graphics/Shaders/CRadarPaintShaderHLSL.cpp @@ -60,7 +60,7 @@ struct CRadarPaintShaderD3DDataBindingFactory : TShader::IDat BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CRadarPaintShader& filter) { - boo::ID3DDataFactory::Context& cctx = static_cast(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBuf.get()}; boo::ObjToken texs[] = {filter.m_tex->GetBooTexture()}; @@ -71,7 +71,7 @@ struct CRadarPaintShaderD3DDataBindingFactory : TShader::IDat }; TShader::IDataBindingFactory* -CRadarPaintShader::Initialize(boo::ID3DDataFactory::Context& ctx) +CRadarPaintShader::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -94,7 +94,7 @@ CRadarPaintShader::Initialize(boo::ID3DDataFactory::Context& ctx) } template <> -void CRadarPaintShader::Shutdown() +void CRadarPaintShader::Shutdown() { s_VtxFmt.reset(); s_Pipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CRandomStaticFilter.cpp b/Runtime/Graphics/Shaders/CRandomStaticFilter.cpp index 71d8ef3dd..38c80abba 100644 --- a/Runtime/Graphics/Shaders/CRandomStaticFilter.cpp +++ b/Runtime/Graphics/Shaders/CRandomStaticFilter.cpp @@ -9,7 +9,7 @@ namespace urde CRandomStaticFilter::CRandomStaticFilter(EFilterType type, bool cookieCutter) : m_cookieCutter(cookieCutter) { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { struct Vert { @@ -26,7 +26,7 @@ CRandomStaticFilter::CRandomStaticFilter(EFilterType type, bool cookieCutter) m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1); m_dataBind = TMultiBlendShader::BuildShaderDataBinding(ctx, type, *this); return true; - }); + } BooTrace); } void CRandomStaticFilter::draw(const zeus::CColor& color, float t) diff --git a/Runtime/Graphics/Shaders/CRandomStaticFilterHLSL.cpp b/Runtime/Graphics/Shaders/CRandomStaticFilterHLSL.cpp index 3d90dc339..c0f85ecbb 100644 --- a/Runtime/Graphics/Shaders/CRandomStaticFilterHLSL.cpp +++ b/Runtime/Graphics/Shaders/CRandomStaticFilterHLSL.cpp @@ -132,7 +132,7 @@ struct CRandomStaticFilterD3DDataBindingFactory : TMultiBlendShader(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBuf.get()}; boo::ObjToken texs[] = {g_Renderer->GetRandomStaticEntropyTex().get()}; @@ -143,7 +143,7 @@ struct CRandomStaticFilterD3DDataBindingFactory : TMultiBlendShader::IDataBindingFactory* -CRandomStaticFilter::Initialize(boo::ID3DDataFactory::Context& ctx) +CRandomStaticFilter::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -171,7 +171,7 @@ CRandomStaticFilter::Initialize(boo::ID3DDataFactory::Context& ctx) } template <> -void CRandomStaticFilter::Shutdown() +void CRandomStaticFilter::Shutdown() { s_VtxFmt.reset(); s_AlphaPipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CScanLinesFilter.cpp b/Runtime/Graphics/Shaders/CScanLinesFilter.cpp index c402188d0..16ad64fab 100644 --- a/Runtime/Graphics/Shaders/CScanLinesFilter.cpp +++ b/Runtime/Graphics/Shaders/CScanLinesFilter.cpp @@ -6,12 +6,12 @@ namespace urde CScanLinesFilter::CScanLinesFilter(EFilterType type, bool even) : m_even(even) { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1); m_dataBind = TMultiBlendShader::BuildShaderDataBinding(ctx, type, *this); return true; - }); + } BooTrace); } void CScanLinesFilter::draw(const zeus::CColor& color) diff --git a/Runtime/Graphics/Shaders/CScanLinesFilterHLSL.cpp b/Runtime/Graphics/Shaders/CScanLinesFilterHLSL.cpp index 8f2aa5fff..c586de3e2 100644 --- a/Runtime/Graphics/Shaders/CScanLinesFilterHLSL.cpp +++ b/Runtime/Graphics/Shaders/CScanLinesFilterHLSL.cpp @@ -72,7 +72,7 @@ struct CScanLinesFilterD3DDataBindingFactory : TMultiBlendShader(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken vbo = filter.m_even ? g_Renderer->GetScanLinesEvenVBO().get() : g_Renderer->GetScanLinesOddVBO().get(); @@ -84,7 +84,7 @@ struct CScanLinesFilterD3DDataBindingFactory : TMultiBlendShader::IDataBindingFactory* -CScanLinesFilter::Initialize(boo::ID3DDataFactory::Context& ctx) +CScanLinesFilter::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -107,7 +107,7 @@ CScanLinesFilter::Initialize(boo::ID3DDataFactory::Context& ctx) } template <> -void CScanLinesFilter::Shutdown() +void CScanLinesFilter::Shutdown() { s_VtxFmt.reset(); s_AlphaPipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CSpaceWarpFilter.cpp b/Runtime/Graphics/Shaders/CSpaceWarpFilter.cpp index 89e50d8fb..d2ffccd6f 100644 --- a/Runtime/Graphics/Shaders/CSpaceWarpFilter.cpp +++ b/Runtime/Graphics/Shaders/CSpaceWarpFilter.cpp @@ -33,7 +33,7 @@ void CSpaceWarpFilter::GenerateWarpRampTex(boo::IGraphicsDataFactory::Context& c CSpaceWarpFilter::CSpaceWarpFilter() { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { GenerateWarpRampTex(ctx); struct Vert @@ -51,7 +51,7 @@ CSpaceWarpFilter::CSpaceWarpFilter() m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1); m_dataBind = TShader::BuildShaderDataBinding(ctx, *this); return true; - }); + } BooTrace); } void CSpaceWarpFilter::draw(const zeus::CVector3f& pt) diff --git a/Runtime/Graphics/Shaders/CSpaceWarpFilterHLSL.cpp b/Runtime/Graphics/Shaders/CSpaceWarpFilterHLSL.cpp index 21d4f7679..b1bbc1641 100644 --- a/Runtime/Graphics/Shaders/CSpaceWarpFilterHLSL.cpp +++ b/Runtime/Graphics/Shaders/CSpaceWarpFilterHLSL.cpp @@ -65,7 +65,7 @@ struct CSpaceWarpFilterD3DDataBindingFactory : TShader::IDataB BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CSpaceWarpFilter& filter) { - boo::ID3DDataFactory::Context& cctx = static_cast(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBuf.get()}; boo::ObjToken texs[] = {CGraphics::g_SpareTexture.get(), filter.m_warpTex.get()}; @@ -75,7 +75,7 @@ struct CSpaceWarpFilterD3DDataBindingFactory : TShader::IDataB } }; -TShader::IDataBindingFactory* CSpaceWarpFilter::Initialize(boo::ID3DDataFactory::Context& ctx) +TShader::IDataBindingFactory* CSpaceWarpFilter::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -91,7 +91,7 @@ TShader::IDataBindingFactory* CSpaceWarpFilter::Initialize(boo } template <> -void CSpaceWarpFilter::Shutdown() +void CSpaceWarpFilter::Shutdown() { s_VtxFmt.reset(); s_Pipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CTextSupportShaderHLSL.cpp b/Runtime/Graphics/Shaders/CTextSupportShaderHLSL.cpp index ead982ff5..efb7d102e 100644 --- a/Runtime/Graphics/Shaders/CTextSupportShaderHLSL.cpp +++ b/Runtime/Graphics/Shaders/CTextSupportShaderHLSL.cpp @@ -109,7 +109,7 @@ static const char* ImgFS = "}\n"; TMultiBlendShader::IDataBindingFactory* -CTextSupportShader::Initialize(boo::ID3DDataFactory::Context& ctx) +CTextSupportShader::Initialize(boo::D3DDataFactory::Context& ctx) { boo::VertexElementDescriptor TextVtxVmt[] = { @@ -169,7 +169,7 @@ CTextSupportShader::Initialize(boo::ID3DDataFactory::Context& ctx) } template <> -void CTextSupportShader::Shutdown() +void CTextSupportShader::Shutdown() { s_TextVtxFmt.reset(); s_TextAlphaPipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CTexturedQuadFilter.cpp b/Runtime/Graphics/Shaders/CTexturedQuadFilter.cpp index 13b4c77ad..4407f9332 100644 --- a/Runtime/Graphics/Shaders/CTexturedQuadFilter.cpp +++ b/Runtime/Graphics/Shaders/CTexturedQuadFilter.cpp @@ -15,13 +15,13 @@ CTexturedQuadFilter::CTexturedQuadFilter(EFilterType type, const boo::ObjTokenplatform() == boo::IGraphicsDataFactory::Platform::Vulkan; tex->setClampMode(boo::TextureClampMode::ClampToEdge); - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, 32, 16); m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1); m_dataBind = TMultiBlendShader::BuildShaderDataBinding(ctx, type, *this); return true; - }); + } BooTrace); } CTexturedQuadFilter::CTexturedQuadFilter(EFilterType type, @@ -157,13 +157,13 @@ URDE_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilter) CTexturedQuadFilterAlpha::CTexturedQuadFilterAlpha(EFilterType type, const boo::ObjToken& tex) : CTexturedQuadFilter(tex) { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, 32, 4); m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1); m_dataBind = TMultiBlendShader::BuildShaderDataBinding(ctx, type, *this); return true; - }); + } BooTrace); } CTexturedQuadFilterAlpha::CTexturedQuadFilterAlpha(EFilterType type, diff --git a/Runtime/Graphics/Shaders/CTexturedQuadFilterHLSL.cpp b/Runtime/Graphics/Shaders/CTexturedQuadFilterHLSL.cpp index 8ea606c24..fd6a94f74 100644 --- a/Runtime/Graphics/Shaders/CTexturedQuadFilterHLSL.cpp +++ b/Runtime/Graphics/Shaders/CTexturedQuadFilterHLSL.cpp @@ -142,7 +142,7 @@ struct CTexturedQuadFilterD3DDataBindingFactory : TMultiBlendShader(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBuf.get()}; boo::ObjToken texs[] = {filter.m_booTex.get()}; @@ -153,7 +153,7 @@ struct CTexturedQuadFilterD3DDataBindingFactory : TMultiBlendShader::IDataBindingFactory* -CTexturedQuadFilter::Initialize(boo::ID3DDataFactory::Context& ctx) +CTexturedQuadFilter::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -185,7 +185,7 @@ CTexturedQuadFilter::Initialize(boo::ID3DDataFactory::Context& ctx) } template <> -void CTexturedQuadFilter::Shutdown() +void CTexturedQuadFilter::Shutdown() { s_VtxFmt.reset(); s_AlphaPipeline.reset(); @@ -221,7 +221,7 @@ struct CTexturedQuadFilterAlphaD3DDataBindingFactory : TMultiBlendShader(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBuf.get()}; boo::ObjToken texs[] = {filter.m_booTex.get()}; @@ -232,7 +232,7 @@ struct CTexturedQuadFilterAlphaD3DDataBindingFactory : TMultiBlendShader::IDataBindingFactory* -CTexturedQuadFilterAlpha::Initialize(boo::ID3DDataFactory::Context& ctx) +CTexturedQuadFilterAlpha::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -256,7 +256,7 @@ CTexturedQuadFilterAlpha::Initialize(boo::ID3DDataFactory::Context& ctx) } template <> -void CTexturedQuadFilterAlpha::Shutdown() +void CTexturedQuadFilterAlpha::Shutdown() { s_AVtxFmt.reset(); s_AAlphaPipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CThermalColdFilter.cpp b/Runtime/Graphics/Shaders/CThermalColdFilter.cpp index 7d2d588e6..4f4cade75 100644 --- a/Runtime/Graphics/Shaders/CThermalColdFilter.cpp +++ b/Runtime/Graphics/Shaders/CThermalColdFilter.cpp @@ -6,7 +6,7 @@ namespace urde CThermalColdFilter::CThermalColdFilter() { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_shiftTex = ctx.newDynamicTexture(8, 4, boo::TextureFormat::RGBA8, boo::TextureClampMode::Repeat); @@ -25,7 +25,7 @@ CThermalColdFilter::CThermalColdFilter() m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1); m_dataBind = TShader::BuildShaderDataBinding(ctx, *this); return true; - }); + } BooTrace); setShift(0); setScale(0.f); diff --git a/Runtime/Graphics/Shaders/CThermalColdFilterHLSL.cpp b/Runtime/Graphics/Shaders/CThermalColdFilterHLSL.cpp index 8b1d949b7..c9d330dd9 100644 --- a/Runtime/Graphics/Shaders/CThermalColdFilterHLSL.cpp +++ b/Runtime/Graphics/Shaders/CThermalColdFilterHLSL.cpp @@ -86,7 +86,7 @@ struct CThermalColdFilterD3DDataBindingFactory : TShader::ID BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CThermalColdFilter& filter) { - boo::ID3DDataFactory::Context& cctx = static_cast(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBuf.get()}; boo::ObjToken texs[] = {CGraphics::g_SpareTexture.get(), filter.m_shiftTex.get()}; @@ -96,7 +96,7 @@ struct CThermalColdFilterD3DDataBindingFactory : TShader::ID } }; -TShader::IDataBindingFactory* CThermalColdFilter::Initialize(boo::ID3DDataFactory::Context& ctx) +TShader::IDataBindingFactory* CThermalColdFilter::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -112,7 +112,7 @@ TShader::IDataBindingFactory* CThermalColdFilter::Initialize } template <> -void CThermalColdFilter::Shutdown() +void CThermalColdFilter::Shutdown() { s_VtxFmt.reset(); s_Pipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CThermalHotFilter.cpp b/Runtime/Graphics/Shaders/CThermalHotFilter.cpp index e169ae46c..813564f6e 100644 --- a/Runtime/Graphics/Shaders/CThermalHotFilter.cpp +++ b/Runtime/Graphics/Shaders/CThermalHotFilter.cpp @@ -6,7 +6,7 @@ namespace urde CThermalHotFilter::CThermalHotFilter() { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { struct Vert { @@ -23,7 +23,7 @@ CThermalHotFilter::CThermalHotFilter() m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1); m_dataBind = TShader::BuildShaderDataBinding(ctx, *this); return true; - }); + } BooTrace); } void CThermalHotFilter::draw() diff --git a/Runtime/Graphics/Shaders/CThermalHotFilterHLSL.cpp b/Runtime/Graphics/Shaders/CThermalHotFilterHLSL.cpp index 5e2b9a7e9..9a2bb32f0 100644 --- a/Runtime/Graphics/Shaders/CThermalHotFilterHLSL.cpp +++ b/Runtime/Graphics/Shaders/CThermalHotFilterHLSL.cpp @@ -63,7 +63,7 @@ struct CThermalHotFilterD3DDataBindingFactory : TShader::IDat BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CThermalHotFilter& filter) { - boo::ID3DDataFactory::Context& cctx = static_cast(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBuf.get()}; boo::ObjToken texs[] = {CGraphics::g_SpareTexture.get(), g_Renderer->GetThermoPalette().get()}; @@ -73,7 +73,7 @@ struct CThermalHotFilterD3DDataBindingFactory : TShader::IDat } }; -TShader::IDataBindingFactory* CThermalHotFilter::Initialize(boo::ID3DDataFactory::Context& ctx) +TShader::IDataBindingFactory* CThermalHotFilter::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -89,7 +89,7 @@ TShader::IDataBindingFactory* CThermalHotFilter::Initialize(b } template <> -void CThermalHotFilter::Shutdown() +void CThermalHotFilter::Shutdown() { s_VtxFmt.reset(); s_Pipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CWorldShadowShader.cpp b/Runtime/Graphics/Shaders/CWorldShadowShader.cpp index 9cda80c2a..0b1118807 100644 --- a/Runtime/Graphics/Shaders/CWorldShadowShader.cpp +++ b/Runtime/Graphics/Shaders/CWorldShadowShader.cpp @@ -6,14 +6,14 @@ namespace urde CWorldShadowShader::CWorldShadowShader(u32 w, u32 h) : m_w(w), m_h(h) { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, 16, 4); m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1); TShader::BuildShaderDataBinding(ctx, *this); m_tex = ctx.newRenderTexture(m_w, m_h, boo::TextureClampMode::ClampToWhite, 1, 0); return true; - }); + } BooTrace); } void CWorldShadowShader::bindRenderTarget() diff --git a/Runtime/Graphics/Shaders/CWorldShadowShaderHLSL.cpp b/Runtime/Graphics/Shaders/CWorldShadowShaderHLSL.cpp index 67d75b2b1..ab391e0a1 100644 --- a/Runtime/Graphics/Shaders/CWorldShadowShaderHLSL.cpp +++ b/Runtime/Graphics/Shaders/CWorldShadowShaderHLSL.cpp @@ -53,7 +53,7 @@ struct CWorldShadowShaderD3DDataBindingFactory : TShader::ID BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CWorldShadowShader& filter) { - boo::ID3DDataFactory::Context& cctx = static_cast(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBuf.get()}; filter.m_dataBind = cctx.newShaderDataBinding(s_Pipeline, s_VtxFmt, @@ -67,7 +67,7 @@ struct CWorldShadowShaderD3DDataBindingFactory : TShader::ID }; TShader::IDataBindingFactory* -CWorldShadowShader::Initialize(boo::ID3DDataFactory::Context& ctx) +CWorldShadowShader::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -84,7 +84,7 @@ CWorldShadowShader::Initialize(boo::ID3DDataFactory::Context& ctx) } template <> -void CWorldShadowShader::Shutdown() +void CWorldShadowShader::Shutdown() { s_VtxFmt.reset(); s_Pipeline.reset(); diff --git a/Runtime/Graphics/Shaders/CXRayBlurFilter.cpp b/Runtime/Graphics/Shaders/CXRayBlurFilter.cpp index 819bfbb70..a2b1df255 100644 --- a/Runtime/Graphics/Shaders/CXRayBlurFilter.cpp +++ b/Runtime/Graphics/Shaders/CXRayBlurFilter.cpp @@ -9,7 +9,7 @@ namespace urde CXRayBlurFilter::CXRayBlurFilter(TLockedToken& tex) : m_paletteTex(tex), m_booTex(tex->GetPaletteTexture()) { - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { struct Vert { @@ -26,7 +26,7 @@ CXRayBlurFilter::CXRayBlurFilter(TLockedToken& tex) m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1); m_dataBind = TShader::BuildShaderDataBinding(ctx, *this); return true; - }); + } BooTrace); } void CXRayBlurFilter::draw(float amount) diff --git a/Runtime/Graphics/Shaders/CXRayBlurFilterHLSL.cpp b/Runtime/Graphics/Shaders/CXRayBlurFilterHLSL.cpp index fe5e533a5..179fcab46 100644 --- a/Runtime/Graphics/Shaders/CXRayBlurFilterHLSL.cpp +++ b/Runtime/Graphics/Shaders/CXRayBlurFilterHLSL.cpp @@ -102,7 +102,7 @@ struct CXRayBlurFilterD3DDataBindingFactory : TShader::IDataBin BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CXRayBlurFilter& filter) { - boo::ID3DDataFactory::Context& cctx = static_cast(ctx); + boo::D3DDataFactory::Context& cctx = static_cast(ctx); boo::ObjToken bufs[] = {filter.m_uniBuf.get()}; boo::ObjToken texs[] = {CGraphics::g_SpareTexture.get(), filter.m_booTex.get()}; @@ -112,7 +112,7 @@ struct CXRayBlurFilterD3DDataBindingFactory : TShader::IDataBin } }; -TShader::IDataBindingFactory* CXRayBlurFilter::Initialize(boo::ID3DDataFactory::Context& ctx) +TShader::IDataBindingFactory* CXRayBlurFilter::Initialize(boo::D3DDataFactory::Context& ctx) { const boo::VertexElementDescriptor VtxVmt[] = { @@ -128,7 +128,7 @@ TShader::IDataBindingFactory* CXRayBlurFilter::Initialize(boo:: } template <> -void CXRayBlurFilter::Shutdown() +void CXRayBlurFilter::Shutdown() { s_VtxFmt.reset(); s_Pipeline.reset(); diff --git a/Runtime/Graphics/Shaders/TMultiBlendShader.hpp b/Runtime/Graphics/Shaders/TMultiBlendShader.hpp index 752e9e9ce..586e3d6bc 100644 --- a/Runtime/Graphics/Shaders/TMultiBlendShader.hpp +++ b/Runtime/Graphics/Shaders/TMultiBlendShader.hpp @@ -29,7 +29,7 @@ public: if (!CGraphics::g_BooFactory) return; - CGraphicsCommitResources( + CGraphics::CommitResources( [&](boo::IGraphicsDataFactory::Context& ctx) { switch (ctx.platform()) @@ -41,8 +41,7 @@ public: #endif #if _WIN32 case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: - m_bindFactory.reset(ShaderImp::Initialize(static_cast(ctx))); + m_bindFactory.reset(ShaderImp::Initialize(static_cast(ctx))); break; #endif #if BOO_HAS_METAL @@ -58,7 +57,7 @@ public: default: break; } return true; - }); + } BooTrace); } static void Shutdown() @@ -72,8 +71,7 @@ public: #endif #if _WIN32 case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: - ShaderImp::template Shutdown(); + ShaderImp::template Shutdown(); break; #endif #if BOO_HAS_METAL diff --git a/Runtime/Graphics/Shaders/TMultiBlendShaderDecl.hpp b/Runtime/Graphics/Shaders/TMultiBlendShaderDecl.hpp index 0e1c1f7af..3a41aee18 100644 --- a/Runtime/Graphics/Shaders/TMultiBlendShaderDecl.hpp +++ b/Runtime/Graphics/Shaders/TMultiBlendShaderDecl.hpp @@ -2,7 +2,7 @@ static TMultiBlendShader<_CLS>::IDataBindingFactory* Initialize(boo::GLDataFactory::Context& ctx); #endif #if _WIN32 -static TMultiBlendShader<_CLS>::IDataBindingFactory* Initialize(boo::ID3DDataFactory::Context& ctx); +static TMultiBlendShader<_CLS>::IDataBindingFactory* Initialize(boo::D3DDataFactory::Context& ctx); #endif #if BOO_HAS_METAL static TMultiBlendShader<_CLS>::IDataBindingFactory* Initialize(boo::MetalDataFactory::Context& ctx); diff --git a/Runtime/Graphics/Shaders/TShader.hpp b/Runtime/Graphics/Shaders/TShader.hpp index 5a9aa9be5..8fc6aa9f1 100644 --- a/Runtime/Graphics/Shaders/TShader.hpp +++ b/Runtime/Graphics/Shaders/TShader.hpp @@ -28,7 +28,7 @@ public: if (!CGraphics::g_BooFactory) return; - CGraphicsCommitResources( + CGraphics::CommitResources( [&](boo::IGraphicsDataFactory::Context& ctx) { switch (ctx.platform()) @@ -40,8 +40,7 @@ public: #endif #if _WIN32 case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: - m_bindFactory.reset(ShaderImp::Initialize(static_cast(ctx))); + m_bindFactory.reset(ShaderImp::Initialize(static_cast(ctx))); break; #endif #if BOO_HAS_METAL @@ -57,7 +56,7 @@ public: default: break; } return true; - }); + } BooTrace); } static void Shutdown() @@ -71,8 +70,7 @@ public: #endif #if _WIN32 case boo::IGraphicsDataFactory::Platform::D3D11: - case boo::IGraphicsDataFactory::Platform::D3D12: - ShaderImp::template Shutdown(); + ShaderImp::template Shutdown(); break; #endif #if BOO_HAS_METAL diff --git a/Runtime/Graphics/Shaders/TShaderDecl.hpp b/Runtime/Graphics/Shaders/TShaderDecl.hpp index 77b8086c6..60517250b 100644 --- a/Runtime/Graphics/Shaders/TShaderDecl.hpp +++ b/Runtime/Graphics/Shaders/TShaderDecl.hpp @@ -2,7 +2,7 @@ static TShader<_CLS>::IDataBindingFactory* Initialize(boo::GLDataFactory::Context& ctx); #endif #if _WIN32 -static TShader<_CLS>::IDataBindingFactory* Initialize(boo::ID3DDataFactory::Context& ctx); +static TShader<_CLS>::IDataBindingFactory* Initialize(boo::D3DDataFactory::Context& ctx); #endif #if BOO_HAS_METAL static TShader<_CLS>::IDataBindingFactory* Initialize(boo::MetalDataFactory::Context& ctx); diff --git a/Runtime/GuiSys/CCompoundTargetReticle.cpp b/Runtime/GuiSys/CCompoundTargetReticle.cpp index 16196584b..cf41fd6c0 100644 --- a/Runtime/GuiSys/CCompoundTargetReticle.cpp +++ b/Runtime/GuiSys/CCompoundTargetReticle.cpp @@ -55,7 +55,7 @@ CCompoundTargetReticle::CCompoundTargetReticle(const CStateManager& mgr) CCompoundTargetReticle::SScanReticuleRenderer::SScanReticuleRenderer() { - CGraphicsCommitResources([this](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([this](boo::IGraphicsDataFactory::Context& ctx) { for (int i=0 ; i<2 ; ++i) { @@ -64,7 +64,7 @@ CCompoundTargetReticle::SScanReticuleRenderer::SScanReticuleRenderer() m_stripRenderers[i][j].emplace(ctx, CLineRenderer::EPrimitiveMode::LineStrip, 4, nullptr, true, true); } return true; - }); + } BooTrace); } CCompoundTargetReticle::EReticleState CCompoundTargetReticle::GetDesiredReticleState(const CStateManager& mgr) const diff --git a/Runtime/GuiSys/CDrawStringOptions.cpp b/Runtime/GuiSys/CDrawStringOptions.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/GuiSys/CGuiSliderGroup.cpp b/Runtime/GuiSys/CGuiSliderGroup.cpp index 1055a50eb..7a7d91755 100644 --- a/Runtime/GuiSys/CGuiSliderGroup.cpp +++ b/Runtime/GuiSys/CGuiSliderGroup.cpp @@ -118,7 +118,7 @@ bool CGuiSliderGroup::AddWorkerWidget(CGuiWidget* worker) return true; } -CGuiWidget* CGuiSliderGroup::GetWorkerWidget(int id) +CGuiWidget* CGuiSliderGroup::GetWorkerWidget(int id) const { if (id < 0 || id > 1) return nullptr; diff --git a/Runtime/GuiSys/CGuiSliderGroup.hpp b/Runtime/GuiSys/CGuiSliderGroup.hpp index 035821aa6..60aaa9019 100644 --- a/Runtime/GuiSys/CGuiSliderGroup.hpp +++ b/Runtime/GuiSys/CGuiSliderGroup.hpp @@ -54,7 +54,7 @@ public: void Update(float dt); bool AddWorkerWidget(CGuiWidget* worker); - CGuiWidget* GetWorkerWidget(int id); + CGuiWidget* GetWorkerWidget(int id) const; static std::shared_ptr Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp); }; diff --git a/Runtime/GuiSys/CMakeLists.txt b/Runtime/GuiSys/CMakeLists.txt index 324eed840..1af160716 100644 --- a/Runtime/GuiSys/CMakeLists.txt +++ b/Runtime/GuiSys/CMakeLists.txt @@ -21,7 +21,7 @@ set(GUISYS_SOURCES CSplashScreen.hpp CSplashScreen.cpp CGuiCompoundWidget.hpp CGuiCompoundWidget.cpp CSaveableState.hpp CSaveableState.cpp - CDrawStringOptions.hpp CDrawStringOptions.cpp + CDrawStringOptions.hpp CRasterFont.hpp CRasterFont.cpp CGuiGroup.hpp CGuiGroup.cpp CGuiWidgetIdDB.hpp CGuiWidgetIdDB.cpp diff --git a/Runtime/GuiSys/CRasterFont.hpp b/Runtime/GuiSys/CRasterFont.hpp index b556b02bb..f477c0523 100644 --- a/Runtime/GuiSys/CRasterFont.hpp +++ b/Runtime/GuiSys/CRasterFont.hpp @@ -86,6 +86,10 @@ public: : x0_(a), x1_(b), x4_(c), x8_fontSize(fontSize) { strcpy(xc_name, name); + (void)x0_; + (void)x1_; + (void)x4_; + (void)x8_fontSize; } }; diff --git a/Runtime/GuiSys/CTextExecuteBuffer.cpp b/Runtime/GuiSys/CTextExecuteBuffer.cpp index d6b4004f2..cf96b3fe0 100644 --- a/Runtime/GuiSys/CTextExecuteBuffer.cpp +++ b/Runtime/GuiSys/CTextExecuteBuffer.cpp @@ -79,7 +79,6 @@ std::list CTextExecuteBuffer::BuildRenderBufferPages(const ze for (auto it = x0_instList.begin() ; it != x0_instList.end() ;) { - const std::shared_ptr& inst = *it; CTextRenderBuffer rbuf(CTextRenderBuffer::EMode::AllocTally, df); { diff --git a/Runtime/GuiSys/CTextRenderBuffer.cpp b/Runtime/GuiSys/CTextRenderBuffer.cpp index 1dd52ae77..9f0fee1ad 100644 --- a/Runtime/GuiSys/CTextRenderBuffer.cpp +++ b/Runtime/GuiSys/CTextRenderBuffer.cpp @@ -54,7 +54,7 @@ void CTextRenderBuffer::CommitResources() for (BooFontCharacters& chs : m_fontCharacters) chs.m_font->GetTexture(); - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_uniBuf = CTextSupportShader::s_Uniforms.allocateBlock(CGraphics::g_BooFactory); auto uBufInfo = m_uniBuf.getBufferInfo(); @@ -167,7 +167,7 @@ void CTextRenderBuffer::CommitResources() } } return true; - }); + } BooTrace); } void CTextRenderBuffer::SetMode(EMode mode) diff --git a/Runtime/IOStreams.cpp b/Runtime/IOStreams.cpp index 5873dc732..da01a5f86 100644 --- a/Runtime/IOStreams.cpp +++ b/Runtime/IOStreams.cpp @@ -158,7 +158,8 @@ atUint64 CZipInputStream::readUBytesToBuf(void *buf, atUint64 len) x30_zstrm.avail_in = readSz; x30_zstrm.next_in = x24_compBuf.get(); } - if (inflate(&x30_zstrm, Z_NO_FLUSH) != Z_OK) + int inflateRet = inflate(&x30_zstrm, Z_NO_FLUSH); + if (inflateRet != Z_OK) break; } return x30_zstrm.total_out; diff --git a/Runtime/IObjectStore.hpp b/Runtime/IObjectStore.hpp index a7f8870a1..4250a9dae 100644 --- a/Runtime/IObjectStore.hpp +++ b/Runtime/IObjectStore.hpp @@ -13,6 +13,7 @@ class CToken; class IObjectStore { public: + virtual ~IObjectStore() = default; virtual CToken GetObj(const SObjectTag&, const CVParamTransfer&)=0; virtual CToken GetObj(const SObjectTag&)=0; virtual CToken GetObj(std::string_view)=0; diff --git a/Runtime/Input/CFinalInput.cpp b/Runtime/Input/CFinalInput.cpp index 75bb6793c..bb01b59ad 100644 --- a/Runtime/Input/CFinalInput.cpp +++ b/Runtime/Input/CFinalInput.cpp @@ -100,9 +100,9 @@ CFinalInput::CFinalInput(int cIdx, float dt, const boo::DolphinControllerState& static float KBToAnaLeftX(const CKeyboardMouseControllerData& data) { float retval = 0.0; - if (data.m_charKeys['a']) + if (data.m_charKeys[int('a')]) retval -= 1.0; - if (data.m_charKeys['d']) + if (data.m_charKeys[int('d')]) retval += 1.0; return retval; } @@ -110,9 +110,9 @@ static float KBToAnaLeftX(const CKeyboardMouseControllerData& data) static float KBToAnaLeftY(const CKeyboardMouseControllerData& data) { float retval = 0.0; - if (data.m_charKeys['s']) + if (data.m_charKeys[int('s')]) retval -= 1.0; - if (data.m_charKeys['w']) + if (data.m_charKeys[int('w')]) retval += 1.0; return retval; } @@ -120,9 +120,9 @@ static float KBToAnaLeftY(const CKeyboardMouseControllerData& data) static float KBToAnaRightX(const CKeyboardMouseControllerData& data) { float retval = 0.0; - if (data.m_charKeys['2']) + if (data.m_charKeys[int('2')]) retval -= 1.0; - if (data.m_charKeys['4']) + if (data.m_charKeys[int('4')]) retval += 1.0; return retval; } @@ -130,9 +130,9 @@ static float KBToAnaRightX(const CKeyboardMouseControllerData& data) static float KBToAnaRightY(const CKeyboardMouseControllerData& data) { float retval = 0.0; - if (data.m_charKeys['3']) + if (data.m_charKeys[int('3')]) retval -= 1.0; - if (data.m_charKeys['1']) + if (data.m_charKeys[int('1')]) retval += 1.0; return retval; } @@ -144,8 +144,8 @@ CFinalInput::CFinalInput(int cIdx, float dt, const CKeyboardMouseControllerData& , xc_anaLeftY(KBToAnaLeftY(data)) , x10_anaRightX(KBToAnaRightX(data)) , x14_anaRightY(KBToAnaRightY(data)) -, x18_anaLeftTrigger(data.m_charKeys['q'] ? 1.0 : 0.0) -, x1c_anaRightTrigger(data.m_charKeys['e'] ? 1.0 : 0.0) +, x18_anaLeftTrigger(data.m_charKeys[int('q')] ? 1.0 : 0.0) +, x1c_anaRightTrigger(data.m_charKeys[int('e')] ? 1.0 : 0.0) , x20_enableAnaLeftXP(DLARight() && !prevInput.DLARight()) , x20_enableAnaLeftNegXP(DLALeft() && !prevInput.DLALeft()) , x21_enableAnaLeftYP(DLAUp() && !prevInput.DLAUp()) @@ -157,12 +157,12 @@ CFinalInput::CFinalInput(int cIdx, float dt, const CKeyboardMouseControllerData& , x24_anaLeftTriggerP(DLTrigger() && !prevInput.DLTrigger()) , x28_anaRightTriggerP(DRTrigger() && !prevInput.DRTrigger()) , x2c_b24_A(data.m_mouseButtons[int(boo::EMouseButton::Primary)]) -, x2c_b25_B(data.m_charKeys[' ']) -, x2c_b26_X(data.m_charKeys['c']) +, x2c_b25_B(data.m_charKeys[int(' ')]) +, x2c_b26_X(data.m_charKeys[int('c')]) , x2c_b27_Y(data.m_mouseButtons[int(boo::EMouseButton::Secondary)]) -, x2c_b28_Z(data.m_charKeys['\t']) -, x2c_b29_L(data.m_charKeys['q']) -, x2c_b30_R(data.m_charKeys['e']) +, x2c_b28_Z(data.m_charKeys[int('\t')]) +, x2c_b29_L(data.m_charKeys[int('q')]) +, x2c_b30_R(data.m_charKeys[int('e')]) , x2c_b31_DPUp(data.m_specialKeys[int(boo::ESpecialKey::Up)]) , x2d_b24_DPRight(data.m_specialKeys[int(boo::ESpecialKey::Right)]) , x2d_b25_DPDown(data.m_specialKeys[int(boo::ESpecialKey::Down)]) diff --git a/Runtime/MP1/CInGameTweakManager.cpp b/Runtime/MP1/CInGameTweakManager.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/MP1/CMakeLists.txt b/Runtime/MP1/CMakeLists.txt index 869353120..06dcef4f4 100644 --- a/Runtime/MP1/CMakeLists.txt +++ b/Runtime/MP1/CMakeLists.txt @@ -9,7 +9,7 @@ endif() set(MP1_SOURCES CTweaks.hpp CTweaks.cpp - CInGameTweakManager.hpp CInGameTweakManager.cpp + CInGameTweakManager.hpp CGBASupport.hpp CGBASupport.cpp CMainFlow.hpp CMainFlow.cpp CMFGame.hpp CMFGame.cpp diff --git a/Runtime/MP1/CPlayMovie.cpp b/Runtime/MP1/CPlayMovie.cpp index 515576697..ddf5adcd5 100644 --- a/Runtime/MP1/CPlayMovie.cpp +++ b/Runtime/MP1/CPlayMovie.cpp @@ -23,7 +23,7 @@ bool CPlayMovie::IsResultsScreen(EWhichMovie which) CPlayMovie::CPlayMovie(EWhichMovie which) : CPlayMovieBase("CPlayMovie", kMovies[int(which)]), x18_which(which) { - + (void)x18_which; } diff --git a/Runtime/MP1/CSlideShow.cpp b/Runtime/MP1/CSlideShow.cpp index 39a99e1c0..627c38add 100644 --- a/Runtime/MP1/CSlideShow.cpp +++ b/Runtime/MP1/CSlideShow.cpp @@ -96,7 +96,7 @@ CIOWin::EMessageReturn CSlideShow::OnMessage(const CArchitectureMessage& msg, CA if (x134_29_) return EMessageReturn::RemoveIOWinAndExit; - float dt = MakeMsg::GetParmTimerTick(msg).x4_parm; + //float dt = MakeMsg::GetParmTimerTick(msg).x4_parm; switch (x14_phase) { diff --git a/Runtime/MP1/CSlideShow.hpp b/Runtime/MP1/CSlideShow.hpp index 7da1a1ce7..5840e92d9 100644 --- a/Runtime/MP1/CSlideShow.hpp +++ b/Runtime/MP1/CSlideShow.hpp @@ -56,6 +56,7 @@ public: private: Phase x14_phase = Phase::Zero; std::vector> x18_galleryTXTRDeps; + /* u32 x2c_ = 0; u32 x30_ = 0; u32 x34_ = 0; @@ -68,29 +69,36 @@ private: float x50_ = 0.f; float x54_ = 0.f; float x58_ = 0.f; + */ SSlideData x5c_slideA; SSlideData x90_slideB; std::unique_ptr xc4_textA; std::unique_ptr xc8_textB; + /* u32 xcc_ = 0; u32 xd4_ = 0; u32 xd8_ = 0; u32 xdc_ = 0; u32 xe0_ = 0; + */ CSfxHandle xe4_; + /* u32 xe8_ = 0; u32 xec_ = 0; u32 xf0_ = 0; u32 xf4_ = 0; + */ std::vector> xf8_stickTextures; /* (9 LStick, 9 CStick) */ std::vector x108_buttonTextures; /* (2L, 2R, 2B, 2Y) */ + /* u32 x11c_ = 0; u32 x120_ = 0; u32 x124_ = 0; float x128_ = 32.f; float x12c_ = 32.f; + */ float x130_; union diff --git a/Runtime/MP1/CTweaks.cpp b/Runtime/MP1/CTweaks.cpp index 6da8f0142..18aafdd0b 100644 --- a/Runtime/MP1/CTweaks.cpp +++ b/Runtime/MP1/CTweaks.cpp @@ -28,14 +28,6 @@ namespace MP1 static logvisor::Module Log("MP1::CTweaks"); -static const SObjectTag& IDFromFactory(CResFactory& factory, const char* name) -{ - const SObjectTag* tag = factory.GetResourceIdByName(name); - if (!tag) - Log.report(logvisor::Fatal, "Tweak Asset not found when loading... '%s'", name); - return *tag; -} - void CTweaks::RegisterTweaks(hecl::CVarManager* cvarMgr) { std::experimental::optional strm; diff --git a/Runtime/MP1/MP1.cpp b/Runtime/MP1/MP1.cpp index 4e7eefe55..30ac73f0e 100644 --- a/Runtime/MP1/MP1.cpp +++ b/Runtime/MP1/MP1.cpp @@ -57,7 +57,7 @@ #include "MP1OriginalIDs.hpp" #include "CStateManager.hpp" #include "World/CPlayer.hpp" -#include +#include namespace hecl { @@ -590,7 +590,7 @@ void CMain::UpdateDiscordPresence(CAssetId worldSTRG) } } -void CMain::HandleDiscordReady() +void CMain::HandleDiscordReady(const DiscordUser* request) { DiscordLog.report(logvisor::Info, "Discord Ready"); } diff --git a/Runtime/MP1/MP1.hpp b/Runtime/MP1/MP1.hpp index 715c064c0..7ce480f99 100644 --- a/Runtime/MP1/MP1.hpp +++ b/Runtime/MP1/MP1.hpp @@ -39,6 +39,8 @@ #include "World/CScriptMazeNode.hpp" #include "hecl/Console.hpp" +struct DiscordUser; + namespace urde { class IFactory; @@ -267,7 +269,7 @@ private: void InitializeSubsystems(const hecl::Runtime::FileStoreManager& storeMgr); static void InitializeDiscord(); static void ShutdownDiscord(); - static void HandleDiscordReady(); + static void HandleDiscordReady(const DiscordUser* request); static void HandleDiscordDisconnected(int errorCode, const char* message); static void HandleDiscordErrored(int errorCode, const char* message); diff --git a/Runtime/Particle/CDecal.cpp b/Runtime/Particle/CDecal.cpp index 3a8924524..08cce137c 100644 --- a/Runtime/Particle/CDecal.cpp +++ b/Runtime/Particle/CDecal.cpp @@ -32,7 +32,7 @@ CDecal::CDecal(const TToken& desc, const zeus::CTransform& xf else x5c_29_modelInvalid = true; - CGraphicsCommitResources([this](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([this](boo::IGraphicsDataFactory::Context& ctx) { for (int i=0 ; i<2 ; ++i) { @@ -45,7 +45,7 @@ CDecal::CDecal(const TToken& desc, const zeus::CTransform& xf CDecalShaders::BuildShaderDataBinding(ctx, decal); } return true; - }); + } BooTrace); } bool CDecal::InitQuad(CQuadDecal& quad, const SQuadDescr& desc) diff --git a/Runtime/Particle/CDecalDescription.cpp b/Runtime/Particle/CDecalDescription.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Particle/CElectricDescription.cpp b/Runtime/Particle/CElectricDescription.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Particle/CElementGen.cpp b/Runtime/Particle/CElementGen.cpp index 6bd01eac4..86f3940b8 100644 --- a/Runtime/Particle/CElementGen.cpp +++ b/Runtime/Particle/CElementGen.cpp @@ -234,7 +234,7 @@ CElementGen::CElementGen(const TToken& gen, size_t maxInsts = x26c_30_MBLR ? (m_maxMBSP * x90_MAXP) : x90_MAXP; maxInsts = (maxInsts == 0 ? 256 : maxInsts); - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { if (!x26c_31_LINE) { @@ -248,7 +248,7 @@ CElementGen::CElementGen(const TToken& gen, } CElementGenShaders::BuildShaderDataBinding(ctx, *this); return true; - }); + } BooTrace); } CElementGen::~CElementGen() @@ -382,6 +382,12 @@ void CElementGen::AccumulateBounds(zeus::CVector3f& pos, float size) void CElementGen::UpdateAdvanceAccessParameters(u32 activeParticleCount, u32 particleFrame) { + if (activeParticleCount >= x60_advValues.size()) + { + CParticleGlobals::g_particleAccessParameters = nullptr; + return; + } + CGenDescription* desc = x1c_genDesc.GetObj(); std::array& arr = x60_advValues[activeParticleCount]; @@ -436,7 +442,10 @@ void CElementGen::UpdateExistingParticles() x25c_activeParticleCount = 0; CParticleGlobals::SetEmitterTime(x74_curFrame); - CParticleGlobals::g_particleAccessParameters = &x60_advValues[x25c_activeParticleCount]; + if (x25c_activeParticleCount < x60_advValues.size()) + CParticleGlobals::g_particleAccessParameters = &x60_advValues[x25c_activeParticleCount]; + else + CParticleGlobals::g_particleAccessParameters = nullptr; for (auto it = x30_particles.begin(); it != x30_particles.end();) { @@ -1030,13 +1039,17 @@ void CElementGen::RenderModels(const CActorLights* actorLights) if (particle.x0_endFrame == -1) { - ++matrixIt; + if (x2c_orientType == EModelOrientationType::One) + ++matrixIt; continue; } CParticleGlobals::SetParticleLifetime(particle.x0_endFrame - particle.x28_startFrame); int partFrame = x74_curFrame - particle.x28_startFrame - 1; CParticleGlobals::UpdateParticleLifetimeTweenValues(partFrame); - CParticleGlobals::g_particleAccessParameters = &x60_advValues[i]; + if (i < x60_advValues.size()) + CParticleGlobals::g_particleAccessParameters = &x60_advValues[i]; + else + CParticleGlobals::g_particleAccessParameters = nullptr; CVectorElement* pmop = desc->x6c_x58_PMOP.get(); if (pmop) pmop->GetValue(partFrame, pmopVec); @@ -1154,7 +1167,8 @@ void CElementGen::RenderModels(const CActorLights* actorLights) } } - ++matrixIt; + if (x2c_orientType == EModelOrientationType::One) + ++matrixIt; } if (desc->x45_24_x31_26_PMUS) @@ -1376,7 +1390,7 @@ void CElementGen::RenderParticles() std::sort(sortItems.begin(), sortItems.end(), [](const CParticleListItem& a, const CParticleListItem& b) -> bool - {return a.x4_viewPoint[1] >= b.x4_viewPoint[1];}); + {return a.x4_viewPoint[1] > b.x4_viewPoint[1];}); } bool moveRedToAlphaBuffer = false; diff --git a/Runtime/Particle/CMakeLists.txt b/Runtime/Particle/CMakeLists.txt index 3df0ea25d..f33ef908d 100644 --- a/Runtime/Particle/CMakeLists.txt +++ b/Runtime/Particle/CMakeLists.txt @@ -9,10 +9,10 @@ set(PARTICLE_SOURCES CUVElement.hpp CUVElement.cpp CEmitterElement.hpp CEmitterElement.cpp CParticleDataFactory.hpp CParticleDataFactory.cpp - CSwooshDescription.hpp CSwooshDescription.cpp - CElectricDescription.hpp CElectricDescription.cpp - CDecalDescription.hpp CDecalDescription.cpp - CWeaponDescription.hpp CWeaponDescription.cpp + CSwooshDescription.hpp + CElectricDescription.hpp + CDecalDescription.hpp + CWeaponDescription.hpp CDecalDataFactory.hpp CDecalDataFactory.cpp CElementGen.hpp CElementGen.cpp CParticleSwooshDataFactory.hpp CParticleSwooshDataFactory.cpp @@ -24,7 +24,7 @@ set(PARTICLE_SOURCES CDecal.hpp CDecal.cpp CDecalManager.hpp CDecalManager.cpp CSpawnSystemKeyframeData.hpp CSpawnSystemKeyframeData.cpp - CWarp.hpp CWarp.cpp + CWarp.hpp CFlameWarp.hpp CFlameWarp.cpp CParticleGlobals.hpp CParticleGlobals.cpp ${PLAT_SRCS}) diff --git a/Runtime/Particle/CParticleSwoosh.cpp b/Runtime/Particle/CParticleSwoosh.cpp index 76c41dcba..7dda91948 100644 --- a/Runtime/Particle/CParticleSwoosh.cpp +++ b/Runtime/Particle/CParticleSwoosh.cpp @@ -69,13 +69,13 @@ CParticleSwoosh::CParticleSwoosh(const TToken& desc, int len { int maxVerts = x1b4_LENG * (x1b0_SPLN+1) * x1b8_SIDE * 4; m_cachedVerts.reserve(maxVerts); - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { m_vertBuf = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(CParticleSwooshShaders::Vert), maxVerts); m_uniformBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(zeus::CMatrix4f), 1); CParticleSwooshShaders::BuildShaderDataBinding(ctx, *this); return true; - }); + } BooTrace); } } } diff --git a/Runtime/Particle/CSwooshDescription.cpp b/Runtime/Particle/CSwooshDescription.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Particle/CWarp.cpp b/Runtime/Particle/CWarp.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Particle/CWeaponDescription.cpp b/Runtime/Particle/CWeaponDescription.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Weapon/CBeamInfo.cpp b/Runtime/Weapon/CBeamInfo.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/Weapon/CIceBeam.hpp b/Runtime/Weapon/CIceBeam.hpp index d514a664a..682496522 100644 --- a/Runtime/Weapon/CIceBeam.hpp +++ b/Runtime/Weapon/CIceBeam.hpp @@ -6,7 +6,7 @@ namespace urde { -class CIceBeam : public CGunWeapon +class CIceBeam final : public CGunWeapon { TCachedToken x21c_iceSmoke; TCachedToken x228_ice2nd1; diff --git a/Runtime/Weapon/CMakeLists.txt b/Runtime/Weapon/CMakeLists.txt index f25afc823..4c60a17d9 100644 --- a/Runtime/Weapon/CMakeLists.txt +++ b/Runtime/Weapon/CMakeLists.txt @@ -21,7 +21,7 @@ set(WEAPON_SOURCES CGameProjectile.hpp CGameProjectile.cpp CBeamProjectile.hpp CBeamProjectile.cpp CTargetableProjectile.hpp CTargetableProjectile.cpp - CBeamInfo.hpp CBeamInfo.cpp + CBeamInfo.hpp CPlasmaProjectile.hpp CPlasmaProjectile.cpp CEnergyProjectile.cpp CEnergyProjectile.cpp CProjectileWeapon.hpp CProjectileWeapon.cpp diff --git a/Runtime/Weapon/CPhazonBeam.hpp b/Runtime/Weapon/CPhazonBeam.hpp index 6588e5c5e..adf67b157 100644 --- a/Runtime/Weapon/CPhazonBeam.hpp +++ b/Runtime/Weapon/CPhazonBeam.hpp @@ -7,7 +7,7 @@ namespace urde { -class CPhazonBeam : public CGunWeapon +class CPhazonBeam final : public CGunWeapon { TCachedToken x21c_phazonVeins; std::unique_ptr x224_phazonVeinsData; diff --git a/Runtime/Weapon/CPlasmaBeam.hpp b/Runtime/Weapon/CPlasmaBeam.hpp index a91cdf5e3..ddf900f57 100644 --- a/Runtime/Weapon/CPlasmaBeam.hpp +++ b/Runtime/Weapon/CPlasmaBeam.hpp @@ -6,7 +6,7 @@ namespace urde { -class CPlasmaBeam : public CGunWeapon +class CPlasmaBeam final : public CGunWeapon { TCachedToken x21c_plasma2nd1; std::unique_ptr x228_chargeFx; diff --git a/Runtime/Weapon/CPowerBeam.hpp b/Runtime/Weapon/CPowerBeam.hpp index d6b64672d..c561dc676 100644 --- a/Runtime/Weapon/CPowerBeam.hpp +++ b/Runtime/Weapon/CPowerBeam.hpp @@ -6,7 +6,7 @@ namespace urde { -class CPowerBeam : public CGunWeapon +class CPowerBeam final : public CGunWeapon { enum class ESmokeState { diff --git a/Runtime/Weapon/CWaveBeam.hpp b/Runtime/Weapon/CWaveBeam.hpp index 690c5b3aa..0f496dcf5 100644 --- a/Runtime/Weapon/CWaveBeam.hpp +++ b/Runtime/Weapon/CWaveBeam.hpp @@ -6,7 +6,7 @@ namespace urde { -class CWaveBeam : public CGunWeapon +class CWaveBeam final : public CGunWeapon { TCachedToken x21c_waveBeam; TCachedToken x228_wave2nd1; diff --git a/Runtime/World/CActorModelParticles.cpp b/Runtime/World/CActorModelParticles.cpp index c66bc429f..e59896d15 100644 --- a/Runtime/World/CActorModelParticles.cpp +++ b/Runtime/World/CActorModelParticles.cpp @@ -54,7 +54,6 @@ void CActorModelParticles::CItem::GeneratePoints(const std::vector= 16 ? 16 : x84_); - zeus::CVector3f uVec = zeus::CVector3f::skUp; u32 idx = x80_; for (u32 i = 0; i < count; ++i) { diff --git a/Runtime/World/CAi.hpp b/Runtime/World/CAi.hpp index f471c3e76..cf5167590 100644 --- a/Runtime/World/CAi.hpp +++ b/Runtime/World/CAi.hpp @@ -52,7 +52,7 @@ public: virtual CHealthInfo* HealthInfo(CStateManager&) { return &x258_healthInfo; } virtual void Death(CStateManager&, const zeus::CVector3f&, EStateMsg)=0; virtual void KnockBack(const zeus::CVector3f&, CStateManager&, const CDamageInfo& info, EKnockBackType, bool, float)=0; - virtual CDamageVulnerability GetDamageVulnerability() { return x260_damageVulnerability; } + virtual const CDamageVulnerability* GetDamageVulnerability() const { return &x260_damageVulnerability; } virtual void TakeDamage(const zeus::CVector3f&, float) {} virtual bool CanBeShot(const CStateManager&, int) { return true; } virtual bool IsListening() const { return false; } diff --git a/Runtime/World/CDamageVulnerability.cpp b/Runtime/World/CDamageVulnerability.cpp index 4dd8ff0ef..1f36bc945 100644 --- a/Runtime/World/CDamageVulnerability.cpp +++ b/Runtime/World/CDamageVulnerability.cpp @@ -34,10 +34,6 @@ const CDamageVulnerability CDamageVulnerability::sPassThroughVulnerability( EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::DoubleDamage); -static inline bool is_normal_or_weak(EVulnerability vuln) -{ - return (vuln == EVulnerability::DoubleDamage || vuln == EVulnerability::Normal); -} static inline bool is_not_immune(EVulnerability vuln) { diff --git a/Runtime/World/CEnvFxManager.hpp b/Runtime/World/CEnvFxManager.hpp index 2c02e7d6e..0613a6eb9 100644 --- a/Runtime/World/CEnvFxManager.hpp +++ b/Runtime/World/CEnvFxManager.hpp @@ -27,7 +27,7 @@ enum class EPhazonType class CVectorFixed8_8 { - u16 x0_[3]; + //u16 x0_[3]; }; class CEnvFxManagerGrid diff --git a/Runtime/World/CFluidPlaneCPU.cpp b/Runtime/World/CFluidPlaneCPU.cpp index 77b32d440..d940d4d5b 100644 --- a/Runtime/World/CFluidPlaneCPU.cpp +++ b/Runtime/World/CFluidPlaneCPU.cpp @@ -198,7 +198,7 @@ CFluidPlaneCPU::RenderSetup(const CStateManager& mgr, float alpha, const zeus::C pttScale = g_tweakGame->GetFluidEnvBumpScale() * x4c_uvMotion.GetFluidLayers()[0].GetUVScale(); // Load GX_TEXMTX3 with identity - zeus::CMatrix4f& texMtx = out.texMtxs[nextTexMtx++]; + nextTexMtx++; // Load GX_PTTEXMTX0 with scale of pttScale // Next: GX_TG_MTX2x4 GX_TG_NRM, GX_TEXMTX3, true, GX_PTTEXMTX0 diff --git a/Runtime/World/CFluidPlaneCPU.hpp b/Runtime/World/CFluidPlaneCPU.hpp index 7d0589e9f..e14b26154 100644 --- a/Runtime/World/CFluidPlaneCPU.hpp +++ b/Runtime/World/CFluidPlaneCPU.hpp @@ -8,7 +8,7 @@ namespace urde { class CFluidUVMotion; -class CFluidPlaneCPU : public CFluidPlane +class CFluidPlaneCPU final : public CFluidPlane { class CTurbulence { diff --git a/Runtime/World/CFluidPlaneDoor.hpp b/Runtime/World/CFluidPlaneDoor.hpp index b7a35245f..40a37594c 100644 --- a/Runtime/World/CFluidPlaneDoor.hpp +++ b/Runtime/World/CFluidPlaneDoor.hpp @@ -6,7 +6,7 @@ namespace urde { -class CFluidPlaneDoor : public CFluidPlane +class CFluidPlaneDoor final : public CFluidPlane { float xa0_tileSize; int xa4_tileSubdivisions; @@ -36,4 +36,4 @@ public: } -#endif // __URDE_CFLUIDPLANEDOOR_HPP__ \ No newline at end of file +#endif // __URDE_CFLUIDPLANEDOOR_HPP__ diff --git a/Runtime/World/CGameArea.cpp b/Runtime/World/CGameArea.cpp index c49c4b9a2..937501d9c 100644 --- a/Runtime/World/CGameArea.cpp +++ b/Runtime/World/CGameArea.cpp @@ -296,7 +296,7 @@ static std::vector ReadDependencyList(CInputStream& in) std::pair, s32> GetScriptingMemoryAlways(const IGameArea& area) { SObjectTag tag = {SBIG('MREA'), area.IGetAreaAssetId()}; - std::unique_ptr data = std::move(g_ResFactory->LoadNewResourcePartSync(tag, 0, 96)); + std::unique_ptr data = g_ResFactory->LoadNewResourcePartSync(tag, 0, 96); if (*reinterpret_cast(data.get()) != SBIG(0xDEADBEEF)) return {}; @@ -326,7 +326,7 @@ std::pair, s32> GetScriptingMemoryAlways(const IGameArea& u32 dataLen = ROUND_UP_32(header.secCount * 4); - data = std::move(g_ResFactory->LoadNewResourcePartSync(tag, 96, dataLen)); + data = g_ResFactory->LoadNewResourcePartSync(tag, 96, dataLen); r = CMemoryInStream(data.get(), dataLen); @@ -1231,7 +1231,7 @@ void CGameArea::FillInStaticGeometry(bool textures) ++secIt; } - CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx) + CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { /* Shared geometry uniform buffer - one for normal render, one for shadow render */ for (int i=0 ; i<2 ; ++i) @@ -1288,7 +1288,7 @@ void CGameArea::FillInStaticGeometry(bool textures) } return true; - }); + } BooTrace); for (CMetroidModelInstance& inst : x12c_postConstructed->x4c_insts) { diff --git a/Runtime/World/CGameArea.hpp b/Runtime/World/CGameArea.hpp index 0888e3995..5f3a3cea6 100644 --- a/Runtime/World/CGameArea.hpp +++ b/Runtime/World/CGameArea.hpp @@ -39,7 +39,7 @@ struct SMREAHeader u32 arotSecIdx; }; -class CDummyGameArea : public IGameArea +class CDummyGameArea final : public IGameArea { friend class CDummyWorld; @@ -95,7 +95,7 @@ struct CAreaRenderOctTree void FindOverlappingModels(u32* out, const zeus::CAABox& testAABB) const; }; -class CGameArea : public IGameArea +class CGameArea final : public IGameArea { friend class CWorld; friend class CStateManager; diff --git a/Runtime/World/CMakeLists.txt b/Runtime/World/CMakeLists.txt index 8c4d75954..2e76f895d 100644 --- a/Runtime/World/CMakeLists.txt +++ b/Runtime/World/CMakeLists.txt @@ -19,14 +19,13 @@ set(WORLD_SOURCES CPathFindRegion.hpp CPathFindRegion.cpp CPathFindSearch.hpp CPathFindSearch.cpp CPathFindSpline.cpp - CPathFindDraw.hpp CPathFindDraw.cpp CPhysicsActor.hpp CPhysicsActor.cpp CEntity.hpp CEntity.cpp CPhysicsActor.hpp CPhysicsActor.cpp CWorldTransManager.hpp CWorldTransManager.cpp CEnvFxManager.hpp CEnvFxManager.cpp CActorModelParticles.hpp CActorModelParticles.cpp - CTeamAiTypes.hpp CTeamAiTypes.cpp + CTeamAiTypes.hpp ScriptObjectSupport.hpp ScriptObjectSupport.cpp ScriptLoader.hpp ScriptLoader.cpp CScriptActor.hpp CScriptActor.cpp @@ -89,7 +88,7 @@ set(WORLD_SOURCES CScriptGunTurret.hpp CScriptGunTurret.cpp CScriptCameraPitchVolume.hpp CScriptCameraPitchVolume.cpp CTeamAiMgr.hpp CTeamAiMgr.cpp - CSnakeWeedSwarm.hpp CSnakeWeedSwarm.cpp + CSnakeWeedSwarm.hpp CScriptSpindleCamera.hpp CScriptSpindleCamera.cpp CScriptCameraHintTrigger.hpp CScriptCameraHintTrigger.cpp CScriptBeam.hpp CScriptBeam.cpp diff --git a/Runtime/World/CPathFindDraw.cpp b/Runtime/World/CPathFindDraw.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/World/CPathFindDraw.hpp b/Runtime/World/CPathFindDraw.hpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/World/CPlayer.cpp b/Runtime/World/CPlayer.cpp index 186ed6e49..27a3a2ae7 100644 --- a/Runtime/World/CPlayer.cpp +++ b/Runtime/World/CPlayer.cpp @@ -81,8 +81,8 @@ CPlayer::CPlayer(TUniqueId uid, const zeus::CTransform& xf, const zeus::CAABox& const CMaterialList& ml) : CPhysicsActor(uid, true, "CPlayer", CEntityInfo(kInvalidAreaId, CEntity::NullConnectionList), xf, MakePlayerAnimRes(resId, playerScale), ml, aabb, SMoverData(mass), CActorParameters::None(), stepUp, - stepDown), x7d0_animRes(resId, 0, playerScale, 0, true), x2d8_fpBounds(aabb), - x7d8_beamScale(playerScale) + stepDown), x2d8_fpBounds(aabb), x7d0_animRes(resId, 0, playerScale, 0, true), + x7d8_beamScale(playerScale) { x490_gun.reset(new CPlayerGun(uid)); x49c_gunHolsterRemTime = g_tweakPlayerGun->GetGunNotFiringTime(); @@ -4489,7 +4489,6 @@ TUniqueId CPlayer::CheckEnemiesAgainstOrbitZone(const rstl::reserved_vector& ids, EPlayerZoneInfo info, CStateManager& mgr) const { zeus::CVector3f eyePos = GetEyePosition(); - zeus::CVector3f lookDir = x34_transform.basis[1].normalized(); float minEyeToOrbitMag = 10000.f; float minPosInBoxMagSq = 10000.f; TUniqueId bestId = kInvalidUniqueId; diff --git a/Runtime/World/CScriptCoverPoint.hpp b/Runtime/World/CScriptCoverPoint.hpp index 1eb89b055..0790d71cc 100644 --- a/Runtime/World/CScriptCoverPoint.hpp +++ b/Runtime/World/CScriptCoverPoint.hpp @@ -40,9 +40,9 @@ public: void Accept(IVisitor& visitor); void Think(float, CStateManager &); - void AddToRenderer(const zeus::CFrustum &, CStateManager &) {} + void AddToRenderer(const zeus::CFrustum &, const CStateManager &) const {} void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager &); - void Render(CStateManager &) {} + void Render(const CStateManager &) const {} std::experimental::optional GetTouchBounds() const; void SetInUse(bool inUse); bool GetInUse(TUniqueId uid) const; diff --git a/Runtime/World/CScriptSpiderBallWaypoint.hpp b/Runtime/World/CScriptSpiderBallWaypoint.hpp index 93fbfa84e..227b9bfa1 100644 --- a/Runtime/World/CScriptSpiderBallWaypoint.hpp +++ b/Runtime/World/CScriptSpiderBallWaypoint.hpp @@ -20,7 +20,7 @@ public: void Accept(IVisitor&); void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&); void Render(const CStateManager& mgr) const { CActor::Render(mgr); } - void AddToRenderer(const zeus::CFrustum&, const CStateManager&) {} + void AddToRenderer(const zeus::CFrustum&, const CStateManager&) const {} std::experimental::optional GetTouchBounds() const { return xfc_aabox; } void AccumulateBounds(const zeus::CVector3f& v); void BuildWaypointListAndBounds(CStateManager& mgr); @@ -34,4 +34,4 @@ public: }; } -#endif // __URDE_CSCRIPTSPIDERBALLWAYPOINT_HPP__ \ No newline at end of file +#endif // __URDE_CSCRIPTSPIDERBALLWAYPOINT_HPP__ diff --git a/Runtime/World/CSnakeWeedSwarm.cpp b/Runtime/World/CSnakeWeedSwarm.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Runtime/World/CTeamAiTypes.cpp b/Runtime/World/CTeamAiTypes.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/amuse b/amuse index e3c936648..77c7daa67 160000 --- a/amuse +++ b/amuse @@ -1 +1 @@ -Subproject commit e3c936648b40345997445326b95cfdda50dc32c8 +Subproject commit 77c7daa67c2077dcfd14b34aea3fa613c146d1ca diff --git a/assetnameparser/main.cpp b/assetnameparser/main.cpp index e7864af8d..c3a302736 100644 --- a/assetnameparser/main.cpp +++ b/assetnameparser/main.cpp @@ -83,68 +83,24 @@ static inline T bswap64(T val) #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -static inline int16_t SBig(int16_t val) {return bswap16(val);} -static inline uint16_t SBig(uint16_t val) {return bswap16(val);} -static inline int32_t SBig(int32_t val) {return bswap32(val);} static inline uint32_t SBig(uint32_t val) {return bswap32(val);} -static inline int64_t SBig(int64_t val) {return bswap64(val);} static inline uint64_t SBig(uint64_t val) {return bswap64(val);} -static inline float SBig(float val) -{ - int32_t ival = bswap32(*((int32_t*)(&val))); - return *((float*)(&ival)); -} -static inline double SBig(double val) -{ - int64_t ival = bswap64(*((int64_t*)(&val))); - return *((double*)(&ival)); -} #ifndef SBIG #define SBIG(q) ( ( (q) & 0x000000FF ) << 24 | ( (q) & 0x0000FF00 ) << 8 \ | ( (q) & 0x00FF0000 ) >> 8 | ( (q) & 0xFF000000 ) >> 24 ) #endif -static inline int16_t SLittle(int16_t val) {return val;} -static inline uint16_t SLittle(uint16_t val) {return val;} -static inline int32_t SLittle(int32_t val) {return val;} -static inline uint32_t SLittle(uint32_t val) {return val;} -static inline int64_t SLittle(int64_t val) {return val;} -static inline uint64_t SLittle(uint64_t val) {return val;} -static inline float SLittle(float val) {return val;} -static inline double SLittle(double val) {return val;} #ifndef SLITTLE #define SLITTLE(q) (q) #endif #else -static inline int16_t SLittle(int16_t val) {return bswap16(val);} -static inline uint16_t SLittle(uint16_t val) {return bswap16(val);} -static inline int32_t SLittle(int32_t val) {return bswap32(val);} -static inline uint32_t SLittle(uint32_t val) {return bswap32(val);} -static inline int64_t SLittle(int64_t val) {return bswap64(val);} -static inline uint64_t SLittle(uint64_t val) {return bswap64(val);} -static inline float SLittle(float val) -{ - int32_t ival = bswap32(*((int32_t*)(&val))); - return *((float*)(&ival)); -} -static inline double SLittle(double val) -{ - int64_t ival = bswap64(*((int64_t*)(&val))); - return *((double*)(&ival)); -} #ifndef SLITTLE #define SLITTLE(q) ( ( (q) & 0x000000FF ) << 24 | ( (q) & 0x0000FF00 ) << 8 \ | ( (q) & 0x00FF0000 ) >> 8 | ( (q) & 0xFF000000 ) >> 24 ) #endif -static inline int16_t SBig(int16_t val) {return val;} -static inline uint16_t SBig(uint16_t val) {return val;} -static inline int32_t SBig(int32_t val) {return val;} static inline uint32_t SBig(uint32_t val) {return val;} -static inline int64_t SBig(int64_t val) {return val;} static inline uint64_t SBig(uint64_t val) {return val;} -static inline float SBig(float val) {return val;} -static inline double SBig(double val) {return val;} #ifndef SBIG #define SBIG(q) (q) #endif @@ -197,7 +153,6 @@ enum class FileLockType #if IS_UCS2 typedef wchar_t SystemChar; -static inline size_t StrLen(const SystemChar* str) { return wcslen(str); } typedef std::wstring SystemString; #ifndef _S #define _S(val) L##val @@ -205,7 +160,6 @@ typedef std::wstring SystemString; typedef struct _stat Sstat; #else typedef char SystemChar; -static inline size_t StrLen(const SystemChar* str) { return strlen(str); } typedef std::string SystemString; #ifndef _S #define _S(val) val @@ -213,15 +167,6 @@ typedef std::string SystemString; typedef struct stat Sstat; #endif -static inline int StrCmp(const SystemChar* str1, const SystemChar* str2) -{ -#if IS_UCS2 - return wcscmp(str1, str2); -#else - return strcmp(str1, str2); -#endif -} - static inline FILE* Fopen(const SystemChar* path, const SystemChar* mode, FileLockType lock = FileLockType::None) { #if IS_UCS2 diff --git a/discord-rpc b/discord-rpc index b85758ec1..ba9fe00c4 160000 --- a/discord-rpc +++ b/discord-rpc @@ -1 +1 @@ -Subproject commit b85758ec19ab37a317662eb93d7208eaae129e84 +Subproject commit ba9fe00c4de1d680cdc56605d9c0d2b4cf8e7a07 diff --git a/hecl b/hecl index 52134b89f..e97d83f6f 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 52134b89fdbd44b569c32ae177ef3bb2e6dd6178 +Subproject commit e97d83f6f62c2bb8b930547d874d3a45fa2a2bbf diff --git a/nod b/nod index 51a15e474..d5f5db440 160000 --- a/nod +++ b/nod @@ -1 +1 @@ -Subproject commit 51a15e474e64575dc2c92249e01e10965fc70de7 +Subproject commit d5f5db440cc266700bd59397b3a3b4a4596b87aa diff --git a/rapidjson b/rapidjson index 2fb78f9ce..af223d44f 160000 --- a/rapidjson +++ b/rapidjson @@ -1 +1 @@ -Subproject commit 2fb78f9cee01996f020d5af7592b37c5a0693b31 +Subproject commit af223d44f4e8d3772cb1ac0ce8bc2a132b51717f diff --git a/specter b/specter index d3d604f39..cb3bf9e09 160000 --- a/specter +++ b/specter @@ -1 +1 @@ -Subproject commit d3d604f390141fdd147bb87c8d2fb8fa68564c3e +Subproject commit cb3bf9e09e0da856563438af420f9a9d2930394a diff --git a/visigen/VISIRenderer.cpp b/visigen/VISIRenderer.cpp index a713e57ed..2e41d8df9 100644 --- a/visigen/VISIRenderer.cpp +++ b/visigen/VISIRenderer.cpp @@ -445,6 +445,7 @@ void VISIRenderer::RenderPVSEntitiesAndLights(const std::function& pa idx = m_models.size(); for (const Entity& ent : m_entities) { + (void)ent; if (m_queryBools[idx]) { GLint res;