summaryrefslogtreecommitdiff
path: root/src/room.h
blob: 23aca004e0d3eca98a9d56b78f3f79eec22ff65f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef TAKETHIS_INCLUDED_ROOM
#define TAKETHIS_INCLUDED_ROOM

#include "body.h"
#include <SDL2/SDL.h>

#define TT_ROOM_W 20
#define TT_ROOM_H 16

typedef struct tt_room {
    SDL_Rect *      floor[TT_ROOM_H][TT_ROOM_W];
    tt_body *       walls[TT_ROOM_H][TT_ROOM_W];
    tt_body *       bodies;
    int             bodies_count;
    struct tt_room *neighbours[4];
} tt_room;

void tt_room_draw_background(tt_room *room);
void tt_room_draw_foreground(tt_room *room);

int tt_room_collide(tt_room *room, SDL_Rect *box);

int tt_room_out(tt_room *room, SDL_Rect *box);

#endif