2020-06-02 16:44:34 +00:00
|
|
|
#ifndef SURFACE_LOAD_H
|
|
|
|
#define SURFACE_LOAD_H
|
|
|
|
|
|
|
|
#include <PR/ultratypes.h>
|
2019-08-25 04:46:40 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-02-19 04:27:10 +00:00
|
|
|
// NUM_CELLS needs to be a power of 2 so that the bitwise
|
|
|
|
// in surface_collision.c functions can work properly
|
|
|
|
#define NUM_CELLS 16
|
|
|
|
|
2019-08-25 04:46:40 +00:00
|
|
|
struct SurfaceNode
|
|
|
|
{
|
|
|
|
struct SurfaceNode *next;
|
|
|
|
struct Surface *surface;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
SPATIAL_PARTITION_FLOORS,
|
|
|
|
SPATIAL_PARTITION_CEILS,
|
|
|
|
SPATIAL_PARTITION_WALLS
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct SurfaceNode SpatialPartitionCell[3];
|
|
|
|
|
|
|
|
// Needed for bs bss reordering memes.
|
|
|
|
extern s32 unused8038BE90;
|
|
|
|
|
2022-02-19 04:27:10 +00:00
|
|
|
extern SpatialPartitionCell gStaticSurfacePartition[NUM_CELLS][NUM_CELLS];
|
|
|
|
extern SpatialPartitionCell gDynamicSurfacePartition[NUM_CELLS][NUM_CELLS];
|
2019-08-25 04:46:40 +00:00
|
|
|
extern struct SurfaceNode *sSurfaceNodePool;
|
|
|
|
extern struct Surface *sSurfacePool;
|
|
|
|
extern s16 sSurfacePoolSize;
|
|
|
|
|
|
|
|
void alloc_surface_pools(void);
|
2020-05-13 11:57:25 +00:00
|
|
|
|
2020-05-07 18:21:22 +00:00
|
|
|
u32 get_area_terrain_size(s16 *data);
|
2020-05-13 11:57:25 +00:00
|
|
|
|
2019-08-25 04:46:40 +00:00
|
|
|
void load_area_terrain(s16 index, s16 *data, s8 *surfaceRooms, s16 *macroObjects);
|
|
|
|
void clear_dynamic_surfaces(void);
|
|
|
|
void load_object_collision_model(void);
|
|
|
|
|
2020-06-02 16:44:34 +00:00
|
|
|
#endif // SURFACE_LOAD_H
|