#ifndef GAME_COLLISION_H
#define GAME_COLLISION_H

#include <stdbool.h>
#include "sys/sys.h"

#define TILE_SZ_MICROPIXEL 0x800
#define PIXEL_SZ_MICROPIXEL 0x100

typedef struct {
    sys_i32 x_origin;
    sys_i32 y_origin;
    sys_i32 x;
    sys_i32 y;
    sys_i32 w;
    sys_i32 h;
} game_bbox;

typedef struct {
    bool collided_x;
    bool collided_y;
    sys_i32 distance_x;
    sys_i32 distance_y;
} game_collision;

bool game_collision_is_occlusive(sys_maptile tile);
bool game_collision_can_move(game_bbox body, sys_i32 dx, sys_i32 dy);
game_collision game_collision_move_to_contact(game_bbox* body, sys_i32 x, sys_i32 y);

#endif  // GAME_COLLISION_H