Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
ferzkopp committed Sep 16, 2010
1 parent a278927 commit b6038a5
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 31 deletions.
2 changes: 1 addition & 1 deletion VisualC/SDL/SDL_VS2008.vcproj
Expand Up @@ -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"
Expand Down
12 changes: 12 additions & 0 deletions VisualC/SDL_VS2008.sln
Expand Up @@ -132,6 +132,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwm", "tests\testwm\test
{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
Expand Down Expand Up @@ -355,6 +357,15 @@ Global
{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
Expand All @@ -381,5 +392,6 @@ Global
{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
15 changes: 7 additions & 8 deletions VisualC/tests/testshape/testshape.vcproj
@@ -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
Expand Down Expand Up @@ -78,6 +79,8 @@
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/testshape.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
Expand All @@ -97,9 +100,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
Expand Down Expand Up @@ -169,6 +169,8 @@
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/testshape.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
Expand All @@ -188,9 +190,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/audio/SDL_audio.c
Expand Up @@ -339,7 +339,7 @@ SDL_RunAudio(void *devicep)

/* 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();
Expand Down
4 changes: 4 additions & 0 deletions test/automated/rwops/TestSupportRWops_Generic.c
@@ -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"

Expand Down
2 changes: 1 addition & 1 deletion test/graywin.c
Expand Up @@ -25,7 +25,7 @@ DrawBox(SDL_Surface * screen, int X, int Y, int width, int height)

/* Seed the random number generator */
if (seeded == 0) {
srand(time(NULL));
srand((unsigned int)time(NULL));
seeded = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion test/testdraw2.c
Expand Up @@ -234,7 +234,7 @@ main(int argc, char *argv[])
SDL_RenderClear();
}

srand(time(NULL));
srand((unsigned int)time(NULL));

/* Main render loop */
frames = 0;
Expand Down
3 changes: 3 additions & 0 deletions test/testfile.c
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/testgl.c
Expand Up @@ -654,7 +654,7 @@ RunGLTest(int argc, char *argv[],
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);
Expand Down
16 changes: 8 additions & 8 deletions test/testoverlay.c
Expand Up @@ -38,23 +38,23 @@ RGBtoYUV(Uint8 * rgb, int *yuv, int monochrome, int luminance)
{
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
}

Expand Down
12 changes: 6 additions & 6 deletions test/testoverlay2.c
Expand Up @@ -144,19 +144,19 @@ RGBtoYUV(Uint8 * rgb, int *yuv, int monochrome, int luminance)
{
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]);
Expand Down Expand Up @@ -606,7 +606,7 @@ main(int argc, char **argv)
}

if ((!paused) || (resized)) {
if (((SDL_GetTicks() - lastftick) > fpsdelay) || (resized)) {
if (((SDL_GetTicks() - lastftick) > (Uint32)fpsdelay) || (resized)) {
lastftick = SDL_GetTicks();

switch (overlay_format) {
Expand Down
6 changes: 3 additions & 3 deletions test/testsprite.c
Expand Up @@ -100,7 +100,7 @@ MoveSprites(SDL_Surface * screen, Uint32 background)
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;
Expand Down Expand Up @@ -141,7 +141,7 @@ FastestFlags(Uint32 flags, int width, int height, int bpp)
/* 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;
Expand Down Expand Up @@ -236,7 +236,7 @@ main(int argc, char *argv[])
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);
Expand Down
3 changes: 2 additions & 1 deletion test/testsprite2.c
Expand Up @@ -315,7 +315,7 @@ main(int argc, char *argv[])
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;
Expand Down Expand Up @@ -368,6 +368,7 @@ main(int argc, char *argv[])
printf("%2.2f frames per second\n", fps);
}
quit(0);
return 0;
}

/* vi: set ts=4 sw=4 expandtab: */

0 comments on commit b6038a5

Please sign in to comment.