mirror of https://github.com/PrimeDecomp/prime.git
Add CStateManager::MemoryAllocatorAllocationFailedCallback and RayStaticIntersection
This commit is contained in:
parent
0e45d77036
commit
c29af5f67d
|
@ -9,6 +9,7 @@ public:
|
||||||
static void CollectGarbage();
|
static void CollectGarbage();
|
||||||
static void PreInitializeAlloc(uint size) { mPreInitializeAlloc += size; }
|
static void PreInitializeAlloc(uint size) { mPreInitializeAlloc += size; }
|
||||||
static void Initialize(uint);
|
static void Initialize(uint);
|
||||||
|
static void WaitForAllDMAsToComplete();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static uint mPreInitializeAlloc;
|
static uint mPreInitializeAlloc;
|
||||||
|
|
|
@ -132,6 +132,7 @@ public:
|
||||||
void AddObject(CEntity*);
|
void AddObject(CEntity*);
|
||||||
TUniqueId AllocateUniqueId();
|
TUniqueId AllocateUniqueId();
|
||||||
const rstl::string& HashInstanceName(CInputStream& in);
|
const rstl::string& HashInstanceName(CInputStream& in);
|
||||||
|
bool SwapOutAllPossibleMemory();
|
||||||
|
|
||||||
void BuildNearList(TEntityList& nearList, const CVector3f& pos, const CVector3f& dir, float mag,
|
void BuildNearList(TEntityList& nearList, const CVector3f& pos, const CVector3f& dir, float mag,
|
||||||
const CMaterialFilter&, const CActor*) const;
|
const CMaterialFilter&, const CActor*) const;
|
||||||
|
|
|
@ -17,10 +17,17 @@
|
||||||
#include "MetroidPrime/ScriptObjects/CScriptMazeNode.hpp"
|
#include "MetroidPrime/ScriptObjects/CScriptMazeNode.hpp"
|
||||||
|
|
||||||
#include "Collision/CCollisionPrimitive.hpp"
|
#include "Collision/CCollisionPrimitive.hpp"
|
||||||
|
#include "Collision/CRayCastResult.hpp"
|
||||||
#include "Kyoto/Basics/RAssertDolphin.hpp"
|
#include "Kyoto/Basics/RAssertDolphin.hpp"
|
||||||
|
#include "Kyoto/CARAMManager.hpp"
|
||||||
|
#include "Kyoto/CARAMToken.hpp"
|
||||||
#include "Kyoto/Graphics/CLight.hpp"
|
#include "Kyoto/Graphics/CLight.hpp"
|
||||||
#include "MetaRender/CCubeRenderer.hpp"
|
#include "MetaRender/CCubeRenderer.hpp"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
void sub_8036ccfc();
|
||||||
|
}
|
||||||
|
|
||||||
CStateManager::CStateManager(const rstl::ncrc_ptr< CScriptMailbox >& mailbox,
|
CStateManager::CStateManager(const rstl::ncrc_ptr< CScriptMailbox >& mailbox,
|
||||||
const rstl::ncrc_ptr< CMapWorldInfo >& mwInfo,
|
const rstl::ncrc_ptr< CMapWorldInfo >& mwInfo,
|
||||||
const rstl::ncrc_ptr< CPlayerState >& playerState,
|
const rstl::ncrc_ptr< CPlayerState >& playerState,
|
||||||
|
@ -311,10 +318,25 @@ TUniqueId CStateManager::AllocateUniqueId() {
|
||||||
return TUniqueId(x4_objectIndexArray[ourIndex], ourIndex);
|
return TUniqueId(x4_objectIndexArray[ourIndex], ourIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CRayCastResult CStateManager::RayStaticIntersection(const CVector3f& pos, const CVector3f& dir,
|
||||||
|
float length,
|
||||||
|
const CMaterialFilter& filter) const {
|
||||||
|
return CGameCollision::RayStaticIntersection(*this, pos, dir, length, filter);
|
||||||
|
}
|
||||||
|
|
||||||
void CStateManager::RemoveObject(TUniqueId id) {}
|
void CStateManager::RemoveObject(TUniqueId id) {}
|
||||||
|
|
||||||
void CStateManager::ClearGraveyard() {}
|
void CStateManager::ClearGraveyard() {}
|
||||||
|
|
||||||
void CStateManager::RendererDrawCallback(const void*, const void*, int) {}
|
const bool CStateManager::MemoryAllocatorAllocationFailedCallback(const void* obj, unsigned int) {
|
||||||
|
return static_cast< CStateManager* >(const_cast< void* >(obj))->SwapOutAllPossibleMemory();
|
||||||
|
}
|
||||||
|
|
||||||
const bool CStateManager::MemoryAllocatorAllocationFailedCallback(const void*, unsigned int) {}
|
bool CStateManager::SwapOutAllPossibleMemory() {
|
||||||
|
sub_8036ccfc();
|
||||||
|
CARAMManager::WaitForAllDMAsToComplete();
|
||||||
|
CARAMToken::UpdateAllDMAs();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CStateManager::RendererDrawCallback(const void*, const void*, int) {}
|
||||||
|
|
Loading…
Reference in New Issue