diff options
Diffstat (limited to 'src/engine/courses/KalimariDesert.cpp')
| -rw-r--r-- | src/engine/courses/KalimariDesert.cpp | 81 |
1 files changed, 40 insertions, 41 deletions
diff --git a/src/engine/courses/KalimariDesert.cpp b/src/engine/courses/KalimariDesert.cpp index ffd19a86e..e783d4e0f 100644 --- a/src/engine/courses/KalimariDesert.cpp +++ b/src/engine/courses/KalimariDesert.cpp @@ -11,7 +11,6 @@ #include "engine/vehicles/Utils.h" #include "engine/vehicles/Train.h" -#include "engine/vehicles/Vehicle.h" extern "C" { #include "main.h" @@ -136,7 +135,7 @@ void KalimariDesert::LoadTextures() { dma_textures(gTextureCactus3, 0x000003AFU, 0x00000800U); } -void KalimariDesert::SpawnActors() { +void KalimariDesert::BeginPlay() { struct RailroadCrossing* rrxing; Vec3f position; Vec3f velocity = { 0.0f, 0.0f, 0.0f }; @@ -173,6 +172,45 @@ void KalimariDesert::SpawnActors() { rrxing = (struct RailroadCrossing*) GET_ACTOR(add_actor_to_empty_slot(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)); rrxing->crossingTrigger = crossing1; + + + + generate_train_waypoints(); + + s32 centerWaypoint = 160; + + // Spawn two trains + for (size_t i = 0; i < _numTrains; ++i) { + uint32_t waypoint = CalculateWaypointDistribution(i, _numTrains, gVehicle2DWaypointLength, centerWaypoint); + + if (CVarGetInteger("gMultiplayerNoFeatureCuts", 0) == false) { + // Multiplayer modes have no tender and no carriages + if (gActiveScreenMode != SCREEN_MODE_1P) { + _tender = ATrain::TenderStatus::NO_TENDER; + _numCarriages = 0; + } + + // 2 player versus mode has a tender and a carriage + if ((gModeSelection == VERSUS) && (gPlayerCountSelection1 == 2)) { + _tender = ATrain::TenderStatus::HAS_TENDER; + _numCarriages = 1; + } + } + + gWorldInstance.AddActor(new ATrain(_tender, _numCarriages, 2.5f, waypoint)); + } + + if (gModeSelection == VERSUS) { + Vec3f pos = {0, 0, 0}; + + gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][50], 50, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][138], 138, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][280], 280, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][404], 404, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][510], 510, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][0], 0, 0, 0.8333333f)); + } } // Likely sets minimap boundaries @@ -214,45 +252,6 @@ void KalimariDesert::MinimapFinishlinePosition() { draw_hud_2d_texture_8x8(this->Props.MinimapFinishlineX, this->Props.MinimapFinishlineY, (u8*) common_texture_minimap_finish_line); } -void KalimariDesert::SpawnVehicles() { - generate_train_waypoints(); - - s32 centerWaypoint = 160; - - // Spawn two trains - for (size_t i = 0; i < _numTrains; ++i) { - uint32_t waypoint = CalculateWaypointDistribution(i, _numTrains, gVehicle2DWaypointLength, centerWaypoint); - - if (CVarGetInteger("gMultiplayerNoFeatureCuts", 0) == false) { - // Multiplayer modes have no tender and no carriages - if (gActiveScreenMode != SCREEN_MODE_1P) { - _tender = ATrain::TenderStatus::NO_TENDER; - _numCarriages = 0; - } - - // 2 player versus mode has a tender and a carriage - if ((gModeSelection == VERSUS) && (gPlayerCountSelection1 == 2)) { - _tender = ATrain::TenderStatus::HAS_TENDER; - _numCarriages = 1; - } - } - - gWorldInstance.AddVehicle(new ATrain(_tender, _numCarriages, 2.5f, waypoint)); - } - - if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; - - gWorldInstance.AddBombKart(pos, &D_80164550[0][50], 50, 3, 0.8333333f); - gWorldInstance.AddBombKart(pos, &D_80164550[0][138], 138, 1, 0.8333333f); - gWorldInstance.AddBombKart(pos, &D_80164550[0][280], 280, 3, 0.8333333f); - gWorldInstance.AddBombKart(pos, &D_80164550[0][404], 404, 1, 0.8333333f); - gWorldInstance.AddBombKart(pos, &D_80164550[0][510], 510, 3, 0.8333333f); - gWorldInstance.AddBombKart(pos, &D_80164550[0][0], 0, 0, 0.8333333f); - gWorldInstance.AddBombKart(pos, &D_80164550[0][0], 0, 0, 0.8333333f); - } -} - void KalimariDesert::Render(struct UnkStruct_800DC5EC* arg0) { func_802B5D64(D_800DC610, D_802B87D4, 0, 1); |
