From 022f9e6af1570f071eaf85cf65d50cb29ddc34f2 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 28 Jun 2020 19:56:06 -0400 Subject: [PATCH] Reformat gfx/trade/game_boy.png and fix tools/gfx --preserve --- Makefile | 2 ++ engine/movie/trade_animation.asm | 2 +- gfx/trade/game_boy.png | Bin 360 -> 214 bytes gfx/trade/link_cable.png | Bin 0 -> 216 bytes tools/gfx.c | 8 ++++---- 5 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 gfx/trade/link_cable.png diff --git a/Makefile b/Makefile index d130725a8..bc9299f73 100644 --- a/Makefile +++ b/Makefile @@ -186,6 +186,8 @@ gfx/title/old_fg.2bpp: tools/gfx += --interleave --png=$< gfx/title/logo.2bpp: rgbgfx += -x 4 gfx/trade/ball.2bpp: tools/gfx += --remove-whitespace +gfx/trade/game_boy.2bpp: tools/gfx += --remove-duplicates --preserve=0x23,0x27 +gfx/trade/game_boy_cable.2bpp: gfx/trade/game_boy.2bpp gfx/trade/link_cable.2bpp ; cat $^ > $@ gfx/slots/slots_1.2bpp: tools/gfx += --trim-whitespace gfx/slots/slots_2.2bpp: tools/gfx += --interleave --png=$< diff --git a/engine/movie/trade_animation.asm b/engine/movie/trade_animation.asm index 5b885249c..4295ce282 100644 --- a/engine/movie/trade_animation.asm +++ b/engine/movie/trade_animation.asm @@ -1460,6 +1460,6 @@ TradeArrowRightGFX: INCBIN "gfx/trade/arrow_right.2bpp" TradeArrowLeftGFX: INCBIN "gfx/trade/arrow_left.2bpp" TradeCableGFX: INCBIN "gfx/trade/cable.2bpp" TradeBubbleGFX: INCBIN "gfx/trade/bubble.2bpp" -TradeGameBoyLZ: INCBIN "gfx/trade/game_boy.2bpp.lz" +TradeGameBoyLZ: INCBIN "gfx/trade/game_boy_cable.2bpp.lz" TradeBallGFX: INCBIN "gfx/trade/ball.2bpp" TradePoofGFX: INCBIN "gfx/trade/poof.2bpp" diff --git a/gfx/trade/game_boy.png b/gfx/trade/game_boy.png index 64c92260c3b2310c8963c966d833a821dfe3063e..3fcf9c224433270068de7572fe895dd3bee9c65c 100644 GIT binary patch literal 214 zcmV;{04e{8P)B#p2RuzH^?rJRmV~IL z?a`w&jxIgdk37*9l8re*QkuMtN;n~(h~!mf<#g$mQEjZhmi#eVGvmvc?bqd(pRHv& Qxc~qF07*qoM6N<$fJhw_g=aQiA<(PTg}Xv`5*TMD{i_ISN}K$WFW+RE z!3b&W6H2o__;eLxya0}wvtQ8*@^`$Saa5-blR9nUBL-gvW#Yexa@=2`Wr~X)g6HP{ zhL#@VCv-;)D~b*tjf`^>%ulcfBc~narrEHOwFV1{gGkjT$YUt>JG3~PxE!H`)*I4M z(1{hNDf`1}4vN!^JO)iKEa@j!lvOPV&W?#Ng{5q~B2Qud#msU?F{-j^W31Zl4nzfC z=ztxa+U{2NWO)V8yE0Uv^iKRvM7D3vsQQ8r63^laTFLTI54C>Lr;iw4hnwd*M#1FX ziJpe*b4_IU20RWx4H)WBrxp~UZZL75)JE;h3a$hx;XVPTAcrD@nFy``0000J>jHEH~xp>GPX==A12ZJGaXIRMpWwSq=YQ zwzZ3n+?JmFHbd-=X~fh*qmXquKiU&(>VrPqxY+YL)xR`AYqQYF7{ z958q9Vc{7v37q}+c#Aal#6L0Fv17yLoHx-&dUzIj9nkV=Johmp+U3;(^U#LkeVp~- QY9J?jy85}Sb4q9e00>f8#sB~S literal 0 HcmV?d00001 diff --git a/tools/gfx.c b/tools/gfx.c index 6dad2f1a8..7d6dd0ee8 100644 --- a/tools/gfx.c +++ b/tools/gfx.c @@ -68,7 +68,7 @@ void get_args(int argc, char *argv[]) { while (token) { Options.num_preserved++; Options.preserved = realloc(Options.preserved, Options.num_preserved * sizeof(int)); - Options.preserved[Options.num_preserved-1] = strtoul(optarg, NULL, 0); + Options.preserved[Options.num_preserved-1] = strtoul(token, NULL, 0); token = strtok(NULL, ","); } break; @@ -139,7 +139,7 @@ void remove_whitespace(struct Graphic *graphic) { int i = 0; for (int j = 0, d = 0; i < graphic->size && j < graphic->size; i += tile_size, j += tile_size) { while (j < graphic->size && is_whitespace(&graphic->data[j], tile_size) && !is_preserved(j / tile_size - d)) { - shift_preserved(j / tile_size); + shift_preserved(j / tile_size - d); d++; j += tile_size; } @@ -181,7 +181,7 @@ void remove_duplicates(struct Graphic *graphic) { if ((Options.keep_whitespace && is_whitespace(&graphic->data[j], tile_size)) || is_preserved(j / tile_size - d)) { break; } - shift_preserved(j / tile_size); + shift_preserved(j / tile_size - d); d++; j += tile_size; } @@ -235,7 +235,7 @@ void remove_flip(struct Graphic *graphic, bool xflip, bool yflip) { if ((Options.keep_whitespace && is_whitespace(&graphic->data[j], tile_size)) || is_preserved(j / tile_size - d)) { break; } - shift_preserved(j / tile_size); + shift_preserved(j / tile_size - d); d++; j += tile_size; }