Add warning if no finishline. Remove printfs

This commit is contained in:
MegaMech
2024-12-06 13:38:50 -07:00
parent 821bb4eba2
commit f87ad23500
5 changed files with 22 additions and 2 deletions
-1
View File
@@ -104,7 +104,6 @@ void Course::Load() {
freeMemory = (u8*) allocate_memory(size);
texture = (u8*)(asset->addr);
printf("TEXTURE: 0x%llX\n",texture);
if (texture) {
if (asset == &this->Props.textures[0]) {
gSegmentTable[5] = reinterpret_cast<uintptr_t>(&freeMemory[0]);
+11
View File
@@ -27,6 +27,7 @@
#include "engine/courses/DKJungle.h"
#include "engine/courses/BigDonut.h"
#include "engine/courses/TestCourse.h"
#include "engine/actors/AFinishline.h"
#include "engine/courses/PodiumCeremony.h"
@@ -377,6 +378,16 @@ extern "C" {
}
}
// Helps prevents users from forgetting to add a finishline to their course
bool cm_DoesFinishlineExist() {
for (AActor* actor : gWorldInstance.Actors) {
if (dynamic_cast<AFinishline*>(actor)) {
return true;
}
}
return false;
}
void CourseManager_InitClouds() {
if (gWorldInstance.CurrentCourse) {
gWorldInstance.CurrentCourse->InitClouds();
+2
View File
@@ -43,6 +43,8 @@ void CourseManager_RenderCredits();
void CourseManager_SpawnActors();
bool cm_DoesFinishlineExist();
void CourseManager_InitClouds();
void CourseManager_DrawActor(Camera* camera, struct Actor* actor);
+9
View File
@@ -1045,6 +1045,15 @@ void spawn_course_actors(void) {
gNumPermanentActors = 0;
CourseManager_SpawnActors();
if (gModeSelection != BATTLE) {
if (!cm_DoesFinishlineExist()) {
printf("\n[actors.c] COURSE MISSING THE FINISHLINE\n");
printf(" In the course class SpawnActors() function make sure to include:\n");
printf(" gWorldInstance.AddActor(new AFinishline());\n\n");
printf("\n Otherwise, course textures may glitch out or other strange issues may occur.\n");
}
}
// switch (gCurrentCourseId) {
// case COURSE_MARIO_RACEWAY:
// // spawn_foliage(d_course_mario_raceway_tree_spawns);
-1
View File
@@ -828,7 +828,6 @@ uintptr_t get_texture(size_t offset) {
while (textures->addr) {
if (totalOffset == offset) {
printf("FOUND TEXTURE: 0x%s\n", (textures->addr));
return (textures->addr);
}
totalOffset += textures->data_size;