implements PLN-0026
This commit is contained in:
@@ -247,10 +247,15 @@ impl FrameComposer {
|
||||
{
|
||||
let update = resolver.update(scene, self.camera_x_px, self.camera_y_px);
|
||||
Self::apply_refresh_requests(cache, scene, &update.refresh_requests);
|
||||
// `FrameComposer` owns only canonical game-frame composition.
|
||||
// Deferred `gfx.*` primitives are drained later by a separate
|
||||
// overlay/debug stage outside this service boundary.
|
||||
gfx.render_scene_from_cache(cache, &update);
|
||||
return;
|
||||
}
|
||||
|
||||
// No-scene frames still stop at canonical game composition. Final
|
||||
// overlay/debug work remains outside `FrameComposer`.
|
||||
gfx.render_no_scene_frame();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,22 +31,11 @@ pub enum BlendMode {
|
||||
|
||||
/// PROMETEU Graphics Subsystem (GFX).
|
||||
///
|
||||
/// Models a specialized graphics chip with a fixed resolution, double buffering,
|
||||
/// and a multi-layered tile/sprite architecture.
|
||||
///
|
||||
/// The GFX system works by composing several "layers" into a single 16-bit
|
||||
/// RGB565 framebuffer. It supports hardware-accelerated primitives (lines, rects)
|
||||
/// and specialized console features like background scrolling and sprite sorting.
|
||||
///
|
||||
/// ### Layer Composition Order (back to front):
|
||||
/// 1. **Priority 0 Sprites**: Objects behind everything else.
|
||||
/// 2. **Tile Layer 0 + Priority 1 Sprites**: Background 0.
|
||||
/// 3. **Tile Layer 1 + Priority 2 Sprites**: Background 1.
|
||||
/// 4. **Tile Layer 2 + Priority 3 Sprites**: Background 2.
|
||||
/// 5. **Tile Layer 3 + Priority 4 Sprites**: Foreground.
|
||||
/// 6. **Scene Fade**: Global brightness/color filter.
|
||||
/// 7. **HUD Layer**: Fixed UI elements (always on top).
|
||||
/// 8. **HUD Fade**: Independent fade for the UI.
|
||||
/// `Gfx` owns the framebuffer backend and the canonical game-frame raster path
|
||||
/// consumed by `FrameComposer`. That canonical path covers scene composition,
|
||||
/// sprite composition, and fades. Public `gfx.*` primitives remain valid, but
|
||||
/// they do not define the canonical game composition contract; they belong to a
|
||||
/// separate final overlay/debug stage.
|
||||
pub struct Gfx {
|
||||
/// Width of the internal framebuffer in pixels.
|
||||
w: usize,
|
||||
@@ -54,7 +43,8 @@ pub struct Gfx {
|
||||
h: usize,
|
||||
/// Front buffer: the "VRAM" currently being displayed by the Host window.
|
||||
front: Vec<u16>,
|
||||
/// Back buffer: the "Work RAM" where new frames are composed.
|
||||
/// Back buffer: the working buffer where canonical game frames are composed
|
||||
/// before any final overlay/debug drain.
|
||||
back: Vec<u16>,
|
||||
|
||||
/// Shared access to graphical memory banks (tiles and palettes).
|
||||
|
||||
Reference in New Issue
Block a user