From: Martin Read Date: Sat, 8 Feb 2014 18:56:49 +0000 (+0000) Subject: Remove external compressor call; correctly process the game tick when saving and... X-Git-Tag: printmsg-purged~8 X-Git-Url: http://git.blackswordsonics.com/?a=commitdiff_plain;h=828883f0b0d8ee1ebb7d32cea7ec0933e7b94f30;p=victrix-abyssi Remove external compressor call; correctly process the game tick when saving and loading --- diff --git a/main.cc b/main.cc index efbd596..82fc23b 100644 --- a/main.cc +++ b/main.cc @@ -111,7 +111,6 @@ void save_game(void) { FILE *fp; uint32_t tmp; - int i; fp = fopen("victrix-abyssi.sav", "wb"); serialize_level(fp, &lvl); fwrite(permobjs, NUM_OF_PERMOBJS, sizeof (Permobj), fp); @@ -128,12 +127,6 @@ void save_game(void) /* Clean up */ fflush(fp); fclose(fp); - /* Compress! */ - i = system("gzip victrix-abyssi.sav"); - if (i != 0) - { - /// welp gzip failed - } game_finished = 1; return; } @@ -141,7 +134,6 @@ void save_game(void) void load_game(void) { FILE *fp; - wrapped_system("gunzip victrix-abyssi.sav"); fp = fopen("victrix-abyssi.sav", "rb"); deserialize_level(fp, &lvl); wrapped_fread(permobjs, sizeof (Permobj), NUM_OF_PERMOBJS, fp); @@ -153,6 +145,7 @@ void load_game(void) depth = ntohl(depth); wrapped_fread(&u, 1, sizeof u, fp); wrapped_fread(&game_tick, 1, sizeof game_tick, fp); + game_tick = ntohl(game_tick); fclose(fp); look_around_you(); status_updated = 1;