Skip to content

Commit

Permalink
Devwizard's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilaa3 committed Jan 22, 2024
1 parent def0655 commit 514e5ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fast64_internal/f3d/f3d_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -3394,9 +3394,9 @@ def getOptimalFormat(tex, curFormat, isMultitexture):
hasAlpha1bit = True
pixelValues.add(getRGBA16Tuple(color))

tex_size = tex.size[0] * tex.size[1]
n_size = tex.size[0] * tex.size[1]
if isGreyscale:
if tex_size > 4096:
if n_size > 4096:
if not hasAlpha1bit:
texFormat = "I4"
else:
Expand All @@ -3408,9 +3408,9 @@ def getOptimalFormat(tex, curFormat, isMultitexture):
texFormat = "IA8"
else:
prefer_ci_over_rgba = bpy.context.scene.fast64.settings.prefer_ci_over_rgba
if (prefer_ci_over_rgba and len(pixelValues) <= 16) or (len(pixelValues) <= 16 and tex_size > 2048):
if (prefer_ci_over_rgba and len(pixelValues) <= 16) or (len(pixelValues) <= 16 and n_size > 2048):
texFormat = "CI4"
elif prefer_ci_over_rgba and len(pixelValues) <= 256 and tex_size <= 2048:
elif prefer_ci_over_rgba and len(pixelValues) <= 256 and n_size <= 2048:
texFormat = "CI8"
else:
texFormat = "RGBA16"
Expand Down

0 comments on commit 514e5ce

Please sign in to comment.