Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/src/engine/surface_load.h
7857 views
1
#ifndef SURFACE_LOAD_H
2
#define SURFACE_LOAD_H
3
4
#include <PR/ultratypes.h>
5
6
#include "surface_collision.h"
7
#include "types.h"
8
9
#define NUM_CELLS (2 * LEVEL_BOUNDARY_MAX / CELL_SIZE)
10
#define NUM_CELLS_INDEX (NUM_CELLS - 1)
11
12
struct SurfaceNode
13
{
14
struct SurfaceNode *next;
15
struct Surface *surface;
16
};
17
18
enum
19
{
20
SPATIAL_PARTITION_FLOORS,
21
SPATIAL_PARTITION_CEILS,
22
SPATIAL_PARTITION_WALLS
23
};
24
25
typedef struct SurfaceNode SpatialPartitionCell[3];
26
27
// Needed for bs bss reordering memes.
28
extern s32 unused8038BE90;
29
30
extern SpatialPartitionCell gStaticSurfacePartition[NUM_CELLS][NUM_CELLS];
31
extern SpatialPartitionCell gDynamicSurfacePartition[NUM_CELLS][NUM_CELLS];
32
extern struct SurfaceNode *sSurfaceNodePool;
33
extern struct Surface *sSurfacePool;
34
extern s16 sSurfacePoolSize;
35
36
void alloc_surface_pools(void);
37
#ifdef NO_SEGMENTED_MEMORY
38
u32 get_area_terrain_size(s16 *data);
39
#endif
40
void load_area_terrain(s16 index, s16 *data, s8 *surfaceRooms, s16 *macroObjects);
41
void clear_dynamic_surfaces(void);
42
void load_object_collision_model(void);
43
44
#endif // SURFACE_LOAD_H
45
46