Skip to content

Commit

Permalink
Added optional 'no_alpha.txt' file to manual mipmapping for use with …
Browse files Browse the repository at this point in the history
…'accurate.txt'
  • Loading branch information
Permdog99 committed Feb 9, 2025
1 parent 3aea71c commit 35847de
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,10 @@ public static NativeImage mipmapAccurate(NativeImage original, int mipmap) {
NativeImage newImage = new NativeImage(original.getWidth() >> 1, original.getHeight() >> 1, false);
int j = newImage.getWidth();
int k = newImage.getHeight();
Optional<File> noAlphaFile = fromFileResource(ResourceLocation.fromNamespaceAndPath(currentResourceLocation.getNamespace(), "textures/ltmipmaps/" + currentResourceLocation.getPath() + "/no_alpha.txt"));
for(int l = 0; l < j; ++l) {
for (int m = 0; m < k; ++m) {
setColorWithAlpha(newImage, l, m, blend(getColor(original, l * 2, m * 2 + 1), getColor(original, l * 2, m * 2 + 1), getColor(original, l * 2, m * 2 + 1), getColor(original, l * 2, m * 2 + 1), bl), 255, mipmap >= 2);
setColorWithAlpha(newImage, l, m, blend(getColor(original, l * 2, m * 2 + 1), getColor(original, l * 2, m * 2 + 1), getColor(original, l * 2, m * 2 + 1), getColor(original, l * 2, m * 2 + 1), bl), 255, mipmap >= 2 && noAlphaFile.isEmpty());
}
}
return newImage;
Expand Down

0 comments on commit 35847de

Please sign in to comment.