Refactor Field-of-view into the Camera Struct (#590)
* Fix finishline for toads turnpike in extra * Fixed trash bin in extra * Refactor fov * Update scene.json * Allow setting fog * impl fog save & load
This commit is contained in:
parent
4e51b7d5b6
commit
7bc8d6f4be
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ extern "C" {
|
|||
#include "actors.h"
|
||||
#include "actor_types.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "code_800029B0.h"
|
||||
#include "render_courses.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
|
|
@ -56,6 +58,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;
|
||||
|
|
@ -297,6 +303,19 @@ namespace Editor {
|
|||
}
|
||||
}
|
||||
|
||||
void SaveFog(nlohmann::json& fog) {
|
||||
if (bFog) {
|
||||
fog["EnableFog"] = 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?");
|
||||
|
|
@ -415,4 +434,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);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -166,7 +166,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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,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;
|
||||
|
||||
|
|
|
|||
|
|
@ -623,6 +623,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,7 +643,6 @@ 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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include <libultraship.h>
|
||||
#include <typeinfo>
|
||||
|
||||
#include "Game.h"
|
||||
#include "port/Engine.h"
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ namespace Editor {
|
|||
}
|
||||
|
||||
if (ImGui::CollapsingHeader("Environment")) {
|
||||
TrackPropertiesWindow::DrawFog();
|
||||
TrackPropertiesWindow::DrawLight();
|
||||
}
|
||||
|
||||
|
|
@ -249,6 +250,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 +295,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 +316,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]
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ protected:
|
|||
void InitElement() override {};
|
||||
void DrawElement() override;
|
||||
void DrawMusic();
|
||||
void DrawFog();
|
||||
void DrawLight();
|
||||
void UpdateElement() override {};
|
||||
void RGB8ToFloat(const u8* src, float* dst);
|
||||
|
|
|
|||
|
|
@ -535,7 +535,7 @@ void render_cows(Camera* camera, Mat4 arg1) {
|
|||
sp88[0] = var_s1->pos[0] * gTrackDirection;
|
||||
sp88[1] = var_s1->pos[1];
|
||||
sp88[2] = var_s1->pos[2];
|
||||
temp_f0 = is_within_render_distance(camera->pos, sp88, camera->rot[1], 0.0f, gCameraFOV[camera - camera1],
|
||||
temp_f0 = is_within_render_distance(camera->pos, sp88, camera->rot[1], 0.0f, camera->fieldOfView,
|
||||
4000000.0f);
|
||||
if (temp_f0 > 0.0f) {
|
||||
if (temp_f0 < D_8015F704) {
|
||||
|
|
@ -678,7 +678,7 @@ void render_palm_trees(Camera* camera, Mat4 arg1) {
|
|||
spD4[1] = var_s1->pos[1];
|
||||
spD4[2] = var_s1->pos[2];
|
||||
|
||||
if (is_within_render_distance(camera->pos, spD4, camera->rot[1], 0.0f, gCameraFOV[camera - camera1], var_f22) <
|
||||
if (is_within_render_distance(camera->pos, spD4, camera->rot[1], 0.0f, camera->fieldOfView, var_f22) <
|
||||
0.0f &&
|
||||
CVarGetInteger("gNoCulling", 0) == 0) {
|
||||
var_s1++;
|
||||
|
|
@ -744,7 +744,7 @@ void render_actor_shell(Camera* camera, Mat4 matrix, struct ShellActor* shell) {
|
|||
FrameInterpolation_RecordOpenChild("Shell", TAG_ITEM_ADDR(shell));
|
||||
|
||||
f32 temp_f0 =
|
||||
is_within_render_distance(camera->pos, shell->pos, camera->rot[1], 0, gCameraFOV[camera - camera1], 490000.0f);
|
||||
is_within_render_distance(camera->pos, shell->pos, camera->rot[1], 0, camera->fieldOfView, 490000.0f);
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
temp_f0 = CLAMP(temp_f0, 0.0f, 40000.0f);
|
||||
}
|
||||
|
|
@ -824,7 +824,7 @@ UNUSED void func_8029ABD4(f32* pos, s16 state) {
|
|||
}
|
||||
|
||||
void func_8029AC18(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;
|
||||
|
|
|
|||
|
|
@ -407,8 +407,7 @@ Mtx gIdentityMatrix2 = {
|
|||
toFixedPointMatrix(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0),
|
||||
};
|
||||
|
||||
void func_802A487C(Vtx* arg0, UNUSED ScreenContext* arg1, UNUSED s32 arg2, UNUSED s32 arg3,
|
||||
UNUSED f32* arg4) {
|
||||
void func_802A487C(Vtx* arg0) {
|
||||
|
||||
init_rdp();
|
||||
if (!IsRainbowRoad()) {
|
||||
|
|
@ -425,7 +424,7 @@ void func_802A487C(Vtx* arg0, UNUSED ScreenContext* arg1, UNUSED s32 arg2, UNUSE
|
|||
}
|
||||
}
|
||||
|
||||
void func_802A4A0C(Vtx* vtx, ScreenContext* arg1, UNUSED s32 arg2, UNUSED s32 arg3, UNUSED f32* arg4) {
|
||||
void func_802A4A0C(Vtx* vtx, ScreenContext* arg1) {
|
||||
Camera* camera = arg1->camera;
|
||||
s16 temp_t5;
|
||||
f32 temp_f0;
|
||||
|
|
@ -521,22 +520,22 @@ void func_802A4D18(void) {
|
|||
void func_802A4EF4(void) {
|
||||
switch (gActiveScreenMode) {
|
||||
case SCREEN_MODE_1P:
|
||||
func_8001F394(gPlayerOne, &gCameraFOV[0]);
|
||||
func_8001F394(gPlayerOne);
|
||||
break;
|
||||
|
||||
case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL:
|
||||
func_8001F394(gPlayerOne, &gCameraFOV[0]);
|
||||
func_8001F394(gPlayerTwo, &gCameraFOV[1]);
|
||||
func_8001F394(gPlayerOne);
|
||||
func_8001F394(gPlayerTwo);
|
||||
break;
|
||||
case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL:
|
||||
func_8001F394(gPlayerOne, &gCameraFOV[0]);
|
||||
func_8001F394(gPlayerTwo, &gCameraFOV[1]);
|
||||
func_8001F394(gPlayerOne);
|
||||
func_8001F394(gPlayerTwo);
|
||||
break;
|
||||
case SCREEN_MODE_3P_4P_SPLITSCREEN:
|
||||
func_8001F394(gPlayerOne, &gCameraFOV[0]);
|
||||
func_8001F394(gPlayerTwo, &gCameraFOV[1]);
|
||||
func_8001F394(gPlayerThree, &gCameraFOV[2]);
|
||||
func_8001F394(gPlayerFour, &gCameraFOV[3]);
|
||||
func_8001F394(gPlayerOne);
|
||||
func_8001F394(gPlayerTwo);
|
||||
func_8001F394(gPlayerThree);
|
||||
func_8001F394(gPlayerFour);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -552,9 +551,9 @@ void func_802A5004(void) {
|
|||
|
||||
func_802A39E0(gScreenTwoCtx);
|
||||
if (D_800DC5B4 != 0) {
|
||||
func_802A4A0C((Vtx*) D_802B8910, gScreenTwoCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[1]);
|
||||
func_802A4A0C((Vtx*) D_802B8910, gScreenTwoCtx);
|
||||
func_80057FC4(2);
|
||||
func_802A487C((Vtx*) D_802B8910, gScreenTwoCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[1]);
|
||||
func_802A487C((Vtx*) D_802B8910);
|
||||
func_80093A30(2);
|
||||
}
|
||||
}
|
||||
|
|
@ -569,9 +568,9 @@ void func_802A50EC(void) {
|
|||
|
||||
func_802A39E0(gScreenOneCtx);
|
||||
if (D_800DC5B4 != 0) {
|
||||
func_802A4A0C((Vtx*) D_802B8890, gScreenOneCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[0]);
|
||||
func_802A4A0C((Vtx*) D_802B8890, gScreenOneCtx);
|
||||
func_80057FC4(1);
|
||||
func_802A487C((Vtx*) D_802B8890, gScreenOneCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[0]);
|
||||
func_802A487C((Vtx*) D_802B8890);
|
||||
func_80093A30(1);
|
||||
}
|
||||
}
|
||||
|
|
@ -586,9 +585,9 @@ void func_802A51D4(void) {
|
|||
gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING);
|
||||
|
||||
if (D_800DC5B4 != 0) {
|
||||
func_802A4A0C((Vtx*) D_802B8890, gScreenOneCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[0]);
|
||||
func_802A4A0C((Vtx*) D_802B8890, gScreenOneCtx);
|
||||
func_80057FC4(3);
|
||||
func_802A487C((Vtx*) D_802B8890, gScreenOneCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[0]);
|
||||
func_802A487C((Vtx*) D_802B8890);
|
||||
func_80093A30(3);
|
||||
}
|
||||
}
|
||||
|
|
@ -603,9 +602,9 @@ void func_802A52BC(void) {
|
|||
gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING);
|
||||
|
||||
if (D_800DC5B4 != 0) {
|
||||
func_802A4A0C((Vtx*) D_802B8910, gScreenTwoCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[1]);
|
||||
func_802A4A0C((Vtx*) D_802B8910, gScreenTwoCtx);
|
||||
func_80057FC4(4);
|
||||
func_802A487C((Vtx*) D_802B8910, gScreenTwoCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[1]);
|
||||
func_802A487C((Vtx*) D_802B8910);
|
||||
func_80093A30(4);
|
||||
}
|
||||
}
|
||||
|
|
@ -620,11 +619,11 @@ void func_802A53A4(void) {
|
|||
init_z_buffer();
|
||||
select_framebuffer();
|
||||
if (D_800DC5B4 != 0) {
|
||||
func_802A4A0C((Vtx*) D_802B8890, gScreenOneCtx, 0x140, 0xF0, &gCameraFOV[0]);
|
||||
func_802A4A0C((Vtx*) D_802B8890, gScreenOneCtx);
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
func_80057FC4(0);
|
||||
}
|
||||
func_802A487C((Vtx*) D_802B8890, gScreenOneCtx, 0x140, 0xF0, &gCameraFOV[0]);
|
||||
func_802A487C((Vtx*) D_802B8890);
|
||||
func_80093A30(0);
|
||||
}
|
||||
}
|
||||
|
|
@ -639,9 +638,9 @@ void func_802A54A8(void) {
|
|||
gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING);
|
||||
|
||||
if (D_800DC5B4 != 0) {
|
||||
func_802A4A0C((Vtx*) D_802B8890, gScreenOneCtx, 0x140, 0xF0, &gCameraFOV[0]);
|
||||
func_802A4A0C((Vtx*) D_802B8890, gScreenOneCtx);
|
||||
func_80057FC4(8);
|
||||
func_802A487C((Vtx*) D_802B8890, gScreenOneCtx, 0x140, 0xF0, &gCameraFOV[0]);
|
||||
func_802A487C((Vtx*) D_802B8890);
|
||||
func_80093A30(8);
|
||||
}
|
||||
}
|
||||
|
|
@ -656,9 +655,9 @@ void func_802A5590(void) {
|
|||
gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING);
|
||||
|
||||
if (D_800DC5B4 != 0) {
|
||||
func_802A4A0C((Vtx*) D_802B8910, gScreenTwoCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[1]);
|
||||
func_802A4A0C((Vtx*) D_802B8910, gScreenTwoCtx);
|
||||
func_80057FC4(9);
|
||||
func_802A487C((Vtx*) D_802B8910, gScreenTwoCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[1]);
|
||||
func_802A487C((Vtx*) D_802B8910);
|
||||
func_80093A30(9);
|
||||
}
|
||||
}
|
||||
|
|
@ -673,9 +672,9 @@ void func_802A5678(void) {
|
|||
gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING);
|
||||
|
||||
if (D_800DC5B4 != 0) {
|
||||
func_802A4A0C((Vtx*) D_802B8990, gScreenThreeCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[2]);
|
||||
func_802A4A0C((Vtx*) D_802B8990, gScreenThreeCtx);
|
||||
func_80057FC4(10);
|
||||
func_802A487C((Vtx*) D_802B8990, gScreenThreeCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[2]);
|
||||
func_802A487C((Vtx*) D_802B8990);
|
||||
func_80093A30(10);
|
||||
}
|
||||
}
|
||||
|
|
@ -708,9 +707,9 @@ void func_802A5760(void) {
|
|||
func_802A39E0(gScreenFourCtx);
|
||||
|
||||
if (D_800DC5B4 != 0) {
|
||||
func_802A4A0C(D_802B8A10, gScreenFourCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[3]);
|
||||
func_802A4A0C(D_802B8A10, gScreenFourCtx);
|
||||
func_80057FC4(11);
|
||||
func_802A487C(D_802B8A10, gScreenFourCtx, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraFOV[3]);
|
||||
func_802A487C(D_802B8A10);
|
||||
func_80093A30(11);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
/* Function Prototypes */
|
||||
|
||||
void func_802A4A0C(Vtx*, ScreenContext*, s32, s32, f32*);
|
||||
void func_802A4A0C(Vtx*, ScreenContext*);
|
||||
void set_screen(void);
|
||||
void set_editor_screen(void);
|
||||
void func_802A3730(ScreenContext*);
|
||||
|
|
@ -31,7 +31,7 @@ void set_viewport(void);
|
|||
void select_framebuffer(void);
|
||||
void func_802A4300(void);
|
||||
void func_802A450C(Vtx*);
|
||||
void func_802A487C(Vtx*, ScreenContext*, s32, s32, f32*);
|
||||
void func_802A487C(Vtx*);
|
||||
void func_802A4D18(void);
|
||||
void func_802A4EF4(void);
|
||||
void func_802A5004(void);
|
||||
|
|
|
|||
|
|
@ -2532,27 +2532,27 @@ void func_80078C70(s32 arg0) {
|
|||
case 0: /* switch 1 */
|
||||
sp1C = 0;
|
||||
camera = camera1;
|
||||
D_8018D200 = gCameraFOV[0] + 40.0f;
|
||||
D_8018D200 = camera->fieldOfView + 40.0f;
|
||||
break;
|
||||
case 1: /* switch 1 */
|
||||
sp1C = 0;
|
||||
camera = camera1;
|
||||
D_8018D200 = gCameraFOV[0] + 40.0f;
|
||||
D_8018D200 = camera->fieldOfView + 40.0f;
|
||||
break;
|
||||
case 2: /* switch 1 */
|
||||
camera = camera2;
|
||||
sp1C = D_8018D1F0;
|
||||
D_8018D200 = gCameraFOV[1] + 40.0f;
|
||||
D_8018D200 = camera->fieldOfView + 40.0f;
|
||||
break;
|
||||
case 3: /* switch 1 */
|
||||
sp1C = 0;
|
||||
camera = camera1;
|
||||
D_8018D200 = gCameraFOV[0] + 40.0f;
|
||||
D_8018D200 = camera->fieldOfView + 40.0f;
|
||||
break;
|
||||
case 4: /* switch 1 */
|
||||
camera = camera2;
|
||||
sp1C = D_8018D1F0;
|
||||
D_8018D200 = gCameraFOV[1] + 40.0f;
|
||||
D_8018D200 = camera->fieldOfView + 40.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue