summaryrefslogtreecommitdiff
path: root/src/guichan/sdl
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-17 20:13:48 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-17 20:13:48 +0300
commitc2efedab22275302f0a10cc197424d345a021d18 (patch)
tree7488abbb3655451a3f6a1621e0708f72011af5f6 /src/guichan/sdl
parent79aba82be3de5b6b571e2f59f7a34ded4b03160f (diff)
downloadplus-c2efedab22275302f0a10cc197424d345a021d18.tar.gz
plus-c2efedab22275302f0a10cc197424d345a021d18.tar.bz2
plus-c2efedab22275302f0a10cc197424d345a021d18.tar.xz
plus-c2efedab22275302f0a10cc197424d345a021d18.zip
Replace SDL int types to C++ types.
Diffstat (limited to 'src/guichan/sdl')
-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);