implements PLN-0042 scene glyph tooling and fixtures
This commit is contained in:
@@ -847,4 +847,27 @@ mod tests {
|
||||
assert!(message.contains("SCENE dependency fatal during render_frame"));
|
||||
assert!(message.contains("glyph_asset_id=1"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn render_frame_resolves_glyph_dependency_by_asset_id_not_by_slot_number() {
|
||||
let banks = Arc::new(MemoryBanks::new());
|
||||
banks.install_glyph_bank(7, Arc::new(make_glyph_bank(TileSize::Size8, 2, Color::BLUE)));
|
||||
banks.install_scene_bank(0, Arc::new(make_scene_with_palette(42, 2, TileSize::Size8)));
|
||||
|
||||
let mut frame_composer = FrameComposer::new(
|
||||
16,
|
||||
16,
|
||||
Arc::clone(&banks) as Arc<dyn SceneBankPoolAccess>,
|
||||
make_glyph_slot_index(&[(42, 7)]),
|
||||
);
|
||||
assert!(frame_composer.bind_scene(0));
|
||||
|
||||
let mut gfx = Gfx::new(16, 16, Arc::clone(&banks) as Arc<dyn GlyphBankPoolAccess>);
|
||||
gfx.scene_fade_level = 31;
|
||||
gfx.hud_fade_level = 31;
|
||||
frame_composer.render_frame(&mut gfx);
|
||||
gfx.present();
|
||||
|
||||
assert_eq!(gfx.front_buffer()[0], Color::BLUE.raw());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user