summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/tippercanoe/sdlwrap.cpp
diff options
context:
space:
mode:
authorOBATA Akio <obache@wizdas.com>2022-01-05 16:36:10 +0900
committerOBATA Akio <obache@wizdas.com>2022-01-05 16:36:10 +0900
commitecd978360d79ba71df598f372be65cc1c0e34d80 (patch)
treeb8065873a3fc01b7115df7207de638589d304145 /noatun-plugins/tippercanoe/sdlwrap.cpp
parent762bfec2c849854fc0247acf8d2f107c27b17940 (diff)
downloadtdeaddons-ecd978360d79ba71df598f372be65cc1c0e34d80.tar.gz
tdeaddons-ecd978360d79ba71df598f372be65cc1c0e34d80.zip
noatun-plugins: change to use SDL feature to handle data for SDL
With own imcompleted endianness checkes, systems might be mis-detected as big endian. Change to use SDL macros to determine endianness. Change to use SDL function to byte swap Change to use SDL tyepdef for appropriate size integer type Signed-off-by: OBATA Akio <obache@wizdas.com>
Diffstat (limited to 'noatun-plugins/tippercanoe/sdlwrap.cpp')
-rw-r--r--noatun-plugins/tippercanoe/sdlwrap.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/noatun-plugins/tippercanoe/sdlwrap.cpp b/noatun-plugins/tippercanoe/sdlwrap.cpp
index 0ca2f4e..5b6bc41 100644
--- a/noatun-plugins/tippercanoe/sdlwrap.cpp
+++ b/noatun-plugins/tippercanoe/sdlwrap.cpp
@@ -142,8 +142,8 @@ int SdlScreen::sizeUpdate(void) { return 0; }
void SdlScreen::show(void) {
SDL_LockSurface(surface);
- unsigned long *ptr2 = (unsigned long*)core->output();
- unsigned long *ptr1 = (unsigned long*)( surface->pixels );
+ Uint32 *ptr2 = (Uint32*)core->output();
+ Uint32 *ptr1 = (Uint32*)( surface->pixels );
int i = core->outWidth*core->outHeight/4;
do {
@@ -153,7 +153,7 @@ void SdlScreen::show(void) {
unsigned int const r2 = *(ptr2++);
//if (r1 || r2) {
-#ifdef LITTLEENDIAN
+#if SDL_BYTEORDER == SDL_LIT_ENDIAN
unsigned int const v =
((r1 & 0x000000f0ul) >> 4)
| ((r1 & 0x0000f000ul) >> 8)