[vulkan] Update the number of drawn quads correctly

They should increment by one for each pic, not 4 (I think some fluff
remaining from copying glsl's draw code).

I noticed the problem when I saw large gaps of 0s in the vertex data in
renderdoc.
This commit is contained in:
Bill Currie 2021-12-18 13:09:09 +09:00
parent be7216e660
commit 4d1e8b2375

View file

@ -448,12 +448,12 @@ draw_pic (float x, float y, int w, int h, qpic_t *pic,
int srcx, int srcy, int srcw, int srch,
float *color, drawframe_t *frame)
{
if (frame->num_quads + VERTS_PER_QUAD > MAX_QUADS) {
if (frame->num_quads >= MAX_QUADS) {
return;
}
drawvert_t *verts = frame->verts + frame->num_quads * VERTS_PER_QUAD;
frame->num_quads += VERTS_PER_QUAD;
frame->num_quads++;
subpic_t *subpic = *(subpic_t **) pic->data;
srcx += subpic->rect->x;