private static void main2(String[] args) {
		Config.cmdline(args);
		ThreadGroup g = HackThread.tg();
		setupres();
		MainFrame f = new MainFrame(800, 600);
		if (Config.fullscreen)
			f.setfs();
		f.resetCenter();
		f.g = g;
		if (g instanceof haven.error.ErrorHandler) {
			final haven.error.ErrorHandler hg = (haven.error.ErrorHandler) g;
			hg.sethandler(new haven.error.ErrorGui(null) {
				public void errorsent() {
					hg.interrupt();
				}
			});
		}
		f.run();
		dumplist(Resource.loadwaited, Config.loadwaited);
		dumplist(Resource.cached(), Config.allused);
		if (ResCache.global != null) {
			try {
				Collection<Resource> used = new LinkedList<Resource>();
				for (Resource res : Resource.cached()) {
					if (res.prio >= 0)
						used.add(res);
				}
				Writer w = new OutputStreamWriter(
						ResCache.global.store("tmp/allused"), "UTF-8");
				try {
					Resource.dumplist(used, w);
				} finally {
					w.close();
				}
			} catch (IOException e) {
			}
		}
	}