summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-06-06 12:39:51 +0200
committerBad Diode <bd@badd10de.dev>2021-06-06 12:39:51 +0200
commitb6d5c2a326e39063977dd546690a74e8cce24143 (patch)
treedb98439383e4260a535a661bd86daa037f8dd3d7
parent6f3f65fd5dc7b6bfa13fbdb841548aaaee90b228 (diff)
downloadgba-sequencer-b6d5c2a326e39063977dd546690a74e8cce24143.tar.gz
gba-sequencer-b6d5c2a326e39063977dd546690a74e8cce24143.zip
Fix a bug in vertical line drawing
-rw-r--r--src/renderer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/renderer.c b/src/renderer.c
index 2cc5758..3072105 100644
--- a/src/renderer.c
+++ b/src/renderer.c
@@ -112,6 +112,7 @@ draw_line(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr) {
112 for (size_t i = 0; i < (8 - start_row0); i++, backbuffer++) { 112 for (size_t i = 0; i < (8 - start_row0); i++, backbuffer++) {
113 backbuffer[0] = (backbuffer[0] & ~row_mask) | row_left; 113 backbuffer[0] = (backbuffer[0] & ~row_mask) | row_left;
114 } 114 }
115 dirty_tiles[tile_y0] |= 1 << tile_x0;
115 backbuffer += 8 * 31; 116 backbuffer += 8 * 31;
116 for (size_t j = 1; j < dy; j++) { 117 for (size_t j = 1; j < dy; j++) {
117 for (size_t i = 0; i < 8; i++, backbuffer++) { 118 for (size_t i = 0; i < 8; i++, backbuffer++) {
@@ -123,6 +124,7 @@ draw_line(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr) {
123 for (size_t i = 0; i <= start_row1; i++, backbuffer++) { 124 for (size_t i = 0; i <= start_row1; i++, backbuffer++) {
124 backbuffer[0] = (backbuffer[0] & ~row_mask) | row_left; 125 backbuffer[0] = (backbuffer[0] & ~row_mask) | row_left;
125 } 126 }
127 dirty_tiles[tile_y1] |= 1 << tile_x0;
126 } 128 }
127 } else { 129 } else {
128 // Diagonal line. 130 // Diagonal line.