Move surface contracts to model

This commit is contained in:
gamer147
2026-08-03 10:53:22 -04:00
parent bf670cf1e0
commit fdf2afdadc
4 changed files with 24 additions and 15 deletions

View File

@@ -175,6 +175,8 @@ retained graphics without making `Model` depend on `Hosting`.
`engine/Age.Engine/Model/RgbaImage.cs` owns the format-independent packed RGBA image transported between SYS4 `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 decoders, host surfaces, renderers, persistence, and tests; consumers do not depend on `Sys4` merely to exchange
decoded pixels. decoded pixels.
`engine/Age.Engine/Model/SurfaceContracts.cs` owns neutral surface fill/copy requests and the black-fade direction
shared by VM presentation, graphics hosts, Godot, and tests.
`engine/Age.Engine/Model/GfxState.cs` retains cross-domain retained-graphics coordination. `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, `engine/Age.Engine/Model/GfxState.Contracts.cs` owns its public render, transition, diagnostic, persistence,

View File

@@ -793,6 +793,11 @@ do not mix mechanical moves with semantic changes.
direction remain in their prior locations pending a separate transport cleanup. Runtime validation remains direction remain in their prior locations pending a separate transport cleanup. Runtime validation remains
green. green.
The seventh bounded contract slice moved the unchanged `SurfaceRectFill`, `SurfaceRectCopy`, and
`SurfaceBlackFadeDirection` declarations from `Hosting` into `Model/SurfaceContracts.cs`. Every consumer already
imported `Model`, so no call sites changed; surface request shape, enum values, and graphics behavior remain
unchanged. Runtime validation remains green.
4. **Make the build graph express source ownership.** Stop linking production `.cs` files from `godot/` and 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 `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 code into a small production project referenced by Godot, tests, and the corpus gate. Retain both existing
@@ -1154,7 +1159,8 @@ layer's rendering diverges from ADV; save layout.
Continue step 3 of the **codebase consolidation** maintenance slice: clarify runtime contracts without changing 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 behavior or the aggregate host accepted by the VM. With diagnostic, lifecycle, audio, and movie contracts
established beneath `IHost`, shared movie/image transport neutral, and the graphics contract now separated, move established beneath `IHost`, shared movie/image transport neutral, and the graphics contract now separated, move
the unchanged `SurfaceRectFill`, `SurfaceRectCopy`, and `SurfaceBlackFadeDirection` contracts from `Hosting` to the input host contract next: modal text entry, ADV waits and callback servicing, input clock, cursor resources,
`Model` next. Preserve all consumers and graphics behavior before separating the remaining ADV/input domains. and skip-state interaction. Preserve the existing overload/default chains and aggregate `IHost` entry point before
separating the remaining ADV text/presentation contract.
Concrete playthrough blockers may still preempt this bounded maintenance work; the consolidation effort does 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. not replace Phase B gameplay validation or the open cross-platform gates.

View File

@@ -20,13 +20,6 @@ public readonly record struct AdvWaitIndicatorConfig(
public readonly record struct AdvAutoWaitState( public readonly record struct AdvAutoWaitState(
bool Enabled, bool VoicePending, long PostVoiceDelayMs, long UnvoicedDelayMs); bool Enabled, bool VoicePending, long PostVoiceDelayMs, long UnvoicedDelayMs);
public readonly record struct SurfaceRectFill(
int SurfaceSlot, int X, int Y, int Width, int Height, int Alpha, long Rgb);
public readonly record struct SurfaceRectCopy(
int SourceSurface, int DestinationSurface, int SourceX, int SourceY,
int Width, int Height, int DestinationX, int DestinationY);
/// <summary>A synchronous AGE-owned diagnostic prompt after native body/context formatting.</summary> /// <summary>A synchronous AGE-owned diagnostic prompt after native body/context formatting.</summary>
public readonly record struct DiagnosticMessage(string Caption, string Text); public readonly record struct DiagnosticMessage(string Caption, string Text);
@@ -34,12 +27,6 @@ public readonly record struct DiagnosticMessage(string Caption, string Text);
public readonly record struct FullwidthTextEditRequest(string CurrentText, string InitialText); public readonly record struct FullwidthTextEditRequest(string CurrentText, string InitialText);
public readonly record struct FullwidthTextEditResult(bool Accepted, string Text); public readonly record struct FullwidthTextEditResult(bool Accepted, string Text);
public enum SurfaceBlackFadeDirection
{
FromBlack,
ToBlack,
}
public interface IHost : IDiagnosticHost, ILifecycleHost, IAudioHost, IMovieHost, IGraphicsHost public interface IHost : IDiagnosticHost, ILifecycleHost, IAudioHost, IMovieHost, IGraphicsHost
{ {
/// <summary>Present AGERc's modal full-width editor. Cancel preserves CurrentText.</summary> /// <summary>Present AGERc's modal full-width editor. Cancel preserves CurrentText.</summary>

View File

@@ -0,0 +1,14 @@
namespace Age.Engine.Model;
public readonly record struct SurfaceRectFill(
int SurfaceSlot, int X, int Y, int Width, int Height, int Alpha, long Rgb);
public readonly record struct SurfaceRectCopy(
int SourceSurface, int DestinationSurface, int SourceX, int SourceY,
int Width, int Height, int DestinationX, int DestinationY);
public enum SurfaceBlackFadeDirection
{
FromBlack,
ToBlack,
}