mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-09-02 02:22:44 -04:00
Add warning if no finishline. Remove printfs
This commit is contained in:
@@ -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]);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -43,6 +43,8 @@ void CourseManager_RenderCredits();
|
||||
|
||||
void CourseManager_SpawnActors();
|
||||
|
||||
bool cm_DoesFinishlineExist();
|
||||
|
||||
void CourseManager_InitClouds();
|
||||
|
||||
void CourseManager_DrawActor(Camera* camera, struct Actor* actor);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user