mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 17:47:43 +00:00
Merge branch 'master' of https://github.com/AxioDL/urde
This commit is contained in:
@@ -142,19 +142,16 @@ size_t COBBTree::CNode::GetMemoryUsage() const
|
||||
{
|
||||
size_t ret = 0;
|
||||
if (x3c_isLeaf)
|
||||
ret = x48_leaf->GetMemoryUsage() + 80;
|
||||
ret = x48_leaf->GetMemoryUsage() + /*sizeof(CNode)*/ 80;
|
||||
else
|
||||
{
|
||||
if (x40_left)
|
||||
ret = x40_left->GetMemoryUsage() + 80;
|
||||
ret = x40_left->GetMemoryUsage() + /*sizeof(CNode)*/ 80;
|
||||
if (x44_right)
|
||||
ret += x44_right->GetMemoryUsage();
|
||||
}
|
||||
|
||||
if (!(ret & 3))
|
||||
return ret;
|
||||
|
||||
return ret + ((ret & 3) - 4);
|
||||
return (ret + 3) & ~3;
|
||||
}
|
||||
|
||||
COBBTree::CLeafData::CLeafData(const std::vector<u16>& surface)
|
||||
@@ -169,10 +166,8 @@ const std::vector<u16>& COBBTree::CLeafData::GetSurfaceVector() const
|
||||
|
||||
size_t COBBTree::CLeafData::GetMemoryUsage() const
|
||||
{
|
||||
size_t ret = (x0_surface.size() * 2) + 16;
|
||||
if (!(ret & 3))
|
||||
return ret;
|
||||
return ret + ((ret & 3) - 4);
|
||||
size_t ret = (x0_surface.size() * 2) + /*sizeof(CLeafData)*/ 16;
|
||||
return (ret + 3) & ~3;
|
||||
}
|
||||
|
||||
COBBTree::CLeafData::CLeafData(CInputStream& in)
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "GuiSys/CTextExecuteBuffer.hpp"
|
||||
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp"
|
||||
#include "DataSpec/DNAMP1/Tweaks/CTweakGame.hpp"
|
||||
#include "World/CScriptMazeNode.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
@@ -90,6 +91,7 @@ public:
|
||||
{
|
||||
LoadStringTable();
|
||||
m_renderer.reset(AllocateRenderer(xcc_simplePool, x4_resFactory));
|
||||
CScriptMazeNode::LoadMazeSeeds();
|
||||
}
|
||||
|
||||
void ResetGameState()
|
||||
|
||||
@@ -2,10 +2,13 @@
|
||||
#include "Character/CModelData.hpp"
|
||||
#include "GameGlobalObjects.hpp"
|
||||
#include "CActorParameters.hpp"
|
||||
#include "TCastTo.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
atUint32 CScriptMazeNode::sMazeSeeds[300] = {0};
|
||||
|
||||
CScriptMazeNode::CScriptMazeNode(TUniqueId uid, const std::string& name, const CEntityInfo& info,
|
||||
const zeus::CTransform& xf, bool active, s32 w1, s32 w2, s32 w3,
|
||||
const zeus::CVector3f& vec1, const zeus::CVector3f& vec2, const zeus::CVector3f& vec3)
|
||||
@@ -21,7 +24,12 @@ CScriptMazeNode::CScriptMazeNode(TUniqueId uid, const std::string& name, const C
|
||||
x13c_24_ = true;
|
||||
}
|
||||
|
||||
void CScriptMazeNode::LoadSeeds()
|
||||
void CScriptMazeNode::Accept(IVisitor& visitor)
|
||||
{
|
||||
visitor.Visit(this);
|
||||
}
|
||||
|
||||
void CScriptMazeNode::LoadMazeSeeds()
|
||||
{
|
||||
const SObjectTag* tag = g_ResFactory->GetResourceIdByName("DUMB_MazeSeeds");
|
||||
u32 resSize = g_ResFactory->ResourceSize(*tag);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace urde
|
||||
{
|
||||
class CScriptMazeNode : CActor
|
||||
class CScriptMazeNode : public CActor
|
||||
{
|
||||
static u32 sMazeSeeds[300];
|
||||
s32 xe8_;
|
||||
@@ -36,7 +36,8 @@ public:
|
||||
CScriptMazeNode(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, bool, s32, s32, s32,
|
||||
const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&);
|
||||
|
||||
void LoadSeeds();
|
||||
void Accept(IVisitor &visitor);
|
||||
static void LoadMazeSeeds();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
#include "CScriptCameraHintTrigger.hpp"
|
||||
#include "CScriptVisorFlare.hpp"
|
||||
#include "CScriptBeam.hpp"
|
||||
#include "CScriptMazeNode.hpp"
|
||||
#include "Camera/CCinematicCamera.hpp"
|
||||
#include "MP1/World/CNewIntroBoss.hpp"
|
||||
#include "MP1/World/CBeetle.hpp"
|
||||
@@ -2340,7 +2341,20 @@ CEntity* ScriptLoader::LoadMetroidPrimeStage1(CStateManager& mgr, CInputStream&
|
||||
|
||||
CEntity* ScriptLoader::LoadMazeNode(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)
|
||||
{
|
||||
return nullptr;
|
||||
if (!EnsurePropertyCount(propCount, 10, "MazeNode"))
|
||||
return nullptr;
|
||||
|
||||
SActorHead aHead = LoadActorHead(in, mgr);
|
||||
bool active = in.readBool();
|
||||
u32 w1 = in.readUint32Big();
|
||||
u32 w2 = in.readUint32Big();
|
||||
u32 w3 = in.readUint32Big();
|
||||
zeus::CVector3f vec1 = zeus::CVector3f::ReadBig(in);
|
||||
zeus::CVector3f vec2 = zeus::CVector3f::ReadBig(in);
|
||||
zeus::CVector3f vec3 = zeus::CVector3f::ReadBig(in);
|
||||
|
||||
return new CScriptMazeNode(mgr.AllocateUniqueId(), aHead.x0_name, info, aHead.x10_transform, active, w1, w2, w3,
|
||||
vec1, vec2, vec3);
|
||||
}
|
||||
|
||||
CEntity* ScriptLoader::LoadOmegaPirate(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)
|
||||
|
||||
Reference in New Issue
Block a user