mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Move shared clut check to gstate.
This commit is contained in:
parent
cdccf06b62
commit
c6a441965e
4 changed files with 4 additions and 3 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue