engine-c: denser Evolved heavies + harvester cargo bed

This commit is contained in:
local-model/engine-L2-grok-4.5 2026-09-19 13:27:48 +02:00
parent 88631a5be6
commit c3fd57f86c
No known key found for this signature in database
3 changed files with 49 additions and 12 deletions

View file

@ -208,22 +208,34 @@ static void draw_unit(Unit *u, int sx, int sy) {
tyre_mark(LX(8,23), LY(8,23), SI(3), ph, 0);
tyre_mark(LX(22,23), LY(22,23), SI(3), ph, 0);
break;
case UT_HARVESTER:
/* cabin nose + scrap bed ridges + wheels */
case UT_HARVESTER: {
/* cabin nose + cargo bed (empty dark → gold fill by u->cargo) + wheels */
fill_rect(sx-SI(14), sy-SI(9), SI(28), SI(18), ok, og, ob);
fill_rect(sx-SI(12), sy-SI(7), SI(24), SI(14), br, bg, bb);
fill_rect(LX(4,10)-SI(1), LY(4,10)-SI(2), SI(8), SI(8), lr, lg, lb); /* cabin */
fill_rect(LX(5,9)-SI(1), LY(5,9)-SI(1), SI(6), SI(3), 35, 55, 75); /* cabin glass */
fill_rect(sx-SI(4), sy-SI(5), SI(14), SI(10), 200, 170, 90); /* bed */
line(LX(14,10), LY(14,10), LX(26,10), LY(26,10), 160, 130, 70);
line(LX(14,13), LY(14,13), LX(26,13), LY(26,13), 160, 130, 70);
line(LX(14,16), LY(14,16), LX(26,16), LY(26,16), 160, 130, 70);
int bed_w = SI(14), bed_h = SI(10);
int bed_x = sx - SI(4), bed_y = sy - SI(5);
fill_rect(bed_x, bed_y, bed_w, bed_h, 55, 48, 32); /* empty bed */
float cap = (float)unit_def(u->type, u->faction)->cargo;
float fill = (cap > 0.0f) ? (u->cargo / cap) : 0.0f;
if (fill < 0.0f) fill = 0.0f;
if (fill > 1.0f) fill = 1.0f;
int fw = (int)(bed_w * fill + 0.5f);
if (fw > 0)
fill_rect(bed_x, bed_y, fw, bed_h, 200, 170, 90); /* cargo gold */
if (fill > 0.15f) {
line(LX(14,10), LY(14,10), LX(26,10), LY(26,10), 160, 130, 70);
line(LX(14,13), LY(14,13), LX(26,13), LY(26,13), 160, 130, 70);
line(LX(14,16), LY(14,16), LX(26,16), LY(26,16), 160, 130, 70);
}
disc(LX(8,23), LY(8,23), SI(4), mr, mg, mb);
disc(LX(22,23), LY(22,23), SI(4), mr, mg, mb);
tyre_mark(LX(8,23), LY(8,23), SI(4), ph, 1);
tyre_mark(LX(22,23), LY(22,23), SI(4), ph, 1);
line(LX(5,7), LY(5,7), LX(5,2), LY(5,2), lr, lg, lb);
break;
}
case UT_JEEP:
/* open cabin + roll bar + MG */
fill_rect(sx-SI(11), sy-SI(6), SI(22), SI(12), ok, og, ob);