fix(bridge): decode legacy animation art without GDI+ (#39, 1 of 2) #42
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/asset-bridge-gdiplus-anim"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes the legacy-animation half of #39 (PR 1 of 2).
The bug
On a Linux/Mono shard the Asset Bridge's legacy-MUL catalogue art fails with
[GDI+ status: NotImplemented]: the vendoredUltima.Framector builds a 16bppBitmap(Settings.PixelFormat) and libgdiplus cannot create one, so the ~787 legacyanim*.mulcreature thumbnails never render. The phase-4 UOP path already avoidsSystem.Drawing; this finishes the same migration for the legacy animation path, soWindows and Linux share one managed path instead of a Linux-specific workaround.
The fix (overlay-only — no wire change, no
PROTOCOL_VERSIONbump)Keep every byte-level vendored call (
Translate,BodyConverter,FileIndex, theResolveAnimation/CheckEntry/AnimationSanegate,Hues.List[i].Colors) and replaceonly the two calls that reach
System.Drawing:BridgeMul— a hand-writtenanim*.mulfirst-frame decoder to an ARGB1555ushort[], mirroringUltima.Frame's run loop withBridgeUop's bounds checks. NoBitmap, noSystem.Drawing.BridgeHue—Ultima.Hue.ApplyToreproduced over aushort[], reusing the vendoredHues.List[i].Colorstable so a body.def-hued creature (162Body.defentries carry ahue) tints identically.
BridgeAssetValidator—RecordReader.ReadRecordCopyhands the verdata-patchedrecord bytes to the decoder; a
ResolveAnimationoverload surfaces the body.def hue italready computed and used to discard.
BridgeCatalog— the legacy path decodes throughBridgeMul+BridgeHue→BridgePng; theImagingOkgate is removed fromassets.manifest/assets.fetch,because the body catalogue (legacy + UOP) no longer touches
System.Drawing.BridgeAnimParity— a[BridgeAnimParity]GM command /BRIDGE_ANIM_PARITY=1bootrun that compares the shipping managed decode against the vendored one pixel for pixel.
It is the only file that still references
System.Drawing, and only as the test oracle.The record gate is unchanged, so the exact set of records served is unchanged. The
art/land path (
BridgeArt) and its own imaging gate are PR 2 of 2;BridgeHueis theshared piece it will reuse.
Verification — both gates green
Windows (local ServUO + live client): the parity harness compared every legacy record
the Bridge serves against the vendored GDI+ decode:
Linux/Mono (Ubuntu 24.04.5, Mono 6.8, libgdiplus 6.1 — the live-host versions): ServUO
loaded the prebuilt
Scripts.dll, the world loaded (210k items / 43k mobiles), and thesame harness ran at boot:
i.e. the vendored path fails with the exact
NotImplementedthis issue reports, while themanaged path produces all 40,341 sprites — the same count that is pixel-identical on
Windows.
dotnet build Scripts.csproj -c Release→ 0 warnings / 0 errors.Docs companion (the §4.4 imaging note in
docs/) follows separately.🤖 Generated with Claude Code
https://claude.ai/code/session_014HJEmcaKvWQ8LsnXHKha5y