2020-09-14 14:37:46 +02:00
|
|
|
#include <gint/display.h>
|
|
|
|
|
2020-09-11 18:07:53 +02:00
|
|
|
#include "camera.h"
|
2020-09-19 14:00:46 +02:00
|
|
|
#include "conf.h"
|
2020-09-14 10:33:01 +02:00
|
|
|
#include "vec.h"
|
2020-09-14 14:37:46 +02:00
|
|
|
#include "debug.h"
|
2020-09-11 18:07:53 +02:00
|
|
|
|
|
|
|
void camera_step(Camera *camera)
|
|
|
|
{
|
2020-09-14 14:37:46 +02:00
|
|
|
vec_lerp(&camera->pos, *camera->target, camera->speed);
|
|
|
|
}
|
|
|
|
|
2020-09-18 11:12:34 +02:00
|
|
|
void camera_draw_debug(Camera *camera)
|
2020-09-14 14:37:46 +02:00
|
|
|
{
|
2020-09-19 14:00:46 +02:00
|
|
|
Vec draw_pos;
|
|
|
|
vec_cpy(&draw_pos, camera->pos);
|
|
|
|
vec_mul(&draw_pos, SCALE);
|
|
|
|
vec_div(&draw_pos, VEC_PRECISION);
|
2020-09-16 11:18:55 +02:00
|
|
|
#ifdef FX9860G
|
2020-09-21 12:01:54 +02:00
|
|
|
const int color = C_BLACK;
|
2020-09-16 11:18:55 +02:00
|
|
|
#endif /* FX9860G */
|
|
|
|
#ifdef FXCG50
|
2020-09-21 12:01:54 +02:00
|
|
|
const int color = C_RED;
|
2020-09-16 11:18:55 +02:00
|
|
|
#endif /* FXCG50 */
|
2020-09-19 14:00:46 +02:00
|
|
|
dpixel(draw_pos.x, draw_pos.y, color);
|
2020-09-11 18:07:53 +02:00
|
|
|
}
|