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

Clamp texrect texture in case of texture coordinate overflow.

Probably incorrect.

Fixes Sin And Punishment:
without that fix ' ' and 'U' have the same coordinate after wrapping.
This commit is contained in:
Sergey Lipskiy 2014-11-14 13:28:04 +06:00
parent f8da3cb792
commit eb0e3ca25a

View File

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