Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 17 additions & 26 deletions include/SmSdk/AreaTriggerManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,23 @@ SMSDK_BEGIN_NAMESPACE

struct AreaTrigger
{
/* 0x0000 */ std::int32_t m_iId;
/* 0x0004 */ std::int16_t m_iWorldId;
private:
/* 0x0006 */ char pad_0x6[0xE];
public:
/* 0x0014 */ uint32_t m_uFilter;
private:
/* 0x0018 */ char pad_0x18[0xC];
/* 0x0024 */ uint32_t m_uSomeFlag;
/* 0x0028 */ char pad_0x28[0x4];
public:
/* 0x002C */ bool m_bWaterTrigger;
private:
/* 0x002D */ char pad_0x2D[0x3];
public:
/* 0x0030 */ btBoxShape* m_pBoxShape;
/* 0x0038 */ btPairCachingGhostObject* m_pGhostObject;
/* 0x0040 */ AreaTriggerProxy* m_pPhysicsProxy;
private:
/* 0x0048 */ char pad_0x48[0x100];
public:
/* 0x0148 */ DirectX::XMFLOAT3 m_position;
/* 0x0154 */ DirectX::XMFLOAT4 m_rotation;
/* 0x0164 */ DirectX::XMFLOAT3 m_size;
private:
/* 0x0170 */ char pad_0x170[0x8];
/* 0x0000 */ SDK_PUB std::int32_t m_iId;
/* 0x0004 */ SDK_PUB std::int16_t m_iWorldId;
/* 0x0006 */ SDK_PRI char pad_0x6[0xE];
/* 0x0014 */ SDK_PUB std::uint32_t m_uFilter;
/* 0x0018 */ SDK_PRI char pad_0x18[0xC];
/* 0x0024 */ SDK_PRI std::uint32_t m_uSomeFlag;
/* 0x0028 */ SDK_PRI char pad_0x28[0x4];
/* 0x002C */ SDK_PUB bool m_bWaterTrigger;
/* 0x002D */ SDK_PRI char pad_0x2D[0x3];
/* 0x0030 */ SDK_PUB btBoxShape* m_pBoxShape;
/* 0x0038 */ SDK_PUB btPairCachingGhostObject* m_pGhostObject;
/* 0x0040 */ SDK_PUB AreaTriggerProxy* m_pPhysicsProxy;
/* 0x0048 */ SDK_PRI char pad_0x48[0x100];
/* 0x0148 */ SDK_PUB DirectX::XMFLOAT3 m_position;
/* 0x0154 */ SDK_PUB DirectX::XMFLOAT4 m_rotation;
/* 0x0164 */ SDK_PUB DirectX::XMFLOAT3 m_size;
/* 0x0170 */ SDK_PRI char pad_0x170[0x8];
}; // Size: 0x178

static_assert(offsetof(AreaTrigger, AreaTrigger::m_iId) == 0x0, "AreaTrigger::m_iId: Incorrect offset");
Expand Down
64 changes: 26 additions & 38 deletions include/SmSdk/AudioManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,22 @@ SMSDK_BEGIN_NAMESPACE

struct EventData
{
/* 0x0000 */ std::int16_t m_iWorldId;
private:
/* 0x0002 */ char pad_0x2[0x2];
public:
/* 0x0004 */ std::int32_t m_iSomeVal;
private:
/* 0x0008 */ char pad_0x8[0x18];
public:
/* 0x0020 */ std::string m_eventName;
/* 0x0040 */ std::map<std::string, float> m_mapTemporary;
/* 0x0050 */ std::shared_ptr<struct AudioEvent> m_pAudioEvent;
/* 0x0000 */ SDK_PUB std::int16_t m_iWorldId;
/* 0x0002 */ SDK_PRI char pad_0x2[0x2];
/* 0x0004 */ SDK_PUB std::int32_t m_iSomeVal;
/* 0x0008 */ SDK_PRI char pad_0x8[0x18];
/* 0x0020 */ SDK_PUB std::string m_eventName;
/* 0x0040 */ SDK_PUB std::map<std::string, float> m_mapTemporary;
/* 0x0050 */ SDK_PUB std::shared_ptr<struct AudioEvent> m_pAudioEvent;
}; // Size: 0x60

static_assert(sizeof(EventData) == 0x60, "EventData: Incorrect Size");

