mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 21:07:42 +00:00
New code style refactor
This commit is contained in:
@@ -2,38 +2,31 @@
|
||||
#include "GameGlobalObjects.hpp"
|
||||
#include "IMain.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
namespace urde {
|
||||
logvisor::Module Log("urde::RetroTypes::CAssetId");
|
||||
|
||||
CAssetId::CAssetId(CInputStream& in)
|
||||
{
|
||||
if (g_Main)
|
||||
{
|
||||
if (g_Main->GetExpectedIdSize() == sizeof(u32))
|
||||
Assign(in.readUint32Big());
|
||||
else if (g_Main->GetExpectedIdSize() == sizeof(u64))
|
||||
Assign(in.readUint64Big());
|
||||
else
|
||||
Log.report(logvisor::Fatal, "Unsupported id length %i", g_Main->GetExpectedIdSize());
|
||||
}
|
||||
CAssetId::CAssetId(CInputStream& in) {
|
||||
if (g_Main) {
|
||||
if (g_Main->GetExpectedIdSize() == sizeof(u32))
|
||||
Assign(in.readUint32Big());
|
||||
else if (g_Main->GetExpectedIdSize() == sizeof(u64))
|
||||
Assign(in.readUint64Big());
|
||||
else
|
||||
Log.report(logvisor::Fatal, "Input constructor called before runtime Main entered!");
|
||||
Log.report(logvisor::Fatal, "Unsupported id length %i", g_Main->GetExpectedIdSize());
|
||||
} else
|
||||
Log.report(logvisor::Fatal, "Input constructor called before runtime Main entered!");
|
||||
}
|
||||
|
||||
void CAssetId::PutTo(COutputStream& out)
|
||||
{
|
||||
if (g_Main)
|
||||
{
|
||||
if (g_Main->GetExpectedIdSize() == sizeof(u32))
|
||||
out.writeUint32Big(u32(id));
|
||||
else if (g_Main->GetExpectedIdSize() == sizeof(u64))
|
||||
out.writeUint64Big(id);
|
||||
else
|
||||
Log.report(logvisor::Fatal, "Unsupported id length %i", g_Main->GetExpectedIdSize());
|
||||
}
|
||||
void CAssetId::PutTo(COutputStream& out) {
|
||||
if (g_Main) {
|
||||
if (g_Main->GetExpectedIdSize() == sizeof(u32))
|
||||
out.writeUint32Big(u32(id));
|
||||
else if (g_Main->GetExpectedIdSize() == sizeof(u64))
|
||||
out.writeUint64Big(id);
|
||||
else
|
||||
Log.report(logvisor::Fatal, "PutTo called before runtime Main entered!");
|
||||
Log.report(logvisor::Fatal, "Unsupported id length %i", g_Main->GetExpectedIdSize());
|
||||
} else
|
||||
Log.report(logvisor::Fatal, "PutTo called before runtime Main entered!");
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace urde
|
||||
Reference in New Issue
Block a user