X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=highscores.c;h=c72b9876d7f13bbd13259bf692ade95cbb282c10;hb=e311bbe2fa903a7e2a922f202f389b799193195d;hp=d1866ae58d5a86a1cba27503e508ae3003fb9a78;hpb=22f62f001f21d1b91fefd9fc495c122d9ddf205a;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/highscores.c b/highscores.c index d1866ae..c72b987 100644 --- a/highscores.c +++ b/highscores.c @@ -64,11 +64,13 @@ static void highscores_create_db(void) sys->dbheader.playerinfo_root = AATREE_PTR_NIL; } -static int highscores_read(void) -{ +static int highscores_read( const char *path ){ struct highscore_system *sys = &highscore_system; - FILE *fp = fopen( ".aadb", "rb" ); + if( path == NULL ) + path = ".aadb"; + + FILE *fp = fopen( path, "rb" ); if( fp ){ vg_info( "Loading existing database\n" ); @@ -106,7 +108,7 @@ static int highscores_read(void) } else { - vg_low( "No existing database found (.aadb)\n" ); + vg_low( "No existing database found (%s)\n", path ); return 0; } } @@ -159,6 +161,7 @@ static void highscores_init( u32 pool_size, u32 playerinfo_pool_size ) offsetof(highscore_playerinfo,aa_playerid); sys->aainfo_playerinfo_playerid.p_cmp = highscore_cmp_playerinfo_playerid; + /* TODO: Is this even useable? */ sys->aainfo_playerinfo.base = highscore_system.playerinfo_data; sys->aainfo_playerinfo.stride = sizeof(highscore_playerinfo); sys->aainfo_playerinfo.offset = offsetof(highscore_playerinfo,aapn);