added base for RenderingHints
parent
129ba135e9
commit
bf933201c2
|
@ -79,6 +79,7 @@ public class Project extends JPanel {
|
|||
tick();
|
||||
}
|
||||
}, 20, 20);
|
||||
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
|
|
|
@ -18,7 +18,6 @@ public class Amidst {
|
|||
public static final Gson gson = new Gson();
|
||||
|
||||
public static void main(String args[]) {
|
||||
|
||||
Util.setLookAndFeel();
|
||||
Google.startTracking();
|
||||
Google.track("Run");
|
||||
|
|
|
@ -24,7 +24,6 @@ import amidst.Util;
|
|||
public class InstallInformation {
|
||||
public String name;
|
||||
public String lastVersionId;
|
||||
public String gameDir;
|
||||
public String javaDir;
|
||||
public String javaArgs;
|
||||
public Resolution resolution;
|
||||
|
@ -40,13 +39,11 @@ public class InstallInformation {
|
|||
name = "Minecraft";
|
||||
lastVersionId = "None";
|
||||
}
|
||||
gameDir = Util.minecraftDirectory.toString();
|
||||
isOld = old;
|
||||
}
|
||||
public InstallInformation(String name, String version) {
|
||||
this.name = name;
|
||||
lastVersionId = version;
|
||||
gameDir = Util.minecraftDirectory.toString();
|
||||
isOld = false;
|
||||
}
|
||||
public boolean validate() {
|
||||
|
@ -115,19 +112,19 @@ public class InstallInformation {
|
|||
}
|
||||
public boolean doesJarExist() {
|
||||
if (isOld)
|
||||
return (new File(Util.minecraftDirectory.toString() + "/bin/minecraft.jar")).exists();
|
||||
return (new File(Util.minecraftDirectory + "/bin/minecraft.jar")).exists();
|
||||
else
|
||||
return (new File(gameDir + "/versions/" + lastVersionId + "/" + lastVersionId + ".jar")).exists();
|
||||
return (new File(Util.minecraftDirectory + "/versions/" + lastVersionId + "/" + lastVersionId + ".jar")).exists();
|
||||
}
|
||||
|
||||
public File getJarFile() {
|
||||
File returnFile;
|
||||
if (!isOld) {
|
||||
returnFile = new File(gameDir + "/versions/" + lastVersionId + "/" + lastVersionId + ".jar");
|
||||
returnFile = new File(Util.minecraftDirectory + "/versions/" + lastVersionId + "/" + lastVersionId + ".jar");
|
||||
if (returnFile.exists())
|
||||
return returnFile;
|
||||
Log.i("Attempt to get jar failed. Path: " + returnFile);
|
||||
File versionsPath = new File(gameDir + "/versions/");
|
||||
File versionsPath = new File(Util.minecraftDirectory + "/versions/");
|
||||
if (versionsPath.exists()) { // https://s3.amazonaws.com/Minecraft.Download/versions/versions.json
|
||||
File[] files = versionsPath.listFiles();
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
|
@ -140,7 +137,7 @@ public class InstallInformation {
|
|||
Log.i("Attempt to browse versions folder failed. Path: " + versionsPath);
|
||||
}
|
||||
}
|
||||
returnFile = new File(Util.minecraftDirectory.toString() + "/bin/minecraft.jar");
|
||||
returnFile = new File(Util.minecraftDirectory + "/bin/minecraft.jar");
|
||||
if (returnFile.exists())
|
||||
return returnFile;
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package amidst.map;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.RenderingHints.Key;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Stack;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
@ -34,6 +36,9 @@ public class Map {
|
|||
|
||||
private boolean firstDraw = true;
|
||||
|
||||
|
||||
private RenderingHints renderingHints;
|
||||
|
||||
// TODO : This must be changed with the removal of ChunkManager
|
||||
public Map(Layer[] layers, Layer[] liveLayers, IconLayer[] iconLayers) {
|
||||
for (Layer layer : layers)
|
||||
|
@ -51,6 +56,19 @@ public class Map {
|
|||
|
||||
start = new Point2D.Double();
|
||||
addStart(0, 0);
|
||||
|
||||
HashMap<Key, Object> hintMap = new HashMap<Key, Object>();
|
||||
hintMap.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
|
||||
hintMap.put(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED);
|
||||
hintMap.put(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED);
|
||||
hintMap.put(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE);
|
||||
hintMap.put(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
|
||||
hintMap.put(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
|
||||
hintMap.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
|
||||
hintMap.put(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
|
||||
hintMap.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
|
||||
|
||||
renderingHints = new RenderingHints(hintMap);
|
||||
}
|
||||
|
||||
|
||||
|
@ -59,6 +77,8 @@ public class Map {
|
|||
firstDraw = false;
|
||||
centerOn(0, 0);
|
||||
}
|
||||
// TODO: Enable via settings?
|
||||
//g.setRenderingHints(renderingHints);
|
||||
synchronized (drawLock) {
|
||||
int size = (int) (Fragment.SIZE * scale);
|
||||
int w = width / size + 2;
|
||||
|
@ -75,8 +95,6 @@ public class Map {
|
|||
while (start.y < -size) { start.y += size; addRow(END); removeRow(START); }
|
||||
|
||||
//g.setColor(Color.pink);
|
||||
//g.fillRect(5, 5, width - 10, height - 10);
|
||||
|
||||
Fragment frag = startNode;
|
||||
size = Fragment.SIZE;
|
||||
if (frag.hasNext) {
|
||||
|
@ -124,6 +142,7 @@ public class Map {
|
|||
}
|
||||
|
||||
g.setTransform(iMat);
|
||||
|
||||
}
|
||||
}
|
||||
public void addStart(int x, int y) {
|
||||
|
|
|
@ -64,7 +64,8 @@ public class Minecraft {
|
|||
new CCMethodPreset(
|
||||
"IntCache",
|
||||
"a(int)", "getIntCache",
|
||||
"a()", "resetIntCache"
|
||||
"a()", "resetIntCache",
|
||||
"b()", "getInformation"
|
||||
),
|
||||
new CCPropertyPreset(
|
||||
"IntCache",
|
||||
|
|
|
@ -13,6 +13,10 @@ public class MinecraftUtil {
|
|||
Minecraft.getActiveMinecraft().getClassByName("IntCache").callFunction("resetIntCache");
|
||||
return (int[])Minecraft.getActiveMinecraft().getGlobal("biomeGen").callFunction("getInts", x, y, width, height);
|
||||
}
|
||||
|
||||
public static String getIntCacheInfo() {
|
||||
return (String) Minecraft.getActiveMinecraft().getClassByName("IntCache").callFunction("getInformation");
|
||||
}
|
||||
public static Point findValidLocation(int x, int y, int size, List<Biome> paramList, Random random) {
|
||||
// TODO: Clean up this code
|
||||
int i = x - size >> 2;
|
||||
|
|
Loading…
Reference in New Issue