Repository navigation
Conversation
…ority order, descfuncs 1 to 28, stat groups, damage pairs, the undead and Indestructible lines
…order and colours, names per quality, set cards, the numbers from base stats plus the percent and per-level ops, requirements, attack speed
… current durability; the save inspector now shows the durability line, with the max-durability percent and without it on throwing weapons
… second mindam/maxdam is empty, the smite damage is in the first); gem slot lines drop their trailing newline as the engine's affix descriptions do
…colour map, sockets and ethereal look, the hover tooltip box in Font16, and the two together as on hover; C ABI, a CLI, and goldens over real items
…m imports d2-item as a module so both shims link into one wasm; personalised names follow the engine's possessive; the item-draw CLI writes each item's records
…he d2itemdraw C ABI, checked against fixtures the Zig side writes through the same ABI; CI builds and embeds the native
…worn in gold, from Sets.txt, as SKILLDESC_AppendSetBonusTextByStateValue reads them
…ox, lines as positioned glyph cells, icon and socket frame references) and a rasterizer that paints it through glyph and sprite providers; the 1.14d DC6 providers keep every picture byte-identical
…t 1024 bytes, and rasterizing through C callback providers that fall back to the 1.14d art
…res, a lazy module the Zig tests import; the kit character is built from its spec in the test instead of committed, and the copies in itemdraw and the Go package are gone
… remapped blits, baseline blits and compositing; itemdraw's image module and its raster compositing, and render's object compositing, now draw through it with byte-identical output
…d the drawer d2-formats' font table, which now keeps the header height and the Latin glyph lookup
… on every side) and gets the colour's nominal RGB, for vector text with outlines
…the C headers, each header checked against its package's exports and ABI number, with a smoke test per language; zig build bindings / check-bindings; the Go packages now sit on the generated API, and net and util are reachable from Go
… generated layer: drlg on the generated declarations, a safe itemdraw module with layouts and provider traits over the callback struct, all of sys public; util joins the combined wasm and native
…youts, alt text and glyph/sprite providers through function pointers; LibD2.Tests runs the generated smoke test and the shared fixtures, in CI too
…y's ABI is checked on load; item and itemdraw ship as a second module, items.wasm, loaded only by ItemDrawer; ItemDrawer with text, alt text, images, layouts and the default raster, and rasterizeLayout drawing a display list through JavaScript providers; util joins the map module
…tools/sprite drops its own copies (compose and nearest render byte-identical)
…written by zig build fixtures (CI runs it before the language tests) instead of committed, and the layout goldens move to testdata/itemdraw/layouts
…poses the raw layer; docs: layout and raster, providers, the bindings per language, bindgen and the shared test data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draws an item exactly as Diablo II 1.14d does: the inventory icon, the hover tooltip, and the card that combines them.
Text (
d2-item)statdesc.zig: the stat lines (descfuncs 1-28, stat groups, damage pairs, and the unstable descpriority sort).itemdesc.zig: the full card asLoadItemDesc(0x48dd90) builds it, with names per quality, set cards and requirements.Pictures (new
packages/itemdraw), in two stagesOne canvas:
d2-formats' canvas now has straight-alpha put, fill, scaled remapped blits, baseline blits and compositing; itemdraw and render's object sprites draw through it (byte-identical).Bindings, generated from the C headers (
tools/bindgen, Zig)capi.zig(exports, parameter counts, ABI number), then writes the raw layer for Rust (sys), Go (zz_abi.go, purego), .NET (Native.g.cs) and TypeScript (abi.ts), each with a smoke test.zig build bindings/zig build check-bindings(in CI).ItemDrawer+rasterizeLayout(providers in JS).items.wasm(item, itemdraw) apart from the map module so map users do not download the item tables.One graphics module:
d2-formats' canvas holds the RGBA canvas, palette blits with colour map and alpha, fill, composite, index-space draw and nearest scaling; MMPX and PNG stay ind2-util(domain-free; formats is zero-dep). itemdraw, render's object sprites andtools/spriteuse it, their copies are gone, output byte-identical.Test data: one top-level
testdata/(two engine saves, two kits, the goldens, layout goldens) that every package and language reads. Generated, not committed: the kit character's save (composed in the test) and the binding fixtures (zig build fixtures, run by CI before the language tests).Generated files carry a "do not edit" header and are
linguist-generatedin.gitattributes.Size (lines vs main; the charkit commits come from local main, not yet on origin/main)
"After" hand-written includes bindgen (1.2k), the binding wrappers (2.5k, net of the 584 hand ABI lines the generator replaced), itemdraw (2.5k) and the item text (2.5k).
Tests
Design and the 1.14d functions each part follows:
docs/item-draw.md; bindings:docs/BUILDING.md.Before merge
docs/item-draw.md.