diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-22 19:50:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-22 22:33:52 +0300 |
commit | a8d90b8a84b5a21c53fb5d279dc983ae1e2c3217 (patch) | |
tree | f1e35affbe927a1e81fcfafe91747fe3c1e3f56d /src/guichan/include | |
parent | 3e75f388c21a7c9a00ef2ff802023be00431248a (diff) | |
download | mv-a8d90b8a84b5a21c53fb5d279dc983ae1e2c3217.tar.gz mv-a8d90b8a84b5a21c53fb5d279dc983ae1e2c3217.tar.bz2 mv-a8d90b8a84b5a21c53fb5d279dc983ae1e2c3217.tar.xz mv-a8d90b8a84b5a21c53fb5d279dc983ae1e2c3217.zip |
Fix code style.
Diffstat (limited to 'src/guichan/include')
-rw-r--r-- | src/guichan/include/guichan/sdl/sdlpixel.hpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/guichan/include/guichan/sdl/sdlpixel.hpp b/src/guichan/include/guichan/sdl/sdlpixel.hpp index a0221ca7c..bfd08341b 100644 --- a/src/guichan/include/guichan/sdl/sdlpixel.hpp +++ b/src/guichan/include/guichan/sdl/sdlpixel.hpp @@ -68,7 +68,8 @@ namespace gcn SDL_LockSurface(surface); - Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp; + Uint8 *p = static_cast<Uint8*>(surface->pixels) + + y * surface->pitch + x * bpp; unsigned int color = 0; @@ -79,7 +80,7 @@ namespace gcn break; case 2: - color = *(Uint16 *)p; + color = *reinterpret_cast<Uint16*>(p); break; case 3: @@ -90,7 +91,7 @@ namespace gcn break; case 4: - color = *(Uint32 *)p; + color = *reinterpret_cast<Uint32*>(p); break; default: @@ -123,7 +124,7 @@ namespace gcn SDL_LockSurface(surface); - Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp; + Uint8 *p = static_cast<Uint8*>(surface->pixels) + y * surface->pitch + x * bpp; Uint32 pixel = SDL_MapRGB(surface->format, color.r, color.g, color.b); @@ -134,7 +135,7 @@ namespace gcn break; case 2: - *(Uint16 *)p = pixel; + *reinterpret_cast<Uint16*>(p) = pixel; break; case 3: @@ -153,7 +154,7 @@ namespace gcn break; case 4: - *(Uint32 *)p = pixel; + *reinterpret_cast<Uint32*>(p) = pixel; break; default: @@ -199,7 +200,7 @@ namespace gcn unsigned int r = ((src & f->Bmask) * a + (dst & f->Bmask) * (255 - a)) >> 8; - return (unsigned short)((b & f->Rmask) + return static_cast<unsigned short>((b & f->Rmask) | (g & f->Gmask) | (r & f->Bmask)); } @@ -230,7 +231,8 @@ namespace gcn SDL_LockSurface(surface); - Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp; + Uint8 *p = static_cast<Uint8*>(surface->pixels) + + y * surface->pitch + x * bpp; Uint32 pixel = SDL_MapRGB(surface->format, color.r, color.g, color.b); @@ -241,7 +243,7 @@ namespace gcn break; case 2: - *(Uint16 *)p = SDLAlpha16(pixel, *(Uint32 *)p, + *reinterpret_cast<Uint16*>(p) = SDLAlpha16(pixel, *(Uint32 *)p, color.a, surface->format); break; @@ -275,7 +277,8 @@ namespace gcn break; case 4: - *(Uint32 *)p = SDLAlpha32(pixel, *(Uint32 *)p, color.a); + *reinterpret_cast<Uint32*>(p) = SDLAlpha32(pixel, + *reinterpret_cast<Uint32*>(p), color.a); break; default: break; |