From 61bd545f80cd699e8fe1c872f3185dea04f81fd6 Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Mon, 12 Jul 2010 20:11:19 +0000 Subject: [PATCH] A little iterator bug and a compiler warning in the OpenGL code. Use -fvisibility-inlines-hidden on OS X as well. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5875 8ced0084-cf51-0410-be5f-012b33b47a6e --- SConstruct | 7 +++-- Source/Core/Common/Src/CDUtils.cpp | 4 +-- .../Plugin_VideoOGL/Src/TextureMngr.cpp | 26 ++++++++++--------- .../Plugins/Plugin_VideoOGL/Src/TextureMngr.h | 7 +++-- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/SConstruct b/SConstruct index 99e25343d6..fad76b7b9c 100644 --- a/SConstruct +++ b/SConstruct @@ -146,6 +146,7 @@ if sys.platform == 'win32': env['tools'] = ['mingw'] env['ENV'] = os.environ else: + env['CXXFLAGS'] = ['-fvisibility-inlines-hidden'] env['ENV'] = { 'PATH' : os.environ['PATH'], 'HOME' : os.environ['HOME'], @@ -202,8 +203,6 @@ compileFlags += [ ('-W' + warning) for warning in warnings ] env['CCFLAGS'] = compileFlags env['CPPDEFINES'] = cppDefines -if not sys.platform == 'win32': - env['CXXFLAGS'] = ['-fvisibility-inlines-hidden'] # Configuration tests section tests = {'CheckWXConfig' : wxconfig.CheckWXConfig, @@ -268,9 +267,9 @@ if sys.platform == 'darwin': if env['FRAMEWORKS'].count('QuickTime'): env['FRAMEWORKS'].remove('QuickTime') env['CC'] = "gcc-4.2" - env['CFLAGS'] = ['-x', 'objective-c'] + env['CFLAGS'] += ['-x', 'objective-c'] env['CXX'] = "g++-4.2" - env['CXXFLAGS'] = ['-x', 'objective-c++'] + env['CXXFLAGS'] += ['-x', 'objective-c++'] env['CCFLAGS'] += ['-arch', 'x86_64', '-arch', 'i386'] env['LIBS'] += ['iconv'] env['LINKFLAGS'] += ['-arch', 'x86_64', '-arch', 'i386'] diff --git a/Source/Core/Common/Src/CDUtils.cpp b/Source/Core/Common/Src/CDUtils.cpp index 2d887edc32..e936f1d9c4 100644 --- a/Source/Core/Common/Src/CDUtils.cpp +++ b/Source/Core/Common/Src/CDUtils.cpp @@ -6,12 +6,12 @@ #ifdef _WIN32 #include #elif __APPLE__ -#include -#include +#include #include #include #include #include +#include #elif __linux__ #include #include diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp index dbad2fbc3a..3034b0f15d 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp @@ -193,17 +193,17 @@ void TextureMngr::Shutdown() void TextureMngr::ProgressiveCleanup() { - TexCache::iterator iter = textures.begin(); - while (iter != textures.end()) + TexCache::iterator iter = textures.begin(); + while (iter != textures.end()) { - if (frameCount > TEXTURE_KILL_THRESHOLD + iter->second.frameCount) + if (frameCount > TEXTURE_KILL_THRESHOLD + iter->second.frameCount) { - iter->second.Destroy(false); - iter = textures.erase(iter); - } - else - ++iter; - } + iter->second.Destroy(false); + textures.erase(iter++); + } + else + ++iter; + } } void TextureMngr::InvalidateRange(u32 start_address, u32 size) @@ -368,9 +368,11 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width // instead of destroying it and having to create a new one. // Might speed up movie playback very, very slightly. TextureIsDinamic = (entry.isRenderTarget || entry.isDinamic) && !g_ActiveConfig.bCopyEFBToTexture; - if (!entry.isRenderTarget && - ((!entry.isDinamic && width == entry.w && height==entry.h && FullFormat == entry.fmt) - || (entry.isDinamic && entry.w == width && entry.h == height))) + if (!entry.isRenderTarget && ((!entry.isDinamic && + width == entry.w && height == entry.h && + (int)FullFormat == entry.fmt) || + (entry.isDinamic && + entry.w == width && entry.h == height))) { glBindTexture(entry.isRectangle ? GL_TEXTURE_RECTANGLE_ARB : GL_TEXTURE_2D, entry.texture); GL_REPORT_ERRORD(); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.h b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.h index 5dd50c5fa6..b731a9d985 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.h @@ -29,7 +29,10 @@ class TextureMngr public: struct TCacheEntry { - TCacheEntry() : texture(0), addr(0), size_in_bytes(0), hash(0), w(0), h(0),MipLevels(0), scaleX(1.0f), scaleY(1.0f),isDinamic(false), isRenderTarget(false), isRectangle(true), bHaveMipMaps(false) { mode.hex = 0xFCFCFCFC; } + TCacheEntry() : texture(0), addr(0), size_in_bytes(0), hash(0), + w(0), h(0), MipLevels(0), scaleX(1.0f), scaleY(1.0f), + isRenderTarget(false), isDinamic(false), isRectangle(true), + bHaveMipMaps(false) { mode.hex = 0xFCFCFCFC; } GLuint texture; u32 addr; @@ -47,7 +50,7 @@ public: bool isRenderTarget; // if render texture, then rendertex is filled with the direct copy of the render target // later conversions would have to convert properly from rendertexfmt to texfmt - bool isDinamic;// mofified from cpu + bool isDinamic; // modified from cpu bool isRectangle; // if nonpow2, use GL_TEXTURE_2D, else GL_TEXTURE_RECTANGLE_NV bool bHaveMipMaps;