You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Farclip failsafe
This commit is contained in:
@@ -417,6 +417,8 @@ void geo_process_perspective(struct GraphNodePerspective *node) {
|
||||
}
|
||||
if (node->fnNode.node.children != NULL) {
|
||||
u16 perspNorm;
|
||||
f32 farClip = node->far;
|
||||
f32 farClipDelta = farClip;
|
||||
Mtx *mtx = alloc_display_list(sizeof(*mtx));
|
||||
#ifdef WIDE
|
||||
if (gConfig.widescreen && (gCurrLevelNum != 0x01)){
|
||||
@@ -434,7 +436,14 @@ void geo_process_perspective(struct GraphNodePerspective *node) {
|
||||
} else {
|
||||
gWorldScale = 1.0f;
|
||||
}
|
||||
guPerspective(mtx, &perspNorm, node->fov, sAspectRatio, ((node->far / 300) / gWorldScale), (node->far / gWorldScale), 1.0f);
|
||||
farClip = CLAMP(farClip / gWorldScale, 4096, 61440);
|
||||
if (farClip / farClipDelta != 1)
|
||||
{
|
||||
farClipDelta /= farClip;
|
||||
gWorldScale *= farClipDelta;
|
||||
}
|
||||
|
||||
guPerspective(mtx, &perspNorm, node->fov, sAspectRatio, ((farClip / 300) / gWorldScale), (farClip / gWorldScale), 1.0f);
|
||||
gSPPerspNormalize(gDisplayListHead++, perspNorm);
|
||||
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx), (G_MTX_PROJECTION | G_MTX_LOAD | G_MTX_NOPUSH));
|
||||
gCurGraphNodeCamFrustum = node;
|
||||
|
||||
Reference in New Issue
Block a user