GSdx: this should fix d3d9 mode and the aspect ratio bug

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1191 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gabest11 2009-05-15 07:48:51 +00:00
parent 667581e4be
commit a1507e6044
4 changed files with 8 additions and 4 deletions

View File

@ -28,7 +28,7 @@
#include "GSLocalMemory.h"
#define ASSERT_BLOCK(r, w, h) \
ASSERT((r).Width() >= w && (r).Height() >= h && !((r).left&(w-1)) && !((r).top&(h-1)) && !((r).right&(w-1)) && !((r).bottom&(h-1))); \
ASSERT((r).width() >= w && (r).height() >= h && !((r).left&(w-1)) && !((r).top&(h-1)) && !((r).right&(w-1)) && !((r).bottom&(h-1))); \
#define FOREACH_BLOCK_START(w, h, bpp) \
uint32 bp = TEX0.TBP0; \

View File

@ -94,7 +94,10 @@ bool GSTexture9::Update(const GSVector4i& r, const void* data, int pitch)
uint8* src = (uint8*)data;
uint8* dst = (uint8*)lr.pBits;
int bytes = min(pitch, lr.Pitch);
int bytes = r.width() << (m_desc.Format == D3DFMT_A1R5G5B5 ? 1 : 2);
bytes = min(bytes, pitch);
bytes = min(bytes, lr.Pitch);
for(int i = 0, j = r.height(); i < j; i++, src += pitch, dst += lr.Pitch)
{

View File

@ -224,7 +224,8 @@ public:
m_valid = m_valid.runion(r);
static uint8* bits = (uint8*)::_aligned_malloc(1024 * 1024 * 4, 16);
static int pitch = 1024 * 4;
int pitch = ((r.width() + 3) & ~3) * 4;
if(m_renderer->m_psrr)
{

View File

@ -58,7 +58,7 @@ GSVector4i GSVector4i::fit(int arx, int ary) const
if(w * ary > h * arx)
{
int w2 = w * arx / ary;
int w2 = h * arx / ary;
r.left = (r.left + r.right - w2) >> 1;
if(r.left & 1) r.left++;
r.right = r.left + w2;