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
This commit is contained in:
Soren Jorvang 2010-07-12 20:11:19 +00:00
parent 9cb41e7c70
commit 61bd545f80
4 changed files with 24 additions and 20 deletions

View File

@ -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']

View File

@ -6,12 +6,12 @@
#ifdef _WIN32
#include <windows.h>
#elif __APPLE__
#include <paths.h>
#include <Carbon/Carbon.h>
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/storage/IOCDMedia.h>
#include <IOKit/storage/IOMedia.h>
#include <IOKit/IOBSD.h>
#include <paths.h>
#elif __linux__
#include <fcntl.h>
#include <sys/stat.h>

View File

@ -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();

View File

@ -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;