summaryrefslogtreecommitdiff
path: root/src/guichan
diff options
context:
space:
mode:
Diffstat (limited to 'src/guichan')
-rw-r--r--src/guichan/sdl/sdlgraphics.cpp20
-rw-r--r--src/guichan/sdl/sdlimage.cpp2
2 files changed, 11 insertions, 11 deletions
diff --git a/src/guichan/sdl/sdlgraphics.cpp b/src/guichan/sdl/sdlgraphics.cpp
index 63ed8bbc2..e50017c38 100644
--- a/src/guichan/sdl/sdlgraphics.cpp
+++ b/src/guichan/sdl/sdlgraphics.cpp
@@ -209,10 +209,10 @@ namespace gcn
SDL_LockSurface(mTarget);
- Uint8 *p = static_cast<Uint8*>(mTarget->pixels)
+ uint8_t *p = static_cast<uint8_t*>(mTarget->pixels)
+ y * mTarget->pitch + x1 * bpp;
- Uint32 pixel = SDL_MapRGB(mTarget->format,
+ uint32_t pixel = SDL_MapRGB(mTarget->format,
mColor.r,
mColor.g,
mColor.b);
@@ -225,7 +225,7 @@ namespace gcn
case 2:
{
- Uint16* q = reinterpret_cast<Uint16*>(p);
+ uint16_t* q = reinterpret_cast<uint16_t*>(p);
for (; x1 <= x2; ++x1)
*(q++) = pixel;
break;
@@ -256,7 +256,7 @@ namespace gcn
case 4:
{
- Uint32 *q = reinterpret_cast<Uint32*>(p);
+ uint32_t *q = reinterpret_cast<uint32_t*>(p);
for (; x1 <= x2; ++x1)
{
if (mAlpha)
@@ -322,10 +322,10 @@ namespace gcn
SDL_LockSurface(mTarget);
- Uint8 *p = static_cast<Uint8*>(mTarget->pixels)
+ uint8_t *p = static_cast<uint8_t*>(mTarget->pixels)
+ y1 * mTarget->pitch + x * bpp;
- Uint32 pixel = SDL_MapRGB(mTarget->format, mColor.r,
+ uint32_t pixel = SDL_MapRGB(mTarget->format, mColor.r,
mColor.g, mColor.b);
switch (bpp)
@@ -341,7 +341,7 @@ namespace gcn
case 2:
for (; y1 <= y2; ++ y1)
{
- *reinterpret_cast<Uint16*>(p) = pixel;
+ *reinterpret_cast<uint16_t*>(p) = pixel;
p += mTarget->pitch;
}
break;
@@ -374,12 +374,12 @@ namespace gcn
{
if (mAlpha)
{
- *reinterpret_cast<Uint32*>(p) = SDLAlpha32(pixel,
- *reinterpret_cast<Uint32*>(p), mColor.a);
+ *reinterpret_cast<uint32_t*>(p) = SDLAlpha32(pixel,
+ *reinterpret_cast<uint32_t*>(p), mColor.a);
}
else
{
- *reinterpret_cast<Uint32*>(p) = pixel;
+ *reinterpret_cast<uint32_t*>(p) = pixel;
}
p += mTarget->pitch;
}
diff --git a/src/guichan/sdl/sdlimage.cpp b/src/guichan/sdl/sdlimage.cpp
index f00db27f9..5bb7041ff 100644
--- a/src/guichan/sdl/sdlimage.cpp
+++ b/src/guichan/sdl/sdlimage.cpp
@@ -140,7 +140,7 @@ namespace gcn
for (i = 0; i < mSurface->w * mSurface->h; ++i)
{
- Uint8 r, g, b, a;
+ uint8_t r, g, b, a;
SDL_GetRGBA((static_cast<unsigned int*>(mSurface->pixels)[i]),
mSurface->format, &r, &g, &b, &a);