/** * Return the game title screen, in a dumb way following last Enterbrain conventions to avoid * numerous syscalls. */ public static Bitmap getGameTitleScreen(GameInformation gameInformation) { // Search the title folder : the dumb way File dir = new File(gameInformation.getGameFolderPath() + "/Title"); if (dir.isDirectory() && dir.canRead()) { File[] files = dir.listFiles(); for (File f : files) { String name = f.getName().toLowerCase().trim(); if (!f.getName().startsWith(".") && (name.endsWith("png") || name.endsWith("bmp") || name.endsWith("xyz"))) { Bitmap b = BitmapFactory.decodeFile(f.getAbsolutePath()); if (b == null && GameBrowserActivity.libraryLoaded) { // Check for XYZ byte[] xyz = decodeXYZ(f.getAbsolutePath()); if (xyz == null) { return null; } return BitmapFactory.decodeByteArray(xyz, 0, xyz.length); } return b; } } } return null; }