Skip to content
This repository
Browse code

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 authored December 09, 2012

Showing 1 changed file with 16 additions and 4 deletions. Show diff stats Hide diff stats

  1. 20  xbmc/video/Teletext.cpp
20  xbmc/video/Teletext.cpp
@@ -36,10 +36,22 @@
36 36
 #ifdef HAS_SDL
37 37
 #include <SDL/SDL_stdinc.h>
38 38
 #else
39  
-#define SDL_memset4(dst, val, len) memset(dst, val, (len)*4)
40  
-#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4)
41  
-#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4)
42  
-#define SDL_memset4(dst, val, len) memset(dst, val, (len)*4)
  39
+#define SDL_memset4(dst, val, len)		\
  40
+do {						\
  41
+	uint32_t _count = (len);		\
  42
+	uint32_t _n = (_count + 3) / 4;		\
  43
+	uint32_t *_p = static_cast<uint32_t *>(dst);	\
  44
+	uint32_t _val = (val);			\
  45
+	if (len == 0) break;			\
  46
+        switch (_count % 4) {			\
  47
+        case 0: do {    *_p++ = _val;		\
  48
+        case 3:         *_p++ = _val;		\
  49
+        case 2:         *_p++ = _val;		\
  50
+        case 1:         *_p++ = _val;		\
  51
+		} while ( --_n );		\
  52
+	}					\
  53
+} while(0)
  54
+#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len) << 2)
43 55
 #endif
44 56
 
45 57
 using namespace std;

0 notes on commit 7f49891

Please sign in to comment.
Something went wrong with that request. Please try again.