ref: a76b7a3a8734b9d5d306aa13ee4b85733903a53e
parent: 92031052356178b7e4a0f3258c436299a484fd55
author: Clownacy <Clownacy@users.noreply.github.com>
date: Tue Feb 19 18:35:37 EST 2019
Fix sprite upscaling on platforms where long isn't 32-bit That was dumb.
--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -274,15 +274,20 @@
const unsigned char *src_row = (unsigned char*)converted_surface->pixels + h * converted_surface->pitch;
unsigned char *dst_row = (unsigned char*)surf[surf_no].surface->pixels + h * surf[surf_no].surface->pitch * magnification;
- const unsigned long *src_ptr = (unsigned long*)src_row;
- unsigned long *dst_ptr = (unsigned long*)dst_row;
+ const unsigned char *src_ptr = src_row;
+ unsigned char *dst_ptr = dst_row;
for (int w = 0; w < converted_surface->w; ++w)
{
- const unsigned long src_pixel = *src_ptr++;
-
for (int i = 0; i < magnification; ++i)
- *dst_ptr++ = src_pixel;
+ {
+ *dst_ptr++ = src_ptr[0];
+ *dst_ptr++ = src_ptr[1];
+ *dst_ptr++ = src_ptr[2];
+ *dst_ptr++ = src_ptr[3];
+ }
+
+ src_ptr += 4;
}
for (int i = 1; i < magnification; ++i)