From 7714c99eb5ef9d7874041be03eabc57474bdeb2f Mon Sep 17 00:00:00 2001 From: J-D-K Date: Thu, 28 Jun 2018 20:02:19 -0400 Subject: [PATCH] Small revision --- src/gfx.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gfx.cpp b/src/gfx.cpp index 6c91bcd..9bf62fa 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -295,12 +295,8 @@ namespace gfx for(unsigned y = 0, i = 0; y < height; y++) { png_bytep row = rows[y]; - for(unsigned x = 0; x < width; x++, i++) - { - png_bytep px = &(row[x * 4]); - - data[i] = px[3] << 24 | px[2] << 16 | px[1] << 8 | px[0]; - } + for(unsigned x = 0; x < width * 4; x += 4, i++) + std::memcpy(&data[i], &row[x], sizeof(uint32_t)); } for(unsigned i = 0; i < height; i++)