d3d9: Correct replaced texture format.

This was causing the row width to be wrong for many textures too, which
was generating errors.
This commit is contained in:
Unknown W. Brackets 2016-07-17 09:03:08 -07:00
parent dddb3c39eb
commit b30d0e8cec

View file

@ -1370,7 +1370,9 @@ void TextureCacheDX9::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &re
int levels = scaleFactor == 1 ? maxLevel + 1 : 1;
int tw = w, th = h;
D3DFORMAT tfmt = (D3DFORMAT)D3DFMT(dstFmt);
if (!replaced.GetSize(level, tw, th)) {
if (replaced.GetSize(level, tw, th)) {
tfmt = (D3DFORMAT)D3DFMT(ToD3D9Format(replaced.Format(level)));
} else {
tw *= scaleFactor;
th *= scaleFactor;
if (scaleFactor > 1) {