diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2026-02-24 14:51:25 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-24 14:51:25 -0700 |
| commit | 548ccf0063f6c4d6608cf87f46a347c71079c0bd (patch) | |
| tree | 42708916b67dc1dd553c70199339541a401dca15 /src/port | |
| parent | 321d440089fc7424002879c9b2e74a4b0ffe9a8d (diff) | |
Impl Sky and SkyActors (#630)
* Create Cloud.cpp
* Create Cloud.h
* Fix the cloud
* Cleanup
* More cleanup
* Update Track.h
* Refactor SkyboxCloud position calculations
* Update SkyboxStar.cpp
* Update SkyboxStar.cpp
* Refactor SkyboxStar.cpp by removing redundant code
* Update SkyboxCloud.cpp
* Refactor SkyboxSnow.cpp by reordering includes
* Update SkyboxCloud.h
* Refactor SkyboxStar.h for improved formatting
* Impl skyboxcloud
* Update comment
* update comment
* Work now
* Fully impl Sky
* Fix define
* Fix args
Diffstat (limited to 'src/port')
| -rw-r--r-- | src/port/Game.cpp | 23 | ||||
| -rw-r--r-- | src/port/Game.h | 4 | ||||
| -rw-r--r-- | src/port/ui/ContentBrowser.cpp | 5 | ||||
| -rw-r--r-- | src/port/ui/PortMenu.cpp | 8 |
4 files changed, 28 insertions, 12 deletions
diff --git a/src/port/Game.cpp b/src/port/Game.cpp index ce22999d1..9a492f6b3 100644 --- a/src/port/Game.cpp +++ b/src/port/Game.cpp @@ -32,6 +32,7 @@ #include "engine/TrackBrowser.h" #include "engine/RandomItemTable.h" +#include "engine/sky/Sky.h" #ifdef _WIN32 #include <locale.h> @@ -47,6 +48,7 @@ extern "C" { #include "spawn_players.h" #include "src/enhancements/collision_viewer.h" #include "code_800029B0.h" +#include "code_80057C60.h" // #include "engine/wasm.h" } @@ -81,6 +83,7 @@ Registry<ItemInfo> gItemRegistry; DataRegistry<RandomItemTable> gItemTableRegistry; std::unique_ptr<TrackBrowser> gTrackBrowser; +std::unique_ptr<Sky> gSky; World* GetWorld() { return World::Instance; @@ -91,6 +94,8 @@ void CustomEngineInit() { // This also turns off freecam gEditor.Disable(); + + gSky = std::make_unique<Sky>(); RegisterTracks(gTrackRegistry); gTrackBrowser = std::make_unique<TrackBrowser>(gTrackRegistry); TrackBrowser::Instance->FindCustomTracks(); @@ -361,6 +366,7 @@ void CM_DrawStaticMeshActors() { void CM_BeginPlay() { static bool tour = false; auto track = GetWorld()->GetTrack(); + GetWorld()->Actors.clear(); if (nullptr == track) { return; @@ -554,15 +560,14 @@ void CM_DrawParticles(s32 cameraId) { } } -void CM_InitClouds() { - if (GetWorld()->GetTrack()) { - GetWorld()->GetTrack()->InitClouds(); - } -} - -void CM_TickClouds(s32 arg0, Camera* camera) { - if (GetWorld()->GetTrack()) { - GetWorld()->GetTrack()->TickClouds(arg0, camera); +void CM_RaceDrawSky(ScreenContext* screen, s32 someId) { + // if (bDrawSkybox) { + if (CVarGetInteger("gDrawSky", true) == true) { + Sky::Instance->Draw(screen); + if (gGamestate != CREDITS_SEQUENCE) { + func_80057FC4(screen, someId); // DrawSkyActors + } + Sky::Instance->DrawFloor(screen); } } diff --git a/src/port/Game.h b/src/port/Game.h index fdd11c7a6..f649389af 100644 --- a/src/port/Game.h +++ b/src/port/Game.h @@ -72,8 +72,6 @@ void CM_ActivateSecondLapLakitu(s32 playerId); void CM_ActivateFinalLapLakitu(s32 playerId); void CM_ActivateReverseLakitu(s32 playerId); -void CM_InitClouds(); - void CM_DrawActors(Camera* camera); void CM_DrawStaticMeshActors(); @@ -102,7 +100,7 @@ void Editor_CleanWorld(); void CM_TickParticles(void); void CM_DrawParticles(s32 cameraId); -void CM_TickClouds(s32 arg0, Camera* camera); +void CM_RaceDrawSky(ScreenContext* screen, s32 someId); void CM_Waypoints(Player* player, int8_t playerId); diff --git a/src/port/ui/ContentBrowser.cpp b/src/port/ui/ContentBrowser.cpp index a5ef9baa3..1065007b6 100644 --- a/src/port/ui/ContentBrowser.cpp +++ b/src/port/ui/ContentBrowser.cpp @@ -94,6 +94,11 @@ namespace TrackEditor { for (const TrackInfo* info : gTrackRegistry.GetAllInfo()) { if (!info) { continue; } + // Skip this invalid option + if (info->ResourceName == "mk:podium_ceremony") { + continue; + } + if (!search.empty() && ToLower(info->Name).find(search) == std::string::npos) { continue; diff --git a/src/port/ui/PortMenu.cpp b/src/port/ui/PortMenu.cpp index 9eb273f5e..09a115e32 100644 --- a/src/port/ui/PortMenu.cpp +++ b/src/port/ui/PortMenu.cpp @@ -565,6 +565,14 @@ void PortMenu::AddSceneVisibility() { WidgetPath path = { "Developer", "Scene Visibility", SECTION_COLUMN_1 }; AddSidebarEntry("Developer", "Scene Visibility", 1); + AddWidget(path, "Draw Sky", WIDGET_CVAR_CHECKBOX) + .CVar("gDrawSky") + .Options(UIWidgets::CheckboxOptions().DefaultValue(true)); + + AddWidget(path, "Draw Sky Actors", WIDGET_CVAR_CHECKBOX) + .CVar("gDrawSkyActors") + .Options(UIWidgets::CheckboxOptions().DefaultValue(true)); + AddWidget(path, "Draw Track Geometry", WIDGET_CVAR_CHECKBOX) .CVar("gDrawTrackGeometry") .Options(UIWidgets::CheckboxOptions().DefaultValue(true)); |
