diff --git a/pomme-client/assets/gui/title/edition.png b/pomme-client/assets/gui/title/edition.png new file mode 100644 index 000000000..b7bf81c14 Binary files /dev/null and b/pomme-client/assets/gui/title/edition.png differ diff --git a/pomme-client/src/assets.rs b/pomme-client/src/assets.rs index d9a750158..3cefc88fe 100644 --- a/pomme-client/src/assets.rs +++ b/pomme-client/src/assets.rs @@ -69,6 +69,13 @@ pub(crate) fn valid_asset_key(asset_key: &str) -> bool { pub const POMME_ICON_PNG: &[u8] = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/icon.png")); +/// The "Rust Edition" banner under the title logo, laid out like the jar's +/// `edition.png`. +pub const POMME_EDITION_PNG: &[u8] = include_bytes!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/assets/gui/title/edition.png" +)); + pub fn load_image(path: &Path) -> Result { image::open(path).or_else(|_| { let data = std::fs::read(path).map_err(image::ImageError::IoError)?; diff --git a/pomme-client/src/renderer/pipelines/menu_overlay.rs b/pomme-client/src/renderer/pipelines/menu_overlay.rs index 8415c8251..2fdef9303 100644 --- a/pomme-client/src/renderer/pipelines/menu_overlay.rs +++ b/pomme-client/src/renderer/pipelines/menu_overlay.rs @@ -3894,24 +3894,27 @@ fn build_sprite_atlas( } // `LogoRenderer` blits only the top 44/64 of minecraft.png and 14/16 of - // edition.png. The files are supersampled and packs may use any size, so - // crop by fraction; a row-major prefix is contiguous, so it's a truncate. - for (id, asset_key, logical_h, used_h) in [ + // edition.png. Both are supersampled, so crop by fraction; a row-major + // prefix is contiguous, so it's a truncate. + for (id, image, logical_h, used_h) in [ ( SpriteId::MinecraftLogo, - "minecraft/textures/gui/title/minecraft.png", + crate::assets::load_image(&resolve_asset_path( + jar_assets_dir, + asset_index, + "minecraft/textures/gui/title/minecraft.png", + )), 64u32, 44u32, ), ( SpriteId::MinecraftEdition, - "minecraft/textures/gui/title/edition.png", + image::load_from_memory(crate::assets::POMME_EDITION_PNG), 16, 14, ), ] { - let path = resolve_asset_path(jar_assets_dir, asset_index, asset_key); - match crate::assets::load_image(&path) { + match image { Ok(img) => { let rgba = img.to_rgba8(); let (w, h) = (rgba.width(), rgba.height()); @@ -3921,7 +3924,7 @@ fn build_sprite_atlas( images.push((id, raw, w, used, 0.0)); } Err(e) => { - tracing::warn!("Failed to load title sprite {asset_key}: {e}"); + tracing::warn!("Failed to load title sprite {id:?}: {e}"); images.push((id, vec![255, 0, 255, 255], 1, 1, 0.0)); } }