Commit 1975b91f authored by Andreas Schiffler's avatar Andreas Schiffler

- 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
parent 458c6eda
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" 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__" PreprocessorDefinitions="_DEBUG;_WINDOWS;_WIN32_WINNT=0x0400;__MMX__;__3dNOW__;__SSE__;__SSE2__"
RuntimeLibrary="2" RuntimeLibrary="2"
BufferSecurityCheck="false" BufferSecurityCheck="false"
......
...@@ -132,6 +132,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwm", "tests\testwm\test ...@@ -132,6 +132,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwm", "tests\testwm\test
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape.vcproj", "{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32 Debug|Win32 = Debug|Win32
...@@ -355,6 +357,15 @@ Global ...@@ -355,6 +357,15 @@ Global
{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release|Win32.ActiveCfg = Release|Win32 {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|Win32.Build.0 = Release|Win32
{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release|x64.ActiveCfg = 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 EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
...@@ -381,5 +392,6 @@ Global ...@@ -381,5 +392,6 @@ Global
{575FD095-EDAB-4BD4-B733-CD4A874F6FB0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {575FD095-EDAB-4BD4-B733-CD4A874F6FB0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
{0FFD1A21-11DB-492C-A989-E4F195B0C441} = {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} {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8.00" Version="9.00"
Name="testshape" Name="testshape"
ProjectGUID="{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}" ProjectGUID="{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}"
TargetFrameworkVersion="131072"
> >
<Platforms> <Platforms>
<Platform <Platform
...@@ -78,6 +79,8 @@ ...@@ -78,6 +79,8 @@
SuppressStartupBanner="true" SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/testshape.pdb" ProgramDatabaseFile=".\Release/testshape.pdb"
SubSystem="2" SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
...@@ -97,9 +100,6 @@ ...@@ -97,9 +100,6 @@
<Tool <Tool
Name="VCAppVerifierTool" Name="VCAppVerifierTool"
/> />
<Tool
Name="VCWebDeploymentTool"
/>
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
...@@ -169,6 +169,8 @@ ...@@ -169,6 +169,8 @@
GenerateDebugInformation="true" GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/testshape.pdb" ProgramDatabaseFile=".\Debug/testshape.pdb"
SubSystem="2" SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
...@@ -188,9 +190,6 @@ ...@@ -188,9 +190,6 @@
<Tool <Tool
Name="VCAppVerifierTool" Name="VCAppVerifierTool"
/> />
<Tool
Name="VCWebDeploymentTool"
/>
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
......
...@@ -339,7 +339,7 @@ SDL_RunAudio(void *devicep) ...@@ -339,7 +339,7 @@ SDL_RunAudio(void *devicep)
/* For streaming when the buffer sizes don't match up */ /* For streaming when the buffer sizes don't match up */
Uint8 *istream; Uint8 *istream;
int istream_len; int istream_len = 0;
/* Perform any thread setup */ /* Perform any thread setup */
device->threadid = SDL_ThreadID(); device->threadid = SDL_ThreadID();
......
/* Generic implementation for file opening routines. /* Generic implementation for file opening routines.
* Customizations for specific platforms should go in alternative files. * Customizations for specific platforms should go in alternative files.
*/ */
// quiet win32 compiler warnings
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h> #include <stdio.h>
#include "SDL.h" #include "SDL.h"
......
...@@ -25,7 +25,7 @@ DrawBox(SDL_Surface * screen, int X, int Y, int width, int height) ...@@ -25,7 +25,7 @@ DrawBox(SDL_Surface * screen, int X, int Y, int width, int height)
/* Seed the random number generator */ /* Seed the random number generator */
if (seeded == 0) { if (seeded == 0) {
srand(time(NULL)); srand((unsigned int)time(NULL));
seeded = 1; seeded = 1;
} }
......
...@@ -234,7 +234,7 @@ main(int argc, char *argv[]) ...@@ -234,7 +234,7 @@ main(int argc, char *argv[])
SDL_RenderClear(); SDL_RenderClear();
} }
srand(time(NULL)); srand((unsigned int)time(NULL));
/* Main render loop */ /* Main render loop */
frames = 0; frames = 0;
......
/* sanity tests on SDL_rwops.c (usefull for alternative implementations of stdio rwops) */ /* 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> #include <stdlib.h>
#ifndef _MSC_VER #ifndef _MSC_VER
......
...@@ -654,7 +654,7 @@ RunGLTest(int argc, char *argv[], ...@@ -654,7 +654,7 @@ RunGLTest(int argc, char *argv[],
fprintf(stderr, "testgl: OpenGL error: %d\n", gl_error); fprintf(stderr, "testgl: OpenGL error: %d\n", gl_error);
} }
sdl_error = SDL_GetError(); sdl_error = (char *)SDL_GetError();
if (sdl_error[0] != '\0') { if (sdl_error[0] != '\0') {
fprintf(stderr, "testgl: SDL error '%s'\n", sdl_error); fprintf(stderr, "testgl: SDL error '%s'\n", sdl_error);
......
...@@ -38,23 +38,23 @@ RGBtoYUV(Uint8 * rgb, int *yuv, int monochrome, int luminance) ...@@ -38,23 +38,23 @@ RGBtoYUV(Uint8 * rgb, int *yuv, int monochrome, int luminance)
{ {
if (monochrome) { if (monochrome) {
#if 1 /* these are the two formulas that I found on the FourCC site... */ #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[1] = 128;
yuv[2] = 128; yuv[2] = 128;
#else #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[1] = 128;
yuv[2] = 128; yuv[2] = 128;
#endif #endif
} else { } else {
#if 1 /* these are the two formulas that I found on the FourCC site... */ #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] = (rgb[2] - yuv[0]) * 0.565 + 128; yuv[1] = (int)((rgb[2] - yuv[0]) * 0.565 + 128);
yuv[2] = (rgb[0] - yuv[0]) * 0.713 + 128; yuv[2] = (int)((rgb[0] - yuv[0]) * 0.713 + 128);
#else #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 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2]); yuv[1] = (int)(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[2] = (int)(128 + (0.439 * rgb[0]) - (0.368 * rgb[1]) - (0.071 * rgb[2]));
#endif #endif
} }
......
...@@ -144,19 +144,19 @@ RGBtoYUV(Uint8 * rgb, int *yuv, int monochrome, int luminance) ...@@ -144,19 +144,19 @@ RGBtoYUV(Uint8 * rgb, int *yuv, int monochrome, int luminance)
{ {
if (monochrome) { if (monochrome) {
#if 1 /* these are the two formulas that I found on the FourCC site... */ #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[1] = 128;
yuv[2] = 128; yuv[2] = 128;
#else #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[1] = 128;
yuv[2] = 128; yuv[2] = 128;
#endif #endif
} else { } else {
#if 1 /* these are the two formulas that I found on the FourCC site... */ #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] = (rgb[2] - yuv[0]) * 0.565 + 128; yuv[1] = (int)((rgb[2] - yuv[0]) * 0.565 + 128);
yuv[2] = (rgb[0] - yuv[0]) * 0.713 + 128; yuv[2] = (int)((rgb[0] - yuv[0]) * 0.713 + 128);
#else #else
yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16; 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[1] = 128 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2]);
...@@ -606,7 +606,7 @@ main(int argc, char **argv) ...@@ -606,7 +606,7 @@ main(int argc, char **argv)
} }
if ((!paused) || (resized)) { if ((!paused) || (resized)) {
if (((SDL_GetTicks() - lastftick) > fpsdelay) || (resized)) { if (((SDL_GetTicks() - lastftick) > (Uint32)fpsdelay) || (resized)) {
lastftick = SDL_GetTicks(); lastftick = SDL_GetTicks();
switch (overlay_format) { switch (overlay_format) {
......
...@@ -100,7 +100,7 @@ MoveSprites(SDL_Surface * screen, Uint32 background) ...@@ -100,7 +100,7 @@ MoveSprites(SDL_Surface * screen, Uint32 background)
Uint32 color = SDL_MapRGB(screen->format, 255, 0, 0); Uint32 color = SDL_MapRGB(screen->format, 255, 0, 0);
SDL_Rect r; SDL_Rect r;
r.x = 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.y = 0;
r.w = 20; r.w = 20;
r.h = screen->h; r.h = screen->h;
...@@ -141,7 +141,7 @@ FastestFlags(Uint32 flags, int width, int height, int bpp) ...@@ -141,7 +141,7 @@ FastestFlags(Uint32 flags, int width, int height, int bpp)
/* Direct hardware blitting without double-buffering /* Direct hardware blitting without double-buffering
causes really bad flickering. 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; flags |= SDL_DOUBLEBUF;
} else { } else {
flags &= ~SDL_HWSURFACE; flags &= ~SDL_HWSURFACE;
...@@ -236,7 +236,7 @@ main(int argc, char *argv[]) ...@@ -236,7 +236,7 @@ main(int argc, char *argv[])
sprite_rects += numsprites; sprite_rects += numsprites;
sprite_w = sprite->w; sprite_w = sprite->w;
sprite_h = sprite->h; sprite_h = sprite->h;
srand(time(NULL)); srand((unsigned int)time(NULL));
for (i = 0; i < numsprites; ++i) { for (i = 0; i < numsprites; ++i) {
positions[i].x = rand() % (screen->w - sprite_w); positions[i].x = rand() % (screen->w - sprite_w);
positions[i].y = rand() % (screen->h - sprite_h); positions[i].y = rand() % (screen->h - sprite_h);
......
...@@ -315,7 +315,7 @@ main(int argc, char *argv[]) ...@@ -315,7 +315,7 @@ main(int argc, char *argv[])
fprintf(stderr, "Out of memory!\n"); fprintf(stderr, "Out of memory!\n");
quit(2); quit(2);
} }
srand(time(NULL)); srand((unsigned int)time(NULL));
if (scaleMode != SDL_TEXTURESCALEMODE_NONE) { if (scaleMode != SDL_TEXTURESCALEMODE_NONE) {
sprite_w += sprite_w / 2; sprite_w += sprite_w / 2;
sprite_h += sprite_h / 2; sprite_h += sprite_h / 2;
...@@ -368,6 +368,7 @@ main(int argc, char *argv[]) ...@@ -368,6 +368,7 @@ main(int argc, char *argv[])
printf("%2.2f frames per second\n", fps); printf("%2.2f frames per second\n", fps);
} }
quit(0); quit(0);
return 0;
} }
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment