Skip to content

Commit

Permalink
Type hints
Browse files Browse the repository at this point in the history
getSTUVRepeats couldn´t auto type hint, getUVInverval can.
Use 1.0 instead of 1
  • Loading branch information
Lilaa3 committed Jan 18, 2024
1 parent 24cb921 commit f2b1d3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fast64_internal/f3d/f3d_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,25 @@ def getInfoDict(obj):
return infoDict


def getSTUVRepeats(tex_prop: "TextureProperty"):
def getSTUVRepeats(tex_prop: "TextureProperty") -> tuple[float, float]:
SShift, TShift = 2**tex_prop.S.shift, 2**tex_prop.T.shift
sMirrorScale = 2 if tex_prop.S.mirror else 1
tMirrorScale = 2 if tex_prop.T.mirror else 1
return (SShift * sMirrorScale, TShift * tMirrorScale)


def getUVInterval(f3dMat) -> tuple[float, float]:
def getUVInterval(f3dMat):
useDict = all_combiner_uses(f3dMat)

if useDict["Texture 0"] and f3dMat.tex0.tex_set:
tex0UVInterval = getSTUVRepeats(f3dMat.tex0)
else:
tex0UVInterval = (1, 1)
tex0UVInterval = (1.0, 1.0)

if useDict["Texture 1"] and f3dMat.tex1.tex_set:
tex1UVInterval = getSTUVRepeats(f3dMat.tex1)
else:
tex1UVInterval = (1, 1)
tex1UVInterval = (1.0, 1.0)

return (max(tex0UVInterval[0], tex1UVInterval[0]), max(tex0UVInterval[1], tex1UVInterval[1]))

Expand Down

0 comments on commit f2b1d3d

Please sign in to comment.