mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
D3D11:
Hardcode the backbuffer size again. Fix R5G6B5 texture converting, textures should be perfect now. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5697 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -119,8 +119,12 @@ void ReplaceTexture2D(ID3D11Texture2D* pTexture, const u8* buffer, unsigned int
|
||||
u32* pBits = (u32*)((u8*)outptr + y * destPitch);
|
||||
for (unsigned int x = 0; x < width; x++)
|
||||
{
|
||||
// we can't simply shift here, since e.g. 11111 must map to 11111111 and not 11111000
|
||||
const u16 col = *in;
|
||||
*pBits = 0xFF000000 | (((col&0x1f)<<3)) | ((col&0x7e0)<<5) | ((col&0xF800)<<8);
|
||||
*pBits = 0xFF000000 | // alpha
|
||||
((((col&0xF800) << 5) * 255 / 31) & 0xFF0000) | // red
|
||||
((((col& 0x7e0) << 3) * 255 / 63) & 0xFF00) | // green
|
||||
(( (col& 0x1f) * 255 / 31)); // blue
|
||||
pBits++;
|
||||
in++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user