aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-font/src/bitmap.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-12-02 00:39:12 +0300
committerValentin Popov <valentin@popov.link>2026-12-02 00:39:12 +0300
commit6c9fe794cda795b101825091aee4644efd9422f8 (patch)
tree809310e22352b8f2ad59413caed89a57ec436aac /crates/fparkan-font/src/bitmap.rs
parent72eff35e96ea0c9029248d8403c0a37f63642b79 (diff)
downloadfparkan-6c9fe794cda795b101825091aee4644efd9422f8.tar.xz
fparkan-6c9fe794cda795b101825091aee4644efd9422f8.zip
feat(ui): show installed warbot weapons in the cockpit
Resolve each selected mount through the original objects.dlb short name and render the live weapon bank after boarding. On a stock Fireline start the medium warbot shows the laser and both separate missile racks. Firing the selected rack reduces its ammunition from 18 to 17 while the other still reads 18.
Diffstat (limited to 'crates/fparkan-font/src/bitmap.rs')
-rw-r--r--crates/fparkan-font/src/bitmap.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/fparkan-font/src/bitmap.rs b/crates/fparkan-font/src/bitmap.rs
index c28ce7f4..039e3b9f 100644
--- a/crates/fparkan-font/src/bitmap.rs
+++ b/crates/fparkan-font/src/bitmap.rs
@@ -128,6 +128,16 @@ impl BitmapFont {
if unmappable {
return Err("game text contains characters outside CP1251".into());
}
+ self.centered_line_bytes(&bytes, width, height)
+ }
+
+ /// Composes a single line from a game resource's original CP1251 bytes.
+ pub fn centered_line_bytes(
+ &self,
+ bytes: &[u8],
+ width: u16,
+ height: u16,
+ ) -> Result<RgbaImage, String> {
let (width, height) = (usize::from(width), usize::from(height));
if height < self.glyph_height || width == 0 {
return Err("game text rectangle is too small".into());