49 lines
913 B
C
49 lines
913 B
C
#ifndef HANDMADE_TILE_H_SENTRY
|
|
#define HANDMADE_TILE_H_SENTRY
|
|
|
|
#include "handmade_math.h"
|
|
|
|
struct tile_map_difference {
|
|
struct v2 d_xy;
|
|
float d_z;
|
|
};
|
|
|
|
struct tile_map_position {
|
|
unsigned int abs_tile_x;
|
|
unsigned int abs_tile_y;
|
|
unsigned int abs_tile_z;
|
|
|
|
/* NOTE: X and Y relative to tile center. */
|
|
struct v2 offset;
|
|
};
|
|
|
|
struct tile_chunk_position {
|
|
unsigned int tile_chunk_x;
|
|
unsigned int tile_chunk_y;
|
|
unsigned int tile_chunk_z;
|
|
|
|
unsigned int rel_tile_x;
|
|
unsigned int rel_tile_y;
|
|
};
|
|
|
|
struct tile_chunk {
|
|
unsigned int *tiles;
|
|
};
|
|
|
|
struct tile_map {
|
|
unsigned int chunk_shift;
|
|
unsigned int chunk_mask;
|
|
unsigned int chunk_dim;
|
|
|
|
float tile_side_in_meters;
|
|
|
|
/* TODO: Real sparseness. */
|
|
unsigned int tile_chunk_count_x;
|
|
unsigned int tile_chunk_count_y;
|
|
unsigned int tile_chunk_count_z;
|
|
|
|
struct tile_chunk *tile_chunks;
|
|
};
|
|
|
|
#endif
|