From 1787992f59a3b83c4f4daf85bd78b6a8f3bd75ff Mon Sep 17 00:00:00 2001 From: Cass Everitt Date: Mon, 6 Jan 2014 18:23:27 -0600 Subject: [PATCH] partial update to Win32 build, not working yet --- build/win32/vs2010/Regal/Regal.vcxproj | 715 ++++++++++++------------- src/regal/Regal.cpp | 2 +- src/regal/RegalDispatchHttp.h | 1 + src/regal/RegalHttp.cpp | 23 +- src/regal/RegalLayerInfo.h | 13 + src/regal/RegalMutex.h | 17 + 6 files changed, 405 insertions(+), 366 deletions(-) diff --git a/build/win32/vs2010/Regal/Regal.vcxproj b/build/win32/vs2010/Regal/Regal.vcxproj index 6e3d577..d014e05 100755 --- a/build/win32/vs2010/Regal/Regal.vcxproj +++ b/build/win32/vs2010/Regal/Regal.vcxproj @@ -1,359 +1,358 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - Regal - {6B2786AC-DF6B-8B13-DE42-875D8D9194D9} - - - - DynamicLibrary - false - Unicode - - - DynamicLibrary - false - Unicode - - - DynamicLibrary - false - Unicode - - - DynamicLibrary - false - Unicode - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - Release\Win32\ - Release\x64\ - Release\Win32\Regal\ - Release\x64\Regal\ - Debug\Win32\ - Debug\x64\ - Debug\Win32\Regal\ - Debug\x64\Regal\ - regal32 - regal32 - regal32 - regal32 - - - - MaxSpeed - OnlyExplicitInline - ../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories) - REGAL_NO_SQUISH=1;REGAL_SYS_WGL_DECLARE_WGL;REGAL_WIN_TLS=1;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Release\Win32\Regal\ - Release\Win32\Regal\ - Release\Win32\regal32.pdb - Level4 - true - Default - 4996 - %(AdditionalOptions) - true - - - mongooselib.lib;md5lib.lib;jsonsllib.lib;squishlib.lib;apitracelib.lib;snappylib.lib;pnglib.lib;zlib.lib;advapi32.lib;gdi32.lib;user32.lib;ws2_32.lib;%(AdditionalDependencies) - true - Release\Win32\;%(AdditionalLibraryDirectories) - ../../../../src/regal/Regal.def - Release\Win32\regal32.pdb - Console - MachineX86 - Release\Win32\regal32.lib - - - - - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - - - MaxSpeed - OnlyExplicitInline - ../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories) - REGAL_NO_SQUISH=1;REGAL_SYS_WGL_DECLARE_WGL;REGAL_WIN_TLS=1;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Release\x64\Regal\ - Release\x64\Regal\ - Release\x64\regal32.pdb - Level4 - true - Default - 4996 - ProgramDatabase - %(AdditionalOptions) - true - - - mongooselib.lib;md5lib.lib;jsonsllib.lib;squishlib.lib;apitracelib.lib;snappylib.lib;pnglib.lib;zlib.lib;advapi32.lib;gdi32.lib;user32.lib;ws2_32.lib;%(AdditionalDependencies) - true - Release\x64\;%(AdditionalLibraryDirectories) - ../../../../src/regal/Regal.def - Release\x64\regal32.pdb - Console - Release\x64\regal32.lib - - - - - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - - - Disabled - ../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories) - REGAL_NO_SQUISH=1;REGAL_SYS_WGL_DECLARE_WGL;REGAL_WIN_TLS=1;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Debug\Win32\Regal\ - Debug\Win32\Regal\ - Debug\Win32\regal32.pdb - Level4 - true - EditAndContinue - Default - 4996 - %(AdditionalOptions) - true - - - mongooselib.lib;md5lib.lib;jsonsllib.lib;squishlib.lib;apitracelib.lib;snappylib.lib;pnglib.lib;zlib.lib;advapi32.lib;gdi32.lib;user32.lib;ws2_32.lib;%(AdditionalDependencies) - true - Debug\Win32\;%(AdditionalLibraryDirectories) - ../../../../src/regal/Regal.def - true - Debug\Win32\regal32.pdb - Console - MachineX86 - Debug\Win32\regal32.lib - - - - - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - - - Disabled - ../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories) - REGAL_NO_SQUISH=1;REGAL_SYS_WGL_DECLARE_WGL;REGAL_WIN_TLS=1;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Debug\x64\Regal\ - Debug\x64\Regal\ - Debug\x64\regal32.pdb - Level4 - true - Default - 4996 - ProgramDatabase - %(AdditionalOptions) - true - - - mongooselib.lib;md5lib.lib;jsonsllib.lib;squishlib.lib;apitracelib.lib;snappylib.lib;pnglib.lib;zlib.lib;advapi32.lib;gdi32.lib;user32.lib;ws2_32.lib;%(AdditionalDependencies) - true - Debug\x64\;%(AdditionalLibraryDirectories) - ../../../../src/regal/Regal.def - true - Debug\x64\regal32.pdb - Console - Debug\x64\regal32.lib - - - - - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + Regal + {6B2786AC-DF6B-8B13-DE42-875D8D9194D9} + + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + Release\Win32\ + Release\x64\ + Release\Win32\Regal\ + Release\x64\Regal\ + Debug\Win32\ + Debug\x64\ + Debug\Win32\Regal\ + Debug\x64\Regal\ + regal32 + regal32 + regal32 + regal32 + + + + MaxSpeed + OnlyExplicitInline + ../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;../../../../src/pcre;%(AdditionalIncludeDirectories) + REGAL_NO_SQUISH=1;REGAL_SYS_WGL_DECLARE_WGL;REGAL_WIN_TLS=1;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Release\Win32\Regal\ + Release\Win32\Regal\ + Release\Win32\regal32.pdb + Level4 + true + Default + 4996 + %(AdditionalOptions) + true + + + mongooselib.lib;md5lib.lib;jsonsllib.lib;squishlib.lib;apitracelib.lib;snappylib.lib;pnglib.lib;zlib.lib;advapi32.lib;gdi32.lib;user32.lib;ws2_32.lib;%(AdditionalDependencies) + true + Release\Win32\;%(AdditionalLibraryDirectories) + ../../../../src/regal/Regal.def + Release\Win32\regal32.pdb + Console + MachineX86 + Release\Win32\regal32.lib + + + + + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + MaxSpeed + OnlyExplicitInline + ../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories) + REGAL_NO_SQUISH=1;REGAL_SYS_WGL_DECLARE_WGL;REGAL_WIN_TLS=1;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Release\x64\Regal\ + Release\x64\Regal\ + Release\x64\regal32.pdb + Level4 + true + Default + 4996 + ProgramDatabase + %(AdditionalOptions) + true + + + mongooselib.lib;md5lib.lib;jsonsllib.lib;squishlib.lib;apitracelib.lib;snappylib.lib;pnglib.lib;zlib.lib;advapi32.lib;gdi32.lib;user32.lib;ws2_32.lib;%(AdditionalDependencies) + true + Release\x64\;%(AdditionalLibraryDirectories) + ../../../../src/regal/Regal.def + Release\x64\regal32.pdb + Console + Release\x64\regal32.lib + + + + + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;../../../../src/pcre;%(AdditionalIncludeDirectories) + REGAL_NO_SQUISH=1;REGAL_SYS_WGL_DECLARE_WGL;REGAL_WIN_TLS=1;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Debug\Win32\Regal\ + Debug\Win32\Regal\ + Debug\Win32\regal32.pdb + Level4 + true + EditAndContinue + Default + 4996 + %(AdditionalOptions) + true + + + mongooselib.lib;md5lib.lib;jsonsllib.lib;squishlib.lib;apitracelib.lib;snappylib.lib;pnglib.lib;zlib.lib;advapi32.lib;gdi32.lib;user32.lib;ws2_32.lib;%(AdditionalDependencies) + true + Debug\Win32\;%(AdditionalLibraryDirectories) + ../../../../src/regal/Regal.def + true + Debug\Win32\regal32.pdb + Console + MachineX86 + Debug\Win32\regal32.lib + + + + + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories) + REGAL_NO_SQUISH=1;REGAL_SYS_WGL_DECLARE_WGL;REGAL_WIN_TLS=1;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Debug\x64\Regal\ + Debug\x64\Regal\ + Debug\x64\regal32.pdb + Level4 + true + Default + 4996 + ProgramDatabase + %(AdditionalOptions) + true + + + mongooselib.lib;md5lib.lib;jsonsllib.lib;squishlib.lib;apitracelib.lib;snappylib.lib;pnglib.lib;zlib.lib;advapi32.lib;gdi32.lib;user32.lib;ws2_32.lib;%(AdditionalDependencies) + true + Debug\x64\;%(AdditionalLibraryDirectories) + ../../../../src/regal/Regal.def + true + Debug\x64\regal32.pdb + Console + Debug\x64\regal32.lib + + + + + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/regal/Regal.cpp b/src/regal/Regal.cpp index ec3bea6..101a44a 100644 --- a/src/regal/Regal.cpp +++ b/src/regal/Regal.cpp @@ -42292,7 +42292,7 @@ extern "C" { RegalContext *_context = REGAL_GET_CONTEXT(); RegalAssert(_context); _context->hglrc = hglrc; - _context->hdc = hdc; + _context->hdc = hDC; } return ret; } diff --git a/src/regal/RegalDispatchHttp.h b/src/regal/RegalDispatchHttp.h index dba229a..5a2a641 100644 --- a/src/regal/RegalDispatchHttp.h +++ b/src/regal/RegalDispatchHttp.h @@ -71,6 +71,7 @@ struct Breakpoint { } void SetRegularExpression( const std::string & newRe ) { + UNUSED_PARAMETER(newRe); if( re ) { pcre_free( re ); } diff --git a/src/regal/RegalHttp.cpp b/src/regal/RegalHttp.cpp index 55cf34a..8c5f543 100644 --- a/src/regal/RegalHttp.cpp +++ b/src/regal/RegalHttp.cpp @@ -92,6 +92,10 @@ using boost::print::print_string; #include "mongoose.h" +#if REGAL_SYS_WGL +extern "C" { BOOL __stdcall Sleep(DWORD); } +#endif + REGAL_GLOBAL_END REGAL_NAMESPACE_BEGIN @@ -481,8 +485,8 @@ struct TextureHandler : public RequestHandler { const TextureObjectParameter & p = top[i]; h.gl.GetTextureParameter( texname, GL_TEXTURE_2D, p.pname, fval ); switch( p.pname ) { - case GL_TEXTURE_BASE_LEVEL: baseLevel = fval[0]; break; - case GL_TEXTURE_MAX_LEVEL: maxLevel = fval[0]; break; + case GL_TEXTURE_BASE_LEVEL: baseLevel = GLint(fval[0]); break; + case GL_TEXTURE_MAX_LEVEL: maxLevel = GLint(fval[0]); break; default: break; } if( fval[0] != p.initVal[0] ) { @@ -531,8 +535,8 @@ struct TextureHandler : public RequestHandler { h.gl.GetTextureLevelParameter( texname, texinfo.target, 0, GL_TEXTURE_WIDTH, &fwidth ); h.gl.GetTextureLevelParameter( texname, texinfo.target, 0, GL_TEXTURE_HEIGHT, &fheight ); - int width = fwidth; - int height = fheight; + int width = int(fwidth); + int height = int(fheight); if( width <= 0 || height <= 0 ) { // evil @@ -1136,7 +1140,7 @@ struct LogHandler : public RequestHandler { json += string( indent, ' ' ) + "\"log\": [\n"; indent += 2; - size_t base = startLine - front; + size_t base = size_t(startLine - front); for( size_t i = 0; i < numLines; i++ ) { string esc = EscapeJson( h.callLog[ base + i ] ); json += string( indent, ' ' ) + print_string( "\"", esc, "\",\n"); @@ -1254,7 +1258,11 @@ struct DebugHandler : public RequestHandler { if( ctx->http.runState == RS_Pause ) { break; } +#if ! REGAL_SYS_WGL usleep( 1000 ); +#else + Sleep(1); +#endif } } @@ -1359,7 +1367,7 @@ void Http::YieldToHttpServer( RegalContext * ctx, bool log ) static GLuint64 sz = 0; sz = max( sz, ( count.call - count.lastFrame + 1 ) ); if( callLog.size() > sz ) { - callLog.erase( callLog.begin(), callLog.begin() + ( callLog.size() - sz ) ); + callLog.erase( callLog.begin(), callLog.begin() + size_t( callLog.size() - sz ) ); } } @@ -1428,7 +1436,8 @@ void Http::ReleaseAppContext( RegalContext * ctx ) void Http::ContinueFromBreakpoint( RegalContext * ctx, HttpRunState rs ) { - if( runState == RS_Pause ) { + UNUSED_PARAMETER(ctx); + if( runState == RS_Pause ) { breakpointMutex->release(); breakpointMutex->acquire(); } diff --git a/src/regal/RegalLayerInfo.h b/src/regal/RegalLayerInfo.h index 7b51a40..e628def 100644 --- a/src/regal/RegalLayerInfo.h +++ b/src/regal/RegalLayerInfo.h @@ -85,6 +85,7 @@ namespace Emu } inline void SetBinEmuInfo( bool enable, EmuInfo *emuInfo, LayerInfo &layer ) { + UNUSED_PARAMETER(emuInfo); if( enable || layer.emulationNeeded == false ) { // set some sort of enable } @@ -111,6 +112,7 @@ namespace Emu } inline void SetFilterEmuInfo( bool enable, EmuInfo *emuInfo, LayerInfo &layer ) { + UNUSED_PARAMETER(emuInfo); if( enable || layer.emulationNeeded == false ) { // set some sort of enable } @@ -124,6 +126,7 @@ namespace Emu } inline void SetHintEmuInfo( bool enable, EmuInfo *emuInfo, LayerInfo &layer ) { + UNUSED_PARAMETER(emuInfo); if( enable || layer.emulationNeeded == false ) { // set some sort of enable } @@ -139,6 +142,7 @@ namespace Emu } inline void SetIffEmuInfo( bool enable, EmuInfo *emuInfo, LayerInfo &layer ) { + UNUSED_PARAMETER(emuInfo); if( enable || layer.emulationNeeded == false ) { // set some sort of enable } @@ -156,6 +160,7 @@ namespace Emu } inline void SetObjEmuInfo( bool enable, EmuInfo *emuInfo, LayerInfo &layer ) { + UNUSED_PARAMETER(emuInfo); if( enable || layer.emulationNeeded == false ) { // set some sort of enable } @@ -173,6 +178,7 @@ namespace Emu // FIXME: set correctly inline void GetPpaLayerInfo( RegalContext &ctx, LayerInfo &layer ) { + UNUSED_PARAMETER(ctx); layer = LayerInfo(); // Need ppca layer with core to track fixed function state // layer.emulationNeeded = ctx.info->es1 || ctx.info->es2 || ctx.info->core; @@ -181,6 +187,7 @@ namespace Emu } inline void SetPpaEmuInfo( bool enable, EmuInfo *emuInfo, LayerInfo &layer ) { + UNUSED_PARAMETER(emuInfo); if( enable || layer.emulationNeeded == false ) { // set some sort of enable } @@ -195,6 +202,7 @@ namespace Emu } inline void SetPpcaEmuInfo( bool enable, EmuInfo *emuInfo, LayerInfo &layer ) { + UNUSED_PARAMETER(emuInfo); if( enable || layer.emulationNeeded == false ) { // set some sort of enable } @@ -209,6 +217,7 @@ namespace Emu } inline void SetQuadsEmuInfo( bool enable, EmuInfo *emuInfo, LayerInfo &layer ) { + UNUSED_PARAMETER(emuInfo); if( enable || layer.emulationNeeded == false ) { // set some sort of enable } @@ -222,6 +231,7 @@ namespace Emu } inline void SetRectEmuInfo( bool enable, EmuInfo *emuInfo, LayerInfo &layer ) { + UNUSED_PARAMETER(emuInfo); if( enable || layer.emulationNeeded == false ) { // set some sort of enable } @@ -248,6 +258,7 @@ namespace Emu } inline void SetTexCEmuInfo( bool enable, EmuInfo *emuInfo, LayerInfo &layer ) { + UNUSED_PARAMETER(emuInfo); if( enable || layer.emulationNeeded == false ) { // set some sort of enable } @@ -262,6 +273,7 @@ namespace Emu } inline void SetTexStoEmuInfo( bool enable, EmuInfo *emuInfo, LayerInfo &layer ) { + UNUSED_PARAMETER(emuInfo); if( enable || layer.emulationNeeded == false ) { // set some sort of enable } @@ -290,6 +302,7 @@ namespace Emu } inline void SetXferEmuInfo( bool enable, EmuInfo *emuInfo, LayerInfo &layer ) { + UNUSED_PARAMETER(emuInfo); if( enable || layer.emulationNeeded == false ) { // set some sort of enable } diff --git a/src/regal/RegalMutex.h b/src/regal/RegalMutex.h index d4444d0..3014486 100644 --- a/src/regal/RegalMutex.h +++ b/src/regal/RegalMutex.h @@ -71,6 +71,23 @@ extern "C" { void __stdcall DeleteCriticalSection(LPCRITICAL_SECTION); } extern "C" { void __stdcall EnterCriticalSection(LPCRITICAL_SECTION); } extern "C" { void __stdcall LeaveCriticalSection(LPCRITICAL_SECTION); } +#define INFINITE 0xffffffffL + +typedef struct _SECURITY_ATTRIBUTES { + DWORD nLength; + LPVOID lpSecurityDescriptor; + BOOL bInheritHandle; +} SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; + +typedef LONG * LPLONG; + +extern "C" { HANDLE __stdcall CreateSemaphore(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCSTR); } +extern "C" { BOOL __stdcall CloseHandle(HANDLE); } +extern "C" { DWORD __stdcall WaitForSingleObject(HANDLE,DWORD); } +extern "C" { BOOL __stdcall ReleaseSemaphore(HANDLE,LONG,LPLONG); } + + + #endif REGAL_GLOBAL_END