From b5223ab09bd7180e0cdc68f417218516ef3a9baa Mon Sep 17 00:00:00 2001 From: Cameron Reikes Date: Wed, 16 Nov 2022 21:24:14 -0800 Subject: [PATCH] Separate image for solar panel while charging --- loaded/solarpanel_charging.png | Bin 0 -> 381 bytes main.c | 24 ++++++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 loaded/solarpanel_charging.png diff --git a/loaded/solarpanel_charging.png b/loaded/solarpanel_charging.png new file mode 100644 index 0000000000000000000000000000000000000000..d2986b5f049413d4a39c1c6393860b8d0df3e78d GIT binary patch literal 381 zcmV-@0fPRCP)Px$H%UZ6R5*>LlQB!fP!xr~SR@1lU0Uo=&@NJ!Kq(HLij!cMK%w1(|Di&M4h4UN zbZ?-LMZrm&GDs+7X*U%*2)c+=LIimZlGh|O!Rndrd*mMO`Enm*$e(tFKkbUFZ!*=; z3ZkJEG7XgI!Blmzd+@=ru?N7d{ghhQbd7nCXXDS~0cZWArGcsHViB0FQ64-1#pn&6TjZSplayer_who_is_inside_of_me) != NULL) img = image_medbay_used; } + if (b->box_type == BoxSolarPanel) + { + sgp_set_image(0, image_solarpanel_charging); + sgp_set_color(1.0f, 1.0f, 1.0f, b->sun_amount); + draw_texture_centered(entity_pos(b), BOX_SIZE); + sgp_reset_image(0); + sgp_set_color(1.0f, 1.0f, 1.0f, 1.0f - b->sun_amount); + /* Color to_set = colhexcode(0xeb9834); + to_set.a = b->sun_amount * 0.5f; + set_color(to_set); + draw_color_rect_centered(entity_pos(b), BOX_SIZE); + */ + } + sgp_set_image(0, img); if (b->indestructible) { @@ -1558,14 +1574,6 @@ static void frame(void) draw_texture_centered(entity_pos(b), BOX_SIZE); sgp_reset_image(0); - if (b->box_type == BoxSolarPanel) - { - Color to_set = colhexcode(0xeb9834); - to_set.a = b->sun_amount * 0.5f; - set_color(to_set); - draw_color_rect_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); }