Commit durante_d3dhiresfix.patch. should finally fix rb swap when loading hires replacement textures in the d3d plugin.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5428 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
533162b41f
commit
66ffa3b045
|
@ -110,12 +110,27 @@ LPDIRECT3DTEXTURE9 CreateTexture2D(const u8* buffer, const int width, const int
|
||||||
else
|
else
|
||||||
{*/
|
{*/
|
||||||
u32* pIn = pBuffer;
|
u32* pIn = pBuffer;
|
||||||
|
if (!swap_r_b) {
|
||||||
for (int y = 0; y < height; y++)
|
for (int y = 0; y < height; y++)
|
||||||
{
|
{
|
||||||
u32 *pBits = (u32*)((u8*)Lock.pBits + (y * Lock.Pitch));
|
u32 *pBits = (u32*)((u8*)Lock.pBits + (y * Lock.Pitch));
|
||||||
memcpy(pBits, pIn, width * 4);
|
memcpy(pBits, pIn, width * 4);
|
||||||
pIn += pitch;
|
pIn += pitch;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for (int y = 0; y < height; y++)
|
||||||
|
{
|
||||||
|
u8 *pIn8 = (u8 *)pIn;
|
||||||
|
u8 *pBits = (u8 *)((u8*)Lock.pBits + (y * Lock.Pitch));
|
||||||
|
for (int x = 0; x < width * 4; x += 4) {
|
||||||
|
pBits[x + 0] = pIn8[x + 2];
|
||||||
|
pBits[x + 1] = pIn8[x + 1];
|
||||||
|
pBits[x + 2] = pIn8[x + 0];
|
||||||
|
pBits[x + 3] = pIn8[x + 3];
|
||||||
|
}
|
||||||
|
pIn += pitch;
|
||||||
|
}
|
||||||
|
}
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue