diff options
author | wm4 <wm4@nowhere> | 2017-10-27 14:19:57 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-10-27 14:19:57 +0200 |
commit | d6f33e0b0da8004bc89469bbd43ac21b00de83de (patch) | |
tree | e2a641a6ca241801b8021e83b57ca0a44bfb0b2d /video/out | |
parent | 6a9f457102beaab06051ebcde669dfba8612528b (diff) |
vo_gpu: osd: simplify some code
Coverity complains about this, but it's probably a false positive.
Anyway, rewrite it in a slightly more readable way. Now it's more
obvious that it is correct.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/gpu/osd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/video/out/gpu/osd.c b/video/out/gpu/osd.c index b7cbfa597a..317deb6e4d 100644 --- a/video/out/gpu/osd.c +++ b/video/out/gpu/osd.c @@ -253,8 +253,8 @@ static void write_quad(struct vertex *va, struct gl_transform t, static void generate_verts(struct mpgl_osd_part *part, struct gl_transform t) { - int num_vertices = part->num_subparts * 6; - MP_TARRAY_GROW(part, part->vertices, part->num_vertices + num_vertices); + MP_TARRAY_GROW(part, part->vertices, + part->num_vertices + part->num_subparts * 6); for (int n = 0; n < part->num_subparts; n++) { struct sub_bitmap *b = &part->subparts[n]; @@ -266,13 +266,13 @@ static void generate_verts(struct mpgl_osd_part *part, struct gl_transform t) uint8_t color[4] = { c >> 24, (c >> 16) & 0xff, (c >> 8) & 0xff, 255 - (c & 0xff) }; - write_quad(&va[n * 6], t, + write_quad(va, t, b->x, b->y, b->x + b->dw, b->y + b->dh, b->src_x, b->src_y, b->src_x + b->w, b->src_y + b->h, part->w, part->h, color); - } - part->num_vertices += num_vertices; + part->num_vertices += 6; + } } // number of screen divisions per axis (x=0, y=1) for the current 3D mode |