Merge branch 'main' into port-pr750
This commit is contained in:
commit
2cfb06744f
|
|
@ -126,7 +126,7 @@ jobs:
|
|||
|
||||
build-macos-intel:
|
||||
needs: generate-port-o2r
|
||||
runs-on: macOS-latest-intel
|
||||
runs-on: macos-15-intel
|
||||
strategy:
|
||||
matrix:
|
||||
config: [Release, Debug]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"Props":{"AIDistance":[20,5,10,15,20,25,30,35,30,25,45,65,90,115,140,165,40,3,6,16,46,49,59,89,50,30,60,63,73,78,108,138],"AIMaximumSeparation":50.0,"AIMinimumSeparation":0.30000001192092896,"AISteeringSensitivity":48,"CourseLength":"100m","CurveTargetSpeed":[4.166666507720947,5.583333492279053,6.166666507720947,6.75],"NormalTargetSpeed":[3.75,5.166666507720947,5.75,6.333333492279053],"D_0D0096B8":[3.3333332538604736,3.9166667461395264,4.5,5.083333492279053],"OffTrackTargetSpeed":[3.75,5.166666507720947,5.75,6.333333492279053], "DebugName":"harbour","FarPersp":6800.0,"LakituTowType":0,"MinimapColour":[251,234,188],"MinimapFinishlineX":1.0,"MinimapFinishlineY":0.0,"MinimapPlayerScaleFactor":0.03799999877810478,"MinimapPlayerX":53,"MinimapPlayerY":48,"MinimapPosition":[273,168],"MinimapPosition2P":[5,0],"Name":"harbour","NearPersp":3.0,"Sequence":6,"Skybox":[66,179,246,255,118,118,0,198,255,0,180,255,0,96,255,0,96,255,0,96,255,0,96,255],"WaterLevel":-130.0},"StaticMeshActors":null}
|
||||
{"Props":{"AIDistance":[20,5,10,15,20,25,30,35,30,25,45,65,90,115,140,165,40,3,6,16,46,49,59,89,50,30,60,63,73,78,108,138],"AIMaximumSeparation":50.0,"AIMinimumSeparation":0.30000001192092896,"AISteeringSensitivity":48,"TrackLength":"100m","CurveTargetSpeed":[4.166666507720947,5.583333492279053,6.166666507720947,6.75],"NormalTargetSpeed":[3.75,5.166666507720947,5.75,6.333333492279053],"D_0D0096B8":[3.3333332538604736,3.9166667461395264,4.5,5.083333492279053],"OffTrackTargetSpeed":[3.75,5.166666507720947,5.75,6.333333492279053], "ResourceName":"hm:harbour", "DebugName":"harbour","FarPersp":6800.0,"LakituTowType":0,"MinimapColour":[251,234,188],"MinimapFinishlineX":1.0,"MinimapFinishlineY":0.0,"MinimapPlayerScaleFactor":0.03799999877810478,"MinimapPlayerX":53,"MinimapPlayerY":48,"MinimapPosition":[273,168],"MinimapPosition2P":[5,0],"Name":"harbour","NearPersp":3.0,"Sequence":6,"Skybox":[66,179,246,255,118,118,0,198,255,0,180,255,0,96,255,0,96,255,0,96,255,0,96,255],"WaterLevel":-130.0},"StaticMeshActors":null}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ void render_actor_banana(Camera* camera, UNUSED Mat4 arg1, struct BananaActor* b
|
|||
Vec3s sp7C;
|
||||
Mat4 sp3C;
|
||||
|
||||
f32 temp = is_within_render_distance(camera->pos, banana->pos, camera->rot[1], 0, gCameraFOV[camera - camera1],
|
||||
f32 temp = is_within_render_distance(camera->pos, banana->pos, camera->rot[1], 0, camera->fieldOfView,
|
||||
490000.0f);
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp = MAX(temp, 0.0f);
|
||||
|
|
|
|||
|
|
@ -10,15 +10,15 @@
|
|||
* Actor used in Toad's Turnpike.
|
||||
* His update are made in vehicle.
|
||||
*
|
||||
* @param arg0
|
||||
* @param camera
|
||||
* @param arg1
|
||||
*/
|
||||
void render_actor_box_truck(Camera* arg0, struct Actor* arg1) {
|
||||
void render_actor_box_truck(Camera* camera, struct Actor* arg1) {
|
||||
UNUSED s32 pad[6];
|
||||
Mat4 spD8;
|
||||
UNUSED s32 pad2[32];
|
||||
f32 temp_f0 =
|
||||
is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraFOV[arg0 - camera1], 9000000.0f);
|
||||
is_within_render_distance(camera->pos, arg1->pos, camera->rot[1], 2500.0f, camera->fieldOfView, 9000000.0f);
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,15 +8,15 @@
|
|||
* Actor used in Toad's Turnpike.
|
||||
* His update are made in vehicle.
|
||||
*
|
||||
* @param arg0
|
||||
* @param camera
|
||||
* @param arg1
|
||||
*/
|
||||
void render_actor_car(Camera* arg0, struct Actor* arg1) {
|
||||
void render_actor_car(Camera* camera, struct Actor* arg1) {
|
||||
UNUSED s32 pad[6];
|
||||
Mat4 spC8;
|
||||
UNUSED s32 pad2[32];
|
||||
f32 temp_f0 =
|
||||
is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraFOV[arg0 - camera1], 9000000.0f);
|
||||
is_within_render_distance(camera->pos, arg1->pos, camera->rot[1], 2500.0f, camera->fieldOfView, 9000000.0f);
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
* @param arg2
|
||||
*/
|
||||
void render_actor_cow(Camera* camera, Mat4 arg1, struct Actor* arg2) {
|
||||
if (is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraFOV[camera - camera1],
|
||||
if (is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView,
|
||||
4000000.0f) < 0 &&
|
||||
CVarGetInteger("gNoCulling", 0) == 0) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ void render_actor_fake_item_box(Camera* camera, struct FakeItemBox* fakeItemBox)
|
|||
// @port: Tag the transform.
|
||||
FrameInterpolation_RecordOpenChild("Fake Item Box", TAG_ITEM_ADDR(fakeItemBox));
|
||||
|
||||
if (is_within_render_distance(camera->pos, fakeItemBox->pos, camera->rot[1], 2500.0f, gCameraFOV[camera - camera1],
|
||||
if (is_within_render_distance(camera->pos, fakeItemBox->pos, camera->rot[1], 2500.0f, camera->fieldOfView,
|
||||
1000000.0f) < 0 &&
|
||||
CVarGetInteger("gNoCulling", 0) == 0) {
|
||||
actor_not_rendered(camera, (struct Actor*) fakeItemBox);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ void render_actor_falling_rock(Camera* camera, struct FallingRock* rock) {
|
|||
return;
|
||||
}
|
||||
|
||||
height = is_within_render_distance(camera->pos, rock->pos, camera->rot[1], 400.0f, gCameraFOV[camera - camera1],
|
||||
height = is_within_render_distance(camera->pos, rock->pos, camera->rot[1], 400.0f, camera->fieldOfView,
|
||||
4000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
|
|||
// @port: Tag the transform.
|
||||
FrameInterpolation_RecordOpenChild("ItemBox", TAG_ITEM_ADDR(item_box));
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, item_box->pos, camera->rot[1], 0.0f, gCameraFOV[camera - camera1],
|
||||
temp_f0 = is_within_render_distance(camera->pos, item_box->pos, camera->rot[1], 0.0f, camera->fieldOfView,
|
||||
4000000.0f);
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = CLAMP(temp_f0, 0.0f, 600000.0f);
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
* @brief Renders the Mario sign actor.
|
||||
* Actor used in Mario Raceway.
|
||||
*
|
||||
* @param arg0
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_mario_sign(Camera* arg0, UNUSED Mat4 arg1, struct Actor* arg2) {
|
||||
void render_actor_mario_sign(Camera* camera, UNUSED Mat4 arg1, struct Actor* arg2) {
|
||||
Mat4 mtx;
|
||||
f32 unk;
|
||||
s16 temp = arg2->flags;
|
||||
|
|
@ -19,7 +19,7 @@ void render_actor_mario_sign(Camera* arg0, UNUSED Mat4 arg1, struct Actor* arg2)
|
|||
return;
|
||||
}
|
||||
|
||||
unk = is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0, gCameraFOV[arg0 - camera1], 16000000.0f);
|
||||
unk = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView, 16000000.0f);
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
unk = MAX(unk, 0.0f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@
|
|||
* @brief Renders the paddle boat actor.
|
||||
* Actor used in DK's Jungle Parkway.
|
||||
*
|
||||
* @param arg0
|
||||
* @param camera
|
||||
* @param boat
|
||||
* @param arg2
|
||||
* @param pathCounter
|
||||
*/
|
||||
void render_actor_paddle_boat(Camera* arg0, struct PaddleWheelBoat* boat, UNUSED Mat4 arg2, u16 pathCounter) {
|
||||
void render_actor_paddle_boat(Camera* camera, struct PaddleWheelBoat* boat, UNUSED Mat4 arg2, u16 pathCounter) {
|
||||
UNUSED s32 pad[3];
|
||||
Vec3f sp120;
|
||||
Mat4 spE0;
|
||||
|
|
@ -29,7 +29,7 @@ void render_actor_paddle_boat(Camera* arg0, struct PaddleWheelBoat* boat, UNUSED
|
|||
return;
|
||||
}
|
||||
|
||||
temp = is_within_render_distance(arg0->pos, boat->pos, arg0->rot[1], 90000.0f, gCameraFOV[arg0 - camera1],
|
||||
temp = is_within_render_distance(camera->pos, boat->pos, camera->rot[1], 90000.0f, camera->fieldOfView,
|
||||
9000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@
|
|||
* @brief Renders the palm tree actor.
|
||||
* Actor used in Koopa Troopa Beach.
|
||||
*
|
||||
* @param arg0
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_palm_tree(Camera* arg0, UNUSED Mat4 arg1, struct PalmTree* arg2) {
|
||||
void render_actor_palm_tree(Camera* camera, UNUSED Mat4 arg1, struct PalmTree* arg2) {
|
||||
Vec3s spA8 = { 0, 0, 0 };
|
||||
Mat4 sp68;
|
||||
f32 temp_f0;
|
||||
|
|
@ -21,7 +21,7 @@ void render_actor_palm_tree(Camera* arg0, UNUSED Mat4 arg1, struct PalmTree* arg
|
|||
}
|
||||
|
||||
temp_f0 =
|
||||
is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0.0f, gCameraFOV[arg0 - camera1], 4000000.0f);
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0.0f, camera->fieldOfView, 4000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
|
|||
|
|
@ -20,14 +20,14 @@ const char* sPiranhaPlantTextures[] = {
|
|||
* @brief Renders the piranha plant actor.
|
||||
* Actor used in Mario Raceway and Royal Raceway.
|
||||
*
|
||||
* @param arg0
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_piranha_plant(Camera* arg0, Mat4 arg1, struct PiranhaPlant* arg2) {
|
||||
void render_actor_piranha_plant(Camera* camera, Mat4 arg1, struct PiranhaPlant* arg2) {
|
||||
UNUSED s32 pad;
|
||||
u8* addr;
|
||||
s16 temp_lo = arg0 - camera1;
|
||||
s16 temp_lo = camera - camera1;
|
||||
s16 animationFrame; // unconfirmed
|
||||
s16 temp = arg2->flags;
|
||||
f32 temp_f0;
|
||||
|
|
@ -37,7 +37,7 @@ void render_actor_piranha_plant(Camera* arg0, Mat4 arg1, struct PiranhaPlant* ar
|
|||
return;
|
||||
}
|
||||
|
||||
temp_f0 = is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0, gCameraFOV[arg0 - camera1], 1000000.0f);
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView, 1000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@
|
|||
* @brief Renders the railroad crossing actor.
|
||||
* Actor used in Kalimari Desert.
|
||||
*
|
||||
* @param arg0
|
||||
* @param camera
|
||||
* @param rr_crossing
|
||||
*/
|
||||
void render_actor_railroad_crossing(Camera* arg0, struct RailroadCrossing* rr_crossing) {
|
||||
void render_actor_railroad_crossing(Camera* camera, struct RailroadCrossing* rr_crossing) {
|
||||
UNUSED Vec3s sp80 = { 0, 0, 0 };
|
||||
Mat4 sp40;
|
||||
f32 unk = is_within_render_distance(arg0->pos, rr_crossing->pos, arg0->rot[1], 0.0f, gCameraFOV[arg0 - camera1],
|
||||
f32 unk = is_within_render_distance(camera->pos, rr_crossing->pos, camera->rot[1], 0.0f, camera->fieldOfView,
|
||||
4000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
|
|
|
|||
|
|
@ -8,17 +8,17 @@
|
|||
* Actor used in Toad's Turnpike.
|
||||
* His update are made in vehicle.
|
||||
*
|
||||
* @param arg0
|
||||
* @param camera
|
||||
* @param arg1
|
||||
*/
|
||||
void render_actor_school_bus(Camera* arg0, struct Actor* arg1) {
|
||||
void render_actor_school_bus(Camera* camera, struct Actor* arg1) {
|
||||
UNUSED s32 pad[6];
|
||||
Mat4 spC8;
|
||||
UNUSED s32 pad2[32];
|
||||
f32 temp_f0;
|
||||
|
||||
temp_f0 =
|
||||
is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraFOV[arg0 - camera1], 9000000.0f);
|
||||
is_within_render_distance(camera->pos, arg1->pos, camera->rot[1], 2500.0f, camera->fieldOfView, 9000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ void render_actor_tanker_truck(Camera* camera, struct Actor* arg1) {
|
|||
Mat4 spC8;
|
||||
UNUSED s32 pad2[32];
|
||||
f32 temp_f0 = is_within_render_distance(camera->pos, arg1->pos, camera->rot[1], 2500.0f,
|
||||
gCameraFOV[camera - camera1], 9000000.0f);
|
||||
camera->fieldOfView, 9000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ void render_actor_train_engine(Camera* camera, struct TrainCar* actor) {
|
|||
Mat4 resultMtx;
|
||||
|
||||
f32 distance = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 2500.0f,
|
||||
gCameraFOV[camera - camera1], 9000000.0f);
|
||||
camera->fieldOfView, 9000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
distance = MAX(distance, 0.0f);
|
||||
|
|
@ -175,7 +175,7 @@ void render_actor_train_tender(Camera* camera, struct TrainCar* actor) {
|
|||
Mat4 spA0;
|
||||
|
||||
f32 temp_f0 = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 625.0f,
|
||||
gCameraFOV[camera - camera1], 9000000.0f);
|
||||
camera->fieldOfView, 9000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
@ -268,7 +268,7 @@ void render_actor_train_passenger_car(Camera* camera, struct TrainCar* actor) {
|
|||
Mat4 spA0;
|
||||
|
||||
f32 temp_f0 = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 2025.0f,
|
||||
gCameraFOV[camera - camera1], 9000000.0f);
|
||||
camera->fieldOfView, 9000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ void render_actor_tree_mario_raceway(Camera* camera, Mat4 arg1, struct Actor* ar
|
|||
return;
|
||||
}
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraFOV[camera - camera1],
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView,
|
||||
16000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
|
|
@ -62,7 +62,7 @@ void render_actor_tree_yoshi_valley(Camera* camera, Mat4 arg1, struct Actor* arg
|
|||
}
|
||||
|
||||
temp_f0 =
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraFOV[camera - camera1], 4000000.0f);
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView, 4000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
@ -101,7 +101,7 @@ void render_actor_tree_royal_raceway(Camera* camera, Mat4 arg1, struct Actor* ar
|
|||
}
|
||||
|
||||
temp_f0 =
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraFOV[camera - camera1], 4000000.0f);
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView, 4000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
@ -140,7 +140,7 @@ void render_actor_tree_moo_moo_farm(Camera* camera, Mat4 arg1, struct Actor* arg
|
|||
}
|
||||
|
||||
temp_f0 =
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraFOV[camera - camera1], 6250000.0f);
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView, 6250000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
@ -172,7 +172,7 @@ void render_actor_tree_luigi_raceway(Camera* camera, Mat4 arg1, struct Actor* ar
|
|||
}
|
||||
|
||||
temp_f0 =
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraFOV[camera - camera1], 4000000.0f);
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView, 4000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
@ -215,7 +215,7 @@ void render_actor_tree_peach_castle(Camera* camera, Mat4 arg1, struct Actor* arg
|
|||
}
|
||||
|
||||
temp_f0 =
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraFOV[camera - camera1], 4000000.0f);
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView, 4000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
@ -254,7 +254,7 @@ void render_actor_bush_bowser_castle(Camera* camera, Mat4 arg1, struct Actor* ar
|
|||
}
|
||||
|
||||
temp_f0 =
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraFOV[camera - camera1], 640000.0f);
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView, 640000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
@ -293,7 +293,7 @@ void render_actor_tree_frappe_snowland(Camera* camera, Mat4 arg1, struct Actor*
|
|||
}
|
||||
|
||||
temp_f0 =
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraFOV[camera - camera1], 4000000.0f);
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView, 4000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
@ -331,7 +331,7 @@ void render_actor_tree_cactus1_kalimari_desert(Camera* camera, Mat4 arg1, struct
|
|||
}
|
||||
|
||||
temp_f0 =
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraFOV[camera - camera1], 4000000.0f);
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView, 4000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
@ -369,7 +369,7 @@ void render_actor_tree_cactus2_kalimari_desert(Camera* camera, Mat4 arg1, struct
|
|||
}
|
||||
|
||||
temp_f0 =
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraFOV[camera - camera1], 4000000.0f);
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView, 4000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
@ -407,7 +407,7 @@ void render_actor_tree_cactus3_kalimari_desert(Camera* camera, Mat4 arg1, struct
|
|||
}
|
||||
|
||||
temp_f0 =
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraFOV[camera - camera1], 4000000.0f);
|
||||
is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, camera->fieldOfView, 4000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = MAX(temp_f0, 0.0f);
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@
|
|||
* @brief Renders the Wario sign actor.
|
||||
* Used in Wario Stadium.
|
||||
*
|
||||
* @param arg0
|
||||
* @param camera
|
||||
* @param arg1
|
||||
*/
|
||||
void render_actor_wario_sign(Camera* arg0, struct Actor* arg1) {
|
||||
void render_actor_wario_sign(Camera* camera, struct Actor* arg1) {
|
||||
Mat4 sp38;
|
||||
f32 unk =
|
||||
is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 0, gCameraFOV[arg0 - camera1], 16000000.0f);
|
||||
is_within_render_distance(camera->pos, arg1->pos, camera->rot[1], 0, camera->fieldOfView, 16000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
unk = MAX(unk, 0.0f);
|
||||
|
|
|
|||
|
|
@ -8,19 +8,19 @@
|
|||
* @brief Renders the Yoshi egg actor.
|
||||
* Actor used in Yoshi Valley.
|
||||
*
|
||||
* @param arg0
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param egg
|
||||
* @param arg3
|
||||
*/
|
||||
void render_actor_yoshi_egg(Camera* arg0, Mat4 arg1, struct YoshiValleyEgg* egg, u16 arg3) {
|
||||
void render_actor_yoshi_egg(Camera* camera, Mat4 arg1, struct YoshiValleyEgg* egg, u16 arg3) {
|
||||
Mat4 sp60;
|
||||
Vec3s sp5C;
|
||||
Vec3f sp54;
|
||||
f32 temp_f0;
|
||||
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
temp_f0 = is_within_render_distance(arg0->pos, egg->pos, arg0->rot[1], 200.0f, gCameraFOV[arg0 - camera1],
|
||||
temp_f0 = is_within_render_distance(camera->pos, egg->pos, camera->rot[1], 200.0f, camera->fieldOfView,
|
||||
16000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
|
|
|
|||
45
src/camera.c
45
src/camera.c
|
|
@ -163,27 +163,27 @@ void camera_init(Vec3f pos, s16 rot, u32 mode, s32 cameraId) {
|
|||
|
||||
if (D_80164678[cameraId] == 0) {
|
||||
if (D_80164A28 == 1) {
|
||||
gCameraFOV[cameraId] = 80.0f;
|
||||
camera->fieldOfView = 80.0f;
|
||||
} else {
|
||||
gCameraFOV[cameraId] = 40.0f;
|
||||
camera->fieldOfView = 40.0f;
|
||||
}
|
||||
camera->unk_B4 = gCameraFOV[cameraId];
|
||||
camera->unk_B4 = camera->fieldOfView;
|
||||
}
|
||||
if (D_80164678[cameraId] == 1) {
|
||||
if (D_80164A28 == 1) {
|
||||
gCameraFOV[cameraId] = 100.0f;
|
||||
camera->fieldOfView = 100.0f;
|
||||
} else {
|
||||
gCameraFOV[cameraId] = 60.0f;
|
||||
camera->fieldOfView = 60.0f;
|
||||
}
|
||||
camera->unk_B4 = gCameraFOV[cameraId];
|
||||
camera->unk_B4 = camera->fieldOfView;
|
||||
}
|
||||
if (D_80164678[cameraId] == 2) {
|
||||
if (D_80164A28 == 1) {
|
||||
gCameraFOV[cameraId] = 100.0f;
|
||||
camera->fieldOfView = 100.0f;
|
||||
} else {
|
||||
gCameraFOV[cameraId] = 60.0f;
|
||||
camera->fieldOfView = 60.0f;
|
||||
}
|
||||
camera->unk_B4 = gCameraFOV[cameraId];
|
||||
camera->unk_B4 = camera->fieldOfView;
|
||||
D_80164A38[cameraId] = 20.0f;
|
||||
D_80164A48[cameraId] = 1.5f;
|
||||
D_80164A78[cameraId] = 1.0f;
|
||||
|
|
@ -202,6 +202,7 @@ void freecam_init(Vec3f pos, s16 rot, u32 mode, s32 cameraId) {
|
|||
return;
|
||||
}
|
||||
|
||||
camera->fieldOfView = 40.0f;
|
||||
camera->mode = mode;
|
||||
sStagingTimer[cameraId] = 0;
|
||||
switch (mode) {
|
||||
|
|
@ -305,27 +306,27 @@ void freecam_init(Vec3f pos, s16 rot, u32 mode, s32 cameraId) {
|
|||
|
||||
// if (D_80164678[cameraId] == 0) {
|
||||
if (D_80164A28 == 1) {
|
||||
// gCameraFOV[cameraId] = 80.0f;
|
||||
// camera->fieldOfView = 80.0f;
|
||||
} else {
|
||||
// gCameraFOV[cameraId] = 40.0f;
|
||||
// camera->fieldOfView = 40.0f;
|
||||
}
|
||||
camera->unk_B4 = gCameraFOV[cameraId];
|
||||
camera->unk_B4 = camera->fieldOfView;
|
||||
// }
|
||||
// if (D_80164678[cameraId] == 1) {
|
||||
// if (D_80164A28 == 1) {
|
||||
// gCameraFOV[cameraId] = 100.0f;
|
||||
// camera->fieldOfView = 100.0f;
|
||||
// } else {
|
||||
// gCameraFOV[cameraId] = 60.0f;
|
||||
// camera->fieldOfView = 60.0f;
|
||||
// }
|
||||
// camera->unk_B4 = gCameraFOV[cameraId];
|
||||
// camera->unk_B4 = camera->fieldOfView;
|
||||
// // }
|
||||
// if (D_80164678[cameraId] == 2) {
|
||||
// if (D_80164A28 == 1) {
|
||||
// gCameraFOV[cameraId] = 100.0f;
|
||||
// camera->fieldOfView = 100.0f;
|
||||
// } else {
|
||||
// gCameraFOV[cameraId] = 60.0f;
|
||||
// camera->fieldOfView = 60.0f;
|
||||
// }
|
||||
// camera->unk_B4 = gCameraFOV[cameraId];
|
||||
// camera->unk_B4 = camera->fieldOfView;
|
||||
// D_80164A38[cameraId] = 20.0f;
|
||||
// D_80164A48[cameraId] = 1.5f;
|
||||
// D_80164A78[cameraId] = 1.0f;
|
||||
|
|
@ -1129,7 +1130,7 @@ void func_8001EE98(Player* player, Camera* camera, s8 index) {
|
|||
}
|
||||
}
|
||||
|
||||
void func_8001F394(Player* player, f32* arg1) {
|
||||
void func_8001F394(Player* player) {
|
||||
f32 var_f0;
|
||||
UNUSED s32 pad;
|
||||
s32 playerIndex = player - gPlayerOne;
|
||||
|
|
@ -1252,15 +1253,15 @@ void func_8001F394(Player* player, f32* arg1) {
|
|||
D_80164498[playerIndex] = 0.0f;
|
||||
}
|
||||
}
|
||||
var_f0 = func_80014EE4(*arg1, playerIndex);
|
||||
var_f0 = func_80014EE4(camera->fieldOfView, playerIndex);
|
||||
break;
|
||||
case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL:
|
||||
case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL:
|
||||
case SCREEN_MODE_3P_4P_SPLITSCREEN:
|
||||
var_f0 = func_80014EE4(*arg1, playerIndex);
|
||||
var_f0 = func_80014EE4(camera->fieldOfView, playerIndex);
|
||||
break;
|
||||
}
|
||||
*arg1 = var_f0;
|
||||
camera->fieldOfView = var_f0;
|
||||
camera->unk_B4 = var_f0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ typedef struct {
|
|||
// I think these are the "nautical angles" between pos and lookAt
|
||||
// rot[0] = roll? Does nothing?, rot[1] = yaw, rot[2] = pitch
|
||||
/* 0x24 */ Vec3s rot;
|
||||
f32 fieldOfView;
|
||||
/* 0x2A */ u16 someBitFlags;
|
||||
/* 0x2C */ s16 unk_2C;
|
||||
/* 0x2E */ s16 unk_2E;
|
||||
|
|
@ -85,7 +86,7 @@ void func_8001E45C(Camera*, Player*, s8);
|
|||
void func_8001E8E8(Camera*, Player*, s8);
|
||||
void func_8001EA0C(Camera*, Player*, s8);
|
||||
void func_8001EE98(Player*, Camera*, s8);
|
||||
void func_8001F394(Player*, f32*);
|
||||
void func_8001F394(Player*);
|
||||
void func_8001F87C(s32);
|
||||
|
||||
extern f32 D_800DDB30[];
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ void init_camera_podium_ceremony(void) {
|
|||
cameras[0].up[0] = 0.0f;
|
||||
cameras[0].up[1] = 1.0f;
|
||||
cameras[0].up[2] = 0.0f;
|
||||
gCameraFOV[0] = 40.0f;
|
||||
cameras[0].fieldOfView = 40.0f;
|
||||
gScreenAspect = 1.33333333f;
|
||||
D_80150150 = 3.0f;
|
||||
D_8015014C = 6800.0f;
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@ void func_802830B4(CinematicCamera* arg0, s16 arg1, s16 arg2, s16 arg3) {
|
|||
}
|
||||
}
|
||||
|
||||
void func_80283100(CinematicCamera* arg0, f32* arg1) {
|
||||
void func_80283100(CinematicCamera* arg0, Camera* camera) {
|
||||
if (arg0->unk60 != 0) {
|
||||
arg0->unk6E = (coss((u16) arg0->unk64) * arg0->unk60) / 256;
|
||||
arg0->unk64 += arg0->unk68;
|
||||
|
|
@ -463,7 +463,7 @@ void func_80283100(CinematicCamera* arg0, f32* arg1) {
|
|||
} else {
|
||||
arg0->unk64 = 0.0f;
|
||||
}
|
||||
*arg1 = arg0->unk20 + (f32) arg0->unk6E;
|
||||
camera->fieldOfView = arg0->unk20 + (f32) arg0->unk6E;
|
||||
}
|
||||
|
||||
void func_80283240(s16 arg0) {
|
||||
|
|
@ -547,7 +547,7 @@ void init_cinematic_camera(void) {
|
|||
camera->unk68 = 0.0f;
|
||||
camera->unk6C = 0;
|
||||
camera->unk6E = 0;
|
||||
camera->unk20 = gCameraFOV[0];
|
||||
camera->unk20 = 60.0f;// gCameraFOV[0];
|
||||
sCutsceneShot = 0;
|
||||
gCutsceneShotTimer = 0;
|
||||
D_802876D4 = 0;
|
||||
|
|
@ -633,7 +633,7 @@ s32 func_80283648(Camera* camera) {
|
|||
}
|
||||
func_80282F44(0, cinematicCamera, camera);
|
||||
func_80282F44(1, cinematicCamera, camera);
|
||||
func_80283100(cinematicCamera, gCameraFOV);
|
||||
func_80283100(cinematicCamera, camera);
|
||||
vec3f_copy_return_dupe(cinematicCamera->unk30, camera->pos);
|
||||
vec3f_copy_return_dupe(cinematicCamera->unk24, camera->lookAt);
|
||||
vec3f_copy_return_dupe(cinematicCamera->unk3C, camera->up);
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ void func_80282EAC(s32, CinematicCamera*, s16, s16, s16);
|
|||
void func_80282F00(s16*, s16);
|
||||
void func_80282F44(s32, CinematicCamera*, Camera*);
|
||||
void func_802830B4(CinematicCamera*, s16, s16, s16);
|
||||
void func_80283100(CinematicCamera*, f32*);
|
||||
void func_80283100(CinematicCamera*, Camera* camera);
|
||||
void func_80283240(s16);
|
||||
s32 cutscene_event(CameraEvent event, CinematicCamera*, s16, s16);
|
||||
s32 func_80283330(s32);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ void func_80280038(Camera* camera) {
|
|||
func_80057FC4(0);
|
||||
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH);
|
||||
guPerspective(camera->perspectiveMatrix , &perspNorm, gCameraFOV[0], gScreenAspect, CM_GetProps()->NearPersp, CM_GetProps()->FarPersp, 1.0f);
|
||||
guPerspective(camera->perspectiveMatrix , &perspNorm, camera->fieldOfView, gScreenAspect, CM_GetProps()->NearPersp, CM_GetProps()->FarPersp, 1.0f);
|
||||
gSPPerspNormalize(gDisplayListHead++, perspNorm);
|
||||
gSPMatrix(gDisplayListHead++, camera->perspectiveMatrix,
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
|
|
@ -145,8 +145,7 @@ void load_credits(void) {
|
|||
gScreenOneCtx->camera = camera;
|
||||
camera->renderMode = RENDER_FULL_SCENE;
|
||||
camera->unk_B4 = 60.0f;
|
||||
gCameraFOV[0] = 60.0f;
|
||||
|
||||
camera->fieldOfView = 60.0f;
|
||||
|
||||
gCurrentCourseId = gCreditsCourseId;
|
||||
TrackBrowser_SetTrackByIdx(gCreditsCourseId);
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ void setup_podium_ceremony(void) {
|
|||
spawn_players_and_cameras();
|
||||
gScreenOneCtx->camera->renderMode = RENDER_FULL_SCENE;
|
||||
gScreenOneCtx->camera->unk_B4 = 60.0f;
|
||||
gCameraFOV[0] = 60.0f;
|
||||
gScreenOneCtx->camera->fieldOfView = 60.0f;
|
||||
load_kart_textures();
|
||||
init_hud();
|
||||
func_8001C05C();
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ void func_80281D00(void) {
|
|||
}
|
||||
func_8028150C();
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH);
|
||||
guPerspective(camera->perspectiveMatrix, &perspNorm, gCameraFOV[0], gScreenAspect, CM_GetProps()->NearPersp, CM_GetProps()->FarPersp,
|
||||
guPerspective(camera->perspectiveMatrix, &perspNorm, camera->fieldOfView, gScreenAspect, CM_GetProps()->NearPersp, CM_GetProps()->FarPersp,
|
||||
1.0f);
|
||||
gSPPerspNormalize(gDisplayListHead++, perspNorm);
|
||||
gSPMatrix(gDisplayListHead++, camera->perspectiveMatrix,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ void AActor::BeginPlay() {
|
|||
if ((nullptr != Model) && (Model[0] != '\0')) {
|
||||
// Prevent collision mesh from being generated extra times.
|
||||
if (Triangles.size() == 0) {
|
||||
Editor::GenerateCollisionMesh(this, (Gfx*)LOAD_ASSET_RAW(Model), 1.0f);
|
||||
TrackEditor::GenerateCollisionMesh(this, (Gfx*)LOAD_ASSET_RAW(Model), 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,9 +52,10 @@ extern "C" void add_triangle_to_collision_mesh(Vtx* vtx1, Vtx* vtx2, Vtx* vtx3,
|
|||
}
|
||||
|
||||
void RaceManager::Load() {
|
||||
if (GetWorld()->GetTrack()) {
|
||||
auto* track = GetWorld()->GetTrack();
|
||||
if (track) {
|
||||
mirroredVtxCache.clear();
|
||||
GetWorld()->GetTrack()->Load();
|
||||
track->Load();
|
||||
} else {
|
||||
printf("[RaceManager] [Load] Track was nullptr\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ void RegisterTracks(Registry<TrackInfo>& r) {
|
|||
r.Add(info, []() { GetWorld()->SetCurrentTrack(std::make_unique<BigDonut>()); });
|
||||
|
||||
info = {
|
||||
.ResourceName = "mk:test_track",
|
||||
.ResourceName = "hm:test_track",
|
||||
.Name = "test track",
|
||||
.DebugName = "test track",
|
||||
.Length = "100m",
|
||||
|
|
|
|||
|
|
@ -97,6 +97,17 @@ public:
|
|||
return list;
|
||||
}
|
||||
|
||||
// Returns true if item succesfully removed
|
||||
// Note that mCounter is not decremented on remove
|
||||
bool Remove(const std::string& resourceName) {
|
||||
auto it = mMap.find(resourceName);
|
||||
if (it != mMap.end()) {
|
||||
mMap.erase(it);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
mMap.clear();
|
||||
mCounter = 0;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "TrackBrowser.h"
|
||||
#include "port/Engine.h"
|
||||
#include "engine/editor/SceneManager.h"
|
||||
#include <imgui.h>
|
||||
|
||||
TrackBrowser* TrackBrowser::Instance;
|
||||
|
||||
|
|
@ -8,57 +9,67 @@ void TrackBrowser::FindCustomTracks() {
|
|||
auto manager = GameEngine::Instance->context->GetResourceManager()->GetArchiveManager();
|
||||
|
||||
auto ptr2 = manager->ListDirectories("tracks/*");
|
||||
if (ptr2) {
|
||||
auto dirs = *ptr2;
|
||||
if (!ptr2) {
|
||||
return;
|
||||
}
|
||||
auto dirs = *ptr2;
|
||||
|
||||
for (const std::string& dir : dirs) {
|
||||
std::string name = dir.substr(dir.find_last_of('/') + 1);
|
||||
std::string sceneFile = dir + "/scene.json";
|
||||
std::string minimapFile = dir + "/minimap.png";
|
||||
for (const std::string& dir : dirs) {
|
||||
std::string name = dir.substr(dir.find_last_of('/') + 1);
|
||||
std::string sceneFile = dir + "/scene.json";
|
||||
std::string minimapFile = dir + "/minimap.png";
|
||||
|
||||
// The track has a valid scene file, add it to the registry
|
||||
if (manager->HasFile(sceneFile)) {
|
||||
auto archive = manager->GetArchiveFromFile(sceneFile);
|
||||
// The track has a valid scene file, add it to the registry
|
||||
if (manager->HasFile(sceneFile)) {
|
||||
auto archive = manager->GetArchiveFromFile(sceneFile);
|
||||
|
||||
TrackInfo info;
|
||||
info.Path = dir;
|
||||
TrackEditor::LoadTrackInfo(info, archive, sceneFile);
|
||||
if (info.ResourceName.empty()) {
|
||||
printf("[TrackBrowser] Track has invalid resource name; expected format: author:mod_name");
|
||||
info.ResourceName = std::string("mods:") + name;
|
||||
}
|
||||
printf("[TrackBrowser] Added custom track %s\n", info.Name.c_str());
|
||||
gTrackRegistry.Add(info, [info, archive]() {
|
||||
auto track = std::make_unique<Track>();
|
||||
track->ResourceName = info.ResourceName;
|
||||
track->Archive = archive;
|
||||
GetWorld()->SetCurrentTrack(std::move(track));
|
||||
});
|
||||
} else { // The track does not have a valid scene file
|
||||
const std::string file = dir + "/data_track_sections";
|
||||
// If the track has a data_track_sections file,
|
||||
// then it must at least be a valid track.
|
||||
// So lets add it as an uninitialized track.
|
||||
if (manager->HasFile(file)) {
|
||||
printf("[TrackBrowser] [FindCustomTracks] Found a new custom track!\n");
|
||||
printf(" Creating scene.json so the track can be configured in the editor\n");
|
||||
|
||||
TrackInfo info;
|
||||
std::string resName = std::string("mods:") + name;
|
||||
info.ResourceName = resName;
|
||||
info.Name = name;
|
||||
info.DebugName = name;
|
||||
info.Path = dir;
|
||||
Editor::LoadTrackInfo(info, archive, sceneFile);
|
||||
printf("Added custom track %s\n", info.Name.c_str());
|
||||
|
||||
// Create the track
|
||||
auto archive = manager->GetArchiveFromFile(file);
|
||||
auto track = std::make_unique<Track>();
|
||||
track->Archive = archive;
|
||||
track->ResourceName = info.ResourceName;
|
||||
TrackEditor::SaveLevel(track.get(), static_cast<const TrackInfo*>(&info)); // Write scene file so it will show up in the track browser
|
||||
printf("[TrackBrowser] [FindCustomTracks] Saved scene.json to new track!\n");
|
||||
|
||||
// Passing these through seems kinda bad. But it works?
|
||||
gTrackRegistry.Add(info, [info, archive]() {
|
||||
auto track = std::make_unique<Track>();
|
||||
track->ResourceName = info.ResourceName;
|
||||
track->Archive = archive;
|
||||
track->ResourceName = info.ResourceName;
|
||||
GetWorld()->SetCurrentTrack(std::move(track));
|
||||
});
|
||||
} else { // The track does not have a valid scene file
|
||||
const std::string file = dir + "/data_track_sections";
|
||||
|
||||
// If the track has a data_track_sections file,
|
||||
// then it must at least be a valid track.
|
||||
// So lets add it as an uninitialized track.
|
||||
if (manager->HasFile(file)) {
|
||||
TrackInfo info;
|
||||
|
||||
std::string resName = std::string("mods:") + name;
|
||||
info.ResourceName = resName;
|
||||
info.Name = name;
|
||||
info.DebugName = name;
|
||||
|
||||
auto archive = manager->GetArchiveFromFile(file);
|
||||
//mNewTracks.push_back({info, "", dir, archive});
|
||||
auto track = std::make_unique<Track>();
|
||||
Editor::SaveLevel(track.get()); // Write scene file so it will show up in the track browser
|
||||
|
||||
gTrackRegistry.Add(info, [info, archive]() {
|
||||
auto track = std::make_unique<Track>();
|
||||
track->ResourceName = info.ResourceName;
|
||||
track->Archive = archive;
|
||||
GetWorld()->SetCurrentTrack(std::move(track));
|
||||
});
|
||||
|
||||
} else {
|
||||
printf("ContentBrowser.cpp: Track '%s' missing required track files. Cannot add to game\n Missing %s/data_track_sections file\n", name.c_str(), dir.c_str());
|
||||
}
|
||||
} else {
|
||||
printf("[TrackBrowser] Track '%s' missing required track files. Cannot add to game\n Missing %s/data_track_sections file\n", name.c_str(), dir.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ void ACloud::BeginPlay() {
|
|||
// Prevent collision mesh from being generated extra times.
|
||||
if (Editor_IsEnabled()) {
|
||||
if (Triangles.size() == 0) {
|
||||
Editor::GenerateCollisionMesh(this, (Gfx*)cloud_mesh, 1.0f);
|
||||
TrackEditor::GenerateCollisionMesh(this, (Gfx*) cloud_mesh, 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ void AFallingRock::Draw(Camera* camera) {
|
|||
return;
|
||||
}
|
||||
|
||||
height = is_within_render_distance(camera->pos, Pos, camera->rot[1], 400.0f, gCameraFOV[camera - camera1],
|
||||
height = is_within_render_distance(camera->pos, Pos, camera->rot[1], 400.0f, camera->fieldOfView,
|
||||
4000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ void AFinishline::BeginPlay() {
|
|||
// Prevent collision mesh from being generated extra times.
|
||||
if (Editor_IsEnabled()) {
|
||||
if (Triangles.size() == 0) {
|
||||
Editor::GenerateCollisionMesh(this, (Gfx*)LOAD_ASSET_RAW(D_0D001B90), 1.0f);
|
||||
TrackEditor::GenerateCollisionMesh(this, (Gfx*)LOAD_ASSET_RAW(D_0D001B90), 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ void AMarioSign::Draw(Camera *camera) {
|
|||
return;
|
||||
}
|
||||
|
||||
unk = is_within_render_distance(camera->pos, Pos, camera->rot[1], 0, gCameraFOV[camera - camera1], 16000000.0f);
|
||||
unk = is_within_render_distance(camera->pos, Pos, camera->rot[1], 0, camera->fieldOfView, 16000000.0f);
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
unk = MAX(unk, 0.0f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ void AShip::BeginPlay() {
|
|||
// Prevent collision mesh from being generated extra times.
|
||||
if (Editor_IsEnabled()) {
|
||||
if (Triangles.size() == 0) {
|
||||
Editor::GenerateCollisionMesh(this, (Gfx*)_skin, Scale.y);
|
||||
TrackEditor::GenerateCollisionMesh(this, (Gfx*) _skin, Scale.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ void AStarship::BeginPlay() {
|
|||
// Prevent collision mesh from being generated extra times.
|
||||
if (Editor_IsEnabled()) {
|
||||
if (Triangles.size() == 0) {
|
||||
Editor::GenerateCollisionMesh(this, (Gfx*)Model, 1.0f);
|
||||
TrackEditor::GenerateCollisionMesh(this, (Gfx*)Model, 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ void AText::Draw(Camera* camera) {
|
|||
}
|
||||
|
||||
f32 distance = is_within_render_distance(camera->pos, (float*)&Pos[0], camera->rot[1], Close,
|
||||
gCameraFOV[camera - camera1], Far);
|
||||
camera->fieldOfView, Far);
|
||||
|
||||
if (distance == -1.0f) {
|
||||
Dist = DistanceProps::TOO_FAR;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ void ATree::Draw(Camera* camera) {
|
|||
return;
|
||||
}
|
||||
|
||||
dist = is_within_render_distance(camera->pos, Pos, camera->rot[1], 0, gCameraFOV[camera - camera1],
|
||||
dist = is_within_render_distance(camera->pos, Pos, camera->rot[1], 0, camera->fieldOfView,
|
||||
DrawDistance);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ void AWarioSign::Tick() {
|
|||
void AWarioSign::Draw(Camera *camera) {
|
||||
Mat4 sp38;
|
||||
f32 unk =
|
||||
is_within_render_distance(camera->pos, Pos, camera->rot[1], 0, gCameraFOV[camera - camera1], 16000000.0f);
|
||||
is_within_render_distance(camera->pos, Pos, camera->rot[1], 0, camera->fieldOfView, 16000000.0f);
|
||||
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
unk = MAX(unk, 0.0f);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ void FreeCamera::SetViewProjection() {
|
|||
|
||||
// Perspective (camera movement)
|
||||
FrameInterpolation_RecordOpenChild("freecam_persp", FrameInterpolation_GetCameraEpoch());
|
||||
guPerspective(&PerspectiveMatrix, &perspNorm, 40, gScreenAspect,
|
||||
guPerspective(&PerspectiveMatrix, &perspNorm, _camera->fieldOfView, gScreenAspect,
|
||||
CM_GetProps()->NearPersp, CM_GetProps()->FarPersp, 1.0f);
|
||||
gSPPerspNormalize(gDisplayListHead++, perspNorm);
|
||||
gSPMatrix(gDisplayListHead++, &PerspectiveMatrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ void GameCamera::SetViewProjection() {
|
|||
(FrameInterpolation_GetCameraEpoch() | ((_camera->cameraId << 8))));
|
||||
|
||||
// Calculate camera perspective (camera movement/location)
|
||||
guPerspective(&PerspectiveMatrix, &perspNorm, gCameraFOV[_camera->cameraId], gScreenAspect,
|
||||
guPerspective(&PerspectiveMatrix, &perspNorm, _camera->fieldOfView, gScreenAspect,
|
||||
CM_GetProps()->NearPersp, CM_GetProps()->FarPersp, 1.0f);
|
||||
gSPPerspNormalize(gDisplayListHead++, perspNorm);
|
||||
gSPMatrix(gDisplayListHead++, &PerspectiveMatrix,
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ void TourCamera::SetViewProjection() {
|
|||
|
||||
// Perspective (camera movement)
|
||||
FrameInterpolation_RecordOpenChild("tourcam_persp", FrameInterpolation_GetCameraEpoch());
|
||||
guPerspective(&PerspectiveMatrix, &perspNorm, 40, gScreenAspect,
|
||||
guPerspective(&PerspectiveMatrix, &perspNorm, _camera->fieldOfView, gScreenAspect,
|
||||
CM_GetProps()->NearPersp, CM_GetProps()->FarPersp, 1.0f);
|
||||
gSPPerspNormalize(gDisplayListHead++, perspNorm);
|
||||
gSPMatrix(gDisplayListHead++, &PerspectiveMatrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ extern "C" {
|
|||
#include "assets/textures/other_textures.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
void GenerateCollisionMesh(std::variant<AActor*, OObject*, GameObject*> object, Gfx* model, float scale) {
|
||||
int8_t opcode;
|
||||
uintptr_t lo;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#define EDITOR_GFX_GET_OPCODE(var) ((uint32_t) ((var) & 0xFF000000))
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
void GenerateCollisionMesh(std::variant<AActor*, OObject*, GameObject*> object, Gfx* model, float scale);
|
||||
void DebugCollision(GameObject* obj, FVector pos, IRotator rot, FVector scale, const std::vector<Triangle>& triangles);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ extern "C" {
|
|||
#include "camera.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
Editor* Editor::Instance;
|
||||
|
||||
Editor::Editor() {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
#include "ObjectPicker.h"
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
class ObjectPicker;
|
||||
|
||||
class Editor {
|
||||
|
|
@ -54,7 +54,7 @@ private:
|
|||
void Copy(MtxF* src, MtxF* dest);
|
||||
void Clear(MtxF* mf);
|
||||
};
|
||||
} // namespace Editor
|
||||
} // namespace TrackEditor
|
||||
#endif // __cplusplus
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ FVector ScreenRayTrace() {
|
|||
|
||||
Mat4 perspMtx;
|
||||
u16 perspNorm;
|
||||
guPerspectiveF(perspMtx, &perspNorm, 40, OTRGetAspectRatio(), CM_GetProps()->NearPersp, CM_GetProps()->FarPersp, 1.0f);
|
||||
guPerspectiveF(perspMtx, &perspNorm, camera->fieldOfView, OTRGetAspectRatio(), CM_GetProps()->NearPersp, CM_GetProps()->FarPersp, 1.0f);
|
||||
|
||||
Mat4 inversePerspMtx;
|
||||
if (InverseMatrix((float*)&perspMtx, (float*)&inversePerspMtx) != 2) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include <libultraship/libultraship.h>
|
||||
#include "GameObject.h"
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
|
||||
GameObject::GameObject(FVector pos, IRotator rot, FVector scale, const char* model, std::vector<Triangle> triangles, CollisionType collision, float boundingBoxSize) {
|
||||
Pos = pos;
|
||||
|
|
@ -38,4 +38,4 @@ namespace Editor {
|
|||
Scale = scale;
|
||||
};
|
||||
|
||||
} // namespace Editor
|
||||
} // namespace TrackEditor
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ extern "C" {
|
|||
|
||||
struct Triangle;
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
class GameObject {
|
||||
public:
|
||||
enum class CollisionType {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ extern "C" {
|
|||
#include "math_util.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
|
||||
void Gizmo::Load() {
|
||||
/* Translate handle collision */
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include "engine/objects/Object.h"
|
||||
#include <variant>
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
|
||||
class Gizmo {
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "Handles.h"
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
Handles::Handles() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include <libultra/gbi.h>
|
||||
#include "GameObject.h"
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
class Handles : public GameObject {
|
||||
|
||||
Handles();
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ extern "C" {
|
|||
#include "math_util_2.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
|
||||
size_t LightObject::NumLights = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "Collision.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
|
||||
class LightObject : public GameObject {
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ extern "C" {
|
|||
#include "camera.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
|
||||
void ObjectPicker::Load() {
|
||||
eGizmo.Load();
|
||||
|
|
@ -230,7 +230,7 @@ std::pair<GameObject*, float> ObjectPicker::CheckEditorObjectRay(Ray ray) {
|
|||
break;
|
||||
}
|
||||
case GameObject::CollisionType::BOUNDING_SPHERE:
|
||||
printf("Editor::ObjectPicker.cpp Bounding sphere collision type not yet supported\n");
|
||||
printf("[ObjectPicker] [CheckEditorObjectRay] Bounding sphere collision type not yet supported\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "GameObject.h"
|
||||
#include "engine/Matrix.h"
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
class ObjectPicker {
|
||||
public:
|
||||
void SelectObject(std::vector<GameObject*> objects);
|
||||
|
|
|
|||
|
|
@ -29,20 +29,31 @@ extern "C" {
|
|||
#include "actors.h"
|
||||
#include "actor_types.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "code_800029B0.h"
|
||||
#include "render_courses.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
void SaveLevel(Track* track) {
|
||||
namespace TrackEditor {
|
||||
void SaveLevel(Track* track, const TrackInfo* info) {
|
||||
nlohmann::json data;
|
||||
|
||||
/**
|
||||
* Save track properties, static mesh actors, actors, and tour camera
|
||||
*/
|
||||
data["Props"] = track->Props.to_json();
|
||||
try {
|
||||
data["Props"] = track->Props.to_json();
|
||||
data["Props"]["ResourceName"] = track->ResourceName.c_str();
|
||||
} catch (...) {
|
||||
SPDLOG_ERROR("[SceneManager] [SaveLevel] Failed serializing track Props");
|
||||
}
|
||||
|
||||
nlohmann::json staticMesh;
|
||||
SaveStaticMeshActors(staticMesh);
|
||||
data["StaticMeshActors"] = staticMesh;
|
||||
try {
|
||||
nlohmann::json staticMesh;
|
||||
SaveStaticMeshActors(staticMesh);
|
||||
data["StaticMeshActors"] = staticMesh;
|
||||
} catch (...) {
|
||||
SPDLOG_ERROR("[SceneManager] [SaveLevel] Failed serializing StaticMeshActors");
|
||||
}
|
||||
|
||||
|
||||
nlohmann::json actors;
|
||||
|
|
@ -56,6 +67,10 @@ namespace Editor {
|
|||
data["Tour"] = tour;
|
||||
}
|
||||
|
||||
nlohmann::json fog;
|
||||
SaveFog(fog);
|
||||
data["Fog"] = fog;
|
||||
|
||||
if (nullptr == track->Archive) {
|
||||
SPDLOG_INFO("[SceneManager] [SaveLevel] Track archive nullptr");
|
||||
return;
|
||||
|
|
@ -69,7 +84,6 @@ namespace Editor {
|
|||
std::vector<uint8_t> bytes; // Turn the str into raw data
|
||||
bytes.assign(jsonStr.begin(), jsonStr.end());
|
||||
|
||||
const TrackInfo* info = gTrackRegistry.GetInfo(track->ResourceName);
|
||||
std::string sceneFile = info->Path + "/scene.json";
|
||||
|
||||
// Write file to disk
|
||||
|
|
@ -297,6 +311,19 @@ namespace Editor {
|
|||
}
|
||||
}
|
||||
|
||||
void SaveFog(nlohmann::json& fog) {
|
||||
fog["EnableFog"] = bFog;
|
||||
if (bFog) {
|
||||
fog["Colour"]["R"] = gFogColour.r;
|
||||
fog["Colour"]["G"] = gFogColour.g;
|
||||
fog["Colour"]["B"] = gFogColour.b;
|
||||
fog["Colour"]["A"] = gFogColour.a;
|
||||
|
||||
fog["Min"] = gFogMin;
|
||||
fog["Max"] = gFogMax;
|
||||
}
|
||||
}
|
||||
|
||||
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?");
|
||||
|
|
@ -305,6 +332,7 @@ namespace Editor {
|
|||
|
||||
try {
|
||||
track->Props.from_json(data["Props"]);
|
||||
track->ResourceName = data["Props"].at("ResourceName").get<std::string>();
|
||||
} 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;
|
||||
|
|
@ -312,27 +340,34 @@ namespace Editor {
|
|||
}
|
||||
|
||||
void LoadPaths(Track* track, const std::string& trackPath) {
|
||||
SPDLOG_INFO("[SceneManager] [LoadPaths] Loading Paths...");
|
||||
std::string path_file = (trackPath + "/data_paths").c_str();
|
||||
|
||||
auto res = std::dynamic_pointer_cast<MK64::Paths>(ResourceLoad(path_file.c_str()));
|
||||
if (nullptr == res) {
|
||||
SPDLOG_ERROR(" Unable to load path file (data_paths)");
|
||||
SPDLOG_ERROR(" This file is required for custom tracks to work ");
|
||||
SPDLOG_ERROR(" Make sure the first path point is at coordinates 0,0,0");
|
||||
SPDLOG_ERROR(" In blender you may need to apply transformations and then move the point to 0,0,0");
|
||||
}
|
||||
|
||||
if (res != nullptr) {
|
||||
auto& paths = res->PathList;
|
||||
auto& paths = res->PathList;
|
||||
|
||||
size_t i = 0;
|
||||
u16* ptr = &track->Props.PathSizes.unk0;
|
||||
for (auto& path : paths) {
|
||||
if (i >= ARRAY_COUNT(track->Props.PathTable2)) {
|
||||
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();
|
||||
track->Props.PathTable2[i] = (TrackPathPoint*) path.data();
|
||||
|
||||
i += 1;
|
||||
size_t i = 0;
|
||||
u16* ptr = &track->Props.PathSizes.unk0;
|
||||
for (auto& path : paths) {
|
||||
if (i >= ARRAY_COUNT(track->Props.PathTable2)) {
|
||||
SPDLOG_INFO(" The game can only import 5 paths. Found more than 5. Skipping the rest");
|
||||
break; // Only 5 paths allowed. 4 track, 1 vehicle
|
||||
}
|
||||
ptr[i] = path.size();
|
||||
track->Props.PathTable2[i] = (TrackPathPoint*) path.data();
|
||||
SPDLOG_INFO(" Added path {}", i);
|
||||
|
||||
i += 1;
|
||||
}
|
||||
gVehiclePathSize = track->Props.PathSizes.unk0; // This is likely incorrect.
|
||||
SPDLOG_INFO("[SceneManager] [LoadPaths] Path Loading Complete!");
|
||||
}
|
||||
|
||||
void LoadTrackInfoData(TrackInfo& info, nlohmann::json& data) {
|
||||
|
|
@ -415,4 +450,43 @@ namespace Editor {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LoadFog(nlohmann::json& data) {
|
||||
if (!data.contains("Fog") || !data["Fog"].is_object()) {
|
||||
SPDLOG_INFO(" This track does not contain fog");
|
||||
return;
|
||||
}
|
||||
|
||||
nlohmann::json& fog = data["Fog"];
|
||||
|
||||
bFog = fog.value("Enabled", false);
|
||||
|
||||
if (!bFog) return;
|
||||
|
||||
// Load color
|
||||
if (fog.contains("Colour") && fog["Colour"].is_object()) {
|
||||
nlohmann::json& c = fog["Colour"];
|
||||
gFogColour.r = c.value("R", 255);
|
||||
gFogColour.g = c.value("G", 255);
|
||||
gFogColour.b = c.value("B", 255);
|
||||
gFogColour.a = c.value("A", 255);
|
||||
}
|
||||
|
||||
// Load min/max with safety clamps
|
||||
int minVal = fog.value("Min", 0);
|
||||
int maxVal = fog.value("Max", 500);
|
||||
|
||||
// Ensure min < max
|
||||
if (minVal >= maxVal) {
|
||||
minVal = maxVal - 1;
|
||||
}
|
||||
|
||||
// Clamp to valid ranges
|
||||
minVal = std::clamp(minVal, 0, 999);
|
||||
maxVal = std::clamp(maxVal, 1, 1000);
|
||||
|
||||
gFogMin = static_cast<int16_t>(minVal);
|
||||
gFogMax = static_cast<int16_t>(maxVal);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
#include <optional>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace Editor {
|
||||
void SaveLevel(Track* track);
|
||||
namespace TrackEditor {
|
||||
void SaveLevel(Track* track, const TrackInfo* info);
|
||||
void LoadTrackDataFromJson(Track* track, const std::string& trackPath);
|
||||
void LoadTrackInfo(TrackInfo& info, std::shared_ptr<Ship::Archive> archive, std::string sceneFile);
|
||||
void Load_AddStaticMeshActor(const nlohmann::json& actorJson);
|
||||
|
|
@ -17,6 +17,7 @@ namespace Editor {
|
|||
void SaveActors(nlohmann::json& actorList);
|
||||
void SaveStaticMeshActors(nlohmann::json& actorList);
|
||||
void SaveTour(Track* track, nlohmann::json& tour);
|
||||
void SaveFog(nlohmann::json& fog);
|
||||
|
||||
void LoadProps(Track* track, nlohmann::json& data);
|
||||
void LoadPaths(Track* track, const std::string& trackPath);
|
||||
|
|
@ -24,6 +25,7 @@ namespace Editor {
|
|||
void LoadActors(Track* track, nlohmann::json& data);
|
||||
void LoadStaticMeshActors(Track* track, nlohmann::json& data);
|
||||
void LoadTour(Track* track, nlohmann::json& data);
|
||||
void LoadFog(nlohmann::json& data);
|
||||
|
||||
void SpawnActors(std::vector<std::pair<std::string, SpawnParams>> spawnList);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,14 +19,13 @@ extern "C" {
|
|||
#include "audio/external.h"
|
||||
}
|
||||
|
||||
#define DEGREES_FLOAT_TO_SHORT(Degrees) ((s16)((Degrees) * (0x8000 / 180.0f)))
|
||||
|
||||
OTrashBin::OTrashBin(const SpawnParams& params) : OObject(params) {
|
||||
Name = "Trash Bin";
|
||||
ResourceName = "mk:trash_bin";
|
||||
_pos = params.Location.value_or(FVector(0, 0, 0));
|
||||
_pos.x *= xOrientation;
|
||||
_rot = params.Rotation.value_or(IRotator(0, 0, 0));
|
||||
_scale = params.Scale.value_or(FVector(0, 0, 0)).y; // Only y
|
||||
_scale = params.Scale.value_or(FVector(0, 0, 0)).y;
|
||||
_bhv = static_cast<Behaviour>(params.Behaviour.value_or(0));
|
||||
|
||||
find_unused_obj_index(&_objectIndex);
|
||||
|
|
@ -86,9 +85,9 @@ void OTrashBin::init_bb_trash_bin(s32 objectIndex) {
|
|||
gObjectList[objectIndex].unk_04C = 0;
|
||||
gObjectList[objectIndex].unk_084[7] = 0;
|
||||
set_obj_orientation(objectIndex, 0U, 0U, 0U);
|
||||
gObjectList[objectIndex].orientation[0] = DEGREES_FLOAT_TO_SHORT(_rot.pitch);
|
||||
gObjectList[objectIndex].orientation[1] = DEGREES_FLOAT_TO_SHORT(_rot.yaw);
|
||||
gObjectList[objectIndex].orientation[2] = DEGREES_FLOAT_TO_SHORT(_rot.roll);
|
||||
gObjectList[objectIndex].orientation[0] = _rot.pitch;
|
||||
gObjectList[objectIndex].orientation[1] = _rot.yaw;
|
||||
gObjectList[objectIndex].orientation[2] = _rot.roll;
|
||||
gObjectList[objectIndex].pos[0] = _pos.x;
|
||||
if (_drawBin) {
|
||||
// Position the lid on-top of the box.
|
||||
|
|
@ -105,8 +104,6 @@ void OTrashBin::init_bb_trash_bin(s32 objectIndex) {
|
|||
object_next_state(objectIndex);
|
||||
}
|
||||
|
||||
#undef DEGREES_FLOAT_TO_SHORT
|
||||
|
||||
void OTrashBin::func_8007E00C(s32 objectIndex) {
|
||||
switch (gObjectList[objectIndex].state) {
|
||||
case 1:
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ BansheeBoardwalk::BansheeBoardwalk() {
|
|||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:banshee_boardwalk";
|
||||
|
||||
Props.SetText(Props.Name, "banshee boardwalk", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "ghost", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "747m", sizeof(Props.TrackLength));
|
||||
|
|
@ -166,7 +165,7 @@ void BansheeBoardwalk::BeginPlay() {
|
|||
}
|
||||
|
||||
if (gIsMirrorMode) {
|
||||
SpawnActor<OTrashBin>(FVector(1765.0f, 45.0f, 195.0f), IRotator(0, 180, 0), 1.0f, bhv);
|
||||
SpawnActor<OTrashBin>(FVector(-1765.0f, 45.0f, 195.0f), IRotator(0, 180, 0), 1.0f, bhv);
|
||||
} else {
|
||||
SpawnActor<OTrashBin>(FVector(-1765.0f, 45.0f, 70.0f), IRotator(0, 0, 0), 1.0f, bhv);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ BigDonut::BigDonut() {
|
|||
Props.Minimap.FinishlineY = 0;
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:big_donut";
|
||||
Props.SetText(Props.Name, "big donut", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "doughnut", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ BlockFort::BlockFort() {
|
|||
Props.Minimap.FinishlineY = 0;
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:block_fort";
|
||||
Props.SetText(Props.Name, "block fort", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "block", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ BowsersCastle::BowsersCastle() {
|
|||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:bowsers_castle";
|
||||
|
||||
Props.SetText(Props.Name, "bowser's castle", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "castle", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "777m", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -132,8 +132,8 @@ void ChocoMountain::Load() {
|
|||
gFogColour.g = 255;
|
||||
gFogColour.b = 255;
|
||||
gFogColour.a = 255;
|
||||
gFogMin = 0x3E3;
|
||||
gFogMax = 0x3E8;
|
||||
gFogMin = 995;
|
||||
gFogMax = 1000;
|
||||
D_802B87D4 = 0x71C;
|
||||
D_802B87D0 = 0xE38;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ DKJungle::DKJungle() {
|
|||
Props.Minimap.FinishlineY = 0;
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:dk_jungle";
|
||||
Props.SetText(Props.Name, "d.k.'s jungle parkway", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "jungle", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "893m", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ DoubleDeck::DoubleDeck() {
|
|||
Props.Minimap.FinishlineY = 0;
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:double_deck";
|
||||
Props.SetText(Props.Name, "double deck", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "deck", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ FrappeSnowland::FrappeSnowland() {
|
|||
Props.Minimap.Colour = {72, 100, 255};
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:frappe_snowland";
|
||||
Props.SetText(Props.Name, "frappe snowland", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "snow", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "734m", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ KalimariDesert::KalimariDesert() {
|
|||
Props.Minimap.FinishlineY = 4.0;
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:kalimari_desert";
|
||||
Props.SetText(Props.Name, "kalimari desert", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "desert", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "753m", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ MooMooFarm::MooMooFarm() {
|
|||
Props.Minimap.FinishlineY = 0;
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:moo_moo_farm";
|
||||
Props.SetText(Props.Name, "moo moo farm", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "farm", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "527m", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ RainbowRoad::RainbowRoad() {
|
|||
Props.Minimap.FinishlineY = 0;
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:rainbow_road";
|
||||
Props.SetText(Props.Name, "rainbow road", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "rainbow", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "2000m", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ RoyalRaceway::RoyalRaceway() {
|
|||
Props.Minimap.FinishlineY = 0;
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:royal_raceway";
|
||||
Props.SetText(Props.Name, "royal raceway", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "p circuit", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "1025m", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ SherbetLand::SherbetLand() {
|
|||
Props.Minimap.Colour = {72, 100, 255};
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:sherbet_land";
|
||||
Props.SetText(Props.Name, "sherbet land", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "sherbet", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "756m", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ Skyscraper::Skyscraper() {
|
|||
Props.Minimap.FinishlineY = 0;
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:skyscraper";
|
||||
Props.SetText(Props.Name, "skyscraper", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "skyscraper", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -71,8 +71,7 @@ TestTrack::TestTrack() {
|
|||
Props.Minimap.Colour = {255, 255, 255};
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:test_track";
|
||||
|
||||
ResourceName = "hm:test_track";
|
||||
Props.SetText(Props.Name, "Test Track", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "test track", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "100m", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ ToadsTurnpike::ToadsTurnpike() {
|
|||
Props.Minimap.FinishlineY = 0;
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:toads_turnpike";
|
||||
Props.SetText(Props.Name, "toad's turnpike", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "highway", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "1036m", sizeof(Props.TrackLength));
|
||||
|
|
@ -103,7 +104,7 @@ ToadsTurnpike::ToadsTurnpike() {
|
|||
Props.CloudList = gToadsTurnpikeRainbowRoadStars;
|
||||
|
||||
FVector finish;
|
||||
finish.x = (gIsMirrorMode != 0) ? 100 + 138.0f : 100 - 138.0f;
|
||||
finish.x = -38.0f * xOrientation;
|
||||
finish.y = (f32) (0 - 15);
|
||||
finish.z = 16;
|
||||
|
||||
|
|
|
|||
|
|
@ -350,14 +350,13 @@ bool IsTriangleWindingInverted() {
|
|||
return !gModifiedGfxSet.empty();
|
||||
}
|
||||
|
||||
|
||||
Track::Track() {
|
||||
Props.SetText(Props.Name, "Blank Track", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "blnktrck", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "100m", sizeof(Props.TrackLength));
|
||||
// Props.Cup = FLOWER_CUP;
|
||||
// Props.CupIndex = 3;
|
||||
ResourceName = "";
|
||||
ResourceName = "mod:blank_track";
|
||||
Props.Minimap.Texture = minimap_mario_raceway;
|
||||
Props.Minimap.Width = ResourceGetTexWidthByName(Props.Minimap.Texture);
|
||||
Props.Minimap.Height = ResourceGetTexHeightByName(Props.Minimap.Texture);
|
||||
|
|
@ -449,7 +448,7 @@ void Track::Load() {
|
|||
} else { // Load custom track
|
||||
bIsMod = true;
|
||||
|
||||
Editor::LoadTrackDataFromJson(this, trackPath);
|
||||
TrackEditor::LoadTrackDataFromJson(this, trackPath);
|
||||
|
||||
const std::string trackSectionPath = (trackPath + "/data_track_sections");
|
||||
TrackSections* sections = (TrackSections*) LOAD_ASSET_RAW(trackSectionPath.c_str());
|
||||
|
|
@ -623,6 +622,19 @@ void Track::Waypoints(Player* player, int8_t playerId) {
|
|||
void Track::Draw(ScreenContext* arg0) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
|
||||
if (bFog) {
|
||||
gDPSetCycleType(gDisplayListHead++, G_CYC_2CYCLE);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_FOG);
|
||||
|
||||
gDPSetFogColor(gDisplayListHead++, gFogColour.r, gFogColour.g, gFogColour.b, gFogColour.a);
|
||||
gSPFogPosition(gDisplayListHead++, gFogMin, gFogMax);
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
} else {
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_FOG);
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
@ -630,10 +642,13 @@ void Track::Draw(ScreenContext* arg0) {
|
|||
if (func_80290C20(arg0->camera) == 1) {
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_SHADE, G_CC_SHADE);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
// d_course_big_donut_packed_dl_DE8
|
||||
}
|
||||
|
||||
const TrackInfo* info = gTrackRegistry.GetInfo(ResourceName);
|
||||
if (nullptr == info) {
|
||||
printf("[Track] [Draw] Resource name did not return a valid TrackInfo %s\n", ResourceName.c_str());
|
||||
return;
|
||||
}
|
||||
std::string res = info->Path + "/data_track_sections";
|
||||
|
||||
TrackSections* sections = (TrackSections*) LOAD_ASSET_RAW(res.c_str());
|
||||
|
|
|
|||
|
|
@ -86,7 +86,6 @@ typedef struct {
|
|||
} TrackSections;
|
||||
|
||||
typedef struct Properties {
|
||||
char ResourceName[128];
|
||||
char Name[128];
|
||||
char DebugName[128];
|
||||
char TrackLength[128];
|
||||
|
|
@ -116,8 +115,6 @@ typedef struct Properties {
|
|||
#ifdef __cplusplus
|
||||
nlohmann::json to_json() const {
|
||||
nlohmann::json j;
|
||||
// j["Id"] = Id ? Id : "";
|
||||
j["ResourceName"] = ResourceName ? ResourceName : "";
|
||||
j["Name"] = Name ? Name : "";
|
||||
j["DebugName"] = DebugName ? DebugName : "";
|
||||
j["TrackLength"] = TrackLength ? TrackLength : "";
|
||||
|
|
@ -180,19 +177,12 @@ typedef struct Properties {
|
|||
|
||||
// Function to load struct from JSON
|
||||
void from_json(const nlohmann::json& j) {
|
||||
//Id = j.at("Id").get<std::string>().c_str();
|
||||
// Name = j.at("Name").get<std::string>().c_str();
|
||||
strncpy(ResourceName, j.at("ResourceName").get<std::string>().c_str(), sizeof(ResourceName) - 1);
|
||||
ResourceName[sizeof(ResourceName) - 1] = '\0'; // Ensure null termination
|
||||
|
||||
strncpy(Name, j.at("Name").get<std::string>().c_str(), sizeof(Name) - 1);
|
||||
Name[sizeof(Name) - 1] = '\0'; // Ensure null termination
|
||||
|
||||
// DebugName = j.at("DebugName").get<std::string>().c_str();
|
||||
strncpy(DebugName, j.at("DebugName").get<std::string>().c_str(), sizeof(DebugName) - 1);
|
||||
DebugName[sizeof(DebugName) - 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
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ WarioStadium::WarioStadium() {
|
|||
Props.Minimap.FinishlineY = 0;
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:wario_stadium";
|
||||
Props.SetText(Props.Name, "wario stadium", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "stadium", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "1591m", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ YoshiValley::YoshiValley() {
|
|||
Props.Minimap.FinishlineY = 0;
|
||||
ResizeMinimap(&Props.Minimap);
|
||||
|
||||
ResourceName = "mk:yoshi_valley";
|
||||
Props.SetText(Props.Name, "yoshi valley", sizeof(Props.Name));
|
||||
Props.SetText(Props.DebugName, "maze", sizeof(Props.DebugName));
|
||||
Props.SetText(Props.TrackLength, "772m", sizeof(Props.TrackLength));
|
||||
|
|
|
|||
|
|
@ -30,297 +30,298 @@ void render_collision(void) {
|
|||
|
||||
mtxf_identity(matrix);
|
||||
AddObjectMatrix(matrix, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
|
||||
|
||||
u16 previousSurfaceType = -2;
|
||||
for (size_t i = 0; i < gCollisionMeshCount; i++) {
|
||||
// Load vertices for this tri
|
||||
if (gCollisionMesh[i].surfaceType != previousSurfaceType) {
|
||||
previousSurfaceType = gCollisionMesh[i].surfaceType;
|
||||
switch (gCollisionMesh[i].surfaceType) {
|
||||
case ASPHALT:
|
||||
|
||||
switch (gCollisionMesh[i].surfaceType) {
|
||||
case ASPHALT:
|
||||
// gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
// gDPTileSync(gDisplayListHead++);
|
||||
// gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
// G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_MIRROR | G_TX_WRAP, 6, G_TX_NOLOD);
|
||||
// gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x00FC, 0x007C);
|
||||
// gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTextureRoad1);
|
||||
// gDPTileSync(gDisplayListHead++);
|
||||
// gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
// G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
// G_TX_NOLOD); gDPLoadSync(gDisplayListHead++); gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE,
|
||||
// 0, 0, 2047, 128); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
// gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
gCollisionMesh[i].vtx1->v.cn[0] = 50;
|
||||
gCollisionMesh[i].vtx1->v.cn[1] = 50;
|
||||
gCollisionMesh[i].vtx1->v.cn[2] = 50;
|
||||
gCollisionMesh[i].vtx2->v.cn[0] = 50;
|
||||
gCollisionMesh[i].vtx2->v.cn[1] = 50;
|
||||
gCollisionMesh[i].vtx2->v.cn[2] = 50;
|
||||
gCollisionMesh[i].vtx3->v.cn[0] = 50;
|
||||
gCollisionMesh[i].vtx3->v.cn[1] = 50;
|
||||
gCollisionMesh[i].vtx3->v.cn[2] = 50;
|
||||
break;
|
||||
case DIRT: // gTexture64619C
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture64AF50);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
// gCollisionMesh[i].vtx1->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx1->v.cn[1] = 248;
|
||||
// gCollisionMesh[i].vtx1->v.cn[2] = 220;
|
||||
// gCollisionMesh[i].vtx2->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx2->v.cn[1] = 248;
|
||||
// gCollisionMesh[i].vtx2->v.cn[2] = 220;
|
||||
// gCollisionMesh[i].vtx3->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx3->v.cn[1] = 248;
|
||||
// gCollisionMesh[i].vtx3->v.cn[2] = 220;
|
||||
break;
|
||||
case SAND:
|
||||
// gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
// gDPTileSync(gDisplayListHead++);
|
||||
// gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
// G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
// gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
// gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture67BEE8);
|
||||
// gDPTileSync(gDisplayListHead++);
|
||||
// gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
// G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
// G_TX_NOLOD); gDPLoadSync(gDisplayListHead++); gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0,
|
||||
// 0, 1023, 256); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
// gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
// gCollisionMesh[i].vtx1->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx1->v.cn[1] = 121;
|
||||
// gCollisionMesh[i].vtx1->v.cn[2] = 25;
|
||||
// gCollisionMesh[i].vtx2->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx2->v.cn[1] = 121;
|
||||
// gCollisionMesh[i].vtx2->v.cn[2] = 25;
|
||||
// gCollisionMesh[i].vtx3->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx3->v.cn[1] = 121;
|
||||
// gCollisionMesh[i].vtx3->v.cn[2] = 25;
|
||||
break;
|
||||
case STONE:
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture6528DC);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
// gCollisionMesh[i].vtx1->v.cn[0] = 128;
|
||||
// gCollisionMesh[i].vtx1->v.cn[1] = 128;
|
||||
// gCollisionMesh[i].vtx1->v.cn[2] = 128;
|
||||
// gCollisionMesh[i].vtx2->v.cn[0] = 128;
|
||||
// gCollisionMesh[i].vtx2->v.cn[1] = 128;
|
||||
// gCollisionMesh[i].vtx2->v.cn[2] = 128;
|
||||
// gCollisionMesh[i].vtx3->v.cn[0] = 128;
|
||||
// gCollisionMesh[i].vtx3->v.cn[1] = 128;
|
||||
// gCollisionMesh[i].vtx3->v.cn[2] = 128;
|
||||
break;
|
||||
case SNOW:
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture677F04);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
break;
|
||||
case SAND_OFFROAD:
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture67B9B0);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
break;
|
||||
case GRASS: // gTextureGrass1
|
||||
|
||||
// gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
// gDPTileSync(gDisplayListHead++);
|
||||
// gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
// G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_MIRROR | G_TX_WRAP, 6, G_TX_NOLOD);
|
||||
// gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x00FC, 0x007C);
|
||||
// gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTextureRoad1);
|
||||
// gDPTileSync(gDisplayListHead++);
|
||||
// gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
// G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
// G_TX_NOLOD); gDPLoadSync(gDisplayListHead++); gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0,
|
||||
// 0, 2047, 128); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
// gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
gCollisionMesh[i].vtx1->v.cn[0] = 50;
|
||||
gCollisionMesh[i].vtx1->v.cn[1] = 50;
|
||||
gCollisionMesh[i].vtx1->v.cn[2] = 50;
|
||||
gCollisionMesh[i].vtx2->v.cn[0] = 50;
|
||||
gCollisionMesh[i].vtx2->v.cn[1] = 50;
|
||||
gCollisionMesh[i].vtx2->v.cn[2] = 50;
|
||||
gCollisionMesh[i].vtx3->v.cn[0] = 50;
|
||||
gCollisionMesh[i].vtx3->v.cn[1] = 50;
|
||||
gCollisionMesh[i].vtx3->v.cn[2] = 50;
|
||||
break;
|
||||
case DIRT: // gTexture64619C
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture64AF50);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
// gCollisionMesh[i].vtx1->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx1->v.cn[1] = 248;
|
||||
// gCollisionMesh[i].vtx1->v.cn[2] = 220;
|
||||
// gCollisionMesh[i].vtx2->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx2->v.cn[1] = 248;
|
||||
// gCollisionMesh[i].vtx2->v.cn[2] = 220;
|
||||
// gCollisionMesh[i].vtx3->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx3->v.cn[1] = 248;
|
||||
// gCollisionMesh[i].vtx3->v.cn[2] = 220;
|
||||
break;
|
||||
case SAND:
|
||||
// gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
// gDPTileSync(gDisplayListHead++);
|
||||
// gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
// G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
// gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
// gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture67BEE8);
|
||||
// gDPTileSync(gDisplayListHead++);
|
||||
// gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
// G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
// G_TX_NOLOD); gDPLoadSync(gDisplayListHead++); gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0,
|
||||
// 1023, 256); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
// gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
// gCollisionMesh[i].vtx1->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx1->v.cn[1] = 121;
|
||||
// gCollisionMesh[i].vtx1->v.cn[2] = 25;
|
||||
// gCollisionMesh[i].vtx2->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx2->v.cn[1] = 121;
|
||||
// gCollisionMesh[i].vtx2->v.cn[2] = 25;
|
||||
// gCollisionMesh[i].vtx3->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx3->v.cn[1] = 121;
|
||||
// gCollisionMesh[i].vtx3->v.cn[2] = 25;
|
||||
break;
|
||||
case STONE:
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture6528DC);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
// gCollisionMesh[i].vtx1->v.cn[0] = 128;
|
||||
// gCollisionMesh[i].vtx1->v.cn[1] = 128;
|
||||
// gCollisionMesh[i].vtx1->v.cn[2] = 128;
|
||||
// gCollisionMesh[i].vtx2->v.cn[0] = 128;
|
||||
// gCollisionMesh[i].vtx2->v.cn[1] = 128;
|
||||
// gCollisionMesh[i].vtx2->v.cn[2] = 128;
|
||||
// gCollisionMesh[i].vtx3->v.cn[0] = 128;
|
||||
// gCollisionMesh[i].vtx3->v.cn[1] = 128;
|
||||
// gCollisionMesh[i].vtx3->v.cn[2] = 128;
|
||||
break;
|
||||
case SNOW:
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture677F04);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
break;
|
||||
case SAND_OFFROAD:
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture67B9B0);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
break;
|
||||
case GRASS: // gTextureGrass1
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTextureGrass1);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTextureGrass1);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
|
||||
// gCollisionMesh[i].vtx1->v.cn[0] = 50;
|
||||
// gCollisionMesh[i].vtx1->v.cn[1] = 180;
|
||||
// gCollisionMesh[i].vtx1->v.cn[2] = 50;
|
||||
// gCollisionMesh[i].vtx2->v.cn[0] = 50;
|
||||
// gCollisionMesh[i].vtx2->v.cn[1] = 180;
|
||||
// gCollisionMesh[i].vtx2->v.cn[2] = 50;
|
||||
// gCollisionMesh[i].vtx3->v.cn[0] = 50;
|
||||
// gCollisionMesh[i].vtx3->v.cn[1] = 180;
|
||||
// gCollisionMesh[i].vtx3->v.cn[2] = 50;
|
||||
break;
|
||||
case ICE:
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture643B3C);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
break;
|
||||
case WET_SAND:
|
||||
// gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
// gDPTileSync(gDisplayListHead++);
|
||||
// gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
// G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
// gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x00FC);
|
||||
// gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture66DD38);
|
||||
// gDPTileSync(gDisplayListHead++);
|
||||
// gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
// G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
// G_TX_NOLOD); gDPLoadSync(gDisplayListHead++); gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0,
|
||||
// 1023, 256); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
// gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
break;
|
||||
case SNOW_OFFROAD:
|
||||
gCollisionMesh[i].vtx1->v.cn[0] = 80;
|
||||
gCollisionMesh[i].vtx1->v.cn[1] = 80;
|
||||
gCollisionMesh[i].vtx1->v.cn[2] = 80;
|
||||
gCollisionMesh[i].vtx2->v.cn[0] = 80;
|
||||
gCollisionMesh[i].vtx2->v.cn[1] = 80;
|
||||
gCollisionMesh[i].vtx2->v.cn[2] = 80;
|
||||
gCollisionMesh[i].vtx3->v.cn[0] = 80;
|
||||
gCollisionMesh[i].vtx3->v.cn[1] = 80;
|
||||
gCollisionMesh[i].vtx3->v.cn[2] = 80;
|
||||
break;
|
||||
case CLIFF:
|
||||
break;
|
||||
case DIRT_OFFROAD:
|
||||
break;
|
||||
case TRAIN_TRACK: // gTextureRailroadTrack
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 6, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x00FC, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTextureRailroadTrack);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 2047, 128);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
break;
|
||||
case CAVE:
|
||||
break;
|
||||
case OUT_OF_BOUNDS:
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture64313C);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
// gCollisionMesh[i].vtx1->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx1->v.cn[1] = 0;
|
||||
// gCollisionMesh[i].vtx1->v.cn[2] = 0;
|
||||
// gCollisionMesh[i].vtx2->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx2->v.cn[1] = 0;
|
||||
// gCollisionMesh[i].vtx2->v.cn[2] = 0;
|
||||
// gCollisionMesh[i].vtx3->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx3->v.cn[1] = 0;
|
||||
// gCollisionMesh[i].vtx3->v.cn[2] = 0;
|
||||
break;
|
||||
case BOOST_RAMP_WOOD:
|
||||
case BOOST_RAMP_ASPHALT:
|
||||
case RAMP:
|
||||
gCollisionMesh[i].vtx1->v.cn[0] = 255;
|
||||
gCollisionMesh[i].vtx1->v.cn[1] = 255;
|
||||
gCollisionMesh[i].vtx1->v.cn[2] = 0;
|
||||
gCollisionMesh[i].vtx2->v.cn[0] = 255;
|
||||
gCollisionMesh[i].vtx2->v.cn[1] = 255;
|
||||
gCollisionMesh[i].vtx2->v.cn[2] = 0;
|
||||
gCollisionMesh[i].vtx3->v.cn[0] = 255;
|
||||
gCollisionMesh[i].vtx3->v.cn[1] = 255;
|
||||
gCollisionMesh[i].vtx3->v.cn[2] = 0;
|
||||
break;
|
||||
case WOOD_BRIDGE:
|
||||
case ROPE_BRIDGE:
|
||||
case BRIDGE:
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture676FB0);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
// gCollisionMesh[i].vtx1->v.cn[0] = 0;
|
||||
// gCollisionMesh[i].vtx1->v.cn[1] = 255;
|
||||
// gCollisionMesh[i].vtx1->v.cn[2] = 0;
|
||||
// gCollisionMesh[i].vtx2->v.cn[0] = 0;
|
||||
// gCollisionMesh[i].vtx2->v.cn[1] = 255;
|
||||
// gCollisionMesh[i].vtx2->v.cn[2] = 0;
|
||||
// gCollisionMesh[i].vtx3->v.cn[0] = 0;
|
||||
// gCollisionMesh[i].vtx3->v.cn[1] = 255;
|
||||
// gCollisionMesh[i].vtx3->v.cn[2] = 0;
|
||||
break;
|
||||
// gCollisionMesh[i].vtx1->v.cn[0] = 50;
|
||||
// gCollisionMesh[i].vtx1->v.cn[1] = 180;
|
||||
// gCollisionMesh[i].vtx1->v.cn[2] = 50;
|
||||
// gCollisionMesh[i].vtx2->v.cn[0] = 50;
|
||||
// gCollisionMesh[i].vtx2->v.cn[1] = 180;
|
||||
// gCollisionMesh[i].vtx2->v.cn[2] = 50;
|
||||
// gCollisionMesh[i].vtx3->v.cn[0] = 50;
|
||||
// gCollisionMesh[i].vtx3->v.cn[1] = 180;
|
||||
// gCollisionMesh[i].vtx3->v.cn[2] = 50;
|
||||
break;
|
||||
case ICE:
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture643B3C);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
break;
|
||||
case WET_SAND:
|
||||
// gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
// gDPTileSync(gDisplayListHead++);
|
||||
// gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
// G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
// gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x00FC);
|
||||
// gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture66DD38);
|
||||
// gDPTileSync(gDisplayListHead++);
|
||||
// gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
// G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
// G_TX_NOLOD); gDPLoadSync(gDisplayListHead++); gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0,
|
||||
// 0, 1023, 256); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
// gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
break;
|
||||
case SNOW_OFFROAD:
|
||||
gCollisionMesh[i].vtx1->v.cn[0] = 80;
|
||||
gCollisionMesh[i].vtx1->v.cn[1] = 80;
|
||||
gCollisionMesh[i].vtx1->v.cn[2] = 80;
|
||||
gCollisionMesh[i].vtx2->v.cn[0] = 80;
|
||||
gCollisionMesh[i].vtx2->v.cn[1] = 80;
|
||||
gCollisionMesh[i].vtx2->v.cn[2] = 80;
|
||||
gCollisionMesh[i].vtx3->v.cn[0] = 80;
|
||||
gCollisionMesh[i].vtx3->v.cn[1] = 80;
|
||||
gCollisionMesh[i].vtx3->v.cn[2] = 80;
|
||||
break;
|
||||
case CLIFF:
|
||||
break;
|
||||
case DIRT_OFFROAD:
|
||||
break;
|
||||
case TRAIN_TRACK: // gTextureRailroadTrack
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 6, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x00FC, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTextureRailroadTrack);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 2047, 128);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
break;
|
||||
case CAVE:
|
||||
break;
|
||||
case OUT_OF_BOUNDS:
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture64313C);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
// gCollisionMesh[i].vtx1->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx1->v.cn[1] = 0;
|
||||
// gCollisionMesh[i].vtx1->v.cn[2] = 0;
|
||||
// gCollisionMesh[i].vtx2->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx2->v.cn[1] = 0;
|
||||
// gCollisionMesh[i].vtx2->v.cn[2] = 0;
|
||||
// gCollisionMesh[i].vtx3->v.cn[0] = 255;
|
||||
// gCollisionMesh[i].vtx3->v.cn[1] = 0;
|
||||
// gCollisionMesh[i].vtx3->v.cn[2] = 0;
|
||||
break;
|
||||
case BOOST_RAMP_WOOD:
|
||||
case BOOST_RAMP_ASPHALT:
|
||||
case RAMP:
|
||||
gCollisionMesh[i].vtx1->v.cn[0] = 255;
|
||||
gCollisionMesh[i].vtx1->v.cn[1] = 255;
|
||||
gCollisionMesh[i].vtx1->v.cn[2] = 0;
|
||||
gCollisionMesh[i].vtx2->v.cn[0] = 255;
|
||||
gCollisionMesh[i].vtx2->v.cn[1] = 255;
|
||||
gCollisionMesh[i].vtx2->v.cn[2] = 0;
|
||||
gCollisionMesh[i].vtx3->v.cn[0] = 255;
|
||||
gCollisionMesh[i].vtx3->v.cn[1] = 255;
|
||||
gCollisionMesh[i].vtx3->v.cn[2] = 0;
|
||||
break;
|
||||
case WOOD_BRIDGE:
|
||||
case ROPE_BRIDGE:
|
||||
case BRIDGE:
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
|
||||
gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
|
||||
gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gTexture676FB0);
|
||||
gDPTileSync(gDisplayListHead++);
|
||||
gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPLoadSync(gDisplayListHead++);
|
||||
gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 1023, 256);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
// gCollisionMesh[i].vtx1->v.cn[0] = 0;
|
||||
// gCollisionMesh[i].vtx1->v.cn[1] = 255;
|
||||
// gCollisionMesh[i].vtx1->v.cn[2] = 0;
|
||||
// gCollisionMesh[i].vtx2->v.cn[0] = 0;
|
||||
// gCollisionMesh[i].vtx2->v.cn[1] = 255;
|
||||
// gCollisionMesh[i].vtx2->v.cn[2] = 0;
|
||||
// gCollisionMesh[i].vtx3->v.cn[0] = 0;
|
||||
// gCollisionMesh[i].vtx3->v.cn[1] = 255;
|
||||
// gCollisionMesh[i].vtx3->v.cn[2] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gSPVertex(gDisplayListHead++, gCollisionMesh[i].vtx1, 1, 0);
|
||||
gSPVertex(gDisplayListHead++, gCollisionMesh[i].vtx2, 1, 1);
|
||||
gSPVertex(gDisplayListHead++, gCollisionMesh[i].vtx3, 1, 2);
|
||||
|
|
|
|||
|
|
@ -122,7 +122,6 @@ s32 D_80150120;
|
|||
s32 gGotoMode;
|
||||
UNUSED s32 D_80150128;
|
||||
UNUSED s32 D_8015012C;
|
||||
f32 gCameraFOV[NUM_CAMERAS]; // Field-of-view for each camera
|
||||
UNUSED s32 D_80150140;
|
||||
UNUSED s32 D_80150144;
|
||||
f32 gScreenAspect;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
#define MTX_EFFECT_POOL_SIZE_MAX MTX_EFFECT_POOL_SIZE + 100
|
||||
#endif
|
||||
|
||||
#define GFX_POOL_SIZE 15000
|
||||
#define GFX_POOL_SIZE 150000
|
||||
|
||||
struct GfxPool {
|
||||
/* 0x00000 */ Mtx mtxScreen; // Matrix for skybox and startup logo
|
||||
|
|
@ -167,7 +167,6 @@ extern u16 D_8015011E;
|
|||
|
||||
extern s32 D_80150120;
|
||||
extern s32 gGotoMode;
|
||||
extern f32 gCameraFOV[];
|
||||
|
||||
extern f32 gScreenAspect;
|
||||
extern f32 D_8015014C;
|
||||
|
|
|
|||
|
|
@ -1177,7 +1177,7 @@ void splash_menu_act(struct Controller* controller, u16 controllerIdx) {
|
|||
}
|
||||
case DEBUG_MENU_LAUNCH_EDITOR: {
|
||||
if (btnAndStick & (A_BUTTON | START_BUTTON)) {
|
||||
Editor_Launch("mk:test_track");
|
||||
Editor_Launch("hm:test_track");
|
||||
play_sound2(SOUND_INTRO_ENTER_MENU);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include <libultraship.h>
|
||||
#include <typeinfo>
|
||||
|
||||
#include "Game.h"
|
||||
#include "port/Engine.h"
|
||||
|
|
@ -68,7 +69,7 @@ Cup* gBattleCup;
|
|||
|
||||
HarbourMastersIntro gMenuIntro;
|
||||
|
||||
Editor::Editor gEditor;
|
||||
TrackEditor::Editor gEditor;
|
||||
|
||||
s32 gTrophyIndex = NULL;
|
||||
|
||||
|
|
@ -284,6 +285,12 @@ void CM_DrawTrack(ScreenContext* screen) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Check if collision mesh rendering is enabled via CVar
|
||||
if (CVarGetInteger("gRenderCollisionMesh", 0)) {
|
||||
render_collision();
|
||||
return;
|
||||
}
|
||||
|
||||
// Custom tracks should never use DrawCredits();
|
||||
if (GetWorld()->GetTrack()->IsMod()) {
|
||||
switch(screen->camera->renderMode) {
|
||||
|
|
@ -756,7 +763,7 @@ void CM_ActorGenerateCollision(struct Actor* actor) {
|
|||
|
||||
if ((nullptr != act->Model) && (act->Model[0] != '\0')) {
|
||||
if (act->Triangles.size() == 0) {
|
||||
Editor::GenerateCollisionMesh(act, (Gfx*)LOAD_ASSET_RAW(act->Model), 1.0f);
|
||||
TrackEditor::GenerateCollisionMesh(act, (Gfx*)LOAD_ASSET_RAW(act->Model), 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ extern "C" {
|
|||
extern s32 gTrophyIndex;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern Editor::Editor gEditor;
|
||||
extern TrackEditor::Editor gEditor;
|
||||
extern HarbourMastersIntro gMenuIntro;
|
||||
extern bool bCleanWorld;
|
||||
extern Registry<TrackInfo> gTrackRegistry;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ extern "C" {
|
|||
#include "collision.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
bool bIsTrainWindowOpen = false; // Global because member variables do not work in lambdas
|
||||
|
||||
ContentBrowserWindow::~ContentBrowserWindow() {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "engine/tracks/Track.h"
|
||||
#include "AllActors.h"
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
class ContentBrowserWindow : public Ship::GuiWindow {
|
||||
public:
|
||||
using Ship::GuiWindow::GuiWindow;
|
||||
|
|
|
|||
|
|
@ -69,21 +69,21 @@ void SetupGuiElements() {
|
|||
SPDLOG_ERROR("Could not find input GfxDebuggerWindow");
|
||||
}
|
||||
|
||||
mToolsWindow = std::make_shared<Editor::ToolsWindow>("gEditorEnabled", "Tools", ImVec2(100, 100),
|
||||
mToolsWindow = std::make_shared<TrackEditor::ToolsWindow>("gEditorEnabled", "Tools", ImVec2(100, 100),
|
||||
(ImGuiWindowFlags_NoTitleBar));
|
||||
gui->AddGuiWindow(mToolsWindow);
|
||||
|
||||
mSceneExplorerWindow = std::make_shared<Editor::SceneExplorerWindow>("gEditorEnabled", "Scene Explorer");
|
||||
mSceneExplorerWindow = std::make_shared<TrackEditor::SceneExplorerWindow>("gEditorEnabled", "Scene Explorer");
|
||||
gui->AddGuiWindow(mSceneExplorerWindow);
|
||||
|
||||
mPropertiesWindow = std::make_shared<Editor::PropertiesWindow>("gEditorEnabled", "Properties");
|
||||
mPropertiesWindow = std::make_shared<TrackEditor::PropertiesWindow>("gEditorEnabled", "Properties");
|
||||
gui->AddGuiWindow(mPropertiesWindow);
|
||||
|
||||
mTrackPropertiesWindow = std::make_shared<Editor::TrackPropertiesWindow>("gEditorEnabled", "Track Properties");
|
||||
mTrackPropertiesWindow = std::make_shared<TrackEditor::TrackPropertiesWindow>("gEditorEnabled", "Track Properties");
|
||||
gui->AddGuiWindow(mTrackPropertiesWindow);
|
||||
|
||||
mContentBrowserWindow =
|
||||
std::make_shared<Editor::ContentBrowserWindow>("gEditorEnabled", "Content Browser");
|
||||
std::make_shared<TrackEditor::ContentBrowserWindow>("gEditorEnabled", "Content Browser");
|
||||
gui->AddGuiWindow(mContentBrowserWindow);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ extern "C" {
|
|||
#include "actors.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
|
||||
PropertiesWindow::~PropertiesWindow() {
|
||||
SPDLOG_TRACE("destruct properties window");
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include <libultraship/libultraship.h>
|
||||
#include "port/Game.h"
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
class PropertiesWindow : public Ship::GuiWindow {
|
||||
public:
|
||||
using Ship::GuiWindow::GuiWindow;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ extern "C" {
|
|||
#include "actors.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
|
||||
SceneExplorerWindow::~SceneExplorerWindow() {
|
||||
SPDLOG_TRACE("destruct scene explorer window");
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "port/Game.h"
|
||||
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
class SceneExplorerWindow : public Ship::GuiWindow {
|
||||
public:
|
||||
using Ship::GuiWindow::GuiWindow;
|
||||
|
|
|
|||
|
|
@ -12,13 +12,14 @@
|
|||
#include <defines.h>
|
||||
#include "port/Game.h"
|
||||
#include "engine/editor/SceneManager.h"
|
||||
#include "engine/TrackBrowser.h"
|
||||
|
||||
extern "C" {
|
||||
#include "code_800029B0.h"
|
||||
#include "code_80057C60.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
|
||||
ToolsWindow::~ToolsWindow() {
|
||||
SPDLOG_TRACE("destruct tools window");
|
||||
|
|
@ -36,7 +37,8 @@ namespace Editor {
|
|||
// Save button
|
||||
if (ImGui::Button(ICON_FA_FLOPPY_O, ImVec2(50, 25))) {
|
||||
if (gEditor.IsPaused()) {
|
||||
SaveLevel(GetWorld()->GetTrack());
|
||||
SaveLevel(GetWorld()->GetTrack(), gTrackRegistry.GetInfo(GetWorld()->GetTrack()->ResourceName));
|
||||
TrackBrowser::Instance->Refresh(gTrackRegistry);
|
||||
} else {
|
||||
printf("[Editor] Cannot save during simulation\n Please switch back to edit mode!\n\n");
|
||||
}
|
||||
|
|
@ -140,7 +142,8 @@ namespace Editor {
|
|||
ImGui::PushStyleColor(ImGuiCol_Button, defaultColor);
|
||||
if (ImGui::Button(gEditor.IsPaused() ? ICON_FA_PLAY : ICON_FA_STOP, ImVec2(50, 25))) {
|
||||
if (gEditor.IsPaused()) {
|
||||
SaveLevel(GetWorld()->GetTrack());
|
||||
SaveLevel(GetWorld()->GetTrack(), gTrackRegistry.GetInfo(GetWorld()->GetTrack()->ResourceName));
|
||||
TrackBrowser::Instance->Refresh(gTrackRegistry);
|
||||
CVarSetInteger("gFreecam", false);
|
||||
CM_SetFreeCamera(false);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <libultraship/libultraship.h>
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
class ToolsWindow : public Ship::GuiWindow {
|
||||
public:
|
||||
using Ship::GuiWindow::GuiWindow;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@
|
|||
#include "port/Game.h"
|
||||
|
||||
#include "engine/cameras/TourCamera.h"
|
||||
#include "engine/TrackBrowser.h"
|
||||
#include "engine/editor/SceneManager.h"
|
||||
#include "engine/Registry.h"
|
||||
|
||||
extern "C" {
|
||||
#include "code_800029B0.h"
|
||||
|
|
@ -23,26 +26,23 @@ extern "C" {
|
|||
#include "render_objects.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
|
||||
TrackPropertiesWindow::~TrackPropertiesWindow() {
|
||||
SPDLOG_TRACE("destruct track properties window");
|
||||
}
|
||||
|
||||
void TrackPropertiesWindow::DrawElement() {
|
||||
static char idBuffer[256] = "mk:mario_raceway";
|
||||
static char nameBuffer[256] = "Mario Raceway";
|
||||
static char debugNameBuffer[256] = "m circuit";
|
||||
static char lengthBuffer[256] = "567m";
|
||||
|
||||
if (nullptr == GetWorld()->GetTrack()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui::InputText("ID", idBuffer, IM_ARRAYSIZE(idBuffer));
|
||||
ImGui::InputText("Name", GetWorld()->GetTrack()->Props.Name, IM_ARRAYSIZE(nameBuffer));
|
||||
ImGui::InputText("Debug Name", GetWorld()->GetTrack()->Props.DebugName, IM_ARRAYSIZE(debugNameBuffer));
|
||||
ImGui::InputText("Track Length", GetWorld()->GetTrack()->Props.TrackLength, IM_ARRAYSIZE(lengthBuffer));
|
||||
if (ImGui::Button("Edit TrackInfo")) {
|
||||
ImGui::OpenPopup("Edit TrackInfo");
|
||||
}
|
||||
|
||||
DrawResourceNameEdit();
|
||||
|
||||
ImGui::InputFloat("Water Level", &GetWorld()->GetTrack()->Props.WaterLevel);
|
||||
|
||||
if (ImGui::CollapsingHeader("Camera")) {
|
||||
|
|
@ -57,6 +57,7 @@ namespace Editor {
|
|||
}
|
||||
|
||||
if (ImGui::CollapsingHeader("Environment")) {
|
||||
TrackPropertiesWindow::DrawFog();
|
||||
TrackPropertiesWindow::DrawLight();
|
||||
}
|
||||
|
||||
|
|
@ -174,6 +175,99 @@ namespace Editor {
|
|||
TrackPropertiesWindow::DrawTourCamera();
|
||||
}
|
||||
|
||||
void TrackPropertiesWindow::DrawResourceNameEdit() {
|
||||
Track* track = GetWorld()->GetTrack();
|
||||
if (!track) {
|
||||
return;
|
||||
}
|
||||
|
||||
static char resourceNameBuffer[128] = {};
|
||||
static char nameBuffer[128] = "blank_track";
|
||||
static char debugNameBuffer[128] = "blanktrack";
|
||||
static char lengthBuffer[128] = "100m";
|
||||
static bool initialized = false;
|
||||
static std::string oldResourceName = track->ResourceName;
|
||||
|
||||
// Auto-sizing fills the height of the screen for a single frame.
|
||||
// Because there's no content in the window in the first frame.
|
||||
// This forces the window size to prevent that
|
||||
ImGui::SetNextWindowSize(ImVec2(400, 275), ImGuiCond_Always);
|
||||
if (ImGui::BeginPopupModal("Edit TrackInfo", nullptr,
|
||||
ImGuiWindowFlags_AlwaysAutoResize)) {
|
||||
|
||||
// Initialize once per popup open
|
||||
if (!initialized) {
|
||||
strncpy(resourceNameBuffer, track->ResourceName.c_str(), sizeof(resourceNameBuffer));
|
||||
resourceNameBuffer[sizeof(resourceNameBuffer) - 1] = '\0';
|
||||
oldResourceName = track->ResourceName;
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
ImGui::TextWrapped(
|
||||
"Changing these fields will:\n"
|
||||
"- Save the current track\n"
|
||||
"- Reload the track\n"
|
||||
"- Update the registry\n\n"
|
||||
);
|
||||
|
||||
gEditor.Pause();
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::InputText("ResourceName", resourceNameBuffer, IM_ARRAYSIZE(resourceNameBuffer));
|
||||
ImGui::InputText("Name", GetWorld()->GetTrack()->Props.Name, IM_ARRAYSIZE(nameBuffer));
|
||||
ImGui::InputText("Debug Name", GetWorld()->GetTrack()->Props.DebugName, IM_ARRAYSIZE(debugNameBuffer));
|
||||
ImGui::InputText("Track Length", GetWorld()->GetTrack()->Props.TrackLength, IM_ARRAYSIZE(lengthBuffer));
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
bool cancel = ImGui::Button("Cancel", ImVec2(120, 0));
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
bool confirm = ImGui::Button("Confirm", ImVec2(120, 0));
|
||||
|
||||
if (confirm) {
|
||||
if (oldResourceName != resourceNameBuffer) {
|
||||
track->ResourceName = resourceNameBuffer;
|
||||
const TrackInfo* oldInfo = gTrackRegistry.GetInfo(oldResourceName);
|
||||
TrackInfo info;
|
||||
info.ResourceName = track->ResourceName;
|
||||
info.Name = track->Props.Name;
|
||||
info.DebugName = track->Props.DebugName;
|
||||
info.Path = oldInfo->Path;
|
||||
|
||||
TrackEditor::SaveLevel(track, static_cast<const TrackInfo*>(&info));
|
||||
auto archive = track->Archive;
|
||||
gTrackRegistry.Remove(oldResourceName);
|
||||
gTrackRegistry.Add(info, [info, archive]() {
|
||||
auto track = std::make_unique<Track>();
|
||||
track->Archive = archive;
|
||||
track->ResourceName = info.ResourceName;
|
||||
GetWorld()->SetCurrentTrack(std::move(track));
|
||||
});
|
||||
TrackBrowser::Instance->Refresh(gTrackRegistry);
|
||||
gGotoMode = RACING;
|
||||
|
||||
}
|
||||
initialized = false;
|
||||
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
|
||||
if (cancel) {
|
||||
initialized = false;
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
}
|
||||
|
||||
void TrackPropertiesWindow::DrawMusic() {
|
||||
const char* items[] = {
|
||||
"None", "Title Screen", "Main Menu", "Wario Stadium", "Moo Moo Farm",
|
||||
|
|
@ -249,6 +343,40 @@ namespace Editor {
|
|||
}
|
||||
}
|
||||
|
||||
void TrackPropertiesWindow::DrawFog() {
|
||||
if (ImGui::CollapsingHeader("Fog")) {
|
||||
ImGui::Checkbox("Enable Fog", &bFog);
|
||||
float colours[4];
|
||||
|
||||
// Convert rgba to floats
|
||||
RGB8ToFloat((u8*)&gFogColour, colours);
|
||||
colours[3] = gFogColour.a / 255.0f;
|
||||
// Edit the ambient RGB colour
|
||||
ImGui::ColorEdit4("Fog Colour", colours);
|
||||
|
||||
// Convert floats to rgba
|
||||
FloatToRGB8(colours, (u8*)&gFogColour);
|
||||
gFogColour.a = static_cast<u8>(colours[3] * 255.0f);
|
||||
|
||||
// Fog near and far planes
|
||||
int val[2] = {static_cast<int>(gFogMin), static_cast<int>(gFogMax)};
|
||||
|
||||
ImGui::DragInt2("##MinimapPosition", &val[0], 1.0f, 0, 1000);
|
||||
|
||||
if (val[0] >= val[1]) {
|
||||
val[0] = val[1] - 1;
|
||||
}
|
||||
|
||||
// Clamp to allowed range just in case
|
||||
val[0] = std::clamp(val[0], 0, 999);
|
||||
val[1] = std::clamp(val[1], 1, 1000);
|
||||
|
||||
gFogMin = static_cast<int16_t>(val[0]);
|
||||
gFogMax = static_cast<int16_t>(val[1]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void TrackPropertiesWindow::DrawLight() {
|
||||
// Convert and pass to ImGui ColorEdit3
|
||||
|
||||
|
|
@ -260,17 +388,17 @@ namespace Editor {
|
|||
RGB8ToFloat((u8*)&D_800DC610[i].l->l.col, diffuse);
|
||||
RGB8ToFloat((u8*)&D_800DC610[i].l->l.dir, direction);
|
||||
|
||||
// Edit the ambient RGB color
|
||||
ImGui::Text("Light %d - Ambient Color", i + 1);
|
||||
ImGui::ColorEdit3(("Ambient Color " + std::to_string(i)).c_str(), ambient); // Modify ambient color
|
||||
// Edit the ambient RGB colour
|
||||
ImGui::Text("Light %d - Ambient Colour", i + 1);
|
||||
ImGui::ColorEdit3(("Ambient Colour " + std::to_string(i)).c_str(), ambient); // Modify ambient colour
|
||||
|
||||
// Edit the diffuse RGB colour
|
||||
ImGui::Text("Light %d - Diffuse Colour", i + 1);
|
||||
ImGui::ColorEdit3(("Diffuse Colour " + std::to_string(i)).c_str(), diffuse); // Modify diffuse colour
|
||||
|
||||
// Edit the diffuse RGB color
|
||||
ImGui::Text("Light %d - Diffuse Color", i + 1);
|
||||
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)
|
||||
// Edit the direction RGB colour (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(), direction); // Modify direction vector color
|
||||
ImGui::ColorEdit3(("Direction Colour " + std::to_string(i)).c_str(), direction); // Modify direction vector colour
|
||||
|
||||
FloatToRGB8(ambient, (u8*)&D_800DC610[i].a.l.col);
|
||||
FloatToRGB8(ambient, (u8*)&D_800DC610[i].a.l.colc);
|
||||
|
|
@ -281,7 +409,7 @@ namespace Editor {
|
|||
}
|
||||
}
|
||||
|
||||
// Convert s16 color values to float (normalized to [0, 1] range)
|
||||
// Convert s16 colour values to float (normalized to [0, 1] range)
|
||||
void TrackPropertiesWindow::RGB8ToFloat(const u8* src, float* dst) {
|
||||
for (size_t i = 0; i < 3; ++i) {
|
||||
dst[i] = src[i] / 255.0f; // Normalize to the range [0.0f, 1.0f]
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ extern "C" {
|
|||
#include "sounds.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
namespace TrackEditor {
|
||||
class TrackPropertiesWindow : public Ship::GuiWindow {
|
||||
public:
|
||||
using Ship::GuiWindow::GuiWindow;
|
||||
|
|
@ -15,7 +15,9 @@ public:
|
|||
protected:
|
||||
void InitElement() override {};
|
||||
void DrawElement() override;
|
||||
void DrawResourceNameEdit();
|
||||
void DrawMusic();
|
||||
void DrawFog();
|
||||
void DrawLight();
|
||||
void UpdateElement() override {};
|
||||
void RGB8ToFloat(const u8* src, float* dst);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue