summaryrefslogtreecommitdiff
path: root/src/engine/courses/MooMooFarm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/courses/MooMooFarm.cpp')
-rw-r--r--src/engine/courses/MooMooFarm.cpp154
1 files changed, 65 insertions, 89 deletions
diff --git a/src/engine/courses/MooMooFarm.cpp b/src/engine/courses/MooMooFarm.cpp
index 304ad2210..90b1cdfd9 100644
--- a/src/engine/courses/MooMooFarm.cpp
+++ b/src/engine/courses/MooMooFarm.cpp
@@ -12,30 +12,30 @@
#include "engine/objects/Mole.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 "code_80086E70.h"
- #include "course.h"
- extern const char *moo_moo_farm_dls[];
- extern s16 currentScreenSection;
- extern s8 gPlayerCount;
+#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 "code_80086E70.h"
+#include "course.h"
+extern const char* moo_moo_farm_dls[];
+extern s16 currentScreenSection;
+extern s8 gPlayerCount;
}
const course_texture moo_moo_farm_textures[] = {
@@ -98,7 +98,7 @@ MooMooFarm::MooMooFarm() {
Props.NearPersp = 9.0f;
Props.FarPersp = 4500.0f;
- Props.PathSizes = {0x230, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0};
+ 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;
@@ -120,12 +120,12 @@ MooMooFarm::MooMooFarm() {
Props.D_0D009808[2] = 5.75f;
Props.D_0D009808[3] = 6.3333334f;
- Props.PathTable[0] = (TrackWaypoint*)LOAD_ASSET_RAW(d_course_moo_moo_farm_unknown_waypoints);
+ Props.PathTable[0] = (TrackWaypoint*) 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] = (TrackWaypoint*) LOAD_ASSET_RAW(d_course_moo_moo_farm_track_waypoints);
Props.PathTable2[1] = NULL;
Props.PathTable2[2] = NULL;
Props.PathTable2[3] = NULL;
@@ -134,21 +134,21 @@ MooMooFarm::MooMooFarm() {
Props.Clouds = gYoshiValleyMooMooFarmClouds;
Props.CloudList = gYoshiValleyMooMooFarmClouds;
- Props.Skybox.TopRight = {0, 18, 255};
- Props.Skybox.BottomRight = {197, 211, 255};
- Props.Skybox.BottomLeft = {197, 211, 255};
- Props.Skybox.TopLeft = {0, 18, 255};
- Props.Skybox.FloorTopRight = {255, 184, 99};
- Props.Skybox.FloorBottomRight = {0, 0, 0};
- Props.Skybox.FloorBottomLeft = {0, 0, 0};
- Props.Skybox.FloorTopLeft = {255, 184, 99};
+ Props.Skybox.TopRight = { 0, 18, 255 };
+ Props.Skybox.BottomRight = { 197, 211, 255 };
+ Props.Skybox.BottomLeft = { 197, 211, 255 };
+ Props.Skybox.TopLeft = { 0, 18, 255 };
+ Props.Skybox.FloorTopRight = { 255, 184, 99 };
+ Props.Skybox.FloorBottomRight = { 0, 0, 0 };
+ Props.Skybox.FloorBottomLeft = { 0, 0, 0 };
+ Props.Skybox.FloorTopLeft = { 255, 184, 99 };
Props.Sequence = MusicSeq::MUSIC_SEQ_MOO_MOO_FARM_YOSHI_VALLEY;
}
void MooMooFarm::Load() {
Course::Load();
- parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_moo_moo_farm_addr));
+ parse_course_displaylists((TrackSections*) LOAD_ASSET_RAW(d_course_moo_moo_farm_addr));
func_80295C6C();
Props.WaterLevel = gCourseMinY - 10.0f;
}
@@ -170,57 +170,34 @@ void MooMooFarm::LoadTextures() {
// These are full arrays that are not used in the original game
static std::vector<FVector> sMoleSpawns1 = {
- { FVector(771, 20, -2022) },
- { FVector(807, 15, -2063) },
- { FVector(847, 18, -2040) },
- { FVector(913, 14, -2054) },
- { FVector(939, 21, -1997) },
- { FVector(941, 17, -2024) },
- { FVector(994, 17, -1994) },
- { FVector(863, 22, -2010) },
+ { FVector(771, 20, -2022) }, { FVector(807, 15, -2063) }, { FVector(847, 18, -2040) }, { FVector(913, 14, -2054) },
+ { FVector(939, 21, -1997) }, { FVector(941, 17, -2024) }, { FVector(994, 17, -1994) }, { FVector(863, 22, -2010) },
};
static std::vector<FVector> sMoleSpawns2 = {
- { FVector(1500, 2, 1140) },
- { FVector(1510, 15, 1050) },
- { FVector(1609, 21, 935) },
- { FVector(1289, 3, 1269) },
- { FVector(1468, 22, 1046) },
- { FVector(1380, 12, 1154) },
- { FVector(1297, 19, 1170) },
- { FVector(1589, 11, 1004) },
- { FVector(1414, 3, 1185) },
- { FVector(1405, 4, 1254) },
- { FVector(1463, 8, 1118) },
+ { FVector(1500, 2, 1140) }, { FVector(1510, 15, 1050) }, { FVector(1609, 21, 935) }, { FVector(1289, 3, 1269) },
+ { FVector(1468, 22, 1046) }, { FVector(1380, 12, 1154) }, { FVector(1297, 19, 1170) }, { FVector(1589, 11, 1004) },
+ { FVector(1414, 3, 1185) }, { FVector(1405, 4, 1254) }, { FVector(1463, 8, 1118) },
};
static std::vector<FVector> sMoleSpawns3 = {
- { FVector(701, 2, 1279) },
- { FVector(811, 8, 1278) },
- { FVector(791, 16, 1229) },
- { FVector(876, 15, 1266) },
- { FVector(984, 23, 1248) },
- { FVector(891, 20, 1242) },
- { FVector(920, 15, 1304) },
- { FVector(823, 6, 1327) },
- { FVector(717, 8, 1239) },
- { FVector(695, 19, 1176) },
- { FVector(628, 8, 1191) },
- { FVector(724, 4, 1339) },
+ { FVector(701, 2, 1279) }, { FVector(811, 8, 1278) }, { FVector(791, 16, 1229) }, { FVector(876, 15, 1266) },
+ { FVector(984, 23, 1248) }, { FVector(891, 20, 1242) }, { FVector(920, 15, 1304) }, { FVector(823, 6, 1327) },
+ { FVector(717, 8, 1239) }, { FVector(695, 19, 1176) }, { FVector(628, 8, 1191) }, { FVector(724, 4, 1339) },
};
void MooMooFarm::BeginPlay() {
if (gPlayerCountSelection1 != 4) {
- spawn_foliage((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_moo_moo_farm_tree_spawn));
+ spawn_foliage((struct ActorSpawnData*) LOAD_ASSET_RAW(d_course_moo_moo_farm_tree_spawn));
}
- spawn_all_item_boxes((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_moo_moo_farm_item_box_spawns));
+ spawn_all_item_boxes((struct ActorSpawnData*) LOAD_ASSET_RAW(d_course_moo_moo_farm_item_box_spawns));
for (size_t i = 0; i < gObjectParticle2_SIZE; i++) {
find_unused_obj_index(&gObjectParticle2[i]);
}
if (gGamestate != CREDITS_SEQUENCE) {
- switch(gCCSelection) {
+ switch (gCCSelection) {
case CC_50: {
std::vector<FVector> moleSpawns1_50 = { { FVector(771, 20, -2022) },
{ FVector(807, 15, -2063) },
@@ -332,8 +309,7 @@ void MooMooFarm::BeginPlay() {
}
void MooMooFarm::WhatDoesThisDo(Player* player, int8_t playerId) {
- if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x145) &&
- ((s16) gNearestWaypointByPlayerId[playerId] < 0x18B)) {
+ if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x145) && ((s16) gNearestWaypointByPlayerId[playerId] < 0x18B)) {
if (D_80165300[playerId] != 1) {
func_800CA288(playerId, 0x55);
}
@@ -347,8 +323,7 @@ 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) gNearestWaypointByPlayerId[playerId] >= 0x145) && ((s16) gNearestWaypointByPlayerId[playerId] < 0x18B)) {
if (D_80165300[playerId] != 1) {
func_800CA2E4(playerId, 0x55);
}
@@ -372,28 +347,28 @@ void MooMooFarm::Render(struct UnkStruct_800DC5EC* arg0) {
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
// d_course_moo_moo_farm_packed_dl_4DF8
- gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual((void*)0x07004DF8));
+ gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual((void*) 0x07004DF8));
// d_course_moo_moo_farm_packed_dl_5640
- gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual((void*)0x07005640));
+ gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual((void*) 0x07005640));
gSPFogPosition(gDisplayListHead++, D_802B87B0, D_802B87B4);
render_course_segments(moo_moo_farm_dls, arg0);
if ((temp_s0 < 14) && (temp_s0 > 10)) {
if ((temp_s1 == 2) || (temp_s1 == 3) || (temp_s1 == 1)) {
- gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_moo_moo_farm_dl_13FF8);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_moo_moo_farm_dl_13FF8);
}
} else if (temp_s0 < 16) {
- gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_moo_moo_farm_dl_13FF8);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_moo_moo_farm_dl_13FF8);
} else if (temp_s0 < 19) {
if (temp_s1 != 2) {
- gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_moo_moo_farm_dl_13FF8);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_moo_moo_farm_dl_13FF8);
}
} else if (temp_s0 < 20) {
if (temp_s1 == 0) {
- gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_moo_moo_farm_dl_13FF8);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_moo_moo_farm_dl_13FF8);
}
}
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI);
@@ -402,40 +377,40 @@ void MooMooFarm::Render(struct UnkStruct_800DC5EC* arg0) {
if ((temp_s0 >= 16) && (temp_s0 < 24)) {
if ((temp_s1 == 2) || (temp_s1 == 3)) {
// d_course_moo_moo_farm_packed_dl_5410
- gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual((void*)0x07005410));
+ gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual((void*) 0x07005410));
}
} else if (temp_s0 < 9) {
if (temp_s1 == 2) {
// d_course_moo_moo_farm_packed_dl_5410
- gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual((void*)0x07005410));
+ gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual((void*) 0x07005410));
}
}
if (temp_s0 < 4) {
if (temp_s1 != 0) {
- gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_moo_moo_farm_dl_14060);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_moo_moo_farm_dl_14060);
}
} else if (temp_s0 < 8) {
if (temp_s1 == 2) {
- gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_moo_moo_farm_dl_14060);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_moo_moo_farm_dl_14060);
}
} else if (temp_s0 >= 22) {
- gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_moo_moo_farm_dl_14060);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_moo_moo_farm_dl_14060);
} else if (temp_s0 >= 18) {
if ((temp_s1 == 0) || (temp_s1 == 3)) {
- gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_moo_moo_farm_dl_14060);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_moo_moo_farm_dl_14060);
}
}
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
// d_course_moo_moo_farm_packed_dl_10C0
- gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual((void*)0x070010C0));
+ gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual((void*) 0x070010C0));
}
void MooMooFarm::RenderCredits() {
- gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_moo_moo_farm_dl_14088));
+ gSPDisplayList(gDisplayListHead++, (Gfx*) (d_course_moo_moo_farm_dl_14088));
}
void MooMooFarm::CreditsSpawnActors() {
@@ -454,4 +429,5 @@ void MooMooFarm::CreditsSpawnActors() {
spawn_foliage((struct ActorSpawnData*) LOAD_ASSET_RAW(d_course_moo_moo_farm_tree_spawn));
}
-void MooMooFarm::Destroy() { }
+void MooMooFarm::Destroy() {
+}