From f48a609ac873b76ff2de94d13a165e0766effba8 Mon Sep 17 00:00:00 2001 From: Cameron Reikes Date: Thu, 17 Nov 2022 13:27:50 -0800 Subject: [PATCH] Add cosmetic scanner block --- loaded/scanner_base.png | Bin 0 -> 503 bytes loaded/scanner_head.png | Bin 0 -> 192 bytes main.c | 17 +++++++++++++++-- types.h | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 loaded/scanner_base.png create mode 100644 loaded/scanner_head.png diff --git a/loaded/scanner_base.png b/loaded/scanner_base.png new file mode 100644 index 0000000000000000000000000000000000000000..6100a9598a6b5f1d641ddfb5f560dac8fe546142 GIT binary patch literal 503 zcmVPx$u}MThR5*>LlfP;kK@i4&dsZSiI7n&1sWEbKzCw{eZ=oVbifbjdh@ZfPBMAOe zxpJ8l7YwQl#&#h{lNX4=l8jM=Kp2dKrBWa;80_0L+2u|-SD9*dcfOhVzS$A{HP@F) z`;HxxWy?p)_|rio%)#}g@@h?0C{|1onJ*jv!mAp;P^>7g)>OJ+&h@2wt)d17!>(9; zbL<$`m&$VNn8m!$V%|3u0O}iSbnaeK;6kyYwyJd#@7OWI^`+8$G&pRuGCMjwIRs!f z=?MU@)>Kw9U^eNAu+gG)en#p1jQ0I4%cFgMzImp7e@obC8L&1h$zKcC8~@JiKw&_+RW_8B#54F zgr@NA%MoA04*+bRUh@6zb0!7Hj?*1z3co(@0+=LM?G9J%PKtsa?|+Ta^`*)sf!dA_ zJ{mD)zO3pSYXrlt&>smf@i~BZ>+bkm_;vUF|0PT_rq49!Rpy-_(_x^X ib>x&s#8nLipbO{O<#0%;DnA9fg2B_(&t;ucLK6Tj9ZyvN literal 0 HcmV?d00001 diff --git a/main.c b/main.c index d7517a2..87da037 100644 --- a/main.c +++ b/main.c @@ -105,6 +105,7 @@ static sg_image image_squad_invite; static sg_image image_check; static sg_image image_no; static sg_image image_solarpanel_charging; +static sg_image image_scanner_head; static int cur_editing_boxtype = -1; static int cur_editing_rotation = 0; @@ -165,6 +166,11 @@ static struct BoxInfo .image_path = "loaded/explosive.png", .needs_tobe_unlocked = true, }, + { + .type = BoxScanner, + .image_path = "loaded/scanner_base.png", + .needs_tobe_unlocked = false, + }, }; #define ENTITIES_ITER(cur) \ for (Entity *cur = gs.entities; cur < gs.entities + gs.cur_next_entity; \ @@ -497,6 +503,7 @@ static void init(void) image_check = load_image("loaded/check.png"); image_no = load_image("loaded/no.png"); image_solarpanel_charging = load_image("loaded/solarpanel_charging.png"); + image_scanner_head = load_image("loaded/scanner_head.png"); } // socket initialization @@ -1616,10 +1623,16 @@ static void frame(void) sgp_set_color(0.2f, 0.2f, 0.2f, 1.0f); } pipeline_scope(goodpixel_pipeline) - { draw_texture_centered(entity_pos(b), BOX_SIZE); - } sgp_reset_image(0); + + if(b->box_type == BoxScanner) + { + sgp_set_image(0, image_scanner_head); + sgp_rotate_at((float)gs.time*3.0f, entity_pos(b).x, entity_pos(b).y); + pipeline_scope(goodpixel_pipeline) + draw_texture_centered(entity_pos(b), BOX_SIZE); + } sgp_set_color(0.5f, 0.1f, 0.1f, b->damage); draw_color_rect_centered(entity_pos(b), BOX_SIZE); diff --git a/types.h b/types.h index 80a5394..87e72b5 100644 --- a/types.h +++ b/types.h @@ -134,6 +134,7 @@ enum BoxType BoxMedbay, BoxSolarPanel, BoxExplosive, + BoxScanner, BoxLast, };