From 49acf7035df238fe1f4df1d31c90ec76aebb4fc0 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 28 Sep 2022 18:29:53 +0900 Subject: [PATCH] [vulkaan] Fix incorrect conback drawing Putting the console background image in the scrap needed different calculations for the sliding console, but I rather messed things up. --- libs/video/renderer/vulkan/vulkan_draw.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/video/renderer/vulkan/vulkan_draw.c b/libs/video/renderer/vulkan/vulkan_draw.c index bfb7dea2c..65bd3955e 100644 --- a/libs/video/renderer/vulkan/vulkan_draw.c +++ b/libs/video/renderer/vulkan/vulkan_draw.c @@ -830,11 +830,12 @@ Vulkan_Draw_ConsoleBackground (int lines, byte alpha, vulkan_ctx_t *ctx) quat_t color = { a, a, a, a}; qpic_t *cpic; cpic = Vulkan_Draw_CachePic ("gfx/conback.lmp", false, ctx); - int ofs = max (0, cpic->height - lines); - lines = min (lines, cpic->height); + float frac = (vid.height - lines) / (float) vid.height; + int ofs = frac * cpic->height; subpic_t *subpic = *(subpic_t **) cpic->data; draw_pic (0, 0, vid.width, lines, subpic, - 0, ofs, cpic->width, lines, color, &frame->quad_verts); + 0, ofs, cpic->width, cpic->height - ofs, color, + &frame->quad_verts); } void