34 lines
632 B
C++
34 lines
632 B
C++
#ifndef UTILITIES_H
|
|
#define UTILITIES_H
|
|
|
|
|
|
#include <cstdint>
|
|
#include "gint/image.h"
|
|
|
|
|
|
typedef struct
|
|
{
|
|
/* position of the picture */
|
|
int16_t x, y;
|
|
/* pointer to the image structure */
|
|
image_t *image;
|
|
|
|
} SpriteLocator;
|
|
|
|
|
|
#define ABS(a) ((a) < 0 ? -(a) : (a))
|
|
#define FLOOR(a) ((a) < 0 ? (int)((a)-1.0) : (int)(a))
|
|
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
|
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
|
|
|
|
|
|
|
bool AABB_Collision( SpriteLocator image1, SpriteLocator image2 );
|
|
|
|
bool Pixel_Perfect_Collision( SpriteLocator image1, SpriteLocator image2 );
|
|
|
|
|
|
void Azur_draw_text(int x, int y, char const *fmt, ...);
|
|
|
|
|
|
#endif |