summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2014-02-20 06:03:18 +0000
committerSimon Howard2014-02-20 06:03:18 +0000
commitdc57eb0844fea8fd444281453b25f43ab7007a22 (patch)
tree43faeb6e3835a47ae4d1af31824370aa5ea82d7b
parent2ec58cfa8becc461bf749e0009f150b1841aba6b (diff)
downloadchocolate-doom-dc57eb0844fea8fd444281453b25f43ab7007a22.tar.gz
chocolate-doom-dc57eb0844fea8fd444281453b25f43ab7007a22.tar.bz2
chocolate-doom-dc57eb0844fea8fd444281453b25f43ab7007a22.zip
Add BFG edition workaround for options menu crash.
The BFG edition IWADs have their M_GDHIGH lumps changed to say "Fullscreen:" instead of just "high". This breaks the options menu which assumes a graphic that is not as wide. In the same spirit as the title screen workaround, add a workaround for this as well: use the message "on/off" graphics instead when we are running using a BFG edition IWAD. This fixes #341 (thanks Fabian Greffrath).
-rw-r--r--src/doom/doomstat.h3
-rw-r--r--src/doom/m_menu.c31
2 files changed, 28 insertions, 6 deletions
diff --git a/src/doom/doomstat.h b/src/doom/doomstat.h
index 9e09bb42..bb203e0d 100644
--- a/src/doom/doomstat.h
+++ b/src/doom/doomstat.h
@@ -66,6 +66,9 @@ extern GameMission_t gamemission;
extern GameVersion_t gameversion;
extern char *gamedescription;
+// If true, we're using one of the mangled BFG edition IWADs.
+extern boolean bfgedition;
+
// Convenience macro.
// 'gamemission' can be equal to pack_chex or pack_hacx, but these are
// just modified versions of doom and doom2, and should be interpreted
diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c
index 4951d9a6..97c080c8 100644
--- a/src/doom/m_menu.c
+++ b/src/doom/m_menu.c
@@ -985,18 +985,37 @@ void M_Episode(int choice)
//
// M_Options
//
-char detailNames[2][9] = {"M_GDHIGH","M_GDLOW"};
-char msgNames[2][9] = {"M_MSGOFF","M_MSGON"};
-
+static char *detailNames[2] = {"M_GDHIGH","M_GDLOW"};
+static char *msgNames[2] = {"M_MSGOFF","M_MSGON"};
void M_DrawOptions(void)
{
+ char *detail_patch;
+
V_DrawPatchDirect(108, 15, W_CacheLumpName(DEH_String("M_OPTTTL"),
PU_CACHE));
-
+
+ // Workaround for BFG edition IWAD weirdness.
+ // The BFG edition doesn't have the "low detail" menu option (fair
+ // enough). But bizarrely, it reuses the M_GDHIGH patch as a label
+ // for the options menu (says "Fullscreen:"). Why the perpetrators
+ // couldn't just add a new graphic lump and had to reuse this one,
+ // I don't know.
+ //
+ // The end result is that M_GDHIGH is too wide and causes the game
+ // to crash. As a workaround to get a minimum level of support for
+ // the BFG edition IWADs, use the "ON"/"OFF" graphics instead.
+ if (bfgedition)
+ {
+ detail_patch = msgNames[detailLevel];
+ }
+ else
+ {
+ detail_patch = detailNames[detailLevel];
+ }
+
V_DrawPatchDirect(OptionsDef.x + 175, OptionsDef.y + LINEHEIGHT * detail,
- W_CacheLumpName(DEH_String(detailNames[detailLevel]),
- PU_CACHE));
+ W_CacheLumpName(DEH_String(detail_patch), PU_CACHE));
V_DrawPatchDirect(OptionsDef.x + 120, OptionsDef.y + LINEHEIGHT * messages,
W_CacheLumpName(DEH_String(msgNames[showMessages]),