From 3c404128c4669a1f4f190e20a89553677717fc50 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 23 Sep 2016 22:01:44 +0300 Subject: Add missing comments into defines. --- src/render/sdl2softwaregraphics.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'src/render/sdl2softwaregraphics.cpp') diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index 2d0ade4d9..d60d70cc8 100644 --- a/src/render/sdl2softwaregraphics.cpp +++ b/src/render/sdl2softwaregraphics.cpp @@ -41,13 +41,13 @@ #ifndef SDL_BYTEORDER #error missing SDL_endian.h -#endif +#endif // SDL_BYTEORDER #if SDL_BYTEORDER == SDL_LIL_ENDIAN static unsigned int *cR = nullptr; static unsigned int *cG = nullptr; static unsigned int *cB = nullptr; -#endif +#endif // SDL_BYTEORDER == SDL_LIL_ENDIAN #define defRectFromArea(rect, area) \ const SDL_Rect rect = \ @@ -995,11 +995,12 @@ void SDL2SoftwareGraphics::fillRectangle(const Rect &restrict rectangle) p[2] = CAST_U8((p[2] * ca + cb) >> 8); p[1] = CAST_U8((p[1] * ca + cg) >> 8); p[0] = CAST_U8((p[0] * ca + cr) >> 8); -#else +#else // SDL_BYTEORDER == SDL_BIG_ENDIAN + p[0] = CAST_U8((p[0] * ca + cb) >> 8); p[1] = CAST_U8((p[1] * ca + cg) >> 8); p[2] = CAST_U8((p[2] * ca + cr) >> 8); -#endif +#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN } } break; @@ -1029,7 +1030,8 @@ void SDL2SoftwareGraphics::fillRectangle(const Rect &restrict rectangle) | (g & 0xff00) | (r & 0xff0000)); } } -#else +#else // SDL_BYTEORDER == SDL_BIG_ENDIAN + if (!cR) { cR = new unsigned int[0x100]; @@ -1089,7 +1091,8 @@ void SDL2SoftwareGraphics::fillRectangle(const Rect &restrict rectangle) | cR[(dst & rMask) / rShift]; } } -#endif +#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN + break; } default: @@ -1241,7 +1244,8 @@ void SDL2SoftwareGraphics::drawHLine(int x1, int y, int x2) restrict2 p[2] = b2; p += 3; } -#else +#else // SDL_BYTEORDER == SDL_BIG_ENDIAN + for (; x1 <= x2; ++x1) { p[0] = b2; @@ -1249,7 +1253,8 @@ void SDL2SoftwareGraphics::drawHLine(int x1, int y, int x2) restrict2 p[2] = b0; p += 3; } -#endif +#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN + break; } @@ -1371,7 +1376,8 @@ void SDL2SoftwareGraphics::drawVLine(int x, int y1, int y2) restrict2 p[2] = b2; p += pitch; } -#else +#else // SDL_BYTEORDER == SDL_BIG_ENDIAN + for (; y1 <= y2; ++y1) { p[0] = b2; @@ -1379,7 +1385,8 @@ void SDL2SoftwareGraphics::drawVLine(int x, int y1, int y2) restrict2 p[2] = b0; p += pitch; } -#endif +#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN + break; } -- cgit v1.2.3-70-g09d2