From d19878efcb3f2ad766bc8d3636ceea7baf32c711 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 6 Mar 2010 03:28:22 +0000 Subject: [PATCH] - 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) --- src/d_dehacked.cpp | 15 +-------------- src/f_finale.cpp | 6 +++++- src/g_level.cpp | 6 +++--- src/g_level.h | 3 ++- src/g_mapinfo.cpp | 12 +++++++++--- wadsrc/static/language.enu | 13 +++++++++++++ wadsrc/static/mapinfo/doom1.txt | 8 ++++---- wadsrc/static/mapinfo/doom2.txt | 12 ++++++------ 8 files changed, 43 insertions(+), 32 deletions(-) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index c90eabe903..62c5090e20 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -2138,20 +2138,7 @@ static int PatchText (int oldSize) if (!good) { - // search cluster text background flats (only if no user-defined MAPINFO is used!) - 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"); + DPrintf (" (Unmatched)\n"); } } diff --git a/src/f_finale.cpp b/src/f_finale.cpp index e08f249ebf..2b220fddb8 100644 --- a/src/f_finale.cpp +++ b/src/f_finale.cpp @@ -117,6 +117,10 @@ void F_StartFinale (const char *music, int musicorder, int cdtrack, unsigned int } FinaleFlat = (flat != NULL && *flat != 0) ? flat : gameinfo.finaleFlat; + if (FinaleFlat != NULL && FinaleFlat[0] == '$') + { + FinaleFlat = GStrings(FinaleFlat + 1); + } if (textInLump) { @@ -758,7 +762,7 @@ void F_CastDrawer (void) FTexture* pic; // 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_DestHeight, screen->GetHeight(), TAG_DONE); diff --git a/src/g_level.cpp b/src/g_level.cpp index 1b0bd11300..cc30429411 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1039,7 +1039,7 @@ void G_WorldDone (void) { F_StartFinale (thiscluster->MessageMusic, thiscluster->musicorder, thiscluster->cdtrack, thiscluster->cdid, - thiscluster->finaleflat, thiscluster->ExitText, + thiscluster->FinaleFlat, thiscluster->ExitText, thiscluster->flags & CLUSTER_EXITTEXTINLUMP, thiscluster->flags & CLUSTER_FINALEPIC, thiscluster->flags & CLUSTER_LOOKUPEXITTEXT, @@ -1057,7 +1057,7 @@ void G_WorldDone (void) { F_StartFinale (nextcluster->MessageMusic, nextcluster->musicorder, nextcluster->cdtrack, nextcluster->cdid, - nextcluster->finaleflat, nextcluster->EnterText, + nextcluster->FinaleFlat, nextcluster->EnterText, nextcluster->flags & CLUSTER_ENTERTEXTINLUMP, nextcluster->flags & CLUSTER_FINALEPIC, nextcluster->flags & CLUSTER_LOOKUPENTERTEXT, @@ -1067,7 +1067,7 @@ void G_WorldDone (void) { F_StartFinale (thiscluster->MessageMusic, thiscluster->musicorder, thiscluster->cdtrack, nextcluster->cdid, - thiscluster->finaleflat, thiscluster->ExitText, + thiscluster->FinaleFlat, thiscluster->ExitText, thiscluster->flags & CLUSTER_EXITTEXTINLUMP, thiscluster->flags & CLUSTER_FINALEPIC, thiscluster->flags & CLUSTER_LOOKUPEXITTEXT, diff --git a/src/g_level.h b/src/g_level.h index 3b08516364..7ea2e31473 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -77,6 +77,7 @@ struct FMapInfoParser bool ParseLookupName(FString &dest); void ParseMusic(FString &name, int &order); void ParseLumpOrTextureName(char *name); + void ParseLumpOrTextureName(FString &name); void ParseCluster(); void ParseNextMap(char *mapname); @@ -439,7 +440,7 @@ extern TArray EndSequences; struct cluster_info_t { int cluster; - char finaleflat[9]; + FString FinaleFlat; FString ExitText; FString EnterText; FString MessageMusic; diff --git a/src/g_mapinfo.cpp b/src/g_mapinfo.cpp index f85b089604..f9fe5e829a 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -389,7 +389,7 @@ bool level_info_t::isValid() void cluster_info_t::Reset() { cluster = 0; - finaleflat[0] = 0; + FinaleFlat = ""; ExitText = ""; EnterText = ""; MessageMusic = ""; @@ -615,6 +615,12 @@ void FMapInfoParser::ParseLumpOrTextureName(char *name) 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")) { ParseAssign(); - ParseLumpOrTextureName(clusterinfo->finaleflat); + ParseLumpOrTextureName(clusterinfo->FinaleFlat); } else if (sc.Compare("pic")) { ParseAssign(); - ParseLumpOrTextureName(clusterinfo->finaleflat); + ParseLumpOrTextureName(clusterinfo->FinaleFlat); clusterinfo->flags |= CLUSTER_FINALEPIC; } else if (sc.Compare("hub")) diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 4cb444d0fa..53d74a4833 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -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_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 TXT_FRAGLIMIT = "Fraglimit hit."; TXT_TIMELIMIT = "Timelimit hit."; diff --git a/wadsrc/static/mapinfo/doom1.txt b/wadsrc/static/mapinfo/doom1.txt index 5c8fc1dc9f..b3e6316501 100644 --- a/wadsrc/static/mapinfo/doom1.txt +++ b/wadsrc/static/mapinfo/doom1.txt @@ -501,28 +501,28 @@ map E4M9 lookup "HUSTR_E4M9" cluster 1 { - flat = "FLOOR4_8" + flat = "$bgflatE1" music = "$MUSIC_VICTOR" exittext = lookup, "E1TEXT" } cluster 2 { - flat = "SFLR6_1" + flat = "$bgflatE2" music = "$MUSIC_VICTOR" exittext = lookup, "E2TEXT" } cluster 3 { - flat = "MFLR8_4" + flat = "$bgflatE3" music = "$MUSIC_VICTOR" exittext = lookup, "E3TEXT" } cluster 4 { - flat = "MFLR8_3" + flat = "$bgflatE4" music = "$MUSIC_VICTOR" exittext = lookup, "E4TEXT" } diff --git a/wadsrc/static/mapinfo/doom2.txt b/wadsrc/static/mapinfo/doom2.txt index 50bae7d9db..6dc9815b1d 100644 --- a/wadsrc/static/mapinfo/doom2.txt +++ b/wadsrc/static/mapinfo/doom2.txt @@ -372,7 +372,7 @@ map MAP32 lookup "HUSTR_32" cluster 5 { - flat = "SLIME16" + flat = "$BGFLAT06" music = "$MUSIC_READ_M" exittext = lookup, "C1TEXT" @@ -382,7 +382,7 @@ cluster 5 cluster 6 { - flat = "RROCK14" + flat = "$BGFLAT11" music = "$MUSIC_READ_M" exittext = lookup, "C2TEXT" @@ -392,7 +392,7 @@ cluster 6 cluster 7 { - flat = "RROCK07" + flat = "$BGFLAT20" music = "$MUSIC_READ_M" exittext = lookup, "C3TEXT" } @@ -401,7 +401,7 @@ cluster 7 cluster 8 { - flat = "RROCK17" + flat = "$BGFLAT30" music = "$MUSIC_READ_M" exittext = lookup, "C4TEXT" } @@ -410,7 +410,7 @@ cluster 8 cluster 9 { - flat = "RROCK13" + flat = "$BGFLAT15" music = "$MUSIC_READ_M" entertext = lookup, "C5TEXT" } @@ -419,7 +419,7 @@ cluster 9 cluster 10 { - flat = "RROCK19" + flat = "$BGFLAT31" music = "$MUSIC_READ_M" entertext = lookup, "C6TEXT" }