BBox: Changed the rounding again, the old one fixed Paper Mario but had bugs in Mickey's Magical Mirror. This change fixes the glitches in both games.

Also fixed some compiler warnings.
This commit is contained in:
crudelios 2014-01-26 13:21:22 +00:00
parent d3fd0eddbb
commit 9b6c6fa9e4
12 changed files with 16 additions and 16 deletions

View File

@ -556,7 +556,7 @@ void drawShadedTexQuad(ID3D11ShaderResourceView* texture,
}
void drawShadedTexSubQuad(ID3D11ShaderResourceView* texture,
const MathUtil::Rectangle<float>* rSource,
const MathUtil::Rectangle<int>* rSource,
int SourceWidth,
int SourceHeight,
const MathUtil::Rectangle<float>* rDest,

View File

@ -62,7 +62,7 @@ namespace D3D
ID3D11InputLayout* layout,
float Gamma = 1.0f);
void drawShadedTexSubQuad(ID3D11ShaderResourceView* texture,
const MathUtil::Rectangle<float>* rSource,
const MathUtil::Rectangle<int>* rSource,
int SourceWidth,
int SourceHeight,
const MathUtil::Rectangle<float>* rDest,

View File

@ -179,7 +179,7 @@ void FramebufferManager::GetTargetSize(unsigned int *width, unsigned int *height
*height = targetSource.bottom - targetSource.top;
}
void XFBSource::Draw(const MathUtil::Rectangle<float> &sourcerc,
void XFBSource::Draw(const MathUtil::Rectangle<int> &sourcerc,
const MathUtil::Rectangle<float> &drawrc) const
{
D3D::drawShadedTexSubQuad(tex->GetSRV(), &sourcerc,

View File

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

View File

@ -791,12 +791,12 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
for (u32 i = 0; i < xfbCount; ++i)
{
xfbSource = xfbSourceList[i];
MathUtil::Rectangle<float> sourceRc;
MathUtil::Rectangle<int> sourceRc;
sourceRc.left = 0;
sourceRc.top = 0;
sourceRc.right = (float)xfbSource->texWidth;
sourceRc.bottom = (float)xfbSource->texHeight;
sourceRc.right = (int)xfbSource->texWidth;
sourceRc.bottom = (int)xfbSource->texHeight;
MathUtil::Rectangle<float> drawRc;

View File

@ -147,7 +147,7 @@ void Television::Render()
// line down. We could even consider implementing a deinterlacing
// algorithm.
MathUtil::Rectangle<float> sourceRc(0.f, 0.f, float(m_curWidth), float(m_curHeight));
MathUtil::Rectangle<int> sourceRc(0, 0, int(m_curWidth), int(m_curHeight));
MathUtil::Rectangle<float> destRc(-1.f, 1.f, 1.f, -1.f);
D3D::context->PSSetSamplers(0, 1, &m_samplerState);

View File

@ -394,13 +394,13 @@ XFBSource::~XFBSource()
}
void XFBSource::Draw(const MathUtil::Rectangle<float> &sourcerc,
void XFBSource::Draw(const MathUtil::Rectangle<int> &sourcerc,
const MathUtil::Rectangle<float> &drawrc) const
{
// Texture map xfbSource->texture onto the main buffer
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
glBlitFramebuffer(sourcerc.left, sourcerc.bottom, sourcerc.right, sourcerc.top,
drawrc.left, drawrc.bottom, drawrc.right, drawrc.top,
(int)drawrc.left, (int)drawrc.bottom, (int)drawrc.right, (int)drawrc.top,
GL_COLOR_BUFFER_BIT, GL_LINEAR);
GL_REPORT_ERRORD();

View File

@ -51,7 +51,7 @@ struct XFBSource : public XFBSourceBase
void CopyEFB(float Gamma) override;
void DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight) override;
void Draw(const MathUtil::Rectangle<float> &sourcerc,
void Draw(const MathUtil::Rectangle<int> &sourcerc,
const MathUtil::Rectangle<float> &drawrc) const override;
const GLuint texture;

View File

@ -1352,7 +1352,7 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
// Tell the OSD Menu about the current internal resolution
OSDInternalW = xfbSource->sourceRc.GetWidth(); OSDInternalH = xfbSource->sourceRc.GetHeight();
MathUtil::Rectangle<float> sourceRc;
MathUtil::Rectangle<int> sourceRc;
sourceRc.left = xfbSource->sourceRc.left;
sourceRc.right = xfbSource->sourceRc.right;
sourceRc.top = xfbSource->sourceRc.top;

View File

@ -34,7 +34,7 @@ namespace DriverDetails
Vendor m_vendor = VENDOR_UNKNOWN;
Driver m_driver = DRIVER_UNKNOWN;
s32 m_family = 0.0;
s32 m_family = 0;
double m_version = 0.0;
// This is a list of all known bugs for each vendor

View File

@ -15,7 +15,7 @@ struct XFBSourceBase
{
virtual ~XFBSourceBase() {}
virtual void Draw(const MathUtil::Rectangle<float> &sourcerc,
virtual void Draw(const MathUtil::Rectangle<int> &sourcerc,
const MathUtil::Rectangle<float> &drawrc) const = 0;
virtual void DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight) = 0;

View File

@ -254,8 +254,8 @@ void LOADERDECL UpdateBoundingBox()
}
// Convert to screen space and add the point to the list - round like the real hardware
s_bbox_points[s_bbox_currPoint].x = (((s32) (0.5f + (16.0f * (screenPoint[0] * xfregs.viewport.wd + (xfregs.viewport.xOrig - 342.0f))))) - 9) >> 4;
s_bbox_points[s_bbox_currPoint].y = (((s32) (0.5f + (16.0f * (screenPoint[1] * xfregs.viewport.ht + (xfregs.viewport.yOrig - 342.0f))))) - 9) >> 4;
s_bbox_points[s_bbox_currPoint].x = (((s32) (0.5f + (16.0f * (screenPoint[0] * xfregs.viewport.wd + (xfregs.viewport.xOrig - 342.0f))))) + 3) >> 4;
s_bbox_points[s_bbox_currPoint].y = (((s32) (0.5f + (16.0f * (screenPoint[1] * xfregs.viewport.ht + (xfregs.viewport.yOrig - 342.0f))))) + 3) >> 4;
s_bbox_points[s_bbox_currPoint].z = screenPoint[2];
// Update point list for primitive