mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix non-through rectangles
This commit is contained in:
parent
069a7b0d2f
commit
c1db771056
3 changed files with 7 additions and 5 deletions
|
@ -463,11 +463,15 @@ void SoftwareTransform(
|
|||
numTrans = vertexCount;
|
||||
drawIndexed = true;
|
||||
} else {
|
||||
bool useBufferedRendering = g_Config.iRenderingMode != FB_NON_BUFFERED_MODE;
|
||||
if (useBufferedRendering)
|
||||
ySign = -ySign;
|
||||
|
||||
float flippedMatrix[16];
|
||||
if (!throughmode) {
|
||||
memcpy(&flippedMatrix, gstate.projMatrix, 16 * sizeof(float));
|
||||
|
||||
const bool invertedY = gstate_c.vpHeight < 0;
|
||||
const bool invertedY = useBufferedRendering ? (gstate_c.vpHeight > 0) : (gstate_c.vpHeight < 0);
|
||||
if (invertedY) {
|
||||
flippedMatrix[5] = -flippedMatrix[5];
|
||||
flippedMatrix[13] = -flippedMatrix[13];
|
||||
|
|
|
@ -419,7 +419,7 @@ void LinkedShader::UpdateUniforms(u32 vertType) {
|
|||
if (invertedX) {
|
||||
flippedMatrix[0] = -flippedMatrix[0];
|
||||
flippedMatrix[12] = -flippedMatrix[12];
|
||||
}
|
||||
}\
|
||||
|
||||
// In Phantasy Star Portable 2, depth range sometimes goes negative and is clamped by glDepthRange to 0,
|
||||
// causing graphics clipping glitch (issue #1788). This hack modifies the projection matrix to work around it.
|
||||
|
|
|
@ -793,9 +793,6 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
|
|||
float offsetY = gstate.getOffsetY();
|
||||
|
||||
if (throughmode) {
|
||||
// If the buffer is too large, offset the viewport to the top.
|
||||
renderY += renderHeight - framebufferManager_->GetTargetHeight() * renderHeightFactor;
|
||||
|
||||
// No viewport transform here. Let's experiment with using region.
|
||||
if (useBufferedRendering) {
|
||||
// No flip needed
|
||||
|
@ -805,6 +802,7 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
|
|||
(regionX2 - regionX1) * renderWidthFactor,
|
||||
(regionY2 - regionY1) * renderHeightFactor);
|
||||
} else {
|
||||
renderY += renderHeight - framebufferManager_->GetTargetHeight() * renderHeightFactor;
|
||||
glstate.viewport.set(
|
||||
renderX + displayOffsetX + (0 + regionX1) * renderWidthFactor,
|
||||
renderY + displayOffsetY + (0 - regionY1) * renderHeightFactor,
|
||||
|
|
Loading…
Add table
Reference in a new issue