diff options
| author | coco875 <59367621+coco875@users.noreply.github.com> | 2025-06-19 22:26:04 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-19 16:26:04 -0600 |
| commit | 5d7cf20c83bf49e6b27f07684535727506526012 (patch) | |
| tree | d5a02b39520ff255f4b1ffc557be5026d481427c /src/engine | |
| parent | 602141fb11e2614583caa23b250ca115ce451c99 (diff) | |
pr Code 80005fd0 (#181)
* fix error
* a lot of change
* basic rename of local variable
* continue rename and improve Enhancements
* re-apply change
* revert the remove of dma_texture and fix mtxf_multiplication
* more documentation port
* some fix
* more fix
* fix arround
* Update torch
* fix spelling
---------
Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/engine')
44 files changed, 1051 insertions, 1087 deletions
diff --git a/src/engine/TrainCrossing.cpp b/src/engine/TrainCrossing.cpp index 8dce6984b..21eefc8d2 100644 --- a/src/engine/TrainCrossing.cpp +++ b/src/engine/TrainCrossing.cpp @@ -29,9 +29,9 @@ void TrainCrossing::CrossingTrigger() { s32 i; OnTriggered = 0; - for (const auto& actor : gWorldInstance.Actors) { - if (auto train = dynamic_cast<ATrain*>(actor)) {; + if (auto train = dynamic_cast<ATrain*>(actor)) { + ; f32 radius = DynamicRadius(train->Locomotive.position, train->Locomotive.velocity, Position); if (Distance(train->Locomotive.position, Position) < radius) { @@ -53,7 +53,7 @@ void TrainCrossing::AICrossingBehaviour(s32 playerId) { if ((!(D_801631E0[playerId] != 0)) || (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)) { + if ((sSomeNearestPathPoint > WaypointMin) && (sSomeNearestPathPoint < WaypointMax)) { bStopAICrossing[playerId] = 1; } } @@ -61,9 +61,9 @@ void TrainCrossing::AICrossingBehaviour(s32 playerId) { } f32 TrainCrossing::Distance(Vec3f a, Vec3f b) { - float dx = b[0] - a[0]; // Difference in x-coordinates - float dy = b[1] - a[1]; // Difference in y-coordinates - float dz = b[2] - a[2]; // Difference in z-coordinates + float dx = b[0] - a[0]; // Difference in x-coordinates + float dy = b[1] - a[1]; // Difference in y-coordinates + float dz = b[2] - a[2]; // Difference in z-coordinates return sqrt(dx * dx + dy * dy + dz * dz); // Return the distance } @@ -75,8 +75,7 @@ f32 TrainCrossing::DynamicRadius(Vec3f trainPos, Vec3f trainVelocity, Vec3f cros trainToCrossing[2] = crossingPos[2] - trainPos[2]; // Dot product to check if the train is approaching or moving away from the crossing - f32 dotProduct = trainToCrossing[0] * trainVelocity[0] + - trainToCrossing[1] * trainVelocity[1] + + f32 dotProduct = trainToCrossing[0] * trainVelocity[0] + trainToCrossing[1] * trainVelocity[1] + trainToCrossing[2] * trainVelocity[2]; if (dotProduct > 0) { diff --git a/src/engine/actors/Finishline.cpp b/src/engine/actors/Finishline.cpp index fb408bd14..6a82f03f0 100644 --- a/src/engine/actors/Finishline.cpp +++ b/src/engine/actors/Finishline.cpp @@ -31,9 +31,9 @@ AFinishline::AFinishline(std::optional<FVector> pos) { Pos[2] = D_8015F8D0[2] = pos.value().z; } else { // Set spawn point to the tracks first path point. - Pos[0] = D_8015F8D0[0] = D_80164490->posX; - Pos[1] = D_8015F8D0[1] = (f32) (D_80164490->posY - 15); - Pos[2] = D_8015F8D0[2] = D_80164490->posZ; + Pos[0] = D_8015F8D0[0] = gCurrentTrackPath->posX; + Pos[1] = D_8015F8D0[1] = (f32) (gCurrentTrackPath->posY - 15); + Pos[2] = D_8015F8D0[2] = gCurrentTrackPath->posZ; } Rot[0] = 0; @@ -45,14 +45,14 @@ AFinishline::AFinishline(std::optional<FVector> pos) { BoundingBoxSize = 0.0f; } -void AFinishline::Tick() {} +void AFinishline::Tick() { +} void AFinishline::Draw(Camera *camera) { Mat4 mtx; s16 temp = Pos[2]; s32 maxObjectsReached; - if (gGamestate == CREDITS_SEQUENCE) { return; } @@ -70,20 +70,23 @@ void AFinishline::Draw(Camera *camera) { if (D_800DC5BC != 0) { gDPSetFogColor(gDisplayListHead++, D_801625EC, D_801625F4, D_801625F0, 0xFF); - gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D001C20); + gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D001C20); } else { - gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D001B90); + gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D001B90); } } else if (D_800DC5BC != 0) { gDPSetFogColor(gDisplayListHead++, D_801625EC, D_801625F4, D_801625F0, 0xFF); - gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D001C88); + gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D001C88); } else { - gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D001BD8); + gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D001BD8); } FrameInterpolation_RecordCloseChild(); } -void AFinishline::Collision(Player* player, AActor* actor) {} +void AFinishline::Collision(Player* player, AActor* actor) { +} -bool AFinishline::IsMod() { return true; } +bool AFinishline::IsMod() { + return true; +} diff --git a/src/engine/courses/BansheeBoardwalk.cpp b/src/engine/courses/BansheeBoardwalk.cpp index 51049fb8d..5d3af6e65 100644 --- a/src/engine/courses/BansheeBoardwalk.cpp +++ b/src/engine/courses/BansheeBoardwalk.cpp @@ -15,28 +15,27 @@ #include "assets/boo_frames.h" extern "C" { - #include "main.h" - #include "camera.h" - #include "course_offsets.h" - #include "code_800029B0.h" - #include "render_courses.h" - #include "code_8006E9C0.h" - #include "code_80057C60.h" - #include "defines.h" - #include "math_util.h" - #include "external.h" - #include "code_80005FD0.h" - #include "spawn_players.h" - #include "render_objects.h" - #include "assets/common_data.h" - #include "save.h" - #include "staff_ghosts.h" - #include "actors.h" - #include "collision.h" - #include "memory.h" - #include "course_offsets.h" - #include "course.h" - extern const char *banshee_boardwalk_dls[]; +#include "main.h" +#include "camera.h" +#include "course_offsets.h" +#include "code_800029B0.h" +#include "render_courses.h" +#include "code_8006E9C0.h" +#include "code_80057C60.h" +#include "defines.h" +#include "math_util.h" +#include "external.h" +#include "code_80005FD0.h" +#include "spawn_players.h" +#include "render_objects.h" +#include "assets/common_data.h" +#include "save.h" +#include "staff_ghosts.h" +#include "actors.h" +#include "collision.h" +#include "memory.h" +#include "course.h" +extern const char *banshee_boardwalk_dls[]; } const course_texture banshee_boardwalk_textures[] = { @@ -95,34 +94,34 @@ BansheeBoardwalk::BansheeBoardwalk() { Props.NearPersp = 2.0f; Props.FarPersp = 2700.0f; - Props.PathSizes = {0x2EE, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; + Props.PathSizes = { 0x2EE, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 }; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_banshee_boardwalk_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*) LOAD_ASSET_RAW(d_course_banshee_boardwalk_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_banshee_boardwalk_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*) LOAD_ASSET_RAW(d_course_banshee_boardwalk_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -130,14 +129,14 @@ BansheeBoardwalk::BansheeBoardwalk() { Props.Clouds = NULL; // no clouds Props.CloudList = NULL; - Props.Skybox.TopRight = {0, 0, 0}; - Props.Skybox.BottomRight = {0, 0, 0}; - Props.Skybox.BottomLeft = {0, 0, 0}; - Props.Skybox.TopLeft = {0, 0, 0}; - Props.Skybox.FloorTopRight = {0, 0, 0}; - Props.Skybox.FloorBottomRight = {0, 0, 0}; - Props.Skybox.FloorBottomLeft = {0, 0, 0}; - Props.Skybox.FloorTopLeft = {0, 0, 0}; + Props.Skybox.TopRight = { 0, 0, 0 }; + Props.Skybox.BottomRight = { 0, 0, 0 }; + Props.Skybox.BottomLeft = { 0, 0, 0 }; + Props.Skybox.TopLeft = { 0, 0, 0 }; + Props.Skybox.FloorTopRight = { 0, 0, 0 }; + Props.Skybox.FloorBottomRight = { 0, 0, 0 }; + Props.Skybox.FloorBottomLeft = { 0, 0, 0 }; + Props.Skybox.FloorTopLeft = { 0, 0, 0 }; Props.Sequence = MusicSeq::MUSIC_SEQ_BANSHEE_BOARDWALK; Props.WaterLevel = -80.0f; @@ -161,8 +160,8 @@ void BansheeBoardwalk::LoadTextures() { void BansheeBoardwalk::BeginPlay() { spawn_all_item_boxes((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_banshee_boardwalk_item_box_spawns)); - - gWorldInstance.AddObject(new OCheepCheep(FVector(xOrientation * -1650.0, -200.0f, -1650.0f), OCheepCheep::CheepType::RACE, IPathSpan(160, 170))); + gWorldInstance.AddObject(new OCheepCheep(FVector(xOrientation * -1650.0, -200.0f, -1650.0f), + OCheepCheep::CheepType::RACE, IPathSpan(160, 170))); OTrashBin::Behaviour bhv; if (gModeSelection == TIME_TRIALS) { @@ -186,13 +185,13 @@ void BansheeBoardwalk::BeginPlay() { if (gModeSelection == VERSUS) { FVector pos = { 0, 0, 0 }; - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][110], 110, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][190], 190, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][250], 250, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][475], 475, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][610], 610, 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][110], 110, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][190], 190, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][250], 250, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][475], 475, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][610], 610, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } } @@ -207,16 +206,16 @@ void BansheeBoardwalk::UpdateCourseObjects() { if (gGamestate != CREDITS_SEQUENCE) { func_8007E4C4(); if (gModeSelection != TIME_TRIALS) { - //update_bat(); + // update_bat(); } - //wrapper_update_boos(); + // wrapper_update_boos(); } } void BansheeBoardwalk::RenderCourseObjects(s32 cameraId) { if (gGamestate != CREDITS_SEQUENCE) { - //render_object_bat(cameraId); - //render_object_boos(cameraId); + // render_object_bat(cameraId); + // render_object_boos(cameraId); } } @@ -224,8 +223,8 @@ void BansheeBoardwalk::SomeSounds() { } void BansheeBoardwalk::WhatDoesThisDo(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x180) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1E1)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x180) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1E1)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x41); } @@ -239,8 +238,8 @@ void BansheeBoardwalk::WhatDoesThisDo(Player* player, int8_t playerId) { } void BansheeBoardwalk::WhatDoesThisDoAI(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x180) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1E1)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x180) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1E1)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x41); } @@ -308,12 +307,12 @@ void BansheeBoardwalk::Render(struct UnkStruct_800DC5EC* arg0) { mtxf_translate(spCC, spA8); render_set_position(spCC, 0); - gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_banshee_boardwalk_dl_B278); + gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_banshee_boardwalk_dl_B278); gDPPipeSync(gDisplayListHead++); } void BansheeBoardwalk::RenderCredits() { - gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_banshee_boardwalk_dl_B308)); + gSPDisplayList(gDisplayListHead++, (Gfx*) (d_course_banshee_boardwalk_dl_B308)); } void BansheeBoardwalk::ScrollingTextures() { @@ -326,18 +325,19 @@ void BansheeBoardwalk::ScrollingTextures() { } void BansheeBoardwalk::Waypoints(Player* player, int8_t playerId) { - s16 waypoint = gNearestWaypointByPlayerId[playerId]; + s16 waypoint = gNearestPathPointByPlayerId[playerId]; if ((waypoint >= 0x12C) && (waypoint < 0x13C)) { - player->nearestWaypointId = 0x12CU; + player->nearestPathPointId = 0x12CU; } else { - player->nearestWaypointId = gNearestWaypointByPlayerId[playerId]; - if (player->nearestWaypointId < 0) { - player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId; + player->nearestPathPointId = gNearestPathPointByPlayerId[playerId]; + if (player->nearestPathPointId < 0) { + player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId; } } } -void BansheeBoardwalk::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) { +void BansheeBoardwalk::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, + uint16_t playerDirection) { gDPPipeSync(gDisplayListHead++); gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); @@ -345,13 +345,14 @@ void BansheeBoardwalk::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pat gDPSetBlendMask(gDisplayListHead++, 0xFF); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA); // d_course_banshee_boardwalk_packed_dl_878 - gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual((void*)0x07000878)); + gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual((void*) 0x07000878)); gDPSetAlphaCompare(gDisplayListHead++, G_AC_NONE); gDPPipeSync(gDisplayListHead++); } void BansheeBoardwalk::CreditsSpawnActors() { - find_vtx_and_set_colours(segmented_gfx_to_virtual((void*)0x07000878), 0x32, 0, 0, 0); + find_vtx_and_set_colours(segmented_gfx_to_virtual((void*) 0x07000878), 0x32, 0, 0, 0); } -void BansheeBoardwalk::Destroy() { } +void BansheeBoardwalk::Destroy() { +} diff --git a/src/engine/courses/BigDonut.cpp b/src/engine/courses/BigDonut.cpp index 4e99828eb..86bb71615 100644 --- a/src/engine/courses/BigDonut.cpp +++ b/src/engine/courses/BigDonut.cpp @@ -9,27 +9,27 @@ #include "assets/big_donut_data.h" extern "C" { - #include "main.h" - #include "camera.h" - #include "course_offsets.h" - #include "code_800029B0.h" - #include "render_courses.h" - #include "code_8006E9C0.h" - #include "code_80057C60.h" - #include "defines.h" - #include "math_util.h" - #include "external.h" - #include "code_80005FD0.h" - #include "spawn_players.h" - #include "render_objects.h" - #include "assets/common_data.h" - #include "save.h" - #include "staff_ghosts.h" - #include "actors.h" - #include "collision.h" - #include "memory.h" - extern const char *big_donut_dls[]; - extern s16 currentScreenSection; +#include "main.h" +#include "camera.h" +#include "course_offsets.h" +#include "code_800029B0.h" +#include "render_courses.h" +#include "code_8006E9C0.h" +#include "code_80057C60.h" +#include "defines.h" +#include "math_util.h" +#include "external.h" +#include "code_80005FD0.h" +#include "spawn_players.h" +#include "render_objects.h" +#include "assets/common_data.h" +#include "save.h" +#include "staff_ghosts.h" +#include "actors.h" +#include "collision.h" +#include "memory.h" +extern const char* big_donut_dls[]; +extern s16 currentScreenSection; } const course_texture big_donut_textures[] = { @@ -63,27 +63,27 @@ BigDonut::BigDonut() { Props.AIMinimumSeparation = 0.5f; Props.AISteeringSensitivity = 40; - Props.PathSizes = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; + Props.PathSizes = { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 }; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; Props.PathTable[0] = NULL; Props.PathTable[1] = NULL; @@ -98,14 +98,14 @@ BigDonut::BigDonut() { Props.Clouds = NULL; // no clouds Props.CloudList = NULL; - Props.Skybox.TopRight = {0, 0, 0}; - Props.Skybox.BottomRight = {0, 0, 0}; - Props.Skybox.BottomLeft = {0, 0, 0}; - Props.Skybox.TopLeft = {0, 0, 0}; - Props.Skybox.FloorTopRight = {0, 0, 0}; - Props.Skybox.FloorBottomRight = {0, 0, 0}; - Props.Skybox.FloorBottomLeft = {0, 0, 0}; - Props.Skybox.FloorTopLeft = {0, 0, 0}; + Props.Skybox.TopRight = { 0, 0, 0 }; + Props.Skybox.BottomRight = { 0, 0, 0 }; + Props.Skybox.BottomLeft = { 0, 0, 0 }; + Props.Skybox.TopLeft = { 0, 0, 0 }; + Props.Skybox.FloorTopRight = { 0, 0, 0 }; + Props.Skybox.FloorBottomRight = { 0, 0, 0 }; + Props.Skybox.FloorBottomLeft = { 0, 0, 0 }; + Props.Skybox.FloorTopLeft = { 0, 0, 0 }; Props.Sequence = MusicSeq::MUSIC_SEQ_BATTLE_ARENAS; Props.WaterLevel = 100.0f; @@ -115,31 +115,31 @@ void BigDonut::Load() { Course::Load(); // d_course_big_donut_packed_dl_1018 - generate_collision_mesh_with_default_section_id((Gfx*) segmented_gfx_to_virtual((void*)0x07001018), 6); + generate_collision_mesh_with_default_section_id((Gfx*) segmented_gfx_to_virtual((void*) 0x07001018), 6); // d_course_big_donut_packed_dl_450 - generate_collision_mesh_with_default_section_id((Gfx*) segmented_gfx_to_virtual((void*)0x07000450), 6); + generate_collision_mesh_with_default_section_id((Gfx*) segmented_gfx_to_virtual((void*) 0x07000450), 6); // d_course_big_donut_packed_dl_AC0 - generate_collision_mesh_with_default_section_id((Gfx*) segmented_gfx_to_virtual((void*)0x07000AC0), 6); + generate_collision_mesh_with_default_section_id((Gfx*) segmented_gfx_to_virtual((void*) 0x07000AC0), 6); // d_course_big_donut_packed_dl_B58 - generate_collision_mesh_with_default_section_id((Gfx*) segmented_gfx_to_virtual((void*)0x07000B58), 6); + generate_collision_mesh_with_default_section_id((Gfx*) segmented_gfx_to_virtual((void*) 0x07000B58), 6); // d_course_big_donut_packed_dl_230 - generate_collision_mesh_with_default_section_id((Gfx*) segmented_gfx_to_virtual((void*)0x07000230), 6); + generate_collision_mesh_with_default_section_id((Gfx*) segmented_gfx_to_virtual((void*) 0x07000230), 6); func_80295C6C(); } void BigDonut::BeginPlay() { - spawn_all_item_boxes((ActorSpawnData*)LOAD_ASSET_RAW(d_course_big_donut_item_box_spawns)); + spawn_all_item_boxes((ActorSpawnData*) LOAD_ASSET_RAW(d_course_big_donut_item_box_spawns)); if (gModeSelection == VERSUS) { FVector pos = {0, 0, 0}; - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][20], 20, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][40], 40, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][60], 60, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][80], 80, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][100], 100, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][120], 120, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][140], 140, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][20], 20, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][40], 40, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][60], 60, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][80], 80, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][100], 100, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][120], 120, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][140], 140, 0, 1.0f)); } } @@ -154,22 +154,24 @@ void BigDonut::Render(struct UnkStruct_800DC5EC* arg0) { gDPSetCombineMode(gDisplayListHead++, G_CC_SHADE, G_CC_SHADE); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); // d_course_big_donut_packed_dl_DE8 - gSPDisplayList(gDisplayListHead++, (segmented_gfx_to_virtual((void*)0x07000DE8))); + gSPDisplayList(gDisplayListHead++, (segmented_gfx_to_virtual((void*) 0x07000DE8))); } // d_course_big_donut_packed_dl_450 - gSPDisplayList(gDisplayListHead++, (segmented_gfx_to_virtual((void*)0x07000450))); + gSPDisplayList(gDisplayListHead++, (segmented_gfx_to_virtual((void*) 0x07000450))); // d_course_big_donut_packed_dl_AC0 - gSPDisplayList(gDisplayListHead++, (segmented_gfx_to_virtual((void*)0x07000AC0))); + gSPDisplayList(gDisplayListHead++, (segmented_gfx_to_virtual((void*) 0x07000AC0))); // d_course_big_donut_packed_dl_D20 - gSPDisplayList(gDisplayListHead++, (segmented_gfx_to_virtual((void*)0x07000D20))); + gSPDisplayList(gDisplayListHead++, (segmented_gfx_to_virtual((void*) 0x07000D20))); // d_course_big_donut_packed_dl_230 - gSPDisplayList(gDisplayListHead++, (segmented_gfx_to_virtual((void*)0x07000230))); + gSPDisplayList(gDisplayListHead++, (segmented_gfx_to_virtual((void*) 0x07000230))); } -void BigDonut::RenderCredits() {} +void BigDonut::RenderCredits() { +} void BigDonut::Waypoints(Player* player, int8_t playerId) { - player->nearestWaypointId = 0; + player->nearestPathPointId = 0; } -void BigDonut::Destroy() { } +void BigDonut::Destroy() { +} diff --git a/src/engine/courses/BlockFort.cpp b/src/engine/courses/BlockFort.cpp index cf246220e..a2a5c413a 100644 --- a/src/engine/courses/BlockFort.cpp +++ b/src/engine/courses/BlockFort.cpp @@ -9,28 +9,28 @@ #include "assets/block_fort_data.h" extern "C" { - #include "main.h" - #include "camera.h" - #include "course_offsets.h" - #include "code_800029B0.h" - #include "render_courses.h" - #include "code_8006E9C0.h" - #include "code_80057C60.h" - #include "defines.h" - #include "math_util.h" - #include "external.h" - #include "code_80005FD0.h" - #include "spawn_players.h" - #include "render_objects.h" - #include "assets/common_data.h" - #include "save.h" - #include "staff_ghosts.h" - #include "actors.h" - #include "collision.h" - #include "memory.h" - #include "course_offsets.h" - extern const char *block_fort_dls[]; - extern s16 currentScreenSection; +#include "main.h" +#include "camera.h" +#include "course_offsets.h" +#include "code_800029B0.h" +#include "render_courses.h" +#include "code_8006E9C0.h" +#include "code_80057C60.h" +#include "defines.h" +#include "math_util.h" +#include "external.h" +#include "code_80005FD0.h" +#include "spawn_players.h" +#include "render_objects.h" +#include "assets/common_data.h" +#include "save.h" +#include "staff_ghosts.h" +#include "actors.h" +#include "collision.h" +#include "memory.h" +#include "course_offsets.h" +extern const char* block_fort_dls[]; +extern s16 currentScreenSection; } const course_texture block_fort_textures[] = { @@ -68,27 +68,27 @@ BlockFort::BlockFort() { Props.NearPersp = 2.0f; Props.FarPersp = 2700.0f; - Props.PathSizes = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; + Props.PathSizes = { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 }; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; Props.PathTable[0] = NULL; Props.PathTable[1] = NULL; @@ -103,38 +103,38 @@ BlockFort::BlockFort() { Props.Clouds = NULL; // no clouds Props.CloudList = NULL; - Props.Skybox.TopRight = {128, 184, 248}; - Props.Skybox.BottomRight = {216, 232, 248}; - Props.Skybox.BottomLeft = {216, 232, 248}; - Props.Skybox.TopLeft = {128, 184, 248}; - Props.Skybox.FloorTopRight = {216, 232, 248}; - Props.Skybox.FloorBottomRight = {0, 0, 0}; - Props.Skybox.FloorBottomLeft = {0, 0, 0}; - Props.Skybox.FloorTopLeft = {216, 232, 248}; + Props.Skybox.TopRight = { 128, 184, 248 }; + Props.Skybox.BottomRight = { 216, 232, 248 }; + Props.Skybox.BottomLeft = { 216, 232, 248 }; + Props.Skybox.TopLeft = { 128, 184, 248 }; + Props.Skybox.FloorTopRight = { 216, 232, 248 }; + Props.Skybox.FloorBottomRight = { 0, 0, 0 }; + Props.Skybox.FloorBottomLeft = { 0, 0, 0 }; + Props.Skybox.FloorTopLeft = { 216, 232, 248 }; Props.Sequence = MusicSeq::MUSIC_SEQ_CHOCO_MOUNTAIN; } void BlockFort::Load() { Course::Load(); - generate_collision_mesh_with_default_section_id((Gfx*) segmented_gfx_to_virtual((void*)0x070015C0), 1); + generate_collision_mesh_with_default_section_id((Gfx*) segmented_gfx_to_virtual((void*) 0x070015C0), 1); func_80295C6C(); Props.WaterLevel = gCourseMinY - 10.0f; } void BlockFort::BeginPlay() { - spawn_all_item_boxes((ActorSpawnData*)LOAD_ASSET_RAW(d_course_block_fort_item_box_spawns)); + spawn_all_item_boxes((ActorSpawnData*) LOAD_ASSET_RAW(d_course_block_fort_item_box_spawns)); if (gModeSelection == VERSUS) { FVector pos = { 0, 0, 0 }; - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][20], 20, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][40], 40, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][60], 60, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][80], 80, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][100], 100, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][120], 120, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][140], 140, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][20], 20, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][40], 40, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][60], 60, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][80], 80, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][100], 100, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][120], 120, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][140], 140, 0, 1.0f)); } } @@ -144,9 +144,9 @@ void BlockFort::Render(struct UnkStruct_800DC5EC* arg0) { gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); // d_course_block_fort_packed_dl_15C0 - gSPDisplayList(gDisplayListHead++, (segmented_gfx_to_virtual((void*)0x070015C0))); + gSPDisplayList(gDisplayListHead++, (segmented_gfx_to_virtual((void*) 0x070015C0))); } void BlockFort::Waypoints(Player* player, int8_t playerId) { - player->nearestWaypointId = 0; + player->nearestPathPointId = 0; } diff --git a/src/engine/courses/BowsersCastle.cpp b/src/engine/courses/BowsersCastle.cpp index 22b6cbe78..a150b0f4b 100644 --- a/src/engine/courses/BowsersCastle.cpp +++ b/src/engine/courses/BowsersCastle.cpp @@ -97,34 +97,34 @@ BowsersCastle::BowsersCastle() { Props.NearPersp = 2.0f; Props.FarPersp = 2700.0f; - Props.PathSizes = {0x30C, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; + Props.PathSizes = { 0x30C, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 }; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_bowsers_castle_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*) LOAD_ASSET_RAW(d_course_bowsers_castle_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_bowsers_castle_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*) LOAD_ASSET_RAW(d_course_bowsers_castle_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -132,14 +132,14 @@ BowsersCastle::BowsersCastle() { Props.Clouds = NULL; // no clouds Props.CloudList = NULL; - Props.Skybox.TopRight = {48, 8, 120}; - Props.Skybox.BottomRight = {0, 0, 0}; - Props.Skybox.BottomLeft = {0, 0, 0}; - Props.Skybox.TopLeft = {48, 8, 120}; - Props.Skybox.FloorTopRight = {0, 0, 0}; - Props.Skybox.FloorBottomRight = {0, 0, 0}; - Props.Skybox.FloorBottomLeft = {0, 0, 0}; - Props.Skybox.FloorTopLeft = {0, 0, 0}; + Props.Skybox.TopRight = { 48, 8, 120 }; + Props.Skybox.BottomRight = { 0, 0, 0 }; + Props.Skybox.BottomLeft = { 0, 0, 0 }; + Props.Skybox.TopLeft = { 48, 8, 120 }; + Props.Skybox.FloorTopRight = { 0, 0, 0 }; + Props.Skybox.FloorBottomRight = { 0, 0, 0 }; + Props.Skybox.FloorBottomLeft = { 0, 0, 0 }; + Props.Skybox.FloorTopLeft = { 0, 0, 0 }; Props.Sequence = MusicSeq::MUSIC_SEQ_BOWSERS_CASTLE; Props.WaterLevel = -50.0f; @@ -226,13 +226,13 @@ void BowsersCastle::BeginPlay() { if (gModeSelection == VERSUS) { FVector 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][150], 150, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][200], 200, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][260], 260, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][435], 435, 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][50], 50, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][150], 150, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][200], 200, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][260], 260, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][435], 435, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } } @@ -268,7 +268,7 @@ void BowsersCastle::UpdateCourseObjects() { } void BowsersCastle::RenderCourseObjects(s32 cameraId) { - //render_object_thwomps(cameraId); + // render_object_thwomps(cameraId); render_object_bowser_flame(cameraId); } @@ -276,8 +276,8 @@ void BowsersCastle::SomeSounds() { } void BowsersCastle::WhatDoesThisDo(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x29) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1D2)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x29) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1D2)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x41); } @@ -291,8 +291,8 @@ void BowsersCastle::WhatDoesThisDo(Player* player, int8_t playerId) { } void BowsersCastle::WhatDoesThisDoAI(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x29) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1D2)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x29) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1D2)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x41); } @@ -333,7 +333,7 @@ void BowsersCastle::Render(struct UnkStruct_800DC5EC* arg0) { } void BowsersCastle::RenderCredits() { - gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_bowsers_castle_dl_9148)); + gSPDisplayList(gDisplayListHead++, (Gfx*) (d_course_bowsers_castle_dl_9148)); } void BowsersCastle::SomeCollisionThing(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7) { @@ -341,20 +341,21 @@ void BowsersCastle::SomeCollisionThing(Player *player, Vec3f arg1, Vec3f arg2, V } void BowsersCastle::Waypoints(Player* player, int8_t playerId) { - s16 waypoint = gNearestWaypointByPlayerId[playerId]; + s16 waypoint = gNearestPathPointByPlayerId[playerId]; if ((waypoint >= 0x235) && (waypoint < 0x247)) { - player->nearestWaypointId = 0x214; + player->nearestPathPointId = 0x214; } else if ((waypoint >= 0x267) && (waypoint < 0x277)) { - player->nearestWaypointId = 0x25B; + player->nearestPathPointId = 0x25B; } else { - player->nearestWaypointId = gNearestWaypointByPlayerId[playerId]; - if (player->nearestWaypointId < 0) { - player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId; + player->nearestPathPointId = gNearestPathPointByPlayerId[playerId]; + if (player->nearestPathPointId < 0) { + player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId; } } } -void BowsersCastle::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) { +void BowsersCastle::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, + uint16_t playerDirection) { if (gActiveScreenMode != SCREEN_MODE_1P) { return; } @@ -372,11 +373,12 @@ void BowsersCastle::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCo return; } } - gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_bowsers_castle_dl_9228); + gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_bowsers_castle_dl_9228); } void BowsersCastle::CreditsSpawnActors() { - find_vtx_and_set_colours(segmented_gfx_to_virtual((void*)0x07001350), 0x32, 0, 0, 0); + find_vtx_and_set_colours(segmented_gfx_to_virtual((void*) 0x07001350), 0x32, 0, 0, 0); } -void BowsersCastle::Destroy() { } +void BowsersCastle::Destroy() { +} diff --git a/src/engine/courses/ChocoMountain.cpp b/src/engine/courses/ChocoMountain.cpp index be5dcb0b1..fc24bd764 100644 --- a/src/engine/courses/ChocoMountain.cpp +++ b/src/engine/courses/ChocoMountain.cpp @@ -90,32 +90,32 @@ ChocoMountain::ChocoMountain() { Props.PathSizes = {0x2BC, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_choco_mountain_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_choco_mountain_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_choco_mountain_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_choco_mountain_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -178,13 +178,13 @@ void ChocoMountain::BeginPlay() { if (gModeSelection == VERSUS) { FVector pos = { 0, 0, 0 }; - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][140], 140, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][165], 165, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][330], 330, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][550], 550, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][595], 595, 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][140], 140, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][165], 165, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][330], 330, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][550], 550, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][595], 595, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } } @@ -206,8 +206,8 @@ void ChocoMountain::SomeSounds() { } void ChocoMountain::WhatDoesThisDo(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0xA0) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0xB4)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0xA0) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0xB4)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x55); } @@ -221,8 +221,8 @@ void ChocoMountain::WhatDoesThisDo(Player* player, int8_t playerId) { } void ChocoMountain::WhatDoesThisDoAI(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0xA0) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0xB4)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0xA0) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0xB4)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x55); } diff --git a/src/engine/courses/Course.cpp b/src/engine/courses/Course.cpp index 85223a7c5..8eae0cca1 100644 --- a/src/engine/courses/Course.cpp +++ b/src/engine/courses/Course.cpp @@ -4,7 +4,7 @@ #include "MarioRaceway.h" #include "ChocoMountain.h" #include "port/Game.h" -#include "port/resource/type/TrackWaypoint.h" +#include "port/resource/type/TrackPathPointData.h" #include "port/resource/type/TrackSections.h" extern "C" { @@ -59,25 +59,25 @@ Course::Course() { Props.PathSizes = { 600, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 }; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; Props.PathTable[0] = NULL; Props.PathTable[1] = NULL; @@ -116,11 +116,11 @@ void Course::LoadO2R(std::string trackPath) { size_t i = 0; for (auto& path : paths) { if (i == 0) { - Props.PathTable[0] = (TrackWaypoint*)path.data(); + Props.PathTable[0] = (TrackPathPoint*)path.data(); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)path.data(); + Props.PathTable2[0] = (TrackPathPoint*)path.data(); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -237,10 +237,10 @@ void Course::TestPath() { Vec3s rot = {0, 0, 0}; Vec3f vel = {0, 0, 0}; - for (size_t i = 0; i < gWaypointCountByPathIndex[0]; i++) { - x = D_80164550[0][i].posX; - y = D_80164550[0][i].posY; - z = D_80164550[0][i].posZ; + for (size_t i = 0; i < gPathCountByPathIndex[0]; i++) { + x = gTrackPaths[0][i].posX; + y = gTrackPaths[0][i].posY; + z = gTrackPaths[0][i].posZ; if (((x & 0xFFFF) == 0x8000) && ((y & 0xFFFF) == 0x8000) && ((z & 0xFFFF) == 0x8000)) { break; @@ -333,9 +333,9 @@ void Course::SetStaffGhost() { } void Course::Waypoints(Player* player, int8_t playerId) { - player->nearestWaypointId = gNearestWaypointByPlayerId[playerId]; - if (player->nearestWaypointId < 0) { - player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId; + player->nearestPathPointId = gNearestPathPointByPlayerId[playerId]; + if (player->nearestPathPointId < 0) { + player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId; } } diff --git a/src/engine/courses/Course.h b/src/engine/courses/Course.h index a1a7d2f4b..162803b82 100644 --- a/src/engine/courses/Course.h +++ b/src/engine/courses/Course.h @@ -75,17 +75,17 @@ typedef struct Properties { int16_t* AIDistance; uint32_t AISteeringSensitivity; _struct_gCoursePathSizes_0x10 PathSizes; - Vec4f D_0D009418; - Vec4f D_0D009568; + Vec4f CurveTargetSpeed; + Vec4f NormalTargetSpeed; Vec4f D_0D0096B8; - Vec4f D_0D009808; - TrackWaypoint* PathTable[4]; - TrackWaypoint* PathTable2[4]; + Vec4f OffTrackTargetSpeed; + TrackPathPoint* PathTable[4]; + TrackPathPoint* PathTable2[4]; uint8_t* CloudTexture; CloudData *Clouds; CloudData *CloudList; SkyboxColours Skybox; - const course_texture *textures; + const course_texture* textures; enum MusicSeq Sequence; float WaterLevel; // Used for effects, and Lakitu pick up height. Not necessarily the visual water model height. @@ -111,10 +111,10 @@ typedef struct Properties { // PathSizes - Assuming _struct_gCoursePathSizes_0x10 can be serialized similarly // j["PathSizes"] = PathSizes; // Implement your serialization logic here - j["D_0D009418"] = { D_0D009418[0], D_0D009418[1], D_0D009418[2], D_0D009418[3] }; - j["D_0D009568"] = { D_0D009568[0], D_0D009568[1], D_0D009568[2], D_0D009568[3] }; + j["CurveTargetSpeed"] = { CurveTargetSpeed[0], CurveTargetSpeed[1], CurveTargetSpeed[2], CurveTargetSpeed[3] }; + j["NormalTargetSpeed"] = { NormalTargetSpeed[0], NormalTargetSpeed[1], NormalTargetSpeed[2], NormalTargetSpeed[3] }; j["D_0D0096B8"] = { D_0D0096B8[0], D_0D0096B8[1], D_0D0096B8[2], D_0D0096B8[3] }; - j["D_0D009808"] = { D_0D009808[0], D_0D009808[1], D_0D009808[2], D_0D009808[3] }; + j["OffTrackTargetSpeed"] = { OffTrackTargetSpeed[0], OffTrackTargetSpeed[1], OffTrackTargetSpeed[2], OffTrackTargetSpeed[3] }; // Serialize arrays PathTable and PathTable2 (convert pointers into a JSON array if possible) //j["PathTable"] = {{}}; @@ -190,25 +190,25 @@ typedef struct Properties { // Deserialize PathSizes and other custom structs if needed - D_0D009418[0] = j.at("D_0D009418")[0].get<float>(); - D_0D009418[1] = j.at("D_0D009418")[1].get<float>(); - D_0D009418[2] = j.at("D_0D009418")[2].get<float>(); - D_0D009418[3] = j.at("D_0D009418")[3].get<float>(); + CurveTargetSpeed[0] = j.at("CurveTargetSpeed")[0].get<float>(); + CurveTargetSpeed[1] = j.at("CurveTargetSpeed")[1].get<float>(); + CurveTargetSpeed[2] = j.at("CurveTargetSpeed")[2].get<float>(); + CurveTargetSpeed[3] = j.at("CurveTargetSpeed")[3].get<float>(); - D_0D009568[0] = j.at("D_0D009568")[0].get<float>(); - D_0D009568[1] = j.at("D_0D009568")[1].get<float>(); - D_0D009568[2] = j.at("D_0D009568")[2].get<float>(); - D_0D009568[3] = j.at("D_0D009568")[3].get<float>(); + NormalTargetSpeed[0] = j.at("NormalTargetSpeed")[0].get<float>(); + NormalTargetSpeed[1] = j.at("NormalTargetSpeed")[1].get<float>(); + NormalTargetSpeed[2] = j.at("NormalTargetSpeed")[2].get<float>(); + NormalTargetSpeed[3] = j.at("NormalTargetSpeed")[3].get<float>(); D_0D0096B8[0] = j.at("D_0D0096B8")[0].get<float>(); D_0D0096B8[1] = j.at("D_0D0096B8")[1].get<float>(); D_0D0096B8[2] = j.at("D_0D0096B8")[2].get<float>(); D_0D0096B8[3] = j.at("D_0D0096B8")[3].get<float>(); - D_0D009808[0] = j.at("D_0D009808")[0].get<float>(); - D_0D009808[1] = j.at("D_0D009808")[1].get<float>(); - D_0D009808[2] = j.at("D_0D009808")[2].get<float>(); - D_0D009808[3] = j.at("D_0D009808")[3].get<float>(); + OffTrackTargetSpeed[0] = j.at("OffTrackTargetSpeed")[0].get<float>(); + OffTrackTargetSpeed[1] = j.at("OffTrackTargetSpeed")[1].get<float>(); + OffTrackTargetSpeed[2] = j.at("OffTrackTargetSpeed")[2].get<float>(); + OffTrackTargetSpeed[3] = j.at("OffTrackTargetSpeed")[3].get<float>(); // Deserialize arrays PathTable and PathTable2 similarly @@ -337,10 +337,12 @@ public: virtual void Waypoints(Player* player, int8_t playerId); virtual f32 GetWaterLevel(FVector pos, Collision* collision); virtual void ScrollingTextures(); - virtual void DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection); + virtual void DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, + uint16_t playerDirection); virtual void Destroy(); virtual bool IsMod(); -private: + + private: void Init(); }; diff --git a/src/engine/courses/DKJungle.cpp b/src/engine/courses/DKJungle.cpp index bbb602584..cd4c2803d 100644 --- a/src/engine/courses/DKJungle.cpp +++ b/src/engine/courses/DKJungle.cpp @@ -98,32 +98,32 @@ DKJungle::DKJungle() { Props.PathSizes = {0x370, 1, 1, 1, 0x1F4, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_dks_jungle_parkway_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_dks_jungle_parkway_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_dks_jungle_parkway_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_dks_jungle_parkway_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -197,7 +197,7 @@ void DKJungle::BeginPlay() { func_80298D10(); if (gGamestate != CREDITS_SEQUENCE) { - generate_ferry_waypoints(); + generate_ferry_path(); // The original game only ran vehicle logic every second frame. // Thus the speed gets divided by two to set speed to match properly @@ -206,13 +206,13 @@ void DKJungle::BeginPlay() { if (gModeSelection == VERSUS) { FVector 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][100], 100, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][150], 150, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][190], 190, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][250], 250, 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][50], 50, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][100], 100, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][150], 150, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][190], 190, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][250], 250, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } } } @@ -241,17 +241,17 @@ void DKJungle::SomeSounds() { } void DKJungle::WhatDoesThisDo(Player* player, int8_t playerId) { - if ((((s16) gNearestWaypointByPlayerId[playerId] >= 0) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x65)) || - (((s16) gNearestWaypointByPlayerId[playerId] >= 0x14A) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x21F))) { + if ((((s16) gNearestPathPointByPlayerId[playerId] >= 0) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x65)) || + (((s16) gNearestPathPointByPlayerId[playerId] >= 0x14A) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x21F))) { if (D_80165300[playerId] != 2) { func_800C8F80(playerId, 0x0170802D); } D_80165300[playerId] = 2; } else { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x288) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x305)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x288) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x305)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x55); } @@ -271,8 +271,8 @@ void DKJungle::WhatDoesThisDo(Player* player, int8_t playerId) { } void DKJungle::WhatDoesThisDoAI(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x288) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x305)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x288) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x305)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x55); } @@ -317,13 +317,13 @@ void DKJungle::SomeCollisionThing(Player *player, Vec3f arg1, Vec3f arg2, Vec3f } void DKJungle::Waypoints(Player* player, int8_t playerId) { - s16 waypoint = gNearestWaypointByPlayerId[playerId]; + s16 waypoint = gNearestPathPointByPlayerId[playerId]; if ((waypoint >= 0xB9) && (waypoint < 0x119)) { - player->nearestWaypointId = 0xB9U; + player->nearestPathPointId = 0xB9U; } else { - player->nearestWaypointId = gNearestWaypointByPlayerId[playerId]; - if (player->nearestWaypointId < 0) { - player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId; + player->nearestPathPointId = gNearestPathPointByPlayerId[playerId]; + if (player->nearestPathPointId < 0) { + player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId; } } } diff --git a/src/engine/courses/DoubleDeck.cpp b/src/engine/courses/DoubleDeck.cpp index ecadf9d48..d8beccf06 100644 --- a/src/engine/courses/DoubleDeck.cpp +++ b/src/engine/courses/DoubleDeck.cpp @@ -69,25 +69,25 @@ DoubleDeck::DoubleDeck() { Props.PathSizes = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; Props.PathTable[0] = NULL; Props.PathTable[1] = NULL; @@ -130,13 +130,13 @@ void DoubleDeck::BeginPlay() { if (gModeSelection == VERSUS) { FVector pos = { 0, 0, 0 }; - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][20], 20, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][40], 40, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][60], 60, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][80], 80, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][100], 100, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][120], 120, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][140], 140, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][20], 20, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][40], 40, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][60], 60, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][80], 80, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][100], 100, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][120], 120, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][140], 140, 0, 1.0f)); } } @@ -162,7 +162,7 @@ void DoubleDeck::Render(struct UnkStruct_800DC5EC* arg0) { void DoubleDeck::RenderCredits() {} void DoubleDeck::Waypoints(Player* player, int8_t playerId) { - player->nearestWaypointId = 0; + player->nearestPathPointId = 0; } void DoubleDeck::Destroy() { } diff --git a/src/engine/courses/FrappeSnowland.cpp b/src/engine/courses/FrappeSnowland.cpp index 66a1f9b1a..28d05e411 100644 --- a/src/engine/courses/FrappeSnowland.cpp +++ b/src/engine/courses/FrappeSnowland.cpp @@ -78,32 +78,32 @@ FrappeSnowland::FrappeSnowland() { Props.PathSizes = {0x2EE, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_frappe_snowland_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_frappe_snowland_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_frappe_snowland_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_frappe_snowland_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -165,13 +165,13 @@ void FrappeSnowland::BeginPlay() { if (gModeSelection == VERSUS) { FVector 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][100], 100, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][150], 150, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][290], 290, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][350], 350, 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][50], 50, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][100], 100, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][150], 150, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][290], 290, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][350], 350, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } } @@ -229,14 +229,14 @@ void FrappeSnowland::RenderCredits() { } void FrappeSnowland::Waypoints(Player* player, int8_t playerId) { - s16 waypoint = gNearestWaypointByPlayerId[playerId]; + s16 waypoint = gNearestPathPointByPlayerId[playerId]; if ((waypoint >= 0xF0) && (waypoint < 0x105)) { - player->nearestWaypointId = 0xF0U; + player->nearestPathPointId = 0xF0U; } else { - player->nearestWaypointId = gCopyNearestWaypointByPlayerId[playerId]; - if (player->nearestWaypointId < 0) { - player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId; + player->nearestPathPointId = gCopyNearestWaypointByPlayerId[playerId]; + if (player->nearestPathPointId < 0) { + player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId; } } } diff --git a/src/engine/courses/Harbour.cpp b/src/engine/courses/Harbour.cpp index bd037754c..9ccbcd84b 100644 --- a/src/engine/courses/Harbour.cpp +++ b/src/engine/courses/Harbour.cpp @@ -54,7 +54,7 @@ extern "C" { #include "course.h" } -TrackWaypoint harbour_path[] = { +TrackPathPoint harbour_path[] = { {16,-121,-34,0}, {27,-121,-60,0}, {31,-121,-83,0}, @@ -543,25 +543,25 @@ Harbour::Harbour() { Props.PathSizes = {459, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; Props.PathTable[0] = harbour_path; Props.PathTable[1] = NULL; @@ -741,8 +741,8 @@ void Harbour::BeginPlay() { // gWorldInstance.AddObject(new OBoos(10, IPathSpan(0, 5), IPathSpan(18, 23), IPathSpan(25, 50))); - // gVehicle2DWaypoint = harbour_path2D; - //gVehicle2DWaypointLength = 53; + // gVehicle2DPathPoint = harbour_path2D; + //gVehicle2DPathLength = 53; // D_80162EB0 = spawn_actor_on_surface(harbour_path2D[0].x, 2000.0f, harbour_path2D[0].z); @@ -760,8 +760,8 @@ void Harbour::BeginPlay() { } void Harbour::WhatDoesThisDo(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x19B) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1B9)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x19B) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1B9)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x55); } @@ -775,8 +775,8 @@ void Harbour::WhatDoesThisDo(Player* player, int8_t playerId) { } void Harbour::WhatDoesThisDoAI(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x19B) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1B9)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x19B) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1B9)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x55); } diff --git a/src/engine/courses/KalimariDesert.cpp b/src/engine/courses/KalimariDesert.cpp index 8f4c3e893..a5efbca46 100644 --- a/src/engine/courses/KalimariDesert.cpp +++ b/src/engine/courses/KalimariDesert.cpp @@ -82,32 +82,32 @@ KalimariDesert::KalimariDesert() { Props.PathSizes = {0x2BC, 1, 1, 1, 0x226, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_kalimari_desert_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_kalimari_desert_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_kalimari_desert_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_kalimari_desert_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -184,13 +184,13 @@ void KalimariDesert::BeginPlay() { rrxing->crossingTrigger = crossing1; - generate_train_waypoints(); + generate_train_path(); s32 centerWaypoint = 160; // Spawn two trains for (size_t i = 0; i < _numTrains; ++i) { - uint32_t waypoint = CalculateWaypointDistribution(i, _numTrains, gVehicle2DWaypointLength, centerWaypoint); + uint32_t waypoint = CalculateWaypointDistribution(i, _numTrains, gVehicle2DPathLength, centerWaypoint); if (CVarGetInteger("gMultiplayerNoFeatureCuts", 0) == false) { // Multiplayer modes have no tender and no carriages @@ -212,13 +212,13 @@ void KalimariDesert::BeginPlay() { if (gModeSelection == VERSUS) { FVector 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][50], 50, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][138], 138, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][280], 280, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][404], 404, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][510], 510, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } } } diff --git a/src/engine/courses/KoopaTroopaBeach.cpp b/src/engine/courses/KoopaTroopaBeach.cpp index fff1b7b55..b9a13d242 100644 --- a/src/engine/courses/KoopaTroopaBeach.cpp +++ b/src/engine/courses/KoopaTroopaBeach.cpp @@ -88,33 +88,33 @@ KoopaTroopaBeach::KoopaTroopaBeach() { Props.PathSizes = {0x2BC, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_koopa_troopa_beach_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_koopa_troopa_beach_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_koopa_troopa_beach_track_waypoints); - Props.PathTable2[1] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_koopa_troopa_beach_track_waypoints_2); + Props.PathTable2[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_koopa_troopa_beach_track_waypoints); + Props.PathTable2[1] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_koopa_troopa_beach_track_waypoints_2); Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -186,13 +186,13 @@ void KoopaTroopaBeach::BeginPlay() { if (gModeSelection == VERSUS) { FVector pos = { 0, 0, 0 }; - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][60], 60, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][120], 120, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][200], 200, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][280], 280, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][435], 435, 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][60], 60, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][120], 120, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][200], 200, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][280], 280, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][435], 435, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } } diff --git a/src/engine/courses/LuigiRaceway.cpp b/src/engine/courses/LuigiRaceway.cpp index 2cd51d7c2..add7825b3 100644 --- a/src/engine/courses/LuigiRaceway.cpp +++ b/src/engine/courses/LuigiRaceway.cpp @@ -115,32 +115,32 @@ LuigiRaceway::LuigiRaceway() { Props.PathSizes = { 0x2DA, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 }; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*) LOAD_ASSET_RAW(d_course_luigi_raceway_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*) LOAD_ASSET_RAW(d_course_luigi_raceway_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*) LOAD_ASSET_RAW(d_course_luigi_raceway_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*) LOAD_ASSET_RAW(d_course_luigi_raceway_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -187,13 +187,13 @@ void LuigiRaceway::BeginPlay() { if (gModeSelection == VERSUS) { FVector pos = { 0, 0, 0 }; - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][50], 50, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][200], 200, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][305], 305, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][440], 440, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][515], 515, 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][50], 50, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][200], 200, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][305], 305, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][440], 440, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][515], 515, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } } @@ -212,7 +212,7 @@ void LuigiRaceway::SomeSounds() { } void LuigiRaceway::WhatDoesThisDo(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x145) && ((s16) gNearestWaypointByPlayerId[playerId] < 0x18B)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x145) && ((s16) gNearestPathPointByPlayerId[playerId] < 0x18B)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x55); } @@ -226,7 +226,7 @@ void LuigiRaceway::WhatDoesThisDo(Player* player, int8_t playerId) { } void LuigiRaceway::WhatDoesThisDoAI(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x145) && ((s16) gNearestWaypointByPlayerId[playerId] < 0x18B)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x145) && ((s16) gNearestPathPointByPlayerId[playerId] < 0x18B)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x55); } diff --git a/src/engine/courses/MarioRaceway.cpp b/src/engine/courses/MarioRaceway.cpp index 50af0d890..a7bd21b45 100644 --- a/src/engine/courses/MarioRaceway.cpp +++ b/src/engine/courses/MarioRaceway.cpp @@ -103,32 +103,32 @@ MarioRaceway::MarioRaceway() { Props.PathSizes = {600, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_mario_raceway_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_mario_raceway_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_mario_raceway_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_mario_raceway_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -202,13 +202,13 @@ void MarioRaceway::BeginPlay() { if (gModeSelection == VERSUS) { FVector pos = { 0, 0, 0 }; - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][40], 40, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][100], 100, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][265], 265, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][285], 285, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][420], 420, 1, 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][40], 40, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][100], 100, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][265], 265, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][285], 285, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][420], 420, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } if (gGamestate != CREDITS_SEQUENCE) { @@ -230,8 +230,8 @@ void MarioRaceway::SomeSounds() { } void MarioRaceway::WhatDoesThisDo(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x19B) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1B9)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x19B) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1B9)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x55); } @@ -245,8 +245,8 @@ void MarioRaceway::WhatDoesThisDo(Player* player, int8_t playerId) { } void MarioRaceway::WhatDoesThisDoAI(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x19B) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1B9)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x19B) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1B9)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x55); } diff --git a/src/engine/courses/MooMooFarm.cpp b/src/engine/courses/MooMooFarm.cpp index 304ad2210..24b69ff67 100644 --- a/src/engine/courses/MooMooFarm.cpp +++ b/src/engine/courses/MooMooFarm.cpp @@ -100,32 +100,32 @@ MooMooFarm::MooMooFarm() { Props.PathSizes = {0x230, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_moo_moo_farm_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_moo_moo_farm_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_moo_moo_farm_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_moo_moo_farm_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -321,19 +321,19 @@ void MooMooFarm::BeginPlay() { if (gModeSelection == VERSUS) { FVector 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][140], 140, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][225], 225, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][316], 316, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][434], 434, 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][50], 50, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][140], 140, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][225], 225, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][316], 316, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][434], 434, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } } void MooMooFarm::WhatDoesThisDo(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x145) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x18B)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x145) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x18B)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x55); } @@ -347,8 +347,8 @@ void MooMooFarm::WhatDoesThisDo(Player* player, int8_t playerId) { } void MooMooFarm::WhatDoesThisDoAI(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x145) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x18B)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x145) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x18B)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x55); } diff --git a/src/engine/courses/PodiumCeremony.cpp b/src/engine/courses/PodiumCeremony.cpp index a4c01f588..203e3416f 100644 --- a/src/engine/courses/PodiumCeremony.cpp +++ b/src/engine/courses/PodiumCeremony.cpp @@ -113,30 +113,30 @@ PodiumCeremony::PodiumCeremony() { Props.PathSizes = {500, 500, 500, 500, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(podium_ceremony_path); - Props.PathTable[1] = (TrackWaypoint*)LOAD_ASSET_RAW(podium_ceremony_path_2); - Props.PathTable[2] = (TrackWaypoint*)LOAD_ASSET_RAW(podium_ceremony_path_3); - Props.PathTable[3] = (TrackWaypoint*)LOAD_ASSET_RAW(podium_ceremony_path_4); + Props.PathTable[0] = (TrackPathPoint*)LOAD_ASSET_RAW(podium_ceremony_path); + Props.PathTable[1] = (TrackPathPoint*)LOAD_ASSET_RAW(podium_ceremony_path_2); + Props.PathTable[2] = (TrackPathPoint*)LOAD_ASSET_RAW(podium_ceremony_path_3); + Props.PathTable[3] = (TrackPathPoint*)LOAD_ASSET_RAW(podium_ceremony_path_4); Props.PathTable2[0] = NULL; Props.PathTable2[1] = NULL; @@ -200,13 +200,13 @@ void PodiumCeremony::BeginPlay() { OTrophy* trophy = reinterpret_cast<OTrophy*>(gWorldInstance.AddObject(new OTrophy(pos, type, OTrophy::Behaviour::PODIUM_CEREMONY))); FVector kart = { 0, 0, 0 }; - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[3][3], 3, 5, 1.25f)); - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[3][40], 40, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[3][60], 60, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[3][80], 80, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[3][100], 100, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[3][120], 120, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[3][140], 140, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[3][3], 3, 5, 1.25f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[3][40], 40, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[3][60], 60, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[3][80], 80, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[3][100], 100, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[3][120], 120, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[3][140], 140, 0, 1.0f)); if (gGamestate != CREDITS_SEQUENCE) { gWorldInstance.AddObject(new OGrandPrixBalloons(FVector(-64, 5, -330))); @@ -226,8 +226,8 @@ void PodiumCeremony::SomeSounds() { } void PodiumCeremony::WhatDoesThisDo(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x180) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1E1)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x180) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1E1)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x41); } @@ -241,8 +241,8 @@ void PodiumCeremony::WhatDoesThisDo(Player* player, int8_t playerId) { } void PodiumCeremony::WhatDoesThisDoAI(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x180) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1E1)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x180) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1E1)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x41); } diff --git a/src/engine/courses/RainbowRoad.cpp b/src/engine/courses/RainbowRoad.cpp index 7c60d3af3..bcd9a2667 100644 --- a/src/engine/courses/RainbowRoad.cpp +++ b/src/engine/courses/RainbowRoad.cpp @@ -74,32 +74,32 @@ RainbowRoad::RainbowRoad() { Props.PathSizes = {0x76C, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_rainbow_road_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_rainbow_road_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_rainbow_road_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_rainbow_road_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -157,13 +157,13 @@ void RainbowRoad::BeginPlay() { if (gModeSelection == VERSUS) { FVector 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][100], 100, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][150], 150, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][200], 200, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][250], 250, 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][50], 50, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][100], 100, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][150], 150, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][200], 200, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][250], 250, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } } @@ -218,7 +218,7 @@ void RainbowRoad::RenderCredits() { } void RainbowRoad::Waypoints(Player* player, int8_t playerId) { - player->nearestWaypointId = gCopyNearestWaypointByPlayerId[playerId]; + player->nearestPathPointId = gCopyNearestWaypointByPlayerId[playerId]; } void RainbowRoad::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) { diff --git a/src/engine/courses/RoyalRaceway.cpp b/src/engine/courses/RoyalRaceway.cpp index 849087c3f..28d3c4e3e 100644 --- a/src/engine/courses/RoyalRaceway.cpp +++ b/src/engine/courses/RoyalRaceway.cpp @@ -112,32 +112,32 @@ RoyalRaceway::RoyalRaceway() { Props.PathSizes = {0x3E8, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_royal_raceway_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_royal_raceway_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_royal_raceway_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_royal_raceway_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -188,13 +188,13 @@ void RoyalRaceway::BeginPlay() { if (gModeSelection == VERSUS) { FVector 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][100], 100, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][296], 296, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][400], 400, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][746], 746, 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][50], 50, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][100], 100, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][296], 296, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][400], 400, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][746], 746, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } if (gGamestate != CREDITS_SEQUENCE) { gWorldInstance.AddObject(new OGrandPrixBalloons(FVector(-64, 5, -330))); @@ -211,8 +211,8 @@ void RoyalRaceway::InitCourseObjects() { } void RoyalRaceway::WhatDoesThisDo(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x180) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1E1)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x180) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1E1)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x41); } @@ -226,8 +226,8 @@ void RoyalRaceway::WhatDoesThisDo(Player* player, int8_t playerId) { } void RoyalRaceway::WhatDoesThisDoAI(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x180) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1E1)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x180) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1E1)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x41); } @@ -287,13 +287,13 @@ void RoyalRaceway::RenderCredits() { } void RoyalRaceway::Waypoints(Player* player, int8_t playerId) { - s16 waypoint = gNearestWaypointByPlayerId[playerId]; + s16 waypoint = gNearestPathPointByPlayerId[playerId]; if ((waypoint >= 0x258) && (waypoint < 0x2A4)) { - player->nearestWaypointId = 0x258U; + player->nearestPathPointId = 0x258U; } else { - player->nearestWaypointId = gCopyNearestWaypointByPlayerId[playerId]; - if (player->nearestWaypointId < 0) { - player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId; + player->nearestPathPointId = gCopyNearestWaypointByPlayerId[playerId]; + if (player->nearestPathPointId < 0) { + player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId; } } } diff --git a/src/engine/courses/SherbetLand.cpp b/src/engine/courses/SherbetLand.cpp index 7eb7e958c..2272922fa 100644 --- a/src/engine/courses/SherbetLand.cpp +++ b/src/engine/courses/SherbetLand.cpp @@ -77,32 +77,32 @@ SherbetLand::SherbetLand() { Props.PathSizes = {0x2BC, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_sherbet_land_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_sherbet_land_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_sherbet_land_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_sherbet_land_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -206,13 +206,13 @@ void SherbetLand::BeginPlay() { if (gGamestate != CREDITS_SEQUENCE) { if (gModeSelection == VERSUS) { FVector kart = { 0, 0, 0 }; - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[0][50], 50, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[0][100], 100, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[0][150], 150, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[0][200], 200, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[0][250], 250, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[0][0], 0, 0, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[0][50], 50, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[0][100], 100, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[0][150], 150, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[0][200], 200, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[0][250], 250, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(kart, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } } } diff --git a/src/engine/courses/Skyscraper.cpp b/src/engine/courses/Skyscraper.cpp index 4c165a787..d1bdd373e 100644 --- a/src/engine/courses/Skyscraper.cpp +++ b/src/engine/courses/Skyscraper.cpp @@ -89,25 +89,25 @@ Skyscraper::Skyscraper() { Props.PathSizes = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; Props.PathTable[0] = NULL; Props.PathTable[1] = NULL; @@ -154,13 +154,13 @@ void Skyscraper::BeginPlay() { if (gModeSelection == VERSUS) { FVector pos = { 0, 0, 0 }; - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][20], 20, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][40], 40, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][60], 60, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][80], 80, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][100], 100, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][120], 120, 0, 1.0f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][140], 140, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][20], 20, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][40], 40, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][60], 60, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][80], 80, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][100], 100, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][120], 120, 0, 1.0f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][140], 140, 0, 1.0f)); } } @@ -198,7 +198,7 @@ void Skyscraper::Render(struct UnkStruct_800DC5EC* arg0) { void Skyscraper::RenderCredits() {} void Skyscraper::Waypoints(Player* player, int8_t playerId) { - player->nearestWaypointId = 0; + player->nearestPathPointId = 0; } void Skyscraper::Destroy() { } diff --git a/src/engine/courses/TestCourse.cpp b/src/engine/courses/TestCourse.cpp index eebaee17a..02d2493cf 100644 --- a/src/engine/courses/TestCourse.cpp +++ b/src/engine/courses/TestCourse.cpp @@ -54,7 +54,7 @@ extern "C" { extern Gfx test_course_dls[]; extern Vtx mario_Plane_001_mesh_vtx_1[]; extern Gfx mario_Plane_001_mesh[]; - extern TrackWaypoint test_course_path[]; + extern TrackPathPoint test_course_path[]; extern TrackSections test_course_addr[]; } @@ -89,25 +89,25 @@ TestCourse::TestCourse() { Props.PathSizes = {51, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; Props.PathTable[0] = test_course_path; Props.PathTable[1] = NULL; @@ -282,8 +282,8 @@ void TestCourse::BeginPlay() { // gWorldInstance.AddObject(new OBoos(10, IPathSpan(0, 5), IPathSpan(18, 23), IPathSpan(25, 50))); - gVehicle2DWaypoint = test_course_path2D; - gVehicle2DWaypointLength = 53; + gVehicle2DPathPoint = test_course_path2D; + gVehicle2DPathLength = 53; D_80162EB0 = spawn_actor_on_surface(test_course_path2D[0].x, 2000.0f, test_course_path2D[0].z); //gWorldInstance.AddTrain(ATrain::TenderStatus::HAS_TENDER, 5, 2.5f, 0); @@ -291,8 +291,8 @@ void TestCourse::BeginPlay() { FVector pos2 = { 0, 0, 0 }; - gWorldInstance.AddObject(new OBombKart(pos2, &D_80164550[0][25], 25, 4, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos2, &D_80164550[0][45], 45, 4, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos2, &gTrackPaths[0][25], 25, 4, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos2, &gTrackPaths[0][45], 45, 4, 0.8333333f)); gWorldInstance.AddActor(new AShip(FVector(0, 0, 0), AShip::Skin::SHIP3)); @@ -300,8 +300,8 @@ void TestCourse::BeginPlay() { } void TestCourse::WhatDoesThisDo(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x19B) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1B9)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x19B) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1B9)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x55); } @@ -315,8 +315,8 @@ void TestCourse::WhatDoesThisDo(Player* player, int8_t playerId) { } void TestCourse::WhatDoesThisDoAI(Player* player, int8_t playerId) { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x19B) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1B9)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x19B) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1B9)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x55); } diff --git a/src/engine/courses/ToadsTurnpike.cpp b/src/engine/courses/ToadsTurnpike.cpp index 867fedf25..4314134ff 100644 --- a/src/engine/courses/ToadsTurnpike.cpp +++ b/src/engine/courses/ToadsTurnpike.cpp @@ -95,32 +95,32 @@ ToadsTurnpike::ToadsTurnpike() { Props.PathSizes = {1000, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_toads_turnpike_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_toads_turnpike_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_toads_turnpike_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_toads_turnpike_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -181,34 +181,34 @@ void ToadsTurnpike::BeginPlay() { } for (size_t i = 0; i < _numTrucks; i++) { - waypoint = CalculateWaypointDistribution(i, _numTrucks, gWaypointCountByPathIndex[0], 0); - gWorldInstance.AddActor(new ATruck(a, b, &D_80164550[0][0], waypoint)); + waypoint = CalculateWaypointDistribution(i, _numTrucks, gPathCountByPathIndex[0], 0); + gWorldInstance.AddActor(new ATruck(a, b, &gTrackPaths[0][0], waypoint)); } for (size_t i = 0; i < _numBuses; i++) { - waypoint = CalculateWaypointDistribution(i, _numBuses, gWaypointCountByPathIndex[0], 75); - gWorldInstance.AddActor(new ABus(a, b, &D_80164550[0][0], waypoint)); + waypoint = CalculateWaypointDistribution(i, _numBuses, gPathCountByPathIndex[0], 75); + gWorldInstance.AddActor(new ABus(a, b, &gTrackPaths[0][0], waypoint)); } for (size_t i = 0; i < _numTankerTrucks; i++) { - waypoint = CalculateWaypointDistribution(i, _numTankerTrucks, gWaypointCountByPathIndex[0], 50); - gWorldInstance.AddActor(new ATankerTruck(a, b, &D_80164550[0][0], waypoint)); + waypoint = CalculateWaypointDistribution(i, _numTankerTrucks, gPathCountByPathIndex[0], 50); + gWorldInstance.AddActor(new ATankerTruck(a, b, &gTrackPaths[0][0], waypoint)); } for (size_t i = 0; i < _numCars; i++) { - waypoint = CalculateWaypointDistribution(i, _numCars, gWaypointCountByPathIndex[0], 25); - gWorldInstance.AddActor(new ACar(a, b, &D_80164550[0][0], waypoint)); + waypoint = CalculateWaypointDistribution(i, _numCars, gPathCountByPathIndex[0], 25); + gWorldInstance.AddActor(new ACar(a, b, &gTrackPaths[0][0], waypoint)); } if (gModeSelection == VERSUS) { FVector 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][100], 100, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][150], 150, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][200], 200, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][250], 250, 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][50], 50, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][100], 100, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][150], 150, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][200], 200, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][250], 250, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } } } diff --git a/src/engine/courses/WarioStadium.cpp b/src/engine/courses/WarioStadium.cpp index 8a7e975a2..f08ba2f44 100644 --- a/src/engine/courses/WarioStadium.cpp +++ b/src/engine/courses/WarioStadium.cpp @@ -91,32 +91,32 @@ WarioStadium::WarioStadium() { Props.PathSizes = { 0x640, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 }; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*) LOAD_ASSET_RAW(d_course_wario_stadium_unknown_waypoints); + Props.PathTable[0] = (TrackPathPoint*) LOAD_ASSET_RAW(d_course_wario_stadium_unknown_waypoints); Props.PathTable[1] = NULL; Props.PathTable[2] = NULL; Props.PathTable[3] = NULL; - Props.PathTable2[0] = (TrackWaypoint*) LOAD_ASSET_RAW(d_course_wario_stadium_track_waypoints); + Props.PathTable2[0] = (TrackPathPoint*) LOAD_ASSET_RAW(d_course_wario_stadium_track_waypoints); Props.PathTable2[1] = NULL; Props.PathTable2[2] = NULL; Props.PathTable2[3] = NULL; @@ -187,13 +187,13 @@ void WarioStadium::BeginPlay() { if (gModeSelection == VERSUS) { FVector 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][100], 100, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][150], 150, 3, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][200], 200, 1, 0.8333333f)); - gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][250], 250, 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)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][50], 50, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][100], 100, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][150], 150, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][200], 200, 1, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][250], 250, 3, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); + gWorldInstance.AddObject(new OBombKart(pos, &gTrackPaths[0][0], 0, 0, 0.8333333f)); } } diff --git a/src/engine/courses/YoshiValley.cpp b/src/engine/courses/YoshiValley.cpp index 5fbcbea69..f8424e03e 100644 --- a/src/engine/courses/YoshiValley.cpp +++ b/src/engine/courses/YoshiValley.cpp @@ -84,35 +84,35 @@ YoshiValley::YoshiValley() { Props.PathSizes = {0x02B2, 0x02A8, 0x02B2, 0x0320, 1, 0, 0, 0, 0, 0, 0}; - Props.D_0D009418[0] = 4.1666665f; - Props.D_0D009418[1] = 5.5833334f; - Props.D_0D009418[2] = 6.1666665f; - Props.D_0D009418[3] = 6.75f; + Props.CurveTargetSpeed[0] = 4.1666665f; + Props.CurveTargetSpeed[1] = 5.5833334f; + Props.CurveTargetSpeed[2] = 6.1666665f; + Props.CurveTargetSpeed[3] = 6.75f; - Props.D_0D009568[0] = 3.75f; - Props.D_0D009568[1] = 5.1666665f; - Props.D_0D009568[2] = 5.75f; - Props.D_0D009568[3] = 6.3333334f; + Props.NormalTargetSpeed[0] = 3.75f; + Props.NormalTargetSpeed[1] = 5.1666665f; + Props.NormalTargetSpeed[2] = 5.75f; + Props.NormalTargetSpeed[3] = 6.3333334f; Props.D_0D0096B8[0] = 3.3333332f; Props.D_0D0096B8[1] = 3.9166667f; Props.D_0D0096B8[2] = 4.5f; Props.D_0D0096B8[3] = 5.0833334f; - Props.D_0D009808[0] = 3.75f; - Props.D_0D009808[1] = 5.1666665f; - Props.D_0D009808[2] = 5.75f; - Props.D_0D009808[3] = 6.3333334f; + Props.OffTrackTargetSpeed[0] = 3.75f; + Props.OffTrackTargetSpeed[1] = 5.1666665f; + Props.OffTrackTargetSpeed[2] = 5.75f; + Props.OffTrackTargetSpeed[3] = 6.3333334f; - Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_unknown_waypoints); - Props.PathTable[1] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_unknown_waypoints_2); - Props.PathTable[2] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_unknown_waypoints_3); - Props.PathTable[3] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_unknown_waypoints_4); + Props.PathTable[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_unknown_waypoints); + Props.PathTable[1] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_unknown_waypoints_2); + Props.PathTable[2] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_unknown_waypoints_3); + Props.PathTable[3] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_unknown_waypoints_4); - Props.PathTable2[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_track_waypoints); - Props.PathTable2[1] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_track_waypoints_2); - Props.PathTable2[2] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_track_waypoints_3); - Props.PathTable2[3] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_track_waypoints_4); + Props.PathTable2[0] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_track_waypoints); + Props.PathTable2[1] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_track_waypoints_2); + Props.PathTable2[2] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_track_waypoints_3); + Props.PathTable2[3] = (TrackPathPoint*)LOAD_ASSET_RAW(d_course_yoshi_valley_track_waypoints_4); Props.CloudTexture = (u8*) LOAD_ASSET_RAW(gTextureExhaust0); Props.Clouds = gYoshiValleyMooMooFarmClouds; @@ -230,7 +230,7 @@ void YoshiValley::RenderCredits() { } void YoshiValley::Waypoints(Player* player, int8_t playerId) { - player->nearestWaypointId = gCopyNearestWaypointByPlayerId[playerId]; + player->nearestPathPointId = gCopyNearestWaypointByPlayerId[playerId]; } void YoshiValley::ScrollingTextures() {} diff --git a/src/engine/objects/BombKart.cpp b/src/engine/objects/BombKart.cpp index 8aaaae6cf..a9dd3a22e 100644 --- a/src/engine/objects/BombKart.cpp +++ b/src/engine/objects/BombKart.cpp @@ -29,7 +29,7 @@ extern s8 gPlayerCount; size_t OBombKart::_count = 0; -OBombKart::OBombKart(FVector pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C) { +OBombKart::OBombKart(FVector pos, TrackPathPoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C) { Name = "Bomb Kart"; _idx = _count; Vec3f _pos = {0, 0, 0}; @@ -81,7 +81,7 @@ OBombKart::OBombKart(FVector pos, TrackWaypoint* waypoint, uint16_t waypointInde void OBombKart::Tick() { f32 sp118; f32 var_f18; - TrackWaypoint* temp_v0_2; + TrackPathPoint* temp_v0_2; f32 temp_f0_3; f32 sp108; f32 temp_f14; @@ -109,7 +109,7 @@ void OBombKart::Tick() { u16 temp_t6; u16 temp_t7; u16 circleTimer; - TrackWaypoint* temp_v0_4; + TrackPathPoint* temp_v0_4; Player* player; state = State; @@ -168,7 +168,7 @@ void OBombKart::Tick() { temp_t6 = (circleTimer * 0xFFFF) / 360; sp118 = coss(temp_t6) * 25.0; temp_f0_3 = sins(temp_t6) * 25.0; - temp_v0_2 = &D_80164550[0][waypoint]; + temp_v0_2 = &gTrackPaths[0][waypoint]; newPos[0] = temp_v0_2->posX + sp118; newPos[1] = CenterY + 3.5f; newPos[2] = temp_v0_2->posZ + temp_f0_3; @@ -188,7 +188,7 @@ void OBombKart::Tick() { temp_t6 = (circleTimer * 0xFFFF) / 360; sp118 = coss(temp_t6) * 25.0; temp_f0_3 = sins(temp_t6) * 25.0; - temp_v0_2 = &D_80164550[0][waypoint]; + temp_v0_2 = &gTrackPaths[0][waypoint]; newPos[0] = temp_v0_2->posX + sp118; newPos[1] = CenterY + 3.5f; newPos[2] = temp_v0_2->posZ + temp_f0_3; @@ -209,19 +209,19 @@ void OBombKart::Tick() { break; case States::PODIUM_CEREMONY: - if ((D_8016347C == 0) || (gNearestWaypointByPlayerId[3] < 5)) { + if ((D_8016347C == 0) || (gNearestPathPointByPlayerId[3] < 5)) { break; } else { waypoint = func_8000D2B4(newPos[0], newPos[1], newPos[2], waypoint, 3); - if ((waypoint < 0) || (gWaypointCountByPathIndex[3] < waypoint)) { + if ((waypoint < 0) || (gPathCountByPathIndex[3] < waypoint)) { waypoint = 0; } if (((s32) waypoint) < 0x1A) { - temp_v0_2 = &D_80164550[3][(waypoint + 1) % gWaypointCountByPathIndex[3]]; + temp_v0_2 = &gTrackPaths[3][(waypoint + 1) % gPathCountByPathIndex[3]]; D_80162FB0[0] = temp_v0_2->posX; D_80162FB0[1] = temp_v0_2->posY; D_80162FB0[2] = temp_v0_2->posZ; - temp_v0_4 = &D_80164550[3][(waypoint + 2) % gWaypointCountByPathIndex[3]]; + temp_v0_4 = &gTrackPaths[3][(waypoint + 2) % gPathCountByPathIndex[3]]; D_80162FC0[0] = temp_v0_4->posX; D_80162FC0[1] = temp_v0_4->posY; D_80162FC0[2] = temp_v0_4->posZ; @@ -260,11 +260,11 @@ void OBombKart::Tick() { } break; case States::EXPLODE: - temp_v0_2 = &D_80164550[0][waypoint]; + temp_v0_2 = &gTrackPaths[0][waypoint]; D_80162FB0[0] = temp_v0_2->posX; D_80162FB0[1] = temp_v0_2->posY; D_80162FB0[2] = temp_v0_2->posZ; - temp_v0_4 = &D_80164550[0][(waypoint + 1) % gWaypointCountByPathIndex[0]]; + temp_v0_4 = &gTrackPaths[0][(waypoint + 1) % gPathCountByPathIndex[0]]; D_80162FC0[0] = temp_v0_4->posX; D_80162FC0[1] = temp_v0_4->posY; D_80162FC0[2] = temp_v0_4->posZ; @@ -429,7 +429,7 @@ void OBombKart::Waypoint(s32 screenId) { s32 bombWaypoint; s32 waypointDiff; - playerWaypoint = gNearestWaypointByPlayerId[screenId]; + playerWaypoint = gNearestPathPointByPlayerId[screenId]; playerHUD[screenId].unk_74 = 0; if ((State == States::EXPLODE) || (State == States::DISABLED)) { return; }; bombWaypoint = WaypointIndex; diff --git a/src/engine/objects/BombKart.h b/src/engine/objects/BombKart.h index 29069a00f..86c2c0ef3 100644 --- a/src/engine/objects/BombKart.h +++ b/src/engine/objects/BombKart.h @@ -18,12 +18,12 @@ extern "C" { /** * Used in VS mode - * + * * This differs from the other vehicle classes in that it does not get added to the standard actor list * So this is sort of its own thing. Draw call in different place too. */ class OBombKart : public OObject { -public: + public: enum States : uint16_t { // 0,1,3,5 DISABLED, CCW, @@ -39,7 +39,7 @@ public: Vec3f Pos; Vec3f WheelPos[4]; //! @todo Turn WheelPos into a struct f32 Unk_3C; - u16 SomeRot; // Some angle + u16 SomeRot; // Some angle u16 WaypointIndex; // The waypoint the kart circles States State = States::DISABLED; u16 BounceTimer = 0; @@ -50,7 +50,7 @@ public: Collision _Collision; // Set waypoint to NULL if using a spawn position and not a waypoint. - explicit OBombKart(FVector pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C); + explicit OBombKart(FVector pos, TrackPathPoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C); ~OBombKart() { _count--; @@ -66,7 +66,8 @@ public: void SomeRender(Vec3f arg1); void LoadMtx(); void Waypoint(s32 screenId); -private: + + private: static size_t _count; s32 _idx; Player* FindTarget(); @@ -74,6 +75,4 @@ private: Vec3f _spawnPos; Player* _target = NULL; - - }; diff --git a/src/engine/objects/Boos.cpp b/src/engine/objects/Boos.cpp index 5f02d7876..dbd380901 100644 --- a/src/engine/objects/Boos.cpp +++ b/src/engine/objects/Boos.cpp @@ -34,7 +34,6 @@ OBoos::OBoos(size_t numBoos, const IPathSpan& leftBoundary, const IPathSpan& act _indices.resize(numBoos, 0); - // Generate objects for (size_t i = 0; i < numBoos; i++) { find_unused_obj_index(&_indices[i]); @@ -55,7 +54,7 @@ void OBoos::Tick() { OBoos::func_8007CA70(); for (size_t i = 0; i < _numBoos; i++) { - objectIndex = _indices[i]; //indexObjectList3[i]; + objectIndex = _indices[i]; // indexObjectList3[i]; object = &gObjectList[objectIndex]; if (object->state != 0) { func_8007C684(objectIndex); @@ -83,7 +82,7 @@ void OBoos::Draw(s32 cameraId) { s32 objectIndex; for (size_t i = 0; i < _numBoos; i++) { - objectIndex = _indices[i]; //indexObjectList3[i]; + objectIndex = _indices[i]; // indexObjectList3[i]; if (gObjectList[objectIndex].state >= 2) { temp_s2 = func_8008A364(objectIndex, cameraId, 0x4000U, 0x00000320); if (CVarGetInteger("gNoCulling", 0) == 1) { @@ -111,7 +110,7 @@ void OBoos::func_800523B8(s32 objectIndex, s32 arg1, u32 arg2) { object = &gObjectList[objectIndex]; object->orientation[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos); func_800484BC(object->pos, object->orientation, object->sizeScaling, object->primAlpha, (u8*) object->activeTLUT, - (u8*)object->activeTexture, object->vertex, 0x00000030, 0x00000028, 0x00000030, 0x00000028); + (u8*) object->activeTexture, object->vertex, 0x00000030, 0x00000028, 0x00000030, 0x00000028); if ((is_obj_flag_status_active(objectIndex, 0x00000020) != 0) && (arg2 < 0x15F91U)) { func_8004A630(&D_8018C830, object->pos, 0.4f); } @@ -123,14 +122,14 @@ void OBoos::func_8007CA70(void) { if (_isActive == false) { _playerId = OBoos::func_8007C9F8(); - point = &gNearestWaypointByPlayerId[_playerId]; + point = &gNearestPathPointByPlayerId[_playerId]; if ((*point > _active.Start) && (*point < _active.End)) { // First group entrance OBoos::BooStart(0, _playerId); } } if (_isActive == true) { - point = &gNearestWaypointByPlayerId[_playerId]; + point = &gNearestPathPointByPlayerId[_playerId]; if ((*point > _leftBoundary.Start) && (*point < _leftBoundary.End)) { // First group exit reverse direction @@ -146,7 +145,7 @@ void OBoos::func_8007CA70(void) { void OBoos::func_8007C5B4(s32 objectIndex) { Object* object; - init_texture_object(objectIndex, (u8*)d_course_banshee_boardwalk_boo_tlut, gTextureGhosts, 48, 40); + init_texture_object(objectIndex, (u8*) d_course_banshee_boardwalk_boo_tlut, gTextureGhosts, 48, 40); object = &gObjectList[objectIndex]; object->pos[0] = 0.0f; object->pos[1] = 0.0f; @@ -269,7 +268,7 @@ void OBoos::BooStart(s32 group, s32 playerId) { void OBoos::BooExit(s32 group) { s32 objectIndex; for (size_t i = 0; i < _numBoos; i++) { - objectIndex = _indices[i]; //indexObjectList3[group + temp_a0]; + objectIndex = _indices[i]; // indexObjectList3[group + temp_a0]; gObjectList[objectIndex].unk_0DC += 1; } diff --git a/src/engine/objects/ChainChomp.cpp b/src/engine/objects/ChainChomp.cpp index 695df1e8a..0d7ec6bc9 100644 --- a/src/engine/objects/ChainChomp.cpp +++ b/src/engine/objects/ChainChomp.cpp @@ -65,12 +65,12 @@ void OChainChomp::func_80055AB8(s32 objectIndex, s32 cameraId) { D_80183E80[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos); D_80183E80[2] = 0x8000; - func_800468E0(D_80183E40, D_80183E80, 0.54f, (u8*)d_course_rainbow_road_sphere, (Vtx*)D_0D0062B0, 0x00000020, - 0x00000040, 0x00000020, 0x00000040, 5); + func_800468E0(D_80183E40, D_80183E80, 0.54f, (u8*) d_course_rainbow_road_sphere, (Vtx*) D_0D0062B0, + 0x00000020, 0x00000040, 0x00000020, 0x00000040, 5); } else { rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].direction_angle, gObjectList[objectIndex].sizeScaling); - gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0077D0); + gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D0077D0); render_animated_model((Armature*) gObjectList[objectIndex].model, (Animation**) gObjectList[objectIndex].vertex, 0, (s16) gObjectList[objectIndex].textureListIndex); @@ -79,7 +79,7 @@ void OChainChomp::func_80055AB8(s32 objectIndex, s32 cameraId) { } void OChainChomp::func_80085878(s32 objectIndex, s32 arg1) { - TrackWaypoint* temp_v0; + TrackPathPoint* temp_v0; Object* object; object = &gObjectList[objectIndex]; @@ -91,7 +91,7 @@ void OChainChomp::func_80085878(s32 objectIndex, s32 arg1) { set_object_flag(objectIndex, 0x04000200); object->unk_084[8] = (arg1 * 0x12C) + 0x1F4; set_obj_origin_pos(objectIndex, 0.0f, -15.0f, 0.0f); - temp_v0 = &D_80164490[(u16) object->unk_084[8]]; + temp_v0 = &gCurrentTrackPath[(u16) object->unk_084[8]]; set_obj_origin_offset(objectIndex, temp_v0->posX, temp_v0->posY, temp_v0->posZ); set_obj_direction_angle(objectIndex, 0U, 0U, 0U); object->unk_034 = 4.0f; @@ -99,7 +99,6 @@ void OChainChomp::func_80085878(s32 objectIndex, s32 arg1) { object_next_state(objectIndex); } - void OChainChomp::func_800859C8(s32 objectIndex, s32 arg1) { Object* object; @@ -119,8 +118,3 @@ void OChainChomp::func_800859C8(s32 objectIndex, s32 arg1) { } func_80074344(objectIndex, &object->surfaceHeight, -0.8f, 0.8f, 0.03f, 0, -1); } - - - - - diff --git a/src/engine/objects/CheepCheep.cpp b/src/engine/objects/CheepCheep.cpp index 5b4157c61..ed489dc88 100644 --- a/src/engine/objects/CheepCheep.cpp +++ b/src/engine/objects/CheepCheep.cpp @@ -57,22 +57,22 @@ void OCheepCheep::Draw(s32 cameraId) { // func_8005217C object = &gObjectList[temp_a3]; if (object->state >= 2) { if (is_obj_flag_status_active(temp_a3, 0x10) != 0) { - rsp_set_matrix_transformation(object->pos, object->direction_angle, object->sizeScaling); - func_800520C0(temp_a3); + rsp_set_matrix_transformation(object->pos, object->direction_angle, object->sizeScaling); + func_800520C0(temp_a3); - gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007828); + gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007828); gSPLight(gDisplayListHead++, &D_800E45C0l[0].l[0], LIGHT_1); gSPLight(gDisplayListHead++, &D_800E45C0l[0].a, LIGHT_2); - gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_banshee_boardwalk_dl_7B38); + gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_banshee_boardwalk_dl_7B38); gSPLight(gDisplayListHead++, &D_800E45C0l[1].l[0], LIGHT_1); gSPLight(gDisplayListHead++, &D_800E45C0l[1].a, LIGHT_2); - gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_banshee_boardwalk_dl_7978); + gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_banshee_boardwalk_dl_7978); gSPLight(gDisplayListHead++, &D_800E45C0l[2].l[0], LIGHT_1); gSPLight(gDisplayListHead++, &D_800E45C0l[2].a, LIGHT_2); - gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_banshee_boardwalk_dl_78C0); + gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_banshee_boardwalk_dl_78C0); gSPLight(gDisplayListHead++, &D_800E45C0l[3].l[0], LIGHT_1); gSPLight(gDisplayListHead++, &D_800E45C0l[3].a, LIGHT_2); - gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_banshee_boardwalk_dl_7650); + gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_banshee_boardwalk_dl_7650); } } } @@ -84,7 +84,7 @@ void OCheepCheep::func_8007BBBC(s32 objectIndex) { object = &gObjectList[objectIndex]; switch (object->state) { case 1: - func_800735BC(objectIndex, (Gfx*)d_course_banshee_boardwalk_dl_cheep_cheep, 2.0f); + func_800735BC(objectIndex, (Gfx*) d_course_banshee_boardwalk_dl_cheep_cheep, 2.0f); set_object_flag(objectIndex, 0x00000010); object->unk_0D5 = 0; break; @@ -115,8 +115,8 @@ void OCheepCheep::func_8007BD04(s32 playerId) { objectIndex = indexObjectList2[0]; if (gObjectList[objectIndex].state == 0) { - if (((s32) gNearestWaypointByPlayerId[playerId] >= _span.Start) && - ((s32) gNearestWaypointByPlayerId[playerId] <= _span.End)) { + if (((s32) gNearestPathPointByPlayerId[playerId] >= _span.Start) && + ((s32) gNearestPathPointByPlayerId[playerId] <= _span.End)) { set_obj_origin_pos(objectIndex, xOrientation * _spawnPos.x, _spawnPos.y, _spawnPos.z); init_object(objectIndex, 1); } @@ -129,7 +129,7 @@ void OCheepCheep::init_var_cheep_cheep(s32 objectIndex) { object = &gObjectList[objectIndex]; object->unk_0D5 = 1; object->status = 0; - object->model = (Gfx*)d_course_banshee_boardwalk_dl_cheep_cheep; + object->model = (Gfx*) d_course_banshee_boardwalk_dl_cheep_cheep; object->sizeScaling = 0.2f; object_next_state(objectIndex); set_obj_origin_pos(objectIndex, D_800E634C[0][0], D_800E634C[0][1] + 55.0, D_800E634C[0][2]); diff --git a/src/engine/objects/Mole.cpp b/src/engine/objects/Mole.cpp index f623b1f52..752670679 100644 --- a/src/engine/objects/Mole.cpp +++ b/src/engine/objects/Mole.cpp @@ -221,8 +221,8 @@ void OMole::func_80081D34(s32 objectIndex) { player->soundEffects |= 2; } object->direction_angle[1] = camera->rot[1]; - object->velocity[1] = (player->unk_094 / 2) + 3.0; - object->unk_034 = player->unk_094 + 1.0; + object->velocity[1] = (player->speed / 2) + 3.0; + object->unk_034 = player->speed + 1.0; if (object->velocity[1] >= 5.0) { object->velocity[1] = 5.0f; } diff --git a/src/engine/objects/Thwomp.cpp b/src/engine/objects/Thwomp.cpp index 9919b43b7..b783395b7 100644 --- a/src/engine/objects/Thwomp.cpp +++ b/src/engine/objects/Thwomp.cpp @@ -130,7 +130,6 @@ void OThwomp::Tick60fps() { // func_80081210 if (is_obj_flag_status_active(_objectIndex, 0x00010000) != 0) { OThwomp::func_80080A4C(_objectIndex, var_s4); } - } OThwomp::func_8007542C(3); @@ -191,8 +190,8 @@ void OThwomp::func_80081080(s32 objectIndex) { Object* object; object = &gObjectList[objectIndex]; - object->activeTexture = (const char*)D_8018D490; - object->textureList = (const char**)D_8018D490; + object->activeTexture = (const char*) D_8018D490; + object->textureList = (const char**) D_8018D490; object->primAlpha = 0x00FF; object->direction_angle[1] = 0; object->orientation[0] = 0; @@ -361,7 +360,7 @@ void OThwomp::func_8007F8D8() { if (var_s4 != 0) { for (var_s0 = 0; var_s0 < 4; var_s0++, player++) { - if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_KART_AI)) { + if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_CPU)) { if (OThwomp::func_8007F75C(var_s0) != 0) { break; } @@ -376,7 +375,7 @@ s32 OThwomp::func_8007F75C(s32 playerId) { s32 var_s6; s32 waypoint; - waypoint = gNearestWaypointByPlayerId[playerId]; + waypoint = gNearestPathPointByPlayerId[playerId]; var_s6 = 0; if ((waypoint >= 0xAA) && (waypoint < 0xB5)) { if (_idx == 0) { @@ -615,20 +614,20 @@ void OThwomp::func_8007F6C4(s32 objectIndex, s32 playerId) { void OThwomp::func_80080B28(s32 objectIndex, s32 playerId) { f32 temp_f0; - Player* temp_s0; + Player* player; - temp_s0 = &gPlayerOne[playerId]; + player = &gPlayerOne[playerId]; if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) { - if (!(temp_s0->soundEffects & 0x100)) { - temp_f0 = func_80088F54(objectIndex, temp_s0); - if ((temp_f0 <= 9.0) && !(temp_s0->effects & 0x04000000) && - (has_collided_horizontally_with_player(objectIndex, temp_s0) != 0)) { - if ((temp_s0->type & 0x8000) && !(temp_s0->type & 0x100)) { - if (!(temp_s0->effects & 0x200)) { + if (!(player->soundEffects & 0x100)) { + temp_f0 = func_80088F54(objectIndex, player); + if ((temp_f0 <= 9.0) && !(player->effects & 0x04000000) && + (has_collided_horizontally_with_player(objectIndex, player) != 0)) { + if ((player->type & 0x8000) && !(player->type & 0x100)) { + if (!(player->effects & 0x200)) { func_80089474(objectIndex, playerId, 1.4f, 1.1f, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x4C)); } else if (func_80072354(objectIndex, 0x00000040) != 0) { - if (temp_s0->type & 0x1000) { - func_800C98B8(temp_s0->pos, temp_s0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A)); + if (player->type & 0x1000) { + func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A)); } else { func_800C9060((u8) playerId, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A)); } @@ -641,21 +640,21 @@ void OThwomp::func_80080B28(s32 objectIndex, s32 playerId) { } } } else if ((temp_f0 <= 17.5) && (func_80072320(objectIndex, 1) != 0) && - (is_within_horizontal_distance_of_player(objectIndex, temp_s0, (temp_s0->unk_094 * 0.5) + _boundingBoxSize) != - 0)) { - if ((temp_s0->type & 0x8000) && !(temp_s0->type & 0x100)) { + (is_within_horizontal_distance_of_player(objectIndex, player, + (player->speed * 0.5) + _boundingBoxSize) != 0)) { + if ((player->type & 0x8000) && !(player->type & 0x100)) { if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) { func_80072180(); } func_800722A4(objectIndex, 2); - temp_s0->unk_040 = (s16) objectIndex; - temp_s0->unk_046 |= 2; - temp_s0->soundEffects |= 0x100; - func_80088FF0(temp_s0); + player->unk_040 = (s16) objectIndex; + player->unk_046 |= 2; + player->soundEffects |= 0x100; + func_80088FF0(player); } } } else { - func_80088FF0(temp_s0); + func_80088FF0(player); } } } @@ -693,29 +692,29 @@ void OThwomp::Draw(s32 cameraId) { OThwomp::DrawModel(objectIndex); } - gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0079C8); + gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D0079C8); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA); gSPNumLights(gDisplayListHead++, 1); gSPLight(gDisplayListHead++, &D_800E4668.l[0], LIGHT_1); gSPLight(gDisplayListHead++, &D_800E4668.a, LIGHT_2); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BOTH); gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_LIGHTING | G_SHADING_SMOOTH); - load_texture_block_rgba16_mirror((u8*)d_course_bowsers_castle_thwomp_side, 0x00000020, 0x00000020); + load_texture_block_rgba16_mirror((u8*) d_course_bowsers_castle_thwomp_side, 0x00000020, 0x00000020); for (i = 0; i < gObjectParticle3_SIZE; i++) { objectIndex = gObjectParticle3[i]; if (objectIndex != NULL_OBJECT_ID) { object = &gObjectList[objectIndex]; if ((object->state > 0) && (State == MOVE_FAR) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) { rsp_set_matrix_transformation(object->pos, object->orientation, object->sizeScaling); - gSPVertex(gDisplayListHead++, (uintptr_t)D_0D005C00, 3, 0); - gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D006930); + gSPVertex(gDisplayListHead++, (uintptr_t) D_0D005C00, 3, 0); + gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D006930); } } } gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); gSPTexture(gDisplayListHead++, 0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF); - gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007AE0); + gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007AE0); load_texture_block_ia8_nomirror(D_8018D490, 0x00000020, 0x00000020); func_8004B3C8(0); D_80183E80[0] = 0; @@ -727,7 +726,7 @@ void OThwomp::Draw(s32 cameraId) { if ((object->state >= 2) && (State == MOVE_AND_ROTATE) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) { func_8004B138(0x000000FF, 0x000000FF, 0x000000FF, (s32) object->primAlpha); D_80183E80[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos); - func_800431B0(object->pos, D_80183E80, object->sizeScaling, (Vtx*)D_0D005AE0); + func_800431B0(object->pos, D_80183E80, object->sizeScaling, (Vtx*) D_0D005AE0); } } } @@ -739,10 +738,10 @@ void OThwomp::DrawModel(s32 objectIndex) { rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation, gObjectList[objectIndex].sizeScaling); OThwomp::ThwompLights(objectIndex); - gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007828); + gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007828); gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); gDPLoadTLUT_pal256(gDisplayListHead++, d_course_bowsers_castle_thwomp_tlut); - rsp_load_texture_mask((u8*)gObjectList[objectIndex].activeTexture, 0x00000010, 0x00000040, 4); + rsp_load_texture_mask((u8*) gObjectList[objectIndex].activeTexture, 0x00000010, 0x00000040, 4); gSPDisplayList(gDisplayListHead++, gObjectList[objectIndex].model); } } @@ -840,9 +839,9 @@ void OThwomp::func_8007EC30(s32 objectIndex) { set_obj_direction_angle(objectIndex, 0U, _faceDirection, 0U); set_obj_orientation(objectIndex, 0U, _faceDirection, 0U); } - init_texture_object(objectIndex, (uint8_t*) d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces, - 0x10U, (u16) 0x00000040); - object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp; + init_texture_object(objectIndex, (uint8_t*) d_course_bowsers_castle_thwomp_tlut, + (const char**) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + object->model = (Gfx*) d_course_bowsers_castle_dl_thwomp; object->unk_01C[1] = 30.0f; set_object_flag(objectIndex, 0x05000220); object->type = 0; @@ -877,10 +876,10 @@ void OThwomp::MoveAndRotateBehaviour(s32 objectIndex) { // func_8007F5A8 void OThwomp::func_8007EE5C(s32 objectIndex) { Object* object; - init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces, - 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, (u8*) d_course_bowsers_castle_thwomp_tlut, + (const char**) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); object = &gObjectList[objectIndex]; - object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp; + object->model = (Gfx*) d_course_bowsers_castle_dl_thwomp; set_object_flag(objectIndex, 0x04000220); object->type = 0; object->unk_0DF = 6; @@ -930,10 +929,10 @@ void OThwomp::MoveFarBehaviour(s32 objectIndex) { // func_8007FFC0 void OThwomp::func_8007FA08(s32 objectIndex) { Object* object; - init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces, - 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, (u8*) d_course_bowsers_castle_thwomp_tlut, + (const char**) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); object = &gObjectList[objectIndex]; - object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp; + object->model = (Gfx*) d_course_bowsers_castle_dl_thwomp; set_object_flag(objectIndex, 0x04000220); object->type = 0; object->surfaceHeight = 0.0f; @@ -980,7 +979,7 @@ void OThwomp::func_8007FB48(s32 objectIndex) { func_80086FD4(objectIndex); break; case 2: - gObjectList[objectIndex].velocity[0] = player->unk_094 * xOrientation * 1.25; + gObjectList[objectIndex].velocity[0] = player->speed * xOrientation * 1.25; if (gObjectList[objectIndex].unk_048 >= gObjectList[objectIndex].unk_0B0) { if (gObjectList[objectIndex].unk_0B0 == gObjectList[objectIndex].unk_048) { if (_rand & 1) { // D_8018D400 & 1 @@ -1096,10 +1095,10 @@ void OThwomp::StationaryFastBehaviour(s32 objectIndex) { // func_800801FC void OThwomp::func_80080078(s32 objectIndex) { // func_80080078 Object* object; - init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces, - 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, (u8*) d_course_bowsers_castle_thwomp_tlut, + (const char**) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); object = &gObjectList[objectIndex]; - object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp; + object->model = (Gfx*) d_course_bowsers_castle_dl_thwomp; set_object_flag(objectIndex, 0x04000220); object->type = 2; object->unk_0DF = 8; @@ -1167,11 +1166,11 @@ void OThwomp::func_800802C0(s32 objectIndex) { object = &gObjectList[objectIndex]; object->unk_0D8 = 0; - init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces, - 0x10U, (u16) 0x00000040); - object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp; + init_texture_object(objectIndex, (u8*) d_course_bowsers_castle_thwomp_tlut, + (const char**) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + object->model = (Gfx*) d_course_bowsers_castle_dl_thwomp; object->textureListIndex = 0; - //object->sizeScaling = 1.5f; + // object->sizeScaling = 1.5f; set_object_flag(objectIndex, 0x05000220); object->type = 1; object->unk_0DF = 6; @@ -1193,7 +1192,7 @@ void OThwomp::func_800802C0(s32 objectIndex) { } void OThwomp::SlidingBehaviour(s32 objectIndex) { // func_800808CC - switch (gObjectList[objectIndex].state) { /* irregular */ + switch (gObjectList[objectIndex].state) { /* irregular */ case 0: break; case 1: @@ -1277,10 +1276,10 @@ void OThwomp::func_8008078C(s32 objectIndex) { void OThwomp::func_80080524(s32 objectIndex) { Object* object; - init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces, - 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, (u8*) d_course_bowsers_castle_thwomp_tlut, + (const char**) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); object = &gObjectList[objectIndex]; - object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp; + object->model = (Gfx*) d_course_bowsers_castle_dl_thwomp; object->textureListIndex = 0; set_object_flag(objectIndex, 0x04000220); object->type = 0; diff --git a/src/engine/vehicles/Boat.cpp b/src/engine/vehicles/Boat.cpp index 073974581..44e68da1a 100644 --- a/src/engine/vehicles/Boat.cpp +++ b/src/engine/vehicles/Boat.cpp @@ -27,7 +27,7 @@ ABoat::ABoat(f32 speed, u32 waypoint) { std::fill(SmokeParticles, SmokeParticles + 128, NULL_OBJECT_ID); waypointOffset = waypoint; - temp_a2 = &gVehicle2DWaypoint[waypointOffset]; + temp_a2 = &gVehicle2DPathPoint[waypointOffset]; Position[0] = temp_a2->x; Position[1] = D_80162EB2; Position[2] = temp_a2->z; @@ -44,21 +44,17 @@ ABoat::ABoat(f32 speed, u32 waypoint) { if (IsActive == 1) { f32 origXPos = Position[0]; f32 origZPos = Position[2]; - RotY = update_vehicle_following_waypoint( - Position, (s16*) &WaypointIndex, - Speed); + RotY = update_vehicle_following_path(Position, (s16*) &WaypointIndex, Speed); Velocity[0] = Position[0] - origXPos; Velocity[2] = Position[2] - origZPos; vec3s_set(paddleWheelBoatRot, 0, RotY, 0); - ActorIndex = add_actor_to_empty_slot(Position, paddleWheelBoatRot, - Velocity, ACTOR_PADDLE_BOAT); + ActorIndex = add_actor_to_empty_slot(Position, paddleWheelBoatRot, Velocity, ACTOR_PADDLE_BOAT); } _count++; } void ABoat::Draw(Camera* camera) { - } bool ABoat::IsMod() { @@ -84,22 +80,20 @@ void ABoat::Tick() { temp_f26 = Position[0]; temp_f28 = Position[1]; temp_f30 = Position[2]; - update_vehicle_following_waypoint(Position, (s16*) &WaypointIndex, - Speed); - SomeFlags = set_vehicle_render_distance_flags(Position, BOAT_SMOKE_RENDER_DISTANCE, - SomeFlags); + update_vehicle_following_path(Position, (s16*) &WaypointIndex, Speed); + SomeFlags = set_vehicle_render_distance_flags(Position, BOAT_SMOKE_RENDER_DISTANCE, SomeFlags); if ((((s16) AnotherSmokeTimer % 10) == 0) && (SomeFlags != 0)) { smokePos[0] = (f32) ((f64) Position[0] - 30.0); smokePos[1] = (f32) ((f64) Position[1] + 180.0); smokePos[2] = (f32) ((f64) Position[2] + 45.0); adjust_position_by_angle(smokePos, Position, RotY); - //spawn_ferry_smoke(Index, smokePos, 1.1f); + // spawn_ferry_smoke(Index, smokePos, 1.1f); AddSmoke(Index, smokePos, 1.1f); smokePos[0] = (f32) ((f64) Position[0] + 30.0); smokePos[1] = (f32) ((f64) Position[1] + 180.0); smokePos[2] = (f32) ((f64) Position[2] + 45.0); adjust_position_by_angle(smokePos, Position, RotY); - //spawn_ferry_smoke(Index, smokePos, 1.1f); + // spawn_ferry_smoke(Index, smokePos, 1.1f); AddSmoke(Index, smokePos, 1.1f); } if (random_int(100) == 0) { @@ -112,11 +106,11 @@ void ABoat::Tick() { sp94[0] = temp_f26; sp94[1] = temp_f28; sp94[2] = temp_f30; - waypoint = &gVehicle2DWaypoint[(WaypointIndex + 5) % gVehicle2DWaypointLength]; + waypoint = &gVehicle2DPathPoint[(WaypointIndex + 5) % gVehicle2DPathLength]; sp88[0] = (f32) waypoint->x; sp88[1] = (f32) D_80162EB0; sp88[2] = (f32) waypoint->z; - temp_a1 = get_angle_between_waypoints(sp94, sp88); + temp_a1 = get_angle_between_path(sp94, sp88); temp = temp_a1 - RotY; var_v1 = temp; if (var_v1 < 0) { @@ -182,9 +176,8 @@ void ABoat::VehicleCollision(s32 playerId, Player* player) { z_diff = playerZ - Position[2]; if ((x_diff > -300.0) && (x_diff < 300.0)) { if ((z_diff > -300.0) && (z_diff < 300.0)) { - if ((func_80006018(Position[0], Position[2], - Velocity[0], Velocity[2], 200.0f, - 60.0f, playerX, playerZ) == 1) && + if ((is_collide_with_vehicle(Position[0], Position[2], Velocity[0], Velocity[2], 200.0f, 60.0f, + playerX, playerZ) == 1) && (y_diff < 60.0)) { player->soundEffects |= 0x80000; } diff --git a/src/engine/vehicles/Bus.cpp b/src/engine/vehicles/Bus.cpp index c58cd0a6c..57ff16bff 100644 --- a/src/engine/vehicles/Bus.cpp +++ b/src/engine/vehicles/Bus.cpp @@ -18,11 +18,11 @@ extern s8 gPlayerCount; size_t ABus::_count = 0; -ABus::ABus(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) { +ABus::ABus(f32 speedA, f32 speedB, TrackPathPoint* path, uint32_t waypoint) { Name = "Bus"; - TrackWaypoint* temp_v0; + TrackPathPoint* temp_v0; u16 waypointOffset; - s32 numWaypoints = gWaypointCountByPathIndex[0]; + s32 numWaypoints = gPathCountByPathIndex[0]; Index = _count; @@ -49,17 +49,14 @@ ABus::ABus(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) { } Rotation[0] = 0; Rotation[2] = 0; - if (D_8016347A == 0) { - Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + if (gIsInExtra == 0) { + Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - Rotation[1] = - func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); + Rotation[1] = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } - D_801631C8 = 10; + sVehicleSoundRenderCounter = 10; - spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, - Speed); + spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, Speed); ActorIndex = add_actor_to_empty_slot(Position, Rotation, Velocity, ACTOR_SCHOOL_BUS); _count++; @@ -75,12 +72,13 @@ void ABus::Draw(Camera* camera) { s32 waypointCount; u16 temp_a1; - waypointCount = gWaypointCountByPathIndex[0]; - if (!(gPlayers[camera->playerId].unk_094 < 1.6666666666666667)) { + waypointCount = gPathCountByPathIndex[0]; + if (!(gPlayers[camera->playerId].speed < 1.6666666666666667)) { temp_a1 = WaypointIndex; for (var_v0 = 0; var_v0 < 0x18; var_v0 += 3) { - if (((sSomeNearestWaypoint + var_v0) % waypointCount) == temp_a1) { - D_801634F8[camera->playerId].unk4 = func_800145A8(SomeType, D_80163068[camera->playerId], temp_a1); + if (((sSomeNearestPathPoint + var_v0) % waypointCount) == temp_a1) { + gPlayerTrackPositionFactorInstruction[camera->playerId].target = + player_track_position_factor_vehicle(SomeType, gTrackPositionFactor[camera->playerId], temp_a1); return; } } @@ -118,12 +116,10 @@ void ABus::Tick() { SomeMultiplierTheSequel = temp_f0_2; } } - if (D_8016347A == 0) { - var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + if (gIsInExtra == 0) { + var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0); + var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } adjust_angle(&Rotation[1], var_a1, 100); temp_f0_3 = Position[0] - sp5C; @@ -161,7 +157,7 @@ void ABus::VehicleCollision(s32 playerId, Player* player) { f32 spC0; f32 spBC; - if (((D_801631E0[playerId] != 1) || ((((player->type & PLAYER_HUMAN) != 0)) && !(player->type & PLAYER_KART_AI))) && + if (((D_801631E0[playerId] != 1) || ((((player->type & PLAYER_HUMAN) != 0)) && !(player->type & PLAYER_CPU))) && !(player->effects & 0x01000000)) { spC4 = player->pos[0]; @@ -176,18 +172,18 @@ void ABus::VehicleCollision(s32 playerId, Player* player) { if ((temp_f22 > -20.0) && (temp_f22 < 20.0)) { if (((temp_f14) > -100.0) && ((temp_f14) < 100.0)) { - if (func_80006018(Position[0], Position[2], Velocity[0], - Velocity[2], SomeArg3, SomeArg4, spC4, spBC) == (s32) 1) { + if (is_collide_with_vehicle(Position[0], Position[2], Velocity[0], Velocity[2], SomeArg3, SomeArg4, + spC4, spBC) == (s32) 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } } } } - if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_KART_AI)) { + if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_CPU)) { if (((temp_f12) > -300.0) && ((temp_f12) < 300.0) && ((temp_f22 > -20.0)) && (temp_f22 < 20.0) && (((temp_f14) > -300.0)) && ((temp_f14) < 300.0)) { - if ((D_801631C8 > 0) && (SomeFlags == 0)) { - D_801631C8 -= 1; + if ((sVehicleSoundRenderCounter > 0) && (SomeFlags == 0)) { + sVehicleSoundRenderCounter -= 1; SomeFlags |= (RENDER_VEHICLE << playerId); func_800C9D80(Position, Velocity, SoundBits); } @@ -195,7 +191,7 @@ void ABus::VehicleCollision(s32 playerId, Player* player) { if (SomeFlags != 0) { SomeFlags &= ~(RENDER_VEHICLE << playerId); if (SomeFlags == 0) { - D_801631C8 += 1; + sVehicleSoundRenderCounter += 1; func_800C9EF4(Position, SoundBits); } } @@ -206,31 +202,31 @@ void ABus::VehicleCollision(s32 playerId, Player* player) { if (!(SomeFlagsTheSequel & ((1 << playerId)))) { s32 var_s1 = 0; - u16 path = gWaypointCountByPathIndex[0]; + u16 path = gPathCountByPathIndex[0]; s32 t1; s32 t2; - switch (D_8016347A) { + switch (gIsInExtra) { case 0: - t1 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 10, 0, - path); - if ((D_80163270[playerId] == 0) && (t1 > 0) && (player->unk_094 < Speed)) { + t1 = is_path_point_in_range(WaypointIndex, gNearestPathPointByPlayerId[playerId], 10, 0, + path); + if ((gIsPlayerWrongDirection[playerId] == 0) && (t1 > 0) && (player->speed < Speed)) { var_s1 = 1; } - if ((D_80163270[playerId] == 1) && (t1 > 0)) { + if ((gIsPlayerWrongDirection[playerId] == 1) && (t1 > 0)) { var_s1 = 1; } break; case 1: - t2 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 0, 10, - path); + t2 = is_path_point_in_range(WaypointIndex, gNearestPathPointByPlayerId[playerId], 0, 10, + path); if (t2 > 0) { if (random_int(2) == 0) { - // temp_v1_2 = D_80163270[playerId]; - if (D_80163270[playerId] == 0) { + // temp_v1_2 = gIsPlayerWrongDirection[playerId]; + if (gIsPlayerWrongDirection[playerId] == 0) { var_s1 = 1; } - if ((D_80163270[playerId] == 1) && (player->unk_094 < Speed)) { + if ((gIsPlayerWrongDirection[playerId] == 1) && (player->speed < Speed)) { var_s1 = 1; } } else { diff --git a/src/engine/vehicles/Bus.h b/src/engine/vehicles/Bus.h index c7f3f475e..e1920dd7f 100644 --- a/src/engine/vehicles/Bus.h +++ b/src/engine/vehicles/Bus.h @@ -12,8 +12,7 @@ extern "C" { } class ABus : public AActor { - public: - + public: const char* Type; size_t Index; f32 Speed; @@ -31,7 +30,7 @@ class ABus : public AActor { f32 SomeArg4 = 12.5f; u32 SoundBits = SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x03); - explicit ABus(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint); + explicit ABus(f32 speedA, f32 speedB, TrackPathPoint* path, uint32_t waypoint); ~ABus() { _count--; @@ -46,6 +45,6 @@ class ABus : public AActor { virtual void VehicleCollision(s32 playerId, Player* player) override; virtual bool IsMod() override; -private: + private: static size_t _count; };
\ No newline at end of file diff --git a/src/engine/vehicles/Car.cpp b/src/engine/vehicles/Car.cpp index 89409df50..f5a9b6a4a 100644 --- a/src/engine/vehicles/Car.cpp +++ b/src/engine/vehicles/Car.cpp @@ -18,11 +18,11 @@ extern s8 gPlayerCount; size_t ACar::_count = 0; -ACar::ACar(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) { +ACar::ACar(f32 speedA, f32 speedB, TrackPathPoint* path, uint32_t waypoint) { Name = "Car"; - TrackWaypoint* temp_v0; + TrackPathPoint* temp_v0; u16 waypointOffset; - s32 numWaypoints = gWaypointCountByPathIndex[0]; + s32 numWaypoints = gPathCountByPathIndex[0]; Index = _count; @@ -49,17 +49,14 @@ ACar::ACar(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) { } Rotation[0] = 0; Rotation[2] = 0; - if (D_8016347A == 0) { - Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + if (gIsInExtra == 0) { + Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - Rotation[1] = - func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); + Rotation[1] = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } - D_801631C8 = 10; + sVehicleSoundRenderCounter = 10; - spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, - Speed); + spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, Speed); ActorIndex = add_actor_to_empty_slot(Position, Rotation, Velocity, ACTOR_CAR); _count++; @@ -100,12 +97,10 @@ void ACar::Tick() { SomeMultiplierTheSequel = temp_f0_2; } } - if (D_8016347A == 0) { - var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + if (gIsInExtra == 0) { + var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0); + var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } adjust_angle(&Rotation[1], var_a1, 100); temp_f0_3 = Position[0] - sp5C; @@ -140,12 +135,13 @@ void ACar::Draw(Camera* camera) { s32 waypointCount; u16 temp_a1; - waypointCount = gWaypointCountByPathIndex[0]; - if (!(gPlayers[camera->playerId].unk_094 < 1.6666666666666667)) { + waypointCount = gPathCountByPathIndex[0]; + if (!(gPlayers[camera->playerId].speed < 1.6666666666666667)) { temp_a1 = WaypointIndex; for (var_v0 = 0; var_v0 < 0x18; var_v0 += 3) { - if (((sSomeNearestWaypoint + var_v0) % waypointCount) == temp_a1) { - D_801634F8[camera->playerId].unk4 = func_800145A8(SomeType, D_80163068[camera->playerId], temp_a1); + if (((sSomeNearestPathPoint + var_v0) % waypointCount) == temp_a1) { + gPlayerTrackPositionFactorInstruction[camera->playerId].target = + player_track_position_factor_vehicle(SomeType, gTrackPositionFactor[camera->playerId], temp_a1); return; } } @@ -161,7 +157,7 @@ void ACar::VehicleCollision(s32 playerId, Player* player) { f32 spC0; f32 spBC; - if (((D_801631E0[playerId] != 1) || ((((player->type & PLAYER_HUMAN) != 0)) && !(player->type & PLAYER_KART_AI))) && + if (((D_801631E0[playerId] != 1) || ((((player->type & PLAYER_HUMAN) != 0)) && !(player->type & PLAYER_CPU))) && !(player->effects & 0x01000000)) { spC4 = player->pos[0]; @@ -176,18 +172,18 @@ void ACar::VehicleCollision(s32 playerId, Player* player) { if ((temp_f22 > -20.0) && (temp_f22 < 20.0)) { if (((temp_f14) > -100.0) && ((temp_f14) < 100.0)) { - if (func_80006018(Position[0], Position[2], Velocity[0], - Velocity[2], SomeArg3, SomeArg4, spC4, spBC) == (s32) 1) { + if (is_collide_with_vehicle(Position[0], Position[2], Velocity[0], Velocity[2], SomeArg3, SomeArg4, + spC4, spBC) == (s32) 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } } } } - if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_KART_AI)) { + if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_CPU)) { if (((temp_f12) > -300.0) && ((temp_f12) < 300.0) && ((temp_f22 > -20.0)) && (temp_f22 < 20.0) && (((temp_f14) > -300.0)) && ((temp_f14) < 300.0)) { - if ((D_801631C8 > 0) && (SomeFlags == 0)) { - D_801631C8 -= 1; + if ((sVehicleSoundRenderCounter > 0) && (SomeFlags == 0)) { + sVehicleSoundRenderCounter -= 1; SomeFlags |= (RENDER_VEHICLE << playerId); func_800C9D80(Position, Velocity, SoundBits); } @@ -195,7 +191,7 @@ void ACar::VehicleCollision(s32 playerId, Player* player) { if (SomeFlags != 0) { SomeFlags &= ~(RENDER_VEHICLE << playerId); if (SomeFlags == 0) { - D_801631C8 += 1; + sVehicleSoundRenderCounter += 1; func_800C9EF4(Position, SoundBits); } } @@ -206,31 +202,31 @@ void ACar::VehicleCollision(s32 playerId, Player* player) { if (!(SomeFlagsTheSequel & ((1 << playerId)))) { s32 var_s1 = 0; - u16 path = gWaypointCountByPathIndex[0]; + u16 path = gPathCountByPathIndex[0]; s32 t1; s32 t2; - switch (D_8016347A) { + switch (gIsInExtra) { case 0: - t1 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 10, 0, - path); - if ((D_80163270[playerId] == 0) && (t1 > 0) && (player->unk_094 < Speed)) { + t1 = is_path_point_in_range(WaypointIndex, gNearestPathPointByPlayerId[playerId], 10, 0, + path); + if ((gIsPlayerWrongDirection[playerId] == 0) && (t1 > 0) && (player->speed < Speed)) { var_s1 = 1; } - if ((D_80163270[playerId] == 1) && (t1 > 0)) { + if ((gIsPlayerWrongDirection[playerId] == 1) && (t1 > 0)) { var_s1 = 1; } break; case 1: - t2 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 0, 10, - path); + t2 = is_path_point_in_range(WaypointIndex, gNearestPathPointByPlayerId[playerId], 0, 10, + path); if (t2 > 0) { if (random_int(2) == 0) { - // temp_v1_2 = D_80163270[playerId]; - if (D_80163270[playerId] == 0) { + // temp_v1_2 = gIsPlayerWrongDirection[playerId]; + if (gIsPlayerWrongDirection[playerId] == 0) { var_s1 = 1; } - if ((D_80163270[playerId] == 1) && (player->unk_094 < Speed)) { + if ((gIsPlayerWrongDirection[playerId] == 1) && (player->speed < Speed)) { var_s1 = 1; } } else { diff --git a/src/engine/vehicles/Car.h b/src/engine/vehicles/Car.h index 97bd47e2e..24badabb3 100644 --- a/src/engine/vehicles/Car.h +++ b/src/engine/vehicles/Car.h @@ -12,9 +12,8 @@ extern "C" { } class ACar : public AActor { - public: - - explicit ACar(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint); + public: + explicit ACar(f32 speedA, f32 speedB, TrackPathPoint* path, uint32_t waypoint); ~ACar() { _count--; @@ -45,6 +44,7 @@ class ACar : public AActor { virtual void Draw(Camera*) override; virtual void VehicleCollision(s32 playerId, Player* player) override; virtual bool IsMod() override; -private: + + private: static size_t _count; };
\ No newline at end of file diff --git a/src/engine/vehicles/TankerTruck.cpp b/src/engine/vehicles/TankerTruck.cpp index 02cd9553b..ed28b0d66 100644 --- a/src/engine/vehicles/TankerTruck.cpp +++ b/src/engine/vehicles/TankerTruck.cpp @@ -18,11 +18,11 @@ extern s8 gPlayerCount; size_t ATankerTruck::_count = 0; -ATankerTruck::ATankerTruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) { +ATankerTruck::ATankerTruck(f32 speedA, f32 speedB, TrackPathPoint* path, uint32_t waypoint) { Name = "Tanker Truck"; - TrackWaypoint* temp_v0; + TrackPathPoint* temp_v0; u16 waypointOffset; - s32 numWaypoints = gWaypointCountByPathIndex[0]; + s32 numWaypoints = gPathCountByPathIndex[0]; Index = _count; @@ -49,17 +49,14 @@ ATankerTruck::ATankerTruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t } Rotation[0] = 0; Rotation[2] = 0; - if (D_8016347A == 0) { - Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + if (gIsInExtra == 0) { + Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - Rotation[1] = - func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); + Rotation[1] = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } - D_801631C8 = 10; + sVehicleSoundRenderCounter = 10; - spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, - Speed); + spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, Speed); ActorIndex = add_actor_to_empty_slot(Position, Rotation, Velocity, ACTOR_TANKER_TRUCK); _count++; @@ -75,12 +72,13 @@ void ATankerTruck::Draw(Camera* camera) { s32 waypointCount; u16 temp_a1; - waypointCount = gWaypointCountByPathIndex[0]; - if (!(gPlayers[camera->playerId].unk_094 < 1.6666666666666667)) { + waypointCount = gPathCountByPathIndex[0]; + if (!(gPlayers[camera->playerId].speed < 1.6666666666666667)) { temp_a1 = WaypointIndex; for (var_v0 = 0; var_v0 < 0x18; var_v0 += 3) { - if (((sSomeNearestWaypoint + var_v0) % waypointCount) == temp_a1) { - D_801634F8[camera->playerId].unk4 = func_800145A8(SomeType, D_80163068[camera->playerId], temp_a1); + if (((sSomeNearestPathPoint + var_v0) % waypointCount) == temp_a1) { + gPlayerTrackPositionFactorInstruction[camera->playerId].target = + player_track_position_factor_vehicle(SomeType, gTrackPositionFactor[camera->playerId], temp_a1); return; } } @@ -118,12 +116,10 @@ void ATankerTruck::Tick() { SomeMultiplierTheSequel = temp_f0_2; } } - if (D_8016347A == 0) { - var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + if (gIsInExtra == 0) { + var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0); + var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } adjust_angle(&Rotation[1], var_a1, 100); temp_f0_3 = Position[0] - sp5C; @@ -161,7 +157,7 @@ void ATankerTruck::VehicleCollision(s32 playerId, Player* player) { f32 spC0; f32 spBC; - if (((D_801631E0[playerId] != 1) || ((((player->type & PLAYER_HUMAN) != 0)) && !(player->type & PLAYER_KART_AI))) && + if (((D_801631E0[playerId] != 1) || ((((player->type & PLAYER_HUMAN) != 0)) && !(player->type & PLAYER_CPU))) && !(player->effects & 0x01000000)) { spC4 = player->pos[0]; @@ -176,18 +172,18 @@ void ATankerTruck::VehicleCollision(s32 playerId, Player* player) { if ((temp_f22 > -20.0) && (temp_f22 < 20.0)) { if (((temp_f14) > -100.0) && ((temp_f14) < 100.0)) { - if (func_80006018(Position[0], Position[2], Velocity[0], - Velocity[2], SomeArg3, SomeArg4, spC4, spBC) == (s32) 1) { + if (is_collide_with_vehicle(Position[0], Position[2], Velocity[0], Velocity[2], SomeArg3, SomeArg4, + spC4, spBC) == (s32) 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } } } } - if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_KART_AI)) { + if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_CPU)) { if (((temp_f12) > -300.0) && ((temp_f12) < 300.0) && ((temp_f22 > -20.0)) && (temp_f22 < 20.0) && (((temp_f14) > -300.0)) && ((temp_f14) < 300.0)) { - if ((D_801631C8 > 0) && (SomeFlags == 0)) { - D_801631C8 -= 1; + if ((sVehicleSoundRenderCounter > 0) && (SomeFlags == 0)) { + sVehicleSoundRenderCounter -= 1; SomeFlags |= (RENDER_VEHICLE << playerId); func_800C9D80(Position, Velocity, SoundBits); } @@ -195,7 +191,7 @@ void ATankerTruck::VehicleCollision(s32 playerId, Player* player) { if (SomeFlags != 0) { SomeFlags &= ~(RENDER_VEHICLE << playerId); if (SomeFlags == 0) { - D_801631C8 += 1; + sVehicleSoundRenderCounter += 1; func_800C9EF4(Position, SoundBits); } } @@ -206,31 +202,31 @@ void ATankerTruck::VehicleCollision(s32 playerId, Player* player) { if (!(SomeFlagsTheSequel & ((1 << playerId)))) { s32 var_s1 = 0; - u16 path = gWaypointCountByPathIndex[0]; + u16 path = gPathCountByPathIndex[0]; s32 t1; s32 t2; - switch (D_8016347A) { + switch (gIsInExtra) { case 0: - t1 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 10, 0, - path); - if ((D_80163270[playerId] == 0) && (t1 > 0) && (player->unk_094 < Speed)) { + t1 = is_path_point_in_range(WaypointIndex, gNearestPathPointByPlayerId[playerId], 10, 0, + path); + if ((gIsPlayerWrongDirection[playerId] == 0) && (t1 > 0) && (player->speed < Speed)) { var_s1 = 1; } - if ((D_80163270[playerId] == 1) && (t1 > 0)) { + if ((gIsPlayerWrongDirection[playerId] == 1) && (t1 > 0)) { var_s1 = 1; } break; case 1: - t2 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 0, 10, - path); + t2 = is_path_point_in_range(WaypointIndex, gNearestPathPointByPlayerId[playerId], 0, 10, + path); if (t2 > 0) { if (random_int(2) == 0) { - // temp_v1_2 = D_80163270[playerId]; - if (D_80163270[playerId] == 0) { + // temp_v1_2 = gIsPlayerWrongDirection[playerId]; + if (gIsPlayerWrongDirection[playerId] == 0) { var_s1 = 1; } - if ((D_80163270[playerId] == 1) && (player->unk_094 < Speed)) { + if ((gIsPlayerWrongDirection[playerId] == 1) && (player->speed < Speed)) { var_s1 = 1; } } else { diff --git a/src/engine/vehicles/TankerTruck.h b/src/engine/vehicles/TankerTruck.h index e109115a9..85b501ead 100644 --- a/src/engine/vehicles/TankerTruck.h +++ b/src/engine/vehicles/TankerTruck.h @@ -12,8 +12,7 @@ extern "C" { } class ATankerTruck : public AActor { - public: - + public: const char* Type; size_t Index; f32 Speed; @@ -31,7 +30,7 @@ class ATankerTruck : public AActor { f32 SomeArg4 = 12.5f; u32 SoundBits = SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x03); - explicit ATankerTruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint); + explicit ATankerTruck(f32 speedA, f32 speedB, TrackPathPoint* path, uint32_t waypoint); ~ATankerTruck() { _count--; @@ -46,6 +45,6 @@ class ATankerTruck : public AActor { virtual void VehicleCollision(s32 playerId, Player* player) override; virtual bool IsMod() override; -private: + private: static size_t _count; };
\ No newline at end of file diff --git a/src/engine/vehicles/Train.cpp b/src/engine/vehicles/Train.cpp index a3952742d..ae249be81 100644 --- a/src/engine/vehicles/Train.cpp +++ b/src/engine/vehicles/Train.cpp @@ -19,7 +19,7 @@ extern "C" { #include "math_util_2.h" #include "render_objects.h" #include "assets/common_data.h" - // #include "common_structs.h" +// #include "common_structs.h" } size_t ATrain::_count = 0; @@ -48,16 +48,16 @@ ATrain::ATrain(ATrain::TenderStatus tender, size_t numCarriages, f32 speed, uint for (size_t i = 0; i < PassengerCars.size(); i++) { waypointOffset += 4; ptr1 = &PassengerCars[i]; - pos = &gVehicle2DWaypoint[waypointOffset]; - set_vehicle_pos_waypoint(ptr1, pos, waypointOffset); + pos = &gVehicle2DPathPoint[waypointOffset]; + set_vehicle_pos_path_point(ptr1, pos, waypointOffset); } // Smaller offset for the tender waypointOffset += 3; - pos = &gVehicle2DWaypoint[waypointOffset]; - set_vehicle_pos_waypoint(&this->Tender, pos, waypointOffset); + pos = &gVehicle2DPathPoint[waypointOffset]; + set_vehicle_pos_path_point(&this->Tender, pos, waypointOffset); waypointOffset += 4; - pos = &gVehicle2DWaypoint[waypointOffset]; - set_vehicle_pos_waypoint(&Locomotive, pos, waypointOffset); + pos = &gVehicle2DPathPoint[waypointOffset]; + set_vehicle_pos_path_point(&Locomotive, pos, waypointOffset); // Only use locomotive unless overwritten below. NumCars = LOCOMOTIVE_ONLY; @@ -88,25 +88,24 @@ ATrain::ATrain(ATrain::TenderStatus tender, size_t numCarriages, f32 speed, uint tempLocomotive = &Locomotive; origXPos = tempLocomotive->position[0]; origZPos = tempLocomotive->position[2]; - trainCarYRot = update_vehicle_following_waypoint( - tempLocomotive->position, (s16*) &tempLocomotive->waypointIndex, Speed); + trainCarYRot = + update_vehicle_following_path(tempLocomotive->position, (s16*) &tempLocomotive->waypointIndex, Speed); tempLocomotive->velocity[0] = tempLocomotive->position[0] - origXPos; tempLocomotive->velocity[2] = tempLocomotive->position[2] - origZPos; vec3s_set(trainCarRot, 0, trainCarYRot, 0); - tempLocomotive->actorIndex = add_actor_to_empty_slot(tempLocomotive->position, trainCarRot, - tempLocomotive->velocity, ACTOR_TRAIN_ENGINE); + tempLocomotive->actorIndex = + add_actor_to_empty_slot(tempLocomotive->position, trainCarRot, tempLocomotive->velocity, ACTOR_TRAIN_ENGINE); tempTender = &Tender; if (tempTender->isActive == 1) { origXPos = tempTender->position[0]; origZPos = tempTender->position[2]; - trainCarYRot = update_vehicle_following_waypoint( - tempTender->position, (s16*) &tempTender->waypointIndex, Speed); + trainCarYRot = update_vehicle_following_path(tempTender->position, (s16*) &tempTender->waypointIndex, Speed); tempTender->velocity[0] = tempTender->position[0] - origXPos; tempTender->velocity[2] = tempTender->position[2] - origZPos; vec3s_set(trainCarRot, 0, trainCarYRot, 0); - tempTender->actorIndex = add_actor_to_empty_slot(tempTender->position, trainCarRot, - tempTender->velocity, ACTOR_TRAIN_TENDER); + tempTender->actorIndex = + add_actor_to_empty_slot(tempTender->position, trainCarRot, tempTender->velocity, ACTOR_TRAIN_TENDER); } for (size_t i = 0; i < PassengerCars.size(); i++) { @@ -114,15 +113,13 @@ ATrain::ATrain(ATrain::TenderStatus tender, size_t numCarriages, f32 speed, uint if (tempPassengerCar->isActive == 1) { origXPos = tempPassengerCar->position[0]; origZPos = tempPassengerCar->position[2]; - trainCarYRot = update_vehicle_following_waypoint(tempPassengerCar->position, - (s16*) &tempPassengerCar->waypointIndex, - Speed); + trainCarYRot = update_vehicle_following_path(tempPassengerCar->position, + (s16*) &tempPassengerCar->waypointIndex, Speed); tempPassengerCar->velocity[0] = tempPassengerCar->position[0] - origXPos; tempPassengerCar->velocity[2] = tempPassengerCar->position[2] - origZPos; vec3s_set(trainCarRot, 0, trainCarYRot, 0); - tempPassengerCar->actorIndex = - add_actor_to_empty_slot(tempPassengerCar->position, trainCarRot, tempPassengerCar->velocity, - ACTOR_TRAIN_PASSENGER_CAR); + tempPassengerCar->actorIndex = add_actor_to_empty_slot( + tempPassengerCar->position, trainCarRot, tempPassengerCar->velocity, ACTOR_TRAIN_PASSENGER_CAR); } } @@ -166,8 +163,7 @@ void ATrain::Tick() { temp_f20 = Locomotive.position[0]; temp_f22 = Locomotive.position[2]; - orientationYUpdate = update_vehicle_following_waypoint( - Locomotive.position, (s16*) &Locomotive.waypointIndex, Speed); + orientationYUpdate = update_vehicle_following_path(Locomotive.position, (s16*) &Locomotive.waypointIndex, Speed); Locomotive.velocity[0] = Locomotive.position[0] - temp_f20; Locomotive.velocity[2] = Locomotive.position[2] - temp_f22; @@ -175,24 +171,20 @@ void ATrain::Tick() { sync_train_components(&Locomotive, orientationYUpdate); if ((oldWaypointIndex != Locomotive.waypointIndex) && - ((Locomotive.waypointIndex == 0x00BE) || - (Locomotive.waypointIndex == 0x0140))) { // play crossing bell sound - func_800C98B8(Locomotive.position, Locomotive.velocity, - SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0E)); + ((Locomotive.waypointIndex == 0x00BE) || (Locomotive.waypointIndex == 0x0140))) { // play crossing bell sound + func_800C98B8(Locomotive.position, Locomotive.velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0E)); } else if (random_int(100) == 0) { // play train whistle sound - func_800C98B8(Locomotive.position, Locomotive.velocity, - SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0D)); + func_800C98B8(Locomotive.position, Locomotive.velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0D)); } - SomeFlags = set_vehicle_render_distance_flags( - Locomotive.position, TRAIN_SMOKE_RENDER_DISTANCE, SomeFlags); + SomeFlags = set_vehicle_render_distance_flags(Locomotive.position, TRAIN_SMOKE_RENDER_DISTANCE, SomeFlags); // Renders locomotive smoke on all screens if any player is within range. if ((((s16) AnotherSmokeTimer % 5) == 0) && (SomeFlags != 0)) { smokePos[0] = Locomotive.position[0]; smokePos[1] = (f32) ((f64) Locomotive.position[1] + 65.0); smokePos[2] = (f32) ((f64) Locomotive.position[2] + 25.0); adjust_position_by_angle(smokePos, Locomotive.position, orientationYUpdate); - //spawn_train_smoke(Index, smokePos, 1.1f); + // spawn_train_smoke(Index, smokePos, 1.1f); AddSmoke(Index, smokePos, 1.1f); } @@ -201,8 +193,7 @@ void ATrain::Tick() { if (car->isActive == 1) { temp_f20 = car->position[0]; temp_f22 = car->position[2]; - orientationYUpdate = - update_vehicle_following_waypoint(car->position, (s16*) &car->waypointIndex, Speed); + orientationYUpdate = update_vehicle_following_path(car->position, (s16*) &car->waypointIndex, Speed); car->velocity[0] = car->position[0] - temp_f20; car->velocity[2] = car->position[2] - temp_f22; sync_train_components(car, orientationYUpdate); @@ -214,8 +205,7 @@ void ATrain::Tick() { temp_f20 = car->position[0]; temp_f22 = car->position[2]; - orientationYUpdate = - update_vehicle_following_waypoint(car->position, (s16*) &car->waypointIndex, Speed); + orientationYUpdate = update_vehicle_following_path(car->position, (s16*) &car->waypointIndex, Speed); car->velocity[0] = car->position[0] - temp_f20; car->velocity[2] = car->position[2] - temp_f22; sync_train_components(car, orientationYUpdate); @@ -240,14 +230,14 @@ void ATrain::VehicleCollision(s32 playerId, Player* player) { z_dist = playerPosZ - trainCar->position[2]; if ((x_dist > -100.0) && (x_dist < 100.0)) { if ((z_dist > -100.0) && (z_dist < 100.0)) { - if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], - trainCar->velocity[2], 60.0f, 20.0f, playerPosX, playerPosZ) == 1) { + if (is_collide_with_vehicle(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], + trainCar->velocity[2], 60.0f, 20.0f, playerPosX, playerPosZ) == 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } trainCar = &Tender; if (trainCar->isActive == 1) { - if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], - trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) { + if (is_collide_with_vehicle(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], + trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } } @@ -261,8 +251,9 @@ void ATrain::VehicleCollision(s32 playerId, Player* player) { if (trainCar->isActive == 1) { if ((x_dist > -100.0) && (x_dist < 100.0)) { if ((z_dist > -100.0) && (z_dist < 100.0)) { - if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], - trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) { + if (is_collide_with_vehicle(trainCar->position[0], trainCar->position[2], + trainCar->velocity[0], trainCar->velocity[2], 30.0f, 20.0f, + playerPosX, playerPosZ) == 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } } @@ -273,7 +264,6 @@ void ATrain::VehicleCollision(s32 playerId, Player* player) { } } - void ATrain::Draw(Camera* camera) { } diff --git a/src/engine/vehicles/Truck.cpp b/src/engine/vehicles/Truck.cpp index 585293489..2c7147d3e 100644 --- a/src/engine/vehicles/Truck.cpp +++ b/src/engine/vehicles/Truck.cpp @@ -18,11 +18,11 @@ extern s8 gPlayerCount; size_t ATruck::_count = 0; -ATruck::ATruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) { +ATruck::ATruck(f32 speedA, f32 speedB, TrackPathPoint* path, uint32_t waypoint) { Name = "Truck"; - TrackWaypoint* temp_v0; + TrackPathPoint* temp_v0; u16 waypointOffset; - s32 numWaypoints = gWaypointCountByPathIndex[0]; + s32 numWaypoints = gPathCountByPathIndex[0]; Index = _count; @@ -49,17 +49,14 @@ ATruck::ATruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) { } Rotation[0] = 0; Rotation[2] = 0; - if (D_8016347A == 0) { - Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + if (gIsInExtra == 0) { + Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - Rotation[1] = - func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); + Rotation[1] = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } - D_801631C8 = 10; + sVehicleSoundRenderCounter = 10; - spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, - Speed); + spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, Speed); ActorIndex = add_actor_to_empty_slot(Position, Rotation, Velocity, ACTOR_BOX_TRUCK); _count++; @@ -75,12 +72,13 @@ void ATruck::Draw(Camera* camera) { s32 waypointCount; u16 temp_a1; - waypointCount = gWaypointCountByPathIndex[0]; - if (!(gPlayers[camera->playerId].unk_094 < 1.6666666666666667)) { + waypointCount = gPathCountByPathIndex[0]; + if (!(gPlayers[camera->playerId].speed < 1.6666666666666667)) { temp_a1 = WaypointIndex; for (var_v0 = 0; var_v0 < 0x18; var_v0 += 3) { - if (((sSomeNearestWaypoint + var_v0) % waypointCount) == temp_a1) { - D_801634F8[camera->playerId].unk4 = func_800145A8(SomeType, D_80163068[camera->playerId], temp_a1); + if (((sSomeNearestPathPoint + var_v0) % waypointCount) == temp_a1) { + gPlayerTrackPositionFactorInstruction[camera->playerId].target = + player_track_position_factor_vehicle(SomeType, gTrackPositionFactor[camera->playerId], temp_a1); return; } } @@ -118,12 +116,10 @@ void ATruck::Tick() { SomeMultiplierTheSequel = temp_f0_2; } } - if (D_8016347A == 0) { - var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + if (gIsInExtra == 0) { + var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0); + var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } adjust_angle(&Rotation[1], var_a1, 100); temp_f0_3 = Position[0] - sp5C; @@ -161,7 +157,7 @@ void ATruck::VehicleCollision(s32 playerId, Player* player) { f32 spC0; f32 spBC; - if (((D_801631E0[playerId] != 1) || ((((player->type & PLAYER_HUMAN) != 0)) && !(player->type & PLAYER_KART_AI))) && + if (((D_801631E0[playerId] != 1) || ((((player->type & PLAYER_HUMAN) != 0)) && !(player->type & PLAYER_CPU))) && !(player->effects & 0x01000000)) { spC4 = player->pos[0]; @@ -176,18 +172,18 @@ void ATruck::VehicleCollision(s32 playerId, Player* player) { if ((temp_f22 > -20.0) && (temp_f22 < 20.0)) { if (((temp_f14) > -100.0) && ((temp_f14) < 100.0)) { - if (func_80006018(Position[0], Position[2], Velocity[0], - Velocity[2], SomeArg3, SomeArg4, spC4, spBC) == (s32) 1) { + if (is_collide_with_vehicle(Position[0], Position[2], Velocity[0], Velocity[2], SomeArg3, SomeArg4, + spC4, spBC) == (s32) 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } } } } - if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_KART_AI)) { + if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_CPU)) { if (((temp_f12) > -300.0) && ((temp_f12) < 300.0) && ((temp_f22 > -20.0)) && (temp_f22 < 20.0) && (((temp_f14) > -300.0)) && ((temp_f14) < 300.0)) { - if ((D_801631C8 > 0) && (SomeFlags == 0)) { - D_801631C8 -= 1; + if ((sVehicleSoundRenderCounter > 0) && (SomeFlags == 0)) { + sVehicleSoundRenderCounter -= 1; SomeFlags |= (RENDER_VEHICLE << playerId); func_800C9D80(Position, Velocity, SoundBits); } @@ -195,7 +191,7 @@ void ATruck::VehicleCollision(s32 playerId, Player* player) { if (SomeFlags != 0) { SomeFlags &= ~(RENDER_VEHICLE << playerId); if (SomeFlags == 0) { - D_801631C8 += 1; + sVehicleSoundRenderCounter += 1; func_800C9EF4(Position, SoundBits); } } @@ -206,31 +202,31 @@ void ATruck::VehicleCollision(s32 playerId, Player* player) { if (!(SomeFlagsTheSequel & ((1 << playerId)))) { s32 var_s1 = 0; - u16 path = gWaypointCountByPathIndex[0]; + u16 path = gPathCountByPathIndex[0]; s32 t1; s32 t2; - switch (D_8016347A) { + switch (gIsInExtra) { case 0: - t1 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 10, 0, - path); - if ((D_80163270[playerId] == 0) && (t1 > 0) && (player->unk_094 < Speed)) { + t1 = is_path_point_in_range(WaypointIndex, gNearestPathPointByPlayerId[playerId], 10, 0, + path); + if ((gIsPlayerWrongDirection[playerId] == 0) && (t1 > 0) && (player->speed < Speed)) { var_s1 = 1; } - if ((D_80163270[playerId] == 1) && (t1 > 0)) { + if ((gIsPlayerWrongDirection[playerId] == 1) && (t1 > 0)) { var_s1 = 1; } break; case 1: - t2 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 0, 10, - path); + t2 = is_path_point_in_range(WaypointIndex, gNearestPathPointByPlayerId[playerId], 0, 10, + path); if (t2 > 0) { if (random_int(2) == 0) { - // temp_v1_2 = D_80163270[playerId]; - if (D_80163270[playerId] == 0) { + // temp_v1_2 = gIsPlayerWrongDirection[playerId]; + if (gIsPlayerWrongDirection[playerId] == 0) { var_s1 = 1; } - if ((D_80163270[playerId] == 1) && (player->unk_094 < Speed)) { + if ((gIsPlayerWrongDirection[playerId] == 1) && (player->speed < Speed)) { var_s1 = 1; } } else { diff --git a/src/engine/vehicles/Truck.h b/src/engine/vehicles/Truck.h index c18ce86a5..c9e6cb5ac 100644 --- a/src/engine/vehicles/Truck.h +++ b/src/engine/vehicles/Truck.h @@ -12,8 +12,7 @@ extern "C" { } class ATruck : public AActor { - public: - + public: const char* Type; size_t Index; f32 Speed; @@ -31,7 +30,7 @@ class ATruck : public AActor { f32 SomeArg4 = 12.5f; u32 SoundBits = SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x03); - explicit ATruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint); + explicit ATruck(f32 speedA, f32 speedB, TrackPathPoint* path, uint32_t waypoint); ~ATruck() { _count--; @@ -46,6 +45,6 @@ class ATruck : public AActor { virtual void VehicleCollision(s32 playerId, Player* player) override; virtual bool IsMod() override; -private: + private: static size_t _count; };
\ No newline at end of file |
