sprite: Added overlay sprite def
authorLukas Krickl <lukas@krickl.dev>
Sun, 4 Jan 2026 15:20:42 +0000 (16:20 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sun, 4 Jan 2026 15:20:42 +0000 (16:20 +0100)
src/defs.s
src/macros.inc
src/sprites.s

index 3b0875c573abd24bfaf6b68ce6afa474f892a89d..4c9cdd8e5c854bbb34e591e020ee69bde1131f52 100644 (file)
 .de dv_right, 2
 .de dv_size, 0
 
+
+#define OS_WIDTH 4
+#define OS_HEIGHT 4
+
+       ; overlay sprite struct
+.se 0
+       ; amount of sprite slots this overlay needs
+.de os_slots, 1
+.de os_y, 1
+.de os_x, 1
+       ; all overlays are 4x4 tile ids
+       ; ids of 0 are skipped and not rendered
+       ; the coordinates are fixed
+.de os_data, (OS_WIDTH * OS_HEIGHT)
+.de os_size, 0
index ed4979bfea01fe0a77ecd059f6eb383c00b5b01f..5bec09218a061311d7b1fc18a9eca3e37d5e4254 100644 (file)
@@ -240,3 +240,13 @@ $1:
        .db $1, $2, $3, $4, $5
        dw $6
 #endmacro
+
+       ; defines an overlay sprite
+       ; inputs:
+       ;               $1: amount of slots
+       ;               $2: y position
+       ;               $3: x position
+       ; should be followed by include of tilemap (OS_W*OS_H)
+#macro osdef
+       .db $1, $2, $3
+#endmacro
index 057b2dc9ddfe4a23d146ffa222c6805195286570..e33b9bbbec711be0e0a7c3aca57e19fcc40e4a6a 100644 (file)
@@ -1,4 +1,5 @@
        ; this file contains rendering code for sprite overlays
        ; this can be e.g. weapons displayed in first person view
 
+osdef 6, 20, 20
 #include "sword.inc"