Move RGBA image contract to model

This commit is contained in:
gamer147
2026-08-03 10:46:28 -04:00
parent cc69acd0ac
commit 06b152274d
24 changed files with 30 additions and 17 deletions

View File

@@ -169,6 +169,9 @@ simple hosts. `engine/Age.Engine/Hosting/IMovieHost.cs` owns ordinary, positione
and modal movie playback contracts. `IHost` inherits all four focused contracts; their required and default
behavior is unchanged. The neutral `engine/Age.Engine/Model/MovieMaskTransitionRequest.cs` record carries movie
mask work between the VM, host, and retained graphics without making `Model` depend on `Hosting`.
`engine/Age.Engine/Model/RgbaImage.cs` owns the format-independent packed RGBA image transported between SYS4
decoders, host surfaces, renderers, persistence, and tests; consumers do not depend on `Sys4` merely to exchange
decoded pixels.
`engine/Age.Engine/Model/GfxState.cs` retains cross-domain retained-graphics coordination.
`engine/Age.Engine/Model/GfxState.Contracts.cs` owns its public render, transition, diagnostic, persistence,

View File

@@ -781,6 +781,11 @@ do not mix mechanical moves with semantic changes.
removing the two now-unused imports eliminates `GfxState`'s reverse dependency on the host namespace. Runtime
validation remains green.
The fifth bounded contract slice moved the unchanged, format-independent `RgbaImage` record from the SYS4 AGF
decoder file into `Model`. Decoders, renderers, persistence, Godot, tests, and the aggregate host now consume
the neutral image contract; image-only format imports were removed while genuine SYS4 consumers retained
theirs. Decoder and image behavior remain unchanged, and runtime validation remains green.
4. **Make the build graph express source ownership.** Stop linking production `.cs` files from `godot/` and
`tools/movie-corpus-gate/` into `Age.Engine.Tests`. Extract the platform-neutral frontend/movie/diagnostic
code into a small production project referenced by Godot, tests, and the corpus gate. Retain both existing
@@ -1141,8 +1146,8 @@ layer's rendering diverges from ADV; save layout.
## 8. Immediate next step
Continue step 3 of the **codebase consolidation** maintenance slice: clarify runtime contracts without changing
behavior or the aggregate host accepted by the VM. With diagnostic, lifecycle, audio, and movie contracts
established beneath `IHost` and the movie-mask request now neutral, move the format-independent `RgbaImage` record
from `Sys4` to `Model` next. Update its consumers without changing the record or decoder behavior, removing the
aggregate host's image-only dependency on the format namespace before separating larger host domains.
established beneath `IHost` and shared movie/image transport now neutral, introduce the graphics host contract
next. Preserve its surface, retained-range presentation, transition, texture, capture/replace, and headless-default
behavior while leaving the remaining surface request records in place for a separate transport cleanup.
Concrete playthrough blockers may still preempt this bounded maintenance work; the consolidation effort does
not replace Phase B gameplay validation or the open cross-platform gates.

View File

@@ -1,4 +1,5 @@
using System.Buffers.Binary;
using Age.Engine.Model;
using Age.Engine.Sys4;
namespace Age.Engine.Tests;

View File

@@ -1,4 +1,5 @@
using System.Linq;
using Age.Engine.Model;
using Age.Engine.Sys4;
using Xunit;

View File

@@ -1,5 +1,4 @@
using Age.Engine.Model;
using Age.Engine.Sys4;
using Age.Engine.Text;
public class GlyphMaskCompositorTests

View File

@@ -1,3 +1,4 @@
using Age.Engine.Model;
using Age.Engine.Sys4;
public class MovieCorpusGateTests

View File

@@ -1,4 +1,4 @@
using Age.Engine.Sys4;
using Age.Engine.Model;
public class MovieSurfaceRegistryTests
{

View File

@@ -1,5 +1,4 @@
using Age.Engine.Model;
using Age.Engine.Sys4;
namespace Age.Engine.Hosting;

View File

@@ -0,0 +1,4 @@
namespace Age.Engine.Model;
/// <summary>A decoded, tightly packed, top-down RGBA8 image.</summary>
public sealed record RgbaImage(int Width, int Height, byte[] Pixels);

View File

@@ -1,5 +1,5 @@
using System.Buffers.Binary;
using Age.Engine.Sys4;
using Age.Engine.Model;
namespace Age.Engine.Persistence;

View File

@@ -1,10 +1,8 @@
using System.Buffers.Binary;
using Age.Engine.Model;
namespace Age.Engine.Sys4;
/// <summary>A decoded, tightly packed, top-down RGBA8 image.</summary>
public sealed record RgbaImage(int Width, int Height, byte[] Pixels);
/// <summary>
/// Platform-neutral Eushully AGF decoder. Format algorithm ported from GARbro's MIT-licensed
/// ArcFormats/Eushully/ImageAGF.cs (Copyright (C) 2015 morkt).

View File

@@ -1,4 +1,5 @@
using System.Buffers.Binary;
using Age.Engine.Model;
namespace Age.Engine.Sys4;

View File

@@ -1,3 +1,5 @@
using Age.Engine.Model;
namespace Age.Engine.Sys4;
/// <summary>

View File

@@ -1,3 +1,5 @@
using Age.Engine.Model;
namespace Age.Engine.Sys4;
/// <summary>Platform-neutral mutation helpers for AGE's software-modeled RGBA surfaces.</summary>

View File

@@ -1,5 +1,4 @@
using Age.Engine.Model;
using Age.Engine.Sys4;
namespace Age.Engine.Text;

View File

@@ -1,6 +1,5 @@
using System.Text;
using Age.Engine.Model;
using Age.Engine.Sys4;
namespace Age.Engine.Text;

View File

@@ -1,5 +1,4 @@
using Age.Engine.Model;
using Age.Engine.Sys4;
namespace Age.Engine.Text;

View File

@@ -3,6 +3,7 @@ using System.Diagnostics;
using System.IO;
using System.Collections.Generic;
using System.Threading;
using Age.Engine.Model;
using Age.Engine.Sys4;
internal interface IMoviePacingClock

View File

@@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using Age.Engine.Model;
using Age.Engine.Sys4;
using Microsoft.Win32.SafeHandles;

View File

@@ -4,7 +4,6 @@ using System.Linq;
using System.Threading;
using Age.Engine.Hosting;
using Age.Engine.Model;
using Age.Engine.Sys4;
using Age.Engine.Text;
public sealed partial class GodotAdvHost

View File

@@ -2,7 +2,6 @@ using System;
using System.Collections.Generic;
using Godot;
using Age.Engine.Model;
using Age.Engine.Sys4;
/// <summary>
/// Godot-native presentation of AGE's sampled retained objects. Static decoded/color-key variants are

View File

@@ -1,4 +1,5 @@
using System;
using Age.Engine.Model;
using Age.Engine.Sys4;
internal readonly record struct MovieAudioInfo(int SampleRate, int Channels);

View File

@@ -2,7 +2,6 @@ using System.Collections.Generic;
using System.Linq;
using Godot;
using Age.Engine.Model;
using Age.Engine.Sys4;
public partial class Main
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Age.Engine.Sys4;
using Age.Engine.Model;
internal readonly record struct MovieSurfaceBinding(long PlaybackId, long ResourceId, int SurfaceSlot);
internal sealed record MovieSurfaceFrame(RgbaImage Image, string Name, int AssetId);