jtmm2/src/camera.c

27 lines
521 B
C

#include <gint/display.h>
#include "camera.h"
#include "conf.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)
{
Vec draw_pos;
vec_cpy(&draw_pos, camera->pos);
vec_mul(&draw_pos, SCALE);
vec_div(&draw_pos, VEC_PRECISION);
#ifdef FX9860G
const int color = C_BLACK;
#endif /* FX9860G */
#ifdef FXCG50
const int color = C_RED;
#endif /* FXCG50 */
dpixel(draw_pos.x, draw_pos.y, color);
}