mirror of
https://github.com/BanjoRecomp/BanjoRecomp
synced 2026-07-29 23:36:53 -04:00
Lower interpolation threshold for first beach cutscene. Skip interpolation on lens flare when camera skips.
This commit is contained in:
@@ -201,6 +201,16 @@ void func_802BB4D8(f32 position[3], f32 rotation[3]);
|
||||
void func_802BEFB0(void);
|
||||
void func_802BBA84(void);
|
||||
|
||||
f32 get_camera_skip_threshold() {
|
||||
switch (map_get()) {
|
||||
case MAP_94_CS_INTRO_SPIRAL_7:
|
||||
case MAP_96_CS_END_BEACH_1:
|
||||
return 50.0f;
|
||||
default:
|
||||
return 100.0f;
|
||||
}
|
||||
}
|
||||
|
||||
// @recomp Patched to detect camera type changes or sudden camera movements and skip perspective interpolation when they happen.
|
||||
RECOMP_PATCH void ncCamera_update(void) {
|
||||
f32 vpPos[3];
|
||||
@@ -251,8 +261,7 @@ RECOMP_PATCH void ncCamera_update(void) {
|
||||
ml_vec3f_add(vpPosProjected, vpPosPrev, vpPosVel);
|
||||
|
||||
f32 distToProjected = ml_vec3f_distance(vpPos, vpPosProjected);
|
||||
const f32 SkipThreshold = (map_get() == MAP_94_CS_INTRO_SPIRAL_7) ? 50.0f : 100.0f;
|
||||
if (distToProjected > SkipThreshold) {
|
||||
if (distToProjected > get_camera_skip_threshold()) {
|
||||
ml_vec3f_clear(vpPosVel);
|
||||
skip_perspective_interpolation = TRUE;
|
||||
}
|
||||
|
||||
@@ -153,11 +153,13 @@ RECOMP_PATCH void func_80350818(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
|
||||
|
||||
// @recomp Set the model transform ID before drawing the lens flare.
|
||||
cur_drawn_model_transform_id = LENS_FLARE_TRANSFORM_ID_START + LENS_FLARE_TRANSFORM_ID_COUNT * i;
|
||||
cur_drawn_model_skip_interpolation = perspective_interpolation_skipped();
|
||||
|
||||
modelRender_draw(gfx, mtx, spB8, spD0, temp_s2->unk4[i].unk14 * 0.25, NULL, D_80386170.unk8);
|
||||
|
||||
// @recomp Clear the model transform ID after drawing the lens flare.
|
||||
cur_drawn_model_transform_id = 0;
|
||||
cur_drawn_model_skip_interpolation = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user