Make World scale automatic
This commit is contained in:
1 parent
6173fe01f2
commit
5bb14224f7
4 files changed
+13
-5
No files matched your search
+3
-3
@@ -101,7 +101,7 @@
|
||||
//Adds multiple languages to the game. Just a placeholder for the most part, because it only works with EU, and must be enabled with EU.
|
||||
#define MULTILANG (0 || VERSION_EU)
|
||||
//Enables Puppy Camera 2, a rewritten camera that can be freely configured and modified.
|
||||
//#define PUPPYCAM
|
||||
#define PUPPYCAM
|
||||
|
||||
|
||||
// HACKER QOL
|
||||
@@ -116,8 +116,8 @@
|
||||
// Custom debug mode. Press DPAD left to show the debug UI. Press DPAD right to enter the noclip mode.
|
||||
//#define CUSTOM_DEBUG
|
||||
// Include Puppyprint, a display library for text and large images. Also includes a custom, enhanced performance profiler.
|
||||
//#define PUPPYPRINT
|
||||
#define PUPPYPRINT_DEBUG 0
|
||||
#define PUPPYPRINT
|
||||
#define PUPPYPRINT_DEBUG 1
|
||||
//Visual debug enables some collision visuals. Tapping Right on the dpad will cycle between visual hitboxes, visual surfaces, both, and neither.
|
||||
//If puppyprint is enabled, then this can be cycled only while the screen is active.
|
||||
//#define VISUAL_DEBUG
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "trig_tables.inc.c"
|
||||
#include "surface_load.h"
|
||||
#include "game/puppyprint.h"
|
||||
#include "game/rendering_graph_node.h"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
@@ -583,7 +584,7 @@ void mtxf_to_mtx(Mtx *dest, Mat4 src) {
|
||||
|
||||
for( i = 0; i < 4; i++ ) {
|
||||
for( j = 0; j < 3; j++ ) {
|
||||
temp[i][j] = src[i][j] / WORLD_SCALE;
|
||||
temp[i][j] = src[i][j] / gWorldScale;
|
||||
}
|
||||
temp[i][3] = src[i][3];
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ s16 gMatStackIndex;
|
||||
Mat4 gMatStack[32];
|
||||
Mtx *gMatStackFixed[32];
|
||||
f32 aspect;
|
||||
f32 gWorldScale = 1.0f;
|
||||
|
||||
/**
|
||||
* Animation nodes have state in global variables, so this struct captures
|
||||
@@ -259,7 +260,12 @@ static void geo_process_perspective(struct GraphNodePerspective *node) {
|
||||
aspect = 1.33333f;
|
||||
#endif
|
||||
|
||||
guPerspective(mtx, &perspNorm, node->fov, aspect, node->near / WORLD_SCALE, node->far / WORLD_SCALE, 1.0f);
|
||||
if (gCurrLevelNum > 3)
|
||||
gWorldScale = MAX(((gCamera->pos[0] * gCamera->pos[0]) + (gCamera->pos[1] * gCamera->pos[1]) + (gCamera->pos[2] * gCamera->pos[2]))/67108864, 1.0f);
|
||||
else
|
||||
gWorldScale = 1.0f;
|
||||
|
||||
guPerspective(mtx, &perspNorm, node->fov, aspect, node->near / gWorldScale, node->far / gWorldScale, 1.0f);
|
||||
gSPPerspNormalize(gDisplayListHead++, perspNorm);
|
||||
|
||||
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx), G_MTX_PROJECTION | G_MTX_LOAD | G_MTX_NOPUSH);
|
||||
|
||||
@@ -12,6 +12,7 @@ extern struct GraphNodeCamera *gCurGraphNodeCamera;
|
||||
extern struct GraphNodeObject *gCurGraphNodeObject;
|
||||
extern struct GraphNodeHeldObject *gCurGraphNodeHeldObject;
|
||||
extern u16 gAreaUpdateCounter;
|
||||
extern f32 gWorldScale;
|
||||
|
||||
// after processing an object, the type is reset to this
|
||||
#define ANIM_TYPE_NONE 0
|
||||
|
||||
Reference in new issue
Block a user