mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 11:29:15 +00:00
56 lines
2.1 KiB
Diff
56 lines
2.1 KiB
Diff
--- ../src_base/minecraft/net/minecraft/client/renderer/texture/Texture.java
|
|
+++ ../src_work/minecraft/net/minecraft/client/renderer/texture/Texture.java
|
|
@@ -214,7 +214,33 @@
|
|
this.textureData.position(0);
|
|
bytebuffer.position(0);
|
|
|
|
- for (int k = 0; k < par3Texture.getHeight(); ++k)
|
|
+ /* Forge:
|
|
+ *
|
|
+ * Optimize these loops a bit for non-rotated textures.
|
|
+ * Should help the FPS loss on higher resolution texture packs.
|
|
+ * If it becomes a major issue we may have to look into a more
|
|
+ * optimized animation system.
|
|
+ *
|
|
+ * https://mojang.atlassian.net/browse/MC-13206
|
|
+ */
|
|
+ if (!par4)
|
|
+ {
|
|
+ int scanSize = par3Texture.getWidth() * 4;
|
|
+ int w4 = width * 4;
|
|
+ int targetY = (par2 * w4) + (par1 * 4);
|
|
+
|
|
+ for (int y = 0; y < par3Texture.getHeight(); y++)
|
|
+ {
|
|
+ textureData.position(targetY);
|
|
+ for (int x = 0; x < scanSize; x++)
|
|
+ {
|
|
+ textureData.put(bytebuffer.get());
|
|
+ }
|
|
+ targetY += w4;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ for (int k = 0; par4 && k < par3Texture.getHeight(); ++k)
|
|
{
|
|
int l = par2 + k;
|
|
int i1 = k * par3Texture.getWidth() * 4;
|
|
@@ -222,7 +248,7 @@
|
|
|
|
if (par4)
|
|
{
|
|
- l = par2 + (par3Texture.getHeight() - k);
|
|
+ l = par1 + (par3Texture.getHeight() - k - 1); //BUGFIX: targetY -> targetX and -1
|
|
}
|
|
|
|
for (int k1 = 0; k1 < par3Texture.getWidth(); ++k1)
|
|
@@ -232,7 +258,7 @@
|
|
|
|
if (par4)
|
|
{
|
|
- l1 = par1 + k1 * this.width * 4 + l * 4;
|
|
+ l1 = (par2 + k1) * this.width * 4 + l * 4; //BUGFIX: targetX -> targetY and parens
|
|
}
|
|
|
|
this.textureData.put(l1 + 0, bytebuffer.get(i2 + 0));
|