From a32a168f7968b4498cb966bed7e766ce595a037f Mon Sep 17 00:00:00 2001 From: Hyper <34012267+hyperbx@users.noreply.github.com> Date: Wed, 20 Nov 2024 04:26:39 +0000 Subject: [PATCH] api: update research --- UnleashedRecomp/api/SWA.h | 9 ++++ UnleashedRecomp/api/SWA/Sound/Sound.h | 51 ++++++++++++++++--- .../api/SWA/Sound/SoundBGMActEvil.h | 8 --- .../api/SWA/Sound/SoundBGMActSonic.h | 21 ++++++++ UnleashedRecomp/api/SWA/Sound/SoundBGMBase.h | 15 ++++++ UnleashedRecomp/api/SWA/System/Application.h | 21 ++++++++ .../api/SWA/System/ApplicationD3D9.h | 8 +++ .../api/SWA/System/ApplicationDocument.h | 9 +++- .../api/SWA/System/ApplicationXenon.h | 12 +++++ UnleashedRecomp/api/SWA/System/Game.h | 10 ++++ UnleashedRecomp/api/SWA/System/GameDocument.h | 10 ++-- .../api/SWA/System/GameMode/GameMode.h | 13 +++++ .../api/SWA/System/GameMode/GameModeStage.h | 8 +++ .../api/boost/smart_ptr/shared_ptr.h | 4 +- 14 files changed, 173 insertions(+), 26 deletions(-) delete mode 100644 UnleashedRecomp/api/SWA/Sound/SoundBGMActEvil.h create mode 100644 UnleashedRecomp/api/SWA/Sound/SoundBGMActSonic.h create mode 100644 UnleashedRecomp/api/SWA/Sound/SoundBGMBase.h create mode 100644 UnleashedRecomp/api/SWA/System/Application.h create mode 100644 UnleashedRecomp/api/SWA/System/ApplicationD3D9.h create mode 100644 UnleashedRecomp/api/SWA/System/ApplicationXenon.h create mode 100644 UnleashedRecomp/api/SWA/System/Game.h create mode 100644 UnleashedRecomp/api/SWA/System/GameMode/GameMode.h create mode 100644 UnleashedRecomp/api/SWA/System/GameMode/GameModeStage.h diff --git a/UnleashedRecomp/api/SWA.h b/UnleashedRecomp/api/SWA.h index 7ac8a77a..cd70b616 100644 --- a/UnleashedRecomp/api/SWA.h +++ b/UnleashedRecomp/api/SWA.h @@ -39,9 +39,18 @@ #include "SWA/Player/Character/EvilSonic/Hud/EvilHudGuide.h" #include "SWA/Player/Character/EvilSonic/EvilSonic.h" #include "SWA/Player/Character/EvilSonic/EvilSonicContext.h" +#include "SWA/Sound/Sound.h" +#include "SWA/Sound/SoundBGMActSonic.h" +#include "SWA/Sound/SoundBGMBase.h" #include "SWA/System/GameMode/Title/TitleMenu.h" #include "SWA/System/GameMode/Title/TitleStateBase.h" +#include "SWA/System/GameMode/GameMode.h" +#include "SWA/System/GameMode/GameModeStage.h" +#include "SWA/System/Application.h" +#include "SWA/System/ApplicationD3D9.h" +#include "SWA/System/ApplicationXenon.h" #include "SWA/System/ApplicationDocument.h" +#include "SWA/System/Game.h" #include "SWA/System/GameDocument.h" #include "SWA/System/GameObject.h" #include "SWA/System/InputState.h" diff --git a/UnleashedRecomp/api/SWA/Sound/Sound.h b/UnleashedRecomp/api/SWA/Sound/Sound.h index f31c82fd..86969f30 100644 --- a/UnleashedRecomp/api/SWA/Sound/Sound.h +++ b/UnleashedRecomp/api/SWA/Sound/Sound.h @@ -1,20 +1,55 @@ #pragma once +#include +#include + namespace SWA { - class CSound // : public CGameObject + class CSoundAdministrator : public CGameObject { public: - struct SSoundInfo + class CSimplePlayer {}; + + class CBgm { public: - SWA_INSERT_PADDING(0x04); - xpointer m_pAdminSimplePlayer; - SWA_INSERT_PADDING(0x04); - xpointer m_pAdminBgm; + xpointer m_pThis; + boost::shared_ptr m_spSoundBGM; + be m_Volume1; + be m_Volume2; + be m_Volume3; + be m_Volume4; + SWA_INSERT_PADDING(0x10); }; - SWA_INSERT_PADDING(0xC4); - xpointer m_pSoundInfo; + class CCommunicator + { + public: + class CCommunicatorDevice : Hedgehog::Base::CSynchronizedObject + { + public: + SWA_INSERT_PADDING(0x08); + Hedgehog::Base::CSharedString m_HostName; + SWA_INSERT_PADDING(0x04); + Hedgehog::Base::CSharedString m_Category; + Hedgehog::Base::CSharedString m_Command; + SWA_INSERT_PADDING(0x04); + }; + + xpointer m_pThis; + boost::shared_ptr m_spCommunicatorDevice; + }; + + class CMember + { + public: + boost::shared_ptr m_spSimplePlayer; + boost::shared_ptr m_spBgm; + boost::shared_ptr m_spCommunicator; + SWA_INSERT_PADDING(0x58); + }; + + SWA_INSERT_PADDING(0x04); // vftable ptr + xpointer m_pMember; }; } diff --git a/UnleashedRecomp/api/SWA/Sound/SoundBGMActEvil.h b/UnleashedRecomp/api/SWA/Sound/SoundBGMActEvil.h deleted file mode 100644 index c23a3f03..00000000 --- a/UnleashedRecomp/api/SWA/Sound/SoundBGMActEvil.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -namespace SWA -{ - class CSoundBGMActEvil - { - }; -} diff --git a/UnleashedRecomp/api/SWA/Sound/SoundBGMActSonic.h b/UnleashedRecomp/api/SWA/Sound/SoundBGMActSonic.h new file mode 100644 index 00000000..5f3371ac --- /dev/null +++ b/UnleashedRecomp/api/SWA/Sound/SoundBGMActSonic.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include + +namespace SWA +{ + class CSoundBGMActSonic : public CSoundBGMBase + { + public: + class CMember + { + public: + SWA_INSERT_PADDING(0x58); + be m_Volume1; + be m_Volume2; + }; + + xpointer m_pMember; + }; +} diff --git a/UnleashedRecomp/api/SWA/Sound/SoundBGMBase.h b/UnleashedRecomp/api/SWA/Sound/SoundBGMBase.h new file mode 100644 index 00000000..3f8a7c2f --- /dev/null +++ b/UnleashedRecomp/api/SWA/Sound/SoundBGMBase.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +namespace SWA +{ + class CSoundBGMBase : Hedgehog::Universe::CMessageActor + { + public: + SWA_INSERT_PADDING(0x04); // vftable ptr + SWA_INSERT_PADDING(0x04); + xpointer m_pGameDocument; + bool m_Unk; + }; +} diff --git a/UnleashedRecomp/api/SWA/System/Application.h b/UnleashedRecomp/api/SWA/System/Application.h new file mode 100644 index 00000000..326d734b --- /dev/null +++ b/UnleashedRecomp/api/SWA/System/Application.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include + +namespace SWA +{ + class CApplication : public Hedgehog::Base::CObject + { + public: + class CMember + { + public: + xpointer m_pApplicationDocument; + }; + + SWA_INSERT_PADDING(0x04); // vftable ptr + xpointer m_pMember; + SWA_INSERT_PADDING(0x18); + }; +} diff --git a/UnleashedRecomp/api/SWA/System/ApplicationD3D9.h b/UnleashedRecomp/api/SWA/System/ApplicationD3D9.h new file mode 100644 index 00000000..ef88f297 --- /dev/null +++ b/UnleashedRecomp/api/SWA/System/ApplicationD3D9.h @@ -0,0 +1,8 @@ +#pragma once + +#include + +namespace SWA +{ + class CApplicationD3D9 : public CApplication {}; +} diff --git a/UnleashedRecomp/api/SWA/System/ApplicationDocument.h b/UnleashedRecomp/api/SWA/System/ApplicationDocument.h index 598c4715..6cf4fd20 100644 --- a/UnleashedRecomp/api/SWA/System/ApplicationDocument.h +++ b/UnleashedRecomp/api/SWA/System/ApplicationDocument.h @@ -1,5 +1,8 @@ #pragma once +#include +#include + namespace SWA { class CApplicationDocument // : public Hedgehog::Base::CSynchronizedObject @@ -8,8 +11,10 @@ namespace SWA class CMember { public: - SWA_INSERT_PADDING(0x138); - void* m_spGameParameter; + SWA_INSERT_PADDING(0x20); + boost::shared_ptr m_pGame; + SWA_INSERT_PADDING(0x114); + xpointer m_spGameParameter; }; // TODO: Hedgehog::Base::TSynchronizedPtr diff --git a/UnleashedRecomp/api/SWA/System/ApplicationXenon.h b/UnleashedRecomp/api/SWA/System/ApplicationXenon.h new file mode 100644 index 00000000..ed5d6c1c --- /dev/null +++ b/UnleashedRecomp/api/SWA/System/ApplicationXenon.h @@ -0,0 +1,12 @@ +#pragma once + +#include + +namespace SWA +{ + class CApplicationXenon : public CApplicationD3D9 + { + public: + SWA_INSERT_PADDING(0x1B4); + }; +} diff --git a/UnleashedRecomp/api/SWA/System/Game.h b/UnleashedRecomp/api/SWA/System/Game.h new file mode 100644 index 00000000..9e0101ae --- /dev/null +++ b/UnleashedRecomp/api/SWA/System/Game.h @@ -0,0 +1,10 @@ +#pragma once + +namespace SWA +{ + class CGame // : Hedgehog::Universe::TStateMachine + { + public: + SWA_INSERT_PADDING(0xFC); + }; +} diff --git a/UnleashedRecomp/api/SWA/System/GameDocument.h b/UnleashedRecomp/api/SWA/System/GameDocument.h index f4695315..b75db5e9 100644 --- a/UnleashedRecomp/api/SWA/System/GameDocument.h +++ b/UnleashedRecomp/api/SWA/System/GameDocument.h @@ -1,7 +1,5 @@ #pragma once -#include "SWA/Sound/Sound.h" - namespace Hedgehog::Database { class CDatabase; @@ -17,16 +15,16 @@ namespace SWA public: SWA_INSERT_PADDING(0x1C); boost::shared_ptr m_spDatabase; - SWA_INSERT_PADDING(0x90); - xpointer m_pSound; - SWA_INSERT_PADDING(0x158); + SWA_INSERT_PADDING(0x8C); + xpointer m_pSoundAdministrator; + SWA_INSERT_PADDING(0x15C); be m_Score; }; // TODO: Hedgehog::Base::TSynchronizedPtr static CGameDocument* GetInstance(); - SWA_INSERT_PADDING(0x04); + SWA_INSERT_PADDING(0x04); // vftable ptr xpointer m_pMember; }; } diff --git a/UnleashedRecomp/api/SWA/System/GameMode/GameMode.h b/UnleashedRecomp/api/SWA/System/GameMode/GameMode.h new file mode 100644 index 00000000..5b6c35dc --- /dev/null +++ b/UnleashedRecomp/api/SWA/System/GameMode/GameMode.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace SWA +{ + class CGameMode // : Hedgehog::Universe::TStateMachine::TState + { + public: + SWA_INSERT_PADDING(0x60); // base + SWA_INSERT_PADDING(0x08); + }; +} diff --git a/UnleashedRecomp/api/SWA/System/GameMode/GameModeStage.h b/UnleashedRecomp/api/SWA/System/GameMode/GameModeStage.h new file mode 100644 index 00000000..c99d4a17 --- /dev/null +++ b/UnleashedRecomp/api/SWA/System/GameMode/GameModeStage.h @@ -0,0 +1,8 @@ +#pragma once + +#include + +namespace SWA +{ + class CGameModeStage : public CGameMode {}; +} diff --git a/UnleashedRecomp/api/boost/smart_ptr/shared_ptr.h b/UnleashedRecomp/api/boost/smart_ptr/shared_ptr.h index afe54f20..a5b9bb94 100644 --- a/UnleashedRecomp/api/boost/smart_ptr/shared_ptr.h +++ b/UnleashedRecomp/api/boost/smart_ptr/shared_ptr.h @@ -10,7 +10,7 @@ namespace boost { private: xpointer m_pObject; - xpointer m_pRefCount; + xpointer m_pRefCount; void release() { @@ -24,7 +24,7 @@ namespace boost public: shared_ptr() : m_pObject(nullptr), m_pRefCount(nullptr) {} - explicit shared_ptr(T* p) : m_pObject(p), m_pRefCount(new size_t(1)) {} + explicit shared_ptr(T* p) : m_pObject(p), m_pRefCount(new uint32_t(1)) {} shared_ptr(const shared_ptr& other) : m_pObject(other.m_pObject), m_pRefCount(other.m_pRefCount) {