summaryrefslogtreecommitdiff
path: root/src/engine/courses/YoshiValley.cpp
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2024-10-15 13:09:43 -0600
committerGitHub <noreply@github.com>2024-10-15 13:09:43 -0600
commita0862b6a159373f2e1554e489ecb5bb08d89654e (patch)
treeb5c33fc7f65b438ee74898dd9ed7ba25b0fa108a /src/engine/courses/YoshiValley.cpp
parent58d56fcba848e8545052c1d85ef27d0b02841538 (diff)
[modding] Implement Vehicles & Fix Animations (#109)
* Train works * Fix minimap * Fix highway * Fix * Refactor train and boat * Update * Implement Trucks * Fix tanker * Finish implementing vehicles * Fix animations * Fix spawn players * Fix spawn players * Fix loading custom data --------- Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/engine/courses/YoshiValley.cpp')
-rw-r--r--src/engine/courses/YoshiValley.cpp43
1 files changed, 21 insertions, 22 deletions
diff --git a/src/engine/courses/YoshiValley.cpp b/src/engine/courses/YoshiValley.cpp
index d7c142743..07af8bd1a 100644
--- a/src/engine/courses/YoshiValley.cpp
+++ b/src/engine/courses/YoshiValley.cpp
@@ -38,6 +38,9 @@ YoshiValley::YoshiValley() {
this->gfx = d_course_yoshi_valley_packed_dls;
this->gfxSize = 4140;
this->textures = yoshi_valley_textures;
+ Props.MinimapTexture = gTextureCourseOutlineYoshiValley;
+ Props.D_800E5548[0] = 64;
+ Props.D_800E5548[1] = 64;
Props.Name = "yoshi valley";
Props.DebugName = "maze";
@@ -73,15 +76,15 @@ YoshiValley::YoshiValley() {
Props.D_0D009808[2] = 5.75f;
Props.D_0D009808[3] = 6.3333334f;
- Props.PathTable[0] = d_course_yoshi_valley_unknown_waypoints;
- Props.PathTable[1] = d_course_yoshi_valley_unknown_waypoints_2;
- Props.PathTable[2] = d_course_yoshi_valley_unknown_waypoints_3;
- Props.PathTable[3] = d_course_yoshi_valley_unknown_waypoints_4;
+ 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.PathTable2[0] = d_course_yoshi_valley_track_waypoints;
- Props.PathTable2[1] = d_course_yoshi_valley_track_waypoints_2;
- Props.PathTable2[2] = d_course_yoshi_valley_track_waypoints_3;
- Props.PathTable2[3] = d_course_yoshi_valley_track_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.Clouds = gYoshiValleyMooMooFarmClouds;
Props.CloudList = gYoshiValleyMooMooFarmClouds;
@@ -107,8 +110,8 @@ void YoshiValley::SpawnActors() {
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
Vec3s rotation = { 0, 0, 0 };
- spawn_foliage(d_course_yoshi_valley_tree_spawn);
- spawn_all_item_boxes(d_course_yoshi_valley_item_box_spawns);
+ spawn_foliage((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_yoshi_valley_tree_spawn));
+ spawn_all_item_boxes((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_yoshi_valley_item_box_spawns));
vec3f_set(position, -2300.0f, 0.0f, 634.0f);
position[0] *= gCourseDirection;
add_actor_to_empty_slot(position, rotation, velocity, ACTOR_YOSHI_EGG);
@@ -168,17 +171,13 @@ void YoshiValley::WhatDoesThisDo(Player* player, int8_t playerId) {}
void YoshiValley::WhatDoesThisDoAI(Player* player, int8_t playerId) {}
void YoshiValley::SpawnBombKarts() {
- World* world = GetWorld();
-
- if (world) {
- world->SpawnObject(std::make_unique<OBombKart>(140, 3, 0.8333333, 0, 0, 0, 0));
- world->SpawnObject(std::make_unique<OBombKart>(165, 1, 0.8333333, 0, 0, 0, 0));
- world->SpawnObject(std::make_unique<OBombKart>(330, 3, 0.8333333, 0, 0, 0, 0));
- world->SpawnObject(std::make_unique<OBombKart>(550, 1, 0.8333333, 0, 0, 0, 0));
- world->SpawnObject(std::make_unique<OBombKart>(595, 3, 0.8333333, 0, 0, 0, 0));
- world->SpawnObject(std::make_unique<OBombKart>(0, 0, 0.8333333, 0, 0, 0, 0));
- world->SpawnObject(std::make_unique<OBombKart>(0, 0, 0.8333333, 0, 0, 0, 0));
- }
+ gWorldInstance.SpawnObject(std::make_unique<OBombKart>(140, 3, 0.8333333, 0, 0, 0, 0));
+ gWorldInstance.SpawnObject(std::make_unique<OBombKart>(165, 1, 0.8333333, 0, 0, 0, 0));
+ gWorldInstance.SpawnObject(std::make_unique<OBombKart>(330, 3, 0.8333333, 0, 0, 0, 0));
+ gWorldInstance.SpawnObject(std::make_unique<OBombKart>(550, 1, 0.8333333, 0, 0, 0, 0));
+ gWorldInstance.SpawnObject(std::make_unique<OBombKart>(595, 3, 0.8333333, 0, 0, 0, 0));
+ gWorldInstance.SpawnObject(std::make_unique<OBombKart>(0, 0, 0.8333333, 0, 0, 0, 0));
+ gWorldInstance.SpawnObject(std::make_unique<OBombKart>(0, 0, 0.8333333, 0, 0, 0, 0));
}
// Positions the finishline on the minimap
@@ -210,7 +209,7 @@ void YoshiValley::Collision() {}
void YoshiValley::GenerateCollision() {
Lights1 lights4 = gdSPDefLights1(100, 100, 100, 255, 254, 254, 0, 0, 120);
func_802B5D64(&lights4, -0x38F0, 0x1C70, 1);
- parse_course_displaylists(d_course_yoshi_valley_addr);
+ parse_course_displaylists((TrackSectionsI*)LOAD_ASSET_RAW(d_course_yoshi_valley_addr));
func_80295C6C();
D_8015F8E4 = gCourseMinY - 10.0f;
}