One step closer to fixing D3D. Now textures are set properly.

Still, memory leak exists for some unknown reason (we don't allocate more pages and we release every texture)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2601 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY
2009-03-07 18:05:29 +00:00
parent 7455361ed2
commit 7419475959
7 changed files with 97 additions and 61 deletions

View File

@ -22,9 +22,11 @@
#include <map>
#include "D3DBase.h"
#include "BPMemory.h"
class TextureCache
{
public:
struct TCacheEntry
{
LPDIRECT3DTEXTURE9 texture;
@ -37,6 +39,7 @@ class TextureCache
bool isNonPow2;
int frameCount;
int w,h,fmt;
TexMode0 mode; // current filter and clamp modes that texture is set to
TCacheEntry()
{
texture=0;
@ -46,6 +49,7 @@ class TextureCache
void Destroy(bool shutdown);
};
private:
typedef std::map<u32,TCacheEntry> TexCache;
@ -57,7 +61,7 @@ public:
static void Cleanup();
static void Shutdown();
static void Invalidate(bool shutdown);
static void Load(int stage, u32 address, int width, int height, int format, int tlutaddr, int tlutfmt);
static TCacheEntry *Load(int stage, u32 address, int width, int height, int format, int tlutaddr, int tlutfmt);
static void CopyEFBToRenderTarget(u32 address, RECT *source);
};