aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gregtech/api/enums/TAE.java
blob: 04a8d16ee8c0ce2a59af53232a2bc5b9c2b61691 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package gregtech.api.enums;

import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gtPlusPlus.core.util.Utils;

public class TAE {

	//TAE stands for Texture Array Expansion.
	
	public static int gtTexturesArrayStartOrigin;
	public static int gtPPLastUsedIndex = 96;
	public static boolean hasArrayBeenExpanded = false;

	public static boolean hookGtTextures() {
		/*ITexture[] textureArrayDump = Textures.BlockIcons.CASING_BLOCKS;
		ITexture[] newTextureArray = new ITexture[1024];
		Utils.LOG_INFO("|======| Texture Array Start Length: "+textureArrayDump.length+" |======|");
		for (int r=0;r<textureArrayDump.length;r++){
			if (textureArrayDump[r] == null){
				Utils.LOG_WARNING("Texture slot "+r+" is empty.");
			}
		}
		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;*/	
		return true;
	}

	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[(96+index)];
		}
	}
	
	public static int GTPP_INDEX(int ID){
		return (96+ID);
	}
}