- more parser stuff

- moved text screen coordinates into gameinfo section.


SVN r2876 (finale)
This commit is contained in:
Christoph Oelckers 2010-10-02 07:43:18 +00:00
parent cf099f99e0
commit 854e236c86
10 changed files with 151 additions and 20 deletions

View file

@ -297,6 +297,8 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_STRING(mFontColorHighlight, "menufontcolor_highlight")
GAMEINFOKEY_STRING(mFontColorSelection, "menufontcolor_selection")
GAMEINFOKEY_CSTRING(mBackButton, "menubackbutton", 8)
GAMEINFOKEY_INT(TextScreenX, "textscreenx")
GAMEINFOKEY_INT(TextScreenY, "textscreeny")
else
{

View file

@ -125,6 +125,8 @@ struct gameinfo_t
FName mFontColorSelection;
char mBackButton[9];
fixed_t gibfactor;
int TextScreenX;
int TextScreenY;
const char *GetFinalePage(unsigned int num) const;
};

View file

@ -62,11 +62,21 @@ struct FIntermissionAction
struct FIntermissionActionFader : public FIntermissionAction
{
enum EFadeType
{
FADE_In,
FADE_Out,
FADE_Cross,
FADE_Melt,
FADE_Burn,
FADE_Wipe
};
typedef FIntermissionAction Super;
int FadeTime;
int FadeType;
EFadeType mFadeType;
FIntermissionActionFader();
virtual bool ParseKey(FScanner &sc);
};
@ -78,6 +88,7 @@ struct FIntermissionActionTextscreen : public FIntermissionAction
int mTextSpeed;
int mTextX, mTextY;
FIntermissionActionTextscreen();
virtual bool ParseKey(FScanner &sc);
};
@ -91,6 +102,7 @@ struct FIntermissionActionCast : public FIntermissionAction
FString mDying;
TArray<FCastSound> mCastSounds;
FIntermissionActionCast();
virtual bool ParseKey(FScanner &sc);
};
@ -103,6 +115,7 @@ struct FIntermissionActionScroller : public FIntermissionAction
int mScrollTime;
int mScrollDir;
FIntermissionActionScroller();
virtual bool ParseKey(FScanner &sc);
};

View file