class AudioManager : public Task
{
public:
static AudioManager* GetInstance();
SDK_PUB static AudioManager* GetInstance();

inline void _playSound(const std::string& soundName, uint16_t uWorldId = 0xFFFF)
SDK_PUB inline void _playSound(const std::string& soundName, uint16_t uWorldId = 0xFFFF)
{
std::lock_guard<std::mutex> lock(m_mutex);

Expand All @@ -45,7 +40,7 @@ class AudioManager : public Task
m_deqEventQueue.push_back(newEvent);
}

inline static void PlaySound(const std::string& soundName, uint16_t uWorldId = 0xFFFF)
SDK_PUB inline static void PlaySound(const std::string& soundName, uint16_t uWorldId = 0xFFFF)
{
AudioManager* pAudioMgr = AudioManager::GetInstance();
if (!pAudioMgr)
Expand All @@ -54,29 +49,22 @@ class AudioManager : public Task
pAudioMgr->_playSound(soundName, uWorldId);
}

/* 0x0008 */ std::shared_ptr<struct AudioEventManager> pAudioEventManager;
/* 0x0018 */ std::mutex m_mutex;
/* 0x0068 */ FMOD::Studio::System* m_pFmodStudioSystem;
/* 0x0070 */ FMOD::System* m_pFmodSystem;
/* 0x0078 */ FMOD_ADVANCEDSETTINGS m_fmodAdvancedSettings;
/* 0x00E0 */ float m_fMasterVolume;
/* 0x00E4 */ float m_fOldMasterVolume;
private:
/* 0x00E8 */ char pad_0xE8[0x10];
public:
/* 0x00F8 */ std::deque<EventData> m_deqEventQueue;
private:
/* 0x0120 */ char pad_0x120[0x78];
public:
/* 0x0198 */ std::map<std::string, std::string> m_mapNameToFmodPath;
/* 0x01A8 */ std::map<size_t, std::string> m_someHashToFmodPath;
/* 0x01B8 */ std::map<std::string, std::shared_ptr<struct AudioEvent>> m_nameToEventPtr;
private:
/* 0x01C8 */ char pad_0x1C8[0x100];
public:
/* 0x02C8 */ std::int32_t m_iFmodInitFlags;
private:
/* 0x02CC */ char pad_0x2CC[0xC];
/* 0x0008 */ SDK_PUB std::shared_ptr<struct AudioEventManager> pAudioEventManager;
/* 0x0018 */ SDK_PUB std::mutex m_mutex;
/* 0x0068 */ SDK_PUB FMOD::Studio::System* m_pFmodStudioSystem;
/* 0x0070 */ SDK_PUB FMOD::System* m_pFmodSystem;
/* 0x0078 */ SDK_PUB FMOD_ADVANCEDSETTINGS m_fmodAdvancedSettings;
/* 0x00E0 */ SDK_PUB float m_fMasterVolume;
/* 0x00E4 */ SDK_PUB float m_fOldMasterVolume;
/* 0x00E8 */ SDK_PRI char pad_0xE8[0x10];
/* 0x00F8 */ SDK_PUB std::deque<EventData> m_deqEventQueue;
/* 0x0120 */ SDK_PRI char pad_0x120[0x78];
/* 0x0198 */ SDK_PUB std::map<std::string, std::string> m_mapNameToFmodPath;
/* 0x01A8 */ SDK_PUB std::map<size_t, std::string> m_someHashToFmodPath;
/* 0x01B8 */ SDK_PUB std::map<std::string, std::shared_ptr<struct AudioEvent>> m_nameToEventPtr;
/* 0x01C8 */ SDK_PRI char pad_0x1C8[0x100];
/* 0x02C8 */ SDK_PUB std::int32_t m_iFmodInitFlags;
/* 0x02CC */ SDK_PRI char pad_0x2CC[0xC];
}; // Size: 0x2D8

static_assert(sizeof(AudioManager) == 0x2D8, "AudioManager: Incorrect Size");
Expand Down
14 changes: 6 additions & 8 deletions include/SmSdk/Base/InputTarget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ SMSDK_BEGIN_NAMESPACE

class InputTarget
{
public:
virtual void onKeyPress(int key) { SMSDK_UNREF(key); /* implemented by the game */ }
virtual void onKeyRelease(int key) { SMSDK_UNREF(key); /* implemented by the game */ }
virtual void onMouseKeyPress(int mouseKey) { SMSDK_UNREF(mouseKey); /* implemented by the game */ }
virtual void onMouseKeyRelease(int mouseKey) { SMSDK_UNREF(mouseKey); /* implemented by the game */ }
private:
virtual void func5() { /* implemented by the game */ }
virtual void func6() { /* implemented by the game */ }
SDK_PUB virtual void onKeyPress(int key) { SMSDK_UNREF(key); /* implemented by the game */ }
SDK_PUB virtual void onKeyRelease(int key) { SMSDK_UNREF(key); /* implemented by the game */ }
SDK_PUB virtual void onMouseKeyPress(int mouseKey) { SMSDK_UNREF(mouseKey); /* implemented by the game */ }
SDK_PUB virtual void onMouseKeyRelease(int mouseKey) { SMSDK_UNREF(mouseKey); /* implemented by the game */ }
SDK_PRI virtual void func5() { /* implemented by the game */ }
SDK_PRI virtual void func6() { /* implemented by the game */ }
}; // Size: 0x8

