Fix banner rendering

I guess we've been doing the clamping wrong all along and it just
happened to work in the past?
This commit is contained in:
Hector Martin 2016-11-24 01:47:04 +09:00
parent f7de203b9c
commit f45a0adb84

View File

@ -1577,21 +1577,21 @@ class Renderer(object):
glEnable(texture.target) glEnable(texture.target)
glBindTexture(texture.target, texture.id) glBindTexture(texture.target, texture.id)
if mat.Textures[0][1] == 0x0: if mat.Textures[0][1] == 0x0:
glTexParameteri(texture.target, GL_TEXTURE_WRAP_S, GL_CLAMP) glTexParameteri(texture.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)
elif mat.Textures[0][1] == 0x1: elif mat.Textures[0][1] == 0x1:
glTexParameteri(texture.target, GL_TEXTURE_WRAP_S, GL_REPEAT) glTexParameteri(texture.target, GL_TEXTURE_WRAP_S, GL_REPEAT)
elif mat.Textures[0][1] == 0x2: elif mat.Textures[0][1] == 0x2:
glTexParameteri(texture.target, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT) glTexParameteri(texture.target, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT)
else: else:
glTexParameteri(texture.target, GL_TEXTURE_WRAP_S, GL_CLAMP) glTexParameteri(texture.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)
if mat.Textures[0][2] == 0x0: if mat.Textures[0][2] == 0x0:
glTexParameteri(texture.target, GL_TEXTURE_WRAP_T, GL_CLAMP) glTexParameteri(texture.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
elif mat.Textures[0][2] == 0x1: elif mat.Textures[0][2] == 0x1:
glTexParameteri(texture.target, GL_TEXTURE_WRAP_T, GL_REPEAT) glTexParameteri(texture.target, GL_TEXTURE_WRAP_T, GL_REPEAT)
elif mat.Textures[0][2] == 0x2: elif mat.Textures[0][2] == 0x2:
glTexParameteri(texture.target, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT) glTexParameteri(texture.target, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT)
else: else:
glTexParameteri(texture.target, GL_TEXTURE_WRAP_T, GL_CLAMP) glTexParameteri(texture.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT) glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT)
glInterleavedArrays(GL_T4F_V4F, 0, array) glInterleavedArrays(GL_T4F_V4F, 0, array)