@ -36,6 +36,8 @@
#include "intermission/intermission.h"
#include "g_level.h"
#include "w_wad.h"
#include "gi.h"
//==========================================================================
//
@ -131,7 +133,7 @@ bool FIntermissionAction::ParseKey(FScanner &sc)
pat->y = sc.Number;
return true;
}
else if (sc.Compare("Limk"))
else if (sc.Compare("Link"))
{
sc.MustGetToken('=');
sc.MustGetToken(TK_Identifier);
@ -141,16 +143,119 @@ bool FIntermissionAction::ParseKey(FScanner &sc)
else return false;
}
//==========================================================================
//
// FIntermissionActionFader
//
//==========================================================================
FIntermissionActionFader::FIntermissionActionFader()
{
mFadeType = FADE_Cross;
}
bool FIntermissionActionFader::ParseKey(FScanner &sc)
{
struct FadeType
{
const char *Name;
EFadeType Type;
}
const FT[] = {
{ "FadeIn", FADE_In },
{ "FadeOut", FADE_Out },
{ "Crossfade", FADE_Cross },
{ "Melt", FADE_Melt },
{ "Burn", FADE_Burn },
{ "Wipe", FADE_Wipe },
{ NULL, FADE_In }
};
if (sc.Compare("FadeType"))
{
sc.MustGetToken('=');
sc.MustGetToken(TK_Identifier);
int v = sc.MustMatchString(&FT[0].Name, sizeof(FT[0]));
if (v != -1) mFadeType = FT[v].Type;
return true;
}
else return Super::ParseKey(sc);
}
//==========================================================================
//
// FIntermissionActionFader
//
//==========================================================================
FIntermissionActionTextscreen::FIntermissionActionTextscreen()
{
mTextSpeed = 2;
mTextX = -1; // use gameinfo defaults
mTextY = -1;
}
bool FIntermissionActionTextscreen::ParseKey(FScanner &sc)
{
if (sc.Compare("Position"))
{
sc.MustGetToken('=');
sc.MustGetToken(TK_IntConst);
mTextX = sc.Number;
sc.MustGetToken(',');
sc.MustGetToken(TK_IntConst);
mTextY = sc.Number;
return true;
}
else if (sc.Compare("TextLump"))
{
sc.MustGetToken('=');
sc.MustGetToken(TK_StringConst);
int lump = Wads.CheckNumForFullName(sc.String, true);
if (lump > 0)
{
mText = Wads.ReadLump(lump).GetString();
}
else
{
sc.ScriptMessage("Unknown text lump '%s'", sc.String);
mText = "(no message)";
}
return true;
}
else if (sc.Compare("Text"))
{
sc.MustGetToken('=');
do
{
sc.MustGetToken(TK_StringConst);
mText << sc.String << '\n';
}
while (sc.CheckToken(','));
return true;
}
else if (sc.Compare("textspeed"))
{
sc.MustGetToken('=');
sc.MustGetToken(TK_IntConst);
mTextSpeed = sc.Number;
return true;
}
else return Super::ParseKey(sc);
}
void FMapInfoParser::ParseIntermission()
{
FIntermissionDescriptor *desc;
FIntermissionAction *desc;
while (!sc.CheckString("}"))
{
sc.MustGetString();
if (sc.Compare("image"))
{
desc = new FIntermissionAction;
}
else if (sc.Compare("scroller"))
{
@ -160,15 +265,11 @@ void FMapInfoParser::ParseIntermission()
}
else if (sc.Compare("Fader"))
{
}
else if (sc.Compare("Crossfader"))
{
}
else if (sc.Compare("Wiper"))
{
desc = new FIntermissionActionFader;
}
else if (sc.Compare("TextScreen"))
{
desc = new FIntermissionActionTextscreen;
}
else if (sc.Compare("GotoTitle"))
{

View file

@ -57,6 +57,8 @@ gameinfo
pausesign = "M_PAUSE"
gibfactor = 1
cursorpic = "chexcurs"
textscreenx = 10
textscreeny = 10
}
skill baby

View file

@ -3,7 +3,7 @@ Intermission Inter_Pic1
{
Image
{
Background = "@1" // index into finalepic in gameinfo block
Background = "@1" // index into finalepic FadeIn gameinfo block
}
}
@ -27,7 +27,7 @@ Intermission Inter_Bunny
{
Scroller
{
Direction = Right
FadeType = Right
Background = "PFUB1"
Background2 = "PFUB2"
Music = "$MUSIC_BUNNY"
@ -107,7 +107,7 @@ Intermission Inter_Demonscroll
{
Scroller
{
Direction = Up
FadeType = Up
Background = "FINAL1"
Background2 = "FINAL2"
InitialDelay = 2
@ -119,7 +119,7 @@ Intermission Inter_BuyStrife
{
Scroller
{
Direction = Right
FadeType = Right
Background = "CREDIT"
Background2 = "VELLOGO"
InitialDelay = -230
@ -261,7 +261,7 @@ Intermission Inter_Chess
Music = "Hall"
Background = "FINALE1"
Time = 2
Direction = 1
FadeType = FadeIn
}
TextScreen
{
@ -280,14 +280,14 @@ Intermission Inter_Chess
{
Background = "FINALE2"
Time = 2
Direction = -1
FadeType = FadeOut
}
Fader
{
Music = "Chess"
Background = "FINALE3"
Time = 2
Direction = 1
FadeType = FadeIn
}
TextScreen
{
@ -338,11 +338,12 @@ Intermission Inter_Strife_Good
Background = "SS4F4"
Time = 28
}
Crossfader
Fader
{
Background = "CREDIT"
Music = "D_FAST"
Time = 2
FadeType = Crossfade
}
}
@ -368,11 +369,12 @@ Intermission Inter_Strife_Sad
Sound = "svox/ss603a"
Time = 9
}
Crossfader
Fader
{
Background = "CREDIT"
Music = "D_FAST"
Time = 2
FadeType = Crossfade
}
}
@ -397,11 +399,12 @@ Intermission Inter_Strife_Lose
Sound = "svox/ss503b"
Time = 11
}
Crossfader
Fader
{
Background = "CREDIT"
Music = "D_FAST"
Time = 2
FadeType = Crossfade
}
}

View file

@ -58,6 +58,8 @@ gameinfo
pausesign = "M_PAUSE"
gibfactor = 1
cursorpic = "doomcurs"
textscreenx = 10
textscreeny = 10
}
skill baby

View file

@ -57,6 +57,8 @@ gameinfo
pausesign = "PAUSED"
gibfactor = 0.5
cursorpic = "herecurs"
textscreenx = 20
textscreeny = 5
}
skill baby

View file

@ -55,6 +55,8 @@ gameinfo
pausesign = "PAUSED"
gibfactor = 0.5
cursorpic = "hexncurs"
textscreenx = 10
textscreeny = 5
}
skill baby

View file

@ -57,6 +57,8 @@ gameinfo
pausesign = "PAUSED"
gibfactor = 0.5
cursorpic = "strfcurs"
textscreenx = 10
textscreeny = 10
}
skill baby