# HG changeset patch # User Andreas Schiffler # Date 1284614147 25200 # Node ID 27ab20a36eba2c49017ac1ae4cacf9d9b7089256 # Parent 511948f4919e1b3f00d68a0af88464af70cf5a04 - 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 diff -r 511948f4919e -r 27ab20a36eba VisualC/SDL/SDL_VS2008.vcproj --- a/VisualC/SDL/SDL_VS2008.vcproj Tue Sep 14 21:57:29 2010 -0700 +++ b/VisualC/SDL/SDL_VS2008.vcproj Wed Sep 15 22:15:47 2010 -0700 @@ -52,7 +52,7 @@ - @@ -169,6 +169,8 @@ GenerateDebugInformation="true" ProgramDatabaseFile=".\Debug/testshape.pdb" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" /> - diff -r 511948f4919e -r 27ab20a36eba src/audio/SDL_audio.c --- a/src/audio/SDL_audio.c Tue Sep 14 21:57:29 2010 -0700 +++ b/src/audio/SDL_audio.c Wed Sep 15 22:15:47 2010 -0700 @@ -339,7 +339,7 @@ /* For streaming when the buffer sizes don't match up */ Uint8 *istream; - int istream_len; + int istream_len = 0; /* Perform any thread setup */ device->threadid = SDL_ThreadID(); diff -r 511948f4919e -r 27ab20a36eba test/automated/rwops/TestSupportRWops_Generic.c --- a/test/automated/rwops/TestSupportRWops_Generic.c Tue Sep 14 21:57:29 2010 -0700 +++ b/test/automated/rwops/TestSupportRWops_Generic.c Wed Sep 15 22:15:47 2010 -0700 @@ -1,6 +1,10 @@ /* Generic implementation for file opening routines. * Customizations for specific platforms should go in alternative files. */ + +// quiet win32 compiler warnings +#define _CRT_SECURE_NO_WARNINGS + #include #include "SDL.h" diff -r 511948f4919e -r 27ab20a36eba test/graywin.c --- a/test/graywin.c Tue Sep 14 21:57:29 2010 -0700 +++ b/test/graywin.c Wed Sep 15 22:15:47 2010 -0700 @@ -25,7 +25,7 @@ /* Seed the random number generator */ if (seeded == 0) { - srand(time(NULL)); + srand((unsigned int)time(NULL)); seeded = 1; } diff -r 511948f4919e -r 27ab20a36eba test/testdraw2.c --- a/test/testdraw2.c Tue Sep 14 21:57:29 2010 -0700 +++ b/test/testdraw2.c Wed Sep 15 22:15:47 2010 -0700 @@ -234,7 +234,7 @@ SDL_RenderClear(); } - srand(time(NULL)); + srand((unsigned int)time(NULL)); /* Main render loop */ frames = 0; diff -r 511948f4919e -r 27ab20a36eba test/testfile.c --- a/test/testfile.c Tue Sep 14 21:57:29 2010 -0700 +++ b/test/testfile.c Wed Sep 15 22:15:47 2010 -0700 @@ -1,6 +1,9 @@ /* sanity tests on SDL_rwops.c (usefull for alternative implementations of stdio rwops) */ +// quiet win32 compiler warnings +#define _CRT_NONSTDC_NO_WARNINGS + #include #ifndef _MSC_VER diff -r 511948f4919e -r 27ab20a36eba test/testgl.c --- a/test/testgl.c Tue Sep 14 21:57:29 2010 -0700 +++ b/test/testgl.c Wed Sep 15 22:15:47 2010 -0700 @@ -654,7 +654,7 @@ fprintf(stderr, "testgl: OpenGL error: %d\n", gl_error); } - sdl_error = SDL_GetError(); + sdl_error = (char *)SDL_GetError(); if (sdl_error[0] != '\0') { fprintf(stderr, "testgl: SDL error '%s'\n", sdl_error); diff -r 511948f4919e -r 27ab20a36eba test/testoverlay.c --- a/test/testoverlay.c Tue Sep 14 21:57:29 2010 -0700 +++ b/test/testoverlay.c Wed Sep 15 22:15:47 2010 -0700 @@ -38,23 +38,23 @@ { 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]); - yuv[2] = 128 + (0.439 * rgb[0]) - (0.368 * rgb[1]) - (0.071 * rgb[2]); + yuv[0] = (int)((0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16); + yuv[1] = (int)(128 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2])); + yuv[2] = (int)(128 + (0.439 * rgb[0]) - (0.368 * rgb[1]) - (0.071 * rgb[2])); #endif } diff -r 511948f4919e -r 27ab20a36eba test/testoverlay2.c --- 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) { diff -r 511948f4919e -r 27ab20a36eba test/testsprite.c --- a/test/testsprite.c Tue Sep 14 21:57:29 2010 -0700 +++ b/test/testsprite.c Wed Sep 15 22:15:47 2010 -0700 @@ -100,7 +100,7 @@ Uint32 color = SDL_MapRGB(screen->format, 255, 0, 0); SDL_Rect r; r.x = - (sin((float) t * 2 * 3.1459) + 1.0) / 2.0 * (screen->w - 20); + (int)((sin((float) t * 2 * 3.1459) + 1.0) / 2.0 * (screen->w - 20)); r.y = 0; r.w = 20; r.h = screen->h; @@ -141,7 +141,7 @@ /* Direct hardware blitting without double-buffering causes really bad flickering. */ - if (info->video_mem * 1024 > (height * width * bpp / 8)) { + if (info->video_mem * 1024 > (Uint32)(height * width * bpp / 8)) { flags |= SDL_DOUBLEBUF; } else { flags &= ~SDL_HWSURFACE; @@ -236,7 +236,7 @@ sprite_rects += numsprites; sprite_w = sprite->w; sprite_h = sprite->h; - srand(time(NULL)); + srand((unsigned int)time(NULL)); for (i = 0; i < numsprites; ++i) { positions[i].x = rand() % (screen->w - sprite_w); positions[i].y = rand() % (screen->h - sprite_h); diff -r 511948f4919e -r 27ab20a36eba test/testsprite2.c --- a/test/testsprite2.c Tue Sep 14 21:57:29 2010 -0700 +++ b/test/testsprite2.c Wed Sep 15 22:15:47 2010 -0700 @@ -315,7 +315,7 @@ fprintf(stderr, "Out of memory!\n"); quit(2); } - srand(time(NULL)); + srand((unsigned int)time(NULL)); if (scaleMode != SDL_TEXTURESCALEMODE_NONE) { sprite_w += sprite_w / 2; sprite_h += sprite_h / 2; @@ -368,6 +368,7 @@ printf("%2.2f frames per second\n", fps); } quit(0); + return 0; } /* vi: set ts=4 sw=4 expandtab: */