Move shared clut check to gstate.

This commit is contained in:
Unknown W. Brackets 2013-12-08 23:11:56 -08:00
parent cdccf06b62
commit c6a441965e
4 changed files with 4 additions and 3 deletions

View file

@ -1092,7 +1092,7 @@ void *TextureCacheDX9::DecodeTextureLevel(GETextureFormat format, GEPaletteForma
{
dstFmt = getClutDestFormat(clutformat);
const bool mipmapShareClut = (gstate.texmode & 0x100) == 0;
const bool mipmapShareClut = gstate.isClutSharedForMipmaps();
const int clutSharingOffset = mipmapShareClut ? 0 : level * 16;
switch (clutformat) {

View file

@ -1221,7 +1221,7 @@ void *TextureCache::DecodeTextureLevel(GETextureFormat format, GEPaletteFormat c
switch (format) {
case GE_TFMT_CLUT4:
{
const bool mipmapShareClut = (gstate.texmode & 0x100) == 0;
const bool mipmapShareClut = gstate.isClutSharedForMipmaps();
const int clutSharingOffset = mipmapShareClut ? 0 : level * 16;
switch (clutformat) {

View file

@ -307,6 +307,7 @@ struct GPUgstate
int transformClutIndex(int index) const { return ((index >> getClutIndexShift()) & getClutIndexMask()) | getClutIndexStartPos(); }
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; }
// Lighting
bool isLightingEnabled() const { return lightingEnable & 1; }

View file

@ -74,7 +74,7 @@ static inline int GetPixelDataOffset(unsigned int row_pitch_bits, unsigned int u
static inline u32 LookupColor(unsigned int index, unsigned int level)
{
const bool mipmapShareClut = (gstate.texmode & 0x100) == 0;
const bool mipmapShareClut = gstate.isClutSharedForMipmaps();
const int clutSharingOffset = mipmapShareClut ? 0 : level * 16;
// TODO: No idea if these bswaps are correct