summaryrefslogtreecommitdiff
path: root/src/port
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2025-12-18 11:24:38 -0700
committerGitHub <noreply@github.com>2025-12-18 11:24:38 -0700
commitf0c2cea0eec6c49a335e9c044fcc28218e1ab749 (patch)
tree422128eeb081feffca8ad3ac87566a35358e077f /src/port
parent99b56300556434580ed23edc27e5e7d982751e47 (diff)
Impl RandomItemTable class (#598)
* Impl RandomItem class * Refactor func * Impl RandomItemTable * Revert probability inaccuracy * Remove unnecessary comment * Fix compile, probably * As per review 1 --------- Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/port')
-rw-r--r--src/port/Game.cpp12
-rw-r--r--src/port/Game.h5
-rw-r--r--src/port/ui/TrackProperties.cpp2
3 files changed, 16 insertions, 3 deletions
diff --git a/src/port/Game.cpp b/src/port/Game.cpp
index 9f96182d4..8f50da220 100644
--- a/src/port/Game.cpp
+++ b/src/port/Game.cpp
@@ -23,7 +23,7 @@
#include "engine/editor/Editor.h"
#include "engine/editor/SceneManager.h"
-#include "RegisterContent.h"
+#include "engine/registry/RegisterContent.h"
#include "engine/cameras/GameCamera.h"
#include "engine/cameras/FreeCamera.h"
@@ -31,6 +31,7 @@
#include "engine/cameras/LookBehindCamera.h"
#include "engine/TrackBrowser.h"
+#include "engine/RandomItemTable.h"
#ifdef _WIN32
#include <locale.h>
@@ -73,8 +74,13 @@ TrackEditor::Editor gEditor;
s32 gTrophyIndex = NULL;
+/** Spawner Registries **/
Registry<TrackInfo> gTrackRegistry;
Registry<ActorInfo, const SpawnParams&> gActorRegistry;
+Registry<ItemInfo> gItemRegistry;
+
+/** Data Registries **/
+DataRegistry<RandomItemTable> gItemTableRegistry;
std::unique_ptr<TrackBrowser> gTrackBrowser;
@@ -138,7 +144,11 @@ void CustomEngineInit() {
SetMarioRaceway();
+ printf("[Game] Registering Game Content...\n");
RegisterActors(gActorRegistry);
+ RegisterItems(gItemRegistry);
+ RegisterItemTables(gItemTableRegistry);
+ printf("[Game] Game Content Registered!\n");
}
void CustomEngineDestroy() {
diff --git a/src/port/Game.h b/src/port/Game.h
index d1f6ec3df..dbf2a7cea 100644
--- a/src/port/Game.h
+++ b/src/port/Game.h
@@ -7,7 +7,8 @@
#ifdef __cplusplus
#include "engine/editor/Editor.h"
-#include "engine/Registry.h"
+#include "engine/registry/Registry.h"
+#include "engine/registry/DataRegistry.h"
class Track;
struct Properties;
class World;
@@ -30,6 +31,8 @@ extern HarbourMastersIntro gMenuIntro;
extern bool bCleanWorld;
extern Registry<TrackInfo> gTrackRegistry;
extern Registry<ActorInfo, const SpawnParams&> gActorRegistry;
+extern Registry<ItemInfo> gItemRegistry;
+extern DataRegistry<RandomItemTable> gItemTableRegistry;
World* GetWorld(void); // Retrieve the world instance
#endif
// NOLINTBEGIN(readability-identifier-naming)
diff --git a/src/port/ui/TrackProperties.cpp b/src/port/ui/TrackProperties.cpp
index d3ef44ad4..18a2c4655 100644
--- a/src/port/ui/TrackProperties.cpp
+++ b/src/port/ui/TrackProperties.cpp
@@ -16,7 +16,7 @@
#include "engine/cameras/TourCamera.h"
#include "engine/TrackBrowser.h"
#include "engine/editor/SceneManager.h"
-#include "engine/Registry.h"
+#include "engine/registry/Registry.h"
extern "C" {
#include "code_800029B0.h"