gsdx: fix snow engine issue in native resolution

This commit is contained in:
Gregory Hainaut 2015-06-18 21:17:43 +02:00
parent d8cf4f83d0
commit 5bc8f046b2
1 changed files with 8 additions and 5 deletions

View File

@ -814,13 +814,16 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
if((sRect == dRect).alltrue())
{
// Note: use dstsize.x instead of w because w is limited to 1024 whereas dstsize.x could
// be bigger (1280 for snow engine games)
if (half_right)
m_renderer->m_dev->CopyRect(sTex, dTex, GSVector4i(dstsize.x/2, 0, dstsize.x, h));
else
if (half_right) {
// You typically hit this code in snow engine game. Dstsize is the size of of Dx/GL RT
// which is arbitrary set to 1280 (biggest RT used by GS). h/w are based on the input texture
// so the only reliable way to find the real size of the target is to use the TBW value.
uint32 real_width = dst->m_TEX0.TBW * 64u;
m_renderer->m_dev->CopyRect(sTex, dTex, GSVector4i(real_width/2u, 0, real_width, h));
} else {
m_renderer->m_dev->CopyRect(sTex, dTex, GSVector4i(0, 0, w, h)); // <= likely wrong dstsize.x could be bigger than w
}
}
else
{
sRect.z /= sTex->GetWidth();