Doxygen Samurai Engine 0.0.1
Doxygen Samurai Engine Documentation
Loading...
Searching...
No Matches
marioCommon.cpp
Go to the documentation of this file.
1#include "marioCommon.h"
2
3
4
5bool isSolid(int id)
6{
7 return(collisionMap[id] == 'X');
8}
9
10glm::vec4 getTileUV(gl2d::TextureAtlasPadding atlas, int id, int flip)
11{
12 int x = id % 8;
13 int y = id / 8;
14 return atlas.get(x, y, flip);
15}
16
17bool aabb(glm::vec4 b1, glm::vec4 b2, float delta)
18{
19 b2.x += delta;
20 b2.y += delta;
21 b2.z -= delta * 2;
22 b2.w -= delta * 2;
23
24 if (((b1.x - b2.x < b2.z)
25 && b2.x - b1.x < b1.z
26 )
27 && ((b1.y - b2.y < b2.w)
28 && b2.y - b1.y < b1.w
29 )
30 )
31 {
32 return 1;
33 }
34 return 0;
35}
glm::vec4 getTileUV(gl2d::TextureAtlasPadding atlas, int id, int flip)
bool isSolid(int id)
bool aabb(glm::vec4 b1, glm::vec4 b2, float delta)
constexpr const char * collisionMap
Definition marioCommon.h:6