A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
GameScene.hh
1#pragma once
2
3#include "game/system/MultiDvdArchive.hh"
4
5#include <egg/core/Allocator.hh>
6#include <egg/core/ExpHeap.hh>
7#include <egg/core/Scene.hh>
8
9#include <list>
10
12namespace Kinoko::Scene {
13
15class GameScene : public EGG::Scene {
16public:
17 GameScene();
18 ~GameScene() override;
19
20 void calc() final;
21 void enter() final;
22 void exit() final;
23 void reinit() final;
24
25 virtual void createEngines() = 0;
26 virtual void initEngines() = 0;
27 virtual void calcEngines() = 0;
28 virtual void destroyEngines() = 0;
29 virtual void configure() = 0;
30 virtual void onReinit() {}
31
32 static void initCamera();
33 static void calcCamera();
34
35protected:
36 void appendResource(System::MultiDvdArchive *archive, s32 id);
37
38private:
39 struct Resource {
40 Resource(System::MultiDvdArchive *archive, s32 id);
41
43 s32 id;
44 };
45
46 void initScene();
47 void deinitScene();
48 void unmountResources();
49
50#ifdef BUILD_DEBUG
51 void checkMemory();
52 void getMemoryLeakTags();
53 size_t getMemoryLeakTagCount();
54
55 static void ViewTags(void *block, Abstract::Memory::MEMiHeapHead *heap, uintptr_t param);
56 static void IncreaseTagCount(void *block, Abstract::Memory::MEMiHeapHead *heap,
57 uintptr_t param);
58#endif // BUILD_DEBUG
59
60 EGG::ExpHeap::GroupSizeRecord m_groupSizeRecord;
61 std::list<Resource *, EGG::Allocator<Resource *>>
63 int m_nextSceneId;
64
65 [[maybe_unused]] size_t m_totalMemoryUsed;
66};
67
68} // namespace Kinoko::Scene
A low-level representation of a memory heap for managing dynamic memory allocation....
Definition HeapCommon.hh:21
Memory blocks have group IDs assigned to them (default 0). This class is a record of the total sum of...
Definition ExpHeap.hh:21
Base class for all scenes.
Definition Scene.hh:16
std::list< Resource *, EGG::Allocator< Resource * > > m_resources
List of all active resources in the scene.
Definition GameScene.hh:62
Pertains to scene handling.
Definition GameScene.cc:10