Fix freecam for custom courses

This commit is contained in:
MegaMech
2024-11-24 15:38:57 -07:00
parent 55fe8eb13d
commit b7a637abac
6 changed files with 20 additions and 7 deletions
+5 -1
View File
@@ -239,6 +239,10 @@ void Course::Collision() {}
void Course::ScrollingTextures() {}
void Course::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) {}
void Course::Destroy() { }
void Course::Destroy() {}
bool Course::IsMod() {
return false;
}
Course* currentCourse = nullptr;
+1
View File
@@ -114,6 +114,7 @@ public:
virtual void ScrollingTextures();
virtual void DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection);
virtual void Destroy();
virtual bool IsMod();
private:
void Init();
};
+4
View File
@@ -340,3 +340,7 @@ void TestCourse::RenderCredits() {
void TestCourse::Collision() {}
void TestCourse::Destroy() { }
bool TestCourse::IsMod() {
return true;
}
+1
View File
@@ -39,4 +39,5 @@ public:
virtual void SpawnVehicles() override;
virtual void UpdateVehicles() override;
virtual void Destroy() override;
virtual bool IsMod() override;
};
+9
View File
@@ -41,6 +41,7 @@ extern "C" {
#include "audio/load.h"
#include "audio/external.h"
#include "networking/networking.h"
#include "render_courses.h"
//#include "engine/wasm.h"
}
@@ -340,6 +341,14 @@ extern "C" {
}
void CourseManager_RenderCourse(struct UnkStruct_800DC5EC* arg0) {
if (gWorldInstance.CurrentCourse->IsMod() == false) {
if ((CVarGetInteger("gFreecam", 0) == true)) {
// Render credits courses
func_8029569C();
return;
}
}
if (gWorldInstance.CurrentCourse) {
gWorldInstance.CurrentCourse->Render(arg0);
}
-6
View File
@@ -1399,12 +1399,6 @@ void render_course(struct UnkStruct_800DC5EC* arg0) {
return;
}
if ((CVarGetInteger("gFreecam", 0) == true)) {
// Render credits courses
func_8029569C();
return;
}
if (creditsRenderMode) {
func_8029569C();
return;