From af81bad1f34ee6af52a70ff8bf7ad4e1ee624a93 Mon Sep 17 00:00:00 2001 From: MegaMech Date: Tue, 15 Oct 2024 18:54:38 -0600 Subject: [PATCH] [modding] Add Actors (#113) * fix * Add Actors * Refactor * Update Game.cpp --- CMakeLists.txt | 1 - src/actors/banana/update.inc.c | 4 +- src/code_80005FD0.h | 2 +- src/engine/Actor.cpp | 13 + src/engine/Actor.h | 36 ++ src/engine/GameObject.cpp | 5 +- src/engine/GameObject.h | 5 +- src/engine/TrainCrossing.cpp | 1 - src/engine/World.cpp | 39 +- src/engine/World.h | 34 +- src/engine/actors/ABanana.cpp | 60 ++++ src/engine/actors/ABanana.h | 21 ++ src/engine/actors/AWarioSign.cpp | 42 +++ src/engine/actors/AWarioSign.h | 19 + src/engine/courses/BansheeBoardwalk.cpp | 14 +- src/engine/courses/BowsersCastle.cpp | 14 +- src/engine/courses/ChocoMountain.cpp | 14 +- src/engine/courses/DKJungle.cpp | 14 +- src/engine/courses/FrappeSnowland.cpp | 14 +- src/engine/courses/KalimariDesert.cpp | 14 +- src/engine/courses/KoopaTroopaBeach.cpp | 14 +- src/engine/courses/LuigiRaceway.cpp | 14 +- src/engine/courses/MarioRaceway.cpp | 14 +- src/engine/courses/MooMooFarm.cpp | 14 +- src/engine/courses/PodiumCeremony.cpp | 14 +- src/engine/courses/RainbowRoad.cpp | 14 +- src/engine/courses/RoyalRaceway.cpp | 14 +- src/engine/courses/SherbetLand.cpp | 14 +- src/engine/courses/TestCourse.cpp | 14 +- src/engine/courses/ToadsTurnpike.cpp | 14 +- src/engine/courses/WarioStadium.cpp | 45 ++- src/engine/courses/YoshiValley.cpp | 14 +- src/engine/structs.h | 92 ----- src/engine/vehicles/Train.cpp | 1 - src/main.c | 5 +- src/port/Game.cpp | 460 ++++++++++++------------ src/racing/actors.c | 2 + 37 files changed, 637 insertions(+), 488 deletions(-) create mode 100644 src/engine/Actor.cpp create mode 100644 src/engine/Actor.h create mode 100644 src/engine/actors/ABanana.cpp create mode 100644 src/engine/actors/ABanana.h create mode 100644 src/engine/actors/AWarioSign.cpp create mode 100644 src/engine/actors/AWarioSign.h delete mode 100644 src/engine/structs.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 71b28a810..175cf6439 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -585,7 +585,6 @@ add_custom_target( WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${TORCH_EXECUTABLE} header -o baserom.us.z64 COMMAND ${TORCH_EXECUTABLE} otr baserom.us.z64 - COMMAND ${TORCH_EXECUTABLE} code baserom.us.z64 COMMAND ${TORCH_EXECUTABLE} pack assets ship.otr COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/spaghetti.otr" "${CMAKE_BINARY_DIR}/spaghetti.otr" COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/ship.otr" "${CMAKE_BINARY_DIR}/ship.otr" diff --git a/src/actors/banana/update.inc.c b/src/actors/banana/update.inc.c index eb808aed1..cb21a3166 100644 --- a/src/actors/banana/update.inc.c +++ b/src/actors/banana/update.inc.c @@ -28,7 +28,7 @@ void update_actor_banana(struct BananaActor* banana) { f32 unkY; f32 unkZ; - player = &gPlayers[banana->rot[0]]; + player = &gPlayers[banana->playerId]; switch (banana->state) { case HELD_BANANA: temp_f2 = player->pos[0] - banana->pos[0]; @@ -54,7 +54,7 @@ void update_actor_banana(struct BananaActor* banana) { if (gDemoMode) { controller = gControllerOne; } else { - controller = &gControllers[banana->rot[0]]; + controller = &gControllers[banana->playerId]; } if ((controller->buttonDepressed & Z_TRIG) != 0) { controller->buttonDepressed &= ~Z_TRIG; diff --git a/src/code_80005FD0.h b/src/code_80005FD0.h index 1976cb8ae..354cc2ec3 100644 --- a/src/code_80005FD0.h +++ b/src/code_80005FD0.h @@ -152,7 +152,7 @@ void kart_ai_behaviour_end(s32, Player*); void kart_ai_behaviour(s32); void func_80011EC0(s32, Player*, s32, u16); -void generate_train_waypoints(const char*); +void generate_train_waypoints(void); void generate_ferry_waypoints(void); void spawn_vehicle_on_road(Vec3f position, Vec3s rotation, Vec3f velocity, s32 waypointIndex, s32 someMultiplierTheSequel, f32 speed); void spawn_course_vehicles(void); diff --git a/src/engine/Actor.cpp b/src/engine/Actor.cpp new file mode 100644 index 000000000..1749d4600 --- /dev/null +++ b/src/engine/Actor.cpp @@ -0,0 +1,13 @@ +#include + +#include "Actor.h" + + //GameActor() + +AActor::AActor() {} + + // Virtual functions to be overridden by derived classes +void AActor::Tick() { } +void AActor::Draw(Camera *camera) { } +void AActor::Collision() {} +void AActor::Destroy() { } \ No newline at end of file diff --git a/src/engine/Actor.h b/src/engine/Actor.h new file mode 100644 index 000000000..53b5cfa4d --- /dev/null +++ b/src/engine/Actor.h @@ -0,0 +1,36 @@ +#pragma once + +#include + +extern "C" { +#include "macros.h" +#include "main.h" +#include "camera.h" +#include "common_structs.h" +} + +class AActor { +public: + uint8_t uuid[16]; + + /* 0x00 */ s16 Type; + /* 0x02 */ s16 Flags; + /* 0x04 */ s16 Unk_04; + /* 0x06 */ s16 State; + /* 0x08 */ f32 Unk_08; + /* 0x0C */ f32 BoundingBoxSize; + /* 0x10 */ Vec3s Rot = {0, 0, 0}; + /* 0x16 */ s16 Unk_16; + /* 0x18 */ Vec3f Pos; + /* 0x24 */ Vec3f Velocity = {0, 0, 0}; + /* 0x30 */ Collision Unk30; + + virtual ~AActor() = default; // Virtual destructor for proper cleanup in derived classes + + explicit AActor(); + + virtual void Tick(); + virtual void Draw(Camera*); + virtual void Collision(); + virtual void Destroy(); +}; diff --git a/src/engine/GameObject.cpp b/src/engine/GameObject.cpp index 371d85073..eb2127fcc 100644 --- a/src/engine/GameObject.cpp +++ b/src/engine/GameObject.cpp @@ -13,9 +13,8 @@ extern "C" { GameObject::GameObject() {} // Virtual functions to be overridden by derived classes -void GameObject::Init() { } -void GameObject::Update() { } -void GameObject::Render(Camera* camera) { } +void GameObject::Tick() { } +void GameObject::Draw(Camera* camera) { } void GameObject::Collision() {} void GameObject::Expire() { } void GameObject::Destroy() { } diff --git a/src/engine/GameObject.h b/src/engine/GameObject.h index ae5b530b4..19d5301cd 100644 --- a/src/engine/GameObject.h +++ b/src/engine/GameObject.h @@ -16,9 +16,8 @@ public: explicit GameObject(); - virtual void Init(); - virtual void Update(); - virtual void Render(Camera* camera); + virtual void Tick(); + virtual void Draw(Camera* camera); virtual void Collision(); virtual void Expire(); virtual void Destroy(); diff --git a/src/engine/TrainCrossing.cpp b/src/engine/TrainCrossing.cpp index 3216e7945..13232c962 100644 --- a/src/engine/TrainCrossing.cpp +++ b/src/engine/TrainCrossing.cpp @@ -53,7 +53,6 @@ void TrainCrossing::AICrossingBehaviour(s32 playerId) { (set_vehicle_render_distance_flags(gPlayers[playerId].pos, TRAIN_CROSSING_AI_DISTANCE, 0))) { if ((OnTriggered == 1) && ((Timer) > FRAMES_SINCE_CROSSING_ACTIVATED)) { if ((sSomeNearestWaypoint > WaypointMin) && (sSomeNearestWaypoint < WaypointMax)) { - printf("STOP AI\n"); bStopAICrossing[playerId] = 1; } } diff --git a/src/engine/World.cpp b/src/engine/World.cpp index a27ee2540..346446bf2 100644 --- a/src/engine/World.cpp +++ b/src/engine/World.cpp @@ -172,21 +172,46 @@ void World::PreviousCourse() { gWorldInstance.CurrentCourse = Courses[CourseIndex]; } -Object* World::SpawnObject(std::unique_ptr object) { +Object* World::AddObject(std::unique_ptr object) { GameObject* rawPtr = object.get(); - this->GameObjects.push_back(std::move(object)); + GameObjects.push_back(std::move(object)); return &rawPtr->o; } -void World::UpdateObjects() { - for (const auto& object : this->GameObjects) { - object->Update(); +AActor* World::AddActor(std::unique_ptr actor) { + AActor* rawPtr = actor.get(); + Actors.push_back(std::move(actor)); + return rawPtr; +} + +void World::TickActors() { + for (auto& actor : Actors) { + actor->Tick(); } } -void World::RenderObjects(Camera *camera) { +void World::DrawActors(Camera* camera) { + for (auto& actor : Actors) { + actor->Draw(camera); + } +} + +void RemoveExpiredActors() { + //Actors.erase( + // std::remove_if(Actors.begin(), Actors.end(), + // [](const std::unique_ptr& actor) { return actor->uuid == 0; }), // Example condition + // Actors.end()); +} + +void World::TickObjects() { for (const auto& object : this->GameObjects) { - object->Render(camera); + object->Tick(); + } +} + +void World::DrawObjects(Camera *camera) { + for (const auto& object : this->GameObjects) { + object->Draw(camera); } } diff --git a/src/engine/World.h b/src/engine/World.h index 8b99d796a..6345d9e6e 100644 --- a/src/engine/World.h +++ b/src/engine/World.h @@ -8,6 +8,7 @@ #include "vehicles/Car.h" #include "TrainCrossing.h" #include +#include "Actor.h" extern "C" { #include "camera.h" @@ -64,30 +65,31 @@ class World { } Properties; public: - //Actor actors; - virtual ~World() = default; explicit World(); - // virtual Actor* SpawnActor(std::unique_ptr actor); + AActor* AddActor(std::unique_ptr actor); + void TickActors(); + void DrawActors(Camera* camera); + void RemoveExpiredActors(); - virtual Object* SpawnObject(std::unique_ptr object); + Object* AddObject(std::unique_ptr object); - virtual CProperties* GetCourseProps(); - virtual void UpdateObjects(); - virtual void RenderObjects(Camera *camera); - virtual void ExpiredObjects(); - virtual void DestroyObjects(); - virtual Object *GetObjectByIndex(size_t); + CProperties* GetCourseProps(); + void TickObjects(); + void DrawObjects(Camera *camera); + void ExpiredObjects(); + void DestroyObjects(); + Object *GetObjectByIndex(size_t); Cup* AddCup(const char* name, std::vector courses); Cup* GetCup(); const char* GetCupName(); - virtual u32 GetCupIndex(); - virtual void SetCupIndex(int16_t courseId); - virtual u32 NextCup(); - virtual u32 PreviousCup(); - virtual void SetCourseFromCup(); + u32 GetCupIndex(); + void SetCupIndex(int16_t courseId); + u32 NextCup(); + u32 PreviousCup(); + void SetCourseFromCup(); void SetCup(); World* GetWorld(void); @@ -107,7 +109,7 @@ public: size_t CupIndex = 1; std::vector> GameObjects; - // std::vector> GameActors; + std::vector> Actors; void AddBoat(f32 speed, uint32_t waypoint); void AddTrain(size_t numCarriages, f32 speed, uint32_t waypoint); diff --git a/src/engine/actors/ABanana.cpp b/src/engine/actors/ABanana.cpp new file mode 100644 index 000000000..c26efca24 --- /dev/null +++ b/src/engine/actors/ABanana.cpp @@ -0,0 +1,60 @@ +#include + +#include "ABanana.h" +#include "engine/Actor.h" + +extern "C" { +#include "macros.h" +#include "actor_types.h" +void update_actor_banana(struct BananaActor*); +void render_actor_banana(Camera*, float[4][4], struct BananaActor*); +} + +ABanana::ABanana(uint16_t playerId, const float pos[3], const s16 rot[3], const float velocity[3]) { + // Initialize the BananaActor's position, rotation, and velocity + std::copy(pos, pos + 3, Pos); + //std::copy(rot, rot + 3, this->a.rot); + std::copy(velocity, velocity + 3, Velocity); + + Type = 6; // ACTOR_BANANA + Flags = -0x8000; + Unk_04 = 20; + State = HELD_BANANA; + + PlayerId = playerId; + + //this->a.unk_08 = 0.0f; + Flags |= 0x4000 | 0x1000; + BoundingBoxSize = 2.0f; + + Unk30.meshIndexYX = 5000; + Unk30.meshIndexZX = 5000; + Unk30.meshIndexZY = 5000; + Unk30.unk30 = 0; + Unk30.unk32 = 0; + Unk30.unk34 = 0; + Unk30.surfaceDistance[0] = 0; + Unk30.surfaceDistance[1] = 0; + Unk30.surfaceDistance[2] = 0; + Unk30.unk48[0] = 0; + Unk30.unk48[1] = 0; + Unk30.unk48[2] = 1.0f; + Unk30.unk54[0] = 1.0f; + Unk30.unk54[1] = 0.0f; + Unk30.unk54[2] = 0.0f; + Unk30.orientationVector[0] = 0.0f; + Unk30.orientationVector[1] = 1.0f; + Unk30.orientationVector[2] = 0.0f; +} + +void ABanana::Tick() { + update_actor_banana((BananaActor*)this); +} + +void ABanana::Draw(Camera *camera) { + render_actor_banana(camera, NULL, (BananaActor*)this); +} +void ABanana::Collision() { } +void ABanana::Destroy() { } + +//void ABanana::Held() {} diff --git a/src/engine/actors/ABanana.h b/src/engine/actors/ABanana.h new file mode 100644 index 000000000..5ef8900d6 --- /dev/null +++ b/src/engine/actors/ABanana.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include "engine/Actor.h" + +class ABanana : public AActor { +public: + + uint16_t PlayerId; + + // Constructor + ABanana(uint16_t playerId, const float pos[3], const s16 rot[3], const float velocity[3]); + + virtual ~ABanana() override = default; + + // Virtual functions to be overridden by derived classes + virtual void Tick() override; + virtual void Draw(Camera*) override; + virtual void Collision() override; + virtual void Destroy() override; +}; diff --git a/src/engine/actors/AWarioSign.cpp b/src/engine/actors/AWarioSign.cpp new file mode 100644 index 000000000..2dd8a5fc9 --- /dev/null +++ b/src/engine/actors/AWarioSign.cpp @@ -0,0 +1,42 @@ +#include "AWarioSign.h" + +#include +#include + +extern "C" { +#include "common_structs.h" +#include "math_util.h" +#include "main.h" +} + +AWarioSign::AWarioSign(Vec3f pos) { + Pos[0] = pos[0]; + Pos[1] = pos[1]; + Pos[2] = pos[2]; +} + + // Virtual functions to be overridden by derived classes +void AWarioSign::Tick() { + Rot[1] += 0xB6; +} + +void AWarioSign::Draw(Camera *camera) { + Mat4 sp38; + f32 unk = + is_within_render_distance(camera->pos, Pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 16000000.0f); + + if (CVarGetInteger("gNoCulling", 0) == 1) { + unk = MAX(unk, 0.0f); + } + + if (!(unk < 0.0f)) { + gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); + gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); + + mtxf_pos_rotation_xyz(sp38, Pos, Rot); + if (render_set_position(sp38, 0) != 0) { + + gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_wario_stadium_dl_sign); + } + } +} diff --git a/src/engine/actors/AWarioSign.h b/src/engine/actors/AWarioSign.h new file mode 100644 index 000000000..31d9b9434 --- /dev/null +++ b/src/engine/actors/AWarioSign.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include "engine/Actor.h" + +extern "C" { +#include "common_structs.h" +} + +class AWarioSign : public AActor { +public: + + + virtual ~AWarioSign() = default; + explicit AWarioSign(Vec3f pos); + + virtual void Tick() override; + virtual void Draw(Camera*) override; +}; diff --git a/src/engine/courses/BansheeBoardwalk.cpp b/src/engine/courses/BansheeBoardwalk.cpp index c54f94f35..0e94885c7 100644 --- a/src/engine/courses/BansheeBoardwalk.cpp +++ b/src/engine/courses/BansheeBoardwalk.cpp @@ -191,13 +191,13 @@ void BansheeBoardwalk::WhatDoesThisDoAI(Player* player, int8_t playerId) { } void BansheeBoardwalk::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/BowsersCastle.cpp b/src/engine/courses/BowsersCastle.cpp index 544d7f1d6..5e1593b0c 100644 --- a/src/engine/courses/BowsersCastle.cpp +++ b/src/engine/courses/BowsersCastle.cpp @@ -215,13 +215,13 @@ void BowsersCastle::WhatDoesThisDoAI(Player* player, int8_t playerId) { } void BowsersCastle::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/ChocoMountain.cpp b/src/engine/courses/ChocoMountain.cpp index aad4d8d3d..fe7b32281 100644 --- a/src/engine/courses/ChocoMountain.cpp +++ b/src/engine/courses/ChocoMountain.cpp @@ -168,13 +168,13 @@ void ChocoMountain::WhatDoesThisDoAI(Player* player, int8_t playerId) { } void ChocoMountain::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/DKJungle.cpp b/src/engine/courses/DKJungle.cpp index dc3dfa3f2..f47252daa 100644 --- a/src/engine/courses/DKJungle.cpp +++ b/src/engine/courses/DKJungle.cpp @@ -196,13 +196,13 @@ void DKJungle::WhatDoesThisDoAI(Player* player, int8_t playerId) { } void DKJungle::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/FrappeSnowland.cpp b/src/engine/courses/FrappeSnowland.cpp index a9da71586..28a5ef15e 100644 --- a/src/engine/courses/FrappeSnowland.cpp +++ b/src/engine/courses/FrappeSnowland.cpp @@ -189,13 +189,13 @@ void FrappeSnowland::WhatDoesThisDo(Player* player, int8_t playerId) {} void FrappeSnowland::WhatDoesThisDoAI(Player* player, int8_t playerId) {} void FrappeSnowland::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/KalimariDesert.cpp b/src/engine/courses/KalimariDesert.cpp index db155f91e..691e4c112 100644 --- a/src/engine/courses/KalimariDesert.cpp +++ b/src/engine/courses/KalimariDesert.cpp @@ -184,13 +184,13 @@ void KalimariDesert::WhatDoesThisDo(Player* player, int8_t playerId) {} void KalimariDesert::WhatDoesThisDoAI(Player* player, int8_t playerId) {} void KalimariDesert::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/KoopaTroopaBeach.cpp b/src/engine/courses/KoopaTroopaBeach.cpp index 8cf28a1d9..35532b79c 100644 --- a/src/engine/courses/KoopaTroopaBeach.cpp +++ b/src/engine/courses/KoopaTroopaBeach.cpp @@ -183,13 +183,13 @@ void KoopaTroopaBeach::WhatDoesThisDo(Player* player, int8_t playerId) {} void KoopaTroopaBeach::WhatDoesThisDoAI(Player* player, int8_t playerId) {} void KoopaTroopaBeach::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/LuigiRaceway.cpp b/src/engine/courses/LuigiRaceway.cpp index 173f3ef56..c81ccb453 100644 --- a/src/engine/courses/LuigiRaceway.cpp +++ b/src/engine/courses/LuigiRaceway.cpp @@ -190,13 +190,13 @@ void LuigiRaceway::WhatDoesThisDoAI(Player* player, int8_t playerId) { } void LuigiRaceway::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/MarioRaceway.cpp b/src/engine/courses/MarioRaceway.cpp index 3aff3c6c1..4d4e2725f 100644 --- a/src/engine/courses/MarioRaceway.cpp +++ b/src/engine/courses/MarioRaceway.cpp @@ -195,13 +195,13 @@ void MarioRaceway::WhatDoesThisDoAI(Player* player, int8_t playerId) { } void MarioRaceway::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/MooMooFarm.cpp b/src/engine/courses/MooMooFarm.cpp index f0d9b3978..bc9889e10 100644 --- a/src/engine/courses/MooMooFarm.cpp +++ b/src/engine/courses/MooMooFarm.cpp @@ -240,13 +240,13 @@ void MooMooFarm::WhatDoesThisDoAI(Player* player, int8_t playerId) { } void MooMooFarm::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/PodiumCeremony.cpp b/src/engine/courses/PodiumCeremony.cpp index a0c66bd09..b42c2ec8a 100644 --- a/src/engine/courses/PodiumCeremony.cpp +++ b/src/engine/courses/PodiumCeremony.cpp @@ -166,13 +166,13 @@ void PodiumCeremony::WhatDoesThisDoAI(Player* player, int8_t playerId) { } void PodiumCeremony::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/RainbowRoad.cpp b/src/engine/courses/RainbowRoad.cpp index 1cde1cf94..6f4a0db50 100644 --- a/src/engine/courses/RainbowRoad.cpp +++ b/src/engine/courses/RainbowRoad.cpp @@ -160,13 +160,13 @@ void RainbowRoad::WhatDoesThisDo(Player* player, int8_t playerId) {} void RainbowRoad::WhatDoesThisDoAI(Player* player, int8_t playerId) {} void RainbowRoad::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/RoyalRaceway.cpp b/src/engine/courses/RoyalRaceway.cpp index 355012e2e..c83b2f196 100644 --- a/src/engine/courses/RoyalRaceway.cpp +++ b/src/engine/courses/RoyalRaceway.cpp @@ -181,13 +181,13 @@ void RoyalRaceway::WhatDoesThisDoAI(Player* player, int8_t playerId) { } void RoyalRaceway::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/SherbetLand.cpp b/src/engine/courses/SherbetLand.cpp index 0aee5147a..538b96c2a 100644 --- a/src/engine/courses/SherbetLand.cpp +++ b/src/engine/courses/SherbetLand.cpp @@ -149,13 +149,13 @@ void SherbetLand::WhatDoesThisDo(Player* player, int8_t playerId) {} void SherbetLand::WhatDoesThisDoAI(Player* player, int8_t playerId) {} void SherbetLand::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/TestCourse.cpp b/src/engine/courses/TestCourse.cpp index 7ce8f9cca..efc8f0834 100644 --- a/src/engine/courses/TestCourse.cpp +++ b/src/engine/courses/TestCourse.cpp @@ -286,13 +286,13 @@ void TestCourse::WhatDoesThisDoAI(Player* player, int8_t playerId) { } void TestCourse::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/ToadsTurnpike.cpp b/src/engine/courses/ToadsTurnpike.cpp index cb6420cba..5bba22c10 100644 --- a/src/engine/courses/ToadsTurnpike.cpp +++ b/src/engine/courses/ToadsTurnpike.cpp @@ -160,13 +160,13 @@ void ToadsTurnpike::WhatDoesThisDoAI(Player* player, int8_t playerId) { } void ToadsTurnpike::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/WarioStadium.cpp b/src/engine/courses/WarioStadium.cpp index 6778c1033..7d299e703 100644 --- a/src/engine/courses/WarioStadium.cpp +++ b/src/engine/courses/WarioStadium.cpp @@ -8,6 +8,7 @@ #include "World.h" #include "BombKart.h" #include "assets/wario_stadium_data.h" +#include "engine/actors/AWarioSign.h" extern "C" { #include "main.h" @@ -111,15 +112,27 @@ void WarioStadium::SpawnActors() { Vec3s rotation = { 0, 0, 0 }; spawn_all_item_boxes((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_wario_stadium_item_box_spawns)); - vec3f_set(position, -131.0f, 83.0f, 286.0f); - position[0] *= gCourseDirection; - add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN); - vec3f_set(position, -2353.0f, 72.0f, -1608.0f); - position[0] *= gCourseDirection; - add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN); - vec3f_set(position, -2622.0f, 79.0f, 739.0f); - position[0] *= gCourseDirection; - add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN); + // vec3f_set(position, -131.0f, 83.0f, 286.0f); + // position[0] *= gCourseDirection; + // add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN); + // vec3f_set(position, -2353.0f, 72.0f, -1608.0f); + // position[0] *= gCourseDirection; + // add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN); + // vec3f_set(position, -2622.0f, 79.0f, 739.0f); + // position[0] *= gCourseDirection; + // add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN); + + Vec3f pos = {-131.0f, 83.0f, 286.0f}; + pos[0] *= gCourseDirection; + gWorldInstance.AddActor(std::make_unique(pos)); + + Vec3f pos2 = {-2353.0f, 72.0f, -1608.0f}; + pos2[0] *= gCourseDirection; + gWorldInstance.AddActor(std::make_unique(pos2)); + + Vec3f pos3 = {-2622.0f, 79.0f, 739.0f}; + pos3[0] *= gCourseDirection; + gWorldInstance.AddActor(std::make_unique(pos3)); } void WarioStadium::Init() {} @@ -157,13 +170,13 @@ void WarioStadium::WhatDoesThisDo(Player* player, int8_t playerId) {} void WarioStadium::WhatDoesThisDoAI(Player* player, int8_t playerId) {} void WarioStadium::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(40, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(100, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(265, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(285, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(420, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/courses/YoshiValley.cpp b/src/engine/courses/YoshiValley.cpp index 07af8bd1a..796292985 100644 --- a/src/engine/courses/YoshiValley.cpp +++ b/src/engine/courses/YoshiValley.cpp @@ -171,13 +171,13 @@ void YoshiValley::WhatDoesThisDo(Player* player, int8_t playerId) {} void YoshiValley::WhatDoesThisDoAI(Player* player, int8_t playerId) {} void YoshiValley::SpawnBombKarts() { - gWorldInstance.SpawnObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); - gWorldInstance.SpawnObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(140, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(165, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(330, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(550, 1, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(595, 3, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); + gWorldInstance.AddObject(std::make_unique(0, 0, 0.8333333, 0, 0, 0, 0)); } // Positions the finishline on the minimap diff --git a/src/engine/structs.h b/src/engine/structs.h deleted file mode 100644 index 7b9b8f5c9..000000000 --- a/src/engine/structs.h +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once - -#include - -typedef float Vec3f[3]; -typedef unsigned short Vec3su[3]; - -typedef struct { - /* 0x00 */ u16 unk30; - /* 0x02 */ u16 unk32; - /* 0x04 */ u16 unk34; - /* 0x06 */ u16 meshIndexYX; - /* 0x08 */ u16 meshIndexZY; - // This may be an index to the tilemap? - /* 0x0A */ u16 meshIndexZX; - /* 0x0C */ float surfaceDistance[3]; // Appears to be distance from actor to surface for zx, yx, and zy planes. - /* 0x18 */ float unk48[3]; - /* 0x24 */ float unk54[3]; - /* 0x30 */ float orientationVector[3]; - /* 0x3C */ f32 unk6C; -} Collision; - -struct Actor { - /* 0x00 */ s16 type; - /* 0x02 */ s16 flags; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 state; - /* 0x08 */ f32 unk_08; - /* 0x0C */ f32 boundingBoxSize; - /* 0x10 */ s16 rot[3]; - /* 0x16 */ s16 unk_16; - /* 0x18 */ Vec3f pos; - /* 0x24 */ Vec3f velocity; - /* 0x30 */ Collision unk30; -}; // size = 0x70 - -struct BananaActor { - /* 0x00 */ s16 type; - /* 0x02 */ s16 flags; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 state; - /* 0x08 */ s16 parentIndex; - /* 0x0A */ s16 bananaId; // ? Appears to indiciate which banana of the bunch this one is - /* 0x0C */ f32 boundingBoxSize; - /* 0x10 */ s16 playerId; // Id of the player that owns this banana - /* 0x12 */ s16 elderIndex; // Index in gActorList of the next-oldest banana in the bunch - /* 0x14 */ s16 youngerIndex; // Index in gActorList of the next-youngest banana in the bunch - /* 0x16 */ s16 unk_16; - /* 0x18 */ float pos[3]; - /* 0x24 */ float velocity[3]; - /* 0x30 */ Collision unk30; -}; // size = 0x70 - -typedef struct { - f32 unk_0; - s16 unk_4; - s16 unk_6; - s16 unk_8; -} UnkCameraInner; - -typedef struct { - /* 0x00 */ float pos[3]; - /* 0x0C */ Vec3f lookAt; - // This is expected to be a normalized vector, indicates what direction is "up" for the camera - /* 0x18 */ Vec3f up; - // I think these are the "nautical angles" between pos and lookAt - // rot[0] = roll? Does nothing?, rot[1] = yaw, rot[2] = pitch - /* 0x24 */ s16 rot[3]; - /* 0x2A */ u16 someBitFlags; - /* 0x2C */ s16 unk_2C; - /* 0x2E */ s16 unk_2E; - /* 0x30 */ Vec3f unk_30; - /* 0x3C */ Vec3f unk_3C; - /* 0x48 */ s32 unk_48; - /* 0x4C */ s32 unk_4C; - /* 0x50 */ s32 unk_50; - /* 0x54 */ Collision collision; - // When you hit a wall (or another driver) the camera's pos and lookAt bounce up and down. This is the velocity(?) - // of that bouncing - /* 0x94 */ UnkCameraInner unk_94; - // Timer for wall-hit bounce. Counts up instead of down - /* 0xA0 */ f32 unk_A0; - /* 0xA4 */ s32 unk_A4; - /* 0xA8 */ s32 unk_A8; - /* 0xAC */ s16 unk_AC; - // Id of the player the camera is following. - /* 0xAE */ s16 playerId; - // Seems related to camera movement during drifting - /* 0xB0 */ s16 unk_B0; - /* 0xB2 */ s16 unk_B2; - /* 0xB4 */ f32 unk_B4; -} Camera; /* size = 0xB8 */ diff --git a/src/engine/vehicles/Train.cpp b/src/engine/vehicles/Train.cpp index 85391ec53..e775563f7 100644 --- a/src/engine/vehicles/Train.cpp +++ b/src/engine/vehicles/Train.cpp @@ -200,7 +200,6 @@ void ATrain::Tick() { smokePos[2] = (f32) ((f64) Locomotive.position[2] + 25.0); adjust_position_by_angle(smokePos, Locomotive.position, orientationYUpdate); //spawn_train_smoke(Index, smokePos, 1.1f); - printf("\nSMOKE HERE: %d\n\n", Index); AddSmoke(Index, smokePos, 1.1f); } diff --git a/src/main.c b/src/main.c index b527951c0..f2a2a21ff 100644 --- a/src/main.c +++ b/src/main.c @@ -670,6 +670,7 @@ void race_logic_loop(void) { func_8028F474(); func_80059AC8(); update_course_actors(); + CourseManager_TickActors(); func_802966A0(); func_8028FCBC(); } @@ -966,7 +967,6 @@ void game_state_handler(void) { credits_loop(); break; } - call_render_hook(); } void interrupt_gfx_sptask(void) { @@ -1279,6 +1279,9 @@ void thread5_iteration(void) { FB_CreateFramebuffers(); read_controllers(); game_state_handler(); + + call_render_hook(); + end_master_display_list(); display_and_vsync(); } diff --git a/src/port/Game.cpp b/src/port/Game.cpp index 589f2863c..11d78c73e 100644 --- a/src/port/Game.cpp +++ b/src/port/Game.cpp @@ -139,66 +139,66 @@ void CustomEngineInit() { extern "C" { -World* GetWorld(void) { - return &gWorldInstance; -} - -u32 WorldNextCup(void) { - return gWorldInstance.NextCup(); -} - -u32 WorldPreviousCup(void) { - return gWorldInstance.PreviousCup(); -} - -void SetCupIndex(int16_t courseId) { - gWorldInstance.SetCupIndex(courseId); -} - -void SetCup() { - gWorldInstance.SetCup(); -} - -u32 GetCupIndex(void) { - printf("Cup Index: %d\n", gWorldInstance.GetCupIndex()); - return gWorldInstance.GetCupIndex(); -} - -const char* GetCupName(void) { - return gWorldInstance.Cups[gWorldInstance.CupIndex]->Name; -} - -void LoadCourse() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->Load(); + World* GetWorld(void) { + return &gWorldInstance; } -} -CProperties* GetCoursePropsA() { - return (CProperties*) gWorldInstance.GetCourseProps(); -} - -size_t GetCourseIndex() { - return gWorldInstance.CourseIndex; -} - -void SetCourse(const char* name) { - gWorldInstance.SetCourse(name); -} - -void NextCourse() { - gWorldInstance.NextCourse(); -} - -void PreviousCourse() { - gWorldInstance.PreviousCourse(); -} - -void CourseManager_SpawnVehicles() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->SpawnVehicles(); + u32 WorldNextCup(void) { + return gWorldInstance.NextCup(); + } + + u32 WorldPreviousCup(void) { + return gWorldInstance.PreviousCup(); + } + + void SetCupIndex(int16_t courseId) { + gWorldInstance.SetCupIndex(courseId); + } + + void SetCup() { + gWorldInstance.SetCup(); + } + + u32 GetCupIndex(void) { + printf("Cup Index: %d\n", gWorldInstance.GetCupIndex()); + return gWorldInstance.GetCupIndex(); + } + + const char* GetCupName(void) { + return gWorldInstance.Cups[gWorldInstance.CupIndex]->Name; + } + + void LoadCourse() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->Load(); + } + } + + CProperties* GetCoursePropsA() { + return (CProperties*) gWorldInstance.GetCourseProps(); + } + + size_t GetCourseIndex() { + return gWorldInstance.CourseIndex; + } + + void SetCourse(const char* name) { + gWorldInstance.SetCourse(name); + } + + void NextCourse() { + gWorldInstance.NextCourse(); + } + + void PreviousCourse() { + gWorldInstance.PreviousCourse(); + } + + void CourseManager_SpawnVehicles() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->SpawnVehicles(); + } } -} void CourseManager_VehiclesSpawn() { for (auto& vehicle : gWorldInstance.Vehicles) { @@ -231,7 +231,6 @@ void CourseManager_SpawnVehicles() { } } } -} void CourseManager_ResetVehicles(void) { gWorldInstance.ResetVehicles(); @@ -273,247 +272,258 @@ void CourseManager_SpawnVehicles() { gWorldInstance.CurrentCourse->LoadTextures(); } } -} -void CourseManager_RenderCourse(struct UnkStruct_800DC5EC* arg0) { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->Render(arg0); + void CourseManager_RenderCourse(struct UnkStruct_800DC5EC* arg0) { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->Render(arg0); + } } -} -void CourseManager_RenderCredits() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->RenderCredits(); + void CourseManager_RenderCredits() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->RenderCredits(); + } } -} -void CourseManager_SpawnActors() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->SpawnActors(); + void CourseManager_TickActors() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.TickActors(); + } } -} -void CourseManager_InitClouds() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->InitClouds(); + void CourseManager_DrawActors(Camera* camera) { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.DrawActors(camera); + } } -} -void CourseManager_UpdateClouds(s32 arg0, Camera* camera) { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->UpdateClouds(arg0, camera); + void CourseManager_SpawnActors() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->SpawnActors(); + } } -} -void CourseManager_Waypoints(Player* player, int8_t playerId) { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->Waypoints(player, playerId); + void CourseManager_InitClouds() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->InitClouds(); + } } -} -void CourseManager_GenerateCollision() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->GenerateCollision(); + void CourseManager_UpdateClouds(s32 arg0, Camera* camera) { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->UpdateClouds(arg0, camera); + } } -} -void CourseManager_SomeCollisionThing(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, - f32* arg6, f32* arg7) { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->SomeCollisionThing(player, arg1, arg2, arg3, arg4, arg5, arg6, arg7); + void CourseManager_Waypoints(Player* player, int8_t playerId) { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->Waypoints(player, playerId); + } } -} -void CourseManager_MinimapSettings() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->MinimapSettings(); + void CourseManager_GenerateCollision() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->GenerateCollision(); + } } -} -void CourseManager_InitCourseObjects() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->InitCourseObjects(); + void CourseManager_SomeCollisionThing(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, + f32* arg6, f32* arg7) { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->SomeCollisionThing(player, arg1, arg2, arg3, arg4, arg5, arg6, arg7); + } } -} -void CourseManager_UpdateCourseObjects() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->UpdateCourseObjects(); + void CourseManager_MinimapSettings() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->MinimapSettings(); + } } -} -void CourseManager_RenderCourseObjects(s32 cameraId) { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->RenderCourseObjects(cameraId); + void CourseManager_InitCourseObjects() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->InitCourseObjects(); + } } -} -void CourseManager_SomeSounds() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->SomeSounds(); + void CourseManager_UpdateCourseObjects() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->UpdateCourseObjects(); + } } -} -void CourseManager_SetCourseVtxColours() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->SetCourseVtxColours(); + void CourseManager_RenderCourseObjects(s32 cameraId) { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->RenderCourseObjects(cameraId); + } } -} -void CourseManager_WhatDoesThisDo(Player* player, int8_t playerId) { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->WhatDoesThisDo(player, playerId); + void CourseManager_SomeSounds() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->SomeSounds(); + } } -} -void CourseManager_WhatDoesThisDoAI(Player* player, int8_t playerId) { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->WhatDoesThisDoAI(player, playerId); + void CourseManager_SetCourseVtxColours() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->SetCourseVtxColours(); + } } -} -void CourseManager_MinimapFinishlinePosition() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->MinimapFinishlinePosition(); + void CourseManager_WhatDoesThisDo(Player* player, int8_t playerId) { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->WhatDoesThisDo(player, playerId); + } } -} -void CourseManager_SetStaffGhost() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->SetStaffGhost(); + void CourseManager_WhatDoesThisDoAI(Player* player, int8_t playerId) { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->WhatDoesThisDoAI(player, playerId); + } } -} -CProperties* CourseManager_GetProps() { - if (gWorldInstance.CurrentCourse) { - return (CProperties*) &gWorldInstance.CurrentCourse->Props; + void CourseManager_MinimapFinishlinePosition() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->MinimapFinishlinePosition(); + } } -} -void CourseManager_SpawnBombKarts() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->SpawnBombKarts(); + void CourseManager_SetStaffGhost() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->SetStaffGhost(); + } } -} -void CourseManager_Water() { - if (gWorldInstance.CurrentCourse) { - gWorldInstance.CurrentCourse->Water(); + CProperties* CourseManager_GetProps() { + if (gWorldInstance.CurrentCourse) { + return (CProperties*) &gWorldInstance.CurrentCourse->Props; + } } -} -size_t GetCupCursorPosition() { - return gWorldInstance.CurrentCup->CursorPosition; -} + void CourseManager_SpawnBombKarts() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->SpawnBombKarts(); + } + } + + void CourseManager_Water() { + if (gWorldInstance.CurrentCourse) { + gWorldInstance.CurrentCourse->Water(); + } + } + + size_t GetCupCursorPosition() { + return gWorldInstance.CurrentCup->CursorPosition; + } void SetCupCursorPosition(size_t position) { gWorldInstance.CurrentCup->SetCourse(position); //gWorldInstance.CurrentCup->CursorPosition = position; } -size_t GetCupSize() { - return gWorldInstance.CurrentCup->GetSize(); -} + size_t GetCupSize() { + return gWorldInstance.CurrentCup->GetSize(); + } -void SetCourseFromCup() { - gWorldInstance.CurrentCourse = gWorldInstance.CurrentCup->GetCourse(); -} + void SetCourseFromCup() { + gWorldInstance.CurrentCourse = gWorldInstance.CurrentCup->GetCourse(); + } -void* GetCourse(void) { - return gWorldInstance.CurrentCourse; -} + void* GetCourse(void) { + return gWorldInstance.CurrentCourse; + } -void SetCourseByClass(void* course) { - gWorldInstance.CurrentCourse = (Course*) course; -} + void SetCourseByClass(void* course) { + gWorldInstance.CurrentCourse = (Course*) course; + } -void* GetMarioRaceway(void) { - return gMarioRaceway; -} + void* GetMarioRaceway(void) { + return gMarioRaceway; + } -void* GetLuigiRaceway(void) { - return gLuigiRaceway; -} + void* GetLuigiRaceway(void) { + return gLuigiRaceway; + } -void* GetChocoMountain(void) { - return gChocoMountain; -} + void* GetChocoMountain(void) { + return gChocoMountain; + } -void* GetBowsersCastle(void) { - return gBowsersCastle; -} + void* GetBowsersCastle(void) { + return gBowsersCastle; + } -void* GetBansheeBoardwalk(void) { - return gBansheeBoardwalk; -} + void* GetBansheeBoardwalk(void) { + return gBansheeBoardwalk; + } -void* GetYoshiValley(void) { - return gYoshiValley; -} + void* GetYoshiValley(void) { + return gYoshiValley; + } -void* GetFrappeSnowland(void) { - return gFrappeSnowland; -} + void* GetFrappeSnowland(void) { + return gFrappeSnowland; + } -void* GetKoopaTroopaBeach(void) { - return gKoopaTroopaBeach; -} + void* GetKoopaTroopaBeach(void) { + return gKoopaTroopaBeach; + } -void* GetRoyalRaceway(void) { - return gRoyalRaceway; -} + void* GetRoyalRaceway(void) { + return gRoyalRaceway; + } -void* GetMooMooFarm(void) { - return gMooMooFarm; -} + void* GetMooMooFarm(void) { + return gMooMooFarm; + } -void* GetToadsTurnpike(void) { - return gToadsTurnpike; -} + void* GetToadsTurnpike(void) { + return gToadsTurnpike; + } -void* GetKalimariDesert(void) { - return gKalimariDesert; -} + void* GetKalimariDesert(void) { + return gKalimariDesert; + } -void* GetSherbetLand(void) { - return gSherbetLand; -} + void* GetSherbetLand(void) { + return gSherbetLand; + } -void* GetRainbowRoad(void) { - return gRainbowRoad; -} + void* GetRainbowRoad(void) { + return gRainbowRoad; + } -void* GetWarioStadium(void) { - return gWarioStadium; -} + void* GetWarioStadium(void) { + return gWarioStadium; + } -void* GetBlockFort(void) { - return gBlockFort; -} + void* GetBlockFort(void) { + return gBlockFort; + } -void* GetSkyscraper(void) { - return gSkyscraper; -} + void* GetSkyscraper(void) { + return gSkyscraper; + } -void* GetDoubleDeck(void) { - return gDoubleDeck; -} + void* GetDoubleDeck(void) { + return gDoubleDeck; + } -void* GetDkJungle(void) { - return gDkJungle; -} + void* GetDkJungle(void) { + return gDkJungle; + } -void* GetBigDonut(void) { - return gBigDonut; -} + void* GetBigDonut(void) { + return gBigDonut; + } -void* GetPodiumCeremony(void) { - return gPodiumCeremony; -} + void* GetPodiumCeremony(void) { + return gPodiumCeremony; + } -void* GetTestCourse(void) { - return gTestCourse; -} + void* GetTestCourse(void) { + return gTestCourse; + } } void push_frame() { diff --git a/src/racing/actors.c b/src/racing/actors.c index 8452c0c78..075ed86c3 100644 --- a/src/racing/actors.c +++ b/src/racing/actors.c @@ -2393,6 +2393,8 @@ void render_course_actors(struct UnkStruct_800DC5EC* arg0) { gSPSetLights1(gDisplayListHead++, D_800DC610[1]); gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); + CourseManager_DrawActors(D_800DC5EC->camera); + if (gModeSelection != BATTLE) { func_80297340(camera); }