]> git.lizzy.rs Git - nothing.git/blob - src/game/level/platforms.h
Make platforms a transparent entity
[nothing.git] / src / game / level / platforms.h
1 #ifndef PLATFORMS_H_
2 #define PLATFORMS_H_
3
4 #include <SDL.h>
5
6 #include "game/camera.h"
7 #include "math/rect.h"
8
9 typedef struct RectLayer RectLayer;
10
11 typedef struct {
12     Rect *rects;
13     Color *colors;
14     size_t rects_size;
15 } Platforms;
16
17 Platforms create_platforms_from_rect_layer(const RectLayer *layer);
18 void destroy_platforms(Platforms platforms);
19
20 int platforms_render(const Platforms *platforms,
21                      const Camera *camera);
22
23 void platforms_touches_rect_sides(const Platforms *platforms,
24                                   Rect object,
25                                   int sides[RECT_SIDE_N]);
26 Vec2f platforms_snap_rect(const Platforms *platforms,
27                           Rect *object);
28
29 #endif  // PLATFORMS_H_