Made widescreen toggleable in config.h. Also made the widescreen variable global while I'm at it.

This commit is contained in:
Reonu committed 2021-05-26 14:41:46 +01:00
1 parent bdf81ba882
commit 84d4c8b84b
7 files changed
+53 -25

No files matched your search

+6 -7
View File
@@ -10,6 +10,7 @@
#include "rendering_graph_node.h"
#include "shadow.h"
#include "sm64.h"
#include "game_init.h"
#define WIDESCREEN
/**
@@ -237,7 +238,6 @@ static void geo_process_ortho_projection(struct GraphNodeOrthoProjection *node)
/**
* Process a perspective projection node.
*/
extern u8 widescreen;
static void geo_process_perspective(struct GraphNodePerspective *node) {
if (node->fnNode.func != NULL) {
node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, gMatStack[gMatStackIndex]);
@@ -245,17 +245,16 @@ static void geo_process_perspective(struct GraphNodePerspective *node) {
if (node->fnNode.node.children != NULL) {
u16 perspNorm;
Mtx *mtx = alloc_display_list(sizeof(*mtx));
#ifdef VERSION_EU
f32 aspect = ((f32) gCurGraphNodeRoot->width / (f32) gCurGraphNodeRoot->height) * 1.1f;
#else
if (widescreen == 1){
#ifdef WIDE
if (gWidescreen){
aspect = 1.775f;
}
else{
aspect = 1.33333f;
}
#endif
#else
aspect = 1.33333f;
#endif
guPerspective(mtx, &perspNorm, node->fov, aspect, node->near / WORLD_SCALE, node->far / WORLD_SCALE, 1.0f);
gSPPerspNormalize(gDisplayListHead++, perspNorm);