DRYer
This commit is contained in:
parent
2b5746a1fc
commit
a4f2f1b601
1 changed files with 3 additions and 2 deletions
|
|
@ -901,8 +901,9 @@ handle_put_command(GraphicsManager *self, const GraphicsCommand *g, Cursor *c, b
|
|||
|
||||
static void
|
||||
set_vertex_data(ImageRenderData *rd, const ImageRef *ref, const ImageRect *dest_rect) {
|
||||
#define R(n, a, b) rd->vertices[n*4] = ref->src_rect.a; rd->vertices[n*4 + 1] = ref->src_rect.b; rd->vertices[n*4 + 2] = dest_rect->a; rd->vertices[n*4 + 3] = dest_rect->b;
|
||||
R(0, right, top); R(1, right, bottom); R(2, left, bottom); R(3, left, top);
|
||||
unsigned n = 0;
|
||||
#define R(a, b) rd->vertices[n*4] = ref->src_rect.a; rd->vertices[n*4 + 1] = ref->src_rect.b; rd->vertices[n*4 + 2] = dest_rect->a; rd->vertices[n*4 + 3] = dest_rect->b; n++;
|
||||
R(right, top); R(right, bottom); R(left, bottom); R(left, top);
|
||||
#undef R
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue