diff options
author | OBATA Akio <obache@wizdas.com> | 2022-01-05 16:36:10 +0900 |
---|---|---|
committer | OBATA Akio <obache@wizdas.com> | 2022-01-05 16:36:10 +0900 |
commit | ecd978360d79ba71df598f372be65cc1c0e34d80 (patch) | |
tree | b8065873a3fc01b7115df7207de638589d304145 /noatun-plugins/blurscope/scopedisplayer.cpp | |
parent | 762bfec2c849854fc0247acf8d2f107c27b17940 (diff) | |
download | tdeaddons-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/blurscope/scopedisplayer.cpp')
-rw-r--r-- | noatun-plugins/blurscope/scopedisplayer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noatun-plugins/blurscope/scopedisplayer.cpp b/noatun-plugins/blurscope/scopedisplayer.cpp index 4abc188..da31e5c 100644 --- a/noatun-plugins/blurscope/scopedisplayer.cpp +++ b/noatun-plugins/blurscope/scopedisplayer.cpp @@ -231,15 +231,15 @@ void SDLView::checkInput() } } -#define output2 ((unsigned char*)outputBmp.data) +#define output2 ((Uint8*)outputBmp.data) void SDLView::repaint() { SDL_LockSurface(surface); TEST(); - unsigned long *ptr2 = (unsigned long*)output2; - unsigned long *ptr1 = (unsigned long*)( surface->pixels ); + Uint32 *ptr2 = (Uint32*)output2; + Uint32 *ptr1 = (Uint32*)( surface->pixels ); int i = width*height/4; TEST(); @@ -250,7 +250,7 @@ void SDLView::repaint() 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) |