- merged menu branch back into trunk.
SVN r2768 (trunk)
This commit is contained in:
parent
ec0b07b5e2
commit
579502ab74
86 changed files with 13610 additions and 9229 deletions
|
|
@ -38,7 +38,6 @@
|
|||
#include "g_level.h"
|
||||
#include "sc_man.h"
|
||||
#include "w_wad.h"
|
||||
#include "m_menu.h"
|
||||
#include "cmdlib.h"
|
||||
#include "v_video.h"
|
||||
#include "p_lnspec.h"
|
||||
|
|
@ -63,6 +62,8 @@ TArray<level_info_t> wadlevelinfos;
|
|||
level_info_t TheDefaultLevelInfo;
|
||||
static cluster_info_t TheDefaultClusterInfo;
|
||||
|
||||
TArray<FEpisode> AllEpisodes;
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
|
|
@ -1655,10 +1656,10 @@ level_info_t *FMapInfoParser::ParseMapHeader(level_info_t &defaultinfo)
|
|||
|
||||
void FMapInfoParser::ParseEpisodeInfo ()
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
char map[9];
|
||||
char *pic = NULL;
|
||||
bool picisgfx = false; // Shut up, GCC!!!!
|
||||
FString pic;
|
||||
FString name;
|
||||
bool remove = false;
|
||||
char key = 0;
|
||||
bool noskill = false;
|
||||
|
|
@ -1697,15 +1698,13 @@ void FMapInfoParser::ParseEpisodeInfo ()
|
|||
{
|
||||
ParseAssign();
|
||||
sc.MustGetString ();
|
||||
ReplaceString (&pic, sc.String);
|
||||
picisgfx = false;
|
||||
name = sc.String;
|
||||
}
|
||||
else if (sc.Compare ("picname"))
|
||||
{
|
||||
ParseAssign();
|
||||
sc.MustGetString ();
|
||||
ReplaceString (&pic, sc.String);
|
||||
picisgfx = true;
|
||||
pic = sc.String;
|
||||
}
|
||||
else if (sc.Compare ("remove"))
|
||||
{
|
||||
|
|
@ -1751,9 +1750,9 @@ void FMapInfoParser::ParseEpisodeInfo ()
|
|||
}
|
||||
|
||||
|
||||
for (i = 0; i < EpiDef.numitems; ++i)
|
||||
for (i = 0; i < AllEpisodes.Size(); i++)
|
||||
{
|
||||
if (strncmp (EpisodeMaps[i], map, 8) == 0)
|
||||
if (AllEpisodes[i].mEpisodeMap.CompareNoCase(map) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
@ -1762,50 +1761,17 @@ void FMapInfoParser::ParseEpisodeInfo ()
|
|||
if (remove)
|
||||
{
|
||||
// If the remove property is given for an episode, remove it.
|
||||
if (i < EpiDef.numitems)
|
||||
{
|
||||
if (i+1 < EpiDef.numitems)
|
||||
{
|
||||
memmove (&EpisodeMaps[i], &EpisodeMaps[i+1],
|
||||
sizeof(EpisodeMaps[0])*(EpiDef.numitems - i - 1));
|
||||
memmove (&EpisodeMenu[i], &EpisodeMenu[i+1],
|
||||
sizeof(EpisodeMenu[0])*(EpiDef.numitems - i - 1));
|
||||
memmove (&EpisodeNoSkill[i], &EpisodeNoSkill[i+1],
|
||||
sizeof(EpisodeNoSkill[0])*(EpiDef.numitems - i - 1));
|
||||
}
|
||||
EpiDef.numitems--;
|
||||
}
|
||||
AllEpisodes.Delete(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pic == NULL)
|
||||
{
|
||||
pic = copystring (map);
|
||||
picisgfx = false;
|
||||
}
|
||||
FEpisode *epi = &AllEpisodes[AllEpisodes.Reserve(1)];
|
||||
|
||||
if (i == EpiDef.numitems)
|
||||
{
|
||||
if (EpiDef.numitems == MAX_EPISODES)
|
||||
{
|
||||
i = EpiDef.numitems - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i = EpiDef.numitems++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
delete[] const_cast<char *>(EpisodeMenu[i].name);
|
||||
}
|
||||
|
||||
EpisodeMenu[i].name = pic;
|
||||
EpisodeMenu[i].alphaKey = tolower(key);
|
||||
EpisodeMenu[i].fulltext = !picisgfx;
|
||||
EpisodeNoSkill[i] = noskill;
|
||||
strncpy (EpisodeMaps[i], map, 8);
|
||||
EpisodeMaps[i][8] = 0;
|
||||
epi->mEpisodeMap = map;
|
||||
epi->mEpisodeName = name;
|
||||
epi->mPicName = pic;
|
||||
epi->mShortcut = tolower(key);
|
||||
epi->mNoSkill = noskill;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1818,12 +1784,7 @@ void FMapInfoParser::ParseEpisodeInfo ()
|
|||
|
||||
void ClearEpisodes()
|
||||
{
|
||||
for (int i = 0; i < EpiDef.numitems; ++i)
|
||||
{
|
||||
delete[] const_cast<char *>(EpisodeMenu[i].name);
|
||||
EpisodeMenu[i].name = NULL;
|
||||
}
|
||||
EpiDef.numitems = 0;
|
||||
AllEpisodes.Clear();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
@ -2004,7 +1965,7 @@ void G_ParseMapInfo (const char *basemapinfo)
|
|||
}
|
||||
EndSequences.ShrinkToFit ();
|
||||
|
||||
if (EpiDef.numitems == 0)
|
||||
if (AllEpisodes.Size() == 0)
|
||||
{
|
||||
I_FatalError ("You cannot use clearepisodes in a MAPINFO if you do not define any new episodes after it.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue