summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2011-01-31 01:28:32 +0000
committerJordan Woyak <jordan.woyak@gmail.com>2011-01-31 01:28:32 +0000
commitfbaf9659958cd6d8c0df6b0c217f6e60f57f9d77 (patch)
tree3ddd90222b5d7afd0c98b936ab4c9e37375ec919 /Source/Core/VideoCommon/Src/TextureCacheBase.cpp
parentae7c64ec134799183487adb5104c6908cf282240 (diff)
Eliminated the plugin interface. Merged DX9/DX11/OGL video plugins into Dolphin. It could still use a lot of cleanup. Lots of things are still named "plugin". Software renderer is temporarily disabled until it gets some namespaces. I only updated vs08/10, Linux/OSX builds are broken.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6996 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/TextureCacheBase.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
index a0ff82df82..eb6c4c8539 100644
--- a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
@@ -11,6 +11,8 @@
#include "TextureCacheBase.h"
#include "Debugger.h"
+#include "ConfigManager.h"
+#include "HW/Memmap.h"
// ugly
extern int frameCount;
@@ -33,20 +35,17 @@ TextureCache::TCacheEntryBase::~TCacheEntryBase()
if (!isRenderTarget && !g_ActiveConfig.bSafeTextureCache)
{
- u32 *const ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(addr);
+ u32 *const ptr = (u32*)Memory::GetPointer(addr);
if (ptr && *ptr == hash)
*ptr = oldpixel;
}
}
-// TODO: uglyness
-extern PLUGIN_GLOBALS *globals;
-
TextureCache::TextureCache()
{
temp = (u8*)AllocateMemoryPages(TEMP_SIZE);
TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter);
- HiresTextures::Init(globals->unique_id);
+ HiresTextures::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
}
void TextureCache::Invalidate(bool shutdown)
@@ -164,7 +163,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
if (0 == address)
return NULL;
- u8* ptr = g_VideoInitialize.pGetMemoryPointer(address);
+ u8* ptr = Memory::GetPointer(address);
// TexelSizeInNibbles(format)*width*height/16;
const unsigned int bsw = TexDecoder_GetBlockWidthInTexels(texformat) - 1;
@@ -288,7 +287,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
unsigned int newWidth = width;
unsigned int newHeight = height;
- sprintf(texPathTemp, "%s_%08llx_%i", globals->unique_id, texHash, texformat);
+ sprintf(texPathTemp, "%s_%08llx_%i", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), texHash, texformat);
pcfmt = HiresTextures::GetHiresTex(texPathTemp, &newWidth, &newHeight, texformat, temp);
if (pcfmt != PC_TEX_FMT_NONE)
@@ -385,11 +384,11 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
char szDir[MAX_PATH];
// make sure that the directory exists
- sprintf(szDir, "%s%s", File::GetUserPath(D_DUMPTEXTURES_IDX), globals->unique_id);
+ sprintf(szDir, "%s%s", File::GetUserPath(D_DUMPTEXTURES_IDX), SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
if (false == File::Exists(szDir) || false == File::IsDirectory(szDir))
File::CreateDir(szDir);
- sprintf(szTemp, "%s/%s_%08llx_%i.png", szDir, globals->unique_id, texHash, texformat);
+ sprintf(szTemp, "%s/%s_%08llx_%i.png", szDir, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), texHash, texformat);
if (false == File::Exists(szTemp))
entry->Save(szTemp);