X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fgame%2Fcamera.c;h=508f8dc040feb1f244573cc8b4730336c00b7947;hb=2e8c0bff530cd758ab86928a854cd56949fd19cf;hp=45c63455d0a2dc026c9a39dc9a9e95533612062c;hpb=a3558093d6a7b3f82c521a62af6fefc476cc600b;p=nothing.git diff --git a/src/game/camera.c b/src/game/camera.c index 45c63455..508f8dc0 100644 --- a/src/game/camera.c +++ b/src/game/camera.c @@ -152,7 +152,6 @@ int camera_fill_triangle(camera_t *camera, const SDL_Color sdl_color = color_for_sdl(camera->blackwhite_mode ? color_desaturate(color) : color); - if (camera->debug_mode) { if (SDL_SetRenderDrawColor(camera->renderer, sdl_color.r, sdl_color.g, sdl_color.b, sdl_color.a / 2) < 0) { throw_error(ERROR_TYPE_SDL2); @@ -174,20 +173,21 @@ int camera_fill_triangle(camera_t *camera, int camera_render_text(camera_t *camera, const char *text, - int size, + vec_t size, color_t color, vec_t position) { SDL_Rect view_port; SDL_RenderGetViewport(camera->renderer, &view_port); + const vec_t scale = effective_scale(&view_port); const vec_t screen_position = camera_point(camera, &view_port, position); if (sprite_font_render_text( camera->font, camera->renderer, screen_position, - size, + vec(size.x * scale.x, size.y * scale.y), camera->blackwhite_mode ? color_desaturate(color) : color, text) < 0) { return -1; @@ -264,6 +264,20 @@ rect_t camera_view_port(const camera_t *camera) w, h); } +int camera_is_text_visible(const camera_t *camera, + vec_t size, + vec_t position, + const char *text) +{ + assert(camera); + assert(text); + (void) size; + (void) position; + + /* TODO: camera_is_text_visible not implemented */ + + return 0; +} /* ---------- Private Function ---------- */