/** * Decodes and returns a library synchronously. */ protected static Library decodeLibrarySync (final Platform plat, LibraryData libData, String baseDir) { RPromise<Library> result = RPromise.create(); decodeLibrary(libData, baseDir, result, new ImageLoader() { @Override public Image load (String path) { return plat.assets().getImageSync(path); } }); // this blows, but I don't want to add RPromise.get() final Library[] out = new Library[1]; result.onSuccess(new Slot<Library>() { public void onEmit (Library library) { out[0] = library; } }); assert out[0] != null; return out[0]; }