diff --git a/fml/client/cpw/mods/fml/client/GuiModList.java b/fml/client/cpw/mods/fml/client/GuiModList.java index 8e0ee720b..093a00d11 100644 --- a/fml/client/cpw/mods/fml/client/GuiModList.java +++ b/fml/client/cpw/mods/fml/client/GuiModList.java @@ -102,7 +102,7 @@ public class GuiModList extends GuiScreen public int drawLine(String line, int offset, int shifty) { - this.field_73886_k.func_78276_b(line, offset, shifty, 0xd7edea); + int r = this.field_73886_k.func_78276_b(line, offset, shifty, 0xd7edea); return shifty + 10; } @@ -116,12 +116,21 @@ public class GuiModList extends GuiScreen GL11.glEnable(GL11.GL_BLEND); if (!selectedMod.getMetadata().autogenerated) { int shifty = 35; - if (!selectedMod.getMetadata().logoFile.isEmpty()) + String logoFile = selectedMod.getMetadata().logoFile; + if (!logoFile.isEmpty()) { - int texture = this.field_73882_e.field_71446_o.func_78341_b(selectedMod.getMetadata().logoFile); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.field_73882_e.field_71446_o.func_78342_b(texture); - Dimension dim = TextureFXManager.instance().getTextureDimensions(texture); + this.field_73882_e.field_71446_o.func_98187_b(logoFile); + Dimension dim = TextureFXManager.instance().getTextureDimensions(logoFile); + double scaleX = dim.width / 200.0; + double scaleY = dim.height / 65.0; + double scale = 1.0; + if (scaleX > 1 || scaleY > 1) + { + scale = 1.0 / Math.max(scaleX, scaleY); + } + dim.width *= scale; + dim.height *= scale; int top = 32; Tessellator tess = Tessellator.field_78398_a; tess.func_78382_b(); @@ -144,7 +153,11 @@ public class GuiModList extends GuiScreen shifty = drawLine(String.format("Authors: %s", selectedMod.getMetadata().getAuthorList()), offset, shifty); shifty = drawLine(String.format("URL: %s", selectedMod.getMetadata().url), offset, shifty); shifty = drawLine(selectedMod.getMetadata().childMods.isEmpty() ? "No child mods for this mod" : String.format("Child mods: %s", selectedMod.getMetadata().getChildModList()), offset, shifty); - this.getFontRenderer().func_78279_b(selectedMod.getMetadata().description, offset, shifty + 10, this.field_73880_f - offset - 20, 0xDDDDDD); + int rightSide = this.field_73880_f - offset - 20; + if (rightSide > 20) + { + this.getFontRenderer().func_78279_b(selectedMod.getMetadata().description, offset, shifty + 10, rightSide, 0xDDDDDD); + } } else { offset = ( this.listWidth + this.field_73880_f ) / 2; this.func_73732_a(this.field_73886_k, selectedMod.getName(), offset, 35, 0xFFFFFF); diff --git a/fml/client/cpw/mods/fml/client/TextureFXManager.java b/fml/client/cpw/mods/fml/client/TextureFXManager.java index c21933801..0a6448945 100644 --- a/fml/client/cpw/mods/fml/client/TextureFXManager.java +++ b/fml/client/cpw/mods/fml/client/TextureFXManager.java @@ -5,19 +5,23 @@ * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * + * * Contributors: * cpw - implementation */ package cpw.mods.fml.client; +import java.awt.Dimension; import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream; +import java.util.Map; import javax.imageio.ImageIO; +import com.google.common.collect.Maps; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderEngine; @@ -27,6 +31,9 @@ public class TextureFXManager private Minecraft client; + private Map texturesById = Maps.newHashMap(); + private Map texturesByName = Maps.newHashMap(); + void setClient(Minecraft client) { this.client = client; @@ -64,5 +71,35 @@ public class TextureFXManager } } } + public void bindTextureToName(String name, int index) + { + TextureHolder holder = new TextureHolder(); + holder.textureId = index; + holder.textureName = name; + texturesById.put(index,holder); + texturesByName.put(name,holder); + } + public void setTextureDimensions(int index, int j, int k) + { + TextureHolder holder = texturesById.get(index); + if (holder == null) + { + return; + } + holder.x = j; + holder.y = k; + } + + private class TextureHolder { + private int textureId; + private String textureName; + private int x; + private int y; + } + + public Dimension getTextureDimensions(String texture) + { + return texturesByName.containsKey(texture) ? new Dimension(texturesByName.get(texture).x, texturesByName.get(texture).y) : new Dimension(1,1); + } } diff --git a/fml/commands.patch b/fml/commands.patch index 5c68a9a7f..a83379470 100644 --- a/fml/commands.patch +++ b/fml/commands.patch @@ -4,21 +4,12 @@ def reallyrmtree(path): -+ if os.path.isfile(os.path.join(path, 'asm-4.1.tar.gz')): #Check if asm exists, indicating the libs folder, if so, don't delete it ++ if os.path.isfile(os.path.join(path, 'asm-all-4.0.jar')): #Check if asm exists, indicating the libs folder, if so, don't delete it + return if not sys.platform.startswith('win'): if os.path.exists(path): shutil.rmtree(path) -@@ -139,6 +141,8 @@ - fieldnames = csvreader.fieldnames - return set(fieldnames) - -+def commands_sanity_check(): -+ print 'Commands patch applied successfully' - - class Commands(object): - """Contains the commands and initialisation for a full mcp run""" -@@ -796,6 +800,8 @@ +@@ -788,6 +790,8 @@ binlk = {CLIENT: self.binclient, SERVER: self.binserver} testlk = {CLIENT: self.testclient, SERVER: self.testserver} @@ -27,7 +18,7 @@ if not os.path.exists(os.path.join(binlk[side], os.path.normpath(testlk[side] + '.class'))): return False return True -@@ -1037,6 +1043,10 @@ +@@ -1029,6 +1033,10 @@ pathsrclk = {CLIENT: self.srcclient, SERVER: self.srcserver} pathlog = {CLIENT: self.clientrecomplog, SERVER: self.serverrecomplog} @@ -38,7 +29,7 @@ if not os.path.exists(pathbinlk[side]): os.makedirs(pathbinlk[side]) -@@ -1070,7 +1080,7 @@ +@@ -1062,7 +1070,7 @@ raise def startserver(self): @@ -47,7 +38,7 @@ classpath = [os.path.join('..', p) for p in classpath] classpath = os.pathsep.join(classpath) os.chdir(self.dirjars) -@@ -1078,7 +1088,7 @@ +@@ -1070,7 +1078,7 @@ self.runmc(forkcmd) def startclient(self): @@ -56,7 +47,7 @@ classpath = [os.path.join('..', p) for p in classpath] classpath = os.pathsep.join(classpath) natives = os.path.join('..', self.dirnatives) -@@ -1205,20 +1215,20 @@ +@@ -1197,20 +1205,20 @@ with open(self.csvmethods, 'rb') as fh: methodsreader = csv.DictReader(fh) for row in methodsreader: @@ -80,7 +71,7 @@ names['params'][row['param']] = row['name'] regexps = { -@@ -1352,13 +1362,13 @@ +@@ -1344,13 +1352,13 @@ methods = {} for row in methodsreader: #HINT: Only include methods that have a non-empty description @@ -96,7 +87,7 @@ fields[row['searge']] = row['desc'].replace('*/', '* /') regexps = { -@@ -1435,7 +1445,7 @@ +@@ -1427,7 +1435,7 @@ self.runcmd(forkcmd) return True @@ -105,7 +96,7 @@ if not reobf: md5lk = {CLIENT: self.md5client, SERVER: self.md5server} else: -@@ -1450,6 +1460,9 @@ +@@ -1442,6 +1450,9 @@ class_path = '' else: class_path += '/' @@ -115,7 +106,7 @@ for class_file in fnmatch.filter(filelist, '*.class'): class_name = class_path + os.path.splitext(class_file)[0] bin_file = os.path.normpath(os.path.join(path, class_file)) -@@ -1546,6 +1559,8 @@ +@@ -1535,6 +1546,8 @@ if not os.path.exists(outpathlk[side]): os.makedirs(outpathlk[side]) @@ -124,7 +115,7 @@ # HINT: We extract the modified class files with closing(zipfile.ZipFile(jarlk[side])) as zipjar: for in_class in trgclasses: -@@ -1559,6 +1574,23 @@ +@@ -1548,6 +1561,23 @@ out_class = out_class.replace(self.nullpkg, '') if out_class[0] == '/': out_class = out_class[1:] @@ -148,7 +139,7 @@ try: zipjar.extract(out_class, outpathlk[side]) self.logger.info('> Outputted %s to %s as %s', in_class.ljust(35), outpathlk[side], out_class) -@@ -1605,6 +1637,9 @@ +@@ -1594,6 +1624,9 @@ sys.exit(1) for entry in newfiles: @@ -158,7 +149,7 @@ if entry[3] == 'U': self.logger.info('Retrieving file from server : %s', entry[0]) cur_file = os.path.normpath(entry[0]) -@@ -1625,6 +1660,9 @@ +@@ -1614,6 +1647,9 @@ md5reoblk = {CLIENT: self.md5reobfclient, SERVER: self.md5reobfserver} outpathlk = {CLIENT: self.srcmodclient, SERVER: self.srcmodserver} src = {CLIENT: self.srcclient, SERVER: self.srcserver} @@ -168,3 +159,10 @@ # HINT: We need a table for the old md5 and the new ones md5table = {} +@@ -1656,3 +1692,6 @@ + except IOError: + self.logger.error('* File %s copy failed', in_class) + ++def commands_sanity_check(): ++ print 'Commands patch applied successfully' ++ diff --git a/fml/common/mcpmod.info b/fml/common/mcpmod.info index 3b4d2db6e..ec286aba5 100644 --- a/fml/common/mcpmod.info +++ b/fml/common/mcpmod.info @@ -5,7 +5,7 @@ "description": "Modding toolkit to decompile and deobfuscate the Minecraft client and server files.", "version": "7.42", "mcversion": "1.5", - "logoFile": "mcp.png", + "logoFile": "/mcp.png", "url": "http://mcp.ocean-labs.de/", "updateUrl": "", "authors": ["Searge", "ProfMobius", "IngisKahn", "Fesh0r", "ZeuX", "R4wk", "Others"], diff --git a/fml/patches/minecraft/net/minecraft/client/renderer/RenderEngine.java.patch b/fml/patches/minecraft/net/minecraft/client/renderer/RenderEngine.java.patch index 1006a2ccc..b6f3c64be 100644 --- a/fml/patches/minecraft/net/minecraft/client/renderer/RenderEngine.java.patch +++ b/fml/patches/minecraft/net/minecraft/client/renderer/RenderEngine.java.patch @@ -52,7 +52,15 @@ ioexception.printStackTrace(); int[] aint2 = this.func_78348_b(this.field_78364_l); this.field_78359_d.put(p_78346_1_, aint2); -@@ -184,7 +195,9 @@ +@@ -162,6 +173,7 @@ + try + { + int i = GLAllocation.func_74528_a(); ++ TextureFXManager.instance().bindTextureToName(p_78341_1_, i); + boolean flag = p_78341_1_.startsWith("%blur%"); + + if (flag) +@@ -184,7 +196,9 @@ } else { @@ -63,7 +71,15 @@ } this.field_78362_c.put(s1, Integer.valueOf(i)); -@@ -412,10 +425,12 @@ +@@ -240,6 +254,7 @@ + + int j = p_98184_1_.getWidth(); + int k = p_98184_1_.getHeight(); ++ TextureFXManager.instance().setTextureDimensions(p_98184_2_, j, k); + int[] aint = new int[j * k]; + p_98184_1_.getRGB(0, 0, j, k, aint, 0, j); + +@@ -412,10 +427,12 @@ } BufferedImage bufferedimage1 = this.func_78345_a(itexturepack.func_77532_a(s)); @@ -78,7 +94,7 @@ ioexception.printStackTrace(); } } -@@ -429,10 +444,12 @@ +@@ -429,10 +446,12 @@ try { bufferedimage = this.func_78345_a(itexturepack.func_77532_a(s));