[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.
This commit is contained in:
Bill Currie 2022-09-28 18:29:53 +09:00
parent df6f51b891
commit 49acf7035d

View file

@ -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