Mercurial > sdl-ios-xcode
changeset 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 | 511948f4919e |
children | ad6d5d2402db |
files | VisualC/SDL/SDL_VS2008.vcproj VisualC/SDL_VS2008.sln VisualC/tests/testshape/testshape.vcproj src/audio/SDL_audio.c test/automated/rwops/TestSupportRWops_Generic.c test/graywin.c test/testdraw2.c test/testfile.c test/testgl.c test/testoverlay.c test/testoverlay2.c test/testsprite.c test/testsprite2.c |
diffstat | 13 files changed, 50 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="..\..\include" + AdditionalIncludeDirectories="..\..\include;C:\Program Files\Microsoft SDKs\Windows\v7.0\Include" PreprocessorDefinitions="_DEBUG;_WINDOWS;_WIN32_WINNT=0x0400;__MMX__;__3dNOW__;__SSE__;__SSE2__" RuntimeLibrary="2" BufferSecurityCheck="false"
--- a/VisualC/SDL_VS2008.sln Tue Sep 14 21:57:29 2010 -0700 +++ b/VisualC/SDL_VS2008.sln Wed Sep 15 22:15:47 2010 -0700 @@ -132,6 +132,8 @@ {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape.vcproj", "{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -355,6 +357,15 @@ {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release|Win32.ActiveCfg = Release|Win32 {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release|Win32.Build.0 = Release|Win32 {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release|x64.ActiveCfg = Release|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|Win32.ActiveCfg = Debug|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|Win32.Build.0 = Debug|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|x64.ActiveCfg = Debug|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|Win32.ActiveCfg = Release|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|Win32.Build.0 = Release|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -381,5 +392,6 @@ {575FD095-EDAB-4BD4-B733-CD4A874F6FB0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {0FFD1A21-11DB-492C-A989-E4F195B0C441} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} EndGlobalSection EndGlobal
--- a/VisualC/tests/testshape/testshape.vcproj Tue Sep 14 21:57:29 2010 -0700 +++ b/VisualC/tests/testshape/testshape.vcproj Wed Sep 15 22:15:47 2010 -0700 @@ -1,9 +1,10 @@ <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" - Version="8.00" + Version="9.00" Name="testshape" - ProjectGUID="{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}" + ProjectGUID="{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}" + TargetFrameworkVersion="131072" > <Platforms> <Platform @@ -78,6 +79,8 @@ SuppressStartupBanner="true" ProgramDatabaseFile=".\Release/testshape.pdb" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" /> <Tool Name="VCALinkTool" @@ -98,9 +101,6 @@ Name="VCAppVerifierTool" /> <Tool - Name="VCWebDeploymentTool" - /> - <Tool Name="VCPostBuildEventTool" /> </Configuration> @@ -169,6 +169,8 @@ GenerateDebugInformation="true" ProgramDatabaseFile=".\Debug/testshape.pdb" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" /> <Tool Name="VCALinkTool" @@ -189,9 +191,6 @@ Name="VCAppVerifierTool" /> <Tool - Name="VCWebDeploymentTool" - /> - <Tool Name="VCPostBuildEventTool" /> </Configuration>
--- 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();
--- 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 <stdio.h> #include "SDL.h"
--- 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; }
--- 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;
--- 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 <stdlib.h> #ifndef _MSC_VER
--- 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);
--- 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 }
--- 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) {
--- 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);
--- 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: */