engine-c: denser mid-fight fire/smoke/muzzle/impact for KKND2 combat read

This commit is contained in:
local-model/engine-L2-grok-4.5 2026-09-19 14:45:47 +02:00
parent 72b2c0dc0a
commit 01c7ab8b76
No known key found for this signature in database
5 changed files with 112 additions and 57 deletions

View file

@ -792,8 +792,8 @@ void snapshot_capture(Game *g, const char *path) {
float d = sqrtf(dx * dx + dy * dy);
if (d > 1.0f) {
float ux = dx / d, uy = dy / d;
int len = (p->kind == 2) ? 24 : (p->kind == 3) ? 18
: (p->kind == 1) ? 14 : 10;
int len = (p->kind == 2) ? 32 : (p->kind == 3) ? 24
: (p->kind == 1) ? 20 : 14;
for (int t = 1; t <= len; t++) {
int tx = sx - (int)(ux * (float)t * 0.75f);
int ty = sy - (int)(uy * (float)t * 0.75f);
@ -809,13 +809,13 @@ void snapshot_capture(Game *g, const char *path) {
}
}
}
int rad = (p->kind == 1 || p->kind == 3) ? 6 : 4;
int rad = (p->kind == 1 || p->kind == 3) ? 8 : 5;
disc(sx, sy, rad + 1, 255, 160, 40);
disc(sx, sy, rad, 255, 240, 140);
px(sx + 1, sy, 255, 255, 220);
if (p->kind == 3) {
disc(sx - 3, sy + 1, 3, 255, 70, 30);
disc(sx + 2, sy - 2, 2, 255, 200, 80);
disc(sx - 3, sy + 1, 4, 255, 70, 30);
disc(sx + 2, sy - 2, 3, 255, 200, 80);
} else if (p->kind == 2) {
disc(sx, sy, rad + 1, 120, 200, 255);
disc(sx, sy, rad - 1, 240, 220, 255);
@ -827,13 +827,19 @@ void snapshot_capture(Game *g, const char *path) {
Particle *p = &g->particles[i];
if (p->life <= 0) continue;
int sx = (int)(p->x - camx), sy = (int)(p->y - camy);
if (sx < -8 || sy < -8 || sx > g_sw + 8 || sy > g_sh + 8) continue;
if (sx < -12 || sy < -12 || sx > g_sw + 12 || sy > g_sh + 12) continue;
float a = p->life / (p->max_life > 0 ? p->max_life : 1.0f);
if (a < 0.12f) continue;
int sz = (p->kind == 1) ? 5 : (p->kind == 3) ? 3 : (p->kind == 0) ? 4 : 3;
if (a < 0.10f) continue;
int sz = (p->kind == 1) ? 9 : (p->kind == 3) ? 5 : (p->kind == 0) ? 7 : 4;
uint8_t r = (uint8_t)(p->r * a), gv = (uint8_t)(p->g * a), b = (uint8_t)(p->b * a);
if (p->kind == 0 || p->kind == 1) disc(sx, sy, sz + 1, r, gv, b);
else fill_rect(sx - sz/2, sy - sz/2, sz + 1, sz + 1, r, gv, b);
if (p->kind == 0 || p->kind == 1) {
disc(sx, sy, sz + 2, r / 2, gv / 2, b / 2);
disc(sx, sy, sz + 1, r, gv, b);
if (p->kind == 1 && a > 0.45f)
disc(sx, sy - 1, sz / 2 + 1, 255, (uint8_t)(220 * a), 80);
} else {
fill_rect(sx - sz/2, sy - sz/2, sz + 1, sz + 1, r, gv, b);
}
}
/* KKND2-like chrome: top resource bar + corner minimap + bottom command strip.
* Procedural bars (no font) so the shot still reads as classic RTS UI. */