Revert "Made several variables/parameters unsigned in the DX9, DX11 and OGL plugins. They make more sense like this (given their names)."

Turns out I was wrong in my previous commit. My bad.

This reverts commit 8743166663.
This commit is contained in:
lioncash
2013-01-16 15:46:11 -05:00
parent 8743166663
commit 0ef3bd9c77
16 changed files with 104 additions and 98 deletions

View File

@ -193,7 +193,7 @@ void FramebufferManager::GetTargetSize(unsigned int *width, unsigned int *height
}
void XFBSource::Draw(const MathUtil::Rectangle<float> &sourcerc,
const MathUtil::Rectangle<float> &drawrc, u32 width, u32 height) const
const MathUtil::Rectangle<float> &drawrc, int width, int height) const
{
D3D::drawShadedTexSubQuad(tex->GetSRV(), &sourcerc,
texWidth, texHeight, &drawrc, PixelShaderCache::GetColorCopyProgram(false),

View File

@ -64,7 +64,7 @@ struct XFBSource : public XFBSourceBase
~XFBSource() { tex->Release(); }
void Draw(const MathUtil::Rectangle<float> &sourcerc,
const MathUtil::Rectangle<float> &drawrc, u32 width, u32 height) const;
const MathUtil::Rectangle<float> &drawrc, int width, int height) const;
void DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight);
void CopyEFB(float Gamma);

View File

@ -691,14 +691,18 @@ void Renderer::UpdateViewport(Matrix44& vpCorrection)
}
// In D3D, the viewport rectangle must fit within the render target.
u32 X = intendedX;
u32 Y = intendedY;
u32 Wd = intendedWd;
u32 Ht = intendedHt;
int X = intendedX;
if (X < 0)
X = 0;
int Y = intendedY;
if (Y < 0)
Y = 0;
int Wd = intendedWd;
if (X + Wd > GetTargetWidth())
Wd = GetTargetWidth() - X;
int Ht = intendedHt;
if (Y + Ht > GetTargetHeight())
Ht = GetTargetHeight() - Y;
@ -924,17 +928,20 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
// Prepare to copy the XFBs to our backbuffer
UpdateDrawRectangle(s_backbuffer_width, s_backbuffer_height);
u32 X = GetTargetRectangle().left;
u32 Y = GetTargetRectangle().top;
u32 Width = GetTargetRectangle().right - GetTargetRectangle().left;
u32 Height = GetTargetRectangle().bottom - GetTargetRectangle().top;
int X = GetTargetRectangle().left;
int Y = GetTargetRectangle().top;
int Width = GetTargetRectangle().right - GetTargetRectangle().left;
int Height = GetTargetRectangle().bottom - GetTargetRectangle().top;
// TODO: Redundant checks...
if (X < 0) X = 0;
if (Y < 0) Y = 0;
if (X > s_backbuffer_width) X = s_backbuffer_width;
if (Y > s_backbuffer_height) Y = s_backbuffer_height;
if (Width < 0) Width = 0;
if (Height < 0) Height = 0;
if (Width > (s_backbuffer_width - X)) Width = s_backbuffer_width - X;
if (Height > (s_backbuffer_height - Y)) Height = s_backbuffer_height - Y;
D3D11_VIEWPORT vp = CD3D11_VIEWPORT((float)X, (float)Y, (float)Width, (float)Height);
D3D::context->RSSetViewports(1, &vp);
D3D::context->OMSetRenderTargets(1, &D3D::GetBackBuffer()->GetRTV(), NULL);