test/testoverlay2.c
changeset 4884 27ab20a36eba
parent 2267 c785543d1843
child 5216 16d5e8e90e01
     1.1 --- a/test/testoverlay2.c	Tue Sep 14 21:57:29 2010 -0700
     1.2 +++ b/test/testoverlay2.c	Wed Sep 15 22:15:47 2010 -0700
     1.3 @@ -144,19 +144,19 @@
     1.4  {
     1.5      if (monochrome) {
     1.6  #if 1                           /* these are the two formulas that I found on the FourCC site... */
     1.7 -        yuv[0] = 0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2];
     1.8 +        yuv[0] = (int)(0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2]);
     1.9          yuv[1] = 128;
    1.10          yuv[2] = 128;
    1.11  #else
    1.12 -        yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
    1.13 +        yuv[0] = (int)(0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
    1.14          yuv[1] = 128;
    1.15          yuv[2] = 128;
    1.16  #endif
    1.17      } else {
    1.18  #if 1                           /* these are the two formulas that I found on the FourCC site... */
    1.19 -        yuv[0] = 0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2];
    1.20 -        yuv[1] = (rgb[2] - yuv[0]) * 0.565 + 128;
    1.21 -        yuv[2] = (rgb[0] - yuv[0]) * 0.713 + 128;
    1.22 +        yuv[0] = (int)(0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2]);
    1.23 +        yuv[1] = (int)((rgb[2] - yuv[0]) * 0.565 + 128);
    1.24 +        yuv[2] = (int)((rgb[0] - yuv[0]) * 0.713 + 128);
    1.25  #else
    1.26          yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
    1.27          yuv[1] = 128 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2]);
    1.28 @@ -606,7 +606,7 @@
    1.29          }
    1.30  
    1.31          if ((!paused) || (resized)) {
    1.32 -            if (((SDL_GetTicks() - lastftick) > fpsdelay) || (resized)) {
    1.33 +            if (((SDL_GetTicks() - lastftick) > (Uint32)fpsdelay) || (resized)) {
    1.34                  lastftick = SDL_GetTicks();
    1.35  
    1.36                  switch (overlay_format) {