jtmm2/src/camera.c
KikooDX 65ceff3971 Lot of bugfixes and improvements :)
- [input] Completely rewrote most of the code
- [input/camera] Renamed `*_draw` functions used in debug section to
`*_draw_debug`
- [main/input] Now use `_Bool` instead of `int` when appropriate
- [input] Added function `input_is_up`
- [player] Added function `player_draw_debug`
- [vec] Use `int` instead of `float`, new macro `VEC_PRECISION`
- [main/camera/player/vec] Updated vector related code to work with the
new system
2020-09-18 11:12:34 +02:00

21 lines
454 B
C

#include <gint/display.h>
#include "camera.h"
#include "vec.h"
#include "debug.h"
void camera_step(Camera *camera)
{
vec_lerp(&camera->pos, *camera->target, camera->speed);
}
void camera_draw_debug(Camera *camera)
{
#ifdef FX9860G
dpixel(camera->pos.x / VEC_PRECISION, camera->pos.y / VEC_PRECISION, C_BLACK);
#endif /* FX9860G */
#ifdef FXCG50
dpixel(camera->pos.x / VEC_PRECISION, camera->pos.y / VEC_PRECISION, C_RED);
#endif /* FXCG50 */
}