From acddada252b39b2c7885d0be2d6a7cb16d8475f7 Mon Sep 17 00:00:00 2001 From: hgn Date: Wed, 29 Dec 2021 11:57:14 +0000 Subject: [PATCH] fwd declerations --- fishladder.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/fishladder.c b/fishladder.c index 6c9b1c7..b4c0997 100644 --- a/fishladder.c +++ b/fishladder.c @@ -1,6 +1,6 @@ // Copyright (C) 2021 Harry Godden (hgn) - All Rights Reserved -#define VG_CAPTURE_MODE +//#define VG_CAPTURE_MODE #define VG_STEAM #define VG_STEAM_APPID 1218140U #include "vg/vg.h" @@ -258,11 +258,80 @@ struct world // Forward declerations // -------------------- +// Utility functions +// ----------------- + +static void colour_code_v3( char const cc, v3f target ); +static int hash21i( v2i p, u32 umod ); + +// Mesh functions +// -------------- +static void init_mesh( struct mesh *m, float const *tris, u32 length ); +static void free_mesh( struct mesh *m ); +static void use_mesh( struct mesh *m ); +static void draw_mesh( int const start, int const count ); + +// World buttons +// ------------- +static struct cell_button *get_wbutton( enum e_world_button btn ); +static void wbutton_run( enum e_world_button btn_name, v2f btn_tex ); +static void wbutton_draw( v2i pos, v2f tex, v4f colour ); +static void level_selection_buttons(void); + +// Map/world interface +// ------------------- +static void map_free(void); +static void io_reset(void); +static struct cell *pcell( v2i pos ); +static void map_reclassify( v2i start, v2i end, int update_texbuffer ); +static u32 gen_text_buffer( const char *str, struct sdf_font *font, v2f origin, float size, u32 start ); +static void gen_level_text( struct cmp_level *pLevel ); +static int map_load( const char *str, const char *name ); +static void map_serialize( FILE *stream ); + +// Career +// ------ +static void career_serialize(void); +static void career_unlock_level( struct cmp_level *lvl ); +static void career_unlock_level( struct cmp_level *lvl ); +static void career_pass_level( struct cmp_level *lvl, int score, int upload ); +static void career_reset_level( struct cmp_level *lvl ); +static void career_load(void); +static void clear_animation_flags(void); + +// Gameplay main +// ------------- +static void simulation_stop(void); +static void simulation_start(void); +static int world_check_pos_ok( v2i co ); +static int cell_interactive( v2i co ); + +void vg_update(void); +void leaderboard_found( LeaderboardFindResult_t *pCallback ); +void leaderboard_downloaded( LeaderboardScoresDownloaded_t *pCallback ); + +static void render_tiles( v2i start, v2i end, v4f const regular_colour, v4f const selected_colour ); + +void vg_render(void); +void vg_ui(void); + +// Leaderboard stuff +// ----------------- +void leaderboard_set_score( struct cmp_level *cmp_level, u32 score ); +void leaderboard_dispatch_score(void); +void leaderboard_found( LeaderboardFindResult_t *pCallback ); +void leaderboard_downloaded( LeaderboardScoresDownloaded_t *pCallback ); +void leaderboard_set_score( struct cmp_level *cmp_level, u32 score ); static int console_credits( int argc, char const *argv[] ); static int console_save_map( int argc, char const *argv[] ); static int console_load_map( int argc, char const *argv[] ); static int console_changelevel( int argc, char const *argv[] ); +void vg_start(void); +void vg_free(void); + +int main( int argc, char *argv[] ); + // GLOBALS // =========================================================================================================== -- 2.25.1