fangflecked

90s style ARPG
git clone git://moonbender.net/fangflecked
Log | Files | Refs | README

commit b1514eacfb67348343ad8760dc88ef6e1e91d54e
parent d909dacc5a9a8610829f6dd8fe3ffdb1d4dfc54d
Author: calliope <me@calliope.sh>
Date:   Thu,  2 Oct 2025 18:14:57 -0500

updated name of vecf struct to match upper camel case naming pattern

Diffstat:
Mfangflecked.c | 24++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/fangflecked.c b/fangflecked.c @@ -74,7 +74,7 @@ u8 level_tiles[LEVEL_MAX_WIDTH * LEVEL_MAX_HEIGHT]; typedef struct { float x, y; -} vecf; +} Vecf; /* * functions for drawing and interacting with the level @@ -83,8 +83,8 @@ typedef struct { */ /* lerp between two points */ -vecf vecf_lerp(vecf p1, vecf p2, float t) { - vecf result; +Vecf vecf_lerp(Vecf p1, Vecf p2, float t) { + Vecf result; result.x = p1.x * (1.0 - t) + p2.x * t; result.y = p1.y * (1.0 - t) + p2.y * t; @@ -92,8 +92,8 @@ vecf vecf_lerp(vecf p1, vecf p2, float t) { } /* Take a tile index and return level coordinates */ -vecf pos_world(u32 tile) { - vecf result; +Vecf pos_world(u32 tile) { + Vecf result; result.x = SDL_floor(tile % LEVEL_MAX_WIDTH); result.y = SDL_floor(tile / LEVEL_MAX_WIDTH); @@ -108,9 +108,9 @@ vecf pos_world(u32 tile) { * as performing translations based on the camera * position */ -vecf iso_coords(u32 tile) { - vecf world; - vecf result; +Vecf iso_coords(u32 tile) { + Vecf world; + Vecf result; u32 offs_x, offs_y; /* @@ -148,8 +148,8 @@ u8 path_line(u32 t1, u32 t2, NavPath *line) { u32 dx, dy; u32 i; u32 tx, ty; - vecf p1, p2; - vecf lerp_point; + Vecf p1, p2; + Vecf lerp_point; /* Error out if the start and end tiles are the same */ if (t1 == t2) { return 1; } @@ -265,7 +265,7 @@ u8 cursor_tile(float screen_x, float screen_y, u32 *tile) { */ void draw_level(void) { u32 i; - vecf pos; + Vecf pos; SDL_FRect dest; SDL_FRect src; @@ -394,7 +394,7 @@ u8 player_path(u32 tile) { u8 draw_player() { SDL_FRect dest; SDL_FRect src; - vecf offs; + Vecf offs; u32 tile_next; src.y = (float) player.angle * 96;