This commit is contained in:
MegaMech
2025-03-10 16:26:21 -06:00
parent 9e4b7ae6b4
commit 7674283449
18 changed files with 57 additions and 43 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ void BigDonut::MinimapFinishlinePosition() {
void BigDonut::Render(struct UnkStruct_800DC5EC* arg0) {
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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 -1
View File
@@ -158,7 +158,7 @@ void BlockFort::MinimapFinishlinePosition() {
}
void BlockFort::Render(struct UnkStruct_800DC5EC* arg0) {
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+2 -2
View File
@@ -260,8 +260,8 @@ void DKJungle::MinimapFinishlinePosition() {
}
void DKJungle::Render(struct UnkStruct_800DC5EC* arg0) {
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
func_802B5D64(&D_800DC610[1], D_802B87D4, D_802B87D0, 1);
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
set_track_light_direction(&D_800DC610[1], D_802B87D4, D_802B87D0, 1);
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK | G_LIGHTING);
+1 -1
View File
@@ -155,7 +155,7 @@ void DoubleDeck::MinimapFinishlinePosition() {
}
void DoubleDeck::Render(struct UnkStruct_800DC5EC* arg0) {
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+1 -1
View File
@@ -819,7 +819,7 @@ void Harbour::MinimapFinishlinePosition() {
void Harbour::Render(struct UnkStruct_800DC5EC* arg0) {
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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 -1
View File
@@ -255,7 +255,7 @@ void KalimariDesert::MinimapFinishlinePosition() {
}
void KalimariDesert::Render(struct UnkStruct_800DC5EC* arg0) {
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+1 -1
View File
@@ -372,7 +372,7 @@ void MooMooFarm::Render(struct UnkStruct_800DC5EC* arg0) {
s16 temp_s0 = arg0->pathCounter;
s16 temp_s1 = arg0->playerDirection;
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+1 -1
View File
@@ -180,7 +180,7 @@ void Skyscraper::MinimapFinishlinePosition() {
}
void Skyscraper::Render(struct UnkStruct_800DC5EC* arg0) {
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+1 -1
View File
@@ -350,7 +350,7 @@ void TestCourse::MinimapFinishlinePosition() {
void TestCourse::Render(struct UnkStruct_800DC5EC* arg0) {
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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 -1
View File
@@ -260,7 +260,7 @@ void ToadsTurnpike::MinimapFinishlinePosition() {
}
void ToadsTurnpike::Render(struct UnkStruct_800DC5EC* arg0) {
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+1 -1
View File
@@ -127,7 +127,7 @@ void YoshiValley::Load() {
Course::Load();
Lights1 lights4 = gdSPDefLights1(100, 100, 100, 255, 254, 254, 0, 0, 120);
func_802B5D64(&lights4, -0x38F0, 0x1C70, 1);
set_track_light_direction(&lights4, -0x38F0, 0x1C70, 1);
parse_course_displaylists((TrackSectionsI*)LOAD_ASSET_RAW(d_course_yoshi_valley_addr));
func_80295C6C();
D_8015F8E4 = gCourseMinY - 10.0f;
+17 -5
View File
@@ -1,12 +1,16 @@
#pragma once
#ifndef __EDITOR_H__
#define __EDITOR_H__
#include <libultraship.h>
#include <libultra/gbi.h>
#ifdef __cplusplus
#include "ObjectPicker.h"
class ObjectPicker;
class Editor {
namespace EditorNamespace {
class ObjectPicker;
class Editor {
public:
Editor();
@@ -22,6 +26,8 @@ public:
void ClearObjects();
void RemoveObject();
void SelectObjectFromSceneExplorer(GameObject* object);
void SetLevelDimensions(s16 minX, s16 maxX, s16 minZ, s16 maxZ, s16 minY, s16 maxY);
private:
bool _draw = false;
Vec3f _ray;
@@ -31,3 +37,9 @@ private:
void Clear(MtxF* mf);
};
}
#endif
void SetLevelDimensions(s16 minX, s16 maxX, s16 minZ, s16 maxZ, s16 minY, s16 maxY);
#endif // __EDITOR_H__
+2
View File
@@ -7,6 +7,8 @@ extern "C" {
#include "common_structs.h"
}
std::vector<Mtx> EditorMatrix;
enum class CollisionType {
VTX_INTERSECT,
BOUNDING_BOX,
+2 -2
View File
@@ -346,8 +346,8 @@ void CM_RenderCourse(struct UnkStruct_800DC5EC* arg0) {
if (gWorldInstance.CurrentCourse->IsMod() == false) {
if ((CVarGetInteger("gFreecam", 0) == true)) {
// Render credits courses
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH);
//gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
//gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH);
render_credits();
return;
}
+3 -3
View File
@@ -193,15 +193,15 @@ namespace EditorNamespace {
// Edit the ambient RGB color
ImGui::Text("Light %d - Ambient Color", i + 1);
ImGui::ColorEdit3(("Ambient Color " + std::to_string(i)).c_str(), (float*)&ambient); // Modify ambient color
ImGui::ColorEdit3(("Ambient Color " + std::to_string(i)).c_str(), ambient); // Modify ambient color
// Edit the diffuse RGB color
ImGui::Text("Light %d - Diffuse Color", i + 1);
ImGui::ColorEdit3(("Diffuse Color " + std::to_string(i)).c_str(), (float*)&diffuse); // Modify diffuse color
ImGui::ColorEdit3(("Diffuse Color " + std::to_string(i)).c_str(), diffuse); // Modify diffuse color
// Edit the direction RGB color (this could be represented as a direction vector)
ImGui::Text("Light %d - Direction", i + 1);
ImGui::ColorEdit3(("Direction Color " + std::to_string(i)).c_str(), (float*)&direction); // Modify direction vector color
ImGui::ColorEdit3(("Direction Color " + std::to_string(i)).c_str(), direction); // Modify direction vector color
FloatToRGB8(ambient, (u8*)&D_800DC610[i].a.l.col);
FloatToRGB8(ambient, (u8*)&D_800DC610[i].a.l.colc);
+9 -9
View File
@@ -428,10 +428,10 @@ void func_802B5CAC(s16 arg0, s16 arg1, Vec3f arg2) {
}
void func_802B5D30(s16 arg0, s16 arg1, s32 arg2) {
func_802B5D64((Lights1*) 0x9000000, arg0, arg1, arg2);
set_track_light_direction((Lights1*) 0x9000000, arg0, arg1, arg2);
}
void func_802B5D64(Lights1* addr, s16 arg1, s16 arg2, s32 arg3) {
void set_track_light_direction(Lights1* addr, s16 pitch, s16 yaw, s32 numLights) {
UNUSED s32 pad;
f32 sp48;
f32 sp44;
@@ -441,16 +441,16 @@ void func_802B5D64(Lights1* addr, s16 arg1, s16 arg2, s32 arg3) {
s32 var_v0;
s8 sp2C[3];
Lights1* var_s0;
return;
var_s0 = (Lights1*) addr;
sp48 = sins(arg2);
sp44 = coss(arg2);
sp40 = sins(arg1);
temp_f10 = coss(arg1);
sp48 = sins(yaw);
sp44 = coss(yaw);
sp40 = sins(pitch);
temp_f10 = coss(pitch);
sp2C[0] = sp44 * sp40 * 120.0f;
sp2C[1] = 120.0f * sp48;
sp2C[2] = sp44 * temp_f10 * -120.0f;
for (var_v0 = 0; var_v0 < arg3; var_v0++, var_s0++) {
for (var_v0 = 0; var_v0 < numLights; var_v0++, var_s0++) {
var_s0->l[0].l.dir[0] = sp2C[0];
var_s0->l[0].l.dir[1] = sp2C[1];
var_s0->l[0].l.dir[2] = sp2C[2];
@@ -1181,7 +1181,7 @@ f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY
}
// No idea if arg1 is actually a Mat4 or not, but since this function is unused
// its impossible to know with certainty either way, very close of func_802B5D64
// its impossible to know with certainty either way, very close of set_track_light_direction
UNUSED void func_802B8414(uintptr_t addr, Mat4 arg1, s16 arg2, s16 arg3, s32 arg4) {
UNUSED s32 pad;
Vec3f sp40;
+1 -1
View File
@@ -41,7 +41,7 @@ void mtxf_s16_rotate_z(Mat4, s16);
void func_802B5B14(Vec3f b, Vec3s rotate); // unused
void func_802B5CAC(s16, s16, Vec3f);
void func_802B5D30(s16, s16, s32);
void func_802B5D64(Lights1*, s16, s16, s32);
void set_track_light_direction(Lights1*, s16, s16, s32);
void mtxf_scale(Mat4, f32);
void mtxf_pos_rotation_xyz(Mat4, Vec3f, Vec3s);
void mtxf_translate_vec3f_mat3(Vec3f, Mat3);
+11 -11
View File
@@ -978,7 +978,7 @@ void render_moo_moo_farm(struct UnkStruct_800DC5EC* arg0) {
s16 temp_s0 = arg0->pathCounter;
s16 playerDirection = arg0->playerDirection;
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
@@ -1047,7 +1047,7 @@ void render_moo_moo_farm(struct UnkStruct_800DC5EC* arg0) {
void render_toads_turnpike(struct UnkStruct_800DC5EC* arg0) {
UNUSED s32 pad[13];
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
@@ -1074,7 +1074,7 @@ void render_toads_turnpike(struct UnkStruct_800DC5EC* arg0) {
void render_kalimari_desert(struct UnkStruct_800DC5EC* arg0) {
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
@@ -1229,7 +1229,7 @@ void render_wario_stadium(struct UnkStruct_800DC5EC* arg0) {
void render_block_fort(UNUSED struct UnkStruct_800DC5EC* arg0) {
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
@@ -1238,7 +1238,7 @@ void render_block_fort(UNUSED struct UnkStruct_800DC5EC* arg0) {
}
void render_skyscraper(UNUSED struct UnkStruct_800DC5EC* arg0) {
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
@@ -1262,7 +1262,7 @@ void render_skyscraper(UNUSED struct UnkStruct_800DC5EC* arg0) {
void render_double_deck(UNUSED struct UnkStruct_800DC5EC* arg0) {
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
@@ -1274,8 +1274,8 @@ void render_double_deck(UNUSED struct UnkStruct_800DC5EC* arg0) {
void render_dks_jungle_parkway(struct UnkStruct_800DC5EC* arg0) {
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
func_802B5D64(&D_800DC610[1], D_802B87D4, D_802B87D0, 1);
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
set_track_light_direction(&D_800DC610[1], D_802B87D4, D_802B87D0, 1);
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK | G_LIGHTING);
@@ -1300,7 +1300,7 @@ void render_big_donut(struct UnkStruct_800DC5EC* arg0) {
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
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);
@@ -1389,7 +1389,7 @@ void render_credits(void) {
}
void render_course(struct UnkStruct_800DC5EC* arg0) {
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
set_track_light_direction(D_800DC610, D_802B87D4, 0, 1);
// Freecam priority renders collision.
if (CVarGetInteger("gRenderCollisionMesh", 0) == true) {
@@ -1572,7 +1572,7 @@ void course_init(void) {
// break;
// case COURSE_YOSHI_VALLEY: {
// Lights1 lights4 = gdSPDefLights1(100, 100, 100, 255, 254, 254, 0, 0, 120);
// func_802B5D64(&lights4, -0x38F0, 0x1C70, 1);
// set_track_light_direction(&lights4, -0x38F0, 0x1C70, 1);
// parse_course_displaylists(d_course_yoshi_valley_addr);
// func_80295C6C();
// D_8015F8E4 = gCourseMinY - 10.0f;