You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
some surface_terrains.h defines
This commit is contained in:
@@ -154,18 +154,29 @@
|
||||
#define SURFACE_WOBBLING_WARP 0x00FD // Pool warp (HMC & DDD)
|
||||
#define SURFACE_TRAPDOOR 0x00FF // Bowser Left trapdoor, has no action defined
|
||||
|
||||
#define SURFACE_IS_QUICKSAND(cmd) (cmd >= 0x21 && cmd < 0x28) // Doesn't include SURFACE_INSTANT_MOVING_QUICKSAND
|
||||
#define SURFACE_IS_NOT_HARD(cmd) (cmd != SURFACE_HARD && \
|
||||
!(cmd >= 0x35 && cmd <= 0x37))
|
||||
#define SURFACE_IS_PAINTING_WARP(cmd) (cmd >= 0xD3 && cmd < 0xFD)
|
||||
#define SURFACE_IS_NEW_WATER(cmd) (cmd == SURFACE_NEW_WATER || cmd == SURFACE_NEW_WATER_BOTTOM)
|
||||
#define SURFACE_IS_QUICKSAND(cmd) (cmd >= SURFACE_SHALLOW_QUICKSAND && cmd <= SURFACE_MOVING_QUICKSAND || cmd == SURFACE_INSTANT_MOVING_QUICKSAND)
|
||||
#define SURFACE_IS_NOT_HARD(cmd) (cmd != SURFACE_HARD && !(cmd >= SURFACE_HARD_SLIPPERY && cmd <= SURFACE_HARD_NOT_SLIPPERY))
|
||||
#define SURFACE_IS_PAINTING_WOBBLE(cmd) (cmd >= SURFACE_PAINTING_WOBBLE_A6 && cmd <= SURFACE_PAINTING_WOBBLE_D2)
|
||||
#define SURFACE_IS_PAINTING_WOBBLE_LEFT(cmd) (((cmd - SURFACE_PAINTING_WOBBLE_A6) % 3) == 0)
|
||||
#define SURFACE_IS_PAINTING_WOBBLE_MIDDLE(cmd) (((cmd - SURFACE_PAINTING_WOBBLE_A7) % 3) == 0)
|
||||
#define SURFACE_IS_PAINTING_WOBBLE_RIGHT(cmd) (((cmd - SURFACE_PAINTING_WOBBLE_A8) % 3) == 0)
|
||||
#define SURFACE_IS_PAINTING_WARP(cmd) (cmd >= SURFACE_PAINTING_WARP_D3 && cmd < SURFACE_WOBBLING_WARP) // skips SURFACE_WOBBLING_WARP
|
||||
#define SURFACE_IS_PAINTING_WARP_LEFT(cmd) (((cmd - SURFACE_PAINTING_WARP_D3 ) % 3) == 0)
|
||||
#define SURFACE_IS_PAINTING_WARP_MIDDLE(cmd) (((cmd - SURFACE_PAINTING_WARP_D4 ) % 3) == 0)
|
||||
#define SURFACE_IS_PAINTING_WARP_RIGHT(cmd) (((cmd - SURFACE_PAINTING_WARP_D5 ) % 3) == 0)
|
||||
#define SURFACE_IS_INSTANT_WARP(cmd) (cmd >= SURFACE_INSTANT_WARP_1B && cmd <= SURFACE_INSTANT_WARP_1E)
|
||||
#define SURFACE_IS_WARP(cmd) (SURFACE_IS_PAINTING_WARP(cmd) || SURFACE_IS_INSTANT_WARP(cmd) || cmd == SURFACE_LOOK_UP_WARP || cmd == SURFACE_WOBBLING_WARP)
|
||||
#define SURFACE_IS_UNSAFE(cmd) (SURFACE_IS_QUICKSAND(cmd)|| cmd == SURFACE_BURNING)
|
||||
|
||||
#define SURFACE_CLASS_DEFAULT 0x0000
|
||||
#define SURFACE_CLASS_VERY_SLIPPERY 0x0013
|
||||
#define SURFACE_CLASS_SLIPPERY 0x0014
|
||||
#define SURFACE_CLASS_NOT_SLIPPERY 0x0015
|
||||
|
||||
#define SURFACE_FLAG_DYNAMIC (1 << 0)
|
||||
#define SURFACE_FLAG_NO_CAM_COLLISION (1 << 1)
|
||||
#define SURFACE_FLAGS_NONE (0 << 0) // 0x0000
|
||||
#define SURFACE_FLAG_DYNAMIC (1 << 0) // 0x0001
|
||||
#define SURFACE_FLAG_NO_CAM_COLLISION (1 << 1) // 0x0002
|
||||
|
||||
// These are effectively unique "surface" types like those defined higher
|
||||
// And they are used as collision commands to load certain functions
|
||||
|
||||
@@ -55,7 +55,7 @@ static s32 find_wall_collisions_from_list(struct SurfaceNode *surfaceNode, struc
|
||||
surfaceNode = surfaceNode->next;
|
||||
type = surf->type;
|
||||
// Exclude a large number of walls immediately to optimize.
|
||||
if ((type == SURFACE_NEW_WATER) || (type == SURFACE_NEW_WATER_BOTTOM)) continue;
|
||||
if (SURFACE_IS_NEW_WATER(type)) continue;
|
||||
// Determine if checking for the camera or not.
|
||||
if (gCheckingSurfaceCollisionsForCamera) {
|
||||
if (surf->flags & SURFACE_FLAG_NO_CAM_COLLISION) continue;
|
||||
@@ -227,7 +227,7 @@ static struct Surface *find_ceil_from_list(struct SurfaceNode *surfaceNode, s32
|
||||
surfaceNode = surfaceNode->next;
|
||||
type = surf->type;
|
||||
// Determine if checking for the camera or not.
|
||||
if (type == SURFACE_NEW_WATER || type == SURFACE_NEW_WATER_BOTTOM) continue;
|
||||
if (SURFACE_IS_NEW_WATER(type)) continue;
|
||||
if (gCheckingSurfaceCollisionsForCamera) {
|
||||
if (surf->flags & SURFACE_FLAG_NO_CAM_COLLISION) continue;
|
||||
} else if (type == SURFACE_CAMERA_BOUNDARY) {
|
||||
@@ -345,7 +345,7 @@ static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32
|
||||
if (!gFindFloorIncludeSurfaceIntangible && (type == SURFACE_INTANGIBLE)) continue;
|
||||
// Determine if we are checking for the camera or not.
|
||||
if (gCheckingSurfaceCollisionsForCamera) {
|
||||
if ((surf->flags & SURFACE_FLAG_NO_CAM_COLLISION) || (surf->type == SURFACE_NEW_WATER) || (surf->type == SURFACE_NEW_WATER_BOTTOM)) continue;
|
||||
if ((surf->flags & SURFACE_FLAG_NO_CAM_COLLISION) || SURFACE_IS_NEW_WATER(type)) continue;
|
||||
} else if (surf->type == SURFACE_CAMERA_BOUNDARY) {
|
||||
continue; // If we are not checking for the camera, ignore camera only floors.
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ static void add_surface_to_cell(s32 dynamic, s32 cellX, s32 cellZ, struct Surfac
|
||||
s32 priority;
|
||||
s32 sortDir;
|
||||
s32 listIndex;
|
||||
s32 isWater = surface->type == SURFACE_NEW_WATER || surface->type == SURFACE_NEW_WATER_BOTTOM;
|
||||
s32 isWater = SURFACE_IS_NEW_WATER(surface->type);
|
||||
|
||||
if (surface->normal.y > 0.01) {
|
||||
listIndex = isWater ? SPATIAL_PARTITION_WATER : SPATIAL_PARTITION_FLOORS;
|
||||
|
||||
@@ -301,7 +301,7 @@ static s32 perform_ground_quarter_step(struct MarioState *m, Vec3f nextPos) {
|
||||
}
|
||||
|
||||
vec3f_set(m->pos, nextPos[0], floorHeight, nextPos[2]);
|
||||
if (!SURFACE_IS_QUICKSAND(floor->type) && (floor->type != SURFACE_BURNING)) vec3_copy(m->lastSafePos, m->pos);
|
||||
if (!SURFACE_IS_UNSAFE(floor->type)) vec3_copy(m->lastSafePos, m->pos);
|
||||
set_mario_floor(m, floor, floorHeight);
|
||||
|
||||
if (m->wall != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user