Fix an off-by-one error that caused uvs to wrap.

This commit is contained in:
Bill Currie 2011-09-25 20:52:28 +09:00
parent 1277c17cd9
commit 521f482806
1 changed files with 2 additions and 2 deletions

View File

@ -121,8 +121,8 @@ def convert_stverts(mdl, stverts):
s, t = st
# quake textures are top to bottom, but blender images
# are bottom to top
s = int (s * mdl.skinwidth + 0.5)
t = int ((1 - t) * mdl.skinheight + 0.5)
s = int (s * (mdl.skinwidth - 1) + 0.5)
t = int ((1 - t) * (mdl.skinheight - 1) + 0.5)
# ensure st is within the skin
s = ((s % mdl.skinwidth) + mdl.skinwidth) % mdl.skinwidth
t = ((t % mdl.skinheight) + mdl.skinheight) % mdl.skinheight