mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 00:27:42 +00:00
Various fixes and minor code cleanup, issue warning when attempting to load an unimplemented object
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include "CScriptCoverPoint.hpp"
|
||||
#include "CScriptSpiderBallWaypoint.hpp"
|
||||
#include "CScriptDamageableTrigger.hpp"
|
||||
#include "MP1/World/CMetroid.hpp"
|
||||
#include "CScriptDebris.hpp"
|
||||
#include "CScriptDistanceFog.hpp"
|
||||
#include "CScriptDock.hpp"
|
||||
@@ -116,6 +117,9 @@
|
||||
namespace urde {
|
||||
static logvisor::Module Log("urde::ScriptLoader");
|
||||
|
||||
#define UNIMPLEMENTED(name) \
|
||||
Log.report(logvisor::Warning, "Attempted to load unimplemented object '%s'", name);
|
||||
|
||||
static SObjectTag MorphballDoorANCS = {};
|
||||
|
||||
static const SObjectTag& GetMorphballDoorACS() {
|
||||
@@ -1916,6 +1920,7 @@ CEntity* ScriptLoader::LoadPlayerHint(CStateManager& mgr, CInputStream& in, int
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadRipper(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("Ripper");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -1932,6 +1937,7 @@ CEntity* ScriptLoader::LoadPickupGenerator(CStateManager& mgr, CInputStream& in,
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadAIKeyframe(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("AIKeyframe");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -1950,11 +1956,33 @@ CEntity* ScriptLoader::LoadPointOfInterest(CStateManager& mgr, CInputStream& in,
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadDrone(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("Drone");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadMetroidAlpha(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
return nullptr;
|
||||
CEntity* ScriptLoader::LoadMetroid(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
if (!EnsurePropertyCount(propCount, MP1::CMetroidData::GetNumProperties(), "Metroid"))
|
||||
return nullptr;
|
||||
|
||||
std::string name = mgr.HashInstanceName(in);
|
||||
CPatterned::EFlavorType flavor = CPatterned::EFlavorType(in.readUint32Big());
|
||||
zeus::CTransform xf = LoadEditorTransform(in);
|
||||
zeus::CVector3f scale = zeus::CVector3f::ReadBig(in);
|
||||
auto pair = CPatternedInfo::HasCorrectParameterCount(in);
|
||||
if (!pair.first)
|
||||
return nullptr;
|
||||
|
||||
CPatternedInfo pInfo(in, pair.second);
|
||||
CActorParameters actParms = LoadActorParameters(in);
|
||||
MP1::CMetroidData metData(in);
|
||||
const CAnimationParameters& animParms = pInfo.GetAnimationParameters();
|
||||
if (!animParms.GetACSFile().IsValid() || flavor == CPatterned::EFlavorType::One)
|
||||
return nullptr;
|
||||
|
||||
CModelData mData(
|
||||
CAnimRes(animParms.GetACSFile(), animParms.GetCharacter(), scale, animParms.GetInitialAnimation(), true));
|
||||
return new MP1::CMetroid(mgr.AllocateUniqueId(), name, flavor, info, xf, std::move(mData), pInfo, actParms, metData,
|
||||
kInvalidUniqueId);
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadDebrisExtended(CStateManager& mgr, CInputStream& in, int propCount,
|
||||
@@ -2109,6 +2137,7 @@ CEntity* ScriptLoader::LoadEMPulse(CStateManager& mgr, CInputStream& in, int pro
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadIceSheegoth(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("IceSheegoth");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -2156,6 +2185,7 @@ CEntity* ScriptLoader::LoadPlayerActor(CStateManager& mgr, CInputStream& in, int
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadFlaahgra(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("Flaahgra");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -2338,6 +2368,7 @@ CEntity* ScriptLoader::LoadVisorGoo(CStateManager& mgr, CInputStream& in, int pr
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadJellyZap(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("JellyZap");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -2390,6 +2421,7 @@ CEntity* ScriptLoader::LoadPlayerStateChange(CStateManager& mgr, CInputStream& i
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadThardus(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("Thardus");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -2456,6 +2488,7 @@ CEntity* ScriptLoader::LoadAiJumpPoint(CStateManager& mgr, CInputStream& in, int
|
||||
|
||||
CEntity* ScriptLoader::LoadFlaahgraTentacle(CStateManager& mgr, CInputStream& in, int propCount,
|
||||
const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("FlaahgraTentacle");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -2524,6 +2557,7 @@ CEntity* ScriptLoader::LoadColorModulate(CStateManager& mgr, CInputStream& in, i
|
||||
|
||||
CEntity* ScriptLoader::LoadThardusRockProjectile(CStateManager& mgr, CInputStream& in, int propCount,
|
||||
const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("ThardusRockProjectile");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -2862,6 +2896,7 @@ CEntity* ScriptLoader::LoadActorContraption(CStateManager& mgr, CInputStream& in
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadOculus(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("Oculus");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -3077,6 +3112,7 @@ CEntity* ScriptLoader::LoadAtomicBeta(CStateManager& mgr, CInputStream& in, int
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadIceZoomer(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("IceZoomer");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -3269,6 +3305,7 @@ CEntity* ScriptLoader::LoadWorldLightFader(CStateManager& mgr, CInputStream& in,
|
||||
|
||||
CEntity* ScriptLoader::LoadMetroidPrimeStage2(CStateManager& mgr, CInputStream& in, int propCount,
|
||||
const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("MetroidPrimeStage2");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -3321,15 +3358,18 @@ CEntity* ScriptLoader::LoadMazeNode(CStateManager& mgr, CInputStream& in, int pr
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadOmegaPirate(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("OmegaPirate");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadPhazonPool(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("PhazonPool");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadPhazonHealingNodule(CStateManager& mgr, CInputStream& in, int propCount,
|
||||
const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("PhazonHealingNodule");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -3373,6 +3413,7 @@ CEntity* ScriptLoader::LoadShadowProjector(CStateManager& mgr, CInputStream& in,
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadEnergyBall(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
|
||||
UNIMPLEMENTED("EnergyBall");
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user