From b2cf196d74ed93883d125e4482ddf3c4ce6e11a7 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 15 Jun 2004 06:24:58 +0000 Subject: [PATCH] fixing Xbox compile errors --- stepmania/src/RageDisplay_D3D.cpp | 4 +- stepmania/src/RageSoundManager.h | 2 +- stepmania/src/RageSurface_Load_JPEG.cpp | 5 + stepmania/src/RageThreads.cpp | 2 +- stepmania/src/StepManiaXbox.sln | 10 +- stepmania/src/StepManiaXbox.vcproj | 369 +----------------------- stepmania/src/ezsockets.cpp | 15 +- stepmania/src/ezsockets.h | 8 +- 8 files changed, 30 insertions(+), 385 deletions(-) diff --git a/stepmania/src/RageDisplay_D3D.cpp b/stepmania/src/RageDisplay_D3D.cpp index a14f19e58a..969184caf2 100644 --- a/stepmania/src/RageDisplay_D3D.cpp +++ b/stepmania/src/RageDisplay_D3D.cpp @@ -683,7 +683,9 @@ bool RageDisplay_D3D::SupportsTextureFormat( PixelFormat pixfmt, bool realtime ) RageSurface* RageDisplay_D3D::CreateScreenshot() { -#ifndef _XBOX +#if defined(_XBOX) + return NULL; +#elif /* Get the back buffer. */ IDirect3DSurface8* pSurface; g_pd3dDevice->GetBackBuffer( 0, D3DBACKBUFFER_TYPE_MONO, &pSurface ); diff --git a/stepmania/src/RageSoundManager.h b/stepmania/src/RageSoundManager.h index 53890ed560..f918f3788f 100644 --- a/stepmania/src/RageSoundManager.h +++ b/stepmania/src/RageSoundManager.h @@ -11,7 +11,7 @@ class RageSoundDriver; struct RageSoundParams; /* This is a temporary hack, to try to track down an obscure crash. */ -#if defined(_MSC_VER) && _MSC_VER >= 1300 +#if defined(_WINDOWS) && _MSC_VER >= 1300 #include extern set g_ProtectedPages; diff --git a/stepmania/src/RageSurface_Load_JPEG.cpp b/stepmania/src/RageSurface_Load_JPEG.cpp index d4837866bd..7f9007eced 100644 --- a/stepmania/src/RageSurface_Load_JPEG.cpp +++ b/stepmania/src/RageSurface_Load_JPEG.cpp @@ -8,6 +8,11 @@ #include +// Don't let jpeglib.h define the boolean type on Xbox. +#if defined(_XBOX) +# define HAVE_BOOLEAN +#endif + #if defined(WIN32) /* work around namespace bugs in win32/libjpeg: */ #define XMD_H diff --git a/stepmania/src/RageThreads.cpp b/stepmania/src/RageThreads.cpp index 88a29bdc19..f5e1ff9c29 100644 --- a/stepmania/src/RageThreads.cpp +++ b/stepmania/src/RageThreads.cpp @@ -22,7 +22,7 @@ #include "arch/Threads/Threads.h" #if defined(CRASH_HANDLER) -#if defined(WIN32) +#if defined(_WINDOWS) #include "archutils/Win32/crash.h" #elif defined(LINUX) || defined(DARWIN) #include "archutils/Unix/CrashHandler.h" diff --git a/stepmania/src/StepManiaXbox.sln b/stepmania/src/StepManiaXbox.sln index 6f7ddd0ca3..fc834d37dd 100644 --- a/stepmania/src/StepManiaXbox.sln +++ b/stepmania/src/StepManiaXbox.sln @@ -3,18 +3,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StepMania", "StepManiaXbox. EndProject Global GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - ConfigName.2 = Debug Xbox - ConfigName.3 = Release Xbox + ConfigName.0 = Debug Xbox + ConfigName.1 = Release Xbox EndGlobalSection GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution - {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug.ActiveCfg = Debug|Win32 - {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug.Build.0 = Debug|Win32 - {670745A6-106B-420D-A2A9-D4F89A23986E}.Release.ActiveCfg = Release|Win32 - {670745A6-106B-420D-A2A9-D4F89A23986E}.Release.Build.0 = Release|Win32 {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug Xbox.ActiveCfg = Debug|Xbox {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug Xbox.Build.0 = Debug|Xbox {670745A6-106B-420D-A2A9-D4F89A23986E}.Release Xbox.ActiveCfg = Release|Xbox diff --git a/stepmania/src/StepManiaXbox.vcproj b/stepmania/src/StepManiaXbox.vcproj index 3222aa4bd3..a0a770f3ef 100644 --- a/stepmania/src/StepManiaXbox.vcproj +++ b/stepmania/src/StepManiaXbox.vcproj @@ -93,7 +93,7 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ Name="VCCLCompilerTool" Optimization="0" OptimizeForProcessor="2" - AdditionalIncludeDirectories=".;.\sdl_xbox_includes;".\SDL_image-1.2";".\plib-1.6.0";".\SDL_sound-1.0.0";vorbis" + AdditionalIncludeDirectories=".,sdl_xbox_includes,SDL_image-1.2;vorbis,libjpeg,lua-5.0" PreprocessorDefinitions="WIN32,_XBOX,_DEBUG,OGG_ONLY" RuntimeLibrary="1" UsePrecompiledHeader="2" @@ -1093,18 +1093,6 @@ cl - - - - - - - - - - - - - - - - - - - - + RelativePath="arch\InputHandler\InputHandler_SDL.cpp"> - - - - - - - - - - - - + RelativePath="arch\InputHandler\InputHandler_SDL.h"> - - - - - - - - @@ -1274,18 +1214,6 @@ cl - - - - - - - - @@ -1326,75 +1254,6 @@ cl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2434,225 +2287,9 @@ cl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -26,7 +27,7 @@ EzSockets::EzSockets() memset ( &addr, 0, sizeof(addr) ); //Clear the sockaddr_in structure // Windows REQUIRES WinSock Startup -#if defined(WIN32) +#if defined(_WINDOWS) || defined(_XBOX) WSAStartup( MAKEWORD(1,1), &wsda ); #endif @@ -135,7 +136,11 @@ bool EzSockets::connect( const std::string& host, unsigned short port ) if (! check() ) return false; -#if defined(WIN32) +#if defined(_XBOX) + // FIXME: Xbox doesn't have gethostbyname or any way to get a hostent. + // Investigate the samples and figure out how this is supposed to work. + return false; +#elif defined(_WINDOWS) struct hostent* phe; addr.sin_family = AF_INET; @@ -144,15 +149,15 @@ bool EzSockets::connect( const std::string& host, unsigned short port ) addr.sin_addr = *( (LPIN_ADDR)*phe->h_addr_list ); int desc = ::connect( sock, (struct sockaddr *)&addr, sizeof(addr) ); + return desc >= 0; #else addr.sin_family = AF_INET; addr.sin_port = htons( port ); inet_pton( AF_INET, host.c_str(), &addr.sin_addr ); int desc = ::connect( sock, (struct sockaddr *)&addr, sizeof(addr) ); -#endif - return desc >= 0; +#endif } diff --git a/stepmania/src/ezsockets.h b/stepmania/src/ezsockets.h index 775d070b02..7f1261891f 100644 --- a/stepmania/src/ezsockets.h +++ b/stepmania/src/ezsockets.h @@ -9,7 +9,9 @@ #include #include -#if defined(WIN32) +#if defined(_XBOX) +#include +#elif defined(_WINDOWS) #include #else #include @@ -105,8 +107,8 @@ public: private: - //Only necessiary in windows -#if defined(WIN32) + //Only necessiary in windows, xbox +#if defined(_WINDOWS) || defined(_XBOX) WSADATA wsda; #endif