adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-commits] CVS: adonthell/src data_screen.cc,1.23,1.24 gamedata


From: Kai Sterker <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src data_screen.cc,1.23,1.24 gamedata.cc,1.27,1.28 gamedata.h,1.13,1.14
Date: Thu, 22 Aug 2002 15:52:44 -0400

Update of /cvsroot/adonthell/adonthell/src
In directory subversions:/tmp/cvs-serv30536

Modified Files:
        data_screen.cc gamedata.cc gamedata.h 
Log Message:
FIXED displaying of gametime on load/save screen. (Might be helpful to assign 
the value _before_ saving stuff to disk :P)


Index: data_screen.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/data_screen.cc,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** data_screen.cc      22 Aug 2002 17:56:40 -0000      1.23
--- data_screen.cc      22 Aug 2002 19:52:41 -0000      1.24
***************
*** 2,6 ****
     $Id$
  
!    Copyright (C) 2001 by Kai Sterker <address@hidden>
     Part of the Adonthell Project http://adonthell.linuxgames.com
  
--- 2,6 ----
     $Id$
  
!    Copyright (C) 2001/2002 by Kai Sterker <address@hidden>
     Part of the Adonthell Project http://adonthell.linuxgames.com
  
***************
*** 292,296 ****
      int pos = image_list->get_selected_position ();
  
!     gamedata::save (pos, description);
      gamedata *gdata = gamedata::get_saved_game (pos);
  
--- 292,296 ----
      int pos = image_list->get_selected_position ();
  
!     gamedata::save (pos, description, gametime);
      gamedata *gdata = gamedata::get_saved_game (pos);
  
***************
*** 298,302 ****
      if (gdata != NULL)
      {
-         gdata->set_gametime (gametime); 
          string filepath = gdata->directory ();
          filepath += "/preview.pnm";
--- 298,301 ----

Index: gamedata.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gamedata.cc,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** gamedata.cc 22 Aug 2002 17:56:40 -0000      1.27
--- gamedata.cc 22 Aug 2002 19:52:41 -0000      1.28
***************
*** 57,65 ****
  }
  
! gamedata::gamedata (string dir, string desc)
  {
      Timestamp = 0;
      Directory = dir;
!     Description = desc; 
  }
  
--- 57,66 ----
  }
  
! gamedata::gamedata (string dir, string desc, string time)
  {
      Timestamp = 0;
      Directory = dir;
!     Description = desc;
!     Gametime = time;
  }
  
***************
*** 286,290 ****
  }
  
! bool gamedata::save (u_int32 pos, string desc)
  {
      gamedata *gdata;
--- 287,291 ----
  }
  
! bool gamedata::save (u_int32 pos, string desc, string time)
  {
      gamedata *gdata;
***************
*** 327,331 ****
          
          // we'll need a new gamedata record
!         gdata = new gamedata (filepath, desc);
      }
      else
--- 328,332 ----
          
          // we'll need a new gamedata record
!         gdata = new gamedata (filepath, desc, time);
      }
      else
***************
*** 333,336 ****
--- 334,338 ----
          gdata = saves[pos];
          gdata->set_description (desc);
+         gdata->set_gametime (time);
      }
  
***************
*** 489,499 ****
      if (chdir (game_data_dir ().c_str ()))
      {
!         cerr << "\nSeems like " << game_data_dir () << " is no valid data 
directory.";
!         cerr << "\nMake sure that your Adonthell installation is correct.\n"; 
          return false;
      }
  
      // Add the default savegame used to start a new game to the list of saves
!     gdata = new gamedata (gdir, "Start New Game");
      saves.push_back (gdata);
  
--- 491,501 ----
      if (chdir (game_data_dir ().c_str ()))
      {
!         fprintf (stderr, "Seems like %s is no valid data directory.\n", 
game_data_dir ().c_str ());
!         fprintf (stderr, "Please make sure that your Adonthell installation 
is correct.\n"); 
          return false;
      }
  
      // Add the default savegame used to start a new game to the list of saves
!     gdata = new gamedata (gdir, "Start New Game", "Day 0 - 00:00");
      saves.push_back (gdata);
  

Index: gamedata.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gamedata.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** gamedata.h  22 Aug 2002 17:56:40 -0000      1.13
--- gamedata.h  22 Aug 2002 19:52:41 -0000      1.14
***************
*** 68,73 ****
       * @param desc description of the saved %game.
       * @param dir directory of the saved %game.
       */
!     gamedata (string desc, string dir); 
  #endif
  
--- 68,74 ----
       * @param desc description of the saved %game.
       * @param dir directory of the saved %game.
+      * @param time Textual representation of in-game time.
       */
!     gamedata (string desc, string dir, string time); 
  #endif
  
***************
*** 241,248 ****
       * @param pos Slot number where to save to.
       * @param desc Description of the %game to be saved.
       * 
       * @return \e true in case of success, false otherwise.
       */
!     static bool save (u_int32 pos, string desc);
      
      /**
--- 242,250 ----
       * @param pos Slot number where to save to.
       * @param desc Description of the %game to be saved.
+      * @param time Textual representation of in-game time.
       * 
       * @return \e true in case of success, false otherwise.
       */
!     static bool save (u_int32 pos, string desc, string time);
      
      /**





reply via email to

[Prev in Thread] Current Thread [Next in Thread]