- Added: Automap markers are stored in savegames now. Also moved the call

to AM_LevelInit to its proper place in G_DoLoadLevel, right after
  the call to P_SetupLevel to make it work as intended.


SVN r667 (trunk)
This commit is contained in:
Christoph Oelckers 2008-01-05 12:15:10 +00:00
parent 10b71b09c8
commit 935eeb06f1
5 changed files with 17 additions and 10 deletions

View File

@ -1,4 +1,7 @@
January 5, 2008 (Changes by Graf Zahl)
- Added: Automap markers are stored in savegames now. Also moved the call
to AM_LevelInit to its proper place in G_DoLoadLevel, right after
the call to P_SetupLevel to make it work as intended.
- Changed savegame versioning to use the SVN revision number instead of
an arbitrarily defined value. This reduces the amount of relevant values
that have to be defined in version.h to 1 (the minimum compatible savegame

View File

@ -817,8 +817,7 @@ bool AM_clearMarks ()
}
//
// should be called at the start of every level
// right now, i figure it out myself
// called right after the level has been loaded
//
void AM_LevelInit ()
{
@ -853,15 +852,8 @@ void AM_Stop ()
//
void AM_Start ()
{
static char lastmap[sizeof(level.mapname)] = "";
if (!stopped) AM_Stop();
stopped = false;
if (strcmp (lastmap, level.mapname))
{
AM_LevelInit();
strcpy (lastmap, level.mapname);
}
AM_initVariables();
AM_loadPics();
}
@ -1822,3 +1814,11 @@ void AM_Drawer ()
AM_drawMarks();
}
void AM_SerializeMarkers(FArchive &arc)
{
arc << markpointnum;
for (int i=0; i<AM_NUMMARKPOINTS; i++)
{
arc << markpoints[i].x << markpoints[i].y;
}
}

View File

@ -39,6 +39,8 @@ void AM_Drawer (void);
void AM_Stop (void);
void AM_ToggleMap ();
void AM_LevelInit ();
void AM_SerializeMarkers(FArchive &arc);
#endif

View File

@ -2004,6 +2004,7 @@ void G_DoLoadLevel (int position, bool autosave)
}
P_SetupLevel (level.mapname, position);
AM_LevelInit();
// [RH] Start lightning, if MAPINFO tells us to
if (level.flags & LEVEL_STARTLIGHTNING)
@ -2736,6 +2737,7 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
// This must be saved, too, of course!
FCanvasTextureInfo::Serialize (arc);
AM_SerializeMarkers(arc);
if (!hubLoad)
{

View File

@ -92,7 +92,7 @@
#endif
// MINSAVEVER is the minimum level snapshot version that can be loaded.
#define MINSAVEVER 665
#define MINSAVEVER 667
// The maximum length of one save game description for the menus.
#define SAVESTRINGSIZE 24