static_assert(sizeof(InputTarget) == 0x8, "InputTarget: Incorrect Size");
Expand Down
24 changes: 11 additions & 13 deletions include/SmSdk/Base/NetObj.hpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
#pragma once

#include "SmSdk/config.hpp"

#include <memory>

SMSDK_BEGIN_NAMESPACE

class NetObj
{
public:
virtual ~NetObj() = default;
private:
virtual void func2() {}
public:
virtual char getObjectType() { return 0; }
virtual void updateObject() {}
private:
/* 0x0008 */ char pad_0x8[0x8];
public:
/* 0x0010 */ std::shared_ptr<NetObj> m_pSelf;
/* 0x0020 */ std::int32_t m_iId;
/* 0x0024 */ std::int32_t m_iRevision;
SDK_PUB virtual ~NetObj() = default;
SDK_PRI virtual void func2() {}
SDK_PUB virtual char getObjectType() { return 0; }
SDK_PUB virtual void updateObject() {}

/* 0x0008 */ SDK_PRI char pad_0x8[0x8];
/* 0x0010 */ SDK_PUB std::shared_ptr<NetObj> m_pSelf;
/* 0x0020 */ SDK_PUB std::int32_t m_iId;
/* 0x0024 */ SDK_PUB std::int32_t m_iRevision;
}; // Size: 0x28

static_assert(sizeof(NetObj) == 0x28, "NetObj: Incorrect Size");
Expand Down
5 changes: 2 additions & 3 deletions include/SmSdk/Base/Task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ SMSDK_BEGIN_NAMESPACE

class Task
{
public:
virtual ~Task() {}
virtual std::int64_t update(float fDeltaTime)
SDK_PUB virtual ~Task() {}
SDK_PUB virtual std::int64_t update(float fDeltaTime)
{
SMSDK_UNREF(fDeltaTime);
return 0;
Expand Down
28 changes: 11 additions & 17 deletions include/SmSdk/BlobData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ SMSDK_BEGIN_NAMESPACE

struct BlobDataKey
{
public:
/* 0x0000 */ boost::uuids::uuid m_uuid;
/* 0x0010 */ uint8_t m_data[14];
/* 0x001E */ uint16_t m_uSize;
/* 0x0000 */ SDK_PUB boost::uuids::uuid m_uuid;
/* 0x0010 */ SDK_PUB std::uint8_t m_data[14];
/* 0x001E */ SDK_PUB std::uint16_t m_uSize;
}; // Size: 0x20

static_assert(offsetof(BlobDataKey, BlobDataKey::m_uuid) == 0x0, "BlobDataKey::m_uuid: Incorrect offset");
Expand All @@ -26,19 +25,14 @@ static_assert(sizeof(BlobDataKey) == 0x20, "BlobDataKey: Incorrect Size");

struct BlobData
{
public:
/* 0x0000 */ BlobDataKey m_key;
/* 0x0020 */ uint16_t m_uWorldId;
/* 0x0022 */ uint8_t m_uFlags;
private:
/* 0x0023 */ char pad_0x23[0x5];
public:
/* 0x0028 */ uint64_t m_uSteamId;
/* 0x0030 */ uint32_t m_uBlobSize; // might actually be 64 bit, gotta verify this later at some point
private:
/* 0x0034 */ char pad_0x34[0x4];
public:
/* 0x0038 */ void* m_pBlobData;
/* 0x0000 */ SDK_PUB BlobDataKey m_key;
/* 0x0020 */ SDK_PUB std::uint16_t m_uWorldId;
/* 0x0022 */ SDK_PUB std::uint8_t m_uFlags;
/* 0x0023 */ SDK_PRI char pad_0x23[0x5];
/* 0x0028 */ SDK_PUB std::uint64_t m_uSteamId;
/* 0x0030 */ SDK_PUB std::uint32_t m_uBlobSize; // might actually be 64 bit, gotta verify this later at some point
/* 0x0034 */ SDK_PRI char pad_0x34[0x4];
/* 0x0038 */ SDK_PUB void* m_pBlobData;
}; // Size: 0x40

static_assert(offsetof(BlobData, BlobData::m_key) == 0x0, "BlobData::m_key: Incorrect offset");
Expand Down
Loading