1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Correct update scissor:

glScissor( generates GL_INVALID_VALUE if either width or height is negative.
Clamp width and height to positive value.

glError in Clay Fighter 63 1/3 is fixed.
This commit is contained in:
Sergey Lipskiy 2014-10-03 16:30:18 +07:00
parent 873324e3c1
commit 9d72e182cf

View File

@ -539,8 +539,8 @@ void OGLRender::_updateStates() const
if (gDP.changed & CHANGED_SCISSOR) {
FrameBufferList & fbList = frameBufferList();
const u32 screenHeight = (fbList.getCurrent() == NULL || fbList.getCurrent()->m_height == 0 || !fbList.isFboMode()) ? VI.height : fbList.getCurrent()->m_height;
glScissor( gDP.scissor.ulx * ogl.getScaleX(), (screenHeight - gDP.scissor.lry) * ogl.getScaleY() + (fbList.isFboMode() ? 0 : ogl.getHeightOffset()),
(gDP.scissor.lrx - gDP.scissor.ulx) * ogl.getScaleX(), (gDP.scissor.lry - gDP.scissor.uly) * ogl.getScaleY() );
glScissor( (GLint)(gDP.scissor.ulx * ogl.getScaleX()), (GLint)((screenHeight - gDP.scissor.lry) * ogl.getScaleY() + (fbList.isFboMode() ? 0 : ogl.getHeightOffset())),
max((GLint)((gDP.scissor.lrx - gDP.scissor.ulx) * ogl.getScaleX()), 0), max((GLint)((gDP.scissor.lry - gDP.scissor.uly) * ogl.getScaleY()), 0) );
}
if (gSP.changed & CHANGED_VIEWPORT)