static { String system = System.getProperty("os.name").toLowerCase(); OSX = system.indexOf("mac") >= 0; WIN = system.indexOf("win") >= 0; LINUX = system.indexOf("nux") >= 0 | system.indexOf("nix") >= 0 | system.indexOf("aix") >= 0; assert ((WIN && !OSX && !LINUX) || (!WIN && OSX && !LINUX) || (!WIN && !OSX && LINUX)); }
private void loadIcons() throws IOException { final String OS = System.getProperty("os.name").toLowerCase(Locale.ENGLISH); if (OS.contains("win")) { // Expects one 32x32 and one 16x16 icons = new ByteBuffer[2]; icons[0] = TextureLoader.convertImageData(TextureLoader.loadImage("icon_32.png"), null, true); icons[1] = TextureLoader.convertImageData(TextureLoader.loadImage("icon_16.png"), null, true); } else if (OS.contains("mac")) { // Expects one 128x128 icons = new ByteBuffer[1]; icons[0] = TextureLoader.convertImageData(TextureLoader.loadImage("icon_128.png"), null, true); } else { // Expects one 32x32 icons = new ByteBuffer[1]; icons[0] = TextureLoader.convertImageData(TextureLoader.loadImage("icon_32.png"), null, true); } }
public static void initDisplayLists() throws IOException { Main.dl_zombiebody = glGenLists(1); glNewList(Main.dl_zombiebody, GL_COMPILE); zombiebody(); glEndList(); Main.dl_zombiehead = glGenLists(1); glNewList(Main.dl_zombiehead, GL_COMPILE); zombiehead(); glEndList(); Main.dl_bullet = Model.getDL(System.getProperty("user.dir") + "/res/obj/bullet.obj"); Main.dl_grenade = Model.getDL(System.getProperty("user.dir") + "/res/obj/grenade.obj"); Main.dl_cexplosive = Model.getDL(System.getProperty("user.dir") + "/res/obj/item2.obj"); Main.dl_gun = new int[3]; Main.dl_gun[0] = Model.getDL(System.getProperty("user.dir") + "/res/obj/gun0.obj"); Main.dl_gun[1] = Model.getDL(System.getProperty("user.dir") + "/res/obj/gun1.obj"); Main.dl_gun[2] = Model.getDL(System.getProperty("user.dir") + "/res/obj/gun2.obj"); Main.dl_floorandmap = glGenLists(1); glNewList(Main.dl_floorandmap, GL_COMPILE); floor(); new Model(System.getProperty("user.dir") + "/res/map/map.obj").render(); glEndList(); }