A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
SceneManager.hh
1#pragma once
2
3#include "egg/core/Scene.hh"
4#include "egg/core/SceneCreator.hh"
5
6namespace Host {
7
8class Context;
9
10} // namespace Host
11
12namespace EGG {
13
16 friend class Host::Context;
17
18public:
19 /*------------*
20 Lifecycle
21 *------------*/
22
23 SceneManager(SceneCreator *creator = nullptr);
24 virtual ~SceneManager();
25
26 /*----------*
27 Virtual
28 *----------*/
29
30 virtual void calc();
31 virtual void calcCurrentScene();
32
33 /*----------*
34 Methods
35 *----------*/
36
37 void createChildScene(int nextSceneId, Scene *parent);
38 void createScene(int nextSceneId, Scene *parent);
39 void destroyScene(Scene *scene);
40
41 void changeScene(int nextSceneId);
42 void changeSiblingScene(int nextSceneId);
43 void changeSiblingScene();
44 void incomingCurrentScene();
45 void outgoingParentScene(Scene *parent);
46 void reinitCurrentScene();
47
48 bool destroyCurrentSceneNoIncoming(bool destroyRootIfNoParent);
49 bool destroyToSelectSceneId(int nextSceneId);
50 [[nodiscard]] Scene *findParentScene(int id) const;
51 void setupNextSceneId();
52
53 /*----------*
54 Getters
55 *----------*/
56
57 [[nodiscard]] Scene *currentScene() const {
58 return m_currentScene;
59 }
60
61 [[nodiscard]] int currentSceneId() const {
62 return m_currentSceneId;
63 }
64
65 [[nodiscard]] static Heap *heapForCreateScene() {
66 return s_heapForCreateScene;
67 }
68
69 /*----------*
70 Setters
71 *----------*/
72
73 void setNextSceneId(int id) {
74 m_nextSceneId = id;
75 }
76
77 static void SetRootHeap(Heap *heap) {
78 s_rootHeap = heap;
79 }
80
81private:
82 /*----------*
83 Members
84 *----------*/
85
86 SceneCreator *m_creator;
87 Scene *m_currentScene;
88 int m_nextSceneId;
89 int m_currentSceneId;
90 int m_prevSceneId;
91
92 static Heap *s_heapForCreateScene;
93 static u16 s_heapOptionFlg;
94
95 static Heap *s_rootHeap;
96};
97
98} // namespace EGG
A high-level representation of a memory heap for managing dynamic memory allocation....
Definition Heap.hh:22
Interface for creating and destroying scenes.
Manages the scene stack and transitions between scenes.
Contexts can be used to restore a previous memory state for the current session.
Definition Context.hh:59
EGG core library.
Definition Archive.cc:6
Represents the host application.
Definition HeapCommon.hh:9
Pertains to scene handling.
Definition GameScene.cc:8