Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1906 from margro/fixtrac13515

teletext: fixes #13515 transparent background issue on Windows systems
  • Loading branch information...
commit 7f49891d0a13de807e7da80daa2167a77680c5ce 2 parents e551803 + 54dbf34
@davilla davilla authored
Showing with 16 additions and 4 deletions.
  1. +16 −4 xbmc/video/Teletext.cpp
View
20 xbmc/video/Teletext.cpp
@@ -36,10 +36,22 @@
#ifdef HAS_SDL
#include <SDL/SDL_stdinc.h>
#else
-#define SDL_memset4(dst, val, len) memset(dst, val, (len)*4)
-#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4)
-#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4)
-#define SDL_memset4(dst, val, len) memset(dst, val, (len)*4)
+#define SDL_memset4(dst, val, len) \
+do { \
+ uint32_t _count = (len); \
+ uint32_t _n = (_count + 3) / 4; \
+ uint32_t *_p = static_cast<uint32_t *>(dst); \
+ uint32_t _val = (val); \
+ if (len == 0) break; \
+ switch (_count % 4) { \
+ case 0: do { *_p++ = _val; \
+ case 3: *_p++ = _val; \
+ case 2: *_p++ = _val; \
+ case 1: *_p++ = _val; \
+ } while ( --_n ); \
+ } \
+} while(0)
+#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len) << 2)
#endif
using namespace std;
Please sign in to comment.
Something went wrong with that request. Please try again.