From fdf2afdadc052a6e445328a2648f4f3c75e85cca Mon Sep 17 00:00:00 2001 From: gamer147 Date: Mon, 3 Aug 2026 10:53:22 -0400 Subject: [PATCH] Move surface contracts to model --- docs/PROJECT-STRUCTURE.md | 2 ++ docs/remake-architecture-and-roadmap.md | 10 ++++++++-- engine/Age.Engine/Hosting/IHost.cs | 13 ------------- engine/Age.Engine/Model/SurfaceContracts.cs | 14 ++++++++++++++ 4 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 engine/Age.Engine/Model/SurfaceContracts.cs diff --git a/docs/PROJECT-STRUCTURE.md b/docs/PROJECT-STRUCTURE.md index cb91103..443bc4c 100644 --- a/docs/PROJECT-STRUCTURE.md +++ b/docs/PROJECT-STRUCTURE.md @@ -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 decoders, host surfaces, renderers, persistence, and tests; consumers do not depend on `Sys4` merely to exchange 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.Contracts.cs` owns its public render, transition, diagnostic, persistence, diff --git a/docs/remake-architecture-and-roadmap.md b/docs/remake-architecture-and-roadmap.md index f041321..e55b3c5 100644 --- a/docs/remake-architecture-and-roadmap.md +++ b/docs/remake-architecture-and-roadmap.md @@ -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 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 `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 @@ -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 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 -the unchanged `SurfaceRectFill`, `SurfaceRectCopy`, and `SurfaceBlackFadeDirection` contracts from `Hosting` to -`Model` next. Preserve all consumers and graphics behavior before separating the remaining ADV/input domains. +the input host contract next: modal text entry, ADV waits and callback servicing, input clock, cursor resources, +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 not replace Phase B gameplay validation or the open cross-platform gates. diff --git a/engine/Age.Engine/Hosting/IHost.cs b/engine/Age.Engine/Hosting/IHost.cs index 5ebee13..b9b1822 100644 --- a/engine/Age.Engine/Hosting/IHost.cs +++ b/engine/Age.Engine/Hosting/IHost.cs @@ -20,13 +20,6 @@ public readonly record struct AdvWaitIndicatorConfig( public readonly record struct AdvAutoWaitState( 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); - /// A synchronous AGE-owned diagnostic prompt after native body/context formatting. 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 FullwidthTextEditResult(bool Accepted, string Text); -public enum SurfaceBlackFadeDirection -{ - FromBlack, - ToBlack, -} - public interface IHost : IDiagnosticHost, ILifecycleHost, IAudioHost, IMovieHost, IGraphicsHost { /// Present AGERc's modal full-width editor. Cancel preserves CurrentText. diff --git a/engine/Age.Engine/Model/SurfaceContracts.cs b/engine/Age.Engine/Model/SurfaceContracts.cs new file mode 100644 index 0000000..ead3809 --- /dev/null +++ b/engine/Age.Engine/Model/SurfaceContracts.cs @@ -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, +}