From fef2fd076ae1ffc3b5ae440e2ebf985b452dc75f Mon Sep 17 00:00:00 2001 From: Cameron Reikes Date: Tue, 13 Dec 2022 16:37:18 -0800 Subject: [PATCH] Fix flag hitbox and spice bar --- flight.rdbg | Bin 2393 -> 2425 bytes gamestate.c | 2 +- loaded/flag_available.png | Bin 342 -> 7819 bytes loaded/flag_ripped.png | Bin 254 -> 6289 bytes main.c | 5 ++--- 5 files changed, 3 insertions(+), 4 deletions(-) diff --git a/flight.rdbg b/flight.rdbg index bb1d2c568a8bd6070ec5337e2a3624caf7c252be..993985d75c14f22c166597b6646517f99c43755e 100644 GIT binary patch delta 249 zcmca9^iya;A*1Hxhm5L|^;y{&1A#2-$sbtkC$D8;XS4wF3?>V(u(PC9=w(bSRGaL; z!p&$773G46zFAWfQ(_!P0Y;GOLhmc9Vh28b254YS#B)BC8-6I*E1PRE@X0G zbOA}SIOV5QPQJ(JJ^2BnGkZp2L8@M|8(3FABL|}wNEd5hX=+jB#0Bva3k@fmv1T%g zZ(hJ!$0) TpcIJPH93Ht10*!rpOXs!*K17i delta 236 zcmew^BRC_mAXP6J%mFH3XLOk?$l}D7pHiupYy&jRV6r+hKcg1d*mq1EjGi!)Sb|GZ z3nuF^`7&yNB-wHkGxPM4Co3?TPyWxy3M3U7%~=ZcGQck4PDxEFO;0IGEC(yGnfO_k zF%aTFd-lT8)Y4SFjLBxKnT%qa7qHd=wKFgbody, (pos)); } -static const cpShapeFilter BOXES_FILTER = {CP_NO_GROUP, BOXES, CP_ALL_CATEGORIES}; +static const cpShapeFilter BOXES_FILTER = {CP_NO_GROUP, BOXES, BOXES}; static const cpShapeFilter NOT_BOXES_FILTER = {CP_NO_GROUP, CP_ALL_CATEGORIES & (~BOXES), CP_ALL_CATEGORIES}; #define PLAYER_SHAPE_FILTER cpShapeFilterNew(CP_NO_GROUP, PLAYERS, CP_ALL_CATEGORIES) diff --git a/loaded/flag_available.png b/loaded/flag_available.png index f193c39472a252e1b60258c47e9b5acd184f588b..000a5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*6rvdtL!w}Q&=+uc-01&HTQYs%7PCcn;E5pr(KDjiIpqe1 z&3?^(2J>bn6C6G>EhqqcHU$w70di*Igs^6Z*Z~0FAB5JAFAe)u&ifC|K*AGAP{jZw z2;$jD0+x$Mvan>Rpk`c*8HU5gf~;9uzoCl+TyZ2I1g-rc9wDxv2A$ywZt|s6rawm$ z830P^08xg-Liaby%n|4>$)Y7I#@B2u(Ep1Miy4I zd3~wFf71mV{@ckf@%x*u-*o*F1HYvFySskV^-B!=lJf8F`hTNK>HA>{24Na(0^ zWLN8H=$IwPaT1}sfwzW8hNm? zXALAOpxaoxuWw>=R!JL7>#6`R%(b#R^4ja08lcOM;*w--JbhAQ4PV}Px#xJg7oR9J;$^!U$U$N&XzCMushoqvac zfq{X+bfOA_Nd8?TnA{FVhVu+G2298tk^H;0*w_OGBxMc%OUfGl9|*gd2rHo1x6i%3yeAj7Z`O6E->mCTwv5O dxWJ%t3;<{!BvA92PwfBz002ovPDHLkV1o7jUw8lj diff --git a/main.c b/main.c index 32dc6ce..59dc6c7 100644 --- a/main.c +++ b/main.c @@ -1184,8 +1184,7 @@ static void ui(bool draw, double dt, double width, double height) } double size = 128.0; - bool hovering = - cpvdist(mouse_pos, flag_pos[i]) < size * 0.25 && this_squad_available; + bool hovering = box_has_point((BoxCentered){.pos = flag_pos[i], .rotation = flag_rot[i], .size = cpv(size*0.5, size)}, mouse_pos) && this_squad_available; if (!choosing_flags && hovering && build_pressed) { @@ -1391,7 +1390,7 @@ static void ui(bool draw, double dt, double width, double height) set_color_values(0.5, 0.5, 0.5, cur_opacity); double bar_width = itembar_width * 1.1; - double margin = (width - bar_width)/2.0; + double margin = (width - bar_width) / 2.0; double y = height - 150.0; draw_filled_rect(margin, y, bar_width, 30.0); set_color_values(1.0, 1.0, 1.0, cur_opacity);