implements PLN-0042 scene glyph tooling and fixtures

This commit is contained in:
2026-04-24 14:15:31 +01:00
parent 0d6ff430a0
commit 4227d26101
4 changed files with 32 additions and 9 deletions
+6 -5
View File
@@ -4,8 +4,9 @@ use prometeu_bytecode::model::{
BytecodeModule, ConstantPoolEntry, DebugInfo, Export, FunctionMeta, SyscallDecl,
};
use prometeu_hal::asset::{
AssetCodec, AssetEntry, BankType, PreloadEntry, SCENE_DECODED_LAYER_OVERHEAD_BYTES_V1,
SCENE_LAYER_COUNT_V1, SCENE_PAYLOAD_MAGIC_V1, SCENE_PAYLOAD_VERSION_V1,
AssetCodec, AssetEntry, AssetId, BankType, PreloadEntry,
SCENE_DECODED_LAYER_OVERHEAD_BYTES_V1, SCENE_LAYER_COUNT_V1, SCENE_PAYLOAD_MAGIC_V1,
SCENE_PAYLOAD_VERSION_V1,
};
use prometeu_hal::cartridge::{
AssetsPackHeader, AssetsPackPrelude, ASSETS_PA_MAGIC, ASSETS_PA_PRELUDE_SIZE,
@@ -338,7 +339,7 @@ fn build_scene_bank() -> SceneBank {
SceneLayer {
active: true,
glyph_bank_id: 0,
glyph_asset_id: 100,
tile_size: TileSize::Size8,
parallax_factor: match layer_index {
0 => ParallaxFactor { x: 1.0, y: 1.0 },
@@ -381,9 +382,9 @@ fn encode_scene_payload(scene: &SceneBank) -> Vec<u8> {
for layer in &scene.layers {
let layer_flags = if layer.active { 0b0000_0001 } else { 0 };
data.push(layer_flags);
data.push(layer.glyph_bank_id);
data.extend_from_slice(&(layer.glyph_asset_id as AssetId).to_le_bytes());
data.push(layer.tile_size as u8);
data.push(0);
data.extend_from_slice(&0_u16.to_le_bytes());
data.extend_from_slice(&layer.parallax_factor.x.to_le_bytes());
data.extend_from_slice(&layer.parallax_factor.y.to_le_bytes());
data.extend_from_slice(&(layer.tilemap.width as u32).to_le_bytes());