summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2010-01-12 20:09:01 +0000
committerSimon Howard2010-01-12 20:09:01 +0000
commitb777eebd4d4bd3b974b11e1fc4968e6f2b0e65d5 (patch)
tree3e6654cea2e5b1334b3dfe27271d43c7d137b6a9
parenta33a26c2c46282d2afdfe543d88bd2ba4373319e (diff)
downloadchocolate-doom-b777eebd4d4bd3b974b11e1fc4968e6f2b0e65d5.tar.gz
chocolate-doom-b777eebd4d4bd3b974b11e1fc4968e6f2b0e65d5.tar.bz2
chocolate-doom-b777eebd4d4bd3b974b11e1fc4968e6f2b0e65d5.zip
Place commercial level name strings consecutively in the same array, so
that overflowing the end of one list accesses the start of the next. This trick is used by pl2.wad for its MAP33 secret level. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1806
-rw-r--r--src/hu_stuff.c30
-rw-r--r--src/st_stuff.c7
2 files changed, 17 insertions, 20 deletions
diff --git a/src/hu_stuff.c b/src/hu_stuff.c
index 0ab750fb..9f86c0b9 100644
--- a/src/hu_stuff.c
+++ b/src/hu_stuff.c
@@ -50,9 +50,9 @@
// Locally used constants, shortcuts.
//
#define HU_TITLE (mapnames[(gameepisode-1)*9+gamemap-1])
-#define HU_TITLE2 (mapnames2[gamemap-1])
-#define HU_TITLEP (mapnamesp[gamemap-1])
-#define HU_TITLET (mapnamest[gamemap-1])
+#define HU_TITLE2 (mapnames_commercial[gamemap-1])
+#define HU_TITLEP (mapnames_commercial[gamemap-1 + 32])
+#define HU_TITLET (mapnames_commercial[gamemap-1 + 64])
#define HU_TITLE_CHEX (mapnames[gamemap - 1])
#define HU_TITLEHEIGHT 1
#define HU_TITLEX 0
@@ -171,8 +171,16 @@ char* mapnames[] = // DOOM shareware/registered/retail (Ultimate) names.
"NEWLEVEL"
};
-char* mapnames2[] = // DOOM 2 map names.
+// List of names for levels in commercial IWADs
+// (doom2.wad, plutonia.wad, tnt.wad). These are stored in a
+// single large array; WADs like pl2.wad have a MAP33, and rely on
+// the layout in the Vanilla executable, where it is possible to
+// overflow the end of one array into the next.
+
+char *mapnames_commercial[] =
{
+ // DOOM 2 map names.
+
HUSTR_1,
HUSTR_2,
HUSTR_3,
@@ -206,12 +214,10 @@ char* mapnames2[] = // DOOM 2 map names.
HUSTR_29,
HUSTR_30,
HUSTR_31,
- HUSTR_32
-};
+ HUSTR_32,
+ // Plutonia WAD map names.
-char* mapnamesp[] = // Plutonia WAD map names.
-{
PHUSTR_1,
PHUSTR_2,
PHUSTR_3,
@@ -245,12 +251,10 @@ char* mapnamesp[] = // Plutonia WAD map names.
PHUSTR_29,
PHUSTR_30,
PHUSTR_31,
- PHUSTR_32
-};
-
+ PHUSTR_32,
+
+ // TNT WAD map names.
-char *mapnamest[] = // TNT WAD map names.
-{
THUSTR_1,
THUSTR_2,
THUSTR_3,
diff --git a/src/st_stuff.c b/src/st_stuff.c
index f92d2dda..c3226f1b 100644
--- a/src/st_stuff.c
+++ b/src/st_stuff.c
@@ -259,9 +259,6 @@
// Height, in lines.
#define ST_OUTHEIGHT 1
-#define ST_MAPWIDTH \
- (strlen(mapnames[(gameepisode-1)*9+(gamemap-1)]))
-
#define ST_MAPTITLEX \
(SCREENWIDTH - ST_MAPWIDTH * ST_CHATFONTWIDTH)
@@ -418,10 +415,6 @@ cheatseq_t cheat_clev = CHEAT("idclev", 2);
cheatseq_t cheat_mypos = CHEAT("idmypos", 0);
-//
-extern char* mapnames[];
-
-
//
// STATUS BAR CODE
//