Fix issues with scaling ARGB1555 textures in OpenGL, introduced by the recent merge

This commit is contained in:
Henrik Rydgard committed 2015-01-20 22:48:39 +01:00
1 parent 48e4d1edae
commit 08eaa6e1f7
6 files changed
+58 -31

No files matched your search

+7 -11
View File
@@ -2003,21 +2003,17 @@ void TextureCache::LoadTextureLevel(TexCacheEntry &entry, int level, bool replac
u32 *pixelData = (u32 *)finalBuf;
if (scaleFactor > 1 && (entry.status & TexCacheEntry::STATUS_CHANGE_FREQUENT) == 0) {
GEBufferFormat dstFormat;
ScalerPixelFormat dstFormat;
switch (dstFmt) {
case GL_UNSIGNED_BYTE: dstFormat = GE_FORMAT_8888; break;
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;
case GL_UNSIGNED_BYTE: dstFormat = SCALER_FORMAT_8888; break;
case GL_UNSIGNED_SHORT_4_4_4_4: dstFormat = SCALER_FORMAT_4444; break;
case GL_UNSIGNED_SHORT_5_6_5: dstFormat = SCALER_FORMAT_565; break;
case GL_UNSIGNED_SHORT_5_5_5_1: dstFormat = SCALER_FORMAT_1555; 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;
}
// The scaler currently always outputs this.
dstFmt = GL_UNSIGNED_BYTE;
dontScale:
;
}