Skip to content
Open
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
3 changes: 3 additions & 0 deletions Hedgehog/Base/hhObject.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "SWA.inl"
#include "Hedgehog/Base/System/hhAllocator.h"

namespace Hedgehog::Base
{
Expand All @@ -21,3 +22,5 @@ namespace Hedgehog::Base
void operator delete(void* in_pMem, void* in_pObj);
};
}

#include "hhObject.inl"
34 changes: 34 additions & 0 deletions Hedgehog/Base/hhObject.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
namespace Hedgehog::Base
{
inline CObject::CObject()
{
}

inline CObject::CObject(const swa_null_ctor&)
{
}

inline void* CObject::operator new(const size_t in_Size)
{
return __HH_ALLOC(in_Size);
}

inline void CObject::operator delete(void* in_pMem)
{
return __HH_FREE(in_pMem);
}

inline void* CObject::operator new(const size_t in_Size, void* in_pObj)
{
return in_pObj;
}

inline void* CObject::operator new(const size_t in_Size, const size_t in_Align, void* in_pObj)
{
return in_pObj;
}

inline void CObject::operator delete(void* in_pMem, void* in_pObj)
{
}
}
10 changes: 10 additions & 0 deletions Hedgehog/Math/Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ namespace Hedgehog::Math
be<float> Y;
be<float> Z;
be<float> W;

CVector operator*(const float& scalar) const
{
return { X * scalar, Y * scalar, Z * scalar };
}

CVector operator+(const CVector& v) const
{
return { X + v.X, Y + v.Y, Z + v.Z };
}
};

class CVector4
Expand Down
19 changes: 19 additions & 0 deletions Hedgehog/Universe/Engine/hhMessage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include <SWA.inl>
#include <Hedgehog/Base/hhObject.h>
#include <boost/smart_ptr/shared_ptr.h>

namespace Hedgehog::Universe
{
class Message : public Base::CObject
{
public:
be<uint32_t> m_pVftable;
be<uint32_t> m_SenderActorID;
boost::shared_ptr<Message> m_spSelf;
};

class MessageTypeGet : public Message {};
class MessageTypeSet : public Message {};
}
10 changes: 10 additions & 0 deletions SWA.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <Hedgehog/MirageCore/RenderData/hhVertexShaderCodeData.h>
#include <Hedgehog/MirageCore/RenderData/hhVertexShaderData.h>
#include <Hedgehog/Sparkle/hhParticleMaterial.h>
#include <Hedgehog/Universe/Engine/hhMessage.h>
#include <Hedgehog/Universe/Engine/hhMessageActor.h>
#include <Hedgehog/Universe/Engine/hhMessageProcess.h>
#include <Hedgehog/Universe/Engine/hhStateMachineBase.h>
Expand Down Expand Up @@ -64,6 +65,7 @@
#include <SWA/Boss/EggDragoon/Object/BossEggDragoonDrillMissile.h>
#include <SWA/Camera/Camera.h>
#include <SWA/Camera/CameraController.h>
#include <SWA/Camera/Controller/FreeCamera.h>
#include <SWA/CharacterUtility/CharacterProxy.h>
#include <SWA/CSD/CsdDatabaseWrapper.h>
#include <SWA/CSD/CsdProject.h>
Expand All @@ -89,13 +91,19 @@
#include <SWA/Inspire/InspireTextureOverlayInfo.h>
#include <SWA/Menu/MenuWindowBase.h>
#include <SWA/Message/MsgRequestHelp.h>
#include <SWA/Message/MsgCameraPauseMove.h>
#include <SWA/Message/MsgPopCameraController.h>
#include <SWA/Message/MsgSetPosition.h>
#include <SWA/Message/MsgSetVelocity.h>
#include <SWA/Movie/MovieDisplayer.h>
#include <SWA/Movie/MovieManager.h>
#include <SWA/Object/Common/DashPanel/ObjDashPanel.h>
#include <SWA/Object/SonicStage/EU/RollingBarrel/ObjRollingBarrel.h>
#include <SWA/Player/Character/EvilSonic/EvilSonic.h>
#include <SWA/Player/Character/EvilSonic/EvilSonicContext.h>
#include <SWA/Player/Character/EvilSonic/Hud/EvilHudGuide.h>
#include <SWA/Player/Character/Base/PlayerContext.h>
#include <SWA/Player/Character/Speed/PlayerSpeedContext.h>
#include <SWA/Sequence/Unit/SequenceUnitBase.h>
#include <SWA/Sequence/Unit/SequenceUnitPlayMovie.h>
#include <SWA/Sequence/Utility/SequencePlayMovieWrapper.h>
Expand Down Expand Up @@ -126,4 +134,6 @@
#include <SWA/System/GameMode/Title/TitleStateWorldMap.h>
#include <SWA/System/GameMode/WorldMap/WorldMapCamera.h>
#include <SWA/System/GameMode/WorldMap/WorldMapCursor.h>
#include <SWA/Replay/Camera/ReplayFreeCamera.h>
#include <SWA/Tool/FreeCameraTool/FreeCameraTool.h>

