curFilter = prefs.getBoolean("linear", true) ? Texture.LINEAR : Texture.NEAREST;
grid = prefs.getBoolean("grid", true);
checkBG = prefs.getBoolean("checkBG", true);
polling = prefs.getBoolean("polling", true);
try {
Texture fontTex = new Texture(Util.getResource("res/ptsans_00.png"));
font = new BitmapFont(Util.getResource("res/ptsans.fnt"), fontTex);
String path = prefs.get("url", null);
if (path!=null&&path.length()!=0) {
try {
File file = new File(URLDecoder.decode(path, "UTF-8"));
if (file.exists()) {
url = file.toURI().toURL();
this.file = file;
lastModified = file.lastModified();
}
} catch (IOException e) {
e.printStackTrace();
}
}
if (url!=null)
reload();
terrain = new TerrainMesh(Util.getResource("res/height.png"));
terrain.create(1, 55f, 25f);
batch = new SpriteBatch();
//in Photoshop, we included a small white box at the bottom right of our font sheet
//we will use this to draw lines and rectangles within the same batch as our text
rect = new TextureRegion(fontTex, fontTex.getWidth()-2, fontTex.getHeight()-2, 1, 1);
fpsWidth = font.getWidth("FPS: 0000");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();