summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS8
-rw-r--r--rpm.spec.in2
-rw-r--r--src/doom/d_main.c82
-rw-r--r--src/doom/m_menu.c26
-rw-r--r--textscreen/txt_gui.c23
-rw-r--r--textscreen/txt_gui.h1
-rw-r--r--textscreen/txt_inputbox.c7
7 files changed, 118 insertions, 31 deletions
diff --git a/NEWS b/NEWS
index ede6b242..da799ed4 100644
--- a/NEWS
+++ b/NEWS
@@ -72,6 +72,11 @@
Alexandre-Xavier).
* Level warping on the command line (-warp) to episodes higher
than 4 is possible, matching Vanilla behavior (thanks plumsinus).
+ * The -cdrom command line parameter writes savegames to the
+ correct directory now, matching Vanilla Doom behavior (thanks
+ Alexandre-Xavier).
+ * The Doom II mission pack to use can now be specified manually on
+ the command line with the -pack parameter (thanks chungy)
Heretic:
* Weapon cycling keys for mouse and joystick were fixed (thanks
@@ -166,6 +171,9 @@
* A use-after-free bug has been fixed where a click in a window
that causes the window to close could lead to a crash (thanks
DuClare).
+ * Characters that are unprintable in the Extended ASCII chart
+ are just ignored when they're typed, rather than appearing as
+ an upside-down question mark (thanks Alexandre-Xavier).
2.0.0 (2013-12-09):
diff --git a/rpm.spec.in b/rpm.spec.in
index effe042c..67976019 100644
--- a/rpm.spec.in
+++ b/rpm.spec.in
@@ -3,7 +3,7 @@ Name: @PACKAGE@
Summary: @PACKAGE_SHORTDESC@
Version: @VERSION@
Release: 1
-Source: http://mesh.dl.sourceforge.net/project/chocolate-doom/@PACKAGE@/@VERSION@/@PACKAGE@-@VERSION@.tar.gz
+Source: http://www.chocolate-doom.org/downloads/@VERSION@/@PACKAGE@-@VERSION@.tar.gz
URL: @PACKAGE_URL@
Group: Amusements/Games
BuildRoot: /var/tmp/@PACKAGE@-buildroot
diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index 733a11fb..10606161 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -681,6 +681,38 @@ static char *GetGameName(char *gamename)
return gamename;
}
+static void SetMissionForPackName(char *pack_name)
+{
+ int i;
+ static const struct
+ {
+ char *name;
+ int mission;
+ } packs[] = {
+ { "doom2", doom2 },
+ { "tnt", pack_tnt },
+ { "plutonia", pack_plut },
+ };
+
+ for (i = 0; i < arrlen(packs); ++i)
+ {
+ if (!strcasecmp(pack_name, packs[i].name))
+ {
+ gamemission = packs[i].mission;
+ return;
+ }
+ }
+
+ printf("Valid mission packs are:\n");
+
+ for (i = 0; i < arrlen(packs); ++i)
+ {
+ printf("\t%s\n", packs[i].name);
+ }
+
+ I_Error("Unknown mission pack name: %s", pack_name);
+}
+
//
// Find out what version of Doom is playing.
//
@@ -742,9 +774,27 @@ void D_IdentifyVersion(void)
}
else
{
- // Doom 2 of some kind.
+ int p;
+ // Doom 2 of some kind.
gamemode = commercial;
+
+ // We can manually override the gamemission that we got from the
+ // IWAD detection code. This allows us to eg. play Plutonia 2
+ // with Freedoom and get the right level names.
+
+ //!
+ // @arg <pack>
+ //
+ // Explicitly specify a Doom II "mission pack" to run as, instead of
+ // detecting it based on the filename. Valid values are: "doom2",
+ // "tnt" and "plutonia".
+ //
+ p = M_CheckParmWithArgs("-pack", 1);
+ if (p > 0)
+ {
+ SetMissionForPackName(myargv[p + 1]);
+ }
}
}
@@ -1250,7 +1300,7 @@ void D_DoomMain (void)
// allowing play from CD.
//
- if (M_CheckParm("-cdrom") > 0)
+ if (M_ParmExists("-cdrom"))
{
printf(D_CDROM);
@@ -1263,7 +1313,7 @@ void D_DoomMain (void)
M_SetConfigDir(NULL);
}
-
+
//!
// @arg <x>
// @vanilla
@@ -1363,6 +1413,19 @@ void D_DoomMain (void)
DEH_AddStringReplacement(HUSTR_31, "level 31: idkfa");
DEH_AddStringReplacement(HUSTR_32, "level 32: keen");
DEH_AddStringReplacement(PHUSTR_1, "level 33: betray");
+
+ // 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.
+
+ DEH_AddStringReplacement("M_GDHIGH", "M_MSGON");
+ DEH_AddStringReplacement("M_GDLOW", "M_MSGOFF");
}
#ifdef FEATURE_DEHACKED
@@ -1468,7 +1531,18 @@ void D_DoomMain (void)
// Set the gamedescription string. This is only possible now that
// we've finished loading Dehacked patches.
D_SetGameDescription();
- savegamedir = M_GetSaveGameDir(D_SaveGameIWADName(gamemission));
+
+#ifdef _WIN32
+ // In -cdrom mode, we write savegames to c:\doomdata as well as configs.
+ if (M_ParmExists("-cdrom"))
+ {
+ savegamedir = configdir;
+ }
+ else
+#endif
+ {
+ savegamedir = M_GetSaveGameDir(D_SaveGameIWADName(gamemission));
+ }
// Check for -file in shareware
if (modifiedgame)
diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c
index 863d0832..9a166a43 100644
--- a/src/doom/m_menu.c
+++ b/src/doom/m_menu.c
@@ -983,32 +983,12 @@ 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(detail_patch), PU_CACHE));
+ W_CacheLumpName(DEH_String(detailNames[detailLevel]),
+ PU_CACHE));
V_DrawPatchDirect(OptionsDef.x + 120, OptionsDef.y + LINEHEIGHT * messages,
W_CacheLumpName(DEH_String(msgNames[showMessages]),
diff --git a/textscreen/txt_gui.c b/textscreen/txt_gui.c
index 1a5275b6..74e3ec75 100644
--- a/textscreen/txt_gui.c
+++ b/textscreen/txt_gui.c
@@ -322,6 +322,29 @@ static void PutUnicodeChar(unsigned int c)
TXT_PutChar('\xa8');
}
+int TXT_CanDrawCharacter(unsigned int c)
+{
+ unsigned int i;
+
+ // Standard ASCII range?
+ if (c < 128)
+ {
+ return 1;
+ }
+
+ // Extended ASCII range?
+ for (i = 0; i < 128; ++i)
+ {
+ if (cp437_unicode[i] == c)
+ {
+ return 1;
+ }
+ }
+
+ // Nope.
+ return 0;
+}
+
void TXT_DrawUTF8String(const char *s)
{
int x, y;
diff --git a/textscreen/txt_gui.h b/textscreen/txt_gui.h
index bb41b23d..f745ddd2 100644
--- a/textscreen/txt_gui.h
+++ b/textscreen/txt_gui.h
@@ -27,6 +27,7 @@ void TXT_DrawWindowFrame(const char *title, int x, int y, int w, int h);
void TXT_DrawSeparator(int x, int y, int w);
void TXT_DrawString(const char *s);
void TXT_DrawUTF8String(const char *s);
+int TXT_CanDrawCharacter(unsigned int c);
void TXT_DrawHorizScrollbar(int x, int y, int w, int cursor, int range);
void TXT_DrawVertScrollbar(int x, int y, int h, int cursor, int range);
diff --git a/textscreen/txt_inputbox.c b/textscreen/txt_inputbox.c
index b2acaa8b..60512845 100644
--- a/textscreen/txt_inputbox.c
+++ b/textscreen/txt_inputbox.c
@@ -237,10 +237,11 @@ static int TXT_InputBoxKeyPress(TXT_UNCAST_ARG(inputbox), int key)
c = TXT_KEY_TO_UNICODE(key);
- if (c >= 128 || isprint(c))
+ // Add character to the buffer, but only if it's a printable character
+ // that we can represent on the screen.
+ if (isprint(c)
+ || (c >= 128 && TXT_CanDrawCharacter(c)))
{
- // Add character to the buffer
-
AddCharacter(inputbox, c);
}