X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=highscores.h;h=d99710e480cdf59f142ba126707f86995cdd740c;hb=5ecf9cca8b5b9bf876d7e7c7fde03d5b187bb42b;hp=78db2ad3105961b74a2f6115ba15c8d7e1e0858c;hpb=c2d67378dd5c82de50b8fbbbe222ec6be2da4eee;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/highscores.h b/highscores.h index 78db2ad..d99710e 100644 --- a/highscores.h +++ b/highscores.h @@ -1,3 +1,7 @@ +/* + * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved + */ + #ifndef HIGHSCORES_H #define HIGHSCORES_H @@ -128,7 +132,7 @@ static int highscore_cmp_playerinfo_playerid( void *a, void *b ) static void *highscore_malloc( u32 count, u32 size ) { size_t requested_mem = size * count; - void *data = malloc( requested_mem ); + void *data = vg_alloc( requested_mem ); requested_mem /= 1024; requested_mem /= 1024; @@ -146,8 +150,8 @@ static void *highscore_malloc( u32 count, u32 size ) static void highscores_free(void) { - free( highscore_system.data ); - free( highscore_system.playerinfo_data ); + vg_free( highscore_system.data ); + vg_free( highscore_system.playerinfo_data ); } static int highscores_init( u32 pool_size, u32 playerinfo_pool_size ) @@ -161,7 +165,7 @@ static int highscores_init( u32 pool_size, u32 playerinfo_pool_size ) highscore_malloc( playerinfo_pool_size, sizeof(highscore_playerinfo)); if( !sys->playerinfo_data ) { - free( sys->data ); + vg_free( sys->data ); return 0; } @@ -314,7 +318,6 @@ static aatree_ptr highscores_push_record( highscore_record *record ) { struct highscore_system *sys = &highscore_system; - /* TODO: Verify steam ID */ vg_low( "Inserting record into database for track %hu\n",record->trackid ); if( record->trackid >= vg_list_size(sys->dbheader.tracks) )