Checkpoint

This commit is contained in:
maze authored and maze committed 2026-10-29 17:29:41 +01:00
1 parent b8a493b93d
commit 85a9ec684c
54 files changed
+6855 -526

No files matched your search

+12 -4
View File
@@ -2,10 +2,18 @@ package display
import (
"image/color"
"go.maze.io/harmon/hardware"
"image/draw"
)
func DrawSprite(display hardware.Display, x, y int, sprite []byte, c color.Color) error {
return nil
func DrawSprite(p draw.Image, x, y int, sprite []uint8, c color.Color) {
w, h, data := sprite[0], sprite[1], sprite[2:]
for dy := 0; dy < int(h); dy++ {
for dx := 0; dx < int(w); dx++ {
byteOffset := int(dy/8)*int(w) + dx
bitOffset := dy % 8
if data[byteOffset]&(1<<bitOffset) != 0 {
p.Set(x+dx, y+dy, c)
}
}
}
}