refresh 6

This commit is contained in:
n64 committed 2020-02-03 00:51:26 -05:00
1 parent 9273f38df1
commit 9a801cb96d
236 files changed
+17101 -4820

No files matched your search

+13 -17
View File
@@ -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;