summaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-10-25 17:36:24 +0000
committersmatz <smatz@openttd.org>2009-10-25 17:36:24 +0000
commit002f9c007528ca15897b45f10de67a715e8ad4e4 (patch)
tree22499ed22a369605f06c184767d4095115dfe999 /src/os
parent95ffbc2476942d9bbf66255e990dd372a3d8d00a (diff)
downloadopenttd-002f9c007528ca15897b45f10de67a715e8ad4e4.tar.xz
(svn r17871) -Fix (r11342): memset() accepts only 1-byte argument
Diffstat (limited to 'src/os')
-rw-r--r--src/os/macosx/splash.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/os/macosx/splash.cpp b/src/os/macosx/splash.cpp
index 708d42c9c..6e71e7d30 100644
--- a/src/os/macosx/splash.cpp
+++ b/src/os/macosx/splash.cpp
@@ -16,6 +16,7 @@
#include "../../gfx_func.h"
#include "../../fileio_func.h"
#include "../../blitter/factory.hpp"
+#include "../../core/mem_func.hpp"
#include "splash.h"
@@ -44,7 +45,6 @@ void DisplaySplashImage()
png_colorp palette;
int num_palette;
png_bytep *row_pointers;
- uint8 *src;
uint y;
uint xoff, yoff;
int i;
@@ -119,13 +119,13 @@ void DisplaySplashImage()
switch (BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth()) {
case 8: {
- uint8 *dst;
-
- memset(_screen.dst_ptr, 0xff, _screen.pitch * _screen.height);
+ uint8 *dst_ptr = (uint8 *)_screen.dst_ptr;
+ /* Initialize buffer */
+ MemSetT(dst_ptr, 0xff, _screen.pitch * _screen.height);
for (y = 0; y < height; y++) {
- src = row_pointers[y];
- dst = ((uint8 *) _screen.dst_ptr) + (yoff + y) * _screen.pitch + xoff;
+ uint8 *src = row_pointers[y];
+ uint8 *dst = dst_ptr + (yoff + y) * _screen.pitch + xoff;
memcpy(dst, src, width);
}
@@ -147,17 +147,17 @@ void DisplaySplashImage()
}
break;
case 32: {
- uint32 *dst;
- uint x;
-
- memset(_screen.dst_ptr, 0xff000000, _screen.pitch * _screen.height * 4);
+ uint32 *dst_ptr = (uint32 *)_screen.dst_ptr;
+ /* Initialize buffer */
+ MemSetT(dst_ptr, 0, _screen.pitch * _screen.height);
for (y = 0; y < height; y++) {
- src = row_pointers[y];
- dst = ((uint32 *) _screen.dst_ptr) + (yoff + y) * _screen.pitch + xoff;
+ uint8 *src = row_pointers[y];
+ uint32 *dst = dst_ptr + (yoff + y) * _screen.pitch + xoff;
- for (x = 0; x < width; x++)
+ for (x = 0; x < width; x++) {
dst[x] = palette[src[x]].blue | (palette[src[x]].green << 8) | (palette[src[x]].red << 16) | 0xff000000;
+ }
}
}
break;