#ifndef CAMERA_H #define CAMERA_H #include #include #include #ifdef __cplusplus extern "C" { #endif struct camera { int x, y, x_speed, y_speed; unsigned int xt, yt; struct cursor { unsigned int x, y, x_init, y_init; enum { CURSOR_STATE_IDLE, CURSOR_STATE_PRESSED } state; struct { int last_w, last_h; } screen; } cursor; }; extern struct sprite cursor_sprite; void camera_update(struct camera *cam, const struct pad *p); bool camera_translate(const struct camera *cam, const struct util_rect *dim, short *x, short *y); void cursor_init(struct cursor *c); bool cursor_collision(const struct camera *cam, const struct util_rect *d); void cursor_pos(const struct camera *cam, unsigned long *x, unsigned long *y); int cursor_render(const struct cursor *c); #ifdef __cplusplus } #endif #endif /* CAMERA_H */