aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gregtech
diff options
context:
space:
mode:
authorAlkalus <draknyte1@hotmail.com>2017-07-11 10:09:00 +1000
committerAlkalus <draknyte1@hotmail.com>2017-07-11 10:09:00 +1000
commit8f5d3cb93690fa15cae0999eb17994213d920288 (patch)
treeba27d602b44e92bcc635175c0a50b6c425755842 /src/Java/gregtech
parent15916806ea230a62d81c1cdb54a25ce74d0ca5bd (diff)
downloadGT5-Unofficial-8f5d3cb93690fa15cae0999eb17994213d920288.tar.gz
GT5-Unofficial-8f5d3cb93690fa15cae0999eb17994213d920288.tar.bz2
GT5-Unofficial-8f5d3cb93690fa15cae0999eb17994213d920288.zip
$ Fixed Industrial Sieve Tooltip.
$ Implemented Texture Array Expansion. > This fixes the issue of hatches not using the correct textures.
Diffstat (limited to 'src/Java/gregtech')
-rw-r--r--src/Java/gregtech/api/enums/TAE.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/Java/gregtech/api/enums/TAE.java b/src/Java/gregtech/api/enums/TAE.java
new file mode 100644
index 0000000000..40811a141c
--- /dev/null
+++ b/src/Java/gregtech/api/enums/TAE.java
@@ -0,0 +1,54 @@
+package gregtech.api.enums;
+
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.objects.GT_CopiedBlockTexture;
+import gregtech.api.objects.GT_RenderedTexture;
+
+public class TAE {
+
+ //TAE stands for Texture Array Expansion.
+
+ public static int gtTexturesArrayStartOrigin;
+ public static int gtPPLastUsedIndex = 512;
+ public static boolean hasArrayBeenExpanded = false;
+
+ public static boolean hookGtTextures() {
+ ITexture[] textureArrayDump = Textures.BlockIcons.CASING_BLOCKS;
+ GT_RenderedTexture[] newTextureArray = new GT_RenderedTexture[1024];
+ gtTexturesArrayStartOrigin = textureArrayDump.length;
+ System.arraycopy(textureArrayDump, 0, newTextureArray, 0, textureArrayDump.length);
+ Textures.BlockIcons.CASING_BLOCKS = newTextureArray;
+ if (Textures.BlockIcons.CASING_BLOCKS.length == 1024){
+ hasArrayBeenExpanded = true;
+ }
+ else {
+ hasArrayBeenExpanded = false;
+ }
+ return hasArrayBeenExpanded;
+ }
+
+ public static boolean registerTextures(GT_RenderedTexture textureToRegister) {
+ Textures.BlockIcons.CASING_BLOCKS[gtPPLastUsedIndex++] = textureToRegister;
+ //Just so I know registration is done.
+ return true;
+ }
+
+ public static boolean registerTextures(GT_CopiedBlockTexture gt_CopiedBlockTexture) {
+ Textures.BlockIcons.CASING_BLOCKS[gtPPLastUsedIndex++] = gt_CopiedBlockTexture;
+ //Just so I know registration is done.
+ return true;
+ }
+
+ public static ITexture getTexture(int index){
+ if (!hasArrayBeenExpanded){
+ return null;
+ }
+ else {
+ return Textures.BlockIcons.CASING_BLOCKS[(512+index)];
+ }
+ }
+
+ public static int GTPP_INDEX(int ID){
+ return (512+ID);
+ }
+}