17 changes: 14 additions & 3 deletions SWA/Camera/CameraController.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
#pragma once

#include <SWA.inl>
#include <Hedgehog/Math/Vector.h>
#include <Hedgehog/Math/Quaternion.h>

namespace SWA
{
class CCameraController : public Hedgehog::Universe::CStateMachineBase::CStateBase
class CCamera;

class CCameraController
{
public:
SWA_INSERT_PADDING(0x04);
SWA_INSERT_PADDING(0x08);
xpointer<CCamera> m_pCamera;
SWA_INSERT_PADDING(0x58);
be<float> m_FieldOfView;
SWA_INSERT_PADDING(0x68);
SWA_INSERT_PADDING(0x08);
Hedgehog::Math::CVector m_Position;
Hedgehog::Math::CVector m_UpVector;
Hedgehog::Math::CQuaternion m_Rotation;
SWA_INSERT_PADDING(0x30);
};

SWA_ASSERT_OFFSETOF(CCameraController, m_pCamera, 0x08);
SWA_ASSERT_OFFSETOF(CCameraController, m_FieldOfView, 0x64);
SWA_ASSERT_SIZEOF(CCameraController, 0xD0);
}
16 changes: 16 additions & 0 deletions SWA/Camera/Controller/FreeCamera.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

#include <SWA.inl>
#include "SWA/Camera/CameraController.h"

