From 0d911c535b6fd0d602898413ea1c69faffebc90f Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 3 May 2011 21:53:51 -0400 Subject: [PATCH 01/11] My attempt at fixing VS2008 compilation. Revert this if it proves to be broken beyond repair. --- src/StepMania-net2008.vcproj | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/StepMania-net2008.vcproj b/src/StepMania-net2008.vcproj index 0472414bf6..3b9f03b9b4 100644 --- a/src/StepMania-net2008.vcproj +++ b/src/StepMania-net2008.vcproj @@ -261,7 +261,7 @@ + + + + + + From d19de4ed1ef0d2b83d08a44b640f8b654b9a9fad Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 3 May 2011 21:59:59 -0400 Subject: [PATCH 02/11] shakesoda's suggestions for more glew stuff. Again, revert if a terrible idea. --- src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp b/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp index 9a085108b1..1e0f27f635 100644 --- a/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp +++ b/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp @@ -10,7 +10,7 @@ #include "RageDisplay_OGL_Helpers.h" #include "RageDisplay_OGL.h" -#include +#include static PIXELFORMATDESCRIPTOR g_CurrentPixelFormat; static HGLRC g_HGLRC = NULL; @@ -351,7 +351,7 @@ void RenderTarget_Win32::Create(const RenderTargetParam ¶m, int &iTextureWid GLenum internalformat; GLenum type = param.bWithAlpha? GL_RGBA:GL_RGB; - if( param.bFloat && GLExt.m_bGL_ARB_texture_float ) + if( param.bFloat && m_bGL_ARB_texture_float ) internalformat = param.bWithAlpha? GL_RGBA16F_ARB:GL_RGB16F_ARB; else internalformat = param.bWithAlpha? GL_RGBA8:GL_RGB8; From 4e22702026b6170a33fc0cb490f469216c6542a9 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 3 May 2011 22:09:15 -0400 Subject: [PATCH 03/11] Try different variable name, only one . We'll get this figured out... --- src/StepMania-net2008.vcproj | 8 +++----- src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/StepMania-net2008.vcproj b/src/StepMania-net2008.vcproj index 3b9f03b9b4..eb6e7129d6 100644 --- a/src/StepMania-net2008.vcproj +++ b/src/StepMania-net2008.vcproj @@ -445,11 +445,9 @@ - - - - - + + + Date: Tue, 3 May 2011 22:20:37 -0400 Subject: [PATCH 04/11] lua had " put it here to see. --- src/StepMania-net2008.vcproj | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/StepMania-net2008.vcproj b/src/StepMania-net2008.vcproj index eb6e7129d6..351d471cd8 100644 --- a/src/StepMania-net2008.vcproj +++ b/src/StepMania-net2008.vcproj @@ -261,7 +261,7 @@ - - + + Date: Tue, 3 May 2011 22:23:16 -0400 Subject: [PATCH 05/11] Looks like I missed a few environments. --- src/StepMania-net2008.vcproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/StepMania-net2008.vcproj b/src/StepMania-net2008.vcproj index 351d471cd8..07c00f0c5a 100644 --- a/src/StepMania-net2008.vcproj +++ b/src/StepMania-net2008.vcproj @@ -50,7 +50,7 @@ Date: Tue, 3 May 2011 22:31:08 -0400 Subject: [PATCH 06/11] FILE, not DIRECTORY! --- src/StepMania-net2008.vcproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StepMania-net2008.vcproj b/src/StepMania-net2008.vcproj index 07c00f0c5a..88d27d87bd 100644 --- a/src/StepMania-net2008.vcproj +++ b/src/StepMania-net2008.vcproj @@ -449,7 +449,7 @@ Name="glew-1.5.8" > From 0b327836979d8bcc3fdaf2dea5e76aee8f47e075 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Wed, 4 May 2011 00:26:12 -0500 Subject: [PATCH 07/11] this seems to fix the compile on Windows; not sure if it's the best way of doing it, though. --- src/RageDisplay_OGL.cpp | 12 ++++++++++- src/StepMania-net2008.vcproj | 40 ++++++++++++++++++++++++++++++++---- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/src/RageDisplay_OGL.cpp b/src/RageDisplay_OGL.cpp index 1856705667..8bdef356c1 100644 --- a/src/RageDisplay_OGL.cpp +++ b/src/RageDisplay_OGL.cpp @@ -704,6 +704,11 @@ void RageDisplay_Legacy::ResolutionChanged() RageDisplay::ResolutionChanged(); } +#if defined(WINDOWS) + typedef BOOL (APIENTRY *PFNWGLSWAPINTERVALFARPROC)( int ); + PFNWGLSWAPINTERVALFARPROC wglSwapIntervalEXT = 0; +#endif + // Return true if mode change was successful. // bNewDeviceOut is set true if a new device was created and textures // need to be reloaded. @@ -739,11 +744,16 @@ RString RageDisplay_Legacy::TryVideoMode( const VideoModeParams &p, bool &bNewDe InitShaders(); } + const char *extensions = reinterpret_cast(glGetString( GL_EXTENSIONS )); // I'm not sure this is correct -Colby #if defined(WINDOWS) + if( strstr( extensions, "WGL_EXT_swap_control" ) == 0 ) + return RString("The WGL_EXT_swap_control extension is not supported on your computer."); + /* Set vsync the Windows way, if we can. (What other extensions are there * to do this, for other archs?) */ - if (GLEW_WGL_EXT_swap_control) + wglSwapIntervalEXT = (PFNWGLSWAPINTERVALFARPROC)wglGetProcAddress( "wglSwapIntervalEXT" ); + if (wglSwapIntervalEXT) wglSwapIntervalEXT(p.vsync); #endif diff --git a/src/StepMania-net2008.vcproj b/src/StepMania-net2008.vcproj index 88d27d87bd..53c1ab9c8a 100644 --- a/src/StepMania-net2008.vcproj +++ b/src/StepMania-net2008.vcproj @@ -51,7 +51,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=".;vorbis;libjpeg;"lua-5.1\include";ffmpeg\modern_working\include;BaseClasses;jsoncpp/include;"..\extern\glew-1.5.8\include"" - PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG" + PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG,GLEW_STATIC" ExceptionHandling="0" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -158,7 +158,7 @@ EnableIntrinsicFunctions="true" FavorSizeOrSpeed="2" AdditionalIncludeDirectories=".;vorbis;libjpeg;"lua-5.1\include";ffmpeg\modern_working\include;BaseClasses;jsoncpp/include;"..\extern\glew-1.5.8\include"" - PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,WINDOWS,RELEASE" + PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,WINDOWS,RELEASE,GLEW_STATIC" StringPooling="true" MinimalRebuild="false" ExceptionHandling="0" @@ -262,7 +262,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=".;vorbis;libjpeg;"lua-5.1\include";ffmpeg\modern_working\include;BaseClasses;jsoncpp/include;"..\extern\glew-1.5.8\include"" - PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG" + PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG,GLEW_STATIC" ExceptionHandling="0" BasicRuntimeChecks="0" RuntimeLibrary="3" @@ -369,7 +369,7 @@ EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" AdditionalIncludeDirectories=".;vorbis;libjpeg;"lua-5.1\include";ffmpeg\modern_working\include;BaseClasses;jsoncpp/include;"..\extern\glew-1.5.8\include"" - PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,WINDOWS,RELEASE" + PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,WINDOWS,RELEASE,GLEW_STATIC" StringPooling="true" MinimalRebuild="false" ExceptionHandling="0" @@ -451,6 +451,38 @@ + + + + + + + + + + + + Date: Wed, 4 May 2011 00:31:42 -0500 Subject: [PATCH 08/11] simplify like fuc --- src/RageDisplay_OGL.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/RageDisplay_OGL.cpp b/src/RageDisplay_OGL.cpp index 8bdef356c1..8f45c2a326 100644 --- a/src/RageDisplay_OGL.cpp +++ b/src/RageDisplay_OGL.cpp @@ -22,6 +22,8 @@ using namespace RageDisplay_Legacy_Helpers; #include +#include + #if defined(_MSC_VER) #pragma comment(lib, "opengl32.lib") #pragma comment(lib, "glu32.lib") @@ -704,11 +706,6 @@ void RageDisplay_Legacy::ResolutionChanged() RageDisplay::ResolutionChanged(); } -#if defined(WINDOWS) - typedef BOOL (APIENTRY *PFNWGLSWAPINTERVALFARPROC)( int ); - PFNWGLSWAPINTERVALFARPROC wglSwapIntervalEXT = 0; -#endif - // Return true if mode change was successful. // bNewDeviceOut is set true if a new device was created and textures // need to be reloaded. @@ -744,17 +741,14 @@ RString RageDisplay_Legacy::TryVideoMode( const VideoModeParams &p, bool &bNewDe InitShaders(); } - const char *extensions = reinterpret_cast(glGetString( GL_EXTENSIONS )); // I'm not sure this is correct -Colby #if defined(WINDOWS) - if( strstr( extensions, "WGL_EXT_swap_control" ) == 0 ) - return RString("The WGL_EXT_swap_control extension is not supported on your computer."); - /* Set vsync the Windows way, if we can. (What other extensions are there * to do this, for other archs?) */ - wglSwapIntervalEXT = (PFNWGLSWAPINTERVALFARPROC)wglGetProcAddress( "wglSwapIntervalEXT" ); - if (wglSwapIntervalEXT) + if( wglewIsSupported("WGL_EXT_swap_control") ) wglSwapIntervalEXT(p.vsync); + else + return RString("The WGL_EXT_swap_control extension is not supported on your computer."); #endif ResolutionChanged(); From f9514958bfebadb37953dcce1e90d1a17b8b9919 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Wed, 4 May 2011 00:33:32 -0500 Subject: [PATCH 09/11] put wglew behind #if defined(WINDOWS) --- src/RageDisplay_OGL.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/RageDisplay_OGL.cpp b/src/RageDisplay_OGL.cpp index 8f45c2a326..0b47a78bf2 100644 --- a/src/RageDisplay_OGL.cpp +++ b/src/RageDisplay_OGL.cpp @@ -22,7 +22,9 @@ using namespace RageDisplay_Legacy_Helpers; #include +#if defined(WINDOWS) #include +#endif #if defined(_MSC_VER) #pragma comment(lib, "opengl32.lib") From 6ae77039c93f743ac377e34700fd5eb5af00101d Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Wed, 4 May 2011 16:48:48 -0400 Subject: [PATCH 10/11] Consistent measure comments with internals. For some time, we had the text file use // measure 1 when it was measure 0 internally. As usual, revert if this is a bad idea. It's just bugging me. --- src/NoteDataUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NoteDataUtil.cpp b/src/NoteDataUtil.cpp index 9b5748ce39..6b7f47cba1 100644 --- a/src/NoteDataUtil.cpp +++ b/src/NoteDataUtil.cpp @@ -367,7 +367,7 @@ void NoteDataUtil::GetSMNoteDataString( const NoteData &in, RString &sRet ) { if( m ) sRet.append( 1, ',' ); - sRet += ssprintf(" // measure %d\n", m+1); + sRet += ssprintf(" // measure %d\n", m); NoteType nt = GetSmallestNoteTypeForMeasure( *nd, m ); int iRowSpacing; From 1aef2c25d4bf49355ec23ccbc97118c36fe8d366 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Wed, 4 May 2011 17:05:32 -0400 Subject: [PATCH 11/11] Manual attempts at updating old VS projects. Again, I'll ask. Do we need to keep VS2003 support? --- src/StepMania-net2003.vcproj | 25 +++++++++++++++++++------ src/StepMania-net2005.vcproj | 25 +++++++++++++++++++------ 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/src/StepMania-net2003.vcproj b/src/StepMania-net2003.vcproj index 9b4c749cc7..4775f452bc 100644 --- a/src/StepMania-net2003.vcproj +++ b/src/StepMania-net2003.vcproj @@ -25,8 +25,8 @@ Name="VCCLCompilerTool" AdditionalOptions="/EHa" Optimization="0" - AdditionalIncludeDirectories=".;vorbis;libjpeg;"ffmpeg\include";est" - PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG" + AdditionalIncludeDirectories=".;vorbis;libjpeg;"ffmpeg\include";est;"..\extern\glew-1.5.8\include"" + PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG,GLEW_STATIC" ExceptionHandling="FALSE" BasicRuntimeChecks="3" RuntimeLibrary="2" @@ -109,8 +109,8 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ FavorSizeOrSpeed="2" OptimizeForProcessor="2" OptimizeForWindowsApplication="TRUE" - AdditionalIncludeDirectories=".;vorbis;libjpeg;"ffmpeg\include"" - PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,WINDOWS,RELEASE" + AdditionalIncludeDirectories=".;vorbis;libjpeg;"ffmpeg\include";"..\extern\glew-1.5.8\include"" + PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,WINDOWS,RELEASE,GLEW_STATIC" StringPooling="TRUE" MinimalRebuild="FALSE" ExceptionHandling="FALSE" @@ -190,8 +190,8 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ Name="VCCLCompilerTool" AdditionalOptions="/EHa" Optimization="0" - AdditionalIncludeDirectories=".;vorbis;libjpeg;"ffmpeg\include"" - PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG" + AdditionalIncludeDirectories=".;vorbis;libjpeg;"ffmpeg\include";"..\extern\glew-1.5.8\include"" + PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG,GLEW_STATIC" ExceptionHandling="FALSE" BasicRuntimeChecks="0" RuntimeLibrary="2" @@ -259,6 +259,19 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ + + + + + + + + + + + + + diff --git a/src/StepMania-net2005.vcproj b/src/StepMania-net2005.vcproj index f3776ba489..00fce456ba 100644 --- a/src/StepMania-net2005.vcproj +++ b/src/StepMania-net2005.vcproj @@ -49,8 +49,8 @@ + + + + + + + + + + + + +