diff options
author | Jason Mitchell <mitchej@gmail.com> | 2022-07-29 10:23:45 -0700 |
---|---|---|
committer | Jason Mitchell <mitchej+github@gmail.com> | 2022-08-26 07:42:48 -0700 |
commit | eb95711aadb0066e70440111f93167f6164e6da8 (patch) | |
tree | 2aeb301130661e382d0f8a02a861ec66c9bc243d /src/main/java/gregtech/common/render/GT_IconFlipped.java | |
parent | 68619f5c654f8a44f499f79b859a26787d778a18 (diff) | |
download | GT5-Unofficial-eb95711aadb0066e70440111f93167f6164e6da8.tar.gz GT5-Unofficial-eb95711aadb0066e70440111f93167f6164e6da8.tar.bz2 GT5-Unofficial-eb95711aadb0066e70440111f93167f6164e6da8.zip |
WIP Texture support
Diffstat (limited to 'src/main/java/gregtech/common/render/GT_IconFlipped.java')
-rw-r--r-- | src/main/java/gregtech/common/render/GT_IconFlipped.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/main/java/gregtech/common/render/GT_IconFlipped.java b/src/main/java/gregtech/common/render/GT_IconFlipped.java index c3eee2900f..d4f96fed4f 100644 --- a/src/main/java/gregtech/common/render/GT_IconFlipped.java +++ b/src/main/java/gregtech/common/render/GT_IconFlipped.java @@ -11,6 +11,8 @@ public class GT_IconFlipped implements IIcon { private final boolean flipV; public GT_IconFlipped(IIcon baseIcon, boolean flipU, boolean flipV) { + if(baseIcon == null) + System.out.println("HI"); this.baseIcon = baseIcon; this.flipU = flipU; this.flipV = flipV; @@ -19,6 +21,7 @@ public class GT_IconFlipped implements IIcon { /** * Returns the width of the icon, in pixels. */ + @Override public int getIconWidth() { return this.baseIcon.getIconWidth(); } @@ -26,6 +29,7 @@ public class GT_IconFlipped implements IIcon { /** * Returns the height of the icon, in pixels. */ + @Override public int getIconHeight() { return this.baseIcon.getIconHeight(); } @@ -33,6 +37,7 @@ public class GT_IconFlipped implements IIcon { /** * Returns the minimum U coordinate to use when rendering with this icon. */ + @Override public float getMinU() { return this.flipU ? this.baseIcon.getMaxU() : this.baseIcon.getMinU(); } @@ -40,6 +45,7 @@ public class GT_IconFlipped implements IIcon { /** * Returns the maximum U coordinate to use when rendering with this icon. */ + @Override public float getMaxU() { return this.flipU ? this.baseIcon.getMinU() : this.baseIcon.getMaxU(); } @@ -47,14 +53,16 @@ public class GT_IconFlipped implements IIcon { /** * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. */ + @Override public float getInterpolatedU(double p_94214_1_) { - float f = this.getMaxU() - this.getMinU(); + final float f = this.getMaxU() - this.getMinU(); return this.getMinU() + f * ((float) p_94214_1_ / 16.0F); } /** * Returns the minimum V coordinate to use when rendering with this icon. */ + @Override public float getMinV() { return this.flipV ? this.baseIcon.getMaxV() : this.baseIcon.getMinV(); } @@ -62,6 +70,7 @@ public class GT_IconFlipped implements IIcon { /** * Returns the maximum V coordinate to use when rendering with this icon. */ + @Override public float getMaxV() { return this.flipV ? this.baseIcon.getMinV() : this.baseIcon.getMaxV(); } @@ -69,12 +78,14 @@ public class GT_IconFlipped implements IIcon { /** * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. */ + @Override public float getInterpolatedV(double p_94207_1_) { - float f = this.getMaxV() - this.getMinV(); + final float f = this.getMaxV() - this.getMinV(); return this.getMinV() + f * ((float) p_94207_1_ / 16.0F); } + @Override public String getIconName() { return this.baseIcon.getIconName(); } -}
\ No newline at end of file +} |