summaryrefslogtreecommitdiff
path: root/src/room.h
blob: f1f9ba263652bcfdb95f13f98354c0f3ea8669ad (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
26
27
28
29
#ifndef TAKETHIS_INCLUDED_ROOM
#define TAKETHIS_INCLUDED_ROOM


#include <SDL2/SDL.h>
#include "body.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