- Added BOOM/MBF BEX-style narrative background text substitution. There are two changes because

of this:
  * A cluster's flat definition can now be preceded by a $ to do a string table lookup.
  * Since the standard flat names are now in the LANGUAGE lump, the normal Dehacked substitution
    for these is no longer handled specially and so will not be automatically disabled merely
    by providing your own MAPINFO.

SVN r2195 (trunk)
This commit is contained in:
Randy Heit 2010-03-06 03:28:22 +00:00
parent 38c9bb1900
commit d19878efcb
8 changed files with 43 additions and 32 deletions

View file

@ -2138,20 +2138,7 @@ static int PatchText (int oldSize)
if (!good) if (!good)
{ {
// search cluster text background flats (only if no user-defined MAPINFO is used!) DPrintf (" (Unmatched)\n");
if (strlen(newStr) <= 8 && Wads.CheckNumForName("MAPINFO") >= 0)
{
for (unsigned int i = 0; i < wadclusterinfos.Size(); i++)
{
if (!strcmp(wadclusterinfos[i].finaleflat, oldStr))
{
strcpy(wadclusterinfos[i].finaleflat, newStr);
good = true;
}
}
}
if (!good) DPrintf (" (Unmatched)\n");
} }
} }

View file

@ -117,6 +117,10 @@ void F_StartFinale (const char *music, int musicorder, int cdtrack, unsigned int
} }
FinaleFlat = (flat != NULL && *flat != 0) ? flat : gameinfo.finaleFlat; FinaleFlat = (flat != NULL && *flat != 0) ? flat : gameinfo.finaleFlat;
if (FinaleFlat != NULL && FinaleFlat[0] == '$')
{
FinaleFlat = GStrings(FinaleFlat + 1);
}
if (textInLump) if (textInLump)
{ {
@ -758,7 +762,7 @@ void F_CastDrawer (void)
FTexture* pic; FTexture* pic;
// erase the entire screen to a background // erase the entire screen to a background
screen->DrawTexture (TexMan["BOSSBACK"], 0, 0, screen->DrawTexture (TexMan[GStrings("BOSSBACK")], 0, 0,
DTA_DestWidth, screen->GetWidth(), DTA_DestWidth, screen->GetWidth(),
DTA_DestHeight, screen->GetHeight(), DTA_DestHeight, screen->GetHeight(),
TAG_DONE); TAG_DONE);

View file

@ -1039,7 +1039,7 @@ void G_WorldDone (void)
{ {
F_StartFinale (thiscluster->MessageMusic, thiscluster->musicorder, F_StartFinale (thiscluster->MessageMusic, thiscluster->musicorder,
thiscluster->cdtrack, thiscluster->cdid, thiscluster->cdtrack, thiscluster->cdid,
thiscluster->finaleflat, thiscluster->ExitText, thiscluster->FinaleFlat, thiscluster->ExitText,
thiscluster->flags & CLUSTER_EXITTEXTINLUMP, thiscluster->flags & CLUSTER_EXITTEXTINLUMP,
thiscluster->flags & CLUSTER_FINALEPIC, thiscluster->flags & CLUSTER_FINALEPIC,
thiscluster->flags & CLUSTER_LOOKUPEXITTEXT, thiscluster->flags & CLUSTER_LOOKUPEXITTEXT,
@ -1057,7 +1057,7 @@ void G_WorldDone (void)
{ {
F_StartFinale (nextcluster->MessageMusic, nextcluster->musicorder, F_StartFinale (nextcluster->MessageMusic, nextcluster->musicorder,
nextcluster->cdtrack, nextcluster->cdid, nextcluster->cdtrack, nextcluster->cdid,
nextcluster->finaleflat, nextcluster->EnterText, nextcluster->FinaleFlat, nextcluster->EnterText,
nextcluster->flags & CLUSTER_ENTERTEXTINLUMP, nextcluster->flags & CLUSTER_ENTERTEXTINLUMP,
nextcluster->flags & CLUSTER_FINALEPIC, nextcluster->flags & CLUSTER_FINALEPIC,
nextcluster->flags & CLUSTER_LOOKUPENTERTEXT, nextcluster->flags & CLUSTER_LOOKUPENTERTEXT,
@ -1067,7 +1067,7 @@ void G_WorldDone (void)
{ {
F_StartFinale (thiscluster->MessageMusic, thiscluster->musicorder, F_StartFinale (thiscluster->MessageMusic, thiscluster->musicorder,
thiscluster->cdtrack, nextcluster->cdid, thiscluster->cdtrack, nextcluster->cdid,
thiscluster->finaleflat, thiscluster->ExitText, thiscluster->FinaleFlat, thiscluster->ExitText,
thiscluster->flags & CLUSTER_EXITTEXTINLUMP, thiscluster->flags & CLUSTER_EXITTEXTINLUMP,
thiscluster->flags & CLUSTER_FINALEPIC, thiscluster->flags & CLUSTER_FINALEPIC,
thiscluster->flags & CLUSTER_LOOKUPEXITTEXT, thiscluster->flags & CLUSTER_LOOKUPEXITTEXT,

View file

@ -77,6 +77,7 @@ struct FMapInfoParser
bool ParseLookupName(FString &dest); bool ParseLookupName(FString &dest);
void ParseMusic(FString &name, int &order); void ParseMusic(FString &name, int &order);
void ParseLumpOrTextureName(char *name); void ParseLumpOrTextureName(char *name);
void ParseLumpOrTextureName(FString &name);
void ParseCluster(); void ParseCluster();
void ParseNextMap(char *mapname); void ParseNextMap(char *mapname);
@ -439,7 +440,7 @@ extern TArray<EndSequence> EndSequences;
struct cluster_info_t struct cluster_info_t
{ {
int cluster; int cluster;
char finaleflat[9]; FString FinaleFlat;
FString ExitText; FString ExitText;
FString EnterText; FString EnterText;
FString MessageMusic; FString MessageMusic;

View file

@ -389,7 +389,7 @@ bool level_info_t::isValid()
void cluster_info_t::Reset() void cluster_info_t::Reset()
{ {
cluster = 0; cluster = 0;
finaleflat[0] = 0; FinaleFlat = "";
ExitText = ""; ExitText = "";
EnterText = ""; EnterText = "";
MessageMusic = ""; MessageMusic = "";
@ -615,6 +615,12 @@ void FMapInfoParser::ParseLumpOrTextureName(char *name)
name[8]=0; name[8]=0;
} }
void FMapInfoParser::ParseLumpOrTextureName(FString &name)
{
sc.MustGetString();
name = sc.String;
}
//========================================================================== //==========================================================================
// //
@ -691,12 +697,12 @@ void FMapInfoParser::ParseCluster()
else if (sc.Compare("flat")) else if (sc.Compare("flat"))
{ {
ParseAssign(); ParseAssign();
ParseLumpOrTextureName(clusterinfo->finaleflat); ParseLumpOrTextureName(clusterinfo->FinaleFlat);
} }
else if (sc.Compare("pic")) else if (sc.Compare("pic"))
{ {
ParseAssign(); ParseAssign();
ParseLumpOrTextureName(clusterinfo->finaleflat); ParseLumpOrTextureName(clusterinfo->FinaleFlat);
clusterinfo->flags |= CLUSTER_FINALEPIC; clusterinfo->flags |= CLUSTER_FINALEPIC;
} }
else if (sc.Compare("hub")) else if (sc.Compare("hub"))

View file

@ -570,6 +570,19 @@ PD_ALL6 = "You need all six keys to open this door";
PD_ALL6O = "You need all six keys to activate this object"; PD_ALL6O = "You need all six keys to activate this object";
PD_ALLKEYS = "You need all the keys"; PD_ALLKEYS = "You need all the keys";
// MBF (BOOM?) narration backgrounds
bgflatE1 = "FLOOR4_8";
bgflatE2 = "SFLR6_1";
bgflatE3 = "MFLR8_4";
bgflatE4 = "MFLR8_3";
bgflat06 = "SLIME16";
bgflat11 = "RROCK14";
bgflat20 = "RROCK07";
bgflat30 = "RROCK17";
bgflat15 = "RROCK13";
bgflat31 = "RROCK19";
bgcastcall = "BOSSBACK";
// Gameflow messages // Gameflow messages
TXT_FRAGLIMIT = "Fraglimit hit."; TXT_FRAGLIMIT = "Fraglimit hit.";
TXT_TIMELIMIT = "Timelimit hit."; TXT_TIMELIMIT = "Timelimit hit.";

View file

@ -501,28 +501,28 @@ map E4M9 lookup "HUSTR_E4M9"
cluster 1 cluster 1
{ {
flat = "FLOOR4_8" flat = "$bgflatE1"
music = "$MUSIC_VICTOR" music = "$MUSIC_VICTOR"
exittext = lookup, "E1TEXT" exittext = lookup, "E1TEXT"
} }
cluster 2 cluster 2
{ {
flat = "SFLR6_1" flat = "$bgflatE2"
music = "$MUSIC_VICTOR" music = "$MUSIC_VICTOR"
exittext = lookup, "E2TEXT" exittext = lookup, "E2TEXT"
} }
cluster 3 cluster 3
{ {
flat = "MFLR8_4" flat = "$bgflatE3"
music = "$MUSIC_VICTOR" music = "$MUSIC_VICTOR"
exittext = lookup, "E3TEXT" exittext = lookup, "E3TEXT"
} }
cluster 4 cluster 4
{ {
flat = "MFLR8_3" flat = "$bgflatE4"
music = "$MUSIC_VICTOR" music = "$MUSIC_VICTOR"
exittext = lookup, "E4TEXT" exittext = lookup, "E4TEXT"
} }

View file

@ -372,7 +372,7 @@ map MAP32 lookup "HUSTR_32"
cluster 5 cluster 5
{ {
flat = "SLIME16" flat = "$BGFLAT06"
music = "$MUSIC_READ_M" music = "$MUSIC_READ_M"
exittext = lookup, "C1TEXT" exittext = lookup, "C1TEXT"
@ -382,7 +382,7 @@ cluster 5
cluster 6 cluster 6
{ {
flat = "RROCK14" flat = "$BGFLAT11"
music = "$MUSIC_READ_M" music = "$MUSIC_READ_M"
exittext = lookup, "C2TEXT" exittext = lookup, "C2TEXT"
@ -392,7 +392,7 @@ cluster 6
cluster 7 cluster 7
{ {
flat = "RROCK07" flat = "$BGFLAT20"
music = "$MUSIC_READ_M" music = "$MUSIC_READ_M"
exittext = lookup, "C3TEXT" exittext = lookup, "C3TEXT"
} }
@ -401,7 +401,7 @@ cluster 7
cluster 8 cluster 8
{ {
flat = "RROCK17" flat = "$BGFLAT30"
music = "$MUSIC_READ_M" music = "$MUSIC_READ_M"
exittext = lookup, "C4TEXT" exittext = lookup, "C4TEXT"
} }
@ -410,7 +410,7 @@ cluster 8
cluster 9 cluster 9
{ {
flat = "RROCK13" flat = "$BGFLAT15"
music = "$MUSIC_READ_M" music = "$MUSIC_READ_M"
entertext = lookup, "C5TEXT" entertext = lookup, "C5TEXT"
} }
@ -419,7 +419,7 @@ cluster 9
cluster 10 cluster 10
{ {
flat = "RROCK19" flat = "$BGFLAT31"
music = "$MUSIC_READ_M" music = "$MUSIC_READ_M"
entertext = lookup, "C6TEXT" entertext = lookup, "C6TEXT"
} }