Fix creating textures from image data with flipping

When the image data is copied into a texture with flipping set to true
each row has to be copied into the (height - row - 1)th row instead of
the row with the same number. Otherwise it will just create an unflipped
copy.
master
Christoph Hohmann 2014-10-05 22:54:16 +02:00
parent f76ee956c9
commit 278aa141e3
1 changed files with 1 additions and 1 deletions

View File

@ -891,7 +891,7 @@ void gs_texture_set_image(gs_texture_t *tex, const uint8_t *data,
if (flip) {
for (y = height-1; y >= 0; y--)
memcpy(ptr + (uint32_t)y * linesize_out,
data + (uint32_t)y * linesize,
data + (uint32_t)(height - y - 1) * linesize,
row_copy);
} else if (linesize == linesize_out) {