From 57017298e6dd58cd410718cdf5db70e05aaa6b64 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Wed, 2 Mar 2016 20:57:21 -0800 Subject: [PATCH 1/3] Fix broken rotation --- Runtime/Particle/CElementGen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/Particle/CElementGen.cpp b/Runtime/Particle/CElementGen.cpp index 652d7a804..c8eb71c47 100644 --- a/Runtime/Particle/CElementGen.cpp +++ b/Runtime/Particle/CElementGen.cpp @@ -1701,7 +1701,7 @@ void CElementGen::RenderParticles() { float theta = particle.x30_lineWidthOrRota * M_PI / 180.f; float sinT = sinf(theta) * size; - float cosT = sinf(theta) * size; + float cosT = cosf(theta) * size; switch (m_shaderClass) { @@ -1836,7 +1836,7 @@ void CElementGen::RenderParticles() { float theta = particle.x30_lineWidthOrRota * M_PI / 180.f; float sinT = sinf(theta) * size; - float cosT = sinf(theta) * size; + float cosT = cosf(theta) * size; for (int i=0 ; i Date: Fri, 4 Mar 2016 09:25:39 -1000 Subject: [PATCH 2/3] Submodule refactor --- .gitmodules | 12 ++++++------ NODLib | 1 - hecl | 2 +- libSpecter | 1 - nod | 1 + specter | 1 + 6 files changed, 9 insertions(+), 9 deletions(-) delete mode 160000 NODLib delete mode 160000 libSpecter create mode 160000 nod create mode 160000 specter diff --git a/.gitmodules b/.gitmodules index cef347526..b0a9a7e55 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ -[submodule "NODLib"] - path = NODLib - url = https://github.com/AxioDL/NODLib.git [submodule "hecl"] path = hecl url = https://github.com/AxioDL/hecl.git -[submodule "libSpecter"] - path = libSpecter - url = https://github.com/AxioDL/libSpecter.git +[submodule "specter"] + path = specter + url = https://github.com/AxioDL/specter.git +[submodule "nod"] + path = nod + url = https://github.com/AxioDL/nod.git diff --git a/NODLib b/NODLib deleted file mode 160000 index 4adfa71c2..000000000 --- a/NODLib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4adfa71c2f2cfed5709ae77a536ffcd927ee7e2e diff --git a/hecl b/hecl index d7ba6810a..6158f4410 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit d7ba6810af60bccd41d42d1c06112c2f414b3f98 +Subproject commit 6158f44103efec1372f0a98d5c6268ff528f52ac diff --git a/libSpecter b/libSpecter deleted file mode 160000 index c34050a3b..000000000 --- a/libSpecter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c34050a3bb9a5c55cb26636d75e7d820d589e6a3 diff --git a/nod b/nod new file mode 160000 index 000000000..7320b76ff --- /dev/null +++ b/nod @@ -0,0 +1 @@ +Subproject commit 7320b76ff45b74c1f25b53bfe78255c178168da0 diff --git a/specter b/specter new file mode 160000 index 000000000..cfb3cd8c7 --- /dev/null +++ b/specter @@ -0,0 +1 @@ +Subproject commit cfb3cd8c74d0fb0fbc9c37a523b96fd5d2791db4 From 783fb4c4fe9f2e5d8bafa375562bb98c89e5265b Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 4 Mar 2016 13:04:53 -1000 Subject: [PATCH 3/3] Humungous refactor --- CMakeLists.txt | 30 +- DataSpec/Blender/BlenderSupport.cpp | 8 +- DataSpec/Blender/BlenderSupport.hpp | 4 +- DataSpec/DNACommon/ANCS.hpp | 32 +- DataSpec/DNACommon/ANIM.cpp | 49 ++- DataSpec/DNACommon/BabeDead.hpp | 12 +- DataSpec/DNACommon/CMDL.cpp | 6 +- DataSpec/DNACommon/CMDL.hpp | 132 +++---- DataSpec/DNACommon/DNACommon.cpp | 2 +- DataSpec/DNACommon/DNACommon.hpp | 98 +++--- DataSpec/DNACommon/DeafBabe.hpp | 2 +- DataSpec/DNACommon/GX.hpp | 4 +- DataSpec/DNACommon/MAPA.hpp | 32 +- DataSpec/DNACommon/MLVL.hpp | 30 +- DataSpec/DNACommon/NamedResourceCatalog.hpp | 24 +- DataSpec/DNACommon/PAK.hpp | 226 ++++++------ DataSpec/DNACommon/PART.hpp | 26 +- DataSpec/DNACommon/ParticleCommon.cpp | 74 ++-- DataSpec/DNACommon/ParticleCommon.hpp | 164 ++++----- DataSpec/DNACommon/STRG.cpp | 4 +- DataSpec/DNACommon/STRG.hpp | 10 +- DataSpec/DNACommon/TXTR.cpp | 34 +- DataSpec/DNACommon/TXTR.hpp | 4 +- DataSpec/DNAMP1/AFSM.hpp | 36 +- DataSpec/DNAMP1/ANCS.cpp | 132 +++---- DataSpec/DNAMP1/ANCS.hpp | 40 +-- DataSpec/DNAMP1/ANIM.cpp | 12 +- DataSpec/DNAMP1/ANIM.hpp | 14 +- DataSpec/DNAMP1/CINF.hpp | 4 +- DataSpec/DNAMP1/CMDL.hpp | 44 +-- DataSpec/DNAMP1/CMDLMaterials.cpp | 58 +-- DataSpec/DNAMP1/CMDLMaterials.hpp | 40 +-- DataSpec/DNAMP1/CSKR.hpp | 2 +- DataSpec/DNAMP1/DNAMP1.cpp | 42 +-- DataSpec/DNAMP1/DNAMP1.hpp | 16 +- DataSpec/DNAMP1/DeafBabe.cpp | 2 +- DataSpec/DNAMP1/DeafBabe.hpp | 6 +- DataSpec/DNAMP1/EVNT.cpp | 26 +- DataSpec/DNAMP1/EVNT.hpp | 4 +- DataSpec/DNAMP1/FRME.cpp | 48 +-- DataSpec/DNAMP1/FRME.hpp | 10 +- DataSpec/DNAMP1/MAPA.hpp | 6 +- DataSpec/DNAMP1/MLVL.hpp | 8 +- DataSpec/DNAMP1/MREA.cpp | 52 ++- DataSpec/DNAMP1/MREA.hpp | 8 +- DataSpec/DNAMP1/PAK.cpp | 14 +- DataSpec/DNAMP1/PAK.hpp | 6 +- DataSpec/DNAMP1/SCAN.hpp | 26 +- DataSpec/DNAMP1/SCLY.cpp | 58 +-- DataSpec/DNAMP1/SCLY.hpp | 8 +- DataSpec/DNAMP1/STRG.cpp | 28 +- DataSpec/DNAMP1/STRG.hpp | 20 +- DataSpec/DNAMP1/ScriptObjects/Oculus.hpp | 10 +- DataSpec/DNAMP1/ScriptObjects/Parameters.cpp | 2 +- DataSpec/DNAMP1/ScriptObjects/Ridley.hpp | 10 +- .../DNAMP1/ScriptObjects/WorldTeleporter.hpp | 10 +- DataSpec/DNAMP1/Tweaks/CTweakGame.hpp | 2 +- DataSpec/DNAMP1/Tweaks/CTweakParticle.hpp | 2 +- DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp | 2 +- .../DNAMP1/Tweaks/CTweakPlayerControl.hpp | 2 +- DataSpec/DNAMP2/ANCS.cpp | 110 ++---- DataSpec/DNAMP2/ANCS.hpp | 24 +- DataSpec/DNAMP2/ANIM.cpp | 12 +- DataSpec/DNAMP2/ANIM.hpp | 14 +- DataSpec/DNAMP2/CINF.hpp | 4 +- DataSpec/DNAMP2/CMDL.hpp | 8 +- DataSpec/DNAMP2/CMDLMaterials.hpp | 6 +- DataSpec/DNAMP2/CSKR.hpp | 2 +- DataSpec/DNAMP2/DNAMP2.cpp | 28 +- DataSpec/DNAMP2/DNAMP2.hpp | 16 +- DataSpec/DNAMP2/DeafBabe.hpp | 6 +- DataSpec/DNAMP2/MAPA.hpp | 6 +- DataSpec/DNAMP2/MLVL.hpp | 8 +- DataSpec/DNAMP2/MREA.cpp | 64 ++-- DataSpec/DNAMP2/MREA.hpp | 18 +- DataSpec/DNAMP2/PAK.hpp | 2 +- DataSpec/DNAMP2/STRG.cpp | 36 +- DataSpec/DNAMP2/STRG.hpp | 20 +- DataSpec/DNAMP3/ANIM.cpp | 16 +- DataSpec/DNAMP3/ANIM.hpp | 10 +- DataSpec/DNAMP3/CHAR.cpp | 28 +- DataSpec/DNAMP3/CHAR.hpp | 24 +- DataSpec/DNAMP3/CINF.hpp | 2 +- DataSpec/DNAMP3/CMDL.hpp | 8 +- DataSpec/DNAMP3/CMDLMaterials.cpp | 18 +- DataSpec/DNAMP3/CMDLMaterials.hpp | 22 +- DataSpec/DNAMP3/CSKR.hpp | 2 +- DataSpec/DNAMP3/DNAMP3.cpp | 32 +- DataSpec/DNAMP3/DNAMP3.hpp | 16 +- DataSpec/DNAMP3/MAPA.hpp | 6 +- DataSpec/DNAMP3/MLVL.hpp | 8 +- DataSpec/DNAMP3/MREA.cpp | 56 +-- DataSpec/DNAMP3/MREA.hpp | 14 +- DataSpec/DNAMP3/PAK.cpp | 38 +- DataSpec/DNAMP3/PAK.hpp | 10 +- DataSpec/DNAMP3/STRG.cpp | 36 +- DataSpec/DNAMP3/STRG.hpp | 20 +- DataSpec/SpecBase.cpp | 76 ++-- DataSpec/SpecBase.hpp | 54 +-- DataSpec/SpecMP1.cpp | 108 +++--- DataSpec/SpecMP2.cpp | 104 +++--- DataSpec/SpecMP3.cpp | 146 ++++---- Editor/CMakeLists.txt | 6 +- Editor/Camera.hpp | 26 +- Editor/InformationCenter.hpp | 10 +- Editor/ModelViewer.cpp | 10 +- Editor/ModelViewer.hpp | 16 +- Editor/ParticleEditor.hpp | 8 +- Editor/ProjectManager.cpp | 64 ++-- Editor/ProjectManager.hpp | 24 +- Editor/ProjectResourceFactory.cpp | 40 +-- Editor/ProjectResourceFactory.hpp | 44 +-- Editor/Resource.cpp | 4 +- Editor/Resource.hpp | 16 +- Editor/ResourceBrowser.cpp | 18 +- Editor/ResourceBrowser.hpp | 58 +-- Editor/Space.cpp | 58 +-- Editor/Space.hpp | 114 +++--- Editor/SplashScreen.cpp | 36 +- Editor/SplashScreen.hpp | 104 +++--- Editor/ViewManager.cpp | 114 +++--- Editor/ViewManager.hpp | 66 ++-- Editor/icons/icons.cpp | 18 +- Editor/icons/icons.hpp | 10 +- Editor/locale/locale.cpp | 12 +- Editor/locale/locale.hpp | 6 +- Editor/main.cpp | 38 +- Runtime/Audio/CAudioStateWin.hpp | 2 +- Runtime/Audio/CAudioSys.hpp | 8 +- Runtime/Audio/CSfxHandle.hpp | 2 +- Runtime/Audio/CSfxManager.hpp | 4 +- Runtime/CActor.cpp | 2 +- Runtime/CActor.hpp | 18 +- Runtime/CAi.cpp | 2 +- Runtime/CAi.hpp | 8 +- Runtime/CArchitectureMessage.hpp | 8 +- Runtime/CArchitectureQueue.hpp | 2 +- Runtime/CAreaOctTree.hpp | 2 +- Runtime/CBasics.hpp | 2 +- Runtime/CBasicsPC.cpp | 2 +- Runtime/CCRC32.cpp | 2 +- Runtime/CCRC32.hpp | 2 +- Runtime/CCallStack.hpp | 2 +- Runtime/CDvdFile.hpp | 2 +- Runtime/CDvdRequest.cpp | 2 +- Runtime/CDvdRequest.hpp | 2 +- Runtime/CEntity.cpp | 2 +- Runtime/CEntity.hpp | 2 +- Runtime/CFactoryMgr.cpp | 8 +- Runtime/CFactoryMgr.hpp | 10 +- Runtime/CGameAllocator.cpp | 6 +- Runtime/CGameAllocator.hpp | 2 +- Runtime/CGameDebug.hpp | 2 +- Runtime/CGameOptions.cpp | 2 +- Runtime/CGameOptions.hpp | 2 +- Runtime/CGameState.cpp | 2 +- Runtime/CGameState.hpp | 2 +- Runtime/CIOWin.hpp | 2 +- Runtime/CIOWinManager.cpp | 2 +- Runtime/CIOWinManager.hpp | 2 +- Runtime/CInGameTweakManagerBase.hpp | 2 +- Runtime/CLight.cpp | 24 -- Runtime/CLight.hpp | 39 --- Runtime/CMFGameBase.hpp | 2 +- Runtime/CMainFlowBase.cpp | 2 +- Runtime/CMainFlowBase.hpp | 2 +- Runtime/CMakeLists.txt | 4 - Runtime/CMapWorldInfo.cpp | 2 +- Runtime/CMapWorldInfo.hpp | 2 +- Runtime/CMemory.cpp | 64 ++-- Runtime/CMemory.hpp | 2 +- Runtime/CMemoryCardSys.hpp | 2 +- Runtime/CMemoryCardSysNix.cpp | 2 +- Runtime/CMoviePlayer.cpp | 2 +- Runtime/CMoviePlayer.hpp | 2 +- Runtime/CNODDvdRequest.cpp | 2 +- Runtime/CObjectList.hpp | 2 +- Runtime/CPakFile.hpp | 2 +- Runtime/CPhysicsActor.hpp | 34 +- Runtime/CPlayMovieBase.hpp | 2 +- Runtime/CPlayerState.cpp | 2 +- Runtime/CPlayerState.hpp | 2 +- Runtime/CRandom16.cpp | 2 +- Runtime/CRandom16.hpp | 2 +- Runtime/CResFactory.cpp | 2 +- Runtime/CResFactory.hpp | 2 +- Runtime/CResLoader.cpp | 2 +- Runtime/CResLoader.hpp | 2 +- Runtime/CScriptMailbox.cpp | 2 +- Runtime/CScriptMailbox.hpp | 2 +- Runtime/CSimplePool.cpp | 2 +- Runtime/CSimplePool.hpp | 2 +- Runtime/CStateManager.cpp | 2 +- Runtime/CStateManager.hpp | 2 +- Runtime/CStaticInterference.hpp | 2 +- Runtime/CStringExtras.hpp | 2 +- Runtime/CTimeProvider.cpp | 4 +- Runtime/CTimeProvider.hpp | 2 +- Runtime/CToken.hpp | 2 +- Runtime/CWorldTransManager.cpp | 2 +- Runtime/CWorldTransManager.hpp | 2 +- Runtime/Character/CAnimData.hpp | 2 +- Runtime/Character/CAnimationDatabase.hpp | 2 +- Runtime/Character/CAnimationDatabaseGame.hpp | 2 +- Runtime/Character/CAssetFactory.cpp | 2 +- Runtime/Character/CAssetFactory.hpp | 2 +- Runtime/Character/CCharAnimTime.cpp | 2 +- Runtime/Character/CCharAnimTime.hpp | 2 +- Runtime/Character/CCharacterFactory.hpp | 2 +- Runtime/Character/CHierarchyPoseBuilder.hpp | 2 +- Runtime/Character/CTransitionDatabase.hpp | 2 +- Runtime/Character/CTransitionDatabaseGame.hpp | 2 +- Runtime/Character/IMetaAnim.hpp | 2 +- Runtime/Character/IMetaTrans.hpp | 2 +- Runtime/GameGlobalObjects.hpp | 2 +- Runtime/Graphics/CBooRenderer.hpp | 2 +- Runtime/{ => Graphics}/CGraphics.cpp | 66 ++-- Runtime/{ => Graphics}/CGraphics.hpp | 38 +- Runtime/Graphics/CLight.cpp | 24 ++ Runtime/Graphics/CLight.hpp | 33 +- Runtime/Graphics/CLineRenderer.cpp | 66 ++-- Runtime/Graphics/CLineRenderer.hpp | 28 +- Runtime/Graphics/CLineRendererShaders.hpp | 4 +- Runtime/Graphics/CLineRendererShadersGLSL.cpp | 2 +- Runtime/Graphics/CLineRendererShadersHLSL.cpp | 2 +- .../Graphics/CLineRendererShadersMetal.cpp | 2 +- Runtime/Graphics/CMakeLists.txt | 5 +- Runtime/Graphics/CMetroidModelInstance.hpp | 2 +- Runtime/{ => Graphics}/CModel.hpp | 6 +- Runtime/{ => Graphics}/CModelBoo.cpp | 4 +- Runtime/{ => Graphics}/CTexture.hpp | 4 +- Runtime/{ => Graphics}/CTextureBoo.cpp | 8 +- Runtime/Graphics/IRenderer.hpp | 8 +- Runtime/GuiSys/CConsoleOutputWindow.hpp | 2 +- Runtime/GuiSys/CGuiSys.hpp | 2 +- Runtime/GuiSys/CSplashScreen.hpp | 2 +- Runtime/IAllocator.cpp | 2 +- Runtime/IAllocator.hpp | 2 +- Runtime/IFactory.hpp | 2 +- Runtime/IOStreams.cpp | 2 +- Runtime/IOStreams.hpp | 16 +- Runtime/IObj.hpp | 2 +- Runtime/IObjectStore.hpp | 2 +- Runtime/IRuntimeMain.hpp | 2 +- Runtime/IVParamObj.hpp | 2 +- Runtime/Input/CFinalInput.cpp | 28 +- Runtime/Input/CFinalInput.hpp | 2 +- Runtime/Input/CInputGenerator.cpp | 2 +- Runtime/Input/CInputGenerator.hpp | 2 +- Runtime/Input/CKeyboardMouseController.hpp | 2 +- Runtime/Input/CRumbleGenerator.cpp | 2 +- Runtime/Input/CRumbleGenerator.hpp | 2 +- Runtime/Input/CRumbleManager.cpp | 2 +- Runtime/Input/CRumbleManager.hpp | 2 +- Runtime/Input/CRumbleVoice.cpp | 2 +- Runtime/Input/CRumbleVoice.hpp | 2 +- Runtime/Input/ControlMapper.cpp | 2 +- Runtime/Input/ControlMapper.hpp | 2 +- Runtime/Input/IController.hpp | 2 +- Runtime/MP1/CFrontEndUI.cpp | 2 +- Runtime/MP1/CFrontEndUI.hpp | 2 +- Runtime/MP1/CInGameTweakManager.hpp | 2 +- Runtime/MP1/CMFGame.cpp | 2 +- Runtime/MP1/CMFGame.hpp | 2 +- Runtime/MP1/CMain.hpp | 2 +- Runtime/MP1/CMainFlow.cpp | 2 +- Runtime/MP1/CMainFlow.hpp | 2 +- Runtime/MP1/CMakeLists.txt | 4 +- Runtime/MP1/CPlayMovie.cpp | 2 +- Runtime/MP1/CPlayMovie.hpp | 2 +- Runtime/MP1/CTweaks.cpp | 8 +- Runtime/MP1/CTweaks.hpp | 2 +- Runtime/MP1/main.cpp | 8 +- Runtime/Particle/CCollisionResponseData.cpp | 4 +- Runtime/Particle/CCollisionResponseData.hpp | 2 +- Runtime/Particle/CColorElement.cpp | 36 +- Runtime/Particle/CColorElement.hpp | 22 +- Runtime/Particle/CDecalDataFactory.cpp | 8 +- Runtime/Particle/CDecalDataFactory.hpp | 2 +- Runtime/Particle/CDecalDescription.hpp | 2 +- Runtime/Particle/CDecalManager.hpp | 2 +- Runtime/Particle/CElectricDescription.hpp | 2 +- Runtime/Particle/CElementGen.cpp | 330 +++++++++--------- Runtime/Particle/CElementGen.hpp | 100 +++--- Runtime/Particle/CElementGenShaders.hpp | 4 +- Runtime/Particle/CElementGenShadersGLSL.cpp | 4 +- Runtime/Particle/CElementGenShadersHLSL.cpp | 4 +- Runtime/Particle/CElementGenShadersMetal.cpp | 2 +- Runtime/Particle/CEmitterElement.cpp | 30 +- Runtime/Particle/CEmitterElement.hpp | 8 +- Runtime/Particle/CFlameWarp.cpp | 2 +- Runtime/Particle/CFlameWarp.hpp | 16 +- Runtime/Particle/CGenDescription.hpp | 2 +- Runtime/Particle/CIntElement.cpp | 2 +- Runtime/Particle/CIntElement.hpp | 2 +- Runtime/Particle/CModVectorElement.cpp | 72 ++-- Runtime/Particle/CModVectorElement.hpp | 32 +- Runtime/Particle/CParticleDataFactory.cpp | 10 +- Runtime/Particle/CParticleDataFactory.hpp | 2 +- Runtime/Particle/CParticleElectric.cpp | 48 +-- Runtime/Particle/CParticleElectric.hpp | 48 +-- .../Particle/CParticleElectricDataFactory.cpp | 8 +- .../Particle/CParticleElectricDataFactory.hpp | 2 +- Runtime/Particle/CParticleGen.cpp | 2 +- Runtime/Particle/CParticleGen.hpp | 40 +-- Runtime/Particle/CParticleGlobals.cpp | 2 +- Runtime/Particle/CParticleGlobals.hpp | 6 +- Runtime/Particle/CParticleSwoosh.cpp | 44 +-- Runtime/Particle/CParticleSwoosh.hpp | 30 +- .../Particle/CParticleSwooshDataFactory.cpp | 10 +- .../Particle/CParticleSwooshDataFactory.hpp | 2 +- .../Particle/CProjectileWeaponDataFactory.cpp | 8 +- .../Particle/CProjectileWeaponDataFactory.hpp | 2 +- Runtime/Particle/CRealElement.cpp | 26 +- Runtime/Particle/CRealElement.hpp | 2 +- Runtime/Particle/CSpawnSystemKeyframeData.cpp | 4 +- Runtime/Particle/CSpawnSystemKeyframeData.hpp | 2 +- Runtime/Particle/CSwooshDescription.hpp | 2 +- Runtime/Particle/CUVElement.cpp | 2 +- Runtime/Particle/CUVElement.hpp | 4 +- Runtime/Particle/CVectorElement.cpp | 118 +++---- Runtime/Particle/CVectorElement.hpp | 60 ++-- Runtime/Particle/CWarp.hpp | 14 +- Runtime/Particle/CWeaponDescription.hpp | 2 +- Runtime/Particle/IElement.hpp | 14 +- Runtime/RetroTypes.hpp | 8 +- Runtime/ScriptObjectSupport.hpp | 2 +- hecl | 2 +- nod | 2 +- specter | 2 +- 330 files changed, 2943 insertions(+), 3077 deletions(-) delete mode 100644 Runtime/CLight.cpp delete mode 100644 Runtime/CLight.hpp rename Runtime/{ => Graphics}/CGraphics.cpp (74%) rename Runtime/{ => Graphics}/CGraphics.hpp (81%) create mode 100644 Runtime/Graphics/CLight.cpp rename Runtime/{ => Graphics}/CModel.hpp (79%) rename Runtime/{ => Graphics}/CModelBoo.cpp (57%) rename Runtime/{ => Graphics}/CTexture.hpp (96%) rename Runtime/{ => Graphics}/CTextureBoo.cpp (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d0554301..ed5aab5d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0) cmake_policy(SET CMP0054 NEW) -project(PathShagged) +project(urde) 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 /wd4267 /wd4244 /wd4305 /MP) @@ -53,7 +53,7 @@ if(USE_LD_GOLD AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_ endif() endif() -set(BOO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hecl/extern/libBoo/include) +set(BOO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hecl/extern/boo/include) set(HECL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hecl/include ${CMAKE_CURRENT_SOURCE_DIR}/hecl/blender) @@ -67,25 +67,25 @@ set(HECL_DATASPEC_DECLS "/* RetroCommon specs */ namespace DataSpec { - extern HECL::Database::DataSpecEntry SpecEntMP1; - extern HECL::Database::DataSpecEntry SpecEntMP2; - extern HECL::Database::DataSpecEntry SpecEntMP3; + extern hecl::Database::DataSpecEntry SpecEntMP1; + extern hecl::Database::DataSpecEntry SpecEntMP2; + extern hecl::Database::DataSpecEntry SpecEntMP3; }") set(HECL_DATASPEC_PUSHES " /* RetroCommon */ - HECL::Database::DATA_SPEC_REGISTRY.push_back(&DataSpec::SpecEntMP1); - HECL::Database::DATA_SPEC_REGISTRY.push_back(&DataSpec::SpecEntMP2); - HECL::Database::DATA_SPEC_REGISTRY.push_back(&DataSpec::SpecEntMP3);") + hecl::Database::DATA_SPEC_REGISTRY.push_back(&DataSpec::SpecEntMP1); + hecl::Database::DATA_SPEC_REGISTRY.push_back(&DataSpec::SpecEntMP2); + hecl::Database::DATA_SPEC_REGISTRY.push_back(&DataSpec::SpecEntMP3);") add_subdirectory(hecl) add_definitions(${BOO_SYS_DEFINES}) -add_subdirectory(libSpecter) -set(SPECTER_INCLUDE_DIR libSpecter/include libSpecter/freetype2/include) -add_subdirectory(NODLib) -set(NODLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/NODLib/include) +add_subdirectory(specter) +set(SPECTER_INCLUDE_DIR specter/include specter/freetype2/include) +add_subdirectory(nod) +set(NOD_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/nod/include) add_definitions(-DZE_ATHENA_TYPES=1) -set(MATHLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libSpecter/MathLib/include) -include_directories(${ATHENA_INCLUDE_DIR} ${LOG_VISOR_INCLUDE_DIR} ${HECL_INCLUDE_DIR} - ${NODLIB_INCLUDE_DIR} ${MATHLIB_INCLUDE_DIR} ${BOO_INCLUDE_DIR} +set(ZEUS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/specter/zeus/include) +include_directories(${ATHENA_INCLUDE_DIR} ${LOGVISOR_INCLUDE_DIR} ${HECL_INCLUDE_DIR} + ${NOD_INCLUDE_DIR} ${ZEUS_INCLUDE_DIR} ${BOO_INCLUDE_DIR} ${SPECTER_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) add_subdirectory(DataSpec) add_subdirectory(Editor) diff --git a/DataSpec/Blender/BlenderSupport.cpp b/DataSpec/Blender/BlenderSupport.cpp index 9849ed3b6..3562ab493 100644 --- a/DataSpec/Blender/BlenderSupport.cpp +++ b/DataSpec/Blender/BlenderSupport.cpp @@ -10,13 +10,13 @@ namespace DataSpec namespace Blender { -bool BuildMasterShader(const HECL::ProjectPath& path) +bool BuildMasterShader(const hecl::ProjectPath& path) { - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); - if (!conn.createBlend(path, HECL::BlenderConnection::BlendType::None)) + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); + if (!conn.createBlend(path, hecl::BlenderConnection::BlendType::None)) return false; { - HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); + hecl::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); os << RETRO_MASTER_SHADER; os << "make_master_shader_library()\n"; } diff --git a/DataSpec/Blender/BlenderSupport.hpp b/DataSpec/Blender/BlenderSupport.hpp index f9fc1ae19..ba4f688f0 100644 --- a/DataSpec/Blender/BlenderSupport.hpp +++ b/DataSpec/Blender/BlenderSupport.hpp @@ -1,14 +1,14 @@ #ifndef _RETRO_BLENDER_SUPPORT_HPP_ #define _RETRO_BLENDER_SUPPORT_HPP_ -#include +#include namespace DataSpec { namespace Blender { -bool BuildMasterShader(const HECL::ProjectPath& path); +bool BuildMasterShader(const hecl::ProjectPath& path); } } diff --git a/DataSpec/DNACommon/ANCS.hpp b/DataSpec/DNACommon/ANCS.hpp index 81313155d..7d636fa8f 100644 --- a/DataSpec/DNACommon/ANCS.hpp +++ b/DataSpec/DNACommon/ANCS.hpp @@ -11,7 +11,7 @@ namespace DataSpec namespace DNAANCS { -using Actor = HECL::BlenderConnection::DataStream::Actor; +using Actor = hecl::BlenderConnection::DataStream::Actor; template struct CharacterResInfo @@ -20,7 +20,7 @@ struct CharacterResInfo IDTYPE cmdl; IDTYPE cskr; IDTYPE cinf; - std::vector>> overlays; + std::vector>> overlays; }; template @@ -33,13 +33,13 @@ struct AnimationResInfo }; template -bool ReadANCSToBlender(HECL::BlenderConnection& conn, +bool ReadANCSToBlender(hecl::BlenderConnection& conn, const ANCSDNA& ancs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const typename PAKRouter::EntryType& entry, const SpecBase& dataspec, - std::function fileChanged, + std::function fileChanged, bool force=false) { /* Extract character CMDL/CSKR first */ @@ -47,17 +47,18 @@ bool ReadANCSToBlender(HECL::BlenderConnection& conn, ancs.getCharacterResInfo(chResInfo); for (const auto& info : chResInfo) { - const NOD::Node* node; + const nod::Node* node; const typename PAKRouter::EntryType* cmdlE = pakRouter.lookupEntry(info.cmdl, &node, true, true); if (cmdlE) { - HECL::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE); - if (force || cmdlPath.getPathType() == HECL::ProjectPath::Type::None) + hecl::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE); + if (force || cmdlPath.getPathType() == hecl::ProjectPath::Type::None) { - if (!conn.createBlend(cmdlPath, HECL::BlenderConnection::BlendType::Mesh)) + if (!conn.createBlend(cmdlPath, hecl::BlenderConnection::BlendType::Mesh)) return false; - HECL::SystemStringView bestNameView(pakRouter.getBestEntryName(*cmdlE)); + std::string bestName = pakRouter.getBestEntryName(*cmdlE); + hecl::SystemStringView bestNameView(bestName); fileChanged(bestNameView.sys_str().c_str()); typename ANCSDNA::CSKRType cskr; @@ -76,13 +77,14 @@ bool ReadANCSToBlender(HECL::BlenderConnection& conn, } } - HECL::SystemStringView bestNameView(pakRouter.getBestEntryName(entry)); + std::string bestName = pakRouter.getBestEntryName(entry); + hecl::SystemStringView bestNameView(bestName); fileChanged(bestNameView.sys_str().c_str()); /* Establish ANCS blend */ - if (!conn.createBlend(outPath, HECL::BlenderConnection::BlendType::Actor)) + if (!conn.createBlend(outPath, hecl::BlenderConnection::BlendType::Actor)) return false; - HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); + hecl::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); os.format("import bpy\n" "from mathutils import Vector\n" @@ -125,7 +127,7 @@ bool ReadANCSToBlender(HECL::BlenderConnection& conn, const typename PAKRouter::EntryType* cmdlE = pakRouter.lookupEntry(info.cmdl, nullptr, true, true); if (cmdlE) { - HECL::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE); + hecl::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE); os.linkBlend(cmdlPath.getAbsolutePathUTF8().c_str(), pakRouter.getBestEntryName(*cmdlE).c_str(), true); @@ -147,7 +149,7 @@ bool ReadANCSToBlender(HECL::BlenderConnection& conn, const typename PAKRouter::EntryType* cmdlE = pakRouter.lookupEntry(overlay.second.first, nullptr, true, true); if (cmdlE) { - HECL::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE); + hecl::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE); os.linkBlend(cmdlPath.getAbsolutePathUTF8().c_str(), pakRouter.getBestEntryName(*cmdlE).c_str(), true); diff --git a/DataSpec/DNACommon/ANIM.cpp b/DataSpec/DNACommon/ANIM.cpp index 1420bb22b..58abba4fb 100644 --- a/DataSpec/DNACommon/ANIM.cpp +++ b/DataSpec/DNACommon/ANIM.cpp @@ -1,5 +1,4 @@ -#define _USE_MATH_DEFINES -#include +#include "zeus/Math.hpp" #include "ANIM.hpp" namespace DataSpec @@ -39,50 +38,50 @@ size_t ComputeBitstreamSize(size_t keyFrameCount, const std::vector& ch static inline QuantizedRot QuantizeRotation(const Value& quat, atUint32 div) { - float q = M_PI / 2.0 / div; + float q = M_PI / 2.0f / float(div); return { { - atInt16(asinf(quat.v4.vec[1]) / q), - atInt16(asinf(quat.v4.vec[2]) / q), - atInt16(asinf(quat.v4.vec[3]) / q), + atInt16(std::asin(quat.v4.vec[1]) / q), + atInt16(std::asin(quat.v4.vec[2]) / q), + atInt16(std::asin(quat.v4.vec[3]) / q), }, - (quat.v4.vec[0] < 0) ? true : false + (quat.v4.vec[0] < 0.f) ? true : false }; } static inline Value DequantizeRotation(const QuantizedRot& v, atUint32 div) { - float q = M_PI / 2.0 / div; + float q = M_PI / 2.0f / float(div); Value retval = { - 0.0, - sinf(v.v[0] * q), - sinf(v.v[1] * q), - sinf(v.v[2] * q), + 0.0f, + std::sin(v.v[0] * q), + std::sin(v.v[1] * q), + std::sin(v.v[2] * q), }; - retval.v4.vec[0] = sqrtf(std::max((1.0 - + retval.v4.vec[0] = std::sqrt(std::max((1.0f - (retval.v4.vec[1] * retval.v4.vec[1] + retval.v4.vec[2] * retval.v4.vec[2] + - retval.v4.vec[3] * retval.v4.vec[3])), 0.0)); + retval.v4.vec[3] * retval.v4.vec[3])), 0.0f)); retval.v4.vec[0] = v.w ? -retval.v4.vec[0] : retval.v4.vec[0]; return retval; } static inline Value DequantizeRotation_3(const QuantizedRot& v, atUint32 div) { - float q = 1.0 / div; + float q = 1.0f / float(div); Value retval = { - 0.0, + 0.0f, v.v[0] * q, v.v[1] * q, v.v[2] * q, }; - retval.v4.vec[0] = sqrtf(std::max((1.0 - + retval.v4.vec[0] = std::sqrt(std::max((1.0f - (retval.v4.vec[1] * retval.v4.vec[1] + retval.v4.vec[2] * retval.v4.vec[2] + - retval.v4.vec[3] * retval.v4.vec[3])), 0.0)); + retval.v4.vec[3] * retval.v4.vec[3])), 0.0f)); retval.v4.vec[0] = v.w ? -retval.v4.vec[0] : retval.v4.vec[0]; return retval; } @@ -94,7 +93,7 @@ bool BitstreamReader::dequantizeBit(const atUint8* data) /* Fill 32 bit buffer with region containing bits */ /* Make them least significant */ - atUint32 tempBuf = HECL::SBig(*reinterpret_cast(data + byteCur)) >> bitRem; + atUint32 tempBuf = hecl::SBig(*reinterpret_cast(data + byteCur)) >> bitRem; /* That's it */ m_bitCur += 1; @@ -108,13 +107,13 @@ atInt16 BitstreamReader::dequantize(const atUint8* data, atUint8 q) /* Fill 32 bit buffer with region containing bits */ /* Make them least significant */ - atUint32 tempBuf = HECL::SBig(*reinterpret_cast(data + byteCur)) >> bitRem; + atUint32 tempBuf = hecl::SBig(*reinterpret_cast(data + byteCur)) >> bitRem; /* If this shift underflows the value, buffer the next 32 bits */ /* And tack onto shifted buffer */ if ((bitRem + q) > 32) { - atUint32 tempBuf2 = HECL::SBig(*reinterpret_cast(data + byteCur + 4)); + atUint32 tempBuf2 = hecl::SBig(*reinterpret_cast(data + byteCur + 4)); tempBuf |= (tempBuf2 << (32 - bitRem)); } @@ -256,7 +255,7 @@ void BitstreamWriter::quantizeBit(atUint8* data, bool val) /* Fill 32 bit buffer with region containing bits */ /* Make them least significant */ *(atUint32*)(data + byteCur) = - HECL::SBig(HECL::SBig(*(atUint32*)(data + byteCur)) | (val << bitRem)); + hecl::SBig(hecl::SBig(*(atUint32*)(data + byteCur)) | (val << bitRem)); m_bitCur += 1; } @@ -271,14 +270,14 @@ void BitstreamWriter::quantize(atUint8* data, atUint8 q, atInt16 val) /* Fill 32 bit buffer with region containing bits */ /* Make them least significant */ *(atUint32*)(data + byteCur) = - HECL::SBig(HECL::SBig(*(atUint32*)(data + byteCur)) | (masked << bitRem)); + hecl::SBig(hecl::SBig(*(atUint32*)(data + byteCur)) | (masked << bitRem)); /* If this shift underflows the value, buffer the next 32 bits */ /* And tack onto shifted buffer */ if ((bitRem + q) > 32) { *(atUint32*)(data + byteCur + 4) = - HECL::SBig(HECL::SBig(*(atUint32*)(data + byteCur + 4)) | (masked >> (32 - bitRem))); + hecl::SBig(hecl::SBig(*(atUint32*)(data + byteCur + 4)) | (masked >> (32 - bitRem))); } m_bitCur += q; @@ -295,7 +294,7 @@ BitstreamWriter::write(const std::vector>& chanKeys, rotDivOut = 32767; /* Normalized range of values */ /* Pre-pass to calculate translation multiplier */ - float maxTransDiff = 0.0; + float maxTransDiff = 0.0f; auto kit = chanKeys.begin(); for (Channel& chan : channels) { diff --git a/DataSpec/DNACommon/BabeDead.hpp b/DataSpec/DNACommon/BabeDead.hpp index d4ae5a0cc..c9ecc7928 100644 --- a/DataSpec/DNACommon/BabeDead.hpp +++ b/DataSpec/DNACommon/BabeDead.hpp @@ -1,18 +1,14 @@ #ifndef _DNACOMMON_BABEDEAD_HPP_ #define _DNACOMMON_BABEDEAD_HPP_ -#include - -#ifndef _USE_MATH_DEFINES -#define _USE_MATH_DEFINES 1 -#endif -#include +#include "BlenderConnection.hpp" +#include "zeus/Math.hpp" namespace DataSpec { template -void ReadBabeDeadLightToBlender(HECL::BlenderConnection::PyOutStream& os, +void ReadBabeDeadLightToBlender(hecl::BlenderConnection::PyOutStream& os, const BabeDeadLight& light, unsigned s, unsigned l) { switch (light.lightType) @@ -45,7 +41,7 @@ void ReadBabeDeadLightToBlender(HECL::BlenderConnection::PyOutStream& os, "lamp_obj.rotation_mode = 'QUATERNION'\n" "lamp_obj.rotation_quaternion = Vector((0,0,-1)).rotation_difference(Vector((%f,%f,%f)))\n" "\n", s, l, - light.spotCutoff * M_PI / 180.f, + zeus::degToRad(light.spotCutoff), light.direction.vec[0], light.direction.vec[1], light.direction.vec[2]); break; default: return; diff --git a/DataSpec/DNACommon/CMDL.cpp b/DataSpec/DNACommon/CMDL.cpp index 813e24743..abf8b92dc 100644 --- a/DataSpec/DNACommon/CMDL.cpp +++ b/DataSpec/DNACommon/CMDL.cpp @@ -5,8 +5,8 @@ namespace DataSpec namespace DNACMDL { -void InitGeomBlenderContext(HECL::BlenderConnection::PyOutStream& os, - const HECL::ProjectPath& masterShaderPath) +void InitGeomBlenderContext(hecl::BlenderConnection::PyOutStream& os, + const hecl::ProjectPath& masterShaderPath) { os << "# Using 'Blender Game'\n" "bpy.context.scene.render.engine = 'BLENDER_GAME'\n" @@ -87,7 +87,7 @@ void InitGeomBlenderContext(HECL::BlenderConnection::PyOutStream& os, "\n", masterShaderPath.getAbsolutePathUTF8().c_str()); } -void FinishBlenderMesh(HECL::BlenderConnection::PyOutStream& os, +void FinishBlenderMesh(hecl::BlenderConnection::PyOutStream& os, unsigned matSetCount, int meshIdx) { if (meshIdx < 0) diff --git a/DataSpec/DNACommon/CMDL.hpp b/DataSpec/DNACommon/CMDL.hpp index ea2061e3d..87f2f7e3f 100644 --- a/DataSpec/DNACommon/CMDL.hpp +++ b/DataSpec/DNACommon/CMDL.hpp @@ -1,9 +1,9 @@ #ifndef _DNACOMMON_CMDL_HPP_ #define _DNACOMMON_CMDL_HPP_ -#include -#include -#include +#include +#include +#include #include "PAK.hpp" #include "BlenderConnection.hpp" #include "GX.hpp" @@ -14,7 +14,7 @@ namespace DataSpec namespace DNACMDL { -using Mesh = HECL::BlenderConnection::DataStream::Mesh; +using Mesh = hecl::BlenderConnection::DataStream::Mesh; struct Header : BigDNA { @@ -49,7 +49,7 @@ struct SurfaceHeader_1 : BigDNA Value unk2 = 0; Value aabbSz = 0; Value reflectionNormal; - Seek seek2; + Seek seek2; Align<32> align; static constexpr bool UseMatrixSkinning() {return false;} @@ -69,7 +69,7 @@ struct SurfaceHeader_2 : BigDNA Value reflectionNormal; Value skinMtxBankIdx; Value surfaceGroup; - Seek seek2; + Seek seek2; Align<32> align; static constexpr bool UseMatrixSkinning() {return false;} @@ -89,7 +89,7 @@ struct SurfaceHeader_3 : BigDNA Value reflectionNormal; Value skinMtxBankIdx; Value surfaceGroup; - Seek seek2; + Seek seek2; Value unk3; Align<32> align; @@ -166,7 +166,7 @@ void GetVertexAttributes(const MaterialSet& matSet, } template -void ReadMaterialSetToBlender_1_2(HECL::BlenderConnection::PyOutStream& os, +void ReadMaterialSetToBlender_1_2(hecl::BlenderConnection::PyOutStream& os, const MaterialSet& matSet, const PAKRouter& pakRouter, const typename PAKRouter::EntryType& entry, @@ -177,16 +177,16 @@ void ReadMaterialSetToBlender_1_2(HECL::BlenderConnection::PyOutStream& os, for (const UniqueID32& tex : matSet.head.textureIDs) { std::string texName = pakRouter.getBestEntryName(tex); - const NOD::Node* node; + const nod::Node* node; const typename PAKRouter::EntryType* texEntry = pakRouter.lookupEntry(tex, &node); - HECL::ProjectPath txtrPath = pakRouter.getWorking(texEntry); - if (txtrPath.getPathType() == HECL::ProjectPath::Type::None) + hecl::ProjectPath txtrPath = pakRouter.getWorking(texEntry); + if (txtrPath.getPathType() == hecl::ProjectPath::Type::None) { PAKEntryReadStream rs = texEntry->beginReadStream(*node); TXTR::Extract(rs, txtrPath); } - HECL::SystemString resPath = pakRouter.getResourceRelativePath(entry, tex); - HECL::SystemUTF8View resPathView(resPath); + hecl::SystemString resPath = pakRouter.getResourceRelativePath(entry, tex); + hecl::SystemUTF8View resPathView(resPath); os.format("if '%s' in bpy.data.textures:\n" " image = bpy.data.images['%s']\n" " texture = bpy.data.textures[image.name]\n" @@ -209,7 +209,7 @@ void ReadMaterialSetToBlender_1_2(HECL::BlenderConnection::PyOutStream& os, } template -void ReadMaterialSetToBlender_3(HECL::BlenderConnection::PyOutStream& os, +void ReadMaterialSetToBlender_3(hecl::BlenderConnection::PyOutStream& os, const MaterialSet& matSet, const PAKRouter& pakRouter, const typename PAKRouter::EntryType& entry, @@ -251,7 +251,7 @@ public: } template - void sendAdditionalVertsToBlender(HECL::BlenderConnection::PyOutStream& os, + void sendAdditionalVertsToBlender(hecl::BlenderConnection::PyOutStream& os, const RigPair& rp) const { atUint32 nextVert = 1; @@ -312,7 +312,7 @@ private: case GX::INDEX16: if ((m_cur - m_dl.get() + 1) >= intptr_t(m_dlSize)) return 0; - retval = HECL::SBig(*(atUint16*)m_cur); + retval = hecl::SBig(*(atUint16*)m_cur); m_cur += 2; break; default: break; @@ -346,7 +346,7 @@ public: atUint16 readVertCount() { - atUint16 retval = HECL::SBig(*(atUint16*)m_cur); + atUint16 retval = hecl::SBig(*(atUint16*)m_cur); m_cur += 2; return retval; } @@ -510,14 +510,14 @@ public: } }; -void InitGeomBlenderContext(HECL::BlenderConnection::PyOutStream& os, - const HECL::ProjectPath& masterShaderPath); -void FinishBlenderMesh(HECL::BlenderConnection::PyOutStream& os, +void InitGeomBlenderContext(hecl::BlenderConnection::PyOutStream& os, + const hecl::ProjectPath& masterShaderPath); +void FinishBlenderMesh(hecl::BlenderConnection::PyOutStream& os, unsigned matSetCount, int meshIdx); template -atUint32 ReadGeomSectionsToBlender(HECL::BlenderConnection::PyOutStream& os, - Athena::io::IStreamReader& reader, +atUint32 ReadGeomSectionsToBlender(hecl::BlenderConnection::PyOutStream& os, + athena::io::IStreamReader& reader, PAKRouter& pakRouter, const typename PAKRouter::EntryType& entry, const RigPair& rp, @@ -640,10 +640,10 @@ atUint32 ReadGeomSectionsToBlender(HECL::BlenderConnection::PyOutStream& os, } if (s < secCount - 1) - reader.seek(secStart + secSizes[s], Athena::Begin); + reader.seek(secStart + secSizes[s], athena::Begin); } - reader.seek(afterHeaderPos, Athena::Begin); + reader.seek(afterHeaderPos, athena::Begin); visitedDLOffsets = false; unsigned createdUVLayers = 0; @@ -986,7 +986,7 @@ atUint32 ReadGeomSectionsToBlender(HECL::BlenderConnection::PyOutStream& os, } if (s < secCount - 1) - reader.seek(secStart + secSizes[s], Athena::Begin); + reader.seek(secStart + secSizes[s], athena::Begin); } /* Finish Mesh */ @@ -999,8 +999,8 @@ atUint32 ReadGeomSectionsToBlender(HECL::BlenderConnection::PyOutStream& os, } template -bool ReadCMDLToBlender(HECL::BlenderConnection& conn, - Athena::io::IStreamReader& reader, +bool ReadCMDLToBlender(hecl::BlenderConnection& conn, + athena::io::IStreamReader& reader, PAKRouter& pakRouter, const typename PAKRouter::EntryType& entry, const SpecBase& dataspec, @@ -1011,18 +1011,18 @@ bool ReadCMDLToBlender(HECL::BlenderConnection& conn, if (head.magic != 0xDEADBABE) { - LogDNACommon.report(LogVisor::Error, "invalid CMDL magic"); + LogDNACommon.report(logvisor::Error, "invalid CMDL magic"); return false; } if (head.version != Version) { - LogDNACommon.report(LogVisor::Error, "invalid CMDL version"); + LogDNACommon.report(logvisor::Error, "invalid CMDL version"); return false; } /* Open Py Stream and read sections */ - HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); + hecl::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); os.format("import bpy\n" "import bmesh\n" "\n" @@ -1046,14 +1046,14 @@ bool ReadCMDLToBlender(HECL::BlenderConnection& conn, } template -void NameCMDL(Athena::io::IStreamReader& reader, +void NameCMDL(athena::io::IStreamReader& reader, PAKRouter& pakRouter, typename PAKRouter::EntryType& entry, const SpecBase& dataspec) { Header head; head.read(reader); - std::string bestName = HECL::Format("CMDL_%s", entry.id.toString().c_str()); + std::string bestName = hecl::Format("CMDL_%s", entry.id.toString().c_str()); /* Pre-read pass to determine maximum used vert indices */ atUint32 matSecCount = 0; @@ -1071,11 +1071,11 @@ void NameCMDL(Athena::io::IStreamReader& reader, } if (s < head.secCount - 1) - reader.seek(secStart + head.secSizes[s], Athena::Begin); + reader.seek(secStart + head.secSizes[s], athena::Begin); } } -static void WriteDLVal(Athena::io::FileWriter& writer, GX::AttrType type, atUint32 val) +static void WriteDLVal(athena::io::FileWriter& writer, GX::AttrType type, atUint32 val) { switch (type) { @@ -1091,7 +1091,7 @@ static void WriteDLVal(Athena::io::FileWriter& writer, GX::AttrType type, atUint } template -bool WriteCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& inPath, const Mesh& mesh) +bool WriteCMDL(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath, const Mesh& mesh) { Header head; head.magic = 0xDEADBABE; @@ -1110,23 +1110,23 @@ bool WriteCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& inPath std::vector matSets; matSets.reserve(mesh.materialSets.size()); { - HECL::Frontend::Frontend FE; + hecl::Frontend::Frontend FE; for (const std::vector& mset : mesh.materialSets) { matSets.emplace_back(); MaterialSet& targetMSet = matSets.back(); - std::vector texPaths; - std::vector setBackends; + std::vector texPaths; + std::vector setBackends; setBackends.reserve(mset.size()); size_t endOff = 0; atUint32 nextGroupIdx = 0; for (const Mesh::Material& mat : mset) { - std::string diagName = HECL::Format("%s:%s", inPath.getLastComponentUTF8(), mat.name.c_str()); - HECL::Frontend::IR matIR = FE.compileSource(mat.source, diagName); + std::string diagName = hecl::Format("%s:%s", inPath.getLastComponentUTF8(), mat.name.c_str()); + hecl::Frontend::IR matIR = FE.compileSource(mat.source, diagName); setBackends.emplace_back(); - HECL::Backend::GX& matGX = setBackends.back(); + hecl::Backend::GX& matGX = setBackends.back(); matGX.reset(matIR, FE.getDiagnostics()); atUint32 groupIdx = -1; @@ -1134,7 +1134,7 @@ bool WriteCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& inPath { for (size_t i=0 ; i 65536) - LogDNACommon.report(LogVisor::FatalError, "GX DisplayList overflow"); + LogDNACommon.report(logvisor::Fatal, "GX DisplayList overflow"); size_t secSz = 67 + surf.verts.size() * vertSz; secSz32 = ROUND_UP_32(secSz); if (secSz32 == 0) @@ -1232,7 +1232,7 @@ bool WriteCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& inPath } /* Write sections */ - Athena::io::FileWriter writer(outPath.getAbsolutePath()); + athena::io::FileWriter writer(outPath.getAbsolutePath()); head.write(writer); std::vector::const_iterator padIt = paddingSizes.cbegin(); @@ -1280,12 +1280,12 @@ bool WriteCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& inPath /* Surfaces */ GX::Primitive prim; - if (mesh.topology == HECL::HMDLTopology::Triangles) + if (mesh.topology == hecl::HMDLTopology::Triangles) prim = GX::TRIANGLES; - else if (mesh.topology == HECL::HMDLTopology::TriStrips) + else if (mesh.topology == hecl::HMDLTopology::TriStrips) prim = GX::TRIANGLESTRIP; else - LogDNACommon.report(LogVisor::FatalError, "unrecognized mesh output mode"); + LogDNACommon.report(logvisor::Fatal, "unrecognized mesh output mode"); for (const Mesh::Surface& surf : mesh.surfaces) { const typename MaterialSet::Material::VAFlags& vaFlags = @@ -1335,7 +1335,7 @@ bool WriteCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& inPath } template -bool WriteHMDLCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& inPath, const Mesh& mesh) +bool WriteHMDLCMDL(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath, const Mesh& mesh) { Header head; head.magic = 0xDEADBABE; @@ -1354,19 +1354,19 @@ bool WriteHMDLCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& in std::vector matSets; matSets.reserve(mesh.materialSets.size()); { - HECL::Frontend::Frontend FE; + hecl::Frontend::Frontend FE; for (const std::vector& mset : mesh.materialSets) { matSets.emplace_back(); MaterialSet& targetMSet = matSets.back(); - std::vector texPaths; + std::vector texPaths; texPaths.reserve(mset.size()*4); for (const Mesh::Material& mat : mset) { - for (const HECL::ProjectPath& path : mat.texs) + for (const hecl::ProjectPath& path : mat.texs) { bool found = false; - for (const HECL::ProjectPath& ePath : texPaths) + for (const hecl::ProjectPath& ePath : texPaths) { if (path == ePath) { @@ -1382,22 +1382,22 @@ bool WriteHMDLCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& in size_t endOff = 0; for (const Mesh::Material& mat : mset) { - std::string diagName = HECL::Format("%s:%s", inPath.getLastComponentUTF8(), mat.name.c_str()); + std::string diagName = hecl::Format("%s:%s", inPath.getLastComponentUTF8(), mat.name.c_str()); targetMSet.materials.emplace_back(FE, diagName, mat, mat.iprops, texPaths); endOff = targetMSet.materials.back().binarySize(endOff); targetMSet.head.addMaterialEndOff(endOff); } - for (const HECL::ProjectPath& path : texPaths) + for (const hecl::ProjectPath& path : texPaths) { - const HECL::SystemString& relPath = path.getRelativePath(); + const hecl::SystemString& relPath = path.getRelativePath(); /* TODO: incorporate hecl hashes */ size_t search = relPath.find(_S("TXTR_")); - if (search != HECL::SystemString::npos) + if (search != hecl::SystemString::npos) targetMSet.head.addTexture(relPath.c_str() + search + 5); else - LogDNACommon.report(LogVisor::FatalError, "unable to get hash from path"); + LogDNACommon.report(logvisor::Fatal, "unable to get hash from path"); } size_t secSz = targetMSet.binarySize(0); @@ -1407,7 +1407,7 @@ bool WriteHMDLCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& in } } - HECL::HMDLBuffers bufs = mesh.getHMDLBuffers(); + hecl::HMDLBuffers bufs = mesh.getHMDLBuffers(); /* Metadata */ size_t secSz = bufs.m_meta.binarySize(0); @@ -1445,7 +1445,7 @@ bool WriteHMDLCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& in /* Surfaces */ size_t endOff = 0; - for (const HECL::HMDLBuffers::Surface& surf : bufs.m_surfaces) + for (const hecl::HMDLBuffers::Surface& surf : bufs.m_surfaces) { head.secSizes.push_back(64); paddingSizes.push_back(0); @@ -1454,7 +1454,7 @@ bool WriteHMDLCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& in } /* Write sections */ - Athena::io::FileWriter writer(outPath.getAbsolutePath()); + athena::io::FileWriter writer(outPath.getAbsolutePath()); head.write(writer); std::vector::const_iterator padIt = paddingSizes.cbegin(); @@ -1489,7 +1489,7 @@ bool WriteHMDLCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& in ++padIt; /* Surfaces */ - for (const HECL::HMDLBuffers::Surface& surf : bufs.m_surfaces) + for (const hecl::HMDLBuffers::Surface& surf : bufs.m_surfaces) { const Mesh::Surface& osurf = surf.m_origSurf; @@ -1506,7 +1506,7 @@ bool WriteHMDLCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& in } /* Ensure final surface's alignment writes zeros */ - writer.seek(-1, Athena::Current); + writer.seek(-1, athena::Current); writer.writeUByte(0); writer.close(); return true; diff --git a/DataSpec/DNACommon/DNACommon.cpp b/DataSpec/DNACommon/DNACommon.cpp index 0947a64d9..3b2b5e518 100644 --- a/DataSpec/DNACommon/DNACommon.cpp +++ b/DataSpec/DNACommon/DNACommon.cpp @@ -3,7 +3,7 @@ namespace DataSpec { -LogVisor::LogModule LogDNACommon("Retro::DNACommon"); +logvisor::Module LogDNACommon("urde::DNACommon"); SpecBase* g_curSpec = nullptr; } diff --git a/DataSpec/DNACommon/DNACommon.hpp b/DataSpec/DNACommon/DNACommon.hpp index bb8702a5e..d217a4d01 100644 --- a/DataSpec/DNACommon/DNACommon.hpp +++ b/DataSpec/DNACommon/DNACommon.hpp @@ -2,48 +2,48 @@ #define __DNA_COMMON_HPP__ #include -#include -#include -#include "HECL/HECL.hpp" -#include "HECL/Database.hpp" +#include +#include +#include "hecl/hecl.hpp" +#include "hecl/Database.hpp" #include "../SpecBase.hpp" namespace DataSpec { -extern LogVisor::LogModule LogDNACommon; +extern logvisor::Module LogDNACommon; extern SpecBase* g_curSpec; /* This comes up a great deal */ -typedef Athena::io::DNA BigDNA; -typedef Athena::io::DNAYaml BigYAML; +typedef athena::io::DNA BigDNA; +typedef athena::io::DNAYaml BigYAML; /** FourCC with DNA read/write */ -class DNAFourCC final : public BigYAML, public HECL::FourCC +class DNAFourCC final : public BigYAML, public hecl::FourCC { public: - DNAFourCC() : HECL::FourCC() {} - DNAFourCC(const HECL::FourCC& other) - : HECL::FourCC() {num = other.toUint32();} + DNAFourCC() : hecl::FourCC() {} + DNAFourCC(const hecl::FourCC& other) + : hecl::FourCC() {num = other.toUint32();} DNAFourCC(const char* name) - : HECL::FourCC(name) {} + : hecl::FourCC(name) {} DNAFourCC(uint32_t n) - : HECL::FourCC(n) {} + : hecl::FourCC(n) {} Delete expl; - void read(Athena::io::IStreamReader& reader) + void read(athena::io::IStreamReader& reader) {reader.readUBytesToBuf(fcc, 4);} - void write(Athena::io::IStreamWriter& writer) const + void write(athena::io::IStreamWriter& writer) const {writer.writeUBytes((atUint8*)fcc, 4);} - void read(Athena::io::YAMLDocReader& reader) + void read(athena::io::YAMLDocReader& reader) {std::string rs = reader.readString(nullptr); strncpy(fcc, rs.c_str(), 4);} - void write(Athena::io::YAMLDocWriter& writer) const + void write(athena::io::YAMLDocWriter& writer) const {writer.writeString(nullptr, std::string(fcc, 4));} size_t binarySize(size_t __isz) const {return __isz + 4;} }; -using FourCC = HECL::FourCC; +using FourCC = hecl::FourCC; /** PAK 32-bit Unique ID */ class UniqueID32 : public BigYAML @@ -52,18 +52,18 @@ class UniqueID32 : public BigYAML public: Delete expl; operator bool() const {return m_id != 0xffffffff && m_id != 0;} - void read(Athena::io::IStreamReader& reader) + void read(athena::io::IStreamReader& reader) {m_id = reader.readUint32Big();} - void write(Athena::io::IStreamWriter& writer) const + void write(athena::io::IStreamWriter& writer) const {writer.writeUint32Big(m_id);} - void read(Athena::io::YAMLDocReader& reader) + void read(athena::io::YAMLDocReader& reader) {m_id = reader.readUint32(nullptr);} - void write(Athena::io::YAMLDocWriter& writer) const + void write(athena::io::YAMLDocWriter& writer) const {writer.writeUint32(nullptr, m_id);} size_t binarySize(size_t __isz) const {return __isz + 4;} - UniqueID32& operator=(const HECL::ProjectPath& path) + UniqueID32& operator=(const hecl::ProjectPath& path) {m_id = path.hash().val32(); return *this;} bool operator!=(const UniqueID32& other) const {return m_id != other.m_id;} @@ -78,8 +78,8 @@ public: void clear() {m_id = 0xffffffff;} UniqueID32() = default; - UniqueID32(Athena::io::IStreamReader& reader) {read(reader);} - UniqueID32(const HECL::ProjectPath& path) {*this = path;} + UniqueID32(athena::io::IStreamReader& reader) {read(reader);} + UniqueID32(const hecl::ProjectPath& path) {*this = path;} UniqueID32(const char* hexStr) { char copy[9]; @@ -105,18 +105,18 @@ class UniqueID64 : public BigYAML public: Delete expl; operator bool() const {return m_id != 0xffffffffffffffff && m_id != 0;} - void read(Athena::io::IStreamReader& reader) + void read(athena::io::IStreamReader& reader) {m_id = reader.readUint64Big();} - void write(Athena::io::IStreamWriter& writer) const + void write(athena::io::IStreamWriter& writer) const {writer.writeUint64Big(m_id);} - void read(Athena::io::YAMLDocReader& reader) + void read(athena::io::YAMLDocReader& reader) {m_id = reader.readUint64(nullptr);} - void write(Athena::io::YAMLDocWriter& writer) const + void write(athena::io::YAMLDocWriter& writer) const {writer.writeUint64(nullptr, m_id);} size_t binarySize(size_t __isz) const {return __isz + 8;} - UniqueID64& operator=(const HECL::ProjectPath& path) + UniqueID64& operator=(const hecl::ProjectPath& path) {m_id = path.hash().val64(); return *this;} bool operator!=(const UniqueID64& other) const {return m_id != other.m_id;} @@ -131,8 +131,8 @@ public: void clear() {m_id = 0xffffffffffffffff;} UniqueID64() = default; - UniqueID64(Athena::io::IStreamReader& reader) {read(reader);} - UniqueID64(const HECL::ProjectPath& path) {*this = path;} + UniqueID64(athena::io::IStreamReader& reader) {read(reader);} + UniqueID64(const hecl::ProjectPath& path) {*this = path;} UniqueID64(const char* hexStr) { char copy[17]; @@ -174,17 +174,17 @@ public: UniqueID128() {m_id[0]=0xffffffffffffffff; m_id[1]=0xffffffffffffffff;} operator bool() const {return m_id[0] != 0xffffffffffffffff && m_id[0] != 0 && m_id[1] != 0xffffffffffffffff && m_id[1] != 0;} - void read(Athena::io::IStreamReader& reader) + void read(athena::io::IStreamReader& reader) { m_id[0] = reader.readUint64Big(); m_id[1] = reader.readUint64Big(); } - void write(Athena::io::IStreamWriter& writer) const + void write(athena::io::IStreamWriter& writer) const { writer.writeUint64Big(m_id[0]); writer.writeUint64Big(m_id[1]); } - void read(Athena::io::YAMLDocReader& reader) + void read(athena::io::YAMLDocReader& reader) { std::string str = reader.readString(nullptr); while (str.size() < 32) @@ -194,7 +194,7 @@ public: m_id[0] = strtoull(hStr.c_str(), nullptr, 16); m_id[1] = strtoull(lStr.c_str(), nullptr, 16); } - void write(Athena::io::YAMLDocWriter& writer) const + void write(athena::io::YAMLDocWriter& writer) const { writer.writeString(nullptr, toString().c_str()); } @@ -238,31 +238,31 @@ public: template class PAKPath : public BigYAML { - HECL::ProjectPath m_path; + hecl::ProjectPath m_path; IDTYPE m_id; public: - HECL::ProjectPath getPath() const + hecl::ProjectPath getPath() const { if (m_path) return m_path; if (!g_curSpec) - LogDNACommon.report(LogVisor::FatalError, "current DataSpec not set for PAKPath"); + LogDNACommon.report(logvisor::Fatal, "current DataSpec not set for PAKPath"); if (m_id) return g_curSpec->getWorking(m_id); - return HECL::ProjectPath(); + return hecl::ProjectPath(); } - operator HECL::ProjectPath() const {return getPath();} + operator hecl::ProjectPath() const {return getPath();} operator const IDTYPE&() const {return m_id;} Delete _d; - void read(Athena::io::IStreamReader& reader) + void read(athena::io::IStreamReader& reader) {m_id.read(reader);} - void write(Athena::io::IStreamWriter& writer) const + void write(athena::io::IStreamWriter& writer) const {m_id.write(writer);} - void read(Athena::io::YAMLDocReader& reader) + void read(athena::io::YAMLDocReader& reader) { if (!g_curSpec) - LogDNACommon.report(LogVisor::FatalError, "current DataSpec not set for PAKPath"); + LogDNACommon.report(logvisor::Fatal, "current DataSpec not set for PAKPath"); std::string path = reader.readString(nullptr); if (path.empty()) { @@ -273,7 +273,7 @@ public: m_path.assign(g_curSpec->getProject(), path); m_id = m_path; } - void write(Athena::io::YAMLDocWriter& writer) const + void write(athena::io::YAMLDocWriter& writer) const { if (m_path) { @@ -295,7 +295,7 @@ class WordBitmap std::vector m_words; size_t m_bitCount = 0; public: - void read(Athena::io::IStreamReader& reader, size_t bitCount) + void read(athena::io::IStreamReader& reader, size_t bitCount) { m_bitCount = bitCount; size_t wordCount = (bitCount + 31) / 32; @@ -304,7 +304,7 @@ public: for (size_t w=0 ; w ResCooker; +typedef std::function ResCooker; } diff --git a/DataSpec/DNACommon/DeafBabe.hpp b/DataSpec/DNACommon/DeafBabe.hpp index c89ac0116..433a786e5 100644 --- a/DataSpec/DNACommon/DeafBabe.hpp +++ b/DataSpec/DNACommon/DeafBabe.hpp @@ -8,7 +8,7 @@ namespace DataSpec { template -void DeafBabeSendToBlender(HECL::BlenderConnection::PyOutStream& os, const DEAFBABE& db) +void DeafBabeSendToBlender(hecl::BlenderConnection::PyOutStream& os, const DEAFBABE& db) { os << "material_index = []\n" "col_bm = bmesh.new()\n"; diff --git a/DataSpec/DNACommon/GX.hpp b/DataSpec/DNACommon/GX.hpp index 91eeebb40..c546a217e 100644 --- a/DataSpec/DNACommon/GX.hpp +++ b/DataSpec/DNACommon/GX.hpp @@ -1,7 +1,7 @@ #ifndef _DNACOMMON_GX_HPP_ #define _DNACOMMON_GX_HPP_ -#include "HECL/Backend/GX.hpp" -using GX = HECL::Backend::GX; +#include "hecl/Backend/GX.hpp" +using GX = hecl::Backend::GX; #endif // _DNACOMMON_GX_HPP_ diff --git a/DataSpec/DNACommon/MAPA.hpp b/DataSpec/DNACommon/MAPA.hpp index 9e751321b..2ad2a1a99 100644 --- a/DataSpec/DNACommon/MAPA.hpp +++ b/DataSpec/DNACommon/MAPA.hpp @@ -74,13 +74,13 @@ struct MAPA : BigDNA }; - void read(Athena::io::IStreamReader& __dna_reader) + void read(athena::io::IStreamReader& __dna_reader) { /* magic */ magic = __dna_reader.readUint32Big(); if (magic != 0xDEADD00D) { - LogDNACommon.report(LogVisor::Error, "invalid MAPA magic"); + LogDNACommon.report(logvisor::Error, "invalid MAPA magic"); return; } /* version */ @@ -93,7 +93,7 @@ struct MAPA : BigDNA header.reset(new HeaderMP3); else { - LogDNACommon.report(LogVisor::Error, "invalid MAPA version"); + LogDNACommon.report(logvisor::Error, "invalid MAPA version"); return; } @@ -118,7 +118,7 @@ struct MAPA : BigDNA __dna_reader.enumerate(surfaces, header->surfaceCount()); } - void write(Athena::io::IStreamWriter& __dna_writer) const + void write(athena::io::IStreamWriter& __dna_writer) const { /* magic */ __dna_writer.writeUint32Big(magic); @@ -189,9 +189,9 @@ struct MAPA : BigDNA Value type; Value unknown1; Value sclyId; - Seek seek1; + Seek seek1; Value transformMtx[3]; - Seek seek2; + Seek seek2; virtual ~MappableObjectMP1_2() {} }; @@ -202,9 +202,9 @@ struct MAPA : BigDNA Value unknown1; Value sclyId; Buffer unknownHash; - Seek seek1; + Seek seek1; Value transformMtx[3]; - Seek seek2; + Seek seek2; virtual ~MappableObjectMP3() {} }; @@ -252,21 +252,21 @@ struct MAPA : BigDNA }; template -bool ReadMAPAToBlender(HECL::BlenderConnection& conn, +bool ReadMAPAToBlender(hecl::BlenderConnection& conn, const MAPA& mapa, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const typename PAKRouter::EntryType& entry, bool force) { /* Rename MAPA for consistency */ - HECL::ProjectPath mapaPath(outPath.getParentPath(), _S("!map.blend")); - if (!force && mapaPath.getPathType() == HECL::ProjectPath::Type::File) + hecl::ProjectPath mapaPath(outPath.getParentPath(), _S("!map.blend")); + if (!force && mapaPath.getPathType() == hecl::ProjectPath::Type::File) return true; - if (!conn.createBlend(mapaPath, HECL::BlenderConnection::BlendType::MapArea)) + if (!conn.createBlend(mapaPath, hecl::BlenderConnection::BlendType::MapArea)) return false; - HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); + hecl::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); os << "import bpy, bmesh\n" "from mathutils import Matrix\n" @@ -450,8 +450,8 @@ bool ReadMAPAToBlender(HECL::BlenderConnection& conn, "bm.free()\n"; /* World background */ - HECL::ProjectPath worldBlend(outPath.getParentPath().getParentPath(), "!world.blend"); - if (worldBlend.getPathType() == HECL::ProjectPath::Type::File) + hecl::ProjectPath worldBlend(outPath.getParentPath().getParentPath(), "!world.blend"); + if (worldBlend.getPathType() == hecl::ProjectPath::Type::File) os.linkBackground("//../!world.blend", "World"); os.centerView(); diff --git a/DataSpec/DNACommon/MLVL.hpp b/DataSpec/DNACommon/MLVL.hpp index 42742ada9..a85a6d0e0 100644 --- a/DataSpec/DNACommon/MLVL.hpp +++ b/DataSpec/DNACommon/MLVL.hpp @@ -3,7 +3,7 @@ #include "DNACommon.hpp" #include "BlenderConnection.hpp" -#include "CVector3f.hpp" +#include "zeus/CVector3f.hpp" namespace DataSpec { @@ -11,31 +11,23 @@ namespace DNAMLVL { template -bool ReadMLVLToBlender(HECL::BlenderConnection& conn, +bool ReadMLVLToBlender(hecl::BlenderConnection& conn, const MLVL& mlvl, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const typename PAKRouter::EntryType& entry, bool force, - std::function fileChanged) + std::function fileChanged) { /* Rename MLVL for consistency */ - HECL::ProjectPath mlvlPath(outPath.getParentPath(), _S("!world.blend")); - if (!force && mlvlPath.getPathType() == HECL::ProjectPath::Type::File) + hecl::ProjectPath mlvlPath(outPath.getParentPath(), _S("!world.blend")); + if (!force && mlvlPath.getPathType() == hecl::ProjectPath::Type::File) return true; - /* Link Skybox CMDL */ - const typename PAKRouter::EntryType* skyboxEntry = pakRouter.lookupEntry(mlvl.worldSkyboxId); - if (skyboxEntry) - { - HECL::ProjectPath skyboxPath = pakRouter.getWorking(skyboxEntry); - HECL::ProjectPath(outPath.getParentPath(), _S("!skybox.blend")).makeLinkTo(skyboxPath); - } - /* Create World Blend */ - if (!conn.createBlend(mlvlPath, HECL::BlenderConnection::BlendType::World)) + if (!conn.createBlend(mlvlPath, hecl::BlenderConnection::BlendType::World)) return false; - HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); + hecl::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); os.format("import bpy\n" "import bmesh\n" "from mathutils import Matrix\n" @@ -52,7 +44,7 @@ bool ReadMLVLToBlender(HECL::BlenderConnection& conn, for (const auto& area : mlvl.areas) { const typename PAKRouter::EntryType* mreaEntry = pakRouter.lookupEntry(area.areaMREAId); - HECL::SystemUTF8View areaDirName(*mreaEntry->unique.m_areaName); + hecl::SystemUTF8View areaDirName(*mreaEntry->unique.m_areaName); os.AABBToBMesh(area.aabb[0], area.aabb[1]); os.format("box_mesh = bpy.data.meshes.new('''%s''')\n" @@ -76,14 +68,14 @@ bool ReadMLVLToBlender(HECL::BlenderConnection& conn, for (const auto& dock : area.docks) { os << "bm = bmesh.new()\n"; - Zeus::CVector3f pvAvg; + zeus::CVector3f pvAvg; for (const atVec3f& pv : dock.planeVerts) pvAvg += pv; pvAvg /= dock.planeVerts.size(); int idx = 0; for (const atVec3f& pv : dock.planeVerts) { - Zeus::CVector3f pvRel = Zeus::CVector3f(pv) - pvAvg; + zeus::CVector3f pvRel = zeus::CVector3f(pv) - pvAvg; os.format("bm.verts.new((%f,%f,%f))\n" "bm.verts.ensure_lookup_table()\n", pvRel[0], pvRel[1], pvRel[2]); diff --git a/DataSpec/DNACommon/NamedResourceCatalog.hpp b/DataSpec/DNACommon/NamedResourceCatalog.hpp index 4ce7cda8a..f1fe6013b 100644 --- a/DataSpec/DNACommon/NamedResourceCatalog.hpp +++ b/DataSpec/DNACommon/NamedResourceCatalog.hpp @@ -16,7 +16,7 @@ struct NamedResourceCatalog : BigYAML String<-1> name; IDType uid; - void read(Athena::io::IStreamReader& __dna_reader) + void read(athena::io::IStreamReader& __dna_reader) { /* type */ type.read(__dna_reader); @@ -26,7 +26,7 @@ struct NamedResourceCatalog : BigYAML uid.read(__dna_reader); } - void write(Athena::io::IStreamWriter& __dna_writer) const + void write(athena::io::IStreamWriter& __dna_writer) const { /* type */ type.write(__dna_writer); @@ -36,7 +36,7 @@ struct NamedResourceCatalog : BigYAML uid.write(__dna_writer); } - void read(Athena::io::YAMLDocReader& __dna_docin) + void read(athena::io::YAMLDocReader& __dna_docin) { /* type */ __dna_docin.enumerate("type", type); @@ -46,7 +46,7 @@ struct NamedResourceCatalog : BigYAML __dna_docin.enumerate("uid", uid); } - void write(Athena::io::YAMLDocWriter& __dna_docout) const + void write(athena::io::YAMLDocWriter& __dna_docout) const { /* type */ __dna_docout.enumerate("type", type); @@ -56,7 +56,7 @@ struct NamedResourceCatalog : BigYAML __dna_docout.enumerate("uid", uid); } - static const char* DNAType() { return "DataSpec::DNACommon::NameResourceCatalog::NamedResource"; } + static const char* DNAType() { return "DataSpec::DNACommon::NameResourceCatalogvisor::NamedResource"; } size_t binarySize(size_t __isz) const { @@ -68,7 +68,7 @@ struct NamedResourceCatalog : BigYAML }; Vector namedResources; - void read(Athena::io::IStreamReader& __dna_reader) + void read(athena::io::IStreamReader& __dna_reader) { /* namedResCount */ namedResCount = __dna_reader.readUint32Big(); @@ -76,7 +76,7 @@ struct NamedResourceCatalog : BigYAML __dna_reader.enumerate(namedResources, namedResCount); } - void write(Athena::io::IStreamWriter& __dna_writer) const + void write(athena::io::IStreamWriter& __dna_writer) const { /* namedResCount */ __dna_writer.writeUint32Big(namedResCount); @@ -84,18 +84,14 @@ struct NamedResourceCatalog : BigYAML __dna_writer.enumerate(namedResources); } - void read(Athena::io::YAMLDocReader& __dna_docin) + void read(athena::io::YAMLDocReader& __dna_docin) { - /* namedResCount */ - namedResCount = __dna_docin.readUint32("namedResCount"); /* namedResources */ - __dna_docin.enumerate("namedResources", namedResources, namedResCount); + namedResCount = __dna_docin.enumerate("namedResources", namedResources); } - void write(Athena::io::YAMLDocWriter& __dna_docout) const + void write(athena::io::YAMLDocWriter& __dna_docout) const { - /* namedResCount */ - __dna_docout.writeUint32("namedResCount", namedResCount); /* namedResources */ __dna_docout.enumerate("namedResources", namedResources); } diff --git a/DataSpec/DNACommon/PAK.hpp b/DataSpec/DNACommon/PAK.hpp index 93b643efa..56193354d 100644 --- a/DataSpec/DNACommon/PAK.hpp +++ b/DataSpec/DNACommon/PAK.hpp @@ -8,7 +8,7 @@ namespace DataSpec { /* PAK entry stream reader */ -class PAKEntryReadStream : public Athena::io::IStreamReader +class PAKEntryReadStream : public athena::io::IStreamReader { std::unique_ptr m_buf; atUint64 m_sz; @@ -24,18 +24,18 @@ public: : m_buf(std::move(buf)), m_sz(sz), m_pos(pos) { if (m_pos >= m_sz) - LogDNACommon.report(LogVisor::FatalError, "PAK stream cursor overrun"); + LogDNACommon.report(logvisor::Fatal, "PAK stream cursor overrun"); } - void seek(atInt64 pos, Athena::SeekOrigin origin) + void seek(atInt64 pos, athena::SeekOrigin origin) { - if (origin == Athena::Begin) + if (origin == athena::Begin) m_pos = pos; - else if (origin == Athena::Current) + else if (origin == athena::Current) m_pos += pos; - else if (origin == Athena::End) + else if (origin == athena::End) m_pos = m_sz + pos; if (m_pos > m_sz) - LogDNACommon.report(LogVisor::FatalError, "PAK stream cursor overrun"); + LogDNACommon.report(logvisor::Fatal, "PAK stream cursor overrun"); } atUint64 position() const {return m_pos;} atUint64 length() const {return m_sz;} @@ -61,9 +61,9 @@ struct UniqueResult Area, Layer } m_type = Type::NotFound; - const HECL::SystemString* m_levelName = nullptr; - const HECL::SystemString* m_areaName = nullptr; - const HECL::SystemString* m_layerName = nullptr; + const hecl::SystemString* m_levelName = nullptr; + const hecl::SystemString* m_areaName = nullptr; + const hecl::SystemString* m_layerName = nullptr; UniqueResult() = default; UniqueResult(Type tp) : m_type(tp) {} @@ -72,7 +72,7 @@ struct UniqueResult { UniqueResult::Type resultType = UniqueResult::Type::NotFound; bool foundOneLayer = false; - const HECL::SystemString* levelName = nullptr; + const hecl::SystemString* levelName = nullptr; typename PAKBRIDGE::PAKType::IDType levelId; typename PAKBRIDGE::PAKType::IDType areaId; unsigned layerIdx; @@ -163,12 +163,12 @@ struct UniqueResult } } - HECL::ProjectPath uniquePath(const HECL::ProjectPath& pakPath) const + hecl::ProjectPath uniquePath(const hecl::ProjectPath& pakPath) const { if (m_type == Type::Pak) return pakPath; - HECL::ProjectPath levelDir; + hecl::ProjectPath levelDir; if (m_levelName) levelDir.assign(pakPath, *m_levelName); else @@ -177,15 +177,15 @@ struct UniqueResult if (m_type == Type::Area) { - HECL::ProjectPath areaDir(levelDir, *m_areaName); + hecl::ProjectPath areaDir(levelDir, *m_areaName); areaDir.makeDir(); return areaDir; } else if (m_type == Type::Layer) { - HECL::ProjectPath areaDir(levelDir, *m_areaName); + hecl::ProjectPath areaDir(levelDir, *m_areaName); areaDir.makeDir(); - HECL::ProjectPath layerDir(areaDir, *m_layerName); + hecl::ProjectPath layerDir(areaDir, *m_layerName); layerDir.makeDir(); return layerDir; } @@ -201,11 +201,11 @@ class PAKRouter; template struct ResExtractor { - std::function func_a; - std::function&, + std::function func_a; + std::function&, const typename PAKBRIDGE::PAKType::Entry&, bool, - std::function)> func_b; - const HECL::SystemChar* fileExts[4]; + std::function)> func_b; + const hecl::SystemChar* fileExts[4]; unsigned weight; std::function&, typename PAKBRIDGE::PAKType::Entry&)> func_name; @@ -215,13 +215,13 @@ struct ResExtractor template struct Level { - HECL::SystemString name; + hecl::SystemString name; struct Area { - HECL::SystemString name; + hecl::SystemString name; struct Layer { - HECL::SystemString name; + hecl::SystemString name; bool active; std::unordered_set resources; }; @@ -244,19 +244,19 @@ private: NamedResourceCatalog m_catalog; const SpecBase& m_dataSpec; const std::vector* m_bridges = nullptr; - std::vector> m_bridgePaths; + std::vector> m_bridgePaths; size_t m_curBridgeIdx = 0; - const HECL::ProjectPath& m_gameWorking; - const HECL::ProjectPath& m_gameCooked; - HECL::ProjectPath m_sharedWorking; - HECL::ProjectPath m_sharedCooked; + const hecl::ProjectPath& m_gameWorking; + const hecl::ProjectPath& m_gameCooked; + hecl::ProjectPath m_sharedWorking; + hecl::ProjectPath m_sharedCooked; const PAKType* m_pak = nullptr; - const NOD::Node* m_node = nullptr; + const nod::Node* m_node = nullptr; std::unordered_map> m_uniqueEntries; std::unordered_map> m_sharedEntries; std::unordered_map m_cmdlRigs; public: - PAKRouter(const SpecBase& dataSpec, const HECL::ProjectPath& working, const HECL::ProjectPath& cooked) + PAKRouter(const SpecBase& dataSpec, const hecl::ProjectPath& working, const hecl::ProjectPath& cooked) : m_dataSpec(dataSpec), m_gameWorking(working), m_gameCooked(cooked), m_sharedWorking(working, "Shared"), m_sharedCooked(cooked, "Shared") {} @@ -277,13 +277,13 @@ public: for (BRIDGETYPE& bridge : bridges) { const std::string& name = bridge.getName(); - HECL::SystemStringView sysName(name); + hecl::SystemStringView sysName(name); - HECL::SystemString::const_iterator extit = sysName.sys_str().end() - 4; - HECL::SystemString baseName(sysName.sys_str().begin(), extit); + hecl::SystemString::const_iterator extit = sysName.sys_str().end() - 4; + hecl::SystemString baseName(sysName.sys_str().begin(), extit); - m_bridgePaths.emplace_back(std::make_pair(HECL::ProjectPath(m_gameWorking, baseName), - HECL::ProjectPath(m_gameCooked, baseName))); + m_bridgePaths.emplace_back(std::make_pair(hecl::ProjectPath(m_gameWorking, baseName), + hecl::ProjectPath(m_gameCooked, baseName))); /* Index this PAK */ bridge.build(); @@ -319,8 +319,8 @@ public: ++bridgeIdx; } - HECL::SystemString catalogPath = HECL::ProjectPath(m_gameCooked, "catalog.yaml").getAbsolutePath(); - FILE* catalog = HECL::Fopen(catalogPath.c_str(), _S("wb")); + hecl::SystemString catalogPath = hecl::ProjectPath(m_gameCooked, "catalog.yaml").getAbsolutePath(); + FILE* catalog = hecl::Fopen(catalogPath.c_str(), _S("wb")); if (catalog) { m_catalog.toYAMLFile(catalog); @@ -346,150 +346,132 @@ public: ++pit; ++bridgeIdx; } - LogDNACommon.report(LogVisor::FatalError, "PAKBridge provided to PAKRouter::enterPAKBridge() was not part of build()"); + LogDNACommon.report(logvisor::Fatal, "PAKBridge provided to PAKRouter::enterPAKBridge() was not part of build()"); } - HECL::ProjectPath getWorking(const EntryType* entry, + hecl::ProjectPath getWorking(const EntryType* entry, const ResExtractor& extractor) const { if (!m_pak) - LogDNACommon.report(LogVisor::FatalError, + LogDNACommon.report(logvisor::Fatal, "PAKRouter::enterPAKBridge() must be called before PAKRouter::getWorkingPath()"); if (m_pak->m_noShare) { const EntryType* singleSearch = m_pak->lookupEntry(entry->id); if (singleSearch) { - const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].first; + const hecl::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].first; pakPath.makeDir(); #if HECL_UCS2 - HECL::SystemString entName = HECL::UTF8ToWide(m_pak->bestEntryName(*entry)); + hecl::SystemString entName = hecl::UTF8ToWide(m_pak->bestEntryName(*entry)); #else - HECL::SystemString entName = m_pak->bestEntryName(*entry); + hecl::SystemString entName = m_pak->bestEntryName(*entry); #endif if (extractor.fileExts[0] && !extractor.fileExts[1]) entName += extractor.fileExts[0]; - return HECL::ProjectPath(pakPath, entName); + return hecl::ProjectPath(pakPath, entName); } } auto uniqueSearch = m_uniqueEntries.find(entry->id); if (uniqueSearch != m_uniqueEntries.end()) { - const HECL::ProjectPath& pakPath = m_bridgePaths[uniqueSearch->second.first].first; + const hecl::ProjectPath& pakPath = m_bridgePaths[uniqueSearch->second.first].first; pakPath.makeDir(); - HECL::ProjectPath uniquePath = entry->unique.uniquePath(pakPath); + hecl::ProjectPath uniquePath = entry->unique.uniquePath(pakPath); #if HECL_UCS2 - HECL::SystemString entName = HECL::UTF8ToWide(m_pak->bestEntryName(*entry)); + hecl::SystemString entName = hecl::UTF8ToWide(m_pak->bestEntryName(*entry)); #else - HECL::SystemString entName = m_pak->bestEntryName(*entry); + hecl::SystemString entName = m_pak->bestEntryName(*entry); #endif if (extractor.fileExts[0] && !extractor.fileExts[1]) entName += extractor.fileExts[0]; - return HECL::ProjectPath(uniquePath, entName); + return hecl::ProjectPath(uniquePath, entName); } auto sharedSearch = m_sharedEntries.find(entry->id); if (sharedSearch != m_sharedEntries.end()) { - const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].first; - HECL::ProjectPath uniquePathPre = entry->unique.uniquePath(pakPath); + const hecl::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].first; + hecl::ProjectPath uniquePathPre = entry->unique.uniquePath(pakPath); #if HECL_UCS2 - HECL::SystemString entBase = HECL::UTF8ToWide(m_pak->bestEntryName(*entry)); + hecl::SystemString entBase = hecl::UTF8ToWide(m_pak->bestEntryName(*entry)); #else - HECL::SystemString entBase = m_pak->bestEntryName(*entry); + hecl::SystemString entBase = m_pak->bestEntryName(*entry); #endif - HECL::SystemString entName = entBase; + hecl::SystemString entName = entBase; if (extractor.fileExts[0] && !extractor.fileExts[1]) entName += extractor.fileExts[0]; - HECL::ProjectPath sharedPath(m_sharedWorking, entName); - HECL::ProjectPath uniquePath(uniquePathPre, entName); - if (extractor.func_a || extractor.func_b) - { - if (extractor.fileExts[0] && !extractor.fileExts[1]) - uniquePath.makeLinkTo(sharedPath); - else - { - for (int e=0 ; e<4 ; ++e) - { - if (!extractor.fileExts[e]) - break; - HECL::SystemString entName = entBase + extractor.fileExts[e]; - HECL::ProjectPath sharedPath(m_sharedWorking, entName); - HECL::ProjectPath uniquePath(uniquePathPre, entName); - uniquePath.makeLinkTo(sharedPath); - } - } - } + hecl::ProjectPath sharedPath(m_sharedWorking, entName); m_sharedWorking.makeDir(); return sharedPath; } - LogDNACommon.report(LogVisor::FatalError, "Unable to find entry %s", entry->id.toString().c_str()); - return HECL::ProjectPath(); + LogDNACommon.report(logvisor::Fatal, "Unable to find entry %s", entry->id.toString().c_str()); + return hecl::ProjectPath(); } - HECL::ProjectPath getWorking(const EntryType* entry) const + hecl::ProjectPath getWorking(const EntryType* entry) const { return getWorking(entry, BRIDGETYPE::LookupExtractor(*entry)); } - HECL::ProjectPath getWorking(const IDType& id) const + hecl::ProjectPath getWorking(const IDType& id) const { return getWorking(lookupEntry(id)); } - HECL::ProjectPath getCooked(const EntryType* entry) const + hecl::ProjectPath getCooked(const EntryType* entry) const { if (!m_pak) - LogDNACommon.report(LogVisor::FatalError, + LogDNACommon.report(logvisor::Fatal, "PAKRouter::enterPAKBridge() must be called before PAKRouter::getCookedPath()"); if (m_pak->m_noShare) { const EntryType* singleSearch = m_pak->lookupEntry(entry->id); if (singleSearch) { - const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].second; + const hecl::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].second; pakPath.makeDir(); - return HECL::ProjectPath(pakPath, m_pak->bestEntryName(*entry)); + return hecl::ProjectPath(pakPath, m_pak->bestEntryName(*entry)); } } auto uniqueSearch = m_uniqueEntries.find(entry->id); if (uniqueSearch != m_uniqueEntries.end()) { - const HECL::ProjectPath& pakPath = m_bridgePaths[uniqueSearch->second.first].second; + const hecl::ProjectPath& pakPath = m_bridgePaths[uniqueSearch->second.first].second; pakPath.makeDir(); - HECL::ProjectPath uniquePath = entry->unique.uniquePath(pakPath); - return HECL::ProjectPath(uniquePath, m_pak->bestEntryName(*entry)); + hecl::ProjectPath uniquePath = entry->unique.uniquePath(pakPath); + return hecl::ProjectPath(uniquePath, m_pak->bestEntryName(*entry)); } auto sharedSearch = m_sharedEntries.find(entry->id); if (sharedSearch != m_sharedEntries.end()) { m_sharedCooked.makeDir(); - return HECL::ProjectPath(m_sharedCooked, m_pak->bestEntryName(*entry)); + return hecl::ProjectPath(m_sharedCooked, m_pak->bestEntryName(*entry)); } - LogDNACommon.report(LogVisor::FatalError, "Unable to find entry %s", entry->id.toString().c_str()); - return HECL::ProjectPath(); + LogDNACommon.report(logvisor::Fatal, "Unable to find entry %s", entry->id.toString().c_str()); + return hecl::ProjectPath(); } - HECL::ProjectPath getCooked(const IDType& id) const + hecl::ProjectPath getCooked(const IDType& id) const { return getCooked(lookupEntry(id)); } - HECL::SystemString getResourceRelativePath(const EntryType& a, const IDType& b) const + hecl::SystemString getResourceRelativePath(const EntryType& a, const IDType& b) const { if (!m_pak) - LogDNACommon.report(LogVisor::FatalError, + LogDNACommon.report(logvisor::Fatal, "PAKRouter::enterPAKBridge() must be called before PAKRouter::getResourceRelativePath()"); const typename BRIDGETYPE::PAKType::Entry* be = lookupEntry(b); if (!be) - return HECL::SystemString(); - HECL::ProjectPath aPath = getWorking(&a, BRIDGETYPE::LookupExtractor(a)); - HECL::SystemString ret; + return hecl::SystemString(); + hecl::ProjectPath aPath = getWorking(&a, BRIDGETYPE::LookupExtractor(a)); + hecl::SystemString ret; for (int i=0 ; ibestEntryName(entry); } @@ -505,7 +487,7 @@ public: std::string getBestEntryName(const IDType& entry) const { if (!m_pak) - LogDNACommon.report(LogVisor::FatalError, + LogDNACommon.report(logvisor::Fatal, "PAKRouter::enterPAKBridge() must be called before PAKRouter::getBestEntryName()"); const typename BRIDGETYPE::PAKType::Entry* e = m_pak->lookupEntry(entry); if (!e) @@ -514,7 +496,7 @@ public: } bool extractResources(const BRIDGETYPE& pakBridge, bool force, - std::function progress) + std::function progress) { enterPAKBridge(pakBridge); size_t count = 0; @@ -529,24 +511,24 @@ public: continue; std::string bestName = getBestEntryName(*item); - HECL::SystemStringView bestNameView(bestName); + hecl::SystemStringView bestNameView(bestName); float thisFac = ++count / fsz; progress(bestNameView.sys_str().c_str(), thisFac); /* TODO: Position after extracted item */ - HECL::ProjectPath cooked = getCooked(item); - if (force || cooked.getPathType() == HECL::ProjectPath::Type::None) + hecl::ProjectPath cooked = getCooked(item); + if (force || cooked.getPathType() == hecl::ProjectPath::Type::None) { PAKEntryReadStream s = item->beginReadStream(*m_node); - FILE* fout = HECL::Fopen(cooked.getAbsolutePath().c_str(), _S("wb")); + FILE* fout = hecl::Fopen(cooked.getAbsolutePath().c_str(), _S("wb")); fwrite(s.data(), 1, s.length(), fout); fclose(fout); } - HECL::ProjectPath working = getWorking(item, extractor); + hecl::ProjectPath working = getWorking(item, extractor); if (extractor.func_a) /* Doesn't need PAKRouter access */ { - if (force || working.getPathType() == HECL::ProjectPath::Type::None) + if (force || working.getPathType() == hecl::ProjectPath::Type::None) { PAKEntryReadStream s = item->beginReadStream(*m_node); extractor.func_a(s, working); @@ -554,11 +536,11 @@ public: } else if (extractor.func_b) /* Needs PAKRouter access */ { - if (force || working.getPathType() == HECL::ProjectPath::Type::None) + if (force || working.getPathType() == hecl::ProjectPath::Type::None) { PAKEntryReadStream s = item->beginReadStream(*m_node); extractor.func_b(m_dataSpec, s, working, *this, *item, force, - [&progress, thisFac](const HECL::SystemChar* update) + [&progress, thisFac](const hecl::SystemChar* update) { progress(update, thisFac); }); @@ -571,7 +553,7 @@ public: } const typename BRIDGETYPE::PAKType::Entry* lookupEntry(const IDType& entry, - const NOD::Node** nodeOut=nullptr, + const nod::Node** nodeOut=nullptr, bool silenceWarnings=false, bool currentPAK=false) const { @@ -579,7 +561,7 @@ public: return nullptr; if (!m_bridges) - LogDNACommon.report(LogVisor::FatalError, + LogDNACommon.report(logvisor::Fatal, "PAKRouter::build() must be called before PAKRouter::lookupEntry()"); if (m_pak) @@ -596,7 +578,7 @@ public: if (currentPAK) { if (!silenceWarnings) - LogDNACommon.report(LogVisor::Warning, "unable to find PAK entry %s in current PAK", entry.toString().c_str()); + LogDNACommon.report(logvisor::Warning, "unable to find PAK entry %s in current PAK", entry.toString().c_str()); return nullptr; } @@ -613,7 +595,7 @@ public: } if (!silenceWarnings) - LogDNACommon.report(LogVisor::Warning, "unable to find PAK entry %s", entry.toString().c_str()); + LogDNACommon.report(logvisor::Warning, "unable to find PAK entry %s", entry.toString().c_str()); if (nodeOut) *nodeOut = nullptr; return nullptr; @@ -622,7 +604,7 @@ public: template bool lookupAndReadDNA(const IDType& id, DNA& out, bool silenceWarnings=false) { - const NOD::Node* node; + const nod::Node* node; const EntryType* entry = lookupEntry(id, &node, silenceWarnings); if (!entry) return false; @@ -639,10 +621,10 @@ public: return &search->second; } - HECL::ProjectPath getAreaLayerWorking(const IDType& areaId, int layerIdx) const + hecl::ProjectPath getAreaLayerWorking(const IDType& areaId, int layerIdx) const { if (!m_bridges) - LogDNACommon.report(LogVisor::FatalError, + LogDNACommon.report(logvisor::Fatal, "PAKRouter::build() must be called before PAKRouter::getAreaLayerWorking()"); auto bridgePathIt = m_bridgePaths.cbegin(); for (const BRIDGETYPE& bridge : *m_bridges) @@ -651,21 +633,21 @@ public: for (const auto& area : level.second.areas) if (area.first == areaId) { - HECL::ProjectPath levelPath(bridgePathIt->first, level.second.name); - HECL::ProjectPath areaPath(levelPath, area.second.name); + hecl::ProjectPath levelPath(bridgePathIt->first, level.second.name); + hecl::ProjectPath areaPath(levelPath, area.second.name); if (layerIdx < 0) return areaPath; - return HECL::ProjectPath(areaPath, area.second.layers.at(layerIdx).name); + return hecl::ProjectPath(areaPath, area.second.layers.at(layerIdx).name); } ++bridgePathIt; } - return HECL::ProjectPath(); + return hecl::ProjectPath(); } - HECL::ProjectPath getAreaLayerCooked(const IDType& areaId, int layerIdx) const + hecl::ProjectPath getAreaLayerCooked(const IDType& areaId, int layerIdx) const { if (!m_bridges) - LogDNACommon.report(LogVisor::FatalError, + LogDNACommon.report(logvisor::Fatal, "PAKRouter::build() must be called before PAKRouter::getAreaLayerCooked()"); auto bridgePathIt = m_bridgePaths.cbegin(); for (const BRIDGETYPE& bridge : *m_bridges) @@ -674,15 +656,15 @@ public: for (const auto& area : level.second.areas) if (area.first == areaId) { - HECL::ProjectPath levelPath(bridgePathIt->second, level.second.name); - HECL::ProjectPath areaPath(levelPath, area.second.name); + hecl::ProjectPath levelPath(bridgePathIt->second, level.second.name); + hecl::ProjectPath areaPath(levelPath, area.second.name); if (layerIdx < 0) return areaPath; - return HECL::ProjectPath(areaPath, area.second.layers.at(layerIdx).name); + return hecl::ProjectPath(areaPath, area.second.layers.at(layerIdx).name); } ++bridgePathIt; } - return HECL::ProjectPath(); + return hecl::ProjectPath(); } }; diff --git a/DataSpec/DNACommon/PART.hpp b/DataSpec/DNACommon/PART.hpp index 1f0abf3ce..5bd9408ab 100644 --- a/DataSpec/DNACommon/PART.hpp +++ b/DataSpec/DNACommon/PART.hpp @@ -3,7 +3,7 @@ #include "ParticleCommon.hpp" #include "PAK.hpp" -#include "Athena/FileWriter.hpp" +#include "athena/FileWriter.hpp" namespace DataSpec { @@ -13,7 +13,7 @@ namespace DNAParticle template struct GPSM : BigYAML { - static const char* DNAType() {return "Retro::GPSM";} + static const char* DNAType() {return "urde::GPSM";} const char* DNATypeV() const {return DNAType();} VectorElementFactory x0_PSIV; @@ -107,13 +107,13 @@ struct GPSM : BigYAML x45_25_PMOO = true; } - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { for (const auto& elem : r.getCurNode()->m_mapChildren) { if (elem.first.size() < 4) { - LogModule.report(LogVisor::Warning, "short FourCC in element '%s'", elem.first.c_str()); + LogModule.report(logvisor::Warning, "short FourCC in element '%s'", elem.first.c_str()); continue; } @@ -366,7 +366,7 @@ struct GPSM : BigYAML r.leaveSubRecord(); } } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { if (x0_PSIV) { @@ -950,13 +950,13 @@ struct GPSM : BigYAML __isz = x128_ADV8.binarySize(__isz + 4); return __isz; } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { uint32_t clsId; r.readBytesToBuf(&clsId, 4); if (clsId != SBIG('GPSM')) { - LogModule.report(LogVisor::Warning, "non GPSM provided to GPSM parser"); + LogModule.report(logvisor::Warning, "non GPSM provided to GPSM parser"); return; } r.readBytesToBuf(&clsId, 4); @@ -1226,13 +1226,13 @@ struct GPSM : BigYAML xd8_SELC.read(r); break; default: - LogModule.report(LogVisor::FatalError, "Unknown GPSM class %.4s @%" PRIi64, &clsId, r.position()); + LogModule.report(logvisor::Fatal, "Unknown GPSM class %.4s @%" PRIi64, &clsId, r.position()); break; } r.readBytesToBuf(&clsId, 4); } } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { w.writeBytes((atInt8*)"GPSM", 4); if (x0_PSIV) @@ -1626,9 +1626,9 @@ struct GPSM : BigYAML }; template -bool ExtractGPSM(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath) +bool ExtractGPSM(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) { - FILE* fp = HECL::Fopen(outPath.getAbsolutePath().c_str(), _S("w")); + FILE* fp = hecl::Fopen(outPath.getAbsolutePath().c_str(), _S("w")); if (fp) { GPSM gpsm; @@ -1641,9 +1641,9 @@ bool ExtractGPSM(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath) } template -bool WriteGPSM(const GPSM& gpsm, const HECL::ProjectPath& outPath) +bool WriteGPSM(const GPSM& gpsm, const hecl::ProjectPath& outPath) { - Athena::io::FileWriter w(outPath.getAbsolutePath(), true, false); + athena::io::FileWriter w(outPath.getAbsolutePath(), true, false); if (w.hasError()) return false; gpsm.write(w); diff --git a/DataSpec/DNACommon/ParticleCommon.cpp b/DataSpec/DNACommon/ParticleCommon.cpp index 37adae69a..1bd486bcf 100644 --- a/DataSpec/DNACommon/ParticleCommon.cpp +++ b/DataSpec/DNACommon/ParticleCommon.cpp @@ -4,9 +4,9 @@ namespace DataSpec { namespace DNAParticle { -LogVisor::LogModule LogModule("Retro::DNAParticle"); +logvisor::Module LogModule("urde::DNAParticle"); -void RealElementFactory::read(Athena::io::YAMLDocReader& r) +void RealElementFactory::read(athena::io::YAMLDocReader& r) { const auto& mapChildren = r.getCurNode()->m_mapChildren; if (mapChildren.empty()) @@ -17,7 +17,7 @@ void RealElementFactory::read(Athena::io::YAMLDocReader& r) const auto& elem = mapChildren[0]; if (elem.first.size() < 4) - LogModule.report(LogVisor::FatalError, "short FourCC in element '%s'", elem.first.c_str()); + LogModule.report(logvisor::Fatal, "short FourCC in element '%s'", elem.first.c_str()); switch (*reinterpret_cast(elem.first.data())) { @@ -130,7 +130,7 @@ void RealElementFactory::read(Athena::io::YAMLDocReader& r) r.leaveSubRecord(); } -void RealElementFactory::write(Athena::io::YAMLDocWriter& w) const +void RealElementFactory::write(athena::io::YAMLDocWriter& w) const { if (m_elem) { @@ -148,7 +148,7 @@ size_t RealElementFactory::binarySize(size_t __isz) const return __isz + 4; } -void RealElementFactory::read(Athena::io::IStreamReader& r) +void RealElementFactory::read(athena::io::IStreamReader& r) { uint32_t clsId; r.readBytesToBuf(&clsId, 4); @@ -259,13 +259,13 @@ void RealElementFactory::read(Athena::io::IStreamReader& r) return; default: m_elem.reset(); - LogModule.report(LogVisor::FatalError, "Unknown RealElement class %.4s @%" PRIi64, &clsId, r.position()); + LogModule.report(logvisor::Fatal, "Unknown RealElement class %.4s @%" PRIi64, &clsId, r.position()); return; } m_elem->read(r); } -void RealElementFactory::write(Athena::io::IStreamWriter& w) const +void RealElementFactory::write(athena::io::IStreamWriter& w) const { if (m_elem) { @@ -277,7 +277,7 @@ void RealElementFactory::write(Athena::io::IStreamWriter& w) const } -void IntElementFactory::read(Athena::io::YAMLDocReader& r) +void IntElementFactory::read(athena::io::YAMLDocReader& r) { const auto& mapChildren = r.getCurNode()->m_mapChildren; if (mapChildren.empty()) @@ -288,7 +288,7 @@ void IntElementFactory::read(Athena::io::YAMLDocReader& r) const auto& elem = mapChildren[0]; if (elem.first.size() < 4) - LogModule.report(LogVisor::FatalError, "short FourCC in element '%s'", elem.first.c_str()); + LogModule.report(logvisor::Fatal, "short FourCC in element '%s'", elem.first.c_str()); switch (*reinterpret_cast(elem.first.data())) { @@ -353,7 +353,7 @@ void IntElementFactory::read(Athena::io::YAMLDocReader& r) r.leaveSubRecord(); } -void IntElementFactory::write(Athena::io::YAMLDocWriter& w) const +void IntElementFactory::write(athena::io::YAMLDocWriter& w) const { if (m_elem) { @@ -371,7 +371,7 @@ size_t IntElementFactory::binarySize(size_t __isz) const return __isz + 4; } -void IntElementFactory::read(Athena::io::IStreamReader& r) +void IntElementFactory::read(athena::io::IStreamReader& r) { uint32_t clsId; r.readBytesToBuf(&clsId, 4); @@ -434,13 +434,13 @@ void IntElementFactory::read(Athena::io::IStreamReader& r) return; default: m_elem.reset(); - LogModule.report(LogVisor::FatalError, "Unknown IntElement class %.4s @%" PRIi64, &clsId, r.position()); + LogModule.report(logvisor::Fatal, "Unknown IntElement class %.4s @%" PRIi64, &clsId, r.position()); return; } m_elem->read(r); } -void IntElementFactory::write(Athena::io::IStreamWriter& w) const +void IntElementFactory::write(athena::io::IStreamWriter& w) const { if (m_elem) { @@ -451,7 +451,7 @@ void IntElementFactory::write(Athena::io::IStreamWriter& w) const w.writeBytes((atInt8*)"NONE", 4); } -void VectorElementFactory::read(Athena::io::YAMLDocReader& r) +void VectorElementFactory::read(athena::io::YAMLDocReader& r) { const auto& mapChildren = r.getCurNode()->m_mapChildren; if (mapChildren.empty()) @@ -462,7 +462,7 @@ void VectorElementFactory::read(Athena::io::YAMLDocReader& r) const auto& elem = mapChildren[0]; if (elem.first.size() < 4) - LogModule.report(LogVisor::FatalError, "short FourCC in element '%s'", elem.first.c_str()); + LogModule.report(logvisor::Fatal, "short FourCC in element '%s'", elem.first.c_str()); switch (*reinterpret_cast(elem.first.data())) { @@ -527,7 +527,7 @@ void VectorElementFactory::read(Athena::io::YAMLDocReader& r) r.leaveSubRecord(); } -void VectorElementFactory::write(Athena::io::YAMLDocWriter& w) const +void VectorElementFactory::write(athena::io::YAMLDocWriter& w) const { if (m_elem) { @@ -545,7 +545,7 @@ size_t VectorElementFactory::binarySize(size_t __isz) const return __isz + 4; } -void VectorElementFactory::read(Athena::io::IStreamReader& r) +void VectorElementFactory::read(athena::io::IStreamReader& r) { uint32_t clsId; r.readBytesToBuf(&clsId, 4); @@ -608,13 +608,13 @@ void VectorElementFactory::read(Athena::io::IStreamReader& r) return; default: m_elem.reset(); - LogModule.report(LogVisor::FatalError, "Unknown VectorElement class %.4s @%" PRIi64, &clsId, r.position()); + LogModule.report(logvisor::Fatal, "Unknown VectorElement class %.4s @%" PRIi64, &clsId, r.position()); return; } m_elem->read(r); } -void VectorElementFactory::write(Athena::io::IStreamWriter& w) const +void VectorElementFactory::write(athena::io::IStreamWriter& w) const { if (m_elem) { @@ -626,7 +626,7 @@ void VectorElementFactory::write(Athena::io::IStreamWriter& w) const } -void ColorElementFactory::read(Athena::io::YAMLDocReader& r) +void ColorElementFactory::read(athena::io::YAMLDocReader& r) { const auto& mapChildren = r.getCurNode()->m_mapChildren; if (mapChildren.empty()) @@ -637,7 +637,7 @@ void ColorElementFactory::read(Athena::io::YAMLDocReader& r) const auto& elem = mapChildren[0]; if (elem.first.size() < 4) - LogModule.report(LogVisor::FatalError, "short FourCC in element '%s'", elem.first.c_str()); + LogModule.report(logvisor::Fatal, "short FourCC in element '%s'", elem.first.c_str()); switch (*reinterpret_cast(elem.first.data())) { @@ -669,7 +669,7 @@ void ColorElementFactory::read(Athena::io::YAMLDocReader& r) r.leaveSubRecord(); } -void ColorElementFactory::write(Athena::io::YAMLDocWriter& w) const +void ColorElementFactory::write(athena::io::YAMLDocWriter& w) const { if (m_elem) { @@ -687,7 +687,7 @@ size_t ColorElementFactory::binarySize(size_t __isz) const return __isz + 4; } -void ColorElementFactory::read(Athena::io::IStreamReader& r) +void ColorElementFactory::read(athena::io::IStreamReader& r) { uint32_t clsId; r.readBytesToBuf(&clsId, 4); @@ -717,13 +717,13 @@ void ColorElementFactory::read(Athena::io::IStreamReader& r) return; default: m_elem.reset(); - LogModule.report(LogVisor::FatalError, "Unknown ColorElement class %.4s @%" PRIi64, &clsId, r.position()); + LogModule.report(logvisor::Fatal, "Unknown ColorElement class %.4s @%" PRIi64, &clsId, r.position()); return; } m_elem->read(r); } -void ColorElementFactory::write(Athena::io::IStreamWriter& w) const +void ColorElementFactory::write(athena::io::IStreamWriter& w) const { if (m_elem) { @@ -735,7 +735,7 @@ void ColorElementFactory::write(Athena::io::IStreamWriter& w) const } -void ModVectorElementFactory::read(Athena::io::YAMLDocReader& r) +void ModVectorElementFactory::read(athena::io::YAMLDocReader& r) { const auto& mapChildren = r.getCurNode()->m_mapChildren; if (mapChildren.empty()) @@ -746,7 +746,7 @@ void ModVectorElementFactory::read(Athena::io::YAMLDocReader& r) const auto& elem = mapChildren[0]; if (elem.first.size() < 4) - LogModule.report(LogVisor::FatalError, "short FourCC in element '%s'", elem.first.c_str()); + LogModule.report(logvisor::Fatal, "short FourCC in element '%s'", elem.first.c_str()); switch (*reinterpret_cast(elem.first.data())) { @@ -795,7 +795,7 @@ void ModVectorElementFactory::read(Athena::io::YAMLDocReader& r) r.leaveSubRecord(); } -void ModVectorElementFactory::write(Athena::io::YAMLDocWriter& w) const +void ModVectorElementFactory::write(athena::io::YAMLDocWriter& w) const { if (m_elem) { @@ -813,7 +813,7 @@ size_t ModVectorElementFactory::binarySize(size_t __isz) const return __isz + 4; } -void ModVectorElementFactory::read(Athena::io::IStreamReader& r) +void ModVectorElementFactory::read(athena::io::IStreamReader& r) { uint32_t clsId; r.readBytesToBuf(&clsId, 4); @@ -860,13 +860,13 @@ void ModVectorElementFactory::read(Athena::io::IStreamReader& r) return; default: m_elem.reset(); - LogModule.report(LogVisor::FatalError, "Unknown ModVectorElement class %.4s @%" PRIi64, &clsId, r.position()); + LogModule.report(logvisor::Fatal, "Unknown ModVectorElement class %.4s @%" PRIi64, &clsId, r.position()); return; } m_elem->read(r); } -void ModVectorElementFactory::write(Athena::io::IStreamWriter& w) const +void ModVectorElementFactory::write(athena::io::IStreamWriter& w) const { if (m_elem) { @@ -878,7 +878,7 @@ void ModVectorElementFactory::write(Athena::io::IStreamWriter& w) const } -void EmitterElementFactory::read(Athena::io::YAMLDocReader& r) +void EmitterElementFactory::read(athena::io::YAMLDocReader& r) { const auto& mapChildren = r.getCurNode()->m_mapChildren; if (mapChildren.empty()) @@ -889,7 +889,7 @@ void EmitterElementFactory::read(Athena::io::YAMLDocReader& r) const auto& elem = mapChildren[0]; if (elem.first.size() < 4) - LogModule.report(LogVisor::FatalError, "short FourCC in element '%s'", elem.first.c_str()); + LogModule.report(logvisor::Fatal, "short FourCC in element '%s'", elem.first.c_str()); switch (*reinterpret_cast(elem.first.data())) { @@ -914,7 +914,7 @@ void EmitterElementFactory::read(Athena::io::YAMLDocReader& r) r.leaveSubRecord(); } -void EmitterElementFactory::write(Athena::io::YAMLDocWriter& w) const +void EmitterElementFactory::write(athena::io::YAMLDocWriter& w) const { if (m_elem) { @@ -932,7 +932,7 @@ size_t EmitterElementFactory::binarySize(size_t __isz) const return __isz + 4; } -void EmitterElementFactory::read(Athena::io::IStreamReader& r) +void EmitterElementFactory::read(athena::io::IStreamReader& r) { uint32_t clsId; r.readBytesToBuf(&clsId, 4); @@ -955,13 +955,13 @@ void EmitterElementFactory::read(Athena::io::IStreamReader& r) return; default: m_elem.reset(); - LogModule.report(LogVisor::FatalError, "Unknown EmitterElement class %.4s @%" PRIi64, &clsId, r.position()); + LogModule.report(logvisor::Fatal, "Unknown EmitterElement class %.4s @%" PRIi64, &clsId, r.position()); return; } m_elem->read(r); } -void EmitterElementFactory::write(Athena::io::IStreamWriter& w) const +void EmitterElementFactory::write(athena::io::IStreamWriter& w) const { if (m_elem) { diff --git a/DataSpec/DNACommon/ParticleCommon.hpp b/DataSpec/DNACommon/ParticleCommon.hpp index f325d61ed..e5842c69f 100644 --- a/DataSpec/DNACommon/ParticleCommon.hpp +++ b/DataSpec/DNACommon/ParticleCommon.hpp @@ -7,7 +7,7 @@ namespace DataSpec { namespace DNAParticle { -extern LogVisor::LogModule LogModule; +extern logvisor::Module LogModule; struct IElement : BigYAML { @@ -23,11 +23,11 @@ struct RealElementFactory : BigYAML std::unique_ptr m_elem; operator bool() const {return m_elem.operator bool();} - void read(Athena::io::YAMLDocReader& r); - void write(Athena::io::YAMLDocWriter& w) const; + void read(athena::io::YAMLDocReader& r); + void write(athena::io::YAMLDocWriter& w) const; size_t binarySize(size_t __isz) const; - void read(Athena::io::IStreamReader& r); - void write(Athena::io::IStreamWriter& w) const; + void read(athena::io::IStreamReader& r); + void write(athena::io::IStreamWriter& w) const; }; struct IIntElement : IElement {Delete _d;}; @@ -37,11 +37,11 @@ struct IntElementFactory : BigYAML std::unique_ptr m_elem; operator bool() const {return m_elem.operator bool();} - void read(Athena::io::YAMLDocReader& r); - void write(Athena::io::YAMLDocWriter& w) const; + void read(athena::io::YAMLDocReader& r); + void write(athena::io::YAMLDocWriter& w) const; size_t binarySize(size_t __isz) const; - void read(Athena::io::IStreamReader& r); - void write(Athena::io::IStreamWriter& w) const; + void read(athena::io::IStreamReader& r); + void write(athena::io::IStreamWriter& w) const; }; struct IVectorElement : IElement {Delete _d;}; @@ -51,11 +51,11 @@ struct VectorElementFactory : BigYAML std::unique_ptr m_elem; operator bool() const {return m_elem.operator bool();} - void read(Athena::io::YAMLDocReader& r); - void write(Athena::io::YAMLDocWriter& w) const; + void read(athena::io::YAMLDocReader& r); + void write(athena::io::YAMLDocWriter& w) const; size_t binarySize(size_t __isz) const; - void read(Athena::io::IStreamReader& r); - void write(Athena::io::IStreamWriter& w) const; + void read(athena::io::IStreamReader& r); + void write(athena::io::IStreamWriter& w) const; }; struct IColorElement : IElement {Delete _d;}; @@ -65,11 +65,11 @@ struct ColorElementFactory : BigYAML std::unique_ptr m_elem; operator bool() const {return m_elem.operator bool();} - void read(Athena::io::YAMLDocReader& r); - void write(Athena::io::YAMLDocWriter& w) const; + void read(athena::io::YAMLDocReader& r); + void write(athena::io::YAMLDocWriter& w) const; size_t binarySize(size_t __isz) const; - void read(Athena::io::IStreamReader& r); - void write(Athena::io::IStreamWriter& w) const; + void read(athena::io::IStreamReader& r); + void write(athena::io::IStreamWriter& w) const; }; struct IModVectorElement : IElement {Delete _d;}; @@ -79,11 +79,11 @@ struct ModVectorElementFactory : BigYAML std::unique_ptr m_elem; operator bool() const {return m_elem.operator bool();} - void read(Athena::io::YAMLDocReader& r); - void write(Athena::io::YAMLDocWriter& w) const; + void read(athena::io::YAMLDocReader& r); + void write(athena::io::YAMLDocWriter& w) const; size_t binarySize(size_t __isz) const; - void read(Athena::io::IStreamReader& r); - void write(Athena::io::IStreamWriter& w) const; + void read(athena::io::IStreamReader& r); + void write(athena::io::IStreamWriter& w) const; }; struct IEmitterElement : IElement {Delete _d;}; @@ -93,11 +93,11 @@ struct EmitterElementFactory : BigYAML std::unique_ptr m_elem; operator bool() const {return m_elem.operator bool();} - void read(Athena::io::YAMLDocReader& r); - void write(Athena::io::YAMLDocWriter& w) const; + void read(athena::io::YAMLDocReader& r); + void write(athena::io::YAMLDocWriter& w) const; size_t binarySize(size_t __isz) const; - void read(Athena::io::IStreamReader& r); - void write(Athena::io::IStreamWriter& w) const; + void read(athena::io::IStreamReader& r); + void write(athena::io::IStreamWriter& w) const; }; struct IUVElement : IElement {Delete _d;}; @@ -108,11 +108,11 @@ struct BoolHelper : IElement bool value = false; operator bool() const {return value;} BoolHelper& operator=(bool val) {value = val; return *this;} - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { value = r.readBool(nullptr); } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { w.writeBool(nullptr, value); } @@ -120,7 +120,7 @@ struct BoolHelper : IElement { return __isz + 5; } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { uint32_t clsId; r.readBytesToBuf(&clsId, 4); @@ -129,7 +129,7 @@ struct BoolHelper : IElement else value = false; } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { w.writeBytes((atInt8*)"CNST", 4); w.writeBool(value); @@ -150,11 +150,11 @@ struct REConstant : IRealElement Delete _d; Value val; - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { val = r.readFloat(nullptr); } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { w.writeFloat(nullptr, val); } @@ -162,11 +162,11 @@ struct REConstant : IRealElement { return __isz + 4; } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { val = r.readFloatBig(); } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { w.writeFloatBig(val); } @@ -463,11 +463,11 @@ struct IEConstant : IIntElement Delete _d; Value val; - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { val = r.readUint32(nullptr); } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { w.writeUint32(nullptr, val); } @@ -475,11 +475,11 @@ struct IEConstant : IIntElement { return __isz + 4; } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { val = r.readUint32Big(); } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { w.writeUint32Big(val); } @@ -624,7 +624,7 @@ struct VEConstant : IVectorElement Delete _d; RealElementFactory comps[3]; - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { for (int i=0 ; i<3 ; ++i) { @@ -633,7 +633,7 @@ struct VEConstant : IVectorElement r.leaveSubRecord(); } } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { w.enterSubVector(nullptr); for (int i=0 ; i<3 ; ++i) @@ -650,13 +650,13 @@ struct VEConstant : IVectorElement __isz = comps[1].binarySize(__isz); return comps[2].binarySize(__isz); } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { comps[0].read(r); comps[1].read(r); comps[2].read(r); } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { comps[0].write(w); comps[1].write(w); @@ -772,7 +772,7 @@ struct CEConstant : IColorElement Delete _d; RealElementFactory comps[4]; - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { for (int i=0 ; i<4 ; ++i) { @@ -781,7 +781,7 @@ struct CEConstant : IColorElement r.leaveSubRecord(); } } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { w.enterSubVector(nullptr); for (int i=0 ; i<4 ; ++i) @@ -799,14 +799,14 @@ struct CEConstant : IColorElement __isz = comps[2].binarySize(__isz); return comps[3].binarySize(__isz); } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { comps[0].read(r); comps[1].read(r); comps[2].read(r); comps[3].read(r); } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { comps[0].write(w); comps[1].write(w); @@ -902,7 +902,7 @@ struct MVEConstant : IModVectorElement Delete _d; RealElementFactory comps[3]; - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { for (int i=0 ; i<3 ; ++i) { @@ -911,7 +911,7 @@ struct MVEConstant : IModVectorElement r.leaveSubRecord(); } } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { w.enterSubVector(nullptr); for (int i=0 ; i<3 ; ++i) @@ -928,13 +928,13 @@ struct MVEConstant : IModVectorElement __isz = comps[1].binarySize(__isz); return comps[2].binarySize(__isz); } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { comps[0].read(r); comps[1].read(r); comps[2].read(r); } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { comps[0].write(w); comps[1].write(w); @@ -1039,7 +1039,7 @@ struct EESimpleEmitterTR : EESimpleEmitter { Delete _d; - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { position.m_elem.reset(); velocity.m_elem.reset(); @@ -1054,7 +1054,7 @@ struct EESimpleEmitterTR : EESimpleEmitter r.leaveSubRecord(); } } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { w.enterSubRecord("ILOC"); position.write(w); @@ -1070,7 +1070,7 @@ struct EESimpleEmitterTR : EESimpleEmitter __isz = velocity.binarySize(__isz); return __isz; } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { position.m_elem.reset(); velocity.m_elem.reset(); @@ -1084,7 +1084,7 @@ struct EESimpleEmitterTR : EESimpleEmitter velocity.read(r); } } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { w.writeBytes((atInt8*)"ILOC", 4); position.write(w); @@ -1099,7 +1099,7 @@ struct UVEConstant : IUVElement { Delete _d; IDType tex; - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { tex.clear(); if (r.enterSubRecord("tex")) @@ -1108,7 +1108,7 @@ struct UVEConstant : IUVElement r.leaveSubRecord(); } } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { w.enterSubRecord("tex"); tex.write(w); @@ -1118,7 +1118,7 @@ struct UVEConstant : IUVElement { return tex.binarySize(__isz + 4); } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { tex.clear(); uint32_t clsId; @@ -1126,7 +1126,7 @@ struct UVEConstant : IUVElement if (clsId == SBIG('CNST')) tex.read(r); } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { w.writeBytes((atInt8*)"CNST", 4); tex.write(w); @@ -1145,7 +1145,7 @@ struct UVEAnimTexture : IUVElement IntElementFactory strideH; IntElementFactory cycleFrames; Value loop = false; - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { tex.clear(); if (r.enterSubRecord("tex")) @@ -1184,7 +1184,7 @@ struct UVEAnimTexture : IUVElement r.leaveSubRecord(); } } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { w.enterSubRecord("tex"); tex.write(w); @@ -1217,7 +1217,7 @@ struct UVEAnimTexture : IUVElement __isz = cycleFrames.binarySize(__isz); return __isz; } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { tex.clear(); uint32_t clsId; @@ -1233,7 +1233,7 @@ struct UVEAnimTexture : IUVElement if (clsId == SBIG('CNST')) loop = r.readBool(); } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { w.writeBytes((atInt8*)"CNST", 4); tex.write(w); @@ -1255,7 +1255,7 @@ struct UVElementFactory : BigYAML std::unique_ptr m_elem; operator bool() const {return m_elem.operator bool();} - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { if (r.enterSubRecord("CNST")) { @@ -1273,7 +1273,7 @@ struct UVElementFactory : BigYAML m_elem.reset(); } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { if (m_elem) { @@ -1291,7 +1291,7 @@ struct UVElementFactory : BigYAML return __isz + 4; } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { uint32_t clsId; r.readBytesToBuf(&clsId, 4); @@ -1310,7 +1310,7 @@ struct UVElementFactory : BigYAML m_elem->read(r); } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { if (m_elem) { @@ -1339,7 +1339,7 @@ struct SpawnSystemKeyframeData : BigYAML Value b; Value c; - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { if (r.enterSubRecord("id")) { @@ -1362,7 +1362,7 @@ struct SpawnSystemKeyframeData : BigYAML r.leaveSubRecord(); } } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { w.enterSubRecord("id"); id.write(w); @@ -1375,14 +1375,14 @@ struct SpawnSystemKeyframeData : BigYAML { return id.binarySize(__isz + 12); } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { id.read(r); a = r.readUint32Big(); b = r.readUint32Big(); c = r.readUint32Big(); } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { id.write(w); w.writeUint32Big(a); @@ -1393,7 +1393,7 @@ struct SpawnSystemKeyframeData : BigYAML std::vector>> spawns; - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { if (r.enterSubRecord("a")) { @@ -1416,18 +1416,20 @@ struct SpawnSystemKeyframeData : BigYAML r.leaveSubRecord(); } spawns.clear(); - if (r.enterSubVector("spawns")) + size_t spawnCount; + if (r.enterSubVector("spawns", spawnCount)) { - spawns.reserve(r.getCurNode()->m_seqChildren.size()); + spawns.reserve(spawnCount); for (const auto& child : r.getCurNode()->m_seqChildren) { if (r.enterSubRecord(nullptr)) { spawns.emplace_back(); spawns.back().first = r.readUint32("startFrame"); - if (r.enterSubVector("systems")) + size_t systemCount; + if (r.enterSubVector("systems", systemCount)) { - spawns.back().second.reserve(r.getCurNode()->m_seqChildren.size()); + spawns.back().second.reserve(systemCount); for (const auto& in : r.getCurNode()->m_seqChildren) { spawns.back().second.emplace_back(); @@ -1444,7 +1446,7 @@ struct SpawnSystemKeyframeData : BigYAML r.leaveSubVector(); } } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { if (spawns.empty()) return; @@ -1480,7 +1482,7 @@ struct SpawnSystemKeyframeData : BigYAML } return __isz; } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { uint32_t clsId; r.readBytesToBuf(&clsId, 4); @@ -1507,7 +1509,7 @@ struct SpawnSystemKeyframeData : BigYAML } } } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { if (spawns.empty()) { @@ -1537,7 +1539,7 @@ struct ChildResourceFactory : BigYAML { Delete _d; IDType id; - void read(Athena::io::YAMLDocReader& r) + void read(athena::io::YAMLDocReader& r) { id.clear(); if (r.enterSubRecord("CNST")) @@ -1546,7 +1548,7 @@ struct ChildResourceFactory : BigYAML r.leaveSubRecord(); } } - void write(Athena::io::YAMLDocWriter& w) const + void write(athena::io::YAMLDocWriter& w) const { if (id) { @@ -1562,7 +1564,7 @@ struct ChildResourceFactory : BigYAML else return __isz + 4; } - void read(Athena::io::IStreamReader& r) + void read(athena::io::IStreamReader& r) { id.clear(); uint32_t clsId; @@ -1570,7 +1572,7 @@ struct ChildResourceFactory : BigYAML if (clsId == SBIG('CNST')) id.read(r); } - void write(Athena::io::IStreamWriter& w) const + void write(athena::io::IStreamWriter& w) const { if (id) { diff --git a/DataSpec/DNACommon/STRG.cpp b/DataSpec/DNACommon/STRG.cpp index 9f1867ecf..7b187c3b4 100644 --- a/DataSpec/DNACommon/STRG.cpp +++ b/DataSpec/DNACommon/STRG.cpp @@ -6,12 +6,12 @@ namespace DataSpec { -std::unique_ptr LoadSTRG(Athena::io::IStreamReader& reader) +std::unique_ptr LoadSTRG(athena::io::IStreamReader& reader) { uint32_t magic = reader.readUint32Big(); if (magic != 0x87654321) { - LogDNACommon.report(LogVisor::Error, "invalid STRG magic"); + LogDNACommon.report(logvisor::Error, "invalid STRG magic"); return std::unique_ptr(); } diff --git a/DataSpec/DNACommon/STRG.hpp b/DataSpec/DNACommon/STRG.hpp index ab41e9991..bd1ef08fe 100644 --- a/DataSpec/DNACommon/STRG.hpp +++ b/DataSpec/DNACommon/STRG.hpp @@ -3,9 +3,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "DNACommon.hpp" namespace DataSpec @@ -17,10 +17,10 @@ struct ISTRG : BigYAML virtual size_t count() const=0; virtual std::string getUTF8(const FourCC& lang, size_t idx) const=0; virtual std::wstring getUTF16(const FourCC& lang, size_t idx) const=0; - virtual HECL::SystemString getSystemString(const FourCC& lang, size_t idx) const=0; + virtual hecl::SystemString getSystemString(const FourCC& lang, size_t idx) const=0; virtual int32_t lookupIdx(const std::string& name) const=0; }; -std::unique_ptr LoadSTRG(Athena::io::IStreamReader& reader); +std::unique_ptr LoadSTRG(athena::io::IStreamReader& reader); } diff --git a/DataSpec/DNACommon/TXTR.cpp b/DataSpec/DNACommon/TXTR.cpp index 3fce7ce95..c18b1d6c6 100644 --- a/DataSpec/DNACommon/TXTR.cpp +++ b/DataSpec/DNACommon/TXTR.cpp @@ -6,7 +6,7 @@ namespace DataSpec { -static LogVisor::LogModule Log("libpng"); +static logvisor::Module Log("libpng"); /* GX uses this upsampling technique to prevent banding on downsampled texture formats */ static inline uint8_t Convert3To8(uint8_t v) @@ -80,10 +80,10 @@ static inline void LookupRGBA8(const uint8_t* texels, int width, int x, int y, int bidx = (by * bwidth + bx) * 2; const uint16_t* artexels = (uint16_t*)&texels[32*bidx]; const uint16_t* gbtexels = (uint16_t*)&texels[32*(bidx+1)]; - uint16_t ar = HECL::SBig(artexels[ry*4+rx]); + uint16_t ar = hecl::SBig(artexels[ry*4+rx]); *a = ar >> 8 & 0xff; *r = ar & 0xff; - uint16_t gb = HECL::SBig(gbtexels[ry*4+rx]); + uint16_t gb = hecl::SBig(gbtexels[ry*4+rx]); *g = gb >> 8 & 0xff; *b = gb & 0xff; } @@ -160,7 +160,7 @@ static void DecodeIA8(png_structrp png, png_infop info, static const uint8_t* DecodePalette(png_structrp png, png_infop info, int numEntries, const uint8_t* data) { - uint32_t format = HECL::SBig(*(uint32_t*)data); + uint32_t format = hecl::SBig(*(uint32_t*)data); data += 8; png_color cEntries[256]; png_byte aEntries[256]; @@ -184,7 +184,7 @@ static const uint8_t* DecodePalette(png_structrp png, png_infop info, const uint16_t* data16 = (uint16_t*)data; for (int e=0 ; e> 11 & 0x1f); cEntries[e].green = Convert6To8(texel >> 5 & 0x3f); cEntries[e].blue = Convert5To8(texel & 0x1f); @@ -197,7 +197,7 @@ static const uint8_t* DecodePalette(png_structrp png, png_infop info, const uint16_t* data16 = (uint16_t*)data; for (int e=0 ; e> 10 & 0x1f); @@ -226,7 +226,7 @@ static const uint8_t* DecodePalette(png_structrp png, png_infop info, static const uint8_t* DecodePaletteSPLT(png_structrp png, png_infop info, int numEntries, const uint8_t* data) { - uint32_t format = HECL::SBig(*(uint32_t*)data); + uint32_t format = hecl::SBig(*(uint32_t*)data); data += 8; png_sPLT_entry entries[256] = {}; png_sPLT_t GXEntry = @@ -258,7 +258,7 @@ static const uint8_t* DecodePaletteSPLT(png_structrp png, png_infop info, const uint16_t* data16 = (uint16_t*)data; for (int e=0 ; e> 11 & 0x1f); entries[e].green = Convert6To8(texel >> 5 & 0x3f); entries[e].blue = Convert5To8(texel & 0x1f); @@ -273,7 +273,7 @@ static const uint8_t* DecodePaletteSPLT(png_structrp png, png_infop info, const uint16_t* data16 = (uint16_t*)data; for (int e=0 ; e> 10 & 0x1f); @@ -369,7 +369,7 @@ static void DecodeRGB565(png_structrp png, png_infop info, { for (int x=0 ; x> 11 & 0x1f); buf[x*3+1] = Convert6To8(texel >> 5 & 0x3f); buf[x*3+2] = Convert5To8(texel & 0x1f); @@ -390,7 +390,7 @@ static void DecodeRGB5A3(png_structrp png, png_infop info, { for (int x=0 ; x> 10 & 0x1f); @@ -473,25 +473,25 @@ static void DecodeCMPR(png_structrp png, png_infop info, static void PNGErr(png_structp png, png_const_charp msg) { - Log.report(LogVisor::Error, msg); + Log.report(logvisor::Error, msg); } static void PNGWarn(png_structp png, png_const_charp msg) { - Log.report(LogVisor::Warning, msg); + Log.report(logvisor::Warning, msg); } -bool TXTR::Extract(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath) +bool TXTR::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) { uint32_t format = rs.readUint32Big(); uint16_t width = rs.readUint16Big(); uint16_t height = rs.readUint16Big(); uint32_t numMips = rs.readUint32Big(); - FILE* fp = HECL::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); + FILE* fp = hecl::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); if (!fp) { - Log.report(LogVisor::Error, + Log.report(logvisor::Error, _S("Unable to open '%s' for writing"), outPath.getAbsolutePath().c_str()); return false; @@ -542,7 +542,7 @@ bool TXTR::Extract(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath) return true; } -bool TXTR::Cook(const HECL::ProjectPath& inPath, const HECL::ProjectPath& outPath) +bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) { return false; } diff --git a/DataSpec/DNACommon/TXTR.hpp b/DataSpec/DNACommon/TXTR.hpp index 5d51e599b..853176b7a 100644 --- a/DataSpec/DNACommon/TXTR.hpp +++ b/DataSpec/DNACommon/TXTR.hpp @@ -9,8 +9,8 @@ class PAKEntryReadStream; struct TXTR { - static bool Extract(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath); - static bool Cook(const HECL::ProjectPath& inPath, const HECL::ProjectPath& outPath); + static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath); + static bool Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath); }; } diff --git a/DataSpec/DNAMP1/AFSM.hpp b/DataSpec/DNAMP1/AFSM.hpp index 4c3b0b3e7..88463278e 100644 --- a/DataSpec/DNAMP1/AFSM.hpp +++ b/DataSpec/DNAMP1/AFSM.hpp @@ -1,7 +1,7 @@ #ifndef _DNAMP1_AFSM_HPP_ #define _DNAMP1_AFSM_HPP_ -#include +#include #include "../DNACommon/DNACommon.hpp" #include "DNAMP1.hpp" @@ -32,7 +32,7 @@ struct AFSM : public BigYAML String<-1> name; Value parameter; Value targetState; - void read(Athena::io::IStreamReader& __dna_reader) + void read(athena::io::IStreamReader& __dna_reader) { /* name */ name = __dna_reader.readString(-1); @@ -45,7 +45,7 @@ struct AFSM : public BigYAML } } - void write(Athena::io::IStreamWriter& __dna_writer) const + void write(athena::io::IStreamWriter& __dna_writer) const { /* name */ __dna_writer.writeString(name, -1); @@ -58,7 +58,7 @@ struct AFSM : public BigYAML } } - void read(Athena::io::YAMLDocReader& __dna_docin) + void read(athena::io::YAMLDocReader& __dna_docin) { /* name */ name = __dna_docin.readString("name"); @@ -71,7 +71,7 @@ struct AFSM : public BigYAML } } - void write(Athena::io::YAMLDocWriter& __dna_docout) const + void write(athena::io::YAMLDocWriter& __dna_docout) const { /* name */ __dna_docout.writeString("name", name); @@ -86,7 +86,7 @@ struct AFSM : public BigYAML static const char* DNAType() { - return "Retro::DNAMP1::AFSM::Transition::Trigger"; + return "urde::DNAMP1::AFSM::Transition::Trigger"; } size_t binarySize(size_t __isz) const @@ -98,21 +98,21 @@ struct AFSM : public BigYAML Vector triggers; - void read(Athena::io::IStreamReader& __dna_reader) + void read(athena::io::IStreamReader& __dna_reader) { /* triggerCount */ triggerCount = __dna_reader.readUint32Big(); int i = 0; /* triggers */ __dna_reader.enumerate(triggers, triggerCount, - [&](Athena::io::IStreamReader& in, Trigger& tr){ + [&](athena::io::IStreamReader& in, Trigger& tr){ tr.first = i == 0; tr.read(in); i++; }); } - void write(Athena::io::IStreamWriter& __dna_writer) const + void write(athena::io::IStreamWriter& __dna_writer) const { /* triggerCount */ __dna_writer.writeInt32Big(triggerCount); @@ -120,31 +120,27 @@ struct AFSM : public BigYAML __dna_writer.enumerate(triggers); } - void read(Athena::io::YAMLDocReader& __dna_docin) + void read(athena::io::YAMLDocReader& __dna_docin) { - /* triggerCount */ - triggerCount = __dna_docin.readUint32("triggerCount"); int i = 0; /* triggers */ - __dna_docin.enumerate("triggers", triggers, triggerCount, - [&](Athena::io::YAMLDocReader& in, Trigger& tr){ + triggerCount = __dna_docin.enumerate("triggers", triggers, + [&](athena::io::YAMLDocReader& in, Trigger& tr){ tr.first = i == 0; tr.read(in); i++; }); } - void write(Athena::io::YAMLDocWriter& __dna_docout) const + void write(athena::io::YAMLDocWriter& __dna_docout) const { - /* triggerCount */ - __dna_docout.writeUint32("triggerCount", triggerCount); /* triggers */ __dna_docout.enumerate("triggers", triggers); } static const char* DNAType() { - return "Retro::DNAMP1::AFSM::Transition"; + return "urde::DNAMP1::AFSM::Transition"; } size_t binarySize(size_t __isz) const @@ -159,11 +155,11 @@ struct AFSM : public BigYAML Vector states; - static bool Extract(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath) + static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) { AFSM afsm; afsm.read(rs); - FILE* fp = HECL::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); + FILE* fp = hecl::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); afsm.toYAMLFile(fp); fclose(fp); return true; diff --git a/DataSpec/DNAMP1/ANCS.cpp b/DataSpec/DNAMP1/ANCS.cpp index 8f9a11d11..1d359a59f 100644 --- a/DataSpec/DNAMP1/ANCS.cpp +++ b/DataSpec/DNAMP1/ANCS.cpp @@ -5,7 +5,7 @@ namespace DataSpec namespace DNAMP1 { -void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::read(Athena::io::IStreamReader& reader) +void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::read(athena::io::IStreamReader& reader) { parmType = reader.readUint32Big(); unk1 = reader.readUint32Big(); @@ -32,7 +32,7 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::read(A } } -void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::write(Athena::io::IStreamWriter& writer) const +void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(parmType); writer.writeUint32Big(unk1); @@ -77,12 +77,13 @@ size_t ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::bina return __isz; } -void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::read(Athena::io::YAMLDocReader& reader) +void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::read(athena::io::YAMLDocReader& reader) { parmType = reader.readUint32("parmType"); unk1 = reader.readUint32("unk1"); unk2 = reader.readFloat("unk2"); - reader.enterSubVector("parmVals"); + size_t parmCount; + reader.enterSubVector("parmVals", parmCount); switch (DataType(parmType)) { case DataType::Int32: @@ -107,7 +108,7 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::read(A reader.leaveSubVector(); } -void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::write(Athena::io::YAMLDocWriter& writer) const +void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::write(athena::io::YAMLDocWriter& writer) const { writer.writeUint32("parmType", parmType); writer.writeUint32("unk1", unk1); @@ -138,10 +139,10 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::write( const char* ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::DNAType() { - return "Retro::DNAMP1::ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo"; + return "urde::DNAMP1::ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo"; } -void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::read(Athena::io::IStreamReader& reader) +void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::read(athena::io::IStreamReader& reader) { id = reader.readUint32Big(); atUint32 parmInfoCount = reader.readUint32Big(); @@ -152,7 +153,7 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::read(Athena::io: animInfos.clear(); animInfos.reserve(animInfoCount); reader.enumerate(animInfos, animInfoCount, - [this, parmInfoCount](Athena::io::IStreamReader& reader, AnimInfo& ai) + [this, parmInfoCount](athena::io::IStreamReader& reader, AnimInfo& ai) { ai.id = reader.readUint32Big(); ai.parmVals.reserve(parmInfoCount); @@ -179,7 +180,7 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::read(Athena::io: }); } -void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::write(Athena::io::IStreamWriter& writer) const +void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(id); writer.writeUint32Big(parmInfos.size()); @@ -244,20 +245,19 @@ size_t ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::binarySize(siz return __isz; } -void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::read(Athena::io::YAMLDocReader& reader) +void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::read(athena::io::YAMLDocReader& reader) { id = reader.readUint32("id"); - atUint32 parmInfoCount = reader.readUint32("parmInfoCount"); - atUint32 animInfoCount = reader.readUint32("animInfoCount"); - reader.enumerate("parmInfos", parmInfos, parmInfoCount); + atUint32 parmInfoCount = reader.enumerate("parmInfos", parmInfos); - reader.enumerate("animInfos", animInfos, animInfoCount, - [this, parmInfoCount](Athena::io::YAMLDocReader& reader, AnimInfo& ai) + reader.enumerate("animInfos", animInfos, + [this, parmInfoCount](athena::io::YAMLDocReader& reader, AnimInfo& ai) { ai.id = reader.readUint32("id"); ai.parmVals.reserve(parmInfoCount); - reader.enterSubVector("parmVals"); + size_t parmValCount; + reader.enterSubVector("parmVals", parmValCount); for (const ParmInfo& pi : parmInfos) { switch (ParmInfo::DataType(pi.parmType)) @@ -282,16 +282,14 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::read(Athena::io: }); } -void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::write(Athena::io::YAMLDocWriter& writer) const +void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::write(athena::io::YAMLDocWriter& writer) const { writer.writeUint32("id", id); - writer.writeUint32("parmInfoCount", parmInfos.size()); - writer.writeUint32("animInfoCount", animInfos.size()); writer.enumerate("parmInfos", parmInfos); writer.enumerate("animInfos", animInfos, - [this](Athena::io::YAMLDocWriter& writer, const AnimInfo& ai) + [this](athena::io::YAMLDocWriter& writer, const AnimInfo& ai) { writer.writeUint32("id", ai.id); auto it = ai.parmVals.begin(); @@ -325,10 +323,10 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::write(Athena::io const char* ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::DNAType() { - return "Retro::DNAMP1::ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState"; + return "urde::DNAMP1::ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState"; } -void ANCS::CharacterSet::CharacterInfo::read(Athena::io::IStreamReader& reader) +void ANCS::CharacterSet::CharacterInfo::read(athena::io::IStreamReader& reader) { idx = reader.readUint32Big(); atUint16 sectionCount = reader.readUint16Big(); @@ -388,7 +386,7 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::IStreamReader& reader) } } -void ANCS::CharacterSet::CharacterInfo::write(Athena::io::IStreamWriter& writer) const +void ANCS::CharacterSet::CharacterInfo::write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(idx); @@ -524,7 +522,7 @@ size_t ANCS::CharacterSet::CharacterInfo::binarySize(size_t __isz) const return __isz; } -void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader) +void ANCS::CharacterSet::CharacterInfo::read(athena::io::YAMLDocReader& reader) { idx = reader.readUint32("idx"); atUint16 sectionCount = reader.readUint16("sectionCount"); @@ -533,25 +531,20 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader) reader.enumerate("cskr", cskr); reader.enumerate("cinf", cinf); - atUint32 animationCount = reader.readUint32("animationCount"); - reader.enumerate("animations", animations, animationCount); + reader.enumerate("animations", animations); reader.enumerate("pasDatabase", pasDatabase); - atUint32 partCount = reader.readUint32("partCount"); - reader.enumerate("part", partResData.part, partCount); + reader.enumerate("part", partResData.part); - atUint32 swhcCount = reader.readUint32("swhcCount"); - reader.enumerate("swhc", partResData.swhc, swhcCount); + reader.enumerate("swhc", partResData.swhc); - atUint32 unkCount = reader.readUint32("unkCount"); - reader.enumerate("unk", partResData.unk, unkCount); + reader.enumerate("unk", partResData.unk); partResData.elsc.clear(); if (sectionCount > 5) { - atUint32 elscCount = reader.readUint32("elscCount"); - reader.enumerate("elsc", partResData.elsc, elscCount); + reader.enumerate("elsc", partResData.elsc); } unk1 = reader.readUint32("unk1"); @@ -559,15 +552,13 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader) animAABBs.clear(); if (sectionCount > 1) { - atUint32 aabbCount = reader.readUint32("animAABBCount"); - reader.enumerate("part", animAABBs, aabbCount); + reader.enumerate("part", animAABBs); } effects.clear(); if (sectionCount > 2) { - atUint32 effectCount = reader.readUint32("effectCount"); - reader.enumerate("effects", effects, effectCount); + reader.enumerate("effects", effects); } if (sectionCount > 3) @@ -579,12 +570,11 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader) animIdxs.clear(); if (sectionCount > 4) { - atUint32 animIdxCount = reader.readUint32("animIdxCount"); - reader.enumerate("animIdxs", animIdxs, animIdxCount); + reader.enumerate("animIdxs", animIdxs); } } -void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer) const +void ANCS::CharacterSet::CharacterInfo::write(athena::io::YAMLDocWriter& writer) const { writer.writeUint32("idx", idx); @@ -608,23 +598,18 @@ void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer) writer.enumerate("cskr", cskr); writer.enumerate("cinf", cinf); - writer.writeUint32("animationCount", animations.size()); writer.enumerate("animations", animations); writer.enumerate("pasDatabase", pasDatabase); - writer.writeUint32("partCount", partResData.part.size()); writer.enumerate("part", partResData.part); - writer.writeUint32("swhcCount", partResData.swhc.size()); writer.enumerate("swhc", partResData.swhc); - writer.writeUint32("unkCount", partResData.unk.size()); writer.enumerate("unk", partResData.unk); if (sectionCount > 5) { - writer.writeUint32("elscCount", partResData.elsc.size()); writer.enumerate("elsc", partResData.elsc); } @@ -632,13 +617,11 @@ void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer) if (sectionCount > 1) { - writer.writeUint32("animAABBCount", animAABBs.size()); writer.enumerate("animAABBs", animAABBs); } if (sectionCount > 2) { - writer.writeUint32("effectCount", effects.size()); writer.enumerate("effects", effects); } @@ -650,17 +633,16 @@ void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer) if (sectionCount > 4) { - writer.writeUint32("animIdxCount", animIdxs.size()); writer.enumerate("animIdxs", animIdxs); } } const char* ANCS::CharacterSet::CharacterInfo::DNAType() { - return "Retro::DNAMP1::ANCS::CharacterSet::CharacterInfo"; + return "urde::DNAMP1::ANCS::CharacterSet::CharacterInfo"; } -void ANCS::AnimationSet::MetaAnimFactory::read(Athena::io::IStreamReader& reader) +void ANCS::AnimationSet::MetaAnimFactory::read(athena::io::IStreamReader& reader) { IMetaAnim::Type type(IMetaAnim::Type(reader.readUint32Big())); switch (type) @@ -691,7 +673,7 @@ void ANCS::AnimationSet::MetaAnimFactory::read(Athena::io::IStreamReader& reader } } -void ANCS::AnimationSet::MetaAnimFactory::write(Athena::io::IStreamWriter& writer) const +void ANCS::AnimationSet::MetaAnimFactory::write(athena::io::IStreamWriter& writer) const { if (!m_anim) return; @@ -706,7 +688,7 @@ size_t ANCS::AnimationSet::MetaAnimFactory::binarySize(size_t __isz) const return m_anim->binarySize(__isz + 4); } -void ANCS::AnimationSet::MetaAnimFactory::read(Athena::io::YAMLDocReader& reader) +void ANCS::AnimationSet::MetaAnimFactory::read(athena::io::YAMLDocReader& reader) { std::string type = reader.readString("type"); std::transform(type.begin(), type.end(), type.begin(), tolower); @@ -742,7 +724,7 @@ void ANCS::AnimationSet::MetaAnimFactory::read(Athena::io::YAMLDocReader& reader } -void ANCS::AnimationSet::MetaAnimFactory::write(Athena::io::YAMLDocWriter& writer) const +void ANCS::AnimationSet::MetaAnimFactory::write(athena::io::YAMLDocWriter& writer) const { if (!m_anim) return; @@ -752,10 +734,10 @@ void ANCS::AnimationSet::MetaAnimFactory::write(Athena::io::YAMLDocWriter& write const char* ANCS::AnimationSet::MetaAnimFactory::DNAType() { - return "Retro::DNAMP1::ANCS::AnimationSet::MetaAnimFactory"; + return "urde::DNAMP1::ANCS::AnimationSet::MetaAnimFactory"; } -void ANCS::AnimationSet::MetaTransFactory::read(Athena::io::IStreamReader& reader) +void ANCS::AnimationSet::MetaTransFactory::read(athena::io::IStreamReader& reader) { IMetaTrans::Type type(IMetaTrans::Type(reader.readUint32Big())); switch (type) @@ -779,7 +761,7 @@ void ANCS::AnimationSet::MetaTransFactory::read(Athena::io::IStreamReader& reade } } -void ANCS::AnimationSet::MetaTransFactory::write(Athena::io::IStreamWriter& writer) const +void ANCS::AnimationSet::MetaTransFactory::write(athena::io::IStreamWriter& writer) const { if (!m_trans) { @@ -797,7 +779,7 @@ size_t ANCS::AnimationSet::MetaTransFactory::binarySize(size_t __isz) const return m_trans->binarySize(__isz + 4); } -void ANCS::AnimationSet::MetaTransFactory::read(Athena::io::YAMLDocReader& reader) +void ANCS::AnimationSet::MetaTransFactory::read(athena::io::YAMLDocReader& reader) { std::string type = reader.readString("type"); std::transform(type.begin(), type.end(), type.begin(), tolower); @@ -823,7 +805,7 @@ void ANCS::AnimationSet::MetaTransFactory::read(Athena::io::YAMLDocReader& reade } -void ANCS::AnimationSet::MetaTransFactory::write(Athena::io::YAMLDocWriter& writer) const +void ANCS::AnimationSet::MetaTransFactory::write(athena::io::YAMLDocWriter& writer) const { if (!m_trans) { @@ -836,10 +818,10 @@ void ANCS::AnimationSet::MetaTransFactory::write(Athena::io::YAMLDocWriter& writ const char* ANCS::AnimationSet::MetaTransFactory::DNAType() { - return "Retro::DNAMP1::ANCS::AnimationSet::MetaTransFactory"; + return "urde::DNAMP1::ANCS::AnimationSet::MetaTransFactory"; } -void ANCS::AnimationSet::read(Athena::io::IStreamReader& reader) +void ANCS::AnimationSet::read(athena::io::IStreamReader& reader) { atUint16 sectionCount = reader.readUint16Big(); @@ -874,7 +856,7 @@ void ANCS::AnimationSet::read(Athena::io::IStreamReader& reader) } } -void ANCS::AnimationSet::write(Athena::io::IStreamWriter& writer) const +void ANCS::AnimationSet::write(athena::io::IStreamWriter& writer) const { atUint16 sectionCount; if (animResources.size()) @@ -957,22 +939,19 @@ size_t ANCS::AnimationSet::binarySize(size_t __isz) const return __isz; } -void ANCS::AnimationSet::read(Athena::io::YAMLDocReader& reader) +void ANCS::AnimationSet::read(athena::io::YAMLDocReader& reader) { atUint16 sectionCount = reader.readUint16("sectionCount"); - atUint32 animationCount = reader.readUint32("animationCount"); - reader.enumerate("animations", animations, animationCount); + reader.enumerate("animations", animations); - atUint32 transitionCount = reader.readUint32("transitionCount"); - reader.enumerate("transitions", transitions, transitionCount); + reader.enumerate("transitions", transitions); reader.enumerate("defaultTransition", defaultTransition); additiveAnims.clear(); if (sectionCount > 1) { - atUint32 additiveAnimCount = reader.readUint32("additiveAnimCount"); - reader.enumerate("additiveAnims", additiveAnims, additiveAnimCount); + reader.enumerate("additiveAnims", additiveAnims); floatA = reader.readFloat("floatA"); floatB = reader.readFloat("floatB"); } @@ -980,19 +959,17 @@ void ANCS::AnimationSet::read(Athena::io::YAMLDocReader& reader) halfTransitions.clear(); if (sectionCount > 2) { - atUint32 halfTransitionCount = reader.readUint32("halfTransitionCount"); - reader.enumerate("halfTransitions", halfTransitions, halfTransitionCount); + reader.enumerate("halfTransitions", halfTransitions); } animResources.clear(); if (sectionCount > 3) { - atUint32 animResourcesCount = reader.readUint32("animResourcesCount"); - reader.enumerate("animResources", animResources, animResourcesCount); + reader.enumerate("animResources", animResources); } } -void ANCS::AnimationSet::write(Athena::io::YAMLDocWriter& writer) const +void ANCS::AnimationSet::write(athena::io::YAMLDocWriter& writer) const { atUint16 sectionCount; if (animResources.size()) @@ -1006,16 +983,13 @@ void ANCS::AnimationSet::write(Athena::io::YAMLDocWriter& writer) const writer.writeUint16("sectionCount", sectionCount); - writer.writeUint32("animationCount", animations.size()); writer.enumerate("animations", animations); - writer.writeUint32("transitionCount", transitions.size()); writer.enumerate("transitions", transitions); writer.enumerate("defaultTransition", defaultTransition); if (sectionCount > 1) { - writer.writeUint32("additiveAnimCount", additiveAnims.size()); writer.enumerate("additiveAnims", additiveAnims); writer.writeFloat("floatA", floatA); writer.writeFloat("floatB", floatB); @@ -1023,20 +997,18 @@ void ANCS::AnimationSet::write(Athena::io::YAMLDocWriter& writer) const if (sectionCount > 2) { - writer.writeUint32("halfTransitionCount", halfTransitions.size()); writer.enumerate("halfTransitions", halfTransitions); } if (sectionCount > 3) { - writer.writeUint32("animResourcesCount", animResources.size()); writer.enumerate("animResources", animResources); } } const char* ANCS::AnimationSet::DNAType() { - return "Retro::DNAMP1::ANCS::AnimationSet"; + return "urde::DNAMP1::ANCS::AnimationSet"; } } diff --git a/DataSpec/DNAMP1/ANCS.hpp b/DataSpec/DNAMP1/ANCS.hpp index 8a7db335e..0d5aff532 100644 --- a/DataSpec/DNAMP1/ANCS.hpp +++ b/DataSpec/DNAMP1/ANCS.hpp @@ -9,7 +9,7 @@ #include "CINF.hpp" #include "CSKR.hpp" #include "ANIM.hpp" -#include "Athena/FileReader.hpp" +#include "athena/FileReader.hpp" namespace DataSpec { @@ -390,34 +390,34 @@ struct ANCS : BigYAML static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, - std::function fileChanged) + std::function fileChanged) { - HECL::ProjectPath yamlPath = outPath.getWithExtension(_S(".yaml")); - HECL::ProjectPath::Type yamlType = yamlPath.getPathType(); - HECL::ProjectPath blendPath = outPath.getWithExtension(_S(".blend")); - HECL::ProjectPath::Type blendType = blendPath.getPathType(); + hecl::ProjectPath yamlPath = outPath.getWithExtension(_S(".yaml")); + hecl::ProjectPath::Type yamlType = yamlPath.getPathType(); + hecl::ProjectPath blendPath = outPath.getWithExtension(_S(".blend")); + hecl::ProjectPath::Type blendType = blendPath.getPathType(); if (force || - yamlType == HECL::ProjectPath::Type::None || - blendType == HECL::ProjectPath::Type::None) + yamlType == hecl::ProjectPath::Type::None || + blendType == hecl::ProjectPath::Type::None) { ANCS ancs; ancs.read(rs); - if (force || yamlType == HECL::ProjectPath::Type::None) + if (force || yamlType == hecl::ProjectPath::Type::None) { - FILE* fp = HECL::Fopen(yamlPath.getAbsolutePath().c_str(), _S("wb")); + FILE* fp = hecl::Fopen(yamlPath.getAbsolutePath().c_str(), _S("wb")); ancs.toYAMLFile(fp); fclose(fp); } - if (force || blendType == HECL::ProjectPath::Type::None) + if (force || blendType == hecl::ProjectPath::Type::None) { - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); DNAANCS::ReadANCSToBlender, ANCS, MaterialSet, DNACMDL::SurfaceHeader_1, 2> (conn, ancs, blendPath, pakRouter, entry, dataSpec, fileChanged, force); } @@ -426,19 +426,19 @@ struct ANCS : BigYAML return true; } - static bool Cook(const HECL::ProjectPath& outPath, - const HECL::ProjectPath& inPath, + static bool Cook(const hecl::ProjectPath& outPath, + const hecl::ProjectPath& inPath, const DNAANCS::Actor& actor) { /* Search for yaml */ - HECL::ProjectPath yamlPath = inPath.getWithExtension(_S(".yaml"), true); - if (yamlPath.getPathType() != HECL::ProjectPath::Type::File) - Log.report(LogVisor::FatalError, _S("'%s' not found as file"), + hecl::ProjectPath yamlPath = inPath.getWithExtension(_S(".yaml"), true); + if (yamlPath.getPathType() != hecl::ProjectPath::Type::File) + Log.report(logvisor::Fatal, _S("'%s' not found as file"), yamlPath.getRelativePath().c_str()); - Athena::io::FileReader yamlReader(yamlPath.getAbsolutePath()); + athena::io::FileReader yamlReader(yamlPath.getAbsolutePath()); if (!BigYAML::ValidateFromYAMLFile(yamlReader)) - Log.report(LogVisor::FatalError, _S("'%s' is not Retro::DNAMP1::ANCS type"), + Log.report(logvisor::Fatal, _S("'%s' is not urde::DNAMP1::ANCS type"), yamlPath.getRelativePath().c_str()); ANCS ancs; ancs.read(yamlReader); diff --git a/DataSpec/DNAMP1/ANIM.cpp b/DataSpec/DNAMP1/ANIM.cpp index 3fc7cff46..1f3715091 100644 --- a/DataSpec/DNAMP1/ANIM.cpp +++ b/DataSpec/DNAMP1/ANIM.cpp @@ -5,9 +5,9 @@ namespace DataSpec namespace DNAMP1 { -using ANIMOutStream = HECL::BlenderConnection::PyOutStream::ANIMOutStream; +using ANIMOutStream = hecl::BlenderConnection::PyOutStream::ANIMOutStream; -void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, const CINF& cinf) const +void ANIM::IANIM::sendANIMToBlender(hecl::BlenderConnection::PyOutStream& os, const CINF& cinf) const { os.format("act.hecl_fps = round(%f)\n", (1.0f / mainInterval)); @@ -68,7 +68,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co } } -void ANIM::ANIM0::read(Athena::io::IStreamReader& reader) +void ANIM::ANIM0::read(athena::io::IStreamReader& reader) { Header head; head.read(reader); @@ -138,7 +138,7 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader) evnt.read(reader); } -void ANIM::ANIM0::write(Athena::io::IStreamWriter& writer) const +void ANIM::ANIM0::write(athena::io::IStreamWriter& writer) const { Header head; head.unk0 = 0; @@ -239,7 +239,7 @@ size_t ANIM::ANIM0::binarySize(size_t __isz) const return __isz + 4; } -void ANIM::ANIM2::read(Athena::io::IStreamReader& reader) +void ANIM::ANIM2::read(athena::io::IStreamReader& reader) { Header head; head.read(reader); @@ -303,7 +303,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader) chanKeys = bsReader.read(bsData.get(), keyframeCount, channels, head.rotDiv, head.translationMult); } -void ANIM::ANIM2::write(Athena::io::IStreamWriter& writer) const +void ANIM::ANIM2::write(athena::io::IStreamWriter& writer) const { Header head; head.evnt = evnt; diff --git a/DataSpec/DNAMP1/ANIM.hpp b/DataSpec/DNAMP1/ANIM.hpp index 2155f2377..66a6bba60 100644 --- a/DataSpec/DNAMP1/ANIM.hpp +++ b/DataSpec/DNAMP1/ANIM.hpp @@ -28,7 +28,7 @@ struct ANIM : BigDNA float mainInterval = 0.0; UniqueID32 evnt; - void sendANIMToBlender(HECL::BlenderConnection::PyOutStream&, const CINF&) const; + void sendANIMToBlender(hecl::BlenderConnection::PyOutStream&, const CINF&) const; }; struct ANIM0 : IANIM @@ -90,7 +90,7 @@ struct ANIM : BigDNA Value initTZ = 0; Value qTZ = 0; - void read(Athena::io::IStreamReader& reader) + void read(athena::io::IStreamReader& reader) { id = reader.readUint32Big(); keyCount1 = reader.readUint16Big(); @@ -111,7 +111,7 @@ struct ANIM : BigDNA qTZ = reader.readUByte(); } } - void write(Athena::io::IStreamWriter& writer) const + void write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(id); writer.writeUint16Big(keyCount1); @@ -143,7 +143,7 @@ struct ANIM : BigDNA }; std::unique_ptr m_anim; - void read(Athena::io::IStreamReader& reader) + void read(athena::io::IStreamReader& reader) { atUint32 version = reader.readUint32Big(); switch (version) @@ -157,12 +157,12 @@ struct ANIM : BigDNA m_anim->read(reader); break; default: - Log.report(LogVisor::Error, "unrecognized ANIM version"); + Log.report(logvisor::Error, "unrecognized ANIM version"); break; } } - void write(Athena::io::IStreamWriter& writer) const + void write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(m_anim->m_version); m_anim->write(writer); @@ -173,7 +173,7 @@ struct ANIM : BigDNA return m_anim->binarySize(__isz + 4); } - void sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, const CINF& cinf, bool) const + void sendANIMToBlender(hecl::BlenderConnection::PyOutStream& os, const CINF& cinf, bool) const { m_anim->sendANIMToBlender(os, cinf); } diff --git a/DataSpec/DNAMP1/CINF.hpp b/DataSpec/DNAMP1/CINF.hpp index d7d73dadd..b6902a2bb 100644 --- a/DataSpec/DNAMP1/CINF.hpp +++ b/DataSpec/DNAMP1/CINF.hpp @@ -56,7 +56,7 @@ struct CINF : BigDNA return nullptr; } - void sendVertexGroupsToBlender(HECL::BlenderConnection::PyOutStream& os) const + void sendVertexGroupsToBlender(hecl::BlenderConnection::PyOutStream& os) const { for (atUint32 bid : boneIds) { @@ -71,7 +71,7 @@ struct CINF : BigDNA } } - void sendCINFToBlender(HECL::BlenderConnection::PyOutStream& os, const UniqueID32& cinfId) const + void sendCINFToBlender(hecl::BlenderConnection::PyOutStream& os, const UniqueID32& cinfId) const { os.format("arm = bpy.data.armatures.new('CINF_%08X')\n" "arm_obj = bpy.data.objects.new(arm.name, arm)\n" diff --git a/DataSpec/DNAMP1/CMDL.hpp b/DataSpec/DNAMP1/CMDL.hpp index 4e4e03f59..4b90d1af2 100644 --- a/DataSpec/DNAMP1/CMDL.hpp +++ b/DataSpec/DNAMP1/CMDL.hpp @@ -8,7 +8,7 @@ #include "CINF.hpp" #include "CSKR.hpp" -#include +#include namespace DataSpec { @@ -19,11 +19,11 @@ struct CMDL { static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, - std::function fileChanged) + std::function fileChanged) { /* Check for RigPair */ const PAKRouter::RigPair* rp = pakRouter.lookupCMDLRigPair(entry.id); @@ -39,8 +39,8 @@ struct CMDL } /* Do extract */ - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); - if (!conn.createBlend(outPath, HECL::BlenderConnection::BlendType::Mesh)) + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); + if (!conn.createBlend(outPath, hecl::BlenderConnection::BlendType::Mesh)) return false; DNACMDL::ReadCMDLToBlender, MaterialSet, std::pair, DNACMDL::SurfaceHeader_1, 2> (conn, rs, pakRouter, entry, dataSpec, loadRp); @@ -48,24 +48,24 @@ struct CMDL #if 0 /* Cook and re-extract test */ - HECL::ProjectPath tempOut = outPath.getWithExtension(_S(".recook"), true); - HECL::BlenderConnection::DataStream ds = conn.beginData(); - DNACMDL::Mesh mesh = ds.compileMesh(HECL::TopologyTriStrips, -1); + hecl::ProjectPath tempOut = outPath.getWithExtension(_S(".recook"), true); + hecl::BlenderConnection::DataStream ds = conn.beginData(); + DNACMDL::Mesh mesh = ds.compileMesh(hecl::TopologyTriStrips, -1); ds.close(); DNACMDL::WriteCMDL(tempOut, outPath, mesh); - Athena::io::FileReader reader(tempOut.getAbsolutePath()); - HECL::ProjectPath tempBlend = outPath.getWithExtension(_S(".recook.blend"), true); - if (!conn.createBlend(tempBlend, HECL::BlenderConnection::TypeMesh)) + athena::io::FileReader reader(tempOut.getAbsolutePath()); + hecl::ProjectPath tempBlend = outPath.getWithExtension(_S(".recook.blend"), true); + if (!conn.createBlend(tempBlend, hecl::BlenderConnection::TypeMesh)) return false; DNACMDL::ReadCMDLToBlender, MaterialSet, std::pair, DNACMDL::SurfaceHeader_1_2, 2> (conn, reader, pakRouter, entry, dataSpec, loadRp); return conn.saveBlend(); #elif 0 /* HMDL cook test */ - HECL::ProjectPath tempOut = outPath.getWithExtension(_S(".recook"), true); - HECL::BlenderConnection::DataStream ds = conn.beginData(); - DNACMDL::Mesh mesh = ds.compileMesh(HECL::HMDLTopology::TriStrips, 16); + hecl::ProjectPath tempOut = outPath.getWithExtension(_S(".recook"), true); + hecl::BlenderConnection::DataStream ds = conn.beginData(); + DNACMDL::Mesh mesh = ds.compileMesh(hecl::HMDLTopology::TriStrips, 16); ds.close(); DNACMDL::WriteHMDLCMDL(tempOut, outPath, mesh); #endif @@ -81,11 +81,11 @@ struct CMDL DNACMDL::NameCMDL, MaterialSet>(rs, pakRouter, entry, dataSpec); } - static bool Cook(const HECL::ProjectPath& outPath, - const HECL::ProjectPath& inPath, + static bool Cook(const hecl::ProjectPath& outPath, + const hecl::ProjectPath& inPath, const DNACMDL::Mesh& mesh) { - HECL::ProjectPath tempOut = outPath.getWithExtension(_S(".recook")); + hecl::ProjectPath tempOut = outPath.getWithExtension(_S(".recook")); if (mesh.skins.size()) { DNACMDL::Mesh skinMesh = mesh.getContiguousSkinningVersion(); @@ -94,7 +94,7 @@ struct CMDL /* Output skinning intermediate */ auto vertCountIt = skinMesh.contiguousSkinVertCounts.cbegin(); - Athena::io::FileWriter writer(outPath.getWithExtension(_S(".skin")).getAbsolutePath()); + athena::io::FileWriter writer(outPath.getWithExtension(_S(".skin")).getAbsolutePath()); writer.writeUint32Big(skinMesh.skins.size()); for (const std::vector skin : skinMesh.skins) { @@ -116,18 +116,18 @@ struct CMDL return true; } - static bool HMDLCook(const HECL::ProjectPath& outPath, - const HECL::ProjectPath& inPath, + static bool HMDLCook(const hecl::ProjectPath& outPath, + const hecl::ProjectPath& inPath, const DNACMDL::Mesh& mesh) { - HECL::ProjectPath tempOut = outPath.getWithExtension(_S(".recook")); + hecl::ProjectPath tempOut = outPath.getWithExtension(_S(".recook")); if (mesh.skins.size()) { if (!DNACMDL::WriteHMDLCMDL(tempOut, inPath, mesh)) return false; /* Output skinning intermediate */ - Athena::io::FileWriter writer(outPath.getWithExtension(_S(".skin")).getAbsolutePath()); + athena::io::FileWriter writer(outPath.getWithExtension(_S(".skin")).getAbsolutePath()); writer.writeUint32Big(mesh.skinBanks.banks.size()); for (const DNACMDL::Mesh::SkinBanks::Bank& sb : mesh.skinBanks.banks) { diff --git a/DataSpec/DNAMP1/CMDLMaterials.cpp b/DataSpec/DNAMP1/CMDLMaterials.cpp index 27b541a7f..becba1ace 100644 --- a/DataSpec/DNAMP1/CMDLMaterials.cpp +++ b/DataSpec/DNAMP1/CMDLMaterials.cpp @@ -1,7 +1,7 @@ #include "CMDLMaterials.hpp" #include "../DNAMP2/CMDLMaterials.hpp" -using Stream = HECL::BlenderConnection::PyOutStream; +using Stream = hecl::BlenderConnection::PyOutStream; namespace DataSpec { @@ -914,10 +914,10 @@ void MaterialSet::ConstructMaterial(Stream& out, unsigned matIdx) {_ConstructMaterial(out, material, groupIdx, matIdx);} -MaterialSet::Material::Material(const HECL::Backend::GX& gx, +MaterialSet::Material::Material(const hecl::Backend::GX& gx, const std::unordered_map& iprops, - const std::vector& texPathsIn, - std::vector& texPathsOut, + const std::vector& texPathsIn, + std::vector& texPathsOut, int colorCount, int uvCount, bool lightmapUVs, @@ -969,7 +969,7 @@ MaterialSet::Material::Material(const HECL::Backend::GX& gx, textureIdxs.reserve(gx.m_tevCount); for (unsigned i=0 ; i& iprops, - const std::vector& texPaths) + const std::vector& texPaths) { auto search = iprops.find("retro_depth_sort"); if (search != iprops.end()) @@ -1187,10 +1187,10 @@ HMDLMaterialSet::Material::Material(HECL::Frontend::Frontend& FE, if (search != iprops.end()) flags.setLightmap(search->second != 0); - for (const HECL::ProjectPath& path : mat.texs) + for (const hecl::ProjectPath& path : mat.texs) { size_t idx = 0; - for (const HECL::ProjectPath& tPath : texPaths) + for (const hecl::ProjectPath& tPath : texPaths) { if (path == tPath) { @@ -1210,15 +1210,15 @@ HMDLMaterialSet::Material::Material(HECL::Frontend::Frontend& FE, uvAnimsSize = 4; uvAnimsCount = 0; - for (const HECL::Frontend::IR::Instruction& inst : heclIr.m_instructions) + for (const hecl::Frontend::IR::Instruction& inst : heclIr.m_instructions) { - if (inst.m_op != HECL::Frontend::IR::OpType::Call) + if (inst.m_op != hecl::Frontend::IR::OpType::Call) continue; if (inst.m_call.m_name.compare("Texture")) continue; - const HECL::Frontend::IR::Instruction& sourceInst = inst.getChildInst(heclIr, 1); - if (sourceInst.m_op != HECL::Frontend::IR::OpType::Call) + const hecl::Frontend::IR::Instruction& sourceInst = inst.getChildInst(heclIr, 1); + if (sourceInst.m_op != hecl::Frontend::IR::OpType::Call) continue; if (sourceInst.m_call.m_name.compare(0, 11, "RetroUVMode")) continue; @@ -1227,7 +1227,7 @@ HMDLMaterialSet::Material::Material(HECL::Frontend::Frontend& FE, gameArgs.reserve(sourceInst.getChildCount() - 1); for (int i=1 ; i uvAnims; - static void AddTexture(HECL::BlenderConnection::PyOutStream& out, + static void AddTexture(hecl::BlenderConnection::PyOutStream& out, GX::TexGenSrc type, int mtxIdx, uint32_t texIdx); - static void AddTextureAnim(HECL::BlenderConnection::PyOutStream& out, + static void AddTextureAnim(hecl::BlenderConnection::PyOutStream& out, MaterialSet::Material::UVAnimation::Mode type, unsigned idx, const float* vals); - static void AddKcolor(HECL::BlenderConnection::PyOutStream& out, + static void AddKcolor(hecl::BlenderConnection::PyOutStream& out, const GX::Color& col, unsigned idx); - static void AddDynamicColor(HECL::BlenderConnection::PyOutStream& out, unsigned idx); - static void AddDynamicAlpha(HECL::BlenderConnection::PyOutStream& out, unsigned idx); + static void AddDynamicColor(hecl::BlenderConnection::PyOutStream& out, unsigned idx); + static void AddDynamicAlpha(hecl::BlenderConnection::PyOutStream& out, unsigned idx); Material() = default; - Material(const HECL::Backend::GX& gx, + Material(const hecl::Backend::GX& gx, const std::unordered_map& iprops, - const std::vector& texPathsIn, - std::vector& texPathsOut, + const std::vector& texPathsIn, + std::vector& texPathsOut, int colorCount, int uvCount, bool lightmapUVs, @@ -388,12 +388,12 @@ struct MaterialSet : BigDNA }; Vector materials; - static void RegisterMaterialProps(HECL::BlenderConnection::PyOutStream& out); - static void ConstructMaterial(HECL::BlenderConnection::PyOutStream& out, + static void RegisterMaterialProps(hecl::BlenderConnection::PyOutStream& out); + static void ConstructMaterial(hecl::BlenderConnection::PyOutStream& out, const MaterialSet::Material& material, unsigned groupIdx, unsigned matIdx); - void readToBlender(HECL::BlenderConnection::PyOutStream& os, + void readToBlender(hecl::BlenderConnection::PyOutStream& os, const PAKRouter& pakRouter, const PAKRouter::EntryType& entry, unsigned setIdx) @@ -416,7 +416,7 @@ struct MaterialSet : BigDNA ++stageIdx; continue; } - const NOD::Node* node; + const nod::Node* node; typename PAKRouter::EntryType* texEntry = (typename PAKRouter::EntryType*) pakRouter.lookupEntry(head.textureIDs[mat.textureIdxs[texInfo.texSlot]], &node); if (texEntry->name.size()) @@ -427,9 +427,9 @@ struct MaterialSet : BigDNA continue; } if (setIdx < 0) - texEntry->name = HECL::Format("%s_%d_%d", prefix, matIdx, stageIdx); + texEntry->name = hecl::Format("%s_%d_%d", prefix, matIdx, stageIdx); else - texEntry->name = HECL::Format("%s_%d_%d_%d", prefix, setIdx, matIdx, stageIdx); + texEntry->name = hecl::Format("%s_%d_%d_%d", prefix, setIdx, matIdx, stageIdx); if (mat.flags.lightmap() && stageIdx == 0) { @@ -468,14 +468,14 @@ struct HMDLMaterialSet : BigDNA Vector uvAnims; String<-1> heclSource; - HECL::Frontend::IR heclIr; + hecl::Frontend::IR heclIr; Material() = default; - Material(HECL::Frontend::Frontend& FE, + Material(hecl::Frontend::Frontend& FE, const std::string& diagName, - const HECL::BlenderConnection::DataStream::Mesh::Material& mat, + const hecl::BlenderConnection::DataStream::Mesh::Material& mat, const std::unordered_map& iprops, - const std::vector& texPaths); + const std::vector& texPaths); }; Vector materials; }; diff --git a/DataSpec/DNAMP1/CSKR.hpp b/DataSpec/DNAMP1/CSKR.hpp index de591b0a6..1f9b23a02 100644 --- a/DataSpec/DNAMP1/CSKR.hpp +++ b/DataSpec/DNAMP1/CSKR.hpp @@ -34,7 +34,7 @@ struct CSKR : BigDNA return nullptr; } - void weightVertex(HECL::BlenderConnection::PyOutStream& os, const CINF& cinf, atUint32 idx) const + void weightVertex(hecl::BlenderConnection::PyOutStream& os, const CINF& cinf, atUint32 idx) const { atUint32 accum = 0; for (const SkinningRule& rule : skinningRules) diff --git a/DataSpec/DNAMP1/DNAMP1.cpp b/DataSpec/DNAMP1/DNAMP1.cpp index 1a92eb6e4..1bc00dfa3 100644 --- a/DataSpec/DNAMP1/DNAMP1.cpp +++ b/DataSpec/DNAMP1/DNAMP1.cpp @@ -18,7 +18,7 @@ namespace DataSpec { namespace DNAMP1 { -LogVisor::LogModule Log("Retro::DNAMP1"); +logvisor::Module Log("urde::DNAMP1"); static bool GetNoShare(const std::string& name) { @@ -29,12 +29,12 @@ static bool GetNoShare(const std::string& name) return true; } -PAKBridge::PAKBridge(HECL::Database::Project& project, - const NOD::Node& node, +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) { - NOD::AthenaPartReadStream rs(node.beginReadStream()); + nod::AthenaPartReadStream rs(node.beginReadStream()); m_pak.read(rs); /* Append Level String */ @@ -60,12 +60,12 @@ PAKBridge::PAKBridge(HECL::Database::Project& project, } } -static HECL::SystemString LayerName(const std::string& name) +static hecl::SystemString LayerName(const std::string& name) { #if HECL_UCS2 - HECL::SystemString ret = HECL::UTF8ToWide(name); + hecl::SystemString ret = hecl::UTF8ToWide(name); #else - HECL::SystemString ret = name; + hecl::SystemString ret = name; #endif for (auto& ch : ret) if (ch == _S('/') || ch == _S('\\')) @@ -88,7 +88,7 @@ void PAKBridge::build() mlvl.read(rs); } #if HECL_UCS2 - level.name = HECL::UTF8ToWide(m_pak.bestEntryName(entry)); + level.name = hecl::UTF8ToWide(m_pak.bestEntryName(entry)); #else level.name = m_pak.bestEntryName(entry); #endif @@ -102,7 +102,7 @@ void PAKBridge::build() { worldMapEnt->name = entry.name + "_mapw"; PAKEntryReadStream rs = worldMapEnt->beginReadStream(m_node); - rs.seek(8, Athena::Current); + rs.seek(8, athena::Current); atUint32 areaCount = rs.readUint32Big(); mapw.reserve(areaCount); for (atUint32 i=0 ; i& pakRouter, PAK::Entry* cmdlEnt = (PAK::Entry*)m_pak.lookupEntry(ci.cmdl); PAK::Entry* cskrEnt = (PAK::Entry*)m_pak.lookupEntry(ci.cskr); PAK::Entry* cinfEnt = (PAK::Entry*)m_pak.lookupEntry(ci.cinf); - cmdlEnt->name = HECL::Format("ANCS_%08X_%s_model", entry.first.toUint32(), ci.name.c_str()); - cskrEnt->name = HECL::Format("ANCS_%08X_%s_skin", entry.first.toUint32(), ci.name.c_str()); - cinfEnt->name = HECL::Format("ANCS_%08X_%s_skel", entry.first.toUint32(), ci.name.c_str()); + cmdlEnt->name = hecl::Format("ANCS_%08X_%s_model", entry.first.toUint32(), ci.name.c_str()); + cskrEnt->name = hecl::Format("ANCS_%08X_%s_skin", entry.first.toUint32(), ci.name.c_str()); + cinfEnt->name = hecl::Format("ANCS_%08X_%s_skel", entry.first.toUint32(), ci.name.c_str()); if (ci.cmdlOverlay && ci.cskrOverlay) { addTo[ci.cmdlOverlay] = std::make_pair(ci.cskrOverlay, ci.cinf); PAK::Entry* cmdlEnt = (PAK::Entry*)m_pak.lookupEntry(ci.cmdlOverlay); PAK::Entry* cskrEnt = (PAK::Entry*)m_pak.lookupEntry(ci.cskrOverlay); - cmdlEnt->name = HECL::Format("ANCS_%08X_%s_overmodel", entry.first.toUint32(), ci.name.c_str()); - cskrEnt->name = HECL::Format("ANCS_%08X_%s_overskin", entry.first.toUint32(), ci.name.c_str()); + cmdlEnt->name = hecl::Format("ANCS_%08X_%s_overmodel", entry.first.toUint32(), ci.name.c_str()); + cskrEnt->name = hecl::Format("ANCS_%08X_%s_overskin", entry.first.toUint32(), ci.name.c_str()); } } std::map> animInfo; @@ -245,11 +245,11 @@ void PAKBridge::addCMDLRigPairs(PAKRouter& pakRouter, for (auto& ae : animInfo) { PAK::Entry* animEnt = (PAK::Entry*)m_pak.lookupEntry(ae.second.animId); - animEnt->name = HECL::Format("ANCS_%08X_%s", entry.first.toUint32(), ae.second.name.c_str()); + animEnt->name = hecl::Format("ANCS_%08X_%s", entry.first.toUint32(), ae.second.name.c_str()); if (ae.second.evntId) { PAK::Entry* evntEnt = (PAK::Entry*)m_pak.lookupEntry(ae.second.evntId); - evntEnt->name = HECL::Format("ANCS_%08X_%s_evnt", entry.first.toUint32(), ae.second.name.c_str()); + evntEnt->name = hecl::Format("ANCS_%08X_%s_evnt", entry.first.toUint32(), ae.second.name.c_str()); } } } diff --git a/DataSpec/DNAMP1/DNAMP1.hpp b/DataSpec/DNAMP1/DNAMP1.hpp index 383545dba..99cb23407 100644 --- a/DataSpec/DNAMP1/DNAMP1.hpp +++ b/DataSpec/DNAMP1/DNAMP1.hpp @@ -9,30 +9,30 @@ namespace DataSpec namespace DNAMP1 { -extern LogVisor::LogModule Log; +extern logvisor::Module Log; /* MP1-specific, one-shot PAK traversal/extraction class */ class PAKBridge { - HECL::Database::Project& m_project; - const NOD::Node& m_node; + hecl::Database::Project& m_project; + const nod::Node& m_node; PAK m_pak; public: bool m_doExtract; using Level = Level; std::unordered_map m_levelDeps; - HECL::SystemString m_levelString; + hecl::SystemString m_levelString; - PAKBridge(HECL::Database::Project& project, - const NOD::Node& node, + PAKBridge(hecl::Database::Project& project, + const nod::Node& node, bool doExtract=true); void build(); static ResExtractor LookupExtractor(const PAK::Entry& entry); const std::string& getName() const {return m_node.getName();} - const HECL::SystemString& getLevelString() const {return m_levelString;} + const hecl::SystemString& getLevelString() const {return m_levelString;} using PAKType = PAK; const PAKType& getPAK() const {return m_pak;} - const NOD::Node& getNode() const {return m_node;} + const nod::Node& getNode() const {return m_node;} void addCMDLRigPairs(PAKRouter& pakRouter, std::unordered_map>& addTo) const; diff --git a/DataSpec/DNAMP1/DeafBabe.cpp b/DataSpec/DNAMP1/DeafBabe.cpp index 9ee913148..3e885f749 100644 --- a/DataSpec/DNAMP1/DeafBabe.cpp +++ b/DataSpec/DNAMP1/DeafBabe.cpp @@ -5,7 +5,7 @@ namespace DataSpec namespace DNAMP1 { -void DeafBabe::BlenderInit(HECL::BlenderConnection::PyOutStream& os) +void DeafBabe::BlenderInit(hecl::BlenderConnection::PyOutStream& os) { os << "TYPE_COLORS = {'Ground':(1.0, 0.43, 0.15),\n" " 'Stone':(0.28, 0.28, 0.28),\n" diff --git a/DataSpec/DNAMP1/DeafBabe.hpp b/DataSpec/DNAMP1/DeafBabe.hpp index 5b31e666c..f3af3ff2e 100644 --- a/DataSpec/DNAMP1/DeafBabe.hpp +++ b/DataSpec/DNAMP1/DeafBabe.hpp @@ -86,10 +86,10 @@ struct DeafBabe : BigDNA Vector verts; /* Dummy MP2 member */ - void insertNoClimb(HECL::BlenderConnection::PyOutStream&) const {} + void insertNoClimb(hecl::BlenderConnection::PyOutStream&) const {} - static void BlenderInit(HECL::BlenderConnection::PyOutStream& os); - void sendToBlender(HECL::BlenderConnection::PyOutStream& os) const + static void BlenderInit(hecl::BlenderConnection::PyOutStream& os); + void sendToBlender(hecl::BlenderConnection::PyOutStream& os) const { DeafBabeSendToBlender(os, *this); } diff --git a/DataSpec/DNAMP1/EVNT.cpp b/DataSpec/DNAMP1/EVNT.cpp index 0af53708b..e22025759 100644 --- a/DataSpec/DNAMP1/EVNT.cpp +++ b/DataSpec/DNAMP1/EVNT.cpp @@ -5,7 +5,7 @@ namespace DataSpec namespace DNAMP1 { -void EVNT::read(Athena::io::IStreamReader& reader) +void EVNT::read(athena::io::IStreamReader& reader) { version = reader.readUint32Big(); @@ -26,7 +26,7 @@ void EVNT::read(Athena::io::IStreamReader& reader) } } -void EVNT::write(Athena::io::IStreamWriter& writer) const +void EVNT::write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(version); @@ -46,50 +46,42 @@ void EVNT::write(Athena::io::IStreamWriter& writer) const } } -void EVNT::read(Athena::io::YAMLDocReader& reader) +void EVNT::read(athena::io::YAMLDocReader& reader) { version = reader.readUint32("version"); - atUint32 loopCount = reader.readUint32("loopCount"); - reader.enumerate("loopEvents", loopEvents, loopCount); + reader.enumerate("loopEvents", loopEvents); uevtEvents.clear(); - atUint32 uevtCount = reader.readUint32("uevtCount"); - reader.enumerate("uevtEvents", uevtEvents, uevtCount); + reader.enumerate("uevtEvents", uevtEvents); - atUint32 effectCount = reader.readUint32("effectCount"); - reader.enumerate("effectEvents", effectEvents, effectCount); + reader.enumerate("effectEvents", effectEvents); if (version == 2) { - atUint32 sfxCount = reader.readUint32("sfxCount"); - reader.enumerate("sfxEvents", sfxEvents, sfxCount); + reader.enumerate("sfxEvents", sfxEvents); } } -void EVNT::write(Athena::io::YAMLDocWriter& writer) const +void EVNT::write(athena::io::YAMLDocWriter& writer) const { writer.writeUint32("version", version); - writer.writeUint32("loopCount", loopEvents.size()); writer.enumerate("loopEvents", loopEvents); - writer.writeUint32("uevtCount", uevtEvents.size()); writer.enumerate("uevtEvents", uevtEvents); - writer.writeUint32("effectCount", effectEvents.size()); writer.enumerate("effectEvents", effectEvents); if (version == 2) { - writer.writeUint32("sfxCount", sfxEvents.size()); writer.enumerate("sfxEvents", sfxEvents); } } const char* EVNT::DNAType() { - return "Retro::DNAMP1::EVNT"; + return "urde::DNAMP1::EVNT"; } size_t EVNT::binarySize(size_t __isz) const diff --git a/DataSpec/DNAMP1/EVNT.hpp b/DataSpec/DNAMP1/EVNT.hpp index 5283c4fec..c5ff317f2 100644 --- a/DataSpec/DNAMP1/EVNT.hpp +++ b/DataSpec/DNAMP1/EVNT.hpp @@ -66,11 +66,11 @@ struct EVNT : BigYAML }; std::vector sfxEvents; - static bool Extract(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath) + static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) { EVNT evnt; evnt.read(rs); - FILE* fp = HECL::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); + FILE* fp = hecl::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); evnt.toYAMLFile(fp); fclose(fp); return true; diff --git a/DataSpec/DNAMP1/FRME.cpp b/DataSpec/DNAMP1/FRME.cpp index 21bbcfcff..fcd406163 100644 --- a/DataSpec/DNAMP1/FRME.cpp +++ b/DataSpec/DNAMP1/FRME.cpp @@ -5,7 +5,7 @@ namespace DataSpec { namespace DNAMP1 { -void FRME::read(Athena::io::IStreamReader& __dna_reader) +void FRME::read(athena::io::IStreamReader& __dna_reader) { /* version */ version = __dna_reader.readUint32Big(); @@ -18,13 +18,13 @@ void FRME::read(Athena::io::IStreamReader& __dna_reader) /* widgetCount */ widgetCount = __dna_reader.readUint32Big(); /* widgets */ - __dna_reader.enumerate(widgets, widgetCount, [this](Athena::io::IStreamReader& reader, Widget& w) { + __dna_reader.enumerate(widgets, widgetCount, [this](athena::io::IStreamReader& reader, Widget& w) { w.owner = this; w.read(reader); }); } -void FRME::write(Athena::io::IStreamWriter& __dna_writer) const +void FRME::write(athena::io::IStreamWriter& __dna_writer) const { /* version */ __dna_writer.writeUint32Big(version); @@ -46,7 +46,7 @@ size_t FRME::binarySize(size_t __isz) const return __isz + 20; } -void FRME::Widget::read(Athena::io::IStreamReader& __dna_reader) +void FRME::Widget::read(athena::io::IStreamReader& __dna_reader) { /* type */ type.read(__dna_reader); @@ -67,7 +67,7 @@ void FRME::Widget::read(Athena::io::IStreamReader& __dna_reader) case SBIG('TBGP'): widgetInfo.reset(new TBGPInfo); break; case SBIG('SLGP'): widgetInfo.reset(new SLGPInfo); break; default: - Log.report(LogVisor::FatalError, _S("Unsupported FRME widget type %.8X"), type.toUint32()); + Log.report(logvisor::Fatal, _S("Unsupported FRME widget type %.8X"), type.toUint32()); } /* widgetInfo */ @@ -98,7 +98,7 @@ void FRME::Widget::read(Athena::io::IStreamReader& __dna_reader) unk4 = __dna_reader.readBool(); } -void FRME::Widget::write(Athena::io::IStreamWriter& __dna_writer) const +void FRME::Widget::write(athena::io::IStreamWriter& __dna_writer) const { /* type */ type.write(__dna_writer); @@ -143,7 +143,7 @@ size_t FRME::Widget::binarySize(size_t __isz) const return __isz + 67; } -void FRME::Widget::CAMRInfo::read(Athena::io::IStreamReader& __dna_reader) +void FRME::Widget::CAMRInfo::read(athena::io::IStreamReader& __dna_reader) { projectionType = ProjectionType(__dna_reader.readUint32Big()); if (projectionType == ProjectionType::Perspective) @@ -151,17 +151,17 @@ void FRME::Widget::CAMRInfo::read(Athena::io::IStreamReader& __dna_reader) else if (projectionType == ProjectionType::Orthographic) projection.reset(new OrthographicProjection); else - Log.report(LogVisor::FatalError, _S("Invalid CAMR projection mode! %i"), int(projectionType)); + Log.report(logvisor::Fatal, _S("Invalid CAMR projection mode! %i"), int(projectionType)); projection->read(__dna_reader); } -void FRME::Widget::CAMRInfo::write(Athena::io::IStreamWriter& __dna_writer) const +void FRME::Widget::CAMRInfo::write(athena::io::IStreamWriter& __dna_writer) const { if (!projection) - Log.report(LogVisor::FatalError, _S("Invalid CAMR projection object!")); + Log.report(logvisor::Fatal, _S("Invalid CAMR projection object!")); if (projection->type != projectionType) - Log.report(LogVisor::FatalError, _S("CAMR projection type does not match actual projection type!")); + Log.report(logvisor::Fatal, _S("CAMR projection type does not match actual projection type!")); __dna_writer.writeUint32Big(atUint32(projectionType)); projection->write(__dna_writer); @@ -173,7 +173,7 @@ size_t FRME::Widget::CAMRInfo::binarySize(size_t __isz) const return __isz + 4; } -void FRME::Widget::TXPNInfo::read(Athena::io::IStreamReader& __dna_reader) +void FRME::Widget::TXPNInfo::read(athena::io::IStreamReader& __dna_reader) { IWidgetInfo::read(__dna_reader); /* frameVals[0] */ @@ -213,7 +213,7 @@ void FRME::Widget::TXPNInfo::read(Athena::io::IStreamReader& __dna_reader) } } -void FRME::Widget::TXPNInfo::write(Athena::io::IStreamWriter& __dna_writer) const +void FRME::Widget::TXPNInfo::write(athena::io::IStreamWriter& __dna_writer) const { IWidgetInfo::write(__dna_writer); /* frameVals[0] */ @@ -263,22 +263,22 @@ size_t FRME::Widget::TXPNInfo::binarySize(size_t __isz) const return __isz + (version == 1 ? 78 : 66); } -bool FRME::Extract(const SpecBase &dataSpec, PAKEntryReadStream &rs, const HECL::ProjectPath &outPath, PAKRouter &pakRouter, const PAK::Entry &entry, bool force, std::function fileChanged) +bool FRME::Extract(const SpecBase &dataSpec, PAKEntryReadStream &rs, const hecl::ProjectPath &outPath, PAKRouter &pakRouter, const PAK::Entry &entry, bool force, std::function fileChanged) { FRME frme; frme.read(rs); - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); #if 0 - if (!force && outPath.getPathType() == HECL::ProjectPath::Type::File) + if (!force && outPath.getPathType() == hecl::ProjectPath::Type::File) return true; #endif - if (!conn.createBlend(outPath, HECL::BlenderConnection::BlendType::Frame)) + if (!conn.createBlend(outPath, hecl::BlenderConnection::BlendType::Frame)) return false; - HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); + hecl::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); os << "import bpy, math\n" "from mathutils import Matrix, Quaternion\n" @@ -347,7 +347,7 @@ bool FRME::Extract(const SpecBase &dataSpec, PAKEntryReadStream &rs, const HECL: { using MODLInfo = FRME::Widget::MODLInfo; MODLInfo* info = dynamic_cast(w.widgetInfo.get()); - HECL::ProjectPath modelPath = pakRouter.getWorking(info->model); + hecl::ProjectPath modelPath = pakRouter.getWorking(info->model); const PAKRouter::EntryType* cmdlE = pakRouter.lookupEntry(info->model, nullptr, true, true); os.linkBlend(modelPath.getAbsolutePathUTF8().c_str(), @@ -366,16 +366,16 @@ bool FRME::Extract(const SpecBase &dataSpec, PAKEntryReadStream &rs, const HECL: if (info && info->texture) { std::string texName = pakRouter.getBestEntryName(info->texture); - const NOD::Node* node; + const nod::Node* node; const PAKRouter::EntryType* texEntry = pakRouter.lookupEntry(info->texture, &node); - HECL::ProjectPath txtrPath = pakRouter.getWorking(texEntry); - if (txtrPath.getPathType() == HECL::ProjectPath::Type::None) + hecl::ProjectPath txtrPath = pakRouter.getWorking(texEntry); + if (txtrPath.getPathType() == hecl::ProjectPath::Type::None) { PAKEntryReadStream rs = texEntry->beginReadStream(*node); TXTR::Extract(rs, txtrPath); } - HECL::SystemString resPath = pakRouter.getResourceRelativePath(entry, info->texture); - HECL::SystemUTF8View resPathView(resPath); + hecl::SystemString resPath = pakRouter.getResourceRelativePath(entry, info->texture); + hecl::SystemUTF8View resPathView(resPath); os.format("if '%s' in bpy.data.images:\n" " image = bpy.data.images['%s']\n" "else:\n" diff --git a/DataSpec/DNAMP1/FRME.hpp b/DataSpec/DNAMP1/FRME.hpp index 337fe598c..c7dcdc344 100644 --- a/DataSpec/DNAMP1/FRME.hpp +++ b/DataSpec/DNAMP1/FRME.hpp @@ -3,7 +3,7 @@ #include "../DNACommon/DNACommon.hpp" #include "DNAMP1.hpp" -#include +#include namespace DataSpec { @@ -39,8 +39,8 @@ struct FRME : BigDNA struct IWidgetInfo : BigDNA { Delete _d; - virtual void read(Athena::io::IStreamReader&) {} - void write(Athena::io::IStreamWriter&) const {} + virtual void read(athena::io::IStreamReader&) {} + void write(athena::io::IStreamWriter&) const {} size_t binarySize(size_t __isz) const { return __isz; } }; @@ -219,11 +219,11 @@ struct FRME : BigDNA Vector widgets; static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, - std::function fileChanged); + std::function fileChanged); }; } diff --git a/DataSpec/DNAMP1/MAPA.hpp b/DataSpec/DNAMP1/MAPA.hpp index 052f6edf7..406458203 100644 --- a/DataSpec/DNAMP1/MAPA.hpp +++ b/DataSpec/DNAMP1/MAPA.hpp @@ -16,15 +16,15 @@ struct MAPA : DNAMAPA::MAPA { static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, - std::function fileChanged) + std::function fileChanged) { MAPA mapa; mapa.read(rs); - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); return DNAMAPA::ReadMAPAToBlender(conn, mapa, outPath, pakRouter, entry, force); } }; diff --git a/DataSpec/DNAMP1/MLVL.hpp b/DataSpec/DNAMP1/MLVL.hpp index 875250951..28f6659fe 100644 --- a/DataSpec/DNAMP1/MLVL.hpp +++ b/DataSpec/DNAMP1/MLVL.hpp @@ -108,18 +108,18 @@ struct MLVL : BigYAML static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, - std::function fileChanged) + std::function fileChanged) { MLVL mlvl; mlvl.read(rs); - FILE* fp = HECL::Fopen(outPath.getWithExtension(_S(".yaml"), true).getAbsolutePath().c_str(), _S("w")); + FILE* fp = hecl::Fopen(outPath.getWithExtension(_S(".yaml"), true).getAbsolutePath().c_str(), _S("w")); mlvl.toYAMLFile(fp); fclose(fp); - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); return DNAMLVL::ReadMLVLToBlender(conn, mlvl, outPath, pakRouter, entry, force, fileChanged); } diff --git a/DataSpec/DNAMP1/MREA.cpp b/DataSpec/DNAMP1/MREA.cpp index 474345b91..3809a713d 100644 --- a/DataSpec/DNAMP1/MREA.cpp +++ b/DataSpec/DNAMP1/MREA.cpp @@ -2,23 +2,19 @@ #include "SCLY.hpp" #include "DeafBabe.hpp" #include "../DNACommon/BabeDead.hpp" - -#ifndef _USE_MATH_DEFINES -#define _USE_MATH_DEFINES 1 -#endif -#include +#include "zeus/Math.hpp" namespace DataSpec { namespace DNAMP1 { -void MREA::ReadBabeDeadToBlender_1_2(HECL::BlenderConnection::PyOutStream& os, - Athena::io::IStreamReader& rs) +void MREA::ReadBabeDeadToBlender_1_2(hecl::BlenderConnection::PyOutStream& os, + athena::io::IStreamReader& rs) { atUint32 bdMagic = rs.readUint32Big(); if (bdMagic != 0xBABEDEAD) - Log.report(LogVisor::FatalError, "invalid BABEDEAD magic"); + Log.report(logvisor::Fatal, "invalid BABEDEAD magic"); os << "bpy.context.scene.render.engine = 'CYCLES'\n" "bpy.context.scene.world.use_nodes = True\n" "bpy.context.scene.render.engine = 'BLENDER_GAME'\n" @@ -49,7 +45,7 @@ void MREA::AddCMDLRigPairs(PAKEntryReadStream& rs, atUint64 secStart = rs.position(); while (curSec != head.sclySecIdx) secStart += head.secSizes[curSec++]; - rs.seek(secStart, Athena::Begin); + rs.seek(secStart, athena::Begin); SCLY scly; scly.read(rs); scly.addCMDLRigPairs(pakRouter, addTo); @@ -57,18 +53,18 @@ void MREA::AddCMDLRigPairs(PAKEntryReadStream& rs, bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, - std::function) + std::function) { using RigPair = std::pair; RigPair dummy(nullptr, nullptr); /* Rename MREA for consistency */ - HECL::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend")); - if (!force && mreaPath.getPathType() == HECL::ProjectPath::Type::File) + hecl::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend")); + if (!force && mreaPath.getPathType() == hecl::ProjectPath::Type::File) return true; /* Do extract */ @@ -76,12 +72,12 @@ bool MREA::Extract(const SpecBase& dataSpec, head.read(rs); rs.seekAlign32(); - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); - if (!conn.createBlend(mreaPath, HECL::BlenderConnection::BlendType::Area)) + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); + if (!conn.createBlend(mreaPath, hecl::BlenderConnection::BlendType::Area)) return false; /* Open Py Stream and read sections */ - HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); + hecl::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); os.format("import bpy\n" "import bmesh\n" "from mathutils import Vector\n" @@ -113,7 +109,7 @@ bool MREA::Extract(const SpecBase& dataSpec, atUint64 secStart = rs.position(); matSet.read(rs); matSet.readToBlender(os, pakRouter, entry, 0); - rs.seek(secStart + head.secSizes[0], Athena::Begin); + rs.seek(secStart + head.secSizes[0], athena::Begin); std::vector vertAttribs; DNACMDL::GetVertexAttributes(matSet, vertAttribs); @@ -124,7 +120,7 @@ bool MREA::Extract(const SpecBase& dataSpec, MeshHeader mHeader; secStart = rs.position(); mHeader.read(rs); - rs.seek(secStart + head.secSizes[curSec++], Athena::Begin); + rs.seek(secStart + head.secSizes[curSec++], athena::Begin); curSec += DNACMDL::ReadGeomSectionsToBlender, MaterialSet, RigPair, DNACMDL::SurfaceHeader_1> (os, rs, pakRouter, entry, dummy, true, true, vertAttribs, m, head.secCount, 0, &head.secSizes[curSec]); @@ -139,14 +135,14 @@ bool MREA::Extract(const SpecBase& dataSpec, } /* Skip AROT */ - rs.seek(head.secSizes[curSec++], Athena::Current); + rs.seek(head.secSizes[curSec++], athena::Current); /* Read SCLY layers */ secStart = rs.position(); SCLY scly; scly.read(rs); scly.exportToLayerDirectories(entry, pakRouter, force); - rs.seek(secStart + head.secSizes[curSec++], Athena::Begin); + rs.seek(secStart + head.secSizes[curSec++], athena::Begin); /* Read collision meshes */ DeafBabe collision; @@ -154,15 +150,15 @@ bool MREA::Extract(const SpecBase& dataSpec, collision.read(rs); DeafBabe::BlenderInit(os); collision.sendToBlender(os); - rs.seek(secStart + head.secSizes[curSec++], Athena::Begin); + rs.seek(secStart + head.secSizes[curSec++], athena::Begin); /* Skip unknown section */ - rs.seek(head.secSizes[curSec++], Athena::Current); + rs.seek(head.secSizes[curSec++], athena::Current); /* Read BABEDEAD Lights as Cycles emissives */ secStart = rs.position(); ReadBabeDeadToBlender_1_2(os, rs); - rs.seek(secStart + head.secSizes[curSec++], Athena::Begin); + rs.seek(secStart + head.secSizes[curSec++], athena::Begin); /* Origins to center of mass */ os << "bpy.context.scene.layers[1] = True\n" @@ -193,15 +189,15 @@ void MREA::Name(const SpecBase& dataSpec, atUint64 secStart = rs.position(); MaterialSet matSet; matSet.read(rs); - matSet.nameTextures(pakRouter, HECL::Format("MREA_%s", entry.id.toString().c_str()).c_str(), -1); - rs.seek(secStart + head.secSizes[0], Athena::Begin); + matSet.nameTextures(pakRouter, hecl::Format("MREA_%s", entry.id.toString().c_str()).c_str(), -1); + rs.seek(secStart + head.secSizes[0], athena::Begin); /* Skip to SCLY */ atUint32 curSec = 1; secStart = rs.position(); while (curSec != head.sclySecIdx) secStart += head.secSizes[curSec++]; - rs.seek(secStart, Athena::Begin); + rs.seek(secStart, athena::Begin); SCLY scly; scly.read(rs); scly.nameIDs(pakRouter); @@ -209,10 +205,10 @@ void MREA::Name(const SpecBase& dataSpec, /* Skip to PATH */ while (curSec != head.pathSecIdx) secStart += head.secSizes[curSec++]; - rs.seek(secStart, Athena::Begin); + rs.seek(secStart, athena::Begin); UniqueID32 pathID(rs); - const NOD::Node* node; + const nod::Node* node; PAK::Entry* pathEnt = (PAK::Entry*)pakRouter.lookupEntry(pathID, &node); pathEnt->name = entry.name + "_path"; } diff --git a/DataSpec/DNAMP1/MREA.hpp b/DataSpec/DNAMP1/MREA.hpp index 0e273eb48..584c66805 100644 --- a/DataSpec/DNAMP1/MREA.hpp +++ b/DataSpec/DNAMP1/MREA.hpp @@ -100,8 +100,8 @@ struct MREA Value unk9; }; - static void ReadBabeDeadToBlender_1_2(HECL::BlenderConnection::PyOutStream& os, - Athena::io::IStreamReader& rs); + static void ReadBabeDeadToBlender_1_2(hecl::BlenderConnection::PyOutStream& os, + athena::io::IStreamReader& rs); static void AddCMDLRigPairs(PAKEntryReadStream& rs, PAKRouter& pakRouter, @@ -109,11 +109,11 @@ struct MREA static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool, - std::function); + std::function); static void Name(const SpecBase& dataSpec, PAKEntryReadStream& rs, diff --git a/DataSpec/DNAMP1/PAK.cpp b/DataSpec/DNAMP1/PAK.cpp index e66c5605f..14fdf47df 100644 --- a/DataSpec/DNAMP1/PAK.cpp +++ b/DataSpec/DNAMP1/PAK.cpp @@ -8,11 +8,11 @@ namespace DataSpec namespace DNAMP1 { -void PAK::read(Athena::io::IStreamReader& reader) +void PAK::read(athena::io::IStreamReader& reader) { atUint32 version = reader.readUint32Big(); if (version != 0x00030005) - Log.report(LogVisor::FatalError, "unexpected PAK magic"); + Log.report(logvisor::Fatal, "unexpected PAK magic"); reader.readUint32Big(); atUint32 nameCount = reader.readUint32Big(); @@ -62,7 +62,7 @@ void PAK::read(Athena::io::IStreamReader& reader) } } -void PAK::write(Athena::io::IStreamWriter& writer) const +void PAK::write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(0x00030005); writer.writeUint32Big(0); @@ -98,15 +98,15 @@ size_t PAK::binarySize(size_t __isz) const } std::unique_ptr -PAK::Entry::getBuffer(const NOD::Node& pak, atUint64& szOut) const +PAK::Entry::getBuffer(const nod::Node& pak, atUint64& szOut) const { if (compressed) { - std::unique_ptr strm = pak.beginReadStream(offset); + std::unique_ptr strm = pak.beginReadStream(offset); atUint32 decompSz; strm->read(&decompSz, 4); - decompSz = HECL::SBig(decompSz); + decompSz = hecl::SBig(decompSz); atUint8* buf = new atUint8[decompSz]; atUint8* bufCur = buf; @@ -135,7 +135,7 @@ PAK::Entry::getBuffer(const NOD::Node& pak, atUint64& szOut) const { atUint16 chunkSz; strm->read(&chunkSz, 2); - chunkSz = HECL::SBig(chunkSz); + chunkSz = hecl::SBig(chunkSz); strm->read(compBuf, chunkSz); lzo_uint dsz = rem; lzo1x_decompress(compBuf, chunkSz, bufCur, &dsz, nullptr); diff --git a/DataSpec/DNAMP1/PAK.hpp b/DataSpec/DNAMP1/PAK.hpp index 6c1aa8a59..2077fd5dc 100644 --- a/DataSpec/DNAMP1/PAK.hpp +++ b/DataSpec/DNAMP1/PAK.hpp @@ -3,7 +3,7 @@ #include -#include +#include #include "../DNACommon/PAK.hpp" namespace DataSpec @@ -38,8 +38,8 @@ struct PAK : BigDNA UniqueResult unique; std::string name; /* backreferencing name for RE purposes */ - std::unique_ptr getBuffer(const NOD::Node& pak, atUint64& szOut) const; - inline PAKEntryReadStream beginReadStream(const NOD::Node& pak, atUint64 off=0) const + std::unique_ptr getBuffer(const nod::Node& pak, atUint64& szOut) const; + inline PAKEntryReadStream beginReadStream(const nod::Node& pak, atUint64 off=0) const { atUint64 sz; std::unique_ptr buf = getBuffer(pak, sz); diff --git a/DataSpec/DNAMP1/SCAN.hpp b/DataSpec/DNAMP1/SCAN.hpp index 87e99adc0..ac79bb03d 100644 --- a/DataSpec/DNAMP1/SCAN.hpp +++ b/DataSpec/DNAMP1/SCAN.hpp @@ -1,7 +1,7 @@ #ifndef _DNAMP1_SCAN_HPP_ #define _DNAMP1_SCAN_HPP_ -#include +#include #include "../DNACommon/DNACommon.hpp" #include "DNAMP1.hpp" @@ -59,7 +59,7 @@ struct SCAN : BigYAML Value interval; // 0.0 - 1.0 Value fadeDuration; // 0.0 - 1.0 - void read(Athena::io::IStreamReader& __dna_reader) + void read(athena::io::IStreamReader& __dna_reader) { /* texture */ texture.read(__dna_reader); @@ -77,7 +77,7 @@ struct SCAN : BigYAML fadeDuration = __dna_reader.readFloatBig(); } - void write(Athena::io::IStreamWriter& __dna_writer) const + void write(athena::io::IStreamWriter& __dna_writer) const { /* texture */ texture.write(__dna_writer); @@ -95,7 +95,7 @@ struct SCAN : BigYAML __dna_writer.writeFloatBig(fadeDuration); } - void read(Athena::io::YAMLDocReader& __dna_docin) + void read(athena::io::YAMLDocReader& __dna_docin) { /* texture */ __dna_docin.enumerate("texture", texture); @@ -120,7 +120,7 @@ struct SCAN : BigYAML fadeDuration = __dna_docin.readFloat("fadeDuration"); } - void write(Athena::io::YAMLDocWriter& __dna_docout) const + void write(athena::io::YAMLDocWriter& __dna_docout) const { /* texture */ __dna_docout.enumerate("texture", texture); @@ -141,7 +141,7 @@ struct SCAN : BigYAML __dna_docout.writeFloat("fadeDuration", fadeDuration); } - const char* DNAType() { return "Retro::DNAMP1::SCAN::Texture"; } + const char* DNAType() { return "urde::DNAMP1::SCAN::Texture"; } size_t binarySize(size_t __isz) const { __isz = texture.binarySize(__isz); @@ -152,23 +152,23 @@ struct SCAN : BigYAML Texture textures[4]; - static bool Extract(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath) + static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) { SCAN scan; scan.read(rs); - FILE* fp = HECL::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); + FILE* fp = hecl::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); scan.toYAMLFile(fp); fclose(fp); return true; } - static bool Cook(const HECL::ProjectPath& inPath, const HECL::ProjectPath& outPath) + static bool Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) { SCAN scan; - FILE* fp = HECL::Fopen(inPath.getAbsolutePath().c_str(), _S("rb")); + FILE* fp = hecl::Fopen(inPath.getAbsolutePath().c_str(), _S("rb")); scan.fromYAMLFile(fp); fclose(fp); - Athena::io::FileWriter ws(outPath.getAbsolutePath()); + athena::io::FileWriter ws(outPath.getAbsolutePath()); scan.write(ws); return true; } @@ -183,7 +183,7 @@ struct SCAN : BigYAML if (scan.string) { PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(scan.string); - ent->name = HECL::Format("SCAN_%s_strg", entry.id.toString().c_str()); + ent->name = hecl::Format("SCAN_%s_strg", entry.id.toString().c_str()); } for (int i=0 ; i<4 ; ++i) { @@ -191,7 +191,7 @@ struct SCAN : BigYAML if (tex.texture) { PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(tex.texture); - ent->name = HECL::Format("SCAN_%s_tex%d", entry.id.toString().c_str(), i+1); + ent->name = hecl::Format("SCAN_%s_tex%d", entry.id.toString().c_str(), i+1); } } } diff --git a/DataSpec/DNAMP1/SCLY.cpp b/DataSpec/DNAMP1/SCLY.cpp index 5c55dff79..31ea9dc08 100644 --- a/DataSpec/DNAMP1/SCLY.cpp +++ b/DataSpec/DNAMP1/SCLY.cpp @@ -6,21 +6,21 @@ namespace DataSpec namespace DNAMP1 { -void SCLY::read(Athena::io::IStreamReader& rs) +void SCLY::read(athena::io::IStreamReader& rs) { fourCC = rs.readUint32Little(); version = rs.readUint32Big(); layerCount = rs.readUint32Big(); rs.enumerateBig(layerSizes, layerCount); atUint32 i = 0; - rs.enumerate(layers, layerCount, [&i,this](Athena::io::IStreamReader& rs, ScriptLayer& layer) { + rs.enumerate(layers, layerCount, [&i,this](athena::io::IStreamReader& rs, ScriptLayer& layer) { atUint64 start = rs.position(); layer.read(rs); - rs.seek(start + layerSizes[i++], Athena::Begin); + rs.seek(start + layerSizes[i++], athena::Begin); }); } -void SCLY::write(Athena::io::IStreamWriter& ws) const +void SCLY::write(athena::io::IStreamWriter& ws) const { ws.writeUint32Big(fourCC); ws.writeUint32Big(version); @@ -40,14 +40,14 @@ void SCLY::exportToLayerDirectories(const PAK::Entry& entry, PAKRouter& pakRouter) const obj->nameIDs(pakRouter); } -void SCLY::read(Athena::io::YAMLDocReader& docin) +void SCLY::read(athena::io::YAMLDocReader& docin) { fourCC = docin.readUint32("fourCC"); version = docin.readUint32("version"); - layerCount = docin.readUint32("layerCount"); - docin.enumerate("layerSizes", layerSizes, layerCount); - docin.enumerate("layers", layers, layerCount); + layerCount = docin.enumerate("layerSizes", layerSizes); + docin.enumerate("layers", layers); } -void SCLY::write(Athena::io::YAMLDocWriter& docout) const +void SCLY::write(athena::io::YAMLDocWriter& docout) const { docout.writeUint32("fourCC", fourCC); docout.writeUint32("version", version); - docout.writeUint32("layerCount", layerCount); docout.enumerate("layerSizes", layerSizes); docout.enumerate("layers", layers); } const char* SCLY::DNAType() { - return "Retro::DNAMP1::SCLY"; + return "urde::DNAMP1::SCLY"; } -void SCLY::ScriptLayer::read(Athena::io::IStreamReader& rs) +void SCLY::ScriptLayer::read(athena::io::IStreamReader& rs) { unknown = rs.readUByte(); objectCount = rs.readUint32Big(); + objects.clear(); objects.reserve(objectCount); for (atUint32 i = 0; i < objectCount; i++) { @@ -125,20 +124,22 @@ void SCLY::ScriptLayer::read(Athena::io::IStreamReader& rs) objects.push_back(std::move(obj)); size_t actualLen = rs.position() - start; if (actualLen != len) - Log.report(LogVisor::FatalError, _S("Error while reading object of type 0x%.2X, did not read the expected amount of data, read 0x%x, expected 0x%x"), (atUint32)type, actualLen, len); - rs.seek(start + len, Athena::Begin); + Log.report(logvisor::Fatal, _S("Error while reading object of type 0x%.2X, did not read the expected amount of data, read 0x%x, expected 0x%x"), (atUint32)type, actualLen, len); + rs.seek(start + len, athena::Begin); } else - Log.report(LogVisor::FatalError, _S("Unable to find type 0x%X in object database"), (atUint32)type); + Log.report(logvisor::Fatal, _S("Unable to find type 0x%X in object database"), (atUint32)type); } } -void SCLY::ScriptLayer::read(Athena::io::YAMLDocReader& rs) +void SCLY::ScriptLayer::read(athena::io::YAMLDocReader& rs) { unknown = rs.readUByte("unknown"); - objectCount = rs.readUint32("objectCount"); - objects.reserve(objectCount); - rs.enterSubVector("objects"); + size_t objCount; + rs.enterSubVector("objects", objCount); + objectCount = objCount; + objects.clear(); + objects.reserve(objCount); for (atUint32 i = 0; i < objectCount; i++) { rs.enterSubRecord(nullptr); @@ -154,14 +155,14 @@ void SCLY::ScriptLayer::read(Athena::io::YAMLDocReader& rs) objects.push_back(std::move(obj)); } else - Log.report(LogVisor::FatalError, _S("Unable to find type 0x%X in object database"), (atUint32)type); + Log.report(logvisor::Fatal, _S("Unable to find type 0x%X in object database"), (atUint32)type); rs.leaveSubRecord(); } rs.leaveSubVector(); } -void SCLY::ScriptLayer::write(Athena::io::IStreamWriter& ws) const +void SCLY::ScriptLayer::write(athena::io::IStreamWriter& ws) const { ws.writeUByte(unknown); ws.writeUint32Big(objectCount); @@ -183,10 +184,9 @@ size_t SCLY::ScriptLayer::binarySize(size_t __isz) const return __isz; } -void SCLY::ScriptLayer::write(Athena::io::YAMLDocWriter& ws) const +void SCLY::ScriptLayer::write(athena::io::YAMLDocWriter& ws) const { ws.writeUByte("unknown", unknown); - ws.writeUint32("objectCount", objectCount); ws.enterSubVector("objects"); for (const std::unique_ptr& obj : objects) { @@ -200,7 +200,7 @@ void SCLY::ScriptLayer::write(Athena::io::YAMLDocWriter& ws) const const char* SCLY::ScriptLayer::DNAType() { - return "Retro::DNAMP1::SCLY::ScriptLayer"; + return "urde::DNAMP1::SCLY::ScriptLayer"; } } diff --git a/DataSpec/DNAMP1/SCLY.hpp b/DataSpec/DNAMP1/SCLY.hpp index 2ab65b602..eb6c89574 100644 --- a/DataSpec/DNAMP1/SCLY.hpp +++ b/DataSpec/DNAMP1/SCLY.hpp @@ -26,8 +26,8 @@ struct SCLY : BigYAML Value unknown; Value objectCount; Vector, DNA_COUNT(objectCount)> objects; - void read(Athena::io::IStreamReader &rs); - void write(Athena::io::IStreamWriter &ws) const; + void read(athena::io::IStreamReader &rs); + void write(athena::io::IStreamWriter &ws) const; size_t binarySize(size_t __isz) const; void addCMDLRigPairs(PAKRouter& pakRouter, std::unordered_map>& addTo) const; @@ -35,8 +35,8 @@ struct SCLY : BigYAML }; Vector layers; - void read(Athena::io::IStreamReader &rs); - void write(Athena::io::IStreamWriter &ws) const; + void read(athena::io::IStreamReader &rs); + void write(athena::io::IStreamWriter &ws) const; size_t binarySize(size_t __isz) const; void exportToLayerDirectories(const PAK::Entry &, PAKRouter&, bool) const; diff --git a/DataSpec/DNAMP1/STRG.cpp b/DataSpec/DNAMP1/STRG.cpp index b3fd46abb..e42c2a990 100644 --- a/DataSpec/DNAMP1/STRG.cpp +++ b/DataSpec/DNAMP1/STRG.cpp @@ -6,7 +6,7 @@ namespace DataSpec namespace DNAMP1 { -void STRG::_read(Athena::io::IStreamReader& reader) +void STRG::_read(athena::io::IStreamReader& reader) { atUint32 langCount = reader.readUint32Big(); atUint32 strCount = reader.readUint32Big(); @@ -38,20 +38,20 @@ void STRG::_read(Athena::io::IStreamReader& reader) langMap.emplace(item.first, &item.second); } -void STRG::read(Athena::io::IStreamReader& reader) +void STRG::read(athena::io::IStreamReader& reader) { atUint32 magic = reader.readUint32Big(); if (magic != 0x87654321) - Log.report(LogVisor::Error, "invalid STRG magic"); + Log.report(logvisor::Error, "invalid STRG magic"); atUint32 version = reader.readUint32Big(); if (version != 0) - Log.report(LogVisor::Error, "invalid STRG version"); + Log.report(logvisor::Error, "invalid STRG version"); _read(reader); } -void STRG::write(Athena::io::IStreamWriter& writer) const +void STRG::write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(0x87654321); writer.writeUint32Big(0); @@ -131,9 +131,9 @@ size_t STRG::binarySize(size_t __isz) const return __isz; } -void STRG::read(Athena::io::YAMLDocReader& reader) +void STRG::read(athena::io::YAMLDocReader& reader) { - const Athena::io::YAMLNode* root = reader.getRootNode(); + const athena::io::YAMLNode* root = reader.getRootNode(); /* Validate Pass */ if (root->m_type == YAML_MAPPING_NODE) @@ -142,19 +142,19 @@ void STRG::read(Athena::io::YAMLDocReader& reader) { if (lang.first.size() != 4) { - Log.report(LogVisor::Warning, "STRG language string '%s' must be exactly 4 characters; skipping", lang.first.c_str()); + Log.report(logvisor::Warning, "STRG language string '%s' must be exactly 4 characters; skipping", lang.first.c_str()); return; } if (lang.second->m_type != YAML_SEQUENCE_NODE) { - Log.report(LogVisor::Warning, "STRG language string '%s' must contain a sequence; skipping", lang.first.c_str()); + Log.report(logvisor::Warning, "STRG language string '%s' must contain a sequence; skipping", lang.first.c_str()); return; } for (const auto& str : lang.second->m_seqChildren) { if (str->m_type != YAML_SCALAR_NODE) { - Log.report(LogVisor::Warning, "STRG language '%s' must contain all scalars; skipping", lang.first.c_str()); + Log.report(logvisor::Warning, "STRG language '%s' must contain all scalars; skipping", lang.first.c_str()); return; } } @@ -162,7 +162,7 @@ void STRG::read(Athena::io::YAMLDocReader& reader) } else { - Log.report(LogVisor::Warning, "STRG must have a mapping root node; skipping"); + Log.report(logvisor::Warning, "STRG must have a mapping root node; skipping"); return; } @@ -172,7 +172,7 @@ void STRG::read(Athena::io::YAMLDocReader& reader) { std::vector strs; for (const auto& str : lang.second->m_seqChildren) - strs.emplace_back(HECL::UTF8ToWide(str->m_scalarString)); + strs.emplace_back(hecl::UTF8ToWide(str->m_scalarString)); langs.emplace_back(FourCC(lang.first.c_str()), strs); } @@ -182,7 +182,7 @@ void STRG::read(Athena::io::YAMLDocReader& reader) langMap.emplace(item.first, &item.second); } -void STRG::write(Athena::io::YAMLDocWriter& writer) const +void STRG::write(athena::io::YAMLDocWriter& writer) const { for (const auto& lang : langs) { @@ -195,7 +195,7 @@ void STRG::write(Athena::io::YAMLDocWriter& writer) const const char* STRG::DNAType() { - return "Retro::DNAMP1::STRG"; + return "urde::DNAMP1::STRG"; } } diff --git a/DataSpec/DNAMP1/STRG.hpp b/DataSpec/DNAMP1/STRG.hpp index 3c9d01cdd..b45dc61b2 100644 --- a/DataSpec/DNAMP1/STRG.hpp +++ b/DataSpec/DNAMP1/STRG.hpp @@ -15,7 +15,7 @@ struct STRG : ISTRG { DECL_YAML Delete expl; - void _read(Athena::io::IStreamReader& reader); + void _read(athena::io::IStreamReader& reader); std::vector>> langs; std::unordered_map*> langMap; @@ -36,7 +36,7 @@ struct STRG : ISTRG { auto search = langMap.find(lang); if (search != langMap.end()) - return HECL::WideToUTF8(search->second->at(idx)); + return hecl::WideToUTF8(search->second->at(idx)); return std::string(); } inline std::wstring getUTF16(const FourCC& lang, size_t idx) const @@ -46,35 +46,35 @@ struct STRG : ISTRG return search->second->at(idx); return std::wstring(); } - inline HECL::SystemString getSystemString(const FourCC& lang, size_t idx) const + inline hecl::SystemString getSystemString(const FourCC& lang, size_t idx) const { auto search = langMap.find(lang); if (search != langMap.end()) #if HECL_UCS2 return search->second->at(idx); #else - return HECL::WideToUTF8(search->second->at(idx)); + return hecl::WideToUTF8(search->second->at(idx)); #endif - return HECL::SystemString(); + return hecl::SystemString(); } - static bool Extract(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath) + static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) { STRG strg; strg.read(rs); - FILE* fp = HECL::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); + FILE* fp = hecl::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); strg.toYAMLFile(fp); fclose(fp); return true; } - static bool Cook(const HECL::ProjectPath& inPath, const HECL::ProjectPath& outPath) + static bool Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) { STRG strg; - FILE* fp = HECL::Fopen(inPath.getAbsolutePath().c_str(), _S("rb")); + FILE* fp = hecl::Fopen(inPath.getAbsolutePath().c_str(), _S("rb")); strg.fromYAMLFile(fp); fclose(fp); - Athena::io::FileWriter ws(outPath.getAbsolutePath()); + athena::io::FileWriter ws(outPath.getAbsolutePath()); strg.write(ws); return true; } diff --git a/DataSpec/DNAMP1/ScriptObjects/Oculus.hpp b/DataSpec/DNAMP1/ScriptObjects/Oculus.hpp index 53b673caa..0bc1f344e 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Oculus.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Oculus.hpp @@ -31,7 +31,7 @@ struct Oculus : IScriptObject /* Trilogy addition */ Value unknown8; - void read(Athena::io::IStreamReader& __dna_reader) + void read(athena::io::IStreamReader& __dna_reader) { IScriptObject::read(__dna_reader); /* name */ @@ -71,7 +71,7 @@ struct Oculus : IScriptObject unknown8 = 0.0; } - void write(Athena::io::IStreamWriter& __dna_writer) const + void write(athena::io::IStreamWriter& __dna_writer) const { IScriptObject::write(__dna_writer); /* name */ @@ -109,7 +109,7 @@ struct Oculus : IScriptObject __dna_writer.writeFloatBig(unknown8); } - void read(Athena::io::YAMLDocReader& __dna_docin) + void read(athena::io::YAMLDocReader& __dna_docin) { IScriptObject::read(__dna_docin); /* name */ @@ -149,7 +149,7 @@ struct Oculus : IScriptObject unknown8 = 0.0; } - void write(Athena::io::YAMLDocWriter& __dna_docout) const + void write(athena::io::YAMLDocWriter& __dna_docout) const { IScriptObject::write(__dna_docout); /* name */ @@ -189,7 +189,7 @@ struct Oculus : IScriptObject static const char* DNAType() { - return "Retro::DNAMP1::Oculus"; + return "urde::DNAMP1::Oculus"; } void addCMDLRigPairs(PAKRouter& pakRouter, diff --git a/DataSpec/DNAMP1/ScriptObjects/Parameters.cpp b/DataSpec/DNAMP1/ScriptObjects/Parameters.cpp index dca860d84..0456bb115 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Parameters.cpp +++ b/DataSpec/DNAMP1/ScriptObjects/Parameters.cpp @@ -10,7 +10,7 @@ UniqueID32 AnimationParameters::getCINF(PAKRouter& pakRouter) const { if (!animationCharacterSet) return UniqueID32(); - const NOD::Node* node; + const nod::Node* node; const PAK::Entry* ancsEnt = pakRouter.lookupEntry(animationCharacterSet, &node); ANCS ancs; { diff --git a/DataSpec/DNAMP1/ScriptObjects/Ridley.hpp b/DataSpec/DNAMP1/ScriptObjects/Ridley.hpp index 2699746f6..cfc463166 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Ridley.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Ridley.hpp @@ -124,7 +124,7 @@ struct Ridley : IScriptObject /* Trilogy addition */ DamageInfo damageInfo9; - void read(Athena::io::IStreamReader& __dna_reader) + void read(athena::io::IStreamReader& __dna_reader) { IScriptObject::read(__dna_reader); /* name */ @@ -234,7 +234,7 @@ struct Ridley : IScriptObject damageInfo9.read(__dna_reader); } - void write(Athena::io::IStreamWriter& __dna_writer) const + void write(athena::io::IStreamWriter& __dna_writer) const { IScriptObject::write(__dna_writer); /* name */ @@ -344,7 +344,7 @@ struct Ridley : IScriptObject damageInfo9.write(__dna_writer); } - void read(Athena::io::YAMLDocReader& __dna_docin) + void read(athena::io::YAMLDocReader& __dna_docin) { IScriptObject::read(__dna_docin); /* name */ @@ -454,7 +454,7 @@ struct Ridley : IScriptObject __dna_docin.enumerate("damageInfo9", damageInfo9); } - void write(Athena::io::YAMLDocWriter& __dna_docout) const + void write(athena::io::YAMLDocWriter& __dna_docout) const { IScriptObject::write(__dna_docout); /* name */ @@ -566,7 +566,7 @@ struct Ridley : IScriptObject static const char* DNAType() { - return "Retro::DNAMP1::Ridley"; + return "urde::DNAMP1::Ridley"; } void addCMDLRigPairs(PAKRouter& pakRouter, diff --git a/DataSpec/DNAMP1/ScriptObjects/WorldTeleporter.hpp b/DataSpec/DNAMP1/ScriptObjects/WorldTeleporter.hpp index 9aa32f858..c60a15f13 100644 --- a/DataSpec/DNAMP1/ScriptObjects/WorldTeleporter.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/WorldTeleporter.hpp @@ -41,7 +41,7 @@ struct WorldTeleporter : IScriptObject Value unknown15; Value unknown16; - void read(Athena::io::IStreamReader& __dna_reader) + void read(athena::io::IStreamReader& __dna_reader) { IScriptObject::read(__dna_reader); /* name */ @@ -104,7 +104,7 @@ struct WorldTeleporter : IScriptObject } } - void write(Athena::io::IStreamWriter& __dna_writer) const + void write(athena::io::IStreamWriter& __dna_writer) const { IScriptObject::write(__dna_writer); /* name */ @@ -160,7 +160,7 @@ struct WorldTeleporter : IScriptObject } } - void read(Athena::io::YAMLDocReader& __dna_docin) + void read(athena::io::YAMLDocReader& __dna_docin) { IScriptObject::read(__dna_docin); /* name */ @@ -223,7 +223,7 @@ struct WorldTeleporter : IScriptObject } } - void write(Athena::io::YAMLDocWriter& __dna_docout) const + void write(athena::io::YAMLDocWriter& __dna_docout) const { IScriptObject::write(__dna_docout); /* name */ @@ -281,7 +281,7 @@ struct WorldTeleporter : IScriptObject static const char* DNAType() { - return "Retro::DNAMP1::WorldTeleporter"; + return "urde::DNAMP1::WorldTeleporter"; } void nameIDs(PAKRouter& pakRouter) const diff --git a/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp b/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp index 3b27c0f30..4ceac5dda 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp @@ -15,7 +15,7 @@ struct CTweakGame : ITweakGame String<-1> m_ruinsArea; // ???? virtual const std::string& GetWorldPrefix() const { return m_worldPrefix; } - CTweakGame(Athena::io::IStreamReader& in) { this->read(in); } + CTweakGame(athena::io::IStreamReader& in) { this->read(in); } }; } } diff --git a/DataSpec/DNAMP1/Tweaks/CTweakParticle.hpp b/DataSpec/DNAMP1/Tweaks/CTweakParticle.hpp index e07f06ae4..ee60f0c03 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakParticle.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakParticle.hpp @@ -15,7 +15,7 @@ struct CTweakParticle : ITweakParticle String<-1> m_powerBeam; String<-1> m_genThrust; - CTweakParticle(Athena::io::IStreamReader& reader) { this->read(reader); } + CTweakParticle(athena::io::IStreamReader& reader) { this->read(reader); } }; } diff --git a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp index 6e7f148bf..fbdb152b6 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp @@ -15,7 +15,7 @@ struct CTweakPlayer : ITweakPlayer Value m_rightDiv; float GetLeftLogicalThreshold() const {return m_leftDiv;} float GetRightLogicalThreshold() const {return m_rightDiv;} - CTweakPlayer(Athena::io::IStreamReader& reader) {this->read(reader);} + CTweakPlayer(athena::io::IStreamReader& reader) {this->read(reader);} }; } diff --git a/DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp b/DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp index c72d71dc1..480fd9aa2 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp @@ -13,7 +13,7 @@ struct CTweakPlayerControl : ITweakPlayerControl DECL_YAML Vector m_mappings; atUint32 GetMapping(atUint32 command) const {return m_mappings[command];} - CTweakPlayerControl(Athena::io::IStreamReader& reader) {this->read(reader);} + CTweakPlayerControl(athena::io::IStreamReader& reader) {this->read(reader);} }; } diff --git a/DataSpec/DNAMP2/ANCS.cpp b/DataSpec/DNAMP2/ANCS.cpp index 6e4b8b74f..c26fd175e 100644 --- a/DataSpec/DNAMP2/ANCS.cpp +++ b/DataSpec/DNAMP2/ANCS.cpp @@ -5,7 +5,7 @@ namespace DataSpec namespace DNAMP2 { -void ANCS::CharacterSet::CharacterInfo::read(Athena::io::IStreamReader& reader) +void ANCS::CharacterSet::CharacterInfo::read(athena::io::IStreamReader& reader) { idx = reader.readUint32Big(); atUint16 sectionCount = reader.readUint16Big(); @@ -78,7 +78,7 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::IStreamReader& reader) } } -void ANCS::CharacterSet::CharacterInfo::write(Athena::io::IStreamWriter& writer) const +void ANCS::CharacterSet::CharacterInfo::write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(idx); @@ -238,7 +238,7 @@ size_t ANCS::CharacterSet::CharacterInfo::binarySize(size_t __isz) const return __isz; } -void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader) +void ANCS::CharacterSet::CharacterInfo::read(athena::io::YAMLDocReader& reader) { idx = reader.readUint32("idx"); atUint16 sectionCount = reader.readUint16("sectionCount"); @@ -247,43 +247,34 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader) reader.enumerate("cskr", cskr); reader.enumerate("cinf", cinf); - atUint32 animationCount = reader.readUint32("animationCount"); - reader.enumerate("animations", animations, animationCount); + reader.enumerate("animations", animations); reader.enumerate("pasDatabase", pasDatabase); - atUint32 partCount = reader.readUint32("partCount"); - reader.enumerate("part", partResData.part, partCount); + reader.enumerate("part", partResData.part); - atUint32 swhcCount = reader.readUint32("swhcCount"); - reader.enumerate("swhc", partResData.swhc, swhcCount); + reader.enumerate("swhc", partResData.swhc); - atUint32 unkCount = reader.readUint32("unkCount"); - reader.enumerate("unk", partResData.unk, unkCount); + reader.enumerate("unk", partResData.unk); - atUint32 elscCount = reader.readUint32("elscCount"); - reader.enumerate("elsc", partResData.elsc, elscCount); + reader.enumerate("elsc", partResData.elsc); - atUint32 spscCount = reader.readUint32("spscCount"); - reader.enumerate("spsc", partResData.spsc, spscCount); + reader.enumerate("spsc", partResData.spsc); - atUint32 unk2Count = reader.readUint32("unk2Count"); - reader.enumerate("unk2", partResData.unk2, unk2Count); + reader.enumerate("unk2", partResData.unk2); unk1 = reader.readUint32("unk1"); animAABBs.clear(); if (sectionCount > 1) { - atUint32 aabbCount = reader.readUint32("animAABBCount"); - reader.enumerate("part", animAABBs, aabbCount); + reader.enumerate("part", animAABBs); } effects.clear(); if (sectionCount > 2) { - atUint32 effectCount = reader.readUint32("effectCount"); - reader.enumerate("effects", effects, effectCount); + reader.enumerate("effects", effects); } if (sectionCount > 3) @@ -295,8 +286,7 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader) animIdxs.clear(); if (sectionCount > 4) { - atUint32 animIdxCount = reader.readUint32("animIdxCount"); - reader.enumerate("animIdxs", animIdxs, animIdxCount); + reader.enumerate("animIdxs", animIdxs); } extents.clear(); @@ -304,12 +294,11 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader) { unk4 = reader.readUint32("unk4"); unk5 = reader.readUByte("unk5"); - atUint32 extentsCount = reader.readUint32("extentsCount"); - reader.enumerate("extents", extents, extentsCount); + reader.enumerate("extents", extents); } } -void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer) const +void ANCS::CharacterSet::CharacterInfo::write(athena::io::YAMLDocWriter& writer) const { writer.writeUint32("idx", idx); @@ -335,40 +324,31 @@ void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer) writer.enumerate("cskr", cskr); writer.enumerate("cinf", cinf); - writer.writeUint32("animationCount", animations.size()); writer.enumerate("animations", animations); writer.enumerate("pasDatabase", pasDatabase); - writer.writeUint32("partCount", partResData.part.size()); writer.enumerate("part", partResData.part); - writer.writeUint32("swhcCount", partResData.swhc.size()); writer.enumerate("swhc", partResData.swhc); - writer.writeUint32("unkCount", partResData.unk.size()); writer.enumerate("unk", partResData.unk); - writer.writeUint32("elscCount", partResData.elsc.size()); writer.enumerate("elsc", partResData.elsc); - writer.writeUint32("spscCount", partResData.spsc.size()); writer.enumerate("spsc", partResData.spsc); - writer.writeUint32("unk2Count", partResData.unk2.size()); writer.enumerate("unk2", partResData.unk2); writer.writeUint32("unk1", unk1); if (sectionCount > 1) { - writer.writeUint32("animAABBCount", animAABBs.size()); writer.enumerate("animAABBs", animAABBs); } if (sectionCount > 2) { - writer.writeUint32("effectCount", effects.size()); writer.enumerate("effects", effects); } @@ -380,7 +360,6 @@ void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer) if (sectionCount > 4) { - writer.writeUint32("animIdxCount", animIdxs.size()); writer.enumerate("animIdxs", animIdxs); } @@ -388,17 +367,16 @@ void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer) { writer.writeUint32("unk4", unk4); writer.writeUByte("unk5", unk5); - writer.writeUint32("extentsCount", extents.size()); writer.enumerate("extents", extents); } } const char* ANCS::CharacterSet::CharacterInfo::DNAType() { - return "Retro::DNAMP2::ANCS::CharacterSet::CharacterInfo"; + return "urde::DNAMP2::ANCS::CharacterSet::CharacterInfo"; } -void ANCS::AnimationSet::read(Athena::io::IStreamReader& reader) +void ANCS::AnimationSet::read(athena::io::IStreamReader& reader) { atUint16 sectionCount = reader.readUint16Big(); @@ -433,7 +411,7 @@ void ANCS::AnimationSet::read(Athena::io::IStreamReader& reader) } } -void ANCS::AnimationSet::write(Athena::io::IStreamWriter& writer) const +void ANCS::AnimationSet::write(athena::io::IStreamWriter& writer) const { atUint16 sectionCount; if (evnts.size()) @@ -516,22 +494,19 @@ size_t ANCS::AnimationSet::binarySize(size_t __isz) const return __isz; } -void ANCS::AnimationSet::read(Athena::io::YAMLDocReader& reader) +void ANCS::AnimationSet::read(athena::io::YAMLDocReader& reader) { atUint16 sectionCount = reader.readUint16("sectionCount"); - atUint32 animationCount = reader.readUint32("animationCount"); - reader.enumerate("animations", animations, animationCount); + reader.enumerate("animations", animations); - atUint32 transitionCount = reader.readUint32("transitionCount"); - reader.enumerate("transitions", transitions, transitionCount); + reader.enumerate("transitions", transitions); reader.enumerate("defaultTransition", defaultTransition); additiveAnims.clear(); if (sectionCount > 1) { - atUint32 additiveAnimCount = reader.readUint32("additiveAnimCount"); - reader.enumerate("additiveAnims", additiveAnims, additiveAnimCount); + reader.enumerate("additiveAnims", additiveAnims); floatA = reader.readFloat("floatA"); floatB = reader.readFloat("floatB"); } @@ -539,19 +514,17 @@ void ANCS::AnimationSet::read(Athena::io::YAMLDocReader& reader) halfTransitions.clear(); if (sectionCount > 2) { - atUint32 halfTransitionCount = reader.readUint32("halfTransitionCount"); - reader.enumerate("halfTransitions", halfTransitions, halfTransitionCount); + reader.enumerate("halfTransitions", halfTransitions); } evnts.clear(); if (sectionCount > 3) { - atUint32 evntsCount = reader.readUint32("evntsCount"); - reader.enumerate("evnts", evnts, evntsCount); + reader.enumerate("evnts", evnts); } } -void ANCS::AnimationSet::write(Athena::io::YAMLDocWriter& writer) const +void ANCS::AnimationSet::write(athena::io::YAMLDocWriter& writer) const { atUint16 sectionCount; if (evnts.size()) @@ -565,16 +538,13 @@ void ANCS::AnimationSet::write(Athena::io::YAMLDocWriter& writer) const writer.writeUint16("sectionCount", sectionCount); - writer.writeUint32("animationCount", animations.size()); writer.enumerate("animations", animations); - writer.writeUint32("transitionCount", transitions.size()); writer.enumerate("transitions", transitions); writer.enumerate("defaultTransition", defaultTransition); if (sectionCount > 1) { - writer.writeUint32("additiveAnimCount", additiveAnims.size()); writer.enumerate("additiveAnims", additiveAnims); writer.writeFloat("floatA", floatA); writer.writeFloat("floatB", floatB); @@ -582,23 +552,21 @@ void ANCS::AnimationSet::write(Athena::io::YAMLDocWriter& writer) const if (sectionCount > 2) { - writer.writeUint32("halfTransitionCount", halfTransitions.size()); writer.enumerate("halfTransitions", halfTransitions); } if (sectionCount > 3) { - writer.writeUint32("evntsCount", evnts.size()); writer.enumerate("evnts", evnts); } } const char* ANCS::AnimationSet::DNAType() { - return "Retro::DNAMP2::ANCS::AnimationSet"; + return "urde::DNAMP2::ANCS::AnimationSet"; } -void ANCS::AnimationSet::EVNT::read(Athena::io::IStreamReader& reader) +void ANCS::AnimationSet::EVNT::read(athena::io::IStreamReader& reader) { version = reader.readUint32Big(); @@ -619,7 +587,7 @@ void ANCS::AnimationSet::EVNT::read(Athena::io::IStreamReader& reader) reader.enumerate(sfxEvents, sfxCount); } -void ANCS::AnimationSet::EVNT::write(Athena::io::IStreamWriter& writer) const +void ANCS::AnimationSet::EVNT::write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(version); @@ -661,50 +629,42 @@ size_t ANCS::AnimationSet::EVNT::binarySize(size_t __isz) const return __isz; } -void ANCS::AnimationSet::EVNT::read(Athena::io::YAMLDocReader& reader) +void ANCS::AnimationSet::EVNT::read(athena::io::YAMLDocReader& reader) { version = reader.readUint32("version"); - atUint32 loopCount = reader.readUint32("loopCount"); - reader.enumerate("loopEvents", loopEvents, loopCount); + reader.enumerate("loopEvents", loopEvents); uevtEvents.clear(); if (version == 2) { - atUint32 uevtCount = reader.readUint32("uevtCount"); - reader.enumerate("uevtEvents", uevtEvents, uevtCount); + reader.enumerate("uevtEvents", uevtEvents); } - atUint32 effectCount = reader.readUint32("effectCount"); - reader.enumerate("effectEvents", effectEvents, effectCount); + reader.enumerate("effectEvents", effectEvents); - atUint32 sfxCount = reader.readUint32("sfxCount"); - reader.enumerate("sfxEvents", sfxEvents, sfxCount); + reader.enumerate("sfxEvents", sfxEvents); } -void ANCS::AnimationSet::EVNT::write(Athena::io::YAMLDocWriter& writer) const +void ANCS::AnimationSet::EVNT::write(athena::io::YAMLDocWriter& writer) const { writer.writeUint32("version", version); - writer.writeUint32("loopCount", loopEvents.size()); writer.enumerate("loopEvents", loopEvents); if (version == 2) { - writer.writeUint32("uevtCount", uevtEvents.size()); writer.enumerate("uevtEvents", uevtEvents); } - writer.writeUint32("effectCount", effectEvents.size()); writer.enumerate("effectEvents", effectEvents); - writer.writeUint32("sfxCount", sfxEvents.size()); writer.enumerate("sfxEvents", sfxEvents); } const char* ANCS::AnimationSet::EVNT::DNAType() { - return "Retro::DNAMP2::ANCS::AnimationSet::EVNT"; + return "urde::DNAMP2::ANCS::AnimationSet::EVNT"; } } diff --git a/DataSpec/DNAMP2/ANCS.hpp b/DataSpec/DNAMP2/ANCS.hpp index 780be2092..e2ac9a9b2 100644 --- a/DataSpec/DNAMP2/ANCS.hpp +++ b/DataSpec/DNAMP2/ANCS.hpp @@ -213,34 +213,34 @@ struct ANCS : BigYAML static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const DNAMP1::PAK::Entry& entry, bool force, - std::function fileChanged) + std::function fileChanged) { - HECL::ProjectPath yamlPath = outPath.getWithExtension(_S(".yaml")); - HECL::ProjectPath::Type yamlType = yamlPath.getPathType(); - HECL::ProjectPath blendPath = outPath.getWithExtension(_S(".blend")); - HECL::ProjectPath::Type blendType = blendPath.getPathType(); + hecl::ProjectPath yamlPath = outPath.getWithExtension(_S(".yaml")); + hecl::ProjectPath::Type yamlType = yamlPath.getPathType(); + hecl::ProjectPath blendPath = outPath.getWithExtension(_S(".blend")); + hecl::ProjectPath::Type blendType = blendPath.getPathType(); if (force || - yamlType == HECL::ProjectPath::Type::None || - blendType == HECL::ProjectPath::Type::None) + yamlType == hecl::ProjectPath::Type::None || + blendType == hecl::ProjectPath::Type::None) { ANCS ancs; ancs.read(rs); - if (force || yamlType == HECL::ProjectPath::Type::None) + if (force || yamlType == hecl::ProjectPath::Type::None) { - FILE* fp = HECL::Fopen(yamlPath.getAbsolutePath().c_str(), _S("wb")); + FILE* fp = hecl::Fopen(yamlPath.getAbsolutePath().c_str(), _S("wb")); ancs.toYAMLFile(fp); fclose(fp); } - if (force || blendType == HECL::ProjectPath::Type::None) + if (force || blendType == hecl::ProjectPath::Type::None) { - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); DNAANCS::ReadANCSToBlender, ANCS, MaterialSet, DNACMDL::SurfaceHeader_2, 4> (conn, ancs, blendPath, pakRouter, entry, dataSpec, fileChanged, force); } diff --git a/DataSpec/DNAMP2/ANIM.cpp b/DataSpec/DNAMP2/ANIM.cpp index b85708fae..0799319b6 100644 --- a/DataSpec/DNAMP2/ANIM.cpp +++ b/DataSpec/DNAMP2/ANIM.cpp @@ -5,9 +5,9 @@ namespace DataSpec namespace DNAMP2 { -using ANIMOutStream = HECL::BlenderConnection::PyOutStream::ANIMOutStream; +using ANIMOutStream = hecl::BlenderConnection::PyOutStream::ANIMOutStream; -void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, const CINF& cinf) const +void ANIM::IANIM::sendANIMToBlender(hecl::BlenderConnection::PyOutStream& os, const CINF& cinf) const { os.format("act.hecl_fps = round(%f)\n", (1.0f / mainInterval)); @@ -92,7 +92,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co } } -void ANIM::ANIM0::read(Athena::io::IStreamReader& reader) +void ANIM::ANIM0::read(athena::io::IStreamReader& reader) { Header head; head.read(reader); @@ -215,7 +215,7 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader) } } -void ANIM::ANIM0::write(Athena::io::IStreamWriter& writer) const +void ANIM::ANIM0::write(athena::io::IStreamWriter& writer) const { Header head; head.unk0 = 0; @@ -372,7 +372,7 @@ size_t ANIM::ANIM0::binarySize(size_t __isz) const return __isz; } -void ANIM::ANIM2::read(Athena::io::IStreamReader& reader) +void ANIM::ANIM2::read(athena::io::IStreamReader& reader) { Header head; head.read(reader); @@ -450,7 +450,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader) chanKeys = bsReader.read(bsData.get(), keyframeCount, channels, head.rotDiv, head.translationMult); } -void ANIM::ANIM2::write(Athena::io::IStreamWriter& writer) const +void ANIM::ANIM2::write(athena::io::IStreamWriter& writer) const { Header head; head.unk1 = 1; diff --git a/DataSpec/DNAMP2/ANIM.hpp b/DataSpec/DNAMP2/ANIM.hpp index 7dda6e677..665b8c328 100644 --- a/DataSpec/DNAMP2/ANIM.hpp +++ b/DataSpec/DNAMP2/ANIM.hpp @@ -27,7 +27,7 @@ struct ANIM : BigDNA std::vector> chanKeys; float mainInterval = 0.0; - void sendANIMToBlender(HECL::BlenderConnection::PyOutStream&, const CINF&) const; + void sendANIMToBlender(hecl::BlenderConnection::PyOutStream&, const CINF&) const; }; struct ANIM0 : IANIM @@ -97,7 +97,7 @@ struct ANIM : BigDNA Value initSZ = 0; Value qSZ = 0; - void read(Athena::io::IStreamReader& reader) + void read(athena::io::IStreamReader& reader) { id = reader.readUByte(); keyCount1 = reader.readUint16Big(); @@ -131,7 +131,7 @@ struct ANIM : BigDNA qSZ = reader.readUByte(); } } - void write(Athena::io::IStreamWriter& writer) const + void write(athena::io::IStreamWriter& writer) const { writer.writeUByte(id); writer.writeUint16Big(keyCount1); @@ -180,7 +180,7 @@ struct ANIM : BigDNA }; std::unique_ptr m_anim; - void read(Athena::io::IStreamReader& reader) + void read(athena::io::IStreamReader& reader) { atUint32 version = reader.readUint32Big(); switch (version) @@ -194,12 +194,12 @@ struct ANIM : BigDNA m_anim->read(reader); break; default: - Log.report(LogVisor::FatalError, "unrecognized ANIM version"); + Log.report(logvisor::Fatal, "unrecognized ANIM version"); break; } } - void write(Athena::io::IStreamWriter& writer) const + void write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(m_anim->m_version); m_anim->write(writer); @@ -210,7 +210,7 @@ struct ANIM : BigDNA return m_anim->binarySize(__isz + 4); } - void sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, const CINF& cinf, bool) const + void sendANIMToBlender(hecl::BlenderConnection::PyOutStream& os, const CINF& cinf, bool) const { m_anim->sendANIMToBlender(os, cinf); } diff --git a/DataSpec/DNAMP2/CINF.hpp b/DataSpec/DNAMP2/CINF.hpp index aeef58887..c144e86bc 100644 --- a/DataSpec/DNAMP2/CINF.hpp +++ b/DataSpec/DNAMP2/CINF.hpp @@ -57,7 +57,7 @@ struct CINF : BigDNA return nullptr; } - void sendVertexGroupsToBlender(HECL::BlenderConnection::PyOutStream& os) const + void sendVertexGroupsToBlender(hecl::BlenderConnection::PyOutStream& os) const { for (atUint32 bid : boneIds) { @@ -72,7 +72,7 @@ struct CINF : BigDNA } } - void sendCINFToBlender(HECL::BlenderConnection::PyOutStream& os, const UniqueID32& cinfId) const + void sendCINFToBlender(hecl::BlenderConnection::PyOutStream& os, const UniqueID32& cinfId) const { os.format("arm = bpy.data.armatures.new('CINF_%08X')\n" "arm_obj = bpy.data.objects.new(arm.name, arm)\n" diff --git a/DataSpec/DNAMP2/CMDL.hpp b/DataSpec/DNAMP2/CMDL.hpp index 2a3b9be39..00aff3812 100644 --- a/DataSpec/DNAMP2/CMDL.hpp +++ b/DataSpec/DNAMP2/CMDL.hpp @@ -17,11 +17,11 @@ struct CMDL { static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const DNAMP1::PAK::Entry& entry, bool, - std::function) + std::function) { /* Check for RigPair */ const PAKRouter::RigPair* rp = pakRouter.lookupCMDLRigPair(entry.id); @@ -37,8 +37,8 @@ struct CMDL } /* Do extract */ - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); - if (!conn.createBlend(outPath, HECL::BlenderConnection::BlendType::Mesh)) + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); + if (!conn.createBlend(outPath, hecl::BlenderConnection::BlendType::Mesh)) return false; DNACMDL::ReadCMDLToBlender, MaterialSet, std::pair, DNACMDL::SurfaceHeader_2, 4> (conn, rs, pakRouter, entry, dataSpec, loadRp); diff --git a/DataSpec/DNAMP2/CMDLMaterials.hpp b/DataSpec/DNAMP2/CMDLMaterials.hpp index 59bde8fbd..ab0531bb6 100644 --- a/DataSpec/DNAMP2/CMDLMaterials.hpp +++ b/DataSpec/DNAMP2/CMDLMaterials.hpp @@ -59,15 +59,15 @@ struct MaterialSet : BigDNA }; Vector materials; - static void RegisterMaterialProps(HECL::BlenderConnection::PyOutStream& out) + static void RegisterMaterialProps(hecl::BlenderConnection::PyOutStream& out) { DNAMP1::MaterialSet::RegisterMaterialProps(out); } - static void ConstructMaterial(HECL::BlenderConnection::PyOutStream& out, + static void ConstructMaterial(hecl::BlenderConnection::PyOutStream& out, const MaterialSet::Material& material, unsigned groupIdx, unsigned matIdx); - void readToBlender(HECL::BlenderConnection::PyOutStream& os, + void readToBlender(hecl::BlenderConnection::PyOutStream& os, const PAKRouter& pakRouter, const PAKRouter::EntryType& entry, unsigned setIdx) diff --git a/DataSpec/DNAMP2/CSKR.hpp b/DataSpec/DNAMP2/CSKR.hpp index 1f93533f7..3dd1cbc30 100644 --- a/DataSpec/DNAMP2/CSKR.hpp +++ b/DataSpec/DNAMP2/CSKR.hpp @@ -20,7 +20,7 @@ struct CSKR : DNAMP1::CSKR return nullptr; } - void weightVertex(HECL::BlenderConnection::PyOutStream& os, const CINF& cinf, atUint32 idx) const + void weightVertex(hecl::BlenderConnection::PyOutStream& os, const CINF& cinf, atUint32 idx) const { atUint32 accum = 0; for (const SkinningRule& rule : skinningRules) diff --git a/DataSpec/DNAMP2/DNAMP2.cpp b/DataSpec/DNAMP2/DNAMP2.cpp index c0ea47e6b..2555c1f4a 100644 --- a/DataSpec/DNAMP2/DNAMP2.cpp +++ b/DataSpec/DNAMP2/DNAMP2.cpp @@ -13,7 +13,7 @@ namespace DataSpec { namespace DNAMP2 { -LogVisor::LogModule Log("Retro::DNAMP2"); +logvisor::Module Log("urde::DNAMP2"); static bool GetNoShare(const std::string& name) { @@ -24,12 +24,12 @@ static bool GetNoShare(const std::string& name) return true; } -PAKBridge::PAKBridge(HECL::Database::Project& project, - const NOD::Node& node, +PAKBridge::PAKBridge(hecl::Database::Project& project, + const nod::Node& node, bool doExtract) : m_project(project), m_node(node), m_pak(true, GetNoShare(node.getName())), m_doExtract(doExtract) { - NOD::AthenaPartReadStream rs(node.beginReadStream()); + nod::AthenaPartReadStream rs(node.beginReadStream()); m_pak.read(rs); /* Append Level String */ @@ -54,12 +54,12 @@ PAKBridge::PAKBridge(HECL::Database::Project& project, } } -static HECL::SystemString LayerName(const std::string& name) +static hecl::SystemString LayerName(const std::string& name) { #if HECL_UCS2 - HECL::SystemString ret = HECL::UTF8ToWide(name); + hecl::SystemString ret = hecl::UTF8ToWide(name); #else - HECL::SystemString ret = name; + hecl::SystemString ret = name; #endif for (auto& ch : ret) if (ch == _S('/') || ch == _S('\\')) @@ -82,7 +82,7 @@ void PAKBridge::build() mlvl.read(rs); } #if HECL_UCS2 - level.name = HECL::UTF8ToWide(m_pak.bestEntryName(entry)); + level.name = hecl::UTF8ToWide(m_pak.bestEntryName(entry)); #else level.name = m_pak.bestEntryName(entry); #endif @@ -95,7 +95,7 @@ void PAKBridge::build() if (worldMapEnt) { PAKEntryReadStream rs = worldMapEnt->beginReadStream(m_node); - rs.seek(8, Athena::Current); + rs.seek(8, athena::Current); atUint32 areaCount = rs.readUint32Big(); mapw.reserve(areaCount); for (atUint32 i=0 ; i; std::unordered_map m_levelDeps; - HECL::SystemString m_levelString; + hecl::SystemString m_levelString; - PAKBridge(HECL::Database::Project& project, - const NOD::Node& node, + PAKBridge(hecl::Database::Project& project, + const nod::Node& node, bool doExtract=true); void build(); static ResExtractor LookupExtractor(const DNAMP1::PAK::Entry& entry); const std::string& getName() const {return m_node.getName();} - const HECL::SystemString& getLevelString() const {return m_levelString;} + const hecl::SystemString& getLevelString() const {return m_levelString;} using PAKType = DNAMP1::PAK; const PAKType& getPAK() const {return m_pak;} - const NOD::Node& getNode() const {return m_node;} + const nod::Node& getNode() const {return m_node;} void addCMDLRigPairs(PAKRouter& pakRouter, std::unordered_map>& addTo) const; diff --git a/DataSpec/DNAMP2/DeafBabe.hpp b/DataSpec/DNAMP2/DeafBabe.hpp index 5432a54a9..ee3e735f1 100644 --- a/DataSpec/DNAMP2/DeafBabe.hpp +++ b/DataSpec/DNAMP2/DeafBabe.hpp @@ -65,11 +65,11 @@ struct DeafBabe : BigDNA Value vertCount; Vector verts; - static void BlenderInit(HECL::BlenderConnection::PyOutStream& os) + static void BlenderInit(hecl::BlenderConnection::PyOutStream& os) { DNAMP1::DeafBabe::BlenderInit(os); } - void insertNoClimb(HECL::BlenderConnection::PyOutStream& os) const + void insertNoClimb(hecl::BlenderConnection::PyOutStream& os) const { for (atInt16 edgeIdx : noClimbEdges) { @@ -82,7 +82,7 @@ struct DeafBabe : BigDNA edge.verts[0], edge.verts[1]); } } - void sendToBlender(HECL::BlenderConnection::PyOutStream& os) const + void sendToBlender(hecl::BlenderConnection::PyOutStream& os) const { DeafBabeSendToBlender(os, *this); } diff --git a/DataSpec/DNAMP2/MAPA.hpp b/DataSpec/DNAMP2/MAPA.hpp index 1a8b85eaf..671dd2533 100644 --- a/DataSpec/DNAMP2/MAPA.hpp +++ b/DataSpec/DNAMP2/MAPA.hpp @@ -13,15 +13,15 @@ struct MAPA : DNAMAPA::MAPA { static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const DNAMP1::PAK::Entry& entry, bool force, - std::function fileChanged) + std::function fileChanged) { MAPA mapa; mapa.read(rs); - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); return DNAMAPA::ReadMAPAToBlender(conn, mapa, outPath, pakRouter, entry, force); } }; diff --git a/DataSpec/DNAMP2/MLVL.hpp b/DataSpec/DNAMP2/MLVL.hpp index 2456e64c7..e7643762f 100644 --- a/DataSpec/DNAMP2/MLVL.hpp +++ b/DataSpec/DNAMP2/MLVL.hpp @@ -96,18 +96,18 @@ struct MLVL : BigYAML static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const DNAMP1::PAK::Entry& entry, bool force, - std::function fileChanged) + std::function fileChanged) { MLVL mlvl; mlvl.read(rs); - FILE* fp = HECL::Fopen(outPath.getWithExtension(_S(".yaml"), true).getAbsolutePath().c_str(), _S("wb")); + FILE* fp = hecl::Fopen(outPath.getWithExtension(_S(".yaml"), true).getAbsolutePath().c_str(), _S("wb")); mlvl.toYAMLFile(fp); fclose(fp); - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); return DNAMLVL::ReadMLVLToBlender(conn, mlvl, outPath, pakRouter, entry, force, fileChanged); } diff --git a/DataSpec/DNAMP2/MREA.cpp b/DataSpec/DNAMP2/MREA.cpp index d5adb6d9d..d92f89b4d 100644 --- a/DataSpec/DNAMP2/MREA.cpp +++ b/DataSpec/DNAMP2/MREA.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include "MREA.hpp" #include "../DNAMP1/MREA.hpp" @@ -13,7 +13,7 @@ namespace DNAMP2 void MREA::StreamReader::nextBlock() { if (m_nextBlk >= m_blkCount) - Log.report(LogVisor::FatalError, "MREA stream overrun"); + Log.report(logvisor::Fatal, "MREA stream overrun"); BlockInfo& info = m_blockInfos[m_nextBlk++]; @@ -68,7 +68,7 @@ void MREA::StreamReader::nextBlock() m_blkSz = info.decompSize; } -MREA::StreamReader::StreamReader(Athena::io::IStreamReader& source, atUint32 blkCount) +MREA::StreamReader::StreamReader(athena::io::IStreamReader& source, atUint32 blkCount) : m_compBufSz(0x4120), m_compBuf(new atUint8[0x4120]), m_decompBufSz(0x4120), m_decompBuf(new atUint8[0x4120]), m_source(source), m_blkCount(blkCount) @@ -86,16 +86,16 @@ MREA::StreamReader::StreamReader(Athena::io::IStreamReader& source, atUint32 blk nextBlock(); } -void MREA::StreamReader::seek(atInt64 diff, Athena::SeekOrigin whence) +void MREA::StreamReader::seek(atInt64 diff, athena::SeekOrigin whence) { atUint64 target = diff; - if (whence == Athena::Current) + if (whence == athena::Current) target = m_pos + diff; - else if (whence == Athena::End) + else if (whence == athena::End) target = m_totalDecompLen - diff; if (target >= m_totalDecompLen) - Log.report(LogVisor::FatalError, "MREA stream seek overrun"); + Log.report(logvisor::Fatal, "MREA stream seek overrun"); /* Determine which block contains position */ atUint32 dAccum = 0; @@ -117,7 +117,7 @@ void MREA::StreamReader::seek(atInt64 diff, Athena::SeekOrigin whence) /* Seek source if needed */ if (bIdx != m_nextBlk-1) { - m_source.seek(m_blkBase + cAccum, Athena::Begin); + m_source.seek(m_blkBase + cAccum, athena::Begin); m_nextBlk = bIdx; nextBlock(); } @@ -147,7 +147,7 @@ atUint64 MREA::StreamReader::readUBytesToBuf(void* buf, atUint64 len) return len; } -void MREA::StreamReader::writeDecompInfos(Athena::io::IStreamWriter& writer) const +void MREA::StreamReader::writeDecompInfos(athena::io::IStreamWriter& writer) const { for (const BlockInfo& info : m_blockInfos) { @@ -159,18 +159,18 @@ void MREA::StreamReader::writeDecompInfos(Athena::io::IStreamWriter& writer) con bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const DNAMP1::PAK::Entry& entry, bool force, - std::function) + std::function) { using RigPair = std::pair; RigPair dummy(nullptr, nullptr); /* Rename MREA for consistency */ - HECL::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend")); - if (!force && mreaPath.getPathType() == HECL::ProjectPath::Type::File) + hecl::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend")); + if (!force && mreaPath.getPathType() == hecl::ProjectPath::Type::File) return true; /* Do extract */ @@ -180,7 +180,7 @@ bool MREA::Extract(const SpecBase& dataSpec, /* MREA decompression stream */ StreamReader drs(rs, head.compressedBlockCount); - Athena::io::FileWriter mreaDecompOut(pakRouter.getCooked(&entry).getWithExtension(_S(".decomp")).getAbsolutePath()); + athena::io::FileWriter mreaDecompOut(pakRouter.getCooked(&entry).getWithExtension(_S(".decomp")).getAbsolutePath()); head.write(mreaDecompOut); mreaDecompOut.seekAlign32(); drs.writeDecompInfos(mreaDecompOut); @@ -188,11 +188,11 @@ bool MREA::Extract(const SpecBase& dataSpec, atUint64 decompLen = drs.length(); mreaDecompOut.writeBytes(drs.readBytes(decompLen).get(), decompLen); mreaDecompOut.close(); - drs.seek(0, Athena::Begin); + drs.seek(0, athena::Begin); /* Start up blender connection */ - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); - if (!conn.createBlend(mreaPath, HECL::BlenderConnection::BlendType::Area)) + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); + if (!conn.createBlend(mreaPath, hecl::BlenderConnection::BlendType::Area)) return false; /* Calculate offset to EGMC section */ @@ -201,15 +201,15 @@ bool MREA::Extract(const SpecBase& dataSpec, egmcOffset += head.secSizes[i]; /* Load EGMC if possible so we can assign meshes to scanIds */ - drs.seek(egmcOffset, Athena::Begin); + drs.seek(egmcOffset, athena::Begin); UniqueID32 egmcId(drs); DNACommon::EGMC egmc; bool hasEGMC = pakRouter.lookupAndReadDNA(egmcId, egmc); - drs.seek(0, Athena::Begin); + drs.seek(0, athena::Begin); /* Open Py Stream and read sections */ - HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); + hecl::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); os.format("import bpy\n" "import bmesh\n" "from mathutils import Vector\n" @@ -241,7 +241,7 @@ bool MREA::Extract(const SpecBase& dataSpec, atUint64 secStart = drs.position(); matSet.read(drs); matSet.readToBlender(os, pakRouter, entry, 0); - drs.seek(secStart + head.secSizes[0], Athena::Begin); + drs.seek(secStart + head.secSizes[0], athena::Begin); std::vector vertAttribs; DNACMDL::GetVertexAttributes(matSet, vertAttribs); @@ -252,7 +252,7 @@ bool MREA::Extract(const SpecBase& dataSpec, MeshHeader mHeader; secStart = drs.position(); mHeader.read(drs); - drs.seek(secStart + head.secSizes[curSec++], Athena::Begin); + drs.seek(secStart + head.secSizes[curSec++], athena::Begin); curSec += DNACMDL::ReadGeomSectionsToBlender, MaterialSet, RigPair, DNACMDL::SurfaceHeader_2> (os, drs, pakRouter, entry, dummy, true, true, vertAttribs, m, head.secCount, 0, &head.secSizes[curSec]); @@ -266,25 +266,25 @@ bool MREA::Extract(const SpecBase& dataSpec, mHeader.visorFlags.thermalLevelStr()); /* Seek through AROT-relation sections */ - drs.seek(head.secSizes[curSec++], Athena::Current); - drs.seek(head.secSizes[curSec++], Athena::Current); + drs.seek(head.secSizes[curSec++], athena::Current); + drs.seek(head.secSizes[curSec++], athena::Current); } /* Skip AROT */ - drs.seek(head.secSizes[curSec++], Athena::Current); + drs.seek(head.secSizes[curSec++], athena::Current); /* Skip BVH */ - drs.seek(head.secSizes[curSec++], Athena::Current); + drs.seek(head.secSizes[curSec++], athena::Current); /* Skip Bitmap */ - drs.seek(head.secSizes[curSec++], Athena::Current); + drs.seek(head.secSizes[curSec++], athena::Current); /* Skip SCLY (for now) */ for (atUint32 l=0 ; l m_compBuf; size_t m_decompBufSz; std::unique_ptr m_decompBuf; - Athena::io::IStreamReader& m_source; + athena::io::IStreamReader& m_source; atUint64 m_blkBase; atUint32 m_blkCount; atUint32 m_totalDecompLen = 0; @@ -40,18 +40,18 @@ struct MREA atUint32 m_blkSz = 0; void nextBlock(); - StreamReader(Athena::io::IStreamReader& source) + StreamReader(athena::io::IStreamReader& source) : m_compBufSz(0x4120), m_compBuf(new atUint8[0x4120]), m_decompBufSz(0x4120), m_decompBuf(new atUint8[0x4120]), m_source(source) {} /* Empty constructor for inheriting */ public: - StreamReader(Athena::io::IStreamReader& source, atUint32 blkCount); - void seek(atInt64 diff, Athena::SeekOrigin whence); + StreamReader(athena::io::IStreamReader& source, atUint32 blkCount); + void seek(atInt64 diff, athena::SeekOrigin whence); atUint64 position() const {return m_pos;} atUint64 length() const {return m_totalDecompLen;} atUint64 readUBytesToBuf(void* buf, atUint64 len); - void writeDecompInfos(Athena::io::IStreamWriter& writer) const; + void writeDecompInfos(athena::io::IStreamWriter& writer) const; }; struct Header : BigDNA @@ -75,7 +75,7 @@ struct MREA Value unk3SecIdx; Value egmcSecIdx; Value compressedBlockCount; - Seek<12, Athena::Current> align1; + Seek<12, athena::Current> align1; Vector secSizes; }; @@ -119,11 +119,11 @@ struct MREA static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const DNAMP1::PAK::Entry& entry, bool, - std::function); + std::function); }; } diff --git a/DataSpec/DNAMP2/PAK.hpp b/DataSpec/DNAMP2/PAK.hpp index fde78a969..f0dc42d13 100644 --- a/DataSpec/DNAMP2/PAK.hpp +++ b/DataSpec/DNAMP2/PAK.hpp @@ -3,7 +3,7 @@ #include "../DNAMP1/PAK.hpp" -namespace Retro +namespace urde { namespace DNAMP2 { diff --git a/DataSpec/DNAMP2/STRG.cpp b/DataSpec/DNAMP2/STRG.cpp index c46e7cb79..b745914d7 100644 --- a/DataSpec/DNAMP2/STRG.cpp +++ b/DataSpec/DNAMP2/STRG.cpp @@ -6,7 +6,7 @@ namespace DataSpec namespace DNAMP2 { -void STRG::_read(Athena::io::IStreamReader& reader) +void STRG::_read(athena::io::IStreamReader& reader) { atUint32 langCount = reader.readUint32Big(); atUint32 strCount = reader.readUint32Big(); @@ -32,8 +32,8 @@ void STRG::_read(Athena::io::IStreamReader& reader) }* nameIndex = (NameIdxEntry*)nameTableBuf.get(); for (atUint32 n=0 ; nm_type == YAML_MAPPING_NODE) @@ -179,19 +179,19 @@ void STRG::read(Athena::io::YAMLDocReader& reader) continue; if (lang.first.size() != 4) { - Log.report(LogVisor::Warning, "STRG language string '%s' must be exactly 4 characters; skipping", lang.first.c_str()); + Log.report(logvisor::Warning, "STRG language string '%s' must be exactly 4 characters; skipping", lang.first.c_str()); return; } if (lang.second->m_type != YAML_SEQUENCE_NODE) { - Log.report(LogVisor::Warning, "STRG language string '%s' must contain a sequence; skipping", lang.first.c_str()); + Log.report(logvisor::Warning, "STRG language string '%s' must contain a sequence; skipping", lang.first.c_str()); return; } for (const auto& str : lang.second->m_seqChildren) { if (str->m_type != YAML_SCALAR_NODE) { - Log.report(LogVisor::Warning, "STRG language '%s' must contain all scalars; skipping", lang.first.c_str()); + Log.report(logvisor::Warning, "STRG language '%s' must contain all scalars; skipping", lang.first.c_str()); return; } } @@ -199,7 +199,7 @@ void STRG::read(Athena::io::YAMLDocReader& reader) } else { - Log.report(LogVisor::Warning, "STRG must have a mapping root node; skipping"); + Log.report(logvisor::Warning, "STRG must have a mapping root node; skipping"); return; } @@ -209,15 +209,15 @@ void STRG::read(Athena::io::YAMLDocReader& reader) { std::vector strs; for (const auto& str : lang.second->m_seqChildren) - strs.emplace_back(HECL::UTF8ToWide(str->m_scalarString)); + strs.emplace_back(hecl::UTF8ToWide(str->m_scalarString)); langs.emplace_back(FourCC(lang.first.c_str()), strs); } names.clear(); - const Athena::io::YAMLNode* namesNode = root->findMapChild("names"); + const athena::io::YAMLNode* namesNode = root->findMapChild("names"); if (namesNode) for (const auto& item : namesNode->m_mapChildren) - names[item.first] = Athena::io::NodeToVal(item.second.get()); + names[item.first] = athena::io::NodeToVal(item.second.get()); langMap.clear(); langMap.reserve(langs.size()); @@ -225,7 +225,7 @@ void STRG::read(Athena::io::YAMLDocReader& reader) langMap.emplace(item.first, &item.second); } -void STRG::write(Athena::io::YAMLDocWriter& writer) const +void STRG::write(athena::io::YAMLDocWriter& writer) const { for (const auto& lang : langs) { @@ -249,7 +249,7 @@ void STRG::write(Athena::io::YAMLDocWriter& writer) const const char* STRG::DNAType() { - return "Retro::DNAMP2::STRG"; + return "urde::DNAMP2::STRG"; } } diff --git a/DataSpec/DNAMP2/STRG.hpp b/DataSpec/DNAMP2/STRG.hpp index 1bbdc1c45..8ae4e8318 100644 --- a/DataSpec/DNAMP2/STRG.hpp +++ b/DataSpec/DNAMP2/STRG.hpp @@ -14,7 +14,7 @@ struct STRG : ISTRG { DECL_YAML Delete expl; - void _read(Athena::io::IStreamReader& reader); + void _read(athena::io::IStreamReader& reader); std::vector>> langs; std::unordered_map*> langMap; std::map names; @@ -42,7 +42,7 @@ struct STRG : ISTRG { auto search = langMap.find(lang); if (search != langMap.end()) - return HECL::WideToUTF8(search->second->at(idx)); + return hecl::WideToUTF8(search->second->at(idx)); return std::string(); } inline std::wstring getUTF16(const FourCC& lang, size_t idx) const @@ -52,35 +52,35 @@ struct STRG : ISTRG return search->second->at(idx); return std::wstring(); } - inline HECL::SystemString getSystemString(const FourCC& lang, size_t idx) const + inline hecl::SystemString getSystemString(const FourCC& lang, size_t idx) const { auto search = langMap.find(lang); if (search != langMap.end()) #if HECL_UCS2 return search->second->at(idx); #else - return HECL::WideToUTF8(search->second->at(idx)); + return hecl::WideToUTF8(search->second->at(idx)); #endif - return HECL::SystemString(); + return hecl::SystemString(); } - static bool Extract(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath) + static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) { STRG strg; strg.read(rs); - FILE* fp = HECL::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); + FILE* fp = hecl::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); strg.toYAMLFile(fp); fclose(fp); return true; } - static bool Cook(const HECL::ProjectPath& inPath, const HECL::ProjectPath& outPath) + static bool Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) { STRG strg; - FILE* fp = HECL::Fopen(inPath.getAbsolutePath().c_str(), _S("rb")); + FILE* fp = hecl::Fopen(inPath.getAbsolutePath().c_str(), _S("rb")); strg.fromYAMLFile(fp); fclose(fp); - Athena::io::FileWriter ws(outPath.getAbsolutePath()); + athena::io::FileWriter ws(outPath.getAbsolutePath()); strg.write(ws); return true; } diff --git a/DataSpec/DNAMP3/ANIM.cpp b/DataSpec/DNAMP3/ANIM.cpp index b2b437196..362abab95 100644 --- a/DataSpec/DNAMP3/ANIM.cpp +++ b/DataSpec/DNAMP3/ANIM.cpp @@ -1,15 +1,15 @@ #include "ANIM.hpp" -#include -#include +#include +#include "zeus/Math.hpp" namespace DataSpec { namespace DNAMP3 { -using ANIMOutStream = HECL::BlenderConnection::PyOutStream::ANIMOutStream; +using ANIMOutStream = hecl::BlenderConnection::PyOutStream::ANIMOutStream; -void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, const CINF& cinf, bool additive) const +void ANIM::IANIM::sendANIMToBlender(hecl::BlenderConnection::PyOutStream& os, const CINF& cinf, bool additive) const { os.format("act.hecl_fps = round(%f)\n" "act.hecl_additive = %s\n", @@ -109,7 +109,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co } } -void ANIM::ANIM0::read(Athena::io::IStreamReader& reader) +void ANIM::ANIM0::read(athena::io::IStreamReader& reader) { Header head; head.read(reader); @@ -235,7 +235,7 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader) } } -void ANIM::ANIM0::write(Athena::io::IStreamWriter& writer) const +void ANIM::ANIM0::write(athena::io::IStreamWriter& writer) const { Header head; head.unk0 = 0; @@ -425,7 +425,7 @@ static float ComputeFrames(const std::vector& keyTimes, std::vector> chanKeys; float mainInterval = 0.0; - void sendANIMToBlender(HECL::BlenderConnection::PyOutStream&, const CINF&, bool additive) const; + void sendANIMToBlender(hecl::BlenderConnection::PyOutStream&, const CINF&, bool additive) const; }; struct ANIM0 : IANIM @@ -80,7 +80,7 @@ struct ANIM : BigDNA }; std::unique_ptr m_anim; - void read(Athena::io::IStreamReader& reader) + void read(athena::io::IStreamReader& reader) { atUint32 version = reader.readUint32Big(); switch (version) @@ -94,12 +94,12 @@ struct ANIM : BigDNA m_anim->read(reader); break; default: - Log.report(LogVisor::FatalError, "unrecognized ANIM version"); + Log.report(logvisor::Fatal, "unrecognized ANIM version"); break; } } - void write(Athena::io::IStreamWriter& writer) const + void write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(m_anim->m_version); m_anim->write(writer); @@ -110,7 +110,7 @@ struct ANIM : BigDNA return m_anim->binarySize(__isz + 4); } - void sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, const CINF& cinf, bool additive) const + void sendANIMToBlender(hecl::BlenderConnection::PyOutStream& os, const CINF& cinf, bool additive) const { m_anim->sendANIMToBlender(os, cinf, additive); } diff --git a/DataSpec/DNAMP3/CHAR.cpp b/DataSpec/DNAMP3/CHAR.cpp index 7395e073e..cc10a35b2 100644 --- a/DataSpec/DNAMP3/CHAR.cpp +++ b/DataSpec/DNAMP3/CHAR.cpp @@ -5,7 +5,7 @@ namespace DataSpec namespace DNAMP3 { -void CHAR::AnimationInfo::EVNT::SFXEvent::read(Athena::io::IStreamReader& reader) +void CHAR::AnimationInfo::EVNT::SFXEvent::read(athena::io::IStreamReader& reader) { EventBase::read(reader); caudId.read(reader); @@ -17,10 +17,10 @@ void CHAR::AnimationInfo::EVNT::SFXEvent::read(Athena::io::IStreamReader& reader if (extraType == 1) extraFloat = reader.readFloatBig(); else if (extraType == 2) - reader.seek(35, Athena::Current); + reader.seek(35, athena::Current); } -void CHAR::AnimationInfo::EVNT::SFXEvent::write(Athena::io::IStreamWriter& writer) const +void CHAR::AnimationInfo::EVNT::SFXEvent::write(athena::io::IStreamWriter& writer) const { EventBase::write(writer); caudId.write(writer); @@ -32,7 +32,7 @@ void CHAR::AnimationInfo::EVNT::SFXEvent::write(Athena::io::IStreamWriter& write if (extraType == 1) writer.writeFloatBig(extraFloat); else if (extraType == 2) - writer.seek(35, Athena::Current); + writer.seek(35, athena::Current); } size_t CHAR::AnimationInfo::EVNT::SFXEvent::binarySize(size_t __isz) const @@ -48,26 +48,24 @@ size_t CHAR::AnimationInfo::EVNT::SFXEvent::binarySize(size_t __isz) const return __isz; } -void CHAR::AnimationInfo::EVNT::SFXEvent::read(Athena::io::YAMLDocReader& reader) +void CHAR::AnimationInfo::EVNT::SFXEvent::read(athena::io::YAMLDocReader& reader) { EventBase::read(reader); reader.enumerate("caudId", caudId); unk1 = reader.readUint32("unk1"); unk2 = reader.readUint32("unk2"); - unk3 = reader.readUint32("unk3"); - reader.enumerate("unk3Vals", unk3Vals, unk3); + unk3 = reader.enumerate("unk3Vals", unk3Vals); extraType = reader.readUint32("extraType"); if (extraType == 1) extraFloat = reader.readFloat("extraFloat"); } -void CHAR::AnimationInfo::EVNT::SFXEvent::write(Athena::io::YAMLDocWriter& writer) const +void CHAR::AnimationInfo::EVNT::SFXEvent::write(athena::io::YAMLDocWriter& writer) const { EventBase::write(writer); writer.enumerate("caudId", caudId); writer.writeUint32("unk1", unk1); writer.writeUint32("unk2", unk2); - writer.writeUint32("unk3", unk3); writer.enumerate("unk3Vals", unk3Vals); writer.writeUint32("extraType", extraType); if (extraType == 1) @@ -76,10 +74,10 @@ void CHAR::AnimationInfo::EVNT::SFXEvent::write(Athena::io::YAMLDocWriter& write const char* CHAR::AnimationInfo::EVNT::SFXEvent::DNAType() { - return "Retro::DNAMP3::CHAR::AnimationInfo::EVNT::SFXEvent"; + return "urde::DNAMP3::CHAR::AnimationInfo::EVNT::SFXEvent"; } -void CHAR::AnimationInfo::MetaAnimFactory::read(Athena::io::IStreamReader& reader) +void CHAR::AnimationInfo::MetaAnimFactory::read(athena::io::IStreamReader& reader) { IMetaAnim::Type type(IMetaAnim::Type(reader.readUint32Big())); switch (type) @@ -110,7 +108,7 @@ void CHAR::AnimationInfo::MetaAnimFactory::read(Athena::io::IStreamReader& reade } } -void CHAR::AnimationInfo::MetaAnimFactory::write(Athena::io::IStreamWriter& writer) const +void CHAR::AnimationInfo::MetaAnimFactory::write(athena::io::IStreamWriter& writer) const { if (!m_anim) return; @@ -125,7 +123,7 @@ size_t CHAR::AnimationInfo::MetaAnimFactory::binarySize(size_t __isz) const return m_anim->binarySize(__isz + 4); } -void CHAR::AnimationInfo::MetaAnimFactory::read(Athena::io::YAMLDocReader& reader) +void CHAR::AnimationInfo::MetaAnimFactory::read(athena::io::YAMLDocReader& reader) { std::string type = reader.readString("type"); std::transform(type.begin(), type.end(), type.begin(), tolower); @@ -161,7 +159,7 @@ void CHAR::AnimationInfo::MetaAnimFactory::read(Athena::io::YAMLDocReader& reade } -void CHAR::AnimationInfo::MetaAnimFactory::write(Athena::io::YAMLDocWriter& writer) const +void CHAR::AnimationInfo::MetaAnimFactory::write(athena::io::YAMLDocWriter& writer) const { if (!m_anim) return; @@ -171,7 +169,7 @@ void CHAR::AnimationInfo::MetaAnimFactory::write(Athena::io::YAMLDocWriter& writ const char* CHAR::AnimationInfo::MetaAnimFactory::DNAType() { - return "Retro::DNAMP3::CHAR::AnimationInfo::MetaAnimFactory"; + return "urde::DNAMP3::CHAR::AnimationInfo::MetaAnimFactory"; } } diff --git a/DataSpec/DNAMP3/CHAR.hpp b/DataSpec/DNAMP3/CHAR.hpp index 97813fa27..f443f1d36 100644 --- a/DataSpec/DNAMP3/CHAR.hpp +++ b/DataSpec/DNAMP3/CHAR.hpp @@ -308,34 +308,34 @@ struct CHAR : BigYAML static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, - std::function fileChanged) + std::function fileChanged) { - HECL::ProjectPath yamlPath = outPath.getWithExtension(_S(".yaml")); - HECL::ProjectPath::Type yamlType = yamlPath.getPathType(); - HECL::ProjectPath blendPath = outPath.getWithExtension(_S(".blend")); - HECL::ProjectPath::Type blendType = blendPath.getPathType(); + hecl::ProjectPath yamlPath = outPath.getWithExtension(_S(".yaml")); + hecl::ProjectPath::Type yamlType = yamlPath.getPathType(); + hecl::ProjectPath blendPath = outPath.getWithExtension(_S(".blend")); + hecl::ProjectPath::Type blendType = blendPath.getPathType(); if (force || - yamlType == HECL::ProjectPath::Type::None || - blendType == HECL::ProjectPath::Type::None) + yamlType == hecl::ProjectPath::Type::None || + blendType == hecl::ProjectPath::Type::None) { CHAR aChar; aChar.read(rs); - if (force || yamlType == HECL::ProjectPath::Type::None) + if (force || yamlType == hecl::ProjectPath::Type::None) { - FILE* fp = HECL::Fopen(yamlPath.getAbsolutePath().c_str(), _S("wb")); + FILE* fp = hecl::Fopen(yamlPath.getAbsolutePath().c_str(), _S("wb")); aChar.toYAMLFile(fp); fclose(fp); } - if (force || blendType == HECL::ProjectPath::Type::None) + if (force || blendType == hecl::ProjectPath::Type::None) { - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); DNAANCS::ReadANCSToBlender, CHAR, MaterialSet, DNACMDL::SurfaceHeader_3, 4> (conn, aChar, blendPath, pakRouter, entry, dataSpec, fileChanged, force); } diff --git a/DataSpec/DNAMP3/CINF.hpp b/DataSpec/DNAMP3/CINF.hpp index 2e6421d34..a9a8fd2f2 100644 --- a/DataSpec/DNAMP3/CINF.hpp +++ b/DataSpec/DNAMP3/CINF.hpp @@ -13,7 +13,7 @@ namespace DNAMP3 struct CINF : DNAMP2::CINF { Delete expl; - void sendCINFToBlender(HECL::BlenderConnection::PyOutStream& os, const UniqueID64& cinfId) const + void sendCINFToBlender(hecl::BlenderConnection::PyOutStream& os, const UniqueID64& cinfId) const { os.format("arm = bpy.data.armatures.new('CINF_%016" PRIX64 "')\n" "arm_obj = bpy.data.objects.new(arm.name, arm)\n" diff --git a/DataSpec/DNAMP3/CMDL.hpp b/DataSpec/DNAMP3/CMDL.hpp index b5074fcb9..c2126dc41 100644 --- a/DataSpec/DNAMP3/CMDL.hpp +++ b/DataSpec/DNAMP3/CMDL.hpp @@ -17,11 +17,11 @@ struct CMDL { static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool, - std::function) + std::function) { /* Check for RigPair */ const PAKRouter::RigPair* rp = pakRouter.lookupCMDLRigPair(entry.id); @@ -37,8 +37,8 @@ struct CMDL } /* Do extract */ - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); - if (!conn.createBlend(outPath, HECL::BlenderConnection::BlendType::Mesh)) + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); + if (!conn.createBlend(outPath, hecl::BlenderConnection::BlendType::Mesh)) return false; DNACMDL::ReadCMDLToBlender, MaterialSet, std::pair, DNACMDL::SurfaceHeader_3, 5> (conn, rs, pakRouter, entry, dataSpec, loadRp); diff --git a/DataSpec/DNAMP3/CMDLMaterials.cpp b/DataSpec/DNAMP3/CMDLMaterials.cpp index 2822f7013..496a98ff8 100644 --- a/DataSpec/DNAMP3/CMDLMaterials.cpp +++ b/DataSpec/DNAMP3/CMDLMaterials.cpp @@ -1,6 +1,6 @@ #include "CMDLMaterials.hpp" -using Stream = HECL::BlenderConnection::PyOutStream; +using Stream = hecl::BlenderConnection::PyOutStream; namespace DataSpec { @@ -108,7 +108,7 @@ void MaterialSet::ConstructMaterial(Stream& out, " new_nodetree.links.new(kcolor_nodes[-1][1].outputs[0], final_node.inputs['Alpha'])\n"; } -void Material::SectionPASS::constructNode(HECL::BlenderConnection::PyOutStream& out, +void Material::SectionPASS::constructNode(hecl::BlenderConnection::PyOutStream& out, const PAKRouter& pakRouter, const PAK::Entry& entry, const Material::ISection* prevSection, @@ -121,16 +121,16 @@ void Material::SectionPASS::constructNode(HECL::BlenderConnection::PyOutStream& if (txtrId) { std::string texName = pakRouter.getBestEntryName(txtrId); - const NOD::Node* node; + const nod::Node* node; const PAK::Entry* texEntry = pakRouter.lookupEntry(txtrId, &node); - HECL::ProjectPath txtrPath = pakRouter.getWorking(texEntry); - if (txtrPath.getPathType() == HECL::ProjectPath::Type::None) + hecl::ProjectPath txtrPath = pakRouter.getWorking(texEntry); + if (txtrPath.getPathType() == hecl::ProjectPath::Type::None) { PAKEntryReadStream rs = texEntry->beginReadStream(*node); TXTR::Extract(rs, txtrPath); } - HECL::SystemString resPath = pakRouter.getResourceRelativePath(entry, txtrId); - HECL::SystemUTF8View resPathView(resPath); + hecl::SystemString resPath = pakRouter.getResourceRelativePath(entry, txtrId); + hecl::SystemUTF8View resPathView(resPath); out.format("if '%s' in bpy.data.textures:\n" " image = bpy.data.images['%s']\n" " texture = bpy.data.textures[image.name]\n" @@ -258,7 +258,7 @@ void Material::SectionPASS::constructNode(HECL::BlenderConnection::PyOutStream& out << "gridder.row_break(2)\n"; } -void Material::SectionCLR::constructNode(HECL::BlenderConnection::PyOutStream& out, +void Material::SectionCLR::constructNode(hecl::BlenderConnection::PyOutStream& out, const PAKRouter& pakRouter, const PAK::Entry& entry, const Material::ISection* prevSection, @@ -278,7 +278,7 @@ void Material::SectionCLR::constructNode(HECL::BlenderConnection::PyOutStream& o } } -void Material::SectionINT::constructNode(HECL::BlenderConnection::PyOutStream& out, +void Material::SectionINT::constructNode(hecl::BlenderConnection::PyOutStream& out, const PAKRouter& pakRouter, const PAK::Entry& entry, const Material::ISection* prevSection, diff --git a/DataSpec/DNAMP3/CMDLMaterials.hpp b/DataSpec/DNAMP3/CMDLMaterials.hpp index a3851a522..b4eaf05d7 100644 --- a/DataSpec/DNAMP3/CMDLMaterials.hpp +++ b/DataSpec/DNAMP3/CMDLMaterials.hpp @@ -64,7 +64,7 @@ struct MaterialSet : BigDNA INT = SBIG('INT ') } m_type; ISection(Type type) : m_type(type) {} - virtual void constructNode(HECL::BlenderConnection::PyOutStream& out, + virtual void constructNode(hecl::BlenderConnection::PyOutStream& out, const PAKRouter& pakRouter, const PAK::Entry& entry, const Material::ISection* prevSection, @@ -115,7 +115,7 @@ struct MaterialSet : BigDNA }; Vector uvAnim; - void constructNode(HECL::BlenderConnection::PyOutStream& out, + void constructNode(hecl::BlenderConnection::PyOutStream& out, const PAKRouter& pakRouter, const PAK::Entry& entry, const Material::ISection* prevSection, @@ -136,7 +136,7 @@ struct MaterialSet : BigDNA DNAFourCC subtype; GX::Color color; - void constructNode(HECL::BlenderConnection::PyOutStream& out, + void constructNode(hecl::BlenderConnection::PyOutStream& out, const PAKRouter& pakRouter, const PAK::Entry& entry, const Material::ISection* prevSection, @@ -160,7 +160,7 @@ struct MaterialSet : BigDNA DNAFourCC subtype; Value value; - void constructNode(HECL::BlenderConnection::PyOutStream& out, + void constructNode(hecl::BlenderConnection::PyOutStream& out, const PAKRouter& pakRouter, const PAK::Entry& entry, const Material::ISection* prevSection, @@ -173,7 +173,7 @@ struct MaterialSet : BigDNA { Delete expl; std::unique_ptr section; - void read(Athena::io::IStreamReader& reader) + void read(athena::io::IStreamReader& reader) { DNAFourCC type; type.read(reader); @@ -196,7 +196,7 @@ struct MaterialSet : BigDNA break; } } - void write(Athena::io::IStreamWriter& writer) const + void write(athena::io::IStreamWriter& writer) const { if (!section) return; @@ -209,7 +209,7 @@ struct MaterialSet : BigDNA } }; std::vector sections; - void read(Athena::io::IStreamReader& reader) + void read(athena::io::IStreamReader& reader) { header.read(reader); sections.clear(); @@ -219,7 +219,7 @@ struct MaterialSet : BigDNA } while (sections.back().section); sections.pop_back(); } - void write(Athena::io::IStreamWriter& writer) const + void write(athena::io::IStreamWriter& writer) const { header.write(writer); for (const SectionFactory& section : sections) @@ -236,14 +236,14 @@ struct MaterialSet : BigDNA }; Vector materials; - static void RegisterMaterialProps(HECL::BlenderConnection::PyOutStream& out); - static void ConstructMaterial(HECL::BlenderConnection::PyOutStream& out, + static void RegisterMaterialProps(hecl::BlenderConnection::PyOutStream& out); + static void ConstructMaterial(hecl::BlenderConnection::PyOutStream& out, const PAKRouter& pakRouter, const PAK::Entry& entry, const MaterialSet::Material& material, unsigned groupIdx, unsigned matIdx); - void readToBlender(HECL::BlenderConnection::PyOutStream& os, + void readToBlender(hecl::BlenderConnection::PyOutStream& os, const PAKRouter& pakRouter, const PAKRouter::EntryType& entry, unsigned setIdx) diff --git a/DataSpec/DNAMP3/CSKR.hpp b/DataSpec/DNAMP3/CSKR.hpp index 4f64fc539..e0bd20655 100644 --- a/DataSpec/DNAMP3/CSKR.hpp +++ b/DataSpec/DNAMP3/CSKR.hpp @@ -41,7 +41,7 @@ struct CSKR : BigDNA return mtxBindings.at(idx).mtxs; } - void weightVertex(HECL::BlenderConnection::PyOutStream& os, const CINF& cinf, atInt16 skinIdx) const + void weightVertex(hecl::BlenderConnection::PyOutStream& os, const CINF& cinf, atInt16 skinIdx) const { if (skinIdx < 0) return; diff --git a/DataSpec/DNAMP3/DNAMP3.cpp b/DataSpec/DNAMP3/DNAMP3.cpp index 04ab66d01..e0b9e7cb0 100644 --- a/DataSpec/DNAMP3/DNAMP3.cpp +++ b/DataSpec/DNAMP3/DNAMP3.cpp @@ -14,7 +14,7 @@ namespace DataSpec { namespace DNAMP3 { -LogVisor::LogModule Log("Retro::DNAMP3"); +logvisor::Module Log("urde::DNAMP3"); static bool GetNoShare(const std::string& name) { @@ -25,16 +25,16 @@ static bool GetNoShare(const std::string& name) return true; } -PAKBridge::PAKBridge(HECL::Database::Project& project, - const NOD::Node& node, +PAKBridge::PAKBridge(hecl::Database::Project& project, + const nod::Node& node, bool doExtract) : m_project(project), m_node(node), m_pak(GetNoShare(node.getName())), m_doExtract(doExtract) { - NOD::AthenaPartReadStream rs(node.beginReadStream()); + nod::AthenaPartReadStream rs(node.beginReadStream()); m_pak.read(rs); /* Append Level String */ - std::set uniq; + std::set uniq; for (PAK::Entry& entry : m_pak.m_entries) { if (entry.type == FOURCC('MLVL')) @@ -53,7 +53,7 @@ PAKBridge::PAKBridge(HECL::Database::Project& project, } } bool comma = false; - for (const HECL::SystemString& str : uniq) + for (const hecl::SystemString& str : uniq) { if (comma) m_levelString += _S(", "); @@ -62,12 +62,12 @@ PAKBridge::PAKBridge(HECL::Database::Project& project, } } -static HECL::SystemString LayerName(const std::string& name) +static hecl::SystemString LayerName(const std::string& name) { #if HECL_UCS2 - HECL::SystemString ret = HECL::UTF8ToWide(name); + hecl::SystemString ret = hecl::UTF8ToWide(name); #else - HECL::SystemString ret = name; + hecl::SystemString ret = name; #endif for (auto& ch : ret) if (ch == _S('/') || ch == _S('\\')) @@ -90,7 +90,7 @@ void PAKBridge::build() mlvl.read(rs); } #if HECL_UCS2 - level.name = HECL::UTF8ToWide(m_pak.bestEntryName(entry)); + level.name = hecl::UTF8ToWide(m_pak.bestEntryName(entry)); #else level.name = m_pak.bestEntryName(entry); #endif @@ -103,7 +103,7 @@ void PAKBridge::build() if (worldMapEnt) { PAKEntryReadStream rs = worldMapEnt->beginReadStream(m_node); - rs.seek(8, Athena::Current); + rs.seek(8, athena::Current); atUint32 areaCount = rs.readUint32Big(); mapw.reserve(areaCount); for (atUint32 i=0 ; i; std::unordered_map m_levelDeps; - HECL::SystemString m_levelString; + hecl::SystemString m_levelString; - PAKBridge(HECL::Database::Project& project, - const NOD::Node& node, + PAKBridge(hecl::Database::Project& project, + const nod::Node& node, bool doExtract=true); void build(); static ResExtractor LookupExtractor(const PAK::Entry& entry); inline const std::string& getName() const {return m_node.getName();} - inline HECL::SystemString getLevelString() const {return m_levelString;} + inline hecl::SystemString getLevelString() const {return m_levelString;} using PAKType = PAK; inline const PAKType& getPAK() const {return m_pak;} - inline const NOD::Node& getNode() const {return m_node;} + inline const nod::Node& getNode() const {return m_node;} void addCMDLRigPairs(PAKRouter& pakRouter, std::unordered_map>& addTo) const; diff --git a/DataSpec/DNAMP3/MAPA.hpp b/DataSpec/DNAMP3/MAPA.hpp index 958a37811..787ea361c 100644 --- a/DataSpec/DNAMP3/MAPA.hpp +++ b/DataSpec/DNAMP3/MAPA.hpp @@ -13,15 +13,15 @@ struct MAPA : DNAMAPA::MAPA { static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, - std::function fileChanged) + std::function fileChanged) { MAPA mapa; mapa.read(rs); - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); return DNAMAPA::ReadMAPAToBlender(conn, mapa, outPath, pakRouter, entry, force); } }; diff --git a/DataSpec/DNAMP3/MLVL.hpp b/DataSpec/DNAMP3/MLVL.hpp index 722dcbb18..e75b3cfa1 100644 --- a/DataSpec/DNAMP3/MLVL.hpp +++ b/DataSpec/DNAMP3/MLVL.hpp @@ -80,18 +80,18 @@ struct MLVL : BigYAML static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, - std::function fileChanged) + std::function fileChanged) { MLVL mlvl; mlvl.read(rs); - FILE* fp = HECL::Fopen(outPath.getWithExtension(_S(".yaml"), true).getAbsolutePath().c_str(), _S("wb")); + FILE* fp = hecl::Fopen(outPath.getWithExtension(_S(".yaml"), true).getAbsolutePath().c_str(), _S("wb")); mlvl.toYAMLFile(fp); fclose(fp); - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); return DNAMLVL::ReadMLVLToBlender(conn, mlvl, outPath, pakRouter, entry, force, fileChanged); } diff --git a/DataSpec/DNAMP3/MREA.cpp b/DataSpec/DNAMP3/MREA.cpp index ca98645c5..ef2a67e70 100644 --- a/DataSpec/DNAMP3/MREA.cpp +++ b/DataSpec/DNAMP3/MREA.cpp @@ -1,4 +1,4 @@ -#include +#include #include "MREA.hpp" #include "../DNAMP2/DeafBabe.hpp" #include "../DNACommon/BabeDead.hpp" @@ -8,7 +8,7 @@ namespace DataSpec namespace DNAMP3 { -MREA::StreamReader::StreamReader(Athena::io::IStreamReader& source, +MREA::StreamReader::StreamReader(athena::io::IStreamReader& source, atUint32 blkCount, atUint32 secIdxCount) : DNAMP2::MREA::StreamReader(source) { @@ -35,7 +35,7 @@ MREA::StreamReader::StreamReader(Athena::io::IStreamReader& source, nextBlock(); } -void MREA::StreamReader::writeSecIdxs(Athena::io::IStreamWriter& writer) const +void MREA::StreamReader::writeSecIdxs(athena::io::IStreamWriter& writer) const { for (const std::pair& idx : m_secIdxs) { @@ -44,12 +44,12 @@ void MREA::StreamReader::writeSecIdxs(Athena::io::IStreamWriter& writer) const } } -void MREA::ReadBabeDeadToBlender_3(HECL::BlenderConnection::PyOutStream& os, - Athena::io::IStreamReader& rs) +void MREA::ReadBabeDeadToBlender_3(hecl::BlenderConnection::PyOutStream& os, + athena::io::IStreamReader& rs) { atUint32 bdMagic = rs.readUint32Big(); if (bdMagic != 0xBABEDEAD) - Log.report(LogVisor::FatalError, "invalid BABEDEAD magic"); + Log.report(logvisor::Fatal, "invalid BABEDEAD magic"); os << "bpy.context.scene.render.engine = 'CYCLES'\n" "bpy.context.scene.world.use_nodes = True\n" "bpy.context.scene.render.engine = 'BLENDER_GAME'\n" @@ -68,18 +68,18 @@ void MREA::ReadBabeDeadToBlender_3(HECL::BlenderConnection::PyOutStream& os, bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool force, - std::function) + std::function) { using RigPair = std::pair; RigPair dummy(nullptr, nullptr); /* Rename MREA for consistency */ - HECL::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend")); - if (!force && mreaPath.getPathType() == HECL::ProjectPath::Type::File) + hecl::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend")); + if (!force && mreaPath.getPathType() == hecl::ProjectPath::Type::File) return true; /* Do extract */ @@ -89,7 +89,7 @@ bool MREA::Extract(const SpecBase& dataSpec, /* MREA decompression stream */ StreamReader drs(rs, head.compressedBlockCount, head.secIndexCount); - Athena::io::FileWriter mreaDecompOut(pakRouter.getCooked(&entry).getWithExtension(_S(".decomp")).getAbsolutePath()); + athena::io::FileWriter mreaDecompOut(pakRouter.getCooked(&entry).getWithExtension(_S(".decomp")).getAbsolutePath()); head.write(mreaDecompOut); mreaDecompOut.seekAlign32(); drs.writeDecompInfos(mreaDecompOut); @@ -99,16 +99,16 @@ bool MREA::Extract(const SpecBase& dataSpec, atUint64 decompLen = drs.length(); mreaDecompOut.writeBytes(drs.readBytes(decompLen).get(), decompLen); mreaDecompOut.close(); - drs.seek(0, Athena::Begin); + drs.seek(0, athena::Begin); /* Start up blender connection */ - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); - if (!conn.createBlend(mreaPath, HECL::BlenderConnection::BlendType::Area)) + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); + if (!conn.createBlend(mreaPath, hecl::BlenderConnection::BlendType::Area)) return false; /* Open Py Stream and read sections */ - HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); + hecl::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); os.format("import bpy\n" "import bmesh\n" "from mathutils import Vector\n" @@ -133,7 +133,7 @@ bool MREA::Extract(const SpecBase& dataSpec, atUint64 secStart = drs.position(); matSet.read(drs); matSet.readToBlender(os, pakRouter, entry, 0); - drs.seek(secStart + head.secSizes[0], Athena::Begin); + drs.seek(secStart + head.secSizes[0], athena::Begin); std::vector vertAttribs; DNACMDL::GetVertexAttributes(matSet, vertAttribs); @@ -147,16 +147,16 @@ bool MREA::Extract(const SpecBase& dataSpec, MeshHeader mHeader; secStart = drs.position(); mHeader.read(drs); - drs.seek(secStart + head.secSizes[curSec++], Athena::Begin); + drs.seek(secStart + head.secSizes[curSec++], athena::Begin); /* Surface count from here */ secStart = drs.position(); surfaceCounts.push_back(drs.readUint32Big()); - drs.seek(secStart + head.secSizes[curSec++], Athena::Begin); + drs.seek(secStart + head.secSizes[curSec++], athena::Begin); /* Seek through AROT-relation sections */ - drs.seek(head.secSizes[curSec++], Athena::Current); - drs.seek(head.secSizes[curSec++], Athena::Current); + drs.seek(head.secSizes[curSec++], athena::Current); + drs.seek(head.secSizes[curSec++], athena::Current); } /* Skip though WOBJs */ @@ -167,14 +167,14 @@ bool MREA::Extract(const SpecBase& dataSpec, /* Skip AROT */ if (secIdxIt->first == FOURCC('ROCT')) { - drs.seek(head.secSizes[curSec++], Athena::Current); + drs.seek(head.secSizes[curSec++], athena::Current); ++secIdxIt; } /* Skip AABB */ if (secIdxIt->first == FOURCC('AABB')) { - drs.seek(head.secSizes[curSec++], Athena::Current); + drs.seek(head.secSizes[curSec++], athena::Current); ++secIdxIt; } @@ -193,7 +193,7 @@ bool MREA::Extract(const SpecBase& dataSpec, /* Skip DEPS */ if (secIdxIt->first == FOURCC('DEPS')) { - drs.seek(head.secSizes[curSec++], Athena::Current); + drs.seek(head.secSizes[curSec++], athena::Current); ++secIdxIt; } @@ -201,14 +201,14 @@ bool MREA::Extract(const SpecBase& dataSpec, if (secIdxIt->first == FOURCC('SOBJ')) { for (atUint32 l=0 ; lfirst == FOURCC('SGEN')) { - drs.seek(head.secSizes[curSec++], Athena::Current); + drs.seek(head.secSizes[curSec++], athena::Current); ++secIdxIt; } @@ -220,7 +220,7 @@ bool MREA::Extract(const SpecBase& dataSpec, collision.read(drs); DNAMP2::DeafBabe::BlenderInit(os); collision.sendToBlender(os); - drs.seek(secStart + head.secSizes[curSec++], Athena::Begin); + drs.seek(secStart + head.secSizes[curSec++], athena::Begin); ++secIdxIt; } @@ -229,7 +229,7 @@ bool MREA::Extract(const SpecBase& dataSpec, { secStart = drs.position(); ReadBabeDeadToBlender_3(os, drs); - drs.seek(secStart + head.secSizes[curSec++], Athena::Begin); + drs.seek(secStart + head.secSizes[curSec++], athena::Begin); ++secIdxIt; } @@ -258,7 +258,7 @@ bool MREA::ExtractLayerDeps(PAKEntryReadStream& rs, PAKBridge::Level::Area& area { if (idx.first == FOURCC('DEPS')) { - drs.seek(head.getSecOffset(idx.second), Athena::Begin); + drs.seek(head.getSecOffset(idx.second), athena::Begin); DEPS deps; deps.read(drs); diff --git a/DataSpec/DNAMP3/MREA.hpp b/DataSpec/DNAMP3/MREA.hpp index 3ea60a199..42e36406f 100644 --- a/DataSpec/DNAMP3/MREA.hpp +++ b/DataSpec/DNAMP3/MREA.hpp @@ -16,13 +16,13 @@ struct MREA struct StreamReader : DNAMP2::MREA::StreamReader { std::vector> m_secIdxs; - StreamReader(Athena::io::IStreamReader& source, + StreamReader(athena::io::IStreamReader& source, atUint32 blkCount, atUint32 secIdxCount); std::vector>::const_iterator beginSecIdxs() { return m_secIdxs.begin(); } - void writeSecIdxs(Athena::io::IStreamWriter& writer) const; + void writeSecIdxs(athena::io::IStreamWriter& writer) const; }; struct Header : BigDNA @@ -36,7 +36,7 @@ struct MREA Value secCount; Value compressedBlockCount; Value secIndexCount; - Seek<20, Athena::Current> align1; + Seek<20, athena::Current> align1; Vector secSizes; atUint32 getSecOffset(atUint32 idx) const @@ -111,16 +111,16 @@ struct MREA Value unk13; }; - static void ReadBabeDeadToBlender_3(HECL::BlenderConnection::PyOutStream& os, - Athena::io::IStreamReader& rs); + static void ReadBabeDeadToBlender_3(hecl::BlenderConnection::PyOutStream& os, + athena::io::IStreamReader& rs); static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, - const HECL::ProjectPath& outPath, + const hecl::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool, - std::function); + std::function); static bool ExtractLayerDeps(PAKEntryReadStream& rs, PAKBridge::Level::Area& areaOut); }; diff --git a/DataSpec/DNAMP3/PAK.cpp b/DataSpec/DNAMP3/PAK.cpp index 20ac05a29..1e9e120a7 100644 --- a/DataSpec/DNAMP3/PAK.cpp +++ b/DataSpec/DNAMP3/PAK.cpp @@ -6,19 +6,19 @@ namespace DataSpec namespace DNAMP3 { -const HECL::FourCC CMPD("CMPD"); +const hecl::FourCC CMPD("CMPD"); -void PAK::read(Athena::io::IStreamReader& reader) +void PAK::read(athena::io::IStreamReader& reader) { m_header.read(reader); if (m_header.version != 2) - Log.report(LogVisor::FatalError, "unexpected PAK magic"); + Log.report(logvisor::Fatal, "unexpected PAK magic"); - reader.seek(8, Athena::Current); + reader.seek(8, athena::Current); atUint32 strgSz = reader.readUint32Big(); - reader.seek(4, Athena::Current); + reader.seek(4, athena::Current); atUint32 rshdSz = reader.readUint32Big(); - reader.seek(44, Athena::Current); + reader.seek(44, athena::Current); atUint32 dataOffset = 128 + strgSz + rshdSz; atUint64 strgBase = reader.position(); @@ -30,7 +30,7 @@ void PAK::read(Athena::io::IStreamReader& reader) m_nameEntries.emplace_back(); m_nameEntries.back().read(reader); } - reader.seek(strgBase + strgSz, Athena::Begin); + reader.seek(strgBase + strgSz, athena::Begin); atUint32 count = reader.readUint32Big(); m_entries.clear(); @@ -67,7 +67,7 @@ void PAK::read(Athena::io::IStreamReader& reader) } } } -void PAK::write(Athena::io::IStreamWriter& writer) const +void PAK::write(athena::io::IStreamWriter& writer) const { m_header.write(writer); @@ -93,12 +93,12 @@ void PAK::write(Athena::io::IStreamWriter& writer) const atUint32 dataPad = ((dataSz + 63) & ~63) - dataSz; dataSz += dataPad; writer.writeUint32Big(dataSz); - writer.seek(36, Athena::Current); + writer.seek(36, athena::Current); writer.writeUint32Big((atUint32)m_nameEntries.size()); for (const NameEntry& entry : m_nameEntries) entry.write(writer); - writer.seek(strgPad, Athena::Current); + writer.seek(strgPad, athena::Current); writer.writeUint32Big((atUint32)m_entries.size()); for (const Entry& entry : m_entries) @@ -107,7 +107,7 @@ void PAK::write(Athena::io::IStreamWriter& writer) const copy.offset -= dataOffset; copy.write(writer); } - writer.seek(rshdPad, Athena::Current); + writer.seek(rshdPad, athena::Current); } size_t PAK::binarySize(size_t __isz) const { @@ -136,23 +136,23 @@ size_t PAK::binarySize(size_t __isz) const return __isz; } -std::unique_ptr PAK::Entry::getBuffer(const NOD::Node& pak, atUint64& szOut) const +std::unique_ptr PAK::Entry::getBuffer(const nod::Node& pak, atUint64& szOut) const { if (compressed) { - std::unique_ptr strm = pak.beginReadStream(offset); + std::unique_ptr strm = pak.beginReadStream(offset); struct { - HECL::FourCC magic; + hecl::FourCC magic; atUint32 blockCount; } head; strm->read(&head, 8); if (head.magic != CMPD) { - Log.report(LogVisor::Error, "invalid CMPD block"); + Log.report(logvisor::Error, "invalid CMPD block"); return std::unique_ptr(); } - head.blockCount = HECL::SBig(head.blockCount); + head.blockCount = hecl::SBig(head.blockCount); struct Block { @@ -167,8 +167,8 @@ std::unique_ptr PAK::Entry::getBuffer(const NOD::Node& pak, atUint64& for (atUint32 b=0 ; b maxBlockSz) maxBlockSz = block.compSz; totalDecompSz += block.decompSz; @@ -192,7 +192,7 @@ std::unique_ptr PAK::Entry::getBuffer(const NOD::Node& pak, atUint64& atUint32 rem = block.decompSz; while (rem) { - atUint16 chunkSz = HECL::SBig(*(atUint16*)compBufCur); + atUint16 chunkSz = hecl::SBig(*(atUint16*)compBufCur); compBufCur += 2; lzo_uint dsz = rem; lzo1x_decompress(compBufCur, chunkSz, bufCur, &dsz, nullptr); diff --git a/DataSpec/DNAMP3/PAK.hpp b/DataSpec/DNAMP3/PAK.hpp index 1f2992162..597cf9eff 100644 --- a/DataSpec/DNAMP3/PAK.hpp +++ b/DataSpec/DNAMP3/PAK.hpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include "../DNACommon/PAK.hpp" namespace DataSpec @@ -12,7 +12,7 @@ namespace DataSpec namespace DNAMP3 { -extern const HECL::FourCC CMPD; +extern const hecl::FourCC CMPD; struct PAK : BigDNA { @@ -25,7 +25,7 @@ struct PAK : BigDNA Value version; Value headSz; Value md5sum[16]; - Seek<40, Athena::Current> seek; + Seek<40, athena::Current> seek; } m_header; struct NameEntry : BigDNA @@ -47,8 +47,8 @@ struct PAK : BigDNA UniqueResult unique; std::string name; - std::unique_ptr getBuffer(const NOD::Node& pak, atUint64& szOut) const; - inline PAKEntryReadStream beginReadStream(const NOD::Node& pak, atUint64 off=0) const + std::unique_ptr getBuffer(const nod::Node& pak, atUint64& szOut) const; + inline PAKEntryReadStream beginReadStream(const nod::Node& pak, atUint64 off=0) const { atUint64 sz; std::unique_ptr buf = getBuffer(pak, sz); diff --git a/DataSpec/DNAMP3/STRG.cpp b/DataSpec/DNAMP3/STRG.cpp index eda6c95b7..9e3a8adcc 100644 --- a/DataSpec/DNAMP3/STRG.cpp +++ b/DataSpec/DNAMP3/STRG.cpp @@ -6,7 +6,7 @@ namespace DataSpec namespace DNAMP3 { -void STRG::_read(Athena::io::IStreamReader& reader) +void STRG::_read(athena::io::IStreamReader& reader) { atUint32 langCount = reader.readUint32Big(); atUint32 strCount = reader.readUint32Big(); @@ -24,8 +24,8 @@ void STRG::_read(Athena::io::IStreamReader& reader) }* nameIndex = (NameIdxEntry*)nameTableBuf.get(); for (atUint32 n=0 ; n strs; for (atUint32 s=0 ; sm_type == YAML_MAPPING_NODE) @@ -98,12 +98,12 @@ void STRG::read(Athena::io::YAMLDocReader& reader) continue; if (lang.first.size() != 4) { - Log.report(LogVisor::Warning, "STRG language string '%s' must be exactly 4 characters; skipping", lang.first.c_str()); + Log.report(logvisor::Warning, "STRG language string '%s' must be exactly 4 characters; skipping", lang.first.c_str()); return; } if (lang.second->m_type != YAML_SEQUENCE_NODE) { - Log.report(LogVisor::Warning, + Log.report(logvisor::Warning, "STRG language string '%s' must contain a sequence; skipping", lang.first.c_str()); return; } @@ -111,7 +111,7 @@ void STRG::read(Athena::io::YAMLDocReader& reader) { if (str->m_type != YAML_SCALAR_NODE) { - Log.report(LogVisor::Warning, "STRG language '%s' must contain all scalars; skipping", lang.first.c_str()); + Log.report(logvisor::Warning, "STRG language '%s' must contain all scalars; skipping", lang.first.c_str()); return; } } @@ -119,16 +119,16 @@ void STRG::read(Athena::io::YAMLDocReader& reader) } else { - Log.report(LogVisor::Warning, "STRG must have a mapping root node; skipping"); + Log.report(logvisor::Warning, "STRG must have a mapping root node; skipping"); return; } - const Athena::io::YAMLNode* nameYAML = root->findMapChild("names"); + const athena::io::YAMLNode* nameYAML = root->findMapChild("names"); names.clear(); if (nameYAML && nameYAML->m_type == YAML_MAPPING_NODE) for (const auto& item : nameYAML->m_mapChildren) if (item.second->m_type == YAML_SCALAR_NODE) - names[item.first] = Athena::io::NodeToVal(item.second.get()); + names[item.first] = athena::io::NodeToVal(item.second.get()); langs.clear(); langs.reserve(root->m_mapChildren.size()); @@ -151,7 +151,7 @@ void STRG::read(Athena::io::YAMLDocReader& reader) langMap.emplace(item.first, &item.second); } -void STRG::write(Athena::io::IStreamWriter& writer) const +void STRG::write(athena::io::IStreamWriter& writer) const { writer.writeUint32Big(0x87654321); writer.writeUint32Big(3); @@ -243,7 +243,7 @@ size_t STRG::binarySize(size_t __isz) const return __isz; } -void STRG::write(Athena::io::YAMLDocWriter& writer) const +void STRG::write(athena::io::YAMLDocWriter& writer) const { for (const auto& item : langs) { @@ -268,7 +268,7 @@ void STRG::write(Athena::io::YAMLDocWriter& writer) const const char* STRG::DNAType() { - return "Retro::DNAMP3::STRG"; + return "urde::DNAMP3::STRG"; } } diff --git a/DataSpec/DNAMP3/STRG.hpp b/DataSpec/DNAMP3/STRG.hpp index 4317dc472..ec84f7d8b 100644 --- a/DataSpec/DNAMP3/STRG.hpp +++ b/DataSpec/DNAMP3/STRG.hpp @@ -14,7 +14,7 @@ struct STRG : ISTRG { DECL_YAML Delete expl; - void _read(Athena::io::IStreamReader& reader); + void _read(athena::io::IStreamReader& reader); std::vector>> langs; std::unordered_map*> langMap; std::map names; @@ -49,37 +49,37 @@ struct STRG : ISTRG { auto search = langMap.find(lang); if (search != langMap.end()) - return HECL::UTF8ToWide(search->second->at(idx)); + return hecl::UTF8ToWide(search->second->at(idx)); return std::wstring(); } - inline HECL::SystemString getSystemString(const FourCC& lang, size_t idx) const + inline hecl::SystemString getSystemString(const FourCC& lang, size_t idx) const { auto search = langMap.find(lang); if (search != langMap.end()) #if HECL_UCS2 - return HECL::UTF8ToWide(search->second->at(idx)); + return hecl::UTF8ToWide(search->second->at(idx)); #else return search->second->at(idx); #endif - return HECL::SystemString(); + return hecl::SystemString(); } - static bool Extract(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath) + static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) { std::unique_ptr strg = LoadSTRG(rs); - FILE* fp = HECL::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); + FILE* fp = hecl::Fopen(outPath.getAbsolutePath().c_str(), _S("wb")); strg->toYAMLFile(fp); fclose(fp); return true; } - static bool Cook(const HECL::ProjectPath& inPath, const HECL::ProjectPath& outPath) + static bool Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) { STRG strg; - FILE* fp = HECL::Fopen(inPath.getAbsolutePath().c_str(), _S("rb")); + FILE* fp = hecl::Fopen(inPath.getAbsolutePath().c_str(), _S("rb")); strg.fromYAMLFile(fp); fclose(fp); - Athena::io::FileWriter ws(outPath.getAbsolutePath()); + athena::io::FileWriter ws(outPath.getAbsolutePath()); strg.write(ws); return true; } diff --git a/DataSpec/SpecBase.cpp b/DataSpec/SpecBase.cpp index a98f7ccef..062bf9635 100644 --- a/DataSpec/SpecBase.cpp +++ b/DataSpec/SpecBase.cpp @@ -13,9 +13,9 @@ namespace DataSpec { -static LogVisor::LogModule Log("Retro::SpecBase"); +static logvisor::Module Log("urde::SpecBase"); -static const HECL::SystemChar* MomErr[] = +static const hecl::SystemChar* MomErr[] = { _S("Your metroid is in another castle"), _S("HECL is experiencing a PTSD attack"), @@ -31,13 +31,13 @@ static const HECL::SystemChar* MomErr[] = }; constexpr uint32_t MomErrCount = 11; -SpecBase::SpecBase(HECL::Database::Project& project) +SpecBase::SpecBase(hecl::Database::Project& project) : m_project(project), m_masterShader(project.getProjectWorkingPath(), ".hecl/RetroMasterShader.blend") {} bool SpecBase::canExtract(const ExtractPassInfo& info, std::vector& reps) { - m_disc = NOD::OpenDiscFromImage(info.srcpath.c_str(), m_isWii); + m_disc = nod::OpenDiscFromImage(info.srcpath.c_str(), m_isWii); if (!m_disc) return false; const char* gameID = m_disc->getHeader().m_gameID; @@ -51,7 +51,7 @@ bool SpecBase::canExtract(const ExtractPassInfo& info, std::vectorgetHeader().m_gameID[3]; - static const HECL::SystemString regNONE = _S(""); - static const HECL::SystemString regE = _S("NTSC"); - static const HECL::SystemString regJ = _S("NTSC-J"); - static const HECL::SystemString regP = _S("PAL"); - const HECL::SystemString* regstr = ®NONE; + static const hecl::SystemString regNONE = _S(""); + static const hecl::SystemString regE = _S("NTSC"); + static const hecl::SystemString regJ = _S("NTSC-J"); + static const hecl::SystemString regP = _S("PAL"); + const hecl::SystemString* regstr = ®NONE; switch (region) { case 'E': @@ -90,13 +90,13 @@ void SpecBase::doExtract(const ExtractPassInfo& info, FProgress progress) { DataSpec::g_curSpec = this; if (!Blender::BuildMasterShader(m_masterShader)) - Log.report(LogVisor::FatalError, "Unable to build master shader blend"); + Log.report(logvisor::Fatal, "Unable to build master shader blend"); if (m_isWii) { /* Extract update partition for repacking later */ - const HECL::SystemString& target = m_project.getProjectWorkingPath().getAbsolutePath(); - NOD::Partition* update = m_disc->getUpdatePartition(); - NOD::ExtractionContext ctx = {true, info.force, nullptr}; + const hecl::SystemString& target = m_project.getProjectWorkingPath().getAbsolutePath(); + nod::Partition* update = m_disc->getUpdatePartition(); + nod::ExtractionContext ctx = {true, info.force, nullptr}; if (update) { @@ -104,7 +104,7 @@ void SpecBase::doExtract(const ExtractPassInfo& info, FProgress progress) progress(_S("Update Partition"), _S(""), 0, 0.0); const atUint64 nodeCount = update->getFSTRoot().rawEnd() - update->getFSTRoot().rawBegin(); ctx.progressCB = [&](const std::string& name) { - HECL::SystemStringView nameView(name); + hecl::SystemStringView nameView(name); progress(_S("Update Partition"), nameView.sys_str().c_str(), 0, idx / (float)nodeCount); idx++; }; @@ -116,10 +116,10 @@ void SpecBase::doExtract(const ExtractPassInfo& info, FProgress progress) if (!m_standalone) { progress(_S("Trilogy Files"), _S(""), 1, 0.0); - NOD::Partition* data = m_disc->getDataPartition(); - const NOD::Node& root = data->getFSTRoot(); - for (const NOD::Node& child : root) - if (child.getKind() == NOD::Node::Kind::File) + nod::Partition* data = m_disc->getDataPartition(); + const nod::Node& root = data->getFSTRoot(); + for (const nod::Node& child : root) + if (child.getKind() == nod::Node::Kind::File) child.extractToDirectory(target, ctx); progress(_S("Trilogy Files"), _S(""), 1, 1.0); } @@ -127,25 +127,25 @@ void SpecBase::doExtract(const ExtractPassInfo& info, FProgress progress) extractFromDisc(*m_disc, info.force, progress); } -bool SpecBase::canCook(const HECL::ProjectPath& path) +bool SpecBase::canCook(const hecl::ProjectPath& path) { if (!checkPathPrefix(path)) return false; - if (HECL::IsPathBlend(path)) + if (hecl::IsPathBlend(path)) { - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); if (!conn.openBlend(path)) return false; - if (conn.getBlendType() != HECL::BlenderConnection::BlendType::None) + if (conn.getBlendType() != hecl::BlenderConnection::BlendType::None) return true; } - else if (HECL::IsPathPNG(path)) + else if (hecl::IsPathPNG(path)) { return true; } - else if (HECL::IsPathYAML(path)) + else if (hecl::IsPathYAML(path)) { - FILE* fp = HECL::Fopen(path.getAbsolutePath().c_str(), _S("r")); + FILE* fp = hecl::Fopen(path.getAbsolutePath().c_str(), _S("r")); bool retval = validateYAMLDNAType(fp); fclose(fp); return retval; @@ -153,41 +153,41 @@ bool SpecBase::canCook(const HECL::ProjectPath& path) return false; } -void SpecBase::doCook(const HECL::ProjectPath& path, const HECL::ProjectPath& cookedPath, +void SpecBase::doCook(const hecl::ProjectPath& path, const hecl::ProjectPath& cookedPath, bool fast, FCookProgress progress) { DataSpec::g_curSpec = this; - if (HECL::IsPathBlend(path)) + if (hecl::IsPathBlend(path)) { - HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); + hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection(); if (!conn.openBlend(path)) return; switch (conn.getBlendType()) { - case HECL::BlenderConnection::BlendType::Mesh: + case hecl::BlenderConnection::BlendType::Mesh: { - HECL::BlenderConnection::DataStream ds = conn.beginData(); + hecl::BlenderConnection::DataStream ds = conn.beginData(); cookMesh(cookedPath, path, ds, fast, progress); break; } - case HECL::BlenderConnection::BlendType::Actor: + case hecl::BlenderConnection::BlendType::Actor: { - HECL::BlenderConnection::DataStream ds = conn.beginData(); + hecl::BlenderConnection::DataStream ds = conn.beginData(); cookActor(cookedPath, path, ds, fast, progress); break; } - case HECL::BlenderConnection::BlendType::Area: + case hecl::BlenderConnection::BlendType::Area: { - HECL::BlenderConnection::DataStream ds = conn.beginData(); + hecl::BlenderConnection::DataStream ds = conn.beginData(); cookArea(cookedPath, path, ds, fast, progress); break; } default: break; } } - else if (HECL::IsPathYAML(path)) + else if (hecl::IsPathYAML(path)) { - FILE* fp = HECL::Fopen(path.getAbsolutePath().c_str(), _S("r")); + FILE* fp = hecl::Fopen(path.getAbsolutePath().c_str(), _S("r")); cookYAML(cookedPath, path, fp, progress); } } @@ -198,7 +198,7 @@ bool SpecBase::canPackage(const PackagePassInfo& info) } void SpecBase::gatherDependencies(const PackagePassInfo& info, - std::unordered_set& implicitsOut) + std::unordered_set& implicitsOut) { } diff --git a/DataSpec/SpecBase.hpp b/DataSpec/SpecBase.hpp index ea455d2be..6e7d2f301 100644 --- a/DataSpec/SpecBase.hpp +++ b/DataSpec/SpecBase.hpp @@ -3,71 +3,71 @@ #include -#include -#include +#include +#include #include "BlenderConnection.hpp" namespace DataSpec { -struct SpecBase : HECL::Database::IDataSpec +struct SpecBase : hecl::Database::IDataSpec { /* HECL Adaptors */ bool canExtract(const ExtractPassInfo& info, std::vector& reps); void doExtract(const ExtractPassInfo& info, FProgress progress); - bool canCook(const HECL::ProjectPath& path); - void doCook(const HECL::ProjectPath& path, const HECL::ProjectPath& cookedPath, bool fast, FCookProgress progress); + bool canCook(const hecl::ProjectPath& path); + void doCook(const hecl::ProjectPath& path, const hecl::ProjectPath& cookedPath, bool fast, FCookProgress progress); bool canPackage(const PackagePassInfo& info); void gatherDependencies(const PackagePassInfo& info, - std::unordered_set& implicitsOut); + std::unordered_set& implicitsOut); void doPackage(const PackagePassInfo& info); /* Extract handlers */ virtual bool checkStandaloneID(const char* id) const=0; - virtual bool checkFromStandaloneDisc(NOD::DiscBase& disc, - const HECL::SystemString& regstr, - const std::vector& args, + virtual bool checkFromStandaloneDisc(nod::DiscBase& disc, + const hecl::SystemString& regstr, + const std::vector& args, std::vector& reps)=0; - virtual bool checkFromTrilogyDisc(NOD::DiscBase& disc, - const HECL::SystemString& regstr, - const std::vector& args, + virtual bool checkFromTrilogyDisc(nod::DiscBase& disc, + const hecl::SystemString& regstr, + const std::vector& args, std::vector& reps)=0; - virtual bool extractFromDisc(NOD::DiscBase& disc, bool force, + virtual bool extractFromDisc(nod::DiscBase& disc, bool force, FProgress progress)=0; /* Basic path check (game directory matching) */ - virtual bool checkPathPrefix(const HECL::ProjectPath& path)=0; + virtual bool checkPathPrefix(const hecl::ProjectPath& path)=0; /* Pre-cook handlers */ virtual bool validateYAMLDNAType(FILE* fp) const=0; /* Cook handlers */ - using BlendStream = HECL::BlenderConnection::DataStream; + using BlendStream = hecl::BlenderConnection::DataStream; using Mesh = BlendStream::Mesh; using Actor = BlendStream::Actor; - virtual void cookMesh(const HECL::ProjectPath& out, const HECL::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const=0; - virtual void cookActor(const HECL::ProjectPath& out, const HECL::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const=0; - virtual void cookArea(const HECL::ProjectPath& out, const HECL::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const=0; - virtual void cookYAML(const HECL::ProjectPath& out, const HECL::ProjectPath& in, FILE* fin, FCookProgress progress) const=0; + virtual void cookMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const=0; + virtual void cookActor(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const=0; + virtual void cookArea(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const=0; + virtual void cookYAML(const hecl::ProjectPath& out, const hecl::ProjectPath& in, FILE* fin, FCookProgress progress) const=0; - const HECL::ProjectPath& getMasterShaderPath() const {return m_masterShader;} + const hecl::ProjectPath& getMasterShaderPath() const {return m_masterShader;} /* Support functions for resolving paths from IDs */ - virtual HECL::ProjectPath getWorking(class UniqueID32&) {return HECL::ProjectPath();} - virtual HECL::ProjectPath getWorking(class UniqueID64&) {return HECL::ProjectPath();} + virtual hecl::ProjectPath getWorking(class UniqueID32&) {return hecl::ProjectPath();} + virtual hecl::ProjectPath getWorking(class UniqueID64&) {return hecl::ProjectPath();} /* Project accessor */ - HECL::Database::Project& getProject() {return m_project;} + hecl::Database::Project& getProject() {return m_project;} - SpecBase(HECL::Database::Project& project); + SpecBase(hecl::Database::Project& project); protected: - HECL::Database::Project& m_project; - HECL::ProjectPath m_masterShader; + hecl::Database::Project& m_project; + hecl::ProjectPath m_masterShader; private: - std::unique_ptr m_disc; + std::unique_ptr m_disc; bool m_isWii; bool m_standalone; }; diff --git a/DataSpec/SpecMP1.cpp b/DataSpec/SpecMP1.cpp index 3c5cec55e..3d25bc1e0 100644 --- a/DataSpec/SpecMP1.cpp +++ b/DataSpec/SpecMP1.cpp @@ -13,8 +13,8 @@ namespace DataSpec { -static LogVisor::LogModule Log("Retro::SpecMP1"); -extern HECL::Database::DataSpecEntry SpecEntMP1; +static logvisor::Module Log("urde::SpecMP1"); +extern hecl::Database::DataSpecEntry SpecEntMP1; struct SpecMP1 : SpecBase { @@ -25,27 +25,27 @@ struct SpecMP1 : SpecBase return false; } - std::vector m_nonPaks; + std::vector m_nonPaks; std::vector m_paks; - std::map m_orderedPaks; + std::map m_orderedPaks; - HECL::ProjectPath m_workPath; - HECL::ProjectPath m_cookPath; + hecl::ProjectPath m_workPath; + hecl::ProjectPath m_cookPath; PAKRouter m_pakRouter; - SpecMP1(HECL::Database::Project& project) + SpecMP1(hecl::Database::Project& project) : SpecBase(project), m_workPath(project.getProjectWorkingPath(), _S("MP1")), m_cookPath(project.getProjectCookedPath(SpecEntMP1), _S("MP1")), m_pakRouter(*this, m_workPath, m_cookPath) {} - void buildPaks(NOD::Node& root, - const std::vector& args, + void buildPaks(nod::Node& root, + const std::vector& args, ExtractReport& rep) { m_nonPaks.clear(); m_paks.clear(); - for (const NOD::Node& child : root) + for (const nod::Node& child : root) { bool isPak = false; const std::string& name = child.getName(); @@ -67,8 +67,8 @@ struct SpecMP1 : SpecBase good = false; if (!lowerName.compare(0, 7, "metroid")) { - HECL::SystemChar idxChar = lowerName[7]; - for (const HECL::SystemString& arg : args) + hecl::SystemChar idxChar = lowerName[7]; + for (const hecl::SystemString& arg : args) { if (arg.size() == 1 && iswdigit(arg[0])) if (arg[0] == idxChar) @@ -80,10 +80,10 @@ struct SpecMP1 : SpecBase if (!good) { - for (const HECL::SystemString& arg : args) + for (const hecl::SystemString& arg : args) { #if HECL_UCS2 - std::string lowerArg = HECL::WideToUTF8(arg); + std::string lowerArg = hecl::WideToUTF8(arg); #else std::string lowerArg = arg; #endif @@ -116,18 +116,18 @@ struct SpecMP1 : SpecBase continue; rep.childOpts.emplace_back(); ExtractReport& childRep = rep.childOpts.back(); - HECL::SystemStringView nameView(item.first); + hecl::SystemStringView nameView(item.first); childRep.name = nameView; childRep.desc = item.second->getLevelString(); } } - bool checkFromStandaloneDisc(NOD::DiscBase& disc, - const HECL::SystemString& regstr, - const std::vector& args, + bool checkFromStandaloneDisc(nod::DiscBase& disc, + const hecl::SystemString& regstr, + const std::vector& args, std::vector& reps) { - NOD::Partition* partition = disc.getDataPartition(); + nod::Partition* partition = disc.getDataPartition(); std::unique_ptr dolBuf = partition->getDOLBuf(); const char* buildInfo = (char*)memmem(dolBuf.get(), partition->getDOLSize(), "MetroidBuildInfo", 16) + 19; @@ -142,40 +142,40 @@ struct SpecMP1 : SpecBase if (buildInfo) { std::string buildStr(buildInfo); - HECL::SystemStringView buildView(buildStr); + hecl::SystemStringView buildView(buildStr); rep.desc += _S(" (") + buildView + _S(")"); } /* Iterate PAKs and build level options */ - NOD::Node& root = partition->getFSTRoot(); + nod::Node& root = partition->getFSTRoot(); buildPaks(root, args, rep); return true; } - bool checkFromTrilogyDisc(NOD::DiscBase& disc, - const HECL::SystemString& regstr, - const std::vector& args, + bool checkFromTrilogyDisc(nod::DiscBase& disc, + const hecl::SystemString& regstr, + const std::vector& args, std::vector& reps) { - std::vector mp1args; + std::vector mp1args; bool doExtract = false; if (args.size()) { /* Needs filter */ - for (const HECL::SystemString& arg : args) + for (const hecl::SystemString& arg : args) { - HECL::SystemString lowerArg = arg; - HECL::ToLower(lowerArg); + hecl::SystemString lowerArg = arg; + hecl::ToLower(lowerArg); if (!lowerArg.compare(0, 3, _S("mp1"))) { doExtract = true; mp1args.reserve(args.size()); size_t slashPos = arg.find(_S('/')); - if (slashPos == HECL::SystemString::npos) + if (slashPos == hecl::SystemString::npos) slashPos = arg.find(_S('\\')); - if (slashPos != HECL::SystemString::npos) - mp1args.emplace_back(HECL::SystemString(arg.begin() + slashPos + 1, arg.end())); + if (slashPos != hecl::SystemString::npos) + mp1args.emplace_back(hecl::SystemString(arg.begin() + slashPos + 1, arg.end())); } } } @@ -185,9 +185,9 @@ struct SpecMP1 : SpecBase if (!doExtract) return false; - NOD::Partition* partition = disc.getDataPartition(); - NOD::Node& root = partition->getFSTRoot(); - NOD::Node::DirectoryIterator dolIt = root.find("rs5mp1_p.dol"); + nod::Partition* partition = disc.getDataPartition(); + nod::Node& root = partition->getFSTRoot(); + nod::Node::DirectoryIterator dolIt = root.find("rs5mp1_p.dol"); if (dolIt == root.end()) return false; @@ -202,12 +202,12 @@ struct SpecMP1 : SpecBase if (buildInfo) { std::string buildStr(buildInfo); - HECL::SystemStringView buildView(buildStr); + hecl::SystemStringView buildView(buildStr); rep.desc += _S(" (") + buildView + _S(")"); } /* Iterate PAKs and build level options */ - NOD::Node::DirectoryIterator mp1It = root.find("MP1"); + nod::Node::DirectoryIterator mp1It = root.find("MP1"); if (mp1It == root.end()) return false; buildPaks(*mp1It, mp1args, rep); @@ -215,9 +215,9 @@ struct SpecMP1 : SpecBase return true; } - bool extractFromDisc(NOD::DiscBase&, bool force, FProgress progress) + bool extractFromDisc(nod::DiscBase&, bool force, FProgress progress) { - NOD::ExtractionContext ctx = {true, force, nullptr}; + nod::ExtractionContext ctx = {true, force, nullptr}; progress(_S("Indexing PAKs"), _S(""), 2, 0.0); m_pakRouter.build(m_paks, [&progress](float factor) @@ -230,17 +230,17 @@ struct SpecMP1 : SpecBase progress(_S("MP1 Root"), _S(""), 3, 0.0); int prog = 0; ctx.progressCB = [&](const std::string& name) { - HECL::SystemStringView nameView(name); + hecl::SystemStringView nameView(name); progress(_S("MP1 Root"), nameView.sys_str().c_str(), 3, prog / (float)m_nonPaks.size()); }; - for (const NOD::Node* node : m_nonPaks) + for (const nod::Node* node : m_nonPaks) { node->extractToDirectory(m_workPath.getAbsolutePath(), ctx); prog++; } progress(_S("MP1 Root"), _S(""), 3, 1.0); - const HECL::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP1); + const hecl::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP1); cookPath.makeDir(); m_cookPath.makeDir(); @@ -253,11 +253,11 @@ struct SpecMP1 : SpecBase continue; const std::string& name = pak.getName(); - HECL::SystemStringView sysName(name); + hecl::SystemStringView sysName(name); progress(sysName.sys_str().c_str(), _S(""), compIdx, 0.0); m_pakRouter.extractResources(pak, force, - [&progress, &sysName, &compIdx](const HECL::SystemChar* substr, float factor) + [&progress, &sysName, &compIdx](const hecl::SystemChar* substr, float factor) { progress(sysName.sys_str().c_str(), substr, compIdx, factor); }); @@ -267,12 +267,12 @@ struct SpecMP1 : SpecBase return true; } - virtual HECL::ProjectPath getWorking(class UniqueID32& id) + virtual hecl::ProjectPath getWorking(class UniqueID32& id) { return m_pakRouter.getWorking(id); } - bool checkPathPrefix(const HECL::ProjectPath& path) + bool checkPathPrefix(const hecl::ProjectPath& path) { return path.getRelativePath().compare(0, 4, _S("MP1/")) == 0; } @@ -286,41 +286,41 @@ struct SpecMP1 : SpecBase return false; } - void cookMesh(const HECL::ProjectPath& out, const HECL::ProjectPath& in, + void cookMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const { - Mesh mesh = ds.compileMesh(fast ? HECL::HMDLTopology::Triangles : HECL::HMDLTopology::TriStrips, -1, + Mesh mesh = ds.compileMesh(fast ? hecl::HMDLTopology::Triangles : hecl::HMDLTopology::TriStrips, -1, [&progress](int surfCount) { - progress(HECL::SysFormat(_S("%d"), surfCount).c_str()); + progress(hecl::SysFormat(_S("%d"), surfCount).c_str()); }); DNAMP1::CMDL::Cook(out, in, mesh); } - void cookActor(const HECL::ProjectPath& out, const HECL::ProjectPath& in, + void cookActor(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const { Actor actor = ds.compileActor(); DNAMP1::ANCS::Cook(out, in, actor); } - void cookArea(const HECL::ProjectPath& out, const HECL::ProjectPath& in, + void cookArea(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const { } - void cookYAML(const HECL::ProjectPath& out, const HECL::ProjectPath& in, + void cookYAML(const hecl::ProjectPath& out, const hecl::ProjectPath& in, FILE* fin, FCookProgress progress) const { } }; -HECL::Database::DataSpecEntry SpecEntMP1 = +hecl::Database::DataSpecEntry SpecEntMP1 = { _S("MP1"), _S("Data specification for original Metroid Prime engine"), - [](HECL::Database::Project& project, HECL::Database::DataSpecTool) - -> HECL::Database::IDataSpec* {return new struct SpecMP1(project);} + [](hecl::Database::Project& project, hecl::Database::DataSpecTool) + -> hecl::Database::IDataSpec* {return new struct SpecMP1(project);} }; } diff --git a/DataSpec/SpecMP2.cpp b/DataSpec/SpecMP2.cpp index f5a383f36..30a2f4aaa 100644 --- a/DataSpec/SpecMP2.cpp +++ b/DataSpec/SpecMP2.cpp @@ -9,8 +9,8 @@ namespace DataSpec { -static LogVisor::LogModule Log("Retro::SpecMP2"); -extern HECL::Database::DataSpecEntry SpecEntMP2; +static logvisor::Module Log("urde::SpecMP2"); +extern hecl::Database::DataSpecEntry SpecEntMP2; struct SpecMP2 : SpecBase { @@ -21,27 +21,27 @@ struct SpecMP2 : SpecBase return false; } - std::vector m_nonPaks; + std::vector m_nonPaks; std::vector m_paks; - std::map m_orderedPaks; + std::map m_orderedPaks; - HECL::ProjectPath m_workPath; - HECL::ProjectPath m_cookPath; + hecl::ProjectPath m_workPath; + hecl::ProjectPath m_cookPath; PAKRouter m_pakRouter; - SpecMP2(HECL::Database::Project& project) + SpecMP2(hecl::Database::Project& project) : SpecBase(project), m_workPath(project.getProjectWorkingPath(), _S("MP2")), m_cookPath(project.getProjectCookedPath(SpecEntMP2), _S("MP2")), m_pakRouter(*this, m_workPath, m_cookPath) {} - void buildPaks(NOD::Node& root, - const std::vector& args, + void buildPaks(nod::Node& root, + const std::vector& args, ExtractReport& rep) { m_nonPaks.clear(); m_paks.clear(); - for (const NOD::Node& child : root) + for (const nod::Node& child : root) { bool isPak = false; const std::string& name = child.getName(); @@ -63,8 +63,8 @@ struct SpecMP2 : SpecBase good = false; if (!lowerName.compare(0, 7, "metroid")) { - HECL::SystemChar idxChar = lowerName[7]; - for (const HECL::SystemString& arg : args) + hecl::SystemChar idxChar = lowerName[7]; + for (const hecl::SystemString& arg : args) { if (arg.size() == 1 && iswdigit(arg[0])) if (arg[0] == idxChar) @@ -76,10 +76,10 @@ struct SpecMP2 : SpecBase if (!good) { - for (const HECL::SystemString& arg : args) + for (const hecl::SystemString& arg : args) { #if HECL_UCS2 - std::string lowerArg = HECL::WideToUTF8(arg); + std::string lowerArg = hecl::WideToUTF8(arg); #else std::string lowerArg = arg; #endif @@ -110,18 +110,18 @@ struct SpecMP2 : SpecBase continue; rep.childOpts.emplace_back(); ExtractReport& childRep = rep.childOpts.back(); - HECL::SystemStringView nameView(item.first); + hecl::SystemStringView nameView(item.first); childRep.name = nameView; childRep.desc = item.second->getLevelString(); } } - bool checkFromStandaloneDisc(NOD::DiscBase& disc, - const HECL::SystemString& regstr, - const std::vector& args, + bool checkFromStandaloneDisc(nod::DiscBase& disc, + const hecl::SystemString& regstr, + const std::vector& args, std::vector& reps) { - NOD::Partition* partition = disc.getDataPartition(); + nod::Partition* partition = disc.getDataPartition(); std::unique_ptr dolBuf = partition->getDOLBuf(); const char* buildInfo = (char*)memmem(dolBuf.get(), partition->getDOLSize(), "MetroidBuildInfo", 16) + 19; if (!buildInfo) @@ -133,39 +133,39 @@ struct SpecMP2 : SpecBase rep.name = _S("MP2"); rep.desc = _S("Metroid Prime 2 ") + regstr; std::string buildStr(buildInfo); - HECL::SystemStringView buildView(buildStr); + hecl::SystemStringView buildView(buildStr); rep.desc += _S(" (") + buildView + _S(")"); /* Iterate PAKs and build level options */ - NOD::Node& root = partition->getFSTRoot(); + nod::Node& root = partition->getFSTRoot(); buildPaks(root, args, rep); return true; } - bool checkFromTrilogyDisc(NOD::DiscBase& disc, - const HECL::SystemString& regstr, - const std::vector& args, + bool checkFromTrilogyDisc(nod::DiscBase& disc, + const hecl::SystemString& regstr, + const std::vector& args, std::vector& reps) { - std::vector mp2args; + std::vector mp2args; bool doExtract = false; if (args.size()) { /* Needs filter */ - for (const HECL::SystemString& arg : args) + for (const hecl::SystemString& arg : args) { - HECL::SystemString lowerArg = arg; - HECL::ToLower(lowerArg); + hecl::SystemString lowerArg = arg; + hecl::ToLower(lowerArg); if (!lowerArg.compare(0, 3, _S("mp2"))) { doExtract = true; mp2args.reserve(args.size()); size_t slashPos = arg.find(_S('/')); - if (slashPos == HECL::SystemString::npos) + if (slashPos == hecl::SystemString::npos) slashPos = arg.find(_S('\\')); - if (slashPos != HECL::SystemString::npos) - mp2args.emplace_back(HECL::SystemString(arg.begin() + slashPos + 1, arg.end())); + if (slashPos != hecl::SystemString::npos) + mp2args.emplace_back(hecl::SystemString(arg.begin() + slashPos + 1, arg.end())); } } } @@ -175,9 +175,9 @@ struct SpecMP2 : SpecBase if (!doExtract) return false; - NOD::Partition* partition = disc.getDataPartition(); - NOD::Node& root = partition->getFSTRoot(); - NOD::Node::DirectoryIterator dolIt = root.find("rs5mp2_p.dol"); + nod::Partition* partition = disc.getDataPartition(); + nod::Node& root = partition->getFSTRoot(); + nod::Node::DirectoryIterator dolIt = root.find("rs5mp2_p.dol"); if (dolIt == root.end()) return false; @@ -192,12 +192,12 @@ struct SpecMP2 : SpecBase if (buildInfo) { std::string buildStr(buildInfo); - HECL::SystemStringView buildView(buildStr); + hecl::SystemStringView buildView(buildStr); rep.desc += _S(" (") + buildView + _S(")"); } /* Iterate PAKs and build level options */ - NOD::Node::DirectoryIterator mp2It = root.find("MP2"); + nod::Node::DirectoryIterator mp2It = root.find("MP2"); if (mp2It == root.end()) return false; buildPaks(*mp2It, mp2args, rep); @@ -205,9 +205,9 @@ struct SpecMP2 : SpecBase return true; } - bool extractFromDisc(NOD::DiscBase&, bool force, FProgress progress) + bool extractFromDisc(nod::DiscBase&, bool force, FProgress progress) { - NOD::ExtractionContext ctx = {true, force, nullptr}; + nod::ExtractionContext ctx = {true, force, nullptr}; progress(_S("Indexing PAKs"), _S(""), 2, 0.0); m_pakRouter.build(m_paks, [&progress](float factor) @@ -220,17 +220,17 @@ struct SpecMP2 : SpecBase progress(_S("MP2 Root"), _S(""), 3, 0.0); int prog = 0; ctx.progressCB = [&](const std::string& name) { - HECL::SystemStringView nameView(name); + hecl::SystemStringView nameView(name); progress(_S("MP2 Root"), nameView.sys_str().c_str(), 3, prog / (float)m_nonPaks.size()); }; - for (const NOD::Node* node : m_nonPaks) + for (const nod::Node* node : m_nonPaks) { node->extractToDirectory(m_workPath.getAbsolutePath(), ctx); prog++; } progress(_S("MP2 Root"), _S(""), 3, 1.0); - const HECL::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP2); + const hecl::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP2); cookPath.makeDir(); m_cookPath.makeDir(); @@ -243,11 +243,11 @@ struct SpecMP2 : SpecBase continue; const std::string& name = pak.getName(); - HECL::SystemStringView sysName(name); + hecl::SystemStringView sysName(name); progress(sysName.sys_str().c_str(), _S(""), compIdx, 0.0); m_pakRouter.extractResources(pak, force, - [&progress, &sysName, &compIdx](const HECL::SystemChar* substr, float factor) + [&progress, &sysName, &compIdx](const hecl::SystemChar* substr, float factor) { progress(sysName.sys_str().c_str(), substr, compIdx, factor); }); @@ -257,12 +257,12 @@ struct SpecMP2 : SpecBase return true; } - virtual HECL::ProjectPath getWorking(class UniqueID32& id) + virtual hecl::ProjectPath getWorking(class UniqueID32& id) { return m_pakRouter.getWorking(id); } - bool checkPathPrefix(const HECL::ProjectPath& path) + bool checkPathPrefix(const hecl::ProjectPath& path) { return path.getRelativePath().compare(0, 4, _S("MP2/")) == 0; } @@ -276,33 +276,33 @@ struct SpecMP2 : SpecBase return false; } - void cookMesh(const HECL::ProjectPath& out, const HECL::ProjectPath& in, + void cookMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const { } - void cookActor(const HECL::ProjectPath& out, const HECL::ProjectPath& in, + void cookActor(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const { } - void cookArea(const HECL::ProjectPath& out, const HECL::ProjectPath& in, + void cookArea(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const { } - void cookYAML(const HECL::ProjectPath& out, const HECL::ProjectPath& in, + void cookYAML(const hecl::ProjectPath& out, const hecl::ProjectPath& in, FILE* fin, FCookProgress progress) const { } }; -HECL::Database::DataSpecEntry SpecEntMP2 +hecl::Database::DataSpecEntry SpecEntMP2 ( _S("MP2"), _S("Data specification for original Metroid Prime 2 engine"), - [](HECL::Database::Project& project, HECL::Database::DataSpecTool) - -> HECL::Database::IDataSpec* {return new struct SpecMP2(project);} + [](hecl::Database::Project& project, hecl::Database::DataSpecTool) + -> hecl::Database::IDataSpec* {return new struct SpecMP2(project);} ); } diff --git a/DataSpec/SpecMP3.cpp b/DataSpec/SpecMP3.cpp index 1a60683e2..74dee569e 100644 --- a/DataSpec/SpecMP3.cpp +++ b/DataSpec/SpecMP3.cpp @@ -11,8 +11,8 @@ namespace DataSpec { -static LogVisor::LogModule Log("Retro::SpecMP3"); -extern HECL::Database::DataSpecEntry SpecEntMP3; +static logvisor::Module Log("urde::SpecMP3"); +extern hecl::Database::DataSpecEntry SpecEntMP3; struct SpecMP3 : SpecBase { @@ -24,25 +24,25 @@ struct SpecMP3 : SpecBase } bool doMP3 = false; - std::vector m_nonPaks; + std::vector m_nonPaks; std::vector m_paks; - std::map m_orderedPaks; + std::map m_orderedPaks; - HECL::ProjectPath m_workPath; - HECL::ProjectPath m_cookPath; + hecl::ProjectPath m_workPath; + hecl::ProjectPath m_cookPath; PAKRouter m_pakRouter; /* These are populated when extracting MPT's frontend (uses MP3's DataSpec) */ bool doMPTFE = false; - std::vector m_feNonPaks; + std::vector m_feNonPaks; std::vector m_fePaks; - std::map m_feOrderedPaks; + std::map m_feOrderedPaks; - HECL::ProjectPath m_feWorkPath; - HECL::ProjectPath m_feCookPath; + hecl::ProjectPath m_feWorkPath; + hecl::ProjectPath m_feCookPath; PAKRouter m_fePakRouter; - SpecMP3(HECL::Database::Project& project) + SpecMP3(hecl::Database::Project& project) : SpecBase(project), m_workPath(project.getProjectWorkingPath(), _S("MP3")), m_cookPath(project.getProjectCookedPath(SpecEntMP3), _S("MP3")), @@ -51,8 +51,8 @@ struct SpecMP3 : SpecBase m_feCookPath(project.getProjectCookedPath(SpecEntMP3), _S("fe")), m_fePakRouter(*this, m_feWorkPath, m_feCookPath) {} - void buildPaks(NOD::Node& root, - const std::vector& args, + void buildPaks(nod::Node& root, + const std::vector& args, ExtractReport& rep, bool fe) { @@ -66,7 +66,7 @@ struct SpecMP3 : SpecBase m_nonPaks.clear(); m_paks.clear(); } - for (const NOD::Node& child : root) + for (const nod::Node& child : root) { bool isPak = false; const std::string& name = child.getName(); @@ -88,8 +88,8 @@ struct SpecMP3 : SpecBase good = false; if (!lowerName.compare(0, 7, "metroid")) { - HECL::SystemChar idxChar = lowerName[7]; - for (const HECL::SystemString& arg : args) + hecl::SystemChar idxChar = lowerName[7]; + for (const hecl::SystemString& arg : args) { if (arg.size() == 1 && iswdigit(arg[0])) if (arg[0] == idxChar) @@ -101,10 +101,10 @@ struct SpecMP3 : SpecBase if (!good) { - for (const HECL::SystemString& arg : args) + for (const hecl::SystemString& arg : args) { #if HECL_UCS2 - std::string lowerArg = HECL::WideToUTF8(arg); + std::string lowerArg = hecl::WideToUTF8(arg); #else std::string lowerArg = arg; #endif @@ -152,7 +152,7 @@ struct SpecMP3 : SpecBase continue; rep.childOpts.emplace_back(); ExtractReport& childRep = rep.childOpts.back(); - HECL::SystemStringView nameView(item.first); + hecl::SystemStringView nameView(item.first); childRep.name = nameView; if (!item.first.compare("Worlds.pak")) continue; @@ -172,13 +172,13 @@ struct SpecMP3 : SpecBase } } - bool checkFromStandaloneDisc(NOD::DiscBase& disc, - const HECL::SystemString& regstr, - const std::vector& args, + bool checkFromStandaloneDisc(nod::DiscBase& disc, + const hecl::SystemString& regstr, + const std::vector& args, std::vector& reps) { doMP3 = true; - NOD::Partition* partition = disc.getDataPartition(); + nod::Partition* partition = disc.getDataPartition(); std::unique_ptr dolBuf = partition->getDOLBuf(); const char* buildInfo = (char*)memmem(dolBuf.get(), partition->getDOLSize(), "MetroidBuildInfo", 16) + 19; if (!buildInfo) @@ -194,55 +194,55 @@ struct SpecMP3 : SpecBase rep.name = _S("MP3"); rep.desc = _S("Metroid Prime 3 ") + regstr; std::string buildStr(buildInfo); - HECL::SystemStringView buildView(buildStr); + hecl::SystemStringView buildView(buildStr); rep.desc += _S(" (") + buildView + _S(")"); /* Iterate PAKs and build level options */ - NOD::Node& root = partition->getFSTRoot(); + nod::Node& root = partition->getFSTRoot(); buildPaks(root, args, rep, false); return true; } - bool checkFromTrilogyDisc(NOD::DiscBase& disc, - const HECL::SystemString& regstr, - const std::vector& args, + bool checkFromTrilogyDisc(nod::DiscBase& disc, + const hecl::SystemString& regstr, + const std::vector& args, std::vector& reps) { - std::vector mp3args; - std::vector feargs; + std::vector mp3args; + std::vector feargs; if (args.size()) { /* Needs filter */ - for (const HECL::SystemString& arg : args) + for (const hecl::SystemString& arg : args) { - HECL::SystemString lowerArg = arg; - HECL::ToLower(lowerArg); + hecl::SystemString lowerArg = arg; + hecl::ToLower(lowerArg); if (!lowerArg.compare(0, 3, _S("mp3"))) { doMP3 = true; mp3args.reserve(args.size()); size_t slashPos = arg.find(_S('/')); - if (slashPos == HECL::SystemString::npos) + if (slashPos == hecl::SystemString::npos) slashPos = arg.find(_S('\\')); - if (slashPos != HECL::SystemString::npos) - mp3args.emplace_back(HECL::SystemString(arg.begin() + slashPos + 1, arg.end())); + if (slashPos != hecl::SystemString::npos) + mp3args.emplace_back(hecl::SystemString(arg.begin() + slashPos + 1, arg.end())); } } - for (const HECL::SystemString& arg : args) + for (const hecl::SystemString& arg : args) { - HECL::SystemString lowerArg = arg; - HECL::ToLower(lowerArg); + hecl::SystemString lowerArg = arg; + hecl::ToLower(lowerArg); if (!lowerArg.compare(0, 2, _S("fe"))) { doMPTFE = true; feargs.reserve(args.size()); size_t slashPos = arg.find(_S('/')); - if (slashPos == HECL::SystemString::npos) + if (slashPos == hecl::SystemString::npos) slashPos = arg.find(_S('\\')); - if (slashPos != HECL::SystemString::npos) - feargs.emplace_back(HECL::SystemString(arg.begin() + slashPos + 1, arg.end())); + if (slashPos != hecl::SystemString::npos) + feargs.emplace_back(hecl::SystemString(arg.begin() + slashPos + 1, arg.end())); } } } @@ -255,13 +255,13 @@ struct SpecMP3 : SpecBase if (!doMP3 && !doMPTFE) return false; - NOD::Partition* partition = disc.getDataPartition(); - NOD::Node& root = partition->getFSTRoot(); + nod::Partition* partition = disc.getDataPartition(); + nod::Node& root = partition->getFSTRoot(); /* MP3 extract */ if (doMP3) { - NOD::Node::DirectoryIterator dolIt = root.find("rs5mp3_p.dol"); + nod::Node::DirectoryIterator dolIt = root.find("rs5mp3_p.dol"); if (dolIt == root.end()) return false; @@ -282,12 +282,12 @@ struct SpecMP3 : SpecBase rep.desc = _S("Metroid Prime 3 ") + regstr; std::string buildStr(buildInfo); - HECL::SystemStringView buildView(buildStr); + hecl::SystemStringView buildView(buildStr); rep.desc += _S(" (") + buildView + _S(")"); /* Iterate PAKs and build level options */ - NOD::Node::DirectoryIterator mp3It = root.find("MP3"); + nod::Node::DirectoryIterator mp3It = root.find("MP3"); if (mp3It == root.end()) return false; buildPaks(*mp3It, mp3args, rep, false); @@ -296,7 +296,7 @@ struct SpecMP3 : SpecBase /* MPT Frontend extract */ if (doMPTFE) { - NOD::Node::DirectoryIterator dolIt = root.find("rs5fe_p.dol"); + nod::Node::DirectoryIterator dolIt = root.find("rs5fe_p.dol"); if (dolIt == root.end()) return false; @@ -311,12 +311,12 @@ struct SpecMP3 : SpecBase if (buildInfo) { std::string buildStr(buildInfo); - HECL::SystemStringView buildView(buildStr); + hecl::SystemStringView buildView(buildStr); rep.desc += _S(" (") + buildView + _S(")"); } /* Iterate PAKs and build level options */ - NOD::Node::DirectoryIterator feIt = root.find("fe"); + nod::Node::DirectoryIterator feIt = root.find("fe"); if (feIt == root.end()) return false; buildPaks(*feIt, feargs, rep, true); @@ -325,16 +325,16 @@ struct SpecMP3 : SpecBase return true; } - bool extractFromDisc(NOD::DiscBase&, bool force, FProgress progress) + bool extractFromDisc(nod::DiscBase&, bool force, FProgress progress) { int compIdx = 2; - HECL::SystemString currentTarget = _S(""); + hecl::SystemString currentTarget = _S(""); size_t nodeCount = 0; int prog = 0; - NOD::ExtractionContext ctx = {true, force, + nod::ExtractionContext ctx = {true, force, [&](const std::string& name) { - HECL::SystemStringView nameView(name); + hecl::SystemStringView nameView(name); progress(currentTarget.c_str(), nameView.sys_str().c_str(), compIdx, prog / (float)nodeCount); }}; if (doMP3) @@ -346,7 +346,7 @@ struct SpecMP3 : SpecBase }); progress(_S("Indexing PAKs"), _S(""), compIdx++, 1.0); - HECL::ProjectPath mp3WorkPath(m_project.getProjectWorkingPath(), "MP3"); + hecl::ProjectPath mp3WorkPath(m_project.getProjectWorkingPath(), "MP3"); mp3WorkPath.makeDir(); currentTarget = _S("MP3 Root"); progress(currentTarget.c_str(), _S(""), compIdx, 0.0); @@ -354,7 +354,7 @@ struct SpecMP3 : SpecBase nodeCount = m_nonPaks.size(); // TODO: Make this more granular - for (const NOD::Node* node : m_nonPaks) + for (const nod::Node* node : m_nonPaks) { node->extractToDirectory(mp3WorkPath.getAbsolutePath(), ctx); prog++; @@ -363,9 +363,9 @@ struct SpecMP3 : SpecBase progress(currentTarget.c_str(), _S(""), compIdx++, 1.0); - const HECL::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP3); + const hecl::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP3); cookPath.makeDir(); - HECL::ProjectPath mp3CookPath(cookPath, "MP3"); + hecl::ProjectPath mp3CookPath(cookPath, "MP3"); mp3CookPath.makeDir(); prog = 0; @@ -376,11 +376,11 @@ struct SpecMP3 : SpecBase continue; const std::string& name = pak.getName(); - HECL::SystemStringView sysName(name); + hecl::SystemStringView sysName(name); progress(sysName.sys_str().c_str(), _S(""), compIdx, 0.0); m_pakRouter.extractResources(pak, force, - [&progress, &sysName, &compIdx](const HECL::SystemChar* substr, float factor) + [&progress, &sysName, &compIdx](const hecl::SystemChar* substr, float factor) { progress(sysName.sys_str().c_str(), substr, compIdx, factor); }); @@ -404,14 +404,14 @@ struct SpecMP3 : SpecBase nodeCount = m_feNonPaks.size(); // TODO: Make this more granular - for (const NOD::Node* node : m_feNonPaks) + for (const nod::Node* node : m_feNonPaks) { node->extractToDirectory(m_feWorkPath.getAbsolutePath(), ctx); prog++; } progress(currentTarget.c_str(), _S(""), compIdx++, 1.0); - const HECL::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP3); + const hecl::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP3); cookPath.makeDir(); m_feCookPath.makeDir(); @@ -423,11 +423,11 @@ struct SpecMP3 : SpecBase continue; const std::string& name = pak.getName(); - HECL::SystemStringView sysName(name); + hecl::SystemStringView sysName(name); progress(sysName.sys_str().c_str(), _S(""), compIdx, 0.0); m_fePakRouter.extractResources(pak, force, - [&progress, &sysName, &compIdx](const HECL::SystemChar* substr, float factor) + [&progress, &sysName, &compIdx](const hecl::SystemChar* substr, float factor) { progress(sysName.sys_str().c_str(), substr, compIdx, factor); }); @@ -437,12 +437,12 @@ struct SpecMP3 : SpecBase return true; } - virtual HECL::ProjectPath getWorking(class UniqueID64& id) + virtual hecl::ProjectPath getWorking(class UniqueID64& id) { return m_pakRouter.getWorking(id); } - bool checkPathPrefix(const HECL::ProjectPath& path) + bool checkPathPrefix(const hecl::ProjectPath& path) { return path.getRelativePath().compare(0, 4, _S("MP3/")) == 0; } @@ -458,33 +458,33 @@ struct SpecMP3 : SpecBase return false; } - void cookMesh(const HECL::ProjectPath& out, const HECL::ProjectPath& in, + void cookMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const { } - void cookActor(const HECL::ProjectPath& out, const HECL::ProjectPath& in, + void cookActor(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const { } - void cookArea(const HECL::ProjectPath& out, const HECL::ProjectPath& in, + void cookArea(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast, FCookProgress progress) const { } - void cookYAML(const HECL::ProjectPath& out, const HECL::ProjectPath& in, + void cookYAML(const hecl::ProjectPath& out, const hecl::ProjectPath& in, FILE* fin, FCookProgress progress) const { } }; -HECL::Database::DataSpecEntry SpecEntMP3 +hecl::Database::DataSpecEntry SpecEntMP3 ( _S("MP3"), _S("Data specification for original Metroid Prime 3 engine"), - [](HECL::Database::Project& project, HECL::Database::DataSpecTool) - -> HECL::Database::IDataSpec* {return new struct SpecMP3(project);} + [](hecl::Database::Project& project, hecl::Database::DataSpecTool) + -> hecl::Database::IDataSpec* {return new struct SpecMP3(project);} ); } diff --git a/Editor/CMakeLists.txt b/Editor/CMakeLists.txt index 2f3229c20..abd1bcf28 100644 --- a/Editor/CMakeLists.txt +++ b/Editor/CMakeLists.txt @@ -57,9 +57,9 @@ target_link_libraries(urde RuntimeCommonGraphics RuntimeCommon DNAMP3 DNAMP2 DNAMP1 - DNACommon Specter SpecterFonts freetype ${DATA_SPEC_LIBS} - HECLDatabase HECLBackend HECLFrontend HECLBlender HECLRuntime HECLCommon AthenaCore NOD - LogVisor AthenaLibYaml Boo ${PNG_LIB} squish xxhash Math + DNACommon specter specter-fonts freetype ${DATA_SPEC_LIBS} + hecl-database hecl-backend hecl-frontend hecl-blender hecl-runtime hecl-common athena-core nod + logvisor AthenaLibYaml boo ${PNG_LIB} squish xxhash zeus ${ZLIB_LIBRARIES} ${LZO_LIB} ${BOO_SYS_LIBS}) diff --git a/Editor/Camera.hpp b/Editor/Camera.hpp index 6cf947aaa..d8bd33894 100644 --- a/Editor/Camera.hpp +++ b/Editor/Camera.hpp @@ -1,26 +1,26 @@ #ifndef URDE_CAMERA_HPP #define URDE_CAMERA_HPP -#include -#include -#include -#include -#include +#include "zeus/CProjection.hpp" +#include "zeus/CFrustum.hpp" +#include "zeus/CQuaternion.hpp" +#include "zeus/CVector3f.hpp" +#include "zeus/Math.hpp" namespace URDE { class Camera { - Zeus::CFrustum m_frustum; - Zeus::CProjection m_projection; - Zeus::CVector3f m_position; - Zeus::CQuaternion m_orientation; + zeus::CFrustum m_frustum; + zeus::CProjection m_projection; + zeus::CVector3f m_position; + zeus::CQuaternion m_orientation; public: - void setPosition(const Zeus::CVector3f& position) { m_position = position; } - void setOrientation(const Zeus::CQuaternion& orientation) { m_orientation = orientation; } + void setPosition(const zeus::CVector3f& position) { m_position = position; } + void setOrientation(const zeus::CQuaternion& orientation) { m_orientation = orientation; } - const Zeus::CMatrix4f& projectionMatrix() const { return m_projection.getCachedMatrix(); } - const Zeus::CProjection& projection() const { return m_projection; } + const zeus::CMatrix4f& projectionMatrix() const { return m_projection.getCachedMatrix(); } + const zeus::CProjection& projection() const { return m_projection; } virtual void think() {} diff --git a/Editor/InformationCenter.hpp b/Editor/InformationCenter.hpp index f15e735c8..7a27c4592 100644 --- a/Editor/InformationCenter.hpp +++ b/Editor/InformationCenter.hpp @@ -16,13 +16,13 @@ class InformationCenter : public ViewerSpace const Space::State& spaceState() const { return m_state; } - struct View : Specter::View + struct View : specter::View { InformationCenter& m_ic; - std::vector m_log; + std::vector m_log; - View(InformationCenter& ic, Specter::ViewResources& res) - : Specter::View(res, ic.m_vm.rootView()), m_ic(ic) + View(InformationCenter& ic, specter::ViewResources& res) + : specter::View(res, ic.m_vm.rootView()), m_ic(ic) { commitResources(res); } @@ -55,7 +55,7 @@ public: { } - virtual Specter::View* buildContentView(Specter::ViewResources& res) + virtual specter::View* buildContentView(specter::ViewResources& res) { m_view.reset(new View(*this, res)); return m_view.get(); diff --git a/Editor/ModelViewer.cpp b/Editor/ModelViewer.cpp index 2b19d1b4f..9e7f27c6e 100644 --- a/Editor/ModelViewer.cpp +++ b/Editor/ModelViewer.cpp @@ -5,7 +5,7 @@ namespace URDE void ModelViewer::View::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) { - Specter::View::resized(root, sub); + specter::View::resized(root, sub); m_scissorRect = sub; } @@ -13,10 +13,10 @@ void ModelViewer::View::draw(boo::IGraphicsCommandQueue* gfxQ) { gfxQ->setScissor(m_scissorRect); m_mv.m_lineRenderer->Reset(); - m_mv.m_lineRenderer->AddVertex({-0.5f, 0.f, -0.5f}, Zeus::CColor::skBlue, 1.f); - m_mv.m_lineRenderer->AddVertex({-0.5f, 0.f, 0.5f}, Zeus::CColor::skBlue, 1.f); - m_mv.m_lineRenderer->AddVertex({0.5f, 10.f, 0.5f}, Zeus::CColor::skRed, 3.f); - m_mv.m_lineRenderer->AddVertex({0.5f, 0.f, -0.5f}, Zeus::CColor::skBlue, 1.f); + m_mv.m_lineRenderer->AddVertex({-0.5f, 0.f, -0.5f}, zeus::CColor::skBlue, 1.f); + m_mv.m_lineRenderer->AddVertex({-0.5f, 0.f, 0.5f}, zeus::CColor::skBlue, 1.f); + m_mv.m_lineRenderer->AddVertex({0.5f, 10.f, 0.5f}, zeus::CColor::skRed, 3.f); + m_mv.m_lineRenderer->AddVertex({0.5f, 0.f, -0.5f}, zeus::CColor::skBlue, 1.f); m_mv.m_lineRenderer->Render(); gfxQ->setScissor({}); } diff --git a/Editor/ModelViewer.hpp b/Editor/ModelViewer.hpp index c35b3dc02..e85d329d9 100644 --- a/Editor/ModelViewer.hpp +++ b/Editor/ModelViewer.hpp @@ -20,20 +20,20 @@ class ModelViewer : public ViewerSpace }; Value renderMode = Mode::Material; - Value cameraPosition; - Value cameraOrientation; + Value cameraPosition; + Value cameraOrientation; } m_state; const Space::State& spaceState() const { return m_state; } - std::unique_ptr m_lineRenderer; - struct View : Specter::View + std::unique_ptr m_lineRenderer; + struct View : specter::View { ModelViewer& m_mv; boo::SWindowRect m_scissorRect; - View(ModelViewer& mv, Specter::ViewResources& res) - : Specter::View(res, mv.m_vm.rootView()), m_mv(mv) + View(ModelViewer& mv, specter::ViewResources& res) + : specter::View(res, mv.m_vm.rootView()), m_mv(mv) { commitResources(res); } @@ -50,7 +50,7 @@ public: : ViewerSpace(vm, Class::ModelViewer, parent) { reloadState(); - m_lineRenderer.reset(new pshag::CLineRenderer(pshag::CLineRenderer::EPrimitiveMode::LineStrip, 4, nullptr, true)); + m_lineRenderer.reset(new urde::CLineRenderer(urde::CLineRenderer::EPrimitiveMode::LineStrip, 4, nullptr, true)); } ModelViewer(ViewManager& vm, Space* parent, const ModelViewer& other) @@ -78,7 +78,7 @@ public: return new ModelViewer(m_vm, parent, *this); } - virtual Specter::View* buildContentView(Specter::ViewResources& res) + virtual specter::View* buildContentView(specter::ViewResources& res) { m_view.reset(new View(*this, res)); return m_view.get(); diff --git a/Editor/ParticleEditor.hpp b/Editor/ParticleEditor.hpp index 779f59ba6..d115c3b96 100644 --- a/Editor/ParticleEditor.hpp +++ b/Editor/ParticleEditor.hpp @@ -15,13 +15,13 @@ class EffectEditor : public EditorSpace } m_state; const Space::State& spaceState() const {return m_state;} - struct View : Specter::View + struct View : specter::View { - View(Specter::ViewResources& res, Specter::View& parent) - : Specter::View(res, parent) {} + View(specter::ViewResources& res, specter::View& parent) + : specter::View(res, parent) {} }; - Specter::View* buildContentView(Specter::ViewResources& res) + specter::View* buildContentView(specter::ViewResources& res) { return nullptr; } diff --git a/Editor/ProjectManager.cpp b/Editor/ProjectManager.cpp index a3844ef8a..be52d6a37 100644 --- a/Editor/ProjectManager.cpp +++ b/Editor/ProjectManager.cpp @@ -4,12 +4,12 @@ namespace URDE { -static LogVisor::LogModule Log("URDE::ProjectManager"); +static logvisor::Module Log("URDE::ProjectManager"); void ProjectManager::IndexMP1Resources() { - const std::vector& specs = m_proj->getDataSpecs(); - for (const HECL::Database::Project::ProjectDataSpec& spec : m_proj->getDataSpecs()) + const std::vector& specs = m_proj->getDataSpecs(); + for (const hecl::Database::Project::ProjectDataSpec& spec : m_proj->getDataSpecs()) { if (&spec.spec == &DataSpec::SpecEntMP1) { @@ -30,17 +30,17 @@ ProjectManager::ProjectManager(ViewManager &vm) } } -bool ProjectManager::newProject(const HECL::SystemString& path) +bool ProjectManager::newProject(const hecl::SystemString& path) { - HECL::ProjectRootPath projPath = HECL::SearchForProject(path); + hecl::ProjectRootPath projPath = hecl::SearchForProject(path); if (projPath) { - Log.report(LogVisor::Warning, _S("project already exists at '%s'"), path.c_str()); + Log.report(logvisor::Warning, _S("project already exists at '%s'"), path.c_str()); return false; } - HECL::MakeDir(path.c_str()); - m_proj.reset(new HECL::Database::Project(path)); + hecl::MakeDir(path.c_str()); + m_proj.reset(new hecl::Database::Project(path)); if (!*m_proj) { m_proj.reset(); @@ -56,16 +56,16 @@ bool ProjectManager::newProject(const HECL::SystemString& path) return true; } -bool ProjectManager::openProject(const HECL::SystemString& path) +bool ProjectManager::openProject(const hecl::SystemString& path) { - HECL::ProjectRootPath projPath = HECL::SearchForProject(path); + hecl::ProjectRootPath projPath = hecl::SearchForProject(path); if (!projPath) { - Log.report(LogVisor::Warning, _S("project doesn't exist at '%s'"), path.c_str()); + Log.report(logvisor::Warning, _S("project doesn't exist at '%s'"), path.c_str()); return false; } - m_proj.reset(new HECL::Database::Project(projPath)); + m_proj.reset(new hecl::Database::Project(projPath)); if (!*m_proj) { m_proj.reset(); @@ -73,23 +73,23 @@ bool ProjectManager::openProject(const HECL::SystemString& path) } #ifdef URDE_BINARY_CONFIGS - HECL::ProjectPath urdeSpacesPath(*m_proj, _S(".hecl/urde_spaces.bin")); - Athena::io::FileReader r(urdeSpacesPath.getAbsolutePath(), 32 * 1024, false); + hecl::ProjectPath urdeSpacesPath(*m_proj, _S(".hecl/urde_spaces.bin")); + athena::io::FileReader r(urdeSpacesPath.getAbsolutePath(), 32 * 1024, false); if (r.hasError()) goto makeDefault; m_vm.SetupEditorView(r); #else - HECL::ProjectPath urdeSpacesPath(*m_proj, _S(".hecl/urde_spaces.yaml")); - FILE* fp = HECL::Fopen(urdeSpacesPath.getAbsolutePath().c_str(), _S("r")); + hecl::ProjectPath urdeSpacesPath(*m_proj, _S(".hecl/urde_spaces.yaml")); + FILE* fp = hecl::Fopen(urdeSpacesPath.getAbsolutePath().c_str(), _S("r")); - Athena::io::YAMLDocReader r; + athena::io::YAMLDocReader r; if (!fp) goto makeDefault; yaml_parser_set_input_file(r.getParser(), fp); - if (!r.ValidateClassType(r.getParser(), "UrdeSpacesState")) + if (!r.ValidateClassType("UrdeSpacesState")) { fclose(fp); goto makeDefault; @@ -129,7 +129,7 @@ makeDefault: return true; } -bool ProjectManager::extractGame(const HECL::SystemString& path) +bool ProjectManager::extractGame(const hecl::SystemString& path) { return false; } @@ -140,46 +140,38 @@ bool ProjectManager::saveProject() return false; #ifdef URDE_BINARY_CONFIGS - HECL::ProjectPath oldSpacesPath(*m_proj, _S(".hecl/~urde_spaces.bin")); - Athena::io::FileWriter w(oldSpacesPath.getAbsolutePath(), true, false); + hecl::ProjectPath oldSpacesPath(*m_proj, _S(".hecl/~urde_spaces.bin")); + athena::io::FileWriter w(oldSpacesPath.getAbsolutePath(), true, false); if (w.hasError()) return false; m_vm.SaveEditorView(w); w.close(); - HECL::ProjectPath newSpacesPath(*m_proj, _S(".hecl/urde_spaces.bin")); + hecl::ProjectPath newSpacesPath(*m_proj, _S(".hecl/urde_spaces.bin")); #else - HECL::ProjectPath oldSpacesPath(*m_proj, _S(".hecl/~urde_spaces.yaml")); - FILE* fp = HECL::Fopen(oldSpacesPath.getAbsolutePath().c_str(), _S("w")); + hecl::ProjectPath oldSpacesPath(*m_proj, _S(".hecl/~urde_spaces.yaml")); + FILE* fp = hecl::Fopen(oldSpacesPath.getAbsolutePath().c_str(), _S("w")); if (!fp) return false; - Athena::io::YAMLDocWriter w("UrdeSpacesState"); + athena::io::YAMLDocWriter w("UrdeSpacesState"); yaml_emitter_set_output_file(w.getEmitter(), fp); - if (!w.open()) - { - fclose(fp); - return false; - } - m_vm.SaveEditorView(w); if (!w.finish()) { fclose(fp); return false; } - - w.close(); fclose(fp); - HECL::ProjectPath newSpacesPath(*m_proj, _S(".hecl/urde_spaces.yaml")); + hecl::ProjectPath newSpacesPath(*m_proj, _S(".hecl/urde_spaces.yaml")); #endif - HECL::Unlink(newSpacesPath.getAbsolutePath().c_str()); - HECL::Rename(oldSpacesPath.getAbsolutePath().c_str(), + hecl::Unlink(newSpacesPath.getAbsolutePath().c_str()); + hecl::Rename(oldSpacesPath.getAbsolutePath().c_str(), newSpacesPath.getAbsolutePath().c_str()); m_vm.pushRecentProject(m_proj->getProjectRootPath().getAbsolutePath()); diff --git a/Editor/ProjectManager.hpp b/Editor/ProjectManager.hpp index d9b2031af..21519f9a5 100644 --- a/Editor/ProjectManager.hpp +++ b/Editor/ProjectManager.hpp @@ -1,8 +1,8 @@ #ifndef URDE_PROJECT_MANAGER_HPP #define URDE_PROJECT_MANAGER_HPP -#include -#include +#include +#include #include "ProjectResourceFactory.hpp" #include "Runtime/CSimplePool.hpp" @@ -11,20 +11,20 @@ namespace URDE class ViewManager; #ifdef URDE_BINARY_CONFIGS -using ConfigReader = Athena::io::IStreamReader; -using ConfigWriter = Athena::io::IStreamWriter; +using ConfigReader = athena::io::IStreamReader; +using ConfigWriter = athena::io::IStreamWriter; #else -using ConfigReader = Athena::io::YAMLDocReader; -using ConfigWriter = Athena::io::YAMLDocWriter; +using ConfigReader = athena::io::YAMLDocReader; +using ConfigWriter = athena::io::YAMLDocWriter; #endif class ProjectManager { ViewManager& m_vm; - std::unique_ptr m_proj; + std::unique_ptr m_proj; static bool m_registeredSpecs; ProjectResourceFactory m_factory; - pshag::CSimplePool m_objStore; + urde::CSimplePool m_objStore; void IndexMP1Resources(); @@ -32,11 +32,11 @@ public: ProjectManager(ViewManager& vm); operator bool() const {return m_proj.operator bool();} - HECL::Database::Project* project() {return m_proj.get();} + hecl::Database::Project* project() {return m_proj.get();} - bool newProject(const HECL::SystemString& path); - bool openProject(const HECL::SystemString& path); - bool extractGame(const HECL::SystemString& path); + bool newProject(const hecl::SystemString& path); + bool openProject(const hecl::SystemString& path); + bool extractGame(const hecl::SystemString& path); bool saveProject(); diff --git a/Editor/ProjectResourceFactory.cpp b/Editor/ProjectResourceFactory.cpp index 9e5fedd05..e56bfbb8b 100644 --- a/Editor/ProjectResourceFactory.cpp +++ b/Editor/ProjectResourceFactory.cpp @@ -5,25 +5,25 @@ #include "Runtime/Particle/CGenDescription.hpp" #include "Runtime/Particle/CElectricDescription.hpp" #include "Runtime/Particle/CSwooshDescription.hpp" -#include "Runtime/CModel.hpp" -#include "Runtime/CTexture.hpp" +#include "Runtime/Graphics/CModel.hpp" +#include "Runtime/Graphics/CTexture.hpp" namespace URDE { ProjectResourceFactory::ProjectResourceFactory() { - m_factoryMgr.AddFactory(HECL::FOURCC('TXTR'), pshag::FTextureFactory); - m_factoryMgr.AddFactory(HECL::FOURCC('PART'), pshag::FParticleFactory); + m_factoryMgr.AddFactory(hecl::FOURCC('TXTR'), urde::FTextureFactory); + m_factoryMgr.AddFactory(hecl::FOURCC('PART'), urde::FParticleFactory); } -void ProjectResourceFactory::BuildObjectMap(const HECL::Database::Project::ProjectDataSpec &spec) +void ProjectResourceFactory::BuildObjectMap(const hecl::Database::Project::ProjectDataSpec &spec) { m_resPaths.clear(); m_namedResources.clear(); - HECL::SystemString catalogPath = HECL::ProjectPath(spec.cookedPath, HECL::SystemString(spec.spec.m_name) + _S("/catalog.yaml")).getAbsolutePath(); - FILE* catalogFile = HECL::Fopen(catalogPath.c_str(), _S("r")); - if (!HECL::StrCmp(spec.spec.m_name, _S("MP3"))) + hecl::SystemString catalogPath = hecl::ProjectPath(spec.cookedPath, hecl::SystemString(spec.spec.m_name) + _S("/catalog.yaml")).getAbsolutePath(); + FILE* catalogFile = hecl::Fopen(catalogPath.c_str(), _S("r")); + if (!hecl::StrCmp(spec.spec.m_name, _S("MP3"))) { DataSpec::NamedResourceCatalog catalog; if (catalogFile) @@ -39,51 +39,51 @@ void ProjectResourceFactory::BuildObjectMap(const HECL::Database::Project::Proje } } -std::unique_ptr ProjectResourceFactory::Build(const pshag::SObjectTag& tag, - const pshag::CVParamTransfer& paramXfer) +std::unique_ptr ProjectResourceFactory::Build(const urde::SObjectTag& tag, + const urde::CVParamTransfer& paramXfer) { auto search = m_resPaths.find(tag); if (search == m_resPaths.end()) return {}; fprintf(stderr, "Loading resource %s\n", search->second.getRelativePath().c_str()); - Athena::io::FileReader fr(search->second.getAbsolutePath(), 32 * 1024, false); + athena::io::FileReader fr(search->second.getAbsolutePath(), 32 * 1024, false); if (fr.hasError()) return {}; return m_factoryMgr.MakeObject(tag, fr, paramXfer); } -void ProjectResourceFactory::BuildAsync(const pshag::SObjectTag& tag, - const pshag::CVParamTransfer& paramXfer, - pshag::IObj** objOut) +void ProjectResourceFactory::BuildAsync(const urde::SObjectTag& tag, + const urde::CVParamTransfer& paramXfer, + urde::IObj** objOut) { - std::unique_ptr obj = Build(tag, paramXfer); + std::unique_ptr obj = Build(tag, paramXfer); *objOut = obj.release(); } -void ProjectResourceFactory::CancelBuild(const pshag::SObjectTag&) +void ProjectResourceFactory::CancelBuild(const urde::SObjectTag&) { } -bool ProjectResourceFactory::CanBuild(const pshag::SObjectTag& tag) +bool ProjectResourceFactory::CanBuild(const urde::SObjectTag& tag) { auto search = m_resPaths.find(tag); if (search == m_resPaths.end()) return false; - Athena::io::FileReader fr(search->second.getAbsolutePath(), 32 * 1024, false); + athena::io::FileReader fr(search->second.getAbsolutePath(), 32 * 1024, false); if (fr.hasError()) return false; return true; } -const pshag::SObjectTag* ProjectResourceFactory::GetResourceIdByName(const char* name) const +const urde::SObjectTag* ProjectResourceFactory::GetResourceIdByName(const char* name) const { if (m_namedResources.find(name) == m_namedResources.end()) return nullptr; - const pshag::SObjectTag& tag = m_namedResources.at(name); + const urde::SObjectTag& tag = m_namedResources.at(name); return &tag; } diff --git a/Editor/ProjectResourceFactory.hpp b/Editor/ProjectResourceFactory.hpp index 22cfa974a..fca2310d1 100644 --- a/Editor/ProjectResourceFactory.hpp +++ b/Editor/ProjectResourceFactory.hpp @@ -8,23 +8,23 @@ namespace URDE { -class ProjectResourceFactory : public pshag::IFactory +class ProjectResourceFactory : public urde::IFactory { - std::unordered_map m_resPaths; - std::unordered_map m_namedResources; - pshag::CFactoryMgr m_factoryMgr; + std::unordered_map m_resPaths; + std::unordered_map m_namedResources; + urde::CFactoryMgr m_factoryMgr; template - void RecursiveAddDirObjects(const HECL::ProjectPath& path, const DataSpec::NamedResourceCatalog& catalog) + void RecursiveAddDirObjects(const hecl::ProjectPath& path, const DataSpec::NamedResourceCatalog& catalog) { - HECL::DirectoryEnumerator de = path.enumerateDir(); + hecl::DirectoryEnumerator de = path.enumerateDir(); const int idLen = 5 + (IDType::BinarySize() * 2); - for (const HECL::DirectoryEnumerator::Entry& ent : de) + for (const hecl::DirectoryEnumerator::Entry& ent : de) { if (ent.m_isDir) - RecursiveAddDirObjects(HECL::ProjectPath(path, ent.m_name), catalog); + RecursiveAddDirObjects(hecl::ProjectPath(path, ent.m_name), catalog); if (ent.m_name.size() == idLen && ent.m_name[4] == _S('_')) { - HECL::SystemUTF8View entu8(ent.m_name); + hecl::SystemUTF8View entu8(ent.m_name); #if _WIN32 u64 id = _strtoui64(entu8.c_str() + 5, nullptr, 16); #else @@ -33,14 +33,14 @@ class ProjectResourceFactory : public pshag::IFactory if (id) { - pshag::SObjectTag objTag = {HECL::FourCC(entu8.c_str()), id}; + urde::SObjectTag objTag = {hecl::FourCC(entu8.c_str()), id}; if (m_resPaths.find(objTag) == m_resPaths.end()) - m_resPaths[objTag] = HECL::ProjectPath(path, ent.m_name); + m_resPaths[objTag] = hecl::ProjectPath(path, ent.m_name); } } else { - HECL::SystemUTF8View nameView(ent.m_name); + hecl::SystemUTF8View nameView(ent.m_name); auto it = std::find_if(catalog.namedResources.begin(), catalog.namedResources.end(), [&nameView](const typename DataSpec::NamedResourceCatalog::NamedResource& res) -> bool { return res.name == nameView.str(); }); @@ -48,33 +48,33 @@ class ProjectResourceFactory : public pshag::IFactory continue; const typename DataSpec::NamedResourceCatalog::NamedResource& nr = *it; - pshag::SObjectTag objTag = GetTag(nr); + urde::SObjectTag objTag = GetTag(nr); m_namedResources[nr.name.c_str()] = objTag; - m_resPaths[objTag] = HECL::ProjectPath(path, ent.m_name); + m_resPaths[objTag] = hecl::ProjectPath(path, ent.m_name); } } } template - pshag::SObjectTag GetTag(const DataSpec::NamedResourceCatalog::NamedResource &nr, + urde::SObjectTag GetTag(const DataSpec::NamedResourceCatalog::NamedResource &nr, typename std::enable_if::value>::type* = 0) { return { nr.type, nr.uid.toUint32() }; } template - pshag::SObjectTag GetTag(const typename DataSpec::NamedResourceCatalog::NamedResource& nr, + urde::SObjectTag GetTag(const typename DataSpec::NamedResourceCatalog::NamedResource& nr, typename std::enable_if::value>::type* = 0) { return { nr.type, nr.uid.toUint64() }; } public: ProjectResourceFactory(); - void BuildObjectMap(const HECL::Database::Project::ProjectDataSpec& spec); + void BuildObjectMap(const hecl::Database::Project::ProjectDataSpec& spec); - std::unique_ptr Build(const pshag::SObjectTag&, const pshag::CVParamTransfer&); - void BuildAsync(const pshag::SObjectTag&, const pshag::CVParamTransfer&, pshag::IObj**); - void CancelBuild(const pshag::SObjectTag&); - bool CanBuild(const pshag::SObjectTag&); - const pshag::SObjectTag* GetResourceIdByName(const char*) const; + std::unique_ptr Build(const urde::SObjectTag&, const urde::CVParamTransfer&); + void BuildAsync(const urde::SObjectTag&, const urde::CVParamTransfer&, urde::IObj**); + void CancelBuild(const urde::SObjectTag&); + bool CanBuild(const urde::SObjectTag&); + const urde::SObjectTag* GetResourceIdByName(const char*) const; }; } diff --git a/Editor/Resource.cpp b/Editor/Resource.cpp index 186aa559e..312c6b7b8 100644 --- a/Editor/Resource.cpp +++ b/Editor/Resource.cpp @@ -3,9 +3,9 @@ namespace URDE { -Space::Class Resource::DeduceDefaultSpaceClass(const HECL::ProjectPath& path) +Space::Class Resource::DeduceDefaultSpaceClass(const hecl::ProjectPath& path) { - Athena::io::FileReader r(path.getAbsolutePath(), 32*1024, false); + athena::io::FileReader r(path.getAbsolutePath(), 32*1024, false); if (r.hasError()) return Space::Class::None; return Space::Class::None; diff --git a/Editor/Resource.hpp b/Editor/Resource.hpp index fe85f8e2f..9dce4102f 100644 --- a/Editor/Resource.hpp +++ b/Editor/Resource.hpp @@ -1,7 +1,7 @@ #ifndef URDE_RESOURCE_HPP #define URDE_RESOURCE_HPP -#include +#include #include "Space.hpp" namespace URDE @@ -19,17 +19,17 @@ namespace URDE class Resource { public: - using ProjectDataSpec = HECL::Database::Project::ProjectDataSpec; + using ProjectDataSpec = hecl::Database::Project::ProjectDataSpec; private: - HECL::ProjectPath m_path; + hecl::ProjectPath m_path; Space::Class m_defaultClass = Space::Class::None; EditorSpace* m_editingSpace = nullptr; std::vector m_viewingSpaces; public: - static Space::Class DeduceDefaultSpaceClass(const HECL::ProjectPath& path); - explicit Resource(HECL::ProjectPath&& path) + static Space::Class DeduceDefaultSpaceClass(const hecl::ProjectPath& path); + explicit Resource(hecl::ProjectPath&& path) : m_path(std::move(path)), m_defaultClass(DeduceDefaultSpaceClass(m_path)) {} - const HECL::ProjectPath& path() const {return m_path;} + const hecl::ProjectPath& path() const {return m_path;} }; /** Provides centralized hierarchical lookup and ownership of Resource nodes */ @@ -38,8 +38,8 @@ class ResourceTree public: struct Node { - std::map> m_subnodes; - std::map> m_resources; + std::map> m_subnodes; + std::map> m_resources; }; private: std::unique_ptr m_rootNode; diff --git a/Editor/ResourceBrowser.cpp b/Editor/ResourceBrowser.cpp index 1f151499c..d403e5263 100644 --- a/Editor/ResourceBrowser.cpp +++ b/Editor/ResourceBrowser.cpp @@ -4,19 +4,19 @@ namespace URDE { #define BROWSER_MARGIN 8 -bool ResourceBrowser::navigateToPath(const HECL::ProjectPath& pathIn) +bool ResourceBrowser::navigateToPath(const hecl::ProjectPath& pathIn) { - if (pathIn.getPathType() == HECL::ProjectPath::Type::File) + if (pathIn.getPathType() == hecl::ProjectPath::Type::File) m_path = pathIn.getParentPath(); else m_path = pathIn; m_comps = m_path.getPathComponents(); - HECL::DirectoryEnumerator dEnum(m_path.getAbsolutePath(), - HECL::DirectoryEnumerator::Mode::DirsThenFilesSorted, + hecl::DirectoryEnumerator dEnum(m_path.getAbsolutePath(), + hecl::DirectoryEnumerator::Mode::DirsThenFilesSorted, m_state.sortColumn==State::SortColumn::Size, - m_state.sortDir==Specter::SortDirection::Descending, + m_state.sortDir==specter::SortDirection::Descending, true); m_fileListingBind.updateListing(dEnum); if (m_pathButtons) @@ -37,10 +37,10 @@ void ResourceBrowser::pathButtonActivated(size_t idx) if (idx >= m_comps.size()) return; - HECL::SystemString dir; + hecl::SystemString dir; bool needSlash = false; size_t i = 0; - for (const HECL::SystemString& d : m_comps) + for (const hecl::SystemString& d : m_comps) { if (needSlash) dir += _S('/'); @@ -50,7 +50,7 @@ void ResourceBrowser::pathButtonActivated(size_t idx) if (++i > idx) break; } - navigateToPath(HECL::ProjectPath(*m_vm.project(), dir)); + navigateToPath(hecl::ProjectPath(*m_vm.project(), dir)); } void ResourceBrowser::View::mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mod) @@ -75,7 +75,7 @@ void ResourceBrowser::View::mouseLeave(const boo::SWindowCoord& coord) void ResourceBrowser::View::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) { - Specter::View::resized(root, sub); + specter::View::resized(root, sub); m_fileListing.m_view->resized(root, sub); } void ResourceBrowser::View::draw(boo::IGraphicsCommandQueue* gfxQ) diff --git a/Editor/ResourceBrowser.hpp b/Editor/ResourceBrowser.hpp index 90e29d48f..917b47c28 100644 --- a/Editor/ResourceBrowser.hpp +++ b/Editor/ResourceBrowser.hpp @@ -3,12 +3,12 @@ #include "Space.hpp" #include "ViewManager.hpp" -#include "Specter/PathButtons.hpp" +#include "specter/PathButtons.hpp" namespace URDE { -class ResourceBrowser : public Space, public Specter::IPathButtonsBinding +class ResourceBrowser : public Space, public specter::IPathButtonsBinding { struct State : Space::State { @@ -22,22 +22,22 @@ class ResourceBrowser : public Space, public Specter::IPathButtonsBinding Size }; Value sortColumn = SortColumn::Name; - Value sortDir = Specter::SortDirection::Ascending; + Value sortDir = specter::SortDirection::Ascending; } m_state; const Space::State& spaceState() const {return m_state;} - HECL::ProjectPath m_path; - std::vector m_comps; + hecl::ProjectPath m_path; + std::vector m_comps; void pathButtonActivated(size_t idx); - struct ResListingDataBind : Specter::ITableDataBinding, Specter::ITableStateBinding + struct ResListingDataBind : specter::ITableDataBinding, specter::ITableStateBinding { ResourceBrowser& m_rb; struct Entry { - HECL::SystemString m_path; + hecl::SystemString m_path; std::string m_name; std::string m_type; std::string m_size; @@ -97,21 +97,21 @@ class ResourceBrowser : public Space, public Specter::IPathButtonsBinding m_rb.m_state.columnSplits[cIdx] = split; } - void updateListing(const HECL::DirectoryEnumerator& dEnum) + void updateListing(const hecl::DirectoryEnumerator& dEnum) { m_entries.clear(); m_entries.reserve(dEnum.size()); - for (const HECL::DirectoryEnumerator::Entry& d : dEnum) + for (const hecl::DirectoryEnumerator::Entry& d : dEnum) { m_entries.emplace_back(); Entry& ent = m_entries.back(); ent.m_path = d.m_path; - HECL::SystemUTF8View nameUtf8(d.m_name); + hecl::SystemUTF8View nameUtf8(d.m_name); ent.m_name = nameUtf8.str(); if (d.m_isDir) { - if (HECL::SearchForProject(d.m_path)) + if (hecl::SearchForProject(d.m_path)) ent.m_type = m_projStr; else ent.m_type = m_dirStr; @@ -119,8 +119,8 @@ class ResourceBrowser : public Space, public Specter::IPathButtonsBinding else { ent.m_type = m_fileStr; - ent.m_size = HECL::HumanizeNumber(d.m_fileSz, 7, nullptr, int(HECL::HNScale::AutoScale), - HECL::HNFlags::B | HECL::HNFlags::Decimal); + ent.m_size = hecl::HumanizeNumber(d.m_fileSz, 7, nullptr, int(hecl::HNScale::AutoScale), + hecl::HNFlags::B | hecl::HNFlags::Decimal); } } @@ -129,7 +129,7 @@ class ResourceBrowser : public Space, public Specter::IPathButtonsBinding bool m_needsUpdate = false; - Specter::SortDirection getSort(size_t& cIdx) const + specter::SortDirection getSort(size_t& cIdx) const { cIdx = size_t(m_rb.m_state.sortColumn); if (cIdx > 2) @@ -137,7 +137,7 @@ class ResourceBrowser : public Space, public Specter::IPathButtonsBinding return m_rb.m_state.sortDir; } - void setSort(size_t cIdx, Specter::SortDirection dir) + void setSort(size_t cIdx, specter::SortDirection dir) { m_rb.m_state.sortDir = dir; m_needsUpdate = true; @@ -151,7 +151,7 @@ class ResourceBrowser : public Space, public Specter::IPathButtonsBinding { } - ResListingDataBind(ResourceBrowser& rb, const Specter::IViewManager& vm) + ResListingDataBind(ResourceBrowser& rb, const specter::IViewManager& vm) : m_rb(rb) { m_nameCol = vm.translateOr("name", "Name"); @@ -164,16 +164,16 @@ class ResourceBrowser : public Space, public Specter::IPathButtonsBinding } m_fileListingBind; - struct View : Specter::View + struct View : specter::View { ResourceBrowser& m_ro; - Specter::ViewChild> m_fileListing; + specter::ViewChild> m_fileListing; - View(ResourceBrowser& ro, Specter::ViewResources& res) - : Specter::View(res, ro.m_vm.rootView()), m_ro(ro) + View(ResourceBrowser& ro, specter::ViewResources& res) + : specter::View(res, ro.m_vm.rootView()), m_ro(ro) { commitResources(res); - m_fileListing.m_view.reset(new Specter::Table(res, *this, &ro.m_fileListingBind, &ro.m_fileListingBind, 3)); + m_fileListing.m_view.reset(new specter::Table(res, *this, &ro.m_fileListingBind, &ro.m_fileListingBind, 3)); } void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); @@ -186,7 +186,7 @@ class ResourceBrowser : public Space, public Specter::IPathButtonsBinding }; std::unique_ptr m_view; - std::unique_ptr m_pathButtons; + std::unique_ptr m_pathButtons; public: ResourceBrowser(ViewManager& vm, Space* parent) @@ -210,30 +210,30 @@ public: void reloadState() { - HECL::ProjectPath pp(*m_vm.project(), m_state.path); - if (m_state.path.empty() || pp.getPathType() == HECL::ProjectPath::Type::None) + hecl::ProjectPath pp(*m_vm.project(), m_state.path); + if (m_state.path.empty() || pp.getPathType() == hecl::ProjectPath::Type::None) { m_state.path = m_vm.project()->getProjectWorkingPath().getRelativePathUTF8(); - navigateToPath(HECL::ProjectPath(*m_vm.project(), m_state.path)); + navigateToPath(hecl::ProjectPath(*m_vm.project(), m_state.path)); } else navigateToPath(pp); } - bool navigateToPath(const HECL::ProjectPath& path); + bool navigateToPath(const hecl::ProjectPath& path); Space* copy(Space* parent) const { return new ResourceBrowser(m_vm, parent, *this); } - void buildToolbarView(Specter::ViewResources &res, Specter::Toolbar &tb) + void buildToolbarView(specter::ViewResources &res, specter::Toolbar &tb) { - m_pathButtons.reset(new Specter::PathButtons(res, tb, *this, true)); + m_pathButtons.reset(new specter::PathButtons(res, tb, *this, true)); tb.push_back(m_pathButtons.get(), 0); } - Specter::View* buildContentView(Specter::ViewResources& res) + specter::View* buildContentView(specter::ViewResources& res) { m_view.reset(new View(*this, res)); return m_view.get(); diff --git a/Editor/Space.cpp b/Editor/Space.cpp index 2ac88c8a4..9d5b75d75 100644 --- a/Editor/Space.cpp +++ b/Editor/Space.cpp @@ -8,34 +8,34 @@ namespace URDE { -static LogVisor::LogModule Log("URDE::Space"); +static logvisor::Module Log("URDE::Space"); Space::Space(ViewManager& vm, Class cls, Space* parent) : m_spaceMenuNode(*this), m_spaceSelectBind(*this), m_vm(vm), m_class(cls), m_parent(parent) {} -Specter::View* Space::buildSpaceView(Specter::ViewResources& res) +specter::View* Space::buildSpaceView(specter::ViewResources& res) { if (usesToolbar()) { - m_spaceView.reset(new Specter::Space(res, *m_parent->basisView(), *this, Specter::Toolbar::Position::Bottom, toolbarUnits())); - Specter::View* sview = buildContentView(res); + m_spaceView.reset(new specter::Space(res, *m_parent->basisView(), *this, specter::Toolbar::Position::Bottom, toolbarUnits())); + specter::View* sview = buildContentView(res); m_spaceView->setContentView(sview); - Specter::Toolbar& tb = *m_spaceView->toolbar(); + 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, - Specter::Button::Style::Block, - classColor?*classColor:Zeus::CColor::skWhite)); + 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, + specter::Button::Style::Block, + classColor?*classColor:zeus::CColor::skWhite)); tb.push_back(m_spaceSelectButton.get(), 0); buildToolbarView(res, tb); return m_spaceView.get(); } else { - m_spaceView.reset(new Specter::Space(res, *m_parent->basisView(), *this, Specter::Toolbar::Position::None, 0)); - Specter::View* sview = buildContentView(res); + m_spaceView.reset(new specter::Space(res, *m_parent->basisView(), *this, specter::Toolbar::Position::None, 0)); + specter::View* sview = buildContentView(res); m_spaceView->setContentView(sview); return m_spaceView.get(); } @@ -57,25 +57,25 @@ void Space::SpaceMenuNode::InitializeStrings(ViewManager& vm) sn.m_text = vm.translateOr(sn.m_key, sn.m_text.c_str()); } -std::unique_ptr Space::SpaceSelectBind::buildMenu(const Specter::Button* button) +std::unique_ptr Space::SpaceSelectBind::buildMenu(const specter::Button* button) { - return std::unique_ptr(new Specter::Menu(m_space.m_vm.rootView().viewRes(), + return std::unique_ptr(new specter::Menu(m_space.m_vm.rootView().viewRes(), *m_space.m_spaceView, &m_space.m_spaceMenuNode)); } -Specter::View* RootSpace::buildSpaceView(Specter::ViewResources& res) +specter::View* RootSpace::buildSpaceView(specter::ViewResources& res) { - Specter::View* newRoot = buildContentView(res); + specter::View* newRoot = buildContentView(res); m_vm.RootSpaceViewBuilt(newRoot); return newRoot; } -Specter::View* RootSpace::basisView() {return &m_vm.rootView();} +specter::View* RootSpace::basisView() {return &m_vm.rootView();} -Specter::View* SplitSpace::buildContentView(Specter::ViewResources& res) +specter::View* SplitSpace::buildContentView(specter::ViewResources& res) { int clearance = res.pixelFactor() * SPECTER_TOOLBAR_GAUGE; - m_splitView.reset(new Specter::SplitView(res, *m_parent->basisView(), this, m_state.axis, + m_splitView.reset(new specter::SplitView(res, *m_parent->basisView(), this, m_state.axis, m_state.split, clearance, clearance)); if (m_slots[0]) m_splitView->setContentView(0, m_slots[0]->buildSpaceView(res)); @@ -87,19 +87,19 @@ Specter::View* SplitSpace::buildContentView(Specter::ViewResources& res) void SplitSpace::setChildSlot(unsigned slot, std::unique_ptr&& space) { if (slot > 1) - Log.report(LogVisor::FatalError, "invalid slot %u for SplitView", slot); + Log.report(logvisor::Fatal, "invalid slot %u for SplitView", slot); m_slots[slot] = std::move(space); m_slots[slot]->m_parent = this; } -void SplitSpace::joinViews(Specter::SplitView* thisSplit, int thisSlot, Specter::SplitView* otherSplit, int otherSlot) +void SplitSpace::joinViews(specter::SplitView* thisSplit, int thisSlot, specter::SplitView* otherSplit, int otherSlot) { if (thisSplit == otherSplit) { SplitSpace* thisSS = dynamic_cast(m_slots[thisSlot].get()); if (thisSS) { - int ax = thisSS->m_state.axis == Specter::SplitView::Axis::Horizontal ? 1 : 0; + int ax = thisSS->m_state.axis == specter::SplitView::Axis::Horizontal ? 1 : 0; const boo::SWindowRect& thisRect = m_splitView->subRect(); const boo::SWindowRect& subRect = thisSS->m_splitView->subRect(); int splitPx = subRect.location[ax] + subRect.size[ax] * thisSS->m_state.split - @@ -116,7 +116,7 @@ void SplitSpace::joinViews(Specter::SplitView* thisSplit, int thisSlot, Specter: SplitSpace* otherSS = dynamic_cast(m_slots[i].get()); if (otherSS && otherSS->m_splitView.get() == otherSplit) { - int ax = m_state.axis == Specter::SplitView::Axis::Horizontal ? 1 : 0; + int ax = m_state.axis == specter::SplitView::Axis::Horizontal ? 1 : 0; const boo::SWindowRect& thisRect = m_splitView->subRect(); const boo::SWindowRect& subRect = otherSS->m_splitView->subRect(); int splitPx = subRect.location[ax] + subRect.size[ax] * otherSS->m_state.split - @@ -130,13 +130,13 @@ void SplitSpace::joinViews(Specter::SplitView* thisSplit, int thisSlot, Specter: } } -Specter::ISplitSpaceController* Space::spaceSplit(Specter::SplitView::Axis axis, int thisSlot) +specter::ISplitSpaceController* Space::spaceSplit(specter::SplitView::Axis axis, int thisSlot) { if (m_parent) { /* Reject split operations with insufficient clearance */ int clearance = m_vm.m_viewResources.pixelFactor() * SPECTER_TOOLBAR_GAUGE; - if (axis == Specter::SplitView::Axis::Horizontal) + if (axis == specter::SplitView::Axis::Horizontal) { if (m_spaceView->subRect().size[1] <= clearance) return nullptr; @@ -166,7 +166,7 @@ std::unique_ptr RootSpace::exchangeSpaceSplitJoin(Space* removeSpace, std m_spaceTree->m_parent = this; } else - Log.report(LogVisor::FatalError, "RootSpace::exchangeSpaceSplitJoin() failure"); + Log.report(logvisor::Fatal, "RootSpace::exchangeSpaceSplitJoin() failure"); return ret; } @@ -186,7 +186,7 @@ std::unique_ptr SplitSpace::exchangeSpaceSplitJoin(Space* removeSpace, st m_slots[1]->m_parent = this; } else - Log.report(LogVisor::FatalError, "SplitSpace::exchangeSpaceSplitJoin() failure"); + Log.report(logvisor::Fatal, "SplitSpace::exchangeSpaceSplitJoin() failure"); return ret; } @@ -212,13 +212,13 @@ static Space* BuildNewSpace(ViewManager& vm, Space::Class cls, Space* parent, Re return nullptr; } -void Space::saveState(Athena::io::IStreamWriter& w) const +void Space::saveState(athena::io::IStreamWriter& w) const { w.writeUint32Big(atUint32(m_class)); spaceState().write(w); } -void Space::saveState(Athena::io::YAMLDocWriter& w) const +void Space::saveState(athena::io::YAMLDocWriter& w) const { w.writeUint32("class", atUint32(m_class)); spaceState().write(w); diff --git a/Editor/Space.hpp b/Editor/Space.hpp index 93031a403..c62943b5c 100644 --- a/Editor/Space.hpp +++ b/Editor/Space.hpp @@ -1,11 +1,11 @@ #ifndef URDE_SPACE_HPP #define URDE_SPACE_HPP -#include -#include +#include +#include #include "ProjectManager.hpp" -namespace Specter +namespace specter { class View; class SplitView; @@ -17,7 +17,7 @@ namespace URDE class ViewManager; class RootSpace; -class Space : public Specter::ISpaceController +class Space : public specter::ISpaceController { friend class SplitSpace; public: @@ -38,28 +38,28 @@ public: InformationCenter }; - struct State : Athena::io::DNAYaml {Delete _d;}; + struct State : athena::io::DNAYaml {Delete _d;}; static Space* NewSpaceFromConfigStream(ViewManager& vm, Space* parent, ConfigReader& r); static RootSpace* NewRootSpaceFromConfigStream(ViewManager& vm, ConfigReader& r); - struct SpaceMenuNode : Specter::IMenuNode + struct SpaceMenuNode : specter::IMenuNode { - struct SubNodeData : Specter::IMenuNode + struct SubNodeData : specter::IMenuNode { Class m_cls; std::string m_key; std::string m_text; - Specter::Icon& m_icon; - Zeus::CColor m_color; + specter::Icon& m_icon; + zeus::CColor m_color; const std::string* text() const {return &m_text;} void activated(const boo::SWindowCoord& coord) {} - SubNodeData(Class cls, const char* key, const char* text, Specter::Icon& icon, const Zeus::CColor& color) + SubNodeData(Class cls, const char* key, const char* text, specter::Icon& icon, const zeus::CColor& color) : m_cls(cls), m_key(key), m_text(text), m_icon(icon), m_color(color) {} }; static std::vector s_subNodeDats; - struct SubNode : Specter::IMenuNode + struct SubNode : specter::IMenuNode { Space& m_space; const SubNodeData& m_data; @@ -91,14 +91,14 @@ public: return &sn.m_text; return nullptr; } - static Specter::Icon* LookupClassIcon(Class cls) + static specter::Icon* LookupClassIcon(Class cls) { for (SubNodeData& sn : s_subNodeDats) if (sn.m_cls == cls) return &sn.m_icon; return nullptr; } - static const Zeus::CColor* LookupClassColor(Class cls) + static const zeus::CColor* LookupClassColor(Class cls) { for (SubNodeData& sn : s_subNodeDats) if (sn.m_cls == cls) @@ -107,17 +107,17 @@ public: } } m_spaceMenuNode; - struct SpaceSelectBind : Specter::IButtonBinding + struct SpaceSelectBind : specter::IButtonBinding { Space& m_space; - const char* name(const Specter::Control* control) const {return SpaceMenuNode::s_text.c_str();} + const char* name(const specter::Control* control) const {return SpaceMenuNode::s_text.c_str();} - MenuStyle menuStyle(const Specter::Button* button) const {return MenuStyle::Primary;} - std::unique_ptr buildMenu(const Specter::Button* button); + MenuStyle menuStyle(const specter::Button* button) const {return MenuStyle::Primary;} + std::unique_ptr buildMenu(const specter::Button* button); SpaceSelectBind(Space& space) : m_space(space) {} } m_spaceSelectBind; - std::unique_ptr m_spaceSelectButton; + std::unique_ptr m_spaceSelectButton; protected: friend class ViewManager; @@ -125,7 +125,7 @@ protected: ViewManager& m_vm; Class m_class = Class::None; Space* m_parent; - std::unique_ptr m_spaceView; + std::unique_ptr m_spaceView; Space(ViewManager& vm, Class cls, Space* parent); /* Allows common Space code to access DNA-encoded state */ @@ -134,13 +134,13 @@ protected: /* Structural control */ virtual bool usesToolbar() const {return false;} virtual unsigned toolbarUnits() const {return 1;} - virtual void buildToolbarView(Specter::ViewResources& res, Specter::Toolbar& tb) {} - virtual Specter::View* buildContentView(Specter::ViewResources& res)=0; - virtual Specter::View* buildSpaceView(Specter::ViewResources& res); + virtual void buildToolbarView(specter::ViewResources& res, specter::Toolbar& tb) {} + virtual specter::View* buildContentView(specter::ViewResources& res)=0; + virtual specter::View* buildSpaceView(specter::ViewResources& res); public: - virtual void saveState(Athena::io::IStreamWriter& w) const; - virtual void saveState(Athena::io::YAMLDocWriter& w) const; + virtual void saveState(athena::io::IStreamWriter& w) const; + virtual void saveState(athena::io::YAMLDocWriter& w) const; virtual void reloadState() {} virtual void think() {} @@ -148,17 +148,17 @@ public: virtual Space* copy(Space* parent) const=0; bool spaceSplitAllowed() const {return true;} - Specter::ISplitSpaceController* spaceSplit(Specter::SplitView::Axis axis, int thisSlot); + specter::ISplitSpaceController* spaceSplit(specter::SplitView::Axis axis, int thisSlot); virtual std::unique_ptr exchangeSpaceSplitJoin(Space* removeSpace, std::unique_ptr&& keepSpace) {return std::unique_ptr();} - virtual Specter::View* basisView() {return m_spaceView.get();} + virtual specter::View* basisView() {return m_spaceView.get();} }; class RootSpace : public Space { friend class ViewManager; - std::unique_ptr m_rootView; + std::unique_ptr m_rootView; std::unique_ptr m_spaceTree; struct State : Space::State { @@ -181,7 +181,7 @@ public: #endif } - void saveState(Athena::io::IStreamWriter& w) const + void saveState(athena::io::IStreamWriter& w) const { w.writeUint32Big(atUint32(m_class)); m_state.write(w); @@ -192,7 +192,7 @@ public: w.writeUint32Big(0); } - void saveState(Athena::io::YAMLDocWriter& w) const + void saveState(athena::io::YAMLDocWriter& w) const { w.writeUint32("class", atUint32(m_class)); m_state.write(w); @@ -214,35 +214,35 @@ public: Space* copy(Space* parent) const {return nullptr;} bool spaceSplitAllowed() const {return false;} - Specter::View* buildSpaceView(Specter::ViewResources& res); - Specter::View* buildContentView(Specter::ViewResources& res) {return m_spaceTree->buildSpaceView(res);} + specter::View* buildSpaceView(specter::ViewResources& res); + specter::View* buildContentView(specter::ViewResources& res) {return m_spaceTree->buildSpaceView(res);} std::unique_ptr exchangeSpaceSplitJoin(Space* removeSpace, std::unique_ptr&& keepSpace); - Specter::View* basisView(); + specter::View* basisView(); }; -class SplitSpace : public Space, public Specter::ISplitSpaceController +class SplitSpace : public Space, public specter::ISplitSpaceController { friend class ViewManager; std::unique_ptr m_slots[2]; - std::unique_ptr m_splitView; + std::unique_ptr m_splitView; struct State : Space::State { DECL_YAML - Value axis = Specter::SplitView::Axis::Horizontal; + Value axis = specter::SplitView::Axis::Horizontal; Value split = 0.5; } m_state; const Space::State& spaceState() const {return m_state;} public: - SplitSpace(ViewManager& vm, Space* parent, Specter::SplitView::Axis axis) : Space(vm, Class::SplitSpace, parent) + SplitSpace(ViewManager& vm, Space* parent, specter::SplitView::Axis axis) : Space(vm, Class::SplitSpace, parent) { m_state.axis = axis; reloadState(); } SplitSpace(ViewManager& vm, Space* parent, ConfigReader& r) - : SplitSpace(vm, parent, Specter::SplitView::Axis::Horizontal) + : SplitSpace(vm, parent, specter::SplitView::Axis::Horizontal) { m_state.read(r); #ifdef URDE_BINARY_CONFIGS @@ -262,9 +262,9 @@ public: void reloadState() { m_state.split = std::min(1.f, std::max(0.f, m_state.split)); - if (m_state.axis != Specter::SplitView::Axis::Horizontal && - m_state.axis != Specter::SplitView::Axis::Vertical) - m_state.axis = Specter::SplitView::Axis::Horizontal; + if (m_state.axis != specter::SplitView::Axis::Horizontal && + m_state.axis != specter::SplitView::Axis::Vertical) + m_state.axis = specter::SplitView::Axis::Horizontal; if (m_splitView) { m_splitView->setSplit(m_state.split); @@ -272,7 +272,7 @@ public: } } - void saveState(Athena::io::IStreamWriter& w) const + void saveState(athena::io::IStreamWriter& w) const { w.writeUint32Big(atUint32(m_class)); m_state.write(w); @@ -289,7 +289,7 @@ public: w.writeUint32Big(0); } - void saveState(Athena::io::YAMLDocWriter& w) const + void saveState(athena::io::YAMLDocWriter& w) const { w.writeUint32("class", atUint32(m_class)); m_state.write(w); @@ -311,8 +311,8 @@ public: void setChildSlot(unsigned slot, std::unique_ptr&& space); - Specter::View* buildSpaceView(Specter::ViewResources& res) {return buildContentView(res);} - Specter::View* buildContentView(Specter::ViewResources& res); + specter::View* buildSpaceView(specter::ViewResources& res) {return buildContentView(res);} + specter::View* buildContentView(specter::ViewResources& res); Space* copy(Space* parent) const {return nullptr;} bool spaceSplitAllowed() const {return false;} @@ -330,20 +330,20 @@ public: std::unique_ptr exchangeSpaceSplitJoin(Space* removeSpace, std::unique_ptr&& keepSpace); - Specter::SplitView* splitView() {return m_splitView.get();} + specter::SplitView* splitView() {return m_splitView.get();} void updateSplit(float split) {m_state.split = split;} - void joinViews(Specter::SplitView* thisSplit, int thisSlot, Specter::SplitView* otherSplit, int otherSlot); + void joinViews(specter::SplitView* thisSplit, int thisSlot, specter::SplitView* otherSplit, int otherSlot); - void setAxis(Specter::SplitView::Axis axis) + void setAxis(specter::SplitView::Axis axis) { m_state.axis = axis; reloadState(); } - Specter::SplitView::Axis axis() const {return m_state.axis;} + specter::SplitView::Axis axis() const {return m_state.axis;} float split() const {return m_state.split;} - Specter::View* basisView() {return m_splitView.get();} + specter::View* basisView() {return m_splitView.get();} }; class ViewerSpace : public Space @@ -362,17 +362,17 @@ public: class TestSpace : public Space { - std::unique_ptr m_button; - std::unique_ptr m_textView; + std::unique_ptr m_button; + std::unique_ptr m_textView; std::string m_contentStr; std::string m_buttonStr; - Specter::IButtonBinding* m_binding; + specter::IButtonBinding* m_binding; public: TestSpace(ViewManager& vm, Space* parent, const std::string& content, const std::string& button, - Specter::IButtonBinding* binding) + specter::IButtonBinding* binding) : Space(vm, Class::TestSpace, parent), m_contentStr(content), m_buttonStr(button), m_binding(binding) {} @@ -383,15 +383,15 @@ public: Space::State& spaceState() {return m_state;} bool usesToolbar() const {return true;} - void buildToolbarView(Specter::ViewResources& res, Specter::Toolbar& tb) + void buildToolbarView(specter::ViewResources& res, specter::Toolbar& tb) { - m_button.reset(new Specter::Button(res, tb, m_binding, m_buttonStr)); + m_button.reset(new specter::Button(res, tb, m_binding, m_buttonStr)); tb.push_back(m_button.get(), 0); } - Specter::View* buildContentView(Specter::ViewResources& res) + specter::View* buildContentView(specter::ViewResources& res) { - m_textView.reset(new Specter::MultiLineTextView(res, *m_spaceView, res.m_heading14)); + m_textView.reset(new specter::MultiLineTextView(res, *m_spaceView, res.m_heading14)); m_textView->setBackground(res.themeData().viewportBackground()); m_textView->typesetGlyphs(m_contentStr, res.themeData().uiText()); return m_textView.get(); diff --git a/Editor/SplashScreen.cpp b/Editor/SplashScreen.cpp index 33679cc07..b04f371e0 100644 --- a/Editor/SplashScreen.cpp +++ b/Editor/SplashScreen.cpp @@ -17,9 +17,9 @@ namespace URDE #define LINE_WIDTH 2 #define TEXT_MARGIN 10 -SplashScreen::SplashScreen(ViewManager& vm, Specter::ViewResources& res) +SplashScreen::SplashScreen(ViewManager& vm, specter::ViewResources& res) : ModalWindow(res, vm.rootView(), - Specter::RectangleConstraint(SPLASH_WIDTH * res.pixelFactor(), + specter::RectangleConstraint(SPLASH_WIDTH * res.pixelFactor(), SPLASH_HEIGHT * res.pixelFactor())), m_vm(vm), m_textColor(res.themeData().uiText()), @@ -35,7 +35,7 @@ SplashScreen::SplashScreen(ViewManager& vm, Specter::ViewResources& res) GIT_COMMIT_HASH[0] != '\0' && GIT_BRANCH[0] != '\0') { - m_buildInfoStr = HECL::Format("%s: %s\n%s: %s\n%s: %s", + m_buildInfoStr = hecl::Format("%s: %s\n%s: %s\n%s: %s", vm.translateOr("branch", "Branch").c_str(), GIT_BRANCH, vm.translateOr("commit", "Commit").c_str(), GIT_COMMIT_HASH, vm.translateOr("date", "Date").c_str(), GIT_COMMIT_DATE); @@ -64,19 +64,19 @@ void SplashScreen::think() if (m_newProjBind.m_deferPath.size()) { - Log.report(LogVisor::Info, _S("Making project '%s'"), m_newProjBind.m_deferPath.c_str()); + Log.report(logvisor::Info, _S("Making project '%s'"), m_newProjBind.m_deferPath.c_str()); m_vm.projectManager().newProject(m_newProjBind.m_deferPath); m_newProjBind.m_deferPath.clear(); } else if (m_openProjBind.m_deferPath.size()) { - Log.report(LogVisor::Info, _S("Opening project '%s'"), m_openProjBind.m_deferPath.c_str()); + Log.report(logvisor::Info, _S("Opening project '%s'"), m_openProjBind.m_deferPath.c_str()); m_vm.projectManager().openProject(m_openProjBind.m_deferPath); m_openProjBind.m_deferPath.clear(); } else if (m_extractProjBind.m_deferPath.size()) { - Log.report(LogVisor::Info, _S("Extracting game '%s'"), m_extractProjBind.m_deferPath.c_str()); + Log.report(logvisor::Info, _S("Extracting game '%s'"), m_extractProjBind.m_deferPath.c_str()); m_vm.projectManager().extractGame(m_extractProjBind.m_deferPath); m_extractProjBind.m_deferPath.clear(); } @@ -84,31 +84,31 @@ void SplashScreen::think() void SplashScreen::updateContentOpacity(float opacity) { - Specter::ViewResources& res = rootView().viewRes(); + specter::ViewResources& res = rootView().viewRes(); if (!m_title && res.fontCacheReady()) { - m_title.reset(new Specter::TextView(res, *this, res.m_titleFont)); - Zeus::CColor clearColor = res.themeData().uiText(); + m_title.reset(new specter::TextView(res, *this, res.m_titleFont)); + zeus::CColor clearColor = res.themeData().uiText(); clearColor[3] = 0.0; m_title->typesetGlyphs("URDE", clearColor); - m_buildInfo.reset(new Specter::MultiLineTextView(res, *this, res.m_mainFont, Specter::TextView::Alignment::Right)); + m_buildInfo.reset(new specter::MultiLineTextView(res, *this, res.m_mainFont, specter::TextView::Alignment::Right)); m_buildInfo->typesetGlyphs(m_buildInfoStr, clearColor); - m_newButt.m_view.reset(new Specter::Button(res, *this, &m_newProjBind, m_newString, - nullptr, Specter::Button::Style::Text)); - m_openButt.m_view.reset(new Specter::Button(res, *this, &m_openProjBind, m_openString, - nullptr, Specter::Button::Style::Text)); - m_extractButt.m_view.reset(new Specter::Button(res, *this, &m_extractProjBind, m_extractString, - nullptr, Specter::Button::Style::Text)); + m_newButt.m_view.reset(new specter::Button(res, *this, &m_newProjBind, m_newString, + nullptr, specter::Button::Style::Text)); + m_openButt.m_view.reset(new specter::Button(res, *this, &m_openProjBind, m_openString, + nullptr, specter::Button::Style::Text)); + m_extractButt.m_view.reset(new specter::Button(res, *this, &m_extractProjBind, m_extractString, + nullptr, specter::Button::Style::Text)); updateSize(); } - Zeus::CColor clearColor = res.themeData().uiText(); + zeus::CColor clearColor = res.themeData().uiText(); clearColor[3] = 0.0; - Zeus::CColor color = Zeus::CColor::lerp(clearColor, res.themeData().uiText(), opacity); + zeus::CColor color = zeus::CColor::lerp(clearColor, res.themeData().uiText(), opacity); m_title->colorGlyphs(color); m_buildInfo->colorGlyphs(color); m_newButt.m_view->colorGlyphs(color); diff --git a/Editor/SplashScreen.hpp b/Editor/SplashScreen.hpp index a93c12297..b021ae4aa 100644 --- a/Editor/SplashScreen.hpp +++ b/Editor/SplashScreen.hpp @@ -1,51 +1,51 @@ #ifndef URDE_SPLASH_SCREEN_HPP #define URDE_SPLASH_SCREEN_HPP -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "ViewManager.hpp" namespace URDE { -static LogVisor::LogModule Log("Specter::SplashScreen"); +static logvisor::Module Log("specter::SplashScreen"); -class SplashScreen : public Specter::ModalWindow +class SplashScreen : public specter::ModalWindow { ViewManager& m_vm; - Zeus::CColor m_textColor; - Zeus::CColor m_textColorClear; + zeus::CColor m_textColor; + zeus::CColor m_textColorClear; - std::unique_ptr m_title; + std::unique_ptr m_title; std::string m_buildInfoStr; - std::unique_ptr m_buildInfo; + std::unique_ptr m_buildInfo; std::string m_newString; - Specter::ViewChild> m_newButt; + specter::ViewChild> m_newButt; std::string m_openString; - Specter::ViewChild> m_openButt; + specter::ViewChild> m_openButt; std::string m_extractString; - Specter::ViewChild> m_extractButt; + specter::ViewChild> m_extractButt; - Specter::ViewChild> m_fileBrowser; + specter::ViewChild> m_fileBrowser; - struct NewProjBinding : Specter::IButtonBinding + struct NewProjBinding : specter::IButtonBinding { SplashScreen& m_splash; - HECL::SystemString m_deferPath; + hecl::SystemString m_deferPath; NewProjBinding(SplashScreen& splash) : m_splash(splash) {} - const char* name(const Specter::Control* control) const {return m_splash.m_newString.c_str();} - const char* help(const Specter::Control* control) const {return "Creates an empty project at selected path";} - void activated(const Specter::Button* button, const boo::SWindowCoord& coord) + const char* name(const specter::Control* control) const {return m_splash.m_newString.c_str();} + const char* help(const specter::Control* control) const {return "Creates an empty project at selected path";} + void activated(const specter::Button* button, const boo::SWindowCoord& coord) { m_splash.m_fileBrowser.m_view.reset( - new Specter::FileBrowser(m_splash.rootView().viewRes(), + new specter::FileBrowser(m_splash.rootView().viewRes(), m_splash, m_splash.m_newString, - Specter::FileBrowser::Type::NewHECLProject, - [&](bool ok, const HECL::SystemString& path) + specter::FileBrowser::Type::NewHECLProject, + [&](bool ok, const hecl::SystemString& path) { if (ok) m_deferPath = path; @@ -55,20 +55,20 @@ class SplashScreen : public Specter::ModalWindow } } m_newProjBind; - struct OpenProjBinding : Specter::IButtonBinding + struct OpenProjBinding : specter::IButtonBinding { SplashScreen& m_splash; - HECL::SystemString m_deferPath; + hecl::SystemString m_deferPath; OpenProjBinding(SplashScreen& splash) : m_splash(splash), m_openRecentMenuRoot(*this) {} - const char* name(const Specter::Control* control) const {return m_splash.m_openString.c_str();} - const char* help(const Specter::Control* control) const {return "Opens an existing project at selected path";} - void activated(const Specter::Button* button, const boo::SWindowCoord& coord) + const char* name(const specter::Control* control) const {return m_splash.m_openString.c_str();} + const char* help(const specter::Control* control) const {return "Opens an existing project at selected path";} + void activated(const specter::Button* button, const boo::SWindowCoord& coord) { m_splash.m_fileBrowser.m_view.reset( - new Specter::FileBrowser(m_splash.rootView().viewRes(), + new specter::FileBrowser(m_splash.rootView().viewRes(), m_splash, m_splash.m_openString, - Specter::FileBrowser::Type::OpenHECLProject, - [&](bool ok, const HECL::SystemString& path) + specter::FileBrowser::Type::OpenHECLProject, + [&](bool ok, const hecl::SystemString& path) { if (ok) m_deferPath = path; @@ -77,7 +77,7 @@ class SplashScreen : public Specter::ModalWindow m_splash.m_openButt.mouseLeave(coord); } - struct OpenRecentMenuRoot : Specter::IMenuNode + struct OpenRecentMenuRoot : specter::IMenuNode { OpenProjBinding& m_openProjBind; OpenRecentMenuRoot(OpenProjBinding& openProjBind) : m_openProjBind(openProjBind) {} @@ -85,11 +85,11 @@ class SplashScreen : public Specter::ModalWindow std::string m_text; const std::string* text() const {return &m_text;} - struct OpenRecentMenuItem : Specter::IMenuNode + struct OpenRecentMenuItem : specter::IMenuNode { OpenRecentMenuRoot& m_parent; - HECL::SystemString m_path; + hecl::SystemString m_path; std::string m_text; const std::string* text() const {return &m_text;} @@ -99,54 +99,54 @@ class SplashScreen : public Specter::ModalWindow m_parent.m_openProjBind.m_splash.m_openButt.m_view->closeMenu(coord); } - OpenRecentMenuItem(OpenRecentMenuRoot& parent, const HECL::SystemString& path) + OpenRecentMenuItem(OpenRecentMenuRoot& parent, const hecl::SystemString& path) : m_parent(parent), m_path(path) { - std::vector pathComps = Specter::FileBrowser::PathComponents(path); + std::vector pathComps = specter::FileBrowser::PathComponents(path); if (pathComps.size()) - m_text = HECL::SystemUTF8View(pathComps.back()).str(); + m_text = hecl::SystemUTF8View(pathComps.back()).str(); } }; std::vector m_items; size_t subNodeCount() const {return m_items.size();} - Specter::IMenuNode* subNode(size_t idx) {return &m_items[idx];} + specter::IMenuNode* subNode(size_t idx) {return &m_items[idx];} - void buildNodes(const std::vector* recentProjects) + void buildNodes(const std::vector* recentProjects) { m_items.clear(); if (recentProjects) { m_items.reserve(recentProjects->size()); - for (const HECL::SystemString& path : *recentProjects) + for (const hecl::SystemString& path : *recentProjects) m_items.emplace_back(*this, path); } } } m_openRecentMenuRoot; - MenuStyle menuStyle(const Specter::Button* button) const {return MenuStyle::Auxiliary;} - std::unique_ptr buildMenu(const Specter::Button* button) + MenuStyle menuStyle(const specter::Button* button) const {return MenuStyle::Auxiliary;} + std::unique_ptr buildMenu(const specter::Button* button) { m_openRecentMenuRoot.buildNodes(m_splash.m_vm.recentProjects()); - return std::unique_ptr(new Specter::Menu(m_splash.rootView().viewRes(), + return std::unique_ptr(new specter::Menu(m_splash.rootView().viewRes(), m_splash, &m_openRecentMenuRoot)); } } m_openProjBind; - struct ExtractProjBinding : Specter::IButtonBinding + struct ExtractProjBinding : specter::IButtonBinding { SplashScreen& m_splash; - HECL::SystemString m_deferPath; + hecl::SystemString m_deferPath; ExtractProjBinding(SplashScreen& splash) : m_splash(splash) {} - const char* name(const Specter::Control* control) const {return m_splash.m_extractString.c_str();} - const char* help(const Specter::Control* control) const {return "Extracts game image as project at selected path";} - void activated(const Specter::Button* button, const boo::SWindowCoord& coord) + const char* name(const specter::Control* control) const {return m_splash.m_extractString.c_str();} + const char* help(const specter::Control* control) const {return "Extracts game image as project at selected path";} + void activated(const specter::Button* button, const boo::SWindowCoord& coord) { m_splash.m_fileBrowser.m_view.reset( - new Specter::FileBrowser(m_splash.rootView().viewRes(), + new specter::FileBrowser(m_splash.rootView().viewRes(), m_splash, m_splash.m_extractString, - Specter::FileBrowser::Type::OpenFile, - [&](bool ok, const HECL::SystemString& path) + specter::FileBrowser::Type::OpenFile, + [&](bool ok, const hecl::SystemString& path) { if (ok) m_deferPath = path; @@ -157,7 +157,7 @@ class SplashScreen : public Specter::ModalWindow } m_extractProjBind; public: - SplashScreen(ViewManager& vm, Specter::ViewResources& res); + SplashScreen(ViewManager& vm, specter::ViewResources& res); void think(); void updateContentOpacity(float opacity); diff --git a/Editor/ViewManager.cpp b/Editor/ViewManager.cpp index 253904efd..fa65b0bb6 100644 --- a/Editor/ViewManager.cpp +++ b/Editor/ViewManager.cpp @@ -1,7 +1,7 @@ #include "ViewManager.hpp" -#include "Specter/Control.hpp" -#include "Specter/Space.hpp" -#include "Specter/Menu.hpp" +#include "specter/Control.hpp" +#include "specter/Space.hpp" +#include "specter/Menu.hpp" #include "SplashScreen.hpp" #include "locale/locale.hpp" #include "ResourceBrowser.hpp" @@ -9,25 +9,25 @@ #include "Runtime/Particle/CGenDescription.hpp" #include "Runtime/Particle/CElectricDescription.hpp" #include "Runtime/Particle/CSwooshDescription.hpp" -#include "Runtime/CModel.hpp" -#include "Runtime/CGraphics.hpp" +#include "Runtime/Graphics/CModel.hpp" +#include "Runtime/Graphics/CGraphics.hpp" #include -using YAMLNode = Athena::io::YAMLNode; +using YAMLNode = athena::io::YAMLNode; namespace URDE { -void ViewManager::BuildTestPART(pshag::IObjectStore& objStore) +void ViewManager::BuildTestPART(urde::IObjectStore& objStore) { - //m_partGenDesc = objStore.GetObj({HECL::FOURCC('PART'), 0x972A5CD2}); + //m_partGenDesc = objStore.GetObj({hecl::FOURCC('PART'), 0x972A5CD2}); m_partGenDesc = objStore.GetObj("BusterSparks"); - m_partGen.reset(new pshag::CElementGen(m_partGenDesc, - pshag::CElementGen::EModelOrientationType::Normal, - pshag::CElementGen::EOptionalSystemFlags::None)); + m_partGen.reset(new urde::CElementGen(m_partGenDesc, + urde::CElementGen::EModelOrientationType::Normal, + urde::CElementGen::EOptionalSystemFlags::None)); m_partGen->SetGlobalScale({5.f, 5.f, 5.f}); m_particleView.reset(new ParticleView(*this, m_viewResources, *m_rootView)); - m_lineRenderer.reset(new pshag::CLineRenderer(pshag::CLineRenderer::EPrimitiveMode::LineStrip, 4, nullptr, true)); + m_lineRenderer.reset(new urde::CLineRenderer(urde::CLineRenderer::EPrimitiveMode::LineStrip, 4, nullptr, true)); //m_rootView->accessContentViews().clear(); m_rootView->accessContentViews().push_back(m_particleView.get()); @@ -36,8 +36,8 @@ void ViewManager::BuildTestPART(pshag::IObjectStore& objStore) void ViewManager::ParticleView::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) { - Specter::View::resized(root, sub); - pshag::CGraphics::SetViewportResolution({sub.size[0], sub.size[1]}); + specter::View::resized(root, sub); + urde::CGraphics::SetViewportResolution({sub.size[0], sub.size[1]}); } void ViewManager::ParticleView::draw(boo::IGraphicsCommandQueue *gfxQ) @@ -49,35 +49,35 @@ void ViewManager::ParticleView::draw(boo::IGraphicsCommandQueue *gfxQ) if (m_vm.m_partGen->IsSystemDeletable()) m_vm.m_partGen->Reset(); - pshag::CGraphics::SetModelMatrix(Zeus::CTransform::Identity()); - pshag::CGraphics::SetViewPointMatrix(Zeus::CTransform::Identity() + Zeus::CVector3f(0.f, -10.f, 0.f)); + urde::CGraphics::SetModelMatrix(zeus::CTransform::Identity()); + urde::CGraphics::SetViewPointMatrix(zeus::CTransform::Identity() + zeus::CVector3f(0.f, -10.f, 0.f)); boo::SWindowRect windowRect = m_vm.m_mainWindow->getWindowFrame(); float aspect = windowRect.size[0] / float(windowRect.size[1]); - pshag::CGraphics::SetPerspective(55.0, aspect, 0.001f, 1000.f); + urde::CGraphics::SetPerspective(55.0, aspect, 0.001f, 1000.f); //gfxQ->clearTarget(false, true); m_vm.m_partGen->Render(); /* m_vm.m_lineRenderer->Reset(); - m_vm.m_lineRenderer->AddVertex({-0.5f, 0.f, -0.5f}, Zeus::CColor::skBlue, 1.f); - m_vm.m_lineRenderer->AddVertex({-0.5f, 0.f, 0.5f}, Zeus::CColor::skBlue, 1.f); - m_vm.m_lineRenderer->AddVertex({0.5f, 10.f, 0.5f}, Zeus::CColor::skRed, 3.f); - m_vm.m_lineRenderer->AddVertex({0.5f, 0.f, -0.5f}, Zeus::CColor::skBlue, 1.f); + m_vm.m_lineRenderer->AddVertex({-0.5f, 0.f, -0.5f}, zeus::CColor::skBlue, 1.f); + m_vm.m_lineRenderer->AddVertex({-0.5f, 0.f, 0.5f}, zeus::CColor::skBlue, 1.f); + m_vm.m_lineRenderer->AddVertex({0.5f, 10.f, 0.5f}, zeus::CColor::skRed, 3.f); + m_vm.m_lineRenderer->AddVertex({0.5f, 0.f, -0.5f}, zeus::CColor::skBlue, 1.f); m_vm.m_lineRenderer->Render(); */ } } -Specter::View* ViewManager::BuildSpaceViews() +specter::View* ViewManager::BuildSpaceViews() { m_rootSpaceView = m_rootSpace->buildSpaceView(m_viewResources); return m_rootSpaceView; } -Specter::RootView* ViewManager::SetupRootView() +specter::RootView* ViewManager::SetupRootView() { - m_rootView.reset(new Specter::RootView(*this, m_viewResources, m_mainWindow.get())); - m_rootView->setBackground(Zeus::CColor::skBlack); + m_rootView.reset(new specter::RootView(*this, m_viewResources, m_mainWindow.get())); + m_rootView->setBackground(zeus::CColor::skBlack); return m_rootView.get(); } @@ -89,9 +89,9 @@ SplashScreen* ViewManager::SetupSplashView() return m_splash.get(); } -void ViewManager::RootSpaceViewBuilt(Specter::View *view) +void ViewManager::RootSpaceViewBuilt(specter::View *view) { - std::vector& cViews = m_rootView->accessContentViews(); + std::vector& cViews = m_rootView->accessContentViews(); cViews.clear(); cViews.push_back(view); cViews.push_back(m_splash.get()); @@ -102,7 +102,7 @@ void ViewManager::SetupEditorView() { m_rootSpace.reset(new RootSpace(*this)); - SplitSpace* split = new SplitSpace(*this, nullptr, Specter::SplitView::Axis::Horizontal); + SplitSpace* split = new SplitSpace(*this, nullptr, specter::SplitView::Axis::Horizontal); m_rootSpace->setChild(std::unique_ptr(split)); split->setChildSlot(0, std::make_unique(*this, split)); split->setChildSlot(1, std::make_unique(*this, split)); @@ -131,39 +131,39 @@ void ViewManager::DismissSplash() m_splash->close(); } -ViewManager::ViewManager(HECL::Runtime::FileStoreManager& fileMgr, HECL::CVarManager& cvarMgr) +ViewManager::ViewManager(hecl::Runtime::FileStoreManager& fileMgr, hecl::CVarManager& cvarMgr) : m_fileStoreManager(fileMgr), m_cvarManager(cvarMgr), m_projManager(*this), m_fontCache(fileMgr), m_translator(URDE::SystemLocaleOrEnglish()), - m_recentProjectsPath(HECL::SysFormat(_S("%s/recent_projects.txt"), fileMgr.getStoreRoot().c_str())), - m_recentFilesPath(HECL::SysFormat(_S("%s/recent_files.txt"), fileMgr.getStoreRoot().c_str())) + m_recentProjectsPath(hecl::SysFormat(_S("%s/recent_projects.txt"), fileMgr.getStoreRoot().c_str())), + m_recentFilesPath(hecl::SysFormat(_S("%s/recent_files.txt"), fileMgr.getStoreRoot().c_str())) { Space::SpaceMenuNode::InitializeStrings(*this); char path[2048]; - HECL::Sstat theStat; + hecl::Sstat theStat; - FILE* fp = HECL::Fopen(m_recentProjectsPath.c_str(), _S("r"), HECL::FileLockType::Read); + FILE* fp = hecl::Fopen(m_recentProjectsPath.c_str(), _S("r"), hecl::FileLockType::Read); if (fp) { while (fgets(path, 2048, fp)) { std::string pathStr(path); pathStr.pop_back(); - HECL::SystemStringView pathStrView(pathStr); - if (!HECL::Stat(pathStrView.c_str(), &theStat) && S_ISDIR(theStat.st_mode)) + hecl::SystemStringView pathStrView(pathStr); + if (!hecl::Stat(pathStrView.c_str(), &theStat) && S_ISDIR(theStat.st_mode)) m_recentProjects.push_back(pathStrView); } fclose(fp); } - fp = HECL::Fopen(m_recentFilesPath.c_str(), _S("r"), HECL::FileLockType::Read); + fp = hecl::Fopen(m_recentFilesPath.c_str(), _S("r"), hecl::FileLockType::Read); if (fp) { while (fgets(path, 2048, fp)) { std::string pathStr(path); pathStr.pop_back(); - HECL::SystemStringView pathStrView(pathStr); - if (!HECL::Stat(pathStrView.c_str(), &theStat) && S_ISDIR(theStat.st_mode)) + hecl::SystemStringView pathStrView(pathStr); + if (!hecl::Stat(pathStrView.c_str(), &theStat) && S_ISDIR(theStat.st_mode)) m_recentFiles.push_back(pathStrView); } fclose(fp); @@ -172,36 +172,36 @@ ViewManager::ViewManager(HECL::Runtime::FileStoreManager& fileMgr, HECL::CVarMan ViewManager::~ViewManager() {} -void ViewManager::pushRecentProject(const HECL::SystemString& path) +void ViewManager::pushRecentProject(const hecl::SystemString& path) { - for (HECL::SystemString& testPath : m_recentProjects) + for (hecl::SystemString& testPath : m_recentProjects) { if (path == testPath) return; } m_recentProjects.push_back(path); - FILE* fp = HECL::Fopen(m_recentProjectsPath.c_str(), _S("w"), HECL::FileLockType::Write); + FILE* fp = hecl::Fopen(m_recentProjectsPath.c_str(), _S("w"), hecl::FileLockType::Write); if (fp) { - for (HECL::SystemString& pPath : m_recentProjects) - fprintf(fp, "%s\n", HECL::SystemUTF8View(pPath).c_str()); + for (hecl::SystemString& pPath : m_recentProjects) + fprintf(fp, "%s\n", hecl::SystemUTF8View(pPath).c_str()); fclose(fp); } } -void ViewManager::pushRecentFile(const HECL::SystemString& path) +void ViewManager::pushRecentFile(const hecl::SystemString& path) { - for (HECL::SystemString& testPath : m_recentFiles) + for (hecl::SystemString& testPath : m_recentFiles) { if (path == testPath) return; } m_recentFiles.push_back(path); - FILE* fp = HECL::Fopen(m_recentFilesPath.c_str(), _S("w"), HECL::FileLockType::Write); + FILE* fp = hecl::Fopen(m_recentFilesPath.c_str(), _S("w"), hecl::FileLockType::Write); if (fp) { - for (HECL::SystemString& pPath : m_recentFiles) - fprintf(fp, "%s\n", HECL::SystemUTF8View(pPath).c_str()); + for (hecl::SystemString& pPath : m_recentFiles) + fprintf(fp, "%s\n", hecl::SystemUTF8View(pPath).c_str()); fclose(fp); }} @@ -217,16 +217,16 @@ void ViewManager::init(boo::IApplication* app) m_viewResources.init(gf, &m_fontCache, &m_themeData, pixelFactor); m_iconsToken = InitializeIcons(m_viewResources); m_viewResources.prepFontCacheAsync(m_mainWindow.get()); - Specter::RootView* root = SetupRootView(); + specter::RootView* root = SetupRootView(); m_showSplash = true; root->accessContentViews().push_back(SetupSplashView()); root->updateSize(); m_mainWindow->setWaitCursor(false); - pshag::CGraphics::InitializeBoo(gf, m_mainWindow->getCommandQueue(), root->renderTex()); - pshag::CElementGen::Initialize(); - pshag::CLineRenderer::Initialize(); + urde::CGraphics::InitializeBoo(gf, m_mainWindow->getCommandQueue(), root->renderTex()); + urde::CElementGen::Initialize(); + urde::CLineRenderer::Initialize(); } bool ViewManager::proc() @@ -238,12 +238,12 @@ bool ViewManager::proc() if (m_updatePf) { m_viewResources.resetPixelFactor(m_reqPf); - Specter::RootView* root = SetupRootView(); + specter::RootView* root = SetupRootView(); if (m_rootSpace) BuildSpaceViews(); else { - std::vector& cViews = m_rootView->accessContentViews(); + std::vector& cViews = m_rootView->accessContentViews(); cViews.push_back(SetupSplashView()); } root->updateSize(); @@ -266,7 +266,7 @@ bool ViewManager::proc() ++m_editorFrames; if (m_rootSpaceView && m_editorFrames <= 30) - m_rootSpaceView->setMultiplyColor(Zeus::CColor::lerp({1,1,1,0}, {1,1,1,1}, m_editorFrames / 30.0)); + m_rootSpaceView->setMultiplyColor(zeus::CColor::lerp({1,1,1,0}, {1,1,1,1}, m_editorFrames / 30.0)); m_rootView->draw(gfxQ); gfxQ->execute(); @@ -277,8 +277,8 @@ bool ViewManager::proc() void ViewManager::stop() { - pshag::CElementGen::Shutdown(); - pshag::CLineRenderer::Shutdown(); + urde::CElementGen::Shutdown(); + urde::CLineRenderer::Shutdown(); m_iconsToken.doDestroy(); m_viewResources.destroyResData(); m_fontCache.destroyAtlases(); diff --git a/Editor/ViewManager.hpp b/Editor/ViewManager.hpp index 102498cc0..ee8b94ee6 100644 --- a/Editor/ViewManager.hpp +++ b/Editor/ViewManager.hpp @@ -1,7 +1,7 @@ #ifndef URDE_VIEW_MANAGER_HPP #define URDE_VIEW_MANAGER_HPP -#include +#include #include "ProjectManager.hpp" #include "Space.hpp" @@ -12,54 +12,54 @@ namespace URDE { class SplashScreen; -class ViewManager : public Specter::IViewManager +class ViewManager : public specter::IViewManager { friend class ProjectManager; friend class Space; friend class RootSpace; friend class SplitSpace; - HECL::Runtime::FileStoreManager& m_fileStoreManager; - HECL::CVarManager& m_cvarManager; + hecl::Runtime::FileStoreManager& m_fileStoreManager; + hecl::CVarManager& m_cvarManager; ProjectManager m_projManager; - Specter::FontCache m_fontCache; - Specter::DefaultThemeData m_themeData; - Specter::ViewResources m_viewResources; + specter::FontCache m_fontCache; + specter::DefaultThemeData m_themeData; + specter::ViewResources m_viewResources; boo::GraphicsDataToken m_iconsToken; - Specter::Translator m_translator; + specter::Translator m_translator; std::unique_ptr m_mainWindow; - std::unique_ptr m_rootView; + std::unique_ptr m_rootView; std::unique_ptr m_splash; std::unique_ptr m_rootSpace; - Specter::View* m_rootSpaceView = nullptr; + specter::View* m_rootSpaceView = nullptr; - class ParticleView : public Specter::View + class ParticleView : public specter::View { ViewManager& m_vm; public: - ParticleView(ViewManager& vm, Specter::ViewResources& res, Specter::View& parent) + ParticleView(ViewManager& vm, specter::ViewResources& res, specter::View& parent) : View(res, parent), m_vm(vm) {} void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void draw(boo::IGraphicsCommandQueue* gfxQ); }; std::unique_ptr m_particleView; - pshag::TLockedToken m_partGenDesc; - std::unique_ptr m_partGen; - std::unique_ptr m_lineRenderer; + urde::TLockedToken m_partGenDesc; + std::unique_ptr m_partGen; + std::unique_ptr m_lineRenderer; - HECL::SystemString m_recentProjectsPath; - std::vector m_recentProjects; - HECL::SystemString m_recentFilesPath; - std::vector m_recentFiles; + hecl::SystemString m_recentProjectsPath; + std::vector m_recentProjects; + hecl::SystemString m_recentFilesPath; + std::vector m_recentFiles; bool m_updatePf = false; float m_reqPf; - Specter::View* BuildSpaceViews(); - Specter::RootView* SetupRootView(); + specter::View* BuildSpaceViews(); + specter::RootView* SetupRootView(); SplashScreen* SetupSplashView(); - void RootSpaceViewBuilt(Specter::View* view); + void RootSpaceViewBuilt(specter::View* view); void SetupEditorView(); void SetupEditorView(ConfigReader& r); void SaveEditorView(ConfigWriter& w); @@ -70,18 +70,18 @@ class ViewManager : public Specter::IViewManager unsigned m_editorFrames = 120; void FadeInEditors() {m_editorFrames = 0;} - void BuildTestPART(pshag::IObjectStore& objStore); + void BuildTestPART(urde::IObjectStore& objStore); Space* m_deferSplit = nullptr; - Specter::SplitView::Axis m_deferSplitAxis; + specter::SplitView::Axis m_deferSplitAxis; int m_deferSplitThisSlot; boo::SWindowCoord m_deferSplitCoord; public: - ViewManager(HECL::Runtime::FileStoreManager& fileMgr, HECL::CVarManager& cvarMgr); + ViewManager(hecl::Runtime::FileStoreManager& fileMgr, hecl::CVarManager& cvarMgr); ~ViewManager(); - Specter::RootView& rootView() const {return *m_rootView;} + specter::RootView& rootView() const {return *m_rootView;} void requestPixelFactor(float pf) { m_reqPf = pf; @@ -89,10 +89,10 @@ public: } ProjectManager& projectManager() {return m_projManager;} - HECL::Database::Project* project() {return m_projManager.project();} - const Specter::Translator* getTranslator() const {return &m_translator;} + hecl::Database::Project* project() {return m_projManager.project();} + const specter::Translator* getTranslator() const {return &m_translator;} - void deferSpaceSplit(Specter::ISpaceController* split, Specter::SplitView::Axis axis, int thisSlot, + void deferSpaceSplit(specter::ISpaceController* split, specter::SplitView::Axis axis, int thisSlot, const boo::SWindowCoord& coord) { m_deferSplit = static_cast(split); @@ -101,11 +101,11 @@ public: m_deferSplitCoord = coord; } - const std::vector* recentProjects() const {return &m_recentProjects;} - void pushRecentProject(const HECL::SystemString& path); + const std::vector* recentProjects() const {return &m_recentProjects;} + void pushRecentProject(const hecl::SystemString& path); - const std::vector* recentFiles() const {return &m_recentFiles;} - void pushRecentFile(const HECL::SystemString& path); + const std::vector* recentFiles() const {return &m_recentFiles;} + void pushRecentFile(const hecl::SystemString& path); void init(boo::IApplication* app); bool proc(); diff --git a/Editor/icons/icons.cpp b/Editor/icons/icons.cpp index 3f93a1dcb..61751aee8 100644 --- a/Editor/icons/icons.cpp +++ b/Editor/icons/icons.cpp @@ -1,5 +1,5 @@ #include "icons.hpp" -#include "Athena/MemoryReader.hpp" +#include "athena/MemoryReader.hpp" #include extern "C" uint8_t URDE_ICONS[]; @@ -7,16 +7,16 @@ extern "C" size_t URDE_ICONS_SZ; namespace URDE { -static LogVisor::LogModule Log("URDE::icons"); +static logvisor::Module Log("URDE::icons"); -Specter::IconAtlas<8,8> g_IconAtlas; +specter::IconAtlas<8,8> g_IconAtlas; -boo::GraphicsDataToken InitializeIcons(Specter::ViewResources& viewRes) +boo::GraphicsDataToken InitializeIcons(specter::ViewResources& viewRes) { - Athena::io::MemoryReader r(URDE_ICONS, URDE_ICONS_SZ); + athena::io::MemoryReader r(URDE_ICONS, URDE_ICONS_SZ); size_t fmt = r.readUint32Big(); if (fmt != 16) - Log.report(LogVisor::FatalError, "incorrect icon texture format"); + Log.report(logvisor::Fatal, "incorrect icon texture format"); size_t width = r.readUint16Big(); size_t height = r.readUint16Big(); size_t mips = r.readUint32Big(); @@ -26,14 +26,14 @@ boo::GraphicsDataToken InitializeIcons(Specter::ViewResources& viewRes) uLongf destSz = decompSz; size_t pos = r.position(); if (uncompress(texels.get(), &destSz, URDE_ICONS + pos, URDE_ICONS_SZ - pos) != Z_OK) - Log.report(LogVisor::FatalError, "unable to decompress icons"); + Log.report(logvisor::Fatal, "unable to decompress icons"); g_IconAtlas.initializeAtlas(viewRes.m_factory->newStaticTexture(width, height, mips, boo::TextureFormat::RGBA8, texels.get(), destSz)); return viewRes.m_factory->commit(); } -Specter::Icon& GetIcon(SpaceIcon icon) +specter::Icon& GetIcon(SpaceIcon icon) { switch (icon) { @@ -50,7 +50,7 @@ Specter::Icon& GetIcon(SpaceIcon icon) } } -Specter::Icon& GetIcon(MonoIcon icon) +specter::Icon& GetIcon(MonoIcon icon) { switch (icon) { diff --git a/Editor/icons/icons.hpp b/Editor/icons/icons.hpp index 023344f16..8ab8c16d5 100644 --- a/Editor/icons/icons.hpp +++ b/Editor/icons/icons.hpp @@ -1,12 +1,12 @@ #ifndef URDE_ICONS_HPP #define URDE_ICONS_HPP -#include "Specter/Icon.hpp" -#include "Specter/ViewResources.hpp" +#include "specter/Icon.hpp" +#include "specter/ViewResources.hpp" namespace URDE { -boo::GraphicsDataToken InitializeIcons(Specter::ViewResources& viewRes); +boo::GraphicsDataToken InitializeIcons(specter::ViewResources& viewRes); enum class SpaceIcon { @@ -16,7 +16,7 @@ enum class SpaceIcon ModelViewer, InformationCenter }; -Specter::Icon& GetIcon(SpaceIcon icon); +specter::Icon& GetIcon(SpaceIcon icon); enum class MonoIcon { @@ -37,7 +37,7 @@ enum class MonoIcon Folder, Info }; -Specter::Icon& GetIcon(MonoIcon icon); +specter::Icon& GetIcon(MonoIcon icon); } diff --git a/Editor/locale/locale.cpp b/Editor/locale/locale.cpp index c4cbe4ecf..cd4f0d80a 100644 --- a/Editor/locale/locale.cpp +++ b/Editor/locale/locale.cpp @@ -15,7 +15,7 @@ extern "C" size_t L_ja_JP_SZ; namespace URDE { -static const Specter::Locale Locales[] = +static const specter::Locale Locales[] = { {"en_US", "US English", L_en_US, L_en_US_SZ}, {"en_GB", "British English", L_en_GB, L_en_GB_SZ}, @@ -29,32 +29,32 @@ std::vector> ListLocales() ret.reserve(localeCount); for (size_t i=0 ; i::value; for (size_t i=0 ; i::value; for (size_t i=0 ; i +#include namespace URDE { std::vector> ListLocales(); -const Specter::Locale* LookupLocale(const std::string& name); -const Specter::Locale* SystemLocaleOrEnglish(); +const specter::Locale* LookupLocale(const std::string& name); +const specter::Locale* SystemLocaleOrEnglish(); } diff --git a/Editor/main.cpp b/Editor/main.cpp index a3c5c157b..08c17c4da 100644 --- a/Editor/main.cpp +++ b/Editor/main.cpp @@ -1,20 +1,20 @@ -#include -#include -#include -#include -#include +#include "logvisor/logvisor.hpp" +#include "boo/boo.hpp" +#include "specter/specter.hpp" +#include "hecl/CVarManager.hpp" +#include "Runtime/CGameAllocator.hpp" #include #include "ViewManager.hpp" -#include +#include "Runtime/Particle/CElementGen.hpp" namespace URDE { -LogVisor::LogModule Log{"URDE"}; +logvisor::Module Log{"URDE"}; struct Application : boo::IApplicationCallback { - HECL::Runtime::FileStoreManager m_fileMgr; - HECL::CVarManager m_cvarManager; + hecl::Runtime::FileStoreManager m_fileMgr; + hecl::CVarManager m_cvarManager; std::unique_ptr m_viewManager; bool m_running = true; @@ -51,12 +51,12 @@ struct Application : boo::IApplicationCallback void initialize(boo::IApplication* app) { - Zeus::detectCPU(); + zeus::detectCPU(); - const Zeus::CPUInfo& cpuInf = Zeus::cpuFeatures(); - Log.report(LogVisor::Info, "CPU Name: %s", cpuInf.cpuBrand); - Log.report(LogVisor::Info, "CPU Vendor: %s", cpuInf.cpuVendor); - HECL::SystemString features; + const zeus::CPUInfo& cpuInf = zeus::cpuFeatures(); + Log.report(logvisor::Info, "CPU Name: %s", cpuInf.cpuBrand); + Log.report(logvisor::Info, "CPU Vendor: %s", cpuInf.cpuVendor); + hecl::SystemString features; if (cpuInf.AESNI) features += _S("AES-NI"); if (cpuInf.SSE1) @@ -68,14 +68,14 @@ struct Application : boo::IApplicationCallback } else { - Log.report(LogVisor::FatalError, _S("URDE requires SSE1 minimum")); + Log.report(logvisor::Fatal, _S("URDE requires SSE1 minimum")); return; } if (cpuInf.SSE2) features += _S(", SSE2"); else { - Log.report(LogVisor::FatalError, _S("URDE requires SSE2 minimum")); + Log.report(logvisor::Fatal, _S("URDE requires SSE2 minimum")); return; } if (cpuInf.SSE3) @@ -88,7 +88,7 @@ struct Application : boo::IApplicationCallback features += _S(", SSE4.1"); if (cpuInf.SSE42) features += _S(", SSE4.2"); - Log.report(LogVisor::Info, _S("CPU Features: %s"), features.c_str()); + Log.report(logvisor::Info, _S("CPU Features: %s"), features.c_str()); } }; @@ -100,7 +100,7 @@ int wmain(int argc, const boo::SystemChar** argv) int main(int argc, const boo::SystemChar** argv) #endif { - LogVisor::RegisterConsoleLogger(); + logvisor::RegisterConsoleLogger(); URDE::Application appCb; int ret = boo::ApplicationRun(boo::IApplication::EPlatformType::Auto, appCb, _S("urde"), _S("URDE"), argc, argv, false); @@ -120,7 +120,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR lpCmdLine, int) for (int i=0 ; i #include "../RetroTypes.hpp" #include "CSfxHandle.hpp" -#include "CVector3f.hpp" +#include "zeus/CVector3f.hpp" #include "CAudioSys.hpp" -namespace pshag +namespace urde { class CSfxManager diff --git a/Runtime/CActor.cpp b/Runtime/CActor.cpp index 240371f5a..a3cdc9343 100644 --- a/Runtime/CActor.cpp +++ b/Runtime/CActor.cpp @@ -1,5 +1,5 @@ #include "CActor.hpp" -namespace pshag +namespace urde { } diff --git a/Runtime/CActor.hpp b/Runtime/CActor.hpp index 46a6d6281..056e8434f 100644 --- a/Runtime/CActor.hpp +++ b/Runtime/CActor.hpp @@ -2,9 +2,9 @@ #define __PSHAG_CACTOR_HPP__ #include "CEntity.hpp" -#include +#include "zeus/zeus.hpp" -namespace pshag +namespace urde { enum class ECollisionResponseType @@ -31,7 +31,7 @@ protected: Unknown7 = (1 << 7), }; - Zeus::CTransform x34_transform; + zeus::CTransform x34_transform; float x40_unknown; float x50_unknown; float x60_unknown; @@ -42,20 +42,20 @@ protected: bool xd0_b2_flags : 1; public: CActor(TUniqueId, bool, const std::string&, const CEntityInfo&, - const Zeus::CTransform&, const CModelData&, const CMaterialList&, + const zeus::CTransform&, const CModelData&, const CMaterialList&, const CActorParameters&, TUniqueId); virtual void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) {} - virtual Zeus::CVector3f GetAimPosition(const CStateManager&, float) - { return Zeus::CVector3f(x40_unknown, x50_unknown, x60_unknown); } + virtual zeus::CVector3f GetAimPosition(const CStateManager&, float) + { return zeus::CVector3f(x40_unknown, x50_unknown, x60_unknown); } virtual bool ValidAimTarget() { return true; } virtual bool ValidOrbitTarget() { return true; } virtual bool GetOrbitDistanceCheck() { return true; } - virtual Zeus::CVector3f GetOrbitPosition() - { return Zeus::CVector3f(x40_unknown, x50_unknown, x60_unknown); } + virtual zeus::CVector3f GetOrbitPosition() + { return zeus::CVector3f(x40_unknown, x50_unknown, x60_unknown); } - virtual ECollisionResponseType GetCollisionResponseType(const Zeus::CVector3f&, const Zeus::CVector3f&, CWeaponMode&, int) { return ECollisionResponseType::Unknown12; } + virtual ECollisionResponseType GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&, CWeaponMode&, int) { return ECollisionResponseType::Unknown12; } void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&){} void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&){ } void RemoveMaterial(EMaterialTypes, EMaterialTypes, CStateManager&){ } diff --git a/Runtime/CAi.cpp b/Runtime/CAi.cpp index 3e030470e..8820ea827 100644 --- a/Runtime/CAi.cpp +++ b/Runtime/CAi.cpp @@ -1,6 +1,6 @@ #include "CAi.hpp" -namespace pshag +namespace urde { } diff --git a/Runtime/CAi.hpp b/Runtime/CAi.hpp index 695a0a94f..1b3544368 100644 --- a/Runtime/CAi.hpp +++ b/Runtime/CAi.hpp @@ -7,9 +7,9 @@ #include "CEntity.hpp" #include "CPhysicsActor.hpp" -#include +#include "zeus/zeus.hpp" -namespace pshag +namespace urde { /* TODO: Figure out what all this is for and move it somewhere appropriate */ @@ -55,10 +55,10 @@ public: virtual CHealthInfo GetHealthInfo(const CStateManager&) { return x240_healthInfo; } virtual CDamageVulnerability GetDamageVulnerability() { return x248_damageVulnerability; } - virtual void TakeDamage(const Zeus::CVector3f&, float) {} + virtual void TakeDamage(const zeus::CVector3f&, float) {} virtual bool CanBeShot(const CStateManager&, int) { return true; } virtual bool IsListening() { return false; } - virtual int Listen(const Zeus::CVector3f&, EListenNoiseType) { return 0; } + virtual int Listen(const zeus::CVector3f&, EListenNoiseType) { return 0; } virtual void Patrol(CStateManager&, EStateMsg, float) {} virtual void FollowPattern(CStateManager&, EStateMsg, float) {} diff --git a/Runtime/CArchitectureMessage.hpp b/Runtime/CArchitectureMessage.hpp index e2668e295..69eebe543 100644 --- a/Runtime/CArchitectureMessage.hpp +++ b/Runtime/CArchitectureMessage.hpp @@ -5,7 +5,7 @@ #include "Input/CFinalInput.hpp" #include "rstl.hpp" -namespace pshag +namespace urde { class CIOWin; @@ -13,7 +13,7 @@ enum class EArchMsgTarget { IOWinManager = 0, Game = 1, - /* PathShagged targets, we start at 255 */ + /* URDE targets, we start at 255 */ ArchitectureSupport = 255, }; @@ -30,7 +30,7 @@ enum class EArchMsgType QuitGameplay = 8, UpdateBegin = 10, FrameBegin = 11, - /* PathShagged messages, we start at 255 */ + /* URDE messages, we start at 255 */ ApplicationExit = 255, }; @@ -155,7 +155,7 @@ public: { return *msg.GetParm(); } - /* PathShagged Messages */ + /* URDE Messages */ static CArchitectureMessage CreateApplicationExit(EArchMsgTarget target) { return CArchitectureMessage(target, EArchMsgType::ApplicationExit, new CArchMsgParmNull()); diff --git a/Runtime/CArchitectureQueue.hpp b/Runtime/CArchitectureQueue.hpp index e716b0e78..6b18171c0 100644 --- a/Runtime/CArchitectureQueue.hpp +++ b/Runtime/CArchitectureQueue.hpp @@ -4,7 +4,7 @@ #include #include "CArchitectureMessage.hpp" -namespace pshag +namespace urde { class CArchitectureQueue diff --git a/Runtime/CAreaOctTree.hpp b/Runtime/CAreaOctTree.hpp index b11c58b4b..d68130f8c 100644 --- a/Runtime/CAreaOctTree.hpp +++ b/Runtime/CAreaOctTree.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CAREAOCTTREE_HPP__ #define __PSHAG_CAREAOCTTREE_HPP__ -namespace pshag +namespace urde { class CAreaOctTree diff --git a/Runtime/CBasics.hpp b/Runtime/CBasics.hpp index 0fb858c0c..0288e1785 100644 --- a/Runtime/CBasics.hpp +++ b/Runtime/CBasics.hpp @@ -6,7 +6,7 @@ #include "RetroTypes.hpp" -namespace pshag +namespace urde { class CBasics diff --git a/Runtime/CBasicsPC.cpp b/Runtime/CBasicsPC.cpp index b60cc2fd7..521debcbf 100644 --- a/Runtime/CBasicsPC.cpp +++ b/Runtime/CBasicsPC.cpp @@ -3,7 +3,7 @@ #include "CBasics.hpp" -namespace pshag +namespace urde { void CBasics::Init() diff --git a/Runtime/CCRC32.cpp b/Runtime/CCRC32.cpp index 66ede7ae3..12f81d1ae 100644 --- a/Runtime/CCRC32.cpp +++ b/Runtime/CCRC32.cpp @@ -1,6 +1,6 @@ #include "CCRC32.hpp" -namespace pshag +namespace urde { const uint32_t CCRC32::crc32Table[256] = diff --git a/Runtime/CCRC32.hpp b/Runtime/CCRC32.hpp index a93898289..cb715f07d 100644 --- a/Runtime/CCRC32.hpp +++ b/Runtime/CCRC32.hpp @@ -2,7 +2,7 @@ #define RETRO_CRC32_HPP #include -namespace pshag +namespace urde { class CCRC32 diff --git a/Runtime/CCallStack.hpp b/Runtime/CCallStack.hpp index 52745d9e1..a7447ad57 100644 --- a/Runtime/CCallStack.hpp +++ b/Runtime/CCallStack.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CCALLSTACK_HPP__ #define __PSHAG_CCALLSTACK_HPP__ -namespace pshag +namespace urde { class CCallStack diff --git a/Runtime/CDvdFile.hpp b/Runtime/CDvdFile.hpp index 35d3dcc47..d5e8d1fba 100644 --- a/Runtime/CDvdFile.hpp +++ b/Runtime/CDvdFile.hpp @@ -3,7 +3,7 @@ #include "RetroTypes.hpp" -namespace pshag +namespace urde { static const char* DecodeARAMFile(const char* name) diff --git a/Runtime/CDvdRequest.cpp b/Runtime/CDvdRequest.cpp index 388670a45..fed662b35 100644 --- a/Runtime/CDvdRequest.cpp +++ b/Runtime/CDvdRequest.cpp @@ -1,6 +1,6 @@ #include "CDvdRequest.hpp" -namespace Retro +namespace urde { void CDvdRequest::WaitUntilComplete() diff --git a/Runtime/CDvdRequest.hpp b/Runtime/CDvdRequest.hpp index c5a61d42d..8879adbda 100644 --- a/Runtime/CDvdRequest.hpp +++ b/Runtime/CDvdRequest.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CDVDREQUEST_HPP__ #define __PSHAG_CDVDREQUEST_HPP__ -namespace pshag +namespace urde { class IDvdRequest diff --git a/Runtime/CEntity.cpp b/Runtime/CEntity.cpp index 1e6d6cfcc..72a010e0d 100644 --- a/Runtime/CEntity.cpp +++ b/Runtime/CEntity.cpp @@ -1,7 +1,7 @@ #include "CEntity.hpp" #include "CStateManager.hpp" -namespace pshag +namespace urde { CEntity::CEntity(TUniqueId uniqueId, const CEntityInfo& info, bool active) diff --git a/Runtime/CEntity.hpp b/Runtime/CEntity.hpp index cb993cef6..cf43ca5cb 100644 --- a/Runtime/CEntity.hpp +++ b/Runtime/CEntity.hpp @@ -4,7 +4,7 @@ #include "RetroTypes.hpp" #include "ScriptObjectSupport.hpp" -namespace pshag +namespace urde { class CStateManager; diff --git a/Runtime/CFactoryMgr.cpp b/Runtime/CFactoryMgr.cpp index 2e98adfdf..7ff38e143 100644 --- a/Runtime/CFactoryMgr.cpp +++ b/Runtime/CFactoryMgr.cpp @@ -1,10 +1,10 @@ #include "CFactoryMgr.hpp" #include "IObj.hpp" -namespace pshag +namespace urde { -CFactoryFnReturn CFactoryMgr::MakeObject(const SObjectTag& tag, pshag::CInputStream& in, +CFactoryFnReturn CFactoryMgr::MakeObject(const SObjectTag& tag, urde::CInputStream& in, const CVParamTransfer& paramXfer) { auto search = m_factories.find(tag.type); @@ -23,12 +23,12 @@ CFactoryFnReturn CFactoryMgr::MakeObjectFromMemory(const SObjectTag& tag, void* if (compressed) { - CZipInputStream r(std::make_unique(buf, size)); + CZipInputStream r(std::make_unique(buf, size)); return search->second(tag, r, paramXfer); } else { - Athena::io::MemoryReader r(buf, size); + athena::io::MemoryReader r(buf, size); return search->second(tag, r, paramXfer); } } diff --git a/Runtime/CFactoryMgr.hpp b/Runtime/CFactoryMgr.hpp index 0112dc253..e77af4179 100644 --- a/Runtime/CFactoryMgr.hpp +++ b/Runtime/CFactoryMgr.hpp @@ -5,21 +5,21 @@ #include "RetroTypes.hpp" #include "IOStreams.hpp" -namespace pshag +namespace urde { struct SObjectTag; class CVParamTransfer; class IObj; using CFactoryFnReturn = std::unique_ptr; -using FFactoryFunc = std::function; +using FFactoryFunc = std::function; class CFactoryMgr { std::unordered_map m_factories; public: - CFactoryFnReturn MakeObject(const SObjectTag& tag, pshag::CInputStream& in, + CFactoryFnReturn MakeObject(const SObjectTag& tag, urde::CInputStream& in, const CVParamTransfer& paramXfer); CFactoryFnReturn MakeObjectFromMemory(const SObjectTag& tag, void* buf, int size, bool compressed, const CVParamTransfer& paramXfer); diff --git a/Runtime/CGameAllocator.cpp b/Runtime/CGameAllocator.cpp index 72ee5609e..b8b9b921e 100644 --- a/Runtime/CGameAllocator.cpp +++ b/Runtime/CGameAllocator.cpp @@ -1,9 +1,9 @@ #include "CGameAllocator.hpp" -namespace pshag +namespace urde { -LogVisor::LogModule AllocLog("CGameAllocator"); +logvisor::Module AllocLog("CGameAllocator"); CGameAllocator::SGameMemInfo* CGameAllocator::FindFreeBlock(u32) { @@ -55,7 +55,7 @@ void CGameAllocator::Shutdown() } void* CGameAllocator::Alloc(size_t sz, EHint, EScope, EType, const CCallStack&) { - //AllocLog.report(LogVisor::Warning, _S("Remind Phil to reimplement Alloc!!!!")); + //AllocLog.report(logvisor::Warning, _S("Remind Phil to reimplement Alloc!!!!")); return malloc(sz); } void CGameAllocator::Free(void* ptr) diff --git a/Runtime/CGameAllocator.hpp b/Runtime/CGameAllocator.hpp index 7b34f7b40..9f35db013 100644 --- a/Runtime/CGameAllocator.hpp +++ b/Runtime/CGameAllocator.hpp @@ -3,7 +3,7 @@ #include "IAllocator.hpp" -namespace pshag +namespace urde { class CCallStack; diff --git a/Runtime/CGameDebug.hpp b/Runtime/CGameDebug.hpp index ddd1291ca..b2a8b550d 100644 --- a/Runtime/CGameDebug.hpp +++ b/Runtime/CGameDebug.hpp @@ -3,7 +3,7 @@ #include -namespace pshag +namespace urde { class CFinalInput; diff --git a/Runtime/CGameOptions.cpp b/Runtime/CGameOptions.cpp index 53b9f896e..90d6627a6 100644 --- a/Runtime/CGameOptions.cpp +++ b/Runtime/CGameOptions.cpp @@ -1,6 +1,6 @@ #include "CGameOptions.hpp" -namespace pshag +namespace urde { } diff --git a/Runtime/CGameOptions.hpp b/Runtime/CGameOptions.hpp index ac4ecb0a3..c17cbc753 100644 --- a/Runtime/CGameOptions.hpp +++ b/Runtime/CGameOptions.hpp @@ -3,7 +3,7 @@ #include "RetroTypes.hpp" -namespace pshag +namespace urde { class CGameOptions diff --git a/Runtime/CGameState.cpp b/Runtime/CGameState.cpp index 0a439d995..18e92e328 100644 --- a/Runtime/CGameState.cpp +++ b/Runtime/CGameState.cpp @@ -1,7 +1,7 @@ #include "CGameState.hpp" #include "IOStreams.hpp" -namespace pshag +namespace urde { CGameState::CGameState(CInputStream& stream) diff --git a/Runtime/CGameState.hpp b/Runtime/CGameState.hpp index fbda569d2..10d32051a 100644 --- a/Runtime/CGameState.hpp +++ b/Runtime/CGameState.hpp @@ -7,7 +7,7 @@ #include "CGameOptions.hpp" #include "CWorldTransManager.hpp" -namespace pshag +namespace urde { class CGameState diff --git a/Runtime/CIOWin.hpp b/Runtime/CIOWin.hpp index daa18b1b0..b47866d50 100644 --- a/Runtime/CIOWin.hpp +++ b/Runtime/CIOWin.hpp @@ -4,7 +4,7 @@ #include #include -namespace pshag +namespace urde { class CArchitectureMessage; class CArchitectureQueue; diff --git a/Runtime/CIOWinManager.cpp b/Runtime/CIOWinManager.cpp index 6dd443558..3a6db6d5e 100644 --- a/Runtime/CIOWinManager.cpp +++ b/Runtime/CIOWinManager.cpp @@ -2,7 +2,7 @@ #include "CArchitectureMessage.hpp" #include "CIOWin.hpp" -namespace pshag +namespace urde { bool CIOWinManager::OnIOWinMessage(const CArchitectureMessage& msg) diff --git a/Runtime/CIOWinManager.hpp b/Runtime/CIOWinManager.hpp index f91508b9e..8e1d66098 100644 --- a/Runtime/CIOWinManager.hpp +++ b/Runtime/CIOWinManager.hpp @@ -7,7 +7,7 @@ #include "rstl.hpp" #include "CArchitectureQueue.hpp" -namespace pshag +namespace urde { class CIOWinManager diff --git a/Runtime/CInGameTweakManagerBase.hpp b/Runtime/CInGameTweakManagerBase.hpp index 0fbbdd1a8..a43e2c750 100644 --- a/Runtime/CInGameTweakManagerBase.hpp +++ b/Runtime/CInGameTweakManagerBase.hpp @@ -3,7 +3,7 @@ #include -namespace pshag +namespace urde { class CInGameTweakManagerBase diff --git a/Runtime/CLight.cpp b/Runtime/CLight.cpp deleted file mode 100644 index 754e5ea5a..000000000 --- a/Runtime/CLight.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "CLight.hpp" - -namespace pshag -{ - -CLight CLight::BuildDirectional(const Zeus::CVector3f& dir, const Zeus::CColor& color) -{ - return {}; -} - -CLight CLight::BuildSpot(const Zeus::CVector3f& pos, const Zeus::CVector3f& dir, - const Zeus::CColor& color, float angle) -{ - return {}; -} - -CLight CLight::BuildCustom(const Zeus::CVector3f& pos, const Zeus::CVector3f& dir, - const Zeus::CColor& color, float constAtt, float linearAtt, float quadAtt, - float intensity, float, float) -{ - return {}; -} - -} diff --git a/Runtime/CLight.hpp b/Runtime/CLight.hpp deleted file mode 100644 index 21fa3ae4c..000000000 --- a/Runtime/CLight.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __PSHAG_CLIGHT_HPP__ -#define __PSHAG_CLIGHT_HPP__ - -#include "CVector3f.hpp" -#include "CColor.hpp" - -namespace pshag -{ - -enum class ELightType -{ - LocalAmbient, - Directional, - Custom, - Spot, - Spot2, - LocalAmbient2 -}; -enum class EFalloffType -{ - Constant, - Linear, - Quadratic -}; - -class CLight -{ -public: - static CLight BuildDirectional(const Zeus::CVector3f& dir, const Zeus::CColor& color); - static CLight BuildSpot(const Zeus::CVector3f& pos, const Zeus::CVector3f& dir, - const Zeus::CColor& color, float angle); - static CLight BuildCustom(const Zeus::CVector3f& pos, const Zeus::CVector3f& dir, - const Zeus::CColor& color, float constAtt, float linearAtt, float quadAtt, - float intensity, float, float); -}; - -} - -#endif // __PSHAG_CLIGHT_HPP__ diff --git a/Runtime/CMFGameBase.hpp b/Runtime/CMFGameBase.hpp index df80c7236..29b56e60f 100644 --- a/Runtime/CMFGameBase.hpp +++ b/Runtime/CMFGameBase.hpp @@ -3,7 +3,7 @@ #include "CIOWin.hpp" -namespace pshag +namespace urde { class CMFGameBase : public CIOWin diff --git a/Runtime/CMainFlowBase.cpp b/Runtime/CMainFlowBase.cpp index 70e46cf18..50bbf2c14 100644 --- a/Runtime/CMainFlowBase.cpp +++ b/Runtime/CMainFlowBase.cpp @@ -1,7 +1,7 @@ #include "CMainFlowBase.hpp" #include "CArchitectureMessage.hpp" -namespace pshag +namespace urde { CIOWin::EMessageReturn CMainFlowBase::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) diff --git a/Runtime/CMainFlowBase.hpp b/Runtime/CMainFlowBase.hpp index 33dd1b365..61d8a86bb 100644 --- a/Runtime/CMainFlowBase.hpp +++ b/Runtime/CMainFlowBase.hpp @@ -3,7 +3,7 @@ #include "CIOWin.hpp" -namespace pshag +namespace urde { enum class EClientFlowStates diff --git a/Runtime/CMakeLists.txt b/Runtime/CMakeLists.txt index 703e5f4f8..1bedeac10 100644 --- a/Runtime/CMakeLists.txt +++ b/Runtime/CMakeLists.txt @@ -58,8 +58,6 @@ add_library(RuntimeCommon CPakFile.hpp CPakFile.cpp CStringExtras.hpp CCallStack.hpp - CTexture.hpp CTextureBoo.cpp - CLight.hpp CLight.cpp IOStreams.hpp IOStreams.cpp CMainFlowBase.hpp CMainFlowBase.cpp CMFGameBase.hpp @@ -67,8 +65,6 @@ add_library(RuntimeCommon CPlayMovieBase.hpp CMoviePlayer.hpp CMoviePlayer.cpp CGameDebug.hpp CGameDebug.cpp - CGraphics.hpp CGraphics.cpp - CModel.hpp CModelBoo.cpp rstl.hpp rstl.cpp GameGlobalObjects.hpp RetroTypes.hpp diff --git a/Runtime/CMapWorldInfo.cpp b/Runtime/CMapWorldInfo.cpp index 287017d42..9c5aab606 100644 --- a/Runtime/CMapWorldInfo.cpp +++ b/Runtime/CMapWorldInfo.cpp @@ -1,6 +1,6 @@ #include "CMapWorldInfo.hpp" -namespace pshag +namespace urde { } diff --git a/Runtime/CMapWorldInfo.hpp b/Runtime/CMapWorldInfo.hpp index ef1f28fc4..f0ec67b9f 100644 --- a/Runtime/CMapWorldInfo.hpp +++ b/Runtime/CMapWorldInfo.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CMAPWORLDINFO_HPP__ #define __PSHAG_CMAPWORLDINFO_HPP__ -namespace pshag +namespace urde { class CMapWorldInfo diff --git a/Runtime/CMemory.cpp b/Runtime/CMemory.cpp index 5119f6362..68d52f624 100644 --- a/Runtime/CMemory.cpp +++ b/Runtime/CMemory.cpp @@ -1,12 +1,12 @@ #include "CMemory.hpp" #include "CGameAllocator.hpp" #include "CCallStack.hpp" -#include +#include "logvisor/logvisor.hpp" -namespace pshag +namespace urde { -LogVisor::LogModule Log("CMemory"); +logvisor::Module Log("CMemory"); static CGameAllocator g_gameAllocator; static IAllocator* g_memoryAllocator = &g_gameAllocator; @@ -52,7 +52,7 @@ void* CMemory::Alloc(size_t sz, IAllocator::EHint hint, IAllocator::EScope scope { void* newPtr = g_memoryAllocator->Alloc(sz, hint, scope, type, cs); if (!newPtr) - Log.report(LogVisor::Error, "Alloc Failed! - Size %d", sz); + Log.report(logvisor::Error, "Alloc Failed! - Size %d", sz); return newPtr; } @@ -73,70 +73,70 @@ IAllocator& CMemorySys::GetGameAllocator() {return g_gameAllocator;} void* operator new(std::size_t sz) { - if (!pshag::g_memoryAllocatorReady) + if (!urde::g_memoryAllocatorReady) return malloc(sz); - pshag::CCallStack cs("?\?(?\?)", "UnknownType"); - return pshag::CMemory::Alloc(sz, - pshag::IAllocator::EHint::None, - pshag::IAllocator::EScope::Default, - pshag::IAllocator::EType::Primitive, + urde::CCallStack cs("?\?(?\?)", "UnknownType"); + return urde::CMemory::Alloc(sz, + urde::IAllocator::EHint::None, + urde::IAllocator::EScope::Default, + urde::IAllocator::EType::Primitive, cs); } void* operator new(std::size_t sz, const char* funcName, const char* typeName) { - if (!pshag::g_memoryAllocatorReady) + if (!urde::g_memoryAllocatorReady) return malloc(sz); - pshag::CCallStack cs(funcName, typeName); - return pshag::CMemory::Alloc(sz, - pshag::IAllocator::EHint::None, - pshag::IAllocator::EScope::Default, - pshag::IAllocator::EType::Primitive, + urde::CCallStack cs(funcName, typeName); + return urde::CMemory::Alloc(sz, + urde::IAllocator::EHint::None, + urde::IAllocator::EScope::Default, + urde::IAllocator::EType::Primitive, cs); } void operator delete(void* ptr) noexcept { - if (!pshag::g_memoryAllocatorReady) + if (!urde::g_memoryAllocatorReady) { free(ptr); return; } - pshag::CMemory::Free(ptr); + urde::CMemory::Free(ptr); } void* operator new[](std::size_t sz) { - if (!pshag::g_memoryAllocatorReady) + if (!urde::g_memoryAllocatorReady) return malloc(sz); - pshag::CCallStack cs("?\?(?\?)", "UnknownType"); - return pshag::CMemory::Alloc(sz, - pshag::IAllocator::EHint::None, - pshag::IAllocator::EScope::Default, - pshag::IAllocator::EType::Array, + urde::CCallStack cs("?\?(?\?)", "UnknownType"); + return urde::CMemory::Alloc(sz, + urde::IAllocator::EHint::None, + urde::IAllocator::EScope::Default, + urde::IAllocator::EType::Array, cs); } void* operator new[](std::size_t sz, const char* funcName, const char* typeName) { - if (!pshag::g_memoryAllocatorReady) + if (!urde::g_memoryAllocatorReady) return malloc(sz); - pshag::CCallStack cs(funcName, typeName); - return pshag::CMemory::Alloc(sz, - pshag::IAllocator::EHint::None, - pshag::IAllocator::EScope::Default, - pshag::IAllocator::EType::Array, + urde::CCallStack cs(funcName, typeName); + return urde::CMemory::Alloc(sz, + urde::IAllocator::EHint::None, + urde::IAllocator::EScope::Default, + urde::IAllocator::EType::Array, cs); } void operator delete[](void* ptr) noexcept { - if (!pshag::g_memoryAllocatorReady) + if (!urde::g_memoryAllocatorReady) { free(ptr); return; } - pshag::CMemory::Free(ptr); + urde::CMemory::Free(ptr); } diff --git a/Runtime/CMemory.hpp b/Runtime/CMemory.hpp index dfa7b0ebb..521f2d0dd 100644 --- a/Runtime/CMemory.hpp +++ b/Runtime/CMemory.hpp @@ -3,7 +3,7 @@ #include "IAllocator.hpp" -namespace pshag +namespace urde { class COsContext; diff --git a/Runtime/CMemoryCardSys.hpp b/Runtime/CMemoryCardSys.hpp index 573bad273..853b57494 100644 --- a/Runtime/CMemoryCardSys.hpp +++ b/Runtime/CMemoryCardSys.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CMEMORYCARDSYS_HPP__ #define __PSHAG_CMEMORYCARDSYS_HPP__ -namespace pshag +namespace urde { class CMemoryCardSys diff --git a/Runtime/CMemoryCardSysNix.cpp b/Runtime/CMemoryCardSysNix.cpp index 55236aa6a..6768d64bc 100644 --- a/Runtime/CMemoryCardSysNix.cpp +++ b/Runtime/CMemoryCardSysNix.cpp @@ -1,6 +1,6 @@ #include "CMemoryCardSys.hpp" -namespace pshag +namespace urde { } diff --git a/Runtime/CMoviePlayer.cpp b/Runtime/CMoviePlayer.cpp index 10ba6cebd..87f979be4 100644 --- a/Runtime/CMoviePlayer.cpp +++ b/Runtime/CMoviePlayer.cpp @@ -1,6 +1,6 @@ #include "CMoviePlayer.hpp" -namespace pshag +namespace urde { CMoviePlayer::CMoviePlayer(const char* path, float startTime, bool flag) diff --git a/Runtime/CMoviePlayer.hpp b/Runtime/CMoviePlayer.hpp index 81c52211b..d1aa616a7 100644 --- a/Runtime/CMoviePlayer.hpp +++ b/Runtime/CMoviePlayer.hpp @@ -4,7 +4,7 @@ #include "RetroTypes.hpp" #include "CDvdFile.hpp" -namespace pshag +namespace urde { class CVector3f; diff --git a/Runtime/CNODDvdRequest.cpp b/Runtime/CNODDvdRequest.cpp index 0bc6e20b0..ebb42b16c 100644 --- a/Runtime/CNODDvdRequest.cpp +++ b/Runtime/CNODDvdRequest.cpp @@ -1,6 +1,6 @@ #include "CDvdRequest.hpp" -namespace pshag +namespace urde { void CNODDvdRequest::WaitUntilComplete() diff --git a/Runtime/CObjectList.hpp b/Runtime/CObjectList.hpp index 1ae178b22..ba5a8a785 100644 --- a/Runtime/CObjectList.hpp +++ b/Runtime/CObjectList.hpp @@ -4,7 +4,7 @@ #include "CEntity.hpp" #include "RetroTypes.hpp" -namespace pshag +namespace urde { enum class EGameObjectList diff --git a/Runtime/CPakFile.hpp b/Runtime/CPakFile.hpp index 3c06a5334..b13d7c26e 100644 --- a/Runtime/CPakFile.hpp +++ b/Runtime/CPakFile.hpp @@ -7,7 +7,7 @@ #include "CDvdFile.hpp" #include "CDvdRequest.hpp" -namespace pshag +namespace urde { class CPakFile : public CDvdFile diff --git a/Runtime/CPhysicsActor.hpp b/Runtime/CPhysicsActor.hpp index b3e240796..575d1d1cb 100644 --- a/Runtime/CPhysicsActor.hpp +++ b/Runtime/CPhysicsActor.hpp @@ -3,13 +3,13 @@ #include "CActor.hpp" -namespace pshag +namespace urde { class CCollisionPrimitive { public: - Zeus::CVector3f x1d8_offset; + zeus::CVector3f x1d8_offset; }; class CCollisionInfoList @@ -23,7 +23,7 @@ protected: float xdc_massRecip; float xe0_inertialTensor; float xe4_inertialTensorRecip; - Zeus::CAABox x194_baseBoundingBox; + zeus::CAABox x194_baseBoundingBox; CCollisionPrimitive x1b0_collisionPrimitive; float x228_stepUpHeight; float x22c_stepDownHeight; @@ -49,15 +49,15 @@ public: void Render(const CStateManager&) {} - Zeus::CVector3f GetAimPosition(const CStateManager&, float val) + zeus::CVector3f GetAimPosition(const CStateManager&, float val) { if (val <= 0.0) return GetBoundingBox().center(); - //Zeus::CVector3f delta = PredictMotion(val); - return Zeus::CVector3f(); + //zeus::CVector3f delta = PredictMotion(val); + return zeus::CVector3f(); } - Zeus::CVector3f GetOrbitPosition(const CStateManager&) + zeus::CVector3f GetOrbitPosition(const CStateManager&) { return GetBoundingBox().center(); } float GetStepUpHeight() @@ -66,33 +66,33 @@ public: float GetStepDownHeight() { return x22c_stepDownHeight; } - void SetPrimitiveOffset(const Zeus::CVector2f& offset) + void SetPrimitiveOffset(const zeus::CVector2f& offset) { x1b0_collisionPrimitive.x1d8_offset = offset; } - Zeus::CVector3f GetPrimitiveOffset() + zeus::CVector3f GetPrimitiveOffset() { return x1b0_collisionPrimitive.x1d8_offset; } float GetWeight() { return 24.525002f * xd8_mass; } - void SetBoundingBox(const Zeus::CAABox& box) + void SetBoundingBox(const zeus::CAABox& box) { x194_baseBoundingBox = box; } - Zeus::CAABox GetMotionVolume() - { return Zeus::CAABox::skInvertedBox; } + zeus::CAABox GetMotionVolume() + { return zeus::CAABox::skInvertedBox; } - Zeus::CAABox GetBoundingBox() - { return Zeus::CAABox::skInvertedBox; } + zeus::CAABox GetBoundingBox() + { return zeus::CAABox::skInvertedBox; } - const Zeus::CAABox& GetBaseBoundingBox() const + const zeus::CAABox& GetBaseBoundingBox() const { return x194_baseBoundingBox; } void CollidedWith(const TUniqueId&, const CCollisionInfoList&, CStateManager&) {} - Zeus::CTransform GetPrimitiveTransform() + zeus::CTransform GetPrimitiveTransform() { - return Zeus::CTransform(); + return zeus::CTransform(); } const CCollisionPrimitive& GetCollisionPrimitive() const diff --git a/Runtime/CPlayMovieBase.hpp b/Runtime/CPlayMovieBase.hpp index 492f29c78..65ccc3e0c 100644 --- a/Runtime/CPlayMovieBase.hpp +++ b/Runtime/CPlayMovieBase.hpp @@ -4,7 +4,7 @@ #include "CIOWin.hpp" #include "CMoviePlayer.hpp" -namespace pshag +namespace urde { class CPlayMovieBase : public CIOWin diff --git a/Runtime/CPlayerState.cpp b/Runtime/CPlayerState.cpp index 12a01321f..8a155f72c 100644 --- a/Runtime/CPlayerState.cpp +++ b/Runtime/CPlayerState.cpp @@ -1,6 +1,6 @@ #include "CPlayerState.hpp" -namespace pshag +namespace urde { CPlayerState::CPlayerState(CInputStream& stream) diff --git a/Runtime/CPlayerState.hpp b/Runtime/CPlayerState.hpp index 63d4d8ed9..ef3731509 100644 --- a/Runtime/CPlayerState.hpp +++ b/Runtime/CPlayerState.hpp @@ -6,7 +6,7 @@ #include "CStaticInterference.hpp" #include "IOStreams.hpp" -namespace pshag +namespace urde { class CPlayerState diff --git a/Runtime/CRandom16.cpp b/Runtime/CRandom16.cpp index d95d31427..d80d4c346 100644 --- a/Runtime/CRandom16.cpp +++ b/Runtime/CRandom16.cpp @@ -1,6 +1,6 @@ #include "CRandom16.hpp" -namespace pshag +namespace urde { static CRandom16 DefaultRandom(0); diff --git a/Runtime/CRandom16.hpp b/Runtime/CRandom16.hpp index 0b4497ebb..603d52db5 100644 --- a/Runtime/CRandom16.hpp +++ b/Runtime/CRandom16.hpp @@ -3,7 +3,7 @@ #include "GCNTypes.hpp" -namespace pshag +namespace urde { diff --git a/Runtime/CResFactory.cpp b/Runtime/CResFactory.cpp index f385cfc70..54f4e6995 100644 --- a/Runtime/CResFactory.cpp +++ b/Runtime/CResFactory.cpp @@ -1,7 +1,7 @@ #include "CResFactory.hpp" #include "IObj.hpp" -namespace pshag +namespace urde { std::unique_ptr CResFactory::Build(const SObjectTag&, const CVParamTransfer&) diff --git a/Runtime/CResFactory.hpp b/Runtime/CResFactory.hpp index 95bcaefb0..8611074a1 100644 --- a/Runtime/CResFactory.hpp +++ b/Runtime/CResFactory.hpp @@ -6,7 +6,7 @@ #include "CResLoader.hpp" #include "IVParamObj.hpp" -namespace pshag +namespace urde { class IDvdRequest; diff --git a/Runtime/CResLoader.cpp b/Runtime/CResLoader.cpp index 3001f876d..568aa0cbd 100644 --- a/Runtime/CResLoader.cpp +++ b/Runtime/CResLoader.cpp @@ -3,7 +3,7 @@ #include "CMemory.hpp" #include "CCallStack.hpp" -namespace pshag +namespace urde { const std::vector* CResLoader::GetTagListForFile(const std::string& name) const diff --git a/Runtime/CResLoader.hpp b/Runtime/CResLoader.hpp index 33f1cce97..ca1d75162 100644 --- a/Runtime/CResLoader.hpp +++ b/Runtime/CResLoader.hpp @@ -7,7 +7,7 @@ #include "CPakFile.hpp" #include "IOStreams.hpp" -namespace pshag +namespace urde { struct SObjectTag; class IDvdRequest; diff --git a/Runtime/CScriptMailbox.cpp b/Runtime/CScriptMailbox.cpp index 15e78d82c..78e8c9493 100644 --- a/Runtime/CScriptMailbox.cpp +++ b/Runtime/CScriptMailbox.cpp @@ -1,6 +1,6 @@ #include "CScriptMailbox.hpp" -namespace pshag +namespace urde { } diff --git a/Runtime/CScriptMailbox.hpp b/Runtime/CScriptMailbox.hpp index 2e172c65b..b8eeb6c0e 100644 --- a/Runtime/CScriptMailbox.hpp +++ b/Runtime/CScriptMailbox.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CSCRIPTMAILBOX_HPP__ #define __PSHAG_CSCRIPTMAILBOX_HPP__ -namespace pshag +namespace urde { class CScriptMailbox diff --git a/Runtime/CSimplePool.cpp b/Runtime/CSimplePool.cpp index 69a117542..f457549e7 100644 --- a/Runtime/CSimplePool.cpp +++ b/Runtime/CSimplePool.cpp @@ -2,7 +2,7 @@ #include "IVParamObj.hpp" #include "CToken.hpp" -namespace pshag +namespace urde { CSimplePool::CSimplePool(IFactory& factory) diff --git a/Runtime/CSimplePool.hpp b/Runtime/CSimplePool.hpp index f69c99eca..b2ee91024 100644 --- a/Runtime/CSimplePool.hpp +++ b/Runtime/CSimplePool.hpp @@ -6,7 +6,7 @@ #include "IVParamObj.hpp" #include -namespace pshag +namespace urde { class IFactory; class CObjectReference; diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index 7d18440ae..a3f8d52b0 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -1,6 +1,6 @@ #include "CStateManager.hpp" -namespace pshag +namespace urde { void CStateManager::SendScriptMsg(TUniqueId uid, TEditorId eid, EScriptObjectMessage msg, EScriptObjectState state) diff --git a/Runtime/CStateManager.hpp b/Runtime/CStateManager.hpp index bb76e4295..a61d94c8a 100644 --- a/Runtime/CStateManager.hpp +++ b/Runtime/CStateManager.hpp @@ -5,7 +5,7 @@ #include "CBasics.hpp" #include "ScriptObjectSupport.hpp" -namespace pshag +namespace urde { class CScriptMailbox; class CMapWorldInfo; diff --git a/Runtime/CStaticInterference.hpp b/Runtime/CStaticInterference.hpp index 4dbdce634..0e6e0a13a 100644 --- a/Runtime/CStaticInterference.hpp +++ b/Runtime/CStaticInterference.hpp @@ -4,7 +4,7 @@ #include #include "RetroTypes.hpp" -namespace pshag +namespace urde { class CStateManager; diff --git a/Runtime/CStringExtras.hpp b/Runtime/CStringExtras.hpp index 814dc0676..4d612b8a7 100644 --- a/Runtime/CStringExtras.hpp +++ b/Runtime/CStringExtras.hpp @@ -4,7 +4,7 @@ #include #include -namespace pshag +namespace urde { class CStringExtras diff --git a/Runtime/CTimeProvider.cpp b/Runtime/CTimeProvider.cpp index 4054a9bde..6f2af6bac 100644 --- a/Runtime/CTimeProvider.cpp +++ b/Runtime/CTimeProvider.cpp @@ -1,9 +1,9 @@ #include "CTimeProvider.hpp" #if 0 -#include "CGraphics.hpp" +#include "Graphics/CGraphics.hpp" #endif -namespace pshag +namespace urde { CTimeProvider* CTimeProvider::g_currentTimeProvider = nullptr; CTimeProvider::CTimeProvider(const float& time) diff --git a/Runtime/CTimeProvider.hpp b/Runtime/CTimeProvider.hpp index b72e8d7e0..27a62e45a 100644 --- a/Runtime/CTimeProvider.hpp +++ b/Runtime/CTimeProvider.hpp @@ -1,6 +1,6 @@ #ifndef __PSHAG__CTIMEPROVIDER_HPP__ #define __PSHAG__CTIMEPROVIDER_HPP__ -namespace pshag +namespace urde { class CTimeProvider; class CTimeProvider diff --git a/Runtime/CToken.hpp b/Runtime/CToken.hpp index 4029c3565..03933ca04 100644 --- a/Runtime/CToken.hpp +++ b/Runtime/CToken.hpp @@ -8,7 +8,7 @@ #include "IObjectStore.hpp" #include "IFactory.hpp" -namespace pshag +namespace urde { class IObjectStore; class IObj; diff --git a/Runtime/CWorldTransManager.cpp b/Runtime/CWorldTransManager.cpp index 2826e0f10..442fa856c 100644 --- a/Runtime/CWorldTransManager.cpp +++ b/Runtime/CWorldTransManager.cpp @@ -1,6 +1,6 @@ #include "CWorldTransManager.hpp" -namespace pshag +namespace urde { void CWorldTransManager::DrawEnabled() const diff --git a/Runtime/CWorldTransManager.hpp b/Runtime/CWorldTransManager.hpp index ffd09c207..fe24f33c7 100644 --- a/Runtime/CWorldTransManager.hpp +++ b/Runtime/CWorldTransManager.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CWORLDTRANSMANAGER_HPP__ #define __PSHAG_CWORLDTRANSMANAGER_HPP__ -namespace pshag +namespace urde { class CWorldTransManager diff --git a/Runtime/Character/CAnimData.hpp b/Runtime/Character/CAnimData.hpp index 7a9362b30..9ed93bd1b 100644 --- a/Runtime/Character/CAnimData.hpp +++ b/Runtime/Character/CAnimData.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CANIMDATA_HPP__ #define __PSHAG_CANIMDATA_HPP__ -namespace pshag +namespace urde { class CAnimData diff --git a/Runtime/Character/CAnimationDatabase.hpp b/Runtime/Character/CAnimationDatabase.hpp index e84f0fcd9..9ac6fa070 100644 --- a/Runtime/Character/CAnimationDatabase.hpp +++ b/Runtime/Character/CAnimationDatabase.hpp @@ -6,7 +6,7 @@ #include #include -namespace pshag +namespace urde { class IMetaAnim; class CPrimitive; diff --git a/Runtime/Character/CAnimationDatabaseGame.hpp b/Runtime/Character/CAnimationDatabaseGame.hpp index acd3f77b6..bfc86318e 100644 --- a/Runtime/Character/CAnimationDatabaseGame.hpp +++ b/Runtime/Character/CAnimationDatabaseGame.hpp @@ -3,7 +3,7 @@ #include "CAnimationDatabase.hpp" -namespace pshag +namespace urde { class CAnimationDatabaseGame : public CAnimationDatabase diff --git a/Runtime/Character/CAssetFactory.cpp b/Runtime/Character/CAssetFactory.cpp index 2674d8da7..b11b1f639 100644 --- a/Runtime/Character/CAssetFactory.cpp +++ b/Runtime/Character/CAssetFactory.cpp @@ -1,6 +1,6 @@ #include "CAssetFactory.hpp" -namespace pshag +namespace urde { } diff --git a/Runtime/Character/CAssetFactory.hpp b/Runtime/Character/CAssetFactory.hpp index 77d80bc84..703ecd050 100644 --- a/Runtime/Character/CAssetFactory.hpp +++ b/Runtime/Character/CAssetFactory.hpp @@ -4,7 +4,7 @@ #include "../IFactory.hpp" #include "../IObj.hpp" -namespace pshag +namespace urde { class CCharacterFactoryBuilder : public IFactory { diff --git a/Runtime/Character/CCharAnimTime.cpp b/Runtime/Character/CCharAnimTime.cpp index 1bb090e1f..ea6fdb34a 100644 --- a/Runtime/Character/CCharAnimTime.cpp +++ b/Runtime/Character/CCharAnimTime.cpp @@ -1,6 +1,6 @@ #include "CCharAnimTime.hpp" -namespace pshag +namespace urde { } diff --git a/Runtime/Character/CCharAnimTime.hpp b/Runtime/Character/CCharAnimTime.hpp index 2c36d201b..0827fd20b 100644 --- a/Runtime/Character/CCharAnimTime.hpp +++ b/Runtime/Character/CCharAnimTime.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CCHARANIMTIME_HPP__ #define __PSHAG_CCHARANIMTIME_HPP__ -namespace pshag +namespace urde { class CCharAnimTime diff --git a/Runtime/Character/CCharacterFactory.hpp b/Runtime/Character/CCharacterFactory.hpp index 484446da6..88f9324ea 100644 --- a/Runtime/Character/CCharacterFactory.hpp +++ b/Runtime/Character/CCharacterFactory.hpp @@ -3,7 +3,7 @@ #include "../IFactory.hpp" -namespace pshag +namespace urde { class CCharacterFactory : public IFactory diff --git a/Runtime/Character/CHierarchyPoseBuilder.hpp b/Runtime/Character/CHierarchyPoseBuilder.hpp index 87706ca25..6a2ef14ff 100644 --- a/Runtime/Character/CHierarchyPoseBuilder.hpp +++ b/Runtime/Character/CHierarchyPoseBuilder.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CHIERARCHYPOSEBUILDER_HPP__ #define __PSHAG_CHIERARCHYPOSEBUILDER_HPP__ -namespace pshag +namespace urde { class CHierarchyPoseBuilder diff --git a/Runtime/Character/CTransitionDatabase.hpp b/Runtime/Character/CTransitionDatabase.hpp index 5b54a912f..ad3e1dce3 100644 --- a/Runtime/Character/CTransitionDatabase.hpp +++ b/Runtime/Character/CTransitionDatabase.hpp @@ -3,7 +3,7 @@ #include "../RetroTypes.hpp" -namespace pshag +namespace urde { class IMetaTrans; diff --git a/Runtime/Character/CTransitionDatabaseGame.hpp b/Runtime/Character/CTransitionDatabaseGame.hpp index 468e594f8..672448e68 100644 --- a/Runtime/Character/CTransitionDatabaseGame.hpp +++ b/Runtime/Character/CTransitionDatabaseGame.hpp @@ -3,7 +3,7 @@ #include "CTransitionDatabase.hpp" -namespace pshag +namespace urde { class CTransitionDatabaseGame : public CTransitionDatabase diff --git a/Runtime/Character/IMetaAnim.hpp b/Runtime/Character/IMetaAnim.hpp index e902e6456..14c4fec1c 100644 --- a/Runtime/Character/IMetaAnim.hpp +++ b/Runtime/Character/IMetaAnim.hpp @@ -3,7 +3,7 @@ #include "../RetroTypes.hpp" -namespace pshag +namespace urde { class IMetaAnim diff --git a/Runtime/Character/IMetaTrans.hpp b/Runtime/Character/IMetaTrans.hpp index 05e1ec40d..ca57f050f 100644 --- a/Runtime/Character/IMetaTrans.hpp +++ b/Runtime/Character/IMetaTrans.hpp @@ -3,7 +3,7 @@ #include "../RetroTypes.hpp" -namespace pshag +namespace urde { class IMetaTrans diff --git a/Runtime/GameGlobalObjects.hpp b/Runtime/GameGlobalObjects.hpp index cd009ccef..eee19981a 100644 --- a/Runtime/GameGlobalObjects.hpp +++ b/Runtime/GameGlobalObjects.hpp @@ -4,7 +4,7 @@ #include "../DataSpec/DNACommon/Tweaks/ITweakPlayer.hpp" #include "../DataSpec/DNACommon/Tweaks/ITweakPlayerControl.hpp" -namespace pshag +namespace urde { extern class CMemoryCardSys* g_MemoryCardSys; diff --git a/Runtime/Graphics/CBooRenderer.hpp b/Runtime/Graphics/CBooRenderer.hpp index b9426b13e..cfeecd104 100644 --- a/Runtime/Graphics/CBooRenderer.hpp +++ b/Runtime/Graphics/CBooRenderer.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CBOORENDERER_HPP__ #define __PSHAG_CBOORENDERER_HPP__ -namespace pshag +namespace urde { class IObjectStore; class CMemorySys; diff --git a/Runtime/CGraphics.cpp b/Runtime/Graphics/CGraphics.cpp similarity index 74% rename from Runtime/CGraphics.cpp rename to Runtime/Graphics/CGraphics.cpp index e39cf377b..49a256bec 100644 --- a/Runtime/CGraphics.cpp +++ b/Runtime/Graphics/CGraphics.cpp @@ -1,10 +1,10 @@ -#include "CGraphics.hpp" -#include +#include "Graphics/CGraphics.hpp" +#include "zeus/Math.hpp" #undef near #undef far -namespace pshag +namespace urde { CGraphics::CProjectionState CGraphics::g_Proj; @@ -12,14 +12,14 @@ float CGraphics::g_ProjAspect = 1.f; u32 CGraphics::g_NumLightsActive = 0; ERglLight CGraphics::g_LightActive = ERglLight::None; ERglLight CGraphics::g_LightsWereOn = ERglLight::None; -Zeus::CTransform CGraphics::g_GXModelView; -Zeus::CTransform CGraphics::g_GXModelMatrix; -Zeus::CTransform CGraphics::g_ViewMatrix; -Zeus::CVector3f CGraphics::g_ViewPoint; -Zeus::CTransform CGraphics::g_GXViewPointMatrix; -Zeus::CTransform CGraphics::g_CameraMatrix; -Zeus::CVector2i CGraphics::g_ViewportResolution; -Zeus::CVector2i CGraphics::g_ViewportResolutionHalf; +zeus::CTransform CGraphics::g_GXModelView; +zeus::CTransform CGraphics::g_GXModelMatrix; +zeus::CTransform CGraphics::g_ViewMatrix; +zeus::CVector3f CGraphics::g_ViewPoint; +zeus::CTransform CGraphics::g_GXViewPointMatrix; +zeus::CTransform CGraphics::g_CameraMatrix; +zeus::CVector2i CGraphics::g_ViewportResolution; +zeus::CVector2i CGraphics::g_ViewportResolutionHalf; int CGraphics::g_ViewportSamples = 1; bool CGraphics::g_IsGXModelMatrixIdentity; @@ -45,7 +45,7 @@ void CGraphics::SetLightState(ERglLight lightState) { // TODO: set state for real g_LightActive = lightState; - g_NumLightsActive = Zeus::Math::PopCount(lightState); + g_NumLightsActive = zeus::PopCount(lightState); } void CGraphics::SetDepthWriteMode(bool test, ERglEnum comp, bool write) @@ -65,18 +65,18 @@ void CGraphics::SetAlphaCompare(ERglAlphaFunc comp0, u8 ref0, ERglAlphaOp op, ER { } -void CGraphics::SetViewPointMatrix(const Zeus::CTransform& xf) +void CGraphics::SetViewPointMatrix(const zeus::CTransform& xf) { g_ViewMatrix = xf; g_ViewPoint = xf.m_origin; - Zeus::CMatrix3f tmp(xf.m_basis[0], xf.m_basis[2], -xf.m_basis[1]); - g_GXViewPointMatrix = Zeus::CTransform(tmp.transposed()); + zeus::CMatrix3f tmp(xf.m_basis[0], xf.m_basis[2], -xf.m_basis[1]); + g_GXViewPointMatrix = zeus::CTransform(tmp.transposed()); SetViewMatrix(); } void CGraphics::SetViewMatrix() { - g_CameraMatrix = g_GXViewPointMatrix * Zeus::CTransform::Translate(-g_ViewPoint); + g_CameraMatrix = g_GXViewPointMatrix * zeus::CTransform::Translate(-g_ViewPoint); if (g_IsGXModelMatrixIdentity) g_GXModelView = g_CameraMatrix; else @@ -86,14 +86,14 @@ void CGraphics::SetViewMatrix() /* Load normal matrix */ } -void CGraphics::SetModelMatrix(const Zeus::CTransform& xf) +void CGraphics::SetModelMatrix(const zeus::CTransform& xf) { g_IsGXModelMatrixIdentity = false; g_GXModelMatrix = xf; SetViewMatrix(); } -Zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix() +zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix() { float rml = g_Proj.x8_right - g_Proj.x4_left; float rpl = g_Proj.x8_right + g_Proj.x4_left; @@ -101,7 +101,7 @@ Zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix() float tpb = g_Proj.xc_top + g_Proj.x10_bottom; float fmn = g_Proj.x18_far - g_Proj.x14_near; float fpn = g_Proj.x18_far + g_Proj.x14_near; - return Zeus::CMatrix4f(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f, + return zeus::CMatrix4f(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f, 0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f, 0.f, 0.f, -fpn / fmn, -2.f * g_Proj.x18_far * g_Proj.x14_near / fmn, 0.f, 0.f, -1.f, 0.f); @@ -122,7 +122,7 @@ void CGraphics::SetPerspective(float fovy, float aspect, float near, float far) { g_ProjAspect = aspect; - float tfov = tanf(fovy * 0.5f * M_PI / 180.f); + float tfov = std::tan(zeus::degToRad(fovy * 0.5f)); g_Proj.x0_persp = true; g_Proj.x14_near = near; g_Proj.x18_far = far; @@ -144,23 +144,23 @@ void CGraphics::FlushProjection() } } -Zeus::CVector2i CGraphics::ProjectPoint(const Zeus::CVector3f& point) +zeus::CVector2i CGraphics::ProjectPoint(const zeus::CVector3f& point) { - Zeus::CVector3f projPt = GetPerspectiveProjectionMatrix().multiplyOneOverW(point); + zeus::CVector3f projPt = GetPerspectiveProjectionMatrix().multiplyOneOverW(point); return {int(projPt.x * g_ViewportResolutionHalf.x) + g_ViewportResolutionHalf.x, g_ViewportResolution.y - (int(projPt.y * g_ViewportResolutionHalf.y) + g_ViewportResolutionHalf.y)}; } -SClipScreenRect CGraphics::ClipScreenRectFromMS(const Zeus::CVector3f& p1, - const Zeus::CVector3f& p2) +SClipScreenRect CGraphics::ClipScreenRectFromMS(const zeus::CVector3f& p1, + const zeus::CVector3f& p2) { - Zeus::CVector3f xf1 = g_GXModelView * p1; - Zeus::CVector3f xf2 = g_GXModelView * p2; + zeus::CVector3f xf1 = g_GXModelView * p1; + zeus::CVector3f xf2 = g_GXModelView * p2; return ClipScreenRectFromVS(xf1, xf2); } -SClipScreenRect CGraphics::ClipScreenRectFromVS(const Zeus::CVector3f& p1, - const Zeus::CVector3f& p2) +SClipScreenRect CGraphics::ClipScreenRectFromVS(const zeus::CVector3f& p1, + const zeus::CVector3f& p2) { if (p1.x == 0.f && p1.y == 0.f && p1.z == 0.f) return {}; @@ -172,8 +172,8 @@ SClipScreenRect CGraphics::ClipScreenRectFromVS(const Zeus::CVector3f& p1, if (p1.y > GetProjectionState().x18_far || p2.y > GetProjectionState().x18_far) return {}; - Zeus::CVector2i sp1 = ProjectPoint(p1); - Zeus::CVector2i sp2 = ProjectPoint(p2); + zeus::CVector2i sp1 = ProjectPoint(p1); + zeus::CVector2i sp2 = ProjectPoint(p2); int minX = std::min(sp2.x, sp1.x); int minX2 = minX & 0xfffffffe; int minY = std::min(sp2.y, sp1.y); @@ -211,13 +211,13 @@ SClipScreenRect CGraphics::ClipScreenRectFromVS(const Zeus::CVector3f& p1, } -Zeus::CVector3f CGraphics::ProjectModelPointToViewportSpace(const Zeus::CVector3f& point) +zeus::CVector3f CGraphics::ProjectModelPointToViewportSpace(const zeus::CVector3f& point) { - Zeus::CVector3f pt = g_GXModelView * point; + zeus::CVector3f pt = g_GXModelView * point; return GetPerspectiveProjectionMatrix().multiplyOneOverW(pt); } -void CGraphics::SetViewportResolution(const Zeus::CVector2i& res) +void CGraphics::SetViewportResolution(const zeus::CVector2i& res) { g_ViewportResolution = res; g_ViewportResolutionHalf = {res.x / 2, res.y / 2}; diff --git a/Runtime/CGraphics.hpp b/Runtime/Graphics/CGraphics.hpp similarity index 81% rename from Runtime/CGraphics.hpp rename to Runtime/Graphics/CGraphics.hpp index 3d367715f..d8d19c165 100644 --- a/Runtime/CGraphics.hpp +++ b/Runtime/Graphics/CGraphics.hpp @@ -2,13 +2,13 @@ #define __PSHAG_CGRAPHICS_HPP__ #include "RetroTypes.hpp" -#include "CTransform.hpp" -#include "CVector2i.hpp" +#include "zeus/CTransform.hpp" +#include "zeus/CVector2i.hpp" #include "boo/graphicsdev/IGraphicsDataFactory.hpp" #include "boo/graphicsdev/IGraphicsCommandQueue.hpp" -namespace pshag +namespace urde { enum class ERglLight : u8 @@ -152,14 +152,14 @@ public: static u32 g_NumLightsActive; static ERglLight g_LightActive; static ERglLight g_LightsWereOn; - static Zeus::CTransform g_GXModelView; - static Zeus::CTransform g_GXModelMatrix; - static Zeus::CTransform g_ViewMatrix; - static Zeus::CVector3f g_ViewPoint; - static Zeus::CTransform g_GXViewPointMatrix; - static Zeus::CTransform g_CameraMatrix; - static Zeus::CVector2i g_ViewportResolution; - static Zeus::CVector2i g_ViewportResolutionHalf; + static zeus::CTransform g_GXModelView; + static zeus::CTransform g_GXModelMatrix; + static zeus::CTransform g_ViewMatrix; + static zeus::CVector3f g_ViewPoint; + static zeus::CTransform g_GXViewPointMatrix; + static zeus::CTransform g_CameraMatrix; + static zeus::CVector2i g_ViewportResolution; + static zeus::CVector2i g_ViewportResolutionHalf; static int g_ViewportSamples; static bool g_IsGXModelMatrixIdentity; @@ -170,19 +170,19 @@ public: static void SetBlendMode(ERglBlendMode, ERglBlendFactor, ERglBlendFactor, ERglLogicOp); static void SetCullMode(ERglCullMode); static void SetAlphaCompare(ERglAlphaFunc comp0, u8 ref0, ERglAlphaOp op, ERglAlphaFunc comp1, u8 ref1); - static void SetViewPointMatrix(const Zeus::CTransform& xf); + static void SetViewPointMatrix(const zeus::CTransform& xf); static void SetViewMatrix(); - static void SetModelMatrix(const Zeus::CTransform& xf); - static Zeus::CMatrix4f GetPerspectiveProjectionMatrix(); + static void SetModelMatrix(const zeus::CTransform& xf); + static zeus::CMatrix4f GetPerspectiveProjectionMatrix(); static const CProjectionState& GetProjectionState(); static void SetProjectionState(const CProjectionState&); static void SetPerspective(float fovy, float aspect, float near, float far); static void FlushProjection(); - static Zeus::CVector2i ProjectPoint(const Zeus::CVector3f& point); - static SClipScreenRect ClipScreenRectFromMS(const Zeus::CVector3f& p1, const Zeus::CVector3f& p2); - static SClipScreenRect ClipScreenRectFromVS(const Zeus::CVector3f& p1, const Zeus::CVector3f& p2); - static Zeus::CVector3f ProjectModelPointToViewportSpace(const Zeus::CVector3f& point); - static void SetViewportResolution(const Zeus::CVector2i& res); + static zeus::CVector2i ProjectPoint(const zeus::CVector3f& point); + static SClipScreenRect ClipScreenRectFromMS(const zeus::CVector3f& p1, const zeus::CVector3f& p2); + static SClipScreenRect ClipScreenRectFromVS(const zeus::CVector3f& p1, const zeus::CVector3f& p2); + static zeus::CVector3f ProjectModelPointToViewportSpace(const zeus::CVector3f& point); + static void SetViewportResolution(const zeus::CVector2i& res); static boo::IGraphicsDataFactory* g_BooFactory; static boo::IGraphicsCommandQueue* g_BooMainCommandQueue; diff --git a/Runtime/Graphics/CLight.cpp b/Runtime/Graphics/CLight.cpp new file mode 100644 index 000000000..8994ed2c8 --- /dev/null +++ b/Runtime/Graphics/CLight.cpp @@ -0,0 +1,24 @@ +#include "CLight.hpp" + +namespace urde +{ + +CLight CLight::BuildDirectional(const zeus::CVector3f& dir, const zeus::CColor& color) +{ + return {}; +} + +CLight CLight::BuildSpot(const zeus::CVector3f& pos, const zeus::CVector3f& dir, + const zeus::CColor& color, float angle) +{ + return {}; +} + +CLight CLight::BuildCustom(const zeus::CVector3f& pos, const zeus::CVector3f& dir, + const zeus::CColor& color, float constAtt, float linearAtt, float quadAtt, + float intensity, float, float) +{ + return {}; +} + +} diff --git a/Runtime/Graphics/CLight.hpp b/Runtime/Graphics/CLight.hpp index 9ed5edac1..a3c183df2 100644 --- a/Runtime/Graphics/CLight.hpp +++ b/Runtime/Graphics/CLight.hpp @@ -1,8 +1,39 @@ #ifndef __PSHAG_CLIGHT_HPP__ #define __PSHAG_CLIGHT_HPP__ -class CLight +#include "zeus/CVector3f.hpp" +#include "zeus/CColor.hpp" + +namespace urde { + +enum class ELightType +{ + LocalAmbient, + Directional, + Custom, + Spot, + Spot2, + LocalAmbient2 +}; +enum class EFalloffType +{ + Constant, + Linear, + Quadratic }; +class CLight +{ +public: + static CLight BuildDirectional(const zeus::CVector3f& dir, const zeus::CColor& color); + static CLight BuildSpot(const zeus::CVector3f& pos, const zeus::CVector3f& dir, + const zeus::CColor& color, float angle); + static CLight BuildCustom(const zeus::CVector3f& pos, const zeus::CVector3f& dir, + const zeus::CColor& color, float constAtt, float linearAtt, float quadAtt, + float intensity, float, float); +}; + +} + #endif // __PSHAG_CLIGHT_HPP__ diff --git a/Runtime/Graphics/CLineRenderer.cpp b/Runtime/Graphics/CLineRenderer.cpp index 90dffebd0..a9c5c12bb 100644 --- a/Runtime/Graphics/CLineRenderer.cpp +++ b/Runtime/Graphics/CLineRenderer.cpp @@ -1,9 +1,9 @@ #include "CLineRenderer.hpp" #include "CLineRendererShaders.hpp" -namespace pshag +namespace urde { -LogVisor::LogModule LineRendererLog("pshag::CLineRenderer"); +logvisor::Module LineRendererLog("urde::CLineRenderer"); boo::IShaderPipeline* CLineRendererShaders::m_texAlpha = nullptr; boo::IShaderPipeline* CLineRendererShaders::m_texAdditive = nullptr; @@ -66,20 +66,20 @@ void CLineRenderer::Shutdown() struct SDrawVertTex { - Zeus::CVector4f pos; - Zeus::CColor color; - Zeus::CVector2f uv; + zeus::CVector4f pos; + zeus::CColor color; + zeus::CVector2f uv; }; struct SDrawVertNoTex { - Zeus::CVector4f pos; - Zeus::CColor color; + zeus::CVector4f pos; + zeus::CColor color; }; struct SDrawUniform { - Zeus::CColor moduColor; + zeus::CColor moduColor; }; void CLineRendererShaders::BuildShaderDataBinding(CLineRenderer& renderer, @@ -109,7 +109,7 @@ CLineRenderer::CLineRenderer(EPrimitiveMode mode, u32 maxVerts, boo::ITexture* t { if (maxVerts < 2) { - LineRendererLog.report(LogVisor::FatalError, _S("maxVerts < 2, maxVerts = %i"), maxVerts); + LineRendererLog.report(logvisor::Fatal, _S("maxVerts < 2, maxVerts = %i"), maxVerts); return; } m_textured = texture != nullptr; @@ -139,11 +139,11 @@ CLineRenderer::CLineRenderer(EPrimitiveMode mode, u32 maxVerts, boo::ITexture* t static rstl::reserved_vector g_StaticLineVertsTex; static rstl::reserved_vector g_StaticLineVertsNoTex; -static Zeus::CVector2f IntersectLines(const Zeus::CVector2f& pa1, const Zeus::CVector2f& pa2, - const Zeus::CVector2f& pb1, const Zeus::CVector2f& pb2) +static zeus::CVector2f IntersectLines(const zeus::CVector2f& pa1, const zeus::CVector2f& pa2, + const zeus::CVector2f& pb1, const zeus::CVector2f& pb2) { - Zeus::CVector2f pa1mpa2 = pa1 - pa2; - Zeus::CVector2f pb1mpb2 = pb1 - pb2; + zeus::CVector2f pa1mpa2 = pa1 - pa2; + zeus::CVector2f pb1mpb2 = pb1 - pb2; float denom = pa1mpa2.x * pb1mpb2.y - pa1mpa2.y * pb1mpb2.x; float numt1 = pa1.x * pa2.y - pa1.y * pa2.x; float numt2 = pb1.x * pb2.y - pb1.y * pb2.x; @@ -161,14 +161,14 @@ void CLineRenderer::Reset() g_StaticLineVertsNoTex.clear(); } -void CLineRenderer::AddVertex(const Zeus::CVector3f& position, const Zeus::CColor& color, float width, - const Zeus::CVector2f& uv) +void CLineRenderer::AddVertex(const zeus::CVector3f& position, const zeus::CColor& color, float width, + const zeus::CVector2f& uv) { if (m_final || !m_shaderBind || m_nextVert >= m_maxVerts) return; float adjWidth = width / 480.f; - Zeus::CVector3f projPt = CGraphics::ProjectModelPointToViewportSpace(position); + zeus::CVector3f projPt = CGraphics::ProjectModelPointToViewportSpace(position); if (m_mode == EPrimitiveMode::LineLoop) { @@ -188,13 +188,13 @@ void CLineRenderer::AddVertex(const Zeus::CVector3f& position, const Zeus::CColo if (m_nextVert > 1) { - Zeus::CVector2f dva = (m_lastPos - m_lastPos2).toVec2f(); + zeus::CVector2f dva = (m_lastPos - m_lastPos2).toVec2f(); if (!dva.canBeNormalized()) dva = {0.f, 1.f}; dva = dva.normalized().perpendicularVector() * m_lastWidth; dva.x /= CGraphics::g_ProjAspect; - Zeus::CVector2f dvb = (projPt - m_lastPos).toVec2f(); + zeus::CVector2f dvb = (projPt - m_lastPos).toVec2f(); if (!dvb.canBeNormalized()) dvb = {0.f, 1.f}; dvb = dvb.normalized().perpendicularVector() * m_lastWidth; @@ -219,11 +219,11 @@ void CLineRenderer::AddVertex(const Zeus::CVector3f& position, const Zeus::CColo } else { - Zeus::CVector3f intersect1 = IntersectLines(m_lastPos2.toVec2f() + dva, m_lastPos.toVec2f() + dva, + zeus::CVector3f intersect1 = IntersectLines(m_lastPos2.toVec2f() + dva, m_lastPos.toVec2f() + dva, m_lastPos.toVec2f() + dvb, projPt.toVec2f() + dvb); intersect1.z = m_lastPos.z; - Zeus::CVector3f intersect2 = IntersectLines(m_lastPos2.toVec2f() - dva, m_lastPos.toVec2f() - dva, + zeus::CVector3f intersect2 = IntersectLines(m_lastPos2.toVec2f() - dva, m_lastPos.toVec2f() - dva, m_lastPos.toVec2f() - dvb, projPt.toVec2f() - dvb); intersect2.z = m_lastPos.z; @@ -250,11 +250,11 @@ void CLineRenderer::AddVertex(const Zeus::CVector3f& position, const Zeus::CColo } else { - Zeus::CVector3f intersect1 = IntersectLines(m_lastPos2.toVec2f() + dva, m_lastPos.toVec2f() + dva, + zeus::CVector3f intersect1 = IntersectLines(m_lastPos2.toVec2f() + dva, m_lastPos.toVec2f() + dva, m_lastPos.toVec2f() + dvb, projPt.toVec2f() + dvb); intersect1.z = m_lastPos.z; - Zeus::CVector3f intersect2 = IntersectLines(m_lastPos2.toVec2f() - dva, m_lastPos.toVec2f() - dva, + zeus::CVector3f intersect2 = IntersectLines(m_lastPos2.toVec2f() - dva, m_lastPos.toVec2f() - dva, m_lastPos.toVec2f() - dvb, projPt.toVec2f() - dvb); intersect2.z = m_lastPos.z; @@ -265,7 +265,7 @@ void CLineRenderer::AddVertex(const Zeus::CVector3f& position, const Zeus::CColo } else if (m_nextVert == 1) { - Zeus::CVector2f dv = (projPt - m_lastPos).toVec2f(); + zeus::CVector2f dv = (projPt - m_lastPos).toVec2f(); if (!dv.canBeNormalized()) dv = {0.f, 1.f}; dv = dv.normalized().perpendicularVector() * m_lastWidth; @@ -290,30 +290,30 @@ void CLineRenderer::AddVertex(const Zeus::CVector3f& position, const Zeus::CColo ++m_nextVert; } -void CLineRenderer::Render(const Zeus::CColor& moduColor) +void CLineRenderer::Render(const zeus::CColor& moduColor) { if (!m_final && m_nextVert > 1) { if (m_mode == EPrimitiveMode::LineLoop) { { - Zeus::CVector2f dva = (m_lastPos - m_lastPos2).toVec2f(); + zeus::CVector2f dva = (m_lastPos - m_lastPos2).toVec2f(); if (!dva.canBeNormalized()) dva = {0.f, 1.f}; dva = dva.normalized().perpendicularVector() * m_lastWidth; dva.x /= CGraphics::g_ProjAspect; - Zeus::CVector2f dvb = (m_firstPos - m_lastPos).toVec2f(); + zeus::CVector2f dvb = (m_firstPos - m_lastPos).toVec2f(); if (!dvb.canBeNormalized()) dvb = {0.f, 1.f}; dvb = dvb.normalized().perpendicularVector() * m_lastWidth; dvb.x /= CGraphics::g_ProjAspect; - Zeus::CVector3f intersect1 = IntersectLines(m_lastPos2.toVec2f() + dva, m_lastPos.toVec2f() + dva, + zeus::CVector3f intersect1 = IntersectLines(m_lastPos2.toVec2f() + dva, m_lastPos.toVec2f() + dva, m_lastPos.toVec2f() + dvb, m_firstPos.toVec2f() + dvb); intersect1.z = m_lastPos.z; - Zeus::CVector3f intersect2 = IntersectLines(m_lastPos2.toVec2f() - dva, m_lastPos.toVec2f() - dva, + zeus::CVector3f intersect2 = IntersectLines(m_lastPos2.toVec2f() - dva, m_lastPos.toVec2f() - dva, m_lastPos.toVec2f() - dvb, m_firstPos.toVec2f() - dvb); intersect2.z = m_lastPos.z; @@ -329,23 +329,23 @@ void CLineRenderer::Render(const Zeus::CColor& moduColor) } } { - Zeus::CVector2f dva = (m_firstPos - m_lastPos).toVec2f(); + zeus::CVector2f dva = (m_firstPos - m_lastPos).toVec2f(); if (!dva.canBeNormalized()) dva = {0.f, 1.f}; dva = dva.normalized().perpendicularVector() * m_firstWidth; dva.x /= CGraphics::g_ProjAspect; - Zeus::CVector2f dvb = (m_secondPos - m_firstPos).toVec2f(); + zeus::CVector2f dvb = (m_secondPos - m_firstPos).toVec2f(); if (!dvb.canBeNormalized()) dvb = {0.f, 1.f}; dvb = dvb.normalized().perpendicularVector() * m_firstWidth; dvb.x /= CGraphics::g_ProjAspect; - Zeus::CVector3f intersect1 = IntersectLines(m_lastPos.toVec2f() + dva, m_firstPos.toVec2f() + dva, + zeus::CVector3f intersect1 = IntersectLines(m_lastPos.toVec2f() + dva, m_firstPos.toVec2f() + dva, m_firstPos.toVec2f() + dvb, m_secondPos.toVec2f() + dvb); intersect1.z = m_firstPos.z; - Zeus::CVector3f intersect2 = IntersectLines(m_lastPos.toVec2f() - dva, m_firstPos.toVec2f() - dva, + zeus::CVector3f intersect2 = IntersectLines(m_lastPos.toVec2f() - dva, m_firstPos.toVec2f() - dva, m_firstPos.toVec2f() - dvb, m_secondPos.toVec2f() - dvb); intersect2.z = m_firstPos.z; @@ -363,7 +363,7 @@ void CLineRenderer::Render(const Zeus::CColor& moduColor) } else { - Zeus::CVector2f dv = (m_lastPos - m_lastPos2).toVec2f(); + zeus::CVector2f dv = (m_lastPos - m_lastPos2).toVec2f(); if (!dv.canBeNormalized()) dv = {0.f, 1.f}; dv = dv.normalized().perpendicularVector() * m_lastWidth; diff --git a/Runtime/Graphics/CLineRenderer.hpp b/Runtime/Graphics/CLineRenderer.hpp index 9d23945b6..01155ad12 100644 --- a/Runtime/Graphics/CLineRenderer.hpp +++ b/Runtime/Graphics/CLineRenderer.hpp @@ -2,11 +2,11 @@ #define __PSHAG_CLINERENDERER_HPP__ #include "RetroTypes.hpp" -#include "CVector3f.hpp" -#include "CColor.hpp" +#include "zeus/CVector3f.hpp" +#include "zeus/CColor.hpp" #include "boo/graphicsdev/IGraphicsDataFactory.hpp" -namespace pshag +namespace urde { class CLineRenderer @@ -26,16 +26,16 @@ private: bool m_final = false; bool m_textured; - Zeus::CVector3f m_firstPos; - Zeus::CVector3f m_secondPos; - Zeus::CVector2f m_firstUV; - Zeus::CColor m_firstColor; + zeus::CVector3f m_firstPos; + zeus::CVector3f m_secondPos; + zeus::CVector2f m_firstUV; + zeus::CColor m_firstColor; float m_firstWidth; - Zeus::CVector3f m_lastPos; - Zeus::CVector3f m_lastPos2; - Zeus::CVector2f m_lastUV; - Zeus::CColor m_lastColor; + zeus::CVector3f m_lastPos; + zeus::CVector3f m_lastPos2; + zeus::CVector2f m_lastUV; + zeus::CColor m_lastColor; float m_lastWidth; public: @@ -47,9 +47,9 @@ public: CLineRenderer(EPrimitiveMode mode, u32 maxVerts, boo::ITexture* texture, bool additive); void Reset(); - void AddVertex(const Zeus::CVector3f& position, const Zeus::CColor& color, float width, - const Zeus::CVector2f& uv=Zeus::CVector2f::skZero); - void Render(const Zeus::CColor& moduColor=Zeus::CColor::skWhite); + void AddVertex(const zeus::CVector3f& position, const zeus::CColor& color, float width, + const zeus::CVector2f& uv=zeus::CVector2f::skZero); + void Render(const zeus::CColor& moduColor=zeus::CColor::skWhite); static void Initialize(); static void Shutdown(); diff --git a/Runtime/Graphics/CLineRendererShaders.hpp b/Runtime/Graphics/CLineRendererShaders.hpp index 4d810e6d7..2360da34d 100644 --- a/Runtime/Graphics/CLineRendererShaders.hpp +++ b/Runtime/Graphics/CLineRendererShaders.hpp @@ -1,13 +1,13 @@ #ifndef __PSHAG_CLINERENDERERSHADERS_HPP__ #define __PSHAG_CLINERENDERERSHADERS_HPP__ -#include "CGraphics.hpp" +#include "Graphics/CGraphics.hpp" #include "boo/graphicsdev/GL.hpp" #include "boo/graphicsdev/D3D.hpp" #include "boo/graphicsdev/Metal.hpp" #include "boo/graphicsdev/Vulkan.hpp" -namespace pshag +namespace urde { class CLineRenderer; diff --git a/Runtime/Graphics/CLineRendererShadersGLSL.cpp b/Runtime/Graphics/CLineRendererShadersGLSL.cpp index 57d3d7b28..8f98fd0c1 100644 --- a/Runtime/Graphics/CLineRendererShadersGLSL.cpp +++ b/Runtime/Graphics/CLineRendererShadersGLSL.cpp @@ -1,7 +1,7 @@ #include "CLineRendererShaders.hpp" #include "CLineRenderer.hpp" -namespace pshag +namespace urde { static const char* VS_GLSL_TEX = diff --git a/Runtime/Graphics/CLineRendererShadersHLSL.cpp b/Runtime/Graphics/CLineRendererShadersHLSL.cpp index 909d38f03..97aaf6e88 100644 --- a/Runtime/Graphics/CLineRendererShadersHLSL.cpp +++ b/Runtime/Graphics/CLineRendererShadersHLSL.cpp @@ -1,7 +1,7 @@ #include "CLineRendererShaders.hpp" #include "CLineRenderer.hpp" -namespace pshag +namespace urde { static const char* VS_HLSL_TEX = diff --git a/Runtime/Graphics/CLineRendererShadersMetal.cpp b/Runtime/Graphics/CLineRendererShadersMetal.cpp index d59cc9234..105ec603e 100644 --- a/Runtime/Graphics/CLineRendererShadersMetal.cpp +++ b/Runtime/Graphics/CLineRendererShadersMetal.cpp @@ -1,7 +1,7 @@ #include "CLineRendererShaders.hpp" #include "CLineRenderer.hpp" -namespace pshag +namespace urde { static const char* VS_METAL_TEX = diff --git a/Runtime/Graphics/CMakeLists.txt b/Runtime/Graphics/CMakeLists.txt index 8f2600b13..1f889ac09 100644 --- a/Runtime/Graphics/CMakeLists.txt +++ b/Runtime/Graphics/CMakeLists.txt @@ -10,5 +10,8 @@ add_library(RuntimeCommonGraphics CLineRenderer.hpp CLineRenderer.cpp CLineRendererShaders.hpp CLineRendererShadersGLSL.cpp CMetroidModelInstance.hpp - CLight.hpp + CLight.hpp CLight.cpp + CTexture.hpp CTextureBoo.cpp + CModel.hpp CModelBoo.cpp + CGraphics.hpp CGraphics.cpp ${PLAT_SRCS}) diff --git a/Runtime/Graphics/CMetroidModelInstance.hpp b/Runtime/Graphics/CMetroidModelInstance.hpp index 7906a7d3e..ad1428745 100644 --- a/Runtime/Graphics/CMetroidModelInstance.hpp +++ b/Runtime/Graphics/CMetroidModelInstance.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CMETROIDMODELINSTANCE_HPP__ #define __PSHAG_CMETROIDMODELINSTANCE_HPP__ -namespace pshag +namespace urde { class CMetroidModelInstance diff --git a/Runtime/CModel.hpp b/Runtime/Graphics/CModel.hpp similarity index 79% rename from Runtime/CModel.hpp rename to Runtime/Graphics/CModel.hpp index 839a72c60..327ed265d 100644 --- a/Runtime/CModel.hpp +++ b/Runtime/Graphics/CModel.hpp @@ -2,9 +2,9 @@ #define __PSHAG_CMODEL_HPP__ #include "RetroTypes.hpp" -#include "CColor.hpp" +#include "zeus/CColor.hpp" -namespace pshag +namespace urde { struct CModelFlags @@ -12,7 +12,7 @@ struct CModelFlags u8 f1; u8 f2; u16 f3; - Zeus::CColor color; + zeus::CColor color; }; class CModel diff --git a/Runtime/CModelBoo.cpp b/Runtime/Graphics/CModelBoo.cpp similarity index 57% rename from Runtime/CModelBoo.cpp rename to Runtime/Graphics/CModelBoo.cpp index 16f87e2d7..42497fc01 100644 --- a/Runtime/CModelBoo.cpp +++ b/Runtime/Graphics/CModelBoo.cpp @@ -1,6 +1,6 @@ -#include "CModel.hpp" +#include "Graphics/CModel.hpp" -namespace pshag +namespace urde { void CModel::Draw(const CModelFlags& flags) const diff --git a/Runtime/CTexture.hpp b/Runtime/Graphics/CTexture.hpp similarity index 96% rename from Runtime/CTexture.hpp rename to Runtime/Graphics/CTexture.hpp index d6ce03a9b..e17db48f8 100644 --- a/Runtime/CTexture.hpp +++ b/Runtime/Graphics/CTexture.hpp @@ -4,10 +4,10 @@ #include "GCNTypes.hpp" #include "IObj.hpp" #include "IOStreams.hpp" -#include "CGraphics.hpp" +#include "Graphics/CGraphics.hpp" #include "boo/graphicsdev/IGraphicsDataFactory.hpp" -namespace pshag +namespace urde { class CVParamTransfer; diff --git a/Runtime/CTextureBoo.cpp b/Runtime/Graphics/CTextureBoo.cpp similarity index 99% rename from Runtime/CTextureBoo.cpp rename to Runtime/Graphics/CTextureBoo.cpp index 4f1d59cb4..30b898259 100644 --- a/Runtime/CTextureBoo.cpp +++ b/Runtime/Graphics/CTextureBoo.cpp @@ -1,9 +1,9 @@ #include "CTexture.hpp" #include "CSimplePool.hpp" #include "CToken.hpp" -#include "CGraphics.hpp" +#include "Graphics/CGraphics.hpp" -namespace pshag +namespace urde { /* GX uses this upsampling technique to prevent banding on downsampled texture formats */ @@ -606,8 +606,8 @@ void CTexture::BuildDXT1FromGCN(CInputStream& in) in.readBytesToBuf(source, 16); for (int x=0 ; x<2 ; ++x) { - target[x].color1 = HECL::SBig(source[x].color1); - target[x].color2 = HECL::SBig(source[x].color2); + target[x].color1 = hecl::SBig(source[x].color1); + target[x].color2 = hecl::SBig(source[x].color2); for (int i=0 ; i<4 ; ++i) { u8 ind[4]; diff --git a/Runtime/Graphics/IRenderer.hpp b/Runtime/Graphics/IRenderer.hpp index 421b43078..9f2298578 100644 --- a/Runtime/Graphics/IRenderer.hpp +++ b/Runtime/Graphics/IRenderer.hpp @@ -4,12 +4,12 @@ #include #include "../RetroTypes.hpp" #include "../CToken.hpp" -#include "CAABox.hpp" -#include "CPlane.hpp" +#include "zeus/CAABox.hpp" +#include "zeus/CPlane.hpp" #include "CFrustum.hpp" -#include "CColor.hpp" +#include "zeus/CColor.hpp" -namespace pshag +namespace urde { class CMetroidModelInstance; class CLight; diff --git a/Runtime/GuiSys/CConsoleOutputWindow.hpp b/Runtime/GuiSys/CConsoleOutputWindow.hpp index 53591bbbf..a4e82a0dc 100644 --- a/Runtime/GuiSys/CConsoleOutputWindow.hpp +++ b/Runtime/GuiSys/CConsoleOutputWindow.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CCONSOLEOUTPUTWINDOW_HPP__ #define __PSHAG_CCONSOLEOUTPUTWINDOW_HPP__ -namespace pshag +namespace urde { class CConsoleOutputWindow diff --git a/Runtime/GuiSys/CGuiSys.hpp b/Runtime/GuiSys/CGuiSys.hpp index fa36c97c9..e596167c8 100644 --- a/Runtime/GuiSys/CGuiSys.hpp +++ b/Runtime/GuiSys/CGuiSys.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CGUISYS_HPP__ #define __PSHAG_CGUISYS_HPP__ -namespace pshag +namespace urde { class CGuiSys diff --git a/Runtime/GuiSys/CSplashScreen.hpp b/Runtime/GuiSys/CSplashScreen.hpp index 50994e114..1178c955b 100644 --- a/Runtime/GuiSys/CSplashScreen.hpp +++ b/Runtime/GuiSys/CSplashScreen.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CSPLASHSCREEN_HPP__ #define __PSHAG_CSPLASHSCREEN_HPP__ -namespace pshag +namespace urde { class CSplashScreen diff --git a/Runtime/IAllocator.cpp b/Runtime/IAllocator.cpp index daa46b2a0..fdc53541d 100644 --- a/Runtime/IAllocator.cpp +++ b/Runtime/IAllocator.cpp @@ -1,6 +1,6 @@ #include "IAllocator.hpp" -namespace pshag +namespace urde { } diff --git a/Runtime/IAllocator.hpp b/Runtime/IAllocator.hpp index a018b075b..ce1c0541a 100644 --- a/Runtime/IAllocator.hpp +++ b/Runtime/IAllocator.hpp @@ -3,7 +3,7 @@ #include "RetroTypes.hpp" -namespace pshag +namespace urde { class COsContext; class CCallStack; diff --git a/Runtime/IFactory.hpp b/Runtime/IFactory.hpp index 28c8a0364..10006a064 100644 --- a/Runtime/IFactory.hpp +++ b/Runtime/IFactory.hpp @@ -4,7 +4,7 @@ #include #include "RetroTypes.hpp" -namespace pshag +namespace urde { class CVParamTransfer; class IObj; diff --git a/Runtime/IOStreams.cpp b/Runtime/IOStreams.cpp index d10bb427f..df0697066 100644 --- a/Runtime/IOStreams.cpp +++ b/Runtime/IOStreams.cpp @@ -1,7 +1,7 @@ #include "IOStreams.hpp" #include "CMemory.hpp" -namespace pshag +namespace urde { class CZipSupport diff --git a/Runtime/IOStreams.hpp b/Runtime/IOStreams.hpp index 72b50af32..31655f6bb 100644 --- a/Runtime/IOStreams.hpp +++ b/Runtime/IOStreams.hpp @@ -2,18 +2,18 @@ #define __PSHAG_IOSTREAMS_HPP__ #include "RetroTypes.hpp" -#include -#include -#include +#include +#include +#include #include -namespace pshag +namespace urde { -using CInputStream = Athena::io::IStreamReader; -using COutputStream = Athena::io::IStreamWriter; +using CInputStream = athena::io::IStreamReader; +using COutputStream = athena::io::IStreamWriter; -using CMemoryInStream = Athena::io::MemoryReader; +using CMemoryInStream = athena::io::MemoryReader; class CZipInputStream : public CInputStream { @@ -24,7 +24,7 @@ public: CZipInputStream(std::unique_ptr&& strm); ~CZipInputStream(); atUint64 readUBytesToBuf(void *buf, atUint64 len); - void seek(atInt64, Athena::SeekOrigin) {} + void seek(atInt64, athena::SeekOrigin) {} atUint64 position() const {return 0;} atUint64 length() const {return 0;} }; diff --git a/Runtime/IObj.hpp b/Runtime/IObj.hpp index 2552cd00b..e46fc4f00 100644 --- a/Runtime/IObj.hpp +++ b/Runtime/IObj.hpp @@ -3,7 +3,7 @@ #include "RetroTypes.hpp" -namespace pshag +namespace urde { class IObj diff --git a/Runtime/IObjectStore.hpp b/Runtime/IObjectStore.hpp index d9dc3f138..d414a4816 100644 --- a/Runtime/IObjectStore.hpp +++ b/Runtime/IObjectStore.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_IOBJECTSTORE_HPP__ #define __PSHAG_IOBJECTSTORE_HPP__ -namespace pshag +namespace urde { struct SObjectTag; class CVParamTransfer; diff --git a/Runtime/IRuntimeMain.hpp b/Runtime/IRuntimeMain.hpp index 4c13a81b3..c11f1b474 100644 --- a/Runtime/IRuntimeMain.hpp +++ b/Runtime/IRuntimeMain.hpp @@ -1,7 +1,7 @@ #ifndef IRUNTIMEMAIN_HPP #define IRUNTIMEMAIN_HPP -namespace pshag +namespace urde { struct IRuntimeMain { diff --git a/Runtime/IVParamObj.hpp b/Runtime/IVParamObj.hpp index 7f2fb0b44..d60b96237 100644 --- a/Runtime/IVParamObj.hpp +++ b/Runtime/IVParamObj.hpp @@ -4,7 +4,7 @@ #include #include "IObj.hpp" -namespace pshag +namespace urde { class IVParamObj : public IObj diff --git a/Runtime/Input/CFinalInput.cpp b/Runtime/Input/CFinalInput.cpp index a36bae0fa..65794e248 100644 --- a/Runtime/Input/CFinalInput.cpp +++ b/Runtime/Input/CFinalInput.cpp @@ -1,7 +1,7 @@ -#include +#include "zeus/Math.hpp" #include "CFinalInput.hpp" -namespace pshag +namespace urde { CFinalInput::CFinalInput() @@ -55,10 +55,10 @@ CFinalInput::CFinalInput(int cIdx, float dt, float leftDiv, float rightDiv) : x0_dt(dt), x4_controllerIdx(cIdx), - x8_anaLeftX(Zeus::Math::clamp(-1.0f, data.m_leftStick[0] / 72.0f / leftDiv, 1.0f)), - xc_anaLeftY(Zeus::Math::clamp(-1.0f, data.m_leftStick[1] / 72.0f / leftDiv, 1.0f)), - x10_anaRightX(Zeus::Math::clamp(-1.0f, data.m_rightStick[0] / 59.0f / rightDiv, 1.0f)), - x14_anaRightY(Zeus::Math::clamp(-1.0f, data.m_rightStick[0] / 59.0f / rightDiv, 1.0f)), + x8_anaLeftX(zeus::clamp(-1.0f, data.m_leftStick[0] / 72.0f / leftDiv, 1.0f)), + xc_anaLeftY(zeus::clamp(-1.0f, data.m_leftStick[1] / 72.0f / leftDiv, 1.0f)), + x10_anaRightX(zeus::clamp(-1.0f, data.m_rightStick[0] / 59.0f / rightDiv, 1.0f)), + x14_anaRightY(zeus::clamp(-1.0f, data.m_rightStick[0] / 59.0f / rightDiv, 1.0f)), x18_anaLeftTrigger(data.m_analogTriggers[0] * 0.0066666668), x1c_anaRightTrigger(data.m_analogTriggers[1] * 0.0066666668), x20_enableAnaLeftXP(DLARight() && !prevInput.DLARight()), @@ -184,13 +184,13 @@ CFinalInput::CFinalInput(int cIdx, float dt, { if (x8_anaLeftX || xc_anaLeftY) { - float len = sqrtf(x8_anaLeftX * x8_anaLeftX + xc_anaLeftY * xc_anaLeftY); + float len = std::sqrt(x8_anaLeftX * x8_anaLeftX + xc_anaLeftY * xc_anaLeftY); x8_anaLeftX /= len; xc_anaLeftY /= len; } if (x10_anaRightX || x14_anaRightY) { - float len = sqrtf(x10_anaRightX * x10_anaRightX + x14_anaRightY * x14_anaRightY); + float len = std::sqrt(x10_anaRightX * x10_anaRightX + x14_anaRightY * x14_anaRightY); x10_anaRightX /= len; x14_anaRightY /= len; } @@ -198,17 +198,17 @@ CFinalInput::CFinalInput(int cIdx, float dt, CFinalInput& CFinalInput::operator|=(const CFinalInput& other) { - if (fabsf(other.x8_anaLeftX) > fabsf(x8_anaLeftX)) + if (std::fabs(other.x8_anaLeftX) > std::fabs(x8_anaLeftX)) x8_anaLeftX = other.x8_anaLeftX; - if (fabsf(other.xc_anaLeftY) > fabsf(xc_anaLeftY)) + if (std::fabs(other.xc_anaLeftY) > std::fabs(xc_anaLeftY)) xc_anaLeftY = other.xc_anaLeftY; - if (fabsf(other.x10_anaRightX) > fabsf(x10_anaRightX)) + if (std::fabs(other.x10_anaRightX) > std::fabs(x10_anaRightX)) x10_anaRightX = other.x10_anaRightX; - if (fabsf(other.x14_anaRightY) > fabsf(x14_anaRightY)) + if (std::fabs(other.x14_anaRightY) > std::fabs(x14_anaRightY)) x14_anaRightY = other.x14_anaRightY; - if (fabsf(other.x18_anaLeftTrigger) > fabsf(x18_anaLeftTrigger)) + if (std::fabs(other.x18_anaLeftTrigger) > std::fabs(x18_anaLeftTrigger)) x18_anaLeftTrigger = other.x18_anaLeftTrigger; - if (fabsf(other.x1c_anaRightTrigger) > fabsf(x1c_anaRightTrigger)) + if (std::fabs(other.x1c_anaRightTrigger) > std::fabs(x1c_anaRightTrigger)) x1c_anaRightTrigger = other.x1c_anaRightTrigger; x20_enableAnaLeftXP |= other.x20_enableAnaLeftXP; x20_enableAnaLeftNegXP |= other.x20_enableAnaLeftNegXP; diff --git a/Runtime/Input/CFinalInput.hpp b/Runtime/Input/CFinalInput.hpp index b8ee75992..ed19f0dd3 100644 --- a/Runtime/Input/CFinalInput.hpp +++ b/Runtime/Input/CFinalInput.hpp @@ -5,7 +5,7 @@ #include "CKeyboardMouseController.hpp" #include -namespace pshag +namespace urde { class CFinalInput diff --git a/Runtime/Input/CInputGenerator.cpp b/Runtime/Input/CInputGenerator.cpp index 6f4abf82a..3f2ca57e0 100644 --- a/Runtime/Input/CInputGenerator.cpp +++ b/Runtime/Input/CInputGenerator.cpp @@ -2,7 +2,7 @@ #include "../CArchitectureMessage.hpp" #include "../CArchitectureQueue.hpp" -namespace pshag +namespace urde { void CInputGenerator::Update(float dt, CArchitectureQueue& queue) diff --git a/Runtime/Input/CInputGenerator.hpp b/Runtime/Input/CInputGenerator.hpp index 160366378..cf906b59f 100644 --- a/Runtime/Input/CInputGenerator.hpp +++ b/Runtime/Input/CInputGenerator.hpp @@ -6,7 +6,7 @@ #include "CFinalInput.hpp" #include "CKeyboardMouseController.hpp" -namespace pshag +namespace urde { class CArchitectureQueue; diff --git a/Runtime/Input/CKeyboardMouseController.hpp b/Runtime/Input/CKeyboardMouseController.hpp index 01711f440..4218b796a 100644 --- a/Runtime/Input/CKeyboardMouseController.hpp +++ b/Runtime/Input/CKeyboardMouseController.hpp @@ -3,7 +3,7 @@ #include -namespace pshag +namespace urde { struct CKeyboardMouseControllerData diff --git a/Runtime/Input/CRumbleGenerator.cpp b/Runtime/Input/CRumbleGenerator.cpp index 24c7861df..aefbbc2f4 100644 --- a/Runtime/Input/CRumbleGenerator.cpp +++ b/Runtime/Input/CRumbleGenerator.cpp @@ -1,6 +1,6 @@ #include "CRumbleGenerator.hpp" -namespace pshag +namespace urde { CRumbleGenerator::CRumbleGenerator() { diff --git a/Runtime/Input/CRumbleGenerator.hpp b/Runtime/Input/CRumbleGenerator.hpp index e9c2ca247..504390b11 100644 --- a/Runtime/Input/CRumbleGenerator.hpp +++ b/Runtime/Input/CRumbleGenerator.hpp @@ -3,7 +3,7 @@ #include "CRumbleVoice.hpp" -namespace pshag +namespace urde { class CRumbleGenerator { diff --git a/Runtime/Input/CRumbleManager.cpp b/Runtime/Input/CRumbleManager.cpp index f5a0c7618..83ec3725d 100644 --- a/Runtime/Input/CRumbleManager.cpp +++ b/Runtime/Input/CRumbleManager.cpp @@ -1,6 +1,6 @@ #include "CRumbleManager.hpp" -namespace pshag +namespace urde { void CRumbleManager::Update(float dt) { x0_rumbleGenerator.Update(dt); } diff --git a/Runtime/Input/CRumbleManager.hpp b/Runtime/Input/CRumbleManager.hpp index cb19adf68..a8b14e88d 100644 --- a/Runtime/Input/CRumbleManager.hpp +++ b/Runtime/Input/CRumbleManager.hpp @@ -3,7 +3,7 @@ #include "CRumbleGenerator.hpp" -namespace pshag +namespace urde { class CStateManager; class CRumbleManager diff --git a/Runtime/Input/CRumbleVoice.cpp b/Runtime/Input/CRumbleVoice.cpp index 77ed2dfb1..6a8e37667 100644 --- a/Runtime/Input/CRumbleVoice.cpp +++ b/Runtime/Input/CRumbleVoice.cpp @@ -1,5 +1,5 @@ #include "CRumbleVoice.hpp" -namespace pshag +namespace urde { } diff --git a/Runtime/Input/CRumbleVoice.hpp b/Runtime/Input/CRumbleVoice.hpp index 1f61917c3..34945b942 100644 --- a/Runtime/Input/CRumbleVoice.hpp +++ b/Runtime/Input/CRumbleVoice.hpp @@ -3,7 +3,7 @@ #include "RetroTypes.hpp" -namespace pshag +namespace urde { enum class ERumbleFxId { diff --git a/Runtime/Input/ControlMapper.cpp b/Runtime/Input/ControlMapper.cpp index d749b843a..a48934e59 100644 --- a/Runtime/Input/ControlMapper.cpp +++ b/Runtime/Input/ControlMapper.cpp @@ -4,7 +4,7 @@ #include "DataSpec/DNACommon/Tweaks/ITweakPlayerControl.hpp" #include "../GameGlobalObjects.hpp" -namespace pshag +namespace urde { static const char* skCommandDescs[] = diff --git a/Runtime/Input/ControlMapper.hpp b/Runtime/Input/ControlMapper.hpp index 473f64215..4742b0fdf 100644 --- a/Runtime/Input/ControlMapper.hpp +++ b/Runtime/Input/ControlMapper.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CCONTROLMAPPER_HPP__ #define __PSHAG_CCONTROLMAPPER_HPP__ -namespace pshag +namespace urde { class CFinalInput; diff --git a/Runtime/Input/IController.hpp b/Runtime/Input/IController.hpp index b56cc4baa..0872ff0f3 100644 --- a/Runtime/Input/IController.hpp +++ b/Runtime/Input/IController.hpp @@ -3,7 +3,7 @@ #include "../RetroTypes.hpp" -namespace pshag +namespace urde { class IController diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index 6325c1f8b..2e7165e67 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -1,6 +1,6 @@ #include "CFrontEndUI.hpp" -namespace pshag +namespace urde { namespace MP1 { diff --git a/Runtime/MP1/CFrontEndUI.hpp b/Runtime/MP1/CFrontEndUI.hpp index 84f08065b..5122003f7 100644 --- a/Runtime/MP1/CFrontEndUI.hpp +++ b/Runtime/MP1/CFrontEndUI.hpp @@ -4,7 +4,7 @@ #include "CIOWin.hpp" #include "CGameDebug.hpp" -namespace pshag +namespace urde { class CGuiSliderGroup; class CGuiTableGroup; diff --git a/Runtime/MP1/CInGameTweakManager.hpp b/Runtime/MP1/CInGameTweakManager.hpp index c66e50bcb..b5d3de43d 100644 --- a/Runtime/MP1/CInGameTweakManager.hpp +++ b/Runtime/MP1/CInGameTweakManager.hpp @@ -3,7 +3,7 @@ #include "CInGameTweakManagerBase.hpp" -namespace pshag +namespace urde { namespace MP1 { diff --git a/Runtime/MP1/CMFGame.cpp b/Runtime/MP1/CMFGame.cpp index 3d0a78f74..59e80adc7 100644 --- a/Runtime/MP1/CMFGame.cpp +++ b/Runtime/MP1/CMFGame.cpp @@ -3,7 +3,7 @@ #include "GameGlobalObjects.hpp" #include "CGameState.hpp" -namespace pshag +namespace urde { namespace MP1 { diff --git a/Runtime/MP1/CMFGame.hpp b/Runtime/MP1/CMFGame.hpp index 4dee0c197..3d3e267b4 100644 --- a/Runtime/MP1/CMFGame.hpp +++ b/Runtime/MP1/CMFGame.hpp @@ -3,7 +3,7 @@ #include "CMFGameBase.hpp" -namespace pshag +namespace urde { namespace MP1 { diff --git a/Runtime/MP1/CMain.hpp b/Runtime/MP1/CMain.hpp index e77009869..27a08bf11 100644 --- a/Runtime/MP1/CMain.hpp +++ b/Runtime/MP1/CMain.hpp @@ -7,7 +7,7 @@ #include "CPlayMovie.hpp" #include "IOStreams.hpp" -namespace pshag +namespace urde { class CStopwatch; diff --git a/Runtime/MP1/CMainFlow.cpp b/Runtime/MP1/CMainFlow.cpp index 9ae1b3a9b..f0af7c86b 100644 --- a/Runtime/MP1/CMainFlow.cpp +++ b/Runtime/MP1/CMainFlow.cpp @@ -7,7 +7,7 @@ #include "CFrontEndUI.hpp" #include "GameGlobalObjects.hpp" -namespace pshag +namespace urde { namespace MP1 { diff --git a/Runtime/MP1/CMainFlow.hpp b/Runtime/MP1/CMainFlow.hpp index 86759f5cd..9fca4a27d 100644 --- a/Runtime/MP1/CMainFlow.hpp +++ b/Runtime/MP1/CMainFlow.hpp @@ -3,7 +3,7 @@ #include "CMainFlowBase.hpp" -namespace pshag +namespace urde { class CArchitectureMessage; class CArchitectureQueue; diff --git a/Runtime/MP1/CMakeLists.txt b/Runtime/MP1/CMakeLists.txt index 55e8d6057..ece07eba7 100644 --- a/Runtime/MP1/CMakeLists.txt +++ b/Runtime/MP1/CMakeLists.txt @@ -16,7 +16,7 @@ target_link_libraries(mp1 RuntimeCommon DNAMP1 DNACommon - HECLDatabase HECLBlender HECLCommon AthenaCore NOD - LogVisor AthenaLibYaml Boo ${PNG_LIB} squish xxhash Math + hecl-database hecl-blender hecl-common athena-core nod + logvisor athena-libyaml boo ${PNG_LIB} squish xxhash zeus ${ZLIB_LIBRARIES} ${LZO_LIB} ${BOO_SYS_LIBS}) diff --git a/Runtime/MP1/CPlayMovie.cpp b/Runtime/MP1/CPlayMovie.cpp index 5444b2db2..6045f2dd2 100644 --- a/Runtime/MP1/CPlayMovie.cpp +++ b/Runtime/MP1/CPlayMovie.cpp @@ -1,4 +1,4 @@ -namespace pshag +namespace urde { namespace MP1 { diff --git a/Runtime/MP1/CPlayMovie.hpp b/Runtime/MP1/CPlayMovie.hpp index c788f7078..9c55cae7c 100644 --- a/Runtime/MP1/CPlayMovie.hpp +++ b/Runtime/MP1/CPlayMovie.hpp @@ -3,7 +3,7 @@ #include "CPlayMovieBase.hpp" -namespace pshag +namespace urde { namespace MP1 { diff --git a/Runtime/MP1/CTweaks.cpp b/Runtime/MP1/CTweaks.cpp index 801bf1d61..58154492b 100644 --- a/Runtime/MP1/CTweaks.cpp +++ b/Runtime/MP1/CTweaks.cpp @@ -1,4 +1,4 @@ -#include +#include "logvisor/logvisor.hpp" #include "CTweaks.hpp" #include "CResFactory.hpp" #include "CResLoader.hpp" @@ -7,7 +7,7 @@ #include "DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp" #include "DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp" -namespace pshag +namespace urde { DataSpec::ITweakGame* g_tweakGame = nullptr; DataSpec::ITweakPlayer* g_tweakPlayer = nullptr; @@ -16,13 +16,13 @@ DataSpec::ITweakPlayerControl* g_tweakPlayerControl = nullptr; namespace MP1 { -LogVisor::LogModule Log("MP1::CTweaks"); +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::FatalError, "Tweak Asset not found when loading... '%s'", name); + Log.report(logvisor::Fatal, "Tweak Asset not found when loading... '%s'", name); return *tag; } diff --git a/Runtime/MP1/CTweaks.hpp b/Runtime/MP1/CTweaks.hpp index fb8f31581..b11f713c3 100644 --- a/Runtime/MP1/CTweaks.hpp +++ b/Runtime/MP1/CTweaks.hpp @@ -3,7 +3,7 @@ #include "RetroTypes.hpp" -namespace pshag +namespace urde { namespace MP1 diff --git a/Runtime/MP1/main.cpp b/Runtime/MP1/main.cpp index c3e675458..585b5c9c2 100644 --- a/Runtime/MP1/main.cpp +++ b/Runtime/MP1/main.cpp @@ -37,7 +37,7 @@ #include "DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp" #include "DataSpec/DNAMP1/Tweaks/CTweakGame.hpp" -namespace pshag +namespace urde { CMemoryCardSys* g_MemoryCardSys = nullptr; CResFactory* g_ResFactory = nullptr; @@ -223,7 +223,7 @@ void CMain::LoadAudio() int CMain::appMain(boo::IApplication* app) { - Zeus::detectCPU(); + zeus::detectCPU(); mainWindow = app->newWindow(_S("Metroid Prime 1 Reimplementation vZygote"), 1); mainWindow->showWindow(); TOneStatic globalObjs; @@ -278,8 +278,8 @@ int main(int argc, const char* argv[]) std::setlocale(LC_ALL, "en-US.UTF-8"); #endif - LogVisor::RegisterConsoleLogger(); - pshag::TOneStatic main; + logvisor::RegisterConsoleLogger(); + urde::TOneStatic main; int ret = boo::ApplicationRun(boo::IApplication::EPlatformType::Auto, *main, _S("mp1"), _S("MP1"), argc, argv); return ret; diff --git a/Runtime/Particle/CCollisionResponseData.cpp b/Runtime/Particle/CCollisionResponseData.cpp index ac55d0427..4458064db 100644 --- a/Runtime/Particle/CCollisionResponseData.cpp +++ b/Runtime/Particle/CCollisionResponseData.cpp @@ -4,11 +4,11 @@ #include "CSwooshDescription.hpp" #include "CElectricDescription.hpp" #include "CGenDescription.hpp" -#include "CModel.hpp" +#include "Graphics/CModel.hpp" #include "CSimplePool.hpp" #include "CRandom16.hpp" -namespace pshag +namespace urde { static const std::vector SFXTypes = { diff --git a/Runtime/Particle/CCollisionResponseData.hpp b/Runtime/Particle/CCollisionResponseData.hpp index c3c035bc4..7239b3b49 100644 --- a/Runtime/Particle/CCollisionResponseData.hpp +++ b/Runtime/Particle/CCollisionResponseData.hpp @@ -6,7 +6,7 @@ #include "CToken.hpp" #include "IOStreams.hpp" -namespace pshag +namespace urde { class CSimplePool; class CGenDescription; diff --git a/Runtime/Particle/CColorElement.cpp b/Runtime/Particle/CColorElement.cpp index e5597f429..804955edc 100644 --- a/Runtime/Particle/CColorElement.cpp +++ b/Runtime/Particle/CColorElement.cpp @@ -2,11 +2,11 @@ #include "CElementGen.hpp" #include "CParticleGlobals.hpp" #include "CRandom16.hpp" -#include +#include "zeus/Math.hpp" /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Color_Elements */ -namespace pshag +namespace urde { CCEKeyframeEmitter::CCEKeyframeEmitter(CInputStream& in) @@ -24,7 +24,7 @@ CCEKeyframeEmitter::CCEKeyframeEmitter(CInputStream& in) x18_keys.push_back(in.readVec4fBig()); } -bool CCEKeyframeEmitter::GetValue(int frame, Zeus::CColor& valOut) const +bool CCEKeyframeEmitter::GetValue(int frame, zeus::CColor& valOut) const { if (!x4_percent) { @@ -60,24 +60,24 @@ bool CCEKeyframeEmitter::GetValue(int frame, Zeus::CColor& valOut) const return false; } -bool CCEConstant::GetValue(int frame, Zeus::CColor& valOut) const +bool CCEConstant::GetValue(int frame, zeus::CColor& valOut) const { float a, b, c, d; x4_a->GetValue(frame, a); x8_b->GetValue(frame, b); xc_c->GetValue(frame, c); x10_d->GetValue(frame, d); - valOut = Zeus::CColor(a, b, c, d); + valOut = zeus::CColor(a, b, c, d); return false; } -bool CCEFastConstant::GetValue(int frame, Zeus::CColor& valOut) const +bool CCEFastConstant::GetValue(int frame, zeus::CColor& valOut) const { valOut = x4_val; return false; } -bool CCETimeChain::GetValue(int frame, Zeus::CColor& valOut) const +bool CCETimeChain::GetValue(int frame, zeus::CColor& valOut) const { int v; xc_swFrame->GetValue(frame, v); @@ -87,7 +87,7 @@ bool CCETimeChain::GetValue(int frame, Zeus::CColor& valOut) const return x4_a->GetValue(frame, valOut); } -bool CCEFadeEnd::GetValue(int frame, Zeus::CColor& valOut) const +bool CCEFadeEnd::GetValue(int frame, zeus::CColor& valOut) const { float c; xc_startFrame->GetValue(frame, c); @@ -101,17 +101,17 @@ bool CCEFadeEnd::GetValue(int frame, Zeus::CColor& valOut) const float d; x10_endFrame->GetValue(frame, d); - Zeus::CColor colA; - Zeus::CColor colB; + zeus::CColor colA; + zeus::CColor colB; x4_a->GetValue(frame, colA); x8_b->GetValue(frame, colB); float t = (frame - c) / (d - c); - valOut = Zeus::CColor::lerp(colA, colB, t); + valOut = zeus::CColor::lerp(colA, colB, t); return false; } -bool CCEFade::GetValue(int frame, Zeus::CColor& valOut) const +bool CCEFade::GetValue(int frame, zeus::CColor& valOut) const { float c; xc_endFrame->GetValue(frame, c); @@ -123,21 +123,21 @@ bool CCEFade::GetValue(int frame, Zeus::CColor& valOut) const return false; } - Zeus::CColor colA; - Zeus::CColor colB; + zeus::CColor colA; + zeus::CColor colB; x4_a->GetValue(frame, colA); x8_b->GetValue(frame, colB); - valOut = Zeus::CColor::lerp(colA, colB, t); + valOut = zeus::CColor::lerp(colA, colB, t); return false; } -bool CCEPulse::GetValue(int frame, Zeus::CColor& valOut) const +bool CCEPulse::GetValue(int frame, zeus::CColor& valOut) const { int a, b; x4_aDuration->GetValue(frame, a); x8_bDuration->GetValue(frame, b); - int cv = std::max(1, a + b + 1); + int cv = zeus::max(1, a + b + 1); if (b >= 1) { @@ -153,7 +153,7 @@ bool CCEPulse::GetValue(int frame, Zeus::CColor& valOut) const return false; } -bool CCEParticleColor::GetValue(int /*frame*/, Zeus::CColor& colorOut) const +bool CCEParticleColor::GetValue(int /*frame*/, zeus::CColor& colorOut) const { colorOut = CElementGen::g_currentParticle->x34_color; return false; diff --git a/Runtime/Particle/CColorElement.hpp b/Runtime/Particle/CColorElement.hpp index 4aa1bc324..340789c44 100644 --- a/Runtime/Particle/CColorElement.hpp +++ b/Runtime/Particle/CColorElement.hpp @@ -5,7 +5,7 @@ /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Color_Elements */ -namespace pshag +namespace urde { class CCEKeyframeEmitter : public CColorElement @@ -16,10 +16,10 @@ class CCEKeyframeEmitter : public CColorElement bool xd_unk2; u32 x10_loopEnd; u32 x14_loopStart; - std::vector x18_keys; + std::vector x18_keys; public: CCEKeyframeEmitter(CInputStream& in); - bool GetValue(int frame, Zeus::CColor& colorOut) const; + bool GetValue(int frame, zeus::CColor& colorOut) const; }; class CCEConstant : public CColorElement @@ -31,16 +31,16 @@ class CCEConstant : public CColorElement public: CCEConstant(CRealElement* a, CRealElement* b, CRealElement* c, CRealElement* d) : x4_a(a), x8_b(b), xc_c(c), x10_d(d) {} - bool GetValue(int frame, Zeus::CColor& colorOut) const; + bool GetValue(int frame, zeus::CColor& colorOut) const; }; class CCEFastConstant : public CColorElement { - Zeus::CColor x4_val; + zeus::CColor x4_val; public: CCEFastConstant(float a, float b, float c, float d) : x4_val(a, b, c, d) {} - bool GetValue(int frame, Zeus::CColor& colorOut) const; + bool GetValue(int frame, zeus::CColor& colorOut) const; }; class CCETimeChain : public CColorElement @@ -51,7 +51,7 @@ class CCETimeChain : public CColorElement public: CCETimeChain(CColorElement* a, CColorElement* b, CIntElement* c) : x4_a(a), x8_b(b), xc_swFrame(c) {} - bool GetValue(int frame, Zeus::CColor& colorOut) const; + bool GetValue(int frame, zeus::CColor& colorOut) const; }; class CCEFadeEnd : public CColorElement @@ -63,7 +63,7 @@ class CCEFadeEnd : public CColorElement public: CCEFadeEnd(CColorElement* a, CColorElement* b, CRealElement* c, CRealElement* d) : x4_a(a), x8_b(b), xc_startFrame(c), x10_endFrame(d) {} - bool GetValue(int frame, Zeus::CColor& colorOut) const; + bool GetValue(int frame, zeus::CColor& colorOut) const; }; class CCEFade : public CColorElement @@ -74,7 +74,7 @@ class CCEFade : public CColorElement public: CCEFade(CColorElement* a, CColorElement* b, CRealElement* c) : x4_a(a), x8_b(b), xc_endFrame(c) {} - bool GetValue(int frame, Zeus::CColor& colorOut) const; + bool GetValue(int frame, zeus::CColor& colorOut) const; }; class CCEPulse : public CColorElement @@ -86,13 +86,13 @@ class CCEPulse : public CColorElement public: CCEPulse(CIntElement* a, CIntElement* b, CColorElement* c, CColorElement* d) : x4_aDuration(a), x8_bDuration(b), xc_aVal(c), x10_bVal(d) {} - bool GetValue(int frame, Zeus::CColor& colorOut) const; + bool GetValue(int frame, zeus::CColor& colorOut) const; }; class CCEParticleColor : public CColorElement { public: - bool GetValue(int frame, Zeus::CColor& colorOut) const; + bool GetValue(int frame, zeus::CColor& colorOut) const; }; } diff --git a/Runtime/Particle/CDecalDataFactory.cpp b/Runtime/Particle/CDecalDataFactory.cpp index a35fdd1ce..ca1646828 100644 --- a/Runtime/Particle/CDecalDataFactory.cpp +++ b/Runtime/Particle/CDecalDataFactory.cpp @@ -4,13 +4,13 @@ #include "CSwooshDescription.hpp" #include "CElectricDescription.hpp" #include "CParticleDataFactory.hpp" -#include "CModel.hpp" +#include "Graphics/CModel.hpp" #include "CSimplePool.hpp" #include "CRandom16.hpp" -namespace pshag +namespace urde { -static LogVisor::LogModule Log("pshag::CDecalDataFactory"); +static logvisor::Module Log("urde::CDecalDataFactory"); using CPF = CParticleDataFactory; CDecalDescription* CDecalDataFactory::GetGeneratorDesc(CInputStream& in, CSimplePool* resPool) @@ -92,7 +92,7 @@ bool CDecalDataFactory::CreateDPSM(CDecalDescription* desc, CInputStream& in, CS default: { uint32_t clsName = clsId.toUint32(); - Log.report(LogVisor::FatalError, "Unknown DPSC class %.4s @%" PRIi64, &clsName, in.position()); + Log.report(logvisor::Fatal, "Unknown DPSC class %.4s @%" PRIi64, &clsName, in.position()); return false; } } diff --git a/Runtime/Particle/CDecalDataFactory.hpp b/Runtime/Particle/CDecalDataFactory.hpp index 586399c23..1c2237c3d 100644 --- a/Runtime/Particle/CDecalDataFactory.hpp +++ b/Runtime/Particle/CDecalDataFactory.hpp @@ -7,7 +7,7 @@ #include "IOStreams.hpp" -namespace pshag +namespace urde { struct SQuadDescr; class CDecalDescription; diff --git a/Runtime/Particle/CDecalDescription.hpp b/Runtime/Particle/CDecalDescription.hpp index 75bb0aa83..a91db91a2 100644 --- a/Runtime/Particle/CDecalDescription.hpp +++ b/Runtime/Particle/CDecalDescription.hpp @@ -8,7 +8,7 @@ #include "CUVElement.hpp" #include "CParticleDataFactory.hpp" -namespace pshag +namespace urde { struct SQuadDescr { diff --git a/Runtime/Particle/CDecalManager.hpp b/Runtime/Particle/CDecalManager.hpp index ec75f6a72..10278b053 100644 --- a/Runtime/Particle/CDecalManager.hpp +++ b/Runtime/Particle/CDecalManager.hpp @@ -1,7 +1,7 @@ #ifndef __PSHAG_CDECALMANAGER_HPP__ #define __PSHAG_CDECALMANAGER_HPP__ -namespace pshag +namespace urde { class CDecalManager diff --git a/Runtime/Particle/CElectricDescription.hpp b/Runtime/Particle/CElectricDescription.hpp index 3a83ad9c0..53cdc6746 100644 --- a/Runtime/Particle/CElectricDescription.hpp +++ b/Runtime/Particle/CElectricDescription.hpp @@ -9,7 +9,7 @@ #include "CColorElement.hpp" #include "CUVElement.hpp" -namespace pshag +namespace urde { class CElectricDescription { diff --git a/Runtime/Particle/CElementGen.cpp b/Runtime/Particle/CElementGen.cpp index c8eb71c47..75e608376 100644 --- a/Runtime/Particle/CElementGen.cpp +++ b/Runtime/Particle/CElementGen.cpp @@ -5,15 +5,15 @@ #include "CParticleGlobals.hpp" #include "CParticleSwoosh.hpp" #include "CParticleElectric.hpp" -#include "CModel.hpp" +#include "Graphics/CModel.hpp" #include "CElementGenShaders.hpp" #define MAX_GLOBAL_PARTICLES 2560 -namespace pshag +namespace urde { -static LogVisor::LogModule Log("pshag::CElementGen"); +static logvisor::Module Log("urde::CElementGen"); static bool s_inCreateNewParticles = false; @@ -210,39 +210,39 @@ void CElementGenShaders::Shutdown() struct SParticleInstanceTex { - Zeus::CVector4f pos[4]; - Zeus::CColor color; - Zeus::CVector2f uvs[4]; + zeus::CVector4f pos[4]; + zeus::CColor color; + zeus::CVector2f uvs[4]; }; static std::vector g_instTexData; struct SParticleInstanceIndTex { - Zeus::CVector4f pos[4]; - Zeus::CColor color; - Zeus::CVector4f texrTindUVs[4]; - Zeus::CVector4f sceneUVs; + zeus::CVector4f pos[4]; + zeus::CColor color; + zeus::CVector4f texrTindUVs[4]; + zeus::CVector4f sceneUVs; }; static std::vector g_instIndTexData; struct SParticleInstanceNoTex { - Zeus::CVector4f pos[4]; - Zeus::CColor color; + zeus::CVector4f pos[4]; + zeus::CColor color; }; static std::vector g_instNoTexData; struct SParticleUniforms { - Zeus::CMatrix4f mvp; - Zeus::CColor moduColor; + zeus::CMatrix4f mvp; + zeus::CColor moduColor; }; void CElementGen::Initialize() { if (g_StaticListInitialized) return; - Log.report(LogVisor::Info, "Initialize - Static Particle List - "); + Log.report(logvisor::Info, "Initialize - Static Particle List - "); g_ParticleAliveCount = 0; g_ParticleSystemAliveCount = 0; @@ -255,7 +255,7 @@ void CElementGen::Initialize() g_StaticFreeList.push_back(i); g_FreeIndex = MAX_GLOBAL_PARTICLES - 1; - Log.report(LogVisor::Info, "size %d (%d each part).", + Log.report(logvisor::Info, "size %d (%d each part).", (sizeof(CParticle) + sizeof(u16)) * MAX_GLOBAL_PARTICLES, sizeof(CParticle)); g_StaticListInitialized = true; @@ -369,7 +369,7 @@ CElementGen::CElementGen(const TToken& gen, if (x28_orientType == EModelOrientationType::One) { x3c_parentMatrices.insert(x3c_parentMatrices.end(), x70_MAXP, - Zeus::CMatrix3f::skIdentityMatrix3f); + zeus::CMatrix3f::skIdentityMatrix3f); } x225_26_LINE = desc->x44_24_x30_24_LINE; @@ -464,7 +464,7 @@ void CElementGen::Update(double t) pswtElem->GetValue(x50_curFrame, pswt); if (pswt > 32) { - Log.report(LogVisor::Info, + Log.report(logvisor::Info, "Running warmup on particle system 0x%08x for %d ticks.", desc, pswt); InternalUpdate(pswt / 60.0); @@ -479,8 +479,8 @@ bool CElementGen::InternalUpdate(double dt) CGlobalRandom gr(x230_randState); CGenDescription* desc = x1c_genDesc.GetObj(); - double dt1 = 1 / 60.0; - if (fabs(dt - 1 / 60.0) >= 1 / 60000.0) + double dt1 = 1.0 / 60.0; + if (std::fabs(dt - 1.0 / 60.0) >= 1.0 / 60000.0) dt1 = dt; double t = x50_curFrame / 60.0; CParticleGlobals::SetEmitterTime(x50_curFrame); @@ -505,7 +505,7 @@ bool CElementGen::InternalUpdate(double dt) } int frameUpdateCount = 0; - while (t < x58_curSeconds && fabs(t - x58_curSeconds) >= 1 / 60000.0) + while (t < x58_curSeconds && std::fabs(t - x58_curSeconds) >= 1.0 / 60000.0) { x2a8_aabbMin.splat(FLT_MAX); x2b4_aabbMax.splat(FLT_MIN); @@ -551,7 +551,7 @@ bool CElementGen::InternalUpdate(double dt) } UpdateChildParticleSystems(-(frameUpdateCount / 60.0 - dt1)); - if (fabs(t - x58_curSeconds) < 1 / 60000.0) + if (std::fabs(t - x58_curSeconds) < 1.0 / 60000.0) x58_curSeconds = t; BuildParticleSystemBounds(); @@ -563,7 +563,7 @@ bool CElementGen::InternalUpdate(double dt) return false; } -void CElementGen::AccumulateBounds(Zeus::CVector3f& pos, float size) +void CElementGen::AccumulateBounds(zeus::CVector3f& pos, float size) { x2b4_aabbMax[0] = std::max(pos[0], x2b4_aabbMax[0]); x2b4_aabbMax[1] = std::max(pos[1], x2b4_aabbMax[1]); @@ -625,8 +625,8 @@ void CElementGen::UpdateExistingParticles() { if (x224_30_VMD1) { - Zeus::CVector3f xfVel = x1a8_orientationInverse * particle.x1c_vel; - Zeus::CVector3f xfPos = x1a8_orientationInverse * (particle.x4_pos - x7c_translation); + zeus::CVector3f xfVel = x1a8_orientationInverse * particle.x1c_vel; + zeus::CVector3f xfPos = x1a8_orientationInverse * (particle.x4_pos - x7c_translation); err = vel1->GetValue(particleFrame, xfVel, xfPos); particle.x1c_vel = x178_orientation * xfVel; particle.x4_pos = x178_orientation * xfPos + x7c_translation; @@ -642,8 +642,8 @@ void CElementGen::UpdateExistingParticles() { if (x224_31_VMD2) { - Zeus::CVector3f xfVel = x1a8_orientationInverse * particle.x1c_vel; - Zeus::CVector3f xfPos = x1a8_orientationInverse * (particle.x4_pos - x7c_translation); + zeus::CVector3f xfVel = x1a8_orientationInverse * particle.x1c_vel; + zeus::CVector3f xfPos = x1a8_orientationInverse * (particle.x4_pos - x7c_translation); err |= vel2->GetValue(particleFrame, xfVel, xfPos); particle.x1c_vel = x178_orientation * xfVel; particle.x4_pos = x178_orientation * xfPos + x7c_translation; @@ -659,8 +659,8 @@ void CElementGen::UpdateExistingParticles() { if (x225_24_VMD3) { - Zeus::CVector3f xfVel = x1a8_orientationInverse * particle.x1c_vel; - Zeus::CVector3f xfPos = x1a8_orientationInverse * (particle.x4_pos - x7c_translation); + zeus::CVector3f xfVel = x1a8_orientationInverse * particle.x1c_vel; + zeus::CVector3f xfPos = x1a8_orientationInverse * (particle.x4_pos - x7c_translation); err |= vel3->GetValue(particleFrame, xfVel, xfPos); particle.x1c_vel = x178_orientation * xfVel; particle.x4_pos = x178_orientation * xfPos + x7c_translation; @@ -676,8 +676,8 @@ void CElementGen::UpdateExistingParticles() { if (x225_25_VMD4) { - Zeus::CVector3f xfVel = x1a8_orientationInverse * particle.x1c_vel; - Zeus::CVector3f xfPos = x1a8_orientationInverse * (particle.x4_pos - x7c_translation); + zeus::CVector3f xfVel = x1a8_orientationInverse * particle.x1c_vel; + zeus::CVector3f xfPos = x1a8_orientationInverse * (particle.x4_pos - x7c_translation); err |= vel4->GetValue(particleFrame, xfVel, xfPos); particle.x1c_vel = x178_orientation * xfVel; particle.x4_pos = x178_orientation * xfPos + x7c_translation; @@ -757,20 +757,20 @@ void CElementGen::CreateNewParticles(int count) if (colr) colr->GetValue(0, particle.x34_color); else - particle.x34_color = Zeus::CColor::skWhite; + particle.x34_color = zeus::CColor::skWhite; CEmitterElement* emtr = desc->x40_x2c_EMTR.get(); if (emtr) { emtr->GetValue(x210_curEmitterFrame, particle.x4_pos, particle.x1c_vel); - Zeus::CVector3f compXf1 = (xdc_globalScaleTransformInverse * x148_localScaleTransformInverse) * x7c_translation; - Zeus::CVector3f compXf2 = x178_orientation * particle.x4_pos; + zeus::CVector3f compXf1 = (xdc_globalScaleTransformInverse * x148_localScaleTransformInverse) * x7c_translation; + zeus::CVector3f compXf2 = x178_orientation * particle.x4_pos; particle.x4_pos = compXf1 + compXf2 + x94_POFS; particle.x1c_vel = x178_orientation * particle.x1c_vel; } else { - Zeus::CVector3f compXf1 = (xdc_globalScaleTransformInverse * x148_localScaleTransformInverse) * x7c_translation; + zeus::CVector3f compXf1 = (xdc_globalScaleTransformInverse * x148_localScaleTransformInverse) * x7c_translation; particle.x4_pos = compXf1 + x94_POFS; particle.x1c_vel.zeroOut(); } @@ -823,7 +823,7 @@ void CElementGen::UpdatePSTranslationAndOrientation() CModVectorElement* psvm = desc->x4_PSVM.get(); if (psvm) { - Zeus::CVector3f pos = x7c_translation; + zeus::CVector3f pos = x7c_translation; psvm->GetValue(x50_curFrame, x218_PSIV, pos); if (pos != x7c_translation) { @@ -832,17 +832,17 @@ void CElementGen::UpdatePSTranslationAndOrientation() } } - Zeus::CVector3f v = x178_orientation * x218_PSIV; - if (v != Zeus::CVector3f::skZero) + zeus::CVector3f v = x178_orientation * x218_PSIV; + if (v != zeus::CVector3f::skZero) x224_24_translationDirty = true; x7c_translation += v; CVectorElement* psov = desc->x8_PSOV.get(); if (psov) { - Zeus::CVector3f angles; + zeus::CVector3f angles; psov->GetValue(x50_curFrame, angles); - Zeus::CTransform xf(x178_orientation); + zeus::CTransform xf(x178_orientation); xf.rotateLocalX(angles[0] * M_PI / 180.f); xf.rotateLocalY(angles[1] * M_PI / 180.f); xf.rotateLocalZ(angles[2] * M_PI / 180.f); @@ -1006,7 +1006,7 @@ void CElementGen::UpdateChildParticleSystems(double dt) if ((x50_curFrame == x270_SSSD || x224_24_translationDirty) && x64_prevFrame != x50_curFrame) { - Zeus::CVector3f trans = x7c_translation + x274_SSPO; + zeus::CVector3f trans = x7c_translation + x274_SSPO; ch->SetTranslation(trans); ch->SetOrientation(x178_orientation); } @@ -1027,7 +1027,7 @@ void CElementGen::UpdateChildParticleSystems(double dt) if ((x50_curFrame == x290_SESD || x224_24_translationDirty) && x64_prevFrame != x50_curFrame) { - Zeus::CVector3f trans = x7c_translation + x294_SEPO; + zeus::CVector3f trans = x7c_translation + x294_SEPO; ch->SetTranslation(trans); ch->SetOrientation(x178_orientation); } @@ -1119,12 +1119,12 @@ void CElementGen::EndLifetime() void CElementGen::BuildParticleSystemBounds() { - Zeus::CAABox aabb; + zeus::CAABox aabb; bool accumulated = false; for (std::unique_ptr& ch : x234_activePartChildren) { - std::pair chBounds = ch->GetBounds(); + std::pair chBounds = ch->GetBounds(); if (chBounds.second) { accumulated = true; @@ -1134,7 +1134,7 @@ void CElementGen::BuildParticleSystemBounds() for (std::unique_ptr& ch : x248_finishPartChildren) { - std::pair chBounds = ch->GetBounds(); + std::pair chBounds = ch->GetBounds(); if (chBounds.second) { accumulated = true; @@ -1144,7 +1144,7 @@ void CElementGen::BuildParticleSystemBounds() for (std::unique_ptr& ch : x260_swhcChildren) { - std::pair chBounds = ch->GetBounds(); + std::pair chBounds = ch->GetBounds(); if (chBounds.second) { accumulated = true; @@ -1154,7 +1154,7 @@ void CElementGen::BuildParticleSystemBounds() for (std::unique_ptr& ch : x280_elscChildren) { - std::pair chBounds = ch->GetBounds(); + std::pair chBounds = ch->GetBounds(); if (chBounds.second) { accumulated = true; @@ -1165,15 +1165,15 @@ void CElementGen::BuildParticleSystemBounds() x20c_recursiveParticleCount = GetParticleCountAllInternal(); if (GetParticleCount()) { - Zeus::CVector3f scale = xa0_globalScale * x2c0_maxSize; - Zeus::CTransform xf = (xac_globalScaleTransform * x1d8_globalOrientation) * x118_localScaleTransform; - Zeus::CAABox box = Zeus::CAABox(x2a8_aabbMin, x2b4_aabbMax).getTransformedAABox(xf); - Zeus::CVector3f min = box.m_min + x88_globalTranslation - scale; - Zeus::CVector3f max = box.m_max + x88_globalTranslation + scale; - x2c4_systemBounds = Zeus::CAABox(min, max); + zeus::CVector3f scale = xa0_globalScale * x2c0_maxSize; + zeus::CTransform xf = (xac_globalScaleTransform * x1d8_globalOrientation) * x118_localScaleTransform; + zeus::CAABox box = zeus::CAABox(x2a8_aabbMin, x2b4_aabbMax).getTransformedAABox(xf); + zeus::CVector3f min = box.m_min + x88_globalTranslation - scale; + zeus::CVector3f max = box.m_max + x88_globalTranslation + scale; + x2c4_systemBounds = zeus::CAABox(min, max); } else - x2c4_systemBounds = Zeus::CAABox::skInvertedBox; + x2c4_systemBounds = zeus::CAABox::skInvertedBox; if (accumulated) x2c4_systemBounds.accumulateBounds(aabb); @@ -1277,7 +1277,7 @@ void CElementGen::RenderModels() } } - Zeus::CTransform orient = Zeus::CTransform::Identity(); + zeus::CTransform orient = zeus::CTransform::Identity(); if (desc->x45_25_x31_27_PMOO) orient = x178_orientation; orient = orient * x1d8_globalOrientation; @@ -1287,23 +1287,23 @@ void CElementGen::RenderModels() if (pmrt) pmrtConst = pmrt->IsFastConstant(); - Zeus::CVector3f trans = (xdc_globalScaleTransformInverse * x148_localScaleTransformInverse) * x88_globalTranslation; + zeus::CVector3f trans = (xdc_globalScaleTransformInverse * x148_localScaleTransformInverse) * x88_globalTranslation; - Zeus::CTransform rot = Zeus::CTransform::Identity(); + zeus::CTransform rot = zeus::CTransform::Identity(); if (pmrtConst) { - Zeus::CVector3f pmrtVal; + zeus::CVector3f pmrtVal; pmrt->GetValue(x50_curFrame, pmrtVal); - rot = Zeus::CTransform::RotateZ(pmrtVal[2] * M_PI / 180.f); - rot.rotateLocalY(pmrtVal[1] * M_PI / 180.f); - rot.rotateLocalX(pmrtVal[0] * M_PI / 180.f); + rot = zeus::CTransform::RotateZ(zeus::degToRad(pmrtVal[2])); + rot.rotateLocalY(zeus::degToRad(pmrtVal[1])); + rot.rotateLocalX(zeus::degToRad(pmrtVal[0])); } rot = orient * rot; CParticleGlobals::SetEmitterTime(x50_curFrame); - Zeus::CColor col = {1.f, 1.f, 1.f, 1.f}; + zeus::CColor col = {1.f, 1.f, 1.f, 1.f}; - Zeus::CVector3f pmopVec; + zeus::CVector3f pmopVec; auto matrixIt = x3c_parentMatrices.begin(); for (CParticleListItem& item : x2c_particleLists) { @@ -1322,11 +1322,11 @@ void CElementGen::RenderModels() if (pmop) pmop->GetValue(partFrame, pmopVec); - Zeus::CTransform partTrans = Zeus::CTransform::Translate(particle.x4_pos + trans); + zeus::CTransform partTrans = zeus::CTransform::Translate(particle.x4_pos + trans); if (x28_orientType == EModelOrientationType::One) { - Zeus::CTransform partRot(*matrixIt); - Zeus::CVector3f pmopRotateOffset = (orient * partRot) * pmopVec; + zeus::CTransform partRot(*matrixIt); + zeus::CVector3f pmopRotateOffset = (orient * partRot) * pmopVec; partTrans = partTrans * partRot; partTrans += pmopRotateOffset; } @@ -1343,11 +1343,11 @@ void CElementGen::RenderModels() { if (pmrt) { - Zeus::CVector3f pmrtVal; + zeus::CVector3f pmrtVal; pmrt->GetValue(partFrame, pmrtVal); - rot = Zeus::CTransform::RotateZ(pmrtVal[2] * M_PI / 180.f); - rot.rotateLocalY(pmrtVal[1] * M_PI / 180.f); - rot.rotateLocalX(pmrtVal[0] * M_PI / 180.f); + rot = zeus::CTransform::RotateZ(zeus::degToRad(pmrtVal[2])); + rot.rotateLocalY(zeus::degToRad(pmrtVal[1])); + rot.rotateLocalX(zeus::degToRad(pmrtVal[0])); partTrans = partTrans * (orient * rot); } else @@ -1359,9 +1359,9 @@ void CElementGen::RenderModels() CVectorElement* pmsc = desc->x74_x60_PMSC.get(); if (pmsc) { - Zeus::CVector3f pmscVal; + zeus::CVector3f pmscVal; pmsc->GetValue(partFrame, pmscVal); - partTrans = partTrans * Zeus::CTransform::Scale(pmscVal); + partTrans = partTrans * zeus::CTransform::Scale(pmscVal); } CColorElement* pmcl = desc->x78_x64_PMCL.get(); @@ -1398,7 +1398,7 @@ void CElementGen::RenderModels() else { if (1.f == col.a) - model->Draw({0, 0, 3, Zeus::CColor::skWhite}); + model->Draw({0, 0, 3, zeus::CColor::skWhite}); else model->Draw({4, 0, 1, col}); } @@ -1422,10 +1422,10 @@ void CElementGen::RenderLines() CGenDescription* desc = x1c_genDesc.GetObj(); CGlobalRandom gr(x230_randState); - Zeus::CTransform systemViewPointMatrix(CGraphics::g_ViewMatrix); + zeus::CTransform systemViewPointMatrix(CGraphics::g_ViewMatrix); systemViewPointMatrix.m_origin.zeroOut(); - Zeus::CTransform systemCameraMatrix = systemViewPointMatrix.inverse() * x1d8_globalOrientation; - systemViewPointMatrix = ((Zeus::CTransform::Translate(x88_globalTranslation) * xac_globalScaleTransform) * systemViewPointMatrix) * x118_localScaleTransform; + zeus::CTransform systemCameraMatrix = systemViewPointMatrix.inverse() * x1d8_globalOrientation; + systemViewPointMatrix = ((zeus::CTransform::Translate(x88_globalTranslation) * xac_globalScaleTransform) * systemViewPointMatrix) * x118_localScaleTransform; CGraphics::SetModelMatrix(systemViewPointMatrix); CGraphics::SetAlphaCompare(ERglAlphaFunc::Always, 0, ERglAlphaOp::And, ERglAlphaFunc::Always, 0); @@ -1451,7 +1451,7 @@ void CElementGen::RenderLines() bool constTexr = true; bool constUVs = true; CTexture* cachedTex = nullptr; - Zeus::CColor moduColor = Zeus::CColor::skWhite; + zeus::CColor moduColor = zeus::CColor::skWhite; if (texr) { CParticle& target = g_StaticParticleList[x2c_particleLists[0].x0_partIdx]; @@ -1461,7 +1461,7 @@ void CElementGen::RenderLines() /* Set TEXC * RASC */ - if (x30c_moduColor != Zeus::CColor::skBlack) + if (x30c_moduColor != zeus::CColor::skBlack) { /* Add RASC * PREVC pass for MODU color loaded into channel mat-color */ moduColor = x30c_moduColor; @@ -1501,13 +1501,13 @@ void CElementGen::RenderLines() if (!constUVs) texr->GetValueUV(partFrame, uvs); - Zeus::CVector3f dVec = particle.x4_pos - particle.x10_prevPos; + zeus::CVector3f dVec = particle.x4_pos - particle.x10_prevPos; if (x225_27_FXLL) if (dVec.magSquared() >= 0.f) dVec.normalize(); - Zeus::CVector3f p1 = systemCameraMatrix * particle.x4_pos; - Zeus::CVector3f p2 = systemCameraMatrix * (particle.x2c_lineLengthOrSize * dVec + particle.x4_pos); + zeus::CVector3f p1 = systemCameraMatrix * particle.x4_pos; + zeus::CVector3f p2 = systemCameraMatrix * (particle.x2c_lineLengthOrSize * dVec + particle.x4_pos); if (widtConst) { @@ -1553,10 +1553,10 @@ void CElementGen::RenderParticles() } } - Zeus::CTransform systemViewPointMatrix(CGraphics::g_ViewMatrix); + zeus::CTransform systemViewPointMatrix(CGraphics::g_ViewMatrix); systemViewPointMatrix.m_origin.zeroOut(); - Zeus::CTransform systemCameraMatrix = systemViewPointMatrix.inverse() * x1d8_globalOrientation; - systemViewPointMatrix = ((Zeus::CTransform::Translate(x88_globalTranslation) * xac_globalScaleTransform) * systemViewPointMatrix) * x118_localScaleTransform; + zeus::CTransform systemCameraMatrix = systemViewPointMatrix.inverse() * x1d8_globalOrientation; + systemViewPointMatrix = ((zeus::CTransform::Translate(x88_globalTranslation) * xac_globalScaleTransform) * systemViewPointMatrix) * x118_localScaleTransform; CGraphics::SetModelMatrix(systemViewPointMatrix); CGraphics::SetAlphaCompare(ERglAlphaFunc::Always, 0, ERglAlphaOp::And, ERglAlphaFunc::Always, 0); @@ -1579,7 +1579,7 @@ void CElementGen::RenderParticles() cachedTex = texr->GetValueTexture(partFrame).GetObj(); cachedTex->Load(0, CTexture::EClampMode::One); - if (x30c_moduColor != Zeus::CColor::skBlack) + if (x30c_moduColor != zeus::CColor::skBlack) { /* Add RASC * PREVC pass for MODU color loaded into channel mat-color */ uniformData.moduColor = x30c_moduColor; @@ -1630,7 +1630,7 @@ void CElementGen::RenderParticles() g_instNoTexData.reserve(x2c_particleLists.size()); break; default: - Log.report(LogVisor::FatalError, "unexpected particle shader class"); + Log.report(logvisor::Fatal, "unexpected particle shader class"); break; } for (CParticleListItem& item : x2c_particleLists) @@ -1639,7 +1639,7 @@ void CElementGen::RenderParticles() g_currentParticle = &particle; int partFrame = x50_curFrame - particle.x28_startFrame - 1; - Zeus::CVector3f viewPoint; + zeus::CVector3f viewPoint; if (desc->x44_28_x30_28_SORT) viewPoint = item.x4_viewPoint; else @@ -1672,10 +1672,10 @@ void CElementGen::RenderParticles() { g_instTexData.emplace_back(); SParticleInstanceTex& inst = g_instTexData.back(); - inst.pos[0] = Zeus::CVector4f{viewPoint.x + size, 0.f, viewPoint.z + size, 1.f}; - inst.pos[1] = Zeus::CVector4f{viewPoint.x - size, 0.f, viewPoint.z + size, 1.f}; - inst.pos[2] = Zeus::CVector4f{viewPoint.x + size, 0.f, viewPoint.z - size, 1.f}; - inst.pos[3] = Zeus::CVector4f{viewPoint.x - size, 0.f, viewPoint.z - size, 1.f}; + inst.pos[0] = zeus::CVector4f{viewPoint.x + size, 0.f, viewPoint.z + size, 1.f}; + inst.pos[1] = zeus::CVector4f{viewPoint.x - size, 0.f, viewPoint.z + size, 1.f}; + inst.pos[2] = zeus::CVector4f{viewPoint.x + size, 0.f, viewPoint.z - size, 1.f}; + inst.pos[3] = zeus::CVector4f{viewPoint.x - size, 0.f, viewPoint.z - size, 1.f}; inst.color = particle.x34_color; inst.uvs[0] = {uvs.xMax, uvs.yMax}; inst.uvs[1] = {uvs.xMin, uvs.yMax}; @@ -1687,10 +1687,10 @@ void CElementGen::RenderParticles() { g_instNoTexData.emplace_back(); SParticleInstanceNoTex& inst = g_instNoTexData.back(); - inst.pos[0] = Zeus::CVector4f{viewPoint.x + size, 0.f, viewPoint.z + size, 1.f}; - inst.pos[1] = Zeus::CVector4f{viewPoint.x - size, 0.f, viewPoint.z + size, 1.f}; - inst.pos[2] = Zeus::CVector4f{viewPoint.x + size, 0.f, viewPoint.z - size, 1.f}; - inst.pos[3] = Zeus::CVector4f{viewPoint.x - size, 0.f, viewPoint.z - size, 1.f}; + inst.pos[0] = zeus::CVector4f{viewPoint.x + size, 0.f, viewPoint.z + size, 1.f}; + inst.pos[1] = zeus::CVector4f{viewPoint.x - size, 0.f, viewPoint.z + size, 1.f}; + inst.pos[2] = zeus::CVector4f{viewPoint.x + size, 0.f, viewPoint.z - size, 1.f}; + inst.pos[3] = zeus::CVector4f{viewPoint.x - size, 0.f, viewPoint.z - size, 1.f}; inst.color = particle.x34_color; break; } @@ -1699,9 +1699,9 @@ void CElementGen::RenderParticles() } else { - float theta = particle.x30_lineWidthOrRota * M_PI / 180.f; - float sinT = sinf(theta) * size; - float cosT = cosf(theta) * size; + float theta = zeus::degToRad(particle.x30_lineWidthOrRota); + float sinT = std::sin(theta) * size; + float cosT = std::cos(theta) * size; switch (m_shaderClass) { @@ -1709,10 +1709,10 @@ void CElementGen::RenderParticles() { g_instTexData.emplace_back(); SParticleInstanceTex& inst = g_instTexData.back(); - inst.pos[0] = Zeus::CVector4f{viewPoint.x + sinT + cosT, 0.f, viewPoint.z + cosT - sinT, 1.f}; - inst.pos[1] = Zeus::CVector4f{viewPoint.x + sinT - cosT, 0.f, viewPoint.z + sinT + cosT, 1.f}; - inst.pos[2] = Zeus::CVector4f{viewPoint.x + (cosT - sinT), 0.f, viewPoint.z + (-cosT - sinT), 1.f}; - inst.pos[3] = Zeus::CVector4f{viewPoint.x - (sinT + cosT), 0.f, viewPoint.z - (cosT - sinT), 1.f}; + inst.pos[0] = zeus::CVector4f{viewPoint.x + sinT + cosT, 0.f, viewPoint.z + cosT - sinT, 1.f}; + inst.pos[1] = zeus::CVector4f{viewPoint.x + sinT - cosT, 0.f, viewPoint.z + sinT + cosT, 1.f}; + inst.pos[2] = zeus::CVector4f{viewPoint.x + (cosT - sinT), 0.f, viewPoint.z + (-cosT - sinT), 1.f}; + inst.pos[3] = zeus::CVector4f{viewPoint.x - (sinT + cosT), 0.f, viewPoint.z - (cosT - sinT), 1.f}; inst.color = particle.x34_color; inst.uvs[0] = {uvs.xMax, uvs.yMax}; inst.uvs[1] = {uvs.xMin, uvs.yMax}; @@ -1724,10 +1724,10 @@ void CElementGen::RenderParticles() { g_instNoTexData.emplace_back(); SParticleInstanceNoTex& inst = g_instNoTexData.back(); - inst.pos[0] = Zeus::CVector4f{viewPoint.x + sinT + cosT, 0.f, viewPoint.z + cosT - sinT, 1.f}; - inst.pos[1] = Zeus::CVector4f{viewPoint.x + sinT - cosT, 0.f, viewPoint.z + sinT + cosT, 1.f}; - inst.pos[2] = Zeus::CVector4f{viewPoint.x + (cosT - sinT), 0.f, viewPoint.z + (-cosT - sinT), 1.f}; - inst.pos[3] = Zeus::CVector4f{viewPoint.x - (sinT + cosT), 0.f, viewPoint.z - (cosT - sinT), 1.f}; + inst.pos[0] = zeus::CVector4f{viewPoint.x + sinT + cosT, 0.f, viewPoint.z + cosT - sinT, 1.f}; + inst.pos[1] = zeus::CVector4f{viewPoint.x + sinT - cosT, 0.f, viewPoint.z + sinT + cosT, 1.f}; + inst.pos[2] = zeus::CVector4f{viewPoint.x + (cosT - sinT), 0.f, viewPoint.z + (-cosT - sinT), 1.f}; + inst.pos[3] = zeus::CVector4f{viewPoint.x - (sinT + cosT), 0.f, viewPoint.z - (cosT - sinT), 1.f}; inst.color = particle.x34_color; break; } @@ -1761,7 +1761,7 @@ void CElementGen::RenderParticles() g_instNoTexData.reserve(x2c_particleLists.size() * mbspVal); break; default: - Log.report(LogVisor::FatalError, "unexpected particle shader class"); + Log.report(logvisor::Fatal, "unexpected particle shader class"); break; } float mbspFac = 1.f / float(mbspVal); @@ -1789,16 +1789,16 @@ void CElementGen::RenderParticles() texr->GetValueUV(partFrame, uvs); } - Zeus::CVector3f dVec = particle.x4_pos - particle.x10_prevPos; - Zeus::CVector3f vec = dVec * x60_timeDeltaScale + particle.x10_prevPos; - Zeus::CVector3f mbspVec = dVec * mbspFac; + zeus::CVector3f dVec = particle.x4_pos - particle.x10_prevPos; + zeus::CVector3f vec = dVec * x60_timeDeltaScale + particle.x10_prevPos; + zeus::CVector3f mbspVec = dVec * mbspFac; float size = 0.5f * particle.x2c_lineLengthOrSize; if (0.f == particle.x30_lineWidthOrRota) { for (int i=0 ; ix44_28_x30_28_SORT) viewPoint = item.x4_viewPoint; else @@ -1996,8 +1996,8 @@ void CElementGen::RenderParticlesIndirectTexture() tind->GetValueUV(partFrame, uvsInd); float size = 0.5f * particle.x2c_lineLengthOrSize; - Zeus::CVector3f p1 = {viewPoint.x - size, viewPoint.y, viewPoint.z - size}; - Zeus::CVector3f p2 = {viewPoint.x + size, viewPoint.y, viewPoint.z + size}; + zeus::CVector3f p1 = {viewPoint.x - size, viewPoint.y, viewPoint.z - size}; + zeus::CVector3f p2 = {viewPoint.x + size, viewPoint.y, viewPoint.z + size}; SClipScreenRect clipRect = CGraphics::ClipScreenRectFromMS(p1, p2); if (!clipRect.x0_valid) @@ -2007,16 +2007,16 @@ void CElementGen::RenderParticlesIndirectTexture() g_instIndTexData.emplace_back(); SParticleInstanceIndTex& inst = g_instIndTexData.back(); - inst.pos[0] = Zeus::CVector4f{viewPoint.x + size, viewPoint.y, viewPoint.z + size, 1.f}; - inst.pos[1] = Zeus::CVector4f{viewPoint.x - size, viewPoint.y, viewPoint.z + size, 1.f}; - inst.pos[2] = Zeus::CVector4f{viewPoint.x + size, viewPoint.y, viewPoint.z - size, 1.f}; - inst.pos[3] = Zeus::CVector4f{viewPoint.x - size, viewPoint.y, viewPoint.z - size, 1.f}; + inst.pos[0] = zeus::CVector4f{viewPoint.x + size, viewPoint.y, viewPoint.z + size, 1.f}; + inst.pos[1] = zeus::CVector4f{viewPoint.x - size, viewPoint.y, viewPoint.z + size, 1.f}; + inst.pos[2] = zeus::CVector4f{viewPoint.x + size, viewPoint.y, viewPoint.z - size, 1.f}; + inst.pos[3] = zeus::CVector4f{viewPoint.x - size, viewPoint.y, viewPoint.z - size, 1.f}; inst.color = particle.x34_color; - inst.texrTindUVs[0] = Zeus::CVector4f{uvs.xMax, uvs.yMax, uvsInd.xMin, uvsInd.yMin}; - inst.texrTindUVs[1] = Zeus::CVector4f{uvs.xMin, uvs.yMax, uvsInd.xMin, uvsInd.yMax}; - inst.texrTindUVs[2] = Zeus::CVector4f{uvs.xMax, uvs.yMin, uvsInd.xMax, uvsInd.yMin}; - inst.texrTindUVs[3] = Zeus::CVector4f{uvs.xMin, uvs.yMin, uvsInd.xMax, uvsInd.yMax}; - inst.sceneUVs = Zeus::CVector4f{clipRect.x18_uvXMin, clipRect.x24_uvYMax, clipRect.x1c_uvXMax, clipRect.x20_uvYMin}; + inst.texrTindUVs[0] = zeus::CVector4f{uvs.xMax, uvs.yMax, uvsInd.xMin, uvsInd.yMin}; + inst.texrTindUVs[1] = zeus::CVector4f{uvs.xMin, uvs.yMax, uvsInd.xMin, uvsInd.yMax}; + inst.texrTindUVs[2] = zeus::CVector4f{uvs.xMax, uvs.yMin, uvsInd.xMax, uvsInd.yMin}; + inst.texrTindUVs[3] = zeus::CVector4f{uvs.xMin, uvs.yMin, uvsInd.xMax, uvsInd.yMax}; + inst.sceneUVs = zeus::CVector4f{clipRect.x18_uvXMin, clipRect.x24_uvYMax, clipRect.x1c_uvXMax, clipRect.x20_uvYMin}; } if (g_instIndTexData.size()) @@ -2027,7 +2027,7 @@ void CElementGen::RenderParticlesIndirectTexture() } } -void CElementGen::SetOrientation(const Zeus::CTransform& orientation) +void CElementGen::SetOrientation(const zeus::CTransform& orientation) { x178_orientation = orientation; x1a8_orientationInverse = x178_orientation.inverse(); @@ -2045,7 +2045,7 @@ void CElementGen::SetOrientation(const Zeus::CTransform& orientation) ch->SetOrientation(orientation); } -void CElementGen::SetTranslation(const Zeus::CVector3f& translation) +void CElementGen::SetTranslation(const zeus::CVector3f& translation) { x7c_translation = translation; @@ -2062,7 +2062,7 @@ void CElementGen::SetTranslation(const Zeus::CVector3f& translation) ch->SetTranslation(translation + x294_SEPO); } -void CElementGen::SetGlobalOrientation(const Zeus::CTransform& rotation) +void CElementGen::SetGlobalOrientation(const zeus::CTransform& rotation) { x1d8_globalOrientation.setRotation(rotation); @@ -2076,7 +2076,7 @@ void CElementGen::SetGlobalOrientation(const Zeus::CTransform& rotation) ch->SetGlobalOrientation(x1d8_globalOrientation); } -void CElementGen::SetGlobalTranslation(const Zeus::CVector3f& translation) +void CElementGen::SetGlobalTranslation(const zeus::CVector3f& translation) { x88_globalTranslation = translation; @@ -2093,11 +2093,11 @@ void CElementGen::SetGlobalTranslation(const Zeus::CVector3f& translation) ch->SetGlobalTranslation(translation); } -void CElementGen::SetGlobalScale(const Zeus::CVector3f& scale) +void CElementGen::SetGlobalScale(const zeus::CVector3f& scale) { xa0_globalScale = scale; - xac_globalScaleTransform = Zeus::CTransform::Scale(scale); - xdc_globalScaleTransformInverse = Zeus::CTransform::Scale(Zeus::CVector3f::skOne / scale); + xac_globalScaleTransform = zeus::CTransform::Scale(scale); + xdc_globalScaleTransformInverse = zeus::CTransform::Scale(zeus::CVector3f::skOne / scale); for (const std::unique_ptr& ch : x234_activePartChildren) ch->SetGlobalScale(scale); @@ -2112,11 +2112,11 @@ void CElementGen::SetGlobalScale(const Zeus::CVector3f& scale) ch->SetGlobalScale(scale); } -void CElementGen::SetLocalScale(const Zeus::CVector3f& scale) +void CElementGen::SetLocalScale(const zeus::CVector3f& scale) { x10c_localScale = scale; - x118_localScaleTransform = Zeus::CTransform::Scale(scale); - x148_localScaleTransformInverse = Zeus::CTransform::Scale(Zeus::CVector3f::skOne / scale); + x118_localScaleTransform = zeus::CTransform::Scale(scale); + x148_localScaleTransformInverse = zeus::CTransform::Scale(zeus::CVector3f::skOne / scale); for (const std::unique_ptr& ch : x234_activePartChildren) ch->SetLocalScale(scale); @@ -2142,7 +2142,7 @@ void CElementGen::SetParticleEmission(bool enabled) ch->SetParticleEmission(enabled); } -void CElementGen::SetModulationColor(const Zeus::CColor& color) +void CElementGen::SetModulationColor(const zeus::CColor& color) { x30c_moduColor = color; @@ -2159,32 +2159,32 @@ void CElementGen::SetModulationColor(const Zeus::CColor& color) ch->SetModulationColor(color); } -const Zeus::CTransform& CElementGen::GetOrientation() const +const zeus::CTransform& CElementGen::GetOrientation() const { return x178_orientation; } -const Zeus::CVector3f& CElementGen::GetTranslation() const +const zeus::CVector3f& CElementGen::GetTranslation() const { return x7c_translation; } -const Zeus::CTransform& CElementGen::GetGlobalOrientation() const +const zeus::CTransform& CElementGen::GetGlobalOrientation() const { return x1d8_globalOrientation; } -const Zeus::CVector3f& CElementGen::GetGlobalTranslation() const +const zeus::CVector3f& CElementGen::GetGlobalTranslation() const { return x88_globalTranslation; } -const Zeus::CVector3f& CElementGen::GetGlobalScale() const +const zeus::CVector3f& CElementGen::GetGlobalScale() const { return xa0_globalScale; } -const Zeus::CColor& CElementGen::GetModulationColor() const +const zeus::CColor& CElementGen::GetModulationColor() const { return x30c_moduColor; } @@ -2213,10 +2213,10 @@ bool CElementGen::IsSystemDeletable() const return false; } -std::pair CElementGen::GetBounds() const +std::pair CElementGen::GetBounds() const { if (GetParticleCountAll() == 0) - return {Zeus::CAABox(), false}; + return {zeus::CAABox(), false}; else return {x2c4_systemBounds, true}; } diff --git a/Runtime/Particle/CElementGen.hpp b/Runtime/Particle/CElementGen.hpp index ae52a2885..a33876591 100644 --- a/Runtime/Particle/CElementGen.hpp +++ b/Runtime/Particle/CElementGen.hpp @@ -2,19 +2,19 @@ #define __PSHAG_CELEMENTGEN_HPP__ #include "RetroTypes.hpp" -#include "CTransform.hpp" -#include "CVector3f.hpp" -#include "CColor.hpp" -#include "CAABox.hpp" +#include "zeus/CTransform.hpp" +#include "zeus/CVector3f.hpp" +#include "zeus/CColor.hpp" +#include "zeus/CAABox.hpp" #include "CToken.hpp" -#include "CLight.hpp" -#include "CGraphics.hpp" +#include "Graphics/CLight.hpp" +#include "Graphics/CGraphics.hpp" #include "CRandom16.hpp" #include "CParticleGen.hpp" #include "CElementGenShaders.hpp" #include "Graphics/CLineRenderer.hpp" -namespace pshag +namespace urde { class CWarp; class CLight; @@ -48,7 +48,7 @@ public: { friend class CElementGen; s16 x0_partIdx; - Zeus::CVector3f x4_viewPoint; + zeus::CVector3f x4_viewPoint; public: CParticleListItem(s16 idx) : x0_partIdx(idx) @@ -63,13 +63,13 @@ public: struct CParticle { int x0_endFrame = 0; - Zeus::CVector3f x4_pos; - Zeus::CVector3f x10_prevPos; - Zeus::CVector3f x1c_vel; + zeus::CVector3f x4_pos; + zeus::CVector3f x10_prevPos; + zeus::CVector3f x1c_vel; int x28_startFrame = 0; float x2c_lineLengthOrSize = 0.f; float x30_lineWidthOrRota = 0.f; - Zeus::CColor x34_color = {0.f, 0.f, 0.f, 1.f}; + zeus::CColor x34_color = {0.f, 0.f, 0.f, 1.f}; }; static CParticle* g_currentParticle; private: @@ -77,7 +77,7 @@ private: TLockedToken x1c_genDesc; EModelOrientationType x28_orientType; std::vector x2c_particleLists; - std::vector x3c_parentMatrices; + std::vector x3c_parentMatrices; u32 x4c_internalStartFrame = 0; u32 x50_curFrame = 0; double x58_curSeconds = 0.f; @@ -88,23 +88,23 @@ private: int x70_MAXP = 0; u16 x74_randomSeed = 99; float x78_generatorRate = 1.f; - Zeus::CVector3f x7c_translation; - Zeus::CVector3f x88_globalTranslation; - Zeus::CVector3f x94_POFS; - Zeus::CVector3f xa0_globalScale = {1.f, 1.f, 1.f}; - Zeus::CTransform xac_globalScaleTransform = Zeus::CTransform::Identity(); - Zeus::CTransform xdc_globalScaleTransformInverse = Zeus::CTransform::Identity(); - Zeus::CVector3f x10c_localScale = {1.f, 1.f, 1.f}; - Zeus::CTransform x118_localScaleTransform = Zeus::CTransform::Identity(); - Zeus::CTransform x148_localScaleTransformInverse = Zeus::CTransform::Identity(); - Zeus::CTransform x178_orientation = Zeus::CTransform::Identity(); - Zeus::CTransform x1a8_orientationInverse = Zeus::CTransform::Identity(); - Zeus::CTransform x1d8_globalOrientation = Zeus::CTransform::Identity(); + zeus::CVector3f x7c_translation; + zeus::CVector3f x88_globalTranslation; + zeus::CVector3f x94_POFS; + zeus::CVector3f xa0_globalScale = {1.f, 1.f, 1.f}; + zeus::CTransform xac_globalScaleTransform = zeus::CTransform::Identity(); + zeus::CTransform xdc_globalScaleTransformInverse = zeus::CTransform::Identity(); + zeus::CVector3f x10c_localScale = {1.f, 1.f, 1.f}; + zeus::CTransform x118_localScaleTransform = zeus::CTransform::Identity(); + zeus::CTransform x148_localScaleTransformInverse = zeus::CTransform::Identity(); + zeus::CTransform x178_orientation = zeus::CTransform::Identity(); + zeus::CTransform x1a8_orientationInverse = zeus::CTransform::Identity(); + zeus::CTransform x1d8_globalOrientation = zeus::CTransform::Identity(); u32 x208_activeParticleCount = 0; u32 x20c_recursiveParticleCount = 0; u32 x210_curEmitterFrame = 0; int x214_PSLT = 90;//0x7fffff; - Zeus::CVector3f x218_PSIV; + zeus::CVector3f x218_PSIV; bool x224_24_translationDirty = false; bool x224_25_LIT_; bool x224_26_AAPH; @@ -130,30 +130,30 @@ private: int x25c_PISY = 16; std::vector> x260_swhcChildren; int x270_SSSD = 0; - Zeus::CVector3f x274_SSPO; + zeus::CVector3f x274_SSPO; std::vector> x280_elscChildren; int x290_SESD = 0; - Zeus::CVector3f x294_SEPO; + zeus::CVector3f x294_SEPO; float x2a0 = 0.f; float x2a4 = 0.f; - Zeus::CVector3f x2a8_aabbMin; - Zeus::CVector3f x2b4_aabbMax; + zeus::CVector3f x2a8_aabbMin; + zeus::CVector3f x2b4_aabbMax; float x2c0_maxSize = 0.f; - Zeus::CAABox x2c4_systemBounds = Zeus::CAABox::skInvertedBox; + zeus::CAABox x2c4_systemBounds = zeus::CAABox::skInvertedBox; LightType x2dc_lightType; - Zeus::CColor x2e0_LCLR = Zeus::CColor::skWhite; + zeus::CColor x2e0_LCLR = zeus::CColor::skWhite; float x2e4_LINT = 1.f; - Zeus::CVector3f x2e8_LOFF; - Zeus::CVector3f x2f4_LDIR = {1.f, 0.f, 0.f}; + zeus::CVector3f x2e8_LOFF; + zeus::CVector3f x2f4_LDIR = {1.f, 0.f, 0.f}; EFalloffType x300_falloffType = EFalloffType::Linear; float x304_LFOR = 1.f; float x308_LSLA = 45.f; - Zeus::CColor x30c_moduColor = {1.f, 1.f, 1.f, 1.f}; + zeus::CColor x30c_moduColor = {1.f, 1.f, 1.f, 1.f}; std::unique_ptr m_lineRenderer; CElementGenShaders::EShaderClass m_shaderClass; - void AccumulateBounds(Zeus::CVector3f& pos, float size); + void AccumulateBounds(zeus::CVector3f& pos, float size); public: CElementGen(const TToken& gen, EModelOrientationType orientType, EOptionalSystemFlags flags); @@ -210,22 +210,22 @@ public: void Update(double); void Render(); - void SetOrientation(const Zeus::CTransform&); - void SetTranslation(const Zeus::CVector3f&); - void SetGlobalOrientation(const Zeus::CTransform&); - void SetGlobalTranslation(const Zeus::CVector3f&); - void SetGlobalScale(const Zeus::CVector3f&); - void SetLocalScale(const Zeus::CVector3f&); + void SetOrientation(const zeus::CTransform&); + void SetTranslation(const zeus::CVector3f&); + void SetGlobalOrientation(const zeus::CTransform&); + void SetGlobalTranslation(const zeus::CVector3f&); + void SetGlobalScale(const zeus::CVector3f&); + void SetLocalScale(const zeus::CVector3f&); void SetParticleEmission(bool); - void SetModulationColor(const Zeus::CColor&); - const Zeus::CTransform& GetOrientation() const; - const Zeus::CVector3f& GetTranslation() const; - const Zeus::CTransform& GetGlobalOrientation() const; - const Zeus::CVector3f& GetGlobalTranslation() const; - const Zeus::CVector3f& GetGlobalScale() const; - const Zeus::CColor& GetModulationColor() const; + void SetModulationColor(const zeus::CColor&); + const zeus::CTransform& GetOrientation() const; + const zeus::CVector3f& GetTranslation() const; + const zeus::CTransform& GetGlobalOrientation() const; + const zeus::CVector3f& GetGlobalTranslation() const; + const zeus::CVector3f& GetGlobalScale() const; + const zeus::CColor& GetModulationColor() const; bool IsSystemDeletable() const; - std::pair GetBounds() const; + std::pair GetBounds() const; u32 GetParticleCount() const; bool SystemHasLight() const; CLight GetLight() const; diff --git a/Runtime/Particle/CElementGenShaders.hpp b/Runtime/Particle/CElementGenShaders.hpp index f2eab5303..21e846400 100644 --- a/Runtime/Particle/CElementGenShaders.hpp +++ b/Runtime/Particle/CElementGenShaders.hpp @@ -1,13 +1,13 @@ #ifndef __PSHAG_CELEMENTGENSHADERS_HPP__ #define __PSHAG_CELEMENTGENSHADERS_HPP__ -#include "CGraphics.hpp" +#include "Graphics/CGraphics.hpp" #include "boo/graphicsdev/GL.hpp" #include "boo/graphicsdev/D3D.hpp" #include "boo/graphicsdev/Metal.hpp" #include "boo/graphicsdev/Vulkan.hpp" -namespace pshag +namespace urde { class CElementGen; diff --git a/Runtime/Particle/CElementGenShadersGLSL.cpp b/Runtime/Particle/CElementGenShadersGLSL.cpp index 0cd5b8e69..d5b2f9775 100644 --- a/Runtime/Particle/CElementGenShadersGLSL.cpp +++ b/Runtime/Particle/CElementGenShadersGLSL.cpp @@ -3,9 +3,9 @@ #include "CGenDescription.hpp" #include "CElectricDescription.hpp" #include "CSwooshDescription.hpp" -#include "CModel.hpp" +#include "Graphics/CModel.hpp" -namespace pshag +namespace urde { static const char* VS_GLSL_TEX = diff --git a/Runtime/Particle/CElementGenShadersHLSL.cpp b/Runtime/Particle/CElementGenShadersHLSL.cpp index bbb3a7f89..c63735977 100644 --- a/Runtime/Particle/CElementGenShadersHLSL.cpp +++ b/Runtime/Particle/CElementGenShadersHLSL.cpp @@ -3,9 +3,9 @@ #include "CGenDescription.hpp" #include "CElectricDescription.hpp" #include "CSwooshDescription.hpp" -#include "CModel.hpp" +#include "Graphics/CModel.hpp" -namespace pshag +namespace urde { static const char* VS_HLSL_TEX = diff --git a/Runtime/Particle/CElementGenShadersMetal.cpp b/Runtime/Particle/CElementGenShadersMetal.cpp index 336f8e8f7..61f6d73af 100644 --- a/Runtime/Particle/CElementGenShadersMetal.cpp +++ b/Runtime/Particle/CElementGenShadersMetal.cpp @@ -2,7 +2,7 @@ #include "CElementGen.hpp" #include "CGenDescription.hpp" -namespace pshag +namespace urde { static const char* VS_METAL_TEX = diff --git a/Runtime/Particle/CEmitterElement.cpp b/Runtime/Particle/CEmitterElement.cpp index 2d0deefc8..799079088 100644 --- a/Runtime/Particle/CEmitterElement.cpp +++ b/Runtime/Particle/CEmitterElement.cpp @@ -3,24 +3,24 @@ /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Emitter_Elements */ -namespace pshag +namespace urde { -bool CEESimpleEmitter::GetValue(int frame, Zeus::CVector3f& pPos, Zeus::CVector3f& pVel) const +bool CEESimpleEmitter::GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f& pVel) const { x4_loc->GetValue(frame, pPos); if (x8_vec) x8_vec->GetValue(frame, pVel); else - pVel = Zeus::CVector3f(); + pVel = zeus::CVector3f(); return false; } -bool CVESphere::GetValue(int frame, Zeus::CVector3f& pPos, Zeus::CVector3f& pVel) const +bool CVESphere::GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f& pVel) const { - Zeus::CVector3f a; + zeus::CVector3f a; x4_sphereOrigin->GetValue(frame, a); float b; x8_sphereRadius->GetValue(frame, b); @@ -29,7 +29,7 @@ bool CVESphere::GetValue(int frame, Zeus::CVector3f& pPos, Zeus::CVector3f& pVel int rand2 = rand->Range(-100, 100); int rand3 = rand->Range(-100, 100); - Zeus::CVector3f normVec1 = Zeus::CVector3f(0.0099999998f * float(rand3), + zeus::CVector3f normVec1 = zeus::CVector3f(0.0099999998f * float(rand3), 0.0099999998f * float(rand2), 0.0099999998f * float(rand1)); if (normVec1.canBeNormalized()) @@ -37,7 +37,7 @@ bool CVESphere::GetValue(int frame, Zeus::CVector3f& pPos, Zeus::CVector3f& pVel pPos = b * normVec1 + a; - Zeus::CVector3f normVec2 = (pPos - a); + zeus::CVector3f normVec2 = (pPos - a); if (normVec2.canBeNormalized()) normVec2.normalize(); @@ -48,9 +48,9 @@ bool CVESphere::GetValue(int frame, Zeus::CVector3f& pPos, Zeus::CVector3f& pVel return false; } -bool CVEAngleSphere::GetValue(int frame, Zeus::CVector3f& pPos, Zeus::CVector3f& pVel) const +bool CVEAngleSphere::GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f& pVel) const { - Zeus::CVector3f a; + zeus::CVector3f a; x4_sphereOrigin->GetValue(frame, a); float b, d, e, f, g; @@ -60,14 +60,14 @@ bool CVEAngleSphere::GetValue(int frame, Zeus::CVector3f& pPos, Zeus::CVector3f& x18_angleXRange->GetValue(frame, f); x1c_angleYRange->GetValue(frame, g); CRandom16* rand = CRandom16::GetRandomNumber(); - d = (d + ((0.5f * (f * rand->Float())) - f)) * M_PI / 180.f; - e = (e + ((0.5f * (g * rand->Float())) - g)) * M_PI / 180.f; + d = zeus::degToRad(d + ((0.5f * (f * rand->Float())) - f)); + e = zeus::degToRad(e + ((0.5f * (g * rand->Float())) - g)); - float cosD = Zeus::Math::fastCosR(d); - pPos.x = a.x + (b * (-Zeus::Math::fastSinR(e) * cosD)); - pPos.y = a.y + (b * Zeus::Math::fastSinR(d)); + float cosD = zeus::fastCosF(d); + pPos.x = a.x + (b * (-zeus::fastSinF(e) * cosD)); + pPos.y = a.y + (b * zeus::fastSinF(d)); pPos.z = a.z + (b * (cosD * cosD)); - Zeus::CVector3f normVec = (pPos - a).normalized(); + zeus::CVector3f normVec = (pPos - a).normalized(); float c; xc_velocityMag->GetValue(frame, c); diff --git a/Runtime/Particle/CEmitterElement.hpp b/Runtime/Particle/CEmitterElement.hpp index 7cdfc5539..cf1fc81d5 100644 --- a/Runtime/Particle/CEmitterElement.hpp +++ b/Runtime/Particle/CEmitterElement.hpp @@ -5,7 +5,7 @@ /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Emitter_Elements */ -namespace pshag +namespace urde { class CEESimpleEmitter : public CEmitterElement @@ -15,7 +15,7 @@ class CEESimpleEmitter : public CEmitterElement public: CEESimpleEmitter(CVectorElement* a, CVectorElement* b) : x4_loc(a), x8_vec(b) {} - bool GetValue(int frame, Zeus::CVector3f& pPos, Zeus::CVector3f& pVel) const; + bool GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f& pVel) const; }; class CVESphere : public CEmitterElement @@ -26,7 +26,7 @@ class CVESphere : public CEmitterElement public: CVESphere(CVectorElement* a, CRealElement* b, CRealElement* c) : x4_sphereOrigin(a), x8_sphereRadius(b), xc_velocityMag(c) {} - bool GetValue(int frame, Zeus::CVector3f& pPos, Zeus::CVector3f& pVel) const; + bool GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f& pVel) const; }; class CVEAngleSphere : public CEmitterElement @@ -42,7 +42,7 @@ public: CVEAngleSphere(CVectorElement* a, CRealElement* b, CRealElement* c, CRealElement* d, CRealElement* e, CRealElement* f, CRealElement* g) : x4_sphereOrigin(a), x8_sphereRadius(b), xc_velocityMag(c), x10_angleXBias(d), x14_angleYBias(e), x18_angleXRange(f), x1c_angleYRange(g) {} - bool GetValue(int frame, Zeus::CVector3f& pPos, Zeus::CVector3f& pVel) const; + bool GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f& pVel) const; }; } diff --git a/Runtime/Particle/CFlameWarp.cpp b/Runtime/Particle/CFlameWarp.cpp index 12c39312a..474de8165 100644 --- a/Runtime/Particle/CFlameWarp.cpp +++ b/Runtime/Particle/CFlameWarp.cpp @@ -1,6 +1,6 @@ #include "CFlameWarp.hpp" -namespace pshag +namespace urde { } diff --git a/Runtime/Particle/CFlameWarp.hpp b/Runtime/Particle/CFlameWarp.hpp index 0856a6c51..46c743a5d 100644 --- a/Runtime/Particle/CFlameWarp.hpp +++ b/Runtime/Particle/CFlameWarp.hpp @@ -3,19 +3,19 @@ #include "CWarp.hpp" -namespace pshag +namespace urde { class CFlameWarp : public CWarp { - Zeus::CVector3f x4; - Zeus::CVector3f xc; + zeus::CVector3f x4; + zeus::CVector3f xc; float x1c; float x20; int x24; bool x28_activated : 1; public: - CFlameWarp(float a, const Zeus::CVector3f& b) + CFlameWarp(float a, const zeus::CVector3f& b) : x4(b), x1c(0.0), x20(a * a), x24(0) { x28_activated = false; @@ -25,10 +25,10 @@ public: bool UpdateWarp() { return x28_activated; } void ModifyParticles(int, int, int *, - Zeus::CVector3f*, - Zeus::CVector3f*, - Zeus::CVector3f*, - Zeus::CColor*, + zeus::CVector3f*, + zeus::CVector3f*, + zeus::CVector3f*, + zeus::CColor*, float*, float*) {} void Activate(bool val) { x28_activated = val; } bool IsActivated() { return x28_activated; } diff --git a/Runtime/Particle/CGenDescription.hpp b/Runtime/Particle/CGenDescription.hpp index c3b6b84f2..3edbded9a 100644 --- a/Runtime/Particle/CGenDescription.hpp +++ b/Runtime/Particle/CGenDescription.hpp @@ -14,7 +14,7 @@ /* Documentation at: http://www.metroid2002.com/retromodding/wiki/PART_(File_Format) */ -namespace pshag +namespace urde { class CGenDescription diff --git a/Runtime/Particle/CIntElement.cpp b/Runtime/Particle/CIntElement.cpp index 8bd3d3060..03112c0f5 100644 --- a/Runtime/Particle/CIntElement.cpp +++ b/Runtime/Particle/CIntElement.cpp @@ -4,7 +4,7 @@ /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Int_Elements */ -namespace pshag +namespace urde { CIEKeyframeEmitter::CIEKeyframeEmitter(CInputStream& in) diff --git a/Runtime/Particle/CIntElement.hpp b/Runtime/Particle/CIntElement.hpp index 7b48804a8..0f089e830 100644 --- a/Runtime/Particle/CIntElement.hpp +++ b/Runtime/Particle/CIntElement.hpp @@ -5,7 +5,7 @@ /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Int_Elements */ -namespace pshag +namespace urde { class CIEKeyframeEmitter : public CIntElement diff --git a/Runtime/Particle/CModVectorElement.cpp b/Runtime/Particle/CModVectorElement.cpp index 12dd9c63b..ec63a8025 100644 --- a/Runtime/Particle/CModVectorElement.cpp +++ b/Runtime/Particle/CModVectorElement.cpp @@ -1,19 +1,19 @@ #include "CModVectorElement.hpp" #include "CParticleGlobals.hpp" #include "CRandom16.hpp" -#include +#include "zeus/Math.hpp" /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Mod_Vector_Elements */ -namespace pshag +namespace urde { -bool CMVEImplosion::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const +bool CMVEImplosion::GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const { - Zeus::CVector3f av; + zeus::CVector3f av; x4_implPoint->GetValue(frame, av); - Zeus::CVector3f dv = av - pPos; + zeus::CVector3f dv = av - pPos; float dvm = dv.magnitude(); float c; @@ -31,16 +31,16 @@ bool CMVEImplosion::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& float b; x8_magScale->GetValue(frame, b); - pVel += Zeus::CVector3f(b / dvm) * dv; + pVel += zeus::CVector3f(b / dvm) * dv; return false; } -bool CMVEExponentialImplosion::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const +bool CMVEExponentialImplosion::GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const { - Zeus::CVector3f av; + zeus::CVector3f av; x4_implPoint->GetValue(frame, av); - Zeus::CVector3f dv = av - pPos; + zeus::CVector3f dv = av - pPos; float dvm = dv.magnitude(); float c; @@ -58,16 +58,16 @@ bool CMVEExponentialImplosion::GetValue(int frame, Zeus::CVector3f& pVel, Zeus:: float b; x8_magScale->GetValue(frame, b); - pVel += Zeus::CVector3f(b) * dv; + pVel += zeus::CVector3f(b) * dv; return false; } -bool CMVELinearImplosion::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const +bool CMVELinearImplosion::GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const { - Zeus::CVector3f av; + zeus::CVector3f av; x4_implPoint->GetValue(frame, av); - Zeus::CVector3f dv = av - pPos; + zeus::CVector3f dv = av - pPos; float dvm = dv.magnitude(); float c; @@ -85,11 +85,11 @@ bool CMVELinearImplosion::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVect float b; x8_magScale->GetValue(frame, b); - pVel = Zeus::CVector3f(b / dvm) * dv; + pVel = zeus::CVector3f(b / dvm) * dv; return false; } -bool CMVETimeChain::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const +bool CMVETimeChain::GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const { int v; xc_swFrame->GetValue(frame, v); @@ -111,21 +111,21 @@ CMVEBounce::CMVEBounce(CVectorElement* a, CVectorElement* b, CRealElement* c, CR if (x18_planeValidatedNormal.magSquared() > 0.0) x18_planeValidatedNormal.normalize(); - Zeus::CVector3f a; + zeus::CVector3f a; x4_planePoint->GetValue(0, a); x24_planeD = x18_planeValidatedNormal.dot(a); } } -bool CMVEBounce::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const +bool CMVEBounce::GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const { if (!x14_planePrecomputed) { /* Compute Hesse normal form of plane (for penetration testing) */ - x8_planeNormal->GetValue(frame, ((Zeus::CVector3f&)x18_planeValidatedNormal)); - ((Zeus::CVector3f&)x18_planeValidatedNormal).normalize(); + x8_planeNormal->GetValue(frame, ((zeus::CVector3f&)x18_planeValidatedNormal)); + ((zeus::CVector3f&)x18_planeValidatedNormal).normalize(); - Zeus::CVector3f a; + zeus::CVector3f a; x4_planePoint->GetValue(frame, a); (float&)(x24_planeD) = x18_planeValidatedNormal.dot(a); @@ -145,8 +145,8 @@ bool CMVEBounce::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPo if (pVel.magSquared() > 0.0f) return false; - Zeus::CVector3f delta = pPos - pVel; - pPos += Zeus::CVector3f{(-((((delta.z * ((delta.x * (delta.y * x18_planeValidatedNormal.y)) + zeus::CVector3f delta = pPos - pVel; + pPos += zeus::CVector3f{(-((((delta.z * ((delta.x * (delta.y * x18_planeValidatedNormal.y)) + ((pVel.x * (x18_planeValidatedNormal.y * pVel.y)) + x18_planeValidatedNormal.x))) + x18_planeValidatedNormal.z) - x24_planeD)) / ((pVel.z * ((pVel.x * (x18_planeValidatedNormal.y * pVel.y)) + x18_planeValidatedNormal.x)) + x18_planeValidatedNormal.z)) - ( (x18_planeValidatedNormal.z * ((x18_planeValidatedNormal.x * (x18_planeValidatedNormal.y * pVel.y)) + pVel.x)) + pVel.z)} * pVel; @@ -157,11 +157,11 @@ bool CMVEBounce::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPo float c = 0.0f; xc_friction->GetValue(frame, c); - pVel -= Zeus::CVector3f{(1.0f + c) * ((x18_planeValidatedNormal.z * (x18_planeValidatedNormal.x * (x18_planeValidatedNormal.y * pVel.y)) + pVel.x) + pVel.x)} * x18_planeValidatedNormal; + pVel -= zeus::CVector3f{(1.0f + c) * ((x18_planeValidatedNormal.z * (x18_planeValidatedNormal.x * (x18_planeValidatedNormal.y * pVel.y)) + pVel.x) + pVel.x)} * x18_planeValidatedNormal; return false; } -bool CMVEConstant::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& /*pPos*/) const +bool CMVEConstant::GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& /*pPos*/) const { x4_x->GetValue(frame, pVel.x); x8_y->GetValue(frame, pVel.y); @@ -169,26 +169,26 @@ bool CMVEConstant::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& / return false; } -bool CMVEFastConstant::GetValue(int /*frame*/, Zeus::CVector3f& pVel, Zeus::CVector3f& /*pPos*/) const +bool CMVEFastConstant::GetValue(int /*frame*/, zeus::CVector3f& pVel, zeus::CVector3f& /*pPos*/) const { pVel = x4_val; return false; } -bool CMVEGravity::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& /*pPos*/) const +bool CMVEGravity::GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& /*pPos*/) const { - Zeus::CVector3f grav; + zeus::CVector3f grav; x4_a->GetValue(frame, grav); pVel += grav; return false; } -bool CMVEExplode::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& /*pPos*/) const +bool CMVEExplode::GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& /*pPos*/) const { if (frame == 0) { CRandom16* rand = CRandom16::GetRandomNumber(); - Zeus::CVector3f vec = {rand->Float() - 0.5f, rand->Float() - 0.5f, rand->Float() - 0.5f}; + zeus::CVector3f vec = {rand->Float() - 0.5f, rand->Float() - 0.5f, rand->Float() - 0.5f}; vec.normalize(); float a; x4_a->GetValue(frame, a); @@ -204,13 +204,13 @@ bool CMVEExplode::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& /* return false; } -bool CMVESetPosition::GetValue(int frame, Zeus::CVector3f& /*pVel*/, Zeus::CVector3f& pPos) const +bool CMVESetPosition::GetValue(int frame, zeus::CVector3f& /*pVel*/, zeus::CVector3f& pPos) const { x4_a->GetValue(frame, pPos); return false; } -bool CMVEPulse::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const +bool CMVEPulse::GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const { int a, b; x4_aDuration->GetValue(frame, a); @@ -231,9 +231,9 @@ bool CMVEPulse::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos return false; } -bool CMVEWind::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& /*pPos*/) const +bool CMVEWind::GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& /*pPos*/) const { - Zeus::CVector3f wVel; + zeus::CVector3f wVel; x4_velocity->GetValue(frame, wVel); float factor; x8_factor->GetValue(frame, factor); @@ -241,15 +241,15 @@ bool CMVEWind::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& /*pPo return false; } -bool CMVESwirl::GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const +bool CMVESwirl::GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const { - Zeus::CVector3f a, b; + zeus::CVector3f a, b; x4_helixPoint->GetValue(frame, a); x8_curveBinormal->GetValue(frame, b); /* Compute Frenet–Serret normal * https://en.wikipedia.org/wiki/Frenet–Serret_formulas */ - const Zeus::CVector3f diff = a - pPos; + const zeus::CVector3f diff = a - pPos; float x = (diff.x - (((diff.z * ((diff.x * (diff.y * b.y)) + b.x)) + b.z) * b.x)); float y = (diff.y - (((diff.z * ((diff.x * (diff.y * b.y)) + b.x)) + b.z) * b.y)); float z = (diff.z - (((diff.z * ((diff.x * (diff.y * b.y)) + b.x)) + b.z) * b.z)); diff --git a/Runtime/Particle/CModVectorElement.hpp b/Runtime/Particle/CModVectorElement.hpp index 64aea32eb..4706aaca5 100644 --- a/Runtime/Particle/CModVectorElement.hpp +++ b/Runtime/Particle/CModVectorElement.hpp @@ -5,7 +5,7 @@ /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Mod_Vector_Elements */ -namespace pshag +namespace urde { class CMVEImplosion : public CModVectorElement @@ -18,7 +18,7 @@ class CMVEImplosion : public CModVectorElement public: CMVEImplosion(CVectorElement* a, CRealElement* b, CRealElement* c, CRealElement* d, bool e) : x4_implPoint(a), x8_magScale(b), xc_maxMag(c), x10_minMag(d), x14_enableMinMag(e) {} - bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const; + bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const; }; class CMVEExponentialImplosion : public CModVectorElement @@ -31,7 +31,7 @@ class CMVEExponentialImplosion : public CModVectorElement public: CMVEExponentialImplosion(CVectorElement* a, CRealElement* b, CRealElement* c, CRealElement* d, bool e) : x4_implPoint(a), x8_magScale(b), xc_maxMag(c), x10_minMag(d), x14_enableMinMag(e) {} - bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const; + bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const; }; class CMVELinearImplosion : public CModVectorElement @@ -44,7 +44,7 @@ class CMVELinearImplosion : public CModVectorElement public: CMVELinearImplosion(CVectorElement* a, CRealElement* b, CRealElement* c, CRealElement* d, bool e) : x4_implPoint(a), x8_magScale(b), xc_maxMag(c), x10_minMag(d), x14_enableMinMag(e) {} - bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const; + bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const; }; class CMVETimeChain : public CModVectorElement @@ -55,7 +55,7 @@ class CMVETimeChain : public CModVectorElement public: CMVETimeChain(CModVectorElement* a, CModVectorElement* b, CIntElement* c) : x4_a(a), x8_b(b), xc_swFrame(c) {} - bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const; + bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const; }; class CMVEBounce : public CModVectorElement @@ -66,11 +66,11 @@ class CMVEBounce : public CModVectorElement std::unique_ptr x10_restitution; bool x14_planePrecomputed; bool x15_dieOnPenetrate; - Zeus::CVector3f x18_planeValidatedNormal; + zeus::CVector3f x18_planeValidatedNormal; float x24_planeD; public: CMVEBounce(CVectorElement* a, CVectorElement* b, CRealElement* c, CRealElement* d, bool e); - bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const; + bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const; }; class CMVEConstant : public CModVectorElement @@ -81,16 +81,16 @@ class CMVEConstant : public CModVectorElement public: CMVEConstant(CRealElement* a, CRealElement* b, CRealElement* c) : x4_x(a), x8_y(b), xc_z(c) {} - bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const; + bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const; }; class CMVEFastConstant : public CModVectorElement { - Zeus::CVector3f x4_val; + zeus::CVector3f x4_val; public: CMVEFastConstant(float a, float b, float c) : x4_val(a, b, c) {} - bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const; + bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const; }; class CMVEGravity : public CModVectorElement @@ -99,7 +99,7 @@ class CMVEGravity : public CModVectorElement public: CMVEGravity(CVectorElement* a) : x4_a(a) {} - bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const; + bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const; }; class CMVEExplode : public CModVectorElement @@ -109,7 +109,7 @@ class CMVEExplode : public CModVectorElement public: CMVEExplode(CRealElement* a, CRealElement* b) : x4_a(a), x8_b(b) {} - bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const; + bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const; }; class CMVESetPosition : public CModVectorElement @@ -118,7 +118,7 @@ class CMVESetPosition : public CModVectorElement public: CMVESetPosition(CVectorElement* a) : x4_a(a) {} - bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const; + bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const; }; class CMVEPulse : public CModVectorElement @@ -130,7 +130,7 @@ class CMVEPulse : public CModVectorElement public: CMVEPulse(CIntElement* a, CIntElement* b, CModVectorElement* c, CModVectorElement* d) : x4_aDuration(a), x8_bDuration(b), xc_aVal(c), x10_bVal(d) {} - bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const; + bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const; }; class CMVEWind : public CModVectorElement @@ -140,7 +140,7 @@ class CMVEWind : public CModVectorElement public: CMVEWind(CVectorElement* a, CRealElement* b) : x4_velocity(a), x8_factor(b) {} - bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const; + bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const; }; class CMVESwirl : public CModVectorElement @@ -152,7 +152,7 @@ class CMVESwirl : public CModVectorElement public: CMVESwirl(CVectorElement* a, CVectorElement* b, CRealElement* c, CRealElement* d) : x4_helixPoint(a), x8_curveBinormal(b), xc_targetRadius(c), x10_tangentialVelocity(d) {} - bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const; + bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const; }; } diff --git a/Runtime/Particle/CParticleDataFactory.cpp b/Runtime/Particle/CParticleDataFactory.cpp index cf044ebf5..9932c318f 100644 --- a/Runtime/Particle/CParticleDataFactory.cpp +++ b/Runtime/Particle/CParticleDataFactory.cpp @@ -3,13 +3,13 @@ #include "CSimplePool.hpp" #include "CGenDescription.hpp" #include "CRandom16.hpp" -#include "CModel.hpp" +#include "Graphics/CModel.hpp" #include "CSwooshDescription.hpp" #include "CElectricDescription.hpp" -namespace pshag +namespace urde { -static LogVisor::LogModule Log("pshag::CParticleDataFactory"); +static logvisor::Module Log("urde::CParticleDataFactory"); float CParticleDataFactory::GetReal(CInputStream& in) { @@ -25,7 +25,7 @@ bool CParticleDataFactory::GetBool(CInputStream& in) { FourCC cid = GetClassID(in); if (cid != FOURCC('CNST')) - Log.report(LogVisor::FatalError, "bool element does not begin with CNST"); + Log.report(logvisor::Fatal, "bool element does not begin with CNST"); return in.readBool(); } @@ -1110,7 +1110,7 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i default: { uint32_t clsName = clsId.toUint32(); - Log.report(LogVisor::FatalError, "Unknown GPSM class %.4s @%" PRIi64, &clsName, in.position()); + Log.report(logvisor::Fatal, "Unknown GPSM class %.4s @%" PRIi64, &clsName, in.position()); return false; } } diff --git a/Runtime/Particle/CParticleDataFactory.hpp b/Runtime/Particle/CParticleDataFactory.hpp index aaecd7880..db2bfc55e 100644 --- a/Runtime/Particle/CParticleDataFactory.hpp +++ b/Runtime/Particle/CParticleDataFactory.hpp @@ -6,7 +6,7 @@ #include "CToken.hpp" #include "IOStreams.hpp" -namespace pshag +namespace urde { class CGenDescription; class CSwooshDescription; diff --git a/Runtime/Particle/CParticleElectric.cpp b/Runtime/Particle/CParticleElectric.cpp index 3f5a2fa02..755799a80 100644 --- a/Runtime/Particle/CParticleElectric.cpp +++ b/Runtime/Particle/CParticleElectric.cpp @@ -2,10 +2,10 @@ #include "CGenDescription.hpp" #include "CSwooshDescription.hpp" #include "CElectricDescription.hpp" -#include "CModel.hpp" -#include "CGraphics.hpp" +#include "Graphics/CModel.hpp" +#include "Graphics/CGraphics.hpp" -namespace pshag +namespace urde { CParticleElectric::CParticleElectric(const TToken& desc) @@ -24,14 +24,14 @@ void CParticleElectric::RenderLines() CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, false); CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::One, ERglLogicOp::Clear); - Zeus::CTransform viewXfrm = CGraphics::g_ViewMatrix; - Zeus::CTransform localScale; + zeus::CTransform viewXfrm = CGraphics::g_ViewMatrix; + zeus::CTransform localScale; localScale.Scale(xec_localScale); - Zeus::CTransform globalScale; + zeus::CTransform globalScale; globalScale.Scale(xe0_globalScale); - Zeus::CTransform localTranslation; + zeus::CTransform localTranslation; localTranslation.Translate(x38_translation); - Zeus::CTransform globalTranslation; + zeus::CTransform globalTranslation; globalTranslation.Translate(xa4_globalTranslation); CGraphics::SetModelMatrix(xb0_globalOrientation * globalTranslation * localTranslation * x44_orientation * globalScale); CGraphics::SetCullMode(ERglCullMode::None); @@ -51,37 +51,37 @@ void CParticleElectric::Render() { } -void CParticleElectric::SetOrientation(const Zeus::CTransform& orientation) +void CParticleElectric::SetOrientation(const zeus::CTransform& orientation) { x44_orientation = orientation; x438_28 = true; } -void CParticleElectric::SetTranslation(const Zeus::CVector3f& translation) +void CParticleElectric::SetTranslation(const zeus::CVector3f& translation) { x38_translation = translation; x438_28 = true; } -void CParticleElectric::SetGlobalOrientation(const Zeus::CTransform& orientation) +void CParticleElectric::SetGlobalOrientation(const zeus::CTransform& orientation) { xb0_globalOrientation = orientation; x438_28 = true; } -void CParticleElectric::SetGlobalTranslation(const Zeus::CVector3f& translation) +void CParticleElectric::SetGlobalTranslation(const zeus::CVector3f& translation) { xa4_globalTranslation = translation; x438_28 = true; } -void CParticleElectric::SetGlobalScale(const Zeus::CVector3f& scale) +void CParticleElectric::SetGlobalScale(const zeus::CVector3f& scale) { xe0_globalScale = scale; x438_28 = true; } -void CParticleElectric::SetLocalScale(const Zeus::CVector3f& scale) +void CParticleElectric::SetLocalScale(const zeus::CVector3f& scale) { xec_localScale = scale; x438_28 = true; @@ -95,7 +95,7 @@ void CParticleElectric::SetParticleEmission(bool) { } -void CParticleElectric::SetModulationColor(const Zeus::CColor& color) +void CParticleElectric::SetModulationColor(const zeus::CColor& color) { if (!x1bc_hasModuColor) x1bc_hasModuColor = true; @@ -104,35 +104,35 @@ void CParticleElectric::SetModulationColor(const Zeus::CColor& color) /* TODO: Add child particle systems */ } -const Zeus::CTransform& CParticleElectric::GetOrientation() const +const zeus::CTransform& CParticleElectric::GetOrientation() const { return x44_orientation; } -const Zeus::CVector3f& CParticleElectric::GetTranslation() const +const zeus::CVector3f& CParticleElectric::GetTranslation() const { return x38_translation; } -const Zeus::CTransform& CParticleElectric::GetGlobalOrientation() const +const zeus::CTransform& CParticleElectric::GetGlobalOrientation() const { return xb0_globalOrientation; } -const Zeus::CVector3f& CParticleElectric::GetGlobalTranslation() const +const zeus::CVector3f& CParticleElectric::GetGlobalTranslation() const { return xa4_globalTranslation; } -const Zeus::CVector3f& CParticleElectric::GetGlobalScale() const +const zeus::CVector3f& CParticleElectric::GetGlobalScale() const { return xe0_globalScale; } -const Zeus::CColor& CParticleElectric::GetModulationColor() const +const zeus::CColor& CParticleElectric::GetModulationColor() const { if (!x1bc_hasModuColor) - return Zeus::CColor::skWhite; + return zeus::CColor::skWhite; return x1b8_moduColor; } @@ -141,9 +141,9 @@ bool CParticleElectric::IsSystemDeletable() const return false; } -std::pair CParticleElectric::GetBounds() const +std::pair CParticleElectric::GetBounds() const { - return std::make_pair(Zeus::CAABox(), false); + return std::make_pair(zeus::CAABox(), false); } u32 CParticleElectric::GetParticleCount() const diff --git a/Runtime/Particle/CParticleElectric.hpp b/Runtime/Particle/CParticleElectric.hpp index 001442f34..e7bd7f9f1 100644 --- a/Runtime/Particle/CParticleElectric.hpp +++ b/Runtime/Particle/CParticleElectric.hpp @@ -5,7 +5,7 @@ #include "CToken.hpp" #include "CRandom16.hpp" -namespace pshag +namespace urde { class CElectricDescription; @@ -21,25 +21,25 @@ private: u32 x28 = 0; u32 x2c = 0; double x30 = 0.0; - Zeus::CVector3f x38_translation; - Zeus::CTransform x44_orientation; - Zeus::CVector3f xa4_globalTranslation; - Zeus::CTransform xb0_globalOrientation; - Zeus::CVector3f xe0_globalScale; - Zeus::CVector3f xec_localScale; + zeus::CVector3f x38_translation; + zeus::CTransform x44_orientation; + zeus::CVector3f xa4_globalTranslation; + zeus::CTransform xb0_globalOrientation; + zeus::CVector3f xe0_globalScale; + zeus::CVector3f xec_localScale; float x128 = 0.f; float x12c = 0.f; - Zeus::CVector3f x130; + zeus::CVector3f x130; CRandom16 x14c_randState; u32 x150 = 0; u32 x154 = 1; u32 x158 = 0; float x15c = 0.f; - Zeus::CAABox x160_systemBounds = Zeus::CAABox::skInvertedBox; + zeus::CAABox x160_systemBounds = zeus::CAABox::skInvertedBox; bool x184 = false; bool x194 = false; bool x1b4 = false; - Zeus::CColor x1b8_moduColor; + zeus::CColor x1b8_moduColor; bool x1bc_hasModuColor = false; rstl::reserved_vector, 32> x1c0_lineManagers; @@ -57,22 +57,22 @@ public: void RenderLines(); void Update(double); void Render(); - void SetOrientation(const Zeus::CTransform&); - void SetTranslation(const Zeus::CVector3f&); - void SetGlobalOrientation(const Zeus::CTransform&); - void SetGlobalTranslation(const Zeus::CVector3f&); - void SetGlobalScale(const Zeus::CVector3f&); - void SetLocalScale(const Zeus::CVector3f&); + void SetOrientation(const zeus::CTransform&); + void SetTranslation(const zeus::CVector3f&); + void SetGlobalOrientation(const zeus::CTransform&); + void SetGlobalTranslation(const zeus::CVector3f&); + void SetGlobalScale(const zeus::CVector3f&); + void SetLocalScale(const zeus::CVector3f&); void SetParticleEmission(bool); - void SetModulationColor(const Zeus::CColor&); - const Zeus::CTransform& GetOrientation() const; - const Zeus::CVector3f& GetTranslation() const; - const Zeus::CTransform& GetGlobalOrientation() const; - const Zeus::CVector3f& GetGlobalTranslation() const; - const Zeus::CVector3f& GetGlobalScale() const; - const Zeus::CColor& GetModulationColor() const; + void SetModulationColor(const zeus::CColor&); + const zeus::CTransform& GetOrientation() const; + const zeus::CVector3f& GetTranslation() const; + const zeus::CTransform& GetGlobalOrientation() const; + const zeus::CVector3f& GetGlobalTranslation() const; + const zeus::CVector3f& GetGlobalScale() const; + const zeus::CColor& GetModulationColor() const; bool IsSystemDeletable() const; - std::pair GetBounds() const; + std::pair GetBounds() const; u32 GetParticleCount() const; bool SystemHasLight() const; CLight GetLight() const; diff --git a/Runtime/Particle/CParticleElectricDataFactory.cpp b/Runtime/Particle/CParticleElectricDataFactory.cpp index 47e548736..956c334f1 100644 --- a/Runtime/Particle/CParticleElectricDataFactory.cpp +++ b/Runtime/Particle/CParticleElectricDataFactory.cpp @@ -2,14 +2,14 @@ #include "CSwooshDescription.hpp" #include "CElectricDescription.hpp" #include "CGenDescription.hpp" -#include "CModel.hpp" +#include "Graphics/CModel.hpp" #include "CToken.hpp" #include "CSimplePool.hpp" #include "CRandom16.hpp" -namespace pshag +namespace urde { -static LogVisor::LogModule Log("pshag::CParticleElectricDataFactory"); +static logvisor::Module Log("urde::CParticleElectricDataFactory"); using CPF = CParticleDataFactory; @@ -113,7 +113,7 @@ bool CParticleElectricDataFactory::CreateELSM(CElectricDescription *desc, CInput default: { uint32_t clsName = clsId.toUint32(); - Log.report(LogVisor::FatalError, "Unknown ELSM class %.4s @%" PRIi64, &clsName, in.position()); + Log.report(logvisor::Fatal, "Unknown ELSM class %.4s @%" PRIi64, &clsName, in.position()); return false; } } diff --git a/Runtime/Particle/CParticleElectricDataFactory.hpp b/Runtime/Particle/CParticleElectricDataFactory.hpp index a466e2400..3740f00d9 100644 --- a/Runtime/Particle/CParticleElectricDataFactory.hpp +++ b/Runtime/Particle/CParticleElectricDataFactory.hpp @@ -6,7 +6,7 @@ #include "CToken.hpp" #include "IOStreams.hpp" -namespace pshag +namespace urde { class CElectricDescription; class CSimplePool; diff --git a/Runtime/Particle/CParticleGen.cpp b/Runtime/Particle/CParticleGen.cpp index a4005427f..0aa609611 100644 --- a/Runtime/Particle/CParticleGen.cpp +++ b/Runtime/Particle/CParticleGen.cpp @@ -1,6 +1,6 @@ #include "CParticleGen.hpp" -namespace pshag +namespace urde { void CParticleGen::AddModifier(CWarp* mod) diff --git a/Runtime/Particle/CParticleGen.hpp b/Runtime/Particle/CParticleGen.hpp index 03057da50..557b0e180 100644 --- a/Runtime/Particle/CParticleGen.hpp +++ b/Runtime/Particle/CParticleGen.hpp @@ -2,15 +2,15 @@ #define __PSHAG_CPARTICLEGEN_HPP__ #include "RetroTypes.hpp" -#include "CLight.hpp" +#include "Graphics/CLight.hpp" #include "CWarp.hpp" -#include "CColor.hpp" -#include "CVector3f.hpp" -#include "CTransform.hpp" -#include "CAABox.hpp" +#include "zeus/CColor.hpp" +#include "zeus/CVector3f.hpp" +#include "zeus/CTransform.hpp" +#include "zeus/CAABox.hpp" #include -namespace pshag +namespace urde { class CParticleGen @@ -21,22 +21,22 @@ public: virtual void Update(double)=0; virtual void Render()=0; - virtual void SetOrientation(const Zeus::CTransform&)=0; - virtual void SetTranslation(const Zeus::CVector3f&)=0; - virtual void SetGlobalOrientation(const Zeus::CTransform&)=0; - virtual void SetGlobalTranslation(const Zeus::CVector3f&)=0; - virtual void SetGlobalScale(const Zeus::CVector3f&)=0; - virtual void SetLocalScale(const Zeus::CVector3f&)=0; + virtual void SetOrientation(const zeus::CTransform&)=0; + virtual void SetTranslation(const zeus::CVector3f&)=0; + virtual void SetGlobalOrientation(const zeus::CTransform&)=0; + virtual void SetGlobalTranslation(const zeus::CVector3f&)=0; + virtual void SetGlobalScale(const zeus::CVector3f&)=0; + virtual void SetLocalScale(const zeus::CVector3f&)=0; virtual void SetParticleEmission(bool)=0; - virtual void SetModulationColor(const Zeus::CColor&)=0; - virtual const Zeus::CTransform& GetOrientation() const=0; - virtual const Zeus::CVector3f& GetTranslation() const=0; - virtual const Zeus::CTransform& GetGlobalOrientation() const=0; - virtual const Zeus::CVector3f& GetGlobalTranslation() const=0; - virtual const Zeus::CVector3f& GetGlobalScale() const=0; - virtual const Zeus::CColor& GetModulationColor() const=0; + virtual void SetModulationColor(const zeus::CColor&)=0; + virtual const zeus::CTransform& GetOrientation() const=0; + virtual const zeus::CVector3f& GetTranslation() const=0; + virtual const zeus::CTransform& GetGlobalOrientation() const=0; + virtual const zeus::CVector3f& GetGlobalTranslation() const=0; + virtual const zeus::CVector3f& GetGlobalScale() const=0; + virtual const zeus::CColor& GetModulationColor() const=0; virtual bool IsSystemDeletable() const=0; - virtual std::pair GetBounds() const=0; + virtual std::pair GetBounds() const=0; virtual u32 GetParticleCount() const=0; virtual bool SystemHasLight() const=0; virtual CLight GetLight() const=0; diff --git a/Runtime/Particle/CParticleGlobals.cpp b/Runtime/Particle/CParticleGlobals.cpp index c23c94ee4..2b8b41092 100644 --- a/Runtime/Particle/CParticleGlobals.cpp +++ b/Runtime/Particle/CParticleGlobals.cpp @@ -1,6 +1,6 @@ #include "CParticleGlobals.hpp" -namespace pshag +namespace urde { int CParticleGlobals::g_EmitterTime = 0; diff --git a/Runtime/Particle/CParticleGlobals.hpp b/Runtime/Particle/CParticleGlobals.hpp index 33b4c2c42..83925f1e4 100644 --- a/Runtime/Particle/CParticleGlobals.hpp +++ b/Runtime/Particle/CParticleGlobals.hpp @@ -1,11 +1,11 @@ #ifndef __PSHAG_CPARTICLEGLOBALS_HPP__ #define __PSHAG_CPARTICLEGLOBALS_HPP__ -#include "CVector3f.hpp" -#include "CColor.hpp" +#include "zeus/CVector3f.hpp" +#include "zeus/CColor.hpp" #include "RetroTypes.hpp" -namespace pshag +namespace urde { class CParticleGen; class CParticleGlobals diff --git a/Runtime/Particle/CParticleSwoosh.cpp b/Runtime/Particle/CParticleSwoosh.cpp index d07fdb2eb..d8cd7ad3d 100644 --- a/Runtime/Particle/CParticleSwoosh.cpp +++ b/Runtime/Particle/CParticleSwoosh.cpp @@ -1,6 +1,6 @@ #include "CParticleSwoosh.hpp" -namespace pshag +namespace urde { CParticleSwoosh::CParticleSwoosh(const TToken& desc, int) @@ -15,27 +15,27 @@ void CParticleSwoosh::Render() { } -void CParticleSwoosh::SetOrientation(const Zeus::CTransform&) +void CParticleSwoosh::SetOrientation(const zeus::CTransform&) { } -void CParticleSwoosh::SetTranslation(const Zeus::CVector3f&) +void CParticleSwoosh::SetTranslation(const zeus::CVector3f&) { } -void CParticleSwoosh::SetGlobalOrientation(const Zeus::CTransform&) +void CParticleSwoosh::SetGlobalOrientation(const zeus::CTransform&) { } -void CParticleSwoosh::SetGlobalTranslation(const Zeus::CVector3f&) +void CParticleSwoosh::SetGlobalTranslation(const zeus::CVector3f&) { } -void CParticleSwoosh::SetGlobalScale(const Zeus::CVector3f&) +void CParticleSwoosh::SetGlobalScale(const zeus::CVector3f&) { } -void CParticleSwoosh::SetLocalScale(const Zeus::CVector3f&) +void CParticleSwoosh::SetLocalScale(const zeus::CVector3f&) { } @@ -43,43 +43,43 @@ void CParticleSwoosh::SetParticleEmission(bool) { } -void CParticleSwoosh::SetModulationColor(const Zeus::CColor&) +void CParticleSwoosh::SetModulationColor(const zeus::CColor&) { } -const Zeus::CTransform& CParticleSwoosh::GetOrientation() const +const zeus::CTransform& CParticleSwoosh::GetOrientation() const { - static Zeus::CTransform dummy; + static zeus::CTransform dummy; return dummy; } -const Zeus::CVector3f& CParticleSwoosh::GetTranslation() const +const zeus::CVector3f& CParticleSwoosh::GetTranslation() const { - static Zeus::CVector3f dummy; + static zeus::CVector3f dummy; return dummy; } -const Zeus::CTransform& CParticleSwoosh::GetGlobalOrientation() const +const zeus::CTransform& CParticleSwoosh::GetGlobalOrientation() const { - static Zeus::CTransform dummy; + static zeus::CTransform dummy; return dummy; } -const Zeus::CVector3f& CParticleSwoosh::GetGlobalTranslation() const +const zeus::CVector3f& CParticleSwoosh::GetGlobalTranslation() const { - static Zeus::CVector3f dummy; + static zeus::CVector3f dummy; return dummy; } -const Zeus::CVector3f& CParticleSwoosh::GetGlobalScale() const +const zeus::CVector3f& CParticleSwoosh::GetGlobalScale() const { - static Zeus::CVector3f dummy; + static zeus::CVector3f dummy; return dummy; } -const Zeus::CColor& CParticleSwoosh::GetModulationColor() const +const zeus::CColor& CParticleSwoosh::GetModulationColor() const { - static Zeus::CColor dummy; + static zeus::CColor dummy; return dummy; } @@ -88,9 +88,9 @@ bool CParticleSwoosh::IsSystemDeletable() const return false; } -std::pair CParticleSwoosh::GetBounds() const +std::pair CParticleSwoosh::GetBounds() const { - return std::make_pair(Zeus::CAABox(), false); + return std::make_pair(zeus::CAABox(), false); } u32 CParticleSwoosh::GetParticleCount() const diff --git a/Runtime/Particle/CParticleSwoosh.hpp b/Runtime/Particle/CParticleSwoosh.hpp index 2a4b578eb..d526e60a2 100644 --- a/Runtime/Particle/CParticleSwoosh.hpp +++ b/Runtime/Particle/CParticleSwoosh.hpp @@ -4,7 +4,7 @@ #include "CParticleGen.hpp" #include "CToken.hpp" -namespace pshag +namespace urde { class CSwooshDescription; @@ -15,22 +15,22 @@ public: void Update(double); void Render(); - void SetOrientation(const Zeus::CTransform&); - void SetTranslation(const Zeus::CVector3f&); - void SetGlobalOrientation(const Zeus::CTransform&); - void SetGlobalTranslation(const Zeus::CVector3f&); - void SetGlobalScale(const Zeus::CVector3f&); - void SetLocalScale(const Zeus::CVector3f&); + void SetOrientation(const zeus::CTransform&); + void SetTranslation(const zeus::CVector3f&); + void SetGlobalOrientation(const zeus::CTransform&); + void SetGlobalTranslation(const zeus::CVector3f&); + void SetGlobalScale(const zeus::CVector3f&); + void SetLocalScale(const zeus::CVector3f&); void SetParticleEmission(bool); - void SetModulationColor(const Zeus::CColor&); - const Zeus::CTransform& GetOrientation() const; - const Zeus::CVector3f& GetTranslation() const; - const Zeus::CTransform& GetGlobalOrientation() const; - const Zeus::CVector3f& GetGlobalTranslation() const; - const Zeus::CVector3f& GetGlobalScale() const; - const Zeus::CColor& GetModulationColor() const; + void SetModulationColor(const zeus::CColor&); + const zeus::CTransform& GetOrientation() const; + const zeus::CVector3f& GetTranslation() const; + const zeus::CTransform& GetGlobalOrientation() const; + const zeus::CVector3f& GetGlobalTranslation() const; + const zeus::CVector3f& GetGlobalScale() const; + const zeus::CColor& GetModulationColor() const; bool IsSystemDeletable() const; - std::pair GetBounds() const; + std::pair GetBounds() const; u32 GetParticleCount() const; bool SystemHasLight() const; CLight GetLight() const; diff --git a/Runtime/Particle/CParticleSwooshDataFactory.cpp b/Runtime/Particle/CParticleSwooshDataFactory.cpp index f4cc0759c..8feaea22e 100644 --- a/Runtime/Particle/CParticleSwooshDataFactory.cpp +++ b/Runtime/Particle/CParticleSwooshDataFactory.cpp @@ -2,13 +2,13 @@ #include "CSwooshDescription.hpp" #include "CElectricDescription.hpp" #include "CGenDescription.hpp" -#include "CModel.hpp" +#include "Graphics/CModel.hpp" #include "CRandom16.hpp" #include "CSimplePool.hpp" -namespace pshag +namespace urde { -static LogVisor::LogModule Log("pshag::CParticleSwooshDataFactory"); +static logvisor::Module Log("urde::CParticleSwooshDataFactory"); using CPF = CParticleDataFactory; @@ -127,7 +127,7 @@ bool CParticleSwooshDataFactory::CreateWPSM(CSwooshDescription* desc, CInputStre default: { uint32_t clsName = clsId.toUint32(); - Log.report(LogVisor::FatalError, "Unknown SWSH class %.4s @%" PRIi64, &clsName, in.position()); + Log.report(logvisor::Fatal, "Unknown SWSH class %.4s @%" PRIi64, &clsName, in.position()); return false; } } @@ -137,7 +137,7 @@ bool CParticleSwooshDataFactory::CreateWPSM(CSwooshDescription* desc, CInputStre return true; } -std::unique_ptr FParticleSwooshDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms) +std::unique_ptr FParticleSwooshDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms) { CSimplePool* sp = static_cast(static_cast*>(vparms.GetObj())->GetParam()); return TToken::GetIObjObjectFor(std::unique_ptr(CParticleSwooshDataFactory::GetGeneratorDesc(in, sp))); diff --git a/Runtime/Particle/CParticleSwooshDataFactory.hpp b/Runtime/Particle/CParticleSwooshDataFactory.hpp index 151a2ad66..52a59d39a 100644 --- a/Runtime/Particle/CParticleSwooshDataFactory.hpp +++ b/Runtime/Particle/CParticleSwooshDataFactory.hpp @@ -6,7 +6,7 @@ #include "CToken.hpp" #include "IOStreams.hpp" -namespace pshag +namespace urde { class CSwooshDescription; class CSimplePool; diff --git a/Runtime/Particle/CProjectileWeaponDataFactory.cpp b/Runtime/Particle/CProjectileWeaponDataFactory.cpp index d32a03a45..50d67a5c1 100644 --- a/Runtime/Particle/CProjectileWeaponDataFactory.cpp +++ b/Runtime/Particle/CProjectileWeaponDataFactory.cpp @@ -4,13 +4,13 @@ #include "CElectricDescription.hpp" #include "CSwooshDescription.hpp" #include "CGenDescription.hpp" -#include "CModel.hpp" +#include "Graphics/CModel.hpp" #include "CRandom16.hpp" #include "CSimplePool.hpp" -namespace pshag +namespace urde { -static LogVisor::LogModule Log("pshag::CProjectileWeaponDataFactory"); +static logvisor::Module Log("urde::CProjectileWeaponDataFactory"); using CPF = CParticleDataFactory; @@ -149,7 +149,7 @@ bool CProjectileWeaponDataFactory::CreateWPSM(CWeaponDescription* desc, CInputSt default: { uint32_t clsName = clsId.toUint32(); - Log.report(LogVisor::FatalError, "Unknown WPSM class %.4s @%" PRIi64, &clsName, in.position()); + Log.report(logvisor::Fatal, "Unknown WPSM class %.4s @%" PRIi64, &clsName, in.position()); return false; } } diff --git a/Runtime/Particle/CProjectileWeaponDataFactory.hpp b/Runtime/Particle/CProjectileWeaponDataFactory.hpp index 1b4a5f5ea..0e3d331c4 100644 --- a/Runtime/Particle/CProjectileWeaponDataFactory.hpp +++ b/Runtime/Particle/CProjectileWeaponDataFactory.hpp @@ -6,7 +6,7 @@ #include "CToken.hpp" #include "IOStreams.hpp" -namespace pshag +namespace urde { class CWeaponDescription; class CSimplePool; diff --git a/Runtime/Particle/CRealElement.cpp b/Runtime/Particle/CRealElement.cpp index 471faa5fc..a1451f9bd 100644 --- a/Runtime/Particle/CRealElement.cpp +++ b/Runtime/Particle/CRealElement.cpp @@ -2,11 +2,11 @@ #include "CParticleGlobals.hpp" #include "CRandom16.hpp" #include "CElementGen.hpp" -#include +#include "zeus/Math.hpp" /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Real_Elements */ -namespace pshag +namespace urde { CREKeyframeEmitter::CREKeyframeEmitter(CInputStream& in) @@ -133,7 +133,7 @@ bool CRERandom::GetValue(int frame, float& valOut) const bool CREDotProduct::GetValue(int frame, float& valOut) const { - Zeus::CVector3f a, b; + zeus::CVector3f a, b; x4_a->GetValue(frame, a); x8_b->GetValue(frame, b); valOut = a.dot(b); @@ -194,7 +194,7 @@ bool CRESineWave::GetValue(int frame, float& valOut) const x4_magnitude->GetValue(frame, a); x8_linearFrame->GetValue(frame, b); xc_constantFrame->GetValue(frame, c); - valOut = sinf((frame * b + c) * M_PI / 180.f) * a; + valOut = std::sin(zeus::degToRad(frame * b + c)) * a; return false; } @@ -224,7 +224,7 @@ bool CRECompareEquals::GetValue(int frame, float& valOut) const float a, b; x4_a->GetValue(frame, a); x8_b->GetValue(frame, b); - if (fabsf(a-b) < 0.00001) + if (std::fabs(a-b) < 0.00001f) xc_c->GetValue(frame, valOut); else x10_d->GetValue(frame, valOut); @@ -302,7 +302,7 @@ bool CRESubtract::GetValue(int frame, float& valOut) const bool CREVectorMagnitude::GetValue(int frame, float& valOut) const { - Zeus::CVector3f a; + zeus::CVector3f a; x4_a->GetValue(frame, a); valOut = a.magnitude(); return false; @@ -310,7 +310,7 @@ bool CREVectorMagnitude::GetValue(int frame, float& valOut) const bool CREVectorXToReal::GetValue(int frame, float& valOut) const { - Zeus::CVector3f a; + zeus::CVector3f a; x4_a->GetValue(frame, a); valOut = a[0]; return false; @@ -318,7 +318,7 @@ bool CREVectorXToReal::GetValue(int frame, float& valOut) const bool CREVectorYToReal::GetValue(int frame, float& valOut) const { - Zeus::CVector3f a; + zeus::CVector3f a; x4_a->GetValue(frame, a); valOut = a[1]; return false; @@ -326,7 +326,7 @@ bool CREVectorYToReal::GetValue(int frame, float& valOut) const bool CREVectorZToReal::GetValue(int frame, float& valOut) const { - Zeus::CVector3f a; + zeus::CVector3f a; x4_a->GetValue(frame, a); valOut = a[2]; return false; @@ -368,7 +368,7 @@ bool CREConstantRange::GetValue(int frame, float& valOut) const bool CREGetComponentRed::GetValue(int frame, float& valOut) const { - Zeus::CColor a = Zeus::CColor::skBlack; + zeus::CColor a = zeus::CColor::skBlack; x4_a->GetValue(frame, a); valOut = a.r; return false; @@ -376,7 +376,7 @@ bool CREGetComponentRed::GetValue(int frame, float& valOut) const bool CREGetComponentGreen::GetValue(int frame, float& valOut) const { - Zeus::CColor a = Zeus::CColor::skBlack; + zeus::CColor a = zeus::CColor::skBlack; x4_a->GetValue(frame, a); valOut = a.g; return false; @@ -384,7 +384,7 @@ bool CREGetComponentGreen::GetValue(int frame, float& valOut) const bool CREGetComponentBlue::GetValue(int frame, float& valOut) const { - Zeus::CColor a = Zeus::CColor::skBlack; + zeus::CColor a = zeus::CColor::skBlack; x4_a->GetValue(frame, a); valOut = a.b; return false; @@ -392,7 +392,7 @@ bool CREGetComponentBlue::GetValue(int frame, float& valOut) const bool CREGetComponentAlpha::GetValue(int frame, float& valOut) const { - Zeus::CColor a = Zeus::CColor::skBlack; + zeus::CColor a = zeus::CColor::skBlack; x4_a->GetValue(frame, a); valOut = a.a; return false; diff --git a/Runtime/Particle/CRealElement.hpp b/Runtime/Particle/CRealElement.hpp index b53d08a43..a9a37cce8 100644 --- a/Runtime/Particle/CRealElement.hpp +++ b/Runtime/Particle/CRealElement.hpp @@ -5,7 +5,7 @@ /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Real_Elements */ -namespace pshag +namespace urde { class CREKeyframeEmitter : public CRealElement diff --git a/Runtime/Particle/CSpawnSystemKeyframeData.cpp b/Runtime/Particle/CSpawnSystemKeyframeData.cpp index 6513f497c..05f1fae36 100644 --- a/Runtime/Particle/CSpawnSystemKeyframeData.cpp +++ b/Runtime/Particle/CSpawnSystemKeyframeData.cpp @@ -2,10 +2,10 @@ #include "CGenDescription.hpp" #include "CSwooshDescription.hpp" #include "CElectricDescription.hpp" -#include "CModel.hpp" +#include "Graphics/CModel.hpp" #include "CSimplePool.hpp" -namespace pshag +namespace urde { CSpawnSystemKeyframeData::CSpawnSystemKeyframeData(CInputStream& in) diff --git a/Runtime/Particle/CSpawnSystemKeyframeData.hpp b/Runtime/Particle/CSpawnSystemKeyframeData.hpp index 6ec8957a5..8f016bf78 100644 --- a/Runtime/Particle/CSpawnSystemKeyframeData.hpp +++ b/Runtime/Particle/CSpawnSystemKeyframeData.hpp @@ -4,7 +4,7 @@ #include "IOStreams.hpp" #include "CToken.hpp" -namespace pshag +namespace urde { class CSimplePool; class CGenDescription; diff --git a/Runtime/Particle/CSwooshDescription.hpp b/Runtime/Particle/CSwooshDescription.hpp index 32b2ff930..eb1479dab 100644 --- a/Runtime/Particle/CSwooshDescription.hpp +++ b/Runtime/Particle/CSwooshDescription.hpp @@ -9,7 +9,7 @@ #include "CColorElement.hpp" #include "CUVElement.hpp" -namespace pshag +namespace urde { class CSwooshDescription { diff --git a/Runtime/Particle/CUVElement.cpp b/Runtime/Particle/CUVElement.cpp index 7e3efe112..bc85bf057 100644 --- a/Runtime/Particle/CUVElement.cpp +++ b/Runtime/Particle/CUVElement.cpp @@ -2,7 +2,7 @@ /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#UV_Elements */ -namespace pshag +namespace urde { CUVEAnimTexture::CUVEAnimTexture(TToken&& tex, CIntElement* a, CIntElement* b, diff --git a/Runtime/Particle/CUVElement.hpp b/Runtime/Particle/CUVElement.hpp index d03749191..85c31b962 100644 --- a/Runtime/Particle/CUVElement.hpp +++ b/Runtime/Particle/CUVElement.hpp @@ -3,11 +3,11 @@ #include "IElement.hpp" #include "CToken.hpp" -#include "CTexture.hpp" +#include "Graphics/CTexture.hpp" /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#UV_Elements */ -namespace pshag +namespace urde { class CToken; diff --git a/Runtime/Particle/CVectorElement.cpp b/Runtime/Particle/CVectorElement.cpp index 0441bb5df..9a4d930b2 100644 --- a/Runtime/Particle/CVectorElement.cpp +++ b/Runtime/Particle/CVectorElement.cpp @@ -2,11 +2,11 @@ #include "CParticleGlobals.hpp" #include "CRandom16.hpp" #include "CElementGen.hpp" -#include +#include "zeus/Math.hpp" /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Vector_Elements */ -namespace pshag +namespace urde { CVEKeyframeEmitter::CVEKeyframeEmitter(CInputStream& in) @@ -24,7 +24,7 @@ CVEKeyframeEmitter::CVEKeyframeEmitter(CInputStream& in) x18_keys.push_back(in.readVec3fBig()); } -bool CVEKeyframeEmitter::GetValue(int frame, Zeus::CVector3f& valOut) const +bool CVEKeyframeEmitter::GetValue(int frame, zeus::CVector3f& valOut) const { if (!x4_percent) { @@ -63,21 +63,21 @@ bool CVEKeyframeEmitter::GetValue(int frame, Zeus::CVector3f& valOut) const CVECone::CVECone(CVectorElement* a, CRealElement* b) : x4_direction(a), x8_magnitude(b) { - Zeus::CVector3f av; + zeus::CVector3f av; x4_direction->GetValue(0, av); av.normalize(); if (av[0] > 0.8) - xc_xVec = av.cross(Zeus::CVector3f(0.f, 1.f, 0.f)); + xc_xVec = av.cross(zeus::CVector3f(0.f, 1.f, 0.f)); else - xc_xVec = av.cross(Zeus::CVector3f(1.f, 0.f, 0.f)); + xc_xVec = av.cross(zeus::CVector3f(1.f, 0.f, 0.f)); x18_yVec = av.cross(xc_xVec); } -bool CVECone::GetValue(int frame, Zeus::CVector3f& valOut) const +bool CVECone::GetValue(int frame, zeus::CVector3f& valOut) const { float b; x8_magnitude->GetValue(frame, b); - Zeus::CVector3f dir; + zeus::CVector3f dir; x4_direction->GetValue(frame, dir); float b2 = std::min(1.f, b); @@ -94,7 +94,7 @@ bool CVECone::GetValue(int frame, Zeus::CVector3f& valOut) const return false; } -bool CVETimeChain::GetValue(int frame, Zeus::CVector3f& valOut) const +bool CVETimeChain::GetValue(int frame, zeus::CVector3f& valOut) const { int v; xc_swFrame->GetValue(frame, v); @@ -104,7 +104,7 @@ bool CVETimeChain::GetValue(int frame, Zeus::CVector3f& valOut) const return x4_a->GetValue(frame, valOut); } -bool CVEAngleCone::GetValue(int frame, Zeus::CVector3f& valOut) const +bool CVEAngleCone::GetValue(int frame, zeus::CVector3f& valOut) const { float xc, yc, xr, yr; x4_angleXConstant->GetValue(frame, xc); @@ -113,22 +113,22 @@ bool CVEAngleCone::GetValue(int frame, Zeus::CVector3f& valOut) const x10_angleYRange->GetValue(frame, yr); float xtmp = CRandom16::GetRandomNumber()->Float() * xr; - float xang = (0.5f * xr - xtmp + xc) * M_PI / 180.f; + float xang = zeus::degToRad(0.5f * xr - xtmp + xc); float ytmp = CRandom16::GetRandomNumber()->Float() * yr; - float yang = (0.5f * yr - ytmp + yc) * M_PI / 180.f; + float yang = zeus::degToRad(0.5f * yr - ytmp + yc); float mag; x14_magnitude->GetValue(frame, mag); /* This takes a +Z vector and rotates it around X and Y axis (like a rotation matrix would) */ - valOut = Zeus::CVector3f(cosf(xang) * -sinf(yang), sinf(xang), cosf(xang) * cosf(yang)) * Zeus::CVector3f(mag); + valOut = zeus::CVector3f(std::cos(xang) * -std::sin(yang), std::sin(xang), std::cos(xang) * std::cos(yang)) * zeus::CVector3f(mag); return false; } -bool CVEAdd::GetValue(int frame, Zeus::CVector3f& valOut) const +bool CVEAdd::GetValue(int frame, zeus::CVector3f& valOut) const { - Zeus::CVector3f a, b; + zeus::CVector3f a, b; x4_a->GetValue(frame, a); x8_b->GetValue(frame, b); valOut = a + b; @@ -140,36 +140,36 @@ CVECircleCluster::CVECircleCluster(CVectorElement* a, CVectorElement* b, CIntEle { int cv; c->GetValue(0, cv); - x20_deltaAngle = 360.f / float(cv) * M_PI / 180.f; + x20_deltaAngle = zeus::degToRad(360.f / float(cv)); - Zeus::CVector3f bv; + zeus::CVector3f bv; b->GetValue(0, bv); bv.normalize(); - if (bv[0] > 0.8) - x8_xVec = bv.cross(Zeus::CVector3f(0.f, 1.f, 0.f)); + if (bv[0] > 0.8f) + x8_xVec = bv.cross(zeus::CVector3f(0.f, 1.f, 0.f)); else - x8_xVec = bv.cross(Zeus::CVector3f(1.f, 0.f, 0.f)); + x8_xVec = bv.cross(zeus::CVector3f(1.f, 0.f, 0.f)); x14_yVec = bv.cross(x8_xVec); delete b; delete c; } -bool CVECircleCluster::GetValue(int frame, Zeus::CVector3f& valOut) const +bool CVECircleCluster::GetValue(int frame, zeus::CVector3f& valOut) const { - Zeus::CVector3f av; + zeus::CVector3f av; x4_a->GetValue(frame, av); float curAngle = frame * x20_deltaAngle; - Zeus::CVector3f x = x8_xVec * cosf(curAngle); - Zeus::CVector3f y = x14_yVec * sinf(curAngle); - Zeus::CVector3f tv = x + y + av; + zeus::CVector3f x = x8_xVec * std::cos(curAngle); + zeus::CVector3f y = x14_yVec * std::sin(curAngle); + zeus::CVector3f tv = x + y + av; float dv; x24_magnitude->GetValue(frame, dv); - Zeus::CVector3f magVec(dv * tv.magnitude()); - Zeus::CVector3f rv = magVec * Zeus::CVector3f(CRandom16::GetRandomNumber()->Float(), + zeus::CVector3f magVec(dv * tv.magnitude()); + zeus::CVector3f rv = magVec * zeus::CVector3f(CRandom16::GetRandomNumber()->Float(), CRandom16::GetRandomNumber()->Float(), CRandom16::GetRandomNumber()->Float()); @@ -177,17 +177,17 @@ bool CVECircleCluster::GetValue(int frame, Zeus::CVector3f& valOut) const return false; } -bool CVEConstant::GetValue(int frame, Zeus::CVector3f& valOut) const +bool CVEConstant::GetValue(int frame, zeus::CVector3f& valOut) const { float a, b, c; x4_a->GetValue(frame, a); x8_b->GetValue(frame, b); xc_c->GetValue(frame, c); - valOut = Zeus::CVector3f(a, b, c); + valOut = zeus::CVector3f(a, b, c); return false; } -bool CVEFastConstant::GetValue(int frame, Zeus::CVector3f& valOut) const +bool CVEFastConstant::GetValue(int frame, zeus::CVector3f& valOut) const { valOut = x4_val; return false; @@ -196,54 +196,54 @@ bool CVEFastConstant::GetValue(int frame, Zeus::CVector3f& valOut) const CVECircle::CVECircle(CVectorElement* a, CVectorElement* b, CRealElement* c, CRealElement* d, CRealElement* e) : x4_direction(a), x20_angleConstant(c), x24_angleLinear(d), x28_radius(e) { - Zeus::CVector3f bv; + zeus::CVector3f bv; b->GetValue(0, bv); bv.normalize(); - if (bv[0] > 0.8) - x8_xVec = bv.cross(Zeus::CVector3f(0.f, 1.f, 0.f)); + if (bv[0] > 0.8f) + x8_xVec = bv.cross(zeus::CVector3f(0.f, 1.f, 0.f)); else - x8_xVec = bv.cross(Zeus::CVector3f(1.f, 0.f, 0.f)); + x8_xVec = bv.cross(zeus::CVector3f(1.f, 0.f, 0.f)); x14_yVec = bv.cross(x8_xVec); delete b; } -bool CVECircle::GetValue(int frame, Zeus::CVector3f& valOut) const +bool CVECircle::GetValue(int frame, zeus::CVector3f& valOut) const { float c, d, e; x20_angleConstant->GetValue(frame, c); x24_angleLinear->GetValue(frame, d); x28_radius->GetValue(frame, e); - float curAngle = (d * frame + c) * M_PI / 180.f; + float curAngle = zeus::degToRad(d * frame + c); - Zeus::CVector3f av; + zeus::CVector3f av; x4_direction->GetValue(frame, av); - Zeus::CVector3f x = x8_xVec * e * cosf(curAngle); - Zeus::CVector3f y = x14_yVec * e * sinf(curAngle); + zeus::CVector3f x = x8_xVec * e * std::cos(curAngle); + zeus::CVector3f y = x14_yVec * e * std::sin(curAngle); valOut = x + y + av; return false; } -bool CVEMultiply::GetValue(int frame, Zeus::CVector3f& valOut) const +bool CVEMultiply::GetValue(int frame, zeus::CVector3f& valOut) const { - Zeus::CVector3f a, b; + zeus::CVector3f a, b; x4_a->GetValue(frame, a); x8_b->GetValue(frame, b); valOut = a * b; return false; } -bool CVERealToVector::GetValue(int frame, Zeus::CVector3f& valOut) const +bool CVERealToVector::GetValue(int frame, zeus::CVector3f& valOut) const { float a; x4_a->GetValue(frame, a); - valOut = Zeus::CVector3f(a); + valOut = zeus::CVector3f(a); return false; } -bool CVEPulse::GetValue(int frame, Zeus::CVector3f& valOut) const +bool CVEPulse::GetValue(int frame, zeus::CVector3f& valOut) const { int a, b; x4_aDuration->GetValue(frame, a); @@ -264,71 +264,71 @@ bool CVEPulse::GetValue(int frame, Zeus::CVector3f& valOut) const return false; } -bool CVEParticleVelocity::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const +bool CVEParticleVelocity::GetValue(int /*frame*/, zeus::CVector3f& valOut) const { valOut = CElementGen::g_currentParticle->x1c_vel; return false; } -bool CVEPLCO::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const +bool CVEPLCO::GetValue(int /*frame*/, zeus::CVector3f& valOut) const { valOut = CElementGen::g_currentParticle->x10_prevPos; return false; } -bool CVEPLOC::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const +bool CVEPLOC::GetValue(int /*frame*/, zeus::CVector3f& valOut) const { valOut = CElementGen::g_currentParticle->x4_pos; return false; } -bool CVEPSOF::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const +bool CVEPSOF::GetValue(int /*frame*/, zeus::CVector3f& valOut) const { - Zeus::CTransform trans= CParticleGlobals::g_currentParticleSystem->x4_system->GetOrientation(); + zeus::CTransform trans= CParticleGlobals::g_currentParticleSystem->x4_system->GetOrientation(); valOut.x = trans.m_basis[0].y; valOut.y = trans.m_basis[1].z; valOut.z = trans.m_origin.x; return false; } -bool CVEPSOU::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const +bool CVEPSOU::GetValue(int /*frame*/, zeus::CVector3f& valOut) const { - Zeus::CTransform trans= CParticleGlobals::g_currentParticleSystem->x4_system->GetOrientation(); + zeus::CTransform trans= CParticleGlobals::g_currentParticleSystem->x4_system->GetOrientation(); valOut.x = trans.m_basis[0].z; valOut.y = trans.m_basis[1].x; valOut.z = trans.m_origin.y; return false; } -bool CVEPSOR::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const +bool CVEPSOR::GetValue(int /*frame*/, zeus::CVector3f& valOut) const { - Zeus::CTransform trans= CParticleGlobals::g_currentParticleSystem->x4_system->GetOrientation(); + zeus::CTransform trans= CParticleGlobals::g_currentParticleSystem->x4_system->GetOrientation(); valOut.x = trans.m_basis[0].x; valOut.y = trans.m_basis[1].y; valOut.z = trans.m_basis[2].z; return false; } -bool CVEPSTR::GetValue(int /*frame*/, Zeus::CVector3f& valOut) const +bool CVEPSTR::GetValue(int /*frame*/, zeus::CVector3f& valOut) const { valOut = CParticleGlobals::g_currentParticleSystem->x4_system->GetTranslation(); return false; } -bool CVESubtract::GetValue(int frame, Zeus::CVector3f& valOut) const +bool CVESubtract::GetValue(int frame, zeus::CVector3f& valOut) const { - Zeus::CVector3f a, b; + zeus::CVector3f a, b; x4_a->GetValue(frame, a); x8_b->GetValue(frame, b); valOut = a - b; return false; } -bool CVEColorToVector::GetValue(int frame, Zeus::CVector3f &valOut) const +bool CVEColorToVector::GetValue(int frame, zeus::CVector3f &valOut) const { - Zeus::CColor val = {0.0, 0.0, 0.0, 1.0}; + zeus::CColor val = {0.0f, 0.0f, 0.0f, 1.0f}; x4_a->GetValue(frame, val); - valOut = Zeus::CVector3f{val.r, val.g, val.b}; + valOut = zeus::CVector3f{val.r, val.g, val.b}; return false; } diff --git a/Runtime/Particle/CVectorElement.hpp b/Runtime/Particle/CVectorElement.hpp index ddd662312..6cc429330 100644 --- a/Runtime/Particle/CVectorElement.hpp +++ b/Runtime/Particle/CVectorElement.hpp @@ -5,7 +5,7 @@ /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Vector_Elements */ -namespace pshag +namespace urde { class CVEKeyframeEmitter : public CVectorElement @@ -16,21 +16,21 @@ class CVEKeyframeEmitter : public CVectorElement bool xd_unk2; u32 x10_loopEnd; u32 x14_loopStart; - std::vector x18_keys; + std::vector x18_keys; public: CVEKeyframeEmitter(CInputStream& in); - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVECone : public CVectorElement { std::unique_ptr x4_direction; std::unique_ptr x8_magnitude; - Zeus::CVector3f xc_xVec; - Zeus::CVector3f x18_yVec; + zeus::CVector3f xc_xVec; + zeus::CVector3f x18_yVec; public: CVECone(CVectorElement* a, CRealElement* b); - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVETimeChain : public CVectorElement @@ -41,7 +41,7 @@ class CVETimeChain : public CVectorElement public: CVETimeChain(CVectorElement* a, CVectorElement* b, CIntElement* c) : x4_a(a), x8_b(b), xc_swFrame(c) {} - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEAngleCone : public CVectorElement @@ -54,7 +54,7 @@ class CVEAngleCone : public CVectorElement public: CVEAngleCone(CRealElement* a, CRealElement* b, CRealElement* c, CRealElement* d, CRealElement* e) : x4_angleXConstant(a), x8_angleYConstant(b), xc_angleXRange(c), x10_angleYRange(d), x14_magnitude(e) {} - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEAdd : public CVectorElement @@ -64,19 +64,19 @@ class CVEAdd : public CVectorElement public: CVEAdd(CVectorElement* a, CVectorElement* b) : x4_a(a), x8_b(b) {} - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVECircleCluster : public CVectorElement { std::unique_ptr x4_a; - Zeus::CVector3f x8_xVec; - Zeus::CVector3f x14_yVec; + zeus::CVector3f x8_xVec; + zeus::CVector3f x14_yVec; float x20_deltaAngle; std::unique_ptr x24_magnitude; public: CVECircleCluster(CVectorElement* a, CVectorElement* b, CIntElement* c, CRealElement* d); - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEConstant : public CVectorElement @@ -87,29 +87,29 @@ class CVEConstant : public CVectorElement public: CVEConstant(CRealElement* a, CRealElement* b, CRealElement* c) : x4_a(a), x8_b(b), xc_c(c) {} - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEFastConstant : public CVectorElement { - Zeus::CVector3f x4_val; + zeus::CVector3f x4_val; public: CVEFastConstant(float a, float b, float c) : x4_val(a, b, c) {} - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; bool IsFastConstant() const {return true;} }; class CVECircle : public CVectorElement { std::unique_ptr x4_direction; - Zeus::CVector3f x8_xVec; - Zeus::CVector3f x14_yVec; + zeus::CVector3f x8_xVec; + zeus::CVector3f x14_yVec; std::unique_ptr x20_angleConstant; std::unique_ptr x24_angleLinear; std::unique_ptr x28_radius; public: CVECircle(CVectorElement* a, CVectorElement* b, CRealElement* c, CRealElement* d, CRealElement* e); - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEMultiply : public CVectorElement @@ -119,7 +119,7 @@ class CVEMultiply : public CVectorElement public: CVEMultiply(CVectorElement* a, CVectorElement* b) : x4_a(a), x8_b(b) {} - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVERealToVector : public CVectorElement @@ -128,7 +128,7 @@ class CVERealToVector : public CVectorElement public: CVERealToVector(CRealElement* a) : x4_a(a) {} - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEPulse : public CVectorElement @@ -140,49 +140,49 @@ class CVEPulse : public CVectorElement public: CVEPulse(CIntElement* a, CIntElement* b, CVectorElement* c, CVectorElement* d) : x4_aDuration(a), x8_bDuration(b), xc_aVal(c), x10_bVal(d) {} - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEParticleVelocity : public CVectorElement { public: - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEPLCO : public CVectorElement { public: - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEPLOC : public CVectorElement { public: - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEPSOF : public CVectorElement { public: - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEPSOU : public CVectorElement { public: - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEPSOR : public CVectorElement { public: - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEPSTR : public CVectorElement { public: - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVESubtract : public CVectorElement @@ -193,7 +193,7 @@ public: CVESubtract(CVectorElement* a, CVectorElement* b) : x4_a(a), x8_b(b) {} - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; class CVEColorToVector : public CVectorElement @@ -203,7 +203,7 @@ public: CVEColorToVector(CColorElement* a) : x4_a(a) {} - bool GetValue(int frame, Zeus::CVector3f& valOut) const; + bool GetValue(int frame, zeus::CVector3f& valOut) const; }; } diff --git a/Runtime/Particle/CWarp.hpp b/Runtime/Particle/CWarp.hpp index 5ed3c25d4..a8cfd5954 100644 --- a/Runtime/Particle/CWarp.hpp +++ b/Runtime/Particle/CWarp.hpp @@ -1,11 +1,11 @@ #ifndef __PSHAG_CWARP_HPP__ #define __PSHAG_CWARP_HPP__ -#include -#include +#include "zeus/CColor.hpp" +#include "zeus/CVector3f.hpp" #include "RetroTypes.hpp" -namespace pshag +namespace urde { class CWarp @@ -14,10 +14,10 @@ public: virtual ~CWarp() {} virtual bool UpdateWarp()=0; virtual void ModifyParticles(int, int, int*, - Zeus::CVector3f*, - Zeus::CVector3f*, - Zeus::CVector3f*, - Zeus::CColor*, + zeus::CVector3f*, + zeus::CVector3f*, + zeus::CVector3f*, + zeus::CColor*, float*, float*)=0; virtual void Activate(bool)=0; virtual bool IsActivated()=0; diff --git a/Runtime/Particle/CWeaponDescription.hpp b/Runtime/Particle/CWeaponDescription.hpp index 5ebc948f4..f13b5020c 100644 --- a/Runtime/Particle/CWeaponDescription.hpp +++ b/Runtime/Particle/CWeaponDescription.hpp @@ -8,7 +8,7 @@ #include "CModVectorElement.hpp" #include "CColorElement.hpp" -namespace pshag +namespace urde { class CCollisionResponseData; diff --git a/Runtime/Particle/IElement.hpp b/Runtime/Particle/IElement.hpp index 4f7bdd329..b2087ac2e 100644 --- a/Runtime/Particle/IElement.hpp +++ b/Runtime/Particle/IElement.hpp @@ -3,11 +3,11 @@ #include #include "GCNTypes.hpp" -#include "CVector3f.hpp" -#include "CColor.hpp" +#include "zeus/CVector3f.hpp" +#include "zeus/CColor.hpp" #include "IOStreams.hpp" -namespace pshag +namespace urde { class IElement @@ -32,26 +32,26 @@ public: class CVectorElement : public IElement { public: - virtual bool GetValue(int frame, Zeus::CVector3f& valOut) const=0; + virtual bool GetValue(int frame, zeus::CVector3f& valOut) const=0; virtual bool IsFastConstant() const {return false;} }; class CModVectorElement : public IElement { public: - virtual bool GetValue(int frame, Zeus::CVector3f& pVel, Zeus::CVector3f& pPos) const=0; + virtual bool GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f& pPos) const=0; }; class CColorElement : public IElement { public: - virtual bool GetValue(int frame, Zeus::CColor& colorOut) const=0; + virtual bool GetValue(int frame, zeus::CColor& colorOut) const=0; }; class CEmitterElement : public IElement { public: - virtual bool GetValue(int frame, Zeus::CVector3f& pPos, Zeus::CVector3f& pVel) const=0; + virtual bool GetValue(int frame, zeus::CVector3f& pPos, zeus::CVector3f& pVel) const=0; }; } diff --git a/Runtime/RetroTypes.hpp b/Runtime/RetroTypes.hpp index 18a1c8e6b..e1a23cef7 100644 --- a/Runtime/RetroTypes.hpp +++ b/Runtime/RetroTypes.hpp @@ -8,10 +8,10 @@ #include "rstl.hpp" #include "DataSpec/DNACommon/DNACommon.hpp" -namespace pshag +namespace urde { -using FourCC = HECL::FourCC; +using FourCC = hecl::FourCC; using TResId = u64; struct SObjectTag @@ -72,9 +72,9 @@ using TAreaId = u32; namespace std { template<> -struct hash +struct hash { - inline size_t operator()(const pshag::SObjectTag& tag) const + inline size_t operator()(const urde::SObjectTag& tag) const {return tag.id;} }; } diff --git a/Runtime/ScriptObjectSupport.hpp b/Runtime/ScriptObjectSupport.hpp index 2d79826c6..e8c5107b3 100644 --- a/Runtime/ScriptObjectSupport.hpp +++ b/Runtime/ScriptObjectSupport.hpp @@ -1,7 +1,7 @@ #ifndef __SCRIPT_OBJECT_SUPPORT_HPP__ #define __SCRIPT_OBJECT_SUPPORT_HPP__ -namespace pshag +namespace urde { enum class EScriptObjectState diff --git a/hecl b/hecl index 6158f4410..f17dcd4d0 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 6158f44103efec1372f0a98d5c6268ff528f52ac +Subproject commit f17dcd4d03b87262594a89bdae2c8426c8b50978 diff --git a/nod b/nod index 7320b76ff..556a5868b 160000 --- a/nod +++ b/nod @@ -1 +1 @@ -Subproject commit 7320b76ff45b74c1f25b53bfe78255c178168da0 +Subproject commit 556a5868bb79d740d5cfd5eccd5135c2fd0f39c1 diff --git a/specter b/specter index cfb3cd8c7..d6a6032db 160000 --- a/specter +++ b/specter @@ -1 +1 @@ -Subproject commit cfb3cd8c74d0fb0fbc9c37a523b96fd5d2791db4 +Subproject commit d6a6032dbaf4500acad4900b9e8ba172cf75788c