From d40475fce7e639202931b2dea81cec1899fedefd Mon Sep 17 00:00:00 2001 From: JeffRuLz Date: Sun, 28 Nov 2021 03:02:57 +0000 Subject: [PATCH] Fix black square behind timer The black square behind the timer now has a one pixel border like the original game. --- src/gfx.h | 11 ++++++++++- src/main.c | 10 ++++++++-- src/pico8.c | 8 ++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/gfx.h b/src/gfx.h index 05f3a04..9ea3fc2 100644 --- a/src/gfx.h +++ b/src/gfx.h @@ -1,6 +1,6 @@ #ifndef GFX_H -#define GFX_SIZE 4512 +#define GFX_SIZE (4512+32) const unsigned char GFX_DATA[GFX_SIZE] = { 0x00, 0x00, 0x00, 0x00, @@ -1143,6 +1143,15 @@ const unsigned char GFX_DATA[GFX_SIZE] = { 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + //8x7 black tile for timer backdrop + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }; diff --git a/src/main.c b/src/main.c index 8de9393..d34d0de 100644 --- a/src/main.c +++ b/src/main.c @@ -1912,7 +1912,7 @@ void room_title_draw(Room_Title* this) } else if (this->delay < 0) { //rectfill - rectfill(1,1,5,1,0); + //rectfill(1,1,5,1,0); rectfill(3,7,10,2,0); if (room.x == 3 && room.y == 1) { @@ -1932,6 +1932,12 @@ void room_title_draw(Room_Title* this) } draw_time(4+4,4+4); + //black rectangle behind timer + spr(141, 12, 8, 0, PAL_SPROVER, 0, 0); + spr(141, 20, 8, 0, PAL_SPROVER, 0, 0); + spr(141, 28, 8, 0, PAL_SPROVER, 0, 0); + spr(141, 36, 8, 0, PAL_SPROVER, 0, 0); + spr(141, 37, 8, 0, PAL_SPROVER, 0, 0); } } @@ -2235,7 +2241,7 @@ void _draw() pal(0,0,0); //pal(0,5,PAL_BG); - pal(15,0,PAL_BG); + pal(15,0,PAL_BG | PAL_SPROVER); //-- credits if (is_title()) { diff --git a/src/pico8.c b/src/pico8.c index e9f6f99..9aa73d0 100644 --- a/src/pico8.c +++ b/src/pico8.c @@ -66,6 +66,9 @@ void pal(u8 c0, u8 c1, u8 p) if (p == 0 || p & PAL_TEXT) SPRITE_PALETTE[32 + i] = palette[i]; + + if (p == 0 || p & PAL_SPROVER) + SPRITE_PALETTE[48 + i] = palette[i]; } } else @@ -84,6 +87,9 @@ void pal(u8 c0, u8 c1, u8 p) if (p & PAL_TEXT) SPRITE_PALETTE[32 + c0] = palette[c1]; + + if (p & PAL_SPROVER) + SPRITE_PALETTE[48 + c0] = palette[c1]; } } @@ -154,6 +160,8 @@ void spr(u16 n, s16 x, s16 y, u8 layer, u8 palette, bool flip_x, bool flip_y) obj->attr2 |= ATTR2_PALETTE(1); else if (palette & PAL_TEXT) obj->attr2 |= ATTR2_PALETTE(2); + else if (palette & PAL_SPROVER) + obj->attr2 |= ATTR2_PALETTE(3); //flip if (flip_x)