Respect max texture level in GE debugger preview.

This commit is contained in:
Unknown W. Brackets 2014-06-15 10:31:16 -07:00
parent 07b13f680c
commit f6649794df
5 changed files with 7 additions and 6 deletions

View File

@ -857,7 +857,7 @@ void TextureCacheDX9::SetTexture() {
int bufw = GetTextureBufw(0, texaddr, format);
int w = gstate.getTextureWidth(0);
int h = gstate.getTextureHeight(0);
int maxLevel = ((gstate.texmode >> 16) & 0x7);
int maxLevel = gstate.getTextureMaxLevel();
u32 texhash = MiniHash((const u32 *)Memory::GetPointer(texaddr));
u32 fullhash = 0;

View File

@ -1148,7 +1148,7 @@ void TextureCache::SetTexture(bool force) {
}
int bufw = GetTextureBufw(0, texaddr, format);
int maxLevel = ((gstate.texmode >> 16) & 0x7);
int maxLevel = gstate.getTextureMaxLevel();
u32 texhash = MiniHash((const u32 *)Memory::GetPointer(texaddr));
u32 fullhash = 0;

View File

@ -313,6 +313,7 @@ struct GPUgstate
bool isClutIndexSimple() const { return (clutformat & ~3) == 0xC500FF00; } // Meaning, no special mask, shift, or start pos.
bool isTextureSwizzled() const { return texmode & 1; }
bool isClutSharedForMipmaps() const { return (texmode & 0x100) == 0; }
int getTextureMaxLevel() const { return (texmode >> 16) & 0x7; }
// Lighting
bool isLightingEnabled() const { return lightingEnable & 1; }

View File

@ -1171,7 +1171,7 @@ void DrawTriangleSlice(
int texbufwidthbits[8] = {0};
int maxTexLevel = (gstate.texmode >> 16) & 7;
int maxTexLevel = gstate.getTextureMaxLevel();
u8 *texptr[8] = {NULL};
int magFilt = (gstate.texfilter>>8) & 1;
@ -1346,7 +1346,7 @@ void DrawPoint(const VertexData &v0)
if (gstate.isTextureMapEnabled() && !clearMode) {
int texbufwidthbits[8] = {0};
int maxTexLevel = (gstate.texmode >> 16) & 7;
int maxTexLevel = gstate.getTextureMaxLevel();
u8 *texptr[8] = {NULL};
int magFilt = (gstate.texfilter>>8) & 1;
@ -1430,7 +1430,7 @@ void DrawLine(const VertexData &v0, const VertexData &v1)
int texbufwidthbits[8] = {0};
int maxTexLevel = (gstate.texmode >> 16) & 7;
int maxTexLevel = gstate.getTextureMaxLevel();
u8 *texptr[8] = {NULL};
int magFilt = (gstate.texfilter>>8) & 1;

View File

@ -252,7 +252,7 @@ void CGEDebugger::UpdateTextureLevel(int level) {
}
int maxValid = 0;
for (int i = 1; i < 8; ++i) {
for (int i = 1; i < state.getTextureMaxLevel() + 1; ++i) {
if (state.getTextureAddress(i) != 0) {
maxValid = i;
}