diff --git a/DataSpec/DNACommon/CMDL.cpp b/DataSpec/DNACommon/CMDL.cpp index e017affc3..4fdc0e3fe 100644 --- a/DataSpec/DNACommon/CMDL.cpp +++ b/DataSpec/DNACommon/CMDL.cpp @@ -669,11 +669,12 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I } } - if (s < secCount - 1) - reader.seek(secStart + secSizes[s], athena::Begin); + if (s < secCount - 1) { + reader.seek(secStart + secSizes[s], athena::SeekOrigin::Begin); + } } - reader.seek(afterHeaderPos, athena::Begin); + reader.seek(afterHeaderPos, athena::SeekOrigin::Begin); visitedDLOffsets = false; unsigned createdUVLayers = 0; @@ -989,8 +990,9 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I } } - if (s < secCount - 1) - reader.seek(secStart + secSizes[s], athena::Begin); + if (s < secCount - 1) { + reader.seek(secStart + secSizes[s], athena::SeekOrigin::Begin); + } } /* Finish Mesh */ @@ -1088,8 +1090,9 @@ void NameCMDL(athena::io::IStreamReader& reader, PAKRouter& pakRouter, typename matSet.nameTextures(pakRouter, bestName.c_str(), s); } - if (s < head.secCount - 1) - reader.seek(secStart + head.secSizes[s], athena::Begin); + if (s < head.secCount - 1) { + reader.seek(secStart + head.secSizes[s], athena::SeekOrigin::Begin); + } } } @@ -1547,7 +1550,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::SeekOrigin::Current); writer.writeUByte(0); writer.close(); return true; @@ -2042,7 +2045,7 @@ void SurfaceHeader_1::Enumerate(typename Read::StreamT& reader) { aabb[1] = reader.readVec3fBig(); remAABB -= 24; } - reader.seek(remAABB, athena::Current); + reader.seek(remAABB, athena::SeekOrigin::Current); /* align */ reader.seekAlign32(); } @@ -2106,7 +2109,7 @@ void SurfaceHeader_2::Enumerate(typename Read::StreamT& reader) { aabb[1] = reader.readVec3fBig(); remAABB -= 24; } - reader.seek(remAABB, athena::Current); + reader.seek(remAABB, athena::SeekOrigin::Current); /* align */ reader.seekAlign32(); } @@ -2174,7 +2177,7 @@ void SurfaceHeader_3::Enumerate(typename Read::StreamT& reader) { aabb[1] = reader.readVec3fBig(); remAABB -= 24; } - reader.seek(remAABB, athena::Current); + reader.seek(remAABB, athena::SeekOrigin::Current); /* unk3 */ unk3 = reader.readUByte(); /* align */ diff --git a/DataSpec/DNACommon/DNACommon.hpp b/DataSpec/DNACommon/DNACommon.hpp index aa316fae3..e66593c9d 100644 --- a/DataSpec/DNACommon/DNACommon.hpp +++ b/DataSpec/DNACommon/DNACommon.hpp @@ -17,9 +17,9 @@ extern ThreadLocalPtr g_PakRouter; extern ThreadLocalPtr g_ThreadBlenderToken; /* This comes up a great deal */ -typedef athena::io::DNA BigDNA; -typedef athena::io::DNAV BigDNAV; -typedef athena::io::DNAVYaml BigDNAVYaml; +using BigDNA = athena::io::DNA; +using BigDNAV = athena::io::DNAV; +using BigDNAVYaml = athena::io::DNAVYaml; /** FourCC with DNA read/write */ using DNAFourCC = hecl::DNAFourCC; diff --git a/DataSpec/DNACommon/GX.cpp b/DataSpec/DNACommon/GX.cpp index 37206aeaa..f296883b7 100644 --- a/DataSpec/DNACommon/GX.cpp +++ b/DataSpec/DNACommon/GX.cpp @@ -3,15 +3,15 @@ namespace GX { template <> -void Color::Enumerate::Read>(typename Read::StreamT& reader) { +void Color::Enumerate::Read>(Read::StreamT& reader) { reader.readUBytesToBuf(&num, 4); } template <> -void Color::Enumerate::Write>(typename Write::StreamT& writer) { +void Color::Enumerate::Write>(Write::StreamT& writer) { writer.writeUBytes(reinterpret_cast(&num), 4); } template <> -void Color::Enumerate::BinarySize>(typename BinarySize::StreamT& s) { +void Color::Enumerate::BinarySize>(BinarySize::StreamT& s) { s += 4; } diff --git a/DataSpec/DNACommon/GX.hpp b/DataSpec/DNACommon/GX.hpp index e9e1a573a..5bcb7b7d7 100644 --- a/DataSpec/DNACommon/GX.hpp +++ b/DataSpec/DNACommon/GX.hpp @@ -246,7 +246,7 @@ enum BlendFactor : uint16_t { BL_INVDSTALPHA }; -struct Color : athena::io::DNA { +struct Color : athena::io::DNA { union { uint8_t color[4]; uint32_t num = 0; diff --git a/DataSpec/DNACommon/PAK.hpp b/DataSpec/DNACommon/PAK.hpp index 9d78619e1..c7723eea0 100644 --- a/DataSpec/DNACommon/PAK.hpp +++ b/DataSpec/DNACommon/PAK.hpp @@ -18,12 +18,12 @@ namespace DataSpec { /** PAK entry stream reader */ class PAKEntryReadStream : public athena::io::IStreamReader { std::unique_ptr m_buf; - atUint64 m_sz; - atUint64 m_pos; + atUint64 m_sz = 0; + atUint64 m_pos = 0; public: - PAKEntryReadStream() {} - operator bool() const { return m_buf.operator bool(); } + PAKEntryReadStream() = default; + explicit operator bool() const { return m_buf.operator bool(); } PAKEntryReadStream(const PAKEntryReadStream& other) = delete; PAKEntryReadStream(PAKEntryReadStream&& other) = default; PAKEntryReadStream& operator=(const PAKEntryReadStream& other) = delete; @@ -34,14 +34,16 @@ public: LogDNACommon.report(logvisor::Fatal, fmt("PAK stream cursor overrun")); } void seek(atInt64 pos, athena::SeekOrigin origin) override { - if (origin == athena::Begin) + if (origin == athena::SeekOrigin::Begin) { m_pos = pos; - else if (origin == athena::Current) + } else if (origin == athena::SeekOrigin::Current) { m_pos += pos; - else if (origin == athena::End) + } else if (origin == athena::SeekOrigin::End) { m_pos = m_sz + pos; - if (m_pos > m_sz) + } + if (m_pos > m_sz) { LogDNACommon.report(logvisor::Fatal, fmt("PAK stream cursor overrun")); + } } atUint64 position() const override { return m_pos; } atUint64 length() const override { return m_sz; } diff --git a/DataSpec/DNACommon/WPSC.cpp b/DataSpec/DNACommon/WPSC.cpp index f94513414..67fcfb57c 100644 --- a/DataSpec/DNACommon/WPSC.cpp +++ b/DataSpec/DNACommon/WPSC.cpp @@ -113,7 +113,7 @@ void WPSM::_read(athena::io::YAMLDocReader& r) { xunk_FC60.read(r); break; case SBIG('SPS1'): - xunk_SPS2.read(r); + xunk_SPS1.read(r); break; case SBIG('SPS2'): xunk_SPS2.read(r); diff --git a/DataSpec/DNAMP1/AGSC.cpp b/DataSpec/DNAMP1/AGSC.cpp index 4e3bb95e9..f136e5cb9 100644 --- a/DataSpec/DNAMP1/AGSC.cpp +++ b/DataSpec/DNAMP1/AGSC.cpp @@ -238,7 +238,7 @@ bool AGSC::Cook(const hecl::ProjectPath& dir, const hecl::ProjectPath& refOutPat amuse::AudioGroupDatabase group(path.getAbsolutePath()); auto proj = group.getProj().toGCNData(group.getPool(), group.getSdir()); - auto pool = group.getPool().toData(); + auto pool = group.getPool().toData(); auto sdirSamp = group.getSdir().toGCNData(group); w.writeUint32Big(pool.size()); diff --git a/DataSpec/DNAMP1/CMakeLists.txt b/DataSpec/DNAMP1/CMakeLists.txt index f29b3451c..3520e76c4 100644 --- a/DataSpec/DNAMP1/CMakeLists.txt +++ b/DataSpec/DNAMP1/CMakeLists.txt @@ -61,6 +61,7 @@ set(DNAMP1_SOURCES FRME.cpp SCAN.cpp DeafBabe.cpp + Tweaks/CTweakAutoMapper.cpp Tweaks/CTweakPlayer.cpp Tweaks/CTweakTargeting.cpp Tweaks/CTweakBall.cpp diff --git a/DataSpec/DNAMP1/DNAMP1.cpp b/DataSpec/DNAMP1/DNAMP1.cpp index 680e1e0c7..386059ff9 100644 --- a/DataSpec/DNAMP1/DNAMP1.cpp +++ b/DataSpec/DNAMP1/DNAMP1.cpp @@ -115,7 +115,7 @@ void PAKBridge::build() { if (worldMapEnt) { worldMapEnt->name = entry.name + "_mapw"; PAKEntryReadStream rs = worldMapEnt->beginReadStream(m_node); - rs.seek(8, athena::Current); + rs.seek(8, athena::SeekOrigin::Current); atUint32 areaCount = rs.readUint32Big(); mapw.reserve(areaCount); for (atUint32 i = 0; i < areaCount; ++i) diff --git a/DataSpec/DNAMP1/MREA.cpp b/DataSpec/DNAMP1/MREA.cpp index e94c6093a..89c9e4f0a 100644 --- a/DataSpec/DNAMP1/MREA.cpp +++ b/DataSpec/DNAMP1/MREA.cpp @@ -46,7 +46,7 @@ void MREA::AddCMDLRigPairs(PAKEntryReadStream& rs, PAKRouter& pakRout atUint64 secStart = rs.position(); while (curSec != head.sclySecIdx) secStart += head.secSizes[curSec++]; - rs.seek(secStart, athena::Begin); + rs.seek(secStart, athena::SeekOrigin::Begin); SCLY scly; scly.read(rs); scly.addCMDLRigPairs(pakRouter, charAssoc); @@ -65,7 +65,7 @@ UniqueID32 MREA::GetPATHId(PAKEntryReadStream& rs) { secStart += head.secSizes[curSec++]; if (!head.secSizes[curSec]) return {}; - rs.seek(secStart, athena::Begin); + rs.seek(secStart, athena::SeekOrigin::Begin); return {rs}; } @@ -81,7 +81,7 @@ static void OutputOctreeNode(hecl::blender::PyOutStream& os, athena::io::MemoryR offsets[i] = r.readUint32Big(); u32 dataStart = r.position(); for (int i = 0; i < 8; ++i) { - r.seek(dataStart + offsets[i], athena::Begin); + r.seek(dataStart + offsets[i], athena::SeekOrigin::Begin); int chFlags = (flags >> (i * 2)) & 0x3; zeus::CAABox pos, neg, res; @@ -231,7 +231,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: 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::SeekOrigin::Begin); std::vector vertAttribs; DNACMDL::GetVertexAttributes(matSet, vertAttribs); @@ -241,7 +241,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: MeshHeader mHeader; secStart = rs.position(); mHeader.read(rs); - rs.seek(secStart + head.secSizes[curSec++], athena::Begin); + rs.seek(secStart + head.secSizes[curSec++], athena::SeekOrigin::Begin); curSec += DNACMDL::ReadGeomSectionsToBlender, MaterialSet, RigPair, DNACMDL::SurfaceHeader_1>( os, rs, pakRouter, entry, dummy, true, true, vertAttribs, m, head.secCount, 0, &head.secSizes[curSec]); os.format(fmt( @@ -255,14 +255,14 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: /* Skip AROT */ secStart = rs.position(); - rs.seek(secStart + head.secSizes[curSec++], athena::Begin); + rs.seek(secStart + head.secSizes[curSec++], athena::SeekOrigin::Begin); /* 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::SeekOrigin::Begin); /* Read collision meshes */ DeafBabe collision; @@ -270,32 +270,32 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: collision.read(rs); DeafBabe::BlenderInit(os); collision.sendToBlender(os); - rs.seek(secStart + head.secSizes[curSec++], athena::Begin); + rs.seek(secStart + head.secSizes[curSec++], athena::SeekOrigin::Begin); /* Skip unknown section */ - rs.seek(head.secSizes[curSec++], athena::Current); + rs.seek(head.secSizes[curSec++], athena::SeekOrigin::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::SeekOrigin::Begin); /* Dump VISI entities */ secStart = rs.position(); if (head.secSizes[curSec] && rs.readUint32Big() == 'VISI') { { - rs.seek(secStart, athena::Begin); + rs.seek(secStart, athena::SeekOrigin::Begin); auto visiData = rs.readUBytes(head.secSizes[curSec]); athena::io::FileWriter visiOut(outPath.getWithExtension(_SYS_STR(".visi"), true).getAbsolutePath()); visiOut.writeUBytes(visiData.get(), head.secSizes[curSec]); - rs.seek(secStart + 4, athena::Begin); + rs.seek(secStart + 4, athena::SeekOrigin::Begin); } athena::io::YAMLDocWriter visiWriter("VISI"); if (auto __vec = visiWriter.enterSubVector("entities")) { - rs.seek(18, athena::Current); + rs.seek(18, athena::SeekOrigin::Current); uint32_t entityCount = rs.readUint32Big(); - rs.seek(8, athena::Current); + rs.seek(8, athena::SeekOrigin::Current); for (uint32_t i = 0; i < entityCount; ++i) { uint32_t entityId = rs.readUint32Big(); visiWriter.writeUint32(entityId); @@ -333,14 +333,14 @@ void MREA::Name(const SpecBase& dataSpec, PAKEntryReadStream& rs, PAKRouter(athena::io::IStreamReader& rs) { 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::SeekOrigin::Begin); }); } @@ -118,9 +118,10 @@ void SCLY::ScriptLayer::Enumerate(athena::io::IStreamReader& rs) { fmt(_SYS_STR("Error while reading object of type 0x{:02X}, 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 + rs.seek(start + len, athena::SeekOrigin::Begin); + } else { Log.report(logvisor::Fatal, fmt(_SYS_STR("Unable to find type 0x{:X} in object database")), (atUint32)type); + } } } diff --git a/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.cpp b/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.cpp index e69de29bb..d895bad44 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.cpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.cpp @@ -0,0 +1,18 @@ +#include "DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.hpp" + +#include +#include + +namespace DataSpec::DNAMP1 { +namespace { + +} + +void CTweakAutoMapper::_tweakListener(hecl::CVar* cv) { + +} + +void CTweakAutoMapper::initCVars(hecl::CVarManager* mgr) { + +} +} \ No newline at end of file diff --git a/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.hpp b/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.hpp index 85d8b44d7..291e237ed 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakAutoMapper.hpp @@ -1,7 +1,12 @@ #pragma once -#include "../../DataSpec/DNACommon/Tweaks/ITweakAutoMapper.hpp" -#include "zeus/CVector3f.hpp" +#include "DataSpec/DNACommon/Tweaks/ITweakAutoMapper.hpp" + +#include + +namespace hecl { +class CVar; +} namespace DataSpec::DNAMP1 { struct CTweakAutoMapper final : public ITweakAutoMapper { @@ -132,5 +137,9 @@ struct CTweakAutoMapper final : public ITweakAutoMapper { const zeus::CColor& GetAreaFlashPulseColor() const override { return xf4_areaFlashPulseColor; } const zeus::CColor& GetDoorColor(int idx) const override { return x104_doorColors[idx]; } const zeus::CColor& GetOpenDoorColor() const override { return x11c_openDoorColor; } + void initCVars(hecl::CVarManager*) override; + +private: + void _tweakListener(hecl::CVar* cv); }; } // namespace DataSpec::DNAMP1 diff --git a/DataSpec/DNAMP1/Tweaks/CTweakGame.cpp b/DataSpec/DNAMP1/Tweaks/CTweakGame.cpp index 50ff36f54..801056359 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakGame.cpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakGame.cpp @@ -1,10 +1,46 @@ -#include "CTweakGame.hpp" -#include "hecl/CVarManager.hpp" +#include "DataSpec/DNAMP1/Tweaks/CTweakGame.hpp" +#include "Runtime/Camera/CCameraManager.hpp" + +#include +#include namespace DataSpec::DNAMP1 { +hecl::CVar* tw_fov = nullptr; +hecl::CVar* tw_hardmodeDMult = nullptr; +hecl::CVar* tw_hardmodeWMult = nullptr; +namespace { +constexpr std::string_view skFov = "tweaks.game.FieldOfView"sv; +constexpr std::string_view skHardModeDamageMultName = "tweaks.game.HardModeDamageMult"sv; +constexpr std::string_view skHardModeWeaponMultName = "tweaks.game.HardModeWeaponMult"sv; +} // anonymous namespace + +void CTweakGame::_tweakGameListener(hecl::CVar* cv) { + if (cv == tw_fov) { + x24_fov = cv->toReal(); + } else if (cv == tw_hardmodeDMult) { + x60_hardmodeDamageMult = cv->toReal(); + } else if (cv == tw_hardmodeWMult) { + x64_hardmodeWeaponMult = cv->toReal(); + } +} + void CTweakGame::initCVars(hecl::CVarManager* mgr) { - // mgr->findOrMakeCVar("tweaks.game.hardmodeDamageMult", "", x60_hardmodeDamageMult, hecl::CVar::EFlags::Game | - // hecl::CVar::Archive | hecl::CVar::Cheat); mgr->findOrMakeCVar("tweaks.game.hardmodeWeaponMult", "", - // x64_hardmodeWeaponMult, hecl::CVar::EFlags::Game | hecl::CVar::Archive | hecl::CVar::Cheat); + auto assignRealValue = [this, mgr](std::string_view name, std::string_view desc, float& v, hecl::CVar::EFlags flags) { + hecl::CVar* cv = mgr->findOrMakeCVar(name, desc, v, flags); + // Check if the CVar was deserialized, this avoid an unnecessary conversion + if (cv->wasDeserialized()) + v = cv->toReal(); + cv->addListener([this](hecl::CVar* cv) { _tweakGameListener(cv); }); + return cv; + }; + + tw_fov = assignRealValue(skFov, "", x24_fov, + hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive); + tw_hardmodeDMult = + assignRealValue(skHardModeDamageMultName, "", x60_hardmodeDamageMult, + hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive | hecl::CVar::EFlags::Cheat); + tw_hardmodeWMult = + assignRealValue(skHardModeWeaponMultName, "", x64_hardmodeWeaponMult, + hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive | hecl::CVar::EFlags::Cheat); } } // namespace DataSpec::DNAMP1 diff --git a/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp b/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp index 3bc385287..5fe8c5203 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp @@ -1,6 +1,10 @@ #pragma once -#include "../../DNACommon/Tweaks/ITweakGame.hpp" +#include "DataSpec/DNACommon/Tweaks/ITweakGame.hpp" + +namespace hecl { +class CVar; +} namespace DataSpec::DNAMP1 { @@ -56,5 +60,7 @@ struct CTweakGame final : ITweakGame { } void initCVars(hecl::CVarManager* mgr) override; +private: + void _tweakGameListener(hecl::CVar* cv); }; } // namespace DataSpec::DNAMP1 diff --git a/DataSpec/DNAMP1/Tweaks/CTweakPlayerGun.hpp b/DataSpec/DNAMP1/Tweaks/CTweakPlayerGun.hpp index d497e34ee..e9f821187 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakPlayerGun.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakPlayerGun.hpp @@ -89,14 +89,16 @@ struct CTweakPlayerGun final : ITweakPlayerGun { } const SWeaponInfo& GetBeamInfo(atInt32 beam) const override { - if (beam < 0 || beam > 5) + if (beam < 0 || beam >= 5) { return xa8_beams[0]; + } return xa8_beams[beam]; } const SComboShotParam& GetComboShotInfo(atInt32 beam) const override { - if (beam < 0 || beam > 5) + if (beam < 0 || beam >= 5) { return x1f0_combos[0]; + } return x1f0_combos[beam]; } diff --git a/DataSpec/DNAMP2/AGSC.cpp b/DataSpec/DNAMP2/AGSC.cpp index 152721e92..9dd18ad58 100644 --- a/DataSpec/DNAMP2/AGSC.cpp +++ b/DataSpec/DNAMP2/AGSC.cpp @@ -57,7 +57,7 @@ bool AGSC::Cook(const hecl::ProjectPath& dir, const hecl::ProjectPath& outPath) amuse::AudioGroupDatabase group(dir.getAbsolutePath()); auto proj = group.getProj().toGCNData(group.getPool(), group.getSdir()); - auto pool = group.getPool().toData(); + auto pool = group.getPool().toData(); auto sdirSamp = group.getSdir().toGCNData(group); Header head; diff --git a/DataSpec/DNAMP2/DNAMP2.cpp b/DataSpec/DNAMP2/DNAMP2.cpp index b763694bc..1f6027844 100644 --- a/DataSpec/DNAMP2/DNAMP2.cpp +++ b/DataSpec/DNAMP2/DNAMP2.cpp @@ -86,7 +86,7 @@ void PAKBridge::build() { std::vector mapw; if (worldMapEnt) { PAKEntryReadStream rs = worldMapEnt->beginReadStream(m_node); - rs.seek(8, athena::Current); + rs.seek(8, athena::SeekOrigin::Current); atUint32 areaCount = rs.readUint32Big(); mapw.reserve(areaCount); for (atUint32 i = 0; i < areaCount; ++i) diff --git a/DataSpec/DNAMP2/MREA.cpp b/DataSpec/DNAMP2/MREA.cpp index 844a1bff2..ba2bd6adb 100644 --- a/DataSpec/DNAMP2/MREA.cpp +++ b/DataSpec/DNAMP2/MREA.cpp @@ -80,10 +80,11 @@ MREA::StreamReader::StreamReader(athena::io::IStreamReader& source, atUint32 blk void MREA::StreamReader::seek(atInt64 diff, athena::SeekOrigin whence) { atUint64 target = diff; - if (whence == athena::Current) + if (whence == athena::SeekOrigin::Current) { target = m_pos + diff; - else if (whence == athena::End) + } else if (whence == athena::SeekOrigin::End) { target = m_totalDecompLen - diff; + } if (target >= m_totalDecompLen) Log.report(logvisor::Fatal, fmt("MREA stream seek overrun")); @@ -106,7 +107,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::SeekOrigin::Begin); m_nextBlk = bIdx; nextBlock(); } @@ -168,7 +169,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: atUint64 decompLen = drs.length(); mreaDecompOut.writeBytes(drs.readBytes(decompLen).get(), decompLen); mreaDecompOut.close(); - drs.seek(0, athena::Begin); + drs.seek(0, athena::SeekOrigin::Begin); /* Start up blender connection */ hecl::blender::Connection& conn = btok.getBlenderConnection(); @@ -181,12 +182,12 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: egmcOffset += head.secSizes[i]; /* Load EGMC if possible so we can assign meshes to scanIds */ - drs.seek(egmcOffset, athena::Begin); + drs.seek(egmcOffset, athena::SeekOrigin::Begin); UniqueID32 egmcId(drs); DNACommon::EGMC egmc; pakRouter.lookupAndReadDNA(egmcId, egmc); - drs.seek(0, athena::Begin); + drs.seek(0, athena::SeekOrigin::Begin); /* Open Py Stream and read sections */ hecl::blender::PyOutStream os = conn.beginPythonOut(true); @@ -224,7 +225,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: 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::SeekOrigin::Begin); std::vector vertAttribs; DNACMDL::GetVertexAttributes(matSet, vertAttribs); @@ -234,7 +235,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: MeshHeader mHeader; secStart = drs.position(); mHeader.read(drs); - drs.seek(secStart + head.secSizes[curSec++], athena::Begin); + drs.seek(secStart + head.secSizes[curSec++], athena::SeekOrigin::Begin); curSec += DNACMDL::ReadGeomSectionsToBlender, MaterialSet, RigPair, DNACMDL::SurfaceHeader_2>( os, drs, pakRouter, entry, dummy, true, true, vertAttribs, m, head.secCount, 0, &head.secSizes[curSec]); os.format(fmt( @@ -246,25 +247,26 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: mHeader.visorFlags.disableXray() ? "True" : "False", 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::SeekOrigin::Current); + drs.seek(head.secSizes[curSec++], athena::SeekOrigin::Current); } /* Skip AROT */ - drs.seek(head.secSizes[curSec++], athena::Current); + drs.seek(head.secSizes[curSec++], athena::SeekOrigin::Current); /* Skip BVH */ - drs.seek(head.secSizes[curSec++], athena::Current); + drs.seek(head.secSizes[curSec++], athena::SeekOrigin::Current); /* Skip Bitmap */ - drs.seek(head.secSizes[curSec++], athena::Current); + drs.seek(head.secSizes[curSec++], athena::SeekOrigin::Current); /* Skip SCLY (for now) */ - for (atUint32 l = 0; l < head.sclyLayerCount; ++l) - drs.seek(head.secSizes[curSec++], athena::Current); + for (atUint32 l = 0; l < head.sclyLayerCount; ++l) { + drs.seek(head.secSizes[curSec++], athena::SeekOrigin::Current); + } /* Skip SCGN (for now) */ - drs.seek(head.secSizes[curSec++], athena::Current); + drs.seek(head.secSizes[curSec++], athena::SeekOrigin::Current); /* Read collision meshes */ DeafBabe collision; @@ -272,15 +274,15 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: collision.read(drs); DeafBabe::BlenderInit(os); collision.sendToBlender(os); - drs.seek(secStart + head.secSizes[curSec++], athena::Begin); + drs.seek(secStart + head.secSizes[curSec++], athena::SeekOrigin::Begin); /* Skip unknown section */ - drs.seek(head.secSizes[curSec++], athena::Current); + drs.seek(head.secSizes[curSec++], athena::SeekOrigin::Current); /* Read BABEDEAD Lights as Cycles emissives */ secStart = drs.position(); DNAMP1::MREA::ReadBabeDeadToBlender_1_2(os, drs); - drs.seek(secStart + head.secSizes[curSec++], athena::Begin); + drs.seek(secStart + head.secSizes[curSec++], athena::SeekOrigin::Begin); /* Origins to center of mass */ os << "bpy.context.view_layer.layer_collection.children['Collision'].hide_viewport = False\n" diff --git a/DataSpec/DNAMP2/MREA.hpp b/DataSpec/DNAMP2/MREA.hpp index d11a416ca..5e678d5b7 100644 --- a/DataSpec/DNAMP2/MREA.hpp +++ b/DataSpec/DNAMP2/MREA.hpp @@ -69,7 +69,7 @@ struct MREA { Value unk3SecIdx; Value egmcSecIdx; Value compressedBlockCount; - Seek<12, athena::Current> align1; + Seek<12, athena::SeekOrigin::Current> align1; Vector secSizes; }; diff --git a/DataSpec/DNAMP3/CHAR.cpp b/DataSpec/DNAMP3/CHAR.cpp index 8bea3561e..3836601d7 100644 --- a/DataSpec/DNAMP3/CHAR.cpp +++ b/DataSpec/DNAMP3/CHAR.cpp @@ -14,7 +14,7 @@ void CHAR::AnimationInfo::EVNT::SFXEvent::Enumerate(athena::io::IS if (extraType == 1) extraFloat = reader.readFloatBig(); else if (extraType == 2) - reader.seek(35, athena::Current); + reader.seek(35, athena::SeekOrigin::Current); } template <> @@ -29,7 +29,7 @@ void CHAR::AnimationInfo::EVNT::SFXEvent::Enumerate(athena::io::I if (extraType == 1) writer.writeFloatBig(extraFloat); else if (extraType == 2) - writer.seek(35, athena::Current); + writer.seek(35, athena::SeekOrigin::Current); } template <> diff --git a/DataSpec/DNAMP3/DNAMP3.cpp b/DataSpec/DNAMP3/DNAMP3.cpp index ee6089602..05158846c 100644 --- a/DataSpec/DNAMP3/DNAMP3.cpp +++ b/DataSpec/DNAMP3/DNAMP3.cpp @@ -90,7 +90,7 @@ void PAKBridge::build() { std::vector mapw; if (worldMapEnt) { PAKEntryReadStream rs = worldMapEnt->beginReadStream(m_node); - rs.seek(8, athena::Current); + rs.seek(8, athena::SeekOrigin::Current); atUint32 areaCount = rs.readUint32Big(); mapw.reserve(areaCount); for (atUint32 i = 0; i < areaCount; ++i) diff --git a/DataSpec/DNAMP3/MREA.cpp b/DataSpec/DNAMP3/MREA.cpp index b8d9b7211..a54712423 100644 --- a/DataSpec/DNAMP3/MREA.cpp +++ b/DataSpec/DNAMP3/MREA.cpp @@ -84,7 +84,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: atUint64 decompLen = drs.length(); mreaDecompOut.writeBytes(drs.readBytes(decompLen).get(), decompLen); mreaDecompOut.close(); - drs.seek(0, athena::Begin); + drs.seek(0, athena::SeekOrigin::Begin); /* Start up blender connection */ hecl::blender::Connection& conn = btok.getBlenderConnection(); @@ -118,7 +118,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: 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::SeekOrigin::Begin); std::vector vertAttribs; DNACMDL::GetVertexAttributes(matSet, vertAttribs); @@ -131,16 +131,16 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: MeshHeader mHeader; secStart = drs.position(); mHeader.read(drs); - drs.seek(secStart + head.secSizes[curSec++], athena::Begin); + drs.seek(secStart + head.secSizes[curSec++], athena::SeekOrigin::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::SeekOrigin::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::SeekOrigin::Current); + drs.seek(head.secSizes[curSec++], athena::SeekOrigin::Current); } /* Skip though WOBJs */ @@ -150,13 +150,13 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: /* Skip AROT */ if (secIdxIt->first == FOURCC('ROCT')) { - drs.seek(head.secSizes[curSec++], athena::Current); + drs.seek(head.secSizes[curSec++], athena::SeekOrigin::Current); ++secIdxIt; } /* Skip AABB */ if (secIdxIt->first == FOURCC('AABB')) { - drs.seek(head.secSizes[curSec++], athena::Current); + drs.seek(head.secSizes[curSec++], athena::SeekOrigin::Current); ++secIdxIt; } @@ -173,20 +173,20 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: /* Skip DEPS */ if (secIdxIt->first == FOURCC('DEPS')) { - drs.seek(head.secSizes[curSec++], athena::Current); + drs.seek(head.secSizes[curSec++], athena::SeekOrigin::Current); ++secIdxIt; } /* Skip SOBJ (SCLY) */ if (secIdxIt->first == FOURCC('SOBJ')) { for (atUint32 l = 0; l < head.sclyLayerCount; ++l) - drs.seek(head.secSizes[curSec++], athena::Current); + drs.seek(head.secSizes[curSec++], athena::SeekOrigin::Current); ++secIdxIt; } /* Skip SGEN */ if (secIdxIt->first == FOURCC('SGEN')) { - drs.seek(head.secSizes[curSec++], athena::Current); + drs.seek(head.secSizes[curSec++], athena::SeekOrigin::Current); ++secIdxIt; } @@ -197,7 +197,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: 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::SeekOrigin::Begin); ++secIdxIt; } @@ -205,7 +205,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: if (secIdxIt->first == FOURCC('LITE')) { secStart = drs.position(); ReadBabeDeadToBlender_3(os, drs); - drs.seek(secStart + head.secSizes[curSec++], athena::Begin); + drs.seek(secStart + head.secSizes[curSec++], athena::SeekOrigin::Begin); ++secIdxIt; } @@ -231,7 +231,7 @@ bool MREA::ExtractLayerDeps(PAKEntryReadStream& rs, PAKBridge::Level::Area& area StreamReader drs(rs, head.compressedBlockCount, head.secIndexCount); for (const std::pair& idx : drs.m_secIdxs) { if (idx.first == FOURCC('DEPS')) { - drs.seek(head.getSecOffset(idx.second), athena::Begin); + drs.seek(head.getSecOffset(idx.second), athena::SeekOrigin::Begin); DEPS deps; deps.read(drs); diff --git a/DataSpec/DNAMP3/MREA.hpp b/DataSpec/DNAMP3/MREA.hpp index 170a3c42e..35d234d54 100644 --- a/DataSpec/DNAMP3/MREA.hpp +++ b/DataSpec/DNAMP3/MREA.hpp @@ -25,7 +25,7 @@ struct MREA { Value secCount; Value compressedBlockCount; Value secIndexCount; - Seek<20, athena::Current> align1; + Seek<20, athena::SeekOrigin::Current> align1; Vector secSizes; atUint32 getSecOffset(atUint32 idx) const { diff --git a/DataSpec/DNAMP3/PAK.cpp b/DataSpec/DNAMP3/PAK.cpp index 23cb26fdd..7ebd29659 100644 --- a/DataSpec/DNAMP3/PAK.cpp +++ b/DataSpec/DNAMP3/PAK.cpp @@ -11,11 +11,11 @@ void PAK::Enumerate(athena::io::IStreamReader& reader) { if (m_header.version != 2) Log.report(logvisor::Fatal, fmt("unexpected PAK magic")); - reader.seek(8, athena::Current); + reader.seek(8, athena::SeekOrigin::Current); atUint32 strgSz = reader.readUint32Big(); - reader.seek(4, athena::Current); + reader.seek(4, athena::SeekOrigin::Current); atUint32 rshdSz = reader.readUint32Big(); - reader.seek(44, athena::Current); + reader.seek(44, athena::SeekOrigin::Current); atUint32 dataOffset = 128 + strgSz + rshdSz; atUint64 strgBase = reader.position(); @@ -26,7 +26,7 @@ void PAK::Enumerate(athena::io::IStreamReader& reader) { m_nameEntries.emplace_back(); m_nameEntries.back().read(reader); } - reader.seek(strgBase + strgSz, athena::Begin); + reader.seek(strgBase + strgSz, athena::SeekOrigin::Begin); atUint32 count = reader.readUint32Big(); m_entries.clear(); @@ -91,12 +91,12 @@ void PAK::Enumerate(athena::io::IStreamWriter& writer) { atUint32 dataPad = ((dataSz + 63) & ~63) - dataSz; dataSz += dataPad; writer.writeUint32Big(dataSz); - writer.seek(36, athena::Current); + writer.seek(36, athena::SeekOrigin::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::SeekOrigin::Current); writer.writeUint32Big((atUint32)m_entries.size()); for (const auto& entry : m_entries) { @@ -104,7 +104,7 @@ void PAK::Enumerate(athena::io::IStreamWriter& writer) { copy.offset -= dataOffset; copy.write(writer); } - writer.seek(rshdPad, athena::Current); + writer.seek(rshdPad, athena::SeekOrigin::Current); } template <> diff --git a/DataSpec/DNAMP3/PAK.hpp b/DataSpec/DNAMP3/PAK.hpp index 2d0463f01..d45fe4785 100644 --- a/DataSpec/DNAMP3/PAK.hpp +++ b/DataSpec/DNAMP3/PAK.hpp @@ -19,7 +19,7 @@ struct PAK : BigDNA { Value version; Value headSz; Value md5sum[16]; - Seek<40, athena::Current> seek; + Seek<40, athena::SeekOrigin::Current> seek; } m_header; struct NameEntry : BigDNA { diff --git a/DataSpec/DNAMP3/STRG.cpp b/DataSpec/DNAMP3/STRG.cpp index 282c0e843..a5de8ac98 100644 --- a/DataSpec/DNAMP3/STRG.cpp +++ b/DataSpec/DNAMP3/STRG.cpp @@ -42,7 +42,7 @@ void STRG::_read(athena::io::IStreamReader& reader) { for (atUint32 l = 0; l < langCount; ++l) { std::vector strs; for (atUint32 s = 0; s < strCount; ++s) { - reader.seek(strBase + strOffs[l * strCount + s], athena::Begin); + reader.seek(strBase + strOffs[l * strCount + s], athena::SeekOrigin::Begin); atUint32 len = reader.readUint32Big(); strs.emplace_back(reader.readString(len)); } diff --git a/DataSpec/SpecBase.hpp b/DataSpec/SpecBase.hpp index 5f0dbad36..0173e961a 100644 --- a/DataSpec/SpecBase.hpp +++ b/DataSpec/SpecBase.hpp @@ -1,7 +1,12 @@ #pragma once #include +#include #include +#include +#include +#include +#include #include "hecl/Database.hpp" #include "hecl/Blender/Token.hpp" diff --git a/DataSpec/SpecMP1.cpp b/DataSpec/SpecMP1.cpp index 4adbaa39e..29f3d8d3c 100644 --- a/DataSpec/SpecMP1.cpp +++ b/DataSpec/SpecMP1.cpp @@ -1155,7 +1155,7 @@ struct SpecMP1 : SpecBase { void writePakFileIndex(athena::io::FileWriter& w, const std::vector& tags, const std::vector>& index, atUint64 resTableOffset) override { - w.seek(resTableOffset, athena::Begin); + w.seek(resTableOffset, athena::SeekOrigin::Begin); auto it = tags.begin(); for (const auto& item : index) { diff --git a/Editor/ProjectManager.cpp b/Editor/ProjectManager.cpp index cd04bcfb7..a32454488 100644 --- a/Editor/ProjectManager.cpp +++ b/Editor/ProjectManager.cpp @@ -129,7 +129,7 @@ bool ProjectManager::openProject(hecl::SystemStringView path) { } r.reset(); - reader.seek(0, athena::Begin); + reader.seek(0, athena::SeekOrigin::Begin); if (!r.parse(&reader)) { return makeProj(true); } diff --git a/Editor/ProjectResourceFactoryBase.hpp b/Editor/ProjectResourceFactoryBase.hpp index 79df9f0ff..b729aa179 100644 --- a/Editor/ProjectResourceFactoryBase.hpp +++ b/Editor/ProjectResourceFactoryBase.hpp @@ -1,15 +1,20 @@ #pragma once -#include "hecl/ClientProcess.hpp" -#include "hecl/Database.hpp" -#include "Runtime/IFactory.hpp" +#include +#include +#include +#include +#include +#include + +#include "DataSpec/SpecBase.hpp" + #include "Runtime/CFactoryMgr.hpp" #include "Runtime/CResFactory.hpp" -#include "DataSpec/SpecBase.hpp" -#include +#include "Runtime/IFactory.hpp" -#include -#include +#include +#include namespace urde { diff --git a/Editor/ProjectResourceFactoryMP1.hpp b/Editor/ProjectResourceFactoryMP1.hpp index 2f23c8950..8839ba0fb 100644 --- a/Editor/ProjectResourceFactoryMP1.hpp +++ b/Editor/ProjectResourceFactoryMP1.hpp @@ -1,7 +1,7 @@ #pragma once -#include "ProjectResourceFactoryBase.hpp" -#include "CToken.hpp" +#include "Editor/ProjectResourceFactoryBase.hpp" +#include "Runtime/CToken.hpp" namespace urde { class MP1OriginalIDs; diff --git a/Editor/Space.hpp b/Editor/Space.hpp index 68d87f096..a0ae82b0f 100644 --- a/Editor/Space.hpp +++ b/Editor/Space.hpp @@ -42,7 +42,7 @@ public: GameMode }; - struct State : athena::io::DNAVYaml { + struct State : athena::io::DNAVYaml { Delete _d; }; static Space* NewSpaceFromConfigStream(ViewManager& vm, Space* parent, ConfigReader& r); diff --git a/Editor/ViewManager.cpp b/Editor/ViewManager.cpp index cb53a63fb..e5c4a8ede 100644 --- a/Editor/ViewManager.cpp +++ b/Editor/ViewManager.cpp @@ -346,6 +346,7 @@ bool ViewManager::proc() { 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_cvarManager.proc(); m_projManager.mainUpdate(); if (m_testGameView) diff --git a/Runtime/Audio/CAudioGroupSet.hpp b/Runtime/Audio/CAudioGroupSet.hpp index 7f6e12b74..ef9d37f2e 100644 --- a/Runtime/Audio/CAudioGroupSet.hpp +++ b/Runtime/Audio/CAudioGroupSet.hpp @@ -1,11 +1,15 @@ #pragma once -#include "RetroTypes.hpp" -#include "CFactoryMgr.hpp" -#include "IObj.hpp" -#include "CToken.hpp" -#include "IOStreams.hpp" -#include "amuse/AudioGroupData.hpp" +#include +#include + +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/IObj.hpp" +#include "Runtime/RetroTypes.hpp" + +#include namespace urde { diff --git a/Runtime/Audio/CAudioSys.hpp b/Runtime/Audio/CAudioSys.hpp index f90733efa..dd0cfd1d8 100644 --- a/Runtime/Audio/CAudioSys.hpp +++ b/Runtime/Audio/CAudioSys.hpp @@ -1,15 +1,16 @@ #pragma once -#include "../GCNTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "amuse/amuse.hpp" -#include "boo/audiodev/IAudioVoiceEngine.hpp" -#include "RetroTypes.hpp" -#include "CToken.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/RetroTypes.hpp" + +#include +#include +#include namespace urde { -class CSimplePool; class CAudioGroupSet; +class CSimplePool; CFactoryFnReturn FAudioTranslationTableFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms, CObjectReference* selfRef); diff --git a/Runtime/Audio/CMidiManager.hpp b/Runtime/Audio/CMidiManager.hpp index 278953f67..3abb1b374 100644 --- a/Runtime/Audio/CMidiManager.hpp +++ b/Runtime/Audio/CMidiManager.hpp @@ -1,6 +1,8 @@ #pragma once -#include "CSfxManager.hpp" +#include + +#include "Runtime/Audio/CSfxManager.hpp" namespace urde { diff --git a/Runtime/Audio/CSfxManager.hpp b/Runtime/Audio/CSfxManager.hpp index 2e2384d47..9d13697c9 100644 --- a/Runtime/Audio/CSfxManager.hpp +++ b/Runtime/Audio/CSfxManager.hpp @@ -1,10 +1,14 @@ #pragma once +#include +#include #include -#include "../RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "CAudioSys.hpp" + #include "DNAMP1/SFX/SFX.h" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Audio/CAudioSys.hpp" + +#include namespace urde { diff --git a/Runtime/Audio/CStaticAudioPlayer.hpp b/Runtime/Audio/CStaticAudioPlayer.hpp index b8bbb69b5..b2ee5551e 100644 --- a/Runtime/Audio/CStaticAudioPlayer.hpp +++ b/Runtime/Audio/CStaticAudioPlayer.hpp @@ -1,10 +1,17 @@ #pragma once -#include "CAudioSys.hpp" -#include "RetroTypes.hpp" +#include +#include +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Audio/CAudioSys.hpp" + #include "g721.h" -#include "boo/audiodev/IAudioVoice.hpp" -#include "boo/audiodev/IAudioVoiceEngine.hpp" + +#include +#include namespace urde { class IDvdRequest; diff --git a/Runtime/Audio/CStreamAudioManager.cpp b/Runtime/Audio/CStreamAudioManager.cpp index 6bb845958..dce6a7e4a 100644 --- a/Runtime/Audio/CStreamAudioManager.cpp +++ b/Runtime/Audio/CStreamAudioManager.cpp @@ -862,7 +862,7 @@ void CStreamAudioManager::Start(bool oneshot, std::string_view fileName, float v SDSPPlayer& p = s_Players[oneshot]; SDSPPlayer& qp = s_QueuedPlayers[oneshot]; - if (p.x10_playState != EPlayerState::Stopped && CStringExtras::CompareCaseInsensitive(fileName, p.x0_fileName)) { + if (p.x10_playState != EPlayerState::Stopped && !CStringExtras::CompareCaseInsensitive(fileName, p.x0_fileName)) { /* Enque new stream */ qp = SDSPPlayer(EPlayerState::FadeIn, fileName, volume, fadeIn, fadeOut, -1, music); Stop(oneshot, p.x0_fileName); @@ -900,10 +900,10 @@ void CStreamAudioManager::Stop(bool oneshot, std::string_view fileName) { SDSPPlayer& p = s_Players[oneshot]; SDSPPlayer& qp = s_QueuedPlayers[oneshot]; - if (!CStringExtras::CompareCaseInsensitive(fileName, qp.x0_fileName)) { + if (CStringExtras::CompareCaseInsensitive(fileName, qp.x0_fileName)) { /* Cancel enqueued file */ qp = SDSPPlayer(); - } else if (!CStringExtras::CompareCaseInsensitive(fileName, p.x0_fileName) && p.x20_internalHandle != -1 && + } else if (CStringExtras::CompareCaseInsensitive(fileName, p.x0_fileName) && p.x20_internalHandle != -1 && p.x10_playState != EPlayerState::Stopped) { /* Fade out or stop */ if (p.x1c_fadeOut <= FLT_EPSILON) diff --git a/Runtime/Audio/CStreamAudioManager.hpp b/Runtime/Audio/CStreamAudioManager.hpp index 056ecd31a..10b5b1479 100644 --- a/Runtime/Audio/CStreamAudioManager.hpp +++ b/Runtime/Audio/CStreamAudioManager.hpp @@ -1,6 +1,8 @@ #pragma once -#include "RetroTypes.hpp" +#include + +#include "Runtime/GCNTypes.hpp" namespace urde { diff --git a/Runtime/AutoMapper/CAutoMapper.hpp b/Runtime/AutoMapper/CAutoMapper.hpp index 4acdbf00a..9f77f2cdb 100644 --- a/Runtime/AutoMapper/CAutoMapper.hpp +++ b/Runtime/AutoMapper/CAutoMapper.hpp @@ -1,18 +1,28 @@ #pragma once -#include "RetroTypes.hpp" -#include "CInGameTweakManagerBase.hpp" -#include "zeus/CQuaternion.hpp" -#include "zeus/CTransform.hpp" -#include "zeus/CVector3f.hpp" -#include "MP1/CInGameGuiManager.hpp" +#include +#include +#include +#include + +#include "Runtime/CInGameTweakManagerBase.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/MP1/CInGameGuiManager.hpp" + +#include +#include +#include +#include +#include namespace urde { -struct CFinalInput; -class IWorld; +class CMapUniverse; class CMapWorldInfo; class CStateManager; -class CMapUniverse; +class IWorld; + +struct CFinalInput; class CAutoMapper { public: diff --git a/Runtime/AutoMapper/CMapArea.hpp b/Runtime/AutoMapper/CMapArea.hpp index a452a9113..0e20960d6 100644 --- a/Runtime/AutoMapper/CMapArea.hpp +++ b/Runtime/AutoMapper/CMapArea.hpp @@ -1,13 +1,18 @@ #pragma once -#include "RetroTypes.hpp" -#include "CResFactory.hpp" -#include "zeus/CAABox.hpp" -#include "zeus/CVector3f.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "Graphics/CLineRenderer.hpp" -#include "Graphics/Shaders/CMapSurfaceShader.hpp" -#include "CMappableObject.hpp" +#include +#include + +#include "Runtime/CResFactory.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/AutoMapper/CMappableObject.hpp" +#include "Runtime/Graphics/CLineRenderer.hpp" +#include "Runtime/Graphics/Shaders/CMapSurfaceShader.hpp" + +#include + +#include +#include namespace urde { class IWorld; diff --git a/Runtime/AutoMapper/CMapUniverse.hpp b/Runtime/AutoMapper/CMapUniverse.hpp index e708349d7..989a629f5 100644 --- a/Runtime/AutoMapper/CMapUniverse.hpp +++ b/Runtime/AutoMapper/CMapUniverse.hpp @@ -1,12 +1,16 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CTransform.hpp" -#include "IFactory.hpp" -#include "CToken.hpp" -#include "CMapArea.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/IFactory.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/AutoMapper/CMapArea.hpp" + +#include +#include +#include namespace urde { class CStateManager; diff --git a/Runtime/AutoMapper/CMapWorld.hpp b/Runtime/AutoMapper/CMapWorld.hpp index 2c5c50589..6babb6ebd 100644 --- a/Runtime/AutoMapper/CMapWorld.hpp +++ b/Runtime/AutoMapper/CMapWorld.hpp @@ -1,16 +1,21 @@ #pragma once -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/CTransform.hpp" -#include "CMapArea.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/AutoMapper/CMapArea.hpp" + +#include +#include +#include namespace urde { -class IWorld; class CMapWorldInfo; class CStateManager; +class IWorld; + class CMapWorld { public: /* skDrawProfileItemNames; */ diff --git a/Runtime/AutoMapper/CMapWorldInfo.hpp b/Runtime/AutoMapper/CMapWorldInfo.hpp index 6306a1982..f8e8b3490 100644 --- a/Runtime/AutoMapper/CMapWorldInfo.hpp +++ b/Runtime/AutoMapper/CMapWorldInfo.hpp @@ -1,6 +1,9 @@ #pragma once -#include "RetroTypes.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" namespace urde { class CSaveWorld; diff --git a/Runtime/AutoMapper/CMappableObject.hpp b/Runtime/AutoMapper/CMappableObject.hpp index dde05b877..53cde42bb 100644 --- a/Runtime/AutoMapper/CMappableObject.hpp +++ b/Runtime/AutoMapper/CMappableObject.hpp @@ -1,16 +1,20 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CAABox.hpp" -#include "zeus/CTransform.hpp" -#include "GameGlobalObjects.hpp" -#include "Graphics/Shaders/CMapSurfaceShader.hpp" -#include "Graphics/Shaders/CTexturedQuadFilter.hpp" -#include "Graphics/CLineRenderer.hpp" +#include +#include + +#include "Runtime/GameGlobalObjects.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/CLineRenderer.hpp" +#include "Runtime/Graphics/Shaders/CMapSurfaceShader.hpp" +#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp" + +#include +#include namespace urde { -class CStateManager; class CMapWorldInfo; +class CStateManager; class CMappableObject { static boo::ObjToken g_doorVbo; diff --git a/Runtime/CArchitectureMessage.hpp b/Runtime/CArchitectureMessage.hpp index 54d62c51c..1a7926879 100644 --- a/Runtime/CArchitectureMessage.hpp +++ b/Runtime/CArchitectureMessage.hpp @@ -1,8 +1,10 @@ #pragma once -#include "GCNTypes.hpp" -#include "Input/CFinalInput.hpp" -#include "rstl.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Input/CFinalInput.hpp" namespace urde { class CIOWin; diff --git a/Runtime/CArchitectureQueue.hpp b/Runtime/CArchitectureQueue.hpp index ee2010b6f..8aae965a0 100644 --- a/Runtime/CArchitectureQueue.hpp +++ b/Runtime/CArchitectureQueue.hpp @@ -1,7 +1,7 @@ #pragma once #include -#include "CArchitectureMessage.hpp" +#include "Runtime/CArchitectureMessage.hpp" namespace urde { diff --git a/Runtime/CBasics.hpp b/Runtime/CBasics.hpp index c80118b05..431a2143c 100644 --- a/Runtime/CBasics.hpp +++ b/Runtime/CBasics.hpp @@ -4,7 +4,7 @@ #include #include -#include "RetroTypes.hpp" +#include "Runtime/GCNTypes.hpp" namespace urde { diff --git a/Runtime/CBasicsPC.cpp b/Runtime/CBasicsPC.cpp index 5dd488971..904af0f50 100644 --- a/Runtime/CBasicsPC.cpp +++ b/Runtime/CBasicsPC.cpp @@ -59,16 +59,14 @@ u64 CBasics::GetGCTicks() { const u64 CBasics::SECONDS_TO_2000 = 946684800LL; const u64 CBasics::TICKS_PER_SECOND = 60750000LL; -#ifndef _WIN32 static struct tm* localtime_r(const time_t& time, struct tm& timeSt, long& gmtOff) { +#ifndef _WIN32 auto ret = ::localtime_r(&time, &timeSt); if (!ret) return nullptr; gmtOff = ret->tm_gmtoff; return ret; -} #else -static struct tm* localtime_r(const time_t& time, struct tm& timeSt, long& gmtOff) { struct tm _gmSt; auto reta = localtime_s(&timeSt, &time); auto retb = gmtime_s(&_gmSt, &time); @@ -76,8 +74,8 @@ static struct tm* localtime_r(const time_t& time, struct tm& timeSt, long& gmtOf return nullptr; gmtOff = mktime(&timeSt) - mktime(&_gmSt); return &timeSt; -} #endif +} OSTime CBasics::ToWiiTime(std::chrono::system_clock::time_point time) { auto sec = std::chrono::time_point_cast(time); diff --git a/Runtime/CCRC32.cpp b/Runtime/CCRC32.cpp index 28952d1ca..4b6e3df98 100644 --- a/Runtime/CCRC32.cpp +++ b/Runtime/CCRC32.cpp @@ -1,8 +1,10 @@ -#include "CCRC32.hpp" +#include "Runtime/CCRC32.hpp" + +#include namespace urde { - -const uint32_t CCRC32::crc32Table[256] = { +namespace { +constexpr std::array crc32Table{ 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, @@ -31,14 +33,19 @@ const uint32_t CCRC32::crc32Table[256] = { 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, - 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D}; + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D, +}; + +constexpr uint32_t permute(uint32_t checksum, uint8_t b) { return (checksum >> 8) ^ crc32Table[(checksum & 0xFF) ^ b]; } +} // Anonymous namespace uint32_t CCRC32::Calculate(const void* data, uint32_t length) { - if (!data || length == 0) + if (data == nullptr || length == 0) { return 0; + } uint32_t checksum = 0xFFFFFFFF; - const uint8_t* buf = reinterpret_cast(data); + const uint8_t* buf = static_cast(data); uint32_t words = length / 4; while ((words--) > 0) { checksum = permute(checksum, *buf++); @@ -48,8 +55,9 @@ uint32_t CCRC32::Calculate(const void* data, uint32_t length) { } uint32_t rem = length % 4; - while ((rem--) > 0) + while ((rem--) > 0) { checksum = permute(checksum, *buf++); + } return checksum; } diff --git a/Runtime/CCRC32.hpp b/Runtime/CCRC32.hpp index 1ab178e7e..2bd7961c2 100644 --- a/Runtime/CCRC32.hpp +++ b/Runtime/CCRC32.hpp @@ -1,14 +1,10 @@ #pragma once + #include namespace urde { class CCRC32 { - static const uint32_t crc32Table[256]; - static uint32_t permute(uint32_t checksum, uint8_t b) { - return (checksum >> 8) ^ crc32Table[(checksum & 0xFF) ^ b]; - } - public: static uint32_t Calculate(const void* data, uint32_t length); }; diff --git a/Runtime/CDependencyGroup.hpp b/Runtime/CDependencyGroup.hpp index 08e63d2b7..603fb2471 100644 --- a/Runtime/CDependencyGroup.hpp +++ b/Runtime/CDependencyGroup.hpp @@ -1,6 +1,7 @@ #pragma once -#include "CFactoryMgr.hpp" +#include +#include "Runtime/CFactoryMgr.hpp" namespace urde { class CDependencyGroup { diff --git a/Runtime/CDvdFile.hpp b/Runtime/CDvdFile.hpp index 668239c82..5cb6007f6 100644 --- a/Runtime/CDvdFile.hpp +++ b/Runtime/CDvdFile.hpp @@ -1,13 +1,18 @@ #pragma once -#include "RetroTypes.hpp" -#include "athena/FileReader.hpp" - -#include -#include +#include #include +#include +#include +#include +#include #include +#include "Runtime/GCNTypes.hpp" +#include "Runtime/RetroTypes.hpp" + +#include + namespace urde { enum class ESeekOrigin { Begin = 0, Cur = 1, End = 2 }; diff --git a/Runtime/CFactoryMgr.hpp b/Runtime/CFactoryMgr.hpp index ec29fd9b2..722f30634 100644 --- a/Runtime/CFactoryMgr.hpp +++ b/Runtime/CFactoryMgr.hpp @@ -1,9 +1,10 @@ #pragma once #include -#include "RetroTypes.hpp" -#include "IOStreams.hpp" -#include "IFactory.hpp" + +#include "Runtime/IFactory.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { struct SObjectTag; diff --git a/Runtime/CGameAllocator.hpp b/Runtime/CGameAllocator.hpp index 46bcfaabf..a80500ca9 100644 --- a/Runtime/CGameAllocator.hpp +++ b/Runtime/CGameAllocator.hpp @@ -1,6 +1,10 @@ #pragma once -#include "RetroTypes.hpp" +#include +#include +#include + +#include "Runtime/RetroTypes.hpp" namespace urde { class CGameAllocator { diff --git a/Runtime/CGameHintInfo.hpp b/Runtime/CGameHintInfo.hpp index 9cfca51a7..7b0e75ee3 100644 --- a/Runtime/CGameHintInfo.hpp +++ b/Runtime/CGameHintInfo.hpp @@ -1,7 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "IFactory.hpp" +#include +#include + +#include "Runtime/IFactory.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { class CGameHintInfo { diff --git a/Runtime/CGameOptions.hpp b/Runtime/CGameOptions.hpp index 6e2ebff13..cc290db78 100644 --- a/Runtime/CGameOptions.hpp +++ b/Runtime/CGameOptions.hpp @@ -1,9 +1,11 @@ #pragma once #include -#include "RetroTypes.hpp" -#include "Audio/CAudioSys.hpp" -#include "CSaveWorld.hpp" +#include + +#include "Runtime/CSaveWorld.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Audio/CAudioSys.hpp" namespace urde { struct CFinalInput; diff --git a/Runtime/CGameOptionsTouchBar.hpp b/Runtime/CGameOptionsTouchBar.hpp index 361c4ea7f..302aef98a 100644 --- a/Runtime/CGameOptionsTouchBar.hpp +++ b/Runtime/CGameOptionsTouchBar.hpp @@ -1,7 +1,7 @@ #pragma once -#include #include +#include namespace urde { diff --git a/Runtime/CGameState.hpp b/Runtime/CGameState.hpp index 2d573b706..0c422a7c6 100644 --- a/Runtime/CGameState.hpp +++ b/Runtime/CGameState.hpp @@ -1,15 +1,18 @@ #pragma once #include -#include "CBasics.hpp" -#include "CPlayerState.hpp" -#include "CGameOptions.hpp" -#include "CRelayTracker.hpp" -#include "World/CWorldTransManager.hpp" -#include "AutoMapper/CMapWorldInfo.hpp" -#include "World/CWorld.hpp" +#include + #include "DataSpec/DNACommon/DNACommon.hpp" +#include "Runtime/CBasics.hpp" +#include "Runtime/CGameOptions.hpp" +#include "Runtime/CPlayerState.hpp" +#include "Runtime/CRelayTracker.hpp" +#include "Runtime/AutoMapper/CMapWorldInfo.hpp" +#include "Runtime/World/CWorld.hpp" +#include "Runtime/World/CWorldTransManager.hpp" + namespace urde { class CSaveWorldMemory; diff --git a/Runtime/CIOWin.hpp b/Runtime/CIOWin.hpp index 14b69b75e..4852e719e 100644 --- a/Runtime/CIOWin.hpp +++ b/Runtime/CIOWin.hpp @@ -1,9 +1,10 @@ #pragma once -#include +#include #include +#include -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { class CArchitectureMessage; diff --git a/Runtime/CIOWinManager.hpp b/Runtime/CIOWinManager.hpp index b2b645995..9aadc67b8 100644 --- a/Runtime/CIOWinManager.hpp +++ b/Runtime/CIOWinManager.hpp @@ -1,10 +1,11 @@ #pragma once -#include #include -#include "CIOWin.hpp" -#include "rstl.hpp" -#include "CArchitectureQueue.hpp" +#include + +#include "Runtime/CArchitectureQueue.hpp" +#include "Runtime/CIOWin.hpp" +#include "Runtime/rstl.hpp" namespace urde { diff --git a/Runtime/CInGameTweakManagerBase.hpp b/Runtime/CInGameTweakManagerBase.hpp index 88d69fe58..126098f00 100644 --- a/Runtime/CInGameTweakManagerBase.hpp +++ b/Runtime/CInGameTweakManagerBase.hpp @@ -3,7 +3,7 @@ #include #include -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { diff --git a/Runtime/CMFGameBase.hpp b/Runtime/CMFGameBase.hpp index 9599e0f31..c99416549 100644 --- a/Runtime/CMFGameBase.hpp +++ b/Runtime/CMFGameBase.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CIOWin.hpp" +#include "Runtime/CIOWin.hpp" namespace urde { diff --git a/Runtime/CMainFlowBase.hpp b/Runtime/CMainFlowBase.hpp index 44a9835f8..22a17f39f 100644 --- a/Runtime/CMainFlowBase.hpp +++ b/Runtime/CMainFlowBase.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CIOWin.hpp" +#include "Runtime/CIOWin.hpp" namespace urde { diff --git a/Runtime/CMemoryCardSys.cpp b/Runtime/CMemoryCardSys.cpp index 52efd7cdf..de25f76f6 100644 --- a/Runtime/CMemoryCardSys.cpp +++ b/Runtime/CMemoryCardSys.cpp @@ -11,7 +11,7 @@ namespace urde { using ECardResult = kabufuda::ECardResult; static kabufuda::SystemString g_CardImagePaths[2] = {}; -static kabufuda::Card g_CardStates[2] = {{"GM8E", "01"}, {"GM8E", "01"}}; +static kabufuda::Card g_CardStates[2] = {kabufuda::Card{"GM8E", "01"}, kabufuda::Card{"GM8E", "01"}}; // static kabufuda::ECardResult g_OpResults[2] = {}; CSaveWorldIntermediate::CSaveWorldIntermediate(CAssetId mlvl, CAssetId savw) : x0_mlvlId(mlvl), x8_savwId(savw) { diff --git a/Runtime/CMemoryCardSys.hpp b/Runtime/CMemoryCardSys.hpp index 64c25c9a2..82b71a236 100644 --- a/Runtime/CMemoryCardSys.hpp +++ b/Runtime/CMemoryCardSys.hpp @@ -1,17 +1,23 @@ #pragma once -#include "CToken.hpp" -#include "World/CWorld.hpp" -#include "CGameHintInfo.hpp" -#include "CSaveWorld.hpp" -#include "GuiSys/CStringTable.hpp" -#include "kabufuda/Card.hpp" +#include +#include +#include #include +#include "Runtime/CGameHintInfo.hpp" +#include "Runtime/CSaveWorld.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/GuiSys/CStringTable.hpp" +#include "Runtime/World/CWorld.hpp" + +#include + namespace urde { class CDummyWorld; -class CStringTable; class CSimplePool; +class CStringTable; class CSaveWorldMemory { friend class CMemoryCardSys; diff --git a/Runtime/CObjectList.hpp b/Runtime/CObjectList.hpp index aa92513bb..15222dae8 100644 --- a/Runtime/CObjectList.hpp +++ b/Runtime/CObjectList.hpp @@ -1,7 +1,7 @@ #pragma once -#include "World/CEntity.hpp" -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CEntity.hpp" namespace urde { diff --git a/Runtime/CPakFile.cpp b/Runtime/CPakFile.cpp index bb81bc631..4c6c25494 100644 --- a/Runtime/CPakFile.cpp +++ b/Runtime/CPakFile.cpp @@ -18,9 +18,11 @@ CPakFile::~CPakFile() { } const SObjectTag* CPakFile::GetResIdByName(std::string_view name) const { - for (const std::pair& p : x54_nameList) - if (!CStringExtras::CompareCaseInsensitive(p.first.c_str(), name)) + for (const std::pair& p : x54_nameList) { + if (CStringExtras::CompareCaseInsensitive(p.first, name)) { return &p.second; + } + } return nullptr; } diff --git a/Runtime/CPakFile.hpp b/Runtime/CPakFile.hpp index 0f6b7c084..0ed918f83 100644 --- a/Runtime/CPakFile.hpp +++ b/Runtime/CPakFile.hpp @@ -1,11 +1,14 @@ #pragma once +#include +#include #include -#include "RetroTypes.hpp" -#include "CStringExtras.hpp" -#include "CDvdFile.hpp" -#include "CDvdRequest.hpp" -#include "CFactoryMgr.hpp" + +#include "Runtime/CDvdFile.hpp" +#include "Runtime/CDvdRequest.hpp" +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/CStringExtras.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { diff --git a/Runtime/CPlayMovieBase.hpp b/Runtime/CPlayMovieBase.hpp index 996baa16e..068ef615a 100644 --- a/Runtime/CPlayMovieBase.hpp +++ b/Runtime/CPlayMovieBase.hpp @@ -1,7 +1,7 @@ #pragma once -#include "CIOWin.hpp" -#include "Graphics/CMoviePlayer.hpp" +#include "Runtime/CIOWin.hpp" +#include "Runtime/Graphics/CMoviePlayer.hpp" namespace urde { diff --git a/Runtime/CPlayerState.cpp b/Runtime/CPlayerState.cpp index b94083b53..2a5373e4f 100644 --- a/Runtime/CPlayerState.cpp +++ b/Runtime/CPlayerState.cpp @@ -1,18 +1,26 @@ -#include "CPlayerState.hpp" -#include "IOStreams.hpp" -#include "zeus/Math.hpp" -#include "CStateManager.hpp" -#include "Camera/CCameraManager.hpp" -#include "Camera/CFirstPersonCamera.hpp" -#include "CMemoryCardSys.hpp" -#include "GameGlobalObjects.hpp" -#include "TCastTo.hpp" +#include "Runtime/CPlayerState.hpp" + +#include +#include + +#include "Runtime/CMemoryCardSys.hpp" +#include "Runtime/CStateManager.hpp" +#include "Runtime/GameGlobalObjects.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/Camera/CCameraManager.hpp" +#include "Runtime/Camera/CFirstPersonCamera.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path + +#include namespace urde { -const u32 CPlayerState::PowerUpMaxValues[41] = {1, 1, 1, 1, 250, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 14, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; +namespace { +constexpr std::array PowerUpMaxValues{ + 1, 1, 1, 1, 250, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 14, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +}; -const char* CPlayerState::PowerUpNames[41] = { +[[maybe_unused]] constexpr std::array PowerUpNames{ "Power Beam", "Ice Beam", "Wave Beam", @@ -56,6 +64,15 @@ const char* CPlayerState::PowerUpNames[41] = { "Artifact of Newborn", }; +constexpr std::array costs{ + 5, 10, 10, 10, 1, +}; + +constexpr std::array ComboAmmoPeriods{ + 0.2f, 0.1f, 0.2f, 0.2f, 1.f, +}; +} // Anonymous namespace + CPlayerState::CPlayerState() : x188_staticIntf(5) { x0_24_alive = true; x24_powerups.resize(41); @@ -73,12 +90,13 @@ CPlayerState::CPlayerState(CBitStreamReader& stream) : x188_staticIntf(5) { x8_currentBeam = EBeamId(stream.ReadEncoded(CBitStreamReader::GetBitCount(5))); x20_currentSuit = EPlayerSuit(stream.ReadEncoded(CBitStreamReader::GetBitCount(4))); x24_powerups.resize(41); - for (u32 i = 0; i < x24_powerups.size(); ++i) { - if (PowerUpMaxValues[i] == 0) + for (size_t i = 0; i < x24_powerups.size(); ++i) { + if (PowerUpMaxValues[i] == 0) { continue; + } - u32 a = u32(stream.ReadEncoded(CBitStreamReader::GetBitCount(PowerUpMaxValues[i]))); - u32 b = u32(stream.ReadEncoded(CBitStreamReader::GetBitCount(PowerUpMaxValues[i]))); + const u32 a = u32(stream.ReadEncoded(CBitStreamReader::GetBitCount(PowerUpMaxValues[i]))); + const u32 b = u32(stream.ReadEncoded(CBitStreamReader::GetBitCount(PowerUpMaxValues[i]))); x24_powerups[i] = CPowerUp(a, b); } @@ -103,7 +121,7 @@ void CPlayerState::PutTo(CBitStreamWriter& stream) { stream.WriteEncoded(hp.iHP, 32); stream.WriteEncoded(u32(x8_currentBeam), CBitStreamWriter::GetBitCount(5)); stream.WriteEncoded(u32(x20_currentSuit), CBitStreamWriter::GetBitCount(4)); - for (u32 i = 0; i < x24_powerups.size(); ++i) { + for (size_t i = 0; i < x24_powerups.size(); ++i) { const CPowerUp& pup = x24_powerups[i]; stream.WriteEncoded(pup.x0_amount, CBitStreamWriter::GetBitCount(PowerUpMaxValues[i])); stream.WriteEncoded(pup.x4_capacity, CBitStreamWriter::GetBitCount(PowerUpMaxValues[i])); @@ -120,13 +138,9 @@ void CPlayerState::PutTo(CBitStreamWriter& stream) { stream.WriteEncoded(x180_scanCompletionRate.second, CBitStreamWriter::GetBitCount(0x100)); } -static const u32 costs[] = {5, 10, 10, 10, 1}; +u32 CPlayerState::GetMissileCostForAltAttack() const { return costs[size_t(x8_currentBeam)]; } -u32 CPlayerState::GetMissileCostForAltAttack() const { return costs[u32(x8_currentBeam)]; } - -static const float ComboAmmoPeriods[] = {0.2f, 0.1f, 0.2f, 0.2f, 1.f}; - -float CPlayerState::GetComboFireAmmoPeriod() const { return ComboAmmoPeriods[u32(x8_currentBeam)]; } +float CPlayerState::GetComboFireAmmoPeriod() const { return ComboAmmoPeriods[size_t(x8_currentBeam)]; } u32 CPlayerState::CalculateItemCollectionRate() const { u32 total = GetItemCapacity(EItemType::PowerBombs); @@ -373,6 +387,8 @@ void CPlayerState::InitializeScanTimes() { x170_scanTimes.emplace_back(state.first, 0.f); } +u32 CPlayerState::GetPowerUpMaxValue(EItemType type) { return PowerUpMaxValues[size_t(type)]; } + const std::unordered_map CPlayerState::g_TypeNameMap = { {"powerbeam"sv, EItemType::PowerBeam}, {"icebeam"sv, EItemType::IceBeam}, diff --git a/Runtime/CPlayerState.hpp b/Runtime/CPlayerState.hpp index 773fa8e76..ead556565 100644 --- a/Runtime/CPlayerState.hpp +++ b/Runtime/CPlayerState.hpp @@ -1,12 +1,14 @@ #pragma once -#include "RetroTypes.hpp" -#include "CBasics.hpp" -#include "CStaticInterference.hpp" -#include "IOStreams.hpp" -#include "rstl.hpp" -#include "World/CHealthInfo.hpp" +#include #include +#include + +#include "Runtime/CStaticInterference.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/World/CHealthInfo.hpp" namespace urde { @@ -88,8 +90,6 @@ public: private: static const std::unordered_map g_TypeNameMap; - static const u32 PowerUpMaxValues[41]; - static const char* PowerUpNames[41]; struct CPowerUp { u32 x0_amount = 0; u32 x4_capacity = 0; @@ -174,7 +174,7 @@ public: CPlayerState(); CPlayerState(CBitStreamReader& stream); void PutTo(CBitStreamWriter& stream); - static u32 GetPowerUpMaxValue(EItemType type) { return PowerUpMaxValues[u32(type)]; } + static u32 GetPowerUpMaxValue(EItemType type); static EItemType ItemNameToType(std::string_view name); bool CanTakeDamage() const { return m_canTakeDamage; } void SetCanTakeDamage(bool c) { m_canTakeDamage = c; } diff --git a/Runtime/CRandom16.hpp b/Runtime/CRandom16.hpp index aa66b60fb..3d82cd886 100644 --- a/Runtime/CRandom16.hpp +++ b/Runtime/CRandom16.hpp @@ -1,6 +1,6 @@ #pragma once -#include "GCNTypes.hpp" +#include "Runtime/GCNTypes.hpp" namespace urde { diff --git a/Runtime/CRelayTracker.hpp b/Runtime/CRelayTracker.hpp index c34015918..cd6509d93 100644 --- a/Runtime/CRelayTracker.hpp +++ b/Runtime/CRelayTracker.hpp @@ -1,12 +1,15 @@ #pragma once -#include "IOStreams.hpp" -#include "World/ScriptObjectSupport.hpp" -#include "RetroTypes.hpp" +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/ScriptObjectSupport.hpp" namespace urde { -class CStateManager; class CSaveWorld; +class CStateManager; + #if 0 struct CMailMessage { diff --git a/Runtime/CResFactory.hpp b/Runtime/CResFactory.hpp index a52e85397..c789d2bfb 100644 --- a/Runtime/CResFactory.hpp +++ b/Runtime/CResFactory.hpp @@ -1,10 +1,15 @@ #pragma once +#include +#include #include -#include "IFactory.hpp" -#include "CResLoader.hpp" -#include "IVParamObj.hpp" -#include "CToken.hpp" +#include + +#include "Runtime/CResLoader.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/IFactory.hpp" +#include "Runtime/IVParamObj.hpp" +#include "Runtime/MP1/MP1OriginalIDs.hpp" namespace urde { class IDvdRequest; diff --git a/Runtime/CResLoader.cpp b/Runtime/CResLoader.cpp index b4f0580f3..df607e59f 100644 --- a/Runtime/CResLoader.cpp +++ b/Runtime/CResLoader.cpp @@ -7,17 +7,19 @@ static logvisor::Module Log("CResLoader"); CResLoader::CResLoader() { x48_curPak = x18_pakLoadedList.end(); } const std::vector* CResLoader::GetTagListForFile(std::string_view name) const { - std::string namePak = std::string(name) + ".upak"; - for (const std::unique_ptr& pak : x18_pakLoadedList) - if (!CStringExtras::CompareCaseInsensitive(namePak, pak->x18_path)) + const std::string namePak = std::string(name).append(".upak"); + for (const std::unique_ptr& pak : x18_pakLoadedList) { + if (CStringExtras::CompareCaseInsensitive(namePak, pak->x18_path)) { return &pak->GetDepList(); + } + } return nullptr; } void CResLoader::AddPakFileAsync(std::string_view name, bool buildDepList, bool worldPak) { - std::string namePak = std::string(name) + ".upak"; - if (CDvdFile::FileExists(namePak.c_str())) { - x30_pakLoadingList.emplace_back(new CPakFile(namePak, buildDepList, worldPak)); + const std::string namePak = std::string(name).append(".upak"); + if (CDvdFile::FileExists(namePak)) { + x30_pakLoadingList.emplace_back(std::make_unique(namePak, buildDepList, worldPak)); ++x44_pakLoadingCount; } } @@ -35,11 +37,13 @@ void CResLoader::WaitForPakFileLoadingComplete() { std::unique_ptr CResLoader::LoadNewResourcePartSync(const SObjectTag& tag, u32 length, u32 offset, void* extBuf) { void* buf = extBuf; - CPakFile* file = FindResourceForLoad(tag); - if (!buf) + if (buf == nullptr) { buf = new u8[length]; + } + + CPakFile* const file = FindResourceForLoad(tag); file->SyncSeekRead(buf, length, ESeekOrigin::Begin, x50_cachedResInfo->GetOffset() + offset); - return std::unique_ptr(new athena::io::MemoryReader((atUint8*)buf, length, !extBuf)); + return std::make_unique(buf, length, !extBuf); } void CResLoader::LoadMemResourceSync(const SObjectTag& tag, std::unique_ptr& bufOut, int* sizeOut) { @@ -52,29 +56,36 @@ void CResLoader::LoadMemResourceSync(const SObjectTag& tag, std::unique_ptr CResLoader::LoadResourceFromMemorySync(const SObjectTag& tag, const void* buf) { FindResourceForLoad(tag); - CInputStream* newStrm = new athena::io::MemoryReader((atUint8*)buf, x50_cachedResInfo->GetSize()); + std::unique_ptr newStrm = std::make_unique(buf, x50_cachedResInfo->GetSize()); if (x50_cachedResInfo->IsCompressed()) { newStrm->readUint32Big(); - newStrm = new CZipInputStream(std::unique_ptr(newStrm)); + newStrm = std::make_unique(std::move(newStrm)); } - return std::unique_ptr(newStrm); + return newStrm; } std::unique_ptr CResLoader::LoadNewResourceSync(const SObjectTag& tag, void* extBuf) { - void* buf = extBuf; - if (CPakFile* file = FindResourceForLoad(tag)) { - size_t resSz = ROUND_UP_32(x50_cachedResInfo->GetSize()); - if (!buf) + if (CPakFile* const file = FindResourceForLoad(tag)) { + const size_t resSz = ROUND_UP_32(x50_cachedResInfo->GetSize()); + + void* buf = extBuf; + if (buf == nullptr) { buf = new u8[resSz]; + } + file->SyncSeekRead(buf, resSz, ESeekOrigin::Begin, x50_cachedResInfo->GetOffset()); - CInputStream* newStrm = new athena::io::MemoryReader((atUint8*)buf, resSz, !extBuf); + + const bool takeOwnership = extBuf == nullptr; + std::unique_ptr newStrm = std::make_unique(buf, resSz, takeOwnership); if (x50_cachedResInfo->IsCompressed()) { newStrm->readUint32Big(); - newStrm = new CZipInputStream(std::unique_ptr(newStrm)); + newStrm = std::make_unique(std::move(newStrm)); } - return std::unique_ptr(newStrm); + + return newStrm; } - return {}; + + return nullptr; } std::shared_ptr CResLoader::LoadResourcePartAsync(const SObjectTag& tag, u32 off, u32 size, void* buf) { @@ -106,7 +117,7 @@ std::unique_ptr CResLoader::LoadNewResourcePartSync(const urde::SObjectTag void CResLoader::GetTagListForFile(const char* pakName, std::vector& out) const { std::string path = std::string(pakName) + ".upak"; for (const std::unique_ptr& file : x18_pakLoadedList) { - if (!CStringExtras::CompareCaseInsensitive(file->GetPath(), path)) { + if (CStringExtras::CompareCaseInsensitive(file->GetPath(), path)) { auto& depList = file->GetDepList(); out.reserve(depList.size()); for (const auto& dep : depList) { diff --git a/Runtime/CResLoader.hpp b/Runtime/CResLoader.hpp index 85837d8f4..e9edf7b32 100644 --- a/Runtime/CResLoader.hpp +++ b/Runtime/CResLoader.hpp @@ -1,14 +1,18 @@ #pragma once +#include +#include #include #include -#include "RetroTypes.hpp" -#include "CPakFile.hpp" -#include "IOStreams.hpp" +#include + +#include "Runtime/CPakFile.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { -struct SObjectTag; class IDvdRequest; +struct SObjectTag; class CResLoader { std::string m_loaderPath; diff --git a/Runtime/CSaveWorld.hpp b/Runtime/CSaveWorld.hpp index 030e84341..75403fd74 100644 --- a/Runtime/CSaveWorld.hpp +++ b/Runtime/CSaveWorld.hpp @@ -1,8 +1,11 @@ #pragma once -#include "RetroTypes.hpp" +#include + #include "DNACommon/SAVWCommon.hpp" -#include "CFactoryMgr.hpp" + +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { diff --git a/Runtime/CScannableObjectInfo.hpp b/Runtime/CScannableObjectInfo.hpp index 424720951..79096333e 100644 --- a/Runtime/CScannableObjectInfo.hpp +++ b/Runtime/CScannableObjectInfo.hpp @@ -1,9 +1,11 @@ #pragma once -#include "RetroTypes.hpp" -#include "IFactory.hpp" -#include "CToken.hpp" -#include "zeus/CVector2i.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/IFactory.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" + +#include namespace urde { class CScannableObjectInfo { diff --git a/Runtime/CSimplePool.cpp b/Runtime/CSimplePool.cpp index a957af16c..bc07d761c 100644 --- a/Runtime/CSimplePool.cpp +++ b/Runtime/CSimplePool.cpp @@ -11,15 +11,17 @@ CSimplePool::CSimplePool(IFactory& factory) CSimplePool::~CSimplePool() { assert(x8_resources.empty() && "Dangling CSimplePool resources detected"); } CToken CSimplePool::GetObj(const SObjectTag& tag, const CVParamTransfer& paramXfer) { - if (!tag) + if (!tag) { return {}; + } - auto iter = x8_resources.find(tag); - if (iter != x8_resources.end()) + const auto iter = x8_resources.find(tag); + if (iter != x8_resources.end()) { return CToken(iter->second); + } - CObjectReference* ret = new CObjectReference(*this, std::unique_ptr(), tag, paramXfer); - x8_resources.emplace(std::make_pair((SObjectTag)tag, std::move(ret))); + auto* const ret = new CObjectReference(*this, nullptr, tag, paramXfer); + x8_resources.emplace(tag, ret); return CToken(ret); } diff --git a/Runtime/CSimplePool.hpp b/Runtime/CSimplePool.hpp index 5797c7a30..b237c1f87 100644 --- a/Runtime/CSimplePool.hpp +++ b/Runtime/CSimplePool.hpp @@ -1,13 +1,15 @@ #pragma once -#include "IObjectStore.hpp" -#include "RetroTypes.hpp" -#include "IVParamObj.hpp" #include +#include + +#include "Runtime/IObjectStore.hpp" +#include "Runtime/IVParamObj.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { -class IFactory; class CObjectReference; +class IFactory; class CSimplePool : public IObjectStore { protected: diff --git a/Runtime/CSortedLists.cpp b/Runtime/CSortedLists.cpp index 65f73da09..d31fe1306 100644 --- a/Runtime/CSortedLists.cpp +++ b/Runtime/CSortedLists.cpp @@ -1,20 +1,32 @@ -#include "CSortedLists.hpp" -#include "World/CActor.hpp" +#include "Runtime/CSortedLists.hpp" + +#include +#include +#include "Runtime/World/CActor.hpp" namespace urde { - +namespace { template -static std::remove_reference_t()[0])>& AccessElement(T& arr, S idx) { - assert(std::extent::value > idx && idx >= 0); +auto AccessElement(T& arr, S idx) -> typename T::reference { + assert(std::size(arr) > static_cast(idx) && idx >= 0); return arr[idx]; } +template +auto AccessElement(const T& arr, S idx) -> typename T::const_reference { + assert(std::size(arr) > static_cast(idx) && idx >= 0); + return arr[idx]; +} +} // Anonymous namespace + CSortedListManager::CSortedListManager() { Reset(); } void CSortedListManager::Reset() { - std::fill(std::begin(x0_nodes), std::end(x0_nodes), SNode()); - for (int i = 0; i < 6; ++i) - xb000_sortedLists[i].Reset(); + x0_nodes.fill(SNode{}); + + for (auto& list : xb000_sortedLists) { + list.Reset(); + } } void CSortedListManager::AddToLinkedList(s16 nodeId, s16& headId, s16& tailId) const { @@ -33,32 +45,39 @@ void CSortedListManager::AddToLinkedList(s16 nodeId, s16& headId, s16& tailId) c } void CSortedListManager::RemoveFromList(ESortedList list, s16 idx) { - SSortedList& sl = xb000_sortedLists[u32(list)]; + const auto listIndex = static_cast(list); + SSortedList& sl = xb000_sortedLists[listIndex]; + while (idx < sl.x800_size - 1) { - AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx + 1)).x1c_selfIdxs[int(list)] = idx; + AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx + 1)).x1c_selfIdxs[listIndex] = idx; AccessElement(sl.x0_ids, idx) = AccessElement(sl.x0_ids, idx + 1); ++idx; } + --sl.x800_size; } void CSortedListManager::MoveInList(ESortedList list, s16 idx) { - SSortedList& sl = xb000_sortedLists[int(list)]; + const auto listIndex = static_cast(list); + SSortedList& sl = xb000_sortedLists[listIndex]; + while (true) { - if (idx > 0 && AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx - 1)).x4_box[int(list)] > - AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx)).x4_box[int(list)]) { - AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx - 1)).x1c_selfIdxs[int(list)] = idx; - AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx)).x1c_selfIdxs[int(list)] = idx - 1; + if (idx > 0 && AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx - 1)).x4_box[listIndex] > + AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx)).x4_box[listIndex]) { + AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx - 1)).x1c_selfIdxs[listIndex] = idx; + AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx)).x1c_selfIdxs[listIndex] = idx - 1; std::swap(AccessElement(sl.x0_ids, idx), AccessElement(sl.x0_ids, idx - 1)); --idx; } else { - if (idx >= sl.x800_size - 1) + if (idx >= sl.x800_size - 1) { return; - if (AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx + 1)).x4_box[int(list)] >= - AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx)).x4_box[int(list)]) + } + if (AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx + 1)).x4_box[listIndex] >= + AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx)).x4_box[listIndex]) { return; - AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx + 1)).x1c_selfIdxs[int(list)] = idx; - AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx)).x1c_selfIdxs[int(list)] = idx + 1; + } + AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx + 1)).x1c_selfIdxs[listIndex] = idx; + AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx)).x1c_selfIdxs[listIndex] = idx + 1; std::swap(AccessElement(sl.x0_ids, idx), AccessElement(sl.x0_ids, idx + 1)); ++idx; } @@ -66,11 +85,13 @@ void CSortedListManager::MoveInList(ESortedList list, s16 idx) { } void CSortedListManager::InsertInList(ESortedList list, SNode& node) { - SSortedList& sl = xb000_sortedLists[int(list)]; + const auto listIndex = static_cast(list); + SSortedList& sl = xb000_sortedLists[listIndex]; int insIdx = 0; + for (int i = sl.x800_size; i > 0;) { /* Binary search cycle to find insert index */ - if (AccessElement(x0_nodes, AccessElement(sl.x0_ids, insIdx + i / 2)).x4_box[int(list)] < node.x4_box[int(list)]) { + if (AccessElement(x0_nodes, AccessElement(sl.x0_ids, insIdx + i / 2)).x4_box[listIndex] < node.x4_box[listIndex]) { /* Upper */ insIdx = insIdx + i / 2 + 1; i = i - i / 2 - 1; @@ -82,22 +103,24 @@ void CSortedListManager::InsertInList(ESortedList list, SNode& node) { /* Shift ids for insert */ for (int i = sl.x800_size; i > insIdx; --i) { - AccessElement(x0_nodes, AccessElement(sl.x0_ids, i - 1)).x1c_selfIdxs[int(list)] = i; + AccessElement(x0_nodes, AccessElement(sl.x0_ids, i - 1)).x1c_selfIdxs[listIndex] = i; AccessElement(sl.x0_ids, i) = AccessElement(sl.x0_ids, i - 1); } /* Do insert */ AccessElement(sl.x0_ids, insIdx) = node.x0_actor->GetUniqueId().Value(); - node.x1c_selfIdxs[int(list)] = s16(insIdx); + node.x1c_selfIdxs[listIndex] = s16(insIdx); ++sl.x800_size; } s16 CSortedListManager::FindInListUpper(ESortedList list, float val) const { - const SSortedList& sl = xb000_sortedLists[int(list)]; + const auto listIndex = static_cast(list); + const SSortedList& sl = xb000_sortedLists[listIndex]; int idx = 0; + for (int i = sl.x800_size; i > 0;) { /* Binary search cycle to find index */ - if (!(val < AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx + i / 2)).x4_box[int(list)])) { + if (!(val < AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx + i / 2)).x4_box[listIndex])) { /* Upper */ idx = idx + i / 2 + 1; i = i - i / 2 - 1; @@ -106,15 +129,18 @@ s16 CSortedListManager::FindInListUpper(ESortedList list, float val) const { i /= 2; } } + return idx; } s16 CSortedListManager::FindInListLower(ESortedList list, float val) const { - const SSortedList& sl = xb000_sortedLists[int(list)]; + const auto listIndex = static_cast(list); + const SSortedList& sl = xb000_sortedLists[listIndex]; int idx = 0; + for (int i = sl.x800_size; i > 0;) { /* Binary search cycle to find index */ - if (AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx + i / 2)).x4_box[int(list)] < val) { + if (AccessElement(x0_nodes, AccessElement(sl.x0_ids, idx + i / 2)).x4_box[listIndex] < val) { /* Upper */ idx = idx + i / 2 + 1; i = i - i / 2 - 1; @@ -123,27 +149,28 @@ s16 CSortedListManager::FindInListLower(ESortedList list, float val) const { i /= 2; } } + return idx; } s16 CSortedListManager::ConstructIntersectionArray(const zeus::CAABox& aabb) { - int minXa = FindInListLower(ESortedList::MinX, aabb.min.x()); - int maxXa = FindInListUpper(ESortedList::MinX, aabb.max.x()); - int minXb = FindInListLower(ESortedList::MaxX, aabb.min.x()); - int maxXb = FindInListUpper(ESortedList::MaxX, aabb.max.x()); - int xEnd = std::min(int(xb000_sortedLists[3].x800_size) - maxXb, minXa) + (maxXb + (maxXa - minXa) - minXb) / 2; + const int minXa = FindInListLower(ESortedList::MinX, aabb.min.x()); + const int maxXa = FindInListUpper(ESortedList::MinX, aabb.max.x()); + const int minXb = FindInListLower(ESortedList::MaxX, aabb.min.x()); + const int maxXb = FindInListUpper(ESortedList::MaxX, aabb.max.x()); + const int xEnd = std::min(int(xb000_sortedLists[3].x800_size) - maxXb, minXa) + (maxXb + (maxXa - minXa) - minXb) / 2; - int minYa = FindInListLower(ESortedList::MinY, aabb.min.y()); - int maxYa = FindInListUpper(ESortedList::MinY, aabb.max.y()); - int minYb = FindInListLower(ESortedList::MaxY, aabb.min.y()); - int maxYb = FindInListUpper(ESortedList::MaxY, aabb.max.y()); - int yEnd = std::min(int(xb000_sortedLists[4].x800_size) - maxYb, minYa) + (maxYb + (maxYa - minYa) - minYb) / 2; + const int minYa = FindInListLower(ESortedList::MinY, aabb.min.y()); + const int maxYa = FindInListUpper(ESortedList::MinY, aabb.max.y()); + const int minYb = FindInListLower(ESortedList::MaxY, aabb.min.y()); + const int maxYb = FindInListUpper(ESortedList::MaxY, aabb.max.y()); + const int yEnd = std::min(int(xb000_sortedLists[4].x800_size) - maxYb, minYa) + (maxYb + (maxYa - minYa) - minYb) / 2; - int minZa = FindInListLower(ESortedList::MinZ, aabb.min.z()); - int maxZa = FindInListUpper(ESortedList::MinZ, aabb.max.z()); - int minZb = FindInListLower(ESortedList::MaxZ, aabb.min.z()); - int maxZb = FindInListUpper(ESortedList::MaxZ, aabb.max.z()); - int zEnd = std::min(int(xb000_sortedLists[5].x800_size) - maxZb, minZa) + (maxZb + (maxZa - minZa) - minZb) / 2; + const int minZa = FindInListLower(ESortedList::MinZ, aabb.min.z()); + const int maxZa = FindInListUpper(ESortedList::MinZ, aabb.max.z()); + const int minZb = FindInListLower(ESortedList::MaxZ, aabb.min.z()); + const int maxZb = FindInListUpper(ESortedList::MaxZ, aabb.max.z()); + const int zEnd = std::min(int(xb000_sortedLists[5].x800_size) - maxZb, minZa) + (maxZb + (maxZa - minZa) - minZb) / 2; if (xEnd < yEnd && xEnd < zEnd) { return CalculateIntersections(ESortedList::MinX, ESortedList::MaxX, minXa, maxXa, minXb, maxXb, ESortedList::MinY, @@ -160,31 +187,38 @@ s16 CSortedListManager::ConstructIntersectionArray(const zeus::CAABox& aabb) { s16 CSortedListManager::CalculateIntersections(ESortedList la, ESortedList lb, s16 a, s16 b, s16 c, s16 d, ESortedList slA, ESortedList slB, ESortedList slC, ESortedList slD, const zeus::CAABox& aabb) { + const auto listAIndex = static_cast(la); + const auto listBIndex = static_cast(lb); + s16 headId = -1; s16 tailId = -1; - for (int i = a; i < b; ++i) - AddToLinkedList(AccessElement(xb000_sortedLists[int(la)].x0_ids, i), headId, tailId); - for (int i = c; i < d; ++i) - AddToLinkedList(AccessElement(xb000_sortedLists[int(lb)].x0_ids, i), headId, tailId); + for (int i = a; i < b; ++i) { + AddToLinkedList(AccessElement(xb000_sortedLists[listAIndex].x0_ids, i), headId, tailId); + } + for (int i = c; i < d; ++i) { + AddToLinkedList(AccessElement(xb000_sortedLists[listBIndex].x0_ids, i), headId, tailId); + } - if (a < xb000_sortedLists[int(lb)].x800_size - d) { + if (a < xb000_sortedLists[listBIndex].x800_size - d) { for (int i = 0; i < a; ++i) { - s16 id = AccessElement(xb000_sortedLists[int(la)].x0_ids, i); - if (AccessElement(x0_nodes, id).x4_box[int(lb)] > aabb[int(lb)]) + const s16 id = AccessElement(xb000_sortedLists[listAIndex].x0_ids, i); + if (AccessElement(x0_nodes, id).x4_box[listBIndex] > aabb[listBIndex]) { AddToLinkedList(id, headId, tailId); + } } } else { - for (int i = d; i < xb000_sortedLists[int(lb)].x800_size; ++i) { - s16 id = AccessElement(xb000_sortedLists[int(lb)].x0_ids, i); - if (AccessElement(x0_nodes, id).x4_box[int(la)] < aabb[int(la)]) + for (int i = d; i < xb000_sortedLists[listBIndex].x800_size; ++i) { + const s16 id = AccessElement(xb000_sortedLists[listBIndex].x0_ids, i); + if (AccessElement(x0_nodes, id).x4_box[listAIndex] < aabb[listAIndex]) { AddToLinkedList(id, headId, tailId); + } } } for (s16* id = &headId; *id != -1;) { SNode& node = AccessElement(x0_nodes, *id); - if (node.x4_box[int(slA)] > aabb[int(slB)] || node.x4_box[int(slB)] < aabb[int(slA)] || - node.x4_box[int(slC)] > aabb[int(slD)] || node.x4_box[int(slD)] < aabb[int(slC)]) { + if (node.x4_box[size_t(slA)] > aabb[size_t(slB)] || node.x4_box[size_t(slB)] < aabb[size_t(slA)] || + node.x4_box[size_t(slC)] > aabb[size_t(slD)] || node.x4_box[size_t(slD)] < aabb[size_t(slC)]) { /* Not intersecting; remove from chain */ *id = node.x28_next; node.x28_next = -1; diff --git a/Runtime/CSortedLists.hpp b/Runtime/CSortedLists.hpp index 65ea95427..f251ff662 100644 --- a/Runtime/CSortedLists.hpp +++ b/Runtime/CSortedLists.hpp @@ -1,16 +1,19 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CAABox.hpp" -#include "Collision/CMaterialFilter.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Collision/CMaterialFilter.hpp" + +#include namespace urde { -enum ESortedList { MinX, MinY, MinZ, MaxX, MaxY, MaxZ }; +enum class ESortedList { MinX, MinY, MinZ, MaxX, MaxY, MaxZ }; struct SSortedList { - s16 x0_ids[1024]; + std::array x0_ids; u32 x800_size = 0; - void Reset() { std::fill(std::begin(x0_ids), std::end(x0_ids), -1); } + void Reset() { x0_ids.fill(-1); } SSortedList() { Reset(); } }; @@ -19,14 +22,14 @@ class CSortedListManager { struct SNode { const CActor* x0_actor = nullptr; zeus::CAABox x4_box = zeus::skNullBox; - s16 x1c_selfIdxs[6] = {-1, -1, -1, -1, -1, -1}; + std::array x1c_selfIdxs{-1, -1, -1, -1, -1, -1}; s16 x28_next = -1; bool x2a_populated = false; SNode() = default; SNode(const CActor* act, const zeus::CAABox& aabb) : x0_actor(act), x4_box(aabb), x2a_populated(true) {} }; - SNode x0_nodes[1024]; - SSortedList xb000_sortedLists[6]; + std::array x0_nodes; + std::array xb000_sortedLists; void Reset(); void AddToLinkedList(s16 a, s16& b, s16& c) const; void RemoveFromList(ESortedList, s16); diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index eac8d45c6..e67c83e8e 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -24,7 +24,7 @@ #include "AutoMapper/CMapWorldInfo.hpp" #include "Particle/CGenDescription.hpp" #include "CMemoryCardSys.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "World/CScriptSpecialFunction.hpp" #include "CTimeProvider.hpp" #include "Camera/CBallCamera.hpp" @@ -71,7 +71,7 @@ CStateManager::CStateManager(const std::weak_ptr& relayTracker, , x8c0_mapWorldInfo(mwInfo) , x8c4_worldTransManager(wtMgr) , x8c8_worldLayerState(layerState) { - x86c_stateManagerContainer.reset(new CStateManagerContainer); + x86c_stateManagerContainer = std::make_unique(); x870_cameraManager = &x86c_stateManagerContainer->x0_cameraManager; x874_sortedListManager = &x86c_stateManagerContainer->x3c0_sortedListManager; x878_weaponManager = &x86c_stateManagerContainer->xe3d8_weaponManager; @@ -1292,21 +1292,21 @@ void CStateManager::LoadScriptObjects(TAreaId aid, CInputStream& in, std::vector std::pair CStateManager::LoadScriptObject(TAreaId aid, EScriptObjectType type, u32 length, CInputStream& in) { - TEditorId id = in.readUint32Big(); - u32 connCount = in.readUint32Big(); + const TEditorId id = in.readUint32Big(); + const u32 connCount = in.readUint32Big(); length -= 8; std::vector conns; conns.reserve(connCount); - for (int i = 0; i < connCount; ++i) { - EScriptObjectState state = EScriptObjectState(in.readUint32Big()); - EScriptObjectMessage msg = EScriptObjectMessage(in.readUint32Big()); - TEditorId target = in.readUint32Big(); + for (u32 i = 0; i < connCount; ++i) { + const auto state = EScriptObjectState(in.readUint32Big()); + const auto msg = EScriptObjectMessage(in.readUint32Big()); + const TEditorId target = in.readUint32Big(); length -= 12; conns.push_back(SConnection{state, msg, target}); } - u32 propCount = in.readUint32Big(); + const u32 propCount = in.readUint32Big(); length -= 4; - auto startPos = in.position(); + const auto startPos = in.position(); bool error = false; FScriptLoader loader = {}; @@ -1315,7 +1315,7 @@ std::pair CStateManager::LoadScriptObject(TAreaId aid, ESc CEntity* ent = nullptr; if (loader) { - CEntityInfo info(aid, conns, id); + const CEntityInfo info(aid, std::move(conns), id); ent = loader(*this, in, propCount, info); } else { error = true; @@ -2146,7 +2146,7 @@ void CStateManager::InitializeState(CAssetId mlvlId, TAreaId aid, CAssetId mreaI if (xb3c_initPhase == EInitPhase::LoadWorld) { CreateStandardGameObjects(); - x850_world.reset(new CWorld(*g_SimplePool, *g_ResFactory, mlvlId)); + x850_world = std::make_unique(*g_SimplePool, *g_ResFactory, mlvlId); xb3c_initPhase = EInitPhase::LoadFirstArea; } @@ -2216,17 +2216,18 @@ void CStateManager::InitializeState(CAssetId mlvlId, TAreaId aid, CAssetId mreaI } void CStateManager::CreateStandardGameObjects() { - float height = g_tweakPlayer->GetPlayerHeight(); - float xyHe = g_tweakPlayer->GetPlayerXYHalfExtent(); - float stepUp = g_tweakPlayer->GetStepUpHeight(); - float stepDown = g_tweakPlayer->GetStepDownHeight(); - float ballRadius = g_tweakPlayer->GetPlayerBallHalfExtent(); - zeus::CAABox pBounds = {{-xyHe, -xyHe, 0.f}, {xyHe, xyHe, height}}; - auto q = zeus::CQuaternion::fromAxisAngle(zeus::CVector3f{0.f, 0.f, 1.f}, zeus::degToRad(129.6f)); - x84c_player.reset( - new CPlayer(AllocateUniqueId(), zeus::CTransform(q), pBounds, g_tweakPlayerRes->xc4_ballTransitionsANCS, - zeus::CVector3f{1.65f, 1.65f, 1.65f}, 200.f, stepUp, stepDown, ballRadius, - CMaterialList(EMaterialTypes::Player, EMaterialTypes::Solid, EMaterialTypes::GroundCollider))); + const float height = g_tweakPlayer->GetPlayerHeight(); + const float xyHe = g_tweakPlayer->GetPlayerXYHalfExtent(); + const float stepUp = g_tweakPlayer->GetStepUpHeight(); + const float stepDown = g_tweakPlayer->GetStepDownHeight(); + const float ballRadius = g_tweakPlayer->GetPlayerBallHalfExtent(); + const zeus::CAABox pBounds = {{-xyHe, -xyHe, 0.f}, {xyHe, xyHe, height}}; + const auto q = zeus::CQuaternion::fromAxisAngle(zeus::CVector3f{0.f, 0.f, 1.f}, zeus::degToRad(129.6f)); + + x84c_player = std::make_unique( + AllocateUniqueId(), zeus::CTransform(q), pBounds, g_tweakPlayerRes->xc4_ballTransitionsANCS, + zeus::CVector3f{1.65f, 1.65f, 1.65f}, 200.f, stepUp, stepDown, ballRadius, + CMaterialList(EMaterialTypes::Player, EMaterialTypes::Solid, EMaterialTypes::GroundCollider)); AddObject(*x84c_player); x870_cameraManager->CreateStandardCameras(*this); } diff --git a/Runtime/CStateManager.hpp b/Runtime/CStateManager.hpp index 05b3cffb1..7788d4f59 100644 --- a/Runtime/CStateManager.hpp +++ b/Runtime/CStateManager.hpp @@ -1,49 +1,61 @@ #pragma once +#include +#include #include +#include #include -#include "CBasics.hpp" -#include "World/ScriptObjectSupport.hpp" -#include "GameObjectLists.hpp" -#include "Camera/CCameraManager.hpp" -#include "Camera/CCameraFilter.hpp" -#include "CRandom16.hpp" -#include "zeus/CAABox.hpp" -#include "Weapon/CWeaponMgr.hpp" -#include "World/CAi.hpp" -#include "CToken.hpp" -#include "World/ScriptLoader.hpp" -#include "Input/CFinalInput.hpp" -#include "CSortedLists.hpp" -#include "World/CFluidPlaneManager.hpp" -#include "World/CEnvFxManager.hpp" -#include "World/CActorModelParticles.hpp" -#include "Input/CRumbleManager.hpp" -#include "Camera/CCameraShakeData.hpp" -#include "Graphics/Shaders/CColoredQuadFilter.hpp" +#include +#include +#include + +#include "Runtime/CBasics.hpp" +#include "Runtime/CRandom16.hpp" +#include "Runtime/CSortedLists.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Camera/CCameraFilter.hpp" +#include "Runtime/Camera/CCameraManager.hpp" +#include "Runtime/Camera/CCameraShakeData.hpp" +#include "Runtime/GameObjectLists.hpp" +#include "Runtime/Graphics/Shaders/CColoredQuadFilter.hpp" +#include "Runtime/Input/CFinalInput.hpp" +#include "Runtime/Input/CRumbleManager.hpp" +#include "Runtime/Weapon/CWeaponMgr.hpp" +#include "Runtime/World/CActorModelParticles.hpp" +#include "Runtime/World/CAi.hpp" +#include "Runtime/World/CEnvFxManager.hpp" +#include "Runtime/World/CFluidPlaneManager.hpp" +#include "Runtime/World/ScriptLoader.hpp" +#include "Runtime/World/ScriptObjectSupport.hpp" + +#include +#include +#include namespace urde { -class CRelayTracker; -class CMapWorldInfo; -class CPlayerState; -class CWorldTransManager; -class CObjectList; -class CSortedListManager; -class CFluidPlaneManager; -class CEnvFxManager; -class CActorModelParticles; -class CTeamAiTypes; -class CRumbleManager; class CActor; -class CLight; +class CActorModelParticles; class CDamageInfo; +class CEnvFxManager; +class CFluidPlaneManager; +class CLight; +class CMapWorldInfo; class CMaterialFilter; -struct CFinalInput; +class CObjectList; class CPlayer; -class CWorld; -class CTexture; -class CWorldLayerState; +class CPlayerState; class CProjectedShadow; +class CRelayTracker; +class CRumbleManager; +class CSortedListManager; +class CTeamAiTypes; +class CTexture; +class CWorld; +class CWorldLayerState; +class CWorldTransManager; + +struct CFinalInput; namespace MP1 { class CMFGameLoader; diff --git a/Runtime/CStaticInterference.hpp b/Runtime/CStaticInterference.hpp index dce04963d..9e2718912 100644 --- a/Runtime/CStaticInterference.hpp +++ b/Runtime/CStaticInterference.hpp @@ -1,7 +1,7 @@ #pragma once #include -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { class CStateManager; diff --git a/Runtime/CStopwatch.hpp b/Runtime/CStopwatch.hpp index 0341aaab0..8d1d5fa30 100644 --- a/Runtime/CStopwatch.hpp +++ b/Runtime/CStopwatch.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include namespace urde { class CStopwatch { diff --git a/Runtime/CStringExtras.hpp b/Runtime/CStringExtras.hpp index 2c7d30363..afa6f4505 100644 --- a/Runtime/CStringExtras.hpp +++ b/Runtime/CStringExtras.hpp @@ -1,29 +1,39 @@ #pragma once +#include +#include #include -#include namespace urde { class CStringExtras { public: - static int CompareCaseInsensitive(const char* a, const char* b) { -#if _WIN32 - return _stricmp(a, b); -#else - return strcasecmp(a, b); -#endif - } - static int CompareCaseInsensitive(std::string_view a, std::string_view b) { - return CompareCaseInsensitive(a.data(), b.data()); + // Checks if the provided views into string data can be considered equal or not based on + // whether or not all their characters are equal to one another in a character insensitive manner. + // + // NOTE: This differs slightly from the actual version of this function within the game executable + // in order to better accomodate string views and potentially non-null-terminated string data. + // + // In the game executable, the function essentially behaves like strcasecmp in that it returns + // an int indicating whether or not the first argument is less than, equal to, + // or greater than the second argument. Given no usages in the code depend on the less than or + // greater than cases, but rather just care about whether or not the strings are equal to one + // another, this is a safe change to make. + // + static bool CompareCaseInsensitive(std::string_view a, std::string_view b) { + return std::equal(a.begin(), a.end(), b.begin(), b.end(), [](char lhs, char rhs) { + return std::tolower(lhs) == std::tolower(rhs); + }); } static int IndexOfSubstring(std::string_view haystack, std::string_view needle) { std::string str(haystack); - std::transform(str.begin(), str.end(), str.begin(), tolower); - std::string::size_type s = str.find(needle); - if (s == std::string::npos) + std::transform(str.begin(), str.end(), str.begin(), + [](char c) { return std::tolower(static_cast(c)); }); + const std::string::size_type s = str.find(needle); + if (s == std::string::npos) { return -1; + } return s; } }; diff --git a/Runtime/CToken.cpp b/Runtime/CToken.cpp index d3cc11850..a82937eaf 100644 --- a/Runtime/CToken.cpp +++ b/Runtime/CToken.cpp @@ -16,7 +16,7 @@ u16 CObjectReference::RemoveReference() { CObjectReference::CObjectReference(IObjectStore& objStore, std::unique_ptr&& obj, const SObjectTag& objTag, CVParamTransfer buildParams) -: x4_objTag(objTag), xC_objectStore(&objStore), x10_object(std::move(obj)), x14_params(buildParams) {} +: x4_objTag(objTag), xC_objectStore(&objStore), x10_object(std::move(obj)), x14_params(std::move(buildParams)) {} CObjectReference::CObjectReference(std::unique_ptr&& obj) : x10_object(std::move(obj)) {} void CObjectReference::Unlock() { @@ -128,7 +128,7 @@ CToken::CToken(const CToken& other) : x0_objRef(other.x0_objRef) { Lock(); } } -CToken::CToken(CToken&& other) : x0_objRef(other.x0_objRef), x4_lockHeld(other.x4_lockHeld) { +CToken::CToken(CToken&& other) noexcept : x0_objRef(other.x0_objRef), x4_lockHeld(other.x4_lockHeld) { other.x0_objRef = nullptr; other.x4_lockHeld = false; } diff --git a/Runtime/CToken.hpp b/Runtime/CToken.hpp index ac5921532..906786aa1 100644 --- a/Runtime/CToken.hpp +++ b/Runtime/CToken.hpp @@ -1,19 +1,21 @@ #pragma once #include -#include "IObj.hpp" -#include "RetroTypes.hpp" -#include "IVParamObj.hpp" -#include "IObjectStore.hpp" -#include "IFactory.hpp" + +#include "Runtime/IFactory.hpp" +#include "Runtime/IObj.hpp" +#include "Runtime/IObjectStore.hpp" +#include "Runtime/IVParamObj.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { class IObjectStore; /** Shared data-structure for CToken references, analogous to std::shared_ptr */ class CObjectReference { - friend class CToken; friend class CSimplePool; + friend class CToken; + u16 x0_refCount = 0; u16 x2_lockCount = 0; bool x3_loading = false; /* Rightmost bit of lockCount */ @@ -60,8 +62,9 @@ public: * This class is analogous to std::shared_ptr and C++11 rvalues have been implemented accordingly * (default/empty constructor, move constructor/assign) */ class CToken { - friend class CSimplePool; friend class CModel; + friend class CSimplePool; + CObjectReference* x0_objRef = nullptr; bool x4_lockHeld = false; @@ -82,7 +85,7 @@ public: CToken& operator=(CToken&& other); CToken() = default; CToken(const CToken& other); - CToken(CToken&& other); + CToken(CToken&& other) noexcept; CToken(IObj* obj); CToken(std::unique_ptr&& obj); const SObjectTag* GetObjectTag() const; diff --git a/Runtime/Camera/CBallCamera.cpp b/Runtime/Camera/CBallCamera.cpp index 1b632c84d..fd1e6437a 100644 --- a/Runtime/Camera/CBallCamera.cpp +++ b/Runtime/Camera/CBallCamera.cpp @@ -1,6 +1,6 @@ #include "GameGlobalObjects.hpp" #include "CBallCamera.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" #include "Collision/CCollisionActor.hpp" #include "World/CPlayer.hpp" diff --git a/Runtime/Camera/CBallCamera.hpp b/Runtime/Camera/CBallCamera.hpp index bcc4d52d4..617cfd889 100644 --- a/Runtime/Camera/CBallCamera.hpp +++ b/Runtime/Camera/CBallCamera.hpp @@ -1,7 +1,15 @@ #pragma once -#include "CGameCamera.hpp" -#include "CCameraSpline.hpp" +#include +#include +#include + +#include "Runtime/Camera/CCameraSpline.hpp" +#include "Runtime/Camera/CGameCamera.hpp" + +#include +#include +#include namespace urde { class CPlayer; diff --git a/Runtime/Camera/CCameraFilter.hpp b/Runtime/Camera/CCameraFilter.hpp index c68be2306..027bf2466 100644 --- a/Runtime/Camera/CCameraFilter.hpp +++ b/Runtime/Camera/CCameraFilter.hpp @@ -1,10 +1,14 @@ #pragma once -#include "zeus/CColor.hpp" -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "Graphics/Shaders/CCameraBlurFilter.hpp" -#include "Graphics/Shaders/CXRayBlurFilter.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/Shaders/CCameraBlurFilter.hpp" +#include "Runtime/Graphics/Shaders/CXRayBlurFilter.hpp" + +#include namespace urde { class CTexture; diff --git a/Runtime/Camera/CCameraManager.cpp b/Runtime/Camera/CCameraManager.cpp index bc9bc6166..67309e6d7 100644 --- a/Runtime/Camera/CCameraManager.cpp +++ b/Runtime/Camera/CCameraManager.cpp @@ -5,7 +5,7 @@ #include "World/CScriptWater.hpp" #include "World/CPlayer.hpp" #include "GameGlobalObjects.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CCinematicCamera.hpp" #include "CBallCamera.hpp" #include "CInterpolationCamera.hpp" @@ -15,11 +15,7 @@ #include "World/CExplosion.hpp" namespace urde { -float CCameraManager::sAspect = 1.42f; -float CCameraManager::sFarPlane = 750.f; -float CCameraManager::sNearPlane = 0.2f; float CCameraManager::sFirstPersonFOV = 55.f; -float CCameraManager::sThirdPersonFOV = 60.f; CCameraManager::CCameraManager(TUniqueId curCameraId) : x0_curCameraId(curCameraId) { CSfxManager::AddListener(CSfxManager::ESfxChannels::Game, zeus::skZero3f, zeus::skZero3f, @@ -135,13 +131,13 @@ void CCameraManager::CreateStandardCameras(CStateManager& stateMgr) { TUniqueId fpId = stateMgr.AllocateUniqueId(); x7c_fpCamera = new CFirstPersonCamera(fpId, zeus::CTransform(), stateMgr.Player()->GetUniqueId(), - g_tweakPlayer->GetOrbitCameraSpeed(), sFirstPersonFOV, sNearPlane, sFarPlane, sAspect); + g_tweakPlayer->GetOrbitCameraSpeed(), sFirstPersonFOV, NearPlane(), FarPlane(), Aspect()); stateMgr.AddObject(x7c_fpCamera); stateMgr.Player()->SetCameraState(CPlayer::EPlayerCameraState::FirstPerson, stateMgr); SetCurrentCameraId(fpId, stateMgr); - x80_ballCamera = new CBallCamera(stateMgr.AllocateUniqueId(), stateMgr.Player()->GetUniqueId(), - zeus::CTransform(), sThirdPersonFOV, sNearPlane, sFarPlane, sAspect); + x80_ballCamera = new CBallCamera(stateMgr.AllocateUniqueId(), stateMgr.Player()->GetUniqueId(), zeus::CTransform(), + ThirdPersonFOV(), NearPlane(), FarPlane(), Aspect()); stateMgr.AddObject(x80_ballCamera); x88_interpCamera = new CInterpolationCamera(stateMgr.AllocateUniqueId(), zeus::CTransform()); diff --git a/Runtime/Camera/CCameraManager.hpp b/Runtime/Camera/CCameraManager.hpp index 7cc081244..fc15fb179 100644 --- a/Runtime/Camera/CCameraManager.hpp +++ b/Runtime/Camera/CCameraManager.hpp @@ -1,27 +1,29 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "World/CGameArea.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/World/CGameArea.hpp" + +#include namespace urde { -class CFirstPersonCamera; class CBallCamera; -class CStateManager; -class CGameCamera; class CCameraShakeData; -class CScriptWater; -class CInterpolationCamera; -struct CFinalInput; -class CScriptCameraHint; class CCinematicCamera; +class CFirstPersonCamera; +class CGameCamera; +class CInterpolationCamera; +class CScriptCameraHint; +class CScriptWater; +class CStateManager; + +struct CFinalInput; class CCameraManager { - static float sAspect; - static float sFarPlane; - static float sNearPlane; static float sFirstPersonFOV; - static float sThirdPersonFOV; TUniqueId x0_curCameraId; std::vector x4_cineCameras; std::list x14_shakers; @@ -80,11 +82,11 @@ class CCameraManager { public: CCameraManager(TUniqueId curCameraId = kInvalidUniqueId); - static float Aspect() { return sAspect; } - static float FarPlane() { return sFarPlane; } - static float NearPlane() { return sNearPlane; } + static float Aspect() { return 1.42f; } + static float FarPlane() { return 750.0f; } + static float NearPlane() { return 0.2f; } static float FirstPersonFOV() { return sFirstPersonFOV; } - static float ThirdPersonFOV() { return sThirdPersonFOV; } + static float ThirdPersonFOV() { return 60.0f; } void ResetCameras(CStateManager& mgr); void SetSpecialCameras(CFirstPersonCamera& fp, CBallCamera& ball); diff --git a/Runtime/Camera/CCameraShakeData.hpp b/Runtime/Camera/CCameraShakeData.hpp index d7d1fa20a..e425fa913 100644 --- a/Runtime/Camera/CCameraShakeData.hpp +++ b/Runtime/Camera/CCameraShakeData.hpp @@ -1,7 +1,8 @@ #pragma once -#include "zeus/CVector3f.hpp" -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" + +#include namespace urde { class CRandom16; diff --git a/Runtime/Camera/CCameraSpline.cpp b/Runtime/Camera/CCameraSpline.cpp index 3e2501d91..0723cd348 100644 --- a/Runtime/Camera/CCameraSpline.cpp +++ b/Runtime/Camera/CCameraSpline.cpp @@ -1,7 +1,7 @@ #include "Camera/CCameraSpline.hpp" #include "CStateManager.hpp" #include "World/CScriptCameraWaypoint.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CCameraSpline::CCameraSpline(bool closedLoop) : x48_closedLoop(closedLoop) {} diff --git a/Runtime/Camera/CCinematicCamera.cpp b/Runtime/Camera/CCinematicCamera.cpp index ec62c399e..ebd7e85f3 100644 --- a/Runtime/Camera/CCinematicCamera.cpp +++ b/Runtime/Camera/CCinematicCamera.cpp @@ -2,7 +2,7 @@ #include "CStateManager.hpp" #include "World/CPlayer.hpp" #include "World/CScriptActor.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "World/CScriptCameraWaypoint.hpp" #include "GameGlobalObjects.hpp" #include "Character/CAnimTreeNode.hpp" diff --git a/Runtime/Camera/CCinematicCamera.hpp b/Runtime/Camera/CCinematicCamera.hpp index 6749c9fe3..9a4fcac8e 100644 --- a/Runtime/Camera/CCinematicCamera.hpp +++ b/Runtime/Camera/CCinematicCamera.hpp @@ -1,6 +1,13 @@ #pragma once -#include "CGameCamera.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Camera/CGameCamera.hpp" + +#include +#include namespace urde { diff --git a/Runtime/Camera/CFirstPersonCamera.cpp b/Runtime/Camera/CFirstPersonCamera.cpp index 4787309d9..f958a4340 100644 --- a/Runtime/Camera/CFirstPersonCamera.cpp +++ b/Runtime/Camera/CFirstPersonCamera.cpp @@ -4,7 +4,11 @@ #include "World/CPlayer.hpp" #include "World/CScriptGrapplePoint.hpp" #include "World/CScriptCameraPitchVolume.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path + +namespace DataSpec::DNAMP1 { +extern hecl::CVar* tw_fov; +} namespace urde { @@ -15,6 +19,7 @@ CFirstPersonCamera::CFirstPersonCamera(TUniqueId uid, const zeus::CTransform& xf , x188_orbitCameraSpeed(orbitCameraSpeed) , x190_gunFollowXf(xf) { x1c6_24_deferBallTransitionProcessing = false; + DataSpec::DNAMP1::tw_fov->addListener([this](hecl::CVar* cv) { _fovListener(cv); }); } void CFirstPersonCamera::Accept(IVisitor& visitor) { visitor.Visit(this); } @@ -325,4 +330,10 @@ void CFirstPersonCamera::UpdateElevation(CStateManager& mgr) { } } } + +void CFirstPersonCamera::_fovListener(hecl::CVar* cv) { + x15c_currentFov = x180_perspInterpStartFov = x184_perspInterpEndFov = cv->toReal(); + x170_24_perspDirty = true; +} + } // namespace urde diff --git a/Runtime/Camera/CFirstPersonCamera.hpp b/Runtime/Camera/CFirstPersonCamera.hpp index 8ba630252..dd9330fe1 100644 --- a/Runtime/Camera/CFirstPersonCamera.hpp +++ b/Runtime/Camera/CFirstPersonCamera.hpp @@ -1,6 +1,10 @@ #pragma once -#include "CGameCamera.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Camera/CGameCamera.hpp" + +#include +#include namespace urde { @@ -13,7 +17,7 @@ class CFirstPersonCamera : public CGameCamera { bool x1c6_24_deferBallTransitionProcessing : 1; zeus::CVector3f x1c8_closeInVec; float x1d4_closeInTimer = 0.f; - + void _fovListener(hecl::CVar* cv); public: CFirstPersonCamera(TUniqueId, const zeus::CTransform& xf, TUniqueId, float orbitCameraSpeed, float fov, float nearplane, float farplane, float aspect); diff --git a/Runtime/Camera/CGameCamera.hpp b/Runtime/Camera/CGameCamera.hpp index aadd77397..a0c8cbbdb 100644 --- a/Runtime/Camera/CGameCamera.hpp +++ b/Runtime/Camera/CGameCamera.hpp @@ -1,14 +1,17 @@ #pragma once -#include "World/CActor.hpp" -#include "zeus/CTransform.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CActor.hpp" + +#include +#include namespace urde { struct CFinalInput; class CGameCamera : public CActor { - friend class CStateManager; friend class CCameraManager; + friend class CStateManager; protected: TUniqueId xe8_watchedObject; diff --git a/Runtime/Camera/CInterpolationCamera.cpp b/Runtime/Camera/CInterpolationCamera.cpp index e31ec8882..2e7bd6c5e 100644 --- a/Runtime/Camera/CInterpolationCamera.cpp +++ b/Runtime/Camera/CInterpolationCamera.cpp @@ -4,7 +4,7 @@ #include "Camera/CBallCamera.hpp" #include "World/CPlayer.hpp" #include "World/CScriptSpindleCamera.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/Camera/CInterpolationCamera.hpp b/Runtime/Camera/CInterpolationCamera.hpp index 84e1c9146..260b47203 100644 --- a/Runtime/Camera/CInterpolationCamera.hpp +++ b/Runtime/Camera/CInterpolationCamera.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CGameCamera.hpp" +#include "Runtime/Camera/CGameCamera.hpp" + +#include +#include namespace urde { diff --git a/Runtime/Camera/CPathCamera.cpp b/Runtime/Camera/CPathCamera.cpp index d5abd0da2..fb1c764d5 100644 --- a/Runtime/Camera/CPathCamera.cpp +++ b/Runtime/Camera/CPathCamera.cpp @@ -6,7 +6,7 @@ #include "World/CPlayer.hpp" #include "World/CScriptDoor.hpp" #include "GameGlobalObjects.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/Camera/CPathCamera.hpp b/Runtime/Camera/CPathCamera.hpp index 7afd0f142..96691fe2d 100644 --- a/Runtime/Camera/CPathCamera.hpp +++ b/Runtime/Camera/CPathCamera.hpp @@ -1,7 +1,7 @@ #pragma once -#include "CGameCamera.hpp" -#include "CCameraSpline.hpp" +#include "Runtime/Camera/CCameraSpline.hpp" +#include "Runtime/Camera/CGameCamera.hpp" namespace urde { diff --git a/Runtime/Character/CActorLights.cpp b/Runtime/Character/CActorLights.cpp index 6543bbb2d..02688dd6c 100644 --- a/Runtime/Character/CActorLights.cpp +++ b/Runtime/Character/CActorLights.cpp @@ -5,7 +5,7 @@ #include "Collision/CGameCollision.hpp" #include "Camera/CFirstPersonCamera.hpp" #include "World/CGameLight.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "GameGlobalObjects.hpp" #include "World/CExplosion.hpp" #include "Graphics/CBooRenderer.hpp" diff --git a/Runtime/Character/CActorLights.hpp b/Runtime/Character/CActorLights.hpp index 146ae3035..a6af5e8bd 100644 --- a/Runtime/Character/CActorLights.hpp +++ b/Runtime/Character/CActorLights.hpp @@ -1,15 +1,18 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CAABox.hpp" -#include "Graphics/CLight.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/CLight.hpp" + +#include +#include +#include namespace urde { class CBooModel; -class CStateManager; class CGameArea; +class CStateManager; class CActorLights { static s32 sFrameSchedulerCount; diff --git a/Runtime/Character/CAdditiveAnimPlayback.hpp b/Runtime/Character/CAdditiveAnimPlayback.hpp index b0a5872a8..582bbeb48 100644 --- a/Runtime/Character/CAdditiveAnimPlayback.hpp +++ b/Runtime/Character/CAdditiveAnimPlayback.hpp @@ -1,12 +1,13 @@ #pragma once -#include "RetroTypes.hpp" +#include +#include "Runtime/RetroTypes.hpp" namespace urde { -class CAnimTreeNode; class CAdditiveAnimationInfo; -class CSegIdList; +class CAnimTreeNode; class CCharLayoutInfo; +class CSegIdList; class CSegStatementSet; class CAdditiveAnimationInfo { diff --git a/Runtime/Character/CAdditiveBodyState.hpp b/Runtime/Character/CAdditiveBodyState.hpp index f65db08dd..8bdbcfdd6 100644 --- a/Runtime/Character/CAdditiveBodyState.hpp +++ b/Runtime/Character/CAdditiveBodyState.hpp @@ -1,13 +1,14 @@ #pragma once -#include "RetroTypes.hpp" -#include "CharacterCommon.hpp" -#include "CBodyStateCmdMgr.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CBodyStateCmdMgr.hpp" +#include "Runtime/Character/CharacterCommon.hpp" namespace urde { +class CActor; class CBodyController; class CStateManager; -class CActor; + class CAdditiveBodyState { public: virtual ~CAdditiveBodyState() = default; diff --git a/Runtime/Character/CAllFormatsAnimSource.hpp b/Runtime/Character/CAllFormatsAnimSource.hpp index b7ed79913..b762a5e8c 100644 --- a/Runtime/Character/CAllFormatsAnimSource.hpp +++ b/Runtime/Character/CAllFormatsAnimSource.hpp @@ -1,14 +1,18 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "CAnimSource.hpp" -#include "CFBStreamedCompression.hpp" -#include "CFactoryMgr.hpp" +#include +#include + +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CAnimSource.hpp" +#include "Runtime/Character/CFBStreamedCompression.hpp" + +#include namespace urde { -class IObjectStore; class IAnimReader; +class IObjectStore; enum class EAnimFormat { Uncompressed, Unknown, BitstreamCompressed, BitstreamCompressed24 }; diff --git a/Runtime/Character/CAnimCharacterSet.hpp b/Runtime/Character/CAnimCharacterSet.hpp index 558ae5bd7..749abeb31 100644 --- a/Runtime/Character/CAnimCharacterSet.hpp +++ b/Runtime/Character/CAnimCharacterSet.hpp @@ -1,8 +1,8 @@ #pragma once -#include "CFactoryMgr.hpp" -#include "CCharacterSet.hpp" -#include "CAnimationSet.hpp" +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/Character/CAnimationSet.hpp" +#include "Runtime/Character/CCharacterSet.hpp" namespace urde { diff --git a/Runtime/Character/CAnimData.hpp b/Runtime/Character/CAnimData.hpp index 8fef16bff..7d0ce311b 100644 --- a/Runtime/Character/CAnimData.hpp +++ b/Runtime/Character/CAnimData.hpp @@ -1,16 +1,24 @@ #pragma once -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "CCharacterInfo.hpp" -#include "CParticleDatabase.hpp" -#include "CPoseAsTransforms.hpp" -#include "CHierarchyPoseBuilder.hpp" -#include "CAdditiveAnimPlayback.hpp" -#include "CCharLayoutInfo.hpp" -#include "CAnimPlaybackParms.hpp" -#include "IAnimReader.hpp" +#include #include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CAdditiveAnimPlayback.hpp" +#include "Runtime/Character/CAnimPlaybackParms.hpp" +#include "Runtime/Character/CCharLayoutInfo.hpp" +#include "Runtime/Character/CCharacterInfo.hpp" +#include "Runtime/Character/CHierarchyPoseBuilder.hpp" +#include "Runtime/Character/CParticleDatabase.hpp" +#include "Runtime/Character/CPoseAsTransforms.hpp" +#include "Runtime/Character/IAnimReader.hpp" + +#include +#include +#include enum class EUserEventType { Projectile = 0, @@ -51,30 +59,31 @@ enum class EUserEventType { }; namespace urde { -class CCharLayoutInfo; -class CSkinnedModel; -class CMorphableSkinnedModel; -struct CAnimSysContext; +class CAnimTreeNode; class CAnimationManager; -class CTransitionManager; +class CBoolPOINode; +class CCharAnimTime; +class CCharLayoutInfo; class CCharacterFactory; -class IMetaAnim; -struct CModelFlags; -class CVertexMorphEffect; +class CInt32POINode; +class CModel; +class CMorphableSkinnedModel; +class CParticlePOINode; class CPrimitive; class CRandom16; -class CStateManager; -class CCharAnimTime; -class CModel; -class CSkinRules; -class CAnimTreeNode; class CSegIdList; class CSegStatementSet; -class CBoolPOINode; -class CInt32POINode; -class CParticlePOINode; +class CSkinRules; +class CSkinnedModel; class CSoundPOINode; +class CStateManager; +class CTransitionManager; +class CVertexMorphEffect; class IAnimReader; +class IMetaAnim; + +struct CAnimSysContext; +struct CModelFlags; struct SAdvancementDeltas; struct SAdvancementResults; diff --git a/Runtime/Character/CAnimPOIData.hpp b/Runtime/Character/CAnimPOIData.hpp index c866ffe65..84514f503 100644 --- a/Runtime/Character/CAnimPOIData.hpp +++ b/Runtime/Character/CAnimPOIData.hpp @@ -1,10 +1,13 @@ #pragma once -#include "CFactoryMgr.hpp" -#include "CBoolPOINode.hpp" -#include "CInt32POINode.hpp" -#include "CParticlePOINode.hpp" -#include "CSoundPOINode.hpp" +#include + +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Character/CBoolPOINode.hpp" +#include "Runtime/Character/CInt32POINode.hpp" +#include "Runtime/Character/CParticlePOINode.hpp" +#include "Runtime/Character/CSoundPOINode.hpp" namespace urde { diff --git a/Runtime/Character/CAnimPerSegmentData.hpp b/Runtime/Character/CAnimPerSegmentData.hpp index 805ff7ab7..e9f252eef 100644 --- a/Runtime/Character/CAnimPerSegmentData.hpp +++ b/Runtime/Character/CAnimPerSegmentData.hpp @@ -1,7 +1,7 @@ #pragma once -#include "zeus/CQuaternion.hpp" -#include "zeus/CVector3f.hpp" +#include +#include namespace urde { diff --git a/Runtime/Character/CAnimPlaybackParms.hpp b/Runtime/Character/CAnimPlaybackParms.hpp index 6380ca4ce..988e55242 100644 --- a/Runtime/Character/CAnimPlaybackParms.hpp +++ b/Runtime/Character/CAnimPlaybackParms.hpp @@ -1,7 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CQuaternion.hpp" +#include "Runtime/RetroTypes.hpp" + +#include +#include +#include namespace urde { class CAnimPlaybackParms { diff --git a/Runtime/Character/CAnimSource.hpp b/Runtime/Character/CAnimSource.hpp index 4183e0c04..7e093c747 100644 --- a/Runtime/Character/CAnimSource.hpp +++ b/Runtime/Character/CAnimSource.hpp @@ -1,22 +1,26 @@ #pragma once -#include "RetroTypes.hpp" -#include "CCharAnimTime.hpp" -#include "zeus/CQuaternion.hpp" -#include "zeus/CVector3f.hpp" -#include "CSegId.hpp" -#include "CToken.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CCharAnimTime.hpp" +#include "Runtime/Character/CSegId.hpp" + +#include +#include namespace urde { -class IObjectStore; -class CSegIdList; -class CSegStatementSet; -class CSegId; class CAnimPOIData; class CBoolPOINode; class CInt32POINode; class CParticlePOINode; +class CSegId; +class CSegIdList; +class CSegStatementSet; class CSoundPOINode; +class IObjectStore; class RotationAndOffsetStorage { friend class CAnimSource; diff --git a/Runtime/Character/CAnimSourceReader.hpp b/Runtime/Character/CAnimSourceReader.hpp index d9e909ca0..bbbe67bc3 100644 --- a/Runtime/Character/CAnimSourceReader.hpp +++ b/Runtime/Character/CAnimSourceReader.hpp @@ -1,10 +1,15 @@ #pragma once -#include "IAnimReader.hpp" -#include "CToken.hpp" -#include "CAnimSource.hpp" -#include "CParticleData.hpp" +#include #include +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Character/CAnimSource.hpp" +#include "Runtime/Character/CParticleData.hpp" +#include "Runtime/Character/IAnimReader.hpp" namespace urde { diff --git a/Runtime/Character/CAnimSysContext.hpp b/Runtime/Character/CAnimSysContext.hpp index 28bfb4472..e6a68e595 100644 --- a/Runtime/Character/CAnimSysContext.hpp +++ b/Runtime/Character/CAnimSysContext.hpp @@ -1,11 +1,14 @@ #pragma once -#include "CToken.hpp" -#include "CRandom16.hpp" +#include + +#include "Runtime/CRandom16.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/GCNTypes.hpp" namespace urde { -class CTransitionDatabaseGame; class CSimplePool; +class CTransitionDatabaseGame; struct CAnimSysContext { TToken x0_transDB; diff --git a/Runtime/Character/CAnimTreeAnimReaderContainer.hpp b/Runtime/Character/CAnimTreeAnimReaderContainer.hpp index 571269c34..aec904573 100644 --- a/Runtime/Character/CAnimTreeAnimReaderContainer.hpp +++ b/Runtime/Character/CAnimTreeAnimReaderContainer.hpp @@ -1,6 +1,12 @@ #pragma once -#include "CAnimTreeNode.hpp" +#include +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CAnimTreeNode.hpp" namespace urde { diff --git a/Runtime/Character/CAnimTreeBlend.hpp b/Runtime/Character/CAnimTreeBlend.hpp index 9bc814f67..5717c6e30 100644 --- a/Runtime/Character/CAnimTreeBlend.hpp +++ b/Runtime/Character/CAnimTreeBlend.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CAnimTreeTweenBase.hpp" +#include +#include + +#include "Runtime/Character/CAnimTreeTweenBase.hpp" namespace urde { diff --git a/Runtime/Character/CAnimTreeDoubleChild.hpp b/Runtime/Character/CAnimTreeDoubleChild.hpp index 1d0ab0f1d..22c4b36e2 100644 --- a/Runtime/Character/CAnimTreeDoubleChild.hpp +++ b/Runtime/Character/CAnimTreeDoubleChild.hpp @@ -1,6 +1,10 @@ #pragma once -#include "CAnimTreeNode.hpp" +#include +#include + +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CAnimTreeNode.hpp" namespace urde { diff --git a/Runtime/Character/CAnimTreeLoopIn.hpp b/Runtime/Character/CAnimTreeLoopIn.hpp index ccaa20b85..644e67e27 100644 --- a/Runtime/Character/CAnimTreeLoopIn.hpp +++ b/Runtime/Character/CAnimTreeLoopIn.hpp @@ -1,8 +1,12 @@ #pragma once -#include "CAnimTreeSingleChild.hpp" -#include "CAnimSysContext.hpp" -#include "CSequenceHelper.hpp" +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Character/CAnimSysContext.hpp" +#include "Runtime/Character/CAnimTreeSingleChild.hpp" +#include "Runtime/Character/CSequenceHelper.hpp" namespace urde { diff --git a/Runtime/Character/CAnimTreeNode.hpp b/Runtime/Character/CAnimTreeNode.hpp index 3d689b0c0..61906c067 100644 --- a/Runtime/Character/CAnimTreeNode.hpp +++ b/Runtime/Character/CAnimTreeNode.hpp @@ -1,6 +1,11 @@ #pragma once -#include "IAnimReader.hpp" +#include +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Character/IAnimReader.hpp" namespace urde { diff --git a/Runtime/Character/CAnimTreeSequence.hpp b/Runtime/Character/CAnimTreeSequence.hpp index a1386c798..b82d12470 100644 --- a/Runtime/Character/CAnimTreeSequence.hpp +++ b/Runtime/Character/CAnimTreeSequence.hpp @@ -1,8 +1,12 @@ #pragma once -#include "CAnimTreeSingleChild.hpp" -#include "CAnimSysContext.hpp" -#include "CSequenceHelper.hpp" +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Character/CAnimSysContext.hpp" +#include "Runtime/Character/CAnimTreeSingleChild.hpp" +#include "Runtime/Character/CSequenceHelper.hpp" namespace urde { class IMetaAnim; diff --git a/Runtime/Character/CAnimTreeSingleChild.hpp b/Runtime/Character/CAnimTreeSingleChild.hpp index 9c5724fc5..1158de80e 100644 --- a/Runtime/Character/CAnimTreeSingleChild.hpp +++ b/Runtime/Character/CAnimTreeSingleChild.hpp @@ -1,6 +1,10 @@ #pragma once -#include "CAnimTreeNode.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CAnimTreeNode.hpp" namespace urde { diff --git a/Runtime/Character/CAnimTreeTimeScale.cpp b/Runtime/Character/CAnimTreeTimeScale.cpp index 81c0bb64b..61ce63532 100644 --- a/Runtime/Character/CAnimTreeTimeScale.cpp +++ b/Runtime/Character/CAnimTreeTimeScale.cpp @@ -45,15 +45,18 @@ void CAnimTreeTimeScale::VSetPhase(float phase) { x14_child->VSetPhase(phase); } std::optional> CAnimTreeTimeScale::VSimplified() { if (auto simp = x14_child->Simplified()) { - CAnimTreeTimeScale* newNode = new CAnimTreeTimeScale(CAnimTreeNode::Cast(std::move(*simp)), x18_timeScale->Clone(), - x28_targetAccelTime, x4_name); + auto newNode = std::make_unique(CAnimTreeNode::Cast(std::move(*simp)), x18_timeScale->Clone(), + x28_targetAccelTime, x4_name); newNode->x20_curAccelTime = x20_curAccelTime; newNode->x30_initialTime = x30_initialTime; - return {std::unique_ptr(newNode)}; - } else if (x20_curAccelTime == x28_targetAccelTime) { + return {std::move(newNode)}; + } + + if (x20_curAccelTime == x28_targetAccelTime) { return {x14_child->Clone()}; } - return {}; + + return std::nullopt; } u32 CAnimTreeTimeScale::VGetBoolPOIList(const CCharAnimTime& time, CBoolPOINode* listOut, u32 capacity, u32 iterator, @@ -112,21 +115,21 @@ CAnimTreeEffectiveContribution CAnimTreeTimeScale::VGetContributionOfHighestInfl std::shared_ptr CAnimTreeTimeScale::VGetBestUnblendedChild() const { if (std::shared_ptr bestChild = x14_child->VGetBestUnblendedChild()) { - CAnimTreeTimeScale* newNode = new CAnimTreeTimeScale(CAnimTreeNode::Cast(bestChild->Clone()), + auto newNode = std::make_shared(CAnimTreeNode::Cast(bestChild->Clone()), x18_timeScale->Clone(), x28_targetAccelTime, x4_name); newNode->x20_curAccelTime = x20_curAccelTime; newNode->x30_initialTime = x30_initialTime; - return {std::shared_ptr(newNode)}; + return {std::move(newNode)}; } - return {}; + return nullptr; } std::unique_ptr CAnimTreeTimeScale::VClone() const { - CAnimTreeTimeScale* newNode = new CAnimTreeTimeScale(CAnimTreeNode::Cast(x14_child->Clone()), x18_timeScale->Clone(), - x28_targetAccelTime, x4_name); + auto newNode = std::make_unique(CAnimTreeNode::Cast(x14_child->Clone()), x18_timeScale->Clone(), + x28_targetAccelTime, x4_name); newNode->x20_curAccelTime = x20_curAccelTime; newNode->x30_initialTime = x30_initialTime; - return {std::unique_ptr(newNode)}; + return {std::move(newNode)}; } CSteadyStateAnimInfo CAnimTreeTimeScale::VGetSteadyStateAnimInfo() const { diff --git a/Runtime/Character/CAnimTreeTimeScale.hpp b/Runtime/Character/CAnimTreeTimeScale.hpp index b376b47c1..a4ba6d016 100644 --- a/Runtime/Character/CAnimTreeTimeScale.hpp +++ b/Runtime/Character/CAnimTreeTimeScale.hpp @@ -1,7 +1,12 @@ #pragma once -#include "CAnimTreeSingleChild.hpp" -#include "CTimeScaleFunctions.hpp" +#include +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Character/CAnimTreeSingleChild.hpp" +#include "Runtime/Character/CTimeScaleFunctions.hpp" namespace urde { diff --git a/Runtime/Character/CAnimTreeTransition.hpp b/Runtime/Character/CAnimTreeTransition.hpp index 8bdc4a808..86ba96ec9 100644 --- a/Runtime/Character/CAnimTreeTransition.hpp +++ b/Runtime/Character/CAnimTreeTransition.hpp @@ -1,7 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "CAnimTreeTweenBase.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CAnimTreeTweenBase.hpp" namespace urde { diff --git a/Runtime/Character/CAnimTreeTweenBase.hpp b/Runtime/Character/CAnimTreeTweenBase.hpp index 6049ac340..fefbdf58a 100644 --- a/Runtime/Character/CAnimTreeTweenBase.hpp +++ b/Runtime/Character/CAnimTreeTweenBase.hpp @@ -1,6 +1,10 @@ #pragma once -#include "CAnimTreeDoubleChild.hpp" +#include +#include + +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CAnimTreeDoubleChild.hpp" namespace urde { diff --git a/Runtime/Character/CAnimation.hpp b/Runtime/Character/CAnimation.hpp index 589c2814b..228284130 100644 --- a/Runtime/Character/CAnimation.hpp +++ b/Runtime/Character/CAnimation.hpp @@ -1,7 +1,10 @@ #pragma once -#include "IOStreams.hpp" -#include "CMetaAnimFactory.hpp" +#include +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/CMetaAnimFactory.hpp" namespace urde { class IMetaAnim; diff --git a/Runtime/Character/CAnimationDatabase.hpp b/Runtime/Character/CAnimationDatabase.hpp index 8d4cea31b..0d7d98c71 100644 --- a/Runtime/Character/CAnimationDatabase.hpp +++ b/Runtime/Character/CAnimationDatabase.hpp @@ -1,13 +1,14 @@ #pragma once -#include "../RetroTypes.hpp" -#include #include -#include +#include +#include + +#include "Runtime/RetroTypes.hpp" namespace urde { -class IMetaAnim; class CPrimitive; +class IMetaAnim; class CAnimationDatabase { public: diff --git a/Runtime/Character/CAnimationDatabaseGame.hpp b/Runtime/Character/CAnimationDatabaseGame.hpp index fb7d80516..9d28a708c 100644 --- a/Runtime/Character/CAnimationDatabaseGame.hpp +++ b/Runtime/Character/CAnimationDatabaseGame.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CAnimationDatabase.hpp" +#include +#include + +#include "Runtime/Character/CAnimationDatabase.hpp" namespace urde { class CAnimation; diff --git a/Runtime/Character/CAnimationManager.hpp b/Runtime/Character/CAnimationManager.hpp index 73217a5a6..cff8282e3 100644 --- a/Runtime/Character/CAnimationManager.hpp +++ b/Runtime/Character/CAnimationManager.hpp @@ -1,16 +1,19 @@ #pragma once -#include "CToken.hpp" -#include "CAnimSysContext.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/Character/CAnimSysContext.hpp" namespace urde { -class CAnimationDatabaseGame; -class CTransitionDatabaseGame; -class CSimplePool; class CAnimTreeNode; -struct CMetaAnimTreeBuildOrders; +class CAnimationDatabaseGame; +class CSimplePool; +class CTransitionDatabaseGame; class IMetaAnim; +struct CMetaAnimTreeBuildOrders; + class CAnimationManager { TToken x0_animDB; CAnimSysContext x8_sysCtx; diff --git a/Runtime/Character/CAnimationSet.hpp b/Runtime/Character/CAnimationSet.hpp index d8924c906..c7b58929b 100644 --- a/Runtime/Character/CAnimationSet.hpp +++ b/Runtime/Character/CAnimationSet.hpp @@ -1,10 +1,15 @@ #pragma once -#include "IOStreams.hpp" -#include "CAnimation.hpp" -#include "CTransition.hpp" -#include "CHalfTransition.hpp" -#include "CAdditiveAnimPlayback.hpp" +#include +#include +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CAdditiveAnimPlayback.hpp" +#include "Runtime/Character/CAnimation.hpp" +#include "Runtime/Character/CHalfTransition.hpp" +#include "Runtime/Character/CTransition.hpp" namespace urde { diff --git a/Runtime/Character/CAssetFactory.hpp b/Runtime/Character/CAssetFactory.hpp index 38eebb026..975124f7d 100644 --- a/Runtime/Character/CAssetFactory.hpp +++ b/Runtime/Character/CAssetFactory.hpp @@ -1,9 +1,12 @@ #pragma once -#include "IFactory.hpp" -#include "IObj.hpp" -#include "CToken.hpp" -#include "CSimplePool.hpp" +#include +#include + +#include "Runtime/CSimplePool.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/IFactory.hpp" +#include "Runtime/IObj.hpp" namespace urde { class CCharacterFactory; diff --git a/Runtime/Character/CBodyController.cpp b/Runtime/Character/CBodyController.cpp index 7e6229ffe..4287e42e8 100644 --- a/Runtime/Character/CBodyController.cpp +++ b/Runtime/Character/CBodyController.cpp @@ -1,6 +1,6 @@ #include "CBodyController.hpp" #include "World/CActor.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "World/CPhysicsActor.hpp" #include "World/CActorModelParticles.hpp" #include "Character/CPASAnimParm.hpp" diff --git a/Runtime/Character/CBodyController.hpp b/Runtime/Character/CBodyController.hpp index 79a648e2a..b116c2be5 100644 --- a/Runtime/Character/CBodyController.hpp +++ b/Runtime/Character/CBodyController.hpp @@ -1,20 +1,22 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CQuaternion.hpp" -#include "CharacterCommon.hpp" -#include "CBodyStateCmdMgr.hpp" -#include "CBodyStateInfo.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CBodyStateCmdMgr.hpp" +#include "Runtime/Character/CBodyStateInfo.hpp" +#include "Runtime/Character/CharacterCommon.hpp" + +#include +#include namespace urde { - class CActor; class CAnimPlaybackParms; -struct CFinalInput; class CPASAnimParmData; +class CPASDatabase; class CRandom16; class CStateManager; -class CPASDatabase; + +struct CFinalInput; class CBodyController { CActor& x0_actor; diff --git a/Runtime/Character/CBodyState.cpp b/Runtime/Character/CBodyState.cpp index d5b02ceda..5e2285d86 100644 --- a/Runtime/Character/CBodyState.cpp +++ b/Runtime/Character/CBodyState.cpp @@ -2,7 +2,7 @@ #include "CBodyController.hpp" #include "World/CActor.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CPASAnimParmData.hpp" #include "World/CPatterned.hpp" diff --git a/Runtime/Character/CBodyState.hpp b/Runtime/Character/CBodyState.hpp index dc2112efc..ed8a97ace 100644 --- a/Runtime/Character/CBodyState.hpp +++ b/Runtime/Character/CBodyState.hpp @@ -1,8 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "CharacterCommon.hpp" -#include "CBodyStateCmdMgr.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CBodyStateCmdMgr.hpp" +#include "Runtime/Character/CharacterCommon.hpp" + +#include namespace urde { class CBodyController; diff --git a/Runtime/Character/CBodyStateCmdMgr.hpp b/Runtime/Character/CBodyStateCmdMgr.hpp index 9d0425970..35448520a 100644 --- a/Runtime/Character/CBodyStateCmdMgr.hpp +++ b/Runtime/Character/CBodyStateCmdMgr.hpp @@ -1,8 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "CharacterCommon.hpp" -#include "zeus/CVector3f.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CharacterCommon.hpp" + +#include namespace urde { diff --git a/Runtime/Character/CBodyStateInfo.hpp b/Runtime/Character/CBodyStateInfo.hpp index df2bb3333..bd440683c 100644 --- a/Runtime/Character/CBodyStateInfo.hpp +++ b/Runtime/Character/CBodyStateInfo.hpp @@ -1,9 +1,14 @@ #pragma once -#include "RetroTypes.hpp" -#include "CharacterCommon.hpp" -#include "CBodyState.hpp" -#include "CAdditiveBodyState.hpp" +#include +#include +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CAdditiveBodyState.hpp" +#include "Runtime/Character/CBodyState.hpp" +#include "Runtime/Character/CharacterCommon.hpp" namespace urde { class CActor; diff --git a/Runtime/Character/CBoneTracking.cpp b/Runtime/Character/CBoneTracking.cpp index 3422897c8..4b57545dc 100644 --- a/Runtime/Character/CBoneTracking.cpp +++ b/Runtime/Character/CBoneTracking.cpp @@ -5,7 +5,7 @@ #include "World/CPatterned.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/Character/CBoneTracking.hpp b/Runtime/Character/CBoneTracking.hpp index ecab391ee..4f71351cc 100644 --- a/Runtime/Character/CBoneTracking.hpp +++ b/Runtime/Character/CBoneTracking.hpp @@ -1,11 +1,14 @@ #pragma once -#include "Character/CSegId.hpp" +#include +#include -#include "zeus/CTransform.hpp" -#include "zeus/CQuaternion.hpp" -#include "zeus/CVector3f.hpp" -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CSegId.hpp" + +#include +#include +#include namespace urde { class CAnimData; diff --git a/Runtime/Character/CBoolPOINode.hpp b/Runtime/Character/CBoolPOINode.hpp index d738eff68..9dae11934 100644 --- a/Runtime/Character/CBoolPOINode.hpp +++ b/Runtime/Character/CBoolPOINode.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CPOINode.hpp" +#include "Runtime/Character/CPOINode.hpp" namespace urde { class IAnimSourceInfo; diff --git a/Runtime/Character/CCharAnimTime.hpp b/Runtime/Character/CCharAnimTime.hpp index 71d4caddf..3aed3e0e8 100644 --- a/Runtime/Character/CCharAnimTime.hpp +++ b/Runtime/Character/CCharAnimTime.hpp @@ -1,6 +1,6 @@ #pragma once -#include "IOStreams.hpp" +#include "Runtime/IOStreams.hpp" #undef min #undef max diff --git a/Runtime/Character/CCharLayoutInfo.hpp b/Runtime/Character/CCharLayoutInfo.hpp index 16f931b0b..9ec09cf3c 100644 --- a/Runtime/Character/CCharLayoutInfo.hpp +++ b/Runtime/Character/CCharLayoutInfo.hpp @@ -1,10 +1,17 @@ #pragma once -#include "CFactoryMgr.hpp" -#include "IOStreams.hpp" -#include "CSegIdList.hpp" -#include "CSegId.hpp" -#include "TSegIdMap.hpp" +#include +#include +#include +#include + +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/CSegId.hpp" +#include "Runtime/Character/CSegIdList.hpp" +#include "Runtime/Character/TSegIdMap.hpp" + +#include namespace urde { diff --git a/Runtime/Character/CCharacterFactory.hpp b/Runtime/Character/CCharacterFactory.hpp index de2881aac..7222b1be0 100644 --- a/Runtime/Character/CCharacterFactory.hpp +++ b/Runtime/Character/CCharacterFactory.hpp @@ -1,22 +1,27 @@ #pragma once -#include "IFactory.hpp" -#include "IObjFactory.hpp" -#include "CToken.hpp" -#include "CSimplePool.hpp" -#include "CAnimationSet.hpp" +#include +#include +#include +#include + +#include "Runtime/CSimplePool.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/IFactory.hpp" +#include "Runtime/IObjFactory.hpp" +#include "Runtime/Character/CAnimationSet.hpp" namespace urde { -class CSimplePool; -class CAnimCharacterSet; -class CCharacterInfo; -class CCharLayoutInfo; class CAdditiveAnimationInfo; -class CTransitionDatabaseGame; -class CAnimationManager; -class CTransitionManager; class CAllFormatsAnimSource; +class CAnimCharacterSet; class CAnimData; +class CAnimationManager; +class CCharLayoutInfo; +class CCharacterInfo; +class CSimplePool; +class CTransitionDatabaseGame; +class CTransitionManager; class CCharacterFactory : public IObjFactory { public: diff --git a/Runtime/Character/CCharacterInfo.hpp b/Runtime/Character/CCharacterInfo.hpp index e94c6e214..f1ad08939 100644 --- a/Runtime/Character/CCharacterInfo.hpp +++ b/Runtime/Character/CCharacterInfo.hpp @@ -1,9 +1,15 @@ #pragma once -#include "IOStreams.hpp" -#include "CPASDatabase.hpp" -#include "zeus/CAABox.hpp" -#include "CEffectComponent.hpp" +#include +#include +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CEffectComponent.hpp" +#include "Runtime/Character/CPASDatabase.hpp" + +#include namespace urde { diff --git a/Runtime/Character/CCharacterSet.hpp b/Runtime/Character/CCharacterSet.hpp index 9a0d6a620..9bb0fcdba 100644 --- a/Runtime/Character/CCharacterSet.hpp +++ b/Runtime/Character/CCharacterSet.hpp @@ -1,7 +1,10 @@ #pragma once -#include "IOStreams.hpp" -#include "CCharacterInfo.hpp" +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Character/CCharacterInfo.hpp" namespace urde { diff --git a/Runtime/Character/CEffectComponent.hpp b/Runtime/Character/CEffectComponent.hpp index 06e8b992a..ab290af75 100644 --- a/Runtime/Character/CEffectComponent.hpp +++ b/Runtime/Character/CEffectComponent.hpp @@ -1,8 +1,10 @@ #pragma once -#include "IOStreams.hpp" -#include "RetroTypes.hpp" -#include "CParticleData.hpp" +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CParticleData.hpp" namespace urde { diff --git a/Runtime/Character/CFBStreamedAnimReader.hpp b/Runtime/Character/CFBStreamedAnimReader.hpp index f6cb7a966..ed132832c 100644 --- a/Runtime/Character/CFBStreamedAnimReader.hpp +++ b/Runtime/Character/CFBStreamedAnimReader.hpp @@ -1,7 +1,10 @@ #pragma once -#include "CAnimSourceReader.hpp" -#include "CFBStreamedCompression.hpp" +#include +#include + +#include "Runtime/Character/CAnimSourceReader.hpp" +#include "Runtime/Character/CFBStreamedCompression.hpp" namespace urde { class CBitLevelLoader; diff --git a/Runtime/Character/CFBStreamedCompression.hpp b/Runtime/Character/CFBStreamedCompression.hpp index 2e9fa1a06..2a14c3244 100644 --- a/Runtime/Character/CFBStreamedCompression.hpp +++ b/Runtime/Character/CFBStreamedCompression.hpp @@ -1,9 +1,13 @@ #pragma once -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "CAnimPOIData.hpp" -#include "zeus/CVector3f.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CAnimPOIData.hpp" + +#include namespace urde { class IObjectStore; diff --git a/Runtime/Character/CGroundMovement.cpp b/Runtime/Character/CGroundMovement.cpp index ebda93ab8..bfd32e980 100644 --- a/Runtime/Character/CGroundMovement.cpp +++ b/Runtime/Character/CGroundMovement.cpp @@ -5,7 +5,7 @@ #include "Collision/CollisionUtil.hpp" #include "Collision/CAABoxFilter.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "World/CScriptPlatform.hpp" #include "World/CWorld.hpp" #include "World/CPlayer.hpp" @@ -556,15 +556,14 @@ void CGroundMovement::MoveGroundCollider_New(CStateManager& mgr, CPhysicsActor& std::unique_ptr prim; if (usePrim->GetPrimType() == FOURCC('AABX')) { const CCollidableAABox& existingAABB = static_cast(*usePrim); - prim.reset( - new CCollidableAABox(zeus::CAABox(existingAABB.GetBox().min + 0.0001f, existingAABB.GetBox().max - 0.0001f), - usePrim->GetMaterial())); + prim = std::make_unique( + zeus::CAABox(existingAABB.GetBox().min + 0.0001f, existingAABB.GetBox().max - 0.0001f), usePrim->GetMaterial()); usePrim = prim.get(); } else if (usePrim->GetPrimType() == FOURCC('SPHR')) { const CCollidableSphere& existingSphere = static_cast(*usePrim); - prim.reset(new CCollidableSphere( + prim = std::make_unique( zeus::CSphere(existingSphere.GetSphere().position, existingSphere.GetSphere().radius - 0.0001f), - usePrim->GetMaterial())); + usePrim->GetMaterial()); usePrim = prim.get(); } diff --git a/Runtime/Character/CGroundMovement.hpp b/Runtime/Character/CGroundMovement.hpp index 99796e130..bfcdcd5fd 100644 --- a/Runtime/Character/CGroundMovement.hpp +++ b/Runtime/Character/CGroundMovement.hpp @@ -1,14 +1,19 @@ #pragma once -#include "RetroTypes.hpp" -#include "Collision/CCollisionInfo.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Collision/CCollisionInfo.hpp" + +#include namespace urde { +class CAreaCollisionCache; +class CCollisionInfoList; +class CMaterialFilter; class CPhysicsActor; class CStateManager; -class CAreaCollisionCache; -class CMaterialFilter; -class CCollisionInfoList; class CGroundMovement { public: diff --git a/Runtime/Character/CHalfTransition.hpp b/Runtime/Character/CHalfTransition.hpp index 1a07da935..ad6ab9397 100644 --- a/Runtime/Character/CHalfTransition.hpp +++ b/Runtime/Character/CHalfTransition.hpp @@ -1,7 +1,10 @@ #pragma once -#include "IOStreams.hpp" -#include "IMetaTrans.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/IMetaTrans.hpp" namespace urde { diff --git a/Runtime/Character/CHierarchyPoseBuilder.hpp b/Runtime/Character/CHierarchyPoseBuilder.hpp index 753664aa1..7c0dfd954 100644 --- a/Runtime/Character/CHierarchyPoseBuilder.hpp +++ b/Runtime/Character/CHierarchyPoseBuilder.hpp @@ -1,13 +1,15 @@ #pragma once -#include "CSegId.hpp" -#include "TSegIdMap.hpp" -#include "zeus/CQuaternion.hpp" -#include "CLayoutDescription.hpp" +#include "Runtime/Character/CLayoutDescription.hpp" +#include "Runtime/Character/CSegId.hpp" +#include "Runtime/Character/TSegIdMap.hpp" + +#include +#include namespace urde { -class CLayoutDescription; class CCharLayoutInfo; +class CLayoutDescription; class CPoseAsTransforms; class CHierarchyPoseBuilder { diff --git a/Runtime/Character/CIkChain.hpp b/Runtime/Character/CIkChain.hpp index 738a5eb99..4df48d3b2 100644 --- a/Runtime/Character/CIkChain.hpp +++ b/Runtime/Character/CIkChain.hpp @@ -1,10 +1,11 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CTransform.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/CQuaternion.hpp" -#include "Character/CSegId.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CSegId.hpp" + +#include +#include +#include namespace urde { class CAnimData; diff --git a/Runtime/Character/CInt32POINode.hpp b/Runtime/Character/CInt32POINode.hpp index 9306a5f07..898fff078 100644 --- a/Runtime/Character/CInt32POINode.hpp +++ b/Runtime/Character/CInt32POINode.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CPOINode.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Character/CPOINode.hpp" namespace urde { class IAnimSourceInfo; diff --git a/Runtime/Character/CLayoutDescription.hpp b/Runtime/Character/CLayoutDescription.hpp index 935426385..248f57486 100644 --- a/Runtime/Character/CLayoutDescription.hpp +++ b/Runtime/Character/CLayoutDescription.hpp @@ -1,8 +1,10 @@ #pragma once #include -#include "CToken.hpp" -#include "zeus/CVector3f.hpp" + +#include "Runtime/CToken.hpp" + +#include namespace urde { class CCharLayoutInfo; diff --git a/Runtime/Character/CMetaAnimBlend.hpp b/Runtime/Character/CMetaAnimBlend.hpp index cd39e11ab..a2be465be 100644 --- a/Runtime/Character/CMetaAnimBlend.hpp +++ b/Runtime/Character/CMetaAnimBlend.hpp @@ -1,7 +1,9 @@ #pragma once -#include "IMetaAnim.hpp" -#include "IOStreams.hpp" +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/IMetaAnim.hpp" namespace urde { diff --git a/Runtime/Character/CMetaAnimFactory.hpp b/Runtime/Character/CMetaAnimFactory.hpp index 076d8a888..291bc368c 100644 --- a/Runtime/Character/CMetaAnimFactory.hpp +++ b/Runtime/Character/CMetaAnimFactory.hpp @@ -1,7 +1,9 @@ #pragma once -#include "IOStreams.hpp" -#include "IMetaAnim.hpp" +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/IMetaAnim.hpp" namespace urde { diff --git a/Runtime/Character/CMetaAnimPhaseBlend.hpp b/Runtime/Character/CMetaAnimPhaseBlend.hpp index 695a0c3a6..81686f5c7 100644 --- a/Runtime/Character/CMetaAnimPhaseBlend.hpp +++ b/Runtime/Character/CMetaAnimPhaseBlend.hpp @@ -1,7 +1,9 @@ #pragma once -#include "IMetaAnim.hpp" -#include "IOStreams.hpp" +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/IMetaAnim.hpp" namespace urde { diff --git a/Runtime/Character/CMetaAnimPlay.hpp b/Runtime/Character/CMetaAnimPlay.hpp index cb0c445f9..4f056eeb0 100644 --- a/Runtime/Character/CMetaAnimPlay.hpp +++ b/Runtime/Character/CMetaAnimPlay.hpp @@ -1,8 +1,8 @@ #pragma once -#include "IMetaAnim.hpp" -#include "CPrimitive.hpp" -#include "IOStreams.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/CPrimitive.hpp" +#include "Runtime/Character/IMetaAnim.hpp" namespace urde { diff --git a/Runtime/Character/CMetaAnimRandom.hpp b/Runtime/Character/CMetaAnimRandom.hpp index ac85f1c1b..9abb4e8a2 100644 --- a/Runtime/Character/CMetaAnimRandom.hpp +++ b/Runtime/Character/CMetaAnimRandom.hpp @@ -1,7 +1,11 @@ #pragma once -#include "IMetaAnim.hpp" -#include "IOStreams.hpp" +#include +#include +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/IMetaAnim.hpp" namespace urde { diff --git a/Runtime/Character/CMetaAnimSequence.hpp b/Runtime/Character/CMetaAnimSequence.hpp index fd14c2f57..57d68bf6d 100644 --- a/Runtime/Character/CMetaAnimSequence.hpp +++ b/Runtime/Character/CMetaAnimSequence.hpp @@ -1,7 +1,10 @@ #pragma once -#include "IMetaAnim.hpp" -#include "IOStreams.hpp" +#include +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/IMetaAnim.hpp" namespace urde { diff --git a/Runtime/Character/CMetaTransFactory.hpp b/Runtime/Character/CMetaTransFactory.hpp index da5e81784..d56e54342 100644 --- a/Runtime/Character/CMetaTransFactory.hpp +++ b/Runtime/Character/CMetaTransFactory.hpp @@ -1,7 +1,9 @@ #pragma once -#include "IOStreams.hpp" -#include "IMetaTrans.hpp" +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/IMetaTrans.hpp" namespace urde { diff --git a/Runtime/Character/CMetaTransMetaAnim.hpp b/Runtime/Character/CMetaTransMetaAnim.hpp index 6aa02381b..03f459254 100644 --- a/Runtime/Character/CMetaTransMetaAnim.hpp +++ b/Runtime/Character/CMetaTransMetaAnim.hpp @@ -1,8 +1,10 @@ #pragma once -#include "IMetaTrans.hpp" -#include "IMetaAnim.hpp" -#include "IOStreams.hpp" +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/IMetaAnim.hpp" +#include "Runtime/Character/IMetaTrans.hpp" namespace urde { diff --git a/Runtime/Character/CMetaTransPhaseTrans.hpp b/Runtime/Character/CMetaTransPhaseTrans.hpp index b327b87d2..b9e5c9e5e 100644 --- a/Runtime/Character/CMetaTransPhaseTrans.hpp +++ b/Runtime/Character/CMetaTransPhaseTrans.hpp @@ -1,8 +1,8 @@ #pragma once -#include "IMetaTrans.hpp" -#include "IOStreams.hpp" -#include "CCharAnimTime.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/CCharAnimTime.hpp" +#include "Runtime/Character/IMetaTrans.hpp" namespace urde { diff --git a/Runtime/Character/CMetaTransSnap.hpp b/Runtime/Character/CMetaTransSnap.hpp index cc3dc5f51..78b40af48 100644 --- a/Runtime/Character/CMetaTransSnap.hpp +++ b/Runtime/Character/CMetaTransSnap.hpp @@ -1,7 +1,7 @@ #pragma once -#include "IMetaTrans.hpp" -#include "IOStreams.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/IMetaTrans.hpp" namespace urde { diff --git a/Runtime/Character/CMetaTransTrans.hpp b/Runtime/Character/CMetaTransTrans.hpp index 429c0a163..b3cf33efd 100644 --- a/Runtime/Character/CMetaTransTrans.hpp +++ b/Runtime/Character/CMetaTransTrans.hpp @@ -1,8 +1,8 @@ #pragma once -#include "IMetaTrans.hpp" -#include "IOStreams.hpp" -#include "CCharAnimTime.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/CCharAnimTime.hpp" +#include "Runtime/Character/IMetaTrans.hpp" namespace urde { diff --git a/Runtime/Character/CModelData.hpp b/Runtime/Character/CModelData.hpp index da2b1b0b9..d398873ca 100644 --- a/Runtime/Character/CModelData.hpp +++ b/Runtime/Character/CModelData.hpp @@ -1,22 +1,25 @@ #pragma once -#include "zeus/CVector3f.hpp" -#include "zeus/CAABox.hpp" -#include "zeus/CColor.hpp" -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "CAnimData.hpp" -#include "Graphics/CModel.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CAnimData.hpp" +#include "Runtime/Graphics/CModel.hpp" + +#include +#include +#include namespace urde { -class CCharAnimTime; -class CStateManager; class CActorLights; -struct CModelFlags; -class CRandom16; class CAnimData; +class CCharAnimTime; class CModel; +class CRandom16; class CSkinnedModel; +class CStateManager; +struct CModelFlags; struct SAdvancementDeltas; class CStaticRes { diff --git a/Runtime/Character/CPASAnimInfo.hpp b/Runtime/Character/CPASAnimInfo.hpp index 239699471..1a86d22b9 100644 --- a/Runtime/Character/CPASAnimInfo.hpp +++ b/Runtime/Character/CPASAnimInfo.hpp @@ -1,8 +1,8 @@ #pragma once -#include "IOStreams.hpp" -#include "rstl.hpp" -#include "CPASAnimParm.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CPASAnimParm.hpp" namespace urde { diff --git a/Runtime/Character/CPASAnimParm.hpp b/Runtime/Character/CPASAnimParm.hpp index ed3f47c00..2d093930b 100644 --- a/Runtime/Character/CPASAnimParm.hpp +++ b/Runtime/Character/CPASAnimParm.hpp @@ -1,6 +1,6 @@ #pragma once -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { diff --git a/Runtime/Character/CPASAnimParmData.hpp b/Runtime/Character/CPASAnimParmData.hpp index 8ee34d5c9..b985f0682 100644 --- a/Runtime/Character/CPASAnimParmData.hpp +++ b/Runtime/Character/CPASAnimParmData.hpp @@ -1,6 +1,8 @@ #pragma once -#include "RetroTypes.hpp" -#include "CPASAnimParm.hpp" + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CPASAnimParm.hpp" namespace urde { class CPASAnimParmData { diff --git a/Runtime/Character/CPASAnimState.hpp b/Runtime/Character/CPASAnimState.hpp index db94422d6..8a26a5eb8 100644 --- a/Runtime/Character/CPASAnimState.hpp +++ b/Runtime/Character/CPASAnimState.hpp @@ -1,8 +1,11 @@ #pragma once -#include "IOStreams.hpp" -#include "CPASParmInfo.hpp" -#include "CPASAnimInfo.hpp" +#include +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/CPASAnimInfo.hpp" +#include "Runtime/Character/CPASParmInfo.hpp" namespace urde { class CRandom16; diff --git a/Runtime/Character/CPASDatabase.hpp b/Runtime/Character/CPASDatabase.hpp index 7ac561bf6..db97308b9 100644 --- a/Runtime/Character/CPASDatabase.hpp +++ b/Runtime/Character/CPASDatabase.hpp @@ -1,7 +1,11 @@ #pragma once -#include "IOStreams.hpp" -#include "CPASAnimState.hpp" +#include +#include +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/CPASAnimState.hpp" namespace urde { diff --git a/Runtime/Character/CPASParmInfo.hpp b/Runtime/Character/CPASParmInfo.hpp index adaa25ef9..c26c20e43 100644 --- a/Runtime/Character/CPASParmInfo.hpp +++ b/Runtime/Character/CPASParmInfo.hpp @@ -1,7 +1,7 @@ #pragma once -#include "IOStreams.hpp" -#include "CPASAnimParm.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/CPASAnimParm.hpp" namespace urde { diff --git a/Runtime/Character/CPOINode.hpp b/Runtime/Character/CPOINode.hpp index 2fcd6f6d8..a5777a3bd 100644 --- a/Runtime/Character/CPOINode.hpp +++ b/Runtime/Character/CPOINode.hpp @@ -1,7 +1,10 @@ #pragma once -#include "IOStreams.hpp" -#include "CCharAnimTime.hpp" +#include +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/CCharAnimTime.hpp" namespace urde { class IAnimSourceInfo; diff --git a/Runtime/Character/CParticleData.hpp b/Runtime/Character/CParticleData.hpp index 136c2af08..e79a01866 100644 --- a/Runtime/Character/CParticleData.hpp +++ b/Runtime/Character/CParticleData.hpp @@ -1,8 +1,11 @@ #pragma once -#include "IOStreams.hpp" -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/RetroTypes.hpp" + +#include namespace urde { diff --git a/Runtime/Character/CParticleDatabase.cpp b/Runtime/Character/CParticleDatabase.cpp index 3530245d6..2ad112c4d 100644 --- a/Runtime/Character/CParticleDatabase.cpp +++ b/Runtime/Character/CParticleDatabase.cpp @@ -336,16 +336,15 @@ void CParticleDatabase::AddAuxiliaryParticleEffect(std::string_view name, int fl else scaleVec = scale * data.GetScale(); - std::unique_ptr newGen; switch (data.GetTag().type.toUint32()) { case SBIG('PART'): { - auto search = x0_particleDescs.find(data.GetTag().id); - if (search != x0_particleDescs.end()) { + const auto search = x0_particleDescs.find(data.GetTag().id); + if (search != x0_particleDescs.cend()) { auto sys = std::make_shared(*search->second); - newGen = std::make_unique(data.GetTag(), sys, data.GetDuration(), "NOT_A_VALID_LOCATOR", - scaleVec, CParticleData::EParentedMode::Initial, flags, mgr, - aid, lightId + _getGraphicLightId(sys, *search->second), - EParticleGenType::Auxiliary); + auto newGen = std::make_unique( + data.GetTag(), sys, data.GetDuration(), "NOT_A_VALID_LOCATOR", scaleVec, + CParticleData::EParentedMode::Initial, flags, mgr, aid, lightId + _getGraphicLightId(sys, *search->second), + EParticleGenType::Auxiliary); newGen->SetGlobalTranslation(data.GetTranslation(), mgr); newGen->SetIsGrabInitialData(false); @@ -380,8 +379,8 @@ void CParticleDatabase::AddParticleEffect(std::string_view name, int flags, cons std::unique_ptr newGen; switch (data.GetTag().type.toUint32()) { case SBIG('PART'): { - auto search = x0_particleDescs.find(data.GetTag().id); - if (search != x0_particleDescs.end()) { + const auto search = x0_particleDescs.find(data.GetTag().id); + if (search != x0_particleDescs.cend()) { auto sys = std::make_shared(*search->second); newGen = std::make_unique( data.GetTag(), sys, data.GetDuration(), data.GetSegmentName(), scaleVec, data.GetParentedMode(), flags, mgr, @@ -390,8 +389,8 @@ void CParticleDatabase::AddParticleEffect(std::string_view name, int flags, cons break; } case SBIG('SWHC'): { - auto search = x14_swooshDescs.find(data.GetTag().id); - if (search != x14_swooshDescs.end()) { + const auto search = x14_swooshDescs.find(data.GetTag().id); + if (search != x14_swooshDescs.cend()) { auto sys = std::make_shared(*search->second, 0); newGen = std::make_unique(data.GetTag(), sys, data.GetDuration(), data.GetSegmentName(), scaleVec, data.GetParentedMode(), flags, mgr, aid, -1, @@ -400,8 +399,8 @@ void CParticleDatabase::AddParticleEffect(std::string_view name, int flags, cons break; } case SBIG('ELSC'): { - auto search = x28_electricDescs.find(data.GetTag().id); - if (search != x28_electricDescs.end()) { + const auto search = x28_electricDescs.find(data.GetTag().id); + if (search != x28_electricDescs.cend()) { auto sys = std::make_shared(*search->second); newGen = std::make_unique( data.GetTag(), sys, data.GetDuration(), data.GetSegmentName(), scaleVec, data.GetParentedMode(), flags, mgr, diff --git a/Runtime/Character/CParticleDatabase.hpp b/Runtime/Character/CParticleDatabase.hpp index 5a80112d4..60984f347 100644 --- a/Runtime/Character/CParticleDatabase.hpp +++ b/Runtime/Character/CParticleDatabase.hpp @@ -1,17 +1,22 @@ #pragma once -#include "CCharacterInfo.hpp" -#include "CParticleGenInfo.hpp" -#include "zeus/CFrustum.hpp" -#include "CToken.hpp" -#include "Particle/CGenDescription.hpp" -#include "Particle/CSwooshDescription.hpp" -#include "Particle/CElectricDescription.hpp" #include +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/Character/CCharacterInfo.hpp" +#include "Runtime/Character/CParticleGenInfo.hpp" +#include "Runtime/Particle/CGenDescription.hpp" +#include "Runtime/Particle/CSwooshDescription.hpp" +#include "Runtime/Particle/CElectricDescription.hpp" + +#include +#include namespace urde { -class CPoseAsTransforms; class CCharLayoutInfo; +class CPoseAsTransforms; class CParticleDatabase { std::map>> x0_particleDescs; diff --git a/Runtime/Character/CParticleGenInfo.cpp b/Runtime/Character/CParticleGenInfo.cpp index ea4926d53..360e7e07a 100644 --- a/Runtime/Character/CParticleGenInfo.cpp +++ b/Runtime/Character/CParticleGenInfo.cpp @@ -5,7 +5,7 @@ #include "World/CGameLight.hpp" #include "CStateManager.hpp" #include "Graphics/CBooRenderer.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/Character/CParticleGenInfo.hpp b/Runtime/Character/CParticleGenInfo.hpp index e76fbe2c8..af2418624 100644 --- a/Runtime/Character/CParticleGenInfo.hpp +++ b/Runtime/Character/CParticleGenInfo.hpp @@ -1,14 +1,18 @@ #pragma once -#include "RetroTypes.hpp" -#include "CParticleData.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/CAABox.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CParticleData.hpp" + +#include +#include +#include namespace urde { -struct SObjectTag; class CParticleGen; class CStateManager; +struct SObjectTag; enum class EParticleGenType { Normal, Auxiliary }; diff --git a/Runtime/Character/CParticlePOINode.hpp b/Runtime/Character/CParticlePOINode.hpp index 31af931cb..065ad773c 100644 --- a/Runtime/Character/CParticlePOINode.hpp +++ b/Runtime/Character/CParticlePOINode.hpp @@ -1,7 +1,7 @@ #pragma once -#include "CPOINode.hpp" -#include "CParticleData.hpp" +#include "Runtime/Character/CParticleData.hpp" +#include "Runtime/Character/CPOINode.hpp" namespace urde { class IAnimSourceInfo; diff --git a/Runtime/Character/CPoseAsTransforms.hpp b/Runtime/Character/CPoseAsTransforms.hpp index 5436a1b1c..a07d30553 100644 --- a/Runtime/Character/CPoseAsTransforms.hpp +++ b/Runtime/Character/CPoseAsTransforms.hpp @@ -1,8 +1,14 @@ #pragma once -#include "RetroTypes.hpp" -#include "CSegId.hpp" -#include "zeus/CTransform.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CSegId.hpp" + +#include +#include +#include namespace urde { class CCharLayoutInfo; diff --git a/Runtime/Character/CPrimitive.hpp b/Runtime/Character/CPrimitive.hpp index a3c2195a4..16e7236cd 100644 --- a/Runtime/Character/CPrimitive.hpp +++ b/Runtime/Character/CPrimitive.hpp @@ -1,7 +1,9 @@ #pragma once -#include "IOStreams.hpp" -#include "RetroTypes.hpp" +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { diff --git a/Runtime/Character/CRagDoll.hpp b/Runtime/Character/CRagDoll.hpp index 032c33d19..b8f75d04b 100644 --- a/Runtime/Character/CRagDoll.hpp +++ b/Runtime/Character/CRagDoll.hpp @@ -1,13 +1,17 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/CQuaternion.hpp" -#include "zeus/CAABox.hpp" -#include "CSegId.hpp" + +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CSegId.hpp" + +#include +#include +#include namespace urde { -class CHierarchyPoseBuilder; class CCharLayoutInfo; +class CHierarchyPoseBuilder; class CModelData; class CStateManager; diff --git a/Runtime/Character/CSegId.hpp b/Runtime/Character/CSegId.hpp index 3b036d45b..e351b7abd 100644 --- a/Runtime/Character/CSegId.hpp +++ b/Runtime/Character/CSegId.hpp @@ -1,8 +1,9 @@ #pragma once -#include "RetroTypes.hpp" -#include "IOStreams.hpp" -#include "zeus/CVector3f.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/RetroTypes.hpp" + +#include namespace urde { diff --git a/Runtime/Character/CSegIdList.hpp b/Runtime/Character/CSegIdList.hpp index 015dfc05e..65f456371 100644 --- a/Runtime/Character/CSegIdList.hpp +++ b/Runtime/Character/CSegIdList.hpp @@ -1,7 +1,9 @@ #pragma once -#include "IOStreams.hpp" -#include "CSegId.hpp" +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/CSegId.hpp" namespace urde { diff --git a/Runtime/Character/CSegStatementSet.hpp b/Runtime/Character/CSegStatementSet.hpp index 7017de90f..9499f9b2b 100644 --- a/Runtime/Character/CSegStatementSet.hpp +++ b/Runtime/Character/CSegStatementSet.hpp @@ -1,11 +1,11 @@ #pragma once -#include "CAnimPerSegmentData.hpp" -#include "CSegId.hpp" +#include "Runtime/Character/CAnimPerSegmentData.hpp" +#include "Runtime/Character/CSegId.hpp" namespace urde { -class CSegIdList; class CCharLayoutInfo; +class CSegIdList; class CSegStatementSet { public: diff --git a/Runtime/Character/CSequenceHelper.hpp b/Runtime/Character/CSequenceHelper.hpp index d84e4b36f..c93d13172 100644 --- a/Runtime/Character/CSequenceHelper.hpp +++ b/Runtime/Character/CSequenceHelper.hpp @@ -1,15 +1,18 @@ #pragma once -#include "CAnimTreeNode.hpp" -#include "CBoolPOINode.hpp" -#include "CInt32POINode.hpp" -#include "CParticlePOINode.hpp" -#include "CSoundPOINode.hpp" -#include "CAnimSysContext.hpp" +#include +#include + +#include "Runtime/Character/CAnimSysContext.hpp" +#include "Runtime/Character/CAnimTreeNode.hpp" +#include "Runtime/Character/CBoolPOINode.hpp" +#include "Runtime/Character/CInt32POINode.hpp" +#include "Runtime/Character/CParticlePOINode.hpp" +#include "Runtime/Character/CSoundPOINode.hpp" namespace urde { -class IMetaAnim; class CTransitionDatabaseGame; +class IMetaAnim; class CSequenceFundamentals { CSteadyStateAnimInfo x0_ssInfo; diff --git a/Runtime/Character/CSkinBank.hpp b/Runtime/Character/CSkinBank.hpp index 6e934937c..cce5921f0 100644 --- a/Runtime/Character/CSkinBank.hpp +++ b/Runtime/Character/CSkinBank.hpp @@ -1,7 +1,9 @@ #pragma once -#include "IOStreams.hpp" -#include "CSegId.hpp" +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/CSegId.hpp" namespace urde { class CPoseAsTransforms; diff --git a/Runtime/Character/CSkinRules.hpp b/Runtime/Character/CSkinRules.hpp index 5c10a5c8d..f75dd51d5 100644 --- a/Runtime/Character/CSkinRules.hpp +++ b/Runtime/Character/CSkinRules.hpp @@ -1,9 +1,13 @@ #pragma once -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "RetroTypes.hpp" -#include "CSkinBank.hpp" -#include "CFactoryMgr.hpp" +#include + +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CSkinBank.hpp" + +#include +#include namespace urde { class CPoseAsTransforms; diff --git a/Runtime/Character/CSoundPOINode.hpp b/Runtime/Character/CSoundPOINode.hpp index e1c08d2ec..0f46bae1e 100644 --- a/Runtime/Character/CSoundPOINode.hpp +++ b/Runtime/Character/CSoundPOINode.hpp @@ -1,7 +1,7 @@ #pragma once -#include "CPOINode.hpp" -#include "CCharAnimTime.hpp" +#include "Runtime/Character/CCharAnimTime.hpp" +#include "Runtime/Character/CPOINode.hpp" namespace urde { class IAnimSourceInfo; diff --git a/Runtime/Character/CSteeringBehaviors.hpp b/Runtime/Character/CSteeringBehaviors.hpp index 7dce9d580..d07466a62 100644 --- a/Runtime/Character/CSteeringBehaviors.hpp +++ b/Runtime/Character/CSteeringBehaviors.hpp @@ -1,7 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" + +#include +#include namespace urde { class CPhysicsActor; diff --git a/Runtime/Character/CTimeScaleFunctions.hpp b/Runtime/Character/CTimeScaleFunctions.hpp index 1da9fb482..e6bc159dc 100644 --- a/Runtime/Character/CTimeScaleFunctions.hpp +++ b/Runtime/Character/CTimeScaleFunctions.hpp @@ -1,7 +1,9 @@ #pragma once -#include "RetroTypes.hpp" -#include "CCharAnimTime.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CCharAnimTime.hpp" namespace urde { diff --git a/Runtime/Character/CTransition.hpp b/Runtime/Character/CTransition.hpp index ac7f9f2ea..b7d7a0266 100644 --- a/Runtime/Character/CTransition.hpp +++ b/Runtime/Character/CTransition.hpp @@ -1,7 +1,10 @@ #pragma once -#include "IOStreams.hpp" -#include "CMetaTransFactory.hpp" +#include +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/Character/CMetaTransFactory.hpp" namespace urde { diff --git a/Runtime/Character/CTransitionDatabase.hpp b/Runtime/Character/CTransitionDatabase.hpp index 2f91f3721..17266590e 100644 --- a/Runtime/Character/CTransitionDatabase.hpp +++ b/Runtime/Character/CTransitionDatabase.hpp @@ -1,6 +1,7 @@ #pragma once -#include "../RetroTypes.hpp" +#include +#include "Runtime/RetroTypes.hpp" namespace urde { class IMetaTrans; diff --git a/Runtime/Character/CTransitionDatabaseGame.hpp b/Runtime/Character/CTransitionDatabaseGame.hpp index 56f8a9b85..45f51c17e 100644 --- a/Runtime/Character/CTransitionDatabaseGame.hpp +++ b/Runtime/Character/CTransitionDatabaseGame.hpp @@ -1,6 +1,10 @@ #pragma once -#include "CTransitionDatabase.hpp" +#include +#include +#include + +#include "Runtime/Character/CTransitionDatabase.hpp" namespace urde { class CTransition; diff --git a/Runtime/Character/CTransitionManager.hpp b/Runtime/Character/CTransitionManager.hpp index 07a306169..8d72a5052 100644 --- a/Runtime/Character/CTransitionManager.hpp +++ b/Runtime/Character/CTransitionManager.hpp @@ -1,13 +1,15 @@ #pragma once -#include "CToken.hpp" -#include "CAnimSysContext.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/Character/CAnimSysContext.hpp" namespace urde { -class CTransitionDatabaseGame; +class CAnimTreeNode; class CRandom16; class CSimplePool; -class CAnimTreeNode; +class CTransitionDatabaseGame; class CTransitionManager { CAnimSysContext x0_animCtx; diff --git a/Runtime/Character/CTreeUtils.hpp b/Runtime/Character/CTreeUtils.hpp index 3898bc0bd..9397c51d7 100644 --- a/Runtime/Character/CTreeUtils.hpp +++ b/Runtime/Character/CTreeUtils.hpp @@ -1,6 +1,8 @@ #pragma once -#include "RetroTypes.hpp" +#include + +#include "Runtime/RetroTypes.hpp" namespace urde { class CAnimTreeNode; diff --git a/Runtime/Character/IAnimReader.hpp b/Runtime/Character/IAnimReader.hpp index db091304c..3522a5ba7 100644 --- a/Runtime/Character/IAnimReader.hpp +++ b/Runtime/Character/IAnimReader.hpp @@ -1,21 +1,25 @@ #pragma once -#include "RetroTypes.hpp" -#include "CCharAnimTime.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/CQuaternion.hpp" -#include "CParticleData.hpp" -#include "CToken.hpp" -#include "CAllFormatsAnimSource.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CAllFormatsAnimSource.hpp" +#include "Runtime/Character/CCharAnimTime.hpp" +#include "Runtime/Character/CParticleData.hpp" + +#include +#include namespace urde { -class CSegId; class CBoolPOINode; class CInt32POINode; class CParticlePOINode; -class CSoundPOINode; +class CSegId; class CSegIdList; class CSegStatementSet; +class CSoundPOINode; struct SAdvancementDeltas { zeus::CVector3f x0_posDelta; diff --git a/Runtime/Character/IMetaAnim.hpp b/Runtime/Character/IMetaAnim.hpp index 3a05883f2..71b3fc77a 100644 --- a/Runtime/Character/IMetaAnim.hpp +++ b/Runtime/Character/IMetaAnim.hpp @@ -1,15 +1,18 @@ #pragma once -#include "../RetroTypes.hpp" -#include "CCharAnimTime.hpp" +#include +#include #include +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CCharAnimTime.hpp" + namespace urde { class CAnimTreeNode; -struct CAnimSysContext; -struct CMetaAnimTreeBuildOrders; class CPrimitive; class IAnimReader; +struct CAnimSysContext; +struct CMetaAnimTreeBuildOrders; enum class EMetaAnimType { Play, Blend, PhaseBlend, Random, Sequence }; diff --git a/Runtime/Character/IMetaTrans.hpp b/Runtime/Character/IMetaTrans.hpp index 15ab80acd..862e2564f 100644 --- a/Runtime/Character/IMetaTrans.hpp +++ b/Runtime/Character/IMetaTrans.hpp @@ -1,6 +1,8 @@ #pragma once -#include "../RetroTypes.hpp" +#include + +#include "Runtime/RetroTypes.hpp" namespace urde { class CAnimTreeNode; diff --git a/Runtime/Character/IVaryingAnimationTimeScale.hpp b/Runtime/Character/IVaryingAnimationTimeScale.hpp index dedafb824..1d577e57f 100644 --- a/Runtime/Character/IVaryingAnimationTimeScale.hpp +++ b/Runtime/Character/IVaryingAnimationTimeScale.hpp @@ -1,6 +1,8 @@ #pragma once -#include "CCharAnimTime.hpp" +#include + +#include "Runtime/Character/CCharAnimTime.hpp" namespace urde { class IVaryingAnimationTimeScale { diff --git a/Runtime/Character/TSegIdMap.hpp b/Runtime/Character/TSegIdMap.hpp index 41d45709f..af333b9a5 100644 --- a/Runtime/Character/TSegIdMap.hpp +++ b/Runtime/Character/TSegIdMap.hpp @@ -1,7 +1,10 @@ #pragma once #include -#include "CSegId.hpp" +#include +#include + +#include "Runtime/Character/CSegId.hpp" namespace urde { diff --git a/Runtime/Collision/CAABoxFilter.hpp b/Runtime/Collision/CAABoxFilter.hpp index ee683cce8..4c4553169 100644 --- a/Runtime/Collision/CAABoxFilter.hpp +++ b/Runtime/Collision/CAABoxFilter.hpp @@ -1,6 +1,6 @@ #pragma once -#include "ICollisionFilter.hpp" +#include "Runtime/Collision/ICollisionFilter.hpp" namespace urde { diff --git a/Runtime/Collision/CAreaOctTree.hpp b/Runtime/Collision/CAreaOctTree.hpp index db6f68b8b..d071ea0db 100644 --- a/Runtime/Collision/CAreaOctTree.hpp +++ b/Runtime/Collision/CAreaOctTree.hpp @@ -1,10 +1,15 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CAABox.hpp" -#include "Collision/CCollisionEdge.hpp" -#include "Collision/CCollisionSurface.hpp" -#include "zeus/CLine.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Collision/CCollisionEdge.hpp" +#include "Runtime/Collision/CCollisionSurface.hpp" + +#include +#include +#include +#include namespace urde { class CMaterialFilter; diff --git a/Runtime/Collision/CBallFilter.hpp b/Runtime/Collision/CBallFilter.hpp index bd80dd5c4..eb050215c 100644 --- a/Runtime/Collision/CBallFilter.hpp +++ b/Runtime/Collision/CBallFilter.hpp @@ -1,6 +1,6 @@ #pragma once -#include "ICollisionFilter.hpp" +#include "Runtime/Collision/ICollisionFilter.hpp" namespace urde { class CPhysicsActor; diff --git a/Runtime/Collision/CCollidableAABox.hpp b/Runtime/Collision/CCollidableAABox.hpp index f9defa46d..577d12a45 100644 --- a/Runtime/Collision/CCollidableAABox.hpp +++ b/Runtime/Collision/CCollidableAABox.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CCollisionPrimitive.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Collision/CCollisionPrimitive.hpp" + +#include namespace urde { namespace Collide { diff --git a/Runtime/Collision/CCollidableCollisionSurface.hpp b/Runtime/Collision/CCollidableCollisionSurface.hpp index b2314b368..f1b70e8c6 100644 --- a/Runtime/Collision/CCollidableCollisionSurface.hpp +++ b/Runtime/Collision/CCollidableCollisionSurface.hpp @@ -1,6 +1,7 @@ #pragma once -#include "CCollisionPrimitive.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Collision/CCollisionPrimitive.hpp" namespace urde { class CCollidableCollisionSurface { diff --git a/Runtime/Collision/CCollidableOBBTree.hpp b/Runtime/Collision/CCollidableOBBTree.hpp index 56e67592e..ffa2088eb 100644 --- a/Runtime/Collision/CCollidableOBBTree.hpp +++ b/Runtime/Collision/CCollidableOBBTree.hpp @@ -1,9 +1,12 @@ #pragma once -#include "Collision/CCollisionPrimitive.hpp" -#include "COBBTree.hpp" -#include "zeus/COBBox.hpp" -#include "CMetroidAreaCollider.hpp" +#include "Runtime/Collision/CCollisionPrimitive.hpp" +#include "Runtime/Collision/CMetroidAreaCollider.hpp" +#include "Runtime/Collision/COBBTree.hpp" + +#include +#include +#include namespace urde { class CRayCastInfo { diff --git a/Runtime/Collision/CCollidableOBBTreeGroup.cpp b/Runtime/Collision/CCollidableOBBTreeGroup.cpp index ac58e2b2a..0bda28720 100644 --- a/Runtime/Collision/CCollidableOBBTreeGroup.cpp +++ b/Runtime/Collision/CCollidableOBBTreeGroup.cpp @@ -12,11 +12,11 @@ const CCollisionPrimitive::Type CCollidableOBBTreeGroup::sType(CCollidableOBBTre u32 CCollidableOBBTreeGroup::sTableIndex = -1; CCollidableOBBTreeGroupContainer::CCollidableOBBTreeGroupContainer(CInputStream& in) { - u32 treeCount = in.readUint32Big(); + const u32 treeCount = in.readUint32Big(); x0_trees.reserve(treeCount); for (u32 i = 0; i < treeCount; i++) { - std::unique_ptr tree(new COBBTree(in)); + auto tree = std::make_unique(in); x0_trees.push_back(std::move(tree)); } diff --git a/Runtime/Collision/CCollidableOBBTreeGroup.hpp b/Runtime/Collision/CCollidableOBBTreeGroup.hpp index 58d085045..3a1329942 100644 --- a/Runtime/Collision/CCollidableOBBTreeGroup.hpp +++ b/Runtime/Collision/CCollidableOBBTreeGroup.hpp @@ -1,10 +1,15 @@ #pragma once -#include "IOStreams.hpp" -#include "CFactoryMgr.hpp" -#include "COBBTree.hpp" -#include "zeus/CAABox.hpp" -#include "CCollisionPrimitive.hpp" +#include +#include + +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/Collision/COBBTree.hpp" +#include "Runtime/Collision/CCollisionPrimitive.hpp" + +#include +#include namespace urde { class CCollidableOBBTreeGroupContainer { diff --git a/Runtime/Collision/CCollidableSphere.hpp b/Runtime/Collision/CCollidableSphere.hpp index a00ae87f1..82021abe3 100644 --- a/Runtime/Collision/CCollidableSphere.hpp +++ b/Runtime/Collision/CCollidableSphere.hpp @@ -1,7 +1,9 @@ #pragma once -#include "CCollisionPrimitive.hpp" -#include "zeus/CSphere.hpp" +#include "Runtime/Collision/CCollisionPrimitive.hpp" + +#include +#include namespace urde { namespace Collide { diff --git a/Runtime/Collision/CCollisionActor.cpp b/Runtime/Collision/CCollisionActor.cpp index aba1c6156..1e7fe6740 100644 --- a/Runtime/Collision/CCollisionActor.cpp +++ b/Runtime/Collision/CCollisionActor.cpp @@ -4,7 +4,7 @@ #include "World/CActorParameters.hpp" #include "Collision/CCollidableOBBTreeGroup.hpp" #include "Collision/CCollidableSphere.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { static const CMaterialList gkDefaultCollisionActorMaterials = @@ -20,8 +20,8 @@ CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, co , x25c_owner(uid2) , x260_boxSize(extent) , x26c_center(center) -, x278_obbContainer(new CCollidableOBBTreeGroupContainer(extent, center)) -, x27c_obbTreeGroupPrimitive(new CCollidableOBBTreeGroup(x278_obbContainer.get(), GetMaterialList())) { +, x278_obbContainer(std::make_unique(extent, center)) +, x27c_obbTreeGroupPrimitive(std::make_unique(x278_obbContainer.get(), GetMaterialList())) { x10_name += ' '; x10_name += name; SetCoefficientOfRestitutionModifier(0.5f); @@ -38,8 +38,9 @@ CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, co , x258_primitiveType(EPrimitiveType::AABox) , x25c_owner(uid2) , x260_boxSize(boxSize) -, x280_aaboxPrimitive(new CCollidableAABox(zeus::CAABox(-0.5f * boxSize, 0.5f * boxSize), - CMaterialList(EMaterialTypes::Solid, EMaterialTypes::NoStaticCollision))) { +, x280_aaboxPrimitive( + std::make_unique(zeus::CAABox(-0.5f * boxSize, 0.5f * boxSize), + CMaterialList(EMaterialTypes::Solid, EMaterialTypes::NoStaticCollision))) { x10_name += ' '; x10_name += name; SetCoefficientOfRestitutionModifier(0.5f); @@ -55,8 +56,8 @@ CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, bo zeus::skNullBox, SMoverData(mass), CActorParameters::None(), 0.3f, 0.1f) , x258_primitiveType(EPrimitiveType::Sphere) , x25c_owner(uid2) -, x284_spherePrimitive(new CCollidableSphere(zeus::CSphere(zeus::skZero3f, radius), - CMaterialList(EMaterialTypes::NoStaticCollision, EMaterialTypes::Solid))) +, x284_spherePrimitive(std::make_unique( + zeus::CSphere(zeus::skZero3f, radius), CMaterialList(EMaterialTypes::NoStaticCollision, EMaterialTypes::Solid))) , x288_sphereRadius(radius) { x10_name += ' '; x10_name += name; diff --git a/Runtime/Collision/CCollisionActor.hpp b/Runtime/Collision/CCollisionActor.hpp index 71bdd4703..03ba11c9c 100644 --- a/Runtime/Collision/CCollisionActor.hpp +++ b/Runtime/Collision/CCollisionActor.hpp @@ -1,12 +1,19 @@ #pragma once -#include "World/CPhysicsActor.hpp" -#include "World/CHealthInfo.hpp" -#include "World/CDamageVulnerability.hpp" +#include +#include + +#include "Runtime/World/CDamageVulnerability.hpp" +#include "Runtime/World/CHealthInfo.hpp" +#include "Runtime/World/CPhysicsActor.hpp" + +#include + namespace urde { class CCollidableSphere; class CCollidableOBBTreeGroup; class CCollidableOBBTreeGroupContainer; + class CCollisionActor : public CPhysicsActor { enum class EPrimitiveType { OBBTreeGroup, AABox, Sphere }; diff --git a/Runtime/Collision/CCollisionActorManager.cpp b/Runtime/Collision/CCollisionActorManager.cpp index 362938606..add950c4a 100644 --- a/Runtime/Collision/CCollisionActorManager.cpp +++ b/Runtime/Collision/CCollisionActorManager.cpp @@ -1,5 +1,5 @@ #include "CCollisionActorManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "World/CActor.hpp" #include "CStateManager.hpp" #include "CMaterialList.hpp" diff --git a/Runtime/Collision/CCollisionActorManager.hpp b/Runtime/Collision/CCollisionActorManager.hpp index ac8d9ac84..5e78946ae 100644 --- a/Runtime/Collision/CCollisionActorManager.hpp +++ b/Runtime/Collision/CCollisionActorManager.hpp @@ -1,14 +1,20 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CAABox.hpp" -#include "Collision/CJointCollisionDescription.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Collision/CJointCollisionDescription.hpp" + +#include +#include namespace urde { -class CMaterialList; class CAnimData; class CCollisionActor; +class CMaterialList; class CStateManager; + class CCollisionActorManager { public: enum class EUpdateOptions { ObjectSpace, WorldSpace }; diff --git a/Runtime/Collision/CCollisionEdge.hpp b/Runtime/Collision/CCollisionEdge.hpp index e8f592f07..2b4a5db83 100644 --- a/Runtime/Collision/CCollisionEdge.hpp +++ b/Runtime/Collision/CCollisionEdge.hpp @@ -1,6 +1,6 @@ #pragma once -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { class CCollisionEdge { diff --git a/Runtime/Collision/CCollisionInfo.hpp b/Runtime/Collision/CCollisionInfo.hpp index 57a1c5f3f..fd064bce8 100644 --- a/Runtime/Collision/CCollisionInfo.hpp +++ b/Runtime/Collision/CCollisionInfo.hpp @@ -1,9 +1,11 @@ #pragma once -#include "RetroTypes.hpp" -#include "CMaterialList.hpp" -#include "zeus/CAABox.hpp" -#include "zeus/CMatrix3f.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Collision/CMaterialList.hpp" + +#include +#include +#include namespace urde { class CCollisionInfo { diff --git a/Runtime/Collision/CCollisionInfoList.hpp b/Runtime/Collision/CCollisionInfoList.hpp index 866ac82fe..77c49f151 100644 --- a/Runtime/Collision/CCollisionInfoList.hpp +++ b/Runtime/Collision/CCollisionInfoList.hpp @@ -1,7 +1,8 @@ #pragma once -#include "RetroTypes.hpp" -#include "CCollisionInfo.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Collision/CCollisionInfo.hpp" namespace urde { class CCollisionInfoList { diff --git a/Runtime/Collision/CCollisionPrimitive.cpp b/Runtime/Collision/CCollisionPrimitive.cpp index 4d9ff122e..d592a7ff4 100644 --- a/Runtime/Collision/CCollisionPrimitive.cpp +++ b/Runtime/Collision/CCollisionPrimitive.cpp @@ -149,13 +149,13 @@ bool CCollisionPrimitive::CollideMoving(const CInternalCollisionStructure::CPrim } void CCollisionPrimitive::InitBeginTypes() { - sCollisionTypeList.reset(new std::vector()); + sCollisionTypeList = std::make_unique>(); sCollisionTypeList->reserve(3); sTypesAdding = true; InternalColliders::AddTypes(); } -void CCollisionPrimitive::InitAddType(const CCollisionPrimitive::Type& tp) { +void CCollisionPrimitive::InitAddType(const Type& tp) { tp.GetSetter()(sCollisionTypeList->size()); sCollisionTypeList->push_back(tp); } @@ -168,13 +168,10 @@ void CCollisionPrimitive::InitEndTypes() { } void CCollisionPrimitive::InitBeginColliders() { - sTableOfCollidables.reset(new std::vector()); - sTableOfBooleanCollidables.reset(new std::vector()); - sTableOfMovingCollidables.reset(new std::vector()); - size_t tableSz = sCollisionTypeList->size() * sCollisionTypeList->size(); - sTableOfCollidables->resize(tableSz); - sTableOfBooleanCollidables->resize(tableSz); - sTableOfMovingCollidables->resize(tableSz); + const size_t tableSz = sCollisionTypeList->size() * sCollisionTypeList->size(); + sTableOfCollidables = std::make_unique>(tableSz); + sTableOfBooleanCollidables = std::make_unique>(tableSz); + sTableOfMovingCollidables = std::make_unique>(tableSz); sCollidersAdding = true; InternalColliders::AddColliders(); } diff --git a/Runtime/Collision/CCollisionPrimitive.hpp b/Runtime/Collision/CCollisionPrimitive.hpp index 1bd1bbac1..6eb102b64 100644 --- a/Runtime/Collision/CCollisionPrimitive.hpp +++ b/Runtime/Collision/CCollisionPrimitive.hpp @@ -1,10 +1,15 @@ #pragma once -#include "Collision/CMaterialList.hpp" -#include "CRayCastResult.hpp" -#include "zeus/CAABox.hpp" - #include +#include +#include + +#include "Runtime/Collision/CMaterialList.hpp" +#include "Runtime/Collision/CRayCastResult.hpp" + +#include +#include +#include namespace urde { class CCollisionPrimitive; diff --git a/Runtime/Collision/CCollisionResponseData.cpp b/Runtime/Collision/CCollisionResponseData.cpp index 50679bc57..2375805ad 100644 --- a/Runtime/Collision/CCollisionResponseData.cpp +++ b/Runtime/Collision/CCollisionResponseData.cpp @@ -232,7 +232,6 @@ FourCC CCollisionResponseData::UncookedResType() { return SBIG('CRSM'); } CFactoryFnReturn FCollisionResponseDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms, CObjectReference*) { CSimplePool* sp = vparms.GetOwnedObj(); - return TToken::GetIObjObjectFor( - std::unique_ptr(new CCollisionResponseData(in, sp))); + return TToken::GetIObjObjectFor(std::make_unique(in, sp)); } } // namespace urde diff --git a/Runtime/Collision/CCollisionResponseData.hpp b/Runtime/Collision/CCollisionResponseData.hpp index 09571f6b9..c295065a3 100644 --- a/Runtime/Collision/CCollisionResponseData.hpp +++ b/Runtime/Collision/CCollisionResponseData.hpp @@ -1,16 +1,19 @@ #pragma once -#include "RetroTypes.hpp" -#include "Collision/CMaterialList.hpp" -#include "CFactoryMgr.hpp" -#include "IObj.hpp" -#include "CToken.hpp" -#include "IOStreams.hpp" +#include +#include + +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/IObj.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Collision/CMaterialList.hpp" namespace urde { -class CSimplePool; -class CGenDescription; class CDecalDescription; +class CGenDescription; +class CSimplePool; enum class EWeaponCollisionResponseTypes { None, diff --git a/Runtime/Collision/CCollisionSurface.cpp b/Runtime/Collision/CCollisionSurface.cpp index 6e06bc3d3..749396146 100644 --- a/Runtime/Collision/CCollisionSurface.cpp +++ b/Runtime/Collision/CCollisionSurface.cpp @@ -1,4 +1,6 @@ -#include "CCollisionSurface.hpp" +#include "Runtime/Collision/CCollisionSurface.hpp" + +#include namespace urde { CCollisionSurface::CCollisionSurface(const zeus::CVector3f& a, const zeus::CVector3f& b, const zeus::CVector3f& c, diff --git a/Runtime/Collision/CCollisionSurface.hpp b/Runtime/Collision/CCollisionSurface.hpp index e8538049a..9cc67cedb 100644 --- a/Runtime/Collision/CCollisionSurface.hpp +++ b/Runtime/Collision/CCollisionSurface.hpp @@ -1,7 +1,9 @@ #pragma once -#include "zeus/zeus.hpp" -#include "RetroTypes.hpp" +#include "Runtime/GCNTypes.hpp" + +#include +#include namespace urde { class CCollisionSurface { diff --git a/Runtime/Collision/CGameCollision.cpp b/Runtime/Collision/CGameCollision.cpp index 8ed51e040..9f447892a 100644 --- a/Runtime/Collision/CGameCollision.cpp +++ b/Runtime/Collision/CGameCollision.cpp @@ -4,7 +4,7 @@ #include "CMaterialList.hpp" #include "World/CActor.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "World/CWorld.hpp" #include "CAABoxFilter.hpp" #include "CBallFilter.hpp" diff --git a/Runtime/Collision/CGameCollision.hpp b/Runtime/Collision/CGameCollision.hpp index 303eb0e75..fa4659de3 100644 --- a/Runtime/Collision/CGameCollision.hpp +++ b/Runtime/Collision/CGameCollision.hpp @@ -1,11 +1,15 @@ #pragma once -#include "zeus/CVector3f.hpp" -#include "zeus/CPlane.hpp" -#include "rstl.hpp" -#include "RetroTypes.hpp" -#include "CRayCastResult.hpp" -#include "CMetroidAreaCollider.hpp" -#include "CCollisionPrimitive.hpp" + +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Collision/CCollisionPrimitive.hpp" +#include "Runtime/Collision/CMetroidAreaCollider.hpp" +#include "Runtime/Collision/CRayCastResult.hpp" + +#include +#include namespace urde { diff --git a/Runtime/Collision/CInternalRayCastStructure.hpp b/Runtime/Collision/CInternalRayCastStructure.hpp index 962bb977f..e08e5170e 100644 --- a/Runtime/Collision/CInternalRayCastStructure.hpp +++ b/Runtime/Collision/CInternalRayCastStructure.hpp @@ -1,8 +1,11 @@ #pragma once -#include "zeus/CTransform.hpp" -#include "zeus/CMRay.hpp" -#include "CMaterialFilter.hpp" +#include "Runtime/Collision/CMaterialFilter.hpp" + +#include +#include +#include + namespace urde { class CInternalRayCastStructure { zeus::CMRay x0_ray; diff --git a/Runtime/Collision/CJointCollisionDescription.hpp b/Runtime/Collision/CJointCollisionDescription.hpp index b08ec09d1..5fdbf11cb 100644 --- a/Runtime/Collision/CJointCollisionDescription.hpp +++ b/Runtime/Collision/CJointCollisionDescription.hpp @@ -1,7 +1,11 @@ #pragma once -#include "Character/CSegId.hpp" -#include "zeus/CAABox.hpp" +#include + +#include "Runtime/Character/CSegId.hpp" + +#include +#include namespace urde { struct SJointInfo { diff --git a/Runtime/Collision/CMaterialFilter.cpp b/Runtime/Collision/CMaterialFilter.cpp index c7bcd8ae1..813662ca4 100644 --- a/Runtime/Collision/CMaterialFilter.cpp +++ b/Runtime/Collision/CMaterialFilter.cpp @@ -1,40 +1,6 @@ -#include "CMaterialFilter.hpp" +#include "Runtime/Collision/CMaterialFilter.hpp" namespace urde { const CMaterialFilter CMaterialFilter::skPassEverything({0x00000000FFFFFFFF}, {0}, CMaterialFilter::EFilterType::Always); - -CMaterialFilter::CMaterialFilter(const CMaterialList& include, const CMaterialList& exclude, - CMaterialFilter::EFilterType type) -: x0_include(include), x8_exclude(exclude), x10_type(type) {} - -CMaterialFilter CMaterialFilter::MakeInclude(const CMaterialList& include) { - return CMaterialFilter(include, {0ull}, EFilterType::Include); -} - -CMaterialFilter CMaterialFilter::MakeExclude(const CMaterialList& exclude) { - return CMaterialFilter({u64(0x00000000FFFFFFFF)}, exclude, EFilterType::Exclude); -} - -CMaterialFilter CMaterialFilter::MakeIncludeExclude(const CMaterialList& include, const CMaterialList& exclude) { - return CMaterialFilter(include, exclude, EFilterType::IncludeExclude); -} - -bool CMaterialFilter::Passes(const CMaterialList& list) const { - switch (x10_type) { - case EFilterType::Always: - return true; - case EFilterType::Include: - return (list.x0_list & x0_include.x0_list) != 0; - case EFilterType::Exclude: - return (list.x0_list & x8_exclude.x0_list) == 0; - case EFilterType::IncludeExclude: - if ((list.x0_list & x0_include.x0_list) == 0) - return false; - return (list.x0_list & x8_exclude.x0_list) == 0; - default: - return true; - } -} - } // namespace urde diff --git a/Runtime/Collision/CMaterialFilter.hpp b/Runtime/Collision/CMaterialFilter.hpp index fb2d41f3e..198c43bbd 100644 --- a/Runtime/Collision/CMaterialFilter.hpp +++ b/Runtime/Collision/CMaterialFilter.hpp @@ -1,7 +1,7 @@ #pragma once -#include "CMaterialList.hpp" -#include "zeus/Math.hpp" +#include "Runtime/Collision/CMaterialList.hpp" + namespace urde { class CMaterialFilter { public: @@ -15,18 +15,42 @@ private: public: static const CMaterialFilter skPassEverything; - CMaterialFilter(const CMaterialList& include, const CMaterialList& exclude, EFilterType type); + constexpr CMaterialFilter(const CMaterialList& include, const CMaterialList& exclude, EFilterType type) noexcept + : x0_include(include), x8_exclude(exclude), x10_type(type) {} - static CMaterialFilter MakeInclude(const CMaterialList& include); + static constexpr CMaterialFilter MakeInclude(const CMaterialList& include) noexcept { + return CMaterialFilter(include, {}, EFilterType::Include); + } - static CMaterialFilter MakeExclude(const CMaterialList& exclude); + static constexpr CMaterialFilter MakeExclude(const CMaterialList& exclude) noexcept { + return CMaterialFilter({u64(0x00000000FFFFFFFF)}, exclude, EFilterType::Exclude); + } - static CMaterialFilter MakeIncludeExclude(const CMaterialList& include, const CMaterialList& exclude); + static constexpr CMaterialFilter MakeIncludeExclude(const CMaterialList& include, + const CMaterialList& exclude) noexcept { + return CMaterialFilter(include, exclude, EFilterType::IncludeExclude); + } - const CMaterialList& GetIncludeList() const { return x0_include; } - const CMaterialList& GetExcludeList() const { return x8_exclude; } - CMaterialList& IncludeList() { return x0_include; } - CMaterialList& ExcludeList() { return x8_exclude; } - bool Passes(const CMaterialList&) const; + constexpr const CMaterialList& GetIncludeList() const noexcept { return x0_include; } + constexpr const CMaterialList& GetExcludeList() const noexcept { return x8_exclude; } + constexpr CMaterialList& IncludeList() noexcept { return x0_include; } + constexpr CMaterialList& ExcludeList() noexcept { return x8_exclude; } + + constexpr bool Passes(const CMaterialList& list) const noexcept { + switch (x10_type) { + case EFilterType::Always: + return true; + case EFilterType::Include: + return (list.x0_list & x0_include.x0_list) != 0; + case EFilterType::Exclude: + return (list.x0_list & x8_exclude.x0_list) == 0; + case EFilterType::IncludeExclude: + if ((list.x0_list & x0_include.x0_list) == 0) + return false; + return (list.x0_list & x8_exclude.x0_list) == 0; + default: + return true; + } + } }; } // namespace urde diff --git a/Runtime/Collision/CMaterialList.hpp b/Runtime/Collision/CMaterialList.hpp index 863eb5f7b..8af658359 100644 --- a/Runtime/Collision/CMaterialList.hpp +++ b/Runtime/Collision/CMaterialList.hpp @@ -1,6 +1,6 @@ #pragma once -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { enum class EMaterialTypes { @@ -71,63 +71,69 @@ class CMaterialList { u64 x0_list = 0; public: - CMaterialList() = default; - CMaterialList(u64 flags) : x0_list(flags) {} - CMaterialList(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3, EMaterialTypes t4, EMaterialTypes t5, - EMaterialTypes t6) + constexpr CMaterialList() noexcept = default; + constexpr CMaterialList(u64 flags) noexcept : x0_list(flags) {} + constexpr CMaterialList(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3, EMaterialTypes t4, EMaterialTypes t5, + EMaterialTypes t6) noexcept : CMaterialList(t1, t2, t3, t4, t5) { - x0_list |= 1ull << u64(t6); + x0_list |= u64{1} << u64(t6); } - CMaterialList(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3, EMaterialTypes t4, EMaterialTypes t5) + constexpr CMaterialList(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3, EMaterialTypes t4, + EMaterialTypes t5) noexcept : CMaterialList(t1, t2, t3, t4) { - x0_list |= 1ull << u64(t5); + x0_list |= u64{1} << u64(t5); } - CMaterialList(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3, EMaterialTypes t4) + constexpr CMaterialList(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3, EMaterialTypes t4) noexcept : CMaterialList(t1, t2, t3) { - x0_list |= 1ull << u64(t4); + x0_list |= u64{1} << u64(t4); } - CMaterialList(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3) : CMaterialList(t1, t2) { - x0_list |= 1ull << u64(t3); + constexpr CMaterialList(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3) noexcept : CMaterialList(t1, t2) { + x0_list |= u64{1} << u64(t3); } - CMaterialList(EMaterialTypes t1, EMaterialTypes t2) : CMaterialList(t1) { x0_list |= 1ull << u64(t2); } + constexpr CMaterialList(EMaterialTypes t1, EMaterialTypes t2) noexcept : CMaterialList(t1) { + x0_list |= u64{1} << u64(t2); + } - CMaterialList(EMaterialTypes t1) : x0_list(1ull << u64(t1)) {} + constexpr CMaterialList(EMaterialTypes t1) noexcept : x0_list(u64{1} << u64(t1)) {} - u64 GetValue() const { return x0_list; } + constexpr u64 GetValue() const noexcept { return x0_list; } - static s32 BitPosition(u64 flag) { - for (u32 i = 0; i < 64; ++i) - if ((flag & (1ull << i)) != 0) - return i; + static constexpr s32 BitPosition(u64 flag) noexcept { + for (u32 i = 0; i < 64; ++i) { + if ((flag & (u64{1} << i)) != 0) { + return static_cast(i); + } + } return -1; } - void Add(EMaterialTypes type) { x0_list |= (1ull << u64(type)); } + constexpr void Add(EMaterialTypes type) noexcept { x0_list |= (u64{1} << u64(type)); } - void Add(const CMaterialList& l) { x0_list |= l.x0_list; } + constexpr void Add(const CMaterialList& l) noexcept { x0_list |= l.x0_list; } - void Remove(EMaterialTypes type) { x0_list &= ~(1ull << u64(type)); } + constexpr void Remove(EMaterialTypes type) noexcept { x0_list &= ~(u64{1} << u64(type)); } - void Remove(const CMaterialList& other) { x0_list &= ~(other.x0_list); } + constexpr void Remove(const CMaterialList& other) noexcept { x0_list &= ~(other.x0_list); } - bool HasMaterial(EMaterialTypes type) const { return (x0_list & (1ull << u64(type))) != 0; } + constexpr bool HasMaterial(EMaterialTypes type) const noexcept { return (x0_list & (u64{1} << u64(type))) != 0; } - bool SharesMaterials(const CMaterialList& other) const { + constexpr bool SharesMaterials(const CMaterialList& other) const noexcept { for (u32 i = 0; i < 64; i++) { - if ((x0_list & (1ull << i)) != 0 && (other.x0_list & (1ull << i)) != 0) + if ((x0_list & (u64{1} << i)) != 0 && (other.x0_list & (u64{1} << i)) != 0) { return true; + } } return false; } - u64 Intersection(const CMaterialList& other) const { return other.x0_list & x0_list; } + constexpr u64 Intersection(const CMaterialList& other) const noexcept { return other.x0_list & x0_list; } - u64 XOR(const CMaterialList& other) const { return x0_list ^ other.x0_list; } + constexpr u64 XOR(const CMaterialList& other) const noexcept { return x0_list ^ other.x0_list; } }; } // namespace urde diff --git a/Runtime/Collision/CMetroidAreaCollider.hpp b/Runtime/Collision/CMetroidAreaCollider.hpp index e95c37e56..621c02e1a 100644 --- a/Runtime/Collision/CMetroidAreaCollider.hpp +++ b/Runtime/Collision/CMetroidAreaCollider.hpp @@ -1,12 +1,17 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CAABox.hpp" -#include "CAreaOctTree.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Collision/CAreaOctTree.hpp" + +#include +#include +#include +#include namespace urde { -class CCollisionInfoList; class CCollisionInfo; +class CCollisionInfoList; class CMaterialList; class CAABoxAreaCache { diff --git a/Runtime/Collision/COBBTree.cpp b/Runtime/Collision/COBBTree.cpp index ae420e9ff..eb4fd6c74 100644 --- a/Runtime/Collision/COBBTree.cpp +++ b/Runtime/Collision/COBBTree.cpp @@ -13,7 +13,7 @@ COBBTree::COBBTree(CInputStream& in) , x4_version(verify_version(in)) , x8_memsize(in.readUint32()) , x18_indexData(in) -, x88_root(new CNode(in)) {} +, x88_root(std::make_unique(in)) {} static const u8 DefaultEdgeMaterials[] = { 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 2, 2 @@ -168,10 +168,10 @@ COBBTree::CNode::CNode(CInputStream& in) { x0_obb = zeus::COBBox::ReadBig(in); x3c_isLeaf = in.readBool(); if (x3c_isLeaf) - x48_leaf.reset(new CLeafData(in)); + x48_leaf = std::make_unique(in); else { - x40_left.reset(new CNode(in)); - x44_right.reset(new CNode(in)); + x40_left = std::make_unique(in); + x44_right = std::make_unique(in); } } diff --git a/Runtime/Collision/COBBTree.hpp b/Runtime/Collision/COBBTree.hpp index ac9eef5e8..480bcf790 100644 --- a/Runtime/Collision/COBBTree.hpp +++ b/Runtime/Collision/COBBTree.hpp @@ -1,9 +1,14 @@ #pragma once -#include "RetroTypes.hpp" -#include "CCollisionEdge.hpp" -#include "CCollisionSurface.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/COBBox.hpp" + +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Collision/CCollisionEdge.hpp" +#include "Runtime/Collision/CCollisionSurface.hpp" + +#include +#include namespace urde { class CCollidableOBBTreeGroupContainer; diff --git a/Runtime/Collision/CRayCastResult.hpp b/Runtime/Collision/CRayCastResult.hpp index 86f49f3a5..cabd64655 100644 --- a/Runtime/Collision/CRayCastResult.hpp +++ b/Runtime/Collision/CRayCastResult.hpp @@ -1,7 +1,11 @@ #pragma once -#include "CMaterialList.hpp" -#include "zeus/zeus.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Collision/CMaterialList.hpp" + +#include +#include +#include namespace urde { class CRayCastResult { diff --git a/Runtime/Collision/CollisionUtil.cpp b/Runtime/Collision/CollisionUtil.cpp index 596db2e57..ed63b8653 100644 --- a/Runtime/Collision/CollisionUtil.cpp +++ b/Runtime/Collision/CollisionUtil.cpp @@ -1,6 +1,9 @@ -#include "CollisionUtil.hpp" -#include "CCollisionInfo.hpp" -#include "CCollisionInfoList.hpp" +#include "Runtime/Collision/CollisionUtil.hpp" + +#include "Runtime/Collision/CCollisionInfo.hpp" +#include "Runtime/Collision/CCollisionInfoList.hpp" + +#include namespace urde::CollisionUtil { bool LineIntersectsOBBox(const zeus::COBBox& obb, const zeus::CMRay& ray, float& d) { diff --git a/Runtime/Collision/CollisionUtil.hpp b/Runtime/Collision/CollisionUtil.hpp index 911bc9d6d..8e6da6c8b 100644 --- a/Runtime/Collision/CollisionUtil.hpp +++ b/Runtime/Collision/CollisionUtil.hpp @@ -1,8 +1,13 @@ #pragma once -#include "GCNTypes.hpp" -#include "zeus/zeus.hpp" -#include "CMaterialList.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Collision/CMaterialList.hpp" + +#include +#include +#include +#include +#include namespace urde { class CCollisionInfoList; diff --git a/Runtime/Collision/ICollisionFilter.hpp b/Runtime/Collision/ICollisionFilter.hpp index 4ba21bfee..c860603d0 100644 --- a/Runtime/Collision/ICollisionFilter.hpp +++ b/Runtime/Collision/ICollisionFilter.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CCollisionInfoList.hpp" +#include "Runtime/Collision/CCollisionInfoList.hpp" namespace urde { class CActor; diff --git a/Runtime/GameObjectLists.cpp b/Runtime/GameObjectLists.cpp index 550eb6015..bcba0d2af 100644 --- a/Runtime/GameObjectLists.cpp +++ b/Runtime/GameObjectLists.cpp @@ -6,7 +6,7 @@ #include "World/CScriptAiJumpPoint.hpp" #include "World/CPatterned.hpp" #include "Camera/CGameCamera.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/GameObjectLists.hpp b/Runtime/GameObjectLists.hpp index 715b153b9..d4b6a8b0c 100644 --- a/Runtime/GameObjectLists.hpp +++ b/Runtime/GameObjectLists.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CObjectList.hpp" +#include "Runtime/CObjectList.hpp" namespace urde { diff --git a/Runtime/Graphics/CBooRenderer.cpp b/Runtime/Graphics/CBooRenderer.cpp index fcc9d4b72..1575d76ba 100644 --- a/Runtime/Graphics/CBooRenderer.cpp +++ b/Runtime/Graphics/CBooRenderer.cpp @@ -130,22 +130,26 @@ void Buckets::Sort() { void Buckets::InsertPlaneObject(float closeDist, float farDist, const zeus::CAABox& aabb, bool invertTest, const zeus::CPlane& plane, bool zOnly, EDrawableType dtype, const void* data) { - if (sPlaneObjectData->size() == sPlaneObjectData->capacity()) + if (sPlaneObjectData->size() == sPlaneObjectData->capacity()) { return; - sPlaneObjectData->push_back(CDrawablePlaneObject(dtype, closeDist, farDist, aabb, invertTest, plane, zOnly, data)); + } + sPlaneObjectData->emplace_back(dtype, closeDist, farDist, aabb, invertTest, plane, zOnly, data); } void Buckets::Insert(const zeus::CVector3f& pos, const zeus::CAABox& aabb, EDrawableType dtype, const void* data, const zeus::CPlane& plane, u16 extraSort) { - if (sData->size() != sData->capacity()) { - float dist = plane.pointToPlaneDist(pos); - sData->push_back(CDrawable(dtype, extraSort, dist, aabb, data)); - if (sMinMaxDistance[0] > dist) - sMinMaxDistance[0] = dist; - if (sMinMaxDistance[1] < dist) - sMinMaxDistance[1] = dist; - } else { + if (sData->size() == sData->capacity()) { Log.report(logvisor::Fatal, fmt("Rendering buckets filled to capacity")); + return; + } + + const float dist = plane.pointToPlaneDist(pos); + sData->emplace_back(dtype, extraSort, dist, aabb, data); + if (sMinMaxDistance[0] > dist) { + sMinMaxDistance[0] = dist; + } + if (sMinMaxDistance[1] < dist) { + sMinMaxDistance[1] = dist; } } @@ -565,14 +569,16 @@ void CBooRenderer::GenerateScanLinesVBO(boo::IGraphicsDataFactory::Context& ctx) verts.reserve(670); for (int i = 0; i < 112; ++i) { - verts.push_back(zeus::CVector3f(-1.f, (i * (4.f / 448.f) + (1.f / 448.f)) * 2.f - 1.f, 0.f)); - if (i != 0) - verts.push_back(verts.back()); - verts.push_back(zeus::CVector3f(-1.f, (i * (4.f / 448.f) - (1.f / 448.f)) * 2.f - 1.f, 0.f)); - verts.push_back(zeus::CVector3f(1.f, (i * (4.f / 448.f) + (1.f / 448.f)) * 2.f - 1.f, 0.f)); - verts.push_back(zeus::CVector3f(1.f, (i * (4.f / 448.f) - (1.f / 448.f)) * 2.f - 1.f, 0.f)); - if (i != 111) - verts.push_back(verts.back()); + verts.emplace_back(-1.f, (float(i) * (4.f / 448.f) + (1.f / 448.f)) * 2.f - 1.f, 0.f); + if (i != 0) { + verts.emplace_back(verts.back()); + } + verts.emplace_back(-1.f, (float(i) * (4.f / 448.f) - (1.f / 448.f)) * 2.f - 1.f, 0.f); + verts.emplace_back(1.f, (float(i) * (4.f / 448.f) + (1.f / 448.f)) * 2.f - 1.f, 0.f); + verts.emplace_back(1.f, (float(i) * (4.f / 448.f) - (1.f / 448.f)) * 2.f - 1.f, 0.f); + if (i != 111) { + verts.emplace_back(verts.back()); + } } m_scanLinesEvenVBO = ctx.newStaticBuffer(boo::BufferUse::Vertex, verts.data(), sizeof(zeus::CVector3f), verts.size()); @@ -580,14 +586,16 @@ void CBooRenderer::GenerateScanLinesVBO(boo::IGraphicsDataFactory::Context& ctx) verts.clear(); for (int i = 0; i < 112; ++i) { - verts.push_back(zeus::CVector3f(-1.f, (i * (4.f / 448.f) + (3.f / 448.f)) * 2.f - 1.f, 0.f)); - if (i != 0) - verts.push_back(verts.back()); - verts.push_back(zeus::CVector3f(-1.f, (i * (4.f / 448.f) + (1.f / 448.f)) * 2.f - 1.f, 0.f)); - verts.push_back(zeus::CVector3f(1.f, (i * (4.f / 448.f) + (3.f / 448.f)) * 2.f - 1.f, 0.f)); - verts.push_back(zeus::CVector3f(1.f, (i * (4.f / 448.f) + (1.f / 448.f)) * 2.f - 1.f, 0.f)); - if (i != 111) - verts.push_back(verts.back()); + verts.emplace_back(-1.f, (float(i) * (4.f / 448.f) + (3.f / 448.f)) * 2.f - 1.f, 0.f); + if (i != 0) { + verts.emplace_back(verts.back()); + } + verts.emplace_back(-1.f, (float(i) * (4.f / 448.f) + (1.f / 448.f)) * 2.f - 1.f, 0.f); + verts.emplace_back(1.f, (float(i) * (4.f / 448.f) + (3.f / 448.f)) * 2.f - 1.f, 0.f); + verts.emplace_back(1.f, (float(i) * (4.f / 448.f) + (1.f / 448.f)) * 2.f - 1.f, 0.f); + if (i != 111) { + verts.emplace_back(verts.back()); + } } m_scanLinesOddVBO = ctx.newStaticBuffer(boo::BufferUse::Vertex, verts.data(), sizeof(zeus::CVector3f), verts.size()); diff --git a/Runtime/Graphics/CBooRenderer.hpp b/Runtime/Graphics/CBooRenderer.hpp index 401b60aec..b654d6105 100644 --- a/Runtime/Graphics/CBooRenderer.hpp +++ b/Runtime/Graphics/CBooRenderer.hpp @@ -1,29 +1,42 @@ #pragma once #include -#include "IRenderer.hpp" -#include "CDrawable.hpp" -#include "CDrawablePlaneObject.hpp" -#include "Shaders/CThermalColdFilter.hpp" -#include "Shaders/CThermalHotFilter.hpp" -#include "Shaders/CSpaceWarpFilter.hpp" -#include "Shaders/CFogVolumePlaneShader.hpp" -#include "Shaders/CFogVolumeFilter.hpp" -#include "Shaders/CPhazonSuitFilter.hpp" -#include "CTexture.hpp" -#include "CRandom16.hpp" -#include "CPVSVisSet.hpp" -#include "zeus/CRectangle.hpp" -#include "World/CGameArea.hpp" -#include "zeus/CPlane.hpp" +#include +#include +#include +#include +#include + +#include "Runtime/CRandom16.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Graphics/CDrawable.hpp" +#include "Runtime/Graphics/CDrawablePlaneObject.hpp" +#include "Runtime/Graphics/CPVSVisSet.hpp" +#include "Runtime/Graphics/CTexture.hpp" +#include "Runtime/Graphics/IRenderer.hpp" +#include "Runtime/Graphics/Shaders/CFogVolumeFilter.hpp" +#include "Runtime/Graphics/Shaders/CFogVolumePlaneShader.hpp" +#include "Runtime/Graphics/Shaders/CPhazonSuitFilter.hpp" +#include "Runtime/Graphics/Shaders/CSpaceWarpFilter.hpp" +#include "Runtime/Graphics/Shaders/CThermalColdFilter.hpp" +#include "Runtime/Graphics/Shaders/CThermalHotFilter.hpp" +#include "Runtime/World/CGameArea.hpp" + +#include +#include +#include +#include +#include +#include +#include namespace urde { -class IObjectStore; -class CMemorySys; -class IFactory; -class CTexture; -class CParticleGen; class CBooModel; +class CMemorySys; +class CParticleGen; +class CTexture; +class IFactory; +class IObjectStore; class Buckets { friend class CBooRenderer; @@ -57,10 +70,10 @@ enum class EWorldShadowMode { class CBooRenderer final : public IRenderer { friend class CBooModel; - friend class CModel; friend class CGameArea; - friend class CWorldTransManager; + friend class CModel; friend class CMorphBallShadow; + friend class CWorldTransManager; struct CAreaListItem { const std::vector* x0_geometry; diff --git a/Runtime/Graphics/CDrawable.hpp b/Runtime/Graphics/CDrawable.hpp index 63e6f40e8..8851b520d 100644 --- a/Runtime/Graphics/CDrawable.hpp +++ b/Runtime/Graphics/CDrawable.hpp @@ -1,7 +1,7 @@ #pragma once -#include "GCNTypes.hpp" -#include "zeus/CAABox.hpp" +#include "Runtime/GCNTypes.hpp" +#include namespace urde { enum class EDrawableType : u16 { WorldSurface, Particle, Actor, SimpleShadow, Decal }; diff --git a/Runtime/Graphics/CDrawablePlaneObject.hpp b/Runtime/Graphics/CDrawablePlaneObject.hpp index bed866300..aa94540cb 100644 --- a/Runtime/Graphics/CDrawablePlaneObject.hpp +++ b/Runtime/Graphics/CDrawablePlaneObject.hpp @@ -1,7 +1,7 @@ #pragma once -#include "CDrawable.hpp" -#include "zeus/CPlane.hpp" +#include "Runtime/Graphics/CDrawable.hpp" +#include namespace urde { class CDrawablePlaneObject : public CDrawable { diff --git a/Runtime/Graphics/CGraphics.hpp b/Runtime/Graphics/CGraphics.hpp index 73dfd3729..a9f26f249 100644 --- a/Runtime/Graphics/CGraphics.hpp +++ b/Runtime/Graphics/CGraphics.hpp @@ -1,15 +1,19 @@ #pragma once -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "boo/graphicsdev/IGraphicsCommandQueue.hpp" +#include -#include "RetroTypes.hpp" -#include "zeus/CTransform.hpp" -#include "zeus/CVector2i.hpp" -#include "zeus/CColor.hpp" +#include "Runtime/RetroTypes.hpp" -#include "hecl/Runtime.hpp" -#include "hecl/CVar.hpp" +#include +#include + +#include +#include + +#include +#include +#include +#include namespace urde { extern hecl::CVar* g_disableLighting; diff --git a/Runtime/Graphics/CGraphicsPalette.hpp b/Runtime/Graphics/CGraphicsPalette.hpp index 81061104b..72e78b8b7 100644 --- a/Runtime/Graphics/CGraphicsPalette.hpp +++ b/Runtime/Graphics/CGraphicsPalette.hpp @@ -1,7 +1,7 @@ #pragma once #include -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { diff --git a/Runtime/Graphics/CLight.hpp b/Runtime/Graphics/CLight.hpp index 20d137351..4fcc523b4 100644 --- a/Runtime/Graphics/CLight.hpp +++ b/Runtime/Graphics/CLight.hpp @@ -1,8 +1,9 @@ #pragma once -#include "zeus/CVector3f.hpp" -#include "zeus/CColor.hpp" -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" + +#include +#include namespace urde { diff --git a/Runtime/Graphics/CLineRenderer.hpp b/Runtime/Graphics/CLineRenderer.hpp index 11f7bcd02..07aa05879 100644 --- a/Runtime/Graphics/CLineRenderer.hpp +++ b/Runtime/Graphics/CLineRenderer.hpp @@ -1,13 +1,18 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/CVector4f.hpp" -#include "zeus/CColor.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "hecl/VertexBufferPool.hpp" -#include "hecl/UniformBufferPool.hpp" -#include "Graphics/CGraphics.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Graphics/CGraphics.hpp" + +#include + +#include +#include + +#include +#include +#include +#include namespace urde { diff --git a/Runtime/Graphics/CMetroidModelInstance.hpp b/Runtime/Graphics/CMetroidModelInstance.hpp index 3e132560d..b3305b176 100644 --- a/Runtime/Graphics/CMetroidModelInstance.hpp +++ b/Runtime/Graphics/CMetroidModelInstance.hpp @@ -1,12 +1,18 @@ #pragma once +#include +#include #include -#include "RetroTypes.hpp" -#include "zeus/CTransform.hpp" -#include "zeus/CAABox.hpp" -#include "hecl/HMDLMeta.hpp" + +#include "Runtime/RetroTypes.hpp" + #include "Shaders/CModelShaders.hpp" +#include + +#include +#include + namespace urde { class CBooModel; struct CBooSurface; diff --git a/Runtime/Graphics/CModel.hpp b/Runtime/Graphics/CModel.hpp index 24295b4c7..d569820ea 100644 --- a/Runtime/Graphics/CModel.hpp +++ b/Runtime/Graphics/CModel.hpp @@ -1,23 +1,29 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CColor.hpp" -#include "CFactoryMgr.hpp" -#include "CToken.hpp" -#include "zeus/CAABox.hpp" +#include +#include +#include +#include + #include "DNACommon/CMDL.hpp" #include "DNAMP1/CMDLMaterials.hpp" +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" #include "Shaders/CModelShaders.hpp" -#include "hecl/HMDLMeta.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" + +#include +#include +#include +#include namespace urde { -class IObjectStore; -class CTexture; class CLight; -class CSkinRules; -class CPoseAsTransforms; class CModel; +class CPoseAsTransforms; +class CSkinRules; +class CTexture; +class IObjectStore; struct CModelFlags { u8 x0_blendMode = 0; /* 2: add color, >6: additive, >4: blend, else opaque */ @@ -115,10 +121,10 @@ struct SShader { }; class CBooModel { - friend class CModel; - friend class CGameArea; friend class CBooRenderer; + friend class CGameArea; friend class CMetroidModelInstance; + friend class CModel; friend class CSkinnedModel; friend struct GeometryUniformLayout; diff --git a/Runtime/Graphics/CMoviePlayer.hpp b/Runtime/Graphics/CMoviePlayer.hpp index 57536f172..f32d47fe1 100644 --- a/Runtime/Graphics/CMoviePlayer.hpp +++ b/Runtime/Graphics/CMoviePlayer.hpp @@ -1,10 +1,14 @@ #pragma once -#include "RetroTypes.hpp" -#include "CDvdFile.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "specter/View.hpp" -#include "zeus/CVector3f.hpp" +#include +#include + +#include "Runtime/CDvdFile.hpp" +#include "Runtime/RetroTypes.hpp" + +#include +#include +#include namespace urde { diff --git a/Runtime/Graphics/CPVSAreaSet.hpp b/Runtime/Graphics/CPVSAreaSet.hpp index 9d16a7811..732ca0e0e 100644 --- a/Runtime/Graphics/CPVSAreaSet.hpp +++ b/Runtime/Graphics/CPVSAreaSet.hpp @@ -1,7 +1,9 @@ #pragma once -#include "RetroTypes.hpp" -#include "CPVSVisOctree.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/CPVSVisOctree.hpp" namespace urde { diff --git a/Runtime/Graphics/CPVSVisOctree.hpp b/Runtime/Graphics/CPVSVisOctree.hpp index 2b2452c61..ff9de4be6 100644 --- a/Runtime/Graphics/CPVSVisOctree.hpp +++ b/Runtime/Graphics/CPVSVisOctree.hpp @@ -1,8 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "CPVSVisSet.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/CPVSVisSet.hpp" + +#include +#include namespace urde { diff --git a/Runtime/Graphics/CPVSVisSet.hpp b/Runtime/Graphics/CPVSVisSet.hpp index 4b17e837c..51967d7b9 100644 --- a/Runtime/Graphics/CPVSVisSet.hpp +++ b/Runtime/Graphics/CPVSVisSet.hpp @@ -1,8 +1,7 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CAABox.hpp" -#include +#include "Runtime/RetroTypes.hpp" +#include namespace urde { class CPVSVisOctree; diff --git a/Runtime/Graphics/CRainSplashGenerator.hpp b/Runtime/Graphics/CRainSplashGenerator.hpp index 43824016a..2978c3750 100644 --- a/Runtime/Graphics/CRainSplashGenerator.hpp +++ b/Runtime/Graphics/CRainSplashGenerator.hpp @@ -1,9 +1,14 @@ #pragma once -#include "RetroTypes.hpp" -#include "CRandom16.hpp" -#include "zeus/CVector3f.hpp" -#include "Graphics/CLineRenderer.hpp" +#include +#include + +#include "Runtime/CRandom16.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Graphics/CLineRenderer.hpp" + +#include namespace urde { class CStateManager; diff --git a/Runtime/Graphics/CSimpleShadow.hpp b/Runtime/Graphics/CSimpleShadow.hpp index 7d1b7d164..43f368a70 100644 --- a/Runtime/Graphics/CSimpleShadow.hpp +++ b/Runtime/Graphics/CSimpleShadow.hpp @@ -1,7 +1,11 @@ #pragma once -#include "zeus/CAABox.hpp" -#include "Graphics/Shaders/CTexturedQuadFilter.hpp" +#include + +#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp" + +#include +#include namespace urde { class CTexture; diff --git a/Runtime/Graphics/CSkinnedModel.hpp b/Runtime/Graphics/CSkinnedModel.hpp index 2436969d8..cffc1a074 100644 --- a/Runtime/Graphics/CSkinnedModel.hpp +++ b/Runtime/Graphics/CSkinnedModel.hpp @@ -1,14 +1,20 @@ #pragma once -#include "CToken.hpp" -#include "CModel.hpp" +#include #include +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/Graphics/CModel.hpp" + +#include namespace urde { -class CModel; -class CSkinRules; class CCharLayoutInfo; +class CModel; class CPoseAsTransforms; +class CSkinRules; class CVertexMorphEffect; class IObjectStore; diff --git a/Runtime/Graphics/CTexture.hpp b/Runtime/Graphics/CTexture.hpp index 41596c514..9e79bf6b0 100644 --- a/Runtime/Graphics/CTexture.hpp +++ b/Runtime/Graphics/CTexture.hpp @@ -1,11 +1,15 @@ #pragma once -#include "GCNTypes.hpp" -#include "CFactoryMgr.hpp" -#include "IObj.hpp" -#include "IOStreams.hpp" -#include "Graphics/CGraphics.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" +#include +#include + +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/IObj.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/Graphics/CGraphics.hpp" + +#include namespace urde { class CVParamTransfer; diff --git a/Runtime/Graphics/CVertexMorphEffect.hpp b/Runtime/Graphics/CVertexMorphEffect.hpp index afb380027..7984a376d 100644 --- a/Runtime/Graphics/CVertexMorphEffect.hpp +++ b/Runtime/Graphics/CVertexMorphEffect.hpp @@ -1,11 +1,17 @@ #pragma once -#include "CToken.hpp" -#include "Character/CPoseAsTransforms.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/Character/CPoseAsTransforms.hpp" + +#include +#include namespace urde { -class CSkinRules; class CRandom16; +class CSkinRules; class CVertexMorphEffect { zeus::CUnitVector3f x0_; diff --git a/Runtime/Graphics/IRenderer.hpp b/Runtime/Graphics/IRenderer.hpp index b56afaad5..e1f42ef2d 100644 --- a/Runtime/Graphics/IRenderer.hpp +++ b/Runtime/Graphics/IRenderer.hpp @@ -1,26 +1,29 @@ #pragma once +#include #include -#include "../RetroTypes.hpp" -#include "../CToken.hpp" -#include "zeus/CAABox.hpp" -#include "zeus/CPlane.hpp" -#include "zeus/CFrustum.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CRectangle.hpp" -#include "CGraphics.hpp" + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/CGraphics.hpp" + +#include +#include +#include +#include +#include namespace urde { -class CMetroidModelInstance; -class CLight; class CAreaOctTree; -class CParticleGen; +class CLight; +class CMetroidModelInstance; class CModel; -struct SShader; -class CSkinnedModel; class CPVSVisSet; +class CParticleGen; +class CSkinnedModel; struct CAreaRenderOctTree; struct CModelFlags; +struct SShader; class IRenderer { public: diff --git a/Runtime/Graphics/Shaders/CAABoxShader.hpp b/Runtime/Graphics/Shaders/CAABoxShader.hpp index 712f913ef..e68255194 100644 --- a/Runtime/Graphics/Shaders/CAABoxShader.hpp +++ b/Runtime/Graphics/Shaders/CAABoxShader.hpp @@ -1,9 +1,10 @@ #pragma once -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CAABox.hpp" +#include + +#include +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CCameraBlurFilter.hpp b/Runtime/Graphics/Shaders/CCameraBlurFilter.hpp index af5382573..155cd861c 100644 --- a/Runtime/Graphics/Shaders/CCameraBlurFilter.hpp +++ b/Runtime/Graphics/Shaders/CCameraBlurFilter.hpp @@ -1,8 +1,11 @@ #pragma once -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" +#include + +#include +#include +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CColoredQuadFilter.hpp b/Runtime/Graphics/Shaders/CColoredQuadFilter.hpp index c4130555f..b79fcffa8 100644 --- a/Runtime/Graphics/Shaders/CColoredQuadFilter.hpp +++ b/Runtime/Graphics/Shaders/CColoredQuadFilter.hpp @@ -1,9 +1,11 @@ #pragma once -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CRectangle.hpp" -#include "Camera/CCameraFilter.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/Camera/CCameraFilter.hpp" + +#include +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CColoredStripShader.hpp b/Runtime/Graphics/Shaders/CColoredStripShader.hpp index aa4c8116e..bd6373a33 100644 --- a/Runtime/Graphics/Shaders/CColoredStripShader.hpp +++ b/Runtime/Graphics/Shaders/CColoredStripShader.hpp @@ -1,8 +1,9 @@ #pragma once -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" +#include + +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CDecalShaders.hpp b/Runtime/Graphics/Shaders/CDecalShaders.hpp index be4982db3..9ec398eb5 100644 --- a/Runtime/Graphics/Shaders/CDecalShaders.hpp +++ b/Runtime/Graphics/Shaders/CDecalShaders.hpp @@ -1,6 +1,6 @@ #pragma once -#include "Graphics/CGraphics.hpp" +#include "Runtime/Graphics/CGraphics.hpp" namespace urde { struct CQuadDecal; diff --git a/Runtime/Graphics/Shaders/CElementGenShaders.hpp b/Runtime/Graphics/Shaders/CElementGenShaders.hpp index be2999b97..3e89d351a 100644 --- a/Runtime/Graphics/Shaders/CElementGenShaders.hpp +++ b/Runtime/Graphics/Shaders/CElementGenShaders.hpp @@ -1,7 +1,10 @@ #pragma once -#include "Graphics/CGraphics.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" +#include + +#include "Runtime/Graphics/CGraphics.hpp" + +#include namespace urde { class CElementGen; diff --git a/Runtime/Graphics/Shaders/CEnergyBarShader.hpp b/Runtime/Graphics/Shaders/CEnergyBarShader.hpp index fd5ecd127..35b3254c6 100644 --- a/Runtime/Graphics/Shaders/CEnergyBarShader.hpp +++ b/Runtime/Graphics/Shaders/CEnergyBarShader.hpp @@ -1,9 +1,14 @@ #pragma once -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CRectangle.hpp" -#include "Camera/CCameraFilter.hpp" +#include + +#include "Runtime/Camera/CCameraFilter.hpp" + +#include +#include +#include +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CEnvFxShaders.hpp b/Runtime/Graphics/Shaders/CEnvFxShaders.hpp index aa5de7b8a..fe72ee5d8 100644 --- a/Runtime/Graphics/Shaders/CEnvFxShaders.hpp +++ b/Runtime/Graphics/Shaders/CEnvFxShaders.hpp @@ -1,7 +1,12 @@ #pragma once -#include "Graphics/CGraphics.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" +#include "Runtime/Graphics/CGraphics.hpp" + +#include +#include +#include +#include +#include namespace urde { class CEnvFxManager; diff --git a/Runtime/Graphics/Shaders/CFluidPlaneShader.hpp b/Runtime/Graphics/Shaders/CFluidPlaneShader.hpp index d0d00b424..e106b65f2 100644 --- a/Runtime/Graphics/Shaders/CFluidPlaneShader.hpp +++ b/Runtime/Graphics/Shaders/CFluidPlaneShader.hpp @@ -1,14 +1,23 @@ #pragma once -#include "RetroTypes.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "CModelShaders.hpp" -#include "World/CFluidPlaneManager.hpp" -#include "Graphics/CTexture.hpp" -#include "CToken.hpp" -#include "zeus/CAABox.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/CTexture.hpp" +#include "Runtime/Graphics/Shaders/CModelShaders.hpp" +#include "Runtime/World/CFluidPlaneManager.hpp" + #include "Shaders/shader_CFluidPlaneShader.hpp" +#include + +#include +#include +#include +#include +#include + namespace urde { class CFluidPlaneShader { diff --git a/Runtime/Graphics/Shaders/CFogVolumeFilter.hpp b/Runtime/Graphics/Shaders/CFogVolumeFilter.hpp index 70c41d155..d41015cb4 100644 --- a/Runtime/Graphics/Shaders/CFogVolumeFilter.hpp +++ b/Runtime/Graphics/Shaders/CFogVolumeFilter.hpp @@ -1,9 +1,10 @@ #pragma once -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CRectangle.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" +#include + +#include +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CFogVolumePlaneShader.hpp b/Runtime/Graphics/Shaders/CFogVolumePlaneShader.hpp index 26b1ab09a..5bf764d92 100644 --- a/Runtime/Graphics/Shaders/CFogVolumePlaneShader.hpp +++ b/Runtime/Graphics/Shaders/CFogVolumePlaneShader.hpp @@ -1,10 +1,14 @@ #pragma once -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CRectangle.hpp" -#include "zeus/CVector4f.hpp" +#include +#include + +#include + +#include +#include +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CLineRendererShaders.hpp b/Runtime/Graphics/Shaders/CLineRendererShaders.hpp index 3807898eb..b0afb4a3f 100644 --- a/Runtime/Graphics/Shaders/CLineRendererShaders.hpp +++ b/Runtime/Graphics/Shaders/CLineRendererShaders.hpp @@ -1,7 +1,10 @@ #pragma once -#include "Graphics/CGraphics.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" +#include + +#include "Runtime/Graphics/CGraphics.hpp" + +#include namespace urde { class CLineRenderer; diff --git a/Runtime/Graphics/Shaders/CMapSurfaceShader.hpp b/Runtime/Graphics/Shaders/CMapSurfaceShader.hpp index 18ed9013f..8b150066b 100644 --- a/Runtime/Graphics/Shaders/CMapSurfaceShader.hpp +++ b/Runtime/Graphics/Shaders/CMapSurfaceShader.hpp @@ -1,9 +1,11 @@ #pragma once -#include "RetroTypes.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" +#include "Runtime/RetroTypes.hpp" + +#include + +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CModelShaders.hpp b/Runtime/Graphics/Shaders/CModelShaders.hpp index 457583f13..25f607326 100644 --- a/Runtime/Graphics/Shaders/CModelShaders.hpp +++ b/Runtime/Graphics/Shaders/CModelShaders.hpp @@ -1,13 +1,18 @@ #pragma once -#include "hecl/Runtime.hpp" -#include "hecl/Backend.hpp" -#include -#include "zeus/CVector3f.hpp" -#include "zeus/CColor.hpp" -#include "Graphics/CGraphics.hpp" -#include "DataSpec/DNAMP1/CMDLMaterials.hpp" #include +#include + +#include "DataSpec/DNAMP1/CMDLMaterials.hpp" + +#include "Runtime/Graphics/CGraphics.hpp" + +#include +#include + +#include +#include +#include #define URDE_MAX_LIGHTS 8 diff --git a/Runtime/Graphics/Shaders/CParticleSwooshShaders.hpp b/Runtime/Graphics/Shaders/CParticleSwooshShaders.hpp index ee56a0e6a..b78699a60 100644 --- a/Runtime/Graphics/Shaders/CParticleSwooshShaders.hpp +++ b/Runtime/Graphics/Shaders/CParticleSwooshShaders.hpp @@ -1,7 +1,14 @@ #pragma once -#include "Graphics/CGraphics.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" +#include + +#include "Runtime/Graphics/CGraphics.hpp" + +#include + +#include +#include +#include namespace urde { class CParticleSwoosh; diff --git a/Runtime/Graphics/Shaders/CPhazonSuitFilter.hpp b/Runtime/Graphics/Shaders/CPhazonSuitFilter.hpp index f107b4063..8adba9604 100644 --- a/Runtime/Graphics/Shaders/CPhazonSuitFilter.hpp +++ b/Runtime/Graphics/Shaders/CPhazonSuitFilter.hpp @@ -1,7 +1,7 @@ #pragma once -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "zeus/CColor.hpp" +#include +#include namespace urde { class CTexture; diff --git a/Runtime/Graphics/Shaders/CRadarPaintShader.hpp b/Runtime/Graphics/Shaders/CRadarPaintShader.hpp index cac244d60..076ec6d3a 100644 --- a/Runtime/Graphics/Shaders/CRadarPaintShader.hpp +++ b/Runtime/Graphics/Shaders/CRadarPaintShader.hpp @@ -1,9 +1,12 @@ #pragma once -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CRectangle.hpp" -#include "Camera/CCameraFilter.hpp" +#include + +#include "Runtime/Camera/CCameraFilter.hpp" + +#include +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CRandomStaticFilter.hpp b/Runtime/Graphics/Shaders/CRandomStaticFilter.hpp index 99087338c..6722212f8 100644 --- a/Runtime/Graphics/Shaders/CRandomStaticFilter.hpp +++ b/Runtime/Graphics/Shaders/CRandomStaticFilter.hpp @@ -1,9 +1,10 @@ #pragma once -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CRectangle.hpp" -#include "Camera/CCameraFilter.hpp" +#include "Runtime/Camera/CCameraFilter.hpp" + +#include +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CScanLinesFilter.hpp b/Runtime/Graphics/Shaders/CScanLinesFilter.hpp index 8720199fc..6337d590a 100644 --- a/Runtime/Graphics/Shaders/CScanLinesFilter.hpp +++ b/Runtime/Graphics/Shaders/CScanLinesFilter.hpp @@ -1,9 +1,10 @@ #pragma once -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CRectangle.hpp" -#include "Camera/CCameraFilter.hpp" +#include "Runtime/Camera/CCameraFilter.hpp" + +#include +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CSpaceWarpFilter.hpp b/Runtime/Graphics/Shaders/CSpaceWarpFilter.hpp index 36ea5eb99..17c776f61 100644 --- a/Runtime/Graphics/Shaders/CSpaceWarpFilter.hpp +++ b/Runtime/Graphics/Shaders/CSpaceWarpFilter.hpp @@ -1,9 +1,10 @@ #pragma once -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "RetroTypes.hpp" -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" +#include "Runtime/RetroTypes.hpp" + +#include +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CTextSupportShader.hpp b/Runtime/Graphics/Shaders/CTextSupportShader.hpp index 957ef6288..b9f6adf3f 100644 --- a/Runtime/Graphics/Shaders/CTextSupportShader.hpp +++ b/Runtime/Graphics/Shaders/CTextSupportShader.hpp @@ -1,9 +1,15 @@ #pragma once -#include "GuiSys/CGuiWidget.hpp" -#include "hecl/VertexBufferPool.hpp" -#include "hecl/UniformBufferPool.hpp" -#include "zeus/CVector2i.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" + +#include +#include + +#include +#include +#include +#include +#include namespace urde { class CGlyph; diff --git a/Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp b/Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp index 04d5ea7ed..f8149978b 100644 --- a/Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp +++ b/Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp @@ -1,10 +1,13 @@ #pragma once -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CRectangle.hpp" -#include "Camera/CCameraFilter.hpp" -#include "CToken.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/Camera/CCameraFilter.hpp" + +#include +#include +#include +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CThermalColdFilter.hpp b/Runtime/Graphics/Shaders/CThermalColdFilter.hpp index 6a78c3a70..eeab4614a 100644 --- a/Runtime/Graphics/Shaders/CThermalColdFilter.hpp +++ b/Runtime/Graphics/Shaders/CThermalColdFilter.hpp @@ -1,9 +1,11 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" +#include "Runtime/RetroTypes.hpp" + +#include + +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CThermalHotFilter.hpp b/Runtime/Graphics/Shaders/CThermalHotFilter.hpp index dee1b7228..8135be2f3 100644 --- a/Runtime/Graphics/Shaders/CThermalHotFilter.hpp +++ b/Runtime/Graphics/Shaders/CThermalHotFilter.hpp @@ -1,8 +1,9 @@ #pragma once -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" +#include + +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CWorldShadowShader.hpp b/Runtime/Graphics/Shaders/CWorldShadowShader.hpp index d293158c8..3009248b2 100644 --- a/Runtime/Graphics/Shaders/CWorldShadowShader.hpp +++ b/Runtime/Graphics/Shaders/CWorldShadowShader.hpp @@ -1,7 +1,12 @@ #pragma once -#include "CColoredQuadFilter.hpp" -#include "CTexturedQuadFilter.hpp" +#include + +#include "Runtime/Graphics/Shaders/CColoredQuadFilter.hpp" +#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp" + +#include +#include namespace urde { diff --git a/Runtime/Graphics/Shaders/CXRayBlurFilter.hpp b/Runtime/Graphics/Shaders/CXRayBlurFilter.hpp index 0dcc2131c..503327aa9 100644 --- a/Runtime/Graphics/Shaders/CXRayBlurFilter.hpp +++ b/Runtime/Graphics/Shaders/CXRayBlurFilter.hpp @@ -1,9 +1,10 @@ #pragma once -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" -#include "CToken.hpp" +#include "Runtime/CToken.hpp" + +#include +#include +#include namespace urde { class CTexture; diff --git a/Runtime/GuiSys/CAuiEnergyBarT01.cpp b/Runtime/GuiSys/CAuiEnergyBarT01.cpp index 22658c524..c05ecdff9 100644 --- a/Runtime/GuiSys/CAuiEnergyBarT01.cpp +++ b/Runtime/GuiSys/CAuiEnergyBarT01.cpp @@ -12,7 +12,7 @@ CAuiEnergyBarT01::CAuiEnergyBarT01(const CGuiWidgetParms& parms, CSimplePool* sp } std::pair CAuiEnergyBarT01::DownloadBarCoordFunc(float t) { - float x = 12.5 * t - 6.25; + const float x = 12.5f * t - 6.25f; return {zeus::CVector3f{x, 0.f, -0.2f}, zeus::CVector3f{x, 0.f, 0.2f}}; } diff --git a/Runtime/GuiSys/CAuiEnergyBarT01.hpp b/Runtime/GuiSys/CAuiEnergyBarT01.hpp index 5144637fd..3c46af65e 100644 --- a/Runtime/GuiSys/CAuiEnergyBarT01.hpp +++ b/Runtime/GuiSys/CAuiEnergyBarT01.hpp @@ -1,9 +1,15 @@ #pragma once -#include "CGuiWidget.hpp" -#include "CToken.hpp" -#include "Graphics/CTexture.hpp" -#include "Graphics/Shaders/CEnergyBarShader.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/Graphics/CTexture.hpp" +#include "Runtime/Graphics/Shaders/CEnergyBarShader.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" + +#include +#include namespace urde { class CSimplePool; diff --git a/Runtime/GuiSys/CAuiImagePane.hpp b/Runtime/GuiSys/CAuiImagePane.hpp index 3c574f214..528a83417 100644 --- a/Runtime/GuiSys/CAuiImagePane.hpp +++ b/Runtime/GuiSys/CAuiImagePane.hpp @@ -1,8 +1,16 @@ #pragma once -#include "CGuiWidget.hpp" -#include "CToken.hpp" -#include "Graphics/Shaders/CTexturedQuadFilter.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" + +#include +#include + +namespace zeus { +class CColor; +} namespace urde { class CSimplePool; diff --git a/Runtime/GuiSys/CAuiMeter.hpp b/Runtime/GuiSys/CAuiMeter.hpp index 6934cfb4d..be0b83eae 100644 --- a/Runtime/GuiSys/CAuiMeter.hpp +++ b/Runtime/GuiSys/CAuiMeter.hpp @@ -1,6 +1,10 @@ #pragma once -#include "CGuiGroup.hpp" +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/GuiSys/CGuiGroup.hpp" namespace urde { class CSimplePool; diff --git a/Runtime/GuiSys/CCompoundTargetReticle.cpp b/Runtime/GuiSys/CCompoundTargetReticle.cpp index f1d3da741..a683e3936 100644 --- a/Runtime/GuiSys/CCompoundTargetReticle.cpp +++ b/Runtime/GuiSys/CCompoundTargetReticle.cpp @@ -4,19 +4,38 @@ #include "Camera/CGameCamera.hpp" #include "CSimplePool.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "World/CScriptGrapplePoint.hpp" #include "World/CPlayer.hpp" #include "World/CWorld.hpp" namespace urde { +namespace { +constexpr char skCrosshairsReticleAssetName[] = "CMDL_Crosshairs"; +[[maybe_unused]] constexpr char skOrbitZoneReticleAssetName[] = "CMDL_OrbitZone"; +constexpr char skSeekerAssetName[] = "CMDL_Seeker"; +constexpr char skLockConfirmAssetName[] = "CMDL_LockConfirm"; +constexpr char skTargetFlowerAssetName[] = "CMDL_TargetFlower"; +constexpr char skMissileBracketAssetName[] = "CMDL_MissileBracket"; +constexpr char skChargeGaugeAssetName[] = "CMDL_ChargeGauge"; +constexpr char skChargeBeamTickAssetName[] = "CMDL_ChargeTickFirst"; +constexpr char skOuterBeamIconSquareNameBase[] = "CMDL_BeamSquare"; +constexpr char skInnerBeamIconName[] = "CMDL_InnerBeamIcon"; +constexpr char skLockFireAssetName[] = "CMDL_LockFire"; +constexpr char skLockDaggerAssetName[] = "CMDL_LockDagger0"; +constexpr char skGrappleReticleAssetName[] = "CMDL_Grapple"; +constexpr char skXRayRingModelName[] = "CMDL_XRayRetRing"; +constexpr char skThermalReticleAssetName[] = "CMDL_ThermalRet"; +[[maybe_unused]] constexpr char skOrbitPointAssetName[] = "CMDL_OrbitPoint"; + +float offshoot_func(float f1, float f2, float f3) { return (f1 * 0.5f) + std::sin((f3 - 0.5f) * f2); } + +float calculate_premultiplied_overshoot_offset(float f1) { return 2.f * (M_PIF - std::asin(1.f / f1)); } +} // Anonymous namespace + const CTargetReticleRenderState CTargetReticleRenderState::skZeroRenderState(kInvalidUniqueId, 1.f, zeus::skZero3f, 0.f, 1.f, true); -static float offshoot_func(float f1, float f2, float f3) { return (f1 * 0.5f) + std::sin((f3 - 0.5f) * f2); } - -static float calculate_premultiplied_overshoot_offset(float f1) { return 2.f * (M_PIF - std::asin(1.f / f1)); } - CCompoundTargetReticle::SOuterItemInfo::SOuterItemInfo(std::string_view res) : x0_model(g_SimplePool->GetObj(res)) {} CCompoundTargetReticle::CCompoundTargetReticle(const CStateManager& mgr) diff --git a/Runtime/GuiSys/CCompoundTargetReticle.hpp b/Runtime/GuiSys/CCompoundTargetReticle.hpp index 072b212a4..06a6987a5 100644 --- a/Runtime/GuiSys/CCompoundTargetReticle.hpp +++ b/Runtime/GuiSys/CCompoundTargetReticle.hpp @@ -1,16 +1,20 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CQuaternion.hpp" -#include "CToken.hpp" -#include "Graphics/CLineRenderer.hpp" -#include "CPlayerState.hpp" +#include + +#include "Runtime/CPlayerState.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/Graphics/CLineRenderer.hpp" +#include "Runtime/RetroTypes.hpp" + +#include +#include namespace urde { class CActor; class CModel; -class CStateManager; class CScriptGrapplePoint; +class CStateManager; class CTargetReticleRenderState { TUniqueId x0_target; @@ -61,22 +65,6 @@ public: private: enum class EReticleState { Combat, Scan, XRay, Thermal, Four, Unspecified }; - static constexpr const char* skCrosshairsReticleAssetName = "CMDL_Crosshairs"; - static constexpr const char* skOrbitZoneReticleAssetName = "CMDL_OrbitZone"; - static constexpr const char* skSeekerAssetName = "CMDL_Seeker"; - static constexpr const char* skLockConfirmAssetName = "CMDL_LockConfirm"; - static constexpr const char* skTargetFlowerAssetName = "CMDL_TargetFlower"; - static constexpr const char* skMissileBracketAssetName = "CMDL_MissileBracket"; - static constexpr const char* skChargeGaugeAssetName = "CMDL_ChargeGauge"; - static constexpr const char* skChargeBeamTickAssetName = "CMDL_ChargeTickFirst"; - static constexpr const char* skOuterBeamIconSquareNameBase = "CMDL_BeamSquare"; - static constexpr const char* skInnerBeamIconName = "CMDL_InnerBeamIcon"; - static constexpr const char* skLockFireAssetName = "CMDL_LockFIre"; - static constexpr const char* skLockDaggerAssetName = "CMDL_LockDagger0"; - static constexpr const char* skGrappleReticleAssetName = "CMDL_Grapple"; - static constexpr const char* skXRayRingModelName = "CMDL_XRayRetRing"; - static constexpr const char* skThermalReticleAssetName = "CMDL_ThermalRet"; - static constexpr const char* skOrbitPointAssetName = "CMDL_OrbitPoint"; zeus::CQuaternion x0_leadingOrientation; zeus::CQuaternion x10_laggingOrientation; EReticleState x20_prevState = EReticleState::Unspecified; diff --git a/Runtime/GuiSys/CConsoleOutputWindow.hpp b/Runtime/GuiSys/CConsoleOutputWindow.hpp index 3220d798c..65fc0f862 100644 --- a/Runtime/GuiSys/CConsoleOutputWindow.hpp +++ b/Runtime/GuiSys/CConsoleOutputWindow.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CIOWin.hpp" +#include "Runtime/CIOWin.hpp" namespace urde { diff --git a/Runtime/GuiSys/CDrawStringOptions.hpp b/Runtime/GuiSys/CDrawStringOptions.hpp index 50aa975a6..43523df2f 100644 --- a/Runtime/GuiSys/CDrawStringOptions.hpp +++ b/Runtime/GuiSys/CDrawStringOptions.hpp @@ -1,8 +1,8 @@ #pragma once #include -#include "RetroTypes.hpp" -#include "CGuiTextSupport.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/GuiSys/CGuiTextSupport.hpp" namespace urde { diff --git a/Runtime/GuiSys/CErrorOutputWindow.hpp b/Runtime/GuiSys/CErrorOutputWindow.hpp index 99dad5dc8..2189d77d2 100644 --- a/Runtime/GuiSys/CErrorOutputWindow.hpp +++ b/Runtime/GuiSys/CErrorOutputWindow.hpp @@ -1,7 +1,7 @@ #pragma once -#include "CIOWin.hpp" -#include "RetroTypes.hpp" +#include "Runtime/CIOWin.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { diff --git a/Runtime/GuiSys/CFontImageDef.hpp b/Runtime/GuiSys/CFontImageDef.hpp index 53d1c6228..80355cd4f 100644 --- a/Runtime/GuiSys/CFontImageDef.hpp +++ b/Runtime/GuiSys/CFontImageDef.hpp @@ -1,8 +1,10 @@ #pragma once #include -#include "CToken.hpp" -#include "zeus/CVector2f.hpp" + +#include "Runtime/CToken.hpp" + +#include namespace urde { class CTexture; diff --git a/Runtime/GuiSys/CFontRenderState.hpp b/Runtime/GuiSys/CFontRenderState.hpp index 14c30df26..ec42f469f 100644 --- a/Runtime/GuiSys/CFontRenderState.hpp +++ b/Runtime/GuiSys/CFontRenderState.hpp @@ -1,18 +1,21 @@ #pragma once -#include "CGuiTextSupport.hpp" -#include "CSaveableState.hpp" -#include "CDrawStringOptions.hpp" +#include +#include + +#include "Runtime/GuiSys/CDrawStringOptions.hpp" +#include "Runtime/GuiSys/CGuiTextSupport.hpp" +#include "Runtime/GuiSys/CSaveableState.hpp" namespace urde { -class CLineInstruction; class CBlockInstruction; +class CLineInstruction; class CFontRenderState : public CSaveableState { - friend class CLineInstruction; friend class CBlockInstruction; - friend class CTextInstruction; friend class CImageInstruction; + friend class CLineInstruction; + friend class CTextInstruction; friend class CWordInstruction; CBlockInstruction* x88_curBlock = nullptr; diff --git a/Runtime/GuiSys/CGuiCamera.cpp b/Runtime/GuiSys/CGuiCamera.cpp index 09e210528..99354dce7 100644 --- a/Runtime/GuiSys/CGuiCamera.cpp +++ b/Runtime/GuiSys/CGuiCamera.cpp @@ -1,7 +1,8 @@ -#include "CGuiCamera.hpp" -#include "CGuiFrame.hpp" -#include "Graphics/CGraphics.hpp" -#include "CGuiWidgetDrawParms.hpp" +#include "Runtime/GuiSys/CGuiCamera.hpp" + +#include "Runtime/Graphics/CGraphics.hpp" +#include "Runtime/GuiSys/CGuiFrame.hpp" +#include "Runtime/GuiSys/CGuiWidgetDrawParms.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiCamera.hpp b/Runtime/GuiSys/CGuiCamera.hpp index 5b56cdd88..053041699 100644 --- a/Runtime/GuiSys/CGuiCamera.hpp +++ b/Runtime/GuiSys/CGuiCamera.hpp @@ -1,6 +1,7 @@ #pragma once -#include "CGuiWidget.hpp" +#include +#include "Runtime/GuiSys/CGuiWidget.hpp" namespace urde { class CSimplePool; diff --git a/Runtime/GuiSys/CGuiCompoundWidget.cpp b/Runtime/GuiSys/CGuiCompoundWidget.cpp index a70370850..27aefb6a6 100644 --- a/Runtime/GuiSys/CGuiCompoundWidget.cpp +++ b/Runtime/GuiSys/CGuiCompoundWidget.cpp @@ -1,4 +1,4 @@ -#include "CGuiCompoundWidget.hpp" +#include "Runtime/GuiSys/CGuiCompoundWidget.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiCompoundWidget.hpp b/Runtime/GuiSys/CGuiCompoundWidget.hpp index 82bd0f1c5..9eaac99c4 100644 --- a/Runtime/GuiSys/CGuiCompoundWidget.hpp +++ b/Runtime/GuiSys/CGuiCompoundWidget.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CGuiWidget.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiFrame.cpp b/Runtime/GuiSys/CGuiFrame.cpp index d1c9e7af8..6ab96bc90 100644 --- a/Runtime/GuiSys/CGuiFrame.cpp +++ b/Runtime/GuiSys/CGuiFrame.cpp @@ -1,16 +1,18 @@ -#include "CGuiFrame.hpp" -#include "CGuiWidget.hpp" -#include "CGuiSys.hpp" -#include "CGuiHeadWidget.hpp" -#include "CGuiLight.hpp" -#include "CGuiCamera.hpp" -#include "Graphics/CGraphics.hpp" -#include "Input/CFinalInput.hpp" -#include "zeus/CColor.hpp" -#include "CSimplePool.hpp" -#include "Graphics/CModel.hpp" -#include "CGuiWidgetDrawParms.hpp" -#include "CGuiTableGroup.hpp" +#include "Runtime/GuiSys/CGuiFrame.hpp" + +#include "Runtime/CSimplePool.hpp" +#include "Runtime/Graphics/CGraphics.hpp" +#include "Runtime/Graphics/CModel.hpp" +#include "Runtime/GuiSys/CGuiCamera.hpp" +#include "Runtime/GuiSys/CGuiHeadWidget.hpp" +#include "Runtime/GuiSys/CGuiLight.hpp" +#include "Runtime/GuiSys/CGuiSys.hpp" +#include "Runtime/GuiSys/CGuiTableGroup.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" +#include "Runtime/GuiSys/CGuiWidgetDrawParms.hpp" +#include "Runtime/Input/CFinalInput.hpp" + +#include namespace urde { @@ -18,9 +20,9 @@ CGuiFrame::CGuiFrame(CAssetId id, CGuiSys& sys, int a, int b, int c, CSimplePool : x0_id(id), x8_guiSys(sys), x4c_a(a), x50_b(b), x54_c(c), x58_24_loaded(false) { x3c_lights.reserve(8); m_indexedLights.reserve(8); - x10_rootWidget.reset(new CGuiWidget(CGuiWidget::CGuiWidgetParms( + x10_rootWidget = std::make_unique(CGuiWidget::CGuiWidgetParms( this, false, 0, 0, false, false, false, zeus::skWhite, CGuiWidget::EGuiModelDrawFlags::Alpha, false, - x8_guiSys.x8_mode != CGuiSys::EUsageMode::Zero, ""s))); + x8_guiSys.x8_mode != CGuiSys::EUsageMode::Zero, ""s)); x8_guiSys.m_registeredFrames.insert(this); } diff --git a/Runtime/GuiSys/CGuiFrame.hpp b/Runtime/GuiSys/CGuiFrame.hpp index 091081aca..bae374734 100644 --- a/Runtime/GuiSys/CGuiFrame.hpp +++ b/Runtime/GuiSys/CGuiFrame.hpp @@ -1,22 +1,27 @@ #pragma once -#include "CGuiWidget.hpp" -#include "CGuiHeadWidget.hpp" -#include "CGuiWidgetIdDB.hpp" -#include "IObj.hpp" -#include "boo/IWindow.hpp" #include +#include +#include +#include + +#include "Runtime/IObj.hpp" +#include "Runtime/GuiSys/CGuiHeadWidget.hpp" +#include "Runtime/GuiSys/CGuiWidgetIdDB.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" + +#include namespace urde { +class CBooModel; +class CGuiCamera; +class CGuiLight; class CGuiSys; class CLight; -class CGuiCamera; -struct CFinalInput; -class CGuiLight; -class CVParamTransfer; class CObjectReference; class CSimplePool; -class CBooModel; +class CVParamTransfer; +struct CFinalInput; class CGuiFrame { friend class CGuiSys; diff --git a/Runtime/GuiSys/CGuiGroup.cpp b/Runtime/GuiSys/CGuiGroup.cpp index 60c44af16..9a6bda8fc 100644 --- a/Runtime/GuiSys/CGuiGroup.cpp +++ b/Runtime/GuiSys/CGuiGroup.cpp @@ -1,4 +1,4 @@ -#include "CGuiGroup.hpp" +#include "Runtime/GuiSys/CGuiGroup.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiGroup.hpp b/Runtime/GuiSys/CGuiGroup.hpp index aec2ed07e..9a1bc4f43 100644 --- a/Runtime/GuiSys/CGuiGroup.hpp +++ b/Runtime/GuiSys/CGuiGroup.hpp @@ -1,6 +1,7 @@ #pragma once -#include "CGuiCompoundWidget.hpp" +#include +#include "Runtime/GuiSys/CGuiCompoundWidget.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiHeadWidget.cpp b/Runtime/GuiSys/CGuiHeadWidget.cpp index 5fe50df86..42edb8be9 100644 --- a/Runtime/GuiSys/CGuiHeadWidget.cpp +++ b/Runtime/GuiSys/CGuiHeadWidget.cpp @@ -1,5 +1,5 @@ -#include "CGuiHeadWidget.hpp" -#include "CGuiFrame.hpp" +#include "Runtime/GuiSys/CGuiHeadWidget.hpp" +#include "Runtime/GuiSys/CGuiFrame.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiHeadWidget.hpp b/Runtime/GuiSys/CGuiHeadWidget.hpp index d53064e66..46abbac73 100644 --- a/Runtime/GuiSys/CGuiHeadWidget.hpp +++ b/Runtime/GuiSys/CGuiHeadWidget.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CGuiWidget.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiLight.cpp b/Runtime/GuiSys/CGuiLight.cpp index ea58bd75d..c1299931b 100644 --- a/Runtime/GuiSys/CGuiLight.cpp +++ b/Runtime/GuiSys/CGuiLight.cpp @@ -1,5 +1,5 @@ -#include "CGuiLight.hpp" -#include "CGuiFrame.hpp" +#include "Runtime/GuiSys/CGuiLight.hpp" +#include "Runtime/GuiSys/CGuiFrame.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiLight.hpp b/Runtime/GuiSys/CGuiLight.hpp index 3d86bd1cd..2a077df11 100644 --- a/Runtime/GuiSys/CGuiLight.hpp +++ b/Runtime/GuiSys/CGuiLight.hpp @@ -1,7 +1,11 @@ #pragma once -#include "CGuiWidget.hpp" -#include "Graphics/CLight.hpp" +#include + +#include "Runtime/Graphics/CLight.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" + +#include namespace urde { class CSimplePool; diff --git a/Runtime/GuiSys/CGuiModel.cpp b/Runtime/GuiSys/CGuiModel.cpp index ab353c1eb..07a0f992a 100644 --- a/Runtime/GuiSys/CGuiModel.cpp +++ b/Runtime/GuiSys/CGuiModel.cpp @@ -1,9 +1,10 @@ -#include "CGuiModel.hpp" -#include "CGuiFrame.hpp" -#include "CGuiSys.hpp" -#include "CSimplePool.hpp" -#include "CGuiWidgetDrawParms.hpp" -#include "Graphics/CGraphics.hpp" +#include "Runtime/GuiSys/CGuiModel.hpp" + +#include "Runtime/CSimplePool.hpp" +#include "Runtime/Graphics/CGraphics.hpp" +#include "Runtime/GuiSys/CGuiFrame.hpp" +#include "Runtime/GuiSys/CGuiSys.hpp" +#include "Runtime/GuiSys/CGuiWidgetDrawParms.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiModel.hpp b/Runtime/GuiSys/CGuiModel.hpp index 9b40c52fd..0174ffd9c 100644 --- a/Runtime/GuiSys/CGuiModel.hpp +++ b/Runtime/GuiSys/CGuiModel.hpp @@ -1,8 +1,10 @@ #pragma once -#include "CGuiWidget.hpp" -#include "CToken.hpp" -#include "Graphics/CModel.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/Graphics/CModel.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" namespace urde { class CSimplePool; diff --git a/Runtime/GuiSys/CGuiObject.cpp b/Runtime/GuiSys/CGuiObject.cpp index c421e67fc..a0f27fb11 100644 --- a/Runtime/GuiSys/CGuiObject.cpp +++ b/Runtime/GuiSys/CGuiObject.cpp @@ -1,8 +1,9 @@ -#include "CGuiObject.hpp" -#include "CGuiWidgetDrawParms.hpp" -#include "Graphics/CTexture.hpp" -#include "CGuiWidget.hpp" -#include "CGuiFrame.hpp" +#include "Runtime/GuiSys/CGuiObject.hpp" + +#include "Runtime/Graphics/CTexture.hpp" +#include "Runtime/GuiSys/CGuiFrame.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" +#include "Runtime/GuiSys/CGuiWidgetDrawParms.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiObject.hpp b/Runtime/GuiSys/CGuiObject.hpp index 03d0d1f42..06d7b2d11 100644 --- a/Runtime/GuiSys/CGuiObject.hpp +++ b/Runtime/GuiSys/CGuiObject.hpp @@ -1,9 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/CQuaternion.hpp" -#include "zeus/CTransform.hpp" +#include "Runtime/RetroTypes.hpp" + +#include +#include +#include namespace urde { struct CGuiWidgetDrawParms; diff --git a/Runtime/GuiSys/CGuiPane.cpp b/Runtime/GuiSys/CGuiPane.cpp index 719d98f6f..5cd7658a5 100644 --- a/Runtime/GuiSys/CGuiPane.cpp +++ b/Runtime/GuiSys/CGuiPane.cpp @@ -1,4 +1,4 @@ -#include "CGuiPane.hpp" +#include "Runtime/GuiSys/CGuiPane.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiPane.hpp b/Runtime/GuiSys/CGuiPane.hpp index ffcdb390c..90bdb4729 100644 --- a/Runtime/GuiSys/CGuiPane.hpp +++ b/Runtime/GuiSys/CGuiPane.hpp @@ -1,7 +1,14 @@ #pragma once -#include "CGuiWidget.hpp" -#include "specter/View.hpp" +#include +#include + +#include "Runtime/GuiSys/CGuiWidget.hpp" + +#include + +#include +#include namespace urde { diff --git a/Runtime/GuiSys/CGuiSliderGroup.cpp b/Runtime/GuiSys/CGuiSliderGroup.cpp index 1f63d8e0d..bdb3e49d7 100644 --- a/Runtime/GuiSys/CGuiSliderGroup.cpp +++ b/Runtime/GuiSys/CGuiSliderGroup.cpp @@ -1,6 +1,7 @@ -#include "CGuiSliderGroup.hpp" -#include "Input/CFinalInput.hpp" -#include "CGuiModel.hpp" +#include "Runtime/GuiSys/CGuiSliderGroup.hpp" + +#include "Runtime/GuiSys/CGuiModel.hpp" +#include "Runtime/Input/CFinalInput.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiSliderGroup.hpp b/Runtime/GuiSys/CGuiSliderGroup.hpp index 4831bd752..f8a20235a 100644 --- a/Runtime/GuiSys/CGuiSliderGroup.hpp +++ b/Runtime/GuiSys/CGuiSliderGroup.hpp @@ -1,7 +1,9 @@ #pragma once -#include "CGuiCompoundWidget.hpp" #include +#include + +#include "Runtime/GuiSys/CGuiCompoundWidget.hpp" namespace urde { class CSimplePool; diff --git a/Runtime/GuiSys/CGuiSys.cpp b/Runtime/GuiSys/CGuiSys.cpp index 49c0b8f81..1888da21b 100644 --- a/Runtime/GuiSys/CGuiSys.cpp +++ b/Runtime/GuiSys/CGuiSys.cpp @@ -1,21 +1,22 @@ -#include "CGuiSys.hpp" -#include "CGuiWidget.hpp" -#include "CGuiHeadWidget.hpp" -#include "CGuiLight.hpp" -#include "CGuiCamera.hpp" -#include "CGuiGroup.hpp" -#include "CGuiPane.hpp" -#include "CAuiImagePane.hpp" -#include "CAuiMeter.hpp" -#include "CGuiModel.hpp" -#include "CGuiTableGroup.hpp" -#include "CGuiSliderGroup.hpp" -#include "CGuiTextPane.hpp" -#include "CAuiEnergyBarT01.hpp" -#include "CTextParser.hpp" -#include "CSimplePool.hpp" -#include "CTextExecuteBuffer.hpp" -#include "CGuiFrame.hpp" +#include "Runtime/GuiSys/CGuiSys.hpp" + +#include "Runtime/CSimplePool.hpp" +#include "Runtime/GuiSys/CAuiEnergyBarT01.hpp" +#include "Runtime/GuiSys/CAuiImagePane.hpp" +#include "Runtime/GuiSys/CAuiMeter.hpp" +#include "Runtime/GuiSys/CGuiCamera.hpp" +#include "Runtime/GuiSys/CGuiFrame.hpp" +#include "Runtime/GuiSys/CGuiGroup.hpp" +#include "Runtime/GuiSys/CGuiHeadWidget.hpp" +#include "Runtime/GuiSys/CGuiLight.hpp" +#include "Runtime/GuiSys/CGuiModel.hpp" +#include "Runtime/GuiSys/CGuiPane.hpp" +#include "Runtime/GuiSys/CGuiSliderGroup.hpp" +#include "Runtime/GuiSys/CGuiTableGroup.hpp" +#include "Runtime/GuiSys/CGuiTextPane.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" +#include "Runtime/GuiSys/CTextExecuteBuffer.hpp" +#include "Runtime/GuiSys/CTextParser.hpp" namespace urde { @@ -61,8 +62,8 @@ CGuiSys::CGuiSys(IFactory& resFactory, CSimplePool& resStore, EUsageMode mode) : x0_resFactory(resFactory) , x4_resStore(resStore) , x8_mode(mode) -, xc_textExecuteBuf(new CTextExecuteBuffer()) -, x10_textParser(new CTextParser(resStore)) { +, xc_textExecuteBuf(std::make_unique()) +, x10_textParser(std::make_unique(resStore)) { g_TextExecuteBuf = xc_textExecuteBuf.get(); g_TextParser = x10_textParser.get(); } diff --git a/Runtime/GuiSys/CGuiSys.hpp b/Runtime/GuiSys/CGuiSys.hpp index d64a84921..d82cc5aa8 100644 --- a/Runtime/GuiSys/CGuiSys.hpp +++ b/Runtime/GuiSys/CGuiSys.hpp @@ -1,22 +1,25 @@ #pragma once -#include "hecl/hecl.hpp" -#include -#include +#include #include -#include "CSaveableState.hpp" -#include "IOStreams.hpp" +#include +#include + +#include "Runtime/IOStreams.hpp" +#include "Runtime/GuiSys/CSaveableState.hpp" + +#include namespace urde { -class CGuiObject; -class CVParamTransfer; -struct SObjectTag; -class IFactory; -class CSimplePool; -class CGuiWidget; class CGuiFrame; -class CTextParser; +class CGuiObject; +class CGuiWidget; +class CSimplePool; class CTextExecuteBuffer; +class CTextParser; +class CVParamTransfer; +class IFactory; +struct SObjectTag; class CGuiSys { friend class CGuiFrame; diff --git a/Runtime/GuiSys/CGuiTableGroup.cpp b/Runtime/GuiSys/CGuiTableGroup.cpp index 1889003f4..83a7848c7 100644 --- a/Runtime/GuiSys/CGuiTableGroup.cpp +++ b/Runtime/GuiSys/CGuiTableGroup.cpp @@ -1,5 +1,5 @@ -#include "CGuiTableGroup.hpp" -#include "Input/CFinalInput.hpp" +#include "Runtime/GuiSys/CGuiTableGroup.hpp" +#include "Runtime/Input/CFinalInput.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiTableGroup.hpp b/Runtime/GuiSys/CGuiTableGroup.hpp index 6affde0f9..4f4b3d0f3 100644 --- a/Runtime/GuiSys/CGuiTableGroup.hpp +++ b/Runtime/GuiSys/CGuiTableGroup.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CGuiCompoundWidget.hpp" +#include +#include + +#include "Runtime/GuiSys/CGuiCompoundWidget.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiTextPane.cpp b/Runtime/GuiSys/CGuiTextPane.cpp index e39fdd1f4..3a54fad6d 100644 --- a/Runtime/GuiSys/CGuiTextPane.cpp +++ b/Runtime/GuiSys/CGuiTextPane.cpp @@ -1,10 +1,11 @@ -#include "CGuiTextPane.hpp" -#include "CFontImageDef.hpp" -#include "CGuiFrame.hpp" -#include "CGuiSys.hpp" -#include "CGuiWidgetDrawParms.hpp" -#include "Graphics/CGraphics.hpp" -#include "Graphics/CGraphicsPalette.hpp" +#include "Runtime/GuiSys/CGuiTextPane.hpp" + +#include "Runtime/Graphics/CGraphics.hpp" +#include "Runtime/Graphics/CGraphicsPalette.hpp" +#include "Runtime/GuiSys/CFontImageDef.hpp" +#include "Runtime/GuiSys/CGuiFrame.hpp" +#include "Runtime/GuiSys/CGuiSys.hpp" +#include "Runtime/GuiSys/CGuiWidgetDrawParms.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiTextPane.hpp b/Runtime/GuiSys/CGuiTextPane.hpp index bcc67e431..532d585f3 100644 --- a/Runtime/GuiSys/CGuiTextPane.hpp +++ b/Runtime/GuiSys/CGuiTextPane.hpp @@ -1,7 +1,10 @@ #pragma once -#include "CGuiPane.hpp" -#include "CGuiTextSupport.hpp" +#include +#include + +#include "Runtime/GuiSys/CGuiPane.hpp" +#include "Runtime/GuiSys/CGuiTextSupport.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiTextSupport.cpp b/Runtime/GuiSys/CGuiTextSupport.cpp index 47248d7c1..b1aa1ab6e 100644 --- a/Runtime/GuiSys/CGuiTextSupport.cpp +++ b/Runtime/GuiSys/CGuiTextSupport.cpp @@ -1,12 +1,13 @@ -#include "CGuiTextSupport.hpp" -#include "CSimplePool.hpp" -#include "CFontImageDef.hpp" -#include "CGuiSys.hpp" -#include "CTextExecuteBuffer.hpp" -#include "CTextParser.hpp" -#include "Graphics/CGraphicsPalette.hpp" -#include "Graphics/CGraphics.hpp" -#include "GuiSys/CRasterFont.hpp" +#include "Runtime/GuiSys/CGuiTextSupport.hpp" + +#include "Runtime/CSimplePool.hpp" +#include "Runtime/Graphics/CGraphics.hpp" +#include "Runtime/Graphics/CGraphicsPalette.hpp" +#include "Runtime/GuiSys/CFontImageDef.hpp" +#include "Runtime/GuiSys/CGuiSys.hpp" +#include "Runtime/GuiSys/CRasterFont.hpp" +#include "Runtime/GuiSys/CTextExecuteBuffer.hpp" +#include "Runtime/GuiSys/CTextParser.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiTextSupport.hpp b/Runtime/GuiSys/CGuiTextSupport.hpp index 307de1878..fa7ecd1b6 100644 --- a/Runtime/GuiSys/CGuiTextSupport.hpp +++ b/Runtime/GuiSys/CGuiTextSupport.hpp @@ -1,19 +1,23 @@ #pragma once -#include "zeus/CColor.hpp" -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "CTextRenderBuffer.hpp" -#include "CGuiWidget.hpp" -#include "CSaveWorld.hpp" +#include #include #include +#include + +#include "Runtime/CSaveWorld.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" +#include "Runtime/GuiSys/CTextRenderBuffer.hpp" + +#include namespace urde { -class CSimplePool; class CRasterFont; -class CTextRenderBuffer; +class CSimplePool; class CTextExecuteBuffer; +class CTextRenderBuffer; enum class EJustification { Left = 0, Center, Right, Full, NLeft, NCenter, NRight, LeftMono, CenterMono, RightMono }; diff --git a/Runtime/GuiSys/CGuiWidget.cpp b/Runtime/GuiSys/CGuiWidget.cpp index 36d03e821..e68fe0ce9 100644 --- a/Runtime/GuiSys/CGuiWidget.cpp +++ b/Runtime/GuiSys/CGuiWidget.cpp @@ -1,5 +1,7 @@ -#include "CGuiWidget.hpp" -#include "CGuiFrame.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" +#include "Runtime/GuiSys/CGuiFrame.hpp" + +#include namespace urde { static logvisor::Module Log("urde::CGuiWidget"); diff --git a/Runtime/GuiSys/CGuiWidget.hpp b/Runtime/GuiSys/CGuiWidget.hpp index 7f083ac24..a59585fa9 100644 --- a/Runtime/GuiSys/CGuiWidget.hpp +++ b/Runtime/GuiSys/CGuiWidget.hpp @@ -1,9 +1,18 @@ #pragma once -#include "IOStreams.hpp" -#include "CGuiObject.hpp" -#include "zeus/CColor.hpp" -#include "boo/IWindow.hpp" +#include +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/GuiSys/CGuiObject.hpp" + +#include + +#include +#include +#include namespace urde { class CGuiFrame; diff --git a/Runtime/GuiSys/CGuiWidgetDrawParms.cpp b/Runtime/GuiSys/CGuiWidgetDrawParms.cpp index 58df7407a..7c8af0db6 100644 --- a/Runtime/GuiSys/CGuiWidgetDrawParms.cpp +++ b/Runtime/GuiSys/CGuiWidgetDrawParms.cpp @@ -1,5 +1,5 @@ -#include "CGuiWidgetDrawParms.hpp" +#include "Runtime/GuiSys/CGuiWidgetDrawParms.hpp" namespace urde { -CGuiWidgetDrawParms CGuiWidgetDrawParms::Default = {}; +const CGuiWidgetDrawParms CGuiWidgetDrawParms::Default = {}; } diff --git a/Runtime/GuiSys/CGuiWidgetDrawParms.hpp b/Runtime/GuiSys/CGuiWidgetDrawParms.hpp index 4ee7b0be8..a5938c83c 100644 --- a/Runtime/GuiSys/CGuiWidgetDrawParms.hpp +++ b/Runtime/GuiSys/CGuiWidgetDrawParms.hpp @@ -1,6 +1,6 @@ #pragma once -#include "zeus/CVector3f.hpp" +#include namespace urde { @@ -11,7 +11,7 @@ struct CGuiWidgetDrawParms { CGuiWidgetDrawParms() = default; CGuiWidgetDrawParms(float alphaMod, const zeus::CVector3f& cameraOff) : x0_alphaMod(alphaMod), x4_cameraOffset(cameraOff) {} - static CGuiWidgetDrawParms Default; + static const CGuiWidgetDrawParms Default; }; } // namespace urde diff --git a/Runtime/GuiSys/CGuiWidgetIdDB.cpp b/Runtime/GuiSys/CGuiWidgetIdDB.cpp index c2dad7e80..162ee1351 100644 --- a/Runtime/GuiSys/CGuiWidgetIdDB.cpp +++ b/Runtime/GuiSys/CGuiWidgetIdDB.cpp @@ -1,4 +1,4 @@ -#include "CGuiWidgetIdDB.hpp" +#include "Runtime/GuiSys/CGuiWidgetIdDB.hpp" namespace urde { diff --git a/Runtime/GuiSys/CGuiWidgetIdDB.hpp b/Runtime/GuiSys/CGuiWidgetIdDB.hpp index f95052e8b..799f6efe1 100644 --- a/Runtime/GuiSys/CGuiWidgetIdDB.hpp +++ b/Runtime/GuiSys/CGuiWidgetIdDB.hpp @@ -1,7 +1,7 @@ #pragma once #include -#include "RetroTypes.hpp" +#include "Runtime/GCNTypes.hpp" namespace urde { diff --git a/Runtime/GuiSys/CHudBallInterface.hpp b/Runtime/GuiSys/CHudBallInterface.hpp index 99cd17fc4..818154df4 100644 --- a/Runtime/GuiSys/CHudBallInterface.hpp +++ b/Runtime/GuiSys/CHudBallInterface.hpp @@ -1,14 +1,14 @@ #pragma once -#include "rstl.hpp" -#include "zeus/CVector3f.hpp" +#include "Runtime/rstl.hpp" +#include namespace urde { -class CGuiFrame; -class CGuiWidget; class CGuiCamera; +class CGuiFrame; class CGuiModel; class CGuiTextPane; +class CGuiWidget; class CHudBallInterface { CGuiCamera* x0_camera; diff --git a/Runtime/GuiSys/CHudBossEnergyInterface.hpp b/Runtime/GuiSys/CHudBossEnergyInterface.hpp index 589926398..1736f2935 100644 --- a/Runtime/GuiSys/CHudBossEnergyInterface.hpp +++ b/Runtime/GuiSys/CHudBossEnergyInterface.hpp @@ -1,13 +1,13 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" +#include "Runtime/RetroTypes.hpp" +#include namespace urde { -class CGuiFrame; -class CGuiWidget; class CAuiEnergyBarT01; +class CGuiFrame; class CGuiTextPane; +class CGuiWidget; class CHudBossEnergyInterface { float x0_alpha; diff --git a/Runtime/GuiSys/CHudDecoInterface.cpp b/Runtime/GuiSys/CHudDecoInterface.cpp index 8ab302808..3df317bf4 100644 --- a/Runtime/GuiSys/CHudDecoInterface.cpp +++ b/Runtime/GuiSys/CHudDecoInterface.cpp @@ -7,7 +7,7 @@ #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" #include "MP1/CSamusHud.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CGuiWidgetDrawParms.hpp" namespace urde { diff --git a/Runtime/GuiSys/CHudDecoInterface.hpp b/Runtime/GuiSys/CHudDecoInterface.hpp index c91673416..ab4ab5c83 100644 --- a/Runtime/GuiSys/CHudDecoInterface.hpp +++ b/Runtime/GuiSys/CHudDecoInterface.hpp @@ -1,11 +1,12 @@ #pragma once -#include "zeus/CMatrix3f.hpp" -#include "zeus/CQuaternion.hpp" -#include "zeus/CVector3f.hpp" -#include "CToken.hpp" -#include "CScanDisplay.hpp" -#include "World/CPlayer.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/GuiSys/CScanDisplay.hpp" +#include "Runtime/World/CPlayer.hpp" + +#include +#include +#include namespace urde { class CGuiFrame; diff --git a/Runtime/GuiSys/CHudEnergyInterface.hpp b/Runtime/GuiSys/CHudEnergyInterface.hpp index bca5d08f3..2c2fda089 100644 --- a/Runtime/GuiSys/CHudEnergyInterface.hpp +++ b/Runtime/GuiSys/CHudEnergyInterface.hpp @@ -1,15 +1,15 @@ #pragma once -#include "RetroTypes.hpp" -#include "CHudInterface.hpp" -#include "zeus/CVector3f.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/GuiSys/CHudInterface.hpp" +#include namespace urde { -class CGuiFrame; -class CGuiWidget; -class CGuiTextPane; -class CAuiMeter; class CAuiEnergyBarT01; +class CAuiMeter; +class CGuiFrame; +class CGuiTextPane; +class CGuiWidget; class CHudEnergyInterface { EHudType x0_hudType; diff --git a/Runtime/GuiSys/CHudFreeLookInterface.hpp b/Runtime/GuiSys/CHudFreeLookInterface.hpp index a0564777f..fedc6931b 100644 --- a/Runtime/GuiSys/CHudFreeLookInterface.hpp +++ b/Runtime/GuiSys/CHudFreeLookInterface.hpp @@ -1,13 +1,13 @@ #pragma once -#include "RetroTypes.hpp" -#include "CHudInterface.hpp" -#include "zeus/CTransform.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/GuiSys/CHudInterface.hpp" +#include namespace urde { class CGuiFrame; -class CGuiWidget; class CGuiModel; +class CGuiWidget; class IFreeLookInterface { public: diff --git a/Runtime/GuiSys/CHudHelmetInterface.hpp b/Runtime/GuiSys/CHudHelmetInterface.hpp index a5892d2ea..fc987a420 100644 --- a/Runtime/GuiSys/CHudHelmetInterface.hpp +++ b/Runtime/GuiSys/CHudHelmetInterface.hpp @@ -1,12 +1,12 @@ #pragma once -#include "zeus/CMatrix3f.hpp" -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" +#include namespace urde { +class CGuiCamera; class CGuiFrame; class CGuiWidget; -class CGuiCamera; class CHudHelmetInterface { zeus::CMatrix3f x0_hudLagRotation; diff --git a/Runtime/GuiSys/CHudMissileInterface.hpp b/Runtime/GuiSys/CHudMissileInterface.hpp index 7f270eddc..df21193ec 100644 --- a/Runtime/GuiSys/CHudMissileInterface.hpp +++ b/Runtime/GuiSys/CHudMissileInterface.hpp @@ -1,16 +1,16 @@ #pragma once -#include "RetroTypes.hpp" -#include "CHudInterface.hpp" -#include "zeus/CTransform.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/GuiSys/CHudInterface.hpp" +#include namespace urde { -class CStateManager; -class CGuiFrame; -class CGuiWidget; -class CGuiTextPane; class CAuiEnergyBarT01; +class CGuiFrame; class CGuiModel; +class CGuiTextPane; +class CGuiWidget; +class CStateManager; class CHudMissileInterface { enum class EInventoryStatus { Normal, Warning, Depleted }; diff --git a/Runtime/GuiSys/CHudRadarInterface.cpp b/Runtime/GuiSys/CHudRadarInterface.cpp index 01a067d4e..f63e2db00 100644 --- a/Runtime/GuiSys/CHudRadarInterface.cpp +++ b/Runtime/GuiSys/CHudRadarInterface.cpp @@ -11,7 +11,7 @@ #include "Graphics/CBooRenderer.hpp" #include "World/CWallCrawlerSwarm.hpp" #include "GuiSys/CGuiWidgetDrawParms.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/GuiSys/CHudRadarInterface.hpp b/Runtime/GuiSys/CHudRadarInterface.hpp index 5c4800fc8..8a601701b 100644 --- a/Runtime/GuiSys/CHudRadarInterface.hpp +++ b/Runtime/GuiSys/CHudRadarInterface.hpp @@ -1,13 +1,18 @@ #pragma once -#include "CToken.hpp" -#include "Graphics/CTexture.hpp" -#include "Graphics/Shaders/CRadarPaintShader.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/Graphics/CTexture.hpp" +#include "Runtime/Graphics/Shaders/CRadarPaintShader.hpp" + +#include +#include namespace urde { +class CGuiCamera; class CGuiFrame; class CGuiWidget; -class CGuiCamera; class CStateManager; class CHudRadarInterface { diff --git a/Runtime/GuiSys/CHudThreatInterface.hpp b/Runtime/GuiSys/CHudThreatInterface.hpp index 098e88bc4..2a50de9fa 100644 --- a/Runtime/GuiSys/CHudThreatInterface.hpp +++ b/Runtime/GuiSys/CHudThreatInterface.hpp @@ -1,15 +1,15 @@ #pragma once -#include "CHudInterface.hpp" -#include "RetroTypes.hpp" -#include "zeus/CTransform.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/GuiSys/CHudInterface.hpp" +#include namespace urde { +class CAuiEnergyBarT01; class CGuiFrame; -class CGuiWidget; class CGuiModel; class CGuiTextPane; -class CAuiEnergyBarT01; +class CGuiWidget; class CHudThreatInterface { enum class EThreatStatus { Normal, Warning, Damage }; diff --git a/Runtime/GuiSys/CHudVisorBeamMenu.hpp b/Runtime/GuiSys/CHudVisorBeamMenu.hpp index 37e043130..3cf9b45a9 100644 --- a/Runtime/GuiSys/CHudVisorBeamMenu.hpp +++ b/Runtime/GuiSys/CHudVisorBeamMenu.hpp @@ -1,13 +1,15 @@ #pragma once -#include "RetroTypes.hpp" #include +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" + namespace urde { class CGuiFrame; -class CGuiWidget; -class CGuiTextPane; class CGuiModel; +class CGuiTextPane; +class CGuiWidget; class CHudVisorBeamMenu { public: diff --git a/Runtime/GuiSys/CInstruction.hpp b/Runtime/GuiSys/CInstruction.hpp index fe2caef0e..9f8ecb589 100644 --- a/Runtime/GuiSys/CInstruction.hpp +++ b/Runtime/GuiSys/CInstruction.hpp @@ -1,14 +1,15 @@ #pragma once -#include "CToken.hpp" -#include "CGuiTextSupport.hpp" -#include "CFontImageDef.hpp" #include +#include "Runtime/CToken.hpp" +#include "Runtime/GuiSys/CFontImageDef.hpp" +#include "Runtime/GuiSys/CGuiTextSupport.hpp" + namespace urde { +class CFontImageDef; class CFontRenderState; class CTextRenderBuffer; -class CFontImageDef; class CInstruction { public: diff --git a/Runtime/GuiSys/COrbitPointMarker.hpp b/Runtime/GuiSys/COrbitPointMarker.hpp index 2764ea817..b910babfe 100644 --- a/Runtime/GuiSys/COrbitPointMarker.hpp +++ b/Runtime/GuiSys/COrbitPointMarker.hpp @@ -1,8 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "Graphics/CModel.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/CModel.hpp" + +#include namespace urde { class CStateManager; diff --git a/Runtime/GuiSys/CRasterFont.hpp b/Runtime/GuiSys/CRasterFont.hpp index 18b44530a..6d7c44b58 100644 --- a/Runtime/GuiSys/CRasterFont.hpp +++ b/Runtime/GuiSys/CRasterFont.hpp @@ -1,15 +1,21 @@ #pragma once -#include "IOStreams.hpp" -#include "CToken.hpp" -#include "zeus/CVector2i.hpp" -#include "CGuiTextSupport.hpp" -#include "Graphics/CTexture.hpp" +#include +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/Graphics/CTexture.hpp" +#include "Runtime/GuiSys/CGuiTextSupport.hpp" + +#include namespace urde { -class IObjectStore; class CDrawStringOptions; class CTextRenderBuffer; +class IObjectStore; /* NOTE: Is this a good place for CGlyph and CKernPair? */ class CGlyph { diff --git a/Runtime/GuiSys/CSaveableState.hpp b/Runtime/GuiSys/CSaveableState.hpp index c3fe13cb7..6be5b09e1 100644 --- a/Runtime/GuiSys/CSaveableState.hpp +++ b/Runtime/GuiSys/CSaveableState.hpp @@ -1,23 +1,27 @@ #pragma once -#include "CGuiTextSupport.hpp" -#include "CDrawStringOptions.hpp" -#include "CToken.hpp" -#include "zeus/CColor.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/GuiSys/CDrawStringOptions.hpp" +#include "Runtime/GuiSys/CGuiTextSupport.hpp" + +#include namespace urde { class CRasterFont; class CSaveableState { - friend class CTextExecuteBuffer; friend class CColorOverrideInstruction; friend class CFontInstruction; + friend class CGuiTextSupport; friend class CLineExtraSpaceInstruction; - friend class CTextInstruction; friend class CLineSpacingInstruction; friend class CRemoveColorOverrideInstruction; + friend class CTextExecuteBuffer; + friend class CTextInstruction; friend class CWordInstruction; - friend class CGuiTextSupport; protected: CDrawStringOptions x0_drawStrOpts; diff --git a/Runtime/GuiSys/CScanDisplay.hpp b/Runtime/GuiSys/CScanDisplay.hpp index 9afb852bf..52b9512f4 100644 --- a/Runtime/GuiSys/CScanDisplay.hpp +++ b/Runtime/GuiSys/CScanDisplay.hpp @@ -1,21 +1,26 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CVector2f.hpp" -#include "zeus/CQuaternion.hpp" -#include "CScannableObjectInfo.hpp" -#include "Graphics/CTexture.hpp" -#include "Graphics/Shaders/CTexturedQuadFilter.hpp" +#include +#include + +#include "Runtime/CScannableObjectInfo.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Graphics/CTexture.hpp" +#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp" + +#include +#include +#include namespace urde { +class CAuiImagePane; +class CGuiFrame; +class CGuiModel; class CGuiTextPane; class CGuiWidget; -class CGuiModel; -struct CFinalInput; -class CGuiFrame; -class CAuiImagePane; class CStringTable; +struct CFinalInput; class CScanDisplay { friend class CHudDecoInterfaceScan; diff --git a/Runtime/GuiSys/CSplashScreen.hpp b/Runtime/GuiSys/CSplashScreen.hpp index 88ba3b32e..db4fd2e86 100644 --- a/Runtime/GuiSys/CSplashScreen.hpp +++ b/Runtime/GuiSys/CSplashScreen.hpp @@ -1,9 +1,9 @@ #pragma once -#include "CIOWin.hpp" -#include "CToken.hpp" -#include "Graphics/CTexture.hpp" -#include "Graphics/Shaders/CTexturedQuadFilter.hpp" +#include "Runtime/CIOWin.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/Graphics/CTexture.hpp" +#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp" namespace urde { diff --git a/Runtime/GuiSys/CStringTable.cpp b/Runtime/GuiSys/CStringTable.cpp index 9638934cc..28ee609bb 100644 --- a/Runtime/GuiSys/CStringTable.cpp +++ b/Runtime/GuiSys/CStringTable.cpp @@ -1,11 +1,17 @@ -#include "CStringTable.hpp" -#include "CToken.hpp" +#include "Runtime/GuiSys/CStringTable.hpp" + +#include + +#include "Runtime/CToken.hpp" namespace urde { -const std::vector CStringTable::skLanguages = {FOURCC('ENGL'), FOURCC('FREN'), FOURCC('GERM'), FOURCC('SPAN'), - FOURCC('ITAL'), FOURCC('DUTC'), FOURCC('JAPN')}; +namespace { +constexpr std::array languages{ + FOURCC('ENGL'), FOURCC('FREN'), FOURCC('GERM'), FOURCC('SPAN'), FOURCC('ITAL'), FOURCC('DUTC'), FOURCC('JAPN'), +}; +} // Anonymous namespace -FourCC CStringTable::mCurrentLanguage = CStringTable::skLanguages[0]; +FourCC CStringTable::mCurrentLanguage = languages[0]; CStringTable::CStringTable(CInputStream& in) { LoadStringTable(in); } @@ -64,7 +70,7 @@ const char16_t* CStringTable::GetString(s32 str) const { return reinterpret_cast(x4_data.get() + off); } -void CStringTable::SetLanguage(s32 lang) { mCurrentLanguage = skLanguages[lang]; } +void CStringTable::SetLanguage(s32 lang) { mCurrentLanguage = languages[lang]; } CFactoryFnReturn FStringTableFactory(const SObjectTag&, CInputStream& in, const CVParamTransfer&, CObjectReference* selfRef) { diff --git a/Runtime/GuiSys/CStringTable.hpp b/Runtime/GuiSys/CStringTable.hpp index 2915d986b..0e8461e5e 100644 --- a/Runtime/GuiSys/CStringTable.hpp +++ b/Runtime/GuiSys/CStringTable.hpp @@ -1,14 +1,15 @@ #pragma once -#include "RetroTypes.hpp" -#include "IFactory.hpp" +#include + +#include "Runtime/IFactory.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { class CStringTable { - static const std::vector skLanguages; static FourCC mCurrentLanguage; u32 x0_stringCount = 0; - std::unique_ptr x4_data = 0; + std::unique_ptr x4_data; u32 m_bufLen; public: diff --git a/Runtime/GuiSys/CTargetingManager.hpp b/Runtime/GuiSys/CTargetingManager.hpp index e688ccbc0..3f9a62ec0 100644 --- a/Runtime/GuiSys/CTargetingManager.hpp +++ b/Runtime/GuiSys/CTargetingManager.hpp @@ -1,7 +1,7 @@ #pragma once -#include "CCompoundTargetReticle.hpp" -#include "COrbitPointMarker.hpp" +#include "Runtime/GuiSys/CCompoundTargetReticle.hpp" +#include "Runtime/GuiSys/COrbitPointMarker.hpp" namespace urde { class CStateManager; diff --git a/Runtime/GuiSys/CTextExecuteBuffer.hpp b/Runtime/GuiSys/CTextExecuteBuffer.hpp index daa884925..e84d1043d 100644 --- a/Runtime/GuiSys/CTextExecuteBuffer.hpp +++ b/Runtime/GuiSys/CTextExecuteBuffer.hpp @@ -1,15 +1,20 @@ #pragma once -#include "CSaveableState.hpp" -#include "CGuiTextSupport.hpp" #include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/GuiSys/CGuiTextSupport.hpp" +#include "Runtime/GuiSys/CSaveableState.hpp" + +#include namespace urde { -class CInstruction; -class CFontImageDef; -class CTextRenderBuffer; class CBlockInstruction; +class CFontImageDef; +class CInstruction; class CLineInstruction; +class CTextRenderBuffer; class CTextExecuteBuffer { friend class CGuiTextSupport; diff --git a/Runtime/GuiSys/CTextParser.hpp b/Runtime/GuiSys/CTextParser.hpp index dc72f69e1..6cf4370cc 100644 --- a/Runtime/GuiSys/CTextParser.hpp +++ b/Runtime/GuiSys/CTextParser.hpp @@ -1,10 +1,14 @@ #pragma once -#include "CGuiTextSupport.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/GuiSys/CGuiTextSupport.hpp" namespace urde { -class CTextExecuteBuffer; class CFontImageDef; +class CTextExecuteBuffer; class CTextParser { IObjectStore& x0_store; diff --git a/Runtime/GuiSys/CTextRenderBuffer.hpp b/Runtime/GuiSys/CTextRenderBuffer.hpp index bdea85d77..b3ad6806b 100644 --- a/Runtime/GuiSys/CTextRenderBuffer.hpp +++ b/Runtime/GuiSys/CTextRenderBuffer.hpp @@ -1,20 +1,28 @@ #pragma once -#include "zeus/CColor.hpp" -#include "zeus/CVector2i.hpp" -#include "zeus/CVector2f.hpp" -#include "zeus/CMatrix4f.hpp" -#include "CToken.hpp" -#include "CFontImageDef.hpp" -#include "RetroTypes.hpp" -#include "CGuiWidget.hpp" -#include "Graphics/Shaders/CTextSupportShader.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/Shaders/CTextSupportShader.hpp" +#include "Runtime/GuiSys/CFontImageDef.hpp" +#include "Runtime/GuiSys/CGuiWidget.hpp" + +#include + +#include +#include + +#include +#include +#include +#include namespace urde { +class CGlyph; class CGraphicsPalette; class CRasterFont; -class CGlyph; class CTextExecuteBuffer; using CTextColor = zeus::CColor; diff --git a/Runtime/GuiSys/CWordBreakTables.cpp b/Runtime/GuiSys/CWordBreakTables.cpp index 16435515b..d1e377f57 100644 --- a/Runtime/GuiSys/CWordBreakTables.cpp +++ b/Runtime/GuiSys/CWordBreakTables.cpp @@ -1,4 +1,9 @@ -#include "CWordBreakTables.hpp" +#include "Runtime/GuiSys/CWordBreakTables.hpp" + +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/rstl.hpp" namespace urde { diff --git a/Runtime/GuiSys/CWordBreakTables.hpp b/Runtime/GuiSys/CWordBreakTables.hpp index 7c4e45f67..119b91cf7 100644 --- a/Runtime/GuiSys/CWordBreakTables.hpp +++ b/Runtime/GuiSys/CWordBreakTables.hpp @@ -1,7 +1,5 @@ #pragma once -#include "RetroTypes.hpp" - namespace urde { class CWordBreakTables { diff --git a/Runtime/IFactory.hpp b/Runtime/IFactory.hpp index e8190ae5f..b145b1b70 100644 --- a/Runtime/IFactory.hpp +++ b/Runtime/IFactory.hpp @@ -1,17 +1,19 @@ #pragma once -#include #include -#include "RetroTypes.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" namespace urde { -class CVParamTransfer; -class IObj; +class CFactoryMgr; class CObjectReference; class CResLoader; -class CFactoryMgr; class CSimplePool; +class CVParamTransfer; class IDvdRequest; +class IObj; using CFactoryFnReturn = std::unique_ptr; using FFactoryFunc = std::function +#include +#include +#include namespace hecl { -class CVarManager; class Console; +class CVarManager; } // namespace hecl namespace urde { diff --git a/Runtime/IOStreams.hpp b/Runtime/IOStreams.hpp index 1f2d7df3c..8837e61fe 100644 --- a/Runtime/IOStreams.hpp +++ b/Runtime/IOStreams.hpp @@ -1,10 +1,13 @@ #pragma once -#include "GCNTypes.hpp" -#include "athena/IStreamReader.hpp" -#include "athena/IStreamWriter.hpp" -#include "athena/MemoryReader.hpp" -#include "athena/MemoryWriter.hpp" +#include + +#include "Runtime/GCNTypes.hpp" + +#include +#include +#include +#include #ifdef URDE_ZIP_INPUT_STREAM #include #endif diff --git a/Runtime/IObj.hpp b/Runtime/IObj.hpp index 74898b636..2c45ed233 100644 --- a/Runtime/IObj.hpp +++ b/Runtime/IObj.hpp @@ -1,6 +1,7 @@ #pragma once -#include "RetroTypes.hpp" +#include +#include "Runtime/RetroTypes.hpp" namespace urde { diff --git a/Runtime/IObjFactory.hpp b/Runtime/IObjFactory.hpp index be272f1e9..c67f3a65b 100644 --- a/Runtime/IObjFactory.hpp +++ b/Runtime/IObjFactory.hpp @@ -1,8 +1,5 @@ #pragma once -#include -#include "RetroTypes.hpp" - namespace urde { class IObjFactory { diff --git a/Runtime/IObjectStore.hpp b/Runtime/IObjectStore.hpp index 2d57a98ed..db76a6893 100644 --- a/Runtime/IObjectStore.hpp +++ b/Runtime/IObjectStore.hpp @@ -3,10 +3,10 @@ #include namespace urde { -struct SObjectTag; +class CToken; class CVParamTransfer; class IFactory; -class CToken; +struct SObjectTag; class IObjectStore { public: diff --git a/Runtime/IVParamObj.hpp b/Runtime/IVParamObj.hpp index 424ec9a19..83d307883 100644 --- a/Runtime/IVParamObj.hpp +++ b/Runtime/IVParamObj.hpp @@ -1,7 +1,7 @@ #pragma once #include -#include "IObj.hpp" +#include "Runtime/IObj.hpp" namespace urde { @@ -16,26 +16,32 @@ class TObjOwnerParam : public IVParamObj { public: TObjOwnerParam(T&& obj) : m_param(std::move(obj)) {} - T& GetParam() { return m_param; } - const T& GetParam() const { return m_param; } + T& GetParam() noexcept { return m_param; } + const T& GetParam() const noexcept { return m_param; } }; class CVParamTransfer { std::shared_ptr m_ref; public: - CVParamTransfer() = default; + constexpr CVParamTransfer() noexcept = default; CVParamTransfer(IVParamObj* obj) : m_ref(obj) {} - CVParamTransfer(const CVParamTransfer& other) : m_ref(other.m_ref) {} - IVParamObj* GetObj() const { return m_ref.get(); } - CVParamTransfer ShareTransferRef() const { return CVParamTransfer(*this); } + + CVParamTransfer(const CVParamTransfer& other) noexcept = default; + CVParamTransfer& operator=(const CVParamTransfer&) noexcept = default; + + CVParamTransfer(CVParamTransfer&&) noexcept = default; + CVParamTransfer& operator=(CVParamTransfer&&) noexcept = default; + + IVParamObj* GetObj() const noexcept { return m_ref.get(); } + CVParamTransfer ShareTransferRef() const noexcept { return CVParamTransfer(*this); } template - T& GetOwnedObj() const { + T& GetOwnedObj() const noexcept { return static_cast*>(GetObj())->GetParam(); } - static CVParamTransfer Null() { return CVParamTransfer(); } + static CVParamTransfer Null() noexcept { return CVParamTransfer(); } }; } // namespace urde diff --git a/Runtime/Input/CFinalInput.hpp b/Runtime/Input/CFinalInput.hpp index b4f6a3645..7f64a8e02 100644 --- a/Runtime/Input/CFinalInput.hpp +++ b/Runtime/Input/CFinalInput.hpp @@ -1,7 +1,8 @@ #pragma once -#include "../RetroTypes.hpp" -#include "CKeyboardMouseController.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Input/CKeyboardMouseController.hpp" + #include namespace urde { diff --git a/Runtime/Input/CInputGenerator.hpp b/Runtime/Input/CInputGenerator.hpp index bca3fde7c..d2dd73e88 100644 --- a/Runtime/Input/CInputGenerator.hpp +++ b/Runtime/Input/CInputGenerator.hpp @@ -1,9 +1,12 @@ #pragma once #include +#include + +#include "Runtime/Input/CFinalInput.hpp" +#include "Runtime/Input/CKeyboardMouseController.hpp" + #include -#include "CFinalInput.hpp" -#include "CKeyboardMouseController.hpp" namespace urde { class CArchitectureQueue; diff --git a/Runtime/Input/CRumbleGenerator.hpp b/Runtime/Input/CRumbleGenerator.hpp index bd857334e..d280e0d6c 100644 --- a/Runtime/Input/CRumbleGenerator.hpp +++ b/Runtime/Input/CRumbleGenerator.hpp @@ -1,7 +1,8 @@ #pragma once -#include "CRumbleVoice.hpp" -#include "CInputGenerator.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Input/CInputGenerator.hpp" +#include "Runtime/Input/CRumbleVoice.hpp" namespace urde { class CRumbleGenerator { diff --git a/Runtime/Input/CRumbleManager.cpp b/Runtime/Input/CRumbleManager.cpp index 601dc688e..d79c99c3f 100644 --- a/Runtime/Input/CRumbleManager.cpp +++ b/Runtime/Input/CRumbleManager.cpp @@ -19,7 +19,7 @@ s16 CRumbleManager::Rumble(CStateManager& mgr, const zeus::CVector3f& pos, ERumb s16 CRumbleManager::Rumble(CStateManager& mgr, ERumbleFxId fx, float gain, ERumblePriority priority) { if (g_GameState->GameOptions().GetIsRumbleEnabled()) - return x0_rumbleGenerator.Rumble(RumbleFxTable[int(fx)], gain, priority, EIOPort::Zero); + return x0_rumbleGenerator.Rumble(RumbleFxTable[size_t(fx)], gain, priority, EIOPort::Zero); return -1; } diff --git a/Runtime/Input/CRumbleManager.hpp b/Runtime/Input/CRumbleManager.hpp index b25e42caa..c820dacec 100644 --- a/Runtime/Input/CRumbleManager.hpp +++ b/Runtime/Input/CRumbleManager.hpp @@ -1,7 +1,9 @@ #pragma once -#include "CRumbleGenerator.hpp" -#include "zeus/CVector3f.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Input/CRumbleGenerator.hpp" + +#include namespace urde { class CStateManager; diff --git a/Runtime/Input/CRumbleVoice.hpp b/Runtime/Input/CRumbleVoice.hpp index 5b3042756..719aab552 100644 --- a/Runtime/Input/CRumbleVoice.hpp +++ b/Runtime/Input/CRumbleVoice.hpp @@ -1,6 +1,9 @@ #pragma once -#include "RetroTypes.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" namespace urde { enum class ERumbleFxId { @@ -34,12 +37,12 @@ struct SAdsrData { bool x18_24_hasSustain : 1; bool x18_25_autoRelease : 1; }; - u8 dummy = 0; + u32 dummy = 0; }; - SAdsrData() = default; - SAdsrData(float attackGain, float autoReleaseDur, float attackDur, float decayDur, float sustainGain, - float releaseDur, bool hasSustain, bool autoRelease) + constexpr SAdsrData() noexcept { x18_24_hasSustain = false; x18_25_autoRelease = false; }; + constexpr SAdsrData(float attackGain, float autoReleaseDur, float attackDur, float decayDur, float sustainGain, + float releaseDur, bool hasSustain, bool autoRelease) noexcept : x0_attackGain(attackGain) , x4_autoReleaseDur(autoReleaseDur) , x8_attackDur(attackDur) @@ -59,17 +62,17 @@ struct SAdsrDelta { float x8_decayTime = 0.f; float xc_releaseTime = 0.f; float x10_autoReleaseTime = 0.f; - float x14_attackIntensity; - float x18_sustainIntensity; + float x14_attackIntensity = 0.f; + float x18_sustainIntensity = 0.f; ERumblePriority x1c_priority; EPhase x20_phase; - SAdsrDelta(EPhase phase, ERumblePriority priority) + constexpr SAdsrDelta(EPhase phase, ERumblePriority priority) noexcept : x0_curIntensity(phase == EPhase::PrePulse ? 2.f : 0.f), x1c_priority(priority), x20_phase(phase) {} - SAdsrDelta(EPhase phase) : x1c_priority(ERumblePriority::None), x20_phase(phase) {} + constexpr SAdsrDelta(EPhase phase) noexcept : x1c_priority(ERumblePriority::None), x20_phase(phase) {} - static SAdsrDelta Stopped() { return SAdsrDelta(EPhase::Stop); } - static SAdsrDelta Start(ERumblePriority priority, bool prePulse) { + static constexpr SAdsrDelta Stopped() noexcept { return SAdsrDelta(EPhase::Stop); } + static constexpr SAdsrDelta Start(ERumblePriority priority, bool prePulse) noexcept { return SAdsrDelta(prePulse ? EPhase::PrePulse : EPhase::Attack, priority); } }; diff --git a/Runtime/Input/ControlMapper.cpp b/Runtime/Input/ControlMapper.cpp index 53526cb1f..8810fb594 100644 --- a/Runtime/Input/ControlMapper.cpp +++ b/Runtime/Input/ControlMapper.cpp @@ -7,18 +7,29 @@ namespace urde { static const char* skCommandDescs[] = { - "Forward", "Backward", "Turn Left", "Turn Right", "Strafe Left", "Strafe Right", - "Look Left", "Look Right", "Look Up", "Look Down", "Jump/Boost", "Fire/Bomb", - "Missile/PowerBomb", "Morph", "Aim Up", "Aim Down", "Cycle Beam Up", "Cycle Beam Down", - "Cycle Item", "Power Beam", "Ice Beam", "Wave Beam", "Plasma Beam", "Toggle Holster", - "Orbit Close", "Orbit Far", "Orbit Object", "Orbit Select", "Orbit Confirm", "Orbit Left", - "Orbit Right", "Orbit Up", "Orbit Down", "Look Hold1", "Look Hold2", "Look Zoom In", - "Look Zoom Out", "Aim Hold", "Map Circle Up", "Map Circle Down", "Map Circle Left", "Map Circle Right", - "Map Move Forward", "Map Move Back", "Map Move Left", "Map Move Right", "Map Zoom In", "Map Zoom Out", - "SpiderBall", "Chase Camera", "XRay Visor", "Thermo Visor", "Enviro Visor", "No Visor", - "Visor Menu", "Visor Up", "Visor Down", "UNKNOWN", "UNKNOWN", "Use Shield", - "Scan Item", "UNKNOWN" - + "Forward", "Backward", "Turn Left", + "Turn Right", "Strafe Left", "Strafe Right", + "Look Left", "Look Right", "Look Up", + "Look Down", "Jump/Boost", "Fire/Bomb", + "Missile/PowerBomb", "Morph", "Aim Up", + "Aim Down", "Cycle Beam Up", "Cycle Beam Down", + "Cycle Item", "Power Beam", "Ice Beam", + "Wave Beam", "Plasma Beam", "Toggle Holster", + "Orbit Close", "Orbit Far", "Orbit Object", + "Orbit Select", "Orbit Confirm", "Orbit Left", + "Orbit Right", "Orbit Up", "Orbit Down", + "Look Hold1", "Look Hold2", "Look Zoom In", + "Look Zoom Out", "Aim Hold", "Map Circle Up", + "Map Circle Down", "Map Circle Left", "Map Circle Right", + "Map Move Forward", "Map Move Back", "Map Move Left", + "Map Move Right", "Map Zoom In", "Map Zoom Out", + "SpiderBall", "Chase Camera", "XRay Visor", + "Thermo Visor", "Enviro Visor", "No Visor", + "Visor Menu", "Visor Up", "Visor Down", + "UNKNOWN", "UNKNOWN", "Use Shield", + "Scan Item", "UNKNOWN", "UNKNOWN", + "UNKNOWN", "UNKNOWN", "Previous Pause Screen", + "Next Pause Screen", "UNKNOWN", "None", }; static const char* skFunctionDescs[] = {"None", @@ -359,14 +370,16 @@ float ControlMapper::GetAnalogInput(ECommands cmd, const CFinalInput& input) { } const char* ControlMapper::GetDescriptionForCommand(ECommands cmd) { - if (cmd > ECommands::MAX) + if (cmd >= ECommands::MAX) { return nullptr; + } return skCommandDescs[int(cmd)]; } const char* ControlMapper::GetDescriptionForFunction(EFunctionList func) { - if (func > EFunctionList::MAX) + if (func >= EFunctionList::MAX) { return nullptr; + } return skFunctionDescs[int(func)]; } diff --git a/Runtime/Input/ControlMapper.hpp b/Runtime/Input/ControlMapper.hpp index 6015113ff..81a139bd8 100644 --- a/Runtime/Input/ControlMapper.hpp +++ b/Runtime/Input/ControlMapper.hpp @@ -1,6 +1,8 @@ #pragma once -#include "boo/IWindow.hpp" +#include + +#include namespace urde { struct CFinalInput; diff --git a/Runtime/Input/IController.hpp b/Runtime/Input/IController.hpp index 9bba88e7d..efae5ecd0 100644 --- a/Runtime/Input/IController.hpp +++ b/Runtime/Input/IController.hpp @@ -1,7 +1,5 @@ #pragma once -#include "../RetroTypes.hpp" - namespace urde { class IController { diff --git a/Runtime/Input/RumbleFxTable.cpp b/Runtime/Input/RumbleFxTable.cpp index a887e0497..c7c67f28c 100644 --- a/Runtime/Input/RumbleFxTable.cpp +++ b/Runtime/Input/RumbleFxTable.cpp @@ -1,8 +1,8 @@ -#include "RumbleFxTable.hpp" +#include "Runtime/Input/RumbleFxTable.hpp" namespace urde { -const SAdsrData RumbleFxTable[] = { +const RumbleFXTable RumbleFxTable{{ /* attackGain, autoReleaseDur, attackDur, decayDur, sustainGain, releaseDur, hasSustain, autoRelease */ {0.48f, 0.f, 0.3f, 0.125f, 0.1f, 0.5f, false, false}, {0.66f, 0.f, 0.11f, 0.175f, 0.42f, 0.375f, false, false}, @@ -27,6 +27,7 @@ const SAdsrData RumbleFxTable[] = { {1.2f, 0.f, 0.01f, 0.621f, 0.f, 0.f, false, false}, {0.5268f, 0.f, 0.114f, 1.008f, 0.f, 0.325f, false, false}, {0.6828f, 0.f, 0.f, 0.821f, 0.f, 0.f, false, false}, - {1.8f, 0.f, 0.5f, 0.425f, 0.35f, 0.5f, false, false}}; + {1.8f, 0.f, 0.5f, 0.425f, 0.35f, 0.5f, false, false}, +}}; } diff --git a/Runtime/Input/RumbleFxTable.hpp b/Runtime/Input/RumbleFxTable.hpp index 3c63da69c..9d649537c 100644 --- a/Runtime/Input/RumbleFxTable.hpp +++ b/Runtime/Input/RumbleFxTable.hpp @@ -1,9 +1,12 @@ #pragma once -#include "CRumbleVoice.hpp" +#include +#include "Runtime/Input/CRumbleVoice.hpp" namespace urde { -extern const SAdsrData RumbleFxTable[]; +using RumbleFXTable = std::array; + +extern const RumbleFXTable RumbleFxTable; } diff --git a/Runtime/MP1/CArtifactDoll.hpp b/Runtime/MP1/CArtifactDoll.hpp index 96e5eff25..c37252fdd 100644 --- a/Runtime/MP1/CArtifactDoll.hpp +++ b/Runtime/MP1/CArtifactDoll.hpp @@ -1,9 +1,12 @@ #pragma once -#include "RetroTypes.hpp" -#include "Character/CActorLights.hpp" -#include "CToken.hpp" -#include "CPlayerState.hpp" +#include +#include + +#include "Runtime/CPlayerState.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CActorLights.hpp" namespace urde { class CModel; diff --git a/Runtime/MP1/CAudioStateWin.hpp b/Runtime/MP1/CAudioStateWin.hpp index 9efd53739..fb6dd7064 100644 --- a/Runtime/MP1/CAudioStateWin.hpp +++ b/Runtime/MP1/CAudioStateWin.hpp @@ -1,6 +1,6 @@ #pragma once -#include "../CIOWin.hpp" +#include "Runtime/CIOWin.hpp" namespace urde::MP1 { class CAudioStateWin : public CIOWin { diff --git a/Runtime/MP1/CCredits.hpp b/Runtime/MP1/CCredits.hpp index 0c3be524a..624b00ee7 100644 --- a/Runtime/MP1/CCredits.hpp +++ b/Runtime/MP1/CCredits.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CIOWin.hpp" +#include "Runtime/CIOWin.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/CFaceplateDecoration.hpp b/Runtime/MP1/CFaceplateDecoration.hpp index 8ce1352c9..76518afd1 100644 --- a/Runtime/MP1/CFaceplateDecoration.hpp +++ b/Runtime/MP1/CFaceplateDecoration.hpp @@ -1,7 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "Graphics/Shaders/CTexturedQuadFilter.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp" namespace urde { class CStateManager; diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index 057db8b1b..36b31552b 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -1,52 +1,61 @@ -#include "CFrontEndUI.hpp" -#include "CArchitectureMessage.hpp" -#include "CArchitectureQueue.hpp" -#include "CDvdFile.hpp" -#include "CSimplePool.hpp" -#include "GameGlobalObjects.hpp" -#include "MP1.hpp" -#include "CSlideShow.hpp" -#include "Audio/CSfxManager.hpp" -#include "Graphics/CMoviePlayer.hpp" -#include "CSaveGameScreen.hpp" -#include "GuiSys/CGuiTextPane.hpp" -#include "GuiSys/CGuiFrame.hpp" -#include "GuiSys/CStringTable.hpp" -#include "GuiSys/CGuiTableGroup.hpp" -#include "GuiSys/CGuiSliderGroup.hpp" -#include "GuiSys/CGuiModel.hpp" -#include "CGameState.hpp" -#include "CDependencyGroup.hpp" -#include "Audio/CAudioGroupSet.hpp" -#include "GuiSys/CGuiWidgetDrawParms.hpp" -#include "CNESEmulator.hpp" -#include "CQuitGameScreen.hpp" -#include "Input/RumbleFxTable.hpp" +#include "Runtime/MP1/CFrontEndUI.hpp" + +#include +#include #include -namespace urde::MP1 { +#include "NESEmulator/CNESEmulator.hpp" +#include "Runtime/CArchitectureMessage.hpp" +#include "Runtime/CArchitectureQueue.hpp" +#include "Runtime/CDependencyGroup.hpp" +#include "Runtime/CDvdFile.hpp" +#include "Runtime/CGameState.hpp" +#include "Runtime/CSimplePool.hpp" +#include "Runtime/GameGlobalObjects.hpp" +#include "Runtime/Audio/CAudioGroupSet.hpp" +#include "Runtime/Audio/CSfxManager.hpp" +#include "Runtime/Graphics/CMoviePlayer.hpp" +#include "Runtime/GuiSys/CGuiFrame.hpp" +#include "Runtime/GuiSys/CGuiModel.hpp" +#include "Runtime/GuiSys/CGuiSliderGroup.hpp" +#include "Runtime/GuiSys/CGuiTableGroup.hpp" +#include "Runtime/GuiSys/CGuiTextPane.hpp" +#include "Runtime/GuiSys/CGuiWidgetDrawParms.hpp" +#include "Runtime/GuiSys/CStringTable.hpp" +#include "Runtime/Input/RumbleFxTable.hpp" +#include "Runtime/MP1/CQuitGameScreen.hpp" +#include "Runtime/MP1/CSaveGameScreen.hpp" +#include "Runtime/MP1/CSlideShow.hpp" +#include "Runtime/MP1/MP1.hpp" + +namespace urde::MP1 { +namespace { #define FE_USE_SECONDS_IN_ELAPSED 1 /* Music volume constants */ -static const float FE1_VOL = 0.7421875f; -static const float FE2_VOL = 0.7421875f; +constexpr float FE1_VOL = 0.7421875f; +constexpr float FE2_VOL = 0.7421875f; /* L/R Stereo transition cues */ -static const u16 FETransitionBackSFX[3][2] = {{SFXfnt_transfore_00L, SFXfnt_transfore_00R}, - {SFXfnt_transfore_01L, SFXfnt_transfore_01R}, - {SFXfnt_transfore_02L, SFXfnt_transfore_02R}}; +constexpr std::array, 3> FETransitionBackSFX{{ + {SFXfnt_transfore_00L, SFXfnt_transfore_00R}, + {SFXfnt_transfore_01L, SFXfnt_transfore_01R}, + {SFXfnt_transfore_02L, SFXfnt_transfore_02R}, +}}; -static const u16 FETransitionForwardSFX[3][2] = {{SFXfnt_transback_00L, SFXfnt_transback_00R}, - {SFXfnt_transback_01L, SFXfnt_transback_01R}, - {SFXfnt_transback_02L, SFXfnt_transback_02R}}; +constexpr std::array, 3> FETransitionForwardSFX{{ + {SFXfnt_transback_00L, SFXfnt_transback_00R}, + {SFXfnt_transback_01L, SFXfnt_transback_01R}, + {SFXfnt_transback_02L, SFXfnt_transback_02R}, +}}; struct FEMovie { const char* path; bool loop; }; -static const FEMovie FEMovies[] = { +constexpr std::array FEMovies{{ {"Video/00_first_start.thp", false}, {"Video/01_startloop.thp", true}, {"Video/02_start_fileselect_A.thp", false}, @@ -56,9 +65,48 @@ static const FEMovie FEMovies[] = { {"Video/07_GBAloop.thp", true}, {"Video/08_GBA_fileselect.thp", false}, {"Video/08_GBA_fileselect.thp", false}, +}}; + +constexpr SObjectTag g_DefaultWorldTag = {FOURCC('MLVL'), 0x158efe17}; + +constexpr std::array AudioFadeTimeA{ + 0.44f, + 5.41f, + 3.41f, }; -SObjectTag g_DefaultWorldTag = {FOURCC('MLVL'), 0x158efe17}; +constexpr std::array AudioFadeTimeB{ + 4.2f, + 6.1f, + 6.1f, +}; + +constexpr std::array NextLinkUI{ + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::ConnectSocket, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::PressStartAndSelect, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::BeginLink, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Linking, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::TurnOffGBA, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Complete, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::InsertPak, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty, +}; + +constexpr std::array PrevLinkUI{ + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Cancelled, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Cancelled, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Cancelled, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Cancelled, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Cancelled, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Cancelled, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty, + CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty, +}; +} // Anonymous namespace void CFrontEndUI::PlayAdvanceSfx() { CSfxManager::SfxStart(SFXfnt_advance_L, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId); @@ -107,8 +155,9 @@ void CFrontEndUI::SNewFileSelectFrame::FinishedLoading() { [this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); }); x40_tablegroup_popup->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoPopupCancel(caller); }); - for (int i = 0; i < 3; ++i) - x64_fileSelections[i] = FindFileSelectOption(x1c_loadedFrame, i); + for (size_t i = 0; i < x64_fileSelections.size(); ++i) { + x64_fileSelections[i] = FindFileSelectOption(x1c_loadedFrame, int(i)); + } x104_rowPitch = (x64_fileSelections[1].x0_base->GetLocalPosition() - x64_fileSelections[0].x0_base->GetLocalPosition()).z(); @@ -250,15 +299,15 @@ void CFrontEndUI::SNewFileSelectFrame::HandleActiveChange(CGuiTableGroup* active zeus::CVector3f{0.f, 0.f, active->GetUserSelection() * x104_rowPitch} + xf8_model_erase_position)); /* Set Touch Bar contents here */ - CFrontEndUITouchBar::SFileSelectDetail tbDetails[3] = {}; - for (int i = 0; i < 3; ++i) { - if (const CGameState::GameFileStateInfo* data = x4_saveUI->GetGameData(i)) { + std::array tbDetails{}; + for (size_t i = 0; i < tbDetails.size(); ++i) { + if (const CGameState::GameFileStateInfo* data = x4_saveUI->GetGameData(int(i))) { tbDetails[i].state = data->x20_hardMode ? CFrontEndUITouchBar::EFileState::Hard : CFrontEndUITouchBar::EFileState::Normal; tbDetails[i].percent = data->x18_itemPercent; } } - m_touchBar.SetFileSelectPhase(tbDetails, x8_subMenu == ESubMenu::EraseGame, CSlideShow::SlideShowGalleryFlags()); + m_touchBar.SetFileSelectPhase(tbDetails.data(), x8_subMenu == ESubMenu::EraseGame, CSlideShow::SlideShowGalleryFlags()); } else if (active == x40_tablegroup_popup) { if (x8_subMenu == ESubMenu::EraseGamePopup) m_touchBar.SetPhase(CFrontEndUITouchBar::EPhase::EraseBack); @@ -394,14 +443,17 @@ void CFrontEndUI::SNewFileSelectFrame::ActivateErase() { void CFrontEndUI::SNewFileSelectFrame::ClearFrameContents() { x108_curTime = 0.f; bool hasSave = false; - for (int i = 0; i < 3; ++i) { - if (x4_saveUI->GetGameData(i)) + for (size_t i = 0; i < x64_fileSelections.size(); ++i) { + if (x4_saveUI->GetGameData(int(i))) { hasSave = true; + } + SFileMenuOption& option = x64_fileSelections[i]; option.x2c_chRate = SFileMenuOption::ComputeRandom(); option.x28_curField = -1; - for (int j = 0; j < 4; ++j) - option.x4_textpanes[j].SetPairText(u""); + for (auto& panePair : option.x4_textpanes) { + panePair.SetPairText(u""); + } } StartTextAnimating(x28_textpane_erase.x0_panes[0], g_MainStringTable->GetString(38), 60.f); @@ -438,23 +490,25 @@ void CFrontEndUI::SNewFileSelectFrame::ClearFrameContents() { } void CFrontEndUI::SNewFileSelectFrame::SetupFrameContents() { - for (int i = 0; i < 3; ++i) { + for (size_t i = 0; i < x64_fileSelections.size(); ++i) { SFileMenuOption& option = x64_fileSelections[i]; - if (option.x28_curField == 4) + if (option.x28_curField == 4) { continue; + } + SGuiTextPair* pair = (option.x28_curField == UINT32_MAX) ? nullptr : &option.x4_textpanes[option.x28_curField]; if (!pair || pair->x0_panes[0]->GetTextSupport().GetNumCharsPrinted() >= pair->x0_panes[0]->GetTextSupport().GetNumCharsTotal()) { if (++option.x28_curField < 4) { std::u16string str; SGuiTextPair& populatePair = option.x4_textpanes[option.x28_curField]; - const CGameState::GameFileStateInfo* data = x4_saveUI->GetGameData(i); + const CGameState::GameFileStateInfo* data = x4_saveUI->GetGameData(int(i)); switch (option.x28_curField) { case 0: // Completion percent if (data) { - std::u16string fileStr = g_MainStringTable->GetString((data->x20_hardMode ? 106 : 39) + i); + std::u16string fileStr = g_MainStringTable->GetString((data->x20_hardMode ? 106 : 39) + int(i)); str = fileStr + fmt::format(fmt(u" {:02d}%"), data->x18_itemPercent); break; } @@ -721,30 +775,6 @@ void CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::SetUIText(EUIType tp) { x0_uiType = tp; } -static const CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType NextLinkUI[] = { - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::ConnectSocket, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::PressStartAndSelect, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::BeginLink, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Linking, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::TurnOffGBA, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Complete, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::InsertPak, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty}; - -static const CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType PrevLinkUI[] = { - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Cancelled, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Cancelled, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Cancelled, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Cancelled, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Cancelled, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Cancelled, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty, - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EUIType::Empty}; - CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EAction CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::ProcessUserInput( const CFinalInput& input, bool linkInProgress, CFrontEndUITouchBar::EAction tbAction) { if (linkInProgress != x40_linkInProgress) { @@ -765,12 +795,13 @@ CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EAction CFrontEndUI::SFusionBonus input.PMouseButton(boo::EMouseButton::Primary) || tbAction == CFrontEndUITouchBar::EAction::Confirm) { PlayAdvanceSfx(); - SetUIText(NextLinkUI[int(x0_uiType)]); + SetUIText(NextLinkUI[size_t(x0_uiType)]); } else if (input.PB() || input.PSpecialKey(boo::ESpecialKey::Esc) || tbAction == CFrontEndUITouchBar::EAction::Back) { - EUIType prevUi = PrevLinkUI[int(x0_uiType)]; - if (prevUi == EUIType::Empty) + const EUIType prevUi = PrevLinkUI[size_t(x0_uiType)]; + if (prevUi == EUIType::Empty) { break; + } CSfxManager::SfxStart(SFXfnt_back, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId); SetUIText(prevUi); } @@ -1429,7 +1460,7 @@ void CFrontEndUI::SOptionsFrontEndFrame::DoMenuSelectionChange(CGuiTableGroup* c if (option.option == EGameOption::Rumble && caller->GetUserSelection() > 0) { x40_rumbleGen.HardStopAll(); - x40_rumbleGen.Rumble(RumbleFxTable[int(ERumbleFxId::PlayerBump)], 1.f, ERumblePriority::One, EIOPort::Zero); + x40_rumbleGen.Rumble(RumbleFxTable[size_t(ERumbleFxId::PlayerBump)], 1.f, ERumblePriority::One, EIOPort::Zero); } } } @@ -1746,8 +1777,10 @@ std::string CFrontEndUI::GetNextAttractMovieFileName() { } void CFrontEndUI::SetCurrentMovie(EMenuMovie movie) { - if (xb8_curMovie == movie) + if (xb8_curMovie == movie) { return; + } + StopAttractMovie(); if (xb8_curMovie != EMenuMovie::Stopped) { @@ -1758,10 +1791,11 @@ void CFrontEndUI::SetCurrentMovie(EMenuMovie movie) { xb8_curMovie = movie; if (xb8_curMovie != EMenuMovie::Stopped) { - xcc_curMoviePtr = x70_menuMovies[int(xb8_curMovie)].get(); + xcc_curMoviePtr = x70_menuMovies[size_t(xb8_curMovie)].get(); xcc_curMoviePtr->SetPlayMode(CMoviePlayer::EPlayMode::Playing); - } else + } else { xcc_curMoviePtr = nullptr; + } } void CFrontEndUI::StopAttractMovie() { @@ -2004,26 +2038,34 @@ bool CFrontEndUI::PumpLoad() { bool CFrontEndUI::PumpMovieLoad() { /* Prepare all FrontEnd movies and pause each */ - if (xd1_moviesLoaded) + if (xd1_moviesLoaded) { return true; - for (int i = 0; i < 9; ++i) { - if (!x70_menuMovies[i]) { - const FEMovie& movie = FEMovies[i]; - std::string path = movie.path; - if (i == int(EMenuMovie::StartFileSelectA)) { - auto pos = path.find("A.thp"); - if (pos != std::string::npos) - path[pos] = 'A' + x18_rndA; - } else if (i == int(EMenuMovie::FileSelectPlayGameA)) { - auto pos = path.find("A.thp"); - if (pos != std::string::npos) - path[pos] = 'A' + x1c_rndB; - } - x70_menuMovies[i] = std::make_unique(path.c_str(), 0.05f, movie.loop, false); - x70_menuMovies[i]->SetPlayMode(CMoviePlayer::EPlayMode::Stopped); - return false; - } } + + for (size_t i = 0; i < x70_menuMovies.size(); ++i) { + if (x70_menuMovies[i] != nullptr) { + continue; + } + + const FEMovie& movie = FEMovies[i]; + std::string path = movie.path; + if (i == size_t(EMenuMovie::StartFileSelectA)) { + const auto pos = path.find("A.thp"); + if (pos != std::string::npos) { + path[pos] = 'A' + x18_rndA; + } + } else if (i == size_t(EMenuMovie::FileSelectPlayGameA)) { + const auto pos = path.find("A.thp"); + if (pos != std::string::npos) { + path[pos] = 'A' + x1c_rndB; + } + } + + x70_menuMovies[i] = std::make_unique(path.c_str(), 0.05f, movie.loop, false); + x70_menuMovies[i]->SetPlayMode(CMoviePlayer::EPlayMode::Stopped); + return false; + } + xd1_moviesLoaded = true; return true; } @@ -2161,10 +2203,11 @@ void CFrontEndUI::ProcessUserInput(const CFinalInput& input, CArchitectureQueue& } void CFrontEndUI::TransitionToGame() { - if (x14_phase >= EPhase::ToPlayGame) + if (x14_phase >= EPhase::ToPlayGame) { return; + } - const u16* sfx = FETransitionForwardSFX[x1c_rndB]; + const auto sfx = FETransitionForwardSFX[x1c_rndB]; CSfxManager::SfxStart(sfx[0], 1.f, 0.f, false, 0x7f, false, kInvalidAreaId); CSfxManager::SfxStart(sfx[1], 1.f, 0.f, false, 0x7f, false, kInvalidAreaId); @@ -2181,10 +2224,6 @@ void CFrontEndUI::UpdateMusicVolume() { } } -static const float AudioFadeTimeA[] = {0.44f, 5.41f, 3.41f}; - -static const float AudioFadeTimeB[] = {4.2f, 6.1f, 6.1f}; - CIOWin::EMessageReturn CFrontEndUI::Update(float dt, CArchitectureQueue& queue) { if (xdc_saveUI && x50_curScreen >= EScreen::FileSelect) { switch (xdc_saveUI->Update(dt)) { @@ -2248,14 +2287,12 @@ CIOWin::EMessageReturn CFrontEndUI::Update(float dt, CArchitectureQueue& queue) if (PumpMovieLoad()) { /* Prime first frame of movies */ UpdateMovies(dt); - for (int i = 0; i < 9; ++i) { - if (!x70_menuMovies[i]->GetIsFullyCached()) { - moviesReady = false; - break; - } - } - } else + + moviesReady = std::all_of(x70_menuMovies.cbegin(), x70_menuMovies.cend(), + [](const auto& movie) { return movie->GetIsFullyCached(); }); + } else { moviesReady = false; + } if (moviesReady) { /* Ready to display FrontEnd */ diff --git a/Runtime/MP1/CFrontEndUI.hpp b/Runtime/MP1/CFrontEndUI.hpp index a63e2b76c..e06e19c21 100644 --- a/Runtime/MP1/CFrontEndUI.hpp +++ b/Runtime/MP1/CFrontEndUI.hpp @@ -1,35 +1,40 @@ #pragma once -#include "CIOWin.hpp" -#include "CGameDebug.hpp" -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "Audio/CStaticAudioPlayer.hpp" -#include "Audio/CSfxManager.hpp" -#include "CGBASupport.hpp" -#include "zeus/CVector3f.hpp" -#include "Input/CRumbleGenerator.hpp" -#include "GuiSys/CGuiTextSupport.hpp" -#include "Graphics/Shaders/CTexturedQuadFilter.hpp" -#include "Graphics/Shaders/CColoredQuadFilter.hpp" -#include "CFrontEndUITouchBar.hpp" -#include "CGameOptionsTouchBar.hpp" +#include +#include +#include + +#include "Runtime/CGameDebug.hpp" +#include "Runtime/CGameOptionsTouchBar.hpp" +#include "Runtime/CIOWin.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Audio/CSfxManager.hpp" +#include "Runtime/Audio/CStaticAudioPlayer.hpp" +#include "Runtime/Graphics/Shaders/CColoredQuadFilter.hpp" +#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp" +#include "Runtime/GuiSys/CGuiTextSupport.hpp" +#include "Runtime/Input/CRumbleGenerator.hpp" +#include "Runtime/MP1/CFrontEndUITouchBar.hpp" +#include "Runtime/MP1/CGBASupport.hpp" + +#include namespace urde { +class CAudioGroupSet; +class CDependencyGroup; +class CGuiFrame; +class CGuiModel; class CGuiSliderGroup; class CGuiTableGroup; -class CMoviePlayer; -struct SObjectTag; -class CDependencyGroup; -class CTexture; -class CAudioGroupSet; -class CSaveWorld; -class CStringTable; -class CGuiFrame; +class CGuiTableGroup; class CGuiTextPane; class CGuiWidget; -class CGuiTableGroup; -class CGuiModel; +class CMoviePlayer; +class CSaveWorld; +class CStringTable; +class CTexture; +struct SObjectTag; namespace MP1 { class CNESEmulator; @@ -56,7 +61,7 @@ public: static void PlayAdvanceSfx(); struct SGuiTextPair { - CGuiTextPane* x0_panes[2] = {}; + std::array x0_panes{}; void SetPairText(std::u16string_view str); }; static SGuiTextPair FindTextPanePair(CGuiFrame* frame, const char* name); @@ -66,7 +71,7 @@ public: CGuiWidget* x0_base; /* filename, world, playtime, date */ - SGuiTextPair x4_textpanes[4]; + std::array x4_textpanes; u32 x28_curField = 0; float x2c_chRate = ComputeRandom(); @@ -96,7 +101,7 @@ public: SGuiTextPair x50_textpane_popupcancel; SGuiTextPair x58_textpane_popupextra; CGuiTextPane* x60_textpane_cancel = nullptr; - SFileMenuOption x64_fileSelections[3]; + std::array x64_fileSelections; zeus::CVector3f xf8_model_erase_position; float x104_rowPitch = 0.f; float x108_curTime = 0.f; @@ -329,7 +334,7 @@ private: float x64_pressStartAlpha = 0.f; float x68_musicVol = 1.f; u32 x6c_; - std::unique_ptr x70_menuMovies[9]; + std::array, 9> x70_menuMovies; EMenuMovie xb8_curMovie = EMenuMovie::Stopped; int xbc_nextAttract = 0; int xc0_attractCount = 0; diff --git a/Runtime/MP1/CGBASupport.cpp b/Runtime/MP1/CGBASupport.cpp index 781a82ab6..113241436 100644 --- a/Runtime/MP1/CGBASupport.cpp +++ b/Runtime/MP1/CGBASupport.cpp @@ -1,8 +1,12 @@ #include "CGBASupport.hpp" -#include "CDvdRequest.hpp" + +#include + #include "CBasics.hpp" -#include "jbus/Listener.hpp" -#include "jbus/Endpoint.hpp" +#include "CDvdRequest.hpp" + +#include +#include namespace urde::MP1 { @@ -65,19 +69,27 @@ bool CGBASupport::PollResponse() { if (status != (jbus::GBA_JSTAT_PSF1 | jbus::GBA_JSTAT_SEND)) return false; - u8 bytes[4]; - if (g_JbusEndpoint->GBARead(bytes, &status) == jbus::GBA_NOT_READY) - return false; - if (reinterpret_cast(bytes) != SBIG('AMTE')) + jbus::ReadWriteBuffer bytes; + if (g_JbusEndpoint->GBARead(bytes, &status) == jbus::GBA_NOT_READY) { return false; + } - if (g_JbusEndpoint->GBAGetStatus(&status) == jbus::GBA_NOT_READY) - return false; - if (status != jbus::GBA_JSTAT_PSF1) + u32 bytesU32; + std::memcpy(&bytesU32, bytes.data(), sizeof(bytes)); + if (bytesU32 != SBIG('AMTE')) { return false; + } - if (g_JbusEndpoint->GBAWrite((unsigned char*)"AMTE", &status) == jbus::GBA_NOT_READY) + if (g_JbusEndpoint->GBAGetStatus(&status) == jbus::GBA_NOT_READY) { return false; + } + if (status != jbus::GBA_JSTAT_PSF1) { + return false; + } + + if (g_JbusEndpoint->GBAWrite({'A', 'M', 'T', 'E'}, &status) == jbus::GBA_NOT_READY) { + return false; + } if (g_JbusEndpoint->GBAGetStatus(&status) == jbus::GBA_NOT_READY) return false; @@ -103,11 +115,13 @@ bool CGBASupport::PollResponse() { break; } - if (g_JbusEndpoint->GBARead(bytes, &status) != jbus::GBA_READY) + if (g_JbusEndpoint->GBARead(bytes, &status) != jbus::GBA_READY) { return false; + } - if (bytes[3] != CalculateFusionJBusChecksum(bytes, 3)) + if (bytes[3] != CalculateFusionJBusChecksum(bytes.data(), 3)) { return false; + } x44_fusionLinked = (bytes[2] & 0x2) == 0; if (x44_fusionLinked && (bytes[2] & 0x1) != 0) diff --git a/Runtime/MP1/CGBASupport.hpp b/Runtime/MP1/CGBASupport.hpp index 16c791651..301d2d0e6 100644 --- a/Runtime/MP1/CGBASupport.hpp +++ b/Runtime/MP1/CGBASupport.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CDvdFile.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/CDvdFile.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/CGameCubeDoll.hpp b/Runtime/MP1/CGameCubeDoll.hpp index c5782c940..97d012539 100644 --- a/Runtime/MP1/CGameCubeDoll.hpp +++ b/Runtime/MP1/CGameCubeDoll.hpp @@ -1,8 +1,11 @@ #pragma once -#include "RetroTypes.hpp" -#include "Character/CActorLights.hpp" -#include "CToken.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CActorLights.hpp" namespace urde { class CModel; diff --git a/Runtime/MP1/CInGameGuiManager.cpp b/Runtime/MP1/CInGameGuiManager.cpp index da54730e4..064f305ec 100644 --- a/Runtime/MP1/CInGameGuiManager.cpp +++ b/Runtime/MP1/CInGameGuiManager.cpp @@ -12,7 +12,7 @@ #include "Audio/CSfxManager.hpp" #include "CSamusHud.hpp" #include "Input/CInputGenerator.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "Camera/CFirstPersonCamera.hpp" #include "Graphics/CBooRenderer.hpp" #include "GuiSys/CGuiWidgetDrawParms.hpp" diff --git a/Runtime/MP1/CInGameGuiManager.hpp b/Runtime/MP1/CInGameGuiManager.hpp index 75b560ebf..367c0e8e4 100644 --- a/Runtime/MP1/CInGameGuiManager.hpp +++ b/Runtime/MP1/CInGameGuiManager.hpp @@ -1,35 +1,45 @@ #pragma once -#include "CToken.hpp" -#include "CRandom16.hpp" -#include "CPlayerVisor.hpp" -#include "CFaceplateDecoration.hpp" -#include "CSamusFaceReflection.hpp" -#include "CMessageScreen.hpp" -#include "CSaveGameScreen.hpp" -#include "Camera/CCameraFilter.hpp" -#include "CStateManager.hpp" +#include +#include +#include +#include + #include "DataSpec/DNACommon/Tweaks/ITweakGui.hpp" -#include "CInventoryScreen.hpp" -#include "CPauseScreen.hpp" -#include "CPauseScreenBlur.hpp" -#include "CInGameGuiManagerCommon.hpp" -#include "Graphics/Shaders/CRandomStaticFilter.hpp" + +#include "Runtime/CRandom16.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/CStateManager.hpp" +#include "Runtime/Camera/CCameraFilter.hpp" +#include "Runtime/Graphics/Shaders/CRandomStaticFilter.hpp" +#include "Runtime/MP1/CFaceplateDecoration.hpp" +#include "Runtime/MP1/CInGameGuiManagerCommon.hpp" +#include "Runtime/MP1/CInventoryScreen.hpp" +#include "Runtime/MP1/CMessageScreen.hpp" +#include "Runtime/MP1/CPauseScreen.hpp" +#include "Runtime/MP1/CPauseScreenBlur.hpp" +#include "Runtime/MP1/CPlayerVisor.hpp" +#include "Runtime/MP1/CSamusFaceReflection.hpp" +#include "Runtime/MP1/CSaveGameScreen.hpp" + +#include +#include +#include namespace urde { -class CStateManager; -class CArchitectureQueue; -class CDependencyGroup; -class CModelData; class CActorLights; -class CGuiModel; -class CGuiCamera; +class CArchitectureQueue; class CAutoMapper; +class CDependencyGroup; +class CGuiCamera; +class CGuiModel; +class CModelData; +class CStateManager; namespace MP1 { +class CPauseScreen; class CPauseScreenBlur; class CSamusHud; -class CPauseScreen; class CInGameGuiManager { public: diff --git a/Runtime/MP1/CInGameGuiManagerCommon.hpp b/Runtime/MP1/CInGameGuiManagerCommon.hpp index f403ecfff..3e72a91ce 100644 --- a/Runtime/MP1/CInGameGuiManagerCommon.hpp +++ b/Runtime/MP1/CInGameGuiManagerCommon.hpp @@ -1,7 +1,5 @@ #pragma once -#include "RetroTypes.hpp" - namespace urde::MP1 { enum class EInGameGuiState { Zero, InGame, MapScreen, PauseGame, PauseLogBook, PauseSaveGame, PauseHUDMessage }; diff --git a/Runtime/MP1/CInGameTweakManager.hpp b/Runtime/MP1/CInGameTweakManager.hpp index 46b861c4a..0be9131f8 100644 --- a/Runtime/MP1/CInGameTweakManager.hpp +++ b/Runtime/MP1/CInGameTweakManager.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CInGameTweakManagerBase.hpp" +#include "Runtime/CInGameTweakManagerBase.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/CInventoryScreen.hpp b/Runtime/MP1/CInventoryScreen.hpp index 372b0d480..51a7642de 100644 --- a/Runtime/MP1/CInventoryScreen.hpp +++ b/Runtime/MP1/CInventoryScreen.hpp @@ -1,8 +1,12 @@ #pragma once -#include "CInGameGuiManager.hpp" -#include "CPauseScreenBase.hpp" -#include "CSamusDoll.hpp" +#include + +#include "Runtime/MP1/CInGameGuiManager.hpp" +#include "Runtime/MP1/CPauseScreenBase.hpp" +#include "Runtime/MP1/CSamusDoll.hpp" + +#include namespace urde { class CDependencyGroup; diff --git a/Runtime/MP1/CLogBookScreen.hpp b/Runtime/MP1/CLogBookScreen.hpp index fbaa8111e..c6d2a930d 100644 --- a/Runtime/MP1/CLogBookScreen.hpp +++ b/Runtime/MP1/CLogBookScreen.hpp @@ -1,8 +1,13 @@ #pragma once -#include "CInGameGuiManager.hpp" -#include "CPauseScreenBase.hpp" -#include "CArtifactDoll.hpp" +#include +#include +#include + +#include "Runtime/rstl.hpp" +#include "Runtime/MP1/CArtifactDoll.hpp" +#include "Runtime/MP1/CInGameGuiManager.hpp" +#include "Runtime/MP1/CPauseScreenBase.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/CMFGame.cpp b/Runtime/MP1/CMFGame.cpp index 982385a24..22755120d 100644 --- a/Runtime/MP1/CMFGame.cpp +++ b/Runtime/MP1/CMFGame.cpp @@ -4,7 +4,7 @@ #include "MP1.hpp" #include "AutoMapper/CAutoMapper.hpp" #include "CSamusHud.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "Audio/CMidiManager.hpp" #include "Camera/CCinematicCamera.hpp" diff --git a/Runtime/MP1/CMFGame.hpp b/Runtime/MP1/CMFGame.hpp index fdf612a50..b4ddba89e 100644 --- a/Runtime/MP1/CMFGame.hpp +++ b/Runtime/MP1/CMFGame.hpp @@ -1,8 +1,11 @@ #pragma once -#include "CMFGameBase.hpp" -#include "CInGameGuiManager.hpp" -#include "Graphics/Shaders/CColoredQuadFilter.hpp" +#include +#include + +#include "Runtime/CMFGameBase.hpp" +#include "Runtime/Graphics/Shaders/CColoredQuadFilter.hpp" +#include "Runtime/MP1/CInGameGuiManager.hpp" namespace urde { class CStateManager; diff --git a/Runtime/MP1/CMainFlow.hpp b/Runtime/MP1/CMainFlow.hpp index 19f3ff777..ec2a5df57 100644 --- a/Runtime/MP1/CMainFlow.hpp +++ b/Runtime/MP1/CMainFlow.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CMainFlowBase.hpp" +#include "Runtime/CMainFlowBase.hpp" namespace urde { class CArchitectureMessage; diff --git a/Runtime/MP1/CMemoryCardDriver.cpp b/Runtime/MP1/CMemoryCardDriver.cpp index ccbc08a4b..eb19c9d91 100644 --- a/Runtime/MP1/CMemoryCardDriver.cpp +++ b/Runtime/MP1/CMemoryCardDriver.cpp @@ -709,7 +709,7 @@ void CMemoryCardDriver::HandleCardError(ECardResult result, EState state) { case ECardResult::IOERROR: x10_state = state; x14_error = EError::CardIOError; - [[fallthrough]]; + break; case ECardResult::ENCODING: x10_state = state; x14_error = EError::CardWrongCharacterSet; diff --git a/Runtime/MP1/CMemoryCardDriver.hpp b/Runtime/MP1/CMemoryCardDriver.hpp index 0618e7972..2e89cdd2d 100644 --- a/Runtime/MP1/CMemoryCardDriver.hpp +++ b/Runtime/MP1/CMemoryCardDriver.hpp @@ -1,7 +1,11 @@ #pragma once -#include "CMemoryCardSys.hpp" -#include "CGameState.hpp" +#include +#include +#include + +#include "Runtime/CGameState.hpp" +#include "Runtime/CMemoryCardSys.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/CMessageScreen.hpp b/Runtime/MP1/CMessageScreen.hpp index 0ca683ea4..ea0b77b7e 100644 --- a/Runtime/MP1/CMessageScreen.hpp +++ b/Runtime/MP1/CMessageScreen.hpp @@ -1,15 +1,17 @@ #pragma once -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "GuiSys/CStringTable.hpp" -#include "GuiSys/CGuiFrame.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/GuiSys/CGuiFrame.hpp" +#include "Runtime/GuiSys/CStringTable.hpp" + +#include namespace urde { struct CFinalInput; -class CGuiWidget; -class CGuiTextPane; class CGuiModel; +class CGuiTextPane; +class CGuiWidget; namespace MP1 { diff --git a/Runtime/MP1/COptionsScreen.cpp b/Runtime/MP1/COptionsScreen.cpp index 451e4960c..8d2419cf1 100644 --- a/Runtime/MP1/COptionsScreen.cpp +++ b/Runtime/MP1/COptionsScreen.cpp @@ -86,7 +86,7 @@ void COptionsScreen::OnEnumChanged(CGuiTableGroup* caller, int oldSel) { if (opt == EGameOption::Rumble && caller->GetUserSelection() > 0) { x1a8_rumble.HardStopAll(); - x1a8_rumble.Rumble(RumbleFxTable[int(ERumbleFxId::PlayerBump)], 1.f, ERumblePriority::One, EIOPort::Zero); + x1a8_rumble.Rumble(RumbleFxTable[size_t(ERumbleFxId::PlayerBump)], 1.f, ERumblePriority::One, EIOPort::Zero); } CPauseScreenBase::UpdateSideTable(caller); diff --git a/Runtime/MP1/COptionsScreen.hpp b/Runtime/MP1/COptionsScreen.hpp index a2fc3fc35..d32e784d1 100644 --- a/Runtime/MP1/COptionsScreen.hpp +++ b/Runtime/MP1/COptionsScreen.hpp @@ -1,9 +1,11 @@ #pragma once -#include "CInGameGuiManager.hpp" -#include "CPauseScreenBase.hpp" -#include "CGameCubeDoll.hpp" -#include "CQuitGameScreen.hpp" +#include + +#include "Runtime/MP1/CGameCubeDoll.hpp" +#include "Runtime/MP1/CInGameGuiManager.hpp" +#include "Runtime/MP1/CPauseScreenBase.hpp" +#include "Runtime/MP1/CQuitGameScreen.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/CPauseScreen.hpp b/Runtime/MP1/CPauseScreen.hpp index a51a0ef6c..0c3721e86 100644 --- a/Runtime/MP1/CPauseScreen.hpp +++ b/Runtime/MP1/CPauseScreen.hpp @@ -1,8 +1,11 @@ #pragma once -#include "CInGameGuiManager.hpp" +#include + #include "Editor/ProjectResourceFactoryBase.hpp" -#include "CPauseScreenBase.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/MP1/CInGameGuiManager.hpp" +#include "Runtime/MP1/CPauseScreenBase.hpp" namespace urde { class CDependencyGroup; diff --git a/Runtime/MP1/CPauseScreenBase.hpp b/Runtime/MP1/CPauseScreenBase.hpp index be2ffdabb..7b9937143 100644 --- a/Runtime/MP1/CPauseScreenBase.hpp +++ b/Runtime/MP1/CPauseScreenBase.hpp @@ -1,20 +1,24 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "GuiSys/CGuiFrame.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/GuiSys/CGuiFrame.hpp" + +#include namespace urde { -class CStateManager; -class CGuiWidget; -class CGuiTableGroup; -class CGuiModel; -class CGuiTextPane; -class CGuiSliderGroup; -class CAuiImagePane; -class CStringTable; -class CRandom16; class CArchitectureQueue; +class CAuiImagePane; +class CGuiModel; +class CGuiSliderGroup; +class CGuiTableGroup; +class CGuiTextPane; +class CGuiWidget; +class CRandom16; +class CStateManager; +class CStringTable; namespace MP1 { diff --git a/Runtime/MP1/CPauseScreenBlur.hpp b/Runtime/MP1/CPauseScreenBlur.hpp index 54c3a7d6b..4debbd6f2 100644 --- a/Runtime/MP1/CPauseScreenBlur.hpp +++ b/Runtime/MP1/CPauseScreenBlur.hpp @@ -1,11 +1,11 @@ #pragma once -#include "CInGameGuiManagerCommon.hpp" -#include "CToken.hpp" -#include "Camera/CCameraFilter.hpp" -#include "Graphics/CTexture.hpp" -#include "Graphics/Shaders/CTexturedQuadFilter.hpp" -#include "Graphics/Shaders/CScanLinesFilter.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/Camera/CCameraFilter.hpp" +#include "Runtime/Graphics/CTexture.hpp" +#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp" +#include "Runtime/Graphics/Shaders/CScanLinesFilter.hpp" +#include "Runtime/MP1/CInGameGuiManagerCommon.hpp" namespace urde { class CStateManager; diff --git a/Runtime/MP1/CPlayMovie.hpp b/Runtime/MP1/CPlayMovie.hpp index 9cb030b33..cb1d7199e 100644 --- a/Runtime/MP1/CPlayMovie.hpp +++ b/Runtime/MP1/CPlayMovie.hpp @@ -1,7 +1,7 @@ #pragma once -#include "CPlayMovieBase.hpp" -#include "RetroTypes.hpp" +#include "Runtime/CPlayMovieBase.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/CPlayerVisor.cpp b/Runtime/MP1/CPlayerVisor.cpp index f0d1efd77..35b19f11d 100644 --- a/Runtime/MP1/CPlayerVisor.cpp +++ b/Runtime/MP1/CPlayerVisor.cpp @@ -4,7 +4,7 @@ #include "Graphics/CModel.hpp" #include "CStateManager.hpp" #include "World/CPlayer.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "Camera/CGameCamera.hpp" #include "Graphics/CBooRenderer.hpp" #include "GuiSys/CCompoundTargetReticle.hpp" diff --git a/Runtime/MP1/CPlayerVisor.hpp b/Runtime/MP1/CPlayerVisor.hpp index c67e69603..46b19da3a 100644 --- a/Runtime/MP1/CPlayerVisor.hpp +++ b/Runtime/MP1/CPlayerVisor.hpp @@ -1,13 +1,15 @@ #pragma once -#include "RetroTypes.hpp" -#include "Camera/CCameraFilter.hpp" -#include "zeus/CVector2f.hpp" -#include "Audio/CSfxManager.hpp" -#include "CPlayerState.hpp" -#include "Graphics/CModel.hpp" -#include "Graphics/Shaders/CColoredQuadFilter.hpp" -#include "Graphics/Shaders/CTexturedQuadFilter.hpp" +#include "Runtime/CPlayerState.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Audio/CSfxManager.hpp" +#include "Runtime/Camera/CCameraFilter.hpp" +#include "Runtime/Graphics/CModel.hpp" +#include "Runtime/Graphics/Shaders/CColoredQuadFilter.hpp" +#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp" + +#include namespace urde { class CStateManager; diff --git a/Runtime/MP1/CPreFrontEnd.hpp b/Runtime/MP1/CPreFrontEnd.hpp index 7c6270e06..54a2c02f8 100644 --- a/Runtime/MP1/CPreFrontEnd.hpp +++ b/Runtime/MP1/CPreFrontEnd.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CIOWin.hpp" +#include "Runtime/CIOWin.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/CQuitGameScreen.hpp b/Runtime/MP1/CQuitGameScreen.hpp index f42751c9e..c0c5424f0 100644 --- a/Runtime/MP1/CQuitGameScreen.hpp +++ b/Runtime/MP1/CQuitGameScreen.hpp @@ -1,8 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "Graphics/Shaders/CColoredQuadFilter.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/Shaders/CColoredQuadFilter.hpp" namespace urde { struct CFinalInput; diff --git a/Runtime/MP1/CSamusDoll.cpp b/Runtime/MP1/CSamusDoll.cpp index 82105b920..e84fdd867 100644 --- a/Runtime/MP1/CSamusDoll.cpp +++ b/Runtime/MP1/CSamusDoll.cpp @@ -468,20 +468,35 @@ void CSamusDoll::Draw(const CStateManager& mgr, float alpha) { flags.x4_color.a() = x6c_ballPulseFactor * alpha * itemPulse; x184_ballModelData->Render(mgr, x10_ballXf, x24c_actorLights.get(), flags); - const u8* c = CMorphBall::BallGlowColors[x1e8_ballGlowColorIdx]; - zeus::CColor color = {c[0] / 255.f, c[1] / 255.f, c[2] / 255.f, alpha}; - x22c_ballInnerGlowGen->SetModulationColor(color); + const CMorphBall::ColorArray ballGlowColorData = CMorphBall::BallGlowColors[x1e8_ballGlowColorIdx]; + const zeus::CColor ballGlowColor{ + float(ballGlowColorData[0]) / 255.f, + float(ballGlowColorData[1]) / 255.f, + float(ballGlowColorData[2]) / 255.f, + alpha, + }; + x22c_ballInnerGlowGen->SetModulationColor(ballGlowColor); if (alpha > 0.f) { if (x22c_ballInnerGlowGen->GetNumActiveChildParticles() > 0) { - const u8* c = CMorphBall::BallTransFlashColors[x1e8_ballGlowColorIdx]; - zeus::CColor color = {c[0] / 255.f, c[1] / 255.f, c[2] / 255.f, alpha}; - x22c_ballInnerGlowGen->GetActiveChildParticle(0).SetModulationColor(color); + const CMorphBall::ColorArray transFlashColorData = CMorphBall::BallTransFlashColors[x1e8_ballGlowColorIdx]; + const zeus::CColor transFlashColor{ + float(transFlashColorData[0]) / 255.f, + float(transFlashColorData[1]) / 255.f, + float(transFlashColorData[2]) / 255.f, + alpha, + }; + x22c_ballInnerGlowGen->GetActiveChildParticle(0).SetModulationColor(transFlashColor); if (x22c_ballInnerGlowGen->GetNumActiveChildParticles() > 1) { - const u8* c = CMorphBall::BallAuxGlowColors[x1e8_ballGlowColorIdx]; - zeus::CColor color = {c[0] / 255.f, c[1] / 255.f, c[2] / 255.f, alpha}; - x22c_ballInnerGlowGen->GetActiveChildParticle(1).SetModulationColor(color); + const CMorphBall::ColorArray auxColorData = CMorphBall::BallAuxGlowColors[x1e8_ballGlowColorIdx]; + const zeus::CColor auxColor{ + float(auxColorData[0]) / 255.f, + float(auxColorData[1]) / 255.f, + float(auxColorData[2]) / 255.f, + alpha, + }; + x22c_ballInnerGlowGen->GetActiveChildParticle(1).SetModulationColor(auxColor); } } x22c_ballInnerGlowGen->Render(); @@ -510,8 +525,13 @@ void CSamusDoll::Draw(const CStateManager& mgr, float alpha) { } if (x238_ballTransitionFlashGen) { - const u8* c = CMorphBall::BallTransFlashColors[x1e8_ballGlowColorIdx]; - zeus::CColor color = {c[0] / 255.f, c[1] / 255.f, c[2] / 255.f, 1.f}; + const CMorphBall::ColorArray c = CMorphBall::BallTransFlashColors[x1e8_ballGlowColorIdx]; + const zeus::CColor color{ + float(c[0]) / 255.f, + float(c[1]) / 255.f, + float(c[2]) / 255.f, + 1.f, + }; x238_ballTransitionFlashGen->SetModulationColor(color); x238_ballTransitionFlashGen->Render(); } diff --git a/Runtime/MP1/CSamusDoll.hpp b/Runtime/MP1/CSamusDoll.hpp index 9bf32750e..ad85d8481 100644 --- a/Runtime/MP1/CSamusDoll.hpp +++ b/Runtime/MP1/CSamusDoll.hpp @@ -1,12 +1,22 @@ #pragma once -#include "CPlayerState.hpp" -#include "CToken.hpp" -#include "Character/CModelData.hpp" -#include "Character/CAnimCharacterSet.hpp" -#include "Particle/CElementGen.hpp" -#include "Character/CActorLights.hpp" -#include "Audio/CSfxManager.hpp" +#include +#include +#include + +#include "Runtime/CPlayerState.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Audio/CSfxManager.hpp" +#include "Runtime/Character/CActorLights.hpp" +#include "Runtime/Character/CAnimCharacterSet.hpp" +#include "Runtime/Character/CModelData.hpp" +#include "Runtime/Particle/CElementGen.hpp" + +#include +#include +#include +#include namespace urde { class CDependencyGroup; diff --git a/Runtime/MP1/CSamusFaceReflection.cpp b/Runtime/MP1/CSamusFaceReflection.cpp index 982521c72..50693d287 100644 --- a/Runtime/MP1/CSamusFaceReflection.cpp +++ b/Runtime/MP1/CSamusFaceReflection.cpp @@ -1,7 +1,7 @@ #include "CSamusFaceReflection.hpp" #include "GameGlobalObjects.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "Camera/CFirstPersonCamera.hpp" #include "World/CPlayer.hpp" #include "World/CWorld.hpp" diff --git a/Runtime/MP1/CSamusFaceReflection.hpp b/Runtime/MP1/CSamusFaceReflection.hpp index ec0b2a3ec..76193664e 100644 --- a/Runtime/MP1/CSamusFaceReflection.hpp +++ b/Runtime/MP1/CSamusFaceReflection.hpp @@ -1,7 +1,12 @@ #pragma once -#include "Character/CModelData.hpp" -#include "Character/CActorLights.hpp" +#include + +#include "Runtime/Character/CActorLights.hpp" +#include "Runtime/Character/CModelData.hpp" + +#include +#include namespace urde::MP1 { diff --git a/Runtime/MP1/CSamusHud.cpp b/Runtime/MP1/CSamusHud.cpp index 25a648414..470fe4154 100644 --- a/Runtime/MP1/CSamusHud.cpp +++ b/Runtime/MP1/CSamusHud.cpp @@ -10,7 +10,7 @@ #include "GuiSys/CGuiCamera.hpp" #include "GuiSys/CGuiWidgetDrawParms.hpp" #include "Camera/CFirstPersonCamera.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "World/CGameLight.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/CSamusHud.hpp b/Runtime/MP1/CSamusHud.hpp index 688348e6e..3e8ca6a31 100644 --- a/Runtime/MP1/CSamusHud.hpp +++ b/Runtime/MP1/CSamusHud.hpp @@ -1,24 +1,35 @@ #pragma once -#include "CInGameGuiManager.hpp" -#include "GuiSys/CTargetingManager.hpp" -#include "GuiSys/CHudBallInterface.hpp" -#include "GuiSys/CHudBossEnergyInterface.hpp" -#include "GuiSys/CHudDecoInterface.hpp" -#include "GuiSys/CHudEnergyInterface.hpp" -#include "GuiSys/CHudFreeLookInterface.hpp" -#include "GuiSys/CHudHelmetInterface.hpp" -#include "GuiSys/CHudMissileInterface.hpp" -#include "GuiSys/CHudRadarInterface.hpp" -#include "GuiSys/CHudThreatInterface.hpp" -#include "GuiSys/CHudVisorBeamMenu.hpp" -#include "Graphics/Shaders/CRandomStaticFilter.hpp" -#include "World/CHUDMemoParms.hpp" +#include +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Graphics/Shaders/CRandomStaticFilter.hpp" +#include "Runtime/GuiSys/CHudBallInterface.hpp" +#include "Runtime/GuiSys/CHudBossEnergyInterface.hpp" +#include "Runtime/GuiSys/CHudDecoInterface.hpp" +#include "Runtime/GuiSys/CHudEnergyInterface.hpp" +#include "Runtime/GuiSys/CHudFreeLookInterface.hpp" +#include "Runtime/GuiSys/CHudHelmetInterface.hpp" +#include "Runtime/GuiSys/CHudMissileInterface.hpp" +#include "Runtime/GuiSys/CHudRadarInterface.hpp" +#include "Runtime/GuiSys/CHudThreatInterface.hpp" +#include "Runtime/GuiSys/CHudVisorBeamMenu.hpp" +#include "Runtime/GuiSys/CTargetingManager.hpp" +#include "Runtime/MP1/CInGameGuiManager.hpp" +#include "Runtime/World/CHUDMemoParms.hpp" + +#include +#include +#include +#include namespace urde { class CGuiFrame; -class CStateManager; class CGuiLight; +class CStateManager; enum class EHudState { Combat, XRay, Thermal, Scan, Ball, None }; diff --git a/Runtime/MP1/CSaveGameScreen.hpp b/Runtime/MP1/CSaveGameScreen.hpp index 13445044e..b37fab7e0 100644 --- a/Runtime/MP1/CSaveGameScreen.hpp +++ b/Runtime/MP1/CSaveGameScreen.hpp @@ -1,19 +1,22 @@ #pragma once -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "CIOWin.hpp" -#include "CMemoryCardDriver.hpp" -#include "CSaveGameScreenTouchBar.hpp" +#include +#include + +#include "Runtime/CIOWin.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/MP1/CMemoryCardDriver.hpp" +#include "Runtime/MP1/CSaveGameScreenTouchBar.hpp" namespace urde { -class CTexture; -class CStringTable; class CGuiFrame; -class CSaveWorld; -struct CFinalInput; -class CGuiTextPane; class CGuiTableGroup; +class CGuiTextPane; +class CSaveWorld; +class CStringTable; +class CTexture; +struct CFinalInput; namespace MP1 { diff --git a/Runtime/MP1/CSaveGameScreenTouchBar.hpp b/Runtime/MP1/CSaveGameScreenTouchBar.hpp index f3a1ef205..3e5f2b31e 100644 --- a/Runtime/MP1/CSaveGameScreenTouchBar.hpp +++ b/Runtime/MP1/CSaveGameScreenTouchBar.hpp @@ -1,8 +1,8 @@ #pragma once -#include #include #include +#include namespace urde::MP1 { diff --git a/Runtime/MP1/CSlideShow.hpp b/Runtime/MP1/CSlideShow.hpp index a3d22a7eb..e27c0ce48 100644 --- a/Runtime/MP1/CSlideShow.hpp +++ b/Runtime/MP1/CSlideShow.hpp @@ -1,15 +1,22 @@ #pragma once -#include "RetroTypes.hpp" -#include "CIOWin.hpp" -#include "CToken.hpp" -#include "GuiSys/CGuiTextSupport.hpp" -#include "Graphics/Shaders/CTexturedQuadFilter.hpp" -#include "Audio/CSfxManager.hpp" +#include +#include +#include + +#include "Runtime/CIOWin.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Audio/CSfxManager.hpp" +#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp" +#include "Runtime/GuiSys/CGuiTextSupport.hpp" + +#include +#include namespace urde { -class CTexture; class CDependencyGroup; +class CTexture; class CSlideShow : public CIOWin { public: diff --git a/Runtime/MP1/CStateSetterFlow.hpp b/Runtime/MP1/CStateSetterFlow.hpp index df1699df2..25e1a1d85 100644 --- a/Runtime/MP1/CStateSetterFlow.hpp +++ b/Runtime/MP1/CStateSetterFlow.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CIOWin.hpp" +#include "Runtime/CIOWin.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/CTweaks.hpp b/Runtime/MP1/CTweaks.hpp index d43e0d8b1..c9977e523 100644 --- a/Runtime/MP1/CTweaks.hpp +++ b/Runtime/MP1/CTweaks.hpp @@ -1,6 +1,7 @@ #pragma once -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" + namespace hecl { class CVarManager; } diff --git a/Runtime/MP1/MP1.cpp b/Runtime/MP1/MP1.cpp index 04a4276a1..80b6cea22 100644 --- a/Runtime/MP1/MP1.cpp +++ b/Runtime/MP1/MP1.cpp @@ -359,14 +359,17 @@ void CMain::InitializeSubsystems() { } void CMain::MemoryCardInitializePump() { - if (!g_MemoryCardSys) { - std::unique_ptr& memSys = x128_globalObjects.x0_memoryCardSys; - if (!memSys) - memSys.reset(new CMemoryCardSys()); - if (memSys->InitializePump()) { - g_MemoryCardSys = memSys.get(); - g_GameState->InitializeMemoryStates(); - } + if (g_MemoryCardSys) { + return; + } + + std::unique_ptr& memSys = x128_globalObjects.x0_memoryCardSys; + if (!memSys) { + memSys = std::make_unique(); + } + if (memSys->InitializePump()) { + g_MemoryCardSys = memSys.get(); + g_GameState->InitializeMemoryStates(); } } @@ -726,7 +729,7 @@ void CMain::Init(const hecl::Runtime::FileStoreManager& storeMgr, hecl::CVarMana } FillInAssetIDs(); - x164_archSupport.reset(new CGameArchitectureSupport(*this, voiceEngine, backend)); + x164_archSupport = std::make_unique(*this, voiceEngine, backend); g_archSupport = x164_archSupport.get(); x164_archSupport->PreloadAudio(); std::srand(static_cast(std::time(nullptr))); diff --git a/Runtime/MP1/MP1.hpp b/Runtime/MP1/MP1.hpp index 99bf26b49..f45977c3e 100644 --- a/Runtime/MP1/MP1.hpp +++ b/Runtime/MP1/MP1.hpp @@ -76,18 +76,18 @@ public: CGameGlobalObjects(IFactory* resFactory, CSimplePool* objStore) : x4_resFactory(resFactory), xcc_simplePool(objStore) { if (!x4_resFactory) { - m_gameResFactory.reset(new CResFactory()); + m_gameResFactory = std::make_unique(); x4_resFactory = m_gameResFactory.get(); } if (!xcc_simplePool) { - m_gameSimplePool.reset(new CSimplePool(*x4_resFactory)); + m_gameSimplePool = std::make_unique(*x4_resFactory); xcc_simplePool = m_gameSimplePool.get(); } g_ResFactory = x4_resFactory; g_SimplePool = xcc_simplePool; g_CharFactoryBuilder = &xec_charFactoryBuilder; g_AiFuncMap = &x110_aiFuncMap; - x134_gameState.reset(new CGameState()); + x134_gameState = std::make_unique(); g_GameState = x134_gameState.get(); g_TweakManager = &x150_tweakManager; } @@ -103,12 +103,12 @@ public: } void ResetGameState() { - x134_gameState.reset(new CGameState()); + x134_gameState = std::make_unique(); g_GameState = x134_gameState.get(); } void StreamInGameState(CBitStreamReader& stream, u32 saveIdx) { - x134_gameState.reset(new CGameState(stream, saveIdx)); + x134_gameState = std::make_unique(stream, saveIdx); g_GameState = x134_gameState.get(); } }; diff --git a/Runtime/MP1/World/CActorContraption.cpp b/Runtime/MP1/World/CActorContraption.cpp index 7087e75d5..eb432525c 100644 --- a/Runtime/MP1/World/CActorContraption.cpp +++ b/Runtime/MP1/World/CActorContraption.cpp @@ -5,7 +5,7 @@ #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/MP1/World/CActorContraption.hpp b/Runtime/MP1/World/CActorContraption.hpp index fc1f15fdb..97df40615 100644 --- a/Runtime/MP1/World/CActorContraption.hpp +++ b/Runtime/MP1/World/CActorContraption.hpp @@ -1,7 +1,11 @@ #pragma once -#include "World/CScriptActor.hpp" -#include "World/CDamageInfo.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CDamageInfo.hpp" +#include "Runtime/World/CScriptActor.hpp" namespace urde { class CFlameThrower; diff --git a/Runtime/MP1/World/CAtomicAlpha.hpp b/Runtime/MP1/World/CAtomicAlpha.hpp index 59c53e67d..75c9554d7 100644 --- a/Runtime/MP1/World/CAtomicAlpha.hpp +++ b/Runtime/MP1/World/CAtomicAlpha.hpp @@ -1,8 +1,11 @@ #pragma once -#include "World/CPatterned.hpp" -#include "World/CPathFindSearch.hpp" -#include "Weapon/CProjectileInfo.hpp" +#include + +#include "Runtime/rstl.hpp" +#include "Runtime/Weapon/CProjectileInfo.hpp" +#include "Runtime/World/CPatterned.hpp" +#include "Runtime/World/CPathFindSearch.hpp" namespace urde::MP1 { class CAtomicAlpha : public CPatterned { diff --git a/Runtime/MP1/World/CAtomicBeta.hpp b/Runtime/MP1/World/CAtomicBeta.hpp index d8a0a0a52..46197653f 100644 --- a/Runtime/MP1/World/CAtomicBeta.hpp +++ b/Runtime/MP1/World/CAtomicBeta.hpp @@ -1,5 +1,11 @@ #pragma once -#include "World/CPatterned.hpp" + +#include + +#include "Runtime/rstl.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include namespace urde { class CWeaponDescription; diff --git a/Runtime/MP1/World/CBabygoth.cpp b/Runtime/MP1/World/CBabygoth.cpp index a4a2ca365..1435f6e45 100644 --- a/Runtime/MP1/World/CBabygoth.cpp +++ b/Runtime/MP1/World/CBabygoth.cpp @@ -16,7 +16,7 @@ #include "CSimplePool.hpp" #include "GameGlobalObjects.hpp" #include "Graphics/CSkinnedModel.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { const std::string_view CBabygoth::skpMouthDamageJoint = "LCTR_SHEMOUTH"sv; @@ -298,7 +298,7 @@ void CBabygoth::AddSphereCollisionList(const SSphereJointInfo* sphereJointInfo, void CBabygoth::SetupCollisionManager(CStateManager& mgr) { std::vector joints; AddSphereCollisionList(skSphereJointList, skSphereJointCount, joints); - x928_colActMgr.reset(new CCollisionActorManager(mgr, GetUniqueId(), GetAreaIdAlways(), joints, false)); + x928_colActMgr = std::make_unique(mgr, GetUniqueId(), GetAreaIdAlways(), joints, false); x928_colActMgr->SetActive(mgr, GetActive()); for (u32 i = 0; i < x928_colActMgr->GetNumCollisionActors(); ++i) { diff --git a/Runtime/MP1/World/CBabygoth.hpp b/Runtime/MP1/World/CBabygoth.hpp index d3b4cc98a..634c77d33 100644 --- a/Runtime/MP1/World/CBabygoth.hpp +++ b/Runtime/MP1/World/CBabygoth.hpp @@ -1,10 +1,14 @@ #pragma once -#include -#include "World/CPatterned.hpp" -#include "World/CPathFindSearch.hpp" -#include "Weapon/CProjectileInfo.hpp" -#include "Character/CBoneTracking.hpp" +#include + +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CBoneTracking.hpp" +#include "Runtime/Collision/CJointCollisionDescription.hpp" +#include "Runtime/Weapon/CProjectileInfo.hpp" +#include "Runtime/World/CPathFindSearch.hpp" +#include "Runtime/World/CPatterned.hpp" + namespace urde { class CCollisionActorManager; class CWeaponDescription; diff --git a/Runtime/MP1/World/CBeetle.cpp b/Runtime/MP1/World/CBeetle.cpp index 097375b5e..0819d41f3 100644 --- a/Runtime/MP1/World/CBeetle.cpp +++ b/Runtime/MP1/World/CBeetle.cpp @@ -2,7 +2,7 @@ #include "CStateManager.hpp" #include "World/CDamageInfo.hpp" #include "Character/CCharLayoutInfo.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "World/CPatternedInfo.hpp" #include "Character/CPASAnimParmData.hpp" #include "World/CTeamAiMgr.hpp" diff --git a/Runtime/MP1/World/CBeetle.hpp b/Runtime/MP1/World/CBeetle.hpp index cdb161664..55c146d9c 100644 --- a/Runtime/MP1/World/CBeetle.hpp +++ b/Runtime/MP1/World/CBeetle.hpp @@ -1,8 +1,13 @@ #pragma once -#include "World/CPatterned.hpp" -#include "World/CPathFindSearch.hpp" -#include "World/CDamageInfo.hpp" +#include + +#include "Runtime/rstl.hpp" +#include "Runtime/World/CDamageInfo.hpp" +#include "Runtime/World/CPatterned.hpp" +#include "Runtime/World/CPathFindSearch.hpp" + +#include namespace urde { diff --git a/Runtime/MP1/World/CBloodFlower.cpp b/Runtime/MP1/World/CBloodFlower.cpp index 1d74d743e..3cf68d2b0 100644 --- a/Runtime/MP1/World/CBloodFlower.cpp +++ b/Runtime/MP1/World/CBloodFlower.cpp @@ -18,7 +18,7 @@ CBloodFlower::CBloodFlower(TUniqueId uid, std::string_view name, const CEntityIn : CPatterned(ECharacter::BloodFlower, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo, EMovementType::Ground, EColliderType::One, EBodyType::Restricted, actParms, EKnockBackVariant::Medium) , x568_podEffectDesc(g_SimplePool->GetObj({FOURCC('PART'), partId1})) -, x574_podEffect(new CElementGen(x568_podEffectDesc)) +, x574_podEffect(std::make_unique(x568_podEffectDesc)) , x578_projectileDesc(g_SimplePool->GetObj({FOURCC('WPSC'), wpscId1})) , x590_projectileInfo(wpscId2, dInfo1) , x5d4_visorSfx(CSfxManager::TranslateSFXID(soundId)) diff --git a/Runtime/MP1/World/CBloodFlower.hpp b/Runtime/MP1/World/CBloodFlower.hpp index 297529284..699e58af5 100644 --- a/Runtime/MP1/World/CBloodFlower.hpp +++ b/Runtime/MP1/World/CBloodFlower.hpp @@ -1,7 +1,10 @@ #pragma once -#include "Weapon/CProjectileInfo.hpp" -#include "World/CPatterned.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Weapon/CProjectileInfo.hpp" +#include "Runtime/World/CPatterned.hpp" namespace urde { class CGenDescription; diff --git a/Runtime/MP1/World/CBurrower.hpp b/Runtime/MP1/World/CBurrower.hpp index d6b96a99a..5bdabfc36 100644 --- a/Runtime/MP1/World/CBurrower.hpp +++ b/Runtime/MP1/World/CBurrower.hpp @@ -1,6 +1,6 @@ #pragma once -#include "World/CPatterned.hpp" +#include "Runtime/World/CPatterned.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/World/CChozoGhost.hpp b/Runtime/MP1/World/CChozoGhost.hpp index f34fdff43..b866cb6b3 100644 --- a/Runtime/MP1/World/CChozoGhost.hpp +++ b/Runtime/MP1/World/CChozoGhost.hpp @@ -1,8 +1,13 @@ #pragma once -#include "World/CPatterned.hpp" -#include "Weapon/CProjectileInfo.hpp" -#include "Character/CBoneTracking.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Character/CBoneTracking.hpp" +#include "Runtime/Weapon/CProjectileInfo.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include namespace urde::MP1 { class CChozoGhost : public CPatterned { diff --git a/Runtime/MP1/World/CElitePirate.hpp b/Runtime/MP1/World/CElitePirate.hpp index 8227ffbf7..0f7d31de0 100644 --- a/Runtime/MP1/World/CElitePirate.hpp +++ b/Runtime/MP1/World/CElitePirate.hpp @@ -1,8 +1,11 @@ #pragma once -#include "World/CPatterned.hpp" -#include "World/CActorParameters.hpp" -#include "World/CAnimationParameters.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CActorParameters.hpp" +#include "Runtime/World/CAnimationParameters.hpp" +#include "Runtime/World/CPatterned.hpp" namespace urde::MP1 { class CElitePirateData { diff --git a/Runtime/MP1/World/CEnergyBall.hpp b/Runtime/MP1/World/CEnergyBall.hpp index 11e3cd343..f23fc4920 100644 --- a/Runtime/MP1/World/CEnergyBall.hpp +++ b/Runtime/MP1/World/CEnergyBall.hpp @@ -1,8 +1,11 @@ #pragma once -#include "Character/CSteeringBehaviors.hpp" -#include "World/CDamageInfo.hpp" -#include "World/CPatterned.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/Character/CSteeringBehaviors.hpp" +#include "Runtime/World/CDamageInfo.hpp" +#include "Runtime/World/CPatterned.hpp" namespace urde::MP1 { class CEnergyBall : public CPatterned { diff --git a/Runtime/MP1/World/CEyeball.cpp b/Runtime/MP1/World/CEyeball.cpp index a0040f1be..761385803 100644 --- a/Runtime/MP1/World/CEyeball.cpp +++ b/Runtime/MP1/World/CEyeball.cpp @@ -6,7 +6,7 @@ #include "World/CWorld.hpp" #include "World/CGameArea.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { CEyeball::CEyeball(TUniqueId uid, std::string_view name, CPatterned::EFlavorType flavor, const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo, float attackDelay, diff --git a/Runtime/MP1/World/CEyeball.hpp b/Runtime/MP1/World/CEyeball.hpp index 3fabd721a..c0e698729 100644 --- a/Runtime/MP1/World/CEyeball.hpp +++ b/Runtime/MP1/World/CEyeball.hpp @@ -1,8 +1,13 @@ #pragma once -#include "World/CPatterned.hpp" -#include "Character/CBoneTracking.hpp" -#include "Weapon/CProjectileInfo.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CBoneTracking.hpp" +#include "Runtime/Weapon/CProjectileInfo.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include namespace urde::MP1 { class CEyeball : public CPatterned { diff --git a/Runtime/MP1/World/CFireFlea.cpp b/Runtime/MP1/World/CFireFlea.cpp index f0fdb4667..e67c5f2f1 100644 --- a/Runtime/MP1/World/CFireFlea.cpp +++ b/Runtime/MP1/World/CFireFlea.cpp @@ -3,7 +3,7 @@ #include "CStateManager.hpp" #include "CPlayerState.hpp" #include "World/CWorld.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { diff --git a/Runtime/MP1/World/CFireFlea.hpp b/Runtime/MP1/World/CFireFlea.hpp index 2fd93c16b..50b91a225 100644 --- a/Runtime/MP1/World/CFireFlea.hpp +++ b/Runtime/MP1/World/CFireFlea.hpp @@ -1,7 +1,12 @@ #pragma once -#include "World/CPatterned.hpp" -#include "World/CPathFindSearch.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/World/CPathFindSearch.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include +#include namespace urde::MP1 { class CFireFlea : public CPatterned { diff --git a/Runtime/MP1/World/CFlaahgra.cpp b/Runtime/MP1/World/CFlaahgra.cpp index 174f6d0f0..0fbb41fdd 100644 --- a/Runtime/MP1/World/CFlaahgra.cpp +++ b/Runtime/MP1/World/CFlaahgra.cpp @@ -17,7 +17,7 @@ #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { @@ -345,8 +345,9 @@ void CFlaahgra::ResetModelDataAndBodyController() { CreateShadow(true); x94_simpleShadow->SetAlwaysCalculateRadius(false); BuildBodyController(EBodyType::Restricted); - x6cc_boneTracking.reset(new CBoneTracking(*GetModelData()->GetAnimationData(), "Head_1"sv, zeus::degToRad(80.f), - zeus::degToRad(180.f), EBoneTrackingFlags::None)); + x6cc_boneTracking = + std::make_unique(*GetModelData()->GetAnimationData(), "Head_1"sv, zeus::degToRad(80.f), + zeus::degToRad(180.f), EBoneTrackingFlags::None); } void CFlaahgra::GatherAssets(CStateManager& mgr) { if (x8e4_24_loaded) @@ -488,19 +489,20 @@ void CFlaahgra::SetupCollisionManagers(CStateManager& mgr) { zeus::CVector3f oldScale = GetModelData()->GetScale(); leftArmjointList.reserve(3); AddCollisionList(skLeftArmJointList, 3, leftArmjointList); - x79c_leftArmCollision.reset( - new CCollisionActorManager(mgr, GetUniqueId(), GetAreaIdAlways(), leftArmjointList, true)); + x79c_leftArmCollision = + std::make_unique(mgr, GetUniqueId(), GetAreaIdAlways(), leftArmjointList, true); SetMaterialProperties(x79c_leftArmCollision, mgr); std::vector rightArmJointList; rightArmJointList.reserve(3); AddCollisionList(skRightArmJointList, 3, rightArmJointList); - x7a0_rightArmCollision.reset( - new CCollisionActorManager(mgr, GetUniqueId(), GetAreaIdAlways(), rightArmJointList, true)); + x7a0_rightArmCollision = + std::make_unique(mgr, GetUniqueId(), GetAreaIdAlways(), rightArmJointList, true); SetMaterialProperties(x7a0_rightArmCollision, mgr); std::vector sphereJointList; sphereJointList.reserve(5); AddSphereCollisionList(skSphereJointList, 5, sphereJointList); - x7a4_sphereCollision.reset(new CCollisionActorManager(mgr, GetUniqueId(), GetAreaIdAlways(), sphereJointList, true)); + x7a4_sphereCollision = + std::make_unique(mgr, GetUniqueId(), GetAreaIdAlways(), sphereJointList, true); SetMaterialProperties(x7a4_sphereCollision, mgr); SetupHealthInfo(mgr); SetMaterialFilter(CMaterialFilter::MakeIncludeExclude( @@ -1208,7 +1210,7 @@ CFlaahgraPlants::CFlaahgraPlants(const TToken& genDesc, const C const CDamageInfo& dInfo, const zeus::CVector3f& extents) : CActor(uid, true, "Flaahgra Plants"sv, CEntityInfo(aId, NullConnectionList), xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Projectile), actParms, kInvalidUniqueId) -, xe8_elementGen(new CElementGen(genDesc)) +, xe8_elementGen(std::make_unique(genDesc)) , xf0_ownerId(owner) , x130_obbox(xf, extents) { xe8_elementGen->SetOrientation(xf.getRotation()); diff --git a/Runtime/MP1/World/CFlaahgra.hpp b/Runtime/MP1/World/CFlaahgra.hpp index f1bcf8cf0..140cb60db 100644 --- a/Runtime/MP1/World/CFlaahgra.hpp +++ b/Runtime/MP1/World/CFlaahgra.hpp @@ -1,16 +1,27 @@ #pragma once -#include "World/CActorParameters.hpp" -#include "World/CAnimationParameters.hpp" -#include "World/CPatterned.hpp" -#include "Collision/CJointCollisionDescription.hpp" -#include "Weapon/CProjectileInfo.hpp" +#include +#include +#include + +#include "Runtime/rstl.hpp" +#include "Runtime/Collision/CJointCollisionDescription.hpp" +#include "Runtime/Weapon/CProjectileInfo.hpp" +#include "Runtime/World/CActorParameters.hpp" +#include "Runtime/World/CAnimationParameters.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include +#include +#include +#include + namespace urde { -class CCollisionActorManager; -class CGenDescription; class CBoneTracking; +class CCollisionActorManager; class CDependencyGroup; class CElementGen; +class CGenDescription; } namespace urde::MP1 { diff --git a/Runtime/MP1/World/CFlaahgraProjectile.hpp b/Runtime/MP1/World/CFlaahgraProjectile.hpp index 7939a75bf..d64028782 100644 --- a/Runtime/MP1/World/CFlaahgraProjectile.hpp +++ b/Runtime/MP1/World/CFlaahgraProjectile.hpp @@ -1,6 +1,6 @@ #pragma once -#include "Weapon/CEnergyProjectile.hpp" +#include "Runtime/Weapon/CEnergyProjectile.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/World/CFlaahgraTentacle.cpp b/Runtime/MP1/World/CFlaahgraTentacle.cpp index f1b648760..c799eed6d 100644 --- a/Runtime/MP1/World/CFlaahgraTentacle.cpp +++ b/Runtime/MP1/World/CFlaahgraTentacle.cpp @@ -3,7 +3,7 @@ #include "World/CPlayer.hpp" #include "World/CScriptTrigger.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { CFlaahgraTentacle::CFlaahgraTentacle(TUniqueId uid, std::string_view name, const CEntityInfo& info, @@ -84,15 +84,17 @@ void CFlaahgraTentacle::Think(float dt, CStateManager& mgr) { void CFlaahgraTentacle::AddSphereCollisionList(const SSphereJointInfo* sphereJoints, s32 jointCount, std::vector& outJoints) { - const CAnimData* animData = GetModelData()->GetAnimationData(); - for (u32 i = 0; i < jointCount; ++i) { - CSegId segId = animData->GetLocatorSegId(sphereJoints[i].name); - if (segId == 0xFF) + for (s32 i = 0; i < jointCount; ++i) { + const SSphereJointInfo& sphereJoint = sphereJoints[i]; + const CSegId segId = animData->GetLocatorSegId(sphereJoint.name); + + if (segId == 0xFF) { continue; - outJoints.push_back( - CJointCollisionDescription::SphereCollision(segId, sphereJoints->radius, sphereJoints->name, 10.f)); + } + + outJoints.push_back(CJointCollisionDescription::SphereCollision(segId, sphereJoint.radius, sphereJoint.name, 10.f)); } } @@ -101,7 +103,8 @@ const SSphereJointInfo CFlaahgraTentacle::skJointList[3] = {{"Arm_8", 2.f}, {"Ar void CFlaahgraTentacle::SetupCollisionManager(CStateManager& mgr) { std::vector jointList; AddSphereCollisionList(skJointList, 3, jointList); - x56c_collisionManager.reset(new CCollisionActorManager(mgr, GetUniqueId(), GetAreaIdAlways(), jointList, true)); + x56c_collisionManager = + std::make_unique(mgr, GetUniqueId(), GetAreaIdAlways(), jointList, true); for (u32 i = 0; i < x56c_collisionManager->GetNumCollisionActors(); ++i) { const CJointCollisionDescription& desc = x56c_collisionManager->GetCollisionDescFromIndex(i); diff --git a/Runtime/MP1/World/CFlaahgraTentacle.hpp b/Runtime/MP1/World/CFlaahgraTentacle.hpp index 9d4d4cbe3..0308120b5 100644 --- a/Runtime/MP1/World/CFlaahgraTentacle.hpp +++ b/Runtime/MP1/World/CFlaahgraTentacle.hpp @@ -1,7 +1,13 @@ #pragma once -#include "World/CPatterned.hpp" -#include "Collision/CCollisionActorManager.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Collision/CCollisionActorManager.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include namespace urde::MP1 { class CFlaahgraTentacle : public CPatterned { diff --git a/Runtime/MP1/World/CFlickerBat.cpp b/Runtime/MP1/World/CFlickerBat.cpp index 1eee4cb4f..b0b66c10f 100644 --- a/Runtime/MP1/World/CFlickerBat.cpp +++ b/Runtime/MP1/World/CFlickerBat.cpp @@ -4,7 +4,7 @@ #include "Camera/CGameCamera.hpp" #include "Collision/CGameCollision.hpp" #include "World/CPlayer.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { diff --git a/Runtime/MP1/World/CFlickerBat.hpp b/Runtime/MP1/World/CFlickerBat.hpp index e4439dc3c..eb6d864a3 100644 --- a/Runtime/MP1/World/CFlickerBat.hpp +++ b/Runtime/MP1/World/CFlickerBat.hpp @@ -1,6 +1,6 @@ #pragma once -#include "World/CPatterned.hpp" +#include "Runtime/World/CPatterned.hpp" namespace urde::MP1 { class CFlickerBat final : public CPatterned { diff --git a/Runtime/MP1/World/CFlyingPirate.hpp b/Runtime/MP1/World/CFlyingPirate.hpp index c156aa182..dc89c37c4 100644 --- a/Runtime/MP1/World/CFlyingPirate.hpp +++ b/Runtime/MP1/World/CFlyingPirate.hpp @@ -1,6 +1,6 @@ #pragma once -#include "World/CPatterned.hpp" +#include "Runtime/World/CPatterned.hpp" namespace urde::MP1 { class CFlyingPirate : public CPatterned { diff --git a/Runtime/MP1/World/CJellyZap.cpp b/Runtime/MP1/World/CJellyZap.cpp index 332742fab..092b4d5b8 100644 --- a/Runtime/MP1/World/CJellyZap.cpp +++ b/Runtime/MP1/World/CJellyZap.cpp @@ -1,7 +1,7 @@ #include "CJellyZap.hpp" #include "CStateManager.hpp" #include "World/CPlayer.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { const CMaterialFilter CJellyZap::kPlayerFilter = CMaterialFilter::MakeInclude({EMaterialTypes::Player}); diff --git a/Runtime/MP1/World/CJellyZap.hpp b/Runtime/MP1/World/CJellyZap.hpp index ab89025c8..664d0bdaa 100644 --- a/Runtime/MP1/World/CJellyZap.hpp +++ b/Runtime/MP1/World/CJellyZap.hpp @@ -1,6 +1,6 @@ #pragma once -#include "World/CPatterned.hpp" +#include "Runtime/World/CPatterned.hpp" namespace urde::MP1 { class CJellyZap : public CPatterned { diff --git a/Runtime/MP1/World/CMagdolite.hpp b/Runtime/MP1/World/CMagdolite.hpp index 612cab133..5c61935ab 100644 --- a/Runtime/MP1/World/CMagdolite.hpp +++ b/Runtime/MP1/World/CMagdolite.hpp @@ -1,7 +1,7 @@ #pragma once -#include "World/CPatterned.hpp" -#include "Character/CBoneTracking.hpp" +#include "Runtime/Character/CBoneTracking.hpp" +#include "Runtime/World/CPatterned.hpp" namespace urde::MP1 { class CMagdolite : public CPatterned { diff --git a/Runtime/MP1/World/CMetaree.cpp b/Runtime/MP1/World/CMetaree.cpp index 8e2b511be..89509af27 100644 --- a/Runtime/MP1/World/CMetaree.cpp +++ b/Runtime/MP1/World/CMetaree.cpp @@ -4,7 +4,7 @@ #include "CStateManager.hpp" #include "CPlayerState.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { CMetaree::CMetaree(TUniqueId uid, std::string_view name, EFlavorType flavor, const CEntityInfo& info, diff --git a/Runtime/MP1/World/CMetaree.hpp b/Runtime/MP1/World/CMetaree.hpp index 44373d479..5cd3523a5 100644 --- a/Runtime/MP1/World/CMetaree.hpp +++ b/Runtime/MP1/World/CMetaree.hpp @@ -1,9 +1,12 @@ #pragma once -#include "World/CPatterned.hpp" -#include "World/CDamageInfo.hpp" #include "DataSpec/DNAMP1/SFX/Metaree.h" +#include "Runtime/World/CDamageInfo.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include + namespace urde::MP1 { class CMetaree : public CPatterned { float x568_delay; diff --git a/Runtime/MP1/World/CMetroid.hpp b/Runtime/MP1/World/CMetroid.hpp index 212259762..d9018c6a6 100644 --- a/Runtime/MP1/World/CMetroid.hpp +++ b/Runtime/MP1/World/CMetroid.hpp @@ -1,7 +1,10 @@ #pragma once -#include "World/CPatterned.hpp" -#include "World/CAnimationParameters.hpp" +#include +#include + +#include "Runtime/World/CAnimationParameters.hpp" +#include "Runtime/World/CPatterned.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/World/CMetroidBeta.cpp b/Runtime/MP1/World/CMetroidBeta.cpp index 3dffdc048..c52a8e70f 100644 --- a/Runtime/MP1/World/CMetroidBeta.cpp +++ b/Runtime/MP1/World/CMetroidBeta.cpp @@ -51,11 +51,11 @@ CMetroidBeta::CMetroidBeta(TUniqueId uid, std::string_view name, const CEntityIn , x7fc_(g_SimplePool->GetObj({FOURCC('PART'), metroidData.xfc_})) , x808_(g_SimplePool->GetObj({FOURCC('PART'), metroidData.x100_})) , x814_(g_SimplePool->GetObj({FOURCC('PART'), metroidData.x104_})) -, x820_(new CElementGen(x7e4_)) -, x824_(new CParticleSwoosh(x7f0_, 0)) -, x828_(new CElementGen(x7fc_)) -, x82c_(new CElementGen(x808_)) -, x830_(new CElementGen(x814_)) { +, x820_(std::make_unique(x7e4_)) +, x824_(std::make_unique(x7f0_, 0)) +, x828_(std::make_unique(x7fc_)) +, x82c_(std::make_unique(x808_)) +, x830_(std::make_unique(x814_)) { x820_->SetParticleEmission(false); x828_->SetParticleEmission(false); x82c_->SetParticleEmission(false); @@ -237,7 +237,8 @@ void CMetroidBeta::CreateCollisionActorManager(CStateManager& mgr) { std::vector joints; AddSphereJoints(skPelvisInfo, 1, joints); - x764_collisionManager.reset(new CCollisionActorManager(mgr, GetUniqueId(), GetAreaIdAlways(), joints, false)); + x764_collisionManager = + std::make_unique(mgr, GetUniqueId(), GetAreaIdAlways(), joints, false); x764_collisionManager->SetActive(mgr, GetActive()); for (u32 i = 0; i < x764_collisionManager->GetNumCollisionActors(); ++i) { diff --git a/Runtime/MP1/World/CMetroidBeta.hpp b/Runtime/MP1/World/CMetroidBeta.hpp index 7b74f27a7..17386ab6e 100644 --- a/Runtime/MP1/World/CMetroidBeta.hpp +++ b/Runtime/MP1/World/CMetroidBeta.hpp @@ -1,14 +1,18 @@ #pragma once -#include -#include "World/CPathFindSearch.hpp" -#include "World/CPatterned.hpp" -#include "CRandom16.hpp" +#include + +#include "Runtime/CRandom16.hpp" +#include "Runtime/Collision/CJointCollisionDescription.hpp" +#include "Runtime/World/CPathFindSearch.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include namespace urde { +class CCollisionActorManager; class CElementGen; class CParticleSwoosh; -class CCollisionActorManager; } namespace urde::MP1 { diff --git a/Runtime/MP1/World/CMetroidPrimeExo.hpp b/Runtime/MP1/World/CMetroidPrimeExo.hpp index 58202d9dc..8a0ded221 100644 --- a/Runtime/MP1/World/CMetroidPrimeExo.hpp +++ b/Runtime/MP1/World/CMetroidPrimeExo.hpp @@ -1,11 +1,14 @@ #pragma once -#include "World/CPatterned.hpp" -#include "World/CPatternedInfo.hpp" -#include "World/CActorParameters.hpp" -#include "Camera/CCameraShakeData.hpp" -#include "Weapon/CBeamInfo.hpp" -#include "CMetroidPrimeProjectile.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Camera/CCameraShakeData.hpp" +#include "Runtime/MP1/World/CMetroidPrimeProjectile.hpp" +#include "Runtime/Weapon/CBeamInfo.hpp" +#include "Runtime/World/CActorParameters.hpp" +#include "Runtime/World/CPatterned.hpp" +#include "Runtime/World/CPatternedInfo.hpp" + +#include namespace urde { class CCameraShakeData; diff --git a/Runtime/MP1/World/CMetroidPrimeProjectile.hpp b/Runtime/MP1/World/CMetroidPrimeProjectile.hpp index 7ac76b42e..0d0db410b 100644 --- a/Runtime/MP1/World/CMetroidPrimeProjectile.hpp +++ b/Runtime/MP1/World/CMetroidPrimeProjectile.hpp @@ -1,6 +1,7 @@ #pragma once -#include "Weapon/CEnergyProjectile.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/Weapon/CEnergyProjectile.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/World/CMetroidPrimeRelay.cpp b/Runtime/MP1/World/CMetroidPrimeRelay.cpp index 16009f3b9..e55253425 100644 --- a/Runtime/MP1/World/CMetroidPrimeRelay.cpp +++ b/Runtime/MP1/World/CMetroidPrimeRelay.cpp @@ -1,5 +1,5 @@ #include "CMetroidPrimeRelay.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { diff --git a/Runtime/MP1/World/CMetroidPrimeRelay.hpp b/Runtime/MP1/World/CMetroidPrimeRelay.hpp index fd0ef2281..fe645648d 100644 --- a/Runtime/MP1/World/CMetroidPrimeRelay.hpp +++ b/Runtime/MP1/World/CMetroidPrimeRelay.hpp @@ -1,7 +1,12 @@ #pragma once -#include "World/CEntity.hpp" -#include "CMetroidPrimeExo.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/MP1/World/CMetroidPrimeExo.hpp" +#include "Runtime/World/CEntity.hpp" + +#include +#include namespace urde::MP1 { diff --git a/Runtime/MP1/World/CNewIntroBoss.cpp b/Runtime/MP1/World/CNewIntroBoss.cpp index 26b3c7cb9..78bc60734 100644 --- a/Runtime/MP1/World/CNewIntroBoss.cpp +++ b/Runtime/MP1/World/CNewIntroBoss.cpp @@ -7,7 +7,7 @@ #include "Weapon/CPlasmaProjectile.hpp" #include "World/CPlayer.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CNewIntroBoss.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/World/CNewIntroBoss.hpp b/Runtime/MP1/World/CNewIntroBoss.hpp index 19c3871f7..844d26f12 100644 --- a/Runtime/MP1/World/CNewIntroBoss.hpp +++ b/Runtime/MP1/World/CNewIntroBoss.hpp @@ -1,12 +1,18 @@ #pragma once -#include "World/CPatterned.hpp" -#include "Character/CBoneTracking.hpp" -#include "Weapon/CProjectileInfo.hpp" +#include +#include + +#include "Runtime/Character/CBoneTracking.hpp" +#include "Runtime/Weapon/CProjectileInfo.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include +#include namespace urde { -class CDamageInfo; class CCollisionActorManager; +class CDamageInfo; namespace MP1 { class CNewIntroBoss : public CPatterned { diff --git a/Runtime/MP1/World/CParasite.cpp b/Runtime/MP1/World/CParasite.cpp index 2bdd3d560..682857d10 100644 --- a/Runtime/MP1/World/CParasite.cpp +++ b/Runtime/MP1/World/CParasite.cpp @@ -8,7 +8,7 @@ #include "World/CScriptWaypoint.hpp" #include "World/CScriptDoor.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" #include "Graphics/CSkinnedModel.hpp" diff --git a/Runtime/MP1/World/CParasite.hpp b/Runtime/MP1/World/CParasite.hpp index 744e0a34a..22059d0b7 100644 --- a/Runtime/MP1/World/CParasite.hpp +++ b/Runtime/MP1/World/CParasite.hpp @@ -1,7 +1,12 @@ #pragma once -#include "World/CWallWalker.hpp" -#include "Collision/CCollisionActorManager.hpp" +#include + +#include "Runtime/Collision/CCollisionActorManager.hpp" +#include "Runtime/World/CWallWalker.hpp" + +#include + namespace urde { class CModelData; } diff --git a/Runtime/MP1/World/CPuddleSpore.cpp b/Runtime/MP1/World/CPuddleSpore.cpp index 6398908ee..6e4f8920a 100644 --- a/Runtime/MP1/World/CPuddleSpore.cpp +++ b/Runtime/MP1/World/CPuddleSpore.cpp @@ -8,7 +8,7 @@ #include "CStateManager.hpp" #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { const std::string_view CPuddleSpore::kEyeLocators[16] = { @@ -37,7 +37,7 @@ CPuddleSpore::CPuddleSpore(TUniqueId uid, std::string_view name, EFlavorType fla , x614_25(false) { x5dc_elemGens.reserve(kEyeCount); for (u32 i = 0; i < kEyeCount; ++i) - x5dc_elemGens.emplace_back(new CElementGen(x5d0_)); + x5dc_elemGens.emplace_back(std::make_unique(x5d0_)); x5ec_projectileInfo.Token().Lock(); x460_knockBackController.SetAutoResetImpulse(false); } diff --git a/Runtime/MP1/World/CPuddleSpore.hpp b/Runtime/MP1/World/CPuddleSpore.hpp index 4d3e10f79..7d5021e28 100644 --- a/Runtime/MP1/World/CPuddleSpore.hpp +++ b/Runtime/MP1/World/CPuddleSpore.hpp @@ -1,8 +1,13 @@ #pragma once -#include "World/CPatterned.hpp" -#include "Weapon/CProjectileInfo.hpp" -#include "Particle/CElementGen.hpp" +#include +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/Particle/CElementGen.hpp" +#include "Runtime/Weapon/CProjectileInfo.hpp" +#include "Runtime/World/CPatterned.hpp" namespace urde::MP1 { class CPuddleSpore : public CPatterned { diff --git a/Runtime/MP1/World/CPuddleToadGamma.cpp b/Runtime/MP1/World/CPuddleToadGamma.cpp index 6bb14a416..409661454 100644 --- a/Runtime/MP1/World/CPuddleToadGamma.cpp +++ b/Runtime/MP1/World/CPuddleToadGamma.cpp @@ -5,7 +5,7 @@ #include "World/CPlayer.hpp" #include "Collision/CGameCollision.hpp" #include "Weapon/CBomb.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { @@ -39,7 +39,7 @@ CPuddleToadGamma::CPuddleToadGamma(TUniqueId uid, std::string_view name, EFlavor SetMovable(false); if (dcln.IsValid() && g_ResFactory->GetResourceTypeById(dcln) != 0) { TLockedToken container = g_SimplePool->GetObj({FOURCC('DCLN'), dcln}); - x5e4_collisionTreePrim.reset(new CCollidableOBBTreeGroup(container.GetObj(), GetMaterialList())); + x5e4_collisionTreePrim = std::make_unique(container.GetObj(), GetMaterialList()); } } diff --git a/Runtime/MP1/World/CPuddleToadGamma.hpp b/Runtime/MP1/World/CPuddleToadGamma.hpp index e09e346c4..5ed196760 100644 --- a/Runtime/MP1/World/CPuddleToadGamma.hpp +++ b/Runtime/MP1/World/CPuddleToadGamma.hpp @@ -1,7 +1,12 @@ #pragma once -#include "World/CPatterned.hpp" -#include "Collision/CCollidableOBBTreeGroup.hpp" +#include +#include + +#include "Runtime/Collision/CCollidableOBBTreeGroup.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include namespace urde::MP1 { diff --git a/Runtime/MP1/World/CPuffer.cpp b/Runtime/MP1/World/CPuffer.cpp index 9e556e465..9e3bf11dd 100644 --- a/Runtime/MP1/World/CPuffer.cpp +++ b/Runtime/MP1/World/CPuffer.cpp @@ -5,7 +5,7 @@ #include "World/CKnockBackController.hpp" #include "World/CPlayer.hpp" #include "World/CFire.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { diff --git a/Runtime/MP1/World/CPuffer.hpp b/Runtime/MP1/World/CPuffer.hpp index 06a40dd88..533fa3e81 100644 --- a/Runtime/MP1/World/CPuffer.hpp +++ b/Runtime/MP1/World/CPuffer.hpp @@ -1,6 +1,11 @@ #pragma once -#include "World/CPatterned.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include namespace urde::MP1 { class CPuffer : public CPatterned { diff --git a/Runtime/MP1/World/CRidley.cpp b/Runtime/MP1/World/CRidley.cpp index 3b30bfc51..74d44c133 100644 --- a/Runtime/MP1/World/CRidley.cpp +++ b/Runtime/MP1/World/CRidley.cpp @@ -1,5 +1,5 @@ #include "MP1/World/CRidley.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { namespace MP1 { diff --git a/Runtime/MP1/World/CRidley.hpp b/Runtime/MP1/World/CRidley.hpp index d9db4329f..f9942705c 100644 --- a/Runtime/MP1/World/CRidley.hpp +++ b/Runtime/MP1/World/CRidley.hpp @@ -1,9 +1,11 @@ #pragma once -#include "Camera/CCameraShakeData.hpp" -#include "Weapon/CBeamInfo.hpp" -#include "World/CDamageInfo.hpp" -#include "World/CPatterned.hpp" +#include + +#include "Runtime/Camera/CCameraShakeData.hpp" +#include "Runtime/Weapon/CBeamInfo.hpp" +#include "Runtime/World/CDamageInfo.hpp" +#include "Runtime/World/CPatterned.hpp" namespace urde { namespace MP1 { diff --git a/Runtime/MP1/World/CRipper.cpp b/Runtime/MP1/World/CRipper.cpp index 775862024..61cf93e52 100644 --- a/Runtime/MP1/World/CRipper.cpp +++ b/Runtime/MP1/World/CRipper.cpp @@ -5,7 +5,7 @@ #include "World/CPlayer.hpp" #include "World/CScriptGrapplePoint.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { CRipper::CRipper(TUniqueId uid, std::string_view name, EFlavorType type, const CEntityInfo& info, diff --git a/Runtime/MP1/World/CRipper.hpp b/Runtime/MP1/World/CRipper.hpp index f928a9fc7..ccd721f67 100644 --- a/Runtime/MP1/World/CRipper.hpp +++ b/Runtime/MP1/World/CRipper.hpp @@ -1,8 +1,8 @@ #pragma once -#include "World/CPatterned.hpp" -#include "World/CGrappleParameters.hpp" -#include "World/CScriptPlatform.hpp" +#include "Runtime/World/CGrappleParameters.hpp" +#include "Runtime/World/CPatterned.hpp" +#include "Runtime/World/CScriptPlatform.hpp" namespace urde::MP1 { diff --git a/Runtime/MP1/World/CSeedling.cpp b/Runtime/MP1/World/CSeedling.cpp index 725ab3948..e22dd03a2 100644 --- a/Runtime/MP1/World/CSeedling.cpp +++ b/Runtime/MP1/World/CSeedling.cpp @@ -1,13 +1,36 @@ -#include "MP1/World/CSeedling.hpp" -#include "World/CPatternedInfo.hpp" -#include "World/CWorld.hpp" -#include "World/CGameArea.hpp" -#include "World/CPlayer.hpp" -#include "CStateManager.hpp" -#include "TCastTo.hpp" -#include "CSeedling.hpp" +#include "Runtime/MP1/World/CSeedling.hpp" + +#include + +#include "Runtime/CStateManager.hpp" +#include "Runtime/World/CGameArea.hpp" +#include "Runtime/World/CPatternedInfo.hpp" +#include "Runtime/World/CPlayer.hpp" +#include "Runtime/World/CWorld.hpp" + +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { +namespace { +constexpr std::array, 2> skNeedleLocators{{ + { + "A_spike1_LCTR_SDK", + "A_spike2_LCTR_SDK", + "A_spike3_LCTR_SDK", + "A_spike4_LCTR_SDK", + "A_spike5_LCTR_SDK", + "A_spike6_LCTR_SDK", + }, + { + "B_spike1_LCTR_SDK", + "B_spike2_LCTR_SDK", + "B_spike3_LCTR_SDK", + "B_spike4_LCTR_SDK", + "B_spike5_LCTR_SDK", + "B_spike6_LCTR_SDK", + }, +}}; +} // Anonymous namespace CSeedling::CSeedling(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms, @@ -17,7 +40,7 @@ CSeedling::CSeedling(TUniqueId uid, std::string_view name, const CEntityInfo& in EMovementType::Ground, EColliderType::Zero, EBodyType::WallWalker, actParms, f1, f2, EKnockBackVariant::Small, f3, EWalkerType::Seedling, f4, false) , x5d8_searchPath(nullptr, 1, pInfo.GetPathfindingIndex(), 1.f, 1.f) -, x6bc_spikeData(new CModelData(CStaticRes(needleId, GetModelData()->GetScale()))) +, x6bc_spikeData(std::make_unique(CStaticRes(needleId, GetModelData()->GetScale()))) , x6c0_projectileInfo(weaponId, dInfo1) , x6e8_deathDamage(dInfo2) , x722_24_renderOnlyClusterA(true) @@ -29,23 +52,6 @@ CSeedling::CSeedling(TUniqueId uid, std::string_view name, const CEntityInfo& in void CSeedling::Accept(IVisitor& visitor) { visitor.Visit(this); } -const std::string CSeedling::skNeedleLocators[2][6] = {{ - "A_spike1_LCTR_SDK", - "A_spike2_LCTR_SDK", - "A_spike3_LCTR_SDK", - "A_spike4_LCTR_SDK", - "A_spike5_LCTR_SDK", - "A_spike6_LCTR_SDK", - }, - { - "B_spike1_LCTR_SDK", - "B_spike2_LCTR_SDK", - "B_spike3_LCTR_SDK", - "B_spike4_LCTR_SDK", - "B_spike5_LCTR_SDK", - "B_spike6_LCTR_SDK", - }}; - void CSeedling::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) { CPatterned::AcceptScriptMsg(msg, uid, mgr); @@ -103,13 +109,14 @@ void CSeedling::Think(float dt, CStateManager& mgr) { void CSeedling::Render(const CStateManager& mgr) const { if (x400_25_alive && x6bc_spikeData) { - u32 index = x722_24_renderOnlyClusterA ? 0 : u32(x722_25_curNeedleCluster); + const size_t index = x722_24_renderOnlyClusterA ? 0 : size_t(x722_25_curNeedleCluster); CModelFlags flags; flags.x2_flags = 3; flags.x4_color = zeus::skWhite; - for (const std::string& sv : skNeedleLocators[index]) + for (const std::string_view sv : skNeedleLocators[index]) { x6bc_spikeData->Render(mgr, GetLctrTransform(sv), x90_actorLights.get(), flags); + } } CWallWalker::Render(mgr); @@ -202,9 +209,11 @@ bool CSeedling::ShouldAttack(CStateManager& mgr, float) { } void CSeedling::LaunchNeedles(CStateManager& mgr) { - for (const std::string& needle : skNeedleLocators[u32(x722_25_curNeedleCluster)]) - LaunchProjectile(GetLctrTransform(needle), mgr, 6, EProjectileAttrib::None, true, {}, 0xFFFF, false, - GetModelData()->GetScale()); + const auto& needleLocators = skNeedleLocators[size_t(x722_25_curNeedleCluster)]; + for (const std::string_view needle : needleLocators) { + LaunchProjectile(GetLctrTransform(needle), mgr, int(needleLocators.size()), EProjectileAttrib::None, true, {}, + 0xFFFF, false, GetModelData()->GetScale()); + } x722_25_curNeedleCluster = !x722_25_curNeedleCluster; x722_24_renderOnlyClusterA = false; diff --git a/Runtime/MP1/World/CSeedling.hpp b/Runtime/MP1/World/CSeedling.hpp index 7499670dc..0996b20f2 100644 --- a/Runtime/MP1/World/CSeedling.hpp +++ b/Runtime/MP1/World/CSeedling.hpp @@ -1,12 +1,16 @@ #pragma once -#include "World/CWallWalker.hpp" -#include "World/CPathFindSearch.hpp" -#include "Weapon/CProjectileInfo.hpp" +#include +#include + +#include "Runtime/Weapon/CProjectileInfo.hpp" +#include "Runtime/World/CPathFindSearch.hpp" +#include "Runtime/World/CWallWalker.hpp" + +#include namespace urde::MP1 { class CSeedling : public CWallWalker { - static const std::string skNeedleLocators[2][6]; CPathFindSearch x5d8_searchPath; std::unique_ptr x6bc_spikeData; CProjectileInfo x6c0_projectileInfo; diff --git a/Runtime/MP1/World/CSpacePirate.cpp b/Runtime/MP1/World/CSpacePirate.cpp index 9c1213618..66ba9efa5 100644 --- a/Runtime/MP1/World/CSpacePirate.cpp +++ b/Runtime/MP1/World/CSpacePirate.cpp @@ -15,7 +15,7 @@ #include "World/CScriptAiJumpPoint.hpp" #include "World/CWorld.hpp" #include "CMetroid.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { CSpacePirate::CSpacePirateData::CSpacePirateData(urde::CInputStream& in, u32 propCount) diff --git a/Runtime/MP1/World/CSpacePirate.hpp b/Runtime/MP1/World/CSpacePirate.hpp index 9255ea833..f351c553f 100644 --- a/Runtime/MP1/World/CSpacePirate.hpp +++ b/Runtime/MP1/World/CSpacePirate.hpp @@ -1,12 +1,18 @@ #pragma once -#include "World/CPatterned.hpp" -#include "Weapon/CProjectileInfo.hpp" -#include "Character/CBoneTracking.hpp" -#include "Character/CIkChain.hpp" -#include "Character/CRagDoll.hpp" -#include "World/CPathFindSearch.hpp" -#include "Weapon/CBurstFire.hpp" +#include +#include + +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CBoneTracking.hpp" +#include "Runtime/Character/CIkChain.hpp" +#include "Runtime/Character/CRagDoll.hpp" +#include "Runtime/Weapon/CBurstFire.hpp" +#include "Runtime/Weapon/CProjectileInfo.hpp" +#include "Runtime/World/CPathFindSearch.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include namespace urde::MP1 { class CSpacePirate; diff --git a/Runtime/MP1/World/CSpankWeed.cpp b/Runtime/MP1/World/CSpankWeed.cpp index ab4a67878..b1b59653e 100644 --- a/Runtime/MP1/World/CSpankWeed.cpp +++ b/Runtime/MP1/World/CSpankWeed.cpp @@ -76,7 +76,8 @@ void CSpankWeed::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CState joints.push_back(CJointCollisionDescription::SphereCollision(id, joint.radius, joint.name, 0.001f)); } - x594_collisionMgr.reset(new CCollisionActorManager(mgr, GetUniqueId(), GetAreaIdAlways(), joints, GetActive())); + x594_collisionMgr = + std::make_unique(mgr, GetUniqueId(), GetAreaIdAlways(), joints, GetActive()); CMaterialList list; list.Add(EMaterialTypes::CameraPassthrough); list.Add(EMaterialTypes::Immovable); diff --git a/Runtime/MP1/World/CSpankWeed.hpp b/Runtime/MP1/World/CSpankWeed.hpp index 13be1784e..9133b4a01 100644 --- a/Runtime/MP1/World/CSpankWeed.hpp +++ b/Runtime/MP1/World/CSpankWeed.hpp @@ -1,7 +1,11 @@ #pragma once -#include "World/CPatterned.hpp" -#include "Collision/CCollisionActorManager.hpp" +#include + +#include "Runtime/Collision/CCollisionActorManager.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include namespace urde::MP1 { class CSpankWeed : public CPatterned { diff --git a/Runtime/MP1/World/CThardusRockProjectile.hpp b/Runtime/MP1/World/CThardusRockProjectile.hpp index 915338b7c..c1169b559 100644 --- a/Runtime/MP1/World/CThardusRockProjectile.hpp +++ b/Runtime/MP1/World/CThardusRockProjectile.hpp @@ -1,6 +1,6 @@ #pragma once -#include "World/CPatterned.hpp" +#include "Runtime/World/CPatterned.hpp" namespace urde { diff --git a/Runtime/MP1/World/CTryclops.cpp b/Runtime/MP1/World/CTryclops.cpp index 3cddfeb70..bd0bfbb80 100644 --- a/Runtime/MP1/World/CTryclops.cpp +++ b/Runtime/MP1/World/CTryclops.cpp @@ -5,7 +5,7 @@ #include "World/CPatternedInfo.hpp" #include "World/CPlayer.hpp" #include "Weapon/CBomb.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde::MP1 { const CDamageVulnerability CTryclops::skVulnerabilities = CDamageVulnerability( diff --git a/Runtime/MP1/World/CTryclops.hpp b/Runtime/MP1/World/CTryclops.hpp index 8a9801460..b164e4753 100644 --- a/Runtime/MP1/World/CTryclops.hpp +++ b/Runtime/MP1/World/CTryclops.hpp @@ -1,7 +1,9 @@ #pragma once -#include "World/CPatterned.hpp" -#include "World/CPathFindSearch.hpp" +#include "Runtime/World/CPathFindSearch.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include namespace urde::MP1 { class CTryclops : public CPatterned { diff --git a/Runtime/MP1/World/CWarWasp.cpp b/Runtime/MP1/World/CWarWasp.cpp index 9ea9add1f..ffeaba2cf 100644 --- a/Runtime/MP1/World/CWarWasp.cpp +++ b/Runtime/MP1/World/CWarWasp.cpp @@ -1,6 +1,6 @@ #include "CWarWasp.hpp" #include "Character/CCharLayoutInfo.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "World/CPatternedInfo.hpp" #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" diff --git a/Runtime/MP1/World/CWarWasp.hpp b/Runtime/MP1/World/CWarWasp.hpp index ac6b6bc44..86cb01aaa 100644 --- a/Runtime/MP1/World/CWarWasp.hpp +++ b/Runtime/MP1/World/CWarWasp.hpp @@ -1,9 +1,12 @@ #pragma once -#include "World/CPatterned.hpp" -#include "World/CPathFindSearch.hpp" -#include "Weapon/CProjectileInfo.hpp" -#include "Collision/CCollidableSphere.hpp" +#include "Runtime/Collision/CCollidableSphere.hpp" +#include "Runtime/Weapon/CProjectileInfo.hpp" +#include "Runtime/World/CPatterned.hpp" +#include "Runtime/World/CPathFindSearch.hpp" + +#include +#include namespace urde { class CDamageInfo; diff --git a/Runtime/Particle/CColorElement.hpp b/Runtime/Particle/CColorElement.hpp index 22b82a7ff..ddd0fcc02 100644 --- a/Runtime/Particle/CColorElement.hpp +++ b/Runtime/Particle/CColorElement.hpp @@ -1,6 +1,10 @@ #pragma once -#include "IElement.hpp" +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Particle/IElement.hpp" /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Color_Elements */ diff --git a/Runtime/Particle/CDecal.hpp b/Runtime/Particle/CDecal.hpp index d51462c56..ee571a535 100644 --- a/Runtime/Particle/CDecal.hpp +++ b/Runtime/Particle/CDecal.hpp @@ -1,10 +1,12 @@ #pragma once -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "zeus/CTransform.hpp" -#include "CDecalDescription.hpp" -#include "CRandom16.hpp" +#include "Runtime/CRandom16.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Particle/CDecalDescription.hpp" + +#include +#include namespace urde { struct SQuadDescr; diff --git a/Runtime/Particle/CDecalDataFactory.hpp b/Runtime/Particle/CDecalDataFactory.hpp index 0e27f8c9f..c16547dab 100644 --- a/Runtime/Particle/CDecalDataFactory.hpp +++ b/Runtime/Particle/CDecalDataFactory.hpp @@ -1,11 +1,11 @@ #pragma once -#include "RetroTypes.hpp" -#include "CFactoryMgr.hpp" -#include "IObj.hpp" -#include "CToken.hpp" -#include "IOStreams.hpp" -#include "CDecalDescription.hpp" +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/IObj.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Particle/CDecalDescription.hpp" namespace urde { class CSimplePool; diff --git a/Runtime/Particle/CDecalDescription.hpp b/Runtime/Particle/CDecalDescription.hpp index 105b70409..ff1d74afa 100644 --- a/Runtime/Particle/CDecalDescription.hpp +++ b/Runtime/Particle/CDecalDescription.hpp @@ -1,11 +1,13 @@ #pragma once -#include "CRealElement.hpp" -#include "CIntElement.hpp" -#include "CVectorElement.hpp" -#include "CColorElement.hpp" -#include "CUVElement.hpp" -#include "CParticleDataFactory.hpp" +#include + +#include "Runtime/Particle/CColorElement.hpp" +#include "Runtime/Particle/CIntElement.hpp" +#include "Runtime/Particle/CParticleDataFactory.hpp" +#include "Runtime/Particle/CRealElement.hpp" +#include "Runtime/Particle/CUVElement.hpp" +#include "Runtime/Particle/CVectorElement.hpp" namespace urde { diff --git a/Runtime/Particle/CDecalManager.hpp b/Runtime/Particle/CDecalManager.hpp index caad41743..1af0430c1 100644 --- a/Runtime/Particle/CDecalManager.hpp +++ b/Runtime/Particle/CDecalManager.hpp @@ -1,11 +1,12 @@ #pragma once -#include "RetroTypes.hpp" -#include "rstl.hpp" #include -#include "CToken.hpp" -#include "CDecal.hpp" -#include "zeus/CFrustum.hpp" + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Particle/CDecal.hpp" +#include namespace urde { class CStateManager; diff --git a/Runtime/Particle/CElectricDescription.hpp b/Runtime/Particle/CElectricDescription.hpp index f8318f582..54580af28 100644 --- a/Runtime/Particle/CElectricDescription.hpp +++ b/Runtime/Particle/CElectricDescription.hpp @@ -1,12 +1,14 @@ #pragma once -#include "CParticleDataFactory.hpp" -#include "CRealElement.hpp" -#include "CIntElement.hpp" -#include "CVectorElement.hpp" -#include "CModVectorElement.hpp" -#include "CColorElement.hpp" -#include "CUVElement.hpp" +#include + +#include "Runtime/Particle/CColorElement.hpp" +#include "Runtime/Particle/CIntElement.hpp" +#include "Runtime/Particle/CModVectorElement.hpp" +#include "Runtime/Particle/CParticleDataFactory.hpp" +#include "Runtime/Particle/CRealElement.hpp" +#include "Runtime/Particle/CUVElement.hpp" +#include "Runtime/Particle/CVectorElement.hpp" namespace urde { class CElectricDescription { diff --git a/Runtime/Particle/CElementGen.cpp b/Runtime/Particle/CElementGen.cpp index 0923e61c2..5be66f87d 100644 --- a/Runtime/Particle/CElementGen.cpp +++ b/Runtime/Particle/CElementGen.cpp @@ -567,8 +567,8 @@ void CElementGen::UpdatePSTranslationAndOrientation() { } std::unique_ptr CElementGen::ConstructChildParticleSystem(const TToken& desc) const { - CElementGen* ret = new CElementGen(desc, EModelOrientationType::Normal, - x26d_27_enableOPTS ? EOptionalSystemFlags::Two : EOptionalSystemFlags::One); + auto ret = std::make_unique(desc, EModelOrientationType::Normal, + x26d_27_enableOPTS ? EOptionalSystemFlags::Two : EOptionalSystemFlags::One); ret->x26d_26_modelsUseLights = x26d_26_modelsUseLights; ret->SetGlobalTranslation(xe8_globalTranslation); ret->SetGlobalOrientation(x22c_globalOrientation); @@ -578,7 +578,7 @@ std::unique_ptr CElementGen::ConstructChildParticleSystem(const TT ret->SetOrientation(x1d8_orientation); ret->SetParticleEmission(x88_particleEmission); ret->SetModulationColor(x338_moduColor); - return std::unique_ptr(ret); + return ret; } void CElementGen::UpdateChildParticleSystems(double dt) { diff --git a/Runtime/Particle/CElementGen.hpp b/Runtime/Particle/CElementGen.hpp index 1c64ce375..f88609c12 100644 --- a/Runtime/Particle/CElementGen.hpp +++ b/Runtime/Particle/CElementGen.hpp @@ -1,18 +1,22 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CTransform.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CAABox.hpp" -#include "CToken.hpp" -#include "Graphics/CLight.hpp" -#include "Graphics/CGraphics.hpp" -#include "CRandom16.hpp" -#include "CParticleGen.hpp" -#include "Graphics/Shaders/CElementGenShaders.hpp" -#include "Graphics/CLineRenderer.hpp" -#include "Particle/CGenDescription.hpp" +#include +#include + +#include "Runtime/CRandom16.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/CGraphics.hpp" +#include "Runtime/Graphics/CLight.hpp" +#include "Runtime/Graphics/CLineRenderer.hpp" +#include "Runtime/Graphics/Shaders/CElementGenShaders.hpp" +#include "Runtime/Particle/CGenDescription.hpp" +#include "Runtime/Particle/CParticleGen.hpp" + +#include +#include +#include +#include namespace urde { class CWarp; diff --git a/Runtime/Particle/CEmitterElement.hpp b/Runtime/Particle/CEmitterElement.hpp index 93f1e3cfa..454be10d4 100644 --- a/Runtime/Particle/CEmitterElement.hpp +++ b/Runtime/Particle/CEmitterElement.hpp @@ -1,6 +1,7 @@ #pragma once -#include "IElement.hpp" +#include +#include "Runtime/Particle/IElement.hpp" /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Emitter_Elements */ diff --git a/Runtime/Particle/CFlameWarp.hpp b/Runtime/Particle/CFlameWarp.hpp index a3e2d364a..48faca6fb 100644 --- a/Runtime/Particle/CFlameWarp.hpp +++ b/Runtime/Particle/CFlameWarp.hpp @@ -1,6 +1,10 @@ #pragma once -#include "CWarp.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Particle/CWarp.hpp" + +#include +#include namespace urde { class CStateManager; diff --git a/Runtime/Particle/CGenDescription.hpp b/Runtime/Particle/CGenDescription.hpp index 8fe04e09d..f2eef1c3e 100644 --- a/Runtime/Particle/CGenDescription.hpp +++ b/Runtime/Particle/CGenDescription.hpp @@ -1,15 +1,16 @@ #pragma once #include -#include "CRealElement.hpp" -#include "CIntElement.hpp" -#include "CVectorElement.hpp" -#include "CModVectorElement.hpp" -#include "CColorElement.hpp" -#include "CUVElement.hpp" -#include "CEmitterElement.hpp" -#include "CSpawnSystemKeyframeData.hpp" -#include "CParticleDataFactory.hpp" + +#include "Runtime/Particle/CColorElement.hpp" +#include "Runtime/Particle/CEmitterElement.hpp" +#include "Runtime/Particle/CIntElement.hpp" +#include "Runtime/Particle/CModVectorElement.hpp" +#include "Runtime/Particle/CParticleDataFactory.hpp" +#include "Runtime/Particle/CRealElement.hpp" +#include "Runtime/Particle/CSpawnSystemKeyframeData.hpp" +#include "Runtime/Particle/CUVElement.hpp" +#include "Runtime/Particle/CVectorElement.hpp" /* Documentation at: http://www.metroid2002.com/retromodding/wiki/PART_(File_Format) */ diff --git a/Runtime/Particle/CIntElement.hpp b/Runtime/Particle/CIntElement.hpp index a58460f9a..51bf481c1 100644 --- a/Runtime/Particle/CIntElement.hpp +++ b/Runtime/Particle/CIntElement.hpp @@ -1,6 +1,9 @@ #pragma once -#include "IElement.hpp" +#include +#include + +#include "Runtime/Particle/IElement.hpp" /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Int_Elements */ diff --git a/Runtime/Particle/CModVectorElement.hpp b/Runtime/Particle/CModVectorElement.hpp index 6e01908f4..18a661540 100644 --- a/Runtime/Particle/CModVectorElement.hpp +++ b/Runtime/Particle/CModVectorElement.hpp @@ -1,6 +1,7 @@ #pragma once -#include "IElement.hpp" +#include +#include "Runtime/Particle/IElement.hpp" /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Mod_Vector_Elements */ diff --git a/Runtime/Particle/CParticleDataFactory.cpp b/Runtime/Particle/CParticleDataFactory.cpp index cbefdcd06..83f761b96 100644 --- a/Runtime/Particle/CParticleDataFactory.cpp +++ b/Runtime/Particle/CParticleDataFactory.cpp @@ -761,7 +761,7 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i FourCC cid = GetClassID(in); if (cid != SBIG('CNST')) break; - fillDesc->xd0_xbc_KSSM.reset(new CSpawnSystemKeyframeData(in)); + fillDesc->xd0_xbc_KSSM = std::make_unique(in); fillDesc->xd0_xbc_KSSM->LoadAllSpawnedSystemTokens(resPool); break; } diff --git a/Runtime/Particle/CParticleDataFactory.hpp b/Runtime/Particle/CParticleDataFactory.hpp index 857194be0..281e6ff19 100644 --- a/Runtime/Particle/CParticleDataFactory.hpp +++ b/Runtime/Particle/CParticleDataFactory.hpp @@ -1,25 +1,28 @@ #pragma once -#include "RetroTypes.hpp" -#include "CFactoryMgr.hpp" -#include "IObj.hpp" -#include "CToken.hpp" -#include "IOStreams.hpp" +#include +#include + +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/IObj.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { -class CGenDescription; -class CSwooshDescription; -class CElectricDescription; -class CSimplePool; -class CVParamTransfer; -class CModel; -class CUVElement; class CColorElement; -class CModVectorElement; +class CElectricDescription; class CEmitterElement; -class CVectorElement; -class CRealElement; +class CGenDescription; class CIntElement; +class CModVectorElement; +class CModel; +class CRealElement; +class CSimplePool; +class CSwooshDescription; +class CUVElement; +class CVParamTransfer; +class CVectorElement; struct SParticleModel { TLockedToken m_token; diff --git a/Runtime/Particle/CParticleElectric.hpp b/Runtime/Particle/CParticleElectric.hpp index 22e8cb04e..9cc421928 100644 --- a/Runtime/Particle/CParticleElectric.hpp +++ b/Runtime/Particle/CParticleElectric.hpp @@ -1,14 +1,25 @@ #pragma once -#include "CParticleGen.hpp" -#include "CToken.hpp" -#include "CRandom16.hpp" -#include "Graphics/CLineRenderer.hpp" +#include +#include +#include +#include + +#include "Runtime/CRandom16.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Graphics/CLineRenderer.hpp" +#include "Runtime/Particle/CParticleGen.hpp" + +#include +#include +#include +#include namespace urde { class CElectricDescription; -class CParticleSwoosh; class CElementGen; +class CParticleSwoosh; class CParticleElectric : public CParticleGen { static u16 g_GlobalSeed; diff --git a/Runtime/Particle/CParticleElectricDataFactory.hpp b/Runtime/Particle/CParticleElectricDataFactory.hpp index 96f53a40e..e71fc4609 100644 --- a/Runtime/Particle/CParticleElectricDataFactory.hpp +++ b/Runtime/Particle/CParticleElectricDataFactory.hpp @@ -1,10 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "CFactoryMgr.hpp" -#include "IObj.hpp" -#include "CToken.hpp" -#include "IOStreams.hpp" +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/IObj.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { class CElectricDescription; diff --git a/Runtime/Particle/CParticleGen.hpp b/Runtime/Particle/CParticleGen.hpp index fee3a6ff2..925f1e80c 100644 --- a/Runtime/Particle/CParticleGen.hpp +++ b/Runtime/Particle/CParticleGen.hpp @@ -1,12 +1,15 @@ #pragma once -#include "RetroTypes.hpp" -#include "Graphics/CLight.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/CTransform.hpp" -#include "zeus/CAABox.hpp" #include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/CLight.hpp" + +#include +#include +#include +#include namespace urde { class CWarp; diff --git a/Runtime/Particle/CParticleGlobals.hpp b/Runtime/Particle/CParticleGlobals.hpp index 281877cdd..83233dd05 100644 --- a/Runtime/Particle/CParticleGlobals.hpp +++ b/Runtime/Particle/CParticleGlobals.hpp @@ -1,11 +1,14 @@ #pragma once -#include "zeus/CVector3f.hpp" -#include "zeus/CVector4f.hpp" -#include "zeus/CMatrix4f.hpp" -#include "zeus/CColor.hpp" -#include "RetroTypes.hpp" #include +#include + +#include "Runtime/RetroTypes.hpp" + +#include +#include +#include +#include namespace urde { class CElementGen; diff --git a/Runtime/Particle/CParticleSwoosh.hpp b/Runtime/Particle/CParticleSwoosh.hpp index 46c85b7c1..a2680198a 100644 --- a/Runtime/Particle/CParticleSwoosh.hpp +++ b/Runtime/Particle/CParticleSwoosh.hpp @@ -1,13 +1,21 @@ #pragma once -#include "CParticleGen.hpp" -#include "CToken.hpp" -#include "CRandom16.hpp" -#include "Graphics/CTexture.hpp" -#include "Graphics/CLineRenderer.hpp" -#include "CUVElement.hpp" +#include +#include + #include "DataSpec/DNACommon/GX.hpp" -#include "Graphics/Shaders/CParticleSwooshShaders.hpp" + +#include "Runtime/CRandom16.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/Graphics/CLineRenderer.hpp" +#include "Runtime/Graphics/CTexture.hpp" +#include "Runtime/Graphics/Shaders/CParticleSwooshShaders.hpp" +#include "Runtime/Particle/CParticleGen.hpp" +#include "Runtime/Particle/CUVElement.hpp" + +#include +#include +#include namespace urde { class CSwooshDescription; diff --git a/Runtime/Particle/CParticleSwooshDataFactory.hpp b/Runtime/Particle/CParticleSwooshDataFactory.hpp index c23432f6c..d55d5ab05 100644 --- a/Runtime/Particle/CParticleSwooshDataFactory.hpp +++ b/Runtime/Particle/CParticleSwooshDataFactory.hpp @@ -1,10 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "CFactoryMgr.hpp" -#include "IObj.hpp" -#include "CToken.hpp" -#include "IOStreams.hpp" +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/IObj.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { class CSwooshDescription; diff --git a/Runtime/Particle/CProjectileWeaponDataFactory.hpp b/Runtime/Particle/CProjectileWeaponDataFactory.hpp index 5299b717a..88d920209 100644 --- a/Runtime/Particle/CProjectileWeaponDataFactory.hpp +++ b/Runtime/Particle/CProjectileWeaponDataFactory.hpp @@ -1,10 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "CFactoryMgr.hpp" -#include "IObj.hpp" -#include "CToken.hpp" -#include "IOStreams.hpp" +#include "Runtime/CFactoryMgr.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/IObj.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { class CWeaponDescription; diff --git a/Runtime/Particle/CRealElement.hpp b/Runtime/Particle/CRealElement.hpp index dad6d1daf..da88cceb1 100644 --- a/Runtime/Particle/CRealElement.hpp +++ b/Runtime/Particle/CRealElement.hpp @@ -1,6 +1,10 @@ #pragma once -#include "IElement.hpp" +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Particle/IElement.hpp" /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Real_Elements */ diff --git a/Runtime/Particle/CSpawnSystemKeyframeData.hpp b/Runtime/Particle/CSpawnSystemKeyframeData.hpp index af6f7d22f..f30d580e7 100644 --- a/Runtime/Particle/CSpawnSystemKeyframeData.hpp +++ b/Runtime/Particle/CSpawnSystemKeyframeData.hpp @@ -1,7 +1,11 @@ #pragma once -#include "IOStreams.hpp" -#include "CToken.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { class CSimplePool; diff --git a/Runtime/Particle/CSwooshDescription.hpp b/Runtime/Particle/CSwooshDescription.hpp index 67dda3a90..084ac1971 100644 --- a/Runtime/Particle/CSwooshDescription.hpp +++ b/Runtime/Particle/CSwooshDescription.hpp @@ -1,12 +1,15 @@ #pragma once -#include "CParticleDataFactory.hpp" -#include "CRealElement.hpp" -#include "CIntElement.hpp" -#include "CVectorElement.hpp" -#include "CModVectorElement.hpp" -#include "CColorElement.hpp" -#include "CUVElement.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Particle/CColorElement.hpp" +#include "Runtime/Particle/CIntElement.hpp" +#include "Runtime/Particle/CModVectorElement.hpp" +#include "Runtime/Particle/CParticleDataFactory.hpp" +#include "Runtime/Particle/CRealElement.hpp" +#include "Runtime/Particle/CUVElement.hpp" +#include "Runtime/Particle/CVectorElement.hpp" namespace urde { class CSwooshDescription { diff --git a/Runtime/Particle/CUVElement.hpp b/Runtime/Particle/CUVElement.hpp index 0c8b052f4..b051bae21 100644 --- a/Runtime/Particle/CUVElement.hpp +++ b/Runtime/Particle/CUVElement.hpp @@ -1,8 +1,12 @@ #pragma once -#include "IElement.hpp" -#include "CToken.hpp" -#include "Graphics/CTexture.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/CTexture.hpp" +#include "Runtime/Particle/IElement.hpp" /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#UV_Elements */ diff --git a/Runtime/Particle/CVectorElement.hpp b/Runtime/Particle/CVectorElement.hpp index cda30aba4..0fae082df 100644 --- a/Runtime/Particle/CVectorElement.hpp +++ b/Runtime/Particle/CVectorElement.hpp @@ -1,6 +1,12 @@ #pragma once -#include "IElement.hpp" +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Particle/IElement.hpp" + +#include /* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Vector_Elements */ diff --git a/Runtime/Particle/CWarp.hpp b/Runtime/Particle/CWarp.hpp index 92614a7a0..cbb0d4a09 100644 --- a/Runtime/Particle/CWarp.hpp +++ b/Runtime/Particle/CWarp.hpp @@ -1,9 +1,9 @@ #pragma once -#include "zeus/CColor.hpp" -#include "zeus/CVector3f.hpp" -#include "RetroTypes.hpp" -#include "CParticleGen.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Particle/CParticleGen.hpp" namespace urde { diff --git a/Runtime/Particle/CWeaponDescription.hpp b/Runtime/Particle/CWeaponDescription.hpp index 9fb14e4a0..b6a1c2852 100644 --- a/Runtime/Particle/CWeaponDescription.hpp +++ b/Runtime/Particle/CWeaponDescription.hpp @@ -1,11 +1,14 @@ #pragma once -#include "CParticleDataFactory.hpp" -#include "CRealElement.hpp" -#include "CIntElement.hpp" -#include "CVectorElement.hpp" -#include "CModVectorElement.hpp" -#include "CColorElement.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Particle/CColorElement.hpp" +#include "Runtime/Particle/CIntElement.hpp" +#include "Runtime/Particle/CModVectorElement.hpp" +#include "Runtime/Particle/CParticleDataFactory.hpp" +#include "Runtime/Particle/CRealElement.hpp" +#include "Runtime/Particle/CVectorElement.hpp" namespace urde { class CCollisionResponseData; diff --git a/Runtime/Particle/IElement.hpp b/Runtime/Particle/IElement.hpp index 1fbb3d928..e7cecd29a 100644 --- a/Runtime/Particle/IElement.hpp +++ b/Runtime/Particle/IElement.hpp @@ -1,10 +1,12 @@ #pragma once #include -#include "GCNTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/CColor.hpp" -#include "IOStreams.hpp" + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/IOStreams.hpp" + +#include +#include namespace urde { diff --git a/Runtime/RetroTypes.hpp b/Runtime/RetroTypes.hpp index 730fbef3e..45bdd26ad 100644 --- a/Runtime/RetroTypes.hpp +++ b/Runtime/RetroTypes.hpp @@ -1,18 +1,21 @@ #pragma once -#include -#include -#include #include -#include "GCNTypes.hpp" -#include "rstl.hpp" -#include "IOStreams.hpp" -#include "hecl/hecl.hpp" -#include "zeus/CVector3f.hpp" -#include "zeus/CVector2f.hpp" -#include "zeus/CMatrix3f.hpp" -#include "zeus/CMatrix4f.hpp" -#include "zeus/CTransform.hpp" +#include +#include +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/rstl.hpp" + +#include +#include +#include +#include +#include +#include #undef min #undef max diff --git a/Runtime/Weapon/CAuxWeapon.hpp b/Runtime/Weapon/CAuxWeapon.hpp index 165a0cfbc..05bb59a23 100644 --- a/Runtime/Weapon/CAuxWeapon.hpp +++ b/Runtime/Weapon/CAuxWeapon.hpp @@ -1,10 +1,13 @@ #pragma once -#include "CPlayerState.hpp" -#include "RetroTypes.hpp" -#include "CStateManager.hpp" -#include "CGunWeapon.hpp" -#include "CWeapon.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/CPlayerState.hpp" +#include "Runtime/CStateManager.hpp" +#include "Runtime/Weapon/CGunWeapon.hpp" +#include "Runtime/Weapon/CWeapon.hpp" namespace urde { diff --git a/Runtime/Weapon/CBeamInfo.hpp b/Runtime/Weapon/CBeamInfo.hpp index f374aefef..d87971799 100644 --- a/Runtime/Weapon/CBeamInfo.hpp +++ b/Runtime/Weapon/CBeamInfo.hpp @@ -1,8 +1,8 @@ #pragma once -#include "RetroTypes.hpp" -#include "IOStreams.hpp" -#include "zeus/CColor.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/RetroTypes.hpp" +#include namespace urde { class CBeamInfo { diff --git a/Runtime/Weapon/CBeamProjectile.cpp b/Runtime/Weapon/CBeamProjectile.cpp index 4b75325f7..00bea7d88 100644 --- a/Runtime/Weapon/CBeamProjectile.cpp +++ b/Runtime/Weapon/CBeamProjectile.cpp @@ -1,5 +1,5 @@ #include "Weapon/CBeamProjectile.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" namespace urde { diff --git a/Runtime/Weapon/CBeamProjectile.hpp b/Runtime/Weapon/CBeamProjectile.hpp index a9fcf573c..775cb2a4a 100644 --- a/Runtime/Weapon/CBeamProjectile.hpp +++ b/Runtime/Weapon/CBeamProjectile.hpp @@ -1,6 +1,12 @@ #pragma once -#include "Weapon/CGameProjectile.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Weapon/CGameProjectile.hpp" + +#include +#include +#include + namespace urde { class CBeamProjectile : public CGameProjectile { public: diff --git a/Runtime/Weapon/CBomb.cpp b/Runtime/Weapon/CBomb.cpp index a6b83a790..cfddc723d 100644 --- a/Runtime/Weapon/CBomb.cpp +++ b/Runtime/Weapon/CBomb.cpp @@ -5,7 +5,7 @@ #include "GameGlobalObjects.hpp" #include "Graphics/CBooRenderer.hpp" #include "World/CGameLight.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "DataSpec/DNAMP1/SFX/Weapons.h" namespace urde { @@ -20,10 +20,10 @@ CBomb::CBomb(const TCachedToken& particle1, const TCachedToken< {EMaterialTypes::Projectile, EMaterialTypes::Bomb}, dInfo, EProjectileAttrib::Bombs, CModelData::CModelDataNull()) , x17c_fuseTime(f1) -, x180_particle1( - new CElementGen(particle1, CElementGen::EModelOrientationType::Normal, CElementGen::EOptionalSystemFlags::One)) -, x184_particle2( - new CElementGen(particle2, CElementGen::EModelOrientationType::Normal, CElementGen::EOptionalSystemFlags::One)) +, x180_particle1(std::make_unique(particle1, CElementGen::EModelOrientationType::Normal, + CElementGen::EOptionalSystemFlags::One)) +, x184_particle2(std::make_unique(particle2, CElementGen::EModelOrientationType::Normal, + CElementGen::EOptionalSystemFlags::One)) , x18c_particle2Obj(particle2.GetObj()) , x190_24_isNotDetonated(true) , x190_25_beingDragged(false) diff --git a/Runtime/Weapon/CBomb.hpp b/Runtime/Weapon/CBomb.hpp index c3c6f2aea..bde620c07 100644 --- a/Runtime/Weapon/CBomb.hpp +++ b/Runtime/Weapon/CBomb.hpp @@ -1,7 +1,13 @@ #pragma once -#include "CWeapon.hpp" -#include "CToken.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/Weapon/CWeapon.hpp" + +#include +#include namespace urde { diff --git a/Runtime/Weapon/CBurstFire.cpp b/Runtime/Weapon/CBurstFire.cpp index c90105271..4c6ccd739 100644 --- a/Runtime/Weapon/CBurstFire.cpp +++ b/Runtime/Weapon/CBurstFire.cpp @@ -1,5 +1,12 @@ -#include "CBurstFire.hpp" -#include "GameGlobalObjects.hpp" +#include "Runtime/Weapon/CBurstFire.hpp" + +#include +#include + +#include "Runtime/GameGlobalObjects.hpp" +#include "Runtime/CStateManager.hpp" + +#include namespace urde { CBurstFire::CBurstFire(const SBurst** burstDefs, s32 firstBurstCount) : x10_firstBurstCounter(firstBurstCount) { diff --git a/Runtime/Weapon/CBurstFire.hpp b/Runtime/Weapon/CBurstFire.hpp index d2d986629..2c6a75f1b 100644 --- a/Runtime/Weapon/CBurstFire.hpp +++ b/Runtime/Weapon/CBurstFire.hpp @@ -1,11 +1,18 @@ #pragma once -#include "CStateManager.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/rstl.hpp" + +#include namespace urde { +class CStateManager; + struct SBurst { s32 x0_randomSelectionWeight; - s32 x4_shotAngles[8]; + std::array x4_shotAngles; float x24_timeToNextShot; float x28_timeToNextShotVariance; }; diff --git a/Runtime/Weapon/CElectricBeamProjectile.cpp b/Runtime/Weapon/CElectricBeamProjectile.cpp index ec0892799..c0ead79fa 100644 --- a/Runtime/Weapon/CElectricBeamProjectile.cpp +++ b/Runtime/Weapon/CElectricBeamProjectile.cpp @@ -6,7 +6,7 @@ #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CElectricBeamProjectile::CElectricBeamProjectile(const TToken& wDesc, EWeaponType wType, @@ -15,9 +15,9 @@ CElectricBeamProjectile::CElectricBeamProjectile(const TToken(elec.x0_electricDescription)) , x46c_genDescription(g_SimplePool->GetObj({SBIG('PART'), elec.x14_particleId})) -, x478_elementGen(new CElementGen(x46c_genDescription)) +, x478_elementGen(std::make_unique(x46c_genDescription)) , x47c_(elec.x18_) , x488_(elec.x1c_) { x478_elementGen->SetParticleEmission(false); diff --git a/Runtime/Weapon/CElectricBeamProjectile.hpp b/Runtime/Weapon/CElectricBeamProjectile.hpp index e89dc18d1..ce6c506e1 100644 --- a/Runtime/Weapon/CElectricBeamProjectile.hpp +++ b/Runtime/Weapon/CElectricBeamProjectile.hpp @@ -1,6 +1,8 @@ #pragma once -#include "CBeamProjectile.hpp" +#include + +#include "Runtime/Weapon/CBeamProjectile.hpp" namespace urde { struct SElectricBeamInfo { diff --git a/Runtime/Weapon/CEnergyProjectile.cpp b/Runtime/Weapon/CEnergyProjectile.cpp index 7098b2dfe..ccd459c35 100644 --- a/Runtime/Weapon/CEnergyProjectile.cpp +++ b/Runtime/Weapon/CEnergyProjectile.cpp @@ -10,7 +10,7 @@ #include "World/CScriptPlatform.hpp" #include "World/CIceImpact.hpp" #include "CSimplePool.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/Weapon/CFidget.hpp b/Runtime/Weapon/CFidget.hpp index 13792cdea..5158221b4 100644 --- a/Runtime/Weapon/CFidget.hpp +++ b/Runtime/Weapon/CFidget.hpp @@ -1,7 +1,7 @@ #pragma once -#include "RetroTypes.hpp" -#include "CGunMotion.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Weapon/CGunMotion.hpp" namespace urde { class CStateManager; diff --git a/Runtime/Weapon/CFlameInfo.hpp b/Runtime/Weapon/CFlameInfo.hpp index 4c5cf7f51..03f754264 100644 --- a/Runtime/Weapon/CFlameInfo.hpp +++ b/Runtime/Weapon/CFlameInfo.hpp @@ -1,6 +1,6 @@ #pragma once -#include "Weapon/CGameProjectile.hpp" +#include "Runtime/Weapon/CGameProjectile.hpp" namespace urde { class CFlameInfo { diff --git a/Runtime/Weapon/CFlameThrower.cpp b/Runtime/Weapon/CFlameThrower.cpp index f882c2554..5c78ccf3e 100644 --- a/Runtime/Weapon/CFlameThrower.cpp +++ b/Runtime/Weapon/CFlameThrower.cpp @@ -8,7 +8,7 @@ #include "CStateManager.hpp" #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CFlameThrower.hpp" namespace urde { @@ -24,7 +24,7 @@ CFlameThrower::CFlameThrower(const TToken& wDesc, std::strin , x2e8_flameXf(xf) , x338_(flameInfo.x10_) , x33c_flameDesc(g_SimplePool->GetObj({FOURCC('PART'), flameInfo.GetFlameFxId()})) -, x348_flameGen(new CElementGen(x33c_flameDesc)) +, x348_flameGen(std::make_unique(x33c_flameDesc)) , x34c_flameWarp(176.f - float(flameInfo.GetLength()), xf.origin, bool(flameInfo.GetAttributes() & 0x4)) , x3f4_playerSteamTxtr(playerSteamTxtr) , x3f8_playerHitSfx(playerHitSfx) @@ -80,7 +80,7 @@ void CFlameThrower::Fire(const zeus::CTransform&, CStateManager& mgr, bool) { void CFlameThrower::CreateFlameParticles(CStateManager& mgr) { DeleteProjectileLight(mgr); - x348_flameGen.reset(new CElementGen(x33c_flameDesc)); + x348_flameGen = std::make_unique(x33c_flameDesc); x348_flameGen->SetParticleEmission(true); x348_flameGen->SetZTest(x400_27_coneCollision); x348_flameGen->AddModifier(&x34c_flameWarp); diff --git a/Runtime/Weapon/CFlameThrower.hpp b/Runtime/Weapon/CFlameThrower.hpp index 9d7a6462e..10e846e2f 100644 --- a/Runtime/Weapon/CFlameThrower.hpp +++ b/Runtime/Weapon/CFlameThrower.hpp @@ -1,7 +1,9 @@ #pragma once -#include "Weapon/CGameProjectile.hpp" -#include "Particle/CFlameWarp.hpp" +#include + +#include "Runtime/Particle/CFlameWarp.hpp" +#include "Runtime/Weapon/CGameProjectile.hpp" namespace urde { class CFlameInfo; diff --git a/Runtime/Weapon/CGSComboFire.hpp b/Runtime/Weapon/CGSComboFire.hpp index 5dbb1f390..bdac15732 100644 --- a/Runtime/Weapon/CGSComboFire.hpp +++ b/Runtime/Weapon/CGSComboFire.hpp @@ -1,6 +1,6 @@ #pragma once -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { diff --git a/Runtime/Weapon/CGSFidget.hpp b/Runtime/Weapon/CGSFidget.hpp index f034dcc2a..1317089be 100644 --- a/Runtime/Weapon/CGSFidget.hpp +++ b/Runtime/Weapon/CGSFidget.hpp @@ -1,7 +1,9 @@ #pragma once -#include "RetroTypes.hpp" -#include "CToken.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { class CAnimData; diff --git a/Runtime/Weapon/CGSFreeLook.hpp b/Runtime/Weapon/CGSFreeLook.hpp index 55e2daca3..b7e53d8ef 100644 --- a/Runtime/Weapon/CGSFreeLook.hpp +++ b/Runtime/Weapon/CGSFreeLook.hpp @@ -1,6 +1,6 @@ #pragma once -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { diff --git a/Runtime/Weapon/CGameProjectile.cpp b/Runtime/Weapon/CGameProjectile.cpp index 8e34e6d0f..77c914c6c 100644 --- a/Runtime/Weapon/CGameProjectile.cpp +++ b/Runtime/Weapon/CGameProjectile.cpp @@ -1,7 +1,7 @@ #include "Weapon/CGameProjectile.hpp" #include "World/CGameLight.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "World/CPlayer.hpp" #include "World/CHUDBillboardEffect.hpp" #include "World/CWallCrawlerSwarm.hpp" diff --git a/Runtime/Weapon/CGameProjectile.hpp b/Runtime/Weapon/CGameProjectile.hpp index c62d2b3df..31f482089 100644 --- a/Runtime/Weapon/CGameProjectile.hpp +++ b/Runtime/Weapon/CGameProjectile.hpp @@ -1,13 +1,19 @@ #pragma once -#include "Collision/CMaterialList.hpp" -#include "Weapon/CWeaponMode.hpp" -#include "Weapon/CWeapon.hpp" -#include "World/CDamageInfo.hpp" -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "Weapon/CProjectileWeapon.hpp" -#include "Collision/CRayCastResult.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Collision/CMaterialList.hpp" +#include "Runtime/Collision/CRayCastResult.hpp" +#include "Runtime/Weapon/CProjectileWeapon.hpp" +#include "Runtime/Weapon/CWeapon.hpp" +#include "Runtime/Weapon/CWeaponMode.hpp" +#include "Runtime/World/CDamageInfo.hpp" + +#include +#include namespace urde { class CGenDescription; diff --git a/Runtime/Weapon/CGrappleArm.cpp b/Runtime/Weapon/CGrappleArm.cpp index 6e867e57a..0ecd8e2f1 100644 --- a/Runtime/Weapon/CGrappleArm.cpp +++ b/Runtime/Weapon/CGrappleArm.cpp @@ -4,7 +4,7 @@ #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" #include "World/CPlayer.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "Camera/CGameCamera.hpp" #include "Graphics/CSkinnedModel.hpp" #include "Graphics/CVertexMorphEffect.hpp" diff --git a/Runtime/Weapon/CGrappleArm.hpp b/Runtime/Weapon/CGrappleArm.hpp index 4b7378ffe..0c19da3d5 100644 --- a/Runtime/Weapon/CGrappleArm.hpp +++ b/Runtime/Weapon/CGrappleArm.hpp @@ -1,17 +1,23 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "Character/CModelData.hpp" -#include "Character/CAnimCharacterSet.hpp" -#include "CStateManager.hpp" -#include "CGunController.hpp" -#include "CGunMotion.hpp" +#include +#include +#include + +#include "Runtime/CStateManager.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CModelData.hpp" +#include "Runtime/Character/CAnimCharacterSet.hpp" +#include "Runtime/Weapon/CGunController.hpp" +#include "Runtime/Weapon/CGunMotion.hpp" + +#include namespace urde { +class CActorLights; class CStateManager; struct CModelFlags; -class CActorLights; class CGrappleArm { public: diff --git a/Runtime/Weapon/CGunController.hpp b/Runtime/Weapon/CGunController.hpp index e21a137e8..35f23dcec 100644 --- a/Runtime/Weapon/CGunController.hpp +++ b/Runtime/Weapon/CGunController.hpp @@ -1,9 +1,9 @@ #pragma once -#include "Character/CModelData.hpp" -#include "CGSFreeLook.hpp" -#include "CGSComboFire.hpp" -#include "CGSFidget.hpp" +#include "Runtime/Character/CModelData.hpp" +#include "Runtime/Weapon/CGSComboFire.hpp" +#include "Runtime/Weapon/CGSFidget.hpp" +#include "Runtime/Weapon/CGSFreeLook.hpp" namespace urde { enum class EGunState { Inactive, Default, FreeLook, ComboFire, Idle, Fidget, Strike, BigStrike }; diff --git a/Runtime/Weapon/CGunMotion.hpp b/Runtime/Weapon/CGunMotion.hpp index 10be7eed2..3079140f4 100644 --- a/Runtime/Weapon/CGunMotion.hpp +++ b/Runtime/Weapon/CGunMotion.hpp @@ -1,9 +1,12 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "Character/CModelData.hpp" -#include "CGunController.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CModelData.hpp" +#include "Runtime/Weapon/CGunController.hpp" + +#include namespace urde { diff --git a/Runtime/Weapon/CGunWeapon.hpp b/Runtime/Weapon/CGunWeapon.hpp index 8b2f3ce7d..1813b8d59 100644 --- a/Runtime/Weapon/CGunWeapon.hpp +++ b/Runtime/Weapon/CGunWeapon.hpp @@ -1,18 +1,24 @@ #pragma once -#include "RetroTypes.hpp" -#include "CWeaponMgr.hpp" -#include "Collision/CMaterialList.hpp" -#include "zeus/CVector3f.hpp" -#include "CPlayerState.hpp" -#include "Character/CAnimCharacterSet.hpp" -#include "Particle/CElementGen.hpp" -#include "CToken.hpp" -#include "CStateManager.hpp" -#include "CGunController.hpp" -#include "WeaponCommon.hpp" -#include "CGunMotion.hpp" -#include "World/CDamageInfo.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" + +#include "Runtime/CPlayerState.hpp" +#include "Runtime/CStateManager.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CAnimCharacterSet.hpp" +#include "Runtime/Collision/CMaterialList.hpp" +#include "Runtime/Particle/CElementGen.hpp" +#include "Runtime/Weapon/CGunController.hpp" +#include "Runtime/Weapon/CGunMotion.hpp" +#include "Runtime/Weapon/CWeaponMgr.hpp" +#include "Runtime/Weapon/WeaponCommon.hpp" +#include "Runtime/World/CDamageInfo.hpp" + +#include namespace urde { diff --git a/Runtime/Weapon/CIceBeam.hpp b/Runtime/Weapon/CIceBeam.hpp index 66cd20c81..7442aba39 100644 --- a/Runtime/Weapon/CIceBeam.hpp +++ b/Runtime/Weapon/CIceBeam.hpp @@ -1,6 +1,8 @@ #pragma once -#include "CGunWeapon.hpp" +#include + +#include "Runtime/Weapon/CGunWeapon.hpp" namespace urde { diff --git a/Runtime/Weapon/CNewFlameThrower.hpp b/Runtime/Weapon/CNewFlameThrower.hpp index f4c8e8fbb..29f8af7a9 100644 --- a/Runtime/Weapon/CNewFlameThrower.hpp +++ b/Runtime/Weapon/CNewFlameThrower.hpp @@ -1,6 +1,11 @@ #pragma once -#include "CGameProjectile.hpp" +#include +#include +#include + +#include "Runtime/rstl.hpp" +#include "Runtime/Weapon/CGameProjectile.hpp" namespace urde { diff --git a/Runtime/Weapon/CPhazonBeam.hpp b/Runtime/Weapon/CPhazonBeam.hpp index d1867504b..8de5486ab 100644 --- a/Runtime/Weapon/CPhazonBeam.hpp +++ b/Runtime/Weapon/CPhazonBeam.hpp @@ -1,7 +1,9 @@ #pragma once -#include "CGunWeapon.hpp" -#include "Graphics/Shaders/CAABoxShader.hpp" +#include + +#include "Runtime/Graphics/Shaders/CAABoxShader.hpp" +#include "Runtime/Weapon/CGunWeapon.hpp" namespace urde { diff --git a/Runtime/Weapon/CPlasmaBeam.hpp b/Runtime/Weapon/CPlasmaBeam.hpp index be2594d80..2330515f5 100644 --- a/Runtime/Weapon/CPlasmaBeam.hpp +++ b/Runtime/Weapon/CPlasmaBeam.hpp @@ -1,6 +1,7 @@ #pragma once -#include "CGunWeapon.hpp" +#include +#include "Runtime/Weapon/CGunWeapon.hpp" namespace urde { diff --git a/Runtime/Weapon/CPlasmaProjectile.cpp b/Runtime/Weapon/CPlasmaProjectile.cpp index 067067f40..668a5c6c9 100644 --- a/Runtime/Weapon/CPlasmaProjectile.cpp +++ b/Runtime/Weapon/CPlasmaProjectile.cpp @@ -1,5 +1,5 @@ #include "CPlasmaProjectile.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" #include "World/CGameLight.hpp" diff --git a/Runtime/Weapon/CPlasmaProjectile.hpp b/Runtime/Weapon/CPlasmaProjectile.hpp index 368daf534..b2e7e7d8d 100644 --- a/Runtime/Weapon/CPlasmaProjectile.hpp +++ b/Runtime/Weapon/CPlasmaProjectile.hpp @@ -1,9 +1,19 @@ #pragma once -#include "Weapon/CBeamProjectile.hpp" -#include "Weapon/CBeamInfo.hpp" -#include "World/CDamageInfo.hpp" -#include "Graphics/Shaders/CColoredStripShader.hpp" +#include +#include +#include +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Graphics/Shaders/CColoredStripShader.hpp" +#include "Runtime/Weapon/CBeamInfo.hpp" +#include "Runtime/Weapon/CBeamProjectile.hpp" +#include "Runtime/World/CDamageInfo.hpp" + +#include namespace urde { class CPlasmaProjectile : public CBeamProjectile { diff --git a/Runtime/Weapon/CPlayerGun.cpp b/Runtime/Weapon/CPlayerGun.cpp index 612b155e6..4b667133f 100644 --- a/Runtime/Weapon/CPlayerGun.cpp +++ b/Runtime/Weapon/CPlayerGun.cpp @@ -107,7 +107,7 @@ void CPlayerGun::InitBombData() { void CPlayerGun::InitMuzzleData() { for (int i = 0; i < 5; ++i) { x7c0_auxMuzzleEffects.push_back(g_SimplePool->GetObj(SObjectTag{FOURCC('PART'), g_tweakGunRes->xa4_auxMuzzle[i]})); - x800_auxMuzzleGenerators.emplace_back(new CElementGen(x7c0_auxMuzzleEffects.back())); + x800_auxMuzzleGenerators.emplace_back(std::make_unique(x7c0_auxMuzzleEffects.back())); x800_auxMuzzleGenerators.back()->SetParticleEmission(false); } } diff --git a/Runtime/Weapon/CPlayerGun.hpp b/Runtime/Weapon/CPlayerGun.hpp index 870cfadc4..9f8e8b181 100644 --- a/Runtime/Weapon/CPlayerGun.hpp +++ b/Runtime/Weapon/CPlayerGun.hpp @@ -1,26 +1,31 @@ #pragma once -#include "RetroTypes.hpp" -#include "Character/CActorLights.hpp" -#include "CFidget.hpp" -#include "zeus/CTransform.hpp" -#include "zeus/CAABox.hpp" -#include "World/CPlayerCameraBob.hpp" -#include "CGunMotion.hpp" -#include "CGrappleArm.hpp" -#include "CAuxWeapon.hpp" -#include "CPowerBeam.hpp" -#include "CIceBeam.hpp" -#include "CWaveBeam.hpp" -#include "CPlasmaBeam.hpp" -#include "CPhazonBeam.hpp" -#include "Particle/CElementGen.hpp" -#include "Character/CModelData.hpp" -#include "World/CWorldShadow.hpp" -#include "World/ScriptObjectSupport.hpp" -#include "Graphics/CRainSplashGenerator.hpp" -#include "Graphics/Shaders/CTexturedQuadFilter.hpp" -#include "Graphics/Shaders/CAABoxShader.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CActorLights.hpp" +#include "Runtime/Character/CModelData.hpp" +#include "Runtime/Graphics/CRainSplashGenerator.hpp" +#include "Runtime/Graphics/Shaders/CAABoxShader.hpp" +#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp" +#include "Runtime/Particle/CElementGen.hpp" +#include "Runtime/Weapon/CAuxWeapon.hpp" +#include "Runtime/Weapon/CFidget.hpp" +#include "Runtime/Weapon/CGrappleArm.hpp" +#include "Runtime/Weapon/CGunMotion.hpp" +#include "Runtime/Weapon/CIceBeam.hpp" +#include "Runtime/Weapon/CPhazonBeam.hpp" +#include "Runtime/Weapon/CPlasmaBeam.hpp" +#include "Runtime/Weapon/CPowerBeam.hpp" +#include "Runtime/Weapon/CWaveBeam.hpp" +#include "Runtime/World/CPlayerCameraBob.hpp" +#include "Runtime/World/CWorldShadow.hpp" +#include "Runtime/World/ScriptObjectSupport.hpp" + +#include +#include namespace urde { struct CFinalInput; diff --git a/Runtime/Weapon/CPowerBeam.hpp b/Runtime/Weapon/CPowerBeam.hpp index 9ca278cb9..b28c36485 100644 --- a/Runtime/Weapon/CPowerBeam.hpp +++ b/Runtime/Weapon/CPowerBeam.hpp @@ -1,6 +1,7 @@ #pragma once -#include "CGunWeapon.hpp" +#include +#include "Runtime/Weapon/CGunWeapon.hpp" namespace urde { diff --git a/Runtime/Weapon/CPowerBomb.cpp b/Runtime/Weapon/CPowerBomb.cpp index b5e5115f0..dc516241b 100644 --- a/Runtime/Weapon/CPowerBomb.cpp +++ b/Runtime/Weapon/CPowerBomb.cpp @@ -7,7 +7,7 @@ #include "CPlayerState.hpp" #include "World/CPlayer.hpp" #include "DataSpec/DNAMP1/SFX/Weapons.h" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { @@ -24,7 +24,7 @@ CPowerBomb::CPowerBomb(const TToken& particle, TUniqueId uid, T , x158_24_canStartFilter(true) , x158_25_filterEnabled(false) , x164_radiusIncrement(dInfo.GetRadius() / 2.5f) -, x168_particle(new CElementGen(particle)) +, x168_particle(std::make_unique(particle)) , x16c_radius(dInfo.GetRadius()) { x168_particle->SetGlobalTranslation(GetTranslation()); } diff --git a/Runtime/Weapon/CPowerBomb.hpp b/Runtime/Weapon/CPowerBomb.hpp index 0f969d5a2..1b5a2ac5d 100644 --- a/Runtime/Weapon/CPowerBomb.hpp +++ b/Runtime/Weapon/CPowerBomb.hpp @@ -1,11 +1,17 @@ #pragma once -#include "CWeapon.hpp" -#include "CToken.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/Weapon/CWeapon.hpp" + +#include +#include namespace urde { - class CElementGen; + class CPowerBomb : public CWeapon { static const zeus::CColor kFadeColor; bool x158_24_canStartFilter : 1; diff --git a/Runtime/Weapon/CProjectileInfo.hpp b/Runtime/Weapon/CProjectileInfo.hpp index 6d33ea26e..6800fff3e 100644 --- a/Runtime/Weapon/CProjectileInfo.hpp +++ b/Runtime/Weapon/CProjectileInfo.hpp @@ -1,9 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "World/CDamageInfo.hpp" -#include "Particle/CWeaponDescription.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Particle/CWeaponDescription.hpp" +#include "Runtime/World/CDamageInfo.hpp" + +#include namespace urde { class CPlayer; diff --git a/Runtime/Weapon/CProjectileWeapon.hpp b/Runtime/Weapon/CProjectileWeapon.hpp index 6355496a4..b24b68433 100644 --- a/Runtime/Weapon/CProjectileWeapon.hpp +++ b/Runtime/Weapon/CProjectileWeapon.hpp @@ -1,20 +1,27 @@ #pragma once -#include "RetroTypes.hpp" -#include "CRandom16.hpp" -#include "CToken.hpp" -#include "zeus/CVector3f.hpp" -#include "Particle/CElementGen.hpp" -#include "Particle/CParticleSwoosh.hpp" -#include "Particle/CGenDescription.hpp" -#include "Particle/CSwooshDescription.hpp" -#include "Particle/CWeaponDescription.hpp" -#include "Collision/CCollisionResponseData.hpp" +#include +#include + +#include "Runtime/CRandom16.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Collision/CCollisionResponseData.hpp" +#include "Runtime/Particle/CElementGen.hpp" +#include "Runtime/Particle/CGenDescription.hpp" +#include "Runtime/Particle/CParticleSwoosh.hpp" +#include "Runtime/Particle/CSwooshDescription.hpp" +#include "Runtime/Particle/CWeaponDescription.hpp" + +#include +#include +#include +#include namespace urde { -class CModel; class CDecalDescription; class CGenDescription; +class CModel; class CProjectileWeapon { static u16 g_GlobalSeed; diff --git a/Runtime/Weapon/CTargetableProjectile.cpp b/Runtime/Weapon/CTargetableProjectile.cpp index 3fcbcba5b..9c2cf3592 100644 --- a/Runtime/Weapon/CTargetableProjectile.cpp +++ b/Runtime/Weapon/CTargetableProjectile.cpp @@ -1,7 +1,7 @@ #include "CTargetableProjectile.hpp" #include "CStateManager.hpp" #include "World/CPlayer.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/Weapon/CTargetableProjectile.hpp b/Runtime/Weapon/CTargetableProjectile.hpp index 2b9a77aab..fd1b140bf 100644 --- a/Runtime/Weapon/CTargetableProjectile.hpp +++ b/Runtime/Weapon/CTargetableProjectile.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CEnergyProjectile.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Weapon/CEnergyProjectile.hpp" namespace urde { diff --git a/Runtime/Weapon/CWaveBeam.hpp b/Runtime/Weapon/CWaveBeam.hpp index 83c3ac4ab..9dac530c1 100644 --- a/Runtime/Weapon/CWaveBeam.hpp +++ b/Runtime/Weapon/CWaveBeam.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CGunWeapon.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Weapon/CGunWeapon.hpp" namespace urde { diff --git a/Runtime/Weapon/CWaveBuster.hpp b/Runtime/Weapon/CWaveBuster.hpp index 2c1e6afb9..c6701b1f5 100644 --- a/Runtime/Weapon/CWaveBuster.hpp +++ b/Runtime/Weapon/CWaveBuster.hpp @@ -1,6 +1,13 @@ #pragma once -#include "CGameProjectile.hpp" +#include + +#include "Runtime/CRandom16.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Weapon/CGameProjectile.hpp" + +#include +#include namespace urde { diff --git a/Runtime/Weapon/CWeapon.cpp b/Runtime/Weapon/CWeapon.cpp index e78ad908e..2958195b8 100644 --- a/Runtime/Weapon/CWeapon.cpp +++ b/Runtime/Weapon/CWeapon.cpp @@ -2,7 +2,7 @@ #include "World/CActorParameters.hpp" #include "World/CScriptWater.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/Weapon/CWeapon.hpp b/Runtime/Weapon/CWeapon.hpp index 901afa8ce..672ee2002 100644 --- a/Runtime/Weapon/CWeapon.hpp +++ b/Runtime/Weapon/CWeapon.hpp @@ -1,9 +1,12 @@ #pragma once -#include "World/CActor.hpp" -#include "Weapon/WeaponCommon.hpp" -#include "World/CDamageInfo.hpp" -#include "Collision/CMaterialFilter.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Collision/CMaterialFilter.hpp" +#include "Runtime/World/CActor.hpp" +#include "Runtime/World/CDamageInfo.hpp" +#include "Runtime/Weapon/WeaponCommon.hpp" namespace urde { class CWeapon : public CActor { diff --git a/Runtime/Weapon/CWeaponMgr.hpp b/Runtime/Weapon/CWeaponMgr.hpp index 1c596a785..41f564e88 100644 --- a/Runtime/Weapon/CWeaponMgr.hpp +++ b/Runtime/Weapon/CWeaponMgr.hpp @@ -1,7 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "WeaponCommon.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Weapon/WeaponCommon.hpp" namespace urde { diff --git a/Runtime/Weapon/CWeaponMode.hpp b/Runtime/Weapon/CWeaponMode.hpp index cd6cf6513..15131e35d 100644 --- a/Runtime/Weapon/CWeaponMode.hpp +++ b/Runtime/Weapon/CWeaponMode.hpp @@ -1,6 +1,6 @@ #pragma once -#include "WeaponCommon.hpp" +#include "Runtime/Weapon/WeaponCommon.hpp" namespace urde { class CWeaponMode { diff --git a/Runtime/Weapon/WeaponCommon.hpp b/Runtime/Weapon/WeaponCommon.hpp index 12166c38e..599911708 100644 --- a/Runtime/Weapon/WeaponCommon.hpp +++ b/Runtime/Weapon/WeaponCommon.hpp @@ -1,16 +1,19 @@ #pragma once -#include "RetroTypes.hpp" -#include "DataSpec/DNACommon/Tweaks/ITweakPlayerGun.hpp" -#include "Audio/CSfxManager.hpp" #include -#include +#include + +#include "DataSpec/DNACommon/Tweaks/ITweakPlayerGun.hpp" + +#include "Runtime/CPlayerState.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Audio/CSfxManager.hpp" namespace urde { class CAnimData; -class CToken; class CPrimitive; class CStateManager; +class CToken; enum class EWeaponType { None = -1, diff --git a/Runtime/World/CActor.cpp b/Runtime/World/CActor.cpp index 490091eac..3ecf201a4 100644 --- a/Runtime/World/CActor.cpp +++ b/Runtime/World/CActor.cpp @@ -3,7 +3,7 @@ #include "CStateManager.hpp" #include "Collision/CMaterialList.hpp" #include "Audio/CSfxManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "Character/IAnimReader.hpp" #include "Character/CActorLights.hpp" #include "Camera/CGameCamera.hpp" @@ -32,7 +32,7 @@ CActor::CActor(TUniqueId uid, bool active, std::string_view name, const CEntityI , x68_material(MakeActorMaterialList(list, params)) , x70_materialFilter(CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {0ull})) , xc6_nextDrawNode(otherUid) { - x90_actorLights = mData.IsNull() ? std::unique_ptr() : params.x0_lightParms.MakeActorLights(); + x90_actorLights = mData.IsNull() ? nullptr : params.x0_lightParms.MakeActorLights(); if (mData.x10_animData || mData.x1c_normalModel) x64_modelData = std::make_unique(std::move(mData)); xd0_damageMag = params.x64_thermalMag; @@ -431,8 +431,9 @@ void CActor::CreateShadow(bool b) { } void CActor::_CreateShadow() { - if (!x94_simpleShadow && x64_modelData && (x64_modelData->HasAnimData() || x64_modelData->HasNormalModel())) - x94_simpleShadow.reset(new CSimpleShadow(1.f, 1.f, 20.f, 0.05f)); + if (!x94_simpleShadow && x64_modelData && (x64_modelData->HasAnimData() || x64_modelData->HasNormalModel())) { + x94_simpleShadow = std::make_unique(1.f, 1.f, 20.f, 0.05f); + } } void CActor::_CreateReflectionCube() { diff --git a/Runtime/World/CActor.hpp b/Runtime/World/CActor.hpp index 9e6a5c42b..6419d2fdf 100644 --- a/Runtime/World/CActor.hpp +++ b/Runtime/World/CActor.hpp @@ -1,16 +1,17 @@ #pragma once -#include "CEntity.hpp" -#include "Graphics/CGraphics.hpp" -#include "Graphics/CSimpleShadow.hpp" -#include "zeus/zeus.hpp" -#include "Collision/CMaterialFilter.hpp" -#include "Character/CModelData.hpp" -#include "Character/CActorLights.hpp" -#include "Collision/CCollisionResponseData.hpp" -#include "Audio/CSfxManager.hpp" -#include "CScannableObjectInfo.hpp" -#include "Weapon/WeaponCommon.hpp" +#include "Runtime/CScannableObjectInfo.hpp" +#include "Runtime/Audio/CSfxManager.hpp" +#include "Runtime/Collision/CCollisionResponseData.hpp" +#include "Runtime/Collision/CMaterialFilter.hpp" +#include "Runtime/Character/CActorLights.hpp" +#include "Runtime/Character/CModelData.hpp" +#include "Runtime/Graphics/CGraphics.hpp" +#include "Runtime/Graphics/CSimpleShadow.hpp" +#include "Runtime/Weapon/WeaponCommon.hpp" +#include "Runtime/World/CEntity.hpp" + +#include namespace urde { diff --git a/Runtime/World/CActorModelParticles.cpp b/Runtime/World/CActorModelParticles.cpp index 3289e5975..0bd2bdd3d 100644 --- a/Runtime/World/CActorModelParticles.cpp +++ b/Runtime/World/CActorModelParticles.cpp @@ -1,4 +1,7 @@ #include "CActorModelParticles.hpp" + +#include + #include "CStateManager.hpp" #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" @@ -377,7 +380,7 @@ void CActorModelParticles::IncrementDependency(EDependency d) { xe4_loadingDeps |= (1 << int(d)); } -static const char* ParticleDGRPs[] = { +constexpr std::array ParticleDGRPs{ "Effect_OnFire_DGRP", "Effect_IceBreak_DGRP", "Effect_Ash_DGRP", "Effect_FirePop_DGRP", "Effect_Electric_DGRP", "Effect_IcePop_DGRP", }; @@ -393,8 +396,9 @@ CActorModelParticles::Dependency CActorModelParticles::GetParticleDGRPTokens(con } void CActorModelParticles::LoadParticleDGRPs() { - for (int i = 0; i < 6; ++i) - x50_dgrps.push_back(GetParticleDGRPTokens(ParticleDGRPs[i])); + for (const char* dgrp : ParticleDGRPs) { + x50_dgrps.push_back(GetParticleDGRPTokens(dgrp)); + } } std::unique_ptr CActorModelParticles::MakeOnFireGen() const { diff --git a/Runtime/World/CActorModelParticles.hpp b/Runtime/World/CActorModelParticles.hpp index c58f8a34d..67ab400db 100644 --- a/Runtime/World/CActorModelParticles.hpp +++ b/Runtime/World/CActorModelParticles.hpp @@ -1,12 +1,20 @@ #pragma once #include -#include "Audio/CSfxManager.hpp" -#include "CToken.hpp" -#include "zeus/CTransform.hpp" -#include "Particle/CParticleElectric.hpp" -#include "Particle/CParticleSwoosh.hpp" -#include "Graphics/CRainSplashGenerator.hpp" +#include +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Audio/CSfxManager.hpp" +#include "Runtime/Graphics/CRainSplashGenerator.hpp" +#include "Runtime/Particle/CParticleElectric.hpp" +#include "Runtime/Particle/CParticleSwoosh.hpp" + +#include +#include +#include namespace urde { class CStateManager; diff --git a/Runtime/World/CActorParameters.hpp b/Runtime/World/CActorParameters.hpp index 30942901d..b7b395b43 100644 --- a/Runtime/World/CActorParameters.hpp +++ b/Runtime/World/CActorParameters.hpp @@ -1,8 +1,11 @@ #pragma once -#include "CLightParameters.hpp" -#include "CScannableParameters.hpp" -#include "CVisorParameters.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CLightParameters.hpp" +#include "Runtime/World/CScannableParameters.hpp" +#include "Runtime/World/CVisorParameters.hpp" namespace urde { diff --git a/Runtime/World/CAi.hpp b/Runtime/World/CAi.hpp index 9f8780a10..0f739769c 100644 --- a/Runtime/World/CAi.hpp +++ b/Runtime/World/CAi.hpp @@ -1,16 +1,18 @@ #pragma once -#include "GCNTypes.hpp" -#include "ScriptObjectSupport.hpp" -#include "RetroTypes.hpp" -#include "CEntity.hpp" -#include "CPhysicsActor.hpp" -#include "CDamageVulnerability.hpp" -#include "CHealthInfo.hpp" -#include "CStateMachine.hpp" -#include "CKnockBackController.hpp" +#include -#include "zeus/zeus.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CDamageVulnerability.hpp" +#include "Runtime/World/CEntity.hpp" +#include "Runtime/World/CHealthInfo.hpp" +#include "Runtime/World/CKnockBackController.hpp" +#include "Runtime/World/CPhysicsActor.hpp" +#include "Runtime/World/CStateMachine.hpp" +#include "Runtime/World/ScriptObjectSupport.hpp" + +#include namespace urde { diff --git a/Runtime/World/CAiFuncMap.cpp b/Runtime/World/CAiFuncMap.cpp index b59c7c8bf..3a3787076 100644 --- a/Runtime/World/CAiFuncMap.cpp +++ b/Runtime/World/CAiFuncMap.cpp @@ -5,144 +5,152 @@ namespace urde { CAiFuncMap::CAiFuncMap() { /* Ai States */ - x0_stateFuncs["Patrol"] = &CAi::Patrol; - x0_stateFuncs["FollowPattern"] = &CAi::FollowPattern; - x0_stateFuncs["Dead"] = &CAi::Dead; - x0_stateFuncs["PathFind"] = &CAi::PathFind; - x0_stateFuncs["Start"] = &CAi::Start; - x0_stateFuncs["SelectTarget"] = &CAi::SelectTarget; - x0_stateFuncs["TargetPatrol"] = &CAi::TargetPatrol; - x0_stateFuncs["TargetPlayer"] = &CAi::TargetPlayer; - x0_stateFuncs["TargetCover"] = &CAi::TargetCover; - x0_stateFuncs["Halt"] = &CAi::Halt; - x0_stateFuncs["Walk"] = &CAi::Walk; - x0_stateFuncs["Run"] = &CAi::Run; - x0_stateFuncs["Generate"] = &CAi::Generate; - x0_stateFuncs["Deactivate"] = &CAi::Deactivate; - x0_stateFuncs["Attack"] = &CAi::Attack; - x0_stateFuncs["LoopedAttack"] = &CAi::LoopedAttack; - x0_stateFuncs["JumpBack"] = &CAi::JumpBack; - x0_stateFuncs["DoubleSnap"] = &CAi::DoubleSnap; - x0_stateFuncs["Shuffle"] = &CAi::Shuffle; - x0_stateFuncs["TurnAround"] = &CAi::TurnAround; - x0_stateFuncs["Skid"] = &CAi::Skid; - x0_stateFuncs["Active"] = &CAi::Active; - x0_stateFuncs["InActive"] = &CAi::InActive; - x0_stateFuncs["CoverAttack"] = &CAi::CoverAttack; - x0_stateFuncs["Crouch"] = &CAi::Crouch; - x0_stateFuncs["FadeIn"] = &CAi::FadeIn; - x0_stateFuncs["FadeOut"] = &CAi::FadeOut; - x0_stateFuncs["GetUp"] = &CAi::GetUp; - x0_stateFuncs["Taunt"] = &CAi::Taunt; - x0_stateFuncs["Suck"] = &CAi::Suck; - x0_stateFuncs["Flee"] = &CAi::Flee; - x0_stateFuncs["Lurk"] = &CAi::Lurk; - x0_stateFuncs["ProjectileAttack"] = &CAi::ProjectileAttack; - x0_stateFuncs["Flinch"] = &CAi::Flinch; - x0_stateFuncs["Hurled"] = &CAi::Hurled; - x0_stateFuncs["TelegraphAttack"] = &CAi::TelegraphAttack; - x0_stateFuncs["Jump"] = &CAi::Jump; - x0_stateFuncs["Explode"] = &CAi::Explode; - x0_stateFuncs["Dodge"] = &CAi::Dodge; - x0_stateFuncs["Retreat"] = &CAi::Retreat; - x0_stateFuncs["Cover"] = &CAi::Cover; - x0_stateFuncs["Approach"] = &CAi::Approach; - x0_stateFuncs["WallHang"] = &CAi::WallHang; - x0_stateFuncs["WallDetach"] = &CAi::WallDetach; - x0_stateFuncs["Enraged"] = &CAi::Enraged; - x0_stateFuncs["SpecialAttack"] = &CAi::SpecialAttack; - x0_stateFuncs["Growth"] = &CAi::Growth; - x0_stateFuncs["Faint"] = &CAi::Faint; - x0_stateFuncs["Land"] = &CAi::Land; - x0_stateFuncs["Bounce"] = &CAi::Bounce; - x0_stateFuncs["PathFindEx"] = &CAi::PathFindEx; - x0_stateFuncs["Dizzy"] = &CAi::Dizzy; - x0_stateFuncs["CallForBackup"] = &CAi::CallForBackup; - x0_stateFuncs["BulbAttack"] = &CAi::BulbAttack; - x0_stateFuncs["PodAttack"] = &CAi::PodAttack; + x0_stateFuncs.emplace("Patrol", &CAi::Patrol); + x0_stateFuncs.emplace("FollowPattern", &CAi::FollowPattern); + x0_stateFuncs.emplace("Dead", &CAi::Dead); + x0_stateFuncs.emplace("PathFind", &CAi::PathFind); + x0_stateFuncs.emplace("Start", &CAi::Start); + x0_stateFuncs.emplace("SelectTarget", &CAi::SelectTarget); + x0_stateFuncs.emplace("TargetPatrol", &CAi::TargetPatrol); + x0_stateFuncs.emplace("TargetPlayer", &CAi::TargetPlayer); + x0_stateFuncs.emplace("TargetCover", &CAi::TargetCover); + x0_stateFuncs.emplace("Halt", &CAi::Halt); + x0_stateFuncs.emplace("Walk", &CAi::Walk); + x0_stateFuncs.emplace("Run", &CAi::Run); + x0_stateFuncs.emplace("Generate", &CAi::Generate); + x0_stateFuncs.emplace("Deactivate", &CAi::Deactivate); + x0_stateFuncs.emplace("Attack", &CAi::Attack); + x0_stateFuncs.emplace("LoopedAttack", &CAi::LoopedAttack); + x0_stateFuncs.emplace("JumpBack", &CAi::JumpBack); + x0_stateFuncs.emplace("DoubleSnap", &CAi::DoubleSnap); + x0_stateFuncs.emplace("Shuffle", &CAi::Shuffle); + x0_stateFuncs.emplace("TurnAround", &CAi::TurnAround); + x0_stateFuncs.emplace("Skid", &CAi::Skid); + x0_stateFuncs.emplace("Active", &CAi::Active); + x0_stateFuncs.emplace("InActive", &CAi::InActive); + x0_stateFuncs.emplace("CoverAttack", &CAi::CoverAttack); + x0_stateFuncs.emplace("Crouch", &CAi::Crouch); + x0_stateFuncs.emplace("FadeIn", &CAi::FadeIn); + x0_stateFuncs.emplace("FadeOut", &CAi::FadeOut); + x0_stateFuncs.emplace("GetUp", &CAi::GetUp); + x0_stateFuncs.emplace("Taunt", &CAi::Taunt); + x0_stateFuncs.emplace("Suck", &CAi::Suck); + x0_stateFuncs.emplace("Flee", &CAi::Flee); + x0_stateFuncs.emplace("Lurk", &CAi::Lurk); + x0_stateFuncs.emplace("ProjectileAttack", &CAi::ProjectileAttack); + x0_stateFuncs.emplace("Flinch", &CAi::Flinch); + x0_stateFuncs.emplace("Hurled", &CAi::Hurled); + x0_stateFuncs.emplace("TelegraphAttack", &CAi::TelegraphAttack); + x0_stateFuncs.emplace("Jump", &CAi::Jump); + x0_stateFuncs.emplace("Explode", &CAi::Explode); + x0_stateFuncs.emplace("Dodge", &CAi::Dodge); + x0_stateFuncs.emplace("Retreat", &CAi::Retreat); + x0_stateFuncs.emplace("Cover", &CAi::Cover); + x0_stateFuncs.emplace("Approach", &CAi::Approach); + x0_stateFuncs.emplace("WallHang", &CAi::WallHang); + x0_stateFuncs.emplace("WallDetach", &CAi::WallDetach); + x0_stateFuncs.emplace("Enraged", &CAi::Enraged); + x0_stateFuncs.emplace("SpecialAttack", &CAi::SpecialAttack); + x0_stateFuncs.emplace("Growth", &CAi::Growth); + x0_stateFuncs.emplace("Faint", &CAi::Faint); + x0_stateFuncs.emplace("Land", &CAi::Land); + x0_stateFuncs.emplace("Bounce", &CAi::Bounce); + x0_stateFuncs.emplace("PathFindEx", &CAi::PathFindEx); + x0_stateFuncs.emplace("Dizzy", &CAi::Dizzy); + x0_stateFuncs.emplace("CallForBackup", &CAi::CallForBackup); + x0_stateFuncs.emplace("BulbAttack", &CAi::BulbAttack); + x0_stateFuncs.emplace("PodAttack", &CAi::PodAttack); /* Ai Triggers */ - x10_triggerFuncs["InAttackPosition"] = &CAi::InAttackPosition; - x10_triggerFuncs["Leash"] = &CAi::Leash; - x10_triggerFuncs["OffLine"] = &CAi::OffLine; - x10_triggerFuncs["Attacked"] = &CAi::Attacked; - x10_triggerFuncs["PathShagged"] = &CAi::PathShagged; - x10_triggerFuncs["PathOver"] = &CAi::PathOver; - x10_triggerFuncs["PathFound"] = &CAi::PathFound; - x10_triggerFuncs["TooClose"] = &CAi::TooClose; - x10_triggerFuncs["InRange"] = &CAi::InRange; - x10_triggerFuncs["InMaxRange"] = &CAi::InMaxRange; - x10_triggerFuncs["InDetectionRange"] = &CAi::InDetectionRange; - x10_triggerFuncs["SpotPlayer"] = &CAi::SpotPlayer; - x10_triggerFuncs["PlayerSpot"] = &CAi::PlayerSpot; - x10_triggerFuncs["PatternOver"] = &CAi::PatternOver; - x10_triggerFuncs["PatternShagged"] = &CAi::PatternShagged; - x10_triggerFuncs["HasAttackPattern"] = &CAi::HasAttackPattern; - x10_triggerFuncs["HasPatrolPath"] = &CAi::HasPatrolPath; - x10_triggerFuncs["HasRetreatPattern"] = &CAi::HasRetreatPattern; - x10_triggerFuncs["Delay"] = &CAi::Delay; - x10_triggerFuncs["RandomDelay"] = &CAi::RandomDelay; - x10_triggerFuncs["FixedDelay"] = &CAi::FixedDelay; - x10_triggerFuncs["Default"] = &CAi::Default; - x10_triggerFuncs["AnimOver"] = &CAi::AnimOver; - x10_triggerFuncs["ShouldAttack"] = &CAi::ShouldAttack; - x10_triggerFuncs["ShouldDoubleSnap"] = &CAi::ShouldDoubleSnap; - x10_triggerFuncs["InPosition"] = &CAi::InPosition; - x10_triggerFuncs["ShouldTurn"] = &CAi::ShouldTurn; - x10_triggerFuncs["HitSomething"] = &CAi::HitSomething; - x10_triggerFuncs["ShouldJumpBack"] = &CAi::ShouldJumpBack; - x10_triggerFuncs["Stuck"] = &CAi::Stuck; - x10_triggerFuncs["NoPathNodes"] = &CAi::NoPathNodes; - x10_triggerFuncs["Landed"] = &CAi::Landed; - x10_triggerFuncs["HearShot"] = &CAi::HearShot; - x10_triggerFuncs["HearPlayer"] = &CAi::HearPlayer; - x10_triggerFuncs["CoverCheck"] = &CAi::CoverCheck; - x10_triggerFuncs["CoverFind"] = &CAi::CoverFind; - x10_triggerFuncs["CoverBlown"] = &CAi::CoverBlown; - x10_triggerFuncs["CoverNearlyBlown"] = &CAi::CoverNearlyBlown; - x10_triggerFuncs["CoveringFire"] = &CAi::CoveringFire; - x10_triggerFuncs["GotUp"] = &CAi::GotUp; - x10_triggerFuncs["LineOfSight"] = &CAi::LineOfSight; - x10_triggerFuncs["AggressionCheck"] = &CAi::AggressionCheck; - x10_triggerFuncs["AttackOver"] = &CAi::AttackOver; - x10_triggerFuncs["ShouldTaunt"] = &CAi::ShouldTaunt; - x10_triggerFuncs["Inside"] = &CAi::Inside; - x10_triggerFuncs["ShouldFire"] = &CAi::ShouldFire; - x10_triggerFuncs["ShouldFlinch"] = &CAi::ShouldFlinch; - x10_triggerFuncs["PatrolPathOver"] = &CAi::PatrolPathOver; - x10_triggerFuncs["ShouldDodge"] = &CAi::ShouldDodge; - x10_triggerFuncs["ShouldRetreat"] = &CAi::ShouldRetreat; - x10_triggerFuncs["ShouldCrouch"] = &CAi::ShouldCrouch; - x10_triggerFuncs["ShouldMove"] = &CAi::ShouldMove; - x10_triggerFuncs["ShotAt"] = &CAi::ShotAt; - x10_triggerFuncs["HasTargetingPoint"] = &CAi::HasTargetingPoint; - x10_triggerFuncs["ShouldWallHang"] = &CAi::ShouldWallHang; - x10_triggerFuncs["SetAIStage"] = &CAi::SetAIStage; - x10_triggerFuncs["AIStage"] = &CAi::AIStage; - x10_triggerFuncs["StartAttack"] = &CAi::StartAttack; - x10_triggerFuncs["BreakAttack"] = &CAi::BreakAttack; - x10_triggerFuncs["ShouldStrafe"] = &CAi::ShouldStrafe; - x10_triggerFuncs["ShouldSpecialAttack"] = &CAi::ShouldSpecialAttack; - x10_triggerFuncs["LostInterest"] = &CAi::LostInterest; - x10_triggerFuncs["CodeTrigger"] = &CAi::CodeTrigger; - x10_triggerFuncs["BounceFind"] = &CAi::BounceFind; - x10_triggerFuncs["Random"] = &CAi::Random; - x10_triggerFuncs["FixedRandom"] = &CAi::FixedRandom; - x10_triggerFuncs["IsDizzy"] = &CAi::IsDizzy; - x10_triggerFuncs["ShouldCallForBackup"] = &CAi::ShouldCallForBackup; + x10_triggerFuncs.emplace("InAttackPosition", &CAi::InAttackPosition); + x10_triggerFuncs.emplace("Leash", &CAi::Leash); + x10_triggerFuncs.emplace("OffLine", &CAi::OffLine); + x10_triggerFuncs.emplace("Attacked", &CAi::Attacked); + x10_triggerFuncs.emplace("PathShagged", &CAi::PathShagged); + x10_triggerFuncs.emplace("PathOver", &CAi::PathOver); + x10_triggerFuncs.emplace("PathFound", &CAi::PathFound); + x10_triggerFuncs.emplace("TooClose", &CAi::TooClose); + x10_triggerFuncs.emplace("InRange", &CAi::InRange); + x10_triggerFuncs.emplace("InMaxRange", &CAi::InMaxRange); + x10_triggerFuncs.emplace("InDetectionRange", &CAi::InDetectionRange); + x10_triggerFuncs.emplace("SpotPlayer", &CAi::SpotPlayer); + x10_triggerFuncs.emplace("PlayerSpot", &CAi::PlayerSpot); + x10_triggerFuncs.emplace("PatternOver", &CAi::PatternOver); + x10_triggerFuncs.emplace("PatternShagged", &CAi::PatternShagged); + x10_triggerFuncs.emplace("HasAttackPattern", &CAi::HasAttackPattern); + x10_triggerFuncs.emplace("HasPatrolPath", &CAi::HasPatrolPath); + x10_triggerFuncs.emplace("HasRetreatPattern", &CAi::HasRetreatPattern); + x10_triggerFuncs.emplace("Delay", &CAi::Delay); + x10_triggerFuncs.emplace("RandomDelay", &CAi::RandomDelay); + x10_triggerFuncs.emplace("FixedDelay", &CAi::FixedDelay); + x10_triggerFuncs.emplace("Default", &CAi::Default); + x10_triggerFuncs.emplace("AnimOver", &CAi::AnimOver); + x10_triggerFuncs.emplace("ShouldAttack", &CAi::ShouldAttack); + x10_triggerFuncs.emplace("ShouldDoubleSnap", &CAi::ShouldDoubleSnap); + x10_triggerFuncs.emplace("InPosition", &CAi::InPosition); + x10_triggerFuncs.emplace("ShouldTurn", &CAi::ShouldTurn); + x10_triggerFuncs.emplace("HitSomething", &CAi::HitSomething); + x10_triggerFuncs.emplace("ShouldJumpBack", &CAi::ShouldJumpBack); + x10_triggerFuncs.emplace("Stuck", &CAi::Stuck); + x10_triggerFuncs.emplace("NoPathNodes", &CAi::NoPathNodes); + x10_triggerFuncs.emplace("Landed", &CAi::Landed); + x10_triggerFuncs.emplace("HearShot", &CAi::HearShot); + x10_triggerFuncs.emplace("HearPlayer", &CAi::HearPlayer); + x10_triggerFuncs.emplace("CoverCheck", &CAi::CoverCheck); + x10_triggerFuncs.emplace("CoverFind", &CAi::CoverFind); + x10_triggerFuncs.emplace("CoverBlown", &CAi::CoverBlown); + x10_triggerFuncs.emplace("CoverNearlyBlown", &CAi::CoverNearlyBlown); + x10_triggerFuncs.emplace("CoveringFire", &CAi::CoveringFire); + x10_triggerFuncs.emplace("GotUp", &CAi::GotUp); + x10_triggerFuncs.emplace("LineOfSight", &CAi::LineOfSight); + x10_triggerFuncs.emplace("AggressionCheck", &CAi::AggressionCheck); + x10_triggerFuncs.emplace("AttackOver", &CAi::AttackOver); + x10_triggerFuncs.emplace("ShouldTaunt", &CAi::ShouldTaunt); + x10_triggerFuncs.emplace("Inside", &CAi::Inside); + x10_triggerFuncs.emplace("ShouldFire", &CAi::ShouldFire); + x10_triggerFuncs.emplace("ShouldFlinch", &CAi::ShouldFlinch); + x10_triggerFuncs.emplace("PatrolPathOver", &CAi::PatrolPathOver); + x10_triggerFuncs.emplace("ShouldDodge", &CAi::ShouldDodge); + x10_triggerFuncs.emplace("ShouldRetreat", &CAi::ShouldRetreat); + x10_triggerFuncs.emplace("ShouldCrouch", &CAi::ShouldCrouch); + x10_triggerFuncs.emplace("ShouldMove", &CAi::ShouldMove); + x10_triggerFuncs.emplace("ShotAt", &CAi::ShotAt); + x10_triggerFuncs.emplace("HasTargetingPoint", &CAi::HasTargetingPoint); + x10_triggerFuncs.emplace("ShouldWallHang", &CAi::ShouldWallHang); + x10_triggerFuncs.emplace("SetAIStage", &CAi::SetAIStage); + x10_triggerFuncs.emplace("AIStage", &CAi::AIStage); + x10_triggerFuncs.emplace("StartAttack", &CAi::StartAttack); + x10_triggerFuncs.emplace("BreakAttack", &CAi::BreakAttack); + x10_triggerFuncs.emplace("ShouldStrafe", &CAi::ShouldStrafe); + x10_triggerFuncs.emplace("ShouldSpecialAttack", &CAi::ShouldSpecialAttack); + x10_triggerFuncs.emplace("LostInterest", &CAi::LostInterest); + x10_triggerFuncs.emplace("CodeTrigger", &CAi::CodeTrigger); + x10_triggerFuncs.emplace("BounceFind", &CAi::BounceFind); + x10_triggerFuncs.emplace("Random", &CAi::Random); + x10_triggerFuncs.emplace("FixedRandom", &CAi::FixedRandom); + x10_triggerFuncs.emplace("IsDizzy", &CAi::IsDizzy); + x10_triggerFuncs.emplace("ShouldCallForBackup", &CAi::ShouldCallForBackup); CAi::CreateFuncLookup(this); } -CAiStateFunc CAiFuncMap::GetStateFunc(const char* func) { - if (x0_stateFuncs.find(func) == x0_stateFuncs.end()) +CAiStateFunc CAiFuncMap::GetStateFunc(const char* func) const { + const auto iter = x0_stateFuncs.find(func); + + if (iter == x0_stateFuncs.cend()) { return nullptr; - return x0_stateFuncs[func]; + } + + return iter->second; } -CAiTriggerFunc CAiFuncMap::GetTriggerFunc(const char* func) { - if (x10_triggerFuncs.find(func) == x10_triggerFuncs.end()) +CAiTriggerFunc CAiFuncMap::GetTriggerFunc(const char* func) const { + const auto iter = x10_triggerFuncs.find(func); + + if (iter == x10_triggerFuncs.cend()) { return nullptr; - return x10_triggerFuncs[func]; + } + + return iter->second; } } // namespace urde diff --git a/Runtime/World/CAiFuncMap.hpp b/Runtime/World/CAiFuncMap.hpp index e5b6e4a77..06d81a624 100644 --- a/Runtime/World/CAiFuncMap.hpp +++ b/Runtime/World/CAiFuncMap.hpp @@ -1,24 +1,24 @@ #pragma once -#include "RetroTypes.hpp" +#include #include namespace urde { +class CAi; +class CStateManager; + enum class EStateMsg { Activate = 0, Update = 1, Deactivate = 2 }; -class CStateManager; -class CAi; -typedef void (CAi::*CAiStateFunc)(CStateManager&, EStateMsg, float); -typedef bool (CAi::*CAiTriggerFunc)(CStateManager&, float); +using CAiStateFunc = void (CAi::*)(CStateManager&, EStateMsg, float); +using CAiTriggerFunc = bool (CAi::*)(CStateManager&, float); class CAiFuncMap { - static const std::vector gkStateNames; std::unordered_map x0_stateFuncs; std::unordered_map x10_triggerFuncs; public: CAiFuncMap(); - CAiStateFunc GetStateFunc(const char*); - CAiTriggerFunc GetTriggerFunc(const char*); + CAiStateFunc GetStateFunc(const char*) const; + CAiTriggerFunc GetTriggerFunc(const char*) const; }; } // namespace urde diff --git a/Runtime/World/CAmbientAI.cpp b/Runtime/World/CAmbientAI.cpp index 24343ba8a..a1328c30d 100644 --- a/Runtime/World/CAmbientAI.cpp +++ b/Runtime/World/CAmbientAI.cpp @@ -1,7 +1,7 @@ #include "CAmbientAI.hpp" #include "CStateManager.hpp" #include "CPlayer.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CAmbientAI.hpp b/Runtime/World/CAmbientAI.hpp index 1d05d9506..8ba3dbb03 100644 --- a/Runtime/World/CAmbientAI.hpp +++ b/Runtime/World/CAmbientAI.hpp @@ -1,6 +1,17 @@ #pragma once -#include "CPhysicsActor.hpp" -#include "CDamageVulnerability.hpp" + +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CDamageVulnerability.hpp" +#include "Runtime/World/CPhysicsActor.hpp" + +#include + +namespace zeus { +class CTransform; +} namespace urde { class CAmbientAI : public CPhysicsActor { diff --git a/Runtime/World/CAnimationParameters.hpp b/Runtime/World/CAnimationParameters.hpp index a87138d9f..bb66c7247 100644 --- a/Runtime/World/CAnimationParameters.hpp +++ b/Runtime/World/CAnimationParameters.hpp @@ -1,6 +1,6 @@ #pragma once -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { diff --git a/Runtime/World/CDamageInfo.hpp b/Runtime/World/CDamageInfo.hpp index 6487d6a70..e1db1eab4 100644 --- a/Runtime/World/CDamageInfo.hpp +++ b/Runtime/World/CDamageInfo.hpp @@ -1,8 +1,8 @@ #pragma once -#include "RetroTypes.hpp" -#include "Weapon/CWeaponMgr.hpp" -#include "Weapon/CWeaponMode.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Weapon/CWeaponMgr.hpp" +#include "Runtime/Weapon/CWeaponMode.hpp" namespace DataSpec { struct SShotParam; diff --git a/Runtime/World/CDamageVulnerability.hpp b/Runtime/World/CDamageVulnerability.hpp index 32b929039..daca17b55 100644 --- a/Runtime/World/CDamageVulnerability.hpp +++ b/Runtime/World/CDamageVulnerability.hpp @@ -1,7 +1,7 @@ #pragma once -#include "RetroTypes.hpp" -#include "Weapon/CWeaponMode.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Weapon/CWeaponMode.hpp" namespace urde { diff --git a/Runtime/World/CDestroyableRock.hpp b/Runtime/World/CDestroyableRock.hpp index df5269be5..07bc26f25 100644 --- a/Runtime/World/CDestroyableRock.hpp +++ b/Runtime/World/CDestroyableRock.hpp @@ -1,6 +1,8 @@ #pragma once -#include "CAi.hpp" +#include + +#include "Runtime/World/CAi.hpp" namespace urde { diff --git a/Runtime/World/CEffect.hpp b/Runtime/World/CEffect.hpp index 04d3d297a..ef3b7fea2 100644 --- a/Runtime/World/CEffect.hpp +++ b/Runtime/World/CEffect.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CActor.hpp" +#include "Runtime/World/CActor.hpp" namespace urde { @@ -8,8 +8,8 @@ class CEffect : public CActor { public: CEffect(TUniqueId uid, const CEntityInfo& info, bool active, std::string_view name, const zeus::CTransform& xf); - void AddToRenderer(const zeus::CFrustum&, const CStateManager&) const override{} - void Render(const CStateManager&) const override{} + void AddToRenderer(const zeus::CFrustum&, const CStateManager&) const override {} + void Render(const CStateManager&) const override {} }; } // namespace urde diff --git a/Runtime/World/CEnergyDrainSource.hpp b/Runtime/World/CEnergyDrainSource.hpp index 4d2cdfe35..c71e4713d 100644 --- a/Runtime/World/CEnergyDrainSource.hpp +++ b/Runtime/World/CEnergyDrainSource.hpp @@ -1,6 +1,6 @@ #pragma once -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { class CEnergyDrainSource { diff --git a/Runtime/World/CEntity.hpp b/Runtime/World/CEntity.hpp index ad1f9aa21..912126227 100644 --- a/Runtime/World/CEntity.hpp +++ b/Runtime/World/CEntity.hpp @@ -1,8 +1,11 @@ #pragma once -#include "RetroTypes.hpp" -#include "ScriptObjectSupport.hpp" -#include "CEntityInfo.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CEntityInfo.hpp" +#include "Runtime/World/ScriptObjectSupport.hpp" namespace urde { class CStateManager; diff --git a/Runtime/World/CEntityInfo.hpp b/Runtime/World/CEntityInfo.hpp index 51758e6fe..abbfc09af 100644 --- a/Runtime/World/CEntityInfo.hpp +++ b/Runtime/World/CEntityInfo.hpp @@ -1,9 +1,9 @@ #pragma once #include -#include -#include "RetroTypes.hpp" -#include "World/ScriptObjectSupport.hpp" + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/ScriptObjectSupport.hpp" namespace urde { struct SConnection { @@ -18,8 +18,8 @@ class CEntityInfo { TEditorId x14_editorId; public: - CEntityInfo(TAreaId aid, const std::vector& conns, TEditorId eid = kInvalidEditorId) - : x0_areaId(aid), x4_conns(conns), x14_editorId(eid) {} + CEntityInfo(TAreaId aid, std::vector conns, TEditorId eid = kInvalidEditorId) + : x0_areaId(aid), x4_conns(std::move(conns)), x14_editorId(eid) {} TAreaId GetAreaId() const { return x0_areaId; } std::vector GetConnectionList() const { return x4_conns; } TEditorId GetEditorId() const { return x14_editorId; } diff --git a/Runtime/World/CEnvFxManager.cpp b/Runtime/World/CEnvFxManager.cpp index deb7e85e4..8be160b4e 100644 --- a/Runtime/World/CEnvFxManager.cpp +++ b/Runtime/World/CEnvFxManager.cpp @@ -5,7 +5,7 @@ #include "CSimplePool.hpp" #include "CRandom16.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CHUDBillboardEffect.hpp" #include "World/CWorld.hpp" #include "World/CPlayer.hpp" diff --git a/Runtime/World/CEnvFxManager.hpp b/Runtime/World/CEnvFxManager.hpp index ffec46764..8fe12fc1d 100644 --- a/Runtime/World/CEnvFxManager.hpp +++ b/Runtime/World/CEnvFxManager.hpp @@ -1,19 +1,26 @@ #pragma once -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "zeus/CAABox.hpp" -#include "Particle/CGenDescription.hpp" -#include "Audio/CSfxManager.hpp" -#include "Graphics/Shaders/CEnvFxShaders.hpp" -#include "Graphics/CLineRenderer.hpp" -#include "hecl/VertexBufferPool.hpp" -#include "hecl/UniformBufferPool.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Audio/CSfxManager.hpp" +#include "Runtime/Particle/CGenDescription.hpp" +#include "Runtime/Graphics/CLineRenderer.hpp" +#include "Runtime/Graphics/Shaders/CEnvFxShaders.hpp" + +#include +#include + +#include +#include +#include namespace urde { +class CActor; class CStateManager; class CTexture; -class CActor; enum class EEnvFxType { None, Snow, Rain, UnderwaterFlake }; diff --git a/Runtime/World/CExplosion.cpp b/Runtime/World/CExplosion.cpp index 041d2d366..5ca8c1092 100644 --- a/Runtime/World/CExplosion.cpp +++ b/Runtime/World/CExplosion.cpp @@ -1,7 +1,7 @@ #include "CExplosion.hpp" #include "CStateManager.hpp" #include "CGameLight.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "Graphics/CBooRenderer.hpp" #include "GameGlobalObjects.hpp" diff --git a/Runtime/World/CExplosion.hpp b/Runtime/World/CExplosion.hpp index 5971b0d39..8dd858bd4 100644 --- a/Runtime/World/CExplosion.hpp +++ b/Runtime/World/CExplosion.hpp @@ -1,8 +1,11 @@ #pragma once -#include "CEffect.hpp" -#include "Particle/CElementGen.hpp" -#include "Particle/CGenDescription.hpp" +#include +#include + +#include "Runtime/Particle/CElementGen.hpp" +#include "Runtime/Particle/CGenDescription.hpp" +#include "Runtime/World/CEffect.hpp" namespace urde { diff --git a/Runtime/World/CFire.cpp b/Runtime/World/CFire.cpp index c7a6d13fb..56066351f 100644 --- a/Runtime/World/CFire.cpp +++ b/Runtime/World/CFire.cpp @@ -5,7 +5,7 @@ #include "CPlayer.hpp" #include "GameGlobalObjects.hpp" #include "Graphics/CBooRenderer.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CFire::CFire(TToken effect, TUniqueId uid, TAreaId aId, bool active, TUniqueId owner, @@ -14,7 +14,7 @@ CFire::CFire(TToken effect, TUniqueId uid, TAreaId aId, bool ac float f3, float f4) : CActor(uid, active, "Fire"sv, CEntityInfo(aId, NullConnectionList), xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Projectile), CActorParameters::None(), owner) -, xe8_(new CElementGen(effect)) +, xe8_(std::make_unique(effect)) , xec_ownerId(owner) , xf0_damageInfo(dInfo) , x10c_damageInfo(dInfo) diff --git a/Runtime/World/CFire.hpp b/Runtime/World/CFire.hpp index 401a56f68..6988fda22 100644 --- a/Runtime/World/CFire.hpp +++ b/Runtime/World/CFire.hpp @@ -1,7 +1,10 @@ #pragma once -#include "CActor.hpp" -#include "CDamageInfo.hpp" +#include +#include + +#include "Runtime/World/CActor.hpp" +#include "Runtime/World/CDamageInfo.hpp" namespace urde { class CElementGen; diff --git a/Runtime/World/CFishCloud.cpp b/Runtime/World/CFishCloud.cpp index 8e0c33b13..73c818605 100644 --- a/Runtime/World/CFishCloud.cpp +++ b/Runtime/World/CFishCloud.cpp @@ -1,6 +1,6 @@ #include "CFishCloud.hpp" #include "CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" #include "Weapon/CWeapon.hpp" @@ -50,10 +50,10 @@ CFishCloud::CFishCloud(TUniqueId uid, bool active, std::string_view name, const x108_modifierSources.reserve(10); x250_25_worldSpace = true; // The result of a close_enough paradox (weird inlined test?) if (aRes.GetId().IsValid()) { - x1b0_models.emplace_back(new CModelData(aRes)); - x1b0_models.emplace_back(new CModelData(aRes)); - x1b0_models.emplace_back(new CModelData(aRes)); - x1b0_models.emplace_back(new CModelData(aRes)); + x1b0_models.emplace_back(std::make_unique(aRes)); + x1b0_models.emplace_back(std::make_unique(aRes)); + x1b0_models.emplace_back(std::make_unique(aRes)); + x1b0_models.emplace_back(std::make_unique(aRes)); x250_27_validModel = true; } if (part1.IsValid()) @@ -65,7 +65,7 @@ CFishCloud::CFishCloud(TUniqueId uid, bool active, std::string_view name, const if (part4.IsValid()) x1c4_particleDescs.push_back(g_SimplePool->GetObj({FOURCC('PART'), part4})); for (const auto& p : x1c4_particleDescs) { - x1f8_particleGens.emplace_back(new CElementGen(p)); + x1f8_particleGens.emplace_back(std::make_unique(p)); x1f8_particleGens.back()->SetParticleEmission(false); } x21c_deathParticleCounts.push_back(partCount1); diff --git a/Runtime/World/CFishCloud.hpp b/Runtime/World/CFishCloud.hpp index 10e571141..036606ef0 100644 --- a/Runtime/World/CFishCloud.hpp +++ b/Runtime/World/CFishCloud.hpp @@ -1,7 +1,13 @@ #pragma once -#include "CActor.hpp" -#include "Particle/CElementGen.hpp" +#include +#include + +#include "Runtime/rstl.hpp" +#include "Runtime/Particle/CElementGen.hpp" +#include "Runtime/World/CActor.hpp" + +#include namespace urde { diff --git a/Runtime/World/CFishCloudModifier.cpp b/Runtime/World/CFishCloudModifier.cpp index 819e7991a..031503684 100644 --- a/Runtime/World/CFishCloudModifier.cpp +++ b/Runtime/World/CFishCloudModifier.cpp @@ -2,7 +2,7 @@ #include "CFishCloud.hpp" #include "CStateManager.hpp" #include "CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CFishCloudModifier::CFishCloudModifier(TUniqueId uid, bool active, std::string_view name, const CEntityInfo& eInfo, diff --git a/Runtime/World/CFishCloudModifier.hpp b/Runtime/World/CFishCloudModifier.hpp index d2da1dac2..0d5efde12 100644 --- a/Runtime/World/CFishCloudModifier.hpp +++ b/Runtime/World/CFishCloudModifier.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CActor.hpp" +#include "Runtime/World/CActor.hpp" namespace urde { class CFishCloudModifier : public CActor { diff --git a/Runtime/World/CFluidPlane.hpp b/Runtime/World/CFluidPlane.hpp index f7d47e9a8..a4d848125 100644 --- a/Runtime/World/CFluidPlane.hpp +++ b/Runtime/World/CFluidPlane.hpp @@ -1,19 +1,27 @@ #pragma once -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "Graphics/CTexture.hpp" -#include "CFluidUVMotion.hpp" -#include "zeus/CAABox.hpp" -#include "zeus/CFrustum.hpp" -#include "Graphics/Shaders/CFluidPlaneShader.hpp" +#include +#include +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/CTexture.hpp" +#include "Runtime/Graphics/Shaders/CFluidPlaneShader.hpp" +#include "Runtime/World/CFluidUVMotion.hpp" + +#include +#include +#include +#include namespace urde { class CFluidUVMotion; +class CRipple; class CRippleManager; class CScriptWater; class CStateManager; -class CRipple; class CFluidPlaneRender { public: diff --git a/Runtime/World/CFluidPlaneCPU.cpp b/Runtime/World/CFluidPlaneCPU.cpp index bed3f0ab5..99180308a 100644 --- a/Runtime/World/CFluidPlaneCPU.cpp +++ b/Runtime/World/CFluidPlaneCPU.cpp @@ -5,7 +5,7 @@ #include "CStateManager.hpp" #include "CWorld.hpp" #include "World/CScriptWater.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "Camera/CGameCamera.hpp" #define kTableSize 2048 diff --git a/Runtime/World/CFluidPlaneCPU.hpp b/Runtime/World/CFluidPlaneCPU.hpp index a68094b3e..35ef93eca 100644 --- a/Runtime/World/CFluidPlaneCPU.hpp +++ b/Runtime/World/CFluidPlaneCPU.hpp @@ -1,7 +1,12 @@ #pragma once -#include "CFluidPlane.hpp" -#include "CRipple.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CFluidPlane.hpp" +#include "Runtime/World/CRipple.hpp" + +#include namespace urde { class CFluidUVMotion; diff --git a/Runtime/World/CFluidPlaneDoor.hpp b/Runtime/World/CFluidPlaneDoor.hpp index ac705a946..f3885b59d 100644 --- a/Runtime/World/CFluidPlaneDoor.hpp +++ b/Runtime/World/CFluidPlaneDoor.hpp @@ -1,7 +1,9 @@ #pragma once -#include "CFluidPlane.hpp" -#include "Graphics/Shaders/CFluidPlaneShader.hpp" +#include + +#include "Runtime/Graphics/Shaders/CFluidPlaneShader.hpp" +#include "Runtime/World/CFluidPlane.hpp" namespace urde { class CFluidPlaneDoor final : public CFluidPlane { diff --git a/Runtime/World/CFluidPlaneGPU.hpp b/Runtime/World/CFluidPlaneGPU.hpp index 723a07353..958c97d38 100644 --- a/Runtime/World/CFluidPlaneGPU.hpp +++ b/Runtime/World/CFluidPlaneGPU.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CFluidPlaneCPU.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CFluidPlaneCPU.hpp" namespace urde { diff --git a/Runtime/World/CFluidPlaneManager.hpp b/Runtime/World/CFluidPlaneManager.hpp index 39603029f..62bb95d9c 100644 --- a/Runtime/World/CFluidPlaneManager.hpp +++ b/Runtime/World/CFluidPlaneManager.hpp @@ -1,8 +1,10 @@ #pragma once -#include "RetroTypes.hpp" -#include "CRippleManager.hpp" -#include "boo/graphicsdev/IGraphicsDataFactory.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/World/CRippleManager.hpp" + +#include namespace urde { diff --git a/Runtime/World/CFluidUVMotion.hpp b/Runtime/World/CFluidUVMotion.hpp index a3b9664f6..fd506bcfc 100644 --- a/Runtime/World/CFluidUVMotion.hpp +++ b/Runtime/World/CFluidUVMotion.hpp @@ -1,7 +1,7 @@ #pragma once -#include "rstl.hpp" -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" namespace urde { class CFluidUVMotion { diff --git a/Runtime/World/CGameArea.cpp b/Runtime/World/CGameArea.cpp index 9d1a732a9..fe982d844 100644 --- a/Runtime/World/CGameArea.cpp +++ b/Runtime/World/CGameArea.cpp @@ -6,7 +6,7 @@ #include "World/CScriptAreaAttributes.hpp" #include "CGameState.hpp" #include "DataSpec/DNAMP1/MREA.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CGameArea.hpp b/Runtime/World/CGameArea.hpp index 35dfb8534..ff653bb89 100644 --- a/Runtime/World/CGameArea.hpp +++ b/Runtime/World/CGameArea.hpp @@ -1,22 +1,25 @@ #pragma once -#include "zeus/CVector2f.hpp" -#include "zeus/CColor.hpp" -#include "zeus/CAABox.hpp" -#include "CToken.hpp" -#include "RetroTypes.hpp" -#include "IGameArea.hpp" -#include "Collision/CAreaOctTree.hpp" -#include "hecl/ClientProcess.hpp" -#include "Graphics/CMetroidModelInstance.hpp" -#include "CObjectList.hpp" -#include "CWorldLight.hpp" -#include "Graphics/CPVSAreaSet.hpp" -#include "Graphics/CGraphics.hpp" -#include "Graphics/CModel.hpp" -#include "CPathFindArea.hpp" #include "Editor/ProjectResourceFactoryBase.hpp" -#include "World/CEnvFxManager.hpp" +#include "Runtime/CObjectList.hpp" +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Collision/CAreaOctTree.hpp" +#include "Runtime/Graphics/CGraphics.hpp" +#include "Runtime/Graphics/CMetroidModelInstance.hpp" +#include "Runtime/Graphics/CModel.hpp" +#include "Runtime/Graphics/CPVSAreaSet.hpp" +#include "Runtime/World/CEnvFxManager.hpp" +#include "Runtime/World/CPathFindArea.hpp" +#include "Runtime/World/CWorldLight.hpp" +#include "Runtime/World/IGameArea.hpp" + +#include + +#include +#include +#include +#include namespace urde { class CStateManager; diff --git a/Runtime/World/CGameLight.cpp b/Runtime/World/CGameLight.cpp index b39f3982c..30494517c 100644 --- a/Runtime/World/CGameLight.cpp +++ b/Runtime/World/CGameLight.cpp @@ -1,7 +1,7 @@ #include "World/CGameLight.hpp" #include "World/CActorParameters.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CGameLight.hpp b/Runtime/World/CGameLight.hpp index a5f7f3ebd..f64c850a0 100644 --- a/Runtime/World/CGameLight.hpp +++ b/Runtime/World/CGameLight.hpp @@ -1,6 +1,10 @@ #pragma once -#include "CActor.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CActor.hpp" +#include "Runtime/Graphics/CLight.hpp" namespace urde { class CGameLight : public CActor { diff --git a/Runtime/World/CHUDBillboardEffect.cpp b/Runtime/World/CHUDBillboardEffect.cpp index 302892aa1..640f62c9f 100644 --- a/Runtime/World/CHUDBillboardEffect.cpp +++ b/Runtime/World/CHUDBillboardEffect.cpp @@ -1,5 +1,5 @@ #include "CHUDBillboardEffect.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" #include "Camera/CGameCamera.hpp" #include "GameGlobalObjects.hpp" diff --git a/Runtime/World/CHUDBillboardEffect.hpp b/Runtime/World/CHUDBillboardEffect.hpp index 0afd69daf..cba72ef0d 100644 --- a/Runtime/World/CHUDBillboardEffect.hpp +++ b/Runtime/World/CHUDBillboardEffect.hpp @@ -1,11 +1,16 @@ #pragma once -#include "RetroTypes.hpp" -#include "World/CEffect.hpp" -#include "CToken.hpp" -#include "Particle/CElementGen.hpp" -#include "Particle/CParticleElectric.hpp" -#include "Particle/CParticleSwoosh.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Particle/CElementGen.hpp" +#include "Runtime/Particle/CParticleElectric.hpp" +#include "Runtime/Particle/CParticleSwoosh.hpp" +#include "Runtime/World/CEffect.hpp" + +#include namespace urde { class CGenDescription; diff --git a/Runtime/World/CHUDMemoParms.hpp b/Runtime/World/CHUDMemoParms.hpp index fc54b8b3f..61e3b678a 100644 --- a/Runtime/World/CHUDMemoParms.hpp +++ b/Runtime/World/CHUDMemoParms.hpp @@ -1,6 +1,6 @@ #pragma once -#include "IOStreams.hpp" +#include "Runtime/IOStreams.hpp" namespace urde { diff --git a/Runtime/World/CIceImpact.cpp b/Runtime/World/CIceImpact.cpp index 87a2cc9c9..88b1f73fd 100644 --- a/Runtime/World/CIceImpact.cpp +++ b/Runtime/World/CIceImpact.cpp @@ -1,5 +1,5 @@ #include "CIceImpact.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CIceImpact.hpp b/Runtime/World/CIceImpact.hpp index ab7be8ff5..a746ad7f3 100644 --- a/Runtime/World/CIceImpact.hpp +++ b/Runtime/World/CIceImpact.hpp @@ -1,6 +1,6 @@ #pragma once -#include "CEffect.hpp" +#include "Runtime/World/CEffect.hpp" namespace urde { diff --git a/Runtime/World/CKnockBackController.hpp b/Runtime/World/CKnockBackController.hpp index 0c552952c..3c3180832 100644 --- a/Runtime/World/CKnockBackController.hpp +++ b/Runtime/World/CKnockBackController.hpp @@ -1,12 +1,17 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" -#include "Character/CharacterCommon.hpp" -#include "Weapon/WeaponCommon.hpp" + +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Character/CharacterCommon.hpp" +#include "Runtime/Weapon/WeaponCommon.hpp" + +#include namespace urde { -class CPatterned; class CDamageInfo; +class CPatterned; enum class EKnockBackType { Direct, Radius }; diff --git a/Runtime/World/CLightParameters.hpp b/Runtime/World/CLightParameters.hpp index de70085b1..327c2cb60 100644 --- a/Runtime/World/CLightParameters.hpp +++ b/Runtime/World/CLightParameters.hpp @@ -1,8 +1,12 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CColor.hpp" -#include "Character/CActorLights.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Character/CActorLights.hpp" + +#include +#include namespace urde { @@ -72,18 +76,21 @@ public: } std::unique_ptr MakeActorLights() const { - if (!x1c_makeLights) - return {}; + if (!x1c_makeLights) { + return nullptr; + } - u32 updateFrames = GetFramesBetweenRecalculation(x24_lightRecalcOpts); - CActorLights* lights = new CActorLights(updateFrames, x2c_actorPosBias, x38_maxDynamicLights, x3c_maxAreaLights, - x1d_ambientChannelOverflow, x28_layerIdx == 1, - x20_worldLightingOptions == EWorldLightingOptions::DisableWorld, 0.1f); - if (x20_worldLightingOptions == EWorldLightingOptions::NoShadowCast) + const u32 updateFrames = GetFramesBetweenRecalculation(x24_lightRecalcOpts); + auto lights = std::make_unique(updateFrames, x2c_actorPosBias, x38_maxDynamicLights, + x3c_maxAreaLights, x1d_ambientChannelOverflow, x28_layerIdx == 1, + x20_worldLightingOptions == EWorldLightingOptions::DisableWorld, 0.1f); + if (x20_worldLightingOptions == EWorldLightingOptions::NoShadowCast) { lights->SetCastShadows(false); - if (x3c_maxAreaLights == 0) + } + if (x3c_maxAreaLights == 0) { lights->SetAmbientColor(x18_noLightsAmbient); - return std::unique_ptr(lights); + } + return lights; } const zeus::CColor& GetNoLightsAmbient() const { return x18_noLightsAmbient; } }; diff --git a/Runtime/World/CMorphBall.cpp b/Runtime/World/CMorphBall.cpp index 1c2b6eff6..478471651 100644 --- a/Runtime/World/CMorphBall.cpp +++ b/Runtime/World/CMorphBall.cpp @@ -1,37 +1,244 @@ -#include "GameGlobalObjects.hpp" -#include "CDependencyGroup.hpp" -#include "CMorphBall.hpp" -#include "CPlayer.hpp" -#include "CSimplePool.hpp" -#include "CGameLight.hpp" -#include "World/CWorld.hpp" -#include "World/CScriptAreaAttributes.hpp" -#include "TCastTo.hpp" -#include "Camera/CGameCamera.hpp" -#include "Collision/CGameCollision.hpp" -#include "CScriptSpiderBallAttractionSurface.hpp" -#include "CScriptSpiderBallWaypoint.hpp" -#include "CScriptWater.hpp" -#include "Graphics/CSkinnedModel.hpp" -#include "MP1/World/CMetroidBeta.hpp" -#include "Input/ControlMapper.hpp" +#include "Runtime/World/CMorphBall.hpp" + +#include + +#include "Runtime/CDependencyGroup.hpp" +#include "Runtime/CSimplePool.hpp" +#include "Runtime/Camera/CGameCamera.hpp" +#include "Runtime/Collision/CGameCollision.hpp" +#include "Runtime/GameGlobalObjects.hpp" +#include "Runtime/Graphics/CSkinnedModel.hpp" +#include "Runtime/Input/ControlMapper.hpp" +#include "Runtime/MP1/World/CMetroidBeta.hpp" +#include "Runtime/World/CGameLight.hpp" +#include "Runtime/World/CPlayer.hpp" +#include "Runtime/World/CScriptAreaAttributes.hpp" +#include "Runtime/World/CScriptSpiderBallAttractionSurface.hpp" +#include "Runtime/World/CScriptSpiderBallWaypoint.hpp" +#include "Runtime/World/CScriptWater.hpp" +#include "Runtime/World/CWorld.hpp" + +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { +namespace { +float kSpiderBallCollisionRadius; -static float kSpiderBallCollisionRadius; +constexpr std::array, 8> kBallCharacterTable{{ + {"SamusBallANCS", 0}, + {"SamusBallANCS", 0}, + {"SamusBallANCS", 1}, + {"SamusBallANCS", 0}, + {"SamusFusionBallANCS", 0}, + {"SamusFusionBallANCS", 2}, + {"SamusFusionBallANCS", 1}, + {"SamusFusionBallANCS", 3}, +}}; -const u8 CMorphBall::BallGlowColors[9][3] = { - {0xff, 0xff, 0xff}, {0xff, 0xff, 0xff}, {0xff, 0xff, 0xff}, {0xff, 0xff, 0xff}, {0xff, 0xd5, 0x19}, - {0xff, 0xff, 0xff}, {0xff, 0xff, 0xff}, {0xff, 0xff, 0xff}, {0xff, 0xff, 0xff}, +constexpr std::array, 8> kBallLowPolyTable{{ + {"SamusBallLowPolyCMDL", 0}, + {"SamusBallLowPolyCMDL", 0}, + {"SamusBallLowPolyCMDL", 1}, + {"SamusBallLowPolyCMDL", 0}, + {"SamusBallFusionLowPolyCMDL", 0}, + {"SamusBallFusionLowPolyCMDL", 2}, + {"SamusBallFusionLowPolyCMDL", 1}, + {"SamusBallFusionLowPolyCMDL", 3}, +}}; + +constexpr std::array, 8> kSpiderBallLowPolyTable{{ + {"SamusSpiderBallLowPolyCMDL", 0}, + {"SamusSpiderBallLowPolyCMDL", 0}, + {"SamusSpiderBallLowPolyCMDL", 1}, + {"SamusSpiderBallLowPolyCMDL", 2}, + {"SamusBallFusionLowPolyCMDL", 0}, + {"SamusBallFusionLowPolyCMDL", 2}, + {"SamusBallFusionLowPolyCMDL", 1}, + {"SamusBallFusionLowPolyCMDL", 3}, +}}; + +constexpr std::array, 8> kSpiderBallCharacterTable{{ + {"SamusSpiderBallANCS", 0}, + {"SamusSpiderBallANCS", 0}, + {"SamusSpiderBallANCS", 1}, + {"SamusPhazonBallANCS", 0}, + {"SamusFusionBallANCS", 0}, + {"SamusFusionBallANCS", 2}, + {"SamusFusionBallANCS", 1}, + {"SamusFusionBallANCS", 3}, +}}; + +constexpr std::array, 8> kSpiderBallGlassTable{{ + {"SamusSpiderBallGlassCMDL", 0}, + {"SamusSpiderBallGlassCMDL", 0}, + {"SamusSpiderBallGlassCMDL", 1}, + {"SamusPhazonBallGlassCMDL", 0}, + {"SamusSpiderBallGlassCMDL", 0}, + {"SamusSpiderBallGlassCMDL", 0}, + {"SamusSpiderBallGlassCMDL", 1}, + {"SamusPhazonBallGlassCMDL", 0}, +}}; + +constexpr std::array kSpiderBallGlowColorIdxTable{ + 3, 3, 2, 4, 5, 7, 6, 8, }; -const u8 CMorphBall::BallTransFlashColors[9][3] = {{0xc2, 0x7e, 0x10}, {0x66, 0xc4, 0xff}, {0x60, 0xff, 0x90}, - {0x33, 0x33, 0xff}, {0xff, 0x20, 0x20}, {0x0, 0x9d, 0xb6}, - {0xd3, 0xf1, 0x0}, {0xa6, 0x86, 0xd8}, {0xfb, 0x98, 0x21}}; +constexpr std::array kBallGlowColorIdxTable{ + 0, 0, 1, 0, 5, 7, 6, 8, +}; -const u8 CMorphBall::BallAuxGlowColors[9][3] = {{0xc2, 0x7e, 0x10}, {0x66, 0xc4, 0xff}, {0x6c, 0xff, 0x61}, - {0x33, 0x33, 0xff}, {0xff, 0x20, 0x20}, {0x0, 0x9d, 0xb6}, - {0xd3, 0xf1, 0x0}, {0xa6, 0x86, 0xd8}, {0xfb, 0x98, 0x21}}; +/* Maps material index to effect in generator array */ +constexpr std::array skWakeEffectMap{ + -1, -1, -1, -1, -1, -1, -1, + 0, // Phazon + 2, // Dirt + 3, // Lava + -1, + 4, // Snow + 5, // MudSlow + -1, -1, -1, -1, + 6, // Sand + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +}; + +constexpr std::array skBallRollSfx{ + 0xFFFF, + SFXsam_ballroll_stone, + SFXsam_ballroll_metal, + SFXsam_ballroll_grass, + SFXice_ballroll_ice, + 0xFFFF, + SFXsam_ballroll_grate, + SFXsam_ballroll_phazon, + SFXsam_ballroll_dirt, + SFXlav_ballroll_lava, + SFXsam_ballroll_lavastone, + SFXice_ballroll_snow, + SFXsam_ballroll_mud, + 0xFFFF, + SFXsam_ballroll_org, + SFXsam_ballroll_metal, + SFXsam_ballroll_metal, + SFXsam_ballroll_dirt, + 0xFFFF, + 0xFFFF, + 0xFFFF, + 0xFFFF, + SFXsam_ballroll_wood, + SFXsam_ballroll_org, +}; + +constexpr std::array skBallLandSfx{ + 0xFFFF, + SFXsam_ballland_stone, + SFXsam_ballland_metal, + SFXsam_ballland_grass, + SFXsam_ballland_ice, + 0xFFFF, + SFXsam_ballland_grate, + SFXsam_ballland_phazon, + SFXsam_landdirt_00, + SFXsam_ballland_lava, + SFXsam_ballland_lava, + SFXsam_ballland_snow, + SFXsam_ballland_mud, + 0xFFFF, + SFXsam_ballland_org, + SFXsam_ballland_metal, + SFXsam_ballland_metal, + SFXsam_landdirt_00, + 0xFFFF, + 0xFFFF, + 0xFFFF, + 0xFFFF, + SFXsam_ballland_wood, + SFXsam_ballland_org, +}; + +constexpr std::array skBallInnerGlowColors{{ + {0xc2, 0x7e, 0x10}, + {0x66, 0xc4, 0xff}, + {0x60, 0xff, 0x90}, + {0x33, 0x33, 0xff}, + {0xff, 0x80, 0x80}, + {0x0, 0x9d, 0xb6}, + {0xd3, 0xf1, 0x0}, + {0x60, 0x33, 0xff}, + {0xfb, 0x98, 0x21}, +}}; + +constexpr std::array BallSwooshColors{{ + {0xC2, 0x8F, 0x17}, + {0x70, 0xD4, 0xFF}, + {0x6A, 0xFF, 0x8A}, + {0x3D, 0x4D, 0xFF}, + {0xC0, 0x00, 0x00}, + {0x00, 0xBE, 0xDC}, + {0xDF, 0xFF, 0x00}, + {0xC4, 0x9E, 0xFF}, + {0xFF, 0x9A, 0x22}, +}}; + +constexpr std::array BallSwooshColorsCharged{{ + {0xFF, 0xE6, 0x00}, + {0xFF, 0xE6, 0x00}, + {0xFF, 0xE6, 0x00}, + {0xFF, 0xE6, 0x00}, + {0xFF, 0x80, 0x20}, + {0xFF, 0xE6, 0x00}, + {0xFF, 0xE6, 0x00}, + {0xFF, 0xE6, 0x00}, + {0xFF, 0xE6, 0x00}, +}}; + +constexpr std::array BallSwooshColorsJaggy{{ + {0xFF, 0xCC, 0x00}, + {0xFF, 0xCC, 0x00}, + {0xFF, 0xCC, 0x00}, + {0xFF, 0xCC, 0x00}, + {0xFF, 0xD5, 0x19}, + {0xFF, 0xCC, 0x00}, + {0xFF, 0xCC, 0x00}, + {0xFF, 0xCC, 0x00}, + {0xFF, 0xCC, 0x00}, +}}; +} // Anonymous namespace + +const std::array CMorphBall::BallGlowColors{{ + {0xff, 0xff, 0xff}, + {0xff, 0xff, 0xff}, + {0xff, 0xff, 0xff}, + {0xff, 0xff, 0xff}, + {0xff, 0xd5, 0x19}, + {0xff, 0xff, 0xff}, + {0xff, 0xff, 0xff}, + {0xff, 0xff, 0xff}, + {0xff, 0xff, 0xff}, +}}; + +const std::array CMorphBall::BallTransFlashColors{{ + {0xc2, 0x7e, 0x10}, + {0x66, 0xc4, 0xff}, + {0x60, 0xff, 0x90}, + {0x33, 0x33, 0xff}, + {0xff, 0x20, 0x20}, + {0x0, 0x9d, 0xb6}, + {0xd3, 0xf1, 0x0}, + {0xa6, 0x86, 0xd8}, + {0xfb, 0x98, 0x21}, +}}; + +const std::array CMorphBall::BallAuxGlowColors{{ + {0xc2, 0x7e, 0x10}, + {0x66, 0xc4, 0xff}, + {0x6c, 0xff, 0x61}, + {0x33, 0x33, 0xff}, + {0xff, 0x20, 0x20}, + {0x0, 0x9d, 0xb6}, + {0xd3, 0xf1, 0x0}, + {0xa6, 0x86, 0xd8}, + {0xfb, 0x98, 0x21}, +}}; CMorphBall::CMorphBall(CPlayer& player, float radius) : x0_player(player) @@ -95,18 +302,6 @@ void CMorphBall::LoadAnimationTokens(std::string_view ancsName) { } } -/* Maps material index to effect in generator array */ -static const s32 skWakeEffectMap[32] = {-1, -1, -1, -1, -1, -1, -1, - 0, // Phazon - 2, // Dirt - 3, // Lava - -1, - 4, // Snow - 5, // MudSlow - -1, -1, -1, -1, - 6, // Sand - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; - void CMorphBall::InitializeWakeEffects() { TToken nullParticle = CToken(TObjOwnerDerivedFromIObj::GetNewDerivedObject(std::make_unique())); @@ -199,56 +394,6 @@ void CMorphBall::RenderToShadowTex(CStateManager& mgr) { } } -static const u16 skBallRollSfx[] = {0xFFFF, - SFXsam_ballroll_stone, - SFXsam_ballroll_metal, - SFXsam_ballroll_grass, - SFXice_ballroll_ice, - 0xFFFF, - SFXsam_ballroll_grate, - SFXsam_ballroll_phazon, - SFXsam_ballroll_dirt, - SFXlav_ballroll_lava, - SFXsam_ballroll_lavastone, - SFXice_ballroll_snow, - SFXsam_ballroll_mud, - 0xFFFF, - SFXsam_ballroll_org, - SFXsam_ballroll_metal, - SFXsam_ballroll_metal, - SFXsam_ballroll_dirt, - 0xFFFF, - 0xFFFF, - 0xFFFF, - 0xFFFF, - SFXsam_ballroll_wood, - SFXsam_ballroll_org}; - -static const u16 skBallLandSfx[] = {0xFFFF, - SFXsam_ballland_stone, - SFXsam_ballland_metal, - SFXsam_ballland_grass, - SFXsam_ballland_ice, - 0xFFFF, - SFXsam_ballland_grate, - SFXsam_ballland_phazon, - SFXsam_landdirt_00, - SFXsam_ballland_lava, - SFXsam_ballland_lava, - SFXsam_ballland_snow, - SFXsam_ballland_mud, - 0xFFFF, - SFXsam_ballland_org, - SFXsam_ballland_metal, - SFXsam_ballland_metal, - SFXsam_landdirt_00, - 0xFFFF, - 0xFFFF, - 0xFFFF, - 0xFFFF, - SFXsam_ballland_wood, - SFXsam_ballland_org}; - void CMorphBall::SelectMorphBallSounds(const CMaterialList& mat) { u16 rollSfx; if (x0_player.x9c5_30_selectFluidBallSound) { @@ -257,7 +402,7 @@ void CMorphBall::SelectMorphBallSounds(const CMaterialList& mat) { else rollSfx = 1481; } else { - rollSfx = CPlayer::SfxIdFromMaterial(mat, skBallRollSfx, 24, 0xffff); + rollSfx = CPlayer::SfxIdFromMaterial(mat, skBallRollSfx.data(), skBallRollSfx.size(), 0xffff); } x0_player.x9c5_30_selectFluidBallSound = false; @@ -269,7 +414,7 @@ void CMorphBall::SelectMorphBallSounds(const CMaterialList& mat) { x1e34_rollSfx = rollSfx; } - x1e36_landSfx = CPlayer::SfxIdFromMaterial(mat, skBallLandSfx, 24, 0xffff); + x1e36_landSfx = CPlayer::SfxIdFromMaterial(mat, skBallLandSfx.data(), skBallLandSfx.size(), 0xffff); } void CMorphBall::UpdateMorphBallSounds(float dt) { @@ -1003,10 +1148,6 @@ void CMorphBall::LeaveMorphBallState(CStateManager& mgr) { StopEffects(); } -static const u8 skBallInnerGlowColors[9][3] = {{0xc2, 0x7e, 0x10}, {0x66, 0xc4, 0xff}, {0x60, 0xff, 0x90}, - {0x33, 0x33, 0xff}, {0xff, 0x80, 0x80}, {0x0, 0x9d, 0xb6}, - {0xd3, 0xf1, 0x0}, {0x60, 0x33, 0xff}, {0xfb, 0x98, 0x21}}; - void CMorphBall::UpdateEffects(float dt, CStateManager& mgr) { zeus::CTransform swooshToWorld = GetSwooshToWorld(); x19b8_slowBlueTailSwooshGen->SetTranslation(swooshToWorld.rotate({0.1f, 0.f, 0.f}) + swooshToWorld.origin); @@ -1082,29 +1223,37 @@ void CMorphBall::UpdateEffects(float dt, CStateManager& mgr) { if (x1c10_ballInnerGlowLight != kInvalidUniqueId) { if (TCastToPtr light = mgr.ObjectById(x1c10_ballInnerGlowLight)) { light->SetTranslation(swooshToWorld.origin + zeus::CVector3f(0.f, 0.f, GetBallRadius())); + std::optional lObj; - if (IsMorphBallTransitionFlashValid() && x19dc_morphBallTransitionFlashGen->SystemHasLight()) + if (IsMorphBallTransitionFlashValid() && x19dc_morphBallTransitionFlashGen->SystemHasLight()) { lObj.emplace(x19dc_morphBallTransitionFlashGen->GetLight()); - else if (x19d0_ballInnerGlowGen->SystemHasLight()) + } else if (x19d0_ballInnerGlowGen->SystemHasLight()) { lObj.emplace(x19d0_ballInnerGlowGen->GetLight()); + } + if (lObj) { - const u8* c = skBallInnerGlowColors[x8_ballGlowColorIdx]; - zeus::CColor color(c[0] / 255.f, c[1] / 255.f, c[2] / 255.f, 1.f); - lObj->SetColor(lObj->GetColor() * c); + const auto c = skBallInnerGlowColors[x8_ballGlowColorIdx]; + const zeus::CColor color(c[0] / 255.f, c[1] / 255.f, c[2] / 255.f, 1.f); + lObj->SetColor(lObj->GetColor() * color); + if (x0_player.GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Unmorphing) { float t = 0.f; - if (x0_player.x578_morphDuration != 0.f) + if (x0_player.x578_morphDuration != 0.f) { t = zeus::clamp(0.f, x0_player.x574_morphTime / x0_player.x578_morphDuration, 1.f); + } lObj->SetColor(zeus::CColor::lerp(lObj->GetColor(), zeus::skBlack, t)); } else if (x0_player.GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Morphing) { float t = 0.f; - if (x0_player.x578_morphDuration != 0.f) + if (x0_player.x578_morphDuration != 0.f) { t = zeus::clamp(0.f, x0_player.x574_morphTime / x0_player.x578_morphDuration, 1.f); - if (t < 0.5f) + } + if (t < 0.5f) { lObj->SetColor(zeus::CColor::lerp(zeus::skBlack, lObj->GetColor(), std::min(2.f * t, 1.f))); + } } else { lObj->SetColor(zeus::CColor::lerp(lObj->GetColor(), zeus::skWhite, x1c34_boostLightFactor)); } + light->SetLight(*lObj); } } @@ -1393,19 +1542,6 @@ void CMorphBall::PointGenerator(void* ctx, const std::vector(ctx)->GeneratePoints(vn); } -static const u8 BallSwooshColors[9][3] = { - {0xC2, 0x8F, 0x17}, {0x70, 0xD4, 0xFF}, {0x6A, 0xFF, 0x8A}, {0x3D, 0x4D, 0xFF}, {0xC0, 0x00, 0x00}, - {0x00, 0xBE, 0xDC}, {0xDF, 0xFF, 0x00}, {0xC4, 0x9E, 0xFF}, {0xFF, 0x9A, 0x22}, -}; - -static const u8 BallSwooshColorsCharged[9][3] = {{0xFF, 0xE6, 0x00}, {0xFF, 0xE6, 0x00}, {0xFF, 0xE6, 0x00}, - {0xFF, 0xE6, 0x00}, {0xFF, 0x80, 0x20}, {0xFF, 0xE6, 0x00}, - {0xFF, 0xE6, 0x00}, {0xFF, 0xE6, 0x00}, {0xFF, 0xE6, 0x00}}; - -static const u8 BallSwooshColorsJaggy[9][3] = {{0xFF, 0xCC, 0x00}, {0xFF, 0xCC, 0x00}, {0xFF, 0xCC, 0x00}, - {0xFF, 0xCC, 0x00}, {0xFF, 0xD5, 0x19}, {0xFF, 0xCC, 0x00}, - {0xFF, 0xCC, 0x00}, {0xFF, 0xCC, 0x00}, {0xFF, 0xCC, 0x00}}; - void CMorphBall::Render(const CStateManager& mgr, const CActorLights* lights) const { SCOPED_GRAPHICS_DEBUG_GROUP("CPlayer::Render", zeus::skPurple); zeus::CTransform ballToWorld = GetBallToWorld(); @@ -1466,7 +1602,7 @@ void CMorphBall::Render(const CStateManager& mgr, const CActorLights* lights) co } } - const u8* c = BallSwooshColors[x8_ballGlowColorIdx]; + ColorArray c = BallSwooshColors[x8_ballGlowColorIdx]; float swooshAlpha = x1c20_tireFactor / x1c24_maxTireFactor; zeus::CColor color0 = {c[0] / 255.f, c[1] / 255.f, c[2] / 255.f, swooshAlpha}; c = BallSwooshColorsCharged[x8_ballGlowColorIdx]; @@ -1568,12 +1704,19 @@ void CMorphBall::UpdateMorphBallTransitionFlash(float dt) { } void CMorphBall::RenderMorphBallTransitionFlash(const CStateManager&) const { - if (x19dc_morphBallTransitionFlashGen) { - const u8* c = BallTransFlashColors[x8_ballGlowColorIdx]; - zeus::CColor color = {c[0] / 255.f, c[1] / 255.f, c[2] / 255.f, 1.f}; - x19dc_morphBallTransitionFlashGen->SetModulationColor(color); - x19dc_morphBallTransitionFlashGen->Render(); + if (x19dc_morphBallTransitionFlashGen == nullptr) { + return; } + + const auto colorData = BallTransFlashColors[x8_ballGlowColorIdx]; + const zeus::CColor color = { + float(colorData[0]) / 255.f, + float(colorData[1]) / 255.f, + float(colorData[2]) / 255.f, + 1.f, + }; + x19dc_morphBallTransitionFlashGen->SetModulationColor(color); + x19dc_morphBallTransitionFlashGen->Render(); } void CMorphBall::UpdateIceBreakEffect(float dt) { @@ -1720,7 +1863,7 @@ void CMorphBall::CollidedWith(TUniqueId id, const CCollisionInfoList& list, CSta wakeMaterial = tmpMaterial; if (tmpMaterial != EMaterialTypes::NoStepLogic) { - int mappedIdx = skWakeEffectMap[int(tmpMaterial)]; + int mappedIdx = skWakeEffectMap[size_t(tmpMaterial)]; if (mappedIdx == 0) // Phazon { const CGameArea* area = mgr.GetWorld()->GetAreaAlways(mgr.GetNextAreaId()); @@ -1950,33 +2093,6 @@ void CMorphBall::FluidFXThink(CActor::EFluidState state, CScriptWater& water, CS } } -static const std::pair kBallCharacterTable[] = { - {"SamusBallANCS", 0}, {"SamusBallANCS", 0}, {"SamusBallANCS", 1}, {"SamusBallANCS", 0}, - {"SamusFusionBallANCS", 0}, {"SamusFusionBallANCS", 2}, {"SamusFusionBallANCS", 1}, {"SamusFusionBallANCS", 3}}; - -static const std::pair kBallLowPolyTable[] = { - {"SamusBallLowPolyCMDL", 0}, {"SamusBallLowPolyCMDL", 0}, {"SamusBallLowPolyCMDL", 1}, - {"SamusBallLowPolyCMDL", 0}, {"SamusBallFusionLowPolyCMDL", 0}, {"SamusBallFusionLowPolyCMDL", 2}, - {"SamusBallFusionLowPolyCMDL", 1}, {"SamusBallFusionLowPolyCMDL", 3}}; - -static const std::pair kSpiderBallLowPolyTable[] = { - {"SamusSpiderBallLowPolyCMDL", 0}, {"SamusSpiderBallLowPolyCMDL", 0}, {"SamusSpiderBallLowPolyCMDL", 1}, - {"SamusSpiderBallLowPolyCMDL", 2}, {"SamusBallFusionLowPolyCMDL", 0}, {"SamusBallFusionLowPolyCMDL", 2}, - {"SamusBallFusionLowPolyCMDL", 1}, {"SamusBallFusionLowPolyCMDL", 3}}; - -static const std::pair kSpiderBallCharacterTable[] = { - {"SamusSpiderBallANCS", 0}, {"SamusSpiderBallANCS", 0}, {"SamusSpiderBallANCS", 1}, {"SamusPhazonBallANCS", 0}, - {"SamusFusionBallANCS", 0}, {"SamusFusionBallANCS", 2}, {"SamusFusionBallANCS", 1}, {"SamusFusionBallANCS", 3}}; - -static const std::pair kSpiderBallGlassTable[] = { - {"SamusSpiderBallGlassCMDL", 0}, {"SamusSpiderBallGlassCMDL", 0}, {"SamusSpiderBallGlassCMDL", 1}, - {"SamusPhazonBallGlassCMDL", 0}, {"SamusSpiderBallGlassCMDL", 0}, {"SamusSpiderBallGlassCMDL", 0}, - {"SamusSpiderBallGlassCMDL", 1}, {"SamusPhazonBallGlassCMDL", 0}}; - -static const u32 kSpiderBallGlowColorIdxTable[] = {3, 3, 2, 4, 5, 7, 6, 8}; - -static const u32 kBallGlowColorIdxTable[] = {0, 0, 1, 0, 5, 7, 6, 8}; - void CMorphBall::LoadMorphBallModel(CStateManager& mgr) { bool spiderBall = mgr.GetPlayerState()->HasPowerUp(CPlayerState::EItemType::SpiderBall); diff --git a/Runtime/World/CMorphBall.hpp b/Runtime/World/CMorphBall.hpp index b3d7d77f6..c0f7e8b90 100644 --- a/Runtime/World/CMorphBall.hpp +++ b/Runtime/World/CMorphBall.hpp @@ -1,26 +1,31 @@ #pragma once -#include "World/CActor.hpp" -#include "World/ScriptObjectSupport.hpp" -#include "zeus/CVector3f.hpp" -#include "Collision/CCollidableSphere.hpp" -#include "RetroTypes.hpp" -#include "Character/CAnimCharacterSet.hpp" -#include "Particle/CParticleSwoosh.hpp" -#include "Particle/CElementGen.hpp" -#include "CWorldShadow.hpp" -#include "Graphics/CRainSplashGenerator.hpp" -#include "CMorphBallShadow.hpp" -#include "Collision/CCollisionInfoList.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Collision/CCollidableSphere.hpp" +#include "Runtime/Collision/CCollisionInfoList.hpp" +#include "Runtime/Graphics/CRainSplashGenerator.hpp" +#include "Runtime/Particle/CElementGen.hpp" +#include "Runtime/Particle/CParticleSwoosh.hpp" +#include "Runtime/World/CActor.hpp" +#include "Runtime/World/CMorphBallShadow.hpp" +#include "Runtime/World/CWorldShadow.hpp" +#include "Runtime/World/ScriptObjectSupport.hpp" + +#include +#include +#include namespace urde { class CActorLights; -class CPlayer; class CDamageInfo; -struct CFinalInput; +class CPlayer; class CScriptWater; class CStateManager; +struct CFinalInput; + class CMorphBall { public: enum class EBallBoostState { BoostAvailable, BoostDisabled }; @@ -279,9 +284,11 @@ public: bool IsInBoost() const { return x1de4_24_inBoost; } float GetBoostChargeTime() const { return x1de8_boostChargeTime; } - static const u8 BallGlowColors[9][3]; - static const u8 BallTransFlashColors[9][3]; - static const u8 BallAuxGlowColors[9][3]; + // Contains red, green, and blue channel values + using ColorArray = std::array; + static const std::array BallGlowColors; + static const std::array BallTransFlashColors; + static const std::array BallAuxGlowColors; }; } // namespace urde diff --git a/Runtime/World/CMorphBallShadow.hpp b/Runtime/World/CMorphBallShadow.hpp index 405873def..e1c281c40 100644 --- a/Runtime/World/CMorphBallShadow.hpp +++ b/Runtime/World/CMorphBallShadow.hpp @@ -1,14 +1,18 @@ #pragma once -#include "CToken.hpp" -#include "Graphics/CTexture.hpp" -#include "zeus/CAABox.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/Graphics/CTexture.hpp" + +#include namespace urde { -class CStateManager; -class CPlayer; -class CGameArea; class CActor; +class CGameArea; +class CPlayer; +class CStateManager; class CMorphBallShadow { std::list x0_actors; diff --git a/Runtime/World/CPathFindArea.hpp b/Runtime/World/CPathFindArea.hpp index 7b3b1dfe3..427f6cb5f 100644 --- a/Runtime/World/CPathFindArea.hpp +++ b/Runtime/World/CPathFindArea.hpp @@ -1,10 +1,16 @@ #pragma once -#include "IObj.hpp" -#include "zeus/CTransform.hpp" -#include "zeus/CAABox.hpp" -#include "IFactory.hpp" -#include "CPathFindRegion.hpp" +#include +#include + +#include "Runtime/IFactory.hpp" +#include "Runtime/IObj.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/World/CPathFindRegion.hpp" + +#include +#include +#include namespace urde { class CVParamTransfer; diff --git a/Runtime/World/CPathFindRegion.hpp b/Runtime/World/CPathFindRegion.hpp index ef669cd2d..b126f230e 100644 --- a/Runtime/World/CPathFindRegion.hpp +++ b/Runtime/World/CPathFindRegion.hpp @@ -1,7 +1,11 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CAABox.hpp" +#include + +#include "Runtime/RetroTypes.hpp" + +#include +#include namespace urde { class CPFArea; diff --git a/Runtime/World/CPathFindSearch.hpp b/Runtime/World/CPathFindSearch.hpp index 1c8cffd23..2248dc122 100644 --- a/Runtime/World/CPathFindSearch.hpp +++ b/Runtime/World/CPathFindSearch.hpp @@ -1,8 +1,13 @@ #pragma once -#include "RetroTypes.hpp" -#include "CPathFindArea.hpp" -#include "Graphics/CLineRenderer.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Graphics/CLineRenderer.hpp" +#include "Runtime/World/CPathFindArea.hpp" + +#include namespace urde { class CPathFindSearch; diff --git a/Runtime/World/CPatterned.cpp b/Runtime/World/CPatterned.cpp index 7f2d3a127..47cc563ba 100644 --- a/Runtime/World/CPatterned.cpp +++ b/Runtime/World/CPatterned.cpp @@ -1,7 +1,7 @@ #include "CPatterned.hpp" #include "Runtime/CStateManager.hpp" #include "CPatternedInfo.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CActorParameters.hpp" #include "Character/CPASAnimParmData.hpp" #include "GameGlobalObjects.hpp" @@ -9,7 +9,7 @@ #include "CPlayer.hpp" #include "Weapon/CGameProjectile.hpp" #include "Character/CAnimData.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "MP1/World/CSpacePirate.hpp" #include "MP1/World/CMetroid.hpp" #include "World/CStateMachine.hpp" @@ -944,7 +944,7 @@ void CPatterned::BuildBodyController(EBodyType bodyType) { if (x450_bodyController) return; - x450_bodyController.reset(new CBodyController(*this, x3b8_turnSpeed, bodyType)); + x450_bodyController = std::make_unique(*this, x3b8_turnSpeed, bodyType); auto anim = x450_bodyController->GetPASDatabase().FindBestAnimation(CPASAnimParmData(24, CPASAnimParm::FromEnum(0)), -1); x460_knockBackController.x81_26_enableShock = anim.first > 0.f; diff --git a/Runtime/World/CPatterned.hpp b/Runtime/World/CPatterned.hpp index 7c1516493..fe8842fed 100644 --- a/Runtime/World/CPatterned.hpp +++ b/Runtime/World/CPatterned.hpp @@ -1,14 +1,22 @@ #pragma once -#include "CAi.hpp" -#include "Character/CBodyController.hpp" -#include "Character/CSteeringBehaviors.hpp" -#include "Graphics/CVertexMorphEffect.hpp" -#include "Particle/CGenDescription.hpp" -#include "Particle/CElectricDescription.hpp" -#include "TCastTo.hpp" -#include "CDamageInfo.hpp" -#include "CKnockBackController.hpp" +#include +#include + +#include "Runtime/Character/CBodyController.hpp" +#include "Runtime/Character/CSteeringBehaviors.hpp" +#include "Runtime/Graphics/CVertexMorphEffect.hpp" +#include "Runtime/Particle/CElectricDescription.hpp" +#include "Runtime/Particle/CGenDescription.hpp" +#include "Runtime/World/CAi.hpp" +#include "Runtime/World/CDamageInfo.hpp" +#include "Runtime/World/CKnockBackController.hpp" + +#include "TCastTo.hpp" // Generated file, do not modify include path + +#include +#include +#include #ifndef DEFINE_PATTERNED #define DEFINE_PATTERNED(type) static constexpr ECharacter CharacterType = ECharacter::type; diff --git a/Runtime/World/CPatternedInfo.hpp b/Runtime/World/CPatternedInfo.hpp index e82f27c0a..ee29b63b2 100644 --- a/Runtime/World/CPatternedInfo.hpp +++ b/Runtime/World/CPatternedInfo.hpp @@ -1,11 +1,12 @@ #pragma once -#include "RetroTypes.hpp" -#include "CDamageInfo.hpp" -#include "CHealthInfo.hpp" -#include "CDamageVulnerability.hpp" -#include "CAnimationParameters.hpp" -#include "zeus/CVector3f.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CAnimationParameters.hpp" +#include "Runtime/World/CDamageInfo.hpp" +#include "Runtime/World/CDamageVulnerability.hpp" +#include "Runtime/World/CHealthInfo.hpp" + +#include namespace urde { diff --git a/Runtime/World/CPhysicsActor.cpp b/Runtime/World/CPhysicsActor.cpp index 3112855e2..76b3cb24a 100644 --- a/Runtime/World/CPhysicsActor.cpp +++ b/Runtime/World/CPhysicsActor.cpp @@ -1,5 +1,5 @@ #include "CPhysicsActor.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CPhysicsActor.hpp b/Runtime/World/CPhysicsActor.hpp index 0184e2264..a4aa4b46f 100644 --- a/Runtime/World/CPhysicsActor.hpp +++ b/Runtime/World/CPhysicsActor.hpp @@ -1,7 +1,14 @@ #pragma once -#include "CActor.hpp" -#include "Collision/CCollidableAABox.hpp" +#include + +#include "Runtime/Collision/CCollidableAABox.hpp" +#include "Runtime/World/CActor.hpp" + +#include +#include +#include +#include namespace urde { class CCollisionInfoList; diff --git a/Runtime/World/CPlayer.cpp b/Runtime/World/CPlayer.cpp index 29f72b133..60012cf91 100644 --- a/Runtime/World/CPlayer.cpp +++ b/Runtime/World/CPlayer.cpp @@ -1,71 +1,217 @@ -#include "CPlayer.hpp" -#include "CActorParameters.hpp" -#include "CStateManager.hpp" -#include "CSimplePool.hpp" -#include "GameGlobalObjects.hpp" -#include "Camera/CFirstPersonCamera.hpp" -#include "Camera/CBallCamera.hpp" -#include "Camera/CCinematicCamera.hpp" -#include "TCastTo.hpp" -#include "CScriptGrapplePoint.hpp" -#include "CPatterned.hpp" -#include "CScriptWater.hpp" -#include "CDependencyGroup.hpp" -#include "Character/CSteeringBehaviors.hpp" -#include "Weapon/CEnergyProjectile.hpp" -#include "MP1/World/CThardusRockProjectile.hpp" -#include "MP1/World/CMetroidBeta.hpp" -#include "Collision/CMetroidAreaCollider.hpp" -#include "Collision/CGameCollision.hpp" -#include "Input/ControlMapper.hpp" -#include "CGameState.hpp" -#include "MP1/CSamusHud.hpp" -#include "CHUDBillboardEffect.hpp" -#include "Audio/CStreamAudioManager.hpp" -#include "CScriptPlayerHint.hpp" -#include "CScriptAreaAttributes.hpp" +#include "Runtime/World/CPlayer.hpp" + +#include +#include +#include +#include + +#include "Runtime/CDependencyGroup.hpp" +#include "Runtime/CGameState.hpp" +#include "Runtime/CSimplePool.hpp" +#include "Runtime/CStateManager.hpp" +#include "Runtime/Audio/CStreamAudioManager.hpp" +#include "Runtime/Camera/CBallCamera.hpp" +#include "Runtime/Camera/CCinematicCamera.hpp" +#include "Runtime/Camera/CFirstPersonCamera.hpp" +#include "Runtime/Character/CSteeringBehaviors.hpp" +#include "Runtime/Collision/CGameCollision.hpp" +#include "Runtime/Collision/CMetroidAreaCollider.hpp" +#include "Runtime/GameGlobalObjects.hpp" +#include "Runtime/Input/ControlMapper.hpp" +#include "Runtime/MP1/CSamusHud.hpp" +#include "Runtime/MP1/World/CMetroidBeta.hpp" +#include "Runtime/MP1/World/CThardusRockProjectile.hpp" +#include "Runtime/Weapon/CEnergyProjectile.hpp" +#include "Runtime/World/CActorParameters.hpp" +#include "Runtime/World/CHUDBillboardEffect.hpp" +#include "Runtime/World/CPatterned.hpp" +#include "Runtime/World/CScriptAreaAttributes.hpp" +#include "Runtime/World/CScriptGrapplePoint.hpp" +#include "Runtime/World/CScriptPlayerHint.hpp" +#include "Runtime/World/CScriptWater.hpp" + +#include + +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { +namespace { +logvisor::Module Log("urde::CPlayer"); -static logvisor::Module Log("urde::CPlayer"); +constexpr CMaterialFilter SolidMaterialFilter = CMaterialFilter::MakeInclude(CMaterialList(EMaterialTypes::Solid)); -static const CMaterialFilter SolidMaterialFilter = CMaterialFilter::MakeInclude(CMaterialList(EMaterialTypes::Solid)); - -static const CMaterialFilter LineOfSightFilter = CMaterialFilter::MakeIncludeExclude( +constexpr CMaterialFilter LineOfSightFilter = CMaterialFilter::MakeIncludeExclude( {EMaterialTypes::Solid}, {EMaterialTypes::ProjectilePassthrough, EMaterialTypes::ScanPassthrough, EMaterialTypes::Player}); -static const CMaterialFilter OccluderFilter = CMaterialFilter::MakeIncludeExclude( +constexpr CMaterialFilter OccluderFilter = CMaterialFilter::MakeIncludeExclude( {EMaterialTypes::Solid, EMaterialTypes::Occluder}, {EMaterialTypes::ProjectilePassthrough, EMaterialTypes::ScanPassthrough, EMaterialTypes::Player}); -static CModelData MakePlayerAnimRes(CAssetId resId, const zeus::CVector3f& scale) { +constexpr CMaterialFilter BallTransitionCollide = CMaterialFilter::MakeIncludeExclude( + {EMaterialTypes::Solid}, {EMaterialTypes::ProjectilePassthrough, EMaterialTypes::Player, EMaterialTypes::Character, + EMaterialTypes::CameraPassthrough}); + +constexpr std::array skStrafeDistances{ + 11.8f, 11.8f, 11.8f, 5.0f, 6.0f, 5.0f, 5.0f, 6.0f, +}; + +constexpr std::array skDashStrafeDistances{ + 30.0f, 22.6f, 10.0f, 10.0f, 10.0f, 10.0f, 10.0f, +}; + +constexpr std::array skOrbitForwardDistances{ + 11.8f, 11.8f, 11.8f, 5.0f, 6.0f, 5.0f, 5.0f, 6.0f, +}; + +constexpr std::array UnlockMessageResBases{ + "STRG_SlideShow_Unlock1_", + "STRG_SlideShow_Unlock2_", +}; + +constexpr std::array skPlayerLandSfxSoft{ + 0xFFFF, + SFXsam_landstone_00, + SFXsam_landmetl_00, + SFXsam_landgrass_00, + SFXsam_landice_00, + 0xFFFF, + SFXsam_landgrate_00, + SFXsam_landphazon_00, + SFXsam_landdirt_00, + SFXlav_landlava_00, + SFXsam_landlavastone_00, + SFXsam_landsnow_00, + SFXsam_landmud_00, + 0xFFFF, + SFXsam_landgrass_00, + SFXsam_landmetl_00, + SFXsam_landmetl_00, + SFXsam_landdirt_00, + 0xFFFF, + 0xFFFF, + 0xFFFF, + 0xFFFF, + SFXsam_landwood_00, + SFXsam_b_landorg_00, +}; + +constexpr std::array skPlayerLandSfxHard{ + 0xFFFF, + SFXsam_landstone_02, + SFXsam_b_landmetl_02, + SFXsam_landgrass_02, + SFXsam_landice_02, + 0xFFFF, + SFXsam_landgrate_02, + SFXsam_landphazon_02, + SFXsam_landdirt_02, + SFXlav_landlava_02, + SFXsam_landlavastone_02, + SFXsam_landsnow_02, + SFXsam_landmud_02, + 0xFFFF, + SFXsam_landgrass_02, + SFXsam_b_landmetl_02, + SFXsam_b_landmetl_02, + SFXsam_landdirt_02, + 0xFFFF, + 0xFFFF, + 0xFFFF, + 0xFFFF, + SFXsam_landwood_02, + SFXsam_landorg_02, +}; + +constexpr std::array skLeftStepSounds{ + 0xFFFF, + SFXsam_wlkstone_00, + SFXsam_wlkmetal_00, + SFXsam_b_wlkgrass_00, + SFXsam_wlkice_00, + 0xFFFF, + SFXsam_wlkgrate_00, + SFXsam_wlkphazon_00, + SFXsam_wlkdirt_00, + SFXlav_wlklava_00, + SFXsam_wlklavastone_00, + SFXsam_wlksnow_00, + SFXsam_wlkmud_00, + 0xFFFF, + SFXsam_b_wlkorg_00, + SFXsam_wlkmetal_00, + SFXsam_wlkmetal_00, + SFXsam_wlkdirt_00, + 0xFFFF, + 0xFFFF, + 0xFFFF, + 0xFFFF, + SFXsam_wlkwood_00, + SFXsam_b_wlkorg_00, +}; + +constexpr std::array skRightStepSounds{ + 0xFFFF, + SFXsam_wlkstone_01, + SFXsam_wlkmetal_01, + SFXsam_b_wlkgrass_01, + SFXsam_wlkice_01, + 0xFFFF, + SFXsam_wlkgrate_01, + SFXsam_wlkphazon_01, + SFXsam_wlkdirt_01, + SFXlav_wlklava_01, + SFXsam_wlklavastone_01, + SFXsam_wlksnow_01, + SFXsam_wlkmud_01, + 0xFFFF, + SFXsam_b_wlkorg_01, + SFXsam_wlkmetal_01, + SFXsam_wlkmetal_01, + SFXsam_wlkdirt_01, + 0xFFFF, + 0xFFFF, + 0xFFFF, + 0xFFFF, + SFXsam_wlkwood_01, + SFXsam_b_wlkorg_01, +}; + +constexpr std::array, 4> skVisorToItemMapping{{ + {CPlayerState::EItemType::CombatVisor, ControlMapper::ECommands::NoVisor}, + {CPlayerState::EItemType::XRayVisor, ControlMapper::ECommands::XrayVisor}, + {CPlayerState::EItemType::ScanVisor, ControlMapper::ECommands::InviroVisor}, + {CPlayerState::EItemType::ThermalVisor, ControlMapper::ECommands::ThermoVisor}, +}}; + +CModelData MakePlayerAnimRes(CAssetId resId, const zeus::CVector3f& scale) { return {CAnimRes(resId, 0, scale, 0, true), 1}; } -static uint32_t GetOrbitScreenBoxHalfExtentXScaled(int zone) { +uint32_t GetOrbitScreenBoxHalfExtentXScaled(int zone) { return g_tweakPlayer->GetOrbitScreenBoxHalfExtentX(zone) * g_Viewport.x8_width / 640; } -static uint32_t GetOrbitScreenBoxHalfExtentYScaled(int zone) { +uint32_t GetOrbitScreenBoxHalfExtentYScaled(int zone) { return g_tweakPlayer->GetOrbitScreenBoxHalfExtentY(zone) * g_Viewport.xc_height / 448; } -static uint32_t GetOrbitScreenBoxCenterXScaled(int zone) { +uint32_t GetOrbitScreenBoxCenterXScaled(int zone) { return g_tweakPlayer->GetOrbitScreenBoxCenterX(zone) * g_Viewport.x8_width / 640; } -static uint32_t GetOrbitScreenBoxCenterYScaled(int zone) { +uint32_t GetOrbitScreenBoxCenterYScaled(int zone) { return g_tweakPlayer->GetOrbitScreenBoxCenterY(zone) * g_Viewport.xc_height / 448; } -static uint32_t GetOrbitZoneIdealXScaled(int zone) { +uint32_t GetOrbitZoneIdealXScaled(int zone) { return g_tweakPlayer->GetOrbitZoneIdealX(zone) * g_Viewport.x8_width / 640; } -static uint32_t GetOrbitZoneIdealYScaled(int zone) { +uint32_t GetOrbitZoneIdealYScaled(int zone) { return g_tweakPlayer->GetOrbitZoneIdealY(zone) * g_Viewport.xc_height / 448; } +} // Anonymous namespace CPlayer::CPlayer(TUniqueId uid, const zeus::CTransform& xf, const zeus::CAABox& aabb, CAssetId resId, const zeus::CVector3f& playerScale, float mass, float stepUp, float stepDown, float ballRadius, @@ -76,9 +222,9 @@ CPlayer::CPlayer(TUniqueId uid, const zeus::CTransform& xf, const zeus::CAABox& , x2d8_fpBounds(aabb) , x7d0_animRes(resId, 0, playerScale, 0, true) , x7d8_beamScale(playerScale) { - x490_gun.reset(new CPlayerGun(uid)); + x490_gun = std::make_unique(uid); x49c_gunHolsterRemTime = g_tweakPlayerGun->GetGunNotFiringTime(); - x4a0_failsafeTest.reset(new CFailsafeTest()); + x4a0_failsafeTest = std::make_unique(); x76c_cameraBob.reset( new CPlayerCameraBob(CPlayerCameraBob::ECameraBobType::One, zeus::CVector2f{CPlayerCameraBob::kCameraBobExtentX, CPlayerCameraBob::kCameraBobExtentY}, @@ -90,7 +236,7 @@ CPlayer::CPlayer(TUniqueId uid, const zeus::CTransform& xf, const zeus::CAABox& CAssetId beamId = g_tweakPlayerRes->GetBeamBallTransitionModel(x7ec_beam); x7f0_ballTransitionBeamModel = std::make_unique(CStaticRes(beamId, playerScale)); x730_transitionModels.reserve(3); - x768_morphball.reset(new CMorphBall(*this, ballRadius)); + x768_morphball = std::make_unique(*this, ballRadius); SetInertiaTensorScalar(xe8_mass); x1f4_lastNonCollidingState = GetMotionState(); @@ -141,10 +287,6 @@ float CPlayer::GetTransitionAlpha(const zeus::CVector3f& camPos, float zNear) co return 0.f; } -static const CMaterialFilter BallTransitionCollide = CMaterialFilter::MakeIncludeExclude( - {EMaterialTypes::Solid}, {EMaterialTypes::ProjectilePassthrough, EMaterialTypes::Player, EMaterialTypes::Character, - EMaterialTypes::CameraPassthrough}); - s32 CPlayer::ChooseTransitionToAnimation(float dt, CStateManager& mgr) const { if (x258_movementState == EPlayerMovementState::ApplyJump) return 3; // B_airposetoball_samus @@ -476,11 +618,12 @@ void CPlayer::UpdatePlayerSounds(float dt) { void CPlayer::Update(float dt, CStateManager& mgr) { SetCoefficientOfRestitutionModifier(0.f); UpdateMorphBallTransition(dt, mgr); - CPlayerState::EBeamId newBeam = mgr.GetPlayerState()->GetCurrentBeam(); + + const CPlayerState::EBeamId newBeam = mgr.GetPlayerState()->GetCurrentBeam(); if (newBeam != x7ec_beam) { x7ec_beam = newBeam; - x7f0_ballTransitionBeamModel.reset( - new CModelData(CStaticRes(g_tweakPlayerRes->GetBeamBallTransitionModel(x7ec_beam), x7d8_beamScale))); + x7f0_ballTransitionBeamModel = std::make_unique( + CStaticRes(g_tweakPlayerRes->GetBeamBallTransitionModel(x7ec_beam), x7d8_beamScale)); } if (!mgr.GetPlayerState()->IsPlayerAlive()) { @@ -560,12 +703,6 @@ void CPlayer::Update(float dt, CStateManager& mgr) { } } -static const float skStrafeDistances[] = {11.8f, 11.8f, 11.8f, 5.0f, 6.0f, 5.0f, 5.0f, 6.0f}; - -static const float skDashStrafeDistances[] = {30.0f, 22.6f, 10.0f, 10.0f, 10.0f, 10.0f, 10.0f}; - -static const float skOrbitForwardDistances[] = {11.8f, 11.8f, 11.8f, 5.0f, 6.0f, 5.0f, 5.0f, 6.0f}; - float CPlayer::UpdateCameraBob(float dt, CStateManager& mgr) { float bobMag = 0.f; CPlayerCameraBob::ECameraBobState state; @@ -579,11 +716,11 @@ float CPlayer::UpdateCameraBob(float dt, CStateManager& mgr) { } } else { state = CPlayerCameraBob::ECameraBobState::Orbit; - float f29 = backupVel.dot(x34_transform.basis[0]); - float f30 = backupVel.dot(x34_transform.basis[1]); - float maxVel = GetActualFirstPersonMaxVelocity(dt); - float strafeDist = - skStrafeDistances[int(x2b0_outOfWaterTicks == 2 ? x2ac_surfaceRestraint : ESurfaceRestraints::Water)]; + const float f29 = backupVel.dot(x34_transform.basis[0]); + const float f30 = backupVel.dot(x34_transform.basis[1]); + const float maxVel = GetActualFirstPersonMaxVelocity(dt); + const float strafeDist = + skStrafeDistances[size_t(x2b0_outOfWaterTicks == 2 ? x2ac_surfaceRestraint : ESurfaceRestraints::Water)]; bobMag = std::min(std::sqrt(f30 * f30 + f29 * f29) / std::sqrt(strafeDist * strafeDist + maxVel * maxVel) * CPlayerCameraBob::kOrbitBobScale, CPlayerCameraBob::kMaxOrbitBobScale); @@ -662,9 +799,9 @@ void CPlayer::PostUpdate(float dt, CStateManager& mgr) { float cameraBobT = 0.f; if (mgr.GetCameraManager()->IsInCinematicCamera()) { - zeus::CVector2f bobExtent(CPlayerCameraBob::kCameraBobExtentX, CPlayerCameraBob::kCameraBobExtentY); - x76c_cameraBob.reset( - new CPlayerCameraBob(CPlayerCameraBob::ECameraBobType::One, bobExtent, CPlayerCameraBob::kCameraBobPeriod)); + const zeus::CVector2f bobExtent(CPlayerCameraBob::kCameraBobExtentX, CPlayerCameraBob::kCameraBobExtentY); + x76c_cameraBob = std::make_unique(CPlayerCameraBob::ECameraBobType::One, bobExtent, + CPlayerCameraBob::kCameraBobPeriod); } else { cameraBobT = UpdateCameraBob(dt, mgr); } @@ -1030,28 +1167,29 @@ static bool IsDataLoreResearchScan(CAssetId id) { } } -static const char* UnlockMessageResBases[] = {"STRG_SlideShow_Unlock1_", "STRG_SlideShow_Unlock2_"}; - static CAssetId UpdatePersistentScanPercent(u32 prevLogScans, u32 logScans, u32 totalLogScans) { - if (prevLogScans == logScans) + if (prevLogScans == logScans) { return {}; + } - float scanPercent = logScans / float(totalLogScans) * 100.f; - float prevScanPercent = prevLogScans / float(totalLogScans) * 100.f; - float scanMessageInterval = g_tweakSlideShow->GetScanPercentInterval(); - auto scanPercentProgStep = int(scanPercent / scanMessageInterval); - auto prevScanPercentProgStep = int(prevScanPercent / scanMessageInterval); - bool firstTime = scanPercent > g_GameState->SystemOptions().GetLogScanPercent(); + const float scanPercent = logScans / float(totalLogScans) * 100.f; + const float prevScanPercent = prevLogScans / float(totalLogScans) * 100.f; + const float scanMessageInterval = g_tweakSlideShow->GetScanPercentInterval(); + const auto scanPercentProgStep = int(scanPercent / scanMessageInterval); + const auto prevScanPercentProgStep = int(prevScanPercent / scanMessageInterval); + const bool firstTime = scanPercent > g_GameState->SystemOptions().GetLogScanPercent(); - if (firstTime) + if (firstTime) { g_GameState->SystemOptions().SetLogScanPercent(u32(scanPercent)); + } if (scanPercentProgStep > prevScanPercentProgStep) { - auto message = - std::string(UnlockMessageResBases[zeus::clamp(0, scanPercentProgStep - 1, 1)]) + (firstTime ? '1' : '2'); - auto id = g_ResFactory->GetResourceIdByName(message.c_str()); - if (id != nullptr) + const char* const messageResBase = UnlockMessageResBases[zeus::clamp(0, scanPercentProgStep - 1, 1)]; + const auto message = std::string(messageResBase).append(1, firstTime ? '1' : '2'); + const auto id = g_ResFactory->GetResourceIdByName(message); + if (id != nullptr) { return id->id; + } } return {}; @@ -2327,56 +2465,6 @@ void CPlayer::PreThink(float dt, CStateManager& mgr) { xa04_preThinkDt = dt; } -static const u16 skPlayerLandSfxSoft[] = {0xFFFF, - SFXsam_landstone_00, - SFXsam_landmetl_00, - SFXsam_landgrass_00, - SFXsam_landice_00, - 0xFFFF, - SFXsam_landgrate_00, - SFXsam_landphazon_00, - SFXsam_landdirt_00, - SFXlav_landlava_00, - SFXsam_landlavastone_00, - SFXsam_landsnow_00, - SFXsam_landmud_00, - 0xFFFF, - SFXsam_landgrass_00, - SFXsam_landmetl_00, - SFXsam_landmetl_00, - SFXsam_landdirt_00, - 0xFFFF, - 0xFFFF, - 0xFFFF, - 0xFFFF, - SFXsam_landwood_00, - SFXsam_b_landorg_00}; - -static const u16 skPlayerLandSfxHard[] = {0xFFFF, - SFXsam_landstone_02, - SFXsam_b_landmetl_02, - SFXsam_landgrass_02, - SFXsam_landice_02, - 0xFFFF, - SFXsam_landgrate_02, - SFXsam_landphazon_02, - SFXsam_landdirt_02, - SFXlav_landlava_02, - SFXsam_landlavastone_02, - SFXsam_landsnow_02, - SFXsam_landmud_02, - 0xFFFF, - SFXsam_landgrass_02, - SFXsam_b_landmetl_02, - SFXsam_b_landmetl_02, - SFXsam_landdirt_02, - 0xFFFF, - 0xFFFF, - 0xFFFF, - 0xFFFF, - SFXsam_landwood_02, - SFXsam_landorg_02}; - void CPlayer::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr) { switch (msg) { case EScriptObjectMessage::OnFloor: @@ -2385,12 +2473,12 @@ void CPlayer::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CState if (x258_movementState != EPlayerMovementState::Falling) { float hardThres = 30.f * 2.f * -g_tweakPlayer->GetNormalGravAccel(); hardThres = (hardThres != 0.f) ? hardThres * std::sqrt(hardThres) : 0.f; - float landVol = zeus::clamp(95.f, 1.6f * -x794_lastVelocity.z() + 95.f, 127.f) / 127.f; + const float landVol = zeus::clamp(95.f, 1.6f * -x794_lastVelocity.z() + 95.f, 127.f) / 127.f; u16 landSfx; if (-x794_lastVelocity.z() < hardThres) { - landSfx = GetMaterialSoundUnderPlayer(mgr, skPlayerLandSfxSoft, 24, 0xffff); + landSfx = GetMaterialSoundUnderPlayer(mgr, skPlayerLandSfxSoft.data(), skPlayerLandSfxSoft.size(), 0xffff); } else { - landSfx = GetMaterialSoundUnderPlayer(mgr, skPlayerLandSfxHard, 24, 0xffff); + landSfx = GetMaterialSoundUnderPlayer(mgr, skPlayerLandSfxHard.data(), skPlayerLandSfxHard.size(), 0xffff); StartSamusVoiceSfx(SFXsam_voxland_02, 1.f, 5); x55c_damageAmt = 0.f; x560_prevDamageAmt = 10.f; @@ -2534,56 +2622,6 @@ void CPlayer::SetVisorSteam(float targetAlpha, float alphaInDur, float alphaOutD x7a0_visorSteam.SetSteam(targetAlpha, alphaInDur, alphaOutDur, txtr, affectsThermal); } -static const u16 skLeftStepSounds[] = {0xFFFF, - SFXsam_wlkstone_00, - SFXsam_wlkmetal_00, - SFXsam_b_wlkgrass_00, - SFXsam_wlkice_00, - 0xFFFF, - SFXsam_wlkgrate_00, - SFXsam_wlkphazon_00, - SFXsam_wlkdirt_00, - SFXlav_wlklava_00, - SFXsam_wlklavastone_00, - SFXsam_wlksnow_00, - SFXsam_wlkmud_00, - 0xFFFF, - SFXsam_b_wlkorg_00, - SFXsam_wlkmetal_00, - SFXsam_wlkmetal_00, - SFXsam_wlkdirt_00, - 0xFFFF, - 0xFFFF, - 0xFFFF, - 0xFFFF, - SFXsam_wlkwood_00, - SFXsam_b_wlkorg_00}; - -static const u16 skRightStepSounds[] = {0xFFFF, - SFXsam_wlkstone_01, - SFXsam_wlkmetal_01, - SFXsam_b_wlkgrass_01, - SFXsam_wlkice_01, - 0xFFFF, - SFXsam_wlkgrate_01, - SFXsam_wlkphazon_01, - SFXsam_wlkdirt_01, - SFXlav_wlklava_01, - SFXsam_wlklavastone_01, - SFXsam_wlksnow_01, - SFXsam_wlkmud_01, - 0xFFFF, - SFXsam_b_wlkorg_01, - SFXsam_wlkmetal_01, - SFXsam_wlkmetal_01, - SFXsam_wlkdirt_01, - 0xFFFF, - 0xFFFF, - 0xFFFF, - 0xFFFF, - SFXsam_wlkwood_01, - SFXsam_b_wlkorg_01}; - void CPlayer::UpdateFootstepSounds(const CFinalInput& input, CStateManager& mgr, float dt) { if (x2f8_morphBallState != EPlayerMorphBallState::Unmorphed || x258_movementState != EPlayerMovementState::OnGround || x3dc_inFreeLook || x3dd_lookButtonHeld) @@ -2644,10 +2682,11 @@ void CPlayer::UpdateFootstepSounds(const CFinalInput& input, CStateManager& mgr, } } else { u16 sfx; - if (x790_footstepSfxSel == EFootstepSfx::Left) - sfx = GetMaterialSoundUnderPlayer(mgr, skLeftStepSounds, 24, -1); - else - sfx = GetMaterialSoundUnderPlayer(mgr, skRightStepSounds, 24, -1); + if (x790_footstepSfxSel == EFootstepSfx::Left) { + sfx = GetMaterialSoundUnderPlayer(mgr, skLeftStepSounds.data(), skLeftStepSounds.size(), 0xffff); + } else { + sfx = GetMaterialSoundUnderPlayer(mgr, skRightStepSounds.data(), skRightStepSounds.size(), 0xffff); + } CSfxHandle hnd = CSfxManager::SfxStart(sfx, sfxVol, 0.f, true, 0x7f, false, kInvalidAreaId); ApplySubmergedPitchBend(hnd); } @@ -2660,7 +2699,7 @@ void CPlayer::UpdateFootstepSounds(const CFinalInput& input, CStateManager& mgr, } } -u16 CPlayer::GetMaterialSoundUnderPlayer(const CStateManager& mgr, const u16* table, u32 length, u16 defId) const { +u16 CPlayer::GetMaterialSoundUnderPlayer(const CStateManager& mgr, const u16* table, size_t length, u16 defId) const { u16 ret = defId; zeus::CAABox aabb = GetBoundingBox(); aabb.accumulateBounds(x34_transform.origin + zeus::skDown); @@ -2674,9 +2713,9 @@ u16 CPlayer::GetMaterialSoundUnderPlayer(const CStateManager& mgr, const u16* ta return ret; } -u16 CPlayer::SfxIdFromMaterial(const CMaterialList& mat, const u16* idList, u32 tableLen, u16 defId) { +u16 CPlayer::SfxIdFromMaterial(const CMaterialList& mat, const u16* idList, size_t tableLen, u16 defId) { u16 id = defId; - for (u32 i = 0; i < tableLen; ++i) { + for (size_t i = 0; i < tableLen; ++i) { if (mat.HasMaterial(EMaterialTypes(i)) && idList[i] != 0xFFFF) id = idList[i]; } @@ -2692,12 +2731,6 @@ void CPlayer::UpdateVisorTransition(float dt, CStateManager& mgr) { mgr.GetPlayerState()->UpdateVisorTransition(dt); } -static const std::pair skVisorToItemMapping[] = { - {CPlayerState::EItemType::CombatVisor, ControlMapper::ECommands::NoVisor}, - {CPlayerState::EItemType::XRayVisor, ControlMapper::ECommands::XrayVisor}, - {CPlayerState::EItemType::ScanVisor, ControlMapper::ECommands::InviroVisor}, - {CPlayerState::EItemType::ThermalVisor, ControlMapper::ECommands::ThermoVisor}}; - void CPlayer::UpdateVisorState(const CFinalInput& input, float dt, CStateManager& mgr) { x7a0_visorSteam.Update(dt); if (x7a0_visorSteam.AffectsThermal()) @@ -2717,17 +2750,20 @@ void CPlayer::UpdateVisorState(const CFinalInput& input, float dt, CStateManager DrawGun(mgr); } - for (int i = 0; i < 4; ++i) { - if (mgr.GetPlayerState()->HasPowerUp(skVisorToItemMapping[i].first) && - ControlMapper::GetPressInput(skVisorToItemMapping[i].second, input)) { + for (size_t i = 0; i < skVisorToItemMapping.size(); ++i) { + const auto mapping = skVisorToItemMapping[i]; + + if (mgr.GetPlayerState()->HasPowerUp(mapping.first) && ControlMapper::GetPressInput(mapping.second, input)) { x9c4_24_visorChangeRequested = true; - CPlayerState::EPlayerVisor visor = CPlayerState::EPlayerVisor(i); + const auto visor = CPlayerState::EPlayerVisor(i); + if (mgr.GetPlayerState()->GetTransitioningVisor() != visor) { mgr.GetPlayerState()->StartTransitionToVisor(visor); - if (visor == CPlayerState::EPlayerVisor::Scan) + if (visor == CPlayerState::EPlayerVisor::Scan) { HolsterGun(mgr); - else + } else { DrawGun(mgr); + } } } } @@ -5054,17 +5090,21 @@ void CPlayer::FinishSidewaysDash() { } void CPlayer::ComputeDash(const CFinalInput& input, float dt, CStateManager& mgr) { - float strafeInput = StrafeInput(input); - float forwardInput = ForwardInput(input, TurnInput(input)); + const float strafeInput = StrafeInput(input); + const float forwardInput = ForwardInput(input, TurnInput(input)); zeus::CVector3f orbitPointFlattened(x314_orbitPoint.x(), x314_orbitPoint.y(), GetTranslation().z()); - zeus::CVector3f orbitToPlayer = GetTranslation() - orbitPointFlattened; - if (!orbitToPlayer.canBeNormalized()) + const zeus::CVector3f orbitToPlayer = GetTranslation() - orbitPointFlattened; + if (!orbitToPlayer.canBeNormalized()) { return; + } + zeus::CVector3f useOrbitToPlayer = orbitToPlayer; - ESurfaceRestraints restraints = GetSurfaceRestraint(); - float strafeVel = dt * skStrafeDistances[int(restraints)]; - if (ControlMapper::GetDigitalInput(ControlMapper::ECommands::JumpOrBoost, input)) + const ESurfaceRestraints restraints = GetSurfaceRestraint(); + float strafeVel = dt * skStrafeDistances[size_t(restraints)]; + if (ControlMapper::GetDigitalInput(ControlMapper::ECommands::JumpOrBoost, input)) { x388_dashButtonHoldTime += dt; + } + if (!x37c_sidewaysDashing) { if (SidewaysDashAllowed(strafeInput, forwardInput, input, mgr)) { x37c_sidewaysDashing = true; @@ -5092,36 +5132,41 @@ void CPlayer::ComputeDash(const CFinalInput& input, float dt, CStateManager& mgr CSfxManager::RemoveEmitter(x778_dashSfx); } else { if (x39c_noStrafeDashBlend) { - strafeVel = dt * skDashStrafeDistances[int(restraints)] * x398_dashSpeedMultiplier; + strafeVel = dt * skDashStrafeDistances[size_t(restraints)] * x398_dashSpeedMultiplier; } else { - strafeVel = ((skDashStrafeDistances[int(restraints)] - skStrafeDistances[int(restraints)]) * + strafeVel = ((skDashStrafeDistances[size_t(restraints)] - skStrafeDistances[size_t(restraints)]) * (1.f - zeus::clamp(-1.f, x384_dashTimer / x3a4_strafeDashBlendDuration, 1.f)) + - skStrafeDistances[int(restraints)]) * + skStrafeDistances[size_t(restraints)]) * x398_dashSpeedMultiplier * dt; } - if (x380_strafeInputAtDash < 0.f) + if (x380_strafeInputAtDash < 0.f) { strafeVel = -strafeVel; + } } } - float f3 = strafeVel / orbitToPlayer.magnitude(); - float f2 = dt * (x37c_sidewaysDashing ? M_PIF : (M_PIF * 2.f / 3.f)); + const float f3 = strafeVel / orbitToPlayer.magnitude(); + const float f2 = dt * (x37c_sidewaysDashing ? M_PIF : (M_PIF * 2.f / 3.f)); useOrbitToPlayer = zeus::CQuaternion::fromAxisAngle(zeus::skUp, zeus::clamp(-f2, f3, f2)).transform(orbitToPlayer); orbitPointFlattened += useOrbitToPlayer; - if (!ControlMapper::GetDigitalInput(ControlMapper::ECommands::JumpOrBoost, input)) + if (!ControlMapper::GetDigitalInput(ControlMapper::ECommands::JumpOrBoost, input)) { x388_dashButtonHoldTime = 0.f; - strafeVel = skOrbitForwardDistances[int(restraints)] * forwardInput * dt; + } + + strafeVel = skOrbitForwardDistances[size_t(restraints)] * forwardInput * dt; orbitPointFlattened += -useOrbitToPlayer.normalized() * strafeVel; - zeus::CVector2f velFlat(x138_velocity.x(), x138_velocity.y()); + const zeus::CVector2f velFlat(x138_velocity.x(), x138_velocity.y()); zeus::CVector3f newVelocity = (orbitPointFlattened - GetTranslation()) / dt; - zeus::CVector3f velDelta(newVelocity.x() - x138_velocity.x(), newVelocity.y() - x138_velocity.y(), 0.f); + const zeus::CVector3f velDelta(newVelocity.x() - x138_velocity.x(), newVelocity.y() - x138_velocity.y(), 0.f); strafeVel = velDelta.magnitude(); + if (strafeVel > FLT_EPSILON) { - float accel = dt * GetAcceleration(); + const float accel = dt * GetAcceleration(); newVelocity = velDelta / strafeVel * accel * zeus::clamp(-1.f, strafeVel / accel, 1.f) + x138_velocity; - if (!x9c5_28_slidingOnWall) + if (!x9c5_28_slidingOnWall) { SetVelocityWR(newVelocity); + } } } diff --git a/Runtime/World/CPlayer.hpp b/Runtime/World/CPlayer.hpp index ce6745525..444ab8be8 100644 --- a/Runtime/World/CPlayer.hpp +++ b/Runtime/World/CPlayer.hpp @@ -1,32 +1,39 @@ #pragma once -#include "CPhysicsActor.hpp" -#include "zeus/CAABox.hpp" -#include "zeus/CTransform.hpp" -#include "Weapon/CWeaponMgr.hpp" -#include "CPlayerEnergyDrain.hpp" -#include "Weapon/CPlayerGun.hpp" -#include "CMorphBall.hpp" +#include +#include +#include + +#include "Runtime/Weapon/CPlayerGun.hpp" +#include "Runtime/Weapon/CWeaponMgr.hpp" +#include "Runtime/World/CMorphBall.hpp" +#include "Runtime/World/CPhysicsActor.hpp" +#include "Runtime/World/CPlayerEnergyDrain.hpp" + +#include +#include +#include namespace urde { +class CCollidableSphere; +class CDamageInfo; +class CFirstPersonCamera; class CMaterialList; class CMorphBall; +class CPlayerCameraBob; class CPlayerGun; -class CDamageInfo; +class CScriptPlayerHint; class CScriptWater; class IVisitor; + struct CFinalInput; -class CPlayerCameraBob; -class CFirstPersonCamera; -class CCollidableSphere; -class CScriptPlayerHint; class CPlayer : public CPhysicsActor { - friend class CStateManager; friend class CFirstPersonCamera; - friend class CPlayerCameraBob; - friend class CMorphBall; friend class CGroundMovement; + friend class CMorphBall; + friend class CPlayerCameraBob; + friend class CStateManager; public: enum class EPlayerScanState { NotScanning, Scanning, ScanComplete }; @@ -432,8 +439,8 @@ public: void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override; void SetVisorSteam(float, float, float, CAssetId, bool); void UpdateFootstepSounds(const CFinalInput& input, CStateManager&, float); - u16 GetMaterialSoundUnderPlayer(const CStateManager& mgr, const u16*, u32, u16) const; - static u16 SfxIdFromMaterial(const CMaterialList&, const u16*, u32, u16); + u16 GetMaterialSoundUnderPlayer(const CStateManager& mgr, const u16* idList, size_t length, u16 defId) const; + static u16 SfxIdFromMaterial(const CMaterialList& mat, const u16* idList, size_t tableLen, u16 defId); void UpdateCrosshairsState(const CFinalInput&); void UpdateVisorTransition(float, CStateManager& mgr); void UpdateVisorState(const CFinalInput&, float, CStateManager& mgr); diff --git a/Runtime/World/CPlayerCameraBob.hpp b/Runtime/World/CPlayerCameraBob.hpp index 65b814257..0ef07cde1 100644 --- a/Runtime/World/CPlayerCameraBob.hpp +++ b/Runtime/World/CPlayerCameraBob.hpp @@ -1,9 +1,12 @@ #pragma once #include -#include "RetroTypes.hpp" -#include "zeus/CVector2f.hpp" -#include "zeus/CTransform.hpp" + +#include "Runtime/RetroTypes.hpp" + +#include +#include +#include namespace urde { diff --git a/Runtime/World/CPlayerEnergyDrain.hpp b/Runtime/World/CPlayerEnergyDrain.hpp index 55fe5a562..8b4651786 100644 --- a/Runtime/World/CPlayerEnergyDrain.hpp +++ b/Runtime/World/CPlayerEnergyDrain.hpp @@ -1,7 +1,9 @@ #pragma once -#include "RetroTypes.hpp" -#include "CEnergyDrainSource.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CEnergyDrainSource.hpp" namespace urde { class CStateManager; diff --git a/Runtime/World/CProjectedShadow.hpp b/Runtime/World/CProjectedShadow.hpp index 2282ac8db..f80e130ba 100644 --- a/Runtime/World/CProjectedShadow.hpp +++ b/Runtime/World/CProjectedShadow.hpp @@ -1,8 +1,10 @@ #pragma once -#include "Graphics/CTexture.hpp" -#include "zeus/CTransform.hpp" -#include "zeus/CAABox.hpp" +#include "Runtime/Graphics/CTexture.hpp" + +#include +#include +#include namespace urde { class CStateManager; diff --git a/Runtime/World/CRepulsor.cpp b/Runtime/World/CRepulsor.cpp index 49f65c5c5..6a6f785d0 100644 --- a/Runtime/World/CRepulsor.cpp +++ b/Runtime/World/CRepulsor.cpp @@ -1,6 +1,6 @@ #include "CRepulsor.hpp" #include "CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CRepulsor::CRepulsor(TUniqueId uid, bool active, std::string_view name, const CEntityInfo& info, diff --git a/Runtime/World/CRepulsor.hpp b/Runtime/World/CRepulsor.hpp index c1e48ba3b..58784a52b 100644 --- a/Runtime/World/CRepulsor.hpp +++ b/Runtime/World/CRepulsor.hpp @@ -1,6 +1,8 @@ #pragma once -#include "CActor.hpp" +#include +#include "Runtime/World/CActor.hpp" + namespace urde { class CRepulsor : public CActor { float xe8_affectRadius; diff --git a/Runtime/World/CRipple.hpp b/Runtime/World/CRipple.hpp index 70daf611c..86be8c647 100644 --- a/Runtime/World/CRipple.hpp +++ b/Runtime/World/CRipple.hpp @@ -1,7 +1,7 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CVector3f.hpp" +#include "Runtime/RetroTypes.hpp" +#include namespace urde { class CRipple { diff --git a/Runtime/World/CRippleManager.hpp b/Runtime/World/CRippleManager.hpp index 9c970b03d..be1b2f2e2 100644 --- a/Runtime/World/CRippleManager.hpp +++ b/Runtime/World/CRippleManager.hpp @@ -1,7 +1,9 @@ #pragma once -#include "RetroTypes.hpp" -#include "CRipple.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CRipple.hpp" namespace urde { diff --git a/Runtime/World/CScannableParameters.hpp b/Runtime/World/CScannableParameters.hpp index e2fa4261d..93a6a4739 100644 --- a/Runtime/World/CScannableParameters.hpp +++ b/Runtime/World/CScannableParameters.hpp @@ -1,6 +1,6 @@ #pragma once -#include "RetroTypes.hpp" +#include "Runtime/RetroTypes.hpp" namespace urde { diff --git a/Runtime/World/CScriptActor.cpp b/Runtime/World/CScriptActor.cpp index 37dd2133b..20cbb6f3a 100644 --- a/Runtime/World/CScriptActor.cpp +++ b/Runtime/World/CScriptActor.cpp @@ -6,7 +6,7 @@ #include "CPlayerState.hpp" #include "CScriptColorModulate.hpp" #include "Character/IAnimReader.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CActorParameters.hpp" #include "MP1/World/CActorContraption.hpp" #include "zeus/CEulerAngles.hpp" diff --git a/Runtime/World/CScriptActor.hpp b/Runtime/World/CScriptActor.hpp index 4136329c2..4e0854a1c 100644 --- a/Runtime/World/CScriptActor.hpp +++ b/Runtime/World/CScriptActor.hpp @@ -1,8 +1,9 @@ #pragma once -#include "CPhysicsActor.hpp" -#include "CHealthInfo.hpp" -#include "CDamageVulnerability.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CDamageVulnerability.hpp" +#include "Runtime/World/CHealthInfo.hpp" +#include "Runtime/World/CPhysicsActor.hpp" namespace urde { diff --git a/Runtime/World/CScriptActorKeyframe.cpp b/Runtime/World/CScriptActorKeyframe.cpp index 7a4b5ad5b..895a1048f 100644 --- a/Runtime/World/CScriptActorKeyframe.cpp +++ b/Runtime/World/CScriptActorKeyframe.cpp @@ -3,7 +3,7 @@ #include "World/CScriptActor.hpp" #include "World/CScriptPlatform.hpp" #include "World/CPatterned.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CScriptActorKeyframe::CScriptActorKeyframe(TUniqueId uid, std::string_view name, const CEntityInfo& info, s32 animId, diff --git a/Runtime/World/CScriptActorKeyframe.hpp b/Runtime/World/CScriptActorKeyframe.hpp index 62a3851c9..659ff4f36 100644 --- a/Runtime/World/CScriptActorKeyframe.hpp +++ b/Runtime/World/CScriptActorKeyframe.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CEntity.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CEntity.hpp" namespace urde { class CScriptActorKeyframe : public CEntity { diff --git a/Runtime/World/CScriptActorRotate.cpp b/Runtime/World/CScriptActorRotate.cpp index 5f000f307..370da02aa 100644 --- a/Runtime/World/CScriptActorRotate.cpp +++ b/Runtime/World/CScriptActorRotate.cpp @@ -2,7 +2,7 @@ #include "CStateManager.hpp" #include "CScriptPlatform.hpp" #include "CScriptSpiderBallWaypoint.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CScriptActorRotate::CScriptActorRotate(TUniqueId uid, std::string_view name, const CEntityInfo& info, diff --git a/Runtime/World/CScriptActorRotate.hpp b/Runtime/World/CScriptActorRotate.hpp index 735982f54..8f1893679 100644 --- a/Runtime/World/CScriptActorRotate.hpp +++ b/Runtime/World/CScriptActorRotate.hpp @@ -1,7 +1,14 @@ #pragma once -#include "CEntity.hpp" -#include "zeus/CTransform.hpp" +#include +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CEntity.hpp" + +#include +#include namespace urde { struct SRiders; diff --git a/Runtime/World/CScriptAiJumpPoint.cpp b/Runtime/World/CScriptAiJumpPoint.cpp index 43dd9c23c..d5899fc35 100644 --- a/Runtime/World/CScriptAiJumpPoint.cpp +++ b/Runtime/World/CScriptAiJumpPoint.cpp @@ -2,7 +2,7 @@ #include "CActorParameters.hpp" #include "CStateManager.hpp" #include "CScriptWaypoint.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CScriptAiJumpPoint::CScriptAiJumpPoint(TUniqueId uid, std::string_view name, const CEntityInfo& info, diff --git a/Runtime/World/CScriptAiJumpPoint.hpp b/Runtime/World/CScriptAiJumpPoint.hpp index a5dc82f64..31dfce661 100644 --- a/Runtime/World/CScriptAiJumpPoint.hpp +++ b/Runtime/World/CScriptAiJumpPoint.hpp @@ -1,6 +1,11 @@ #pragma once -#include "CActor.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CActor.hpp" + +#include namespace urde { class CScriptAiJumpPoint : public CActor { diff --git a/Runtime/World/CScriptAreaAttributes.cpp b/Runtime/World/CScriptAreaAttributes.cpp index 85868d4a3..f013c81b2 100644 --- a/Runtime/World/CScriptAreaAttributes.cpp +++ b/Runtime/World/CScriptAreaAttributes.cpp @@ -2,7 +2,7 @@ #include "CEnvFxManager.hpp" #include "CStateManager.hpp" #include "CWorld.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptAreaAttributes.hpp b/Runtime/World/CScriptAreaAttributes.hpp index dde2eeab3..0b15bc880 100644 --- a/Runtime/World/CScriptAreaAttributes.hpp +++ b/Runtime/World/CScriptAreaAttributes.hpp @@ -1,7 +1,7 @@ #pragma once -#include "CEntity.hpp" -#include "CEnvFxManager.hpp" +#include "Runtime/World/CEntity.hpp" +#include "Runtime/World/CEnvFxManager.hpp" namespace urde { class CScriptAreaAttributes : public CEntity { diff --git a/Runtime/World/CScriptBallTrigger.cpp b/Runtime/World/CScriptBallTrigger.cpp index f23f7ad06..210d70d5b 100644 --- a/Runtime/World/CScriptBallTrigger.cpp +++ b/Runtime/World/CScriptBallTrigger.cpp @@ -4,7 +4,7 @@ #include "CMorphBall.hpp" #include "GameGlobalObjects.hpp" #include "DNAMP1/Tweaks/CTweakPlayer.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptBallTrigger.hpp b/Runtime/World/CScriptBallTrigger.hpp index 8e9b41aa7..eccf60c91 100644 --- a/Runtime/World/CScriptBallTrigger.hpp +++ b/Runtime/World/CScriptBallTrigger.hpp @@ -1,6 +1,10 @@ #pragma once -#include "CScriptTrigger.hpp" +#include + +#include "Runtime/World/CScriptTrigger.hpp" + +#include namespace urde { class CScriptBallTrigger : public CScriptTrigger { diff --git a/Runtime/World/CScriptBeam.cpp b/Runtime/World/CScriptBeam.cpp index b65c2cecc..9633c8ace 100644 --- a/Runtime/World/CScriptBeam.cpp +++ b/Runtime/World/CScriptBeam.cpp @@ -3,7 +3,7 @@ #include "Particle/CWeaponDescription.hpp" #include "Weapon/CPlasmaProjectile.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptBeam.hpp b/Runtime/World/CScriptBeam.hpp index 87c450e66..202aab4df 100644 --- a/Runtime/World/CScriptBeam.hpp +++ b/Runtime/World/CScriptBeam.hpp @@ -1,8 +1,10 @@ #pragma once -#include "CActor.hpp" -#include "Weapon/CBeamInfo.hpp" -#include "CDamageInfo.hpp" +#include + +#include "Runtime/Weapon/CBeamInfo.hpp" +#include "Runtime/World/CActor.hpp" +#include "Runtime/World/CDamageInfo.hpp" namespace urde { class CWeaponDescription; diff --git a/Runtime/World/CScriptCameraBlurKeyframe.cpp b/Runtime/World/CScriptCameraBlurKeyframe.cpp index 12255c565..141e2988b 100644 --- a/Runtime/World/CScriptCameraBlurKeyframe.cpp +++ b/Runtime/World/CScriptCameraBlurKeyframe.cpp @@ -1,5 +1,5 @@ #include "CScriptCameraBlurKeyframe.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" namespace urde { diff --git a/Runtime/World/CScriptCameraBlurKeyframe.hpp b/Runtime/World/CScriptCameraBlurKeyframe.hpp index 872ec3402..2916bd382 100644 --- a/Runtime/World/CScriptCameraBlurKeyframe.hpp +++ b/Runtime/World/CScriptCameraBlurKeyframe.hpp @@ -1,7 +1,10 @@ #pragma once -#include "CEntity.hpp" -#include "Camera/CCameraFilter.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Camera/CCameraFilter.hpp" +#include "Runtime/World/CEntity.hpp" namespace urde { class CScriptCameraBlurKeyframe : public CEntity { diff --git a/Runtime/World/CScriptCameraFilterKeyframe.cpp b/Runtime/World/CScriptCameraFilterKeyframe.cpp index 692bad7c9..e8543b80e 100644 --- a/Runtime/World/CScriptCameraFilterKeyframe.cpp +++ b/Runtime/World/CScriptCameraFilterKeyframe.cpp @@ -1,5 +1,5 @@ #include "CScriptCameraFilterKeyframe.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" namespace urde { diff --git a/Runtime/World/CScriptCameraFilterKeyframe.hpp b/Runtime/World/CScriptCameraFilterKeyframe.hpp index 36d2d3677..96e050142 100644 --- a/Runtime/World/CScriptCameraFilterKeyframe.hpp +++ b/Runtime/World/CScriptCameraFilterKeyframe.hpp @@ -1,8 +1,12 @@ #pragma once -#include "CEntity.hpp" -#include "zeus/CColor.hpp" -#include "Camera/CCameraFilter.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Camera/CCameraFilter.hpp" +#include "Runtime/World/CEntity.hpp" + +#include namespace urde { class CScriptCameraFilterKeyframe : public CEntity { diff --git a/Runtime/World/CScriptCameraHint.cpp b/Runtime/World/CScriptCameraHint.cpp index fdc61f13c..fdcaf7657 100644 --- a/Runtime/World/CScriptCameraHint.cpp +++ b/Runtime/World/CScriptCameraHint.cpp @@ -1,7 +1,7 @@ #include "CScriptCameraHint.hpp" #include "CActorParameters.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptCameraHint.hpp b/Runtime/World/CScriptCameraHint.hpp index 4a984a707..3826497da 100644 --- a/Runtime/World/CScriptCameraHint.hpp +++ b/Runtime/World/CScriptCameraHint.hpp @@ -1,7 +1,14 @@ #pragma once -#include "CActor.hpp" -#include "Camera/CBallCamera.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Camera/CBallCamera.hpp" +#include "Runtime/World/CActor.hpp" + +#include +#include namespace urde { diff --git a/Runtime/World/CScriptCameraHintTrigger.cpp b/Runtime/World/CScriptCameraHintTrigger.cpp index ab4fbd3b3..4225907bb 100644 --- a/Runtime/World/CScriptCameraHintTrigger.cpp +++ b/Runtime/World/CScriptCameraHintTrigger.cpp @@ -1,7 +1,7 @@ #include "CScriptCameraHintTrigger.hpp" #include "CActorParameters.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptCameraHintTrigger.hpp b/Runtime/World/CScriptCameraHintTrigger.hpp index a02c5e44e..68497d278 100644 --- a/Runtime/World/CScriptCameraHintTrigger.hpp +++ b/Runtime/World/CScriptCameraHintTrigger.hpp @@ -1,7 +1,12 @@ #pragma once -#include "CActor.hpp" -#include "zeus/COBBox.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CActor.hpp" + +#include +#include namespace urde { class CScriptCameraHintTrigger : public CActor { diff --git a/Runtime/World/CScriptCameraPitchVolume.cpp b/Runtime/World/CScriptCameraPitchVolume.cpp index bf20f8edc..ae014e5b6 100644 --- a/Runtime/World/CScriptCameraPitchVolume.cpp +++ b/Runtime/World/CScriptCameraPitchVolume.cpp @@ -5,7 +5,7 @@ #include "Camera/CCameraManager.hpp" #include "Camera/CFirstPersonCamera.hpp" #include "Particle/CGenDescription.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { const zeus::CVector3f CScriptCameraPitchVolume::skScaleFactor = zeus::CVector3f(0.5f); diff --git a/Runtime/World/CScriptCameraPitchVolume.hpp b/Runtime/World/CScriptCameraPitchVolume.hpp index e4ce1d688..2b84d2816 100644 --- a/Runtime/World/CScriptCameraPitchVolume.hpp +++ b/Runtime/World/CScriptCameraPitchVolume.hpp @@ -1,8 +1,13 @@ #pragma once -#include "CActor.hpp" -#include "zeus/CRelAngle.hpp" -#include "zeus/COBBox.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CActor.hpp" + +#include +#include +#include namespace urde { class CScriptCameraPitchVolume : public CActor { diff --git a/Runtime/World/CScriptCameraShaker.cpp b/Runtime/World/CScriptCameraShaker.cpp index d50bc852b..487a73445 100644 --- a/Runtime/World/CScriptCameraShaker.cpp +++ b/Runtime/World/CScriptCameraShaker.cpp @@ -1,5 +1,5 @@ #include "CScriptCameraShaker.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" #include "CWorld.hpp" diff --git a/Runtime/World/CScriptCameraShaker.hpp b/Runtime/World/CScriptCameraShaker.hpp index 4f5fd3ec0..0c6404201 100644 --- a/Runtime/World/CScriptCameraShaker.hpp +++ b/Runtime/World/CScriptCameraShaker.hpp @@ -1,7 +1,9 @@ #pragma once -#include "CEntity.hpp" -#include "Camera/CCameraShakeData.hpp" +#include + +#include "Runtime/Camera/CCameraShakeData.hpp" +#include "Runtime/World/CEntity.hpp" namespace urde { diff --git a/Runtime/World/CScriptCameraWaypoint.cpp b/Runtime/World/CScriptCameraWaypoint.cpp index 6f0109b14..4cbd1ea8a 100644 --- a/Runtime/World/CScriptCameraWaypoint.cpp +++ b/Runtime/World/CScriptCameraWaypoint.cpp @@ -1,6 +1,6 @@ #include "CScriptCameraWaypoint.hpp" #include "CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" namespace urde { diff --git a/Runtime/World/CScriptCameraWaypoint.hpp b/Runtime/World/CScriptCameraWaypoint.hpp index ffd3f3f32..26f8d9c51 100644 --- a/Runtime/World/CScriptCameraWaypoint.hpp +++ b/Runtime/World/CScriptCameraWaypoint.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CActor.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CActor.hpp" namespace urde { diff --git a/Runtime/World/CScriptColorModulate.cpp b/Runtime/World/CScriptColorModulate.cpp index 09efda46a..1eca0499f 100644 --- a/Runtime/World/CScriptColorModulate.cpp +++ b/Runtime/World/CScriptColorModulate.cpp @@ -1,7 +1,7 @@ #include "CScriptColorModulate.hpp" #include "Graphics/CModel.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CScriptColorModulate::CScriptColorModulate(TUniqueId uid, std::string_view name, const CEntityInfo& info, diff --git a/Runtime/World/CScriptColorModulate.hpp b/Runtime/World/CScriptColorModulate.hpp index a9778e761..bd60316f9 100644 --- a/Runtime/World/CScriptColorModulate.hpp +++ b/Runtime/World/CScriptColorModulate.hpp @@ -1,10 +1,15 @@ #pragma once -#include "CEntity.hpp" -#include "zeus/CColor.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CEntity.hpp" + +#include namespace urde { struct CModelFlags; + class CScriptColorModulate : public CEntity { public: enum class EBlendMode { diff --git a/Runtime/World/CScriptControllerAction.cpp b/Runtime/World/CScriptControllerAction.cpp index 7d2a53b98..60fe98e4a 100644 --- a/Runtime/World/CScriptControllerAction.cpp +++ b/Runtime/World/CScriptControllerAction.cpp @@ -1,5 +1,5 @@ #include "CScriptControllerAction.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" #include "Input/ControlMapper.hpp" diff --git a/Runtime/World/CScriptControllerAction.hpp b/Runtime/World/CScriptControllerAction.hpp index 8d1a61694..a18dd5838 100644 --- a/Runtime/World/CScriptControllerAction.hpp +++ b/Runtime/World/CScriptControllerAction.hpp @@ -1,7 +1,10 @@ #pragma once -#include "CEntity.hpp" -#include "Input/ControlMapper.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Input/ControlMapper.hpp" +#include "Runtime/World/CEntity.hpp" namespace urde { diff --git a/Runtime/World/CScriptCounter.cpp b/Runtime/World/CScriptCounter.cpp index 0b65c5c18..10c98b692 100644 --- a/Runtime/World/CScriptCounter.cpp +++ b/Runtime/World/CScriptCounter.cpp @@ -1,6 +1,6 @@ #include "CScriptCounter.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptCounter.hpp b/Runtime/World/CScriptCounter.hpp index a42819967..95ddd2e5d 100644 --- a/Runtime/World/CScriptCounter.hpp +++ b/Runtime/World/CScriptCounter.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CEntity.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CEntity.hpp" namespace urde { diff --git a/Runtime/World/CScriptCoverPoint.cpp b/Runtime/World/CScriptCoverPoint.cpp index af015ae43..711bf778a 100644 --- a/Runtime/World/CScriptCoverPoint.cpp +++ b/Runtime/World/CScriptCoverPoint.cpp @@ -1,7 +1,7 @@ #include "CScriptCoverPoint.hpp" #include "CActorParameters.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CScriptCoverPoint::CScriptCoverPoint(TUniqueId uid, std::string_view name, const CEntityInfo& info, zeus::CTransform xf, diff --git a/Runtime/World/CScriptCoverPoint.hpp b/Runtime/World/CScriptCoverPoint.hpp index 15d7e92bd..c644d3832 100644 --- a/Runtime/World/CScriptCoverPoint.hpp +++ b/Runtime/World/CScriptCoverPoint.hpp @@ -1,6 +1,12 @@ #pragma once -#include "CActor.hpp" +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CActor.hpp" + +#include namespace urde { class CScriptCoverPoint : public CActor { diff --git a/Runtime/World/CScriptDamageableTrigger.cpp b/Runtime/World/CScriptDamageableTrigger.cpp index e8c58c3d2..9b05b1a23 100644 --- a/Runtime/World/CScriptDamageableTrigger.cpp +++ b/Runtime/World/CScriptDamageableTrigger.cpp @@ -1,6 +1,6 @@ #include "CScriptDamageableTrigger.hpp" #include "CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" #include "CWorld.hpp" #include "CScriptActor.hpp" diff --git a/Runtime/World/CScriptDamageableTrigger.hpp b/Runtime/World/CScriptDamageableTrigger.hpp index 3604a9f25..2f7bead29 100644 --- a/Runtime/World/CScriptDamageableTrigger.hpp +++ b/Runtime/World/CScriptDamageableTrigger.hpp @@ -1,12 +1,21 @@ #pragma once -#include "CActor.hpp" -#include "CFluidPlaneDoor.hpp" -#include "CHealthInfo.hpp" -#include "CDamageVulnerability.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CActor.hpp" +#include "Runtime/World/CDamageVulnerability.hpp" +#include "Runtime/World/CFluidPlaneDoor.hpp" +#include "Runtime/World/CHealthInfo.hpp" + +#include +#include +#include +#include namespace urde { class CVisorParameters; + class CScriptDamageableTrigger : public CActor { public: enum class ECanOrbit { diff --git a/Runtime/World/CScriptDebris.cpp b/Runtime/World/CScriptDebris.cpp index cd6ca2827..155391f92 100644 --- a/Runtime/World/CScriptDebris.cpp +++ b/Runtime/World/CScriptDebris.cpp @@ -1,7 +1,7 @@ #include "CScriptDebris.hpp" #include "Collision/CCollisionInfoList.hpp" #include "Particle/CElementGen.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" #include "CStateManager.hpp" diff --git a/Runtime/World/CScriptDebris.hpp b/Runtime/World/CScriptDebris.hpp index 4c2ee77b2..8121c352d 100644 --- a/Runtime/World/CScriptDebris.hpp +++ b/Runtime/World/CScriptDebris.hpp @@ -1,6 +1,13 @@ #pragma once -#include "CPhysicsActor.hpp" +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CPhysicsActor.hpp" + +#include +#include namespace urde { class CElementGen; diff --git a/Runtime/World/CScriptDebugCameraWaypoint.cpp b/Runtime/World/CScriptDebugCameraWaypoint.cpp index 51d4ff9be..0148e2259 100644 --- a/Runtime/World/CScriptDebugCameraWaypoint.cpp +++ b/Runtime/World/CScriptDebugCameraWaypoint.cpp @@ -1,6 +1,6 @@ #include "CScriptDebugCameraWaypoint.hpp" #include "CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptDebugCameraWaypoint.hpp b/Runtime/World/CScriptDebugCameraWaypoint.hpp index cba74817b..75e9242d6 100644 --- a/Runtime/World/CScriptDebugCameraWaypoint.hpp +++ b/Runtime/World/CScriptDebugCameraWaypoint.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CActor.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CActor.hpp" namespace urde { diff --git a/Runtime/World/CScriptDistanceFog.cpp b/Runtime/World/CScriptDistanceFog.cpp index 6d33a9959..52e1661c9 100644 --- a/Runtime/World/CScriptDistanceFog.cpp +++ b/Runtime/World/CScriptDistanceFog.cpp @@ -1,7 +1,7 @@ #include "CScriptDistanceFog.hpp" #include "CStateManager.hpp" #include "CWorld.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CScriptDistanceFog::CScriptDistanceFog(TUniqueId uid, std::string_view name, const CEntityInfo& info, ERglFogMode mode, diff --git a/Runtime/World/CScriptDistanceFog.hpp b/Runtime/World/CScriptDistanceFog.hpp index be9350bf5..0a58dc5c0 100644 --- a/Runtime/World/CScriptDistanceFog.hpp +++ b/Runtime/World/CScriptDistanceFog.hpp @@ -1,7 +1,12 @@ #pragma once -#include "Graphics/CGraphics.hpp" -#include "CEntity.hpp" +#include + +#include "Runtime/Graphics/CGraphics.hpp" +#include "Runtime/World/CEntity.hpp" + +#include +#include namespace urde { class CScriptDistanceFog : public CEntity { diff --git a/Runtime/World/CScriptDock.cpp b/Runtime/World/CScriptDock.cpp index 231f4f4d3..d02cc57ca 100644 --- a/Runtime/World/CScriptDock.cpp +++ b/Runtime/World/CScriptDock.cpp @@ -7,7 +7,7 @@ #include "CScriptDoor.hpp" #include "CPlayer.hpp" #include "Particle/CGenDescription.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CMaterialList MakeDockMaterialList() { @@ -18,7 +18,7 @@ CMaterialList MakeDockMaterialList() { return list; } -CScriptDock::CScriptDock(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CVector3f position, +CScriptDock::CScriptDock(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CVector3f& position, const zeus::CVector3f& extents, s32 dock, TAreaId area, bool active, s32 dockReferenceCount, bool loadConnected) : CPhysicsActor(uid, active, name, info, zeus::CTransform(zeus::CMatrix3f(), position), diff --git a/Runtime/World/CScriptDock.hpp b/Runtime/World/CScriptDock.hpp index 8623cedc5..1e0634f0d 100644 --- a/Runtime/World/CScriptDock.hpp +++ b/Runtime/World/CScriptDock.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CPhysicsActor.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CPhysicsActor.hpp" namespace urde { @@ -22,7 +25,7 @@ class CScriptDock : public CPhysicsActor { }; public: - CScriptDock(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CVector3f position, + CScriptDock(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CVector3f& position, const zeus::CVector3f& extent, s32 dock, TAreaId area, bool active, s32 dockReferenceCount, bool loadConnected); diff --git a/Runtime/World/CScriptDockAreaChange.cpp b/Runtime/World/CScriptDockAreaChange.cpp index 361dccd2a..0c4c94f35 100644 --- a/Runtime/World/CScriptDockAreaChange.cpp +++ b/Runtime/World/CScriptDockAreaChange.cpp @@ -1,7 +1,7 @@ #include "CScriptDockAreaChange.hpp" #include "CStateManager.hpp" #include "World/CScriptDock.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CScriptDockAreaChange::CScriptDockAreaChange(TUniqueId uid, std::string_view name, const CEntityInfo& info, s32 w1, diff --git a/Runtime/World/CScriptDockAreaChange.hpp b/Runtime/World/CScriptDockAreaChange.hpp index 8898cab5e..0e6c07610 100644 --- a/Runtime/World/CScriptDockAreaChange.hpp +++ b/Runtime/World/CScriptDockAreaChange.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CEntity.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CEntity.hpp" namespace urde { class CScriptDockAreaChange : public CEntity { diff --git a/Runtime/World/CScriptDoor.cpp b/Runtime/World/CScriptDoor.cpp index bde14c13b..1319195ef 100644 --- a/Runtime/World/CScriptDoor.cpp +++ b/Runtime/World/CScriptDoor.cpp @@ -8,7 +8,7 @@ #include "CWorld.hpp" #include "Camera/CCameraManager.hpp" #include "Camera/CBallCamera.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptDoor.hpp b/Runtime/World/CScriptDoor.hpp index 12551c41c..e87f15267 100644 --- a/Runtime/World/CScriptDoor.hpp +++ b/Runtime/World/CScriptDoor.hpp @@ -1,6 +1,11 @@ #pragma once -#include "CPhysicsActor.hpp" +#include + +#include "Runtime/World/CPhysicsActor.hpp" + +#include +#include namespace urde { diff --git a/Runtime/World/CScriptEMPulse.cpp b/Runtime/World/CScriptEMPulse.cpp index ee7f9b129..729e11481 100644 --- a/Runtime/World/CScriptEMPulse.cpp +++ b/Runtime/World/CScriptEMPulse.cpp @@ -7,7 +7,7 @@ #include "CStateManager.hpp" #include "CPlayer.hpp" #include "Graphics/CBooRenderer.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { @@ -43,8 +43,8 @@ void CScriptEMPulse::Think(float dt, CStateManager& mgr) { void CScriptEMPulse::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) { CActor::AcceptScriptMsg(msg, uid, mgr); if (msg == EScriptObjectMessage::Activate) { - x114_particleGen.reset(new CElementGen(x108_particleDesc, CElementGen::EModelOrientationType::Normal, - CElementGen::EOptionalSystemFlags::One)); + x114_particleGen = std::make_unique(x108_particleDesc, CElementGen::EModelOrientationType::Normal, + CElementGen::EOptionalSystemFlags::One); x114_particleGen->SetOrientation(GetTransform().getRotation()); x114_particleGen->SetGlobalTranslation(GetTranslation()); diff --git a/Runtime/World/CScriptEMPulse.hpp b/Runtime/World/CScriptEMPulse.hpp index 29081d045..6f8e4d5be 100644 --- a/Runtime/World/CScriptEMPulse.hpp +++ b/Runtime/World/CScriptEMPulse.hpp @@ -1,11 +1,12 @@ -#ifndef __URDE_CSCRIPTEMPULSE_HPP__ -#define __URDE_CSCRIPTEMPULSE_HPP__ +#pragma once -#include "CActor.hpp" +#include +#include "Runtime/World/CActor.hpp" namespace urde { -class CGenDescription; class CElementGen; +class CGenDescription; + class CScriptEMPulse : public CActor { float xe8_duration; float xec_finalRadius; @@ -32,4 +33,3 @@ public: void Touch(CActor&, CStateManager&) override; }; } // namespace urde -#endif // __URDE_CSCRIPTEMPULSE_HPP__ \ No newline at end of file diff --git a/Runtime/World/CScriptEffect.cpp b/Runtime/World/CScriptEffect.cpp index db7dc3fe0..94538cba3 100644 --- a/Runtime/World/CScriptEffect.cpp +++ b/Runtime/World/CScriptEffect.cpp @@ -12,7 +12,7 @@ #include "Camera/CGameCamera.hpp" #include "CPlayerState.hpp" #include "CScriptTrigger.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { @@ -54,7 +54,7 @@ CScriptEffect::CScriptEffect(TUniqueId uid, std::string_view name, const CEntity if (partId.IsValid()) { xf8_particleSystemToken = g_SimplePool->GetObj({FOURCC('PART'), partId}); - x104_particleSystem.reset(new CElementGen(xf8_particleSystemToken)); + x104_particleSystem = std::make_unique(xf8_particleSystemToken); zeus::CTransform newXf = xf; newXf.origin = zeus::skZero3f; x104_particleSystem->SetOrientation(newXf); @@ -67,7 +67,7 @@ CScriptEffect::CScriptEffect(TUniqueId uid, std::string_view name, const CEntity if (elscId.IsValid()) { xe8_electricToken = g_SimplePool->GetObj({FOURCC('ELSC'), elscId}); - xf4_electric.reset(new CParticleElectric(xe8_electricToken)); + xf4_electric = std::make_unique(xe8_electricToken); zeus::CTransform newXf = xf; newXf.origin = zeus::skZero3f; xf4_electric->SetOrientation(newXf); @@ -87,9 +87,9 @@ void CScriptEffect::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSt case EScriptObjectMessage::Activate: if (x110_26_rebuildSystemsOnActivate) { if (x104_particleSystem) { - zeus::CVector3f scale = x104_particleSystem->GetGlobalScale(); - zeus::CColor color = x104_particleSystem->GetModulationColor(); - x104_particleSystem.reset(new CElementGen(xf8_particleSystemToken)); + const zeus::CVector3f scale = x104_particleSystem->GetGlobalScale(); + const zeus::CColor color = x104_particleSystem->GetModulationColor(); + x104_particleSystem = std::make_unique(xf8_particleSystemToken); zeus::CTransform newXf = GetTransform(); newXf.origin = zeus::skZero3f; x104_particleSystem->SetOrientation(newXf); @@ -101,9 +101,9 @@ void CScriptEffect::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSt } if (xf4_electric) { - zeus::CVector3f scale = xf4_electric->GetGlobalScale(); - zeus::CColor color = xf4_electric->GetModulationColor(); - xf4_electric.reset(new CParticleElectric(xe8_electricToken)); + const zeus::CVector3f scale = xf4_electric->GetGlobalScale(); + const zeus::CColor color = xf4_electric->GetModulationColor(); + xf4_electric = std::make_unique(xe8_electricToken); zeus::CTransform newXf = GetTransform(); newXf.origin = zeus::skZero3f; xf4_electric->SetOrientation(newXf); diff --git a/Runtime/World/CScriptEffect.hpp b/Runtime/World/CScriptEffect.hpp index b8dca4a0c..c01f617cb 100644 --- a/Runtime/World/CScriptEffect.hpp +++ b/Runtime/World/CScriptEffect.hpp @@ -1,10 +1,15 @@ #pragma once -#include "CActor.hpp" +#include +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CActor.hpp" namespace urde { class CElementGen; class CParticleElectric; + class CScriptEffect : public CActor { static u32 g_NumParticlesUpdating; static u32 g_NumParticlesRendered; diff --git a/Runtime/World/CScriptGenerator.cpp b/Runtime/World/CScriptGenerator.cpp index 7169857d5..221b1c682 100644 --- a/Runtime/World/CScriptGenerator.cpp +++ b/Runtime/World/CScriptGenerator.cpp @@ -1,7 +1,7 @@ #include "CScriptGenerator.hpp" #include "CStateManager.hpp" #include "CWallCrawlerSwarm.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptGenerator.hpp b/Runtime/World/CScriptGenerator.hpp index 5ec814a65..3b98b7101 100644 --- a/Runtime/World/CScriptGenerator.hpp +++ b/Runtime/World/CScriptGenerator.hpp @@ -1,7 +1,11 @@ #pragma once -#include "CEntity.hpp" -#include "zeus/CVector3f.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CEntity.hpp" + +#include namespace urde { diff --git a/Runtime/World/CScriptGrapplePoint.cpp b/Runtime/World/CScriptGrapplePoint.cpp index c98f587bc..8fc1406bc 100644 --- a/Runtime/World/CScriptGrapplePoint.cpp +++ b/Runtime/World/CScriptGrapplePoint.cpp @@ -2,7 +2,7 @@ #include "Character/CModelData.hpp" #include "Collision/CMaterialList.hpp" #include "CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CScriptGrapplePoint::CScriptGrapplePoint(TUniqueId uid, std::string_view name, const CEntityInfo& info, diff --git a/Runtime/World/CScriptGrapplePoint.hpp b/Runtime/World/CScriptGrapplePoint.hpp index bab2f6281..13a616670 100644 --- a/Runtime/World/CScriptGrapplePoint.hpp +++ b/Runtime/World/CScriptGrapplePoint.hpp @@ -1,7 +1,11 @@ #pragma once -#include "CActor.hpp" -#include "CGrappleParameters.hpp" +#include + +#include "Runtime/World/CActor.hpp" +#include "Runtime/World/CGrappleParameters.hpp" + +#include namespace urde { class CScriptGrapplePoint : public CActor { diff --git a/Runtime/World/CScriptGunTurret.cpp b/Runtime/World/CScriptGunTurret.cpp index e0f2ec0a8..084724948 100644 --- a/Runtime/World/CScriptGunTurret.cpp +++ b/Runtime/World/CScriptGunTurret.cpp @@ -1,17 +1,20 @@ -#include "CScriptGunTurret.hpp" -#include "GameGlobalObjects.hpp" -#include "CSimplePool.hpp" -#include "Particle/CGenDescription.hpp" -#include "Particle/CElementGen.hpp" -#include "Weapon/CGameProjectile.hpp" -#include "World/CGameLight.hpp" -#include "Collision/CCollisionActorManager.hpp" -#include "Collision/CCollisionActor.hpp" -#include "CPlayer.hpp" -#include "Character/CPASAnimParmData.hpp" -#include "Graphics/CBooRenderer.hpp" -#include "TCastTo.hpp" -#include "Weapon/CEnergyProjectile.hpp" +#include "Runtime/World/CScriptGunTurret.hpp" + +#include "Runtime/CSimplePool.hpp" +#include "Runtime/GameGlobalObjects.hpp" +#include "Runtime/Character/CPASAnimParmData.hpp" +#include "Runtime/Collision/CCollisionActor.hpp" +#include "Runtime/Collision/CCollisionActorManager.hpp" +#include "Runtime/Graphics/CBooRenderer.hpp" +#include "Runtime/Particle/CElementGen.hpp" +#include "Runtime/Particle/CGenDescription.hpp" +#include "Runtime/Weapon/CEnergyProjectile.hpp" +#include "Runtime/Weapon/CGameProjectile.hpp" +#include "Runtime/World/CAiFuncMap.hpp" +#include "Runtime/World/CGameLight.hpp" +#include "Runtime/World/CPlayer.hpp" + +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { @@ -125,12 +128,12 @@ CScriptGunTurret::CScriptGunTurret(TUniqueId uid, std::string_view name, ETurret , x44c_panningEffectDesc(g_SimplePool->GetObj({SBIG('PART'), turretData.GetPanningEffectRes()})) { if (turretData.GetVisorEffectRes().IsValid()) x458_visorEffectDesc = g_SimplePool->GetObj({SBIG('PART'), turretData.GetVisorEffectRes()}); - x468_idleLight.reset(new CElementGen(x410_idleLightDesc)); - x470_deactivateLight.reset(new CElementGen(x41c_deactivateLightDesc)); - x478_targettingLight.reset(new CElementGen(x428_targettingLightDesc)); - x480_frozenEffect.reset(new CElementGen(x434_frozenEffectDesc)); - x488_chargingEffect.reset(new CElementGen(x440_chargingEffectDesc)); - x490_panningEffect.reset(new CElementGen(x44c_panningEffectDesc)); + x468_idleLight = std::make_unique(x410_idleLightDesc); + x470_deactivateLight = std::make_unique(x41c_deactivateLightDesc); + x478_targettingLight = std::make_unique(x428_targettingLightDesc); + x480_frozenEffect = std::make_unique(x434_frozenEffectDesc); + x488_chargingEffect = std::make_unique(x440_chargingEffectDesc); + x490_panningEffect = std::make_unique(x44c_panningEffectDesc); x4fc_extensionOffset = xf.origin; x514_lastFrontVector = xf.frontVector(); x544_originalFrontVec = xf.frontVector(); @@ -150,6 +153,8 @@ CScriptGunTurret::CScriptGunTurret(TUniqueId uid, std::string_view name, ETurret x37c_projectileInfo.Token().Lock(); } +CScriptGunTurret::~CScriptGunTurret() = default; + void CScriptGunTurret::Accept(IVisitor& visitor) { visitor.Visit(this); } void CScriptGunTurret::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) { @@ -330,8 +335,7 @@ void CScriptGunTurret::SetupCollisionManager(CStateManager& mgr) { x508_gunSDKSeg, blastLCTR, 0.6f, 1.f, CJointCollisionDescription::EOrientationType::One, "Gun_SDK"sv, 1000.f)); jointDescs.push_back(CJointCollisionDescription::SphereCollision(blastLCTR, 0.3f, "Blast_LCTR"sv, 1000.f)); - x49c_collisionManager.reset(new CCollisionActorManager(mgr, GetUniqueId(), GetAreaIdAlways(), jointDescs, true)); - + x49c_collisionManager = std::make_unique(mgr, GetUniqueId(), GetAreaIdAlways(), jointDescs, true); x49c_collisionManager->SetActive(mgr, GetActive()); for (int i = 0; i < x49c_collisionManager->GetNumCollisionActors(); ++i) { diff --git a/Runtime/World/CScriptGunTurret.hpp b/Runtime/World/CScriptGunTurret.hpp index 0753601f5..5c4a0044a 100644 --- a/Runtime/World/CScriptGunTurret.hpp +++ b/Runtime/World/CScriptGunTurret.hpp @@ -1,15 +1,24 @@ #pragma once -#include +#include +#include +#include -#include "CPhysicsActor.hpp" -#include "CDamageInfo.hpp" -#include "CDamageVulnerability.hpp" -#include "Weapon/CProjectileInfo.hpp" -#include "Weapon/CBurstFire.hpp" +#include "Runtime/Weapon/CBurstFire.hpp" +#include "Runtime/Weapon/CProjectileInfo.hpp" +#include "Runtime/World/CDamageInfo.hpp" +#include "Runtime/World/CDamageVulnerability.hpp" +#include "Runtime/World/CPhysicsActor.hpp" + +#include +#include namespace urde { class CCollisionActorManager; +class CElementGen; + +enum class EStateMsg; + class CScriptGunTurretData { float x0_intoDeactivateDelay; float x4_intoActivateDelay; @@ -220,6 +229,7 @@ public: const zeus::CTransform& xf, CModelData&& mData, const zeus::CAABox& aabb, const CHealthInfo& hInfo, const CDamageVulnerability& dVuln, const CActorParameters& aParms, const CScriptGunTurretData& turretData); + ~CScriptGunTurret() override; void Accept(IVisitor&) override; void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override; diff --git a/Runtime/World/CScriptHUDMemo.cpp b/Runtime/World/CScriptHUDMemo.cpp index 810f79e43..02b80c2d6 100644 --- a/Runtime/World/CScriptHUDMemo.cpp +++ b/Runtime/World/CScriptHUDMemo.cpp @@ -3,7 +3,7 @@ #include "CSimplePool.hpp" #include "GuiSys/CStringTable.hpp" #include "MP1/CSamusHud.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptHUDMemo.hpp b/Runtime/World/CScriptHUDMemo.hpp index 18b3836c7..78a96f55e 100644 --- a/Runtime/World/CScriptHUDMemo.hpp +++ b/Runtime/World/CScriptHUDMemo.hpp @@ -1,10 +1,15 @@ #pragma once -#include "CEntity.hpp" -#include "CHUDMemoParms.hpp" -#include "CToken.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/World/CEntity.hpp" +#include "Runtime/World/CHUDMemoParms.hpp" + namespace urde { class CStringTable; + class CScriptHUDMemo : public CEntity { public: enum class EDisplayType { diff --git a/Runtime/World/CScriptMazeNode.cpp b/Runtime/World/CScriptMazeNode.cpp index 33732fa0d..5d8e3d88b 100644 --- a/Runtime/World/CScriptMazeNode.cpp +++ b/Runtime/World/CScriptMazeNode.cpp @@ -2,7 +2,7 @@ #include "Character/CModelData.hpp" #include "GameGlobalObjects.hpp" #include "CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptMazeNode.hpp b/Runtime/World/CScriptMazeNode.hpp index 79cadf353..f9e147d5a 100644 --- a/Runtime/World/CScriptMazeNode.hpp +++ b/Runtime/World/CScriptMazeNode.hpp @@ -1,6 +1,11 @@ #pragma once -#include "CActor.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CActor.hpp" + +#include namespace urde { class CScriptMazeNode : public CActor { diff --git a/Runtime/World/CScriptMemoryRelay.cpp b/Runtime/World/CScriptMemoryRelay.cpp index 1ed8fb785..39c760731 100644 --- a/Runtime/World/CScriptMemoryRelay.cpp +++ b/Runtime/World/CScriptMemoryRelay.cpp @@ -1,7 +1,7 @@ #include "CScriptMemoryRelay.hpp" #include "CStateManager.hpp" #include "CRelayTracker.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptMemoryRelay.hpp b/Runtime/World/CScriptMemoryRelay.hpp index 6ad43ce4e..594b6da71 100644 --- a/Runtime/World/CScriptMemoryRelay.hpp +++ b/Runtime/World/CScriptMemoryRelay.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CEntity.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CEntity.hpp" namespace urde { class CScriptMemoryRelay : public CEntity { diff --git a/Runtime/World/CScriptMidi.cpp b/Runtime/World/CScriptMidi.cpp index 21f0b81c5..9abe6110b 100644 --- a/Runtime/World/CScriptMidi.cpp +++ b/Runtime/World/CScriptMidi.cpp @@ -1,5 +1,5 @@ #include "CScriptMidi.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CSimplePool.hpp" #include "GameGlobalObjects.hpp" #include "CStateManager.hpp" diff --git a/Runtime/World/CScriptMidi.hpp b/Runtime/World/CScriptMidi.hpp index 2e3192ef3..296d0682f 100644 --- a/Runtime/World/CScriptMidi.hpp +++ b/Runtime/World/CScriptMidi.hpp @@ -1,8 +1,11 @@ #pragma once -#include "CEntity.hpp" -#include "CToken.hpp" -#include "Audio/CMidiManager.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Audio/CMidiManager.hpp" +#include "Runtime/World/CEntity.hpp" namespace urde { diff --git a/Runtime/World/CScriptPickup.cpp b/Runtime/World/CScriptPickup.cpp index 2e7fd3dbe..6c2923a15 100644 --- a/Runtime/World/CScriptPickup.cpp +++ b/Runtime/World/CScriptPickup.cpp @@ -4,7 +4,7 @@ #include "MP1/CArtifactDoll.hpp" #include "CExplosion.hpp" #include "CSimplePool.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CPlayer.hpp" #include "CGameState.hpp" #include "CGameOptions.hpp" diff --git a/Runtime/World/CScriptPickup.hpp b/Runtime/World/CScriptPickup.hpp index c619ff0e2..234d9fde2 100644 --- a/Runtime/World/CScriptPickup.hpp +++ b/Runtime/World/CScriptPickup.hpp @@ -1,7 +1,10 @@ #pragma once -#include "CPhysicsActor.hpp" -#include "CPlayerState.hpp" +#include + +#include "Runtime/CPlayerState.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CPhysicsActor.hpp" namespace urde { class CScriptPickup : public CPhysicsActor { diff --git a/Runtime/World/CScriptPickupGenerator.cpp b/Runtime/World/CScriptPickupGenerator.cpp index bcda153d9..e1ac83d61 100644 --- a/Runtime/World/CScriptPickupGenerator.cpp +++ b/Runtime/World/CScriptPickupGenerator.cpp @@ -1,5 +1,5 @@ #include "CScriptPickupGenerator.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" #include "CScriptPickup.hpp" #include "CWallCrawlerSwarm.hpp" diff --git a/Runtime/World/CScriptPickupGenerator.hpp b/Runtime/World/CScriptPickupGenerator.hpp index dffb67818..b05e23a3b 100644 --- a/Runtime/World/CScriptPickupGenerator.hpp +++ b/Runtime/World/CScriptPickupGenerator.hpp @@ -1,7 +1,10 @@ #pragma once -#include "CEntity.hpp" -#include "zeus/CVector3f.hpp" +#include + +#include "Runtime/World/CEntity.hpp" + +#include namespace urde { class CScriptPickupGenerator : public CEntity { diff --git a/Runtime/World/CScriptPlatform.cpp b/Runtime/World/CScriptPlatform.cpp index 31000b664..1473af292 100644 --- a/Runtime/World/CScriptPlatform.cpp +++ b/Runtime/World/CScriptPlatform.cpp @@ -9,7 +9,7 @@ #include "World/CScriptTrigger.hpp" #include "Graphics/CBooRenderer.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptPlatform.hpp b/Runtime/World/CScriptPlatform.hpp index 47364348b..d2dcdcfa8 100644 --- a/Runtime/World/CScriptPlatform.hpp +++ b/Runtime/World/CScriptPlatform.hpp @@ -1,10 +1,20 @@ #pragma once -#include "CPhysicsActor.hpp" +#include #include -#include "CToken.hpp" -#include "CHealthInfo.hpp" -#include "CDamageVulnerability.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/World/CDamageVulnerability.hpp" +#include "Runtime/World/CHealthInfo.hpp" +#include "Runtime/World/CPhysicsActor.hpp" + +#include +#include +#include namespace urde { class CCollidableOBBTreeGroup; diff --git a/Runtime/World/CScriptPlayerActor.cpp b/Runtime/World/CScriptPlayerActor.cpp index d12696925..fe9939e43 100644 --- a/Runtime/World/CScriptPlayerActor.cpp +++ b/Runtime/World/CScriptPlayerActor.cpp @@ -9,7 +9,7 @@ #include "World/CWorld.hpp" #include "MP1/MP1.hpp" #include "World/CPlayer.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "Camera/CGameCamera.hpp" namespace urde { diff --git a/Runtime/World/CScriptPlayerActor.hpp b/Runtime/World/CScriptPlayerActor.hpp index dd1e25090..bbd4d910f 100644 --- a/Runtime/World/CScriptPlayerActor.hpp +++ b/Runtime/World/CScriptPlayerActor.hpp @@ -1,7 +1,11 @@ #pragma once -#include "CScriptActor.hpp" -#include "CPlayerState.hpp" +#include +#include + +#include "Runtime/CPlayerState.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CScriptActor.hpp" namespace urde { class CScriptPlayerActor : public CScriptActor { diff --git a/Runtime/World/CScriptPlayerHint.cpp b/Runtime/World/CScriptPlayerHint.cpp index 0f619ecce..f233994e5 100644 --- a/Runtime/World/CScriptPlayerHint.cpp +++ b/Runtime/World/CScriptPlayerHint.cpp @@ -1,6 +1,6 @@ #include "CScriptPlayerHint.hpp" #include "CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" #include "CPlayer.hpp" #include "MP1/World/CMetroidPrimeRelay.hpp" diff --git a/Runtime/World/CScriptPlayerHint.hpp b/Runtime/World/CScriptPlayerHint.hpp index 0ed5114b5..878148aad 100644 --- a/Runtime/World/CScriptPlayerHint.hpp +++ b/Runtime/World/CScriptPlayerHint.hpp @@ -1,6 +1,10 @@ #pragma once -#include "CActor.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/World/CActor.hpp" namespace urde { diff --git a/Runtime/World/CScriptPlayerStateChange.cpp b/Runtime/World/CScriptPlayerStateChange.cpp index fb35a34b7..761c89875 100644 --- a/Runtime/World/CScriptPlayerStateChange.cpp +++ b/Runtime/World/CScriptPlayerStateChange.cpp @@ -2,7 +2,7 @@ #include "CStateManager.hpp" #include "CPlayerState.hpp" #include "Input/ControlMapper.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CScriptPlayerStateChange::CScriptPlayerStateChange(TUniqueId uid, std::string_view name, const CEntityInfo& info, diff --git a/Runtime/World/CScriptPlayerStateChange.hpp b/Runtime/World/CScriptPlayerStateChange.hpp index 024bf283f..d8f297460 100644 --- a/Runtime/World/CScriptPlayerStateChange.hpp +++ b/Runtime/World/CScriptPlayerStateChange.hpp @@ -1,6 +1,9 @@ #pragma once -#include "World/CEntity.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CEntity.hpp" namespace urde { class CScriptPlayerStateChange : public CEntity { diff --git a/Runtime/World/CScriptPointOfInterest.cpp b/Runtime/World/CScriptPointOfInterest.cpp index 3d1ed58a1..2fa156e8b 100644 --- a/Runtime/World/CScriptPointOfInterest.cpp +++ b/Runtime/World/CScriptPointOfInterest.cpp @@ -2,11 +2,11 @@ #include "CActorParameters.hpp" #include "CStateManager.hpp" #include "CPlayerState.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { -CScriptPointOfInterest::CScriptPointOfInterest(TUniqueId uid, std::string_view name, const CEntityInfo info, +CScriptPointOfInterest::CScriptPointOfInterest(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, bool active, const CScannableParameters& parms, float f1) : CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(u64(EMaterialTypes::Orbit)), diff --git a/Runtime/World/CScriptPointOfInterest.hpp b/Runtime/World/CScriptPointOfInterest.hpp index 7c24dfae2..89ee604e8 100644 --- a/Runtime/World/CScriptPointOfInterest.hpp +++ b/Runtime/World/CScriptPointOfInterest.hpp @@ -1,15 +1,17 @@ #pragma once -#include "CActor.hpp" +#include +#include "Runtime/World/CActor.hpp" namespace urde { class CScannableParameters; + class CScriptPointOfInterest : public CActor { private: float xe8_pointSize; public: - CScriptPointOfInterest(TUniqueId, std::string_view, const CEntityInfo, const zeus::CTransform&, bool, + CScriptPointOfInterest(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, bool, const CScannableParameters&, float); void Accept(IVisitor& visitor) override; diff --git a/Runtime/World/CScriptRandomRelay.cpp b/Runtime/World/CScriptRandomRelay.cpp index 92c231147..bcd1f1617 100644 --- a/Runtime/World/CScriptRandomRelay.cpp +++ b/Runtime/World/CScriptRandomRelay.cpp @@ -1,6 +1,6 @@ #include "CScriptRandomRelay.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CScriptRandomRelay::CScriptRandomRelay(TUniqueId uid, std::string_view name, const CEntityInfo& info, s32 sendSetSize, diff --git a/Runtime/World/CScriptRandomRelay.hpp b/Runtime/World/CScriptRandomRelay.hpp index 33490677b..6a4f9c8c8 100644 --- a/Runtime/World/CScriptRandomRelay.hpp +++ b/Runtime/World/CScriptRandomRelay.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CEntity.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CEntity.hpp" namespace urde { class CScriptRandomRelay : public CEntity { diff --git a/Runtime/World/CScriptRelay.cpp b/Runtime/World/CScriptRelay.cpp index 8861c2c92..b04514747 100644 --- a/Runtime/World/CScriptRelay.cpp +++ b/Runtime/World/CScriptRelay.cpp @@ -1,6 +1,6 @@ #include "CScriptRelay.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptRelay.hpp b/Runtime/World/CScriptRelay.hpp index a2c12ce9a..c280acf1f 100644 --- a/Runtime/World/CScriptRelay.hpp +++ b/Runtime/World/CScriptRelay.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CEntity.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CEntity.hpp" namespace urde { class CScriptRelay : public CEntity { diff --git a/Runtime/World/CScriptRipple.cpp b/Runtime/World/CScriptRipple.cpp index a1c56dcd5..b3811bc91 100644 --- a/Runtime/World/CScriptRipple.cpp +++ b/Runtime/World/CScriptRipple.cpp @@ -1,7 +1,7 @@ #include "CScriptRipple.hpp" #include "CStateManager.hpp" #include "CScriptWater.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptRipple.hpp b/Runtime/World/CScriptRipple.hpp index 3f9decfa9..8f9090acf 100644 --- a/Runtime/World/CScriptRipple.hpp +++ b/Runtime/World/CScriptRipple.hpp @@ -1,7 +1,10 @@ #pragma once -#include "CEntity.hpp" -#include "zeus/CVector3f.hpp" +#include + +#include "Runtime/World/CEntity.hpp" + +#include namespace urde { class CScriptRipple : public CEntity { diff --git a/Runtime/World/CScriptRoomAcoustics.cpp b/Runtime/World/CScriptRoomAcoustics.cpp index c6376405a..b7b315713 100644 --- a/Runtime/World/CScriptRoomAcoustics.cpp +++ b/Runtime/World/CScriptRoomAcoustics.cpp @@ -1,5 +1,5 @@ #include "CScriptRoomAcoustics.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "Audio/CSfxManager.hpp" namespace urde { diff --git a/Runtime/World/CScriptRoomAcoustics.hpp b/Runtime/World/CScriptRoomAcoustics.hpp index 371dfa6f4..ca1e0e4b9 100644 --- a/Runtime/World/CScriptRoomAcoustics.hpp +++ b/Runtime/World/CScriptRoomAcoustics.hpp @@ -1,9 +1,13 @@ #pragma once -#include "CEntity.hpp" -#include "amuse/EffectChorus.hpp" -#include "amuse/EffectDelay.hpp" -#include "amuse/EffectReverb.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CEntity.hpp" + +#include +#include +#include namespace urde { diff --git a/Runtime/World/CScriptShadowProjector.cpp b/Runtime/World/CScriptShadowProjector.cpp index a749927bb..dc5cbd005 100644 --- a/Runtime/World/CScriptShadowProjector.cpp +++ b/Runtime/World/CScriptShadowProjector.cpp @@ -2,7 +2,7 @@ #include "World/CActorParameters.hpp" #include "World/CProjectedShadow.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptShadowProjector.hpp b/Runtime/World/CScriptShadowProjector.hpp index 7a61f831d..188369b7e 100644 --- a/Runtime/World/CScriptShadowProjector.hpp +++ b/Runtime/World/CScriptShadowProjector.hpp @@ -1,9 +1,16 @@ #pragma once -#include "World/CActor.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CActor.hpp" + +#include namespace urde { class CProjectedShadow; + class CScriptShadowProjector : public CActor { float xe8_scale; zeus::CVector3f xec_offset; diff --git a/Runtime/World/CScriptSound.cpp b/Runtime/World/CScriptSound.cpp index 503623981..5c027ad3a 100644 --- a/Runtime/World/CScriptSound.cpp +++ b/Runtime/World/CScriptSound.cpp @@ -4,7 +4,7 @@ #include "CStateManager.hpp" #include "CWorld.hpp" #include "CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { bool CScriptSound::sFirstInFrame = false; diff --git a/Runtime/World/CScriptSound.hpp b/Runtime/World/CScriptSound.hpp index 8fa637fab..030a3c1d4 100644 --- a/Runtime/World/CScriptSound.hpp +++ b/Runtime/World/CScriptSound.hpp @@ -1,6 +1,10 @@ #pragma once -#include "CActor.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/Audio/CSfxManager.hpp" +#include "Runtime/World/CActor.hpp" namespace urde { diff --git a/Runtime/World/CScriptSpawnPoint.cpp b/Runtime/World/CScriptSpawnPoint.cpp index 802b80898..ae6b58c42 100644 --- a/Runtime/World/CScriptSpawnPoint.cpp +++ b/Runtime/World/CScriptSpawnPoint.cpp @@ -3,7 +3,7 @@ #include "CWorld.hpp" #include "CPlayer.hpp" #include "Particle/CGenDescription.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptSpawnPoint.hpp b/Runtime/World/CScriptSpawnPoint.hpp index 5ea69e072..ab867ec6c 100644 --- a/Runtime/World/CScriptSpawnPoint.hpp +++ b/Runtime/World/CScriptSpawnPoint.hpp @@ -1,8 +1,13 @@ #pragma once -#include "CEntity.hpp" -#include "zeus/CTransform.hpp" -#include "CPlayerState.hpp" +#include + +#include "Runtime/CPlayerState.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/World/CEntity.hpp" + +#include namespace urde { diff --git a/Runtime/World/CScriptSpecialFunction.cpp b/Runtime/World/CScriptSpecialFunction.cpp index 05cc0b7d1..b9f07ea90 100644 --- a/Runtime/World/CScriptSpecialFunction.cpp +++ b/Runtime/World/CScriptSpecialFunction.cpp @@ -13,7 +13,7 @@ #include "CSimplePool.hpp" #include "CStateManager.hpp" #include "IMain.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "hecl/CVarManager.hpp" diff --git a/Runtime/World/CScriptSpecialFunction.hpp b/Runtime/World/CScriptSpecialFunction.hpp index 0db12c6d7..6fcc2f161 100644 --- a/Runtime/World/CScriptSpecialFunction.hpp +++ b/Runtime/World/CScriptSpecialFunction.hpp @@ -1,9 +1,16 @@ #pragma once -#include "CActor.hpp" -#include "CDamageInfo.hpp" -#include "zeus/CTransform.hpp" -#include "zeus/CColor.hpp" +#include +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CActor.hpp" +#include "Runtime/World/CDamageInfo.hpp" + +#include +#include +#include namespace urde { class CScriptSpecialFunction : public CActor { diff --git a/Runtime/World/CScriptSpiderBallAttractionSurface.cpp b/Runtime/World/CScriptSpiderBallAttractionSurface.cpp index da0c68976..cc0aa8c7d 100644 --- a/Runtime/World/CScriptSpiderBallAttractionSurface.cpp +++ b/Runtime/World/CScriptSpiderBallAttractionSurface.cpp @@ -1,6 +1,6 @@ #include "CScriptSpiderBallAttractionSurface.hpp" #include "CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptSpiderBallAttractionSurface.hpp b/Runtime/World/CScriptSpiderBallAttractionSurface.hpp index d5889db01..90d31503e 100644 --- a/Runtime/World/CScriptSpiderBallAttractionSurface.hpp +++ b/Runtime/World/CScriptSpiderBallAttractionSurface.hpp @@ -1,6 +1,11 @@ #pragma once -#include "CActor.hpp" +#include + +#include "Runtime/World/CActor.hpp" + +#include +#include namespace urde { diff --git a/Runtime/World/CScriptSpiderBallWaypoint.cpp b/Runtime/World/CScriptSpiderBallWaypoint.cpp index 2b623ac16..4d5ea75c5 100644 --- a/Runtime/World/CScriptSpiderBallWaypoint.cpp +++ b/Runtime/World/CScriptSpiderBallWaypoint.cpp @@ -1,7 +1,7 @@ #include "CScriptSpiderBallWaypoint.hpp" #include "CActorParameters.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CScriptSpiderBallWaypoint::CScriptSpiderBallWaypoint(TUniqueId uid, std::string_view name, const CEntityInfo& info, diff --git a/Runtime/World/CScriptSpiderBallWaypoint.hpp b/Runtime/World/CScriptSpiderBallWaypoint.hpp index c43409e2f..7fb1e7ba2 100644 --- a/Runtime/World/CScriptSpiderBallWaypoint.hpp +++ b/Runtime/World/CScriptSpiderBallWaypoint.hpp @@ -1,6 +1,12 @@ #pragma once -#include "CActor.hpp" +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CActor.hpp" + +#include namespace urde { class CScriptSpiderBallWaypoint : public CActor { diff --git a/Runtime/World/CScriptSpindleCamera.cpp b/Runtime/World/CScriptSpindleCamera.cpp index d2158802f..2eb7290f3 100644 --- a/Runtime/World/CScriptSpindleCamera.cpp +++ b/Runtime/World/CScriptSpindleCamera.cpp @@ -5,7 +5,7 @@ #include "Camera/CBallCamera.hpp" #include "World/CPlayer.hpp" #include "World/CScriptCameraHint.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptSpindleCamera.hpp b/Runtime/World/CScriptSpindleCamera.hpp index 577a6eee1..8a494b7a0 100644 --- a/Runtime/World/CScriptSpindleCamera.hpp +++ b/Runtime/World/CScriptSpindleCamera.hpp @@ -1,6 +1,12 @@ #pragma once -#include "Camera/CGameCamera.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Camera/CGameCamera.hpp" + +#include namespace urde { diff --git a/Runtime/World/CScriptSteam.cpp b/Runtime/World/CScriptSteam.cpp index 971856ab5..991e9031c 100644 --- a/Runtime/World/CScriptSteam.cpp +++ b/Runtime/World/CScriptSteam.cpp @@ -1,7 +1,7 @@ #include "CScriptSteam.hpp" #include "CStateManager.hpp" #include "CPlayer.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptSteam.hpp b/Runtime/World/CScriptSteam.hpp index b93ef11f7..40d83e0a7 100644 --- a/Runtime/World/CScriptSteam.hpp +++ b/Runtime/World/CScriptSteam.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CScriptTrigger.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CScriptTrigger.hpp" namespace urde { diff --git a/Runtime/World/CScriptStreamedMusic.cpp b/Runtime/World/CScriptStreamedMusic.cpp index 4df2cfe4f..20902f540 100644 --- a/Runtime/World/CScriptStreamedMusic.cpp +++ b/Runtime/World/CScriptStreamedMusic.cpp @@ -1,6 +1,6 @@ #include "CScriptStreamedMusic.hpp" #include "CStringExtras.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" #include "CWorld.hpp" #include "CInGameTweakManagerBase.hpp" @@ -10,8 +10,9 @@ namespace urde { bool CScriptStreamedMusic::IsDSPFile(std::string_view fileName) { - if (!CStringExtras::CompareCaseInsensitive(fileName, "sw")) + if (CStringExtras::CompareCaseInsensitive(fileName, "sw")) { return true; + } return CStringExtras::IndexOfSubstring(fileName, ".dsp") != -1; } diff --git a/Runtime/World/CScriptStreamedMusic.hpp b/Runtime/World/CScriptStreamedMusic.hpp index fa0408243..e307ddc8d 100644 --- a/Runtime/World/CScriptStreamedMusic.hpp +++ b/Runtime/World/CScriptStreamedMusic.hpp @@ -1,8 +1,12 @@ #pragma once -#include "CEntity.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CEntity.hpp" namespace urde { +class CStateManager; class CScriptStreamedMusic : public CEntity { std::string x34_fileName; diff --git a/Runtime/World/CScriptSwitch.cpp b/Runtime/World/CScriptSwitch.cpp index de82e78e1..d12b9a8de 100644 --- a/Runtime/World/CScriptSwitch.cpp +++ b/Runtime/World/CScriptSwitch.cpp @@ -1,6 +1,6 @@ #include "CScriptSwitch.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CScriptSwitch::CScriptSwitch(TUniqueId uid, std::string_view name, const CEntityInfo& info, bool active, bool opened, diff --git a/Runtime/World/CScriptSwitch.hpp b/Runtime/World/CScriptSwitch.hpp index 20c2ea32a..920374725 100644 --- a/Runtime/World/CScriptSwitch.hpp +++ b/Runtime/World/CScriptSwitch.hpp @@ -1,6 +1,7 @@ #pragma once -#include "CEntity.hpp" +#include +#include "Runtime/World/CEntity.hpp" namespace urde { class CScriptSwitch : public CEntity { diff --git a/Runtime/World/CScriptTargetingPoint.cpp b/Runtime/World/CScriptTargetingPoint.cpp index 7539f4303..f5ea2dfc3 100644 --- a/Runtime/World/CScriptTargetingPoint.cpp +++ b/Runtime/World/CScriptTargetingPoint.cpp @@ -1,6 +1,6 @@ #include "World/CScriptTargetingPoint.hpp" #include "World/CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptTargetingPoint.hpp b/Runtime/World/CScriptTargetingPoint.hpp index 2c8b27ecd..92b61fe12 100644 --- a/Runtime/World/CScriptTargetingPoint.hpp +++ b/Runtime/World/CScriptTargetingPoint.hpp @@ -1,6 +1,9 @@ #pragma once -#include "World/CActor.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CActor.hpp" namespace urde { class CScriptTargetingPoint : public CActor { diff --git a/Runtime/World/CScriptTimer.cpp b/Runtime/World/CScriptTimer.cpp index 690d03586..ba9deaed5 100644 --- a/Runtime/World/CScriptTimer.cpp +++ b/Runtime/World/CScriptTimer.cpp @@ -1,6 +1,6 @@ #include "CScriptTimer.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CScriptTimer.hpp b/Runtime/World/CScriptTimer.hpp index a9f3cba04..c73f7ea96 100644 --- a/Runtime/World/CScriptTimer.hpp +++ b/Runtime/World/CScriptTimer.hpp @@ -1,6 +1,7 @@ #pragma once -#include "CEntity.hpp" +#include +#include "Runtime/World/CEntity.hpp" namespace urde { diff --git a/Runtime/World/CScriptTrigger.cpp b/Runtime/World/CScriptTrigger.cpp index b15ea7e5f..39c78be22 100644 --- a/Runtime/World/CScriptTrigger.cpp +++ b/Runtime/World/CScriptTrigger.cpp @@ -1,7 +1,7 @@ #include "CScriptTrigger.hpp" #include "CActorParameters.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "World/CPlayer.hpp" #include "Weapon/CGameProjectile.hpp" #include "Camera/CGameCamera.hpp" diff --git a/Runtime/World/CScriptTrigger.hpp b/Runtime/World/CScriptTrigger.hpp index 1167c2086..3fe57b9ac 100644 --- a/Runtime/World/CScriptTrigger.hpp +++ b/Runtime/World/CScriptTrigger.hpp @@ -1,7 +1,13 @@ #pragma once -#include "CActor.hpp" -#include "CDamageInfo.hpp" +#include +#include + +#include "Runtime/World/CActor.hpp" +#include "Runtime/World/CDamageInfo.hpp" + +#include +#include namespace urde { diff --git a/Runtime/World/CScriptVisorFlare.cpp b/Runtime/World/CScriptVisorFlare.cpp index a9b285e1f..798de5fb0 100644 --- a/Runtime/World/CScriptVisorFlare.cpp +++ b/Runtime/World/CScriptVisorFlare.cpp @@ -1,6 +1,6 @@ #include "CScriptVisorFlare.hpp" #include "CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" #include "CPlayer.hpp" #include "Particle/CGenDescription.hpp" diff --git a/Runtime/World/CScriptVisorFlare.hpp b/Runtime/World/CScriptVisorFlare.hpp index ba8e55541..718ccb7d4 100644 --- a/Runtime/World/CScriptVisorFlare.hpp +++ b/Runtime/World/CScriptVisorFlare.hpp @@ -1,7 +1,9 @@ #pragma once -#include "CActor.hpp" -#include "CVisorFlare.hpp" +#include + +#include "Runtime/World/CActor.hpp" +#include "Runtime/World/CVisorFlare.hpp" namespace urde { diff --git a/Runtime/World/CScriptVisorGoo.cpp b/Runtime/World/CScriptVisorGoo.cpp index 0cc8d726c..c01440306 100644 --- a/Runtime/World/CScriptVisorGoo.cpp +++ b/Runtime/World/CScriptVisorGoo.cpp @@ -2,7 +2,7 @@ #include "CActorParameters.hpp" #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" #include "CPlayer.hpp" #include "CHUDBillboardEffect.hpp" diff --git a/Runtime/World/CScriptVisorGoo.hpp b/Runtime/World/CScriptVisorGoo.hpp index 0ecbaab0a..df683ca51 100644 --- a/Runtime/World/CScriptVisorGoo.hpp +++ b/Runtime/World/CScriptVisorGoo.hpp @@ -1,6 +1,11 @@ #pragma once -#include "CActor.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CActor.hpp" + +#include namespace urde { diff --git a/Runtime/World/CScriptWater.cpp b/Runtime/World/CScriptWater.cpp index 0529d1f24..b50756da5 100644 --- a/Runtime/World/CScriptWater.cpp +++ b/Runtime/World/CScriptWater.cpp @@ -1,6 +1,6 @@ #include "CScriptWater.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "GameGlobalObjects.hpp" #include "CSimplePool.hpp" #include "World/CWorld.hpp" diff --git a/Runtime/World/CScriptWater.hpp b/Runtime/World/CScriptWater.hpp index 09d453bf5..938c2be12 100644 --- a/Runtime/World/CScriptWater.hpp +++ b/Runtime/World/CScriptWater.hpp @@ -1,7 +1,19 @@ #pragma once -#include "CScriptTrigger.hpp" -#include "CFluidPlaneCPU.hpp" +#include +#include +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/World/CFluidPlaneCPU.hpp" +#include "Runtime/World/CScriptTrigger.hpp" + +#include +#include +#include + namespace urde { class CDamageInfo; diff --git a/Runtime/World/CScriptWaypoint.cpp b/Runtime/World/CScriptWaypoint.cpp index 3efe7f7c4..64d9ff67b 100644 --- a/Runtime/World/CScriptWaypoint.cpp +++ b/Runtime/World/CScriptWaypoint.cpp @@ -1,6 +1,6 @@ #include "CScriptWaypoint.hpp" #include "CActorParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" namespace urde { diff --git a/Runtime/World/CScriptWaypoint.hpp b/Runtime/World/CScriptWaypoint.hpp index d9906c9e6..101fb526e 100644 --- a/Runtime/World/CScriptWaypoint.hpp +++ b/Runtime/World/CScriptWaypoint.hpp @@ -1,6 +1,9 @@ #pragma once -#include "CActor.hpp" +#include + +#include "Runtime/GCNTypes.hpp" +#include "Runtime/World/CActor.hpp" namespace urde { diff --git a/Runtime/World/CScriptWorldTeleporter.cpp b/Runtime/World/CScriptWorldTeleporter.cpp index 2eb0fc2da..5cfdbf563 100644 --- a/Runtime/World/CScriptWorldTeleporter.cpp +++ b/Runtime/World/CScriptWorldTeleporter.cpp @@ -4,7 +4,7 @@ #include "CWorld.hpp" #include "CGameState.hpp" #include "IMain.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { CScriptWorldTeleporter::CScriptWorldTeleporter(TUniqueId uid, std::string_view name, const CEntityInfo& info, diff --git a/Runtime/World/CScriptWorldTeleporter.hpp b/Runtime/World/CScriptWorldTeleporter.hpp index c3fd5fa10..f76a21763 100644 --- a/Runtime/World/CScriptWorldTeleporter.hpp +++ b/Runtime/World/CScriptWorldTeleporter.hpp @@ -1,8 +1,12 @@ #pragma once -#include "CEntity.hpp" -#include "CAnimationParameters.hpp" -#include "zeus/CVector3f.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CAnimationParameters.hpp" +#include "Runtime/World/CEntity.hpp" + +#include namespace urde { diff --git a/Runtime/World/CSnakeWeedSwarm.cpp b/Runtime/World/CSnakeWeedSwarm.cpp index aafcffec8..3c9c5fc98 100644 --- a/Runtime/World/CSnakeWeedSwarm.cpp +++ b/Runtime/World/CSnakeWeedSwarm.cpp @@ -1,6 +1,6 @@ #include "CSnakeWeedSwarm.hpp" #include "CAnimationParameters.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { diff --git a/Runtime/World/CSnakeWeedSwarm.hpp b/Runtime/World/CSnakeWeedSwarm.hpp index 3a39d9566..10d6b5b16 100644 --- a/Runtime/World/CSnakeWeedSwarm.hpp +++ b/Runtime/World/CSnakeWeedSwarm.hpp @@ -1,10 +1,11 @@ #pragma once -#include "World/CActor.hpp" -#include "Collision/CCollisionSurface.hpp" +#include "Runtime/Collision/CCollisionSurface.hpp" +#include "Runtime/World/CActor.hpp" namespace urde { class CAnimationParameters; + class CSnakeWeedSwarm : public CActor { public: CSnakeWeedSwarm(TUniqueId, bool, std::string_view, const CEntityInfo&, const zeus::CVector3f&, const zeus::CVector3f&, diff --git a/Runtime/World/CStateMachine.hpp b/Runtime/World/CStateMachine.hpp index 18c81ccf5..51470b73b 100644 --- a/Runtime/World/CStateMachine.hpp +++ b/Runtime/World/CStateMachine.hpp @@ -1,14 +1,18 @@ #pragma once -#include "CAiFuncMap.hpp" -#include "IObj.hpp" -#include "CToken.hpp" -#include "IOStreams.hpp" -#include "IObjFactory.hpp" +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/IObj.hpp" +#include "Runtime/IObjFactory.hpp" +#include "Runtime/IOStreams.hpp" +#include "Runtime/World/CAiFuncMap.hpp" namespace urde { class CAiState; class CStateManager; + class CAiTrigger { CAiTriggerFunc x0_func; float xc_arg = 0.f; diff --git a/Runtime/World/CTeamAiMgr.cpp b/Runtime/World/CTeamAiMgr.cpp index 21337a5c4..f5ac625f9 100644 --- a/Runtime/World/CTeamAiMgr.cpp +++ b/Runtime/World/CTeamAiMgr.cpp @@ -1,5 +1,5 @@ #include "CTeamAiMgr.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CStateManager.hpp" #include "CPlayer.hpp" diff --git a/Runtime/World/CTeamAiMgr.hpp b/Runtime/World/CTeamAiMgr.hpp index 712e10996..79e6aa5e7 100644 --- a/Runtime/World/CTeamAiMgr.hpp +++ b/Runtime/World/CTeamAiMgr.hpp @@ -1,7 +1,9 @@ #pragma once -#include "CEntity.hpp" -#include "zeus/CVector3f.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/World/CEntity.hpp" + +#include namespace urde { class CStateManager; diff --git a/Runtime/World/CVisorFlare.hpp b/Runtime/World/CVisorFlare.hpp index 2af7bd481..0f2fecc67 100644 --- a/Runtime/World/CVisorFlare.hpp +++ b/Runtime/World/CVisorFlare.hpp @@ -1,13 +1,17 @@ #pragma once -#include "RetroTypes.hpp" -#include "CToken.hpp" -#include "zeus/CColor.hpp" +#include +#include + +#include "Runtime/CToken.hpp" +#include "Runtime/RetroTypes.hpp" + +#include namespace urde { -class CTexture; class CActor; class CStateManager; +class CTexture; class CVisorFlare { public: diff --git a/Runtime/World/CVisorParameters.hpp b/Runtime/World/CVisorParameters.hpp index 95b4576fc..6cc09d1a4 100644 --- a/Runtime/World/CVisorParameters.hpp +++ b/Runtime/World/CVisorParameters.hpp @@ -1,6 +1,6 @@ #pragma once -#include "RetroTypes.hpp" +#include "Runtime/GCNTypes.hpp" namespace urde { diff --git a/Runtime/World/CWallCrawlerSwarm.cpp b/Runtime/World/CWallCrawlerSwarm.cpp index 1b0242447..623691abc 100644 --- a/Runtime/World/CWallCrawlerSwarm.cpp +++ b/Runtime/World/CWallCrawlerSwarm.cpp @@ -17,7 +17,7 @@ #include "CStateManager.hpp" #include "CSimplePool.hpp" #include "World/CPhysicsActor.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path namespace urde { @@ -78,16 +78,16 @@ CWallCrawlerSwarm::CWallCrawlerSwarm(TUniqueId uid, bool active, std::string_vie CAnimRes launchAnimRes(animRes); launchAnimRes.SetCanLoop(true); launchAnimRes.SetDefaultAnim(launchAnim != -1 ? launchAnim : 0); - x4b0_modelDatas.emplace_back(new CModelData(animRes)); - x4b0_modelDatas.emplace_back(new CModelData(animRes)); - x4b0_modelDatas.emplace_back(new CModelData(animRes)); - x4b0_modelDatas.emplace_back(new CModelData(animRes)); - x4b0_modelDatas.emplace_back(new CModelData(attractAnimRes)); - x4b0_modelDatas.emplace_back(new CModelData(attractAnimRes)); - x4b0_modelDatas.emplace_back(new CModelData(attractAnimRes)); - x4b0_modelDatas.emplace_back(new CModelData(attractAnimRes)); - x4b0_modelDatas.emplace_back(new CModelData(launchAnimRes)); - x4b0_modelDatas.emplace_back(new CModelData(animRes)); + x4b0_modelDatas.emplace_back(std::make_unique(animRes)); + x4b0_modelDatas.emplace_back(std::make_unique(animRes)); + x4b0_modelDatas.emplace_back(std::make_unique(animRes)); + x4b0_modelDatas.emplace_back(std::make_unique(animRes)); + x4b0_modelDatas.emplace_back(std::make_unique(attractAnimRes)); + x4b0_modelDatas.emplace_back(std::make_unique(attractAnimRes)); + x4b0_modelDatas.emplace_back(std::make_unique(attractAnimRes)); + x4b0_modelDatas.emplace_back(std::make_unique(attractAnimRes)); + x4b0_modelDatas.emplace_back(std::make_unique(launchAnimRes)); + x4b0_modelDatas.emplace_back(std::make_unique(animRes)); if (aParams.GetXRayAssets().first.IsValid()) { for (int i = 0; i < 9; ++i) x4b0_modelDatas[i]->SetXRayModel(aParams.GetXRayAssets()); diff --git a/Runtime/World/CWallCrawlerSwarm.hpp b/Runtime/World/CWallCrawlerSwarm.hpp index 8c7689deb..f88871b9c 100644 --- a/Runtime/World/CWallCrawlerSwarm.hpp +++ b/Runtime/World/CWallCrawlerSwarm.hpp @@ -1,10 +1,21 @@ #pragma once -#include "World/CActor.hpp" -#include "Collision/CCollisionSurface.hpp" -#include "World/CDamageInfo.hpp" -#include "World/CDamageVulnerability.hpp" -#include "Particle/CElementGen.hpp" +#include +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Collision/CCollisionSurface.hpp" +#include "Runtime/Particle/CElementGen.hpp" +#include "Runtime/World/CActor.hpp" +#include "Runtime/World/CDamageInfo.hpp" +#include "Runtime/World/CDamageVulnerability.hpp" + +#include +#include +#include +#include namespace urde { class CAreaCollisionCache; diff --git a/Runtime/World/CWallWalker.cpp b/Runtime/World/CWallWalker.cpp index 050beb0a1..76e2e431a 100644 --- a/Runtime/World/CWallWalker.cpp +++ b/Runtime/World/CWallWalker.cpp @@ -1,7 +1,7 @@ #include "CWallWalker.hpp" #include "CPatternedInfo.hpp" #include "CStateManager.hpp" -#include "TCastTo.hpp" +#include "TCastTo.hpp" // Generated file, do not modify include path #include "CScriptWaypoint.hpp" #include "Collision/CMetroidAreaCollider.hpp" #include "Collision/CGameCollision.hpp" diff --git a/Runtime/World/CWallWalker.hpp b/Runtime/World/CWallWalker.hpp index 7ee081c41..ab51512d6 100644 --- a/Runtime/World/CWallWalker.hpp +++ b/Runtime/World/CWallWalker.hpp @@ -1,8 +1,13 @@ #pragma once -#include "CPatterned.hpp" -#include "Collision/CCollisionSurface.hpp" -#include "Collision/CCollidableSphere.hpp" +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Collision/CCollidableSphere.hpp" +#include "Runtime/Collision/CCollisionSurface.hpp" +#include "Runtime/World/CPatterned.hpp" + +#include namespace urde { class CWallWalker : public CPatterned { diff --git a/Runtime/World/CWorld.hpp b/Runtime/World/CWorld.hpp index 12d7200ec..dbe99f741 100644 --- a/Runtime/World/CWorld.hpp +++ b/Runtime/World/CWorld.hpp @@ -1,19 +1,24 @@ #pragma once -#include "RetroTypes.hpp" -#include "ScriptObjectSupport.hpp" -#include "CGameArea.hpp" -#include "Graphics/CModel.hpp" -#include "Audio/CSfxManager.hpp" -#include "AutoMapper/CMapWorld.hpp" -#include "CEnvFxManager.hpp" +#include +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" +#include "Runtime/Audio/CSfxManager.hpp" +#include "Runtime/AutoMapper/CMapWorld.hpp" +#include "Runtime/Graphics/CModel.hpp" +#include "Runtime/World/CEnvFxManager.hpp" +#include "Runtime/World/CGameArea.hpp" +#include "Runtime/World/ScriptObjectSupport.hpp" namespace urde { +class CAudioGroupSet; class CGameArea; -class IObjectStore; class CResFactory; class IGameArea; -class CAudioGroupSet; +class IObjectStore; class IWorld { public: diff --git a/Runtime/World/CWorldLight.hpp b/Runtime/World/CWorldLight.hpp index 6e68075bb..eccf6ffab 100644 --- a/Runtime/World/CWorldLight.hpp +++ b/Runtime/World/CWorldLight.hpp @@ -1,6 +1,7 @@ #pragma once -#include "Graphics/CLight.hpp" +#include "Runtime/Graphics/CLight.hpp" +#include namespace urde { class CWorldLight { diff --git a/Runtime/World/CWorldShadow.hpp b/Runtime/World/CWorldShadow.hpp index b80c8e5ea..993f5389b 100644 --- a/Runtime/World/CWorldShadow.hpp +++ b/Runtime/World/CWorldShadow.hpp @@ -1,8 +1,11 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CAABox.hpp" -#include "Graphics/Shaders/CWorldShadowShader.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Graphics/Shaders/CWorldShadowShader.hpp" + +#include +#include +#include #define CWORLDSHADOW_FEEDBACK 0 diff --git a/Runtime/World/CWorldTransManager.cpp b/Runtime/World/CWorldTransManager.cpp index 624a18ff6..f3be4bc19 100644 --- a/Runtime/World/CWorldTransManager.cpp +++ b/Runtime/World/CWorldTransManager.cpp @@ -384,7 +384,7 @@ void CWorldTransManager::EnableTransition(const CAnimRes& samusRes, CAssetId pla x44_25_stopSoon = false; x44_26_goingUp = goingUp; x30_type = ETransType::Enabled; - x4_modelData.reset(new SModelDatas(samusRes)); + x4_modelData = std::make_unique(samusRes); if (!m_reflectionCube[0] && hecl::com_cubemaps->toBoolean()) CGraphics::CommitResources([this](boo::IGraphicsDataFactory::Context& ctx) { @@ -437,11 +437,9 @@ void CWorldTransManager::EnableTransition(CAssetId fontId, CAssetId stringId, u3 x4_modelData.reset(); x44_27_fadeWhite = fadeWhite; - CGuiTextProperties props(false, true, EJustification::Center, EVerticalJustification::Center); - x8_textData.reset(new CGuiTextSupport(fontId, props, zeus::skWhite, zeus::skBlack, - zeus::skWhite, 640, 448, g_SimplePool, - CGuiWidget::EGuiModelDrawFlags::Additive)); - + const CGuiTextProperties props(false, true, EJustification::Center, EVerticalJustification::Center); + x8_textData = std::make_unique(fontId, props, zeus::skWhite, zeus::skBlack, zeus::skWhite, 640, 448, + g_SimplePool, CGuiWidget::EGuiModelDrawFlags::Additive); x8_textData->SetTypeWriteEffectOptions(true, chFadeTime, chFadeRate); xc_strTable = g_SimplePool->GetObj(SObjectTag{FOURCC('STRG'), stringId}); x8_textData->SetText(u""); diff --git a/Runtime/World/CWorldTransManager.hpp b/Runtime/World/CWorldTransManager.hpp index 38e16740c..418452add 100644 --- a/Runtime/World/CWorldTransManager.hpp +++ b/Runtime/World/CWorldTransManager.hpp @@ -1,14 +1,21 @@ #pragma once -#include "RetroTypes.hpp" -#include "CRandom16.hpp" -#include "Character/CModelData.hpp" -#include "GuiSys/CGuiTextSupport.hpp" -#include "Graphics/CLight.hpp" -#include "Graphics/Shaders/CColoredQuadFilter.hpp" -#include "Graphics/Shaders/CTexturedQuadFilter.hpp" -#include "Graphics/Shaders/CCameraBlurFilter.hpp" -#include "Audio/CSfxManager.hpp" +#include +#include + +#include "Runtime/CRandom16.hpp" +#include "Runtime/RetroTypes.hpp" +#include "Runtime/Audio/CSfxManager.hpp" +#include "Runtime/Character/CModelData.hpp" +#include "Runtime/Graphics/CLight.hpp" +#include "Runtime/Graphics/Shaders/CCameraBlurFilter.hpp" +#include "Runtime/Graphics/Shaders/CColoredQuadFilter.hpp" +#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp" +#include "Runtime/GuiSys/CGuiTextSupport.hpp" + +#include +#include +#include namespace urde { class CSimplePool; diff --git a/Runtime/World/IGameArea.hpp b/Runtime/World/IGameArea.hpp index a0addc90d..8d9256e03 100644 --- a/Runtime/World/IGameArea.hpp +++ b/Runtime/World/IGameArea.hpp @@ -1,7 +1,14 @@ #pragma once -#include "RetroTypes.hpp" -#include "zeus/CTransform.hpp" +#include +#include +#include + +#include "Runtime/RetroTypes.hpp" +#include "Runtime/rstl.hpp" + +#include +#include namespace urde { class CEntity; diff --git a/Runtime/World/ScriptLoader.hpp b/Runtime/World/ScriptLoader.hpp index 095ccabd4..e0a84d55e 100644 --- a/Runtime/World/ScriptLoader.hpp +++ b/Runtime/World/ScriptLoader.hpp @@ -1,20 +1,22 @@ #pragma once -#include "IOStreams.hpp" -#include "zeus/CTransform.hpp" +#include "Runtime/IOStreams.hpp" + +#include +#include namespace urde { -class CStateManager; -class CEntityInfo; -class CEntity; -class CGrappleParameters; class CActorParameters; -class CVisorParameters; -class CScannableParameters; -class CLightParameters; class CAnimationParameters; -class CFluidUVMotion; class CCameraShakeData; +class CEntity; +class CEntityInfo; +class CFluidUVMotion; +class CGrappleParameters; +class CLightParameters; +class CScannableParameters; +class CStateManager; +class CVisorParameters; typedef CEntity* (*FScriptLoader)(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info); diff --git a/gbalink/main.cpp b/gbalink/main.cpp index 08ab14c9b..3b33f804b 100644 --- a/gbalink/main.cpp +++ b/gbalink/main.cpp @@ -1,11 +1,12 @@ #include -#include "GCNTypes.hpp" +#include #include -#include -#include #include -#include "jbus/Endpoint.hpp" -#include "jbus/Listener.hpp" + +#include "GCNTypes.hpp" + +#include +#include #undef min #undef max @@ -97,24 +98,34 @@ bool CGBASupport::PollResponse() { if (status != (jbus::GBA_JSTAT_PSF1 | jbus::GBA_JSTAT_SEND)) return false; - u8 bytes[4]; - if (m_endpoint->GBARead(bytes, &status) == jbus::GBA_NOT_READY) - return false; - if (reinterpret_cast(bytes) != SBIG('AMTE')) + jbus::ReadWriteBuffer bytes; + if (m_endpoint->GBARead(bytes, &status) == jbus::GBA_NOT_READY) { return false; + } - if (m_endpoint->GBAGetStatus(&status) == jbus::GBA_NOT_READY) - return false; - if (status != jbus::GBA_JSTAT_PSF1) + u32 bytesU32; + std::memcpy(&bytesU32, bytes.data(), sizeof(bytes)); + if (bytesU32 != SBIG('AMTE')) { return false; + } - if (m_endpoint->GBAWrite((unsigned char*)"AMTE", &status) == jbus::GBA_NOT_READY) + if (m_endpoint->GBAGetStatus(&status) == jbus::GBA_NOT_READY) { return false; + } + if (status != jbus::GBA_JSTAT_PSF1) { + return false; + } - if (m_endpoint->GBAGetStatus(&status) == jbus::GBA_NOT_READY) + if (m_endpoint->GBAWrite({'A', 'M', 'T', 'E'}, &status) == jbus::GBA_NOT_READY) { return false; - if ((status & jbus::GBA_JSTAT_FLAGS_MASK) != jbus::GBA_JSTAT_FLAGS_MASK) + } + + if (m_endpoint->GBAGetStatus(&status) == jbus::GBA_NOT_READY) { return false; + } + if ((status & jbus::GBA_JSTAT_FLAGS_MASK) != jbus::GBA_JSTAT_FLAGS_MASK) { + return false; + } u64 profStart = jbus::GetGCTicks(); const u64 timeToSpin = jbus::GetGCTicksPerSec() / 8000; @@ -138,7 +149,7 @@ bool CGBASupport::PollResponse() { if (m_endpoint->GBARead(bytes, &status) != jbus::GBA_READY) return false; - if (bytes[3] != CalculateFusionJBusChecksum(bytes, 3)) + if (bytes[3] != CalculateFusionJBusChecksum(bytes.data(), 3)) return false; x44_fusionLinked = (bytes[2] & 0x2) == 0; diff --git a/visigen/CMakeLists.txt b/visigen/CMakeLists.txt index 2e5853313..da13fffd9 100644 --- a/visigen/CMakeLists.txt +++ b/visigen/CMakeLists.txt @@ -5,33 +5,51 @@ project(visigen) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_executable(visigen + VISIBuilder.cpp + VISIBuilder.hpp + VISIRenderer.cpp + VISIRenderer.hpp +) + if(MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") + target_compile_options(visigen PRIVATE /EHsc) else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}\ - -Wno-multichar -fno-exceptions -Wno-narrowing -Wno-nullability-completeness -Werror=return-type") + target_compile_options(visigen PRIVATE + -fno-exceptions + + -Werror=return-type + -Wno-multichar + -Wno-narrowing + -Wno-nullability-completeness + ) endif() if(APPLE) - set(PLAT_SRCS MainMac.mm) + target_sources(visigen PRIVATE MainMac.mm) set_source_files_properties(MainMac.mm PROPERTIES COMPILE_FLAGS -fobjc-arc) elseif(WIN32) - set(PLAT_SRCS MainWin.cpp) + target_sources(visigen PRIVATE MainWin.cpp) else() - set(PLAT_SRCS MainXlib.cpp) + target_sources(visigen PRIVATE MainXlib.cpp) endif() -add_executable(visigen ${PLAT_SRCS} - VISIRenderer.cpp VISIRenderer.hpp - VISIBuilder.cpp VISIBuilder.hpp) - set_target_properties(visigen PROPERTIES COMPILE_DEFINITIONS URDE_DLPACKAGE="${URDE_DLPACKAGE}") if(APPLE) find_library(OPENGL_LIBRARY OpenGL) - set(PLAT_LIBS ${OPENGL_LIBRARY}) + target_link_libraries(visigen PRIVATE ${OPENGL_LIBRARY}) endif() -target_link_libraries(visigen logvisor athena-core zeus glew - xxhash ${ZLIB_LIBRARIES} lzokay hecl-light ${PLAT_LIBS}) +target_link_libraries(visigen PRIVATE + athena-core + glew + hecl-light + logvisor + lzokay + xxhash + zeus + ${ZLIB_LIBRARIES} +) endif()