diff --git a/libgag/src/GraphicContext.cpp b/libgag/src/GraphicContext.cpp index 5f7e902e..44b4e133 100644 --- a/libgag/src/GraphicContext.cpp +++ b/libgag/src/GraphicContext.cpp @@ -1697,16 +1697,15 @@ namespace GAGCore // draw glState.setTexture(surface->texture); - std::vector vertices = { x, y, x + w, y, x + w, y + h, x, y + h }; - std::vector texCoords = { static_cast(sx) * surface->texMultX, static_cast(sy) * surface->texMultY, - static_cast(sx + sw) * surface->texMultX, static_cast(sy) * surface->texMultY, - static_cast(sx + sw) * surface->texMultX, static_cast(sy + sh) * surface->texMultY, - static_cast(sx) * surface->texMultX, static_cast(sy + sh) * surface->texMultY - }; if (surface->sprite && alpha == Color::ALPHA_OPAQUE) { - surface->sprite->vertices.insert(surface->sprite->vertices.end(), vertices.begin(), vertices.end()); - surface->sprite->texCoords.insert(surface->sprite->texCoords.end(), texCoords.begin(), texCoords.end()); + surface->sprite->vertices.insert(surface->sprite->vertices.end(), { x, y, x + w, y, x + w, y + h, x, y + h }); + surface->sprite->texCoords.insert(surface->sprite->texCoords.end(), { + static_cast(sx) * surface->texMultX, static_cast(sy) * surface->texMultY, + static_cast(sx + sw) * surface->texMultX, static_cast(sy) * surface->texMultY, + static_cast(sx + sw) * surface->texMultX, static_cast(sy + sh) * surface->texMultY, + static_cast(sx) * surface->texMultX, static_cast(sy + sh) * surface->texMultY + }); } else {