summaryrefslogtreecommitdiff
path: root/src/doom
diff options
context:
space:
mode:
Diffstat (limited to 'src/doom')
-rw-r--r--src/doom/d_main.c26
-rw-r--r--src/doom/d_net.c4
-rw-r--r--src/doom/deh_ammo.c8
-rw-r--r--src/doom/deh_frame.c6
-rw-r--r--src/doom/deh_misc.c6
-rw-r--r--src/doom/deh_ptr.c6
-rw-r--r--src/doom/deh_thing.c6
-rw-r--r--src/doom/deh_weapon.c6
-rw-r--r--src/doom/g_game.c8
-rw-r--r--src/doom/hu_stuff.c5
-rw-r--r--src/doom/m_menu.c43
-rw-r--r--src/doom/p_spec.c5
12 files changed, 102 insertions, 27 deletions
diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index d91649a8..0746a579 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -123,9 +123,10 @@ int startloadgame;
boolean advancedemo;
// Store demo, do not accept any inputs
-
boolean storedemo;
+// "BFG Edition" version of doom2.wad does not include TITLEPIC.
+boolean bfgedition;
char wadfile[1024]; // primary wad file
char mapdir[1024]; // directory of development maps
@@ -566,6 +567,13 @@ void D_DoAdvanceDemo (void)
G_DeferedPlayDemo(DEH_String("demo4"));
break;
}
+
+ // The Doom 3: BFG Edition version of doom2.wad does not have a
+ // TITLETPIC lump. Use INTERPIC instead as a workaround.
+ if (bfgedition && !strcasecmp(pagename, "TITLEPIC"))
+ {
+ pagename = "INTERPIC";
+ }
}
@@ -1539,13 +1547,27 @@ void D_DoomMain (void)
DEH_printf("ST_Init: Init status bar.\n");
ST_Init ();
- // If Doom II without a MAP01 lump, this is a store demo.
+ // If Doom II without a MAP01 lump, this is a store demo.
// Moved this here so that MAP01 isn't constantly looked up
// in the main loop.
if (gamemode == commercial && W_CheckNumForName("map01") < 0)
storedemo = true;
+ // Doom 3: BFG Edition includes modified versions of the classic
+ // IWADs. The modified version of doom2.wad does not have a
+ // TITLEPIC lump, so detect this so we can apply a workaround.
+ // We specifically check for TITLEPIC here, after PWADs have been
+ // loaded - this means that we can play with the BFG Edition with
+ // PWADs that change the title screen and still see the modified
+ // titles.
+
+ if (gamemode == commercial && W_CheckNumForName("titlepic") < 0)
+ {
+ printf("BFG Edition: Using INTERPIC instead of TITLEPIC.\n");
+ bfgedition = true;
+ }
+
if (M_CheckParmWithArgs("-statdump", 1))
{
I_AtExit(StatDump, true);
diff --git a/src/doom/d_net.c b/src/doom/d_net.c
index 74893724..4ab61425 100644
--- a/src/doom/d_net.c
+++ b/src/doom/d_net.c
@@ -215,8 +215,8 @@ static void SaveGameSettings(net_gamesettings_t *settings,
// Read checksums of our WAD directory and dehacked information
- W_Checksum(connect_data->wad_md5sum);
- DEH_Checksum(connect_data->deh_md5sum);
+ W_Checksum(connect_data->wad_sha1sum);
+ DEH_Checksum(connect_data->deh_sha1sum);
// Are we playing with the Freedoom IWAD?
diff --git a/src/doom/deh_ammo.c b/src/doom/deh_ammo.c
index 2c6a9022..952d8df3 100644
--- a/src/doom/deh_ammo.c
+++ b/src/doom/deh_ammo.c
@@ -89,14 +89,14 @@ static void DEH_AmmoParseLine(deh_context_t *context, char *line, void *tag)
}
}
-static void DEH_AmmoMD5Hash(md5_context_t *context)
+static void DEH_AmmoSHA1Hash(sha1_context_t *context)
{
int i;
for (i=0; i<NUMAMMO; ++i)
{
- MD5_UpdateInt32(context, clipammo[i]);
- MD5_UpdateInt32(context, maxammo[i]);
+ SHA1_UpdateInt32(context, clipammo[i]);
+ SHA1_UpdateInt32(context, maxammo[i]);
}
}
@@ -107,6 +107,6 @@ deh_section_t deh_section_ammo =
DEH_AmmoStart,
DEH_AmmoParseLine,
NULL,
- DEH_AmmoMD5Hash,
+ DEH_AmmoSHA1Hash,
};
diff --git a/src/doom/deh_frame.c b/src/doom/deh_frame.c
index e59f09f4..8fc01803 100644
--- a/src/doom/deh_frame.c
+++ b/src/doom/deh_frame.c
@@ -148,13 +148,13 @@ static void DEH_FrameParseLine(deh_context_t *context, char *line, void *tag)
}
}
-static void DEH_FrameMD5Sum(md5_context_t *context)
+static void DEH_FrameSHA1Sum(sha1_context_t *context)
{
int i;
for (i=0; i<NUMSTATES; ++i)
{
- DEH_StructMD5Sum(context, &state_mapping, &states[i]);
+ DEH_StructSHA1Sum(context, &state_mapping, &states[i]);
}
}
@@ -165,6 +165,6 @@ deh_section_t deh_section_frame =
DEH_FrameStart,
DEH_FrameParseLine,
NULL,
- DEH_FrameMD5Sum,
+ DEH_FrameSHA1Sum,
};
diff --git a/src/doom/deh_misc.c b/src/doom/deh_misc.c
index b57d0ef0..eb5acece 100644
--- a/src/doom/deh_misc.c
+++ b/src/doom/deh_misc.c
@@ -215,13 +215,13 @@ static void DEH_MiscParseLine(deh_context_t *context, char *line, void *tag)
DEH_Warning(context, "Unknown Misc variable '%s'", variable_name);
}
-static void DEH_MiscMD5Sum(md5_context_t *context)
+static void DEH_MiscSHA1Sum(sha1_context_t *context)
{
unsigned int i;
for (i=0; i<arrlen(misc_settings); ++i)
{
- MD5_UpdateInt32(context, *misc_settings[i].value);
+ SHA1_UpdateInt32(context, *misc_settings[i].value);
}
}
@@ -232,6 +232,6 @@ deh_section_t deh_section_misc =
DEH_MiscStart,
DEH_MiscParseLine,
NULL,
- DEH_MiscMD5Sum,
+ DEH_MiscSHA1Sum,
};
diff --git a/src/doom/deh_ptr.c b/src/doom/deh_ptr.c
index d757a178..0d1764c9 100644
--- a/src/doom/deh_ptr.c
+++ b/src/doom/deh_ptr.c
@@ -129,13 +129,13 @@ static void DEH_PointerParseLine(deh_context_t *context, char *line, void *tag)
}
}
-static void DEH_PointerMD5Sum(md5_context_t *context)
+static void DEH_PointerSHA1Sum(sha1_context_t *context)
{
int i;
for (i=0; i<NUMSTATES; ++i)
{
- MD5_UpdateInt32(context, CodePointerIndex(&states[i].action));
+ SHA1_UpdateInt32(context, CodePointerIndex(&states[i].action));
}
}
@@ -146,6 +146,6 @@ deh_section_t deh_section_pointer =
DEH_PointerStart,
DEH_PointerParseLine,
NULL,
- DEH_PointerMD5Sum,
+ DEH_PointerSHA1Sum,
};
diff --git a/src/doom/deh_thing.c b/src/doom/deh_thing.c
index 5400ae60..d4e05f01 100644
--- a/src/doom/deh_thing.c
+++ b/src/doom/deh_thing.c
@@ -118,13 +118,13 @@ static void DEH_ThingParseLine(deh_context_t *context, char *line, void *tag)
DEH_SetMapping(context, &thing_mapping, mobj, variable_name, ivalue);
}
-static void DEH_ThingMD5Sum(md5_context_t *context)
+static void DEH_ThingSHA1Sum(sha1_context_t *context)
{
int i;
for (i=0; i<NUMMOBJTYPES; ++i)
{
- DEH_StructMD5Sum(context, &thing_mapping, &mobjinfo[i]);
+ DEH_StructSHA1Sum(context, &thing_mapping, &mobjinfo[i]);
}
}
@@ -135,6 +135,6 @@ deh_section_t deh_section_thing =
DEH_ThingStart,
DEH_ThingParseLine,
NULL,
- DEH_ThingMD5Sum,
+ DEH_ThingSHA1Sum,
};
diff --git a/src/doom/deh_weapon.c b/src/doom/deh_weapon.c
index b0c2400c..5c590fe8 100644
--- a/src/doom/deh_weapon.c
+++ b/src/doom/deh_weapon.c
@@ -88,13 +88,13 @@ static void DEH_WeaponParseLine(deh_context_t *context, char *line, void *tag)
DEH_SetMapping(context, &weapon_mapping, weapon, variable_name, ivalue);
}
-static void DEH_WeaponMD5Sum(md5_context_t *context)
+static void DEH_WeaponSHA1Sum(sha1_context_t *context)
{
int i;
for (i=0; i<NUMWEAPONS ;++i)
{
- DEH_StructMD5Sum(context, &weapon_mapping, &weaponinfo[i]);
+ DEH_StructSHA1Sum(context, &weapon_mapping, &weaponinfo[i]);
}
}
@@ -105,6 +105,6 @@ deh_section_t deh_section_weapon =
DEH_WeaponStart,
DEH_WeaponParseLine,
NULL,
- DEH_WeaponMD5Sum,
+ DEH_WeaponSHA1Sum,
};
diff --git a/src/doom/g_game.c b/src/doom/g_game.c
index 92577ff4..4ffddb41 100644
--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -257,6 +257,14 @@ static boolean WeaponSelectable(weapontype_t weapon)
return false;
}
+ // These weapons aren't available in shareware.
+
+ if ((weapon == wp_plasma || weapon == wp_bfg)
+ && gamemission == doom && gamemode == shareware)
+ {
+ return false;
+ }
+
// Can't select a weapon if we don't own it.
if (!players[consoleplayer].weaponowned[weapon])
diff --git a/src/doom/hu_stuff.c b/src/doom/hu_stuff.c
index 9b67a1a5..3aaa5a33 100644
--- a/src/doom/hu_stuff.c
+++ b/src/doom/hu_stuff.c
@@ -595,11 +595,10 @@ boolean HU_Responder(event_t *ev)
}
else
{
- c = ev->data2;
// send a macro
if (altdown)
{
- c = c - '0';
+ c = ev->data1 - '0';
if (c > 9)
return false;
// fprintf(stderr, "got here\n");
@@ -621,6 +620,8 @@ boolean HU_Responder(event_t *ev)
}
else
{
+ c = ev->data2;
+
eatkey = HUlib_keyInIText(&w_chat, c);
if (eatkey)
{
diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c
index e54ac7ff..b0eeee06 100644
--- a/src/doom/m_menu.c
+++ b/src/doom/m_menu.c
@@ -132,6 +132,7 @@ char savegamestrings[10][SAVESTRINGSIZE];
char endstring[160];
+static boolean opldev;
//
// MENU TYPEDEFS
@@ -1887,6 +1888,39 @@ void M_StartControlPanel (void)
itemOn = currentMenu->lastOn; // JDC
}
+// Display OPL debug messages - hack for GENMIDI development.
+
+static void M_DrawOPLDev(void)
+{
+ extern void I_OPL_DevMessages(char *);
+ char debug[1024];
+ char *curr, *p;
+ int line;
+
+ I_OPL_DevMessages(debug);
+ curr = debug;
+ line = 0;
+
+ for (;;)
+ {
+ p = strchr(curr, '\n');
+
+ if (p != NULL)
+ {
+ *p = '\0';
+ }
+
+ M_WriteText(0, line * 8, curr);
+ ++line;
+
+ if (p == NULL)
+ {
+ break;
+ }
+
+ curr = p + 1;
+ }
+}
//
// M_Drawer
@@ -1938,6 +1972,11 @@ void M_Drawer (void)
return;
}
+ if (opldev)
+ {
+ M_DrawOPLDev();
+ }
+
if (!menuactive)
return;
@@ -1965,7 +2004,6 @@ void M_Drawer (void)
V_DrawPatchDirect(x + SKULLXOFF, currentMenu->y - 5 + itemOn*LINEHEIGHT,
W_CacheLumpName(DEH_String(skullName[whichSkull]),
PU_CACHE));
-
}
@@ -2046,6 +2084,7 @@ void M_Init (void)
default:
break;
}
-
+
+ opldev = M_CheckParm("-opldev") > 0;
}
diff --git a/src/doom/p_spec.c b/src/doom/p_spec.c
index 90d0bb7c..68f986dc 100644
--- a/src/doom/p_spec.c
+++ b/src/doom/p_spec.c
@@ -1474,6 +1474,11 @@ void P_SpawnSpecials (void)
switch(lines[i].special)
{
case 48:
+ if (numlinespecials >= MAXLINEANIMS)
+ {
+ I_Error("Too many scrolling wall linedefs! "
+ "(Vanilla limit is 64)");
+ }
// EFFECT FIRSTCOL SCROLL+
linespeciallist[numlinespecials] = &lines[i];
numlinespecials++;