3#include "game/field/BoxColManager.hh"
4#include "game/field/CollisionDirector.hh"
5#include "game/field/ObjectDirector.hh"
6#include "game/field/RailManager.hh"
7#include "game/item/ItemDirector.hh"
8#include "game/kart/KartObjectManager.hh"
9#include "game/system/CourseMap.hh"
10#include "game/system/KPadDirector.hh"
11#include "game/system/RaceConfig.hh"
12#include "game/system/RaceManager.hh"
13#include "game/system/ResourceManager.hh"
15#include <ScopeLock.hh>
20RaceScene::RaceScene() {
21 m_heap->setName(
"RaceSceneHeap");
25RaceScene::~RaceScene() =
default;
28void RaceScene::createEngines() {
31 System::CourseMap::CreateInstance()->init();
36 System::RaceManager::CreateInstance();
41 Field::BoxColManager::CreateInstance();
46 Kart::KartObjectManager::CreateInstance();
51 Field::CollisionDirector::CreateInstance();
56 Item::ItemDirector::CreateInstance();
61 Field::RailManager::CreateInstance();
62 Field::ObjectDirector::CreateInstance();
67void RaceScene::initEngines() {
70 Kart::KartObjectManager::Instance()->init();
75 System::RaceManager::Instance()->init();
80 Item::ItemDirector::Instance()->init();
85 Field::ObjectDirector::Instance()->init();
88 m_heap->disableAllocation();
95 auto *raceMgr = System::RaceManager::Instance();
97 Field::BoxColManager::Instance()->
calc();
98 Field::ObjectDirector::Instance()->calc();
99 Kart::KartObjectManager::Instance()->calc();
100 Item::ItemDirector::Instance()->calc();
105void RaceScene::destroyEngines() {
106 System::KPadDirector::Instance()->endGhostProxies();
107 Kart::KartObjectManager::DestroyInstance();
108 Field::ObjectDirector::DestroyInstance();
109 Field::RailManager::DestroyInstance();
110 Field::CollisionDirector::DestroyInstance();
111 Item::ItemDirector::DestroyInstance();
112 Field::BoxColManager::DestroyInstance();
113 System::RaceManager::DestroyInstance();
114 System::CourseMap::DestroyInstance();
120 auto *raceCfg = System::RaceConfig::Instance();
121 auto *resMgr = System::ResourceManager::Instance();
129 auto *commonArc = resMgr->load(0,
nullptr);
130 appendResource(commonArc, 0);
132 auto *courseArc = resMgr->load(raceCfg->raceScenario().course);
133 appendResource(courseArc, 1);
void calc()
Recalculate the bounds of all active units having PermRecalcAABB or TempRecalcAABB flag,...
void onReinit() override
This is called on race shutdown in order to prep for the next race.
void configure() override
Retrieves Common.szs and the course archive.
void calcEngines() override
Pertains to scene handling.