refresh 6
This commit is contained in:
1 parent
9273f38df1
commit
9a801cb96d
236 files changed
+17101
-4820
No files matched your search
@@ -44,6 +44,7 @@ GeoLayoutCommandProc GeoLayoutJumpTable[] = {
|
||||
geo_layout_cmd_node_culling_radius,
|
||||
};
|
||||
|
||||
struct GraphNode gObjParentGraphNode;
|
||||
struct AllocOnlyPool *gGraphNodePool;
|
||||
struct GraphNode *gCurRootGraphNode;
|
||||
|
||||
@@ -98,7 +99,6 @@ s16 gGeoLayoutStackIndex; // similar to SP register in MIPS
|
||||
UNUSED s16 D_8038BD7C;
|
||||
s16 gGeoLayoutReturnIndex; // similar to RA register in MIPS
|
||||
u8 *gGeoLayoutCommand;
|
||||
struct GraphNode gObjParentGraphNode;
|
||||
|
||||
u32 unused_8038B894[3] = { 0 };
|
||||
|
||||
|
||||
@@ -372,7 +372,11 @@ static void level_cmd_end_area(void) {
|
||||
|
||||
static void level_cmd_load_model_from_dl(void) {
|
||||
s16 val1 = CMD_GET(s16, 2) & 0x0FFF;
|
||||
#ifdef VERSION_EU
|
||||
s16 val2 = (CMD_GET(s16, 2) & 0xFFFF) >> 12;
|
||||
#else
|
||||
s16 val2 = CMD_GET(u16, 2) >> 12;
|
||||
#endif
|
||||
void *val3 = CMD_GET(void *, 4);
|
||||
|
||||
if (val1 < 256) {
|
||||
@@ -401,7 +405,11 @@ static void level_cmd_23(void) {
|
||||
} arg2;
|
||||
|
||||
s16 model = CMD_GET(s16, 2) & 0x0FFF;
|
||||
#ifdef VERSION_EU
|
||||
s16 arg0H = (CMD_GET(s16, 2) & 0xFFFF) >> 12;
|
||||
#else
|
||||
s16 arg0H = CMD_GET(u16, 2) >> 12;
|
||||
#endif
|
||||
void *arg1 = CMD_GET(void *, 4);
|
||||
// load an f32, but using an integer load instruction for some reason (hence the union)
|
||||
arg2.i = CMD_GET(s32, 8);
|
||||
|
||||
@@ -159,17 +159,12 @@ void mtxf_copy(Mat4 dest, Mat4 src) {
|
||||
void mtxf_identity(Mat4 mtx) {
|
||||
register s32 i;
|
||||
register f32 *dest;
|
||||
|
||||
// Note: These loops need to be on one line to match on PAL
|
||||
// initialize everything except the first and last cells to 0
|
||||
// (this need to be on one line to match on PAL)
|
||||
for (dest = (f32 *) mtx + 1, i = 0; i < 14; dest++, i++) {
|
||||
*dest = 0;
|
||||
}
|
||||
for (dest = (f32 *) mtx + 1, i = 0; i < 14; dest++, i++) *dest = 0;
|
||||
|
||||
// initialize the diagonal cells to 1
|
||||
for (dest = (f32 *) mtx, i = 0; i < 4; dest += 5, i++) {
|
||||
*dest = 1;
|
||||
}
|
||||
for (dest = (f32 *) mtx, i = 0; i < 4; dest += 5, i++) *dest = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "surface_collision.h"
|
||||
#include "surface_load.h"
|
||||
#include "game/object_list_processor.h"
|
||||
#include "game/room.h"
|
||||
|
||||
/**************************************************
|
||||
* WALLS *
|
||||
@@ -21,6 +20,9 @@
|
||||
*/
|
||||
static s32 find_wall_collisions_from_list(struct SurfaceNode *surfaceNode,
|
||||
struct WallCollisionData *data) {
|
||||
#ifdef VERSION_EU
|
||||
UNUSED u8 pad;
|
||||
#endif
|
||||
register f32 offset;
|
||||
register f32 radius = data->radius;
|
||||
register struct Surface *surf;
|
||||
@@ -60,12 +62,8 @@ static s32 find_wall_collisions_from_list(struct SurfaceNode *surfaceNode,
|
||||
// the fact they are floating point, certain floating point positions
|
||||
// along the seam of two walls may collide with neither wall or both walls.
|
||||
if (surf->flags & SURFACE_FLAG_X_PROJECTION) {
|
||||
w1 = -surf->vertex1[2];
|
||||
w2 = -surf->vertex2[2];
|
||||
w3 = -surf->vertex3[2];
|
||||
y1 = surf->vertex1[1];
|
||||
y2 = surf->vertex2[1];
|
||||
y3 = surf->vertex3[1];
|
||||
w1 = -surf->vertex1[2]; w2 = -surf->vertex2[2]; w3 = -surf->vertex3[2];
|
||||
y1 = surf->vertex1[1]; y2 = surf->vertex2[1]; y3 = surf->vertex3[1];
|
||||
|
||||
if (surf->normal.x > 0.0f) {
|
||||
if ((y1 - y) * (w2 - w1) - (w1 - -pz) * (y2 - y1) > 0.0f) {
|
||||
@@ -89,12 +87,8 @@ static s32 find_wall_collisions_from_list(struct SurfaceNode *surfaceNode,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
w1 = surf->vertex1[0];
|
||||
w2 = surf->vertex2[0];
|
||||
w3 = surf->vertex3[0];
|
||||
y1 = surf->vertex1[1];
|
||||
y2 = surf->vertex2[1];
|
||||
y3 = surf->vertex3[1];
|
||||
w1 = surf->vertex1[0]; w2 = surf->vertex2[0]; w3 = surf->vertex3[0];
|
||||
y1 = surf->vertex1[1]; y2 = surf->vertex2[1]; y3 = surf->vertex3[1];
|
||||
|
||||
if (surf->normal.z > 0.0f) {
|
||||
if ((y1 - y) * (w2 - w1) - (w1 - px) * (y2 - y1) > 0.0f) {
|
||||
@@ -370,7 +364,7 @@ f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) {
|
||||
/**
|
||||
* Find the height of the highest floor below an object.
|
||||
*/
|
||||
static f32 unused_obj_find_floor_height(struct Object *obj) {
|
||||
f32 unused_obj_find_floor_height(struct Object *obj) {
|
||||
struct Surface *floor;
|
||||
f32 floorHeight = find_floor(obj->oPosX, obj->oPosY, obj->oPosZ, &floor);
|
||||
return floorHeight;
|
||||
@@ -496,7 +490,7 @@ f32 find_floor_height(f32 x, f32 y, f32 z) {
|
||||
* Find the highest dynamic floor under a given position. Perhaps originally static and
|
||||
* and dynamic floors were checked separately.
|
||||
*/
|
||||
static f32 unused_find_dynamic_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
|
||||
f32 unused_find_dynamic_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
|
||||
struct SurfaceNode *surfaceList;
|
||||
struct Surface *floor;
|
||||
f32 floorHeight = -11000.0f;
|
||||
@@ -749,10 +743,12 @@ void debug_surface_list_info(f32 xPos, f32 zPos) {
|
||||
* An unused function that finds and interacts with any type of surface.
|
||||
* Perhaps an original implementation of surfaces before they were more specialized.
|
||||
*/
|
||||
static s32 unused_resolve_floor_or_ceil_collisions(s32 checkCeil, f32 *px, f32 *py, f32 *pz, f32 radius,
|
||||
s32 unused_resolve_floor_or_ceil_collisions(s32 checkCeil, f32 *px, f32 *py, f32 *pz, f32 radius,
|
||||
struct Surface **psurface, f32 *surfaceHeight) {
|
||||
f32 nx, ny, nz, oo;
|
||||
f32 x = *px, y = *py, z = *pz;
|
||||
f32 x = *px;
|
||||
f32 y = *py;
|
||||
f32 z = *pz;
|
||||
f32 offset, distance;
|
||||
|
||||
*psurface = NULL;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "surface_collision.h"
|
||||
#include "game/mario.h"
|
||||
#include "game/object_list_processor.h"
|
||||
#include "game/room.h"
|
||||
#include "surface_load.h"
|
||||
|
||||
s32 unused8038BE90;
|
||||
@@ -601,17 +600,19 @@ static void unused_80383604(void) {
|
||||
/**
|
||||
* Applies an object's tranformation to the object's vertices.
|
||||
*/
|
||||
static void transform_object_vertices(s16 **data, s16 *vertexData) {
|
||||
void transform_object_vertices(s16 **data, s16 *vertexData) {
|
||||
register s16 *vertices;
|
||||
|
||||
#ifdef VERSION_EU
|
||||
register f32 vx, vy, vz;
|
||||
register s32 numVertices;
|
||||
|
||||
register f32 vx;
|
||||
register f32 vy;
|
||||
register f32 vz;
|
||||
#else
|
||||
register s32 numVertices;
|
||||
register f32 vx, vy, vz;
|
||||
#endif
|
||||
|
||||
Mat4 *objectTransform;
|
||||
Mat4 m;
|
||||
UNUSED s16 unused;
|
||||
|
||||
objectTransform = &gCurrentObject->transform;
|
||||
|
||||
@@ -646,7 +647,7 @@ static void transform_object_vertices(s16 **data, s16 *vertexData) {
|
||||
* Load in the surfaces for the gCurrentObject. This includes setting the flags,
|
||||
* exertion, and room.
|
||||
*/
|
||||
static void load_object_surfaces(s16 **data, s16 *vertexData) {
|
||||
void load_object_surfaces(s16 **data, s16 *vertexData) {
|
||||
s32 surfaceType;
|
||||
s32 i;
|
||||
s32 numSurfaces;
|
||||
|
||||
Reference in new issue
Block a user