mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-27 12:51:42 +00:00
Auto generate SWA.h, add offsetof/sizeof asserts.
This commit is contained in:
parent
8f525b571b
commit
49b0dbe4db
5 changed files with 93 additions and 42 deletions
|
|
@ -197,3 +197,32 @@ compile_vertex_shader(movie_vs)
|
||||||
compile_pixel_shader(resolve_msaa_depth_2x)
|
compile_pixel_shader(resolve_msaa_depth_2x)
|
||||||
compile_pixel_shader(resolve_msaa_depth_4x)
|
compile_pixel_shader(resolve_msaa_depth_4x)
|
||||||
compile_pixel_shader(resolve_msaa_depth_8x)
|
compile_pixel_shader(resolve_msaa_depth_8x)
|
||||||
|
|
||||||
|
function(generate_aggregate_header INPUT_DIRECTORY OUTPUT_FILE)
|
||||||
|
get_filename_component(ABS_OUTPUT_FILE "${OUTPUT_FILE}" ABSOLUTE)
|
||||||
|
file(GLOB_RECURSE HEADER_FILES "${INPUT_DIRECTORY}/*.h")
|
||||||
|
set(HEADER_CONTENT "#pragma once\n\n")
|
||||||
|
|
||||||
|
foreach(HEADER_FILE IN LISTS HEADER_FILES)
|
||||||
|
get_filename_component(ABS_HEADER_FILE "${HEADER_FILE}" ABSOLUTE)
|
||||||
|
if (ABS_HEADER_FILE STREQUAL ABS_OUTPUT_FILE)
|
||||||
|
continue()
|
||||||
|
endif()
|
||||||
|
file(RELATIVE_PATH RELATIVE_HEADER_FILE "${INPUT_DIRECTORY}" "${HEADER_FILE}")
|
||||||
|
string(APPEND HEADER_CONTENT "#include \"${RELATIVE_HEADER_FILE}\"\n")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
if (EXISTS "${OUTPUT_FILE}")
|
||||||
|
file(READ "${OUTPUT_FILE}" EXISTING_CONTENT)
|
||||||
|
if (EXISTING_CONTENT STREQUAL HEADER_CONTENT)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
file(WRITE "${OUTPUT_FILE}" "${HEADER_CONTENT}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
generate_aggregate_header(
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/api"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/api/SWA.h"
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "SWA.inl"
|
#include <SWA.inl>
|
||||||
#include "CSD/Manager/csdmBase.h"
|
#include <CSD/Manager/csdmBase.h>
|
||||||
#include "CSD/Manager/csdmResourceBase.h"
|
#include <CSD/Manager/csdmResourceBase.h>
|
||||||
#include "CSD/Manager/csdmNodeObserver.h"
|
#include <CSD/Manager/csdmNodeObserver.h>
|
||||||
#include "CSD/Manager/csdmSubjectBase.h"
|
#include <CSD/Manager/csdmSubjectBase.h>
|
||||||
|
#include <Hedgehog/Math/Vector2.h>
|
||||||
|
|
||||||
namespace Chao::CSD
|
namespace Chao::CSD
|
||||||
{
|
{
|
||||||
|
|
@ -21,7 +22,7 @@ namespace Chao::CSD
|
||||||
|
|
||||||
void SetText(const char* in_pText);
|
void SetText(const char* in_pText);
|
||||||
void SetText(const wchar_t* in_pText);
|
void SetText(const wchar_t* in_pText);
|
||||||
Hedgehog::Math::CVector2* GetPosition() const;
|
void GetPosition(Hedgehog::Math::CVector2& out_rResult) const;
|
||||||
void SetPosition(float in_X, float in_Y);
|
void SetPosition(float in_X, float in_Y);
|
||||||
void SetHideFlag(uint32_t in_HideFlag);
|
void SetHideFlag(uint32_t in_HideFlag);
|
||||||
void SetRotation(float in_Rotation);
|
void SetRotation(float in_Rotation);
|
||||||
|
|
@ -30,4 +31,4 @@ namespace Chao::CSD
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "CSD/Manager/csdmNode.inl"
|
#include <CSD/Manager/csdmNode.inl>
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,9 @@ namespace Chao::CSD
|
||||||
GuestToHostFunction<int>(0x830BF640, this, in_pText);
|
GuestToHostFunction<int>(0x830BF640, this, in_pText);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Hedgehog::Math::CVector2* CNode::GetPosition() const
|
inline void CNode::GetPosition(Hedgehog::Math::CVector2& out_rResult) const
|
||||||
{
|
{
|
||||||
guest_stack_var<Hedgehog::Math::CVector2> pos;
|
GuestToHostFunction<void>(0x830BF008, &out_rResult, this);
|
||||||
GuestToHostFunction<void>(0x830BF008, pos.get(), this);
|
|
||||||
return pos.get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CNode::SetPosition(float in_X, float in_Y)
|
inline void CNode::SetPosition(float in_X, float in_Y)
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Hedgehog/Base/hhObject.h"
|
|
||||||
#include "Hedgehog/Base/System/hhAllocator.h"
|
|
||||||
#include "Hedgehog/Base/Thread/hhHolder.h"
|
|
||||||
#include "Hedgehog/Base/Thread/hhHolderBase.h"
|
|
||||||
#include "Hedgehog/Base/Thread/hhSynchronizedObject.h"
|
|
||||||
#include "Hedgehog/Base/Thread/hhSynchronizedPtr.h"
|
|
||||||
#include "Hedgehog/Base/Type/hhSharedString.h"
|
|
||||||
#include "Hedgehog/Database/System/hhDatabaseData.h"
|
|
||||||
#include "Hedgehog/Math/Vector2.h"
|
|
||||||
#include "Hedgehog/MirageCore/Renderable/hhRenderable.h"
|
|
||||||
#include "Hedgehog/Universe/Engine/hhMessageActor.h"
|
|
||||||
#include "Hedgehog/Universe/Engine/hhMessageProcess.h"
|
|
||||||
#include "Hedgehog/Universe/Engine/hhUpdateInfo.h"
|
|
||||||
#include "Hedgehog/Universe/Engine/hhUpdateUnit.h"
|
|
||||||
#include "Hedgehog/Universe/Thread/hhParallelJob.h"
|
|
||||||
|
|
||||||
#include "CSD/Manager/csdmBase.h"
|
#include "CSD/Manager/csdmBase.h"
|
||||||
#include "CSD/Manager/csdmMotionPattern.h"
|
#include "CSD/Manager/csdmMotionPattern.h"
|
||||||
#include "CSD/Manager/csdmNode.h"
|
#include "CSD/Manager/csdmNode.h"
|
||||||
|
|
@ -31,38 +15,57 @@
|
||||||
#include "CSD/Manager/csdmSceneObserver.h"
|
#include "CSD/Manager/csdmSceneObserver.h"
|
||||||
#include "CSD/Manager/csdmSubjectBase.h"
|
#include "CSD/Manager/csdmSubjectBase.h"
|
||||||
#include "CSD/Platform/csdTexList.h"
|
#include "CSD/Platform/csdTexList.h"
|
||||||
|
#include "Hedgehog/Base/Container/hhVector.h"
|
||||||
#include "SWA/Camera/Camera.h"
|
#include "Hedgehog/Base/System/hhAllocator.h"
|
||||||
|
#include "Hedgehog/Base/Thread/hhHolder.h"
|
||||||
|
#include "Hedgehog/Base/Thread/hhHolderBase.h"
|
||||||
|
#include "Hedgehog/Base/Thread/hhSynchronizedObject.h"
|
||||||
|
#include "Hedgehog/Base/Thread/hhSynchronizedPtr.h"
|
||||||
|
#include "Hedgehog/Base/Type/detail/hhStringHolder.h"
|
||||||
|
#include "Hedgehog/Base/Type/hhSharedString.h"
|
||||||
|
#include "Hedgehog/Base/hhObject.h"
|
||||||
|
#include "Hedgehog/Database/System/hhDatabaseData.h"
|
||||||
|
#include "Hedgehog/Math/Vector2.h"
|
||||||
|
#include "Hedgehog/MirageCore/Renderable/hhRenderable.h"
|
||||||
|
#include "Hedgehog/Universe/Engine/hhMessageActor.h"
|
||||||
|
#include "Hedgehog/Universe/Engine/hhMessageProcess.h"
|
||||||
|
#include "Hedgehog/Universe/Engine/hhUpdateInfo.h"
|
||||||
|
#include "Hedgehog/Universe/Engine/hhUpdateUnit.h"
|
||||||
|
#include "Hedgehog/Universe/Thread/hhParallelJob.h"
|
||||||
#include "SWA/CSD/CsdDatabaseWrapper.h"
|
#include "SWA/CSD/CsdDatabaseWrapper.h"
|
||||||
#include "SWA/CSD/CsdProject.h"
|
#include "SWA/CSD/CsdProject.h"
|
||||||
#include "SWA/CSD/CsdTexListMirage.h"
|
#include "SWA/CSD/CsdTexListMirage.h"
|
||||||
#include "SWA/CSD/GameObjectCSD.h"
|
#include "SWA/CSD/GameObjectCSD.h"
|
||||||
|
#include "SWA/Camera/Camera.h"
|
||||||
#include "SWA/HUD/GeneralWindow/GeneralWindow.h"
|
#include "SWA/HUD/GeneralWindow/GeneralWindow.h"
|
||||||
#include "SWA/HUD/Loading/Loading.h"
|
#include "SWA/HUD/Loading/Loading.h"
|
||||||
#include "SWA/HUD/Pause/HudPause.h"
|
#include "SWA/HUD/Pause/HudPause.h"
|
||||||
#include "SWA/HUD/Sonic/HudSonicStage.h"
|
#include "SWA/HUD/Sonic/HudSonicStage.h"
|
||||||
#include "SWA/Movie/MovieDisplayer.h"
|
#include "SWA/Movie/MovieDisplayer.h"
|
||||||
#include "SWA/Movie/MovieManager.h"
|
#include "SWA/Movie/MovieManager.h"
|
||||||
#include "SWA/Player/Character/EvilSonic/Hud/EvilHudGuide.h"
|
|
||||||
#include "SWA/Player/Character/EvilSonic/EvilSonic.h"
|
#include "SWA/Player/Character/EvilSonic/EvilSonic.h"
|
||||||
#include "SWA/Player/Character/EvilSonic/EvilSonicContext.h"
|
#include "SWA/Player/Character/EvilSonic/EvilSonicContext.h"
|
||||||
|
#include "SWA/Player/Character/EvilSonic/Hud/EvilHudGuide.h"
|
||||||
#include "SWA/Sequence/Unit/SequenceUnitBase.h"
|
#include "SWA/Sequence/Unit/SequenceUnitBase.h"
|
||||||
#include "SWA/Sequence/Unit/SequenceUnitPlayMovie.h"
|
#include "SWA/Sequence/Unit/SequenceUnitPlayMovie.h"
|
||||||
#include "SWA/Sequence/Utility/SequencePlayMovieWrapper.h"
|
#include "SWA/Sequence/Utility/SequencePlayMovieWrapper.h"
|
||||||
#include "SWA/Sound/Sound.h"
|
#include "SWA/Sound/Sound.h"
|
||||||
#include "SWA/Sound/SoundBGMActSonic.h"
|
#include "SWA/Sound/SoundBGMActSonic.h"
|
||||||
#include "SWA/Sound/SoundBGMBase.h"
|
#include "SWA/Sound/SoundBGMBase.h"
|
||||||
#include "SWA/System/GameMode/Title/TitleMenu.h"
|
#include "SWA/System/Application.h"
|
||||||
#include "SWA/System/GameMode/Title/TitleStateBase.h"
|
#include "SWA/System/ApplicationD3D9.h"
|
||||||
|
#include "SWA/System/ApplicationDocument.h"
|
||||||
|
#include "SWA/System/ApplicationXenon.h"
|
||||||
|
#include "SWA/System/Game.h"
|
||||||
|
#include "SWA/System/GameDocument.h"
|
||||||
#include "SWA/System/GameMode/GameMode.h"
|
#include "SWA/System/GameMode/GameMode.h"
|
||||||
#include "SWA/System/GameMode/GameModeStage.h"
|
#include "SWA/System/GameMode/GameModeStage.h"
|
||||||
#include "SWA/System/GameMode/GameModeStageMovie.h"
|
#include "SWA/System/GameMode/GameModeStageMovie.h"
|
||||||
#include "SWA/System/Application.h"
|
#include "SWA/System/GameMode/Title/TitleMenu.h"
|
||||||
#include "SWA/System/ApplicationD3D9.h"
|
#include "SWA/System/GameMode/Title/TitleStateBase.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/GameObject.h"
|
||||||
#include "SWA/System/InputState.h"
|
#include "SWA/System/InputState.h"
|
||||||
#include "SWA/System/PadState.h"
|
#include "SWA/System/PadState.h"
|
||||||
|
#include "SWA/System/World.h"
|
||||||
|
#include "boost/smart_ptr/make_shared_object.h"
|
||||||
|
#include "boost/smart_ptr/shared_ptr.h"
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,33 @@
|
||||||
#include <cpu/guest_stack_var.h>
|
#include <cpu/guest_stack_var.h>
|
||||||
#include <kernel/function.h>
|
#include <kernel/function.h>
|
||||||
|
|
||||||
#define SWA__CONCAT2(x, y) x##y
|
#define SWA_CONCAT2(x, y) x##y
|
||||||
#define SWA_CONCAT2(x, y) _CONCAT(x, y)
|
#define SWA_CONCAT(x, y) SWA_CONCAT2(x, y)
|
||||||
|
|
||||||
#define SWA_INSERT_PADDING(length) \
|
#define SWA_INSERT_PADDING(length) \
|
||||||
uint8_t SWA_CONCAT2(pad, __LINE__)[length]
|
uint8_t SWA_CONCAT(pad, __LINE__)[length]
|
||||||
|
|
||||||
|
#define SWA_ASSERT_OFFSETOF(type, field, offset) \
|
||||||
|
static inline swa_assert_offsetof<BB_OFFSETOF(type, field), offset> SWA_CONCAT(_, __COUNTER__)
|
||||||
|
|
||||||
|
#define SWA_ASSERT_SIZEOF(type, size) \
|
||||||
|
static inline swa_assert_sizeof<sizeof type, size> SWA_CONCAT(_, __COUNTER__)
|
||||||
|
|
||||||
#define SWA_VIRTUAL_FUNCTION(returnType, virtualIndex, ...) \
|
#define SWA_VIRTUAL_FUNCTION(returnType, virtualIndex, ...) \
|
||||||
GuestToHostFunction<returnType>(*(be<uint32_t>*)(g_memory.Translate(*(be<uint32_t>*)(this) + (4 * virtualIndex))), __VA_ARGS__)
|
GuestToHostFunction<returnType>(*(be<uint32_t>*)(g_memory.Translate(*(be<uint32_t>*)(this) + (4 * virtualIndex))), __VA_ARGS__)
|
||||||
|
|
||||||
struct swa_null_ctor {};
|
struct swa_null_ctor
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int TActual, int TExpected>
|
||||||
|
struct swa_assert_offsetof
|
||||||
|
{
|
||||||
|
static_assert(TActual == TExpected, "offsetof assertion failed");
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int TActual, int TExpected>
|
||||||
|
struct swa_assert_sizeof
|
||||||
|
{
|
||||||
|
static_assert(TActual == TExpected, "sizeof assertion failed");
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue