|
group2 0.1.0
CSE 125 Group 2
|
Procedural vector icons for the VOIDFALL HUD. More...
#include "HudTypes.hpp"Go to the source code of this file.
Namespaces | |
| namespace | voidfall |
| namespace | voidfall::icons |
Functions | |
| void | voidfall::icons::filledPolygon (HudContext &ctx, const float *points, int n, HudColor color) |
| Fill a closed polygon with n points using a triangle fan from the first vertex. | |
| void | voidfall::icons::strokedPolygon (HudContext &ctx, const float *points, int n, float thickness, HudColor color) |
| Stroke a closed polygon (connects last point back to first). | |
| void | voidfall::icons::filledCircle (HudContext &ctx, float cx, float cy, float r, int sides, HudColor color) |
| Fill a regular polygon approximating a circle. | |
| void | voidfall::icons::strokedCircle (HudContext &ctx, float cx, float cy, float r, float thickness, int sides, HudColor color) |
| Stroke a circle as a sides-segment ring. | |
| void | voidfall::icons::hp (HudContext &ctx, float x, float y, float size, HudColor color) |
| Medical-cross HP glyph (filled). | |
| void | voidfall::icons::shield (HudContext &ctx, float x, float y, float size, HudColor color) |
| Shield silhouette: top-flat pentagon with curved bottom (stroked). | |
| void | voidfall::icons::skull (HudContext &ctx, float x, float y, float size, HudColor color) |
| Skull silhouette (filled). | |
| void | voidfall::icons::headshot (HudContext &ctx, float x, float y, float size, HudColor color) |
| Headshot reticle: circle + center pip + line below. | |
| void | voidfall::icons::gravityArrow (HudContext &ctx, float x, float y, float size, int direction, HudColor color) |
| Gravity arrow inside a small dial. direction is 0=down, 1=left, 2=up, 3=right. | |
| void | voidfall::icons::fall (HudContext &ctx, float x, float y, float size, HudColor color) |
| Upward filled triangle (used for "FALL" weapon kill icon). | |
| void | voidfall::icons::grenade (HudContext &ctx, float x, float y, float size, HudColor color) |
| Grenade: round body + collar + lever (filled silhouette). | |
| void | voidfall::icons::grapple (HudContext &ctx, float x, float y, float size, HudColor color) |
| Grapple hook: hook shape + diagonal rope (stroked). | |
| void | voidfall::icons::tactical (HudContext &ctx, float x, float y, float size, HudColor color) |
| Tactical: dotted ring + center pip (stroked). | |
| void | voidfall::icons::playerArrow (HudContext &ctx, float cx, float cy, float size, HudColor color) |
| Player arrow chevron used on the minimap (filled, with notch). | |
| void | voidfall::icons::enemyDiamond (HudContext &ctx, float cx, float cy, float size, HudColor color) |
| Diamond marker for enemy positions on the minimap. | |
Procedural vector icons for the VOIDFALL HUD.
Every icon takes (ctx, x, y, size, color) and renders into a size × size box anchored at top-left. The geometry is emitted as triangles + polylines through the existing HudContext primitives, so icons are crisp at any DPR and don't depend on texture filtering, mip chains, or atlas packing.
The previous implementation built every icon ad-hoc inside its host widget using rotated rectangles, which produced the chunky / mis-aligned shield and grapple seen in early playtesting. Centralising the geometry here:
The function signatures intentionally match the shape of an SVG-atlas lookup: draw(ctx, x, y, size, color). When an SVG raster pipeline (nanosvg + GPU atlas) is added, each function body can be swapped to a single ctx.icon(HudIcon::X, x, y, size, color) without touching any caller — the procedural path becomes a fallback for missing SVGs.