Files
PixelDefense/game/utils.h

26 lines
693 B
C

#ifndef PIXELDEFENSE_UTILS_H
#define PIXELDEFENSE_UTILS_H
#include <raylib.h>
#include <breeze.h>
static Rectangle getCameraBounds(Camera2D camera) {
Rectangle bounds = {
.x = camera.target.x,
.y = camera.target.y,
.width = GetScreenWidth() / camera.zoom,
.height = GetScreenHeight() / camera.zoom,
};
//bounds.width *= 0.8f;
//bounds.height *= 0.8f;
bounds.x -= bounds.width * 0.5f;
bounds.y -= bounds.height * 0.5f;
return bounds;
}
// Implemented in main.c
bool serializeOptions(const char *path, const Options *opts);
bool deserializeOptions(const char *path, Options *optsOut);
#endif //PIXELDEFENSE_UTILS_H