mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-09-04 10:51:37 -04:00
Name ScreenContext, Refactor Course class to Track (#583)
* Rename Screen Contexts * typedef ScreenContext struct * Fix Compile * Rename Course.cpp to Track.cpp * Refactor Course to Track * A few renames * General Cleanup * More Rename * More names * Move TrackSections struct to Track.h --------- Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
This commit is contained in:
@@ -208,7 +208,7 @@ struct FRotator {
|
||||
};
|
||||
|
||||
/**
|
||||
* For selecting a section of a course path
|
||||
* For selecting a section of a track path
|
||||
* Usage: IPathSpan(point1, point2) --> IPathSpan(40, 65)
|
||||
*/
|
||||
struct IPathSpan {
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
#include "Cup.h"
|
||||
#include "courses/Course.h"
|
||||
#include "tracks/Track.h"
|
||||
|
||||
Cup::Cup(std::string id, const char* name, std::vector<std::shared_ptr<Course>> courses) {
|
||||
Cup::Cup(std::string id, const char* name, std::vector<std::shared_ptr<Track>> courses) {
|
||||
Id = id;
|
||||
Name = name;
|
||||
Courses = courses;
|
||||
@@ -23,14 +23,14 @@ void Cup::Previous() {
|
||||
}
|
||||
}
|
||||
|
||||
void Cup::SetCourse(size_t position) {
|
||||
void Cup::SetTrack(size_t position) {
|
||||
if ((position < 0) || (position >= Courses.size())) {
|
||||
throw std::invalid_argument("Invalid course index.");
|
||||
throw std::invalid_argument("Invalid track index.");
|
||||
}
|
||||
CursorPosition = position;
|
||||
}
|
||||
|
||||
std::shared_ptr<Course> Cup::GetCourse() {
|
||||
std::shared_ptr<Track> Cup::GetTrack() {
|
||||
return Courses[CursorPosition];
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -3,25 +3,25 @@
|
||||
// Base Cup class
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include "courses/Course.h"
|
||||
#include "tracks/Track.h"
|
||||
|
||||
class Course; // <-- Forward declare
|
||||
class Track; // <-- Forward declare
|
||||
|
||||
class Cup {
|
||||
public:
|
||||
std::string Id;
|
||||
const char* Name;
|
||||
u8 *Thumbnail;
|
||||
size_t CursorPosition = 0; // Course index in cup
|
||||
std::vector<std::shared_ptr<Course>> Courses;
|
||||
size_t CursorPosition = 0; // Track index in cup
|
||||
std::vector<std::shared_ptr<Track>> Courses;
|
||||
|
||||
explicit Cup(std::string id, const char* name, std::vector<std::shared_ptr<Course>> courses);
|
||||
explicit Cup(std::string id, const char* name, std::vector<std::shared_ptr<Track>> courses);
|
||||
|
||||
virtual void ShuffleCourses();
|
||||
|
||||
virtual void Next();
|
||||
virtual void Previous();
|
||||
virtual void SetCourse(size_t position);
|
||||
virtual std::shared_ptr<Course> GetCourse();
|
||||
virtual void SetTrack(size_t position);
|
||||
virtual std::shared_ptr<Track> GetTrack();
|
||||
virtual size_t GetSize();
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef GAME_API_H
|
||||
#define GAME_API_H
|
||||
|
||||
void* GetCourse(void);
|
||||
void* GetTrack(void);
|
||||
|
||||
#endif // GAME_API_H
|
||||
#endif // GAME_API_H
|
||||
|
||||
+10
-10
@@ -52,15 +52,15 @@ extern "C" void add_triangle_to_collision_mesh(Vtx* vtx1, Vtx* vtx2, Vtx* vtx3,
|
||||
}
|
||||
|
||||
void RaceManager::Load() {
|
||||
if (WorldContext.GetCurrentCourse()) {
|
||||
if (WorldContext.GetTrack()) {
|
||||
mirroredVtxCache.clear();
|
||||
WorldContext.GetCurrentCourse()->Load();
|
||||
WorldContext.GetTrack()->Load();
|
||||
}
|
||||
}
|
||||
|
||||
void RaceManager::UnLoad() {
|
||||
if (WorldContext.GetCurrentCourse()) {
|
||||
WorldContext.GetCurrentCourse()->UnLoad();
|
||||
if (WorldContext.GetTrack()) {
|
||||
WorldContext.GetTrack()->UnLoad();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,14 +74,14 @@ void RaceManager::PreInit() {
|
||||
}
|
||||
|
||||
void RaceManager::BeginPlay() {
|
||||
auto course = WorldContext.GetCurrentCourse();
|
||||
auto track = WorldContext.GetTrack();
|
||||
|
||||
if (course) {
|
||||
if (track) {
|
||||
// Do not spawn finishline in credits or battle mode. And if bSpawnFinishline.
|
||||
if ((gGamestate != CREDITS_SEQUENCE) && (gModeSelection != BATTLE)) {
|
||||
if (course->bSpawnFinishline) {
|
||||
if (course->FinishlineSpawnPoint.has_value()) {
|
||||
AFinishline::Spawn(course->FinishlineSpawnPoint.value(), IRotator(0, 0, 0));
|
||||
if (track->bSpawnFinishline) {
|
||||
if (track->FinishlineSpawnPoint.has_value()) {
|
||||
AFinishline::Spawn(track->FinishlineSpawnPoint.value(), IRotator(0, 0, 0));
|
||||
} else {
|
||||
AFinishline::Spawn();
|
||||
}
|
||||
@@ -90,7 +90,7 @@ void RaceManager::BeginPlay() {
|
||||
}
|
||||
gEditor.AddLight("Sun", nullptr, D_800DC610[1].l->l.dir);
|
||||
|
||||
course->BeginPlay();
|
||||
track->BeginPlay();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+28
-28
@@ -1,7 +1,7 @@
|
||||
#include <libultraship.h>
|
||||
#include "World.h"
|
||||
#include "Cup.h"
|
||||
#include "courses/Course.h"
|
||||
#include "tracks/Track.h"
|
||||
#include "objects/BombKart.h"
|
||||
#include "TrainCrossing.h"
|
||||
#include <memory>
|
||||
@@ -27,7 +27,7 @@ extern "C" {
|
||||
#include "engine/cameras/TourCamera.h"
|
||||
#include "engine/cameras/LookBehindCamera.h"
|
||||
|
||||
std::shared_ptr<Course> CurrentCourse;
|
||||
std::shared_ptr<Track> mTrack;
|
||||
Cup* CurrentCup;
|
||||
|
||||
World::World() {
|
||||
@@ -38,27 +38,27 @@ World::~World() {
|
||||
CleanWorld();
|
||||
}
|
||||
|
||||
std::shared_ptr<Course> World::AddCourse(std::shared_ptr<Course> course) {
|
||||
gWorldInstance.Courses.push_back(course);
|
||||
return course;
|
||||
std::shared_ptr<Track> World::AddTrack(std::shared_ptr<Track> track) {
|
||||
gWorldInstance.Tracks.push_back(track);
|
||||
return track;
|
||||
}
|
||||
|
||||
void World::AddCup(Cup* cup) {
|
||||
Cups.push_back(cup);
|
||||
}
|
||||
|
||||
void World::SetCurrentCourse(std::shared_ptr<Course> course) {
|
||||
if (CurrentCourse) {
|
||||
UnLoadCourse();
|
||||
void World::SetCurrentTrack(std::shared_ptr<Track> track) {
|
||||
if (mTrack) {
|
||||
UnLoadTrack();
|
||||
}
|
||||
if (CurrentCourse == course) {
|
||||
if (mTrack == track) {
|
||||
return;
|
||||
}
|
||||
CurrentCourse = std::move(course);
|
||||
mTrack = std::move(track);
|
||||
}
|
||||
|
||||
void World::SetCourseFromCup() {
|
||||
SetCurrentCourse(CurrentCup->GetCourse());
|
||||
void World::SetTrackFromCup() {
|
||||
SetCurrentTrack(CurrentCup->GetTrack());
|
||||
}
|
||||
|
||||
TrainCrossing* World::AddCrossing(Vec3f position, u32 waypointMin, u32 waypointMax, f32 approachRadius,
|
||||
@@ -114,39 +114,39 @@ void World::SetCurrentCup(Cup* cup) {
|
||||
}
|
||||
}
|
||||
|
||||
void World::SetCourse(const char* name) {
|
||||
void World::SetTrack(const char* name) {
|
||||
//! @todo Use content dictionary instead
|
||||
for (size_t i = 0; i < Courses.size(); i++) {
|
||||
if (strcmp(Courses[i]->Props.Name, name) == 0) {
|
||||
SetCurrentCourse(Courses[i]);
|
||||
for (size_t i = 0; i < Tracks.size(); i++) {
|
||||
if (strcmp(Tracks[i]->Props.Name, name) == 0) {
|
||||
SetCurrentTrack(Tracks[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
std::runtime_error("SetCourse() Course name not found in Courses list");
|
||||
std::runtime_error("[World] [SetTrack()] Track name not found in Track list");
|
||||
}
|
||||
|
||||
void World::NextCourse() {
|
||||
if (CourseIndex < Courses.size() - 1) {
|
||||
CourseIndex++;
|
||||
void World::NextTrack() {
|
||||
if (TrackIndex < Tracks.size() - 1) {
|
||||
TrackIndex++;
|
||||
} else {
|
||||
CourseIndex = 0;
|
||||
TrackIndex = 0;
|
||||
}
|
||||
gWorldInstance.SetCurrentCourse(Courses[CourseIndex]);
|
||||
gWorldInstance.SetCurrentTrack(Tracks[TrackIndex]);
|
||||
}
|
||||
|
||||
void World::PreviousCourse() {
|
||||
if (CourseIndex > 0) {
|
||||
CourseIndex--;
|
||||
void World::PreviousTrack() {
|
||||
if (TrackIndex > 0) {
|
||||
TrackIndex--;
|
||||
} else {
|
||||
CourseIndex = Courses.size() - 1;
|
||||
TrackIndex = Tracks.size() - 1;
|
||||
}
|
||||
gWorldInstance.SetCurrentCourse(Courses[CourseIndex]);
|
||||
gWorldInstance.SetCurrentTrack(Tracks[TrackIndex]);
|
||||
}
|
||||
|
||||
void World::TickCameras() {
|
||||
|
||||
for (size_t i = 0; i < 4; i++) {
|
||||
struct UnkStruct_800DC5EC* screen = &D_8015F480[i];
|
||||
ScreenContext* screen = &gScreenContexts[i];
|
||||
if (NULL == screen->pendingCamera) { continue; }
|
||||
if (screen->pendingCamera != screen->camera) {
|
||||
screen->camera = screen->pendingCamera;
|
||||
|
||||
+21
-21
@@ -3,7 +3,7 @@
|
||||
#include <libultraship.h>
|
||||
|
||||
#include "CoreMath.h"
|
||||
#include "engine/courses/Course.h"
|
||||
#include "engine/tracks/Track.h"
|
||||
#include "engine/cameras/GameCamera.h"
|
||||
#include "objects/Object.h"
|
||||
#include "Cup.h"
|
||||
@@ -29,7 +29,7 @@ extern "C" {
|
||||
class Cup; // <-- Forward declaration
|
||||
class OObject;
|
||||
class GameCamera;
|
||||
class Course;
|
||||
class Track;
|
||||
class StaticMeshActor;
|
||||
class OBombKart;
|
||||
class TrainCrossing;
|
||||
@@ -52,7 +52,7 @@ typedef struct Matrix {
|
||||
{}
|
||||
};
|
||||
private:
|
||||
std::shared_ptr<Course> CurrentCourse;
|
||||
std::shared_ptr<Track> mTrack;
|
||||
Cup* CurrentCup;
|
||||
|
||||
public:
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
RaceManager& GetRaceManager() { return *RaceManagerInstance; }
|
||||
void SetRaceManager(std::unique_ptr<RaceManager> manager) { RaceManagerInstance = std::move(manager); }
|
||||
|
||||
std::shared_ptr<Course> AddCourse(std::shared_ptr<Course> course);
|
||||
std::shared_ptr<Track> AddTrack(std::shared_ptr<Track> track);
|
||||
|
||||
void TickCameras();
|
||||
|
||||
@@ -100,32 +100,32 @@ public:
|
||||
u32 GetCupIndex();
|
||||
u32 NextCup();
|
||||
u32 PreviousCup();
|
||||
void SetCourseFromCup();
|
||||
void SetTrackFromCup();
|
||||
|
||||
World* GetWorld(void);
|
||||
void CleanWorld(void);
|
||||
|
||||
// getter/setter for current course
|
||||
std::shared_ptr<Course> GetCurrentCourse() {
|
||||
return CurrentCourse;
|
||||
// getter/setter for current track
|
||||
std::shared_ptr<Track> GetTrack() {
|
||||
return mTrack;
|
||||
}
|
||||
|
||||
void SetCurrentCourse(std::shared_ptr<Course> course);
|
||||
void SetCurrentTrack(std::shared_ptr<Track> track);
|
||||
|
||||
// These are only for browsing through the course list
|
||||
void SetCourse(const char*);
|
||||
// These are only for browsing through the track list
|
||||
void SetTrack(const char*);
|
||||
template<typename T>
|
||||
void SetCourseByType() {
|
||||
for (const auto& course : Courses) {
|
||||
if (dynamic_cast<T*>(course.get())) {
|
||||
SetCurrentCourse(course);
|
||||
void SetTrackByType() {
|
||||
for (const auto& track : Tracks) {
|
||||
if (dynamic_cast<T*>(track.get())) {
|
||||
SetCurrentTrack(track);
|
||||
return;
|
||||
}
|
||||
}
|
||||
printf("World::SetCourseByType() No course by the type found");
|
||||
printf("World::SetTrackByType() No track by the type found");
|
||||
}
|
||||
void NextCourse(void);
|
||||
void PreviousCourse(void);
|
||||
void NextTrack(void);
|
||||
void PreviousTrack(void);
|
||||
|
||||
Matrix Mtx;
|
||||
|
||||
@@ -147,9 +147,9 @@ public:
|
||||
TrainCrossing* AddCrossing(Vec3f position, u32 waypointMin, u32 waypointMax, f32 approachRadius, f32 exitRadius);
|
||||
std::vector<std::shared_ptr<TrainCrossing>> Crossings;
|
||||
|
||||
// Holds all available courses
|
||||
std::vector<std::shared_ptr<Course>> Courses;
|
||||
size_t CourseIndex = 0; // For browsing courses.
|
||||
// Holds all available tracks
|
||||
std::vector<std::shared_ptr<Track>> Tracks;
|
||||
size_t TrackIndex = 0; // For browsing tracks.
|
||||
private:
|
||||
std::unique_ptr<RaceManager> RaceManagerInstance;
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ AFallingRock::AFallingRock(SpawnParams params) : AActor(params) {
|
||||
|
||||
FVector pos = params.Location.value_or(FVector(0, 0, 0));
|
||||
TimerLength = params.Behaviour.value_or(80);
|
||||
Pos[0] = pos.x * gCourseDirection;
|
||||
Pos[0] = pos.x * gTrackDirection;
|
||||
Pos[1] = pos.y + 10.0f;
|
||||
Pos[2] = pos.z;
|
||||
State = _count;
|
||||
@@ -49,7 +49,7 @@ void AFallingRock::SetSpawnParams(SpawnParams& params) {
|
||||
void AFallingRock::Reset() {
|
||||
RespawnTimer = TimerLength;
|
||||
FVector pos = SpawnPos;
|
||||
Pos[0] = (f32) pos.x * gCourseDirection;
|
||||
Pos[0] = (f32) pos.x * gTrackDirection;
|
||||
Pos[1] = (f32) pos.y + 10.0f;
|
||||
Pos[2] = (f32) pos.z;
|
||||
vec3f_set(Velocity, 0, 0, 0);
|
||||
|
||||
@@ -21,7 +21,7 @@ AMarioSign::AMarioSign(const SpawnParams& params) : AActor(params) {
|
||||
Speed = params.Speed.value_or(182);
|
||||
|
||||
FVector pos = params.Location.value_or(FVector(0, 0, 0));
|
||||
Pos[0] = pos.x * gCourseDirection;
|
||||
Pos[0] = pos.x * gTrackDirection;
|
||||
Pos[1] = pos.y;
|
||||
Pos[2] = pos.z;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ AWarioSign::AWarioSign(const SpawnParams& params) : AActor(params) {
|
||||
Speed = params.Speed.value_or(182);
|
||||
|
||||
FVector pos = params.Location.value_or(FVector(0, 0, 0));
|
||||
Pos[0] = pos.x * gCourseDirection;
|
||||
Pos[0] = pos.x * gTrackDirection;
|
||||
Pos[1] = pos.y;
|
||||
Pos[2] = pos.z;
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ void TourCamera::Reset() {
|
||||
void TourCamera::NextShot() {
|
||||
TourCamera::Reset();
|
||||
bShotComplete = false;
|
||||
_camera->pos[0] = gWorldInstance.GetCurrentCourse()->TourShots[ShotIndex].Pos.x;
|
||||
_camera->pos[1] = gWorldInstance.GetCurrentCourse()->TourShots[ShotIndex].Pos.y;
|
||||
_camera->pos[2] = gWorldInstance.GetCurrentCourse()->TourShots[ShotIndex].Pos.z;
|
||||
_camera->lookAt[0] = gWorldInstance.GetCurrentCourse()->TourShots[ShotIndex].LookAt.x;
|
||||
_camera->lookAt[1] = gWorldInstance.GetCurrentCourse()->TourShots[ShotIndex].LookAt.y;
|
||||
_camera->lookAt[2] = gWorldInstance.GetCurrentCourse()->TourShots[ShotIndex].LookAt.z;
|
||||
_camera->pos[0] = gWorldInstance.GetTrack()->TourShots[ShotIndex].Pos.x;
|
||||
_camera->pos[1] = gWorldInstance.GetTrack()->TourShots[ShotIndex].Pos.y;
|
||||
_camera->pos[2] = gWorldInstance.GetTrack()->TourShots[ShotIndex].Pos.z;
|
||||
_camera->lookAt[0] = gWorldInstance.GetTrack()->TourShots[ShotIndex].LookAt.x;
|
||||
_camera->lookAt[1] = gWorldInstance.GetTrack()->TourShots[ShotIndex].LookAt.y;
|
||||
_camera->lookAt[2] = gWorldInstance.GetTrack()->TourShots[ShotIndex].LookAt.z;
|
||||
}
|
||||
|
||||
void TourCamera::Stop() {
|
||||
@@ -58,7 +58,7 @@ void TourCamera::Stop() {
|
||||
gTourComplete = true;
|
||||
CM_ResetAudio();
|
||||
|
||||
D_8015F480[0].pendingCamera = &cameras[0];
|
||||
gScreenContexts[0].pendingCamera = &cameras[0];
|
||||
bActive = false;
|
||||
bTourComplete = true;
|
||||
|
||||
@@ -76,7 +76,7 @@ void TourCamera::Tick() {
|
||||
if (
|
||||
(nullptr == _camera) ||
|
||||
(bTourComplete) ||
|
||||
(ShotIndex >= gWorldInstance.GetCurrentCourse()->TourShots.size())
|
||||
(ShotIndex >= gWorldInstance.GetTrack()->TourShots.size())
|
||||
) {
|
||||
Alpha += 5;
|
||||
if (Alpha == 255) {
|
||||
@@ -108,7 +108,7 @@ void TourCamera::Tick() {
|
||||
}
|
||||
}
|
||||
|
||||
bool done = TourCamera::MoveCameraAlongSpline(&extraArg, gWorldInstance.GetCurrentCourse()->TourShots[ShotIndex].Frames);
|
||||
bool done = TourCamera::MoveCameraAlongSpline(&extraArg, gWorldInstance.GetTrack()->TourShots[ShotIndex].Frames);
|
||||
|
||||
// Advance to the next camera shot
|
||||
if (done) {
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Editor {
|
||||
/**
|
||||
* Save track properties, static mesh actors, actors, and tour camera
|
||||
*/
|
||||
data["Props"] = gWorldInstance.GetCurrentCourse()->Props.to_json();
|
||||
data["Props"] = gWorldInstance.GetTrack()->Props.to_json();
|
||||
|
||||
nlohmann::json staticMesh;
|
||||
SaveStaticMeshActors(staticMesh);
|
||||
@@ -54,7 +54,7 @@ namespace Editor {
|
||||
data["Actors"] = actors;
|
||||
|
||||
|
||||
if (gWorldInstance.GetCurrentCourse()->TourShots.size() != 0) {
|
||||
if (gWorldInstance.GetTrack()->TourShots.size() != 0) {
|
||||
nlohmann::json tour;
|
||||
SaveTour(tour);
|
||||
data["Tour"] = tour;
|
||||
@@ -85,10 +85,10 @@ namespace Editor {
|
||||
}
|
||||
|
||||
/** Do not use gWorldInstance.CurrentCourse during loading! The current track is not guaranteed! **/
|
||||
void LoadLevel(Course* course, std::string sceneFile) {
|
||||
void LoadLevel(Track* track, std::string sceneFile) {
|
||||
SceneFile = sceneFile;
|
||||
if ((nullptr == course) || (nullptr == course->RootArchive)) {
|
||||
SPDLOG_INFO("[SceneManager] [LoadLevel] Failed to load scenefile, course or rootarchive were null");
|
||||
if ((nullptr == track) || (nullptr == track->RootArchive)) {
|
||||
SPDLOG_INFO("[SceneManager] [LoadLevel] Failed to load scenefile, track or rootarchive were null");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace Editor {
|
||||
* the init data needs to be manually populated
|
||||
*/
|
||||
auto initData = std::make_shared<Ship::ResourceInitData>();
|
||||
initData->Parent = course->RootArchive;
|
||||
initData->Parent = track->RootArchive;
|
||||
initData->Format = RESOURCE_FORMAT_BINARY;
|
||||
initData->ByteOrder = Ship::Endianness::Little;
|
||||
initData->Type = static_cast<uint32_t>(Ship::ResourceType::Json);
|
||||
@@ -116,10 +116,10 @@ namespace Editor {
|
||||
SPDLOG_INFO("[SceneManager] [LoadLevel] Loading track scenefile...");
|
||||
|
||||
// Load the Props, and populate actors
|
||||
LoadProps(course, data);
|
||||
LoadActors(course, data);
|
||||
LoadStaticMeshActors(course, data);
|
||||
LoadTour(course, data);
|
||||
LoadProps(track, data);
|
||||
LoadActors(track, data);
|
||||
LoadStaticMeshActors(track, data);
|
||||
LoadTour(track, data);
|
||||
SPDLOG_INFO("[SceneManager] [LoadLevel] Scene File Loaded!");
|
||||
}
|
||||
|
||||
@@ -138,11 +138,11 @@ namespace Editor {
|
||||
}
|
||||
|
||||
// Called from ContentBrowser.cpp
|
||||
void LoadMinimap(Course* course, std::string filePath) {
|
||||
void LoadMinimap(Track* track, std::string filePath) {
|
||||
SPDLOG_INFO(" Loading {} minimap...", filePath);
|
||||
if (nullptr == course->RootArchive) {
|
||||
if (nullptr == track->RootArchive) {
|
||||
SPDLOG_INFO("[SceneManager] [LoadMinimap] Root archive is nullptr");
|
||||
SetDefaultMinimap(course);
|
||||
SetDefaultMinimap(track);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace Editor {
|
||||
* the init data needs to be manually populated
|
||||
*/
|
||||
auto initData = std::make_shared<Ship::ResourceInitData>();
|
||||
initData->Parent = course->RootArchive;
|
||||
initData->Parent = track->RootArchive;
|
||||
initData->Format = RESOURCE_FORMAT_BINARY;
|
||||
initData->ByteOrder = Ship::Endianness::Little;
|
||||
initData->Type = static_cast<uint32_t>(MK64::ResourceType::Minimap);
|
||||
@@ -163,19 +163,19 @@ namespace Editor {
|
||||
if (ptr) {
|
||||
SPDLOG_INFO(" Minimap Loaded!");
|
||||
MK64::MinimapTexture texture = ptr->Texture;
|
||||
course->Props.Minimap.Texture = (const char*)texture.Data;
|
||||
course->Props.Minimap.Width = texture.Width;
|
||||
course->Props.Minimap.Height = texture.Height;
|
||||
track->Props.Minimap.Texture = (const char*)texture.Data;
|
||||
track->Props.Minimap.Width = texture.Width;
|
||||
track->Props.Minimap.Height = texture.Height;
|
||||
} else { // Fallback
|
||||
SetDefaultMinimap(course);
|
||||
SetDefaultMinimap(track);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets the default minimap if none has been set
|
||||
void SetDefaultMinimap(Course* course) {
|
||||
course->Props.Minimap.Texture = minimap_mario_raceway;
|
||||
course->Props.Minimap.Width = ResourceGetTexWidthByName(course->Props.Minimap.Texture);
|
||||
course->Props.Minimap.Height = ResourceGetTexHeightByName(course->Props.Minimap.Texture);
|
||||
void SetDefaultMinimap(Track* track) {
|
||||
track->Props.Minimap.Texture = minimap_mario_raceway;
|
||||
track->Props.Minimap.Width = ResourceGetTexWidthByName(track->Props.Minimap.Texture);
|
||||
track->Props.Minimap.Height = ResourceGetTexHeightByName(track->Props.Minimap.Texture);
|
||||
SPDLOG_INFO(" No minimap found! Falling back to default minimap");
|
||||
}
|
||||
|
||||
@@ -253,47 +253,47 @@ namespace Editor {
|
||||
}
|
||||
|
||||
void SaveTour(nlohmann::json& tour) {
|
||||
tour["Enabled"] = gWorldInstance.GetCurrentCourse()->bTourEnabled;
|
||||
tour["Enabled"] = gWorldInstance.GetTrack()->bTourEnabled;
|
||||
|
||||
// Camera shots
|
||||
tour["Shots"] = nlohmann::json::array();
|
||||
for (const auto& shot : gWorldInstance.GetCurrentCourse()->TourShots) {
|
||||
for (const auto& shot : gWorldInstance.GetTrack()->TourShots) {
|
||||
tour["Shots"].push_back(ToJson(shot));
|
||||
}
|
||||
}
|
||||
|
||||
void LoadProps(Course* course, nlohmann::json& data) {
|
||||
void LoadProps(Track* track, nlohmann::json& data) {
|
||||
if (!data.contains("Props") || !data["Props"].is_object()) {
|
||||
SPDLOG_INFO("Track is missing props data. Is the scene.json file corrupt?");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
course->Props.from_json(data["Props"]);
|
||||
track->Props.from_json(data["Props"]);
|
||||
} catch(const std::exception& e) {
|
||||
std::cerr << " Error parsing track properties: " << e.what() << std::endl;
|
||||
std::cerr << " Is your scene.json file out of date?" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void LoadActors(Course* course, nlohmann::json& data) {
|
||||
void LoadActors(Track* track, nlohmann::json& data) {
|
||||
if (!data.contains("Actors") || !data["Actors"].is_object()) {
|
||||
SPDLOG_INFO(" This track contains no actors");
|
||||
return;
|
||||
}
|
||||
|
||||
course->SpawnList.clear(); // Clear existing actors, if any
|
||||
track->SpawnList.clear(); // Clear existing actors, if any
|
||||
|
||||
for (const auto& actor : data["Actors"]) {
|
||||
SpawnParams params;
|
||||
params.from_json(actor); //<SpawnParams>();
|
||||
if (!params.Name.empty()) {
|
||||
course->SpawnList.push_back(params);
|
||||
track->SpawnList.push_back(params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LoadStaticMeshActors(Course* course, nlohmann::json& data) {
|
||||
void LoadStaticMeshActors(Track* track, nlohmann::json& data) {
|
||||
if (!data.contains("StaticMeshActors") || !data["StaticMeshActors"].is_object()) {
|
||||
SPDLOG_INFO(" This track contains no StaticMeshActors!");
|
||||
return;
|
||||
@@ -306,7 +306,7 @@ namespace Editor {
|
||||
}
|
||||
}
|
||||
|
||||
void LoadTour(Course* course, nlohmann::json& data) {
|
||||
void LoadTour(Track* track, nlohmann::json& data) {
|
||||
if (!data.contains("Tour") || !data["Tour"].is_object()) {
|
||||
SPDLOG_INFO(" This track does not contain a camera tour");
|
||||
return;
|
||||
@@ -316,17 +316,17 @@ namespace Editor {
|
||||
|
||||
// Enable flag
|
||||
if (tours.contains("Enabled")) {
|
||||
course->bTourEnabled = tours["Enabled"].get<bool>();
|
||||
track->bTourEnabled = tours["Enabled"].get<bool>();
|
||||
} else {
|
||||
course->bTourEnabled = false;
|
||||
track->bTourEnabled = false;
|
||||
}
|
||||
|
||||
// Camera shots
|
||||
if (tours.contains("Shots") && tours["Shots"].is_array()) {
|
||||
course->TourShots.clear();
|
||||
track->TourShots.clear();
|
||||
|
||||
for (const auto& shotJson : tours["Shots"]) {
|
||||
course->TourShots.push_back(FromJsonCameraShot(shotJson));
|
||||
track->TourShots.push_back(FromJsonCameraShot(shotJson));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,26 +2,26 @@
|
||||
|
||||
#include <libultraship/libultraship.h>
|
||||
#include "CoreMath.h"
|
||||
#include "engine/courses/Course.h"
|
||||
#include "engine/tracks/Track.h"
|
||||
#include <optional>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace Editor {
|
||||
void SaveLevel();
|
||||
void LoadLevel(Course* course, std::string sceneFile);
|
||||
void LoadLevel(Track* track, std::string sceneFile);
|
||||
void Load_AddStaticMeshActor(const nlohmann::json& actorJson);
|
||||
void SetSceneFile(std::shared_ptr<Ship::Archive> archive, std::string sceneFile);
|
||||
void LoadMinimap(Course* course, std::string filePath);
|
||||
void SetDefaultMinimap(Course* course);
|
||||
void LoadMinimap(Track* track, std::string filePath);
|
||||
void SetDefaultMinimap(Track* track);
|
||||
|
||||
void SaveActors(nlohmann::json& actorList);
|
||||
void SaveStaticMeshActors(nlohmann::json& actorList);
|
||||
void SaveTour(nlohmann::json& tour);
|
||||
|
||||
void LoadProps(Course* course, nlohmann::json& data);
|
||||
void LoadActors(Course* course, nlohmann::json& data);
|
||||
void LoadStaticMeshActors(Course* course, nlohmann::json& data);
|
||||
void LoadTour(Course* course, nlohmann::json& data);
|
||||
void LoadProps(Track* track, nlohmann::json& data);
|
||||
void LoadActors(Track* track, nlohmann::json& data);
|
||||
void LoadStaticMeshActors(Track* track, nlohmann::json& data);
|
||||
void LoadTour(Track* track, nlohmann::json& data);
|
||||
|
||||
void SpawnActors(std::vector<std::pair<std::string, SpawnParams>> spawnList);
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ extern "C" {
|
||||
#include "code_80057C60.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "external.h"
|
||||
#include "course_offsets.h"
|
||||
}
|
||||
|
||||
size_t OChainChomp::_count = 0;
|
||||
|
||||
@@ -22,7 +22,7 @@ extern "C" {
|
||||
* @arg end x and z patrol location
|
||||
*
|
||||
* Crab patrols between start and end.
|
||||
* The game automatically places the actor on the course surface.
|
||||
* The game automatically places the actor on the surface of the tracks geometry.
|
||||
* Therefore, providing a Y height is unnecessary.
|
||||
*
|
||||
* Crab appears to have a maximum patrolling distance and will patrol between
|
||||
|
||||
@@ -11,6 +11,7 @@ extern "C" {
|
||||
#include "math_util_2.h"
|
||||
#include "code_80086E70.h"
|
||||
#include "code_80057C60.h"
|
||||
#include "course_offsets.h"
|
||||
}
|
||||
|
||||
size_t OFlagpole::_count = 0;
|
||||
|
||||
@@ -12,7 +12,6 @@ extern "C" {
|
||||
#include "waypoints.h"
|
||||
#include "common_structs.h"
|
||||
#include "objects.h"
|
||||
#include "course_offsets.h"
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,6 +22,7 @@ extern "C" {
|
||||
#include "some_data.h"
|
||||
#include "ceremony_and_credits.h"
|
||||
#include "assets/models/common_data.h"
|
||||
#include "course_offsets.h"
|
||||
extern SplineData D_800E6034;
|
||||
extern SplineData D_800E60F0;
|
||||
extern SplineData D_800E61B4;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <libultra/gbi.h>
|
||||
#include "Thwomp.h"
|
||||
#include <vector>
|
||||
#include "engine/courses/Course.h"
|
||||
#include "engine/tracks/Track.h"
|
||||
#include "engine/World.h"
|
||||
|
||||
#include "port/Game.h"
|
||||
|
||||
@@ -38,7 +38,6 @@ extern "C" {
|
||||
#include "actors.h"
|
||||
#include "collision.h"
|
||||
#include "memory.h"
|
||||
#include "course.h"
|
||||
extern const char *banshee_boardwalk_dls[100];
|
||||
}
|
||||
|
||||
@@ -59,7 +58,7 @@ BansheeBoardwalk::BansheeBoardwalk() {
|
||||
|
||||
Props.SetText(Props.Name, "banshee boardwalk", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "ghost", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "747m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "747m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D009058;
|
||||
Props.AIMaximumSeparation = 40.0f;
|
||||
@@ -118,7 +117,7 @@ BansheeBoardwalk::BansheeBoardwalk() {
|
||||
}
|
||||
|
||||
void BansheeBoardwalk::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(banshee_boardwalk_dls); i++) {
|
||||
@@ -146,7 +145,7 @@ void BansheeBoardwalk::Load() {
|
||||
D_801625EC = 0;
|
||||
D_801625F4 = 0;
|
||||
D_801625F0 = 0;
|
||||
parse_course_displaylists((TrackSections*) LOAD_ASSET_RAW(d_course_banshee_boardwalk_track_sections));
|
||||
parse_track_displaylists((TrackSections*) LOAD_ASSET_RAW(d_course_banshee_boardwalk_track_sections));
|
||||
func_80295C6C();
|
||||
find_vtx_and_set_colours((Gfx*) d_course_banshee_boardwalk_packed_dl_878, 128, 0, 0, 0);
|
||||
}
|
||||
@@ -191,14 +190,14 @@ void BansheeBoardwalk::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void BansheeBoardwalk::InitCourseObjects() {
|
||||
void BansheeBoardwalk::InitTrackObjects() {
|
||||
size_t objectId = 0;
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
init_object(indexObjectList1[2], 0);
|
||||
}
|
||||
}
|
||||
|
||||
void BansheeBoardwalk::UpdateCourseObjects() {
|
||||
void BansheeBoardwalk::TickTrackObjects() {
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
func_8007E4C4();
|
||||
if (gModeSelection != TIME_TRIALS) {
|
||||
@@ -208,7 +207,7 @@ void BansheeBoardwalk::UpdateCourseObjects() {
|
||||
}
|
||||
}
|
||||
|
||||
void BansheeBoardwalk::RenderCourseObjects(s32 cameraId) {
|
||||
void BansheeBoardwalk::DrawTrackObjects(s32 cameraId) {
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
// render_object_bat(cameraId);
|
||||
// render_object_boos(cameraId);
|
||||
@@ -248,7 +247,7 @@ void BansheeBoardwalk::WhatDoesThisDoAI(Player* player, int8_t playerId) {
|
||||
}
|
||||
}
|
||||
|
||||
void BansheeBoardwalk::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void BansheeBoardwalk::Draw(ScreenContext* arg0) {
|
||||
Camera* camera = arg0->camera;
|
||||
Mat4 spCC;
|
||||
UNUSED s32 pad[6];
|
||||
@@ -279,7 +278,7 @@ void BansheeBoardwalk::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
// d_course_banshee_boardwalk_packed_dl_69B0
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_banshee_boardwalk_packed_dl_69B0);
|
||||
|
||||
render_course_segments(banshee_boardwalk_dls, arg0);
|
||||
render_track_sections(banshee_boardwalk_dls, arg0);
|
||||
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
@@ -307,7 +306,7 @@ void BansheeBoardwalk::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
}
|
||||
|
||||
void BansheeBoardwalk::RenderCredits() {
|
||||
void BansheeBoardwalk::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) (d_course_banshee_boardwalk_dl_B308));
|
||||
}
|
||||
|
||||
@@ -332,7 +331,7 @@ void BansheeBoardwalk::Waypoints(Player* player, int8_t playerId) {
|
||||
}
|
||||
}
|
||||
|
||||
void BansheeBoardwalk::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot,
|
||||
void BansheeBoardwalk::DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot,
|
||||
uint16_t playerDirection) {
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/banshee_boardwalk/banshee_boardwalk_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture banshee_boardwalk_textures[];
|
||||
}
|
||||
|
||||
class BansheeBoardwalk : public Course {
|
||||
class BansheeBoardwalk : public Track {
|
||||
public:
|
||||
virtual ~BansheeBoardwalk() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -28,17 +29,17 @@ public:
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
//virtual void InitClouds() override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void UpdateCourseObjects() override;
|
||||
virtual void RenderCourseObjects(s32 cameraId) override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void TickTrackObjects() override;
|
||||
virtual void DrawTrackObjects(s32 cameraId) override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void ScrollingTextures() override;
|
||||
virtual void Waypoints(Player*, int8_t) override;
|
||||
virtual void DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) override;
|
||||
virtual void DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) override;
|
||||
virtual void CreditsSpawnActors() override;
|
||||
virtual void Destroy() override;
|
||||
};
|
||||
@@ -47,7 +47,7 @@ BigDonut::BigDonut() {
|
||||
|
||||
Props.SetText(Props.Name, "big donut", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "doughnut", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D008F18;
|
||||
Props.AIMaximumSeparation = -1.0f;
|
||||
@@ -103,7 +103,7 @@ BigDonut::BigDonut() {
|
||||
}
|
||||
|
||||
void BigDonut::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
if (gIsMirrorMode != 0) {
|
||||
InvertTriangleWindingByName(d_course_big_donut_packed_dl_DE8);
|
||||
InvertTriangleWindingByName(d_course_big_donut_packed_dl_450);
|
||||
@@ -142,7 +142,7 @@ void BigDonut::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void BigDonut::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void BigDonut::Draw(ScreenContext* arg0) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
|
||||
@@ -165,7 +165,7 @@ void BigDonut::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_big_donut_packed_dl_230);
|
||||
}
|
||||
|
||||
void BigDonut::RenderCredits() {
|
||||
void BigDonut::DrawCredits() {
|
||||
}
|
||||
|
||||
void BigDonut::Waypoints(Player* player, int8_t playerId) {
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/big_donut/big_donut_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture big_donut_textures[];
|
||||
}
|
||||
|
||||
class BigDonut : public Course {
|
||||
class BigDonut : public Track {
|
||||
public:
|
||||
virtual ~BigDonut() = default;
|
||||
|
||||
@@ -24,8 +25,8 @@ public:
|
||||
virtual void Load() override;
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void Waypoints(Player* player, int8_t playerId) override;
|
||||
virtual void Destroy() override;
|
||||
};
|
||||
@@ -49,7 +49,7 @@ BlockFort::BlockFort() {
|
||||
|
||||
Props.SetText(Props.Name, "block fort", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "block", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D008F18;
|
||||
Props.AIMaximumSeparation = -1.0f;
|
||||
@@ -106,14 +106,14 @@ BlockFort::BlockFort() {
|
||||
}
|
||||
|
||||
void BlockFort::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
|
||||
if (gIsMirrorMode != 0) {
|
||||
InvertTriangleWindingByName(d_course_block_fort_packed_dl_15C0);
|
||||
}
|
||||
generate_collision_mesh_with_default_section_id((Gfx*) d_course_block_fort_packed_dl_15C0, 1);
|
||||
func_80295C6C();
|
||||
Props.WaterLevel = gCourseMinY - 10.0f;
|
||||
Props.WaterLevel = gTrackMinY - 10.0f;
|
||||
}
|
||||
|
||||
void BlockFort::UnLoad() {
|
||||
@@ -133,7 +133,7 @@ void BlockFort::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void BlockFort::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void BlockFort::Draw(ScreenContext* arg0) {
|
||||
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/block_fort/block_fort_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture block_fort_textures[];
|
||||
}
|
||||
|
||||
class BlockFort : public Course {
|
||||
class BlockFort : public Track {
|
||||
public:
|
||||
virtual ~BlockFort() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -27,6 +28,6 @@ public:
|
||||
virtual void Load() override;
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void Waypoints(Player*, int8_t) override;
|
||||
};
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "BowsersCastle.h"
|
||||
#include "align_asset_macro.h"
|
||||
#include "engine/World.h"
|
||||
#include "engine/courses/Course.h"
|
||||
#include "engine/tracks/Track.h"
|
||||
#include "engine/actors/Finishline.h"
|
||||
#include "engine/objects/BombKart.h"
|
||||
#include "engine/objects/Thwomp.h"
|
||||
@@ -34,7 +34,6 @@ extern "C" {
|
||||
#include "collision.h"
|
||||
#include "code_8003DC40.h"
|
||||
#include "memory.h"
|
||||
#include "course.h"
|
||||
extern const char *bowsers_castle_dls[108];
|
||||
}
|
||||
|
||||
@@ -55,7 +54,7 @@ BowsersCastle::BowsersCastle() {
|
||||
|
||||
Props.SetText(Props.Name, "bowser's castle", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "castle", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "777m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "777m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D008FB8;
|
||||
Props.AIMaximumSeparation = 35.0f;
|
||||
@@ -115,7 +114,7 @@ BowsersCastle::BowsersCastle() {
|
||||
}
|
||||
|
||||
void BowsersCastle::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(bowsers_castle_dls); i++) {
|
||||
InvertTriangleWindingByName(bowsers_castle_dls[i]);
|
||||
@@ -127,7 +126,7 @@ void BowsersCastle::Load() {
|
||||
InvertTriangleWindingByName(d_course_bowsers_castle_dl_9228);
|
||||
}
|
||||
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_bowsers_castle_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_bowsers_castle_addr));
|
||||
func_80295C6C();
|
||||
find_vtx_and_set_colours((Gfx*) d_course_bowsers_castle_packed_dl_1350, 0x32, 0, 0, 0);
|
||||
}
|
||||
@@ -192,7 +191,7 @@ void BowsersCastle::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void BowsersCastle::InitCourseObjects() {
|
||||
void BowsersCastle::InitTrackObjects() {
|
||||
size_t objectId;
|
||||
size_t i;
|
||||
|
||||
@@ -219,11 +218,11 @@ void BowsersCastle::InitCourseObjects() {
|
||||
}
|
||||
}
|
||||
|
||||
void BowsersCastle::UpdateCourseObjects() {
|
||||
void BowsersCastle::TickTrackObjects() {
|
||||
update_flame_particle();
|
||||
}
|
||||
|
||||
void BowsersCastle::RenderCourseObjects(s32 cameraId) {
|
||||
void BowsersCastle::DrawTrackObjects(s32 cameraId) {
|
||||
// render_object_thwomps(cameraId);
|
||||
render_object_bowser_flame(cameraId);
|
||||
}
|
||||
@@ -261,7 +260,7 @@ void BowsersCastle::WhatDoesThisDoAI(Player* player, int8_t playerId) {
|
||||
}
|
||||
}
|
||||
|
||||
void BowsersCastle::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void BowsersCastle::Draw(ScreenContext* arg0) {
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
@@ -280,7 +279,7 @@ void BowsersCastle::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
if (D_802B87BC > 255) {
|
||||
D_802B87BC = 0;
|
||||
}
|
||||
render_course_segments(bowsers_castle_dls, arg0);
|
||||
render_track_sections(bowsers_castle_dls, arg0);
|
||||
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
|
||||
@@ -288,7 +287,7 @@ void BowsersCastle::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_bowsers_castle_packed_dl_248);
|
||||
}
|
||||
|
||||
void BowsersCastle::RenderCredits() {
|
||||
void BowsersCastle::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) (d_course_bowsers_castle_dl_9148));
|
||||
}
|
||||
|
||||
@@ -310,7 +309,7 @@ void BowsersCastle::Waypoints(Player* player, int8_t playerId) {
|
||||
}
|
||||
}
|
||||
|
||||
void BowsersCastle::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot,
|
||||
void BowsersCastle::DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot,
|
||||
uint16_t playerDirection) {
|
||||
if (gActiveScreenMode != SCREEN_MODE_1P) {
|
||||
return;
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/bowsers_castle/bowsers_castle_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture bowsers_castle_textures[];
|
||||
}
|
||||
|
||||
class BowsersCastle : public Course {
|
||||
class BowsersCastle : public Track {
|
||||
public:
|
||||
virtual ~BowsersCastle() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -29,17 +30,17 @@ public:
|
||||
void SpawnStockThwomp();
|
||||
virtual void BeginPlay() override;
|
||||
//virtual void InitClouds() override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void UpdateCourseObjects() override;
|
||||
virtual void RenderCourseObjects(s32 cameraId) override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void TickTrackObjects() override;
|
||||
virtual void DrawTrackObjects(s32 cameraId) override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void SomeCollisionThing(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7) override;
|
||||
virtual void Waypoints(Player*, int8_t) override;
|
||||
virtual void DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection);
|
||||
virtual void DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection);
|
||||
virtual void CreditsSpawnActors() override;
|
||||
virtual void Destroy() override;
|
||||
};
|
||||
@@ -34,7 +34,6 @@ extern "C" {
|
||||
#include "code_8003DC40.h"
|
||||
#include "memory.h"
|
||||
#include "course_offsets.h"
|
||||
#include "course.h"
|
||||
extern const char *choco_mountain_dls[96];
|
||||
}
|
||||
|
||||
@@ -54,7 +53,7 @@ ChocoMountain::ChocoMountain() {
|
||||
Id = "mk:choco_mountain";
|
||||
Props.SetText(Props.Name, "choco mountain", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "mountain", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "687m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "687m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D008F80;
|
||||
Props.AIMaximumSeparation = 35.0f;
|
||||
@@ -113,7 +112,7 @@ ChocoMountain::ChocoMountain() {
|
||||
}
|
||||
|
||||
void ChocoMountain::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(choco_mountain_dls); i++) {
|
||||
InvertTriangleWindingByName(choco_mountain_dls[i]);
|
||||
@@ -153,7 +152,7 @@ void ChocoMountain::Load() {
|
||||
nullify_displaylist((uintptr_t) LOAD_ASSET_RAW(d_course_choco_mountain_packed_dl_3C8));
|
||||
}
|
||||
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_choco_mountain_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_choco_mountain_addr));
|
||||
func_802B5CAC(0x238E, 0x31C7, D_8015F590);
|
||||
func_80295C6C();
|
||||
}
|
||||
@@ -179,7 +178,7 @@ void ChocoMountain::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void ChocoMountain::InitCourseObjects() {
|
||||
void ChocoMountain::InitTrackObjects() {
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
if (gModeSelection == GRAND_PRIX) {
|
||||
func_80070714();
|
||||
@@ -226,7 +225,7 @@ void ChocoMountain::WhatDoesThisDoAI(Player* player, int8_t playerId) {
|
||||
}
|
||||
}
|
||||
|
||||
void ChocoMountain::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void ChocoMountain::Draw(ScreenContext* arg0) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
|
||||
@@ -256,7 +255,7 @@ void ChocoMountain::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_choco_mountain_packed_dl_5868);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
|
||||
render_course_segments(choco_mountain_dls, arg0);
|
||||
render_track_sections(choco_mountain_dls, arg0);
|
||||
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2);
|
||||
@@ -273,7 +272,7 @@ void ChocoMountain::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
}
|
||||
|
||||
void ChocoMountain::RenderCredits() {
|
||||
void ChocoMountain::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_choco_mountain_dl_71B8));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/choco_mountain/choco_mountain_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture choco_mountain_textures[];
|
||||
}
|
||||
|
||||
class ChocoMountain : public Course {
|
||||
class ChocoMountain : public Track {
|
||||
public:
|
||||
virtual ~ChocoMountain() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -27,12 +28,12 @@ public:
|
||||
virtual void Load() override;
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void SomeCollisionThing(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7) override;
|
||||
virtual void Destroy() override;
|
||||
};
|
||||
@@ -36,7 +36,6 @@ extern "C" {
|
||||
#include "code_8003DC40.h"
|
||||
#include "memory.h"
|
||||
#include "sounds.h"
|
||||
#include "course.h"
|
||||
extern const char *d_course_dks_jungle_parkway_unknown_dl_list[105];
|
||||
extern s16 currentScreenSection;
|
||||
}
|
||||
@@ -56,7 +55,7 @@ DKJungle::DKJungle() {
|
||||
|
||||
Props.SetText(Props.Name, "d.k.'s jungle parkway", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "jungle", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "893m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "893m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D0093C0;
|
||||
Props.AIMaximumSeparation = 40.0f;
|
||||
@@ -115,7 +114,7 @@ DKJungle::DKJungle() {
|
||||
}
|
||||
|
||||
void DKJungle::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(d_course_dks_jungle_parkway_unknown_dl_list); i++) {
|
||||
InvertTriangleWindingByName(d_course_dks_jungle_parkway_unknown_dl_list[i]);
|
||||
@@ -128,7 +127,7 @@ void DKJungle::Load() {
|
||||
InvertTriangleWindingByName(d_course_dks_jungle_parkway_packed_dl_36A8);
|
||||
InvertTriangleWindingByName(d_course_dks_jungle_parkway_packed_dl_3F30);
|
||||
}
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_dks_jungle_parkway_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_dks_jungle_parkway_addr));
|
||||
func_80295C6C();
|
||||
// d_course_dks_jungle_parkway_packed_dl_3FA8
|
||||
find_vtx_and_set_colours((Gfx*) d_course_dks_jungle_parkway_packed_dl_3FA8, 120, 255, 255, 255);
|
||||
@@ -194,7 +193,7 @@ void DKJungle::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void DKJungle::InitCourseObjects() {
|
||||
void DKJungle::InitTrackObjects() {
|
||||
for (size_t i = 0; i < NUM_TORCHES; i++) {
|
||||
init_smoke_particles(i);
|
||||
// wtf?
|
||||
@@ -202,11 +201,11 @@ void DKJungle::InitCourseObjects() {
|
||||
}
|
||||
}
|
||||
|
||||
void DKJungle::UpdateCourseObjects() {
|
||||
void DKJungle::TickTrackObjects() {
|
||||
update_ferries_smoke_particle();
|
||||
}
|
||||
|
||||
void DKJungle::RenderCourseObjects(s32 cameraId) {
|
||||
void DKJungle::DrawTrackObjects(s32 cameraId) {
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
render_object_paddle_boat_smoke_particles(cameraId);
|
||||
}
|
||||
@@ -262,7 +261,7 @@ void DKJungle::WhatDoesThisDoAI(Player* player, int8_t playerId) {
|
||||
}
|
||||
}
|
||||
|
||||
void DKJungle::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void DKJungle::Draw(ScreenContext* arg0) {
|
||||
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
|
||||
set_track_light_direction(&D_800DC610[1], D_802B87D4, D_802B87D0, 1);
|
||||
|
||||
@@ -280,12 +279,12 @@ void DKJungle::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
|
||||
render_course_segments(d_course_dks_jungle_parkway_unknown_dl_list, arg0);
|
||||
render_track_sections(d_course_dks_jungle_parkway_unknown_dl_list, arg0);
|
||||
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
|
||||
void DKJungle::RenderCredits() {
|
||||
void DKJungle::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_dks_jungle_parkway_dl_13C30));
|
||||
}
|
||||
|
||||
@@ -329,7 +328,7 @@ void DKJungle::ScrollingTextures() {
|
||||
evaluate_collision_players_palm_trees();
|
||||
}
|
||||
|
||||
void DKJungle::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) {
|
||||
void DKJungle::DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) {
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/dks_jungle_parkway/dks_jungle_parkway_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture dks_jungle_parkway_textures[];
|
||||
}
|
||||
|
||||
class DKJungle : public Course {
|
||||
class DKJungle : public Track {
|
||||
public:
|
||||
virtual ~DKJungle() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -29,18 +30,18 @@ public:
|
||||
virtual f32 GetWaterLevel(FVector pos, Collision* collision) override;
|
||||
virtual void BeginPlay() override;
|
||||
//virtual void InitClouds() override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void UpdateCourseObjects() override;
|
||||
virtual void RenderCourseObjects(s32 cameraId) override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void TickTrackObjects() override;
|
||||
virtual void DrawTrackObjects(s32 cameraId) override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void SomeCollisionThing(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7) override;
|
||||
virtual void Waypoints(Player* player, int8_t playerId) override;
|
||||
virtual void ScrollingTextures() override;
|
||||
virtual void DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) override;
|
||||
virtual void DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) override;
|
||||
virtual void CreditsSpawnActors() override;
|
||||
virtual void Destroy() override;
|
||||
};
|
||||
@@ -48,7 +48,7 @@ DoubleDeck::DoubleDeck() {
|
||||
|
||||
Props.SetText(Props.Name, "double deck", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "deck", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "", sizeof(Props.TrackLength));
|
||||
|
||||
|
||||
Props.AIBehaviour = D_0D008F18;
|
||||
@@ -106,13 +106,13 @@ DoubleDeck::DoubleDeck() {
|
||||
}
|
||||
|
||||
void DoubleDeck::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
if (gIsMirrorMode != 0) {
|
||||
InvertTriangleWindingByName(d_course_double_deck_packed_dl_738);
|
||||
}
|
||||
generate_collision_mesh_with_default_section_id((Gfx*) d_course_double_deck_packed_dl_738, 1);
|
||||
func_80295C6C();
|
||||
Props.WaterLevel = gCourseMinY - 10.0f;
|
||||
Props.WaterLevel = gTrackMinY - 10.0f;
|
||||
}
|
||||
|
||||
void DoubleDeck::UnLoad() {
|
||||
@@ -132,7 +132,7 @@ void DoubleDeck::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void DoubleDeck::InitCourseObjects() {}
|
||||
void DoubleDeck::InitTrackObjects() {}
|
||||
|
||||
void DoubleDeck::SomeSounds() {}
|
||||
|
||||
@@ -140,7 +140,7 @@ void DoubleDeck::WhatDoesThisDo(Player* player, int8_t playerId) {}
|
||||
|
||||
void DoubleDeck::WhatDoesThisDoAI(Player* player, int8_t playerId) {}
|
||||
|
||||
void DoubleDeck::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void DoubleDeck::Draw(ScreenContext* arg0) {
|
||||
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
@@ -151,7 +151,7 @@ void DoubleDeck::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
|
||||
void DoubleDeck::RenderCredits() {}
|
||||
void DoubleDeck::DrawCredits() {}
|
||||
|
||||
void DoubleDeck::Waypoints(Player* player, int8_t playerId) {
|
||||
player->nearestPathPointId = 0;
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/double_deck/double_deck_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture double_deck_textures[];
|
||||
}
|
||||
|
||||
class DoubleDeck : public Course {
|
||||
class DoubleDeck : public Track {
|
||||
public:
|
||||
virtual ~DoubleDeck() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -27,12 +28,12 @@ public:
|
||||
virtual void Load() override;
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void Waypoints(Player* player, int8_t playerId) override;
|
||||
virtual void Destroy() override;
|
||||
};
|
||||
@@ -35,7 +35,6 @@ extern "C" {
|
||||
#include "memory.h"
|
||||
#include "update_objects.h"
|
||||
#include "course_offsets.h"
|
||||
#include "course.h"
|
||||
extern const char *d_course_frappe_snowland_dl_list[68];
|
||||
extern s8 gPlayerCount;
|
||||
}
|
||||
@@ -56,7 +55,7 @@ FrappeSnowland::FrappeSnowland() {
|
||||
|
||||
Props.SetText(Props.Name, "frappe snowland", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "snow", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "734m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "734m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D0090F8;
|
||||
Props.AIMaximumSeparation = 50.0f;
|
||||
@@ -115,7 +114,7 @@ FrappeSnowland::FrappeSnowland() {
|
||||
}
|
||||
|
||||
void FrappeSnowland::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(d_course_frappe_snowland_dl_list); i++) {
|
||||
@@ -124,7 +123,7 @@ void FrappeSnowland::Load() {
|
||||
|
||||
InvertTriangleWindingByName(d_course_frappe_snowland_packed_dl_65E0);
|
||||
}
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_frappe_snowland_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_frappe_snowland_addr));
|
||||
func_80295C6C();
|
||||
}
|
||||
|
||||
@@ -185,11 +184,11 @@ void FrappeSnowland::InitClouds() {
|
||||
D_8018D230 = 0; // This must be turned off or mayhem ensues
|
||||
}
|
||||
|
||||
void FrappeSnowland::UpdateClouds(s32 sp1C, Camera* camera) {
|
||||
void FrappeSnowland::TickClouds(s32 sp1C, Camera* camera) {
|
||||
func_80078170(sp1C, camera);
|
||||
}
|
||||
|
||||
void FrappeSnowland::InitCourseObjects() {
|
||||
void FrappeSnowland::InitTrackObjects() {
|
||||
size_t objectId;
|
||||
size_t i;
|
||||
for (i = 0; i < NUM_SNOWFLAKES; i++) {
|
||||
@@ -197,11 +196,11 @@ void FrappeSnowland::InitCourseObjects() {
|
||||
}
|
||||
}
|
||||
|
||||
void FrappeSnowland::UpdateCourseObjects() {
|
||||
void FrappeSnowland::TickTrackObjects() {
|
||||
update_snowflakes();
|
||||
}
|
||||
|
||||
void FrappeSnowland::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void FrappeSnowland::Draw(ScreenContext* arg0) {
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
@@ -215,10 +214,10 @@ void FrappeSnowland::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
render_course_segments(d_course_frappe_snowland_dl_list, arg0);
|
||||
render_track_sections(d_course_frappe_snowland_dl_list, arg0);
|
||||
}
|
||||
|
||||
void FrappeSnowland::RenderCredits() {
|
||||
void FrappeSnowland::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_frappe_snowland_dl_76A0));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/frappe_snowland/frappe_snowland_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture frappe_snowland_textures[];
|
||||
}
|
||||
|
||||
class FrappeSnowland : public Course {
|
||||
class FrappeSnowland : public Track {
|
||||
public:
|
||||
virtual ~FrappeSnowland() = default;
|
||||
|
||||
@@ -25,10 +26,10 @@ public:
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void InitClouds() override;
|
||||
virtual void UpdateClouds(s32 sp1C, Camera* camera) override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void UpdateCourseObjects() override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void TickClouds(s32 sp1C, Camera* camera) override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void TickTrackObjects() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void Waypoints(Player* player, int8_t playerId) override;
|
||||
};
|
||||
@@ -51,7 +51,6 @@ extern "C" {
|
||||
#include "collision.h"
|
||||
#include "memory.h"
|
||||
#include "courses/harbour/track.h"
|
||||
#include "course.h"
|
||||
}
|
||||
|
||||
TrackPathPoint harbour_path[] = {
|
||||
@@ -530,7 +529,7 @@ Harbour::Harbour() {
|
||||
Id = "mk:harbour";
|
||||
Props.SetText(Props.Name, "Harbour", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "harbour", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "99m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "99m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D008F28;
|
||||
Props.AIMaximumSeparation = 50.0f;
|
||||
@@ -596,7 +595,7 @@ TrackSections harbour_surfaces[] = {
|
||||
};
|
||||
|
||||
void Harbour::Load() {
|
||||
Course::Load(road_map_001_mesh_vtx_0, NULL);
|
||||
Track::Load(road_map_001_mesh_vtx_0, NULL);
|
||||
|
||||
if (gIsMirrorMode != 0) {
|
||||
InvertTriangleWinding(ground_map_mesh);
|
||||
@@ -622,9 +621,9 @@ void Harbour::Load() {
|
||||
generate_collision_mesh_with_defaults(bush_map_004_mesh);
|
||||
generate_collision_mesh_with_defaults(statue_map_005_mesh);
|
||||
|
||||
parse_course_displaylists((TrackSections*)harbour_surfaces);
|
||||
parse_track_displaylists((TrackSections*)harbour_surfaces);
|
||||
func_80295C6C();
|
||||
Props.WaterLevel = gCourseMinY - 10.0f;
|
||||
Props.WaterLevel = gTrackMinY - 10.0f;
|
||||
}
|
||||
|
||||
void Harbour::UnLoad() {
|
||||
@@ -717,7 +716,7 @@ void Harbour::WhatDoesThisDoAI(Player* player, int8_t playerId) {
|
||||
}
|
||||
}
|
||||
|
||||
void Harbour::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void Harbour::Draw(ScreenContext* arg0) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/mario_raceway/mario_raceway_vertices.h"
|
||||
@@ -12,10 +12,9 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
extern const course_texture test_course_textures[];
|
||||
}
|
||||
|
||||
class Harbour : public Course {
|
||||
class Harbour : public Track {
|
||||
public:
|
||||
virtual ~Harbour() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -29,6 +28,6 @@ public:
|
||||
virtual void BeginPlay() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual bool IsMod() override;
|
||||
};
|
||||
@@ -33,7 +33,6 @@ extern "C" {
|
||||
#include "actors.h"
|
||||
#include "collision.h"
|
||||
#include "memory.h"
|
||||
#include "course.h"
|
||||
extern const char *kalimari_desert_dls[80];
|
||||
}
|
||||
|
||||
@@ -52,7 +51,7 @@ KalimariDesert::KalimariDesert() {
|
||||
|
||||
Props.SetText(Props.Name, "kalimari desert", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "desert", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "753m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "753m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D009260;
|
||||
Props.AIMaximumSeparation = 50.0f;
|
||||
@@ -110,7 +109,7 @@ KalimariDesert::KalimariDesert() {
|
||||
}
|
||||
|
||||
void KalimariDesert::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(kalimari_desert_dls); i++) {
|
||||
@@ -125,9 +124,9 @@ void KalimariDesert::Load() {
|
||||
InvertTriangleWindingByName(d_course_kalimari_desert_packed_dl_270);
|
||||
}
|
||||
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_kalimari_desert_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_kalimari_desert_addr));
|
||||
func_80295C6C();
|
||||
Props.WaterLevel = gCourseMinY - 10.0f;
|
||||
Props.WaterLevel = gTrackMinY - 10.0f;
|
||||
}
|
||||
|
||||
void KalimariDesert::UnLoad() {
|
||||
@@ -151,25 +150,25 @@ void KalimariDesert::BeginPlay() {
|
||||
uintptr_t* crossing2 = (uintptr_t*) gWorldInstance.AddCrossing(crossingPos2, 176, 182, 900.0f, 650.0f);
|
||||
|
||||
vec3f_set(position, -1680.0f, 2.0f, 35.0f);
|
||||
position[0] *= gCourseDirection;
|
||||
position[0] *= gTrackDirection;
|
||||
rrxing = (struct RailroadCrossing*) GET_ACTOR(add_actor_to_empty_slot(position, rotation, velocity,
|
||||
ACTOR_RAILROAD_CROSSING));
|
||||
rrxing->crossingTrigger = crossing2;
|
||||
vec3f_set(position, -1600.0f, 2.0f, 35.0f);
|
||||
position[0] *= gCourseDirection;
|
||||
position[0] *= gTrackDirection;
|
||||
rrxing = (struct RailroadCrossing*) GET_ACTOR(add_actor_to_empty_slot(position, rotation, velocity,
|
||||
ACTOR_RAILROAD_CROSSING));
|
||||
rrxing->crossingTrigger = crossing2;
|
||||
|
||||
// Original game forgot to put gCourseDirection to face the crossing the right direction in extra mode
|
||||
vec3s_set(rotation, 0, -0x2000 * gCourseDirection, 0);
|
||||
// Original game forgot to put gTrackDirection to face the crossing the right direction in extra mode
|
||||
vec3s_set(rotation, 0, -0x2000 * gTrackDirection, 0);
|
||||
vec3f_set(position, -2459.0f, 2.0f, 2263.0f);
|
||||
position[0] *= gCourseDirection;
|
||||
position[0] *= gTrackDirection;
|
||||
rrxing = (struct RailroadCrossing*) GET_ACTOR(add_actor_to_empty_slot(position, rotation, velocity,
|
||||
ACTOR_RAILROAD_CROSSING));
|
||||
rrxing->crossingTrigger = crossing1;
|
||||
vec3f_set(position, -2467.0f, 2.0f, 2375.0f);
|
||||
position[0] *= gCourseDirection;
|
||||
position[0] *= gTrackDirection;
|
||||
rrxing = (struct RailroadCrossing*) GET_ACTOR(add_actor_to_empty_slot(position, rotation, velocity,
|
||||
ACTOR_RAILROAD_CROSSING));
|
||||
rrxing->crossingTrigger = crossing1;
|
||||
@@ -218,7 +217,7 @@ void KalimariDesert::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void KalimariDesert::InitCourseObjects() {
|
||||
void KalimariDesert::InitTrackObjects() {
|
||||
size_t i;
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
find_unused_obj_index(&D_8018CF10);
|
||||
@@ -241,7 +240,7 @@ void KalimariDesert::WhatDoesThisDo(Player* player, int8_t playerId) {}
|
||||
|
||||
void KalimariDesert::WhatDoesThisDoAI(Player* player, int8_t playerId) {}
|
||||
|
||||
void KalimariDesert::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void KalimariDesert::Draw(ScreenContext* arg0) {
|
||||
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
|
||||
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
@@ -257,7 +256,7 @@ void KalimariDesert::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);
|
||||
render_course_segments(kalimari_desert_dls, arg0);
|
||||
render_track_sections(kalimari_desert_dls, arg0);
|
||||
// d_course_kalimari_desert_packed_dl_1ED8
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_kalimari_desert_packed_dl_1ED8);
|
||||
// d_course_kalimari_desert_packed_dl_1B18
|
||||
@@ -274,7 +273,7 @@ void KalimariDesert::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
|
||||
void KalimariDesert::RenderCredits() {
|
||||
void KalimariDesert::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_kalimari_desert_dl_22E00));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "CoreMath.h"
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
#include "engine/vehicles/Train.h"
|
||||
|
||||
extern "C" {
|
||||
@@ -14,10 +14,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture kalimari_desert_textures[];
|
||||
}
|
||||
|
||||
class KalimariDesert : public Course {
|
||||
class KalimariDesert : public Track {
|
||||
public:
|
||||
virtual ~KalimariDesert() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -29,12 +30,12 @@ public:
|
||||
virtual void Load() override;
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void Destroy() override;
|
||||
|
||||
private:
|
||||
@@ -34,7 +34,6 @@ extern "C" {
|
||||
#include "collision.h"
|
||||
#include "code_8003DC40.h"
|
||||
#include "memory.h"
|
||||
#include "course.h"
|
||||
extern const char *d_course_koopa_troopa_beach_dl_list1[148];
|
||||
extern const char *koopa_troopa_beach_dls2[148];
|
||||
extern s8 gPlayerCount;
|
||||
@@ -56,7 +55,7 @@ KoopaTroopaBeach::KoopaTroopaBeach() {
|
||||
Id = "mk:koopa_beach";
|
||||
Props.SetText(Props.Name, "koopa troopa beach", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "beach", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "691m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "691m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D009158;
|
||||
Props.AIMaximumSeparation = 50.0f;
|
||||
@@ -118,7 +117,7 @@ KoopaTroopaBeach::KoopaTroopaBeach() {
|
||||
}
|
||||
|
||||
void KoopaTroopaBeach::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(d_course_koopa_troopa_beach_dl_list1); i++) {
|
||||
InvertTriangleWindingByName(d_course_koopa_troopa_beach_dl_list1[i]);
|
||||
@@ -131,7 +130,7 @@ void KoopaTroopaBeach::Load() {
|
||||
InvertTriangleWindingByName(d_course_koopa_troopa_beach_packed_dl_2C0);
|
||||
InvertTriangleWindingByName(d_course_koopa_troopa_beach_packed_dl_9E70);
|
||||
}
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_koopa_troopa_beach_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_koopa_troopa_beach_addr));
|
||||
func_80295C6C();
|
||||
find_vtx_and_set_colours((Gfx*) d_course_koopa_troopa_beach_packed_dl_ADE0, 150, 255, 255, 255);
|
||||
find_vtx_and_set_colours((Gfx*) d_course_koopa_troopa_beach_packed_dl_A540, 150, 255, 255, 255);
|
||||
@@ -144,7 +143,7 @@ void KoopaTroopaBeach::UnLoad() {
|
||||
}
|
||||
|
||||
void KoopaTroopaBeach::BeginPlay() {
|
||||
init_actor_hot_air_balloon_item_box(328.0f * gCourseDirection, 70.0f, 2541.0f);
|
||||
init_actor_hot_air_balloon_item_box(328.0f * gTrackDirection, 70.0f, 2541.0f);
|
||||
spawn_all_item_boxes((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_koopa_troopa_beach_item_box_spawns));
|
||||
spawn_palm_trees((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_koopa_troopa_beach_tree_spawn));
|
||||
|
||||
@@ -186,10 +185,10 @@ void KoopaTroopaBeach::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void KoopaTroopaBeach::InitCourseObjects() {
|
||||
void KoopaTroopaBeach::InitTrackObjects() {
|
||||
}
|
||||
|
||||
void KoopaTroopaBeach::UpdateCourseObjects() {
|
||||
void KoopaTroopaBeach::TickTrackObjects() {
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
//update_crabs();
|
||||
}
|
||||
@@ -198,7 +197,7 @@ void KoopaTroopaBeach::UpdateCourseObjects() {
|
||||
}
|
||||
}
|
||||
|
||||
void KoopaTroopaBeach::RenderCourseObjects(s32 cameraId) {
|
||||
void KoopaTroopaBeach::DrawTrackObjects(s32 cameraId) {
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
//render_object_crabs(cameraId);
|
||||
}
|
||||
@@ -221,7 +220,7 @@ void KoopaTroopaBeach::WhatDoesThisDo(Player* player, int8_t playerId) {}
|
||||
|
||||
void KoopaTroopaBeach::WhatDoesThisDoAI(Player* player, int8_t playerId) {}
|
||||
|
||||
void KoopaTroopaBeach::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void KoopaTroopaBeach::Draw(ScreenContext* arg0) {
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
@@ -237,7 +236,7 @@ void KoopaTroopaBeach::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
// d_course_koopa_troopa_beach_packed_dl_9688
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_koopa_troopa_beach_packed_dl_9688);
|
||||
render_course_segments((const char**)d_course_koopa_troopa_beach_dl_list1, arg0);
|
||||
render_track_sections((const char**)d_course_koopa_troopa_beach_dl_list1, arg0);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
|
||||
@@ -247,7 +246,7 @@ void KoopaTroopaBeach::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
}
|
||||
|
||||
void KoopaTroopaBeach::RenderCredits() {
|
||||
void KoopaTroopaBeach::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_koopa_troopa_beach_dl_18D68));
|
||||
}
|
||||
|
||||
@@ -291,7 +290,7 @@ void KoopaTroopaBeach::ScrollingTextures() {
|
||||
|
||||
}
|
||||
|
||||
void KoopaTroopaBeach::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) {
|
||||
void KoopaTroopaBeach::DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) {
|
||||
Vec3f vector;
|
||||
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
@@ -322,7 +321,7 @@ void KoopaTroopaBeach::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pat
|
||||
gDPSetBlendMask(gDisplayListHead++, 0xFF);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
render_course_segments((const char**)koopa_troopa_beach_dls2, screen);
|
||||
render_track_sections((const char**)koopa_troopa_beach_dls2, screen);
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 1, 1, G_OFF);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gDPSetAlphaCompare(gDisplayListHead++, G_AC_NONE);
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "../CoreMath.h"
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
#include "World.h"
|
||||
|
||||
@@ -15,10 +15,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture koopa_troopa_beach_textures[];
|
||||
}
|
||||
|
||||
class KoopaTroopaBeach : public Course {
|
||||
class KoopaTroopaBeach : public Track {
|
||||
public:
|
||||
virtual ~KoopaTroopaBeach() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -30,16 +31,16 @@ public:
|
||||
virtual void Load() override;
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void UpdateCourseObjects() override;
|
||||
virtual void RenderCourseObjects(s32 cameraId) override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void TickTrackObjects() override;
|
||||
virtual void DrawTrackObjects(s32 cameraId) override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void SomeCollisionThing(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7) override;
|
||||
virtual void ScrollingTextures() override;
|
||||
virtual void DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) override;
|
||||
virtual void DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) override;
|
||||
virtual void Destroy() override;
|
||||
};
|
||||
@@ -38,7 +38,6 @@ extern "C" {
|
||||
#include "courses/staff_ghost_data.h"
|
||||
#include "framebuffer_effects.h"
|
||||
#include "skybox_and_splitscreen.h"
|
||||
#include "course.h"
|
||||
extern const char* luigi_raceway_dls[120];
|
||||
extern s16 currentScreenSection;
|
||||
}
|
||||
@@ -59,7 +58,7 @@ LuigiRaceway::LuigiRaceway() {
|
||||
Id = "mk:luigi_raceway";
|
||||
Props.SetText(Props.Name, "luigi raceway", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "l circuit", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "717m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "717m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D0091E8;
|
||||
Props.AIMaximumSeparation = 50.0f;
|
||||
@@ -117,7 +116,7 @@ LuigiRaceway::LuigiRaceway() {
|
||||
}
|
||||
|
||||
void LuigiRaceway::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(luigi_raceway_dls); i++) {
|
||||
InvertTriangleWindingByName(luigi_raceway_dls[i]);
|
||||
@@ -126,9 +125,9 @@ void LuigiRaceway::Load() {
|
||||
InvertTriangleWindingByName(d_course_luigi_raceway_packed_dl_E0);
|
||||
InvertTriangleWindingByName(d_course_luigi_raceway_packed_dl_68);
|
||||
}
|
||||
parse_course_displaylists((TrackSections*) LOAD_ASSET_RAW(d_course_luigi_raceway_addr));
|
||||
parse_track_displaylists((TrackSections*) LOAD_ASSET_RAW(d_course_luigi_raceway_addr));
|
||||
func_80295C6C();
|
||||
Props.WaterLevel = gCourseMinY - 10.0f;
|
||||
Props.WaterLevel = gTrackMinY - 10.0f;
|
||||
}
|
||||
|
||||
void LuigiRaceway::UnLoad() {
|
||||
@@ -157,7 +156,7 @@ void LuigiRaceway::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void LuigiRaceway::InitCourseObjects() {
|
||||
void LuigiRaceway::InitTrackObjects() {
|
||||
size_t i;
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
if (gModeSelection == GRAND_PRIX) {
|
||||
@@ -249,7 +248,7 @@ void LuigiRaceway::CopyJumbotron(s32 ulx, s32 uly, s16 portionToDraw, u16* sourc
|
||||
}
|
||||
}
|
||||
|
||||
void LuigiRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void LuigiRaceway::Draw(ScreenContext* arg0) {
|
||||
UNUSED s32 pad;
|
||||
u16 sp22 = (u16) arg0->pathCounter;
|
||||
s16 prevFrame;
|
||||
@@ -278,7 +277,7 @@ void LuigiRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
|
||||
render_course_segments(luigi_raceway_dls, arg0);
|
||||
render_track_sections(luigi_raceway_dls, arg0);
|
||||
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
|
||||
@@ -314,7 +313,7 @@ void LuigiRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
void LuigiRaceway::RenderCredits() {
|
||||
void LuigiRaceway::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) (d_course_luigi_raceway_dl_FD40));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/luigi_raceway/luigi_raceway_vertices.h"
|
||||
@@ -15,7 +15,7 @@ extern "C" {
|
||||
extern const course_texture luigi_raceway_textures[];
|
||||
}
|
||||
|
||||
class LuigiRaceway : public Course {
|
||||
class LuigiRaceway : public Track {
|
||||
void CopyJumbotron(s32 ulx, s32 uly, s16 portionToDraw, u16* source);
|
||||
|
||||
public:
|
||||
@@ -29,13 +29,13 @@ class LuigiRaceway : public Course {
|
||||
virtual void Load() override;
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void SetStaffGhost() override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void SomeCollisionThing(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6,
|
||||
f32* arg7) override;
|
||||
};
|
||||
@@ -34,7 +34,6 @@ extern "C" {
|
||||
#include "collision.h"
|
||||
#include "memory.h"
|
||||
#include "courses/staff_ghost_data.h"
|
||||
#include "course.h"
|
||||
extern const char *mario_raceway_dls[68];
|
||||
}
|
||||
|
||||
@@ -54,7 +53,7 @@ MarioRaceway::MarioRaceway() {
|
||||
Id = "mk:mario_raceway";
|
||||
Props.SetText(Props.Name, "mario raceway", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "m circuit", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "567m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "567m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D008F28;
|
||||
Props.AIMaximumSeparation = 50.0f;
|
||||
@@ -113,7 +112,7 @@ MarioRaceway::MarioRaceway() {
|
||||
}
|
||||
|
||||
void MarioRaceway::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
|
||||
// Invert winding in mirror mode before generating collision meshes
|
||||
if (gIsMirrorMode != 0) {
|
||||
@@ -150,9 +149,9 @@ void MarioRaceway::Load() {
|
||||
}
|
||||
}
|
||||
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_mario_raceway_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_mario_raceway_addr));
|
||||
func_80295C6C();
|
||||
Props.WaterLevel = gCourseMinY - 10.0f;
|
||||
Props.WaterLevel = gTrackMinY - 10.0f;
|
||||
}
|
||||
|
||||
void MarioRaceway::UnLoad() {
|
||||
@@ -187,7 +186,7 @@ void MarioRaceway::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void MarioRaceway::InitCourseObjects() {
|
||||
void MarioRaceway::InitTrackObjects() {
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
if (gModeSelection == GRAND_PRIX) {
|
||||
func_80070714();
|
||||
@@ -257,7 +256,7 @@ void render_mario_raceway_pipe(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void MarioRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void MarioRaceway::Draw(ScreenContext* arg0) {
|
||||
u16 sp22 = arg0->pathCounter;
|
||||
u16 temp_t0 = arg0->playerDirection;
|
||||
|
||||
@@ -351,7 +350,7 @@ void MarioRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_mario_raceway_packed_dl_3508);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_mario_raceway_packed_dl_3240);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_mario_raceway_packed_dl_14A0);
|
||||
render_course_segments(mario_raceway_dls, arg0);
|
||||
render_track_sections(mario_raceway_dls, arg0);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
@@ -362,7 +361,7 @@ void MarioRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_mario_raceway_packed_dl_160);
|
||||
}
|
||||
|
||||
void MarioRaceway::RenderCredits() {
|
||||
void MarioRaceway::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_mario_raceway_dl_9348));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/mario_raceway/mario_raceway_vertices.h"
|
||||
@@ -12,9 +12,10 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
}
|
||||
|
||||
class MarioRaceway : public Course {
|
||||
class MarioRaceway : public Track {
|
||||
public:
|
||||
virtual ~MarioRaceway() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -26,13 +27,13 @@ public:
|
||||
virtual void Load() override;
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void SetStaffGhost() override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void CreditsSpawnActors() override;
|
||||
virtual void Destroy() override;
|
||||
};
|
||||
@@ -33,7 +33,6 @@ extern "C" {
|
||||
#include "collision.h"
|
||||
#include "memory.h"
|
||||
#include "code_80086E70.h"
|
||||
#include "course.h"
|
||||
extern const char *moo_moo_farm_dls[92];
|
||||
extern s16 currentScreenSection;
|
||||
extern s8 gPlayerCount;
|
||||
@@ -54,7 +53,7 @@ MooMooFarm::MooMooFarm() {
|
||||
|
||||
Props.SetText(Props.Name, "moo moo farm", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "farm", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "527m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "527m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D009210;
|
||||
Props.AIMaximumSeparation = 50.0f;
|
||||
@@ -112,7 +111,7 @@ MooMooFarm::MooMooFarm() {
|
||||
}
|
||||
|
||||
void MooMooFarm::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(moo_moo_farm_dls); i++) {
|
||||
InvertTriangleWindingByName(moo_moo_farm_dls[i]);
|
||||
@@ -124,9 +123,9 @@ void MooMooFarm::Load() {
|
||||
InvertTriangleWindingByName(d_course_moo_moo_farm_dl_14060);
|
||||
InvertTriangleWindingByName(d_course_moo_moo_farm_packed_dl_10C0);
|
||||
}
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_moo_moo_farm_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_moo_moo_farm_addr));
|
||||
func_80295C6C();
|
||||
Props.WaterLevel = gCourseMinY - 10.0f;
|
||||
Props.WaterLevel = gTrackMinY - 10.0f;
|
||||
}
|
||||
|
||||
void MooMooFarm::UnLoad() {
|
||||
@@ -260,7 +259,7 @@ void MooMooFarm::WhatDoesThisDoAI(Player* player, int8_t playerId) {
|
||||
}
|
||||
}
|
||||
|
||||
void MooMooFarm::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void MooMooFarm::Draw(ScreenContext* arg0) {
|
||||
s16 temp_s0 = arg0->pathCounter;
|
||||
s16 temp_s1 = arg0->playerDirection;
|
||||
|
||||
@@ -276,7 +275,7 @@ void MooMooFarm::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_moo_moo_farm_packed_dl_5640);
|
||||
gSPFogPosition(gDisplayListHead++, D_802B87B0, D_802B87B4);
|
||||
|
||||
render_course_segments(moo_moo_farm_dls, arg0);
|
||||
render_track_sections(moo_moo_farm_dls, arg0);
|
||||
|
||||
if ((temp_s0 < 14) && (temp_s0 > 10)) {
|
||||
if ((temp_s1 == 2) || (temp_s1 == 3) || (temp_s1 == 1)) {
|
||||
@@ -333,7 +332,7 @@ void MooMooFarm::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_moo_moo_farm_packed_dl_10C0);
|
||||
}
|
||||
|
||||
void MooMooFarm::RenderCredits() {
|
||||
void MooMooFarm::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_moo_moo_farm_dl_14088));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
#include "engine/objects/Mole.h"
|
||||
|
||||
extern "C" {
|
||||
@@ -13,12 +13,13 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture moo_moo_farm_textures[];
|
||||
}
|
||||
|
||||
class OMole;
|
||||
|
||||
class MooMooFarm : public Course {
|
||||
class MooMooFarm : public Track {
|
||||
public:
|
||||
virtual ~MooMooFarm() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -32,8 +33,8 @@ public:
|
||||
virtual void BeginPlay() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void CreditsSpawnActors() override;
|
||||
virtual void Destroy() override;
|
||||
};
|
||||
@@ -38,7 +38,6 @@ extern "C" {
|
||||
#include "memory.h"
|
||||
#include "courses/staff_ghost_data.h"
|
||||
#include "podium_ceremony_actors.h"
|
||||
#include "course.h"
|
||||
extern const char *royal_raceway_dls[];
|
||||
}
|
||||
|
||||
@@ -55,7 +54,7 @@ PodiumCeremony::PodiumCeremony() {
|
||||
|
||||
Props.SetText(Props.Name, "royal raceway", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "p circuit", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "1025m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "1025m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D009188;
|
||||
Props.AIMaximumSeparation = 50.0f;
|
||||
@@ -112,9 +111,9 @@ PodiumCeremony::PodiumCeremony() {
|
||||
}
|
||||
|
||||
void PodiumCeremony::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_royal_raceway_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_royal_raceway_addr));
|
||||
func_80295C6C();
|
||||
}
|
||||
|
||||
@@ -163,7 +162,7 @@ void PodiumCeremony::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void PodiumCeremony::InitCourseObjects() {
|
||||
void PodiumCeremony::InitTrackObjects() {
|
||||
size_t i;
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
if (gModeSelection == GRAND_PRIX) {
|
||||
@@ -205,7 +204,7 @@ void PodiumCeremony::WhatDoesThisDoAI(Player* player, int8_t playerId) {
|
||||
}
|
||||
}
|
||||
|
||||
void PodiumCeremony::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void PodiumCeremony::Draw(ScreenContext* arg0) {
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
@@ -222,7 +221,7 @@ void PodiumCeremony::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
// d_course_royal_raceway_packed_dl_A648
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_royal_raceway_packed_dl_A648);
|
||||
|
||||
render_course_segments(royal_raceway_dls, arg0);
|
||||
render_track_sections(royal_raceway_dls, arg0);
|
||||
|
||||
// d_course_royal_raceway_packed_dl_11A8
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_royal_raceway_packed_dl_11A8);
|
||||
@@ -234,7 +233,7 @@ void PodiumCeremony::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
|
||||
void PodiumCeremony::RenderCredits() {
|
||||
void PodiumCeremony::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_royal_raceway_dl_D8E8));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "CoreMath.h"
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/royal_raceway/royal_raceway_vertices.h"
|
||||
@@ -13,10 +13,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture royal_raceway_textures[];
|
||||
}
|
||||
|
||||
class PodiumCeremony : public Course {
|
||||
class PodiumCeremony : public Track {
|
||||
public:
|
||||
virtual ~PodiumCeremony() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -29,11 +30,11 @@ public:
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
//virtual void InitClouds() override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void Destroy() override;
|
||||
};
|
||||
@@ -31,7 +31,6 @@ extern "C" {
|
||||
#include "actors.h"
|
||||
#include "collision.h"
|
||||
#include "memory.h"
|
||||
#include "course.h"
|
||||
extern const char *rainbow_road_dls[48];
|
||||
}
|
||||
|
||||
@@ -50,7 +49,7 @@ RainbowRoad::RainbowRoad() {
|
||||
|
||||
Props.SetText(Props.Name, "rainbow road", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "rainbow", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "2000m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "2000m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D0092C8;
|
||||
Props.AIMaximumSeparation = 50.0f;
|
||||
@@ -109,14 +108,14 @@ RainbowRoad::RainbowRoad() {
|
||||
}
|
||||
|
||||
void RainbowRoad::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(rainbow_road_dls); i++) {
|
||||
InvertTriangleWindingByName(rainbow_road_dls[i]);
|
||||
}
|
||||
}
|
||||
D_800DC5C8 = 1;
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_rainbow_road_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_rainbow_road_addr));
|
||||
func_80295C6C();
|
||||
// d_course_rainbow_road_packed_dl_2068
|
||||
find_vtx_and_set_colours((Gfx*) d_course_rainbow_road_packed_dl_2068, 150, 255, 255, 255);
|
||||
@@ -158,11 +157,11 @@ void RainbowRoad::InitClouds() {
|
||||
init_stars(this->Props.Clouds);
|
||||
}
|
||||
|
||||
void RainbowRoad::UpdateClouds(s32 sp1C, Camera* camera) {
|
||||
void RainbowRoad::TickClouds(s32 sp1C, Camera* camera) {
|
||||
update_stars(sp1C, camera, this->Props.CloudList);
|
||||
}
|
||||
|
||||
void RainbowRoad::InitCourseObjects() {
|
||||
void RainbowRoad::InitTrackObjects() {
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
size_t i;
|
||||
for (i = 0; i < NUM_NEON_SIGNS; i++) {
|
||||
@@ -171,14 +170,14 @@ void RainbowRoad::InitCourseObjects() {
|
||||
}
|
||||
}
|
||||
|
||||
void RainbowRoad::UpdateCourseObjects() {
|
||||
void RainbowRoad::TickTrackObjects() {
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
update_neon();
|
||||
//update_chain_chomps();
|
||||
}
|
||||
}
|
||||
|
||||
void RainbowRoad::RenderCourseObjects(s32 cameraId) {
|
||||
void RainbowRoad::DrawTrackObjects(s32 cameraId) {
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
render_object_neon(cameraId);
|
||||
//render_object_chain_chomps(cameraId);
|
||||
@@ -192,7 +191,7 @@ void RainbowRoad::WhatDoesThisDo(Player* player, int8_t playerId) {}
|
||||
|
||||
void RainbowRoad::WhatDoesThisDoAI(Player* player, int8_t playerId) {}
|
||||
|
||||
void RainbowRoad::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void RainbowRoad::Draw(ScreenContext* arg0) {
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
@@ -200,7 +199,7 @@ void RainbowRoad::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
}
|
||||
|
||||
void RainbowRoad::RenderCredits() {
|
||||
void RainbowRoad::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_rainbow_road_dl_16220));
|
||||
}
|
||||
|
||||
@@ -208,11 +207,11 @@ void RainbowRoad::Waypoints(Player* player, int8_t playerId) {
|
||||
player->nearestPathPointId = gCopyNearestWaypointByPlayerId[playerId];
|
||||
}
|
||||
|
||||
void RainbowRoad::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) {
|
||||
void RainbowRoad::DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) {
|
||||
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
render_course_segments(rainbow_road_dls, screen);
|
||||
render_track_sections(rainbow_road_dls, screen);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gDPSetAlphaCompare(gDisplayListHead++, G_AC_NONE);
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/rainbow_road/rainbow_road_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture rainbow_road_textures[];
|
||||
}
|
||||
|
||||
class RainbowRoad : public Course {
|
||||
class RainbowRoad : public Track {
|
||||
public:
|
||||
virtual ~RainbowRoad() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -28,17 +29,17 @@ public:
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void InitClouds() override;
|
||||
virtual void UpdateClouds(s32, Camera*) override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void UpdateCourseObjects() override;
|
||||
virtual void RenderCourseObjects(s32 cameraId) override;
|
||||
virtual void TickClouds(s32, Camera*) override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void TickTrackObjects() override;
|
||||
virtual void DrawTrackObjects(s32 cameraId) override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void Waypoints(Player* player, int8_t playerId) override;
|
||||
virtual void DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) override;
|
||||
virtual void DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) override;
|
||||
virtual void CreditsSpawnActors() override;
|
||||
virtual void Destroy() override;
|
||||
};
|
||||
@@ -32,7 +32,6 @@ extern "C" {
|
||||
#include "collision.h"
|
||||
#include "memory.h"
|
||||
#include "courses/staff_ghost_data.h"
|
||||
#include "course.h"
|
||||
extern const char *royal_raceway_dls[132];
|
||||
}
|
||||
|
||||
@@ -51,7 +50,7 @@ RoyalRaceway::RoyalRaceway() {
|
||||
|
||||
Props.SetText(Props.Name, "royal raceway", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "p circuit", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "1025m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "1025m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D009188;
|
||||
Props.AIMaximumSeparation = 50.0f;
|
||||
@@ -111,7 +110,7 @@ RoyalRaceway::RoyalRaceway() {
|
||||
}
|
||||
|
||||
void RoyalRaceway::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(royal_raceway_dls); i++) {
|
||||
InvertTriangleWindingByName(royal_raceway_dls[i]);
|
||||
@@ -121,7 +120,7 @@ void RoyalRaceway::Load() {
|
||||
InvertTriangleWindingByName(d_course_royal_raceway_packed_dl_11A8);
|
||||
InvertTriangleWindingByName(d_course_royal_raceway_packed_dl_8A0);
|
||||
}
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_royal_raceway_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_royal_raceway_addr));
|
||||
func_80295C6C();
|
||||
}
|
||||
|
||||
@@ -148,7 +147,7 @@ void RoyalRaceway::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void RoyalRaceway::InitCourseObjects() {
|
||||
void RoyalRaceway::InitTrackObjects() {
|
||||
size_t i;
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
if (gModeSelection == GRAND_PRIX) {
|
||||
@@ -200,7 +199,7 @@ void RoyalRaceway::SetStaffGhost() {
|
||||
D_80162DE4 = 6;
|
||||
}
|
||||
|
||||
void RoyalRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void RoyalRaceway::Draw(ScreenContext* arg0) {
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
@@ -217,7 +216,7 @@ void RoyalRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
// d_course_royal_raceway_packed_dl_A648
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_royal_raceway_packed_dl_A648);
|
||||
|
||||
render_course_segments(royal_raceway_dls, arg0);
|
||||
render_track_sections(royal_raceway_dls, arg0);
|
||||
|
||||
// d_course_royal_raceway_packed_dl_11A8
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_royal_raceway_packed_dl_11A8);
|
||||
@@ -229,7 +228,7 @@ void RoyalRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
|
||||
void RoyalRaceway::RenderCredits() {
|
||||
void RoyalRaceway::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_royal_raceway_dl_D8E8));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/royal_raceway/royal_raceway_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture royal_raceway_textures[];
|
||||
}
|
||||
|
||||
class RoyalRaceway : public Course {
|
||||
class RoyalRaceway : public Track {
|
||||
public:
|
||||
virtual ~RoyalRaceway() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -27,12 +28,12 @@ public:
|
||||
virtual void Load() override;
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void SetStaffGhost() override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void ScrollingTextures() override;
|
||||
virtual void Waypoints(Player* player, int8_t playerId) override;
|
||||
};
|
||||
@@ -32,7 +32,6 @@ extern "C" {
|
||||
#include "actors.h"
|
||||
#include "collision.h"
|
||||
#include "memory.h"
|
||||
#include "course.h"
|
||||
extern const char *sherbet_land_dls[72];
|
||||
extern const char *sherbet_land_dls_2[72];
|
||||
}
|
||||
@@ -53,7 +52,7 @@ SherbetLand::SherbetLand() {
|
||||
|
||||
Props.SetText(Props.Name, "sherbet land", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "sherbet", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "756m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "756m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.LakituTowType = (s32)OLakitu::LakituTowType::ICE;
|
||||
|
||||
@@ -115,7 +114,7 @@ SherbetLand::SherbetLand() {
|
||||
}
|
||||
|
||||
void SherbetLand::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(sherbet_land_dls); i++) {
|
||||
InvertTriangleWindingByName(sherbet_land_dls[i]);
|
||||
@@ -124,7 +123,7 @@ void SherbetLand::Load() {
|
||||
InvertTriangleWindingByName(sherbet_land_dls_2[i]);
|
||||
}
|
||||
}
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_sherbet_land_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_sherbet_land_addr));
|
||||
func_80295C6C();
|
||||
// d_course_sherbet_land_packed_dl_1EB8
|
||||
find_vtx_and_set_colours((Gfx*) d_course_sherbet_land_packed_dl_1EB8, 180, 255, 255, 255);
|
||||
@@ -138,7 +137,7 @@ void SherbetLand::UnLoad() {
|
||||
|
||||
f32 SherbetLand::GetWaterLevel(FVector pos, Collision* collision) {
|
||||
if ((get_surface_type(collision->meshIndexZX) & 0xFF) == SNOW) {
|
||||
return (f32) (gCourseMinY - 0xA);
|
||||
return (f32) (gTrackMinY - 0xA);
|
||||
}
|
||||
return Props.WaterLevel;
|
||||
}
|
||||
@@ -188,32 +187,32 @@ void SherbetLand::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void SherbetLand::UpdateCourseObjects() {
|
||||
void SherbetLand::TickTrackObjects() {
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
func_800842C8();
|
||||
}
|
||||
}
|
||||
|
||||
void SherbetLand::RenderCourseObjects(s32 cameraId) {
|
||||
void SherbetLand::DrawTrackObjects(s32 cameraId) {
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
func_80052E30(cameraId);
|
||||
}
|
||||
}
|
||||
|
||||
void SherbetLand::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void SherbetLand::Draw(ScreenContext* arg0) {
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
render_course_segments(sherbet_land_dls, arg0);
|
||||
render_track_sections(sherbet_land_dls, arg0);
|
||||
}
|
||||
|
||||
void SherbetLand::RenderCredits() {
|
||||
void SherbetLand::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_sherbet_land_dl_9AE8));
|
||||
}
|
||||
|
||||
void SherbetLand::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) {
|
||||
void SherbetLand::DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) {
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
@@ -221,7 +220,7 @@ void SherbetLand::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCoun
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetTextureFilter(gDisplayListHead++, G_TF_BILERP);
|
||||
gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP);
|
||||
render_course_segments(sherbet_land_dls_2, screen);
|
||||
render_track_sections(sherbet_land_dls_2, screen);
|
||||
|
||||
gDPSetAlphaCompare(gDisplayListHead++, G_AC_NONE);
|
||||
if ((func_80290C20(screen->camera) == 1) && (get_water_level(screen->player) < screen->player->pos[1])) {
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/sherbet_land/sherbet_land_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture sherbet_land_textures[];
|
||||
}
|
||||
|
||||
class SherbetLand : public Course {
|
||||
class SherbetLand : public Track {
|
||||
public:
|
||||
virtual ~SherbetLand() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -28,10 +29,10 @@ public:
|
||||
virtual void UnLoad() override;
|
||||
virtual f32 GetWaterLevel(FVector pos, Collision* collision) override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void UpdateCourseObjects() override;
|
||||
virtual void RenderCourseObjects(s32 cameraId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) override;
|
||||
virtual void TickTrackObjects() override;
|
||||
virtual void DrawTrackObjects(s32 cameraId) override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) override;
|
||||
virtual void CreditsSpawnActors() override;
|
||||
};
|
||||
@@ -47,7 +47,7 @@ Skyscraper::Skyscraper() {
|
||||
|
||||
Props.SetText(Props.Name, "skyscraper", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "skyscraper", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D008F18;
|
||||
Props.AIMaximumSeparation = -1.0f;
|
||||
@@ -106,7 +106,7 @@ Skyscraper::Skyscraper() {
|
||||
}
|
||||
|
||||
void Skyscraper::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
if (gIsMirrorMode != 0) {
|
||||
InvertTriangleWindingByName(d_course_skyscraper_packed_dl_FE8);
|
||||
InvertTriangleWindingByName(d_course_skyscraper_packed_dl_C60);
|
||||
@@ -140,7 +140,7 @@ void Skyscraper::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void Skyscraper::InitCourseObjects() {}
|
||||
void Skyscraper::InitTrackObjects() {}
|
||||
|
||||
void Skyscraper::SomeSounds() {}
|
||||
|
||||
@@ -148,7 +148,7 @@ void Skyscraper::WhatDoesThisDo(Player* player, int8_t playerId) {}
|
||||
|
||||
void Skyscraper::WhatDoesThisDoAI(Player* player, int8_t playerId) {}
|
||||
|
||||
void Skyscraper::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void Skyscraper::Draw(ScreenContext* arg0) {
|
||||
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
@@ -171,7 +171,7 @@ void Skyscraper::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_skyscraper_packed_dl_258);
|
||||
}
|
||||
|
||||
void Skyscraper::RenderCredits() {}
|
||||
void Skyscraper::DrawCredits() {}
|
||||
|
||||
void Skyscraper::Waypoints(Player* player, int8_t playerId) {
|
||||
player->nearestPathPointId = 0;
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/skyscraper/skyscraper_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture skyscraper_textures[];
|
||||
}
|
||||
|
||||
class Skyscraper : public Course {
|
||||
class Skyscraper : public Track {
|
||||
public:
|
||||
virtual ~Skyscraper() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -28,12 +29,12 @@ public:
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
//virtual void InitClouds() override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void Waypoints(Player* player, int8_t playerId) override;
|
||||
virtual void Destroy() override;
|
||||
};
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
#include "TestCourse.h"
|
||||
#include "TestTrack.h"
|
||||
#include "World.h"
|
||||
#include "engine/actors/Finishline.h"
|
||||
#include "engine/actors/BowserStatue.h"
|
||||
@@ -51,15 +51,13 @@ extern "C" {
|
||||
#include "actors.h"
|
||||
#include "collision.h"
|
||||
#include "memory.h"
|
||||
#include "course.h"
|
||||
extern Gfx test_course_dls[];
|
||||
extern Vtx mario_Plane_001_mesh_vtx_1[];
|
||||
extern Gfx mario_Plane_001_mesh[];
|
||||
extern TrackPathPoint test_course_path[];
|
||||
extern TrackSections test_course_addr[];
|
||||
extern TrackPathPoint test_track_path[];
|
||||
extern TrackSections test_track_addr[];
|
||||
}
|
||||
|
||||
TestCourse::TestCourse() {
|
||||
TestTrack::TestTrack() {
|
||||
Props.Minimap.Texture = minimap_mario_raceway;
|
||||
Props.Minimap.Width = ResourceGetTexWidthByName(Props.Minimap.Texture);
|
||||
Props.Minimap.Height = ResourceGetTexHeightByName(Props.Minimap.Texture);
|
||||
@@ -73,11 +71,11 @@ TestCourse::TestCourse() {
|
||||
Props.Minimap.Colour = {255, 255, 255};
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
Id = "mk:test_course";
|
||||
Id = "mk:test_track";
|
||||
|
||||
Props.SetText(Props.Name, "Test Course", sizeof(Props.Name));
|
||||
Props.SetText(Props.Name, "Test Track", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "test track", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "100m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "100m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D008F28;
|
||||
Props.AIMaximumSeparation = 50.0f;
|
||||
@@ -109,12 +107,12 @@ TestCourse::TestCourse() {
|
||||
Props.OffTrackTargetSpeed[2] = 5.75f;
|
||||
Props.OffTrackTargetSpeed[3] = 6.3333334f;
|
||||
|
||||
Props.PathTable[0] = test_course_path;
|
||||
Props.PathTable[0] = test_track_path;
|
||||
Props.PathTable[1] = NULL;
|
||||
Props.PathTable[2] = NULL;
|
||||
Props.PathTable[3] = NULL;
|
||||
|
||||
Props.PathTable2[0] = test_course_path;
|
||||
Props.PathTable2[0] = test_track_path;
|
||||
Props.PathTable2[1] = NULL;
|
||||
Props.PathTable2[2] = NULL;
|
||||
Props.PathTable2[3] = NULL;
|
||||
@@ -134,8 +132,8 @@ TestCourse::TestCourse() {
|
||||
Props.Sequence = MusicSeq::MUSIC_SEQ_WARIO_STADIUM;
|
||||
}
|
||||
|
||||
void TestCourse::Load() {
|
||||
Course::Load(mario_Plane_001_mesh_vtx_1, NULL);
|
||||
void TestTrack::Load() {
|
||||
Track::Load(mario_Plane_001_mesh_vtx_1, NULL);
|
||||
|
||||
if (gIsMirrorMode != 0) {
|
||||
InvertTriangleWinding(mario_Plane_001_mesh);
|
||||
@@ -143,15 +141,15 @@ void TestCourse::Load() {
|
||||
|
||||
generate_collision_mesh_with_defaults(mario_Plane_001_mesh);
|
||||
|
||||
parse_course_displaylists((TrackSections*)test_course_addr);
|
||||
parse_track_displaylists((TrackSections*)test_track_addr);
|
||||
func_80295C6C();
|
||||
Props.WaterLevel = gCourseMinY - 10.0f;
|
||||
Props.WaterLevel = gTrackMinY - 10.0f;
|
||||
}
|
||||
|
||||
void TestCourse::UnLoad() {
|
||||
void TestTrack::UnLoad() {
|
||||
}
|
||||
|
||||
void TestCourse::BeginPlay() {
|
||||
void TestTrack::BeginPlay() {
|
||||
struct ActorSpawnData itemboxes[] = {
|
||||
{ 200, 1500, 200 , 0},
|
||||
{ 350, 2500, 300 , 1},
|
||||
@@ -192,7 +190,7 @@ void TestCourse::BeginPlay() {
|
||||
Vec3f crossingPos = {0, 2, 0};
|
||||
uintptr_t* crossing1 = (uintptr_t*) gWorldInstance.AddCrossing(crossingPos, 0, 2, 900.0f, 650.0f);
|
||||
|
||||
position[0] *= gCourseDirection;
|
||||
position[0] *= gTrackDirection;
|
||||
rrxing = (struct RailroadCrossing*) GET_ACTOR(add_actor_to_empty_slot(position, rotation, velocity,
|
||||
ACTOR_RAILROAD_CROSSING));
|
||||
rrxing->crossingTrigger = crossing1;
|
||||
@@ -230,7 +228,7 @@ void TestCourse::BeginPlay() {
|
||||
// OGrandPrixBalloons::Spawn(FVector(0, 0, 0));
|
||||
}
|
||||
|
||||
void TestCourse::WhatDoesThisDo(Player* player, int8_t playerId) {
|
||||
void TestTrack::WhatDoesThisDo(Player* player, int8_t playerId) {
|
||||
if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x19B) &&
|
||||
((s16) gNearestPathPointByPlayerId[playerId] < 0x1B9)) {
|
||||
if (D_80165300[playerId] != 1) {
|
||||
@@ -245,7 +243,7 @@ void TestCourse::WhatDoesThisDo(Player* player, int8_t playerId) {
|
||||
}
|
||||
}
|
||||
|
||||
void TestCourse::WhatDoesThisDoAI(Player* player, int8_t playerId) {
|
||||
void TestTrack::WhatDoesThisDoAI(Player* player, int8_t playerId) {
|
||||
if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x19B) &&
|
||||
((s16) gNearestPathPointByPlayerId[playerId] < 0x1B9)) {
|
||||
if (D_80165300[playerId] != 1) {
|
||||
@@ -260,7 +258,7 @@ void TestCourse::WhatDoesThisDoAI(Player* player, int8_t playerId) {
|
||||
}
|
||||
}
|
||||
|
||||
void TestCourse::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void TestTrack::Draw(ScreenContext* arg0) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
|
||||
@@ -275,6 +273,6 @@ void TestCourse::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPDisplayList(gDisplayListHead++, mario_Plane_001_mesh);
|
||||
}
|
||||
|
||||
bool TestCourse::IsMod() {
|
||||
bool TestTrack::IsMod() {
|
||||
return true;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/mario_raceway/mario_raceway_vertices.h"
|
||||
@@ -12,15 +12,15 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
extern const course_texture test_course_textures[];
|
||||
#include "code_800029B0.h"
|
||||
}
|
||||
|
||||
class TestCourse : public Course {
|
||||
class TestTrack : public Track {
|
||||
public:
|
||||
virtual ~TestCourse() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
virtual ~TestTrack() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
// Constructor
|
||||
explicit TestCourse();
|
||||
explicit TestTrack();
|
||||
|
||||
// virtual void Load(const char* courseVtx,
|
||||
// course_texture* textures, const char* displaylists, size_t dlSize);
|
||||
@@ -29,6 +29,6 @@ public:
|
||||
virtual void BeginPlay() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual bool IsMod() override;
|
||||
};
|
||||
@@ -37,7 +37,6 @@ extern "C" {
|
||||
#include "collision.h"
|
||||
#include "memory.h"
|
||||
#include "code_80086E70.h"
|
||||
#include "course.h"
|
||||
extern const char *d_course_toads_turnpike_dl_list[81];
|
||||
extern s16 currentScreenSection;
|
||||
extern s8 gPlayerCount;
|
||||
@@ -58,7 +57,7 @@ ToadsTurnpike::ToadsTurnpike() {
|
||||
|
||||
Props.SetText(Props.Name, "toad's turnpike", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "highway", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "1036m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "1036m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D009238;
|
||||
Props.AIMaximumSeparation = 50.0f;
|
||||
@@ -122,7 +121,7 @@ ToadsTurnpike::ToadsTurnpike() {
|
||||
}
|
||||
|
||||
void ToadsTurnpike::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(d_course_toads_turnpike_dl_list); i++) {
|
||||
@@ -138,9 +137,9 @@ void ToadsTurnpike::Load() {
|
||||
D_801625F0 = 4;
|
||||
D_802B87B0 = 993;
|
||||
D_802B87B4 = 1000;
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_toads_turnpike_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_toads_turnpike_addr));
|
||||
func_80295C6C();
|
||||
Props.WaterLevel = gCourseMinY - 10.0f;
|
||||
Props.WaterLevel = gTrackMinY - 10.0f;
|
||||
}
|
||||
|
||||
void ToadsTurnpike::UnLoad() {
|
||||
@@ -206,7 +205,7 @@ void ToadsTurnpike::InitClouds() {
|
||||
init_stars(this->Props.Clouds);
|
||||
}
|
||||
|
||||
void ToadsTurnpike::UpdateClouds(s32 sp1C, Camera* camera) {
|
||||
void ToadsTurnpike::TickClouds(s32 sp1C, Camera* camera) {
|
||||
update_stars(sp1C, camera, this->Props.CloudList);
|
||||
}
|
||||
|
||||
@@ -240,7 +239,7 @@ void ToadsTurnpike::WhatDoesThisDoAI(Player* player, int8_t playerId) {
|
||||
}
|
||||
}
|
||||
|
||||
void ToadsTurnpike::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void ToadsTurnpike::Draw(ScreenContext* arg0) {
|
||||
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
@@ -252,7 +251,7 @@ void ToadsTurnpike::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_PASS2);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2);
|
||||
|
||||
render_course_segments(d_course_toads_turnpike_dl_list, arg0);
|
||||
render_track_sections(d_course_toads_turnpike_dl_list, arg0);
|
||||
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_PASS2);
|
||||
@@ -266,7 +265,7 @@ void ToadsTurnpike::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gDPSetCycleType(gDisplayListHead++, G_CYC_1CYCLE);
|
||||
}
|
||||
|
||||
void ToadsTurnpike::RenderCredits() {
|
||||
void ToadsTurnpike::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_toads_turnpike_dl_23930));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/toads_turnpike/toads_turnpike_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture toads_turnpike_textures[];
|
||||
}
|
||||
|
||||
class ToadsTurnpike : public Course {
|
||||
class ToadsTurnpike : public Track {
|
||||
public:
|
||||
virtual ~ToadsTurnpike() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -28,12 +29,12 @@ public:
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void InitClouds() override;
|
||||
virtual void UpdateClouds(s32, Camera*) override;
|
||||
virtual void TickClouds(s32, Camera*) override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void Destroy() override;
|
||||
private:
|
||||
size_t _numTrucks = 7;
|
||||
@@ -3,12 +3,11 @@
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
#include "MarioRaceway.h"
|
||||
#include "ChocoMountain.h"
|
||||
#include "port/Game.h"
|
||||
#include "port/resource/type/TrackPathPointData.h"
|
||||
#include "port/resource/type/TrackSections.h"
|
||||
#include "engine/editor/SceneManager.h"
|
||||
#include "Registry.h"
|
||||
#include "resourcebridge.h"
|
||||
@@ -243,10 +242,10 @@ bool IsTriangleWindingInverted() {
|
||||
}
|
||||
|
||||
|
||||
Course::Course() {
|
||||
Track::Track() {
|
||||
Props.SetText(Props.Name, "Blank Track", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "blnktrck", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "100m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "100m", sizeof(Props.TrackLength));
|
||||
// Props.Cup = FLOWER_CUP;
|
||||
// Props.CupIndex = 3;
|
||||
Id = "";
|
||||
@@ -313,14 +312,14 @@ Course::Course() {
|
||||
}
|
||||
|
||||
// Load custom track from code
|
||||
void Course::Load(Vtx* vtx, Gfx* gfx) {
|
||||
Course::Init();
|
||||
void Track::Load(Vtx* vtx, Gfx* gfx) {
|
||||
Track::Init();
|
||||
}
|
||||
|
||||
void Course::UnLoad() {
|
||||
void Track::UnLoad() {
|
||||
}
|
||||
|
||||
void Course::LoadO2R(std::string trackPath) {
|
||||
void Track::LoadO2R(std::string trackPath) {
|
||||
if (!trackPath.empty()) {
|
||||
SceneFilePtr = (trackPath + "/scene.json");
|
||||
TrackSectionsPtr = (trackPath + "/data_track_sections");
|
||||
@@ -336,7 +335,7 @@ void Course::LoadO2R(std::string trackPath) {
|
||||
u16* ptr = &Props.PathSizes.unk0;
|
||||
for (auto& path : paths) {
|
||||
if (i >= ARRAY_COUNT(Props.PathTable2)) {
|
||||
printf("[Course.cpp] The game can only import 5 paths. Found more than 5. Skipping the rest\n");
|
||||
printf("[Track.cpp] The game can only import 5 paths. Found more than 5. Skipping the rest\n");
|
||||
break; // Only 5 paths allowed. 4 track, 1 vehicle
|
||||
}
|
||||
ptr[i] = path.size();
|
||||
@@ -348,12 +347,12 @@ void Course::LoadO2R(std::string trackPath) {
|
||||
gVehiclePathSize = Props.PathSizes.unk0; // This is likely incorrect.
|
||||
|
||||
} else {
|
||||
printf("Course.cpp: LoadO2R: trackPath str is empty\n");
|
||||
printf("Track.cpp: LoadO2R: trackPath str is empty\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Load stock and o2r tracks
|
||||
void Course::Load() {
|
||||
void Track::Load() {
|
||||
// Re-load scenefile in-case changes were made in the editor
|
||||
if (!SceneFilePtr.empty()) {
|
||||
Editor::LoadLevel(this, SceneFilePtr);
|
||||
@@ -368,24 +367,24 @@ void Course::Load() {
|
||||
size_t size = ResourceGetSizeByName(TrackSectionsPtr.c_str());
|
||||
|
||||
if (sections != nullptr) {
|
||||
Course::Init();
|
||||
ParseCourseSections(sections, size);
|
||||
Track::Init();
|
||||
ParseTrackSections(sections, size);
|
||||
func_80295C6C();
|
||||
|
||||
if (Props.WaterLevel == FLT_MAX) {
|
||||
Props.WaterLevel = gCourseMinY - 10.0f;
|
||||
Props.WaterLevel = gTrackMinY - 10.0f;
|
||||
}
|
||||
} else {
|
||||
printf("Course.cpp: Custom track sections are invalid\n");
|
||||
printf("Track.cpp: Custom track sections are invalid\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Course::Init();
|
||||
Track::Init();
|
||||
}
|
||||
|
||||
// C++ version of parse_course_displaylists()
|
||||
void Course::ParseCourseSections(TrackSections* sections, size_t size) {
|
||||
// C++ version of parse_track_displaylists()
|
||||
void Track::ParseTrackSections(TrackSections* sections, size_t size) {
|
||||
printf("\n[Track] Generating Collision Meshes...\n");
|
||||
for (size_t i = 0; i < (size / sizeof(TrackSections)); i++) {
|
||||
if (sections[i].flags & 0x8000) {
|
||||
@@ -411,7 +410,7 @@ void Course::ParseCourseSections(TrackSections* sections, size_t size) {
|
||||
printf("[Track] Collision Mesh Generation Complete!\n\n");
|
||||
}
|
||||
|
||||
void Course::TestPath() {
|
||||
void Track::TestPath() {
|
||||
// DEBUG ONLY TO VISUALIZE PATH
|
||||
return;
|
||||
s16 x;
|
||||
@@ -435,15 +434,15 @@ void Course::TestPath() {
|
||||
}
|
||||
}
|
||||
|
||||
void Course::Init() {
|
||||
void Track::Init() {
|
||||
gNumActors = 0;
|
||||
gCourseMinX = 0;
|
||||
gCourseMinY = 0;
|
||||
gCourseMinZ = 0;
|
||||
gTrackMinX = 0;
|
||||
gTrackMinY = 0;
|
||||
gTrackMinZ = 0;
|
||||
|
||||
gCourseMaxX = 0;
|
||||
gCourseMaxY = 0;
|
||||
gCourseMaxZ = 0;
|
||||
gTrackMaxX = 0;
|
||||
gTrackMaxY = 0;
|
||||
gTrackMaxZ = 0;
|
||||
|
||||
D_8015F59C = 0;
|
||||
D_8015F5A0 = 0;
|
||||
@@ -455,14 +454,14 @@ void Course::Init() {
|
||||
D_800DC5C8 = 0;
|
||||
}
|
||||
|
||||
void Course::BeginPlay() {
|
||||
void Track::BeginPlay() {
|
||||
printf("[Track] BeginPlay\n");
|
||||
TestPath();
|
||||
this->SpawnActors();
|
||||
}
|
||||
|
||||
// Spawns actors from SpawnParams set by the scene file in SceneManager.cpp
|
||||
void Course::SpawnActors() {
|
||||
void Track::SpawnActors() {
|
||||
for (const auto& actor : SpawnList) {
|
||||
auto it = gActorRegistry.find(actor.Name);
|
||||
if (it != gActorRegistry.end() && it->second.spawnFunc) {
|
||||
@@ -473,13 +472,13 @@ void Course::SpawnActors() {
|
||||
}
|
||||
}
|
||||
|
||||
void Course::InitClouds() {
|
||||
void Track::InitClouds() {
|
||||
if (this->Props.Clouds) {
|
||||
init_clouds(this->Props.Clouds);
|
||||
}
|
||||
}
|
||||
|
||||
void Course::UpdateClouds(s32 arg0, Camera* camera) {
|
||||
void Track::TickClouds(s32 arg0, Camera* camera) {
|
||||
s32 cloudIndex;
|
||||
s32 objectIndex;
|
||||
CloudData* cloud;
|
||||
@@ -494,46 +493,46 @@ void Course::UpdateClouds(s32 arg0, Camera* camera) {
|
||||
}
|
||||
|
||||
// Adjusts player speed on steep hills
|
||||
void Course::SomeCollisionThing(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6,
|
||||
void Track::SomeCollisionThing(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6,
|
||||
f32* arg7) {
|
||||
func_8003E048(player, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
|
||||
}
|
||||
|
||||
void Course::InitCourseObjects() {
|
||||
void Track::InitTrackObjects() {
|
||||
}
|
||||
|
||||
void Course::UpdateCourseObjects() {
|
||||
void Track::TickTrackObjects() {
|
||||
}
|
||||
|
||||
void Course::RenderCourseObjects(s32 cameraId) {
|
||||
void Track::DrawTrackObjects(s32 cameraId) {
|
||||
}
|
||||
|
||||
// Implemented for the first cup of each course plus Koopa Beach
|
||||
void Course::SomeSounds() {
|
||||
// Implemented for the first cup of each track plus Koopa Beach
|
||||
void Track::SomeSounds() {
|
||||
}
|
||||
|
||||
void Course::CreditsSpawnActors() {
|
||||
void Track::CreditsSpawnActors() {
|
||||
}
|
||||
|
||||
void Course::WhatDoesThisDo(Player* player, int8_t playerId) {
|
||||
void Track::WhatDoesThisDo(Player* player, int8_t playerId) {
|
||||
}
|
||||
|
||||
void Course::WhatDoesThisDoAI(Player* player, int8_t playerId) {
|
||||
void Track::WhatDoesThisDoAI(Player* player, int8_t playerId) {
|
||||
}
|
||||
|
||||
void Course::SetStaffGhost() {
|
||||
void Track::SetStaffGhost() {
|
||||
bCourseGhostDisabled = 1;
|
||||
D_80162DF4 = 1;
|
||||
}
|
||||
|
||||
void Course::Waypoints(Player* player, int8_t playerId) {
|
||||
void Track::Waypoints(Player* player, int8_t playerId) {
|
||||
player->nearestPathPointId = gNearestPathPointByPlayerId[playerId];
|
||||
if (player->nearestPathPointId < 0) {
|
||||
player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId;
|
||||
}
|
||||
}
|
||||
|
||||
void Course::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void Track::Draw(ScreenContext* arg0) {
|
||||
if (!TrackSectionsPtr.empty()) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
@@ -555,14 +554,14 @@ void Course::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
void Course::RenderCredits() {
|
||||
void Track::DrawCredits() {
|
||||
}
|
||||
|
||||
f32 Course::GetWaterLevel(FVector pos, Collision* collision) {
|
||||
f32 Track::GetWaterLevel(FVector pos, Collision* collision) {
|
||||
float highestWater = -FLT_MAX;
|
||||
bool found = false;
|
||||
|
||||
for (const auto& volume : gWorldInstance.GetCurrentCourse()->WaterVolumes) {
|
||||
for (const auto& volume : gWorldInstance.GetTrack()->WaterVolumes) {
|
||||
if (pos.x >= volume.MinX && pos.x <= volume.MaxX && pos.z >= volume.MinZ && pos.z <= volume.MaxZ) {
|
||||
// Choose the highest water volume the player is over
|
||||
if (!found || volume.Height > highestWater) {
|
||||
@@ -572,21 +571,19 @@ f32 Course::GetWaterLevel(FVector pos, Collision* collision) {
|
||||
}
|
||||
}
|
||||
|
||||
// If player is not over-top of a water volume then return the courses default water level
|
||||
return found ? highestWater : gWorldInstance.GetCurrentCourse()->Props.WaterLevel;
|
||||
// If player is not over-top of a water volume then return the tracks default water level
|
||||
return found ? highestWater : gWorldInstance.GetTrack()->Props.WaterLevel;
|
||||
}
|
||||
|
||||
void Course::ScrollingTextures() {
|
||||
void Track::ScrollingTextures() {
|
||||
}
|
||||
void Course::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot,
|
||||
void Track::DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot,
|
||||
uint16_t playerDirection) {
|
||||
}
|
||||
|
||||
void Course::Destroy() {
|
||||
void Track::Destroy() {
|
||||
}
|
||||
|
||||
bool Course::IsMod() {
|
||||
bool Track::IsMod() {
|
||||
return bIsMod;
|
||||
}
|
||||
|
||||
Course* currentCourse = nullptr;
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef ENGINE_COURSE_H
|
||||
#define ENGINE_COURSE_H
|
||||
#ifndef ENGINE_TRACK_H
|
||||
#define ENGINE_TRACK_H
|
||||
|
||||
#include <libultraship/libultraship.h>
|
||||
#include "CoreMath.h"
|
||||
@@ -10,19 +10,18 @@
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "engine/objects/Lakitu.h"
|
||||
#include "engine/cameras/TourCamera.h"
|
||||
#include "port/resource/type/TrackSections.h"
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "camera.h"
|
||||
#include "course_offsets.h"
|
||||
#include "data/some_data.h"
|
||||
#include "defines.h"
|
||||
#include "camera.h"
|
||||
#include "data/some_data.h"
|
||||
#include "bomb_kart.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "waypoints.h"
|
||||
#include "sounds.h"
|
||||
#include "common_structs.h"
|
||||
#include "code_800029B0.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -73,10 +72,23 @@ void InvertTriangleWindingByName(const char* name);
|
||||
void RestoreTriangleWinding();
|
||||
bool IsTriangleWindingInverted();
|
||||
|
||||
/**
|
||||
* A container of models that make up each section of the track
|
||||
* The game displays each model depending on the location of the player
|
||||
* and the direction they are facing
|
||||
* This work is done in render_track_sections()
|
||||
*/
|
||||
typedef struct {
|
||||
uint64_t crc;
|
||||
u8 surfaceType; // Determines what kind of surface the player drives on (ex. dirt, asphalt, etc.)
|
||||
u8 sectionId;
|
||||
u16 flags;
|
||||
} TrackSections;
|
||||
|
||||
typedef struct Properties {
|
||||
char Name[128];
|
||||
char DebugName[128];
|
||||
char CourseLength[128];
|
||||
char TrackLength[128];
|
||||
int32_t LakituTowType;
|
||||
MinimapProps Minimap;
|
||||
const char* AIBehaviour;
|
||||
@@ -86,7 +98,7 @@ typedef struct Properties {
|
||||
float FarPersp;
|
||||
int16_t* AIDistance;
|
||||
uint32_t AISteeringSensitivity;
|
||||
_struct_gCoursePathSizes_0x10 PathSizes;
|
||||
TrackPathSizes PathSizes;
|
||||
Vec4f CurveTargetSpeed;
|
||||
Vec4f NormalTargetSpeed;
|
||||
Vec4f D_0D0096B8;
|
||||
@@ -106,7 +118,7 @@ typedef struct Properties {
|
||||
// j["Id"] = Id ? Id : "";
|
||||
j["Name"] = Name ? Name : "";
|
||||
j["DebugName"] = DebugName ? DebugName : "";
|
||||
j["CourseLength"] = CourseLength ? CourseLength : "";
|
||||
j["TrackLength"] = TrackLength ? TrackLength : "";
|
||||
//j["AIBehaviour"] = AIBehaviour ? AIBehaviour : "";
|
||||
j["LakituTowType"] = LakituTowType;
|
||||
j["AIMaximumSeparation"] = AIMaximumSeparation;
|
||||
@@ -119,7 +131,7 @@ typedef struct Properties {
|
||||
|
||||
j["AISteeringSensitivity"] = AISteeringSensitivity;
|
||||
|
||||
// PathSizes - Assuming _struct_gCoursePathSizes_0x10 can be serialized similarly
|
||||
// PathSizes - Assuming TrackPathSizes can be serialized similarly
|
||||
// j["PathSizes"] = PathSizes; // Implement your serialization logic here
|
||||
|
||||
j["CurveTargetSpeed"] = { CurveTargetSpeed[0], CurveTargetSpeed[1], CurveTargetSpeed[2], CurveTargetSpeed[3] };
|
||||
@@ -175,9 +187,9 @@ typedef struct Properties {
|
||||
strncpy(DebugName, j.at("DebugName").get<std::string>().c_str(), sizeof(DebugName) - 1);
|
||||
DebugName[sizeof(DebugName) - 1] = '\0'; // Ensure null termination
|
||||
|
||||
// CourseLength = j.at("CourseLength").get<std::string>().c_str();
|
||||
strncpy(CourseLength, j.at("CourseLength").get<std::string>().c_str(), sizeof(CourseLength) - 1);
|
||||
CourseLength[sizeof(CourseLength) - 1] = '\0'; // Ensure null termination
|
||||
// TrackLength = j.at("TrackLength").get<std::string>().c_str();
|
||||
strncpy(TrackLength, j.at("TrackLength").get<std::string>().c_str(), sizeof(TrackLength) - 1);
|
||||
TrackLength[sizeof(TrackLength) - 1] = '\0'; // Ensure null termination
|
||||
|
||||
//AIBehaviour = j.at("AIBehaviour").get<std::string>().c_str();
|
||||
LakituTowType = j.at("LakituTowType").get<int>();
|
||||
@@ -194,7 +206,7 @@ typedef struct Properties {
|
||||
// Copy the data into the existing AIDistances array
|
||||
std::copy(temp.begin(), temp.end(), AIDistance);
|
||||
} else {
|
||||
printf("Course::from_json() AIDistance array not size of 32\n");
|
||||
printf("[Track.h] [from_json()] AIDistance array not size of 32\n");
|
||||
}
|
||||
|
||||
AISteeringSensitivity = j.at("AISteeringSensitivity").get<uint32_t>();
|
||||
@@ -287,7 +299,7 @@ typedef struct Properties {
|
||||
void New() {
|
||||
SetText(Name, "", sizeof(Name));
|
||||
SetText(DebugName, "", sizeof(DebugName));
|
||||
SetText(CourseLength, "", sizeof(CourseLength));
|
||||
SetText(TrackLength, "", sizeof(TrackLength));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -298,7 +310,7 @@ typedef struct Properties {
|
||||
|
||||
class World; // <-- Forward declare
|
||||
|
||||
class Course {
|
||||
class Track {
|
||||
|
||||
public:
|
||||
std::string Id;
|
||||
@@ -323,15 +335,15 @@ public:
|
||||
std::vector<TourCamera::CameraShot> TourShots;
|
||||
|
||||
|
||||
virtual ~Course() = default;
|
||||
virtual ~Track() = default;
|
||||
|
||||
explicit Course();
|
||||
explicit Track();
|
||||
|
||||
virtual void LoadO2R(std::string trackPath); // Load custom track from o2r
|
||||
virtual void Load(); // Decompress and load stock courses or from o2r but TrackSectionsPtr must be set.
|
||||
virtual void Load(); // Decompress and load stock tracks or from o2r but TrackSectionsPtr must be set.
|
||||
virtual void Load(Vtx* vtx, Gfx *gfx); // Load custom track from code. Load must be overridden and then call to this base class method impl.
|
||||
virtual void UnLoad();
|
||||
virtual void ParseCourseSections(TrackSections* sections, size_t size);
|
||||
virtual void ParseTrackSections(TrackSections* sections, size_t size);
|
||||
|
||||
/**
|
||||
* @brief BeginPlay This function is called once at the start of gameplay.
|
||||
@@ -341,23 +353,23 @@ public:
|
||||
void SpawnActors();
|
||||
virtual void TestPath();
|
||||
virtual void InitClouds();
|
||||
virtual void UpdateClouds(s32, Camera*);
|
||||
virtual void TickClouds(s32, Camera*);
|
||||
virtual void SomeCollisionThing(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7);
|
||||
virtual void InitCourseObjects();
|
||||
virtual void UpdateCourseObjects();
|
||||
virtual void RenderCourseObjects(s32 cameraId);
|
||||
virtual void InitTrackObjects();
|
||||
virtual void TickTrackObjects();
|
||||
virtual void DrawTrackObjects(s32 cameraId);
|
||||
virtual void SomeSounds();
|
||||
virtual void CreditsSpawnActors();
|
||||
virtual void WhatDoesThisDo(Player*, int8_t);
|
||||
virtual void WhatDoesThisDoAI(Player*, int8_t);
|
||||
virtual void SetStaffGhost();
|
||||
virtual void Render(struct UnkStruct_800DC5EC*);
|
||||
virtual void RenderCredits();
|
||||
virtual void Draw(ScreenContext*);
|
||||
virtual void DrawCredits();
|
||||
virtual void Waypoints(Player* player, int8_t playerId);
|
||||
virtual f32 GetWaterLevel(FVector pos, Collision* collision);
|
||||
virtual void ScrollingTextures();
|
||||
// Draw transparent models (water, signs, arrows, etc.)
|
||||
virtual void DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot,
|
||||
virtual void DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot,
|
||||
uint16_t playerDirection);
|
||||
virtual void Destroy();
|
||||
virtual bool IsMod();
|
||||
@@ -368,4 +380,4 @@ public:
|
||||
|
||||
#endif
|
||||
|
||||
#endif // ENGINE_COURSE_H
|
||||
#endif // ENGINE_TRACK_H
|
||||
@@ -33,7 +33,6 @@ extern "C" {
|
||||
#include "code_8003DC40.h"
|
||||
#include "memory.h"
|
||||
#include "skybox_and_splitscreen.h"
|
||||
#include "course.h"
|
||||
extern const char* wario_stadium_dls[108];
|
||||
extern s16 currentScreenSection;
|
||||
}
|
||||
@@ -53,7 +52,7 @@ WarioStadium::WarioStadium() {
|
||||
|
||||
Props.SetText(Props.Name, "wario stadium", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "stadium", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "1591m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "1591m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D009310;
|
||||
Props.AIMaximumSeparation = 50.0f;
|
||||
@@ -117,7 +116,7 @@ WarioStadium::WarioStadium() {
|
||||
}
|
||||
|
||||
void WarioStadium::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(wario_stadium_dls); i++) {
|
||||
@@ -129,9 +128,9 @@ void WarioStadium::Load() {
|
||||
InvertTriangleWindingByName(d_course_wario_stadium_packed_dl_EC0);
|
||||
}
|
||||
|
||||
parse_course_displaylists((TrackSections*) LOAD_ASSET_RAW(d_course_wario_stadium_addr));
|
||||
parse_track_displaylists((TrackSections*) LOAD_ASSET_RAW(d_course_wario_stadium_addr));
|
||||
func_80295C6C();
|
||||
Props.WaterLevel = gCourseMinY - 10.0f;
|
||||
Props.WaterLevel = gTrackMinY - 10.0f;
|
||||
// d_course_wario_stadium_packed_dl_C50
|
||||
find_vtx_and_set_colours((Gfx*) d_course_wario_stadium_packed_dl_C50, 100, 255, 255, 255);
|
||||
// d_course_wario_stadium_packed_dl_BD8
|
||||
@@ -176,11 +175,11 @@ void WarioStadium::InitClouds() {
|
||||
init_stars(this->Props.Clouds);
|
||||
}
|
||||
|
||||
void WarioStadium::UpdateClouds(s32 sp1C, Camera* camera) {
|
||||
void WarioStadium::TickClouds(s32 sp1C, Camera* camera) {
|
||||
update_stars(sp1C, camera, this->Props.CloudList);
|
||||
}
|
||||
|
||||
void WarioStadium::InitCourseObjects() {
|
||||
void WarioStadium::InitTrackObjects() {
|
||||
}
|
||||
|
||||
void WarioStadium::SomeSounds() {
|
||||
@@ -237,7 +236,7 @@ void WarioStadium::CopyJumbotron(s32 ulx, s32 uly, s16 portionToDraw, u16* sourc
|
||||
}
|
||||
}
|
||||
|
||||
void WarioStadium::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void WarioStadium::Draw(ScreenContext* arg0) {
|
||||
s16 prevFrame;
|
||||
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
@@ -263,7 +262,7 @@ void WarioStadium::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATERGBA, G_CC_MODULATERGBA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
|
||||
render_course_segments(wario_stadium_dls, arg0);
|
||||
render_track_sections(wario_stadium_dls, arg0);
|
||||
|
||||
// d_course_wario_stadium_packed_dl_A228
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_wario_stadium_packed_dl_A228);
|
||||
@@ -296,7 +295,7 @@ void WarioStadium::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
void WarioStadium::RenderCredits() {
|
||||
void WarioStadium::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) (d_course_wario_stadium_dl_CA78));
|
||||
}
|
||||
|
||||
@@ -305,7 +304,7 @@ void WarioStadium::SomeCollisionThing(Player* player, Vec3f arg1, Vec3f arg2, Ve
|
||||
func_8003EE2C(player, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
|
||||
}
|
||||
|
||||
void WarioStadium::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot,
|
||||
void WarioStadium::DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot,
|
||||
uint16_t playerDirection) {
|
||||
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/wario_stadium/wario_stadium_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture wario_stadium_textures[];
|
||||
}
|
||||
|
||||
class WarioStadium : public Course {
|
||||
class WarioStadium : public Track {
|
||||
void CopyJumbotron(s32 ulx, s32 uly, s16 portionToDraw, u16* source);
|
||||
|
||||
public:
|
||||
@@ -30,16 +31,16 @@ class WarioStadium : public Course {
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void InitClouds() override;
|
||||
virtual void UpdateClouds(s32, Camera*) override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void TickClouds(s32, Camera*) override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void SomeCollisionThing(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6,
|
||||
f32* arg7) override;
|
||||
virtual void DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot,
|
||||
virtual void DrawWater(ScreenContext* screen, uint16_t pathCounter, uint16_t cameraRot,
|
||||
uint16_t playerDirection) override;
|
||||
virtual void CreditsSpawnActors() override;
|
||||
virtual void Destroy() override;
|
||||
@@ -33,7 +33,6 @@ extern "C" {
|
||||
#include "actors.h"
|
||||
#include "collision.h"
|
||||
#include "memory.h"
|
||||
#include "course.h"
|
||||
extern const char *d_course_yoshi_valley_dl_list[124];
|
||||
}
|
||||
|
||||
@@ -50,7 +49,7 @@ YoshiValley::YoshiValley() {
|
||||
|
||||
Props.SetText(Props.Name, "yoshi valley", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "maze", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.CourseLength, "772m", sizeof(Props.CourseLength));
|
||||
Props.SetText(Props.TrackLength, "772m", sizeof(Props.TrackLength));
|
||||
|
||||
Props.AIBehaviour = D_0D0090B8;
|
||||
Props.AIMaximumSeparation = 35.0f;
|
||||
@@ -108,7 +107,7 @@ YoshiValley::YoshiValley() {
|
||||
}
|
||||
|
||||
void YoshiValley::Load() {
|
||||
Course::Load();
|
||||
Track::Load();
|
||||
|
||||
if (gIsMirrorMode != 0) {
|
||||
for (size_t i = 0; i < ARRAY_COUNT(d_course_yoshi_valley_dl_list); i++) {
|
||||
@@ -118,9 +117,9 @@ void YoshiValley::Load() {
|
||||
|
||||
Lights1 lights4 = gdSPDefLights1(100, 100, 100, 255, 254, 254, 0, 0, 120);
|
||||
set_track_light_direction(&lights4, -0x38F0, 0x1C70, 1);
|
||||
parse_course_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_yoshi_valley_addr));
|
||||
parse_track_displaylists((TrackSections*)LOAD_ASSET_RAW(d_course_yoshi_valley_addr));
|
||||
func_80295C6C();
|
||||
Props.WaterLevel = gCourseMinY - 10.0f;
|
||||
Props.WaterLevel = gTrackMinY - 10.0f;
|
||||
}
|
||||
|
||||
void YoshiValley::UnLoad() {
|
||||
@@ -135,7 +134,7 @@ void YoshiValley::BeginPlay() {
|
||||
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;
|
||||
position[0] *= gTrackDirection;
|
||||
add_actor_to_empty_slot(position, rotation, velocity, ACTOR_YOSHI_EGG);
|
||||
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
@@ -177,13 +176,13 @@ void YoshiValley::BeginPlay() {
|
||||
}
|
||||
}
|
||||
|
||||
void YoshiValley::InitCourseObjects() {
|
||||
void YoshiValley::InitTrackObjects() {
|
||||
}
|
||||
|
||||
void YoshiValley::UpdateCourseObjects() {
|
||||
void YoshiValley::TickTrackObjects() {
|
||||
}
|
||||
|
||||
void YoshiValley::RenderCourseObjects(s32 cameraId) {
|
||||
void YoshiValley::DrawTrackObjects(s32 cameraId) {
|
||||
}
|
||||
|
||||
void YoshiValley::SomeSounds() {
|
||||
@@ -193,16 +192,16 @@ void YoshiValley::WhatDoesThisDo(Player* player, int8_t playerId) {}
|
||||
|
||||
void YoshiValley::WhatDoesThisDoAI(Player* player, int8_t playerId) {}
|
||||
|
||||
void YoshiValley::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
void YoshiValley::Draw(ScreenContext* arg0) {
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
render_course_segments(d_course_yoshi_valley_dl_list, arg0);
|
||||
render_track_sections(d_course_yoshi_valley_dl_list, arg0);
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
}
|
||||
|
||||
void YoshiValley::RenderCredits() {
|
||||
void YoshiValley::DrawCredits() {
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)(d_course_yoshi_valley_dl_18020));
|
||||
}
|
||||
|
||||
@@ -218,7 +217,7 @@ void YoshiValley::CreditsSpawnActors() {
|
||||
Vec3s rotation = { 0, 0, 0 };
|
||||
|
||||
vec3f_set(position, -2300.0f, 0.0f, 634.0f);
|
||||
position[0] *= gCourseDirection;
|
||||
position[0] *= gTrackDirection;
|
||||
add_actor_to_empty_slot(position, rotation, velocity, ACTOR_YOSHI_EGG);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include "Course.h"
|
||||
#include "Track.h"
|
||||
|
||||
extern "C" {
|
||||
#include "assets/models/tracks/yoshi_valley/yoshi_valley_vertices.h"
|
||||
@@ -12,10 +12,11 @@ extern "C" {
|
||||
#include "data/some_data.h"
|
||||
#include "objects.h"
|
||||
#include "path_spawn_metadata.h"
|
||||
#include "code_800029B0.h"
|
||||
extern const course_texture yoshi_valley_textures[];
|
||||
}
|
||||
|
||||
class YoshiValley : public Course {
|
||||
class YoshiValley : public Track {
|
||||
public:
|
||||
virtual ~YoshiValley() = default; // Virtual destructor for proper cleanup in derived classes
|
||||
|
||||
@@ -27,14 +28,14 @@ public:
|
||||
virtual void Load() override;
|
||||
virtual void UnLoad() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void InitCourseObjects() override;
|
||||
virtual void UpdateCourseObjects() override;
|
||||
virtual void RenderCourseObjects(s32 cameraId) override;
|
||||
virtual void InitTrackObjects() override;
|
||||
virtual void TickTrackObjects() override;
|
||||
virtual void DrawTrackObjects(s32 cameraId) override;
|
||||
virtual void SomeSounds() override;
|
||||
virtual void WhatDoesThisDo(Player* player, int8_t playerId) override;
|
||||
virtual void WhatDoesThisDoAI(Player* player, int8_t playerId) override;
|
||||
virtual void Render(struct UnkStruct_800DC5EC*) override;
|
||||
virtual void RenderCredits() override;
|
||||
virtual void Draw(ScreenContext*) override;
|
||||
virtual void DrawCredits() override;
|
||||
virtual void ScrollingTextures() override;
|
||||
virtual void Waypoints(Player* player, int8_t playerId) override;
|
||||
virtual void CreditsSpawnActors() override;
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "Train.h"
|
||||
#include <vector>
|
||||
|
||||
#include "engine/courses/Course.h"
|
||||
#include "engine/tracks/Track.h"
|
||||
#include "engine/vehicles/Utils.h"
|
||||
#include "engine/World.h"
|
||||
#include "port/Game.h"
|
||||
|
||||
Reference in New Issue
Block a user