Subversion Repositories Games.Rick Dangerous

Rev

Rev 11 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11 Rev 13
Line 694... Line 694...
694
      hscore_t *hscore;
694
      hscore_t *hscore;
695
      U32 score;
695
      U32 score;
696
      char *ptr;
696
      char *ptr;
697
      size_t i, j;
697
      size_t i, j;
698
      FILE *fp;
698
      FILE *fp;
699
      sprintf_s (hiscorefile_fullpathname, 1024, "%s/%s", sys_getbasepath (), "hiscores.txt");
699
      sprintf_s (hiscorefile_fullpathname, 1024, "%s/hiscores.txt", sys_getdatapath ());
700
      fopen_s (&fp, hiscorefile_fullpathname, "rb");
700
      fopen_s (&fp, hiscorefile_fullpathname, "rb");
701
      if (fp != NULL)
701
      if (fp != NULL)
702
      {
702
      {
703
         for (i = 0; (fgets (linebuf, sizeof (linebuf), fp) != NULL) && (i < 8);)
703
         for (i = 0; (fgets (linebuf, sizeof (linebuf), fp) != NULL) && (i < 8);)
704
         {
704
         {
Line 754... Line 754...
754
   // Pierre-Marie Baty -- addition: save high scores
754
   // Pierre-Marie Baty -- addition: save high scores
755
   {
755
   {
756
      char hiscorefile_fullpathname[1024];
756
      char hiscorefile_fullpathname[1024];
757
      size_t i, j;
757
      size_t i, j;
758
      FILE *fp;
758
      FILE *fp;
759
      sprintf_s (hiscorefile_fullpathname, 1024, "%s/%s", sys_getbasepath (), "hiscores.txt");
759
      sprintf_s (hiscorefile_fullpathname, 1024, "%s/hiscores.txt", sys_getdatapath ());
760
      fopen_s (&fp, hiscorefile_fullpathname, "wb");
760
      fopen_s (&fp, hiscorefile_fullpathname, "wb");
761
      if (fp != NULL)
761
      if (fp != NULL)
762
      {
762
      {
763
         for (i = 0; i < sizeof (game_hscores) / sizeof (game_hscores[0]); i++)
763
         for (i = 0; i < sizeof (game_hscores) / sizeof (game_hscores[0]); i++)
764
         {
764
         {