Some checks failed
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 7m12s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 5m21s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 5m45s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
Bigfoot / Clang Format Checks (push) Has been cancelled
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
75 lines
5.7 KiB
C++
75 lines
5.7 KiB
C++
/*********************************************************************
|
|
* \file AssetHelper.hpp
|
|
*
|
|
* \author Romain BOULLARD
|
|
* \date April 2026
|
|
*********************************************************************/
|
|
#ifndef BIGFOOT_ENGINE_ASSETHELPER_HPP
|
|
#define BIGFOOT_ENGINE_ASSETHELPER_HPP
|
|
#include <Engine/Asset/AssetContainer.hpp>
|
|
#include <Engine/Asset/Reference.hpp>
|
|
#include <Engine/Asset/Reference_generated.hpp>
|
|
|
|
#define ASSET_SOFT_REF_DECL(AssetName, AssetType) \
|
|
namespace flatbuffers \
|
|
{ \
|
|
Flat::Bigfoot::SoftReference PackSoftReference##AssetName(const Bigfoot::SoftReference<AssetType>& p_softRef); \
|
|
Bigfoot::SoftReference<AssetType> UnPackSoftReference##AssetName(const Flat::Bigfoot::SoftReference& p_softRef); \
|
|
}
|
|
|
|
#define ASSET_HARD_REF_DECL(AssetName, AssetType) \
|
|
namespace flatbuffers \
|
|
{ \
|
|
Flat::Bigfoot::HardReference PackHardReference##AssetName(const Bigfoot::HardReference<AssetType>& p_hardRef); \
|
|
Bigfoot::HardReference<AssetType> UnPackHardReference##AssetName(const Flat::Bigfoot::HardReference& p_hardRef); \
|
|
}
|
|
|
|
#define ASSET_CONTAINER(AssetName, AssetType) \
|
|
namespace Bigfoot \
|
|
{ \
|
|
inline AssetContainer<AssetType> g_##AssetName##Container; \
|
|
}
|
|
|
|
#define ASSET_REF_DECL(AssetName, AssetType) \
|
|
ASSET_SOFT_REF_DECL(AssetName, AssetType) \
|
|
ASSET_HARD_REF_DECL(AssetName, AssetType)
|
|
|
|
#define ASSET_DECL(AssetName, AssetType) \
|
|
ASSET_REF_DECL(AssetName, AssetType) \
|
|
ASSET_CONTAINER(AssetName, AssetType)
|
|
|
|
/****************************************************************************************/
|
|
|
|
#define ASSET_SOFT_REF_IMPL(AssetName, AssetType) \
|
|
namespace flatbuffers \
|
|
{ \
|
|
Flat::Bigfoot::SoftReference PackSoftReference##AssetName(const Bigfoot::SoftReference<AssetType>& p_softRef) \
|
|
{ \
|
|
return {flatbuffers::Pack(p_softRef.GetUUID())}; \
|
|
} \
|
|
Bigfoot::SoftReference<AssetType> UnPackSoftReference##AssetName(const Flat::Bigfoot::SoftReference& p_softRef) \
|
|
{ \
|
|
return {flatbuffers::UnPack(p_softRef.uuid())}; \
|
|
} \
|
|
}
|
|
|
|
#define ASSET_HARD_REF_IMPL(AssetName, AssetType) \
|
|
namespace flatbuffers \
|
|
{ \
|
|
Flat::Bigfoot::HardReference PackHardReference##AssetName(const Bigfoot::HardReference<AssetType>& p_hardRef) \
|
|
{ \
|
|
return {flatbuffers::Pack(p_hardRef.GetUUID())}; \
|
|
} \
|
|
Bigfoot::HardReference<AssetType> UnPackHardReference##AssetName(const Flat::Bigfoot::HardReference& p_hardRef) \
|
|
{ \
|
|
return {flatbuffers::UnPack(p_hardRef.uuid())}; \
|
|
} \
|
|
}
|
|
|
|
#define ASSET_REF_IMPL(AssetName, AssetType) \
|
|
ASSET_SOFT_REF_IMPL(AssetName, AssetType) \
|
|
ASSET_HARD_REF_IMPL(AssetName, AssetType)
|
|
|
|
#define ASSET_IMPL(AssetName, AssetType) ASSET_REF_IMPL(AssetName, AssetType)
|
|
#endif
|