foxygit / doom Log in
commit 29e7b9d813046415ca385b8fcea4c39249f9e78e
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sun Jan 19 07:35:58 2014 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sun Jan 19 07:35:58 2014 +0000

    doom: Add support for Freedoom IWAD names.

    Freedoom has new IWAD names. Support these as fallbacks if no other
    IWAD file can be found, but prefer FreeDM as it has Vanilla-
    compatible levels. Show a warning on startup if running using the
    main Freedoom IWADs.
---
 src/d_iwad.c      |  3 +++
 src/doom/d_main.c | 12 ++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/src/d_iwad.c b/src/d_iwad.c
index f122065f..bfef4859 100644
--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@ -48,6 +48,9 @@ static iwad_t iwads[] =
     { "doom1.wad",    doom,      shareware,  "Doom Shareware" },
     { "chex.wad",     pack_chex, shareware,  "Chex Quest" },
     { "hacx.wad",     pack_hacx, commercial, "Hacx" },
+    { "freedm.wad",   doom2,     commercial, "FreeDM" },
+    { "freedoom2.wad", doom2,    commercial, "Freedoom: Phase 2" },
+    { "freedoom1.wad", doom,     retail,     "Freedoom: Phase 1" },
     { "heretic.wad",  heretic,   retail,     "Heretic" },
     { "heretic1.wad", heretic,   shareware,  "Heretic Shareware" },
     { "hexen.wad",    hexen,     commercial, "Hexen" },
diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index 95342437..70144fb6 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -1387,6 +1387,18 @@ void D_DoomMain (void)
     I_PrintStartupBanner(gamedescription);
     PrintDehackedBanners();

+    // Freedoom's IWADs are Boom-compatible, which means they usually
+    // don't work in Vanilla (though FreeDM is okay). Show a warning
+    // message and give a link to the website.
+    if (W_CheckNumForName("FREEDOOM") >= 0 && W_CheckNumForName("FREEDM") < 0)
+    {
+        printf(" WARNING: You are playing using one of the Freedoom IWAD\n"
+               " files, which might not work in this port. See this page\n"
+               " for more information on how to play using Freedoom:\n"
+               "   http://www.chocolate-doom.org/wiki/index.php/Freedoom\n");
+        I_PrintDivider();
+    }
+
     DEH_printf("I_Init: Setting up machine state.\n");
     I_CheckIsScreensaver();
     I_InitTimer();