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

Correct force clamp condition in OGLRender::drawTexturedRect

Fixed sun in Perfect Dark, which was broken after commit ba89dce8512:
Remove textures coordinates swap in case of lower coordinate is larger than higher one.
This commit is contained in:
Sergey Lipskiy 2015-03-01 13:35:01 +06:00
parent d9e9955668
commit ef7ad9a549

View File

@ -1112,10 +1112,10 @@ void OGLRender::drawTexturedRect(const TexturedRectParams & _params)
glActiveTexture( GL_TEXTURE0 );
if ((texST[0].s0 >= 0.0 && texST[0].s1 <= cache.current[0]->width) || (cache.current[0]->maskS + cache.current[0]->mirrorS == 0 && (texST[0].s0 < -1024.0f || texST[0].s1 > 1023.99f)))
if ((texST[0].s0 < texST[0].s1 && texST[0].s0 >= 0.0 && texST[0].s1 <= cache.current[0]->width) || (cache.current[0]->maskS + cache.current[0]->mirrorS == 0 && (texST[0].s0 < -1024.0f || texST[0].s1 > 1023.99f)))
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
if (texST[0].t0 >= 0.0f && texST[0].t1 <= cache.current[0]->height)
if (texST[0].t0 < texST[0].t1 && texST[0].t0 >= 0.0f && texST[0].t1 <= cache.current[0]->height)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
texST[0].s0 *= cache.current[0]->scaleS;