From b0147a60d4cd354288160df99496a45fc8f597d7 Mon Sep 17 00:00:00 2001 From: Matthew Laux Date: Wed, 3 Aug 2022 02:20:38 -0500 Subject: [PATCH] color 0 as transparent --- src/dmg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dmg.c b/src/dmg.c index 823746b..977cbf0 100644 --- a/src/dmg.c +++ b/src/dmg.c @@ -228,8 +228,11 @@ static void render_objs(struct dmg *dmg) if (oam->attrs & OAM_ATTR_MIRROR_X) { use_index = 7 - i; } - dmg->lcd->pixels[off] = ((data1 & (1 << use_index)) ? 1 : 0) << 1; - dmg->lcd->pixels[off] |= (data2 & (1 << use_index)) ? 1 : 0; + int color = ((data1 & (1 << use_index)) ? 1 : 0) << 1 + | ((data2 & (1 << use_index)) ? 1 : 0); + if (color) { + dmg->lcd->pixels[off] = color; + } off++; } off += 152;