Mercurial > sdl-ios-xcode
diff test/testoverlay2.c @ 4884:27ab20a36eba
- added directx include path to VS2008 solution
- updated shape vcproj and add it to VS2008 solution
- minor changes (i.e. typecasting) to get rid of compiler warnings in VS
author | Andreas Schiffler <aschiffler@ferzkopp.net> |
---|---|
date | Wed, 15 Sep 2010 22:15:47 -0700 |
parents | c785543d1843 |
children | 16d5e8e90e01 |
line wrap: on
line diff
--- a/test/testoverlay2.c Tue Sep 14 21:57:29 2010 -0700 +++ b/test/testoverlay2.c Wed Sep 15 22:15:47 2010 -0700 @@ -144,19 +144,19 @@ { if (monochrome) { #if 1 /* these are the two formulas that I found on the FourCC site... */ - yuv[0] = 0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2]; + yuv[0] = (int)(0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2]); yuv[1] = 128; yuv[2] = 128; #else - yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16; + yuv[0] = (int)(0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16; yuv[1] = 128; yuv[2] = 128; #endif } else { #if 1 /* these are the two formulas that I found on the FourCC site... */ - yuv[0] = 0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2]; - yuv[1] = (rgb[2] - yuv[0]) * 0.565 + 128; - yuv[2] = (rgb[0] - yuv[0]) * 0.713 + 128; + yuv[0] = (int)(0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2]); + yuv[1] = (int)((rgb[2] - yuv[0]) * 0.565 + 128); + yuv[2] = (int)((rgb[0] - yuv[0]) * 0.713 + 128); #else yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16; yuv[1] = 128 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2]); @@ -606,7 +606,7 @@ } if ((!paused) || (resized)) { - if (((SDL_GetTicks() - lastftick) > fpsdelay) || (resized)) { + if (((SDL_GetTicks() - lastftick) > (Uint32)fpsdelay) || (resized)) { lastftick = SDL_GetTicks(); switch (overlay_format) {