mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 13:44:56 +00:00
Massive fmtlib refactor
This commit is contained in:
@@ -34,7 +34,7 @@ bool CDecalDataFactory::CreateDPSM(CDecalDescription* desc, CInputStream& in, CS
|
||||
|
||||
while (clsId != SBIG('_END')) {
|
||||
bool loadFirstDesc = false;
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('1SZE'):
|
||||
case SBIG('1LFT'):
|
||||
case SBIG('1ROT'):
|
||||
@@ -82,8 +82,7 @@ bool CDecalDataFactory::CreateDPSM(CDecalDescription* desc, CInputStream& in, CS
|
||||
desc->x5c_25_DMOO = CPF::GetBool(in);
|
||||
break;
|
||||
default: {
|
||||
uint32_t clsName = clsId.toUint32();
|
||||
Log.report(logvisor::Fatal, "Unknown DPSC class %.4s @%" PRIi64, &clsName, in.position());
|
||||
Log.report(logvisor::Fatal, fmt("Unknown DPSC class {} @{}"), clsId, in.position());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -94,7 +93,7 @@ bool CDecalDataFactory::CreateDPSM(CDecalDescription* desc, CInputStream& in, CS
|
||||
}
|
||||
|
||||
void CDecalDataFactory::GetQuadDecalInfo(CInputStream& in, CSimplePool* resPool, FourCC clsId, SQuadDescr& quad) {
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('1LFT'):
|
||||
case SBIG('2LFT'):
|
||||
quad.x0_LFT = CPF::GetIntElement(in);
|
||||
|
||||
@@ -237,7 +237,7 @@ bool CElementGen::Update(double t) {
|
||||
if (pswtElem && !x26d_25_warmedUp) {
|
||||
int pswt = 0;
|
||||
pswtElem->GetValue(x74_curFrame, pswt);
|
||||
//Log.report(logvisor::Info, "Running warmup on particle system 0x%08x for %d ticks.", desc, pswt);
|
||||
//Log.report(logvisor::Info, fmt("Running warmup on particle system 0x%08x for %d ticks."), desc, pswt);
|
||||
InternalUpdate((1.f / 60.f) * pswt);
|
||||
x26d_25_warmedUp = true;
|
||||
}
|
||||
@@ -874,7 +874,7 @@ void CElementGen::RenderModels(const CActorLights* actorLights) {
|
||||
g_instNoTexData.reserve(x30_particles.size());
|
||||
break;
|
||||
default:
|
||||
Log.report(logvisor::Fatal, "unexpected particle shader class");
|
||||
Log.report(logvisor::Fatal, fmt("unexpected particle shader class"));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1288,7 +1288,7 @@ void CElementGen::RenderParticles() {
|
||||
g_instNoTexData.reserve(x30_particles.size());
|
||||
break;
|
||||
default:
|
||||
Log.report(logvisor::Fatal, "unexpected particle shader class");
|
||||
Log.report(logvisor::Fatal, fmt("unexpected particle shader class"));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1482,7 +1482,7 @@ void CElementGen::RenderParticles() {
|
||||
g_instNoTexData.reserve(x30_particles.size() * mbspVal);
|
||||
break;
|
||||
default:
|
||||
Log.report(logvisor::Fatal, "unexpected particle shader class");
|
||||
Log.report(logvisor::Fatal, fmt("unexpected particle shader class"));
|
||||
break;
|
||||
}
|
||||
float mbspFac = 1.f / float(mbspVal);
|
||||
@@ -1749,7 +1749,7 @@ void CElementGen::SetTranslation(const zeus::CVector3f& translation) {
|
||||
xdc_translation = translation;
|
||||
|
||||
for (const std::unique_ptr<CParticleGen>& ch : x290_activePartChildren) {
|
||||
switch (ch->Get4CharId()) {
|
||||
switch (ch->Get4CharId().toUint32()) {
|
||||
case SBIG('SELC'):
|
||||
ch->SetTranslation(translation + x2c0_SEPO);
|
||||
break;
|
||||
|
||||
@@ -17,7 +17,7 @@ s32 CParticleDataFactory::GetInt(CInputStream& in) { return in.readInt32Big(); }
|
||||
bool CParticleDataFactory::GetBool(CInputStream& in) {
|
||||
FourCC cid = GetClassID(in);
|
||||
if (cid != FOURCC('CNST'))
|
||||
Log.report(logvisor::Fatal, "bool element does not begin with CNST");
|
||||
Log.report(logvisor::Fatal, fmt("bool element does not begin with CNST"));
|
||||
return in.readBool();
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ SElectricGeneratorDesc CParticleDataFactory::GetElectricGeneratorDesc(CInputStre
|
||||
|
||||
std::unique_ptr<CUVElement> CParticleDataFactory::GetTextureElement(CInputStream& in, CSimplePool* resPool) {
|
||||
FourCC clsId = GetClassID(in);
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('CNST'): {
|
||||
FourCC subId = GetClassID(in);
|
||||
if (subId == SBIG('NONE'))
|
||||
@@ -109,7 +109,7 @@ std::unique_ptr<CUVElement> CParticleDataFactory::GetTextureElement(CInputStream
|
||||
|
||||
std::unique_ptr<CColorElement> CParticleDataFactory::GetColorElement(CInputStream& in) {
|
||||
FourCC clsId = GetClassID(in);
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('KEYE'):
|
||||
case SBIG('KEYP'): {
|
||||
return std::make_unique<CCEKeyframeEmitter>(in);
|
||||
@@ -167,7 +167,7 @@ std::unique_ptr<CColorElement> CParticleDataFactory::GetColorElement(CInputStrea
|
||||
|
||||
std::unique_ptr<CModVectorElement> CParticleDataFactory::GetModVectorElement(CInputStream& in) {
|
||||
FourCC clsId = GetClassID(in);
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('IMPL'): {
|
||||
auto a = GetVectorElement(in);
|
||||
auto b = GetRealElement(in);
|
||||
@@ -261,7 +261,7 @@ std::unique_ptr<CModVectorElement> CParticleDataFactory::GetModVectorElement(CIn
|
||||
|
||||
std::unique_ptr<CEmitterElement> CParticleDataFactory::GetEmitterElement(CInputStream& in) {
|
||||
FourCC clsId = GetClassID(in);
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('SETR'): {
|
||||
FourCC prop = GetClassID(in);
|
||||
if (prop == SBIG('ILOC')) {
|
||||
@@ -304,7 +304,7 @@ std::unique_ptr<CEmitterElement> CParticleDataFactory::GetEmitterElement(CInputS
|
||||
|
||||
std::unique_ptr<CVectorElement> CParticleDataFactory::GetVectorElement(CInputStream& in) {
|
||||
FourCC clsId = GetClassID(in);
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('CONE'): {
|
||||
auto a = GetVectorElement(in);
|
||||
auto b = GetRealElement(in);
|
||||
@@ -416,7 +416,7 @@ std::unique_ptr<CVectorElement> CParticleDataFactory::GetVectorElement(CInputStr
|
||||
|
||||
std::unique_ptr<CRealElement> CParticleDataFactory::GetRealElement(CInputStream& in) {
|
||||
FourCC clsId = GetClassID(in);
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('LFTW'): {
|
||||
auto a = GetRealElement(in);
|
||||
auto b = GetRealElement(in);
|
||||
@@ -599,7 +599,7 @@ std::unique_ptr<CRealElement> CParticleDataFactory::GetRealElement(CInputStream&
|
||||
|
||||
std::unique_ptr<CIntElement> CParticleDataFactory::GetIntElement(CInputStream& in) {
|
||||
FourCC clsId = GetClassID(in);
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('KEYE'):
|
||||
case SBIG('KEYP'): {
|
||||
return std::make_unique<CIEKeyframeEmitter>(in);
|
||||
@@ -722,7 +722,7 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i
|
||||
CGlobalRandom gr(rand);
|
||||
FourCC clsId = GetClassID(in);
|
||||
while (clsId != SBIG('_END')) {
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('PMCL'):
|
||||
fillDesc->x78_x64_PMCL = GetColorElement(in);
|
||||
break;
|
||||
@@ -976,8 +976,7 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i
|
||||
fillDesc->xec_xd8_SELC = GetElectricGeneratorDesc(in, resPool);
|
||||
break;
|
||||
default: {
|
||||
uint32_t clsName = clsId.toUint32();
|
||||
Log.report(logvisor::Fatal, "Unknown GPSM class %.4s @%" PRIi64, &clsName, in.position());
|
||||
Log.report(logvisor::Fatal, fmt("Unknown GPSM class {} @{}"), clsId, in.position());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -991,7 +990,7 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i
|
||||
return true;
|
||||
|
||||
while (clsId != SBIG('_END') && !in.atEnd()) {
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('BGCL'):
|
||||
fillDesc->m_bevelGradient = GetColorElement(in);
|
||||
break;
|
||||
|
||||
@@ -34,7 +34,7 @@ bool CParticleElectricDataFactory::CreateELSM(CElectricDescription* desc, CInput
|
||||
|
||||
FourCC clsId = CPF::GetClassID(in);
|
||||
while (clsId != SBIG('_END')) {
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('LIFE'):
|
||||
desc->x0_LIFE = CPF::GetIntElement(in);
|
||||
break;
|
||||
@@ -102,8 +102,7 @@ bool CParticleElectricDataFactory::CreateELSM(CElectricDescription* desc, CInput
|
||||
desc->x70_ZERY = CPF::GetBool(in);
|
||||
break;
|
||||
default: {
|
||||
uint32_t clsName = clsId.toUint32();
|
||||
Log.report(logvisor::Fatal, "Unknown ELSM class %.4s @%" PRIi64, &clsName, in.position());
|
||||
Log.report(logvisor::Fatal, fmt("Unknown ELSM class {} @{}"), clsId, in.position());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ bool CParticleSwooshDataFactory::CreateWPSM(CSwooshDescription* desc, CInputStre
|
||||
FourCC clsId = CPF::GetClassID(in);
|
||||
while (clsId != SBIG('_END')) {
|
||||
CGlobalRandom gr(rand);
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('PSLT'):
|
||||
desc->x0_PSLT = CPF::GetIntElement(in);
|
||||
break;
|
||||
@@ -118,8 +118,7 @@ bool CParticleSwooshDataFactory::CreateWPSM(CSwooshDescription* desc, CInputStre
|
||||
desc->x45_26_CRND = CPF::GetBool(in);
|
||||
break;
|
||||
default: {
|
||||
uint32_t clsName = clsId.toUint32();
|
||||
Log.report(logvisor::Fatal, "Unknown SWSH class %.4s @%" PRIi64, &clsName, in.position());
|
||||
Log.report(logvisor::Fatal, fmt("Unknown SWSH class {} @{}"), clsId, in.position());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ bool CProjectileWeaponDataFactory::CreateWPSM(CWeaponDescription* desc, CInputSt
|
||||
FourCC clsId = CPF::GetClassID(in);
|
||||
|
||||
while (clsId != SBIG('_END')) {
|
||||
switch (clsId) {
|
||||
switch (clsId.toUint32()) {
|
||||
case SBIG('IORN'):
|
||||
desc->x0_IORN = CPF::GetVectorElement(in);
|
||||
break;
|
||||
@@ -146,8 +146,7 @@ bool CProjectileWeaponDataFactory::CreateWPSM(CWeaponDescription* desc, CInputSt
|
||||
desc->xb0_FOFF = CPF::GetRealElement(in);
|
||||
break;
|
||||
default: {
|
||||
uint32_t clsName = clsId.toUint32();
|
||||
Log.report(logvisor::Fatal, "Unknown WPSM class %.4s @%" PRIi64, &clsName, in.position());
|
||||
Log.report(logvisor::Fatal, fmt("Unknown WPSM class {} @{}"), clsId, in.position());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user