namespace SWA
{
class CFreeCamera : public CCameraController
{
public:
SWA_INSERT_PADDING(0x10);
be<float> m_Speed;
};

SWA_ASSERT_OFFSETOF(CFreeCamera, m_Speed, 0xE0);
}
26 changes: 16 additions & 10 deletions SWA/Globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ namespace SWA
{
struct SGlobals
{
// ms_DrawLightFieldSamplingPoint: サンプリング点をデバッグ表示
// ms_DrawLightFieldSamplingPoint: サンプリング点をデバッグ表示
static inline bool* ms_DrawLightFieldSamplingPoint;

static inline be<float>* ms_FreeCameraSpeed;

// N/A
static inline bool* ms_IsAutoSaveWarningShown;

// ms_IgnoreLightFieldData: データを無視する
// ms_IgnoreLightFieldData: データを無視する
static inline bool* ms_IgnoreLightFieldData;

// IsCollisionRender
Expand All @@ -24,22 +26,24 @@ namespace SWA
// IsObjectCollisionRender
static inline bool* ms_IsObjectCollisionRender;

// ms_IsRenderDebugDraw: デバッグ描画
// ms_IsRenderDebugDraw: デバッグ描画
static inline bool* ms_IsRenderDebugDraw;

// ms_IsRenderDebugDrawText: デバッグ文字描画
// ms_IsRenderDebugDrawText: デバッグ文字描画
static inline bool* ms_IsRenderDebugDrawText;

// ms_IsRenderDebugPositionDraw: デバッグ位置描画
// ms_IsRenderDebugPositionDraw: デバッグ位置描画
static inline bool* ms_IsRenderDebugPositionDraw;

// ms_IsRenderGameMainHud: ゲームメインHUD 描画
static inline bool* ms_IsRenderDepthOfField;

// ms_IsRenderGameMainHud: ゲームメインHUD 描画
static inline bool* ms_IsRenderGameMainHud;

// ms_IsRenderHud: HUD 描画
// ms_IsRenderHud: 全 HUD 描画
static inline bool* ms_IsRenderHud;

// ms_IsRenderHudPause: ポーズメニュー 描画
// ms_IsRenderHudPause: ポーズメニュー 描画
static inline bool* ms_IsRenderHudPause;

// N/A
Expand All @@ -48,15 +52,16 @@ namespace SWA
// IsTriggerRender
static inline bool* ms_IsTriggerRender;

// ms_LightFieldDebug: 値をデバッグ表示
// ms_LightFieldDebug: 値をデバッグ表示
static inline bool* ms_LightFieldDebug;

// VisualizeLoadedLevel: ミップレベルを視覚化 赤=0, =1, =2, 黄=未ロード
// VisualizeLoadedLevel: ミップレベルを視覚化 赤=0, 緑=1, 青=2, 黄=未ロード
static inline bool* ms_VisualizeLoadedLevel;

static void Init()
{
ms_DrawLightFieldSamplingPoint = (bool*)MmGetHostAddress(0x83367BCE);
ms_FreeCameraSpeed = (be<float>*)MmGetHostAddress(0x83366DF8);
ms_IgnoreLightFieldData = (bool*)MmGetHostAddress(0x83367BCF);
ms_IsAutoSaveWarningShown = (bool*)MmGetHostAddress(0x83367BC1);
ms_IsCollisionRender = (bool*)MmGetHostAddress(0x833678A6);
Expand All @@ -65,6 +70,7 @@ namespace SWA
ms_IsRenderDebugDraw = (bool*)MmGetHostAddress(0x8328BB23);
ms_IsRenderDebugDrawText = (bool*)MmGetHostAddress(0x8328BB25);
ms_IsRenderDebugPositionDraw = (bool*)MmGetHostAddress(0x8328BB24);
ms_IsRenderDepthOfField = (bool*)MmGetHostAddress(0x83302720);
ms_IsRenderGameMainHud = (bool*)MmGetHostAddress(0x8328BB27);
ms_IsRenderHud = (bool*)MmGetHostAddress(0x8328BB26);
ms_IsRenderHudPause = (bool*)MmGetHostAddress(0x8328BB28);
Expand Down
17 changes: 17 additions & 0 deletions SWA/Message/MsgCameraPauseMove.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include <SWA.inl>

namespace SWA::Message
{
class MsgCameraPauseMove : public Hedgehog::Universe::MessageTypeSet
{
public:
SWA_INSERT_PADDING(0x08);
bool m_isPaused;

MsgCameraPauseMove(bool in_isPaused) : m_isPaused(in_isPaused) {}
};

SWA_ASSERT_OFFSETOF(MsgCameraPauseMove, m_isPaused, 0x18);
}
34 changes: 34 additions & 0 deletions SWA/Message/MsgPopCameraController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#pragma once

#include <SWA.inl>
#include "SWA/Camera/CameraController.h"
#include "Hedgehog/Base/Type/hhSharedString.h"

namespace SWA::Message
{
class MsgPopCameraController : public Hedgehog::Universe::MessageTypeSet
{
public:
SWA_INSERT_PADDING(0x08);
xpointer<CCameraController> m_pCameraController;
SWA_INSERT_PADDING(0x08);
xpointer<Hedgehog::Base::CSharedString> m_pCameraName;
be<float> m_InterpolateTime;
bool m_Field2C;
bool m_Field2D;
bool m_Field2E;

MsgPopCameraController(CCameraController* in_pCameraController, float in_interpolateTime)
: m_pCameraController(in_pCameraController), m_InterpolateTime(in_interpolateTime) {}

MsgPopCameraController(Hedgehog::Base::CSharedString* in_pCameraName, float in_interpolateTime)
: m_pCameraName(in_pCameraName), m_InterpolateTime(in_interpolateTime) {}
};

SWA_ASSERT_OFFSETOF(MsgPopCameraController, m_pCameraController, 0x18);
SWA_ASSERT_OFFSETOF(MsgPopCameraController, m_pCameraName, 0x24);
SWA_ASSERT_OFFSETOF(MsgPopCameraController, m_InterpolateTime, 0x28);
SWA_ASSERT_OFFSETOF(MsgPopCameraController, m_Field2C, 0x2C);
SWA_ASSERT_OFFSETOF(MsgPopCameraController, m_Field2D, 0x2D);
SWA_ASSERT_OFFSETOF(MsgPopCameraController, m_Field2E, 0x2E);
}
19 changes: 19 additions & 0 deletions SWA/Message/MsgSetPosition.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include <SWA.inl>
#include "Hedgehog/Math/Vector.h"

namespace SWA::Message
{
class MsgSetPosition : public Hedgehog::Universe::MessageTypeSet
{
public:
SWA_INSERT_PADDING(0x10);
Hedgehog::Math::CVector m_Position;

MsgSetPosition(const Hedgehog::Math::CVector& in_rPosition) : m_Position(in_rPosition) {}
};

SWA_ASSERT_OFFSETOF(MsgSetPosition, m_Position, 0x20);
SWA_ASSERT_SIZEOF(MsgSetPosition, 0x30);
}
19 changes: 19 additions & 0 deletions SWA/Message/MsgSetVelocity.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include <SWA.inl>
#include "Hedgehog/Math/Vector.h"

namespace SWA::Message
{
class MsgSetVelocity : public Hedgehog::Universe::MessageTypeSet
{
public:
SWA_INSERT_PADDING(0x10);
Hedgehog::Math::CVector m_Velocity;

MsgSetVelocity(const Hedgehog::Math::CVector& in_rVelocity) : m_Velocity(in_rVelocity) {}
};

SWA_ASSERT_OFFSETOF(MsgSetVelocity, m_Velocity, 0x20);
SWA_ASSERT_SIZEOF(MsgSetVelocity, 0x30);
}
29 changes: 29 additions & 0 deletions SWA/Player/Character/Base/PlayerContext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#pragma once

#include <SWA.inl>
#include "boost/smart_ptr/shared_ptr.h"

namespace SWA::Player
{
class CPlayer;

class CPlayerContext
{
public:
SWA_INSERT_PADDING(0x10);
boost::shared_ptr<CMatrixNodeTransform> m_spMatrixNode;
SWA_INSERT_PADDING(0x18);
boost::anonymous_shared_ptr m_spRayCastCollision;
SWA_INSERT_PADDING(0xC8);
xpointer<CPlayer> m_pPlayer;
SWA_INSERT_PADDING(0xF8);
boost::shared_ptr<void> m_spParameter;
SWA_INSERT_PADDING(0x0C);
};

SWA_ASSERT_OFFSETOF(CPlayerContext, m_spMatrixNode, 0x10);
SWA_ASSERT_OFFSETOF(CPlayerContext, m_spRayCastCollision, 0x30);
SWA_ASSERT_OFFSETOF(CPlayerContext, m_pPlayer, 0x100);
SWA_ASSERT_OFFSETOF(CPlayerContext, m_spParameter, 0x1FC);
SWA_ASSERT_SIZEOF(CPlayerContext, 0x210);
}
Loading