Skip to content

Commit

Permalink
IdTech1Converter|MapInfoTranslator: Synthesize Music definitions from…
Browse files Browse the repository at this point in the history
… MAPINFO

Doomsday introduces a "song" abstraction to simplify the creation of
custom soundtracks and introduce more flexibility for mod authors.
Unfortunately, MAPINFO must assume a 1:1 relationship between maps
and their configured "song", i.e., music lump name and cd-track num.

Consequently in order to maintain mod compatibility we'll generate a
set of new Music definitions with an id naming convention that allows
mods using MAPINFO to work alongside mods using DED.

However, this means that if a mod uses MAPINFO - the new Music ids
make it incompatible with existing DED custom soundtrack mods. This
is a fundamental incompatibility cannot be solved easily.
  • Loading branch information
danij-deng committed Nov 17, 2014
1 parent 4965df0 commit dad715b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions doomsday/plugins/idtech1converter/src/mapinfotranslator.cpp
Expand Up @@ -104,6 +104,7 @@ namespace internal {
addNumber ("hub", 0);
addText ("id", "Maps:"); // URI. Unknown.
addBoolean("lightning", false);
addText ("music", "");
addBoolean("nointermission", false);
addText ("nextMap", ""); // URI. None. (If scheme is "@wt" then the path is a warp trans number).
addNumber ("par", 0);
Expand All @@ -112,7 +113,6 @@ namespace internal {
addNumber ("sky1ScrollDelta", 0);
addText ("sky2Material", defaultSkyMaterial());
addNumber ("sky2ScrollDelta", 0);
addText ("songLump", "");
addText ("title", "Untitled");
addText ("titleImage", ""); // URI. None.
addNumber ("warpTrans", 0);
Expand Down Expand Up @@ -893,8 +893,7 @@ namespace internal {
}
if(!Str_CompareIgnoreCase(lexer.token(), "music")) // ZDoom
{
LOG_WARNING("MAPINFO Map.music is not supported.");
lexer.readString();
info->set("music", Str_Text(lexer.readString()));
continue;
}
if(!Str_CompareIgnoreCase(lexer.token(), "next"))
Expand Down Expand Up @@ -1437,13 +1436,21 @@ DENG2_PIMPL_NOREF(MapInfoTranslator)

String const mapId = toMapId(mapUri);

String const musicId = mapId + "_music";
os << "\n\nMusic {"
<< "\n ID = \"" + musicId + "\";"
<< "\n Lump = \"" + info.gets("music") + "\";"
<< "\n CD Track = " + String::number(info.geti("cdTrack")) + ";"
<< "\n}";

bool const doubleSky = info.getb("doubleSky");

os << "\n\nMap Info {"
<< "\n ID = \"" + mapId + "\";"
<< "\n Title = \"" + info.gets("title") + "\";"
<< "\n Author = \"" + String(Str_Text(gameInfo.author)) + "\";"
<< "\n Fade Table = \"" + info.gets("fadeTable") + "\";"
<< "\n Music = \"" + musicId + "\";";
de::Uri titleImageUri(info.gets("titleImage"), RC_NULL);
if(!titleImageUri.path().isEmpty())
{
Expand Down

0 comments on commit dad715b

Please sign in to comment.