Skip to content

Conversation

@fank
Copy link
Member

@fank fank commented Feb 6, 2026

Summary

  • Replace dead CDN sprite URL (styles.ocap2.com) with self-hosted sprite files generated during the maptool pipeline
  • Embed 27 real Arma 3 map icons (extracted from ui_f_data.pbo) via go:embed, replacing placeholder geometric shapes
  • Disable vegetation layers (tree, bush, vegetation*) in all style variants to reduce clutter

Changes

  • internal/maptool/sprite.go — new file: loads embedded PNGs, packs into sprite sheet (1x + 2x), writes JSON manifest
  • internal/maptool/icons/*.png — 27 icons from Arma 3's Map/MapControl/ and Map/LocationTypes/
  • internal/maptool/styles.go — replace CDN URL with path-based sprite URL via SpritePrefix; disable vegetation in all variants; recategorize tree/bush as vegetation
  • internal/maptool/metadata.go — call WriteSpriteFiles() in generate_styles stage; compute SpritePrefix
  • internal/maptool/sprite_test.go — tests for sprite generation, file writing, and icon↔style cross-reference
  • go.mod — add golang.org/x/image for bilinear scaling

Test plan

  • go test ./internal/maptool/... passes
  • Load Altis in browser — icons render, no "Image could not be loaded" console warnings
  • Run pipeline for a new world — verify sprite files appear in styles/ directory

fank added 2 commits February 6, 2026 20:51
Replace dead CDN sprite URL (styles.ocap2.com) with self-hosted sprite
files generated during the maptool pipeline. Icons are extracted from
Arma 3's ui_f_data.pbo (Map/MapControl + Map/LocationTypes) and embedded
via go:embed.

- Add sprite.go with 27 embedded PNG icons and sprite sheet generator
- Generate sprite.json, sprite.png, sprite@2x.json, sprite@2x.png in
  styles/ directory during generate_styles pipeline stage
- Use absolute sprite URL path (e.g. images/maps/altis/styles/sprite)
  served by existing /images/maps/* route
- Disable vegetation layers (tree, bush, vegetation*) in all style
  variants to reduce visual clutter
- Add golang.org/x/image/draw dependency for bilinear icon scaling
Integrate self-hosted sprites with main's new style variants (topo,
topo-dark, color-relief), self-hosted glyphs, and GlyphsURL config.
Both sprite and glyph URLs are now self-hosted.
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/OCAP2/web/internal/maptool 14.34% (+0.47%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/OCAP2/web/internal/maptool/metadata.go 10.16% (-0.92%) 374 (+22) 38 (-1) 336 (+23) 👎
github.com/OCAP2/web/internal/maptool/sprite.go 28.34% (+28.34%) 247 (+247) 70 (+70) 177 (+177) 🌟
github.com/OCAP2/web/internal/maptool/styles.go 33.12% (ø) 921 305 616

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/OCAP2/web/internal/maptool/sprite_test.go
  • github.com/OCAP2/web/internal/maptool/styles_test.go

@fank fank merged commit 8505207 into main Feb 7, 2026
2 checks passed
@fank fank deleted the feat/self-host-sprites branch February 7, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant