Remove external compressor call; correctly process the game tick when saving and...
authorMartin Read <martin@blackswordsonics.com>
Sat, 8 Feb 2014 18:56:49 +0000 (18:56 +0000)
committerMartin Read <martin@blackswordsonics.com>
Sat, 8 Feb 2014 18:56:49 +0000 (18:56 +0000)
main.cc

diff --git a/main.cc b/main.cc
index efbd596..82fc23b 100644 (file)
--- 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;