mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-31 13:50:48 +00:00
- create intermissions from text screen clusterinfos.
- restore end of game action special. - move game's default end sequence into gameinfo section. SVN r2879 (finale)
This commit is contained in:
parent
287741c18b
commit
858e5ea0a4
12 changed files with 94 additions and 86 deletions
|
@ -463,7 +463,6 @@ static bool unloading;
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
|
||||
void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill)
|
||||
{
|
||||
level_info_t *nextinfo = NULL;
|
||||
|
@ -476,7 +475,16 @@ void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill
|
|||
|
||||
if (levelname == NULL || *levelname == 0)
|
||||
{
|
||||
// todo: play the default end sequence here
|
||||
// end the game
|
||||
levelname = NULL;
|
||||
if (!strncmp(level.nextmap, "enDSeQ",6))
|
||||
{
|
||||
levelname = level.nextmap; // If there is already an end sequence please leave it alone!
|
||||
}
|
||||
else
|
||||
{
|
||||
nextlevel.Format("enDSeQ%04x", int(gameinfo.DefaultEndSequence));
|
||||
}
|
||||
}
|
||||
else if (strncmp(levelname, "enDSeQ", 6) != 0)
|
||||
{
|
||||
|
@ -492,7 +500,7 @@ void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill
|
|||
}
|
||||
}
|
||||
|
||||
nextlevel = levelname;
|
||||
if (levelname != NULL) nextlevel = levelname;
|
||||
|
||||
if (nextSkill != -1)
|
||||
NextSkill = nextSkill;
|
||||
|
@ -950,12 +958,7 @@ void G_WorldDone (void)
|
|||
|
||||
thiscluster = FindClusterInfo (level.cluster);
|
||||
|
||||
/*
|
||||
if (level.info->Intermission != NAME_None)
|
||||
{
|
||||
// todo start intermission
|
||||
}
|
||||
else if (strncmp (nextlevel, "enDSeQ", 6) == 0)
|
||||
if (strncmp (nextlevel, "enDSeQ", 6) == 0)
|
||||
{
|
||||
F_StartFinale (thiscluster->MessageMusic, thiscluster->musicorder,
|
||||
thiscluster->cdtrack, thiscluster->cdid,
|
||||
|
@ -963,7 +966,7 @@ void G_WorldDone (void)
|
|||
thiscluster->flags & CLUSTER_EXITTEXTINLUMP,
|
||||
thiscluster->flags & CLUSTER_FINALEPIC,
|
||||
thiscluster->flags & CLUSTER_LOOKUPEXITTEXT,
|
||||
true, strtol(nextlevel.GetChars()+6, NULL, 16));
|
||||
true, ENamedName(strtol(nextlevel.GetChars()+6, NULL, 16)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -995,7 +998,6 @@ void G_WorldDone (void)
|
|||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -299,6 +299,7 @@ void FMapInfoParser::ParseGameInfo()
|
|||
GAMEINFOKEY_CSTRING(mBackButton, "menubackbutton", 8)
|
||||
GAMEINFOKEY_INT(TextScreenX, "textscreenx")
|
||||
GAMEINFOKEY_INT(TextScreenY, "textscreeny")
|
||||
GAMEINFOKEY_STRING(DefaultEndSequence, "defaultendsequence")
|
||||
|
||||
else
|
||||
{
|
||||
|
|
1
src/gi.h
1
src/gi.h
|
@ -127,6 +127,7 @@ struct gameinfo_t
|
|||
fixed_t gibfactor;
|
||||
int TextScreenX;
|
||||
int TextScreenY;
|
||||
FName DefaultEndSequence;
|
||||
|
||||
const char *GetFinalePage(unsigned int num) const;
|
||||
};
|
||||
|
|
|
@ -322,79 +322,7 @@ void F_StartFinale (const char *music, int musicorder, int cdtrack, unsigned int
|
|||
}
|
||||
#endif
|
||||
|
||||
void F_StartFinale (const char *music, int musicorder, int cdtrack, unsigned int cdid, const char *flat,
|
||||
const char *text, INTBOOL textInLump, INTBOOL finalePic, INTBOOL lookupText,
|
||||
bool ending, int endsequence)
|
||||
{}
|
||||
|
||||
/*
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int FindEndSequence (int type, const char *picname)
|
||||
void F_StartIntermission(FIntermissionDescriptor *desc, bool deleteme)
|
||||
{
|
||||
unsigned int i, num;
|
||||
|
||||
num = EndSequences.Size ();
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
if (EndSequences[i].EndType == type && !EndSequences[i].Advanced &&
|
||||
(type != END_Pic || stricmp (EndSequences[i].PicName, picname) == 0))
|
||||
{
|
||||
return (int)i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
static void SetEndSequence (char *nextmap, int type)
|
||||
{
|
||||
int seqnum;
|
||||
|
||||
seqnum = FindEndSequence (type, NULL);
|
||||
if (seqnum == -1)
|
||||
{
|
||||
EndSequence newseq;
|
||||
newseq.EndType = type;
|
||||
seqnum = (int)EndSequences.Push (newseq);
|
||||
}
|
||||
mysnprintf(nextmap, 11, "enDSeQ%04x", (WORD)seqnum);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void G_SetForEndGame (char *nextmap)
|
||||
{
|
||||
if (!strncmp(nextmap, "enDSeQ",6)) return; // If there is already an end sequence please leave it alone!!!
|
||||
|
||||
if (gameinfo.gametype == GAME_Strife)
|
||||
{
|
||||
SetEndSequence (nextmap, gameinfo.flags & GI_SHAREWARE ? END_BuyStrife : END_Strife);
|
||||
}
|
||||
else if (gameinfo.gametype == GAME_Hexen)
|
||||
{
|
||||
SetEndSequence (nextmap, END_Chess);
|
||||
}
|
||||
else if (gameinfo.gametype == GAME_Doom && (gameinfo.flags & GI_MAPxx))
|
||||
{
|
||||
SetEndSequence (nextmap, END_Cast);
|
||||
}
|
||||
else
|
||||
{ // The ExMx games actually have different ends based on the episode,
|
||||
// but I want to keep this simple.
|
||||
SetEndSequence (nextmap, END_Pic1);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
|
|
@ -269,11 +269,12 @@ public:
|
|||
bool F_Responder (event_t* ev);
|
||||
void F_Ticker ();
|
||||
void F_Drawer ();
|
||||
void F_StartIntermission(FIntermissionDescriptor *desc, bool deleteme);
|
||||
|
||||
// Create an intermission from old cluster data
|
||||
void F_StartFinale (const char *music, int musicorder, int cdtrack, unsigned int cdid, const char *flat,
|
||||
const char *text, INTBOOL textInLump, INTBOOL finalePic, INTBOOL lookupText,
|
||||
bool ending, int endsequence = 0);
|
||||
bool ending, FName endsequence = NAME_None);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -733,4 +733,66 @@ FName FMapInfoParser::CheckEndSequence()
|
|||
return FName(seqname);
|
||||
}
|
||||
return NAME_None;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Creates an intermission from the cluster's finale info
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void F_StartFinale (const char *music, int musicorder, int cdtrack, unsigned int cdid, const char *flat,
|
||||
const char *text, INTBOOL textInLump, INTBOOL finalePic, INTBOOL lookupText,
|
||||
bool ending, FName endsequence)
|
||||
{
|
||||
if (text != NULL && *text != 0)
|
||||
{
|
||||
FIntermissionActionTextscreen *textscreen = new FIntermissionActionTextscreen;
|
||||
if (textInLump)
|
||||
{
|
||||
int lump = Wads.CheckNumForFullName(text, true);
|
||||
if (lump > 0)
|
||||
{
|
||||
textscreen->mText = Wads.ReadLump(lump).GetString();
|
||||
}
|
||||
else
|
||||
{
|
||||
textscreen->mText.Format("Unknown text lump '%s'", text);
|
||||
}
|
||||
}
|
||||
else if (!lookupText)
|
||||
{
|
||||
textscreen->mText = text;
|
||||
}
|
||||
else
|
||||
{
|
||||
textscreen->mText << '$' << text;
|
||||
}
|
||||
textscreen->mBackground = flat;
|
||||
textscreen->mFlatfill = !finalePic;
|
||||
|
||||
if (music != NULL && *music != 0)
|
||||
{
|
||||
textscreen->mMusic = music;
|
||||
textscreen->mMusicOrder = musicorder;
|
||||
}
|
||||
if (cdtrack > 0)
|
||||
{
|
||||
textscreen->mCdTrack = cdtrack;
|
||||
textscreen->mCdId = cdid;
|
||||
}
|
||||
textscreen->mLink = ending? endsequence : NAME_None;
|
||||
FIntermissionDescriptor *desc = new FIntermissionDescriptor;
|
||||
desc->mActions.Push(textscreen);
|
||||
F_StartIntermission(desc, true);
|
||||
}
|
||||
else if (ending)
|
||||
{
|
||||
FIntermissionDescriptor **pdesc = IntermissionDescriptors.CheckKey(endsequence);
|
||||
if (pdesc != NULL)
|
||||
{
|
||||
F_StartIntermission(*pdesc, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ gameinfo
|
|||
cursorpic = "chexcurs"
|
||||
textscreenx = 10
|
||||
textscreeny = 10
|
||||
defaultendsequence = "Inter_Pic1"
|
||||
}
|
||||
|
||||
skill baby
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
|
||||
Intermission Inter_Titlescreen
|
||||
{
|
||||
GotoTitle
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Intermission Inter_Pic1
|
||||
{
|
||||
Image
|
||||
|
|
|
@ -60,6 +60,7 @@ gameinfo
|
|||
cursorpic = "doomcurs"
|
||||
textscreenx = 10
|
||||
textscreeny = 10
|
||||
defaultendsequence = "Inter_Cast"
|
||||
}
|
||||
|
||||
skill baby
|
||||
|
|
|
@ -59,6 +59,7 @@ gameinfo
|
|||
cursorpic = "herecurs"
|
||||
textscreenx = 20
|
||||
textscreeny = 5
|
||||
defaultendsequence = "Inter_Pic1"
|
||||
}
|
||||
|
||||
skill baby
|
||||
|
|
|
@ -57,6 +57,7 @@ gameinfo
|
|||
cursorpic = "hexncurs"
|
||||
textscreenx = 10
|
||||
textscreeny = 5
|
||||
defaultendsequence = "Inter_Chess"
|
||||
}
|
||||
|
||||
skill baby
|
||||
|
|
|
@ -59,6 +59,7 @@ gameinfo
|
|||
cursorpic = "strfcurs"
|
||||
textscreenx = 10
|
||||
textscreeny = 10
|
||||
defaultendsequence = "Inter_Strife"
|
||||
}
|
||||
|
||||
skill baby
|
||||
|
|
Loading…
Reference in a new issue