Minor optimizations, add a failsafe

This commit is contained in:
Henrik Rydgard 2015-01-20 20:08:12 +01:00
parent f1b57dabf5
commit 48e4d1edae
3 changed files with 5 additions and 3 deletions

View File

@ -255,7 +255,7 @@ void ConvertRGBA5551ToRGBA8888(u32 *dst32, const u16 *src, int numPixels) {
dst[x * 4] = Convert5To8((col)& 0x1f);
dst[x * 4 + 1] = Convert5To8((col >> 5) & 0x1f);
dst[x * 4 + 2] = Convert5To8((col >> 10) & 0x1f);
dst[x * 4 + 3] = (col >> 15) ? 255 : 0;
dst[x * 4 + 3] = (col & 0x8000) ? 255 : 0;
}
}

View File

@ -468,7 +468,6 @@ const u8 *Jit::DoJit(u32 em_address, JitBlock *b)
}
b->codeSize = (u32)(GetCodePtr() - b->normalEntry);
NOP();
AlignCode4();
if (js.lastContinuedPC == 0)
b->originalSize = js.numInstructions;

View File

@ -2009,14 +2009,17 @@ void TextureCache::LoadTextureLevel(TexCacheEntry &entry, int level, bool replac
case GL_UNSIGNED_SHORT_4_4_4_4: dstFormat = GE_FORMAT_4444; break;
case GL_UNSIGNED_SHORT_5_6_5: dstFormat = GE_FORMAT_565; break;
case GL_UNSIGNED_SHORT_5_5_5_1: dstFormat = GE_FORMAT_5551; break;
default: goto dontScale;
}
scaler.Scale(pixelData, dstFormat, w, h, scaleFactor);
switch (dstFormat) {
case GE_FORMAT_8888: dstFmt = GL_UNSIGNED_BYTE; break;
case GE_FORMAT_565: dstFmt = GL_UNSIGNED_SHORT_5_6_5; break;
case GE_FORMAT_5551: dstFmt = GL_UNSIGNED_SHORT_5_5_5_1; break;
case GE_FORMAT_4444: dstFmt = GL_UNSIGNED_SHORT_4_4_4_4; break;
case GE_FORMAT_8888: dstFmt = GL_UNSIGNED_BYTE; break;
}
dontScale:
;
}
if ((entry.status & TexCacheEntry::STATUS_CHANGE_FREQUENT) == 0) {