summaryrefslogtreecommitdiff
path: root/src/heretic
diff options
context:
space:
mode:
Diffstat (limited to 'src/heretic')
-rw-r--r--src/heretic/.gitignore7
-rw-r--r--src/heretic/Makefile.am13
-rw-r--r--src/heretic/am_map.c7
-rw-r--r--src/heretic/ct_chat.c13
-rw-r--r--src/heretic/d_main.c102
-rw-r--r--src/heretic/deh_ammo.c122
-rw-r--r--src/heretic/deh_frame.c344
-rw-r--r--src/heretic/deh_htext.c856
-rw-r--r--src/heretic/deh_htic.c186
-rw-r--r--src/heretic/deh_htic.h60
-rw-r--r--src/heretic/deh_sound.c118
-rw-r--r--src/heretic/deh_thing.c150
-rw-r--r--src/heretic/deh_weapon.c131
-rw-r--r--src/heretic/doomdef.h1
-rw-r--r--src/heretic/dstrings.h177
-rw-r--r--src/heretic/f_finale.c38
-rw-r--r--src/heretic/g_game.c21
-rw-r--r--src/heretic/in_lude.c73
-rw-r--r--src/heretic/info.c162
-rw-r--r--src/heretic/info.h15
-rw-r--r--src/heretic/mn_menu.c60
-rw-r--r--src/heretic/p_action.h160
-rw-r--r--src/heretic/p_doors.c7
-rw-r--r--src/heretic/p_inter.c75
-rw-r--r--src/heretic/p_pspr.c11
-rw-r--r--src/heretic/p_spec.c40
-rw-r--r--src/heretic/p_switch.c5
-rw-r--r--src/heretic/p_user.c3
-rw-r--r--src/heretic/r_data.c40
-rw-r--r--src/heretic/r_draw.c49
-rw-r--r--src/heretic/r_plane.c3
-rw-r--r--src/heretic/r_things.c14
-rw-r--r--src/heretic/s_sound.c21
-rw-r--r--src/heretic/sb_bar.c170
-rw-r--r--src/heretic/sounds.h5
35 files changed, 2598 insertions, 661 deletions
diff --git a/src/heretic/.gitignore b/src/heretic/.gitignore
index d7e732ad..76092240 100644
--- a/src/heretic/.gitignore
+++ b/src/heretic/.gitignore
@@ -1,7 +1,6 @@
Makefile
Makefile.in
.deps
-*.rc
-chocolate-doom
-chocolate-server
-*.exe
+tags
+TAGS
+
diff --git a/src/heretic/Makefile.am b/src/heretic/Makefile.am
index 2a2f8245..e56ee806 100644
--- a/src/heretic/Makefile.am
+++ b/src/heretic/Makefile.am
@@ -20,6 +20,7 @@ info.c info.h \
in_lude.c \
m_random.c m_random.h \
mn_menu.c \
+ p_action.h \
p_ceilng.c \
p_doors.c \
p_enemy.c \
@@ -55,5 +56,15 @@ EXTRA_DIST= \
i_sound.c \
i_ibm.c
-libheretic_a_SOURCES=$(SOURCE_FILES)
+FEATURE_DEHACKED_SOURCE_FILES = \
+deh_ammo.c \
+deh_frame.c \
+deh_htext.c \
+deh_htic.c \
+deh_sound.c \
+deh_thing.c \
+deh_weapon.c
+
+libheretic_a_SOURCES=$(SOURCE_FILES) \
+ $(FEATURE_DEHACKED_SOURCE_FILES)
diff --git a/src/heretic/am_map.c b/src/heretic/am_map.c
index 99a8e206..aae30cc9 100644
--- a/src/heretic/am_map.c
+++ b/src/heretic/am_map.c
@@ -27,6 +27,7 @@
#include <stdio.h>
#include "doomdef.h"
+#include "deh_str.h"
#include "i_video.h"
#include "m_controls.h"
#include "p_local.h"
@@ -408,7 +409,7 @@ void AM_loadPics(void)
sprintf(namebuf, "AMMNUM%d", i);
marknums[i] = W_CacheLumpName(namebuf, PU_STATIC);
}*/
- maplump = W_CacheLumpName("AUTOPAGE", PU_STATIC);
+ maplump = W_CacheLumpName(DEH_String("AUTOPAGE"), PU_STATIC);
}
/*void AM_unloadPics(void)
@@ -1473,6 +1474,7 @@ void AM_drawCrosshair(int color)
void AM_Drawer(void)
{
+ char *level_name;
int numepisodes;
if (!automapactive)
@@ -1505,7 +1507,8 @@ void AM_Drawer(void)
if (gameepisode <= numepisodes && gamemap < 10)
{
- MN_DrTextA(LevelNames[(gameepisode - 1) * 9 + gamemap - 1], 20, 145);
+ level_name = LevelNames[(gameepisode - 1) * 9 + gamemap - 1];
+ MN_DrTextA(DEH_String(level_name), 20, 145);
}
// I_Update();
// V_MarkRect(f_x, f_y, f_w, f_h);
diff --git a/src/heretic/ct_chat.c b/src/heretic/ct_chat.c
index 75fa6035..8059b74d 100644
--- a/src/heretic/ct_chat.c
+++ b/src/heretic/ct_chat.c
@@ -29,6 +29,7 @@
#include <ctype.h>
#include "doomdef.h"
#include "doomkeys.h"
+#include "deh_str.h"
#include "p_local.h"
#include "s_sound.h"
#include "v_video.h"
@@ -115,7 +116,7 @@ void CT_Init(void)
memset(plr_lastmsg[i], 0, MESSAGESIZE);
memset(chat_msg[i], 0, MESSAGESIZE);
}
- FontABaseLump = W_GetNumForName("FONTA_S") + 1;
+ FontABaseLump = W_GetNumForName(DEH_String("FONTA_S")) + 1;
return;
}
@@ -300,7 +301,9 @@ void CT_Ticker(void)
CT_AddChar(i, 0); // set the end of message character
if (numplayers > 2)
{
- strcpy(plr_lastmsg[i], CT_FromPlrText[i]);
+ strncpy(plr_lastmsg[i], DEH_String(CT_FromPlrText[i]),
+ MESSAGESIZE + 9);
+ plr_lastmsg[i][MESSAGESIZE + 8] = '\0';
strcat(plr_lastmsg[i], chat_msg[i]);
}
else
@@ -320,13 +323,13 @@ void CT_Ticker(void)
if (numplayers > 1)
{
P_SetMessage(&players[consoleplayer],
- "-MESSAGE SENT-", true);
+ DEH_String("-MESSAGE SENT-"), true);
S_StartSound(NULL, sfx_chat);
}
else
{
P_SetMessage(&players[consoleplayer],
- "THERE ARE NO OTHER PLAYERS IN THE GAME!",
+ DEH_String("THERE ARE NO OTHER PLAYERS IN THE GAME!"),
true);
S_StartSound(NULL, sfx_chat);
}
@@ -376,7 +379,7 @@ void CT_Drawer(void)
x += patch->width;
}
}
- V_DrawPatch(x, 10, W_CacheLumpName("FONTA59", PU_CACHE));
+ V_DrawPatch(x, 10, W_CacheLumpName(DEH_String("FONTA59"), PU_CACHE));
BorderTopRefresh = true;
UpdateState |= I_MESSAGES;
}
diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c
index 10f5fd3e..169a86ea 100644
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -33,6 +33,7 @@
#include "config.h"
#include "ct_chat.h"
#include "doomdef.h"
+#include "deh_main.h"
#include "d_iwad.h"
#include "i_endoom.h"
#include "i_joystick.h"
@@ -45,6 +46,7 @@
#include "m_controls.h"
#include "p_local.h"
#include "s_sound.h"
+#include "w_main.h"
#include "v_video.h"
#define STARTUP_WINDOW_X 17
@@ -184,12 +186,12 @@ void D_Display(void)
{
if (!netgame)
{
- V_DrawPatch(160, viewwindowy + 5, W_CacheLumpName("PAUSED",
+ V_DrawPatch(160, viewwindowy + 5, W_CacheLumpName(DEH_String("PAUSED"),
PU_CACHE));
}
else
{
- V_DrawPatch(160, 70, W_CacheLumpName("PAUSED", PU_CACHE));
+ V_DrawPatch(160, 70, W_CacheLumpName(DEH_String("PAUSED"), PU_CACHE));
}
}
// Handle player messages
@@ -315,7 +317,7 @@ void D_PageDrawer(void)
V_DrawRawScreen(W_CacheLumpName(pagename, PU_CACHE));
if (demosequence == 1)
{
- V_DrawPatch(4, 160, W_CacheLumpName("ADVISOR", PU_CACHE));
+ V_DrawPatch(4, 160, W_CacheLumpName(DEH_String("ADVISOR"), PU_CACHE));
}
UpdateState |= I_FULLSCRN;
}
@@ -347,45 +349,45 @@ void D_DoAdvanceDemo(void)
case 0:
pagetic = 210;
gamestate = GS_DEMOSCREEN;
- pagename = "TITLE";
+ pagename = DEH_String("TITLE");
S_StartSong(mus_titl, false);
break;
case 1:
pagetic = 140;
gamestate = GS_DEMOSCREEN;
- pagename = "TITLE";
+ pagename = DEH_String("TITLE");
break;
case 2:
BorderNeedRefresh = true;
UpdateState |= I_FULLSCRN;
- G_DeferedPlayDemo("demo1");
+ G_DeferedPlayDemo(DEH_String("demo1"));
break;
case 3:
pagetic = 200;
gamestate = GS_DEMOSCREEN;
- pagename = "CREDIT";
+ pagename = DEH_String("CREDIT");
break;
case 4:
BorderNeedRefresh = true;
UpdateState |= I_FULLSCRN;
- G_DeferedPlayDemo("demo2");
+ G_DeferedPlayDemo(DEH_String("demo2"));
break;
case 5:
pagetic = 200;
gamestate = GS_DEMOSCREEN;
if (gamemode == shareware)
{
- pagename = "ORDER";
+ pagename = DEH_String("ORDER");
}
else
{
- pagename = "CREDIT";
+ pagename = DEH_String("CREDIT");
}
break;
case 6:
BorderNeedRefresh = true;
UpdateState |= I_FULLSCRN;
- G_DeferedPlayDemo("demo3");
+ G_DeferedPlayDemo(DEH_String("demo3"));
break;
}
}
@@ -638,7 +640,7 @@ void initStartup(void)
// Blit main screen
textScreen = TXT_GetScreenData();
- loading = W_CacheLumpName("LOADING", PU_CACHE);
+ loading = W_CacheLumpName(DEH_String("LOADING"), PU_CACHE);
memcpy(textScreen, loading, 4000);
// Print version string
@@ -698,7 +700,7 @@ void tprintf(char *msg, int initflag)
// haleyjd: moved up, removed WATCOMC code
void CleanExit(void)
{
- printf("Exited from HERETIC.\n");
+ DEH_printf("Exited from HERETIC.\n");
exit(1);
}
@@ -746,6 +748,7 @@ void D_BindVariables(void)
M_BindBaseControls();
M_BindHereticControls();
M_BindWeaponControls();
+ M_BindChatControls(MAXPLAYERS);
M_BindMenuControls();
M_BindMapControls();
@@ -782,7 +785,7 @@ static void D_Endoom(void)
return;
}
- endoom_data = W_CacheLumpName("ENDTEXT", PU_STATIC);
+ endoom_data = W_CacheLumpName(DEH_String("ENDTEXT"), PU_STATIC);
I_Endoom(endoom_data);
}
@@ -847,7 +850,7 @@ void D_DoomMain(void)
//
// init subsystems
//
- printf("V_Init: allocate screens.\n");
+ DEH_printf("V_Init: allocate screens.\n");
V_Init();
// Check for -CDROM
@@ -872,7 +875,7 @@ void D_DoomMain(void)
if (cdrom)
{
- M_SetConfigDir("c:\\heretic.cd\\");
+ M_SetConfigDir(DEH_String("c:\\heretic.cd"));
}
else
{
@@ -880,17 +883,22 @@ void D_DoomMain(void)
}
// Load defaults before initing other systems
- printf("M_LoadDefaults: Load system defaults.\n");
+ DEH_printf("M_LoadDefaults: Load system defaults.\n");
D_BindVariables();
M_SetConfigFilenames("heretic.cfg", PROGRAM_PREFIX "heretic.cfg");
M_LoadDefaults();
I_AtExit(M_SaveDefaults, false);
- printf("Z_Init: Init zone memory allocation daemon.\n");
+ DEH_printf("Z_Init: Init zone memory allocation daemon.\n");
Z_Init();
- printf("W_Init: Init WADfiles.\n");
+#ifdef FEATURE_DEHACKED
+ printf("DEH_Init: Init Dehacked support.\n");
+ DEH_Init();
+#endif
+
+ DEH_printf("W_Init: Init WADfiles.\n");
iwadfile = D_FindIWAD(IWAD_MASK_HERETIC, &gamemission);
@@ -901,24 +909,7 @@ void D_DoomMain(void)
}
D_AddFile(iwadfile);
-
- // -FILE [filename] [filename] ...
- // Add files to the wad list.
- p = M_CheckParm("-file");
-
- if (p)
- {
- char *filename;
-
- // the parms after p are wadfile/lump names, until end of parms
- // or another - preceded parm
-
- while (++p != myargc && myargv[p][0] != '-')
- {
- filename = D_FindWADByName(myargv[p]);
- D_AddFile(filename);
- }
- }
+ W_ParseCommandLine();
p = M_CheckParm("-playdemo");
if (!p)
@@ -927,12 +918,12 @@ void D_DoomMain(void)
}
if (p && p < myargc - 1)
{
- sprintf(file, "%s.lmp", myargv[p + 1]);
+ DEH_snprintf(file, sizeof(file), "%s.lmp", myargv[p + 1]);
D_AddFile(file);
- printf("Playing demo %s.lmp.\n", myargv[p + 1]);
+ DEH_printf("Playing demo %s.lmp.\n", myargv[p + 1]);
}
- if (W_CheckNumForName("E2M1") == -1)
+ if (W_CheckNumForName(DEH_String("E2M1")) == -1)
{
gamemode = shareware;
gamedescription = "Heretic (shareware)";
@@ -960,54 +951,55 @@ void D_DoomMain(void)
//
smsg[0] = 0;
if (deathmatch)
- status("DeathMatch...");
+ status(DEH_String("DeathMatch..."));
if (nomonsters)
- status("No Monsters...");
+ status(DEH_String("No Monsters..."));
if (respawnparm)
- status("Respawning...");
+ status(DEH_String("Respawning..."));
if (autostart)
{
char temp[64];
- sprintf(temp, "Warp to Episode %d, Map %d, Skill %d ",
- startepisode, startmap, startskill + 1);
+ DEH_snprintf(temp, sizeof(temp),
+ "Warp to Episode %d, Map %d, Skill %d ",
+ startepisode, startmap, startskill + 1);
status(temp);
}
wadprintf(); // print the added wadfiles
- tprintf("MN_Init: Init menu system.\n", 1);
+ tprintf(DEH_String("MN_Init: Init menu system.\n"), 1);
MN_Init();
CT_Init();
- tprintf("R_Init: Init Heretic refresh daemon.", 1);
- hprintf("Loading graphics");
+ tprintf(DEH_String("R_Init: Init Heretic refresh daemon."), 1);
+ hprintf(DEH_String("Loading graphics"));
R_Init();
tprintf("\n", 0);
- tprintf("P_Init: Init Playloop state.\n", 1);
- hprintf("Init game engine.");
+ tprintf(DEH_String("P_Init: Init Playloop state.\n"), 1);
+ hprintf(DEH_String("Init game engine."));
P_Init();
IncThermo();
- tprintf("I_Init: Setting up machine state.\n", 1);
+ tprintf(DEH_String("I_Init: Setting up machine state.\n"), 1);
I_CheckIsScreensaver();
I_InitTimer();
I_InitJoystick();
IncThermo();
- tprintf("S_Init: Setting up sound.\n", 1);
+ tprintf(DEH_String("S_Init: Setting up sound.\n"), 1);
S_Init();
//IO_StartupTimer();
S_Start();
- tprintf("D_CheckNetGame: Checking network game status.\n", 1);
- hprintf("Checking network game status.");
+ tprintf(DEH_String("D_CheckNetGame: Checking network game status.\n"), 1);
+ hprintf(DEH_String("Checking network game status."));
D_CheckNetGame();
IncThermo();
// haleyjd: removed WATCOMC
- tprintf("SB_Init: Loading patches.\n", 1);
+ tprintf(DEH_String("SB_Init: Loading patches.\n"), 1);
SB_Init();
IncThermo();
diff --git a/src/heretic/deh_ammo.c b/src/heretic/deh_ammo.c
new file mode 100644
index 00000000..fe86c757
--- /dev/null
+++ b/src/heretic/deh_ammo.c
@@ -0,0 +1,122 @@
+// Emacs style mode select -*- C++ -*-
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 2005 Simon Howard
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+//
+//-----------------------------------------------------------------------------
+//
+// Parses "Ammo" sections in dehacked files
+//
+//-----------------------------------------------------------------------------
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "doomdef.h"
+#include "doomtype.h"
+#include "deh_defs.h"
+#include "deh_io.h"
+#include "deh_main.h"
+#include "p_local.h"
+
+static void *DEH_AmmoStart(deh_context_t *context, char *line)
+{
+ int ammo_number = 0;
+
+ if (sscanf(line, "Ammo %i", &ammo_number) != 1)
+ {
+ DEH_Warning(context, "Parse error on section start");
+ return NULL;
+ }
+
+ if (ammo_number < 0 || ammo_number >= NUMAMMO)
+ {
+ DEH_Warning(context, "Invalid ammo number: %i", ammo_number);
+ return NULL;
+ }
+
+ return &maxammo[ammo_number];
+}
+
+static void DEH_AmmoParseLine(deh_context_t *context, char *line, void *tag)
+{
+ char *variable_name, *value;
+ int ivalue;
+ int ammo_number;
+
+ if (tag == NULL)
+ return;
+
+ ammo_number = ((int *) tag) - maxammo;
+
+ // Parse the assignment
+
+ if (!DEH_ParseAssignment(line, &variable_name, &value))
+ {
+ // Failed to parse
+
+ DEH_Warning(context, "Failed to parse assignment");
+ return;
+ }
+
+ ivalue = atoi(value);
+
+ if (!strcasecmp(variable_name, "Per ammo"))
+ {
+ // Heretic doesn't have a "per clip" ammo array, instead
+ // it is per weapon. However, the weapon number lines
+ // up with the ammo number if we add one.
+
+ GetWeaponAmmo[ammo_number + 1] = ivalue;
+ }
+ else if (!strcasecmp(variable_name, "Max ammo"))
+ {
+ maxammo[ammo_number] = ivalue;
+ }
+ else
+ {
+ DEH_Warning(context, "Field named '%s' not found", variable_name);
+ }
+}
+
+static void DEH_AmmoMD5Hash(md5_context_t *context)
+{
+ int i;
+
+ for (i=0; i<NUMAMMO; ++i)
+ {
+ MD5_UpdateInt32(context, maxammo[i]);
+ }
+
+ for (i=0; i<NUMWEAPONS; ++i)
+ {
+ MD5_UpdateInt32(context, GetWeaponAmmo[i]);
+ }
+}
+
+deh_section_t deh_section_ammo =
+{
+ "Ammo",
+ NULL,
+ DEH_AmmoStart,
+ DEH_AmmoParseLine,
+ NULL,
+ DEH_AmmoMD5Hash,
+};
+
diff --git a/src/heretic/deh_frame.c b/src/heretic/deh_frame.c
new file mode 100644
index 00000000..8623ab0c
--- /dev/null
+++ b/src/heretic/deh_frame.c
@@ -0,0 +1,344 @@
+// Emacs style mode select -*- C++ -*-
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 2005 Simon Howard
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+//
+//-----------------------------------------------------------------------------
+//
+// Parses "Frame" sections in dehacked files
+//
+//-----------------------------------------------------------------------------
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "doomtype.h"
+#include "info.h"
+
+#include "deh_defs.h"
+#include "deh_io.h"
+#include "deh_main.h"
+#include "deh_mapping.h"
+#include "deh_htic.h"
+
+#include "p_action.h"
+
+typedef struct
+{
+ int offsets[deh_hhe_num_versions];
+ void (*func)();
+} hhe_action_pointer_t;
+
+// Offsets of action pointers within the Heretic executables.
+// Different versions have different offsets.
+// (Seriously Greg, was this really necessary? What was wrong with the
+// "copying action pointer from another frame" technique used in dehacked?)
+
+// Offset Action function
+// v1.0 v1.2 v1.3
+
+static const hhe_action_pointer_t action_pointers[] =
+{
+ { { 77680, 80144, 80208 }, A_AccTeleGlitter },
+ { { 78608, 81104, 81168 }, A_AddPlayerCorpse },
+ { { 115808, 118000, 118240 }, A_AddPlayerRain },
+ { { 112272, 114480, 114720 }, A_BeakAttackPL1 },
+ { { 112448, 114656, 114896 }, A_BeakAttackPL2 },
+ { { 111856, 114176, 114416 }, A_BeakRaise },
+ { { 111568, 113888, 114128 }, A_BeakReady },
+ { { 74640, 77120, 77184 }, A_BeastAttack },
+ { { 70480, 72992, 73056 }, A_BeastPuff },
+ { { 73120, 75600, 75664 }, A_BlueSpark },
+ { { 115456, 117648, 117888 }, A_BoltSpark },
+ { { 77344, 79808, 79872 }, A_BossDeath },
+ { { 69328, 71856, 71920 }, A_Chase },
+ { { 0, 80976, 81040 }, A_CheckBurnGone },
+ { { 78480, 80944, 81008 }, A_CheckSkullDone },
+ { { 78448, 80912, 80976 }, A_CheckSkullFloor },
+ { { 71376, 73888, 73952 }, A_ChicAttack },
+ { { 71488, 74000, 74064 }, A_ChicChase },
+ { { 71456, 73968, 74032 }, A_ChicLook },
+ { { 71520, 74032, 74096 }, A_ChicPain },
+ { { 75792, 78208, 78272 }, A_ClinkAttack },
+ { { 108432, 110816, 111056 }, A_ContMobjSound },
+ { { 114752, 116944, 117184 }, A_DeathBallImpact },
+ { { 70016, 72528, 72592 }, A_DripBlood },
+ { { 77472, 79936, 80000 }, A_ESound },
+ { { 76784, 79248, 79312 }, A_Explode },
+ { { 69872, 72400, 72464 }, A_FaceTarget },
+ { { 71568, 74080, 74144 }, A_Feathers },
+ { { 112928, 115136, 115376 }, A_FireBlasterPL1 },
+ { { 113072, 115280, 115520 }, A_FireBlasterPL2 },
+ { { 115232, 117424, 117664 }, A_FireCrossbowPL1 },
+ { { 115312, 117504, 117744 }, A_FireCrossbowPL2 },
+ { { 113152, 115360, 115600 }, A_FireGoldWandPL1 },
+ { { 113296, 115504, 115744 }, A_FireGoldWandPL2 },
+ { { 113760, 115968, 116208 }, A_FireMacePL1 },
+ { { 114624, 116816, 117056 }, A_FireMacePL2 },
+ { { 116368, 118544, 118784 }, A_FirePhoenixPL1 },
+ { { 116736, 118896, 119136 }, A_FirePhoenixPL2 },
+ { { 115568, 117760, 118000 }, A_FireSkullRodPL1 },
+ { { 115648, 117840, 118080 }, A_FireSkullRodPL2 },
+ { { 117120, 119280, 119520 }, A_FlameEnd },
+ { { 78704, 81200, 81264 }, A_FlameSnd },
+ { { 117152, 119312, 119552 }, A_FloatPuff },
+ { { 78512, 81008, 81072 }, A_FreeTargMobj },
+ { { 117184, 119344, 119584 }, A_GauntletAttack },
+ { { 73232, 75712, 75776 }, A_GenWizard },
+ { { 75872, 78304, 78368 }, A_GhostOff },
+ { { 74752, 77232, 77296 }, A_HeadAttack },
+ { { 75488, 77984, 78048 }, A_HeadFireGrow },
+ { { 75328, 77824, 77888 }, A_HeadIceImpact },
+ { { 116336, 118512, 118752 }, A_HideInCeiling },
+ { { 78736, 81232, 81296 }, A_HideThing },
+ { { 70976, 73488, 73552 }, A_ImpDeath },
+ { { 70304, 72816, 72880 }, A_ImpExplode },
+ { { 70592, 73104, 73168 }, A_ImpMeAttack },
+ { { 70672, 73184, 73248 }, A_ImpMsAttack },
+ { { 70880, 73392, 73456 }, A_ImpMsAttack2 },
+ { { 71024, 73536, 73600 }, A_ImpXDeath1 },
+ { { 71072, 73584, 73648 }, A_ImpXDeath2 },
+ { { 77728, 80192, 80256 }, A_InitKeyGizmo },
+ { { 116720, 118880, 119120 }, A_InitPhoenixPL2 },
+ { { 70160, 72672, 72736 }, A_KnightAttack },
+ { { 117648, 119824, 120064 }, A_Light0 },
+ { { 69200, 71728, 71792 }, A_Look },
+ { { 111760, 114080, 114320 }, A_Lower },
+ { { 114032, 116224, 116464 }, A_MaceBallImpact },
+ { { 114192, 116384, 116624 }, A_MaceBallImpact2 },
+ { { 113904, 116112, 116352 }, A_MacePL1Check },
+ { { 77104, 79568, 79632 }, A_MakePod },
+ { { 73648, 76128, 76192 }, A_MinotaurAtk1 },
+ { { 74112, 76592, 76656 }, A_MinotaurAtk2 },
+ { { 74352, 76832, 76896 }, A_MinotaurAtk3 },
+ { { 74032, 76512, 76576 }, A_MinotaurCharge },
+ { { 73760, 76240, 76304 }, A_MinotaurDecide },
+ { { 74528, 77008, 77072 }, A_MntrFloorFire },
+ { { 71808, 74288, 74352 }, A_MummyAttack },
+ { { 71920, 74400, 74464 }, A_MummyAttack2 },
+ { { 72016, 74496, 74560 }, A_MummyFX1Seek },
+ { { 72048, 74528, 74592 }, A_MummySoul },
+ { { 76400, 78832, 78896 }, A_NoBlocking },
+ { { 69984, 72496, 72560 }, A_Pain },
+ { { 116496, 118656, 118896 }, A_PhoenixPuff },
+ { { 76896, 79360, 79424 }, A_PodPain },
+ { { 116272, 118448, 118688 }, A_RainImpact },
+ { { 111920, 114240, 114480 }, A_Raise },
+ { { 111696, 114016, 114256 }, A_ReFire },
+ { { 77056, 79520, 79584 }, A_RemovePod },
+ { { 116480, 0, 0 }, A_RemovedPhoenixFunc },
+ { { 81952, 84464, 84528 }, A_RestoreArtifact },
+ { { 82048, 84544, 84608 }, A_RestoreSpecialThing1 },
+ { { 82128, 84592, 84656 }, A_RestoreSpecialThing2 },
+ { { 76144, 78576, 78640 }, A_Scream },
+ { { 117104, 119264, 119504 }, A_ShutdownPhoenixPL2 },
+ { { 78288, 80752, 80816 }, A_SkullPop },
+ { { 115776, 117968, 118208 }, A_SkullRodPL2Seek },
+ { { 115984, 118176, 118416 }, A_SkullRodStorm },
+ { { 75632, 78048, 78112 }, A_SnakeAttack },
+ { { 75712, 78128, 78192 }, A_SnakeAttack2 },
+ { { 72144, 74624, 74688 }, A_Sor1Chase },
+ { { 72096, 74576, 74640 }, A_Sor1Pain },
+ { { 73392, 75872, 75936 }, A_Sor2DthInit },
+ { { 73424, 75904, 75968 }, A_Sor2DthLoop },
+ { { 73584, 76064, 76128 }, A_SorDBon },
+ { { 73552, 76032, 76096 }, A_SorDExp },
+ { { 73520, 76000, 76064 }, A_SorDSph },
+ { { 73488, 75968, 76032 }, A_SorRise },
+ { { 73616, 76096, 76160 }, A_SorSightSnd },
+ { { 73456, 75936, 76000 }, A_SorZap },
+ { { 72480, 74960, 75024 }, A_SorcererRise },
+ { { 115088, 117280, 117520 }, A_SpawnRippers },
+ { { 77520, 79984, 80048 }, A_SpawnTeleGlitter },
+ { { 77600, 80064, 80128 }, A_SpawnTeleGlitter2 },
+ { { 72192, 74672, 74736 }, A_Srcr1Attack },
+ { { 72896, 75376, 75440 }, A_Srcr2Attack },
+ { { 72816, 75296, 75360 }, A_Srcr2Decide },
+ { { 112640, 114848, 115088 }, A_StaffAttackPL1 },
+ { { 112784, 114992, 115232 }, A_StaffAttackPL2 },
+ { { 78752, 81248, 81312 }, A_UnHideThing },
+ { { 78080, 80544, 80608 }, A_VolcBallImpact },
+ { { 77856, 80320, 80384 }, A_VolcanoBlast },
+ { { 77824, 80288, 80352 }, A_VolcanoSet },
+ { { 111168, 113488, 113728 }, A_WeaponReady },
+ { { 75168, 77664, 77728 }, A_WhirlwindSeek },
+ { { 75888, 78320, 78384 }, A_WizAtk1 },
+ { { 75920, 78352, 78416 }, A_WizAtk2 },
+ { { 75952, 78384, 78448 }, A_WizAtk3 },
+};
+
+DEH_BEGIN_MAPPING(state_mapping, state_t)
+ DEH_MAPPING("Sprite number", sprite)
+ DEH_MAPPING("Sprite subnumber", frame)
+ DEH_MAPPING("Duration", tics)
+ DEH_MAPPING("Next frame", nextstate)
+ DEH_MAPPING("Unknown 1", misc1)
+ DEH_MAPPING("Unknown 2", misc2)
+DEH_END_MAPPING
+
+static void DEH_FrameInit(void)
+{
+ // Bit of a hack here:
+ DEH_HereticInit();
+}
+
+static void *DEH_FrameStart(deh_context_t *context, char *line)
+{
+ int frame_number = 0;
+ int mapped_frame_number;
+ state_t *state;
+
+ if (sscanf(line, "Frame %i", &frame_number) != 1)
+ {
+ DEH_Warning(context, "Parse error on section start");
+ return NULL;
+ }
+
+ // Map the HHE frame number (which assumes a Heretic 1.0 state table)
+ // to the internal frame number (which is is the Heretic 1.3 state table):
+
+ mapped_frame_number = DEH_MapHereticFrameNumber(frame_number);
+
+ if (mapped_frame_number < 0 || mapped_frame_number >= DEH_HERETIC_NUMSTATES)
+ {
+ DEH_Warning(context, "Invalid frame number: %i", frame_number);
+ return NULL;
+ }
+
+ state = &states[mapped_frame_number];
+
+ return state;
+}
+
+static boolean GetActionPointerForOffset(int offset, void **result)
+{
+ int i;
+
+ // Special case.
+
+ if (offset == 0)
+ {
+ *result = NULL;
+ return true;
+ }
+
+ for (i=0; i<arrlen(action_pointers); ++i)
+ {
+ if (action_pointers[i].offsets[deh_hhe_version] == offset)
+ {
+ *result = action_pointers[i].func;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// If an invalid action pointer is specified, the patch may be for a
+// different version from the version we are currently set to. Try to
+// suggest a different version to use.
+
+static void SuggestOtherVersions(unsigned int offset)
+{
+ unsigned int i, v;
+
+ for (i=0; i<arrlen(action_pointers); ++i)
+ {
+ for (v=0; v<deh_hhe_num_versions; ++v)
+ {
+ if (action_pointers[i].offsets[v] == offset)
+ {
+ DEH_SuggestHereticVersion(v);
+ }
+ }
+ }
+}
+
+static void DEH_FrameParseLine(deh_context_t *context, char *line, void *tag)
+{
+ state_t *state;
+ char *variable_name, *value;
+ int ivalue;
+
+ if (tag == NULL)
+ return;
+
+ state = (state_t *) tag;
+
+ // Parse the assignment
+
+ if (!DEH_ParseAssignment(line, &variable_name, &value))
+ {
+ // Failed to parse
+
+ DEH_Warning(context, "Failed to parse assignment");
+ return;
+ }
+
+ // all values are integers
+
+ ivalue = atoi(value);
+
+ // Action pointer field is a special case:
+
+ if (!strcasecmp(variable_name, "Action pointer"))
+ {
+ void *func;
+
+ if (!GetActionPointerForOffset(ivalue, &func))
+ {
+ SuggestOtherVersions(ivalue);
+ DEH_Error(context, "Unknown action pointer: %i", ivalue);
+ return;
+ }
+
+ state->action = func;
+ }
+ else
+ {
+ // "Next frame" numbers need to undergo mapping.
+
+ if (!strcasecmp(variable_name, "Next frame"))
+ {
+ ivalue = DEH_MapHereticFrameNumber(ivalue);
+ }
+
+ DEH_SetMapping(context, &state_mapping, state, variable_name, ivalue);
+ }
+}
+
+static void DEH_FrameMD5Sum(md5_context_t *context)
+{
+ int i;
+
+ for (i=0; i<NUMSTATES; ++i)
+ {
+ DEH_StructMD5Sum(context, &state_mapping, &states[i]);
+ }
+}
+
+deh_section_t deh_section_frame =
+{
+ "Frame",
+ DEH_FrameInit,
+ DEH_FrameStart,
+ DEH_FrameParseLine,
+ NULL,
+ DEH_FrameMD5Sum,
+};
+
diff --git a/src/heretic/deh_htext.c b/src/heretic/deh_htext.c
new file mode 100644
index 00000000..5dfddac3
--- /dev/null
+++ b/src/heretic/deh_htext.c
@@ -0,0 +1,856 @@
+// Emacs style mode select -*- C++ -*-
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 2005-2010 Simon Howard
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+//
+//-----------------------------------------------------------------------------
+//
+// Parses Text substitution sections in dehacked files
+//
+//-----------------------------------------------------------------------------
+
+#include <stdio.h>
+#include <string.h>
+
+#include "doomtype.h"
+#include "dstrings.h"
+
+#include "z_zone.h"
+
+#include "deh_defs.h"
+#include "deh_io.h"
+#include "deh_htic.h"
+#include "deh_main.h"
+
+//
+// Ok, Greg, the action pointers thing was bad enough, but this really
+// takes the biscuit. Why does HHE's text replacement address strings
+// by offset??!! The dehacked way was much nicer, why change it?
+//
+
+typedef struct
+{
+ unsigned int offsets[deh_hhe_num_versions];
+ char *string;
+} hhe_string_t;
+
+// Offsets String
+// v1.0 v1.2 v1.3
+
+static const hhe_string_t strings[] =
+{
+ { { 228, 228, 228 }, "PLAYPAL" },
+ { { 1240, 1252, 1252 }, "E1M1: THE DOCKS" },
+ { { 1260, 1272, 1272 }, "E1M2: THE DUNGEONS" },
+ { { 1280, 1292, 1292 }, "E1M3: THE GATEHOUSE" },
+ { { 1304, 1316, 1316 }, "E1M4: THE GUARD TOWER" },
+ { { 1328, 1340, 1340 }, "E1M5: THE CITADEL" },
+ { { 1348, 1360, 1360 }, "E1M6: THE CATHEDRAL" },
+ { { 1372, 1384, 1384 }, "E1M7: THE CRYPTS" },
+ { { 1392, 1404, 1404 }, "E1M8: HELL'S MAW" },
+ { { 1412, 1424, 1424 }, "E1M9: THE GRAVEYARD" },
+ { { 1436, 1448, 1448 }, "E2M1: THE CRATER" },
+ { { 1456, 1468, 1468 }, "E2M2: THE LAVA PITS" },
+ { { 1480, 1492, 1492 }, "E2M3: THE RIVER OF FIRE" },
+ { { 1508, 1520, 1520 }, "E2M4: THE ICE GROTTO" },
+ { { 1532, 1544, 1544 }, "E2M5: THE CATACOMBS" },
+ { { 1556, 1568, 1568 }, "E2M6: THE LABYRINTH" },
+ { { 1580, 1592, 1592 }, "E2M7: THE GREAT HALL" },
+ { { 1604, 1616, 1616 }, "E2M8: THE PORTALS OF CHAOS" },
+ { { 1632, 1644, 1644 }, "E2M9: THE GLACIER" },
+ { { 1652, 1664, 1664 }, "E3M1: THE STOREHOUSE" },
+ { { 1676, 1688, 1688 }, "E3M2: THE CESSPOOL" },
+ { { 1696, 1708, 1708 }, "E3M3: THE CONFLUENCE" },
+ { { 1720, 1732, 1732 }, "E3M4: THE AZURE FORTRESS" },
+ { { 1748, 1760, 1760 }, "E3M5: THE OPHIDIAN LAIR" },
+ { { 1776, 1788, 1788 }, "E3M6: THE HALLS OF FEAR" },
+ { { 1804, 1816, 1816 }, "E3M7: THE CHASM" },
+ { { 1824, 1836, 1836 }, "E3M8: D'SPARIL'S KEEP" },
+ { { 1848, 1860, 1860 }, "E3M9: THE AQUIFER" },
+ { { 0, 1880, 1880 }, "E4M1: CATAFALQUE" },
+ { { 0, 1900, 1900 }, "E4M2: BLOCKHOUSE" },
+ { { 0, 1920, 1920 }, "E4M3: AMBULATORY" },
+ { { 0, 1940, 1940 }, "E4M4: SEPULCHER" },
+ { { 0, 1960, 1960 }, "E4M5: GREAT STAIR" },
+ { { 0, 1980, 1980 }, "E4M6: HALLS OF THE APOSTATE" },
+ { { 0, 2012, 2012 }, "E4M7: RAMPARTS OF PERDITION" },
+ { { 0, 2044, 2044 }, "E4M8: SHATTERED BRIDGE" },
+ { { 0, 2068, 2068 }, "E4M9: MAUSOLEUM" },
+ { { 0, 2088, 2088 }, "E5M1: OCHRE CLIFFS" },
+ { { 0, 2108, 2108 }, "E5M2: RAPIDS" },
+ { { 0, 2124, 2124 }, "E5M3: QUAY" },
+ { { 0, 2136, 2136 }, "E5M4: COURTYARD" },
+ { { 0, 2156, 2156 }, "E5M5: HYDRATYR" },
+ { { 0, 2172, 2172 }, "E5M6: COLONNADE" },
+ { { 0, 2192, 2192 }, "E5M7: FOETID MANSE" },
+ { { 0, 2212, 2212 }, "E5M8: FIELD OF JUDGEMENT" },
+ { { 0, 2240, 2240 }, "E5M9: SKEIN OF D'SPARIL" },
+ { { 1868, 2268, 2268 }, "AUTOPAGE" },
+ { { 1880, 2280, 2280 }, "FOLLOW MODE ON" },
+ { { 1896, 2296, 2296 }, "FOLLOW MODE OFF" },
+ { { 1924, 2324, 2324 }, "GREEN: " },
+ { { 1936, 2336, 2336 }, "YELLOW: " },
+ { { 1948, 2348, 2348 }, "RED: " },
+ { { 1956, 2356, 2356 }, "BLUE: " },
+ { { 1964, 2364, 2364 }, "FONTA_S" },
+ { { 1972, 2372, 2372 }, "-MESSAGE SENT-" },
+ { { 1988, 2388, 2388 }, "THERE ARE NO OTHER PLAYERS IN THE GAME!" },
+ { { 2028, 2428, 2428 }, "FONTA59" },
+ { { 2036, 2504, 2504 }, "PAUSED" },
+ { { 2072, 2540, 2540 }, "ADVISOR" },
+ { { 2080, 2548, 2548 }, "TITLE" },
+ { { 2088, 2556, 2556 }, "demo1" },
+ { { 2096, 2564, 2564 }, "CREDIT" },
+ { { 2104, 2572, 2572 }, "demo2" },
+ { { 2112, 2580, 2580 }, "ORDER" },
+ { { 2120, 2588, 2588 }, "demo3" },
+ { { 2304, 2696, 2696 }, "Exited from HERETIC.\n" },
+ { { 2412, 2800, 2800 }, "c:\\heretic.cd" },
+ { { 2528, 2916, 2916 }, "Playing demo %s.lmp.\n" },
+ { { 2592, 2980, 2980 }, "V_Init: allocate screens.\n" },
+ { { 2620, 3008, 3008 }, "M_LoadDefaults: Load system defaults.\n" },
+ { { 2660, 3048, 3048 }, "Z_Init: Init zone memory allocation daemon.\n" },
+ { { 2708, 3096, 3096 }, "W_Init: Init WADfiles.\n" },
+ { { 2732, 3120, 3120 }, "E2M1" },
+ { { 0, 3128, 3128 }, "EXTENDED" },
+ { { 2740, 3140, 3140 }, "LOADING" },
+ { { 2748, 3148, 3148 }, "DeathMatch..." },
+ { { 2764, 3164, 3164 }, "No Monsters..." },
+ { { 2780, 3180, 3180 }, "Respawning..." },
+ { { 2796, 3196, 3196 }, "Warp to Episode %d, Map %d, Skill %d " },
+ { { 2836, 3236, 3236 }, "MN_Init: Init menu system.\n" },
+ { { 2864, 3264, 3264 }, "R_Init: Init Heretic refresh daemon." },
+ { { 2904, 3304, 3304 }, "Loading graphics" },
+ { { 2924, 3324, 3324 }, "P_Init: Init Playloop state." },
+ { { 2956, 3356, 3356 }, "Init game engine." },
+ { { 2976, 3376, 3376 }, "I_Init: Setting up machine state.\n" },
+ { { 3012, 3412, 3412 }, "D_CheckNetGame: Checking network game status.\n" },
+ { { 3060, 3460, 3460 }, "Checking network game status." },
+ { { 3092, 3492, 3492 }, "SB_Init: Loading patches.\n" },
+ { { 0, 3752, 3752 }, "PLAYER 1 LEFT THE GAME" },
+ { { 3508, 3932, 3932 }, "Network game synchronization aborted." },
+ { { 0, 3972, 3972 }, "Different DOOM versions cannot play a net game!" },
+ { { 3908, 4132, 4132 }, "SKY1" },
+ { { 3916, 4140, 4140 }, "SKY2" },
+ { { 3924, 4148, 4148 }, "SKY3" },
+ { { 3736, 4196, 4196 }, "NET GAME" },
+ { { 3748, 4208, 4208 }, "SAVE GAME" },
+ { { 3760, 4220, 4220 }, "Only %i deathmatch spots, 4 required" },
+ { { 3800, 4260, 4260 }, "version %i" },
+ { { 3828, 4372, 4372 }, "c:\\heretic.cd\\hticsav%d.hsg" },
+ { { 3856, 4400, 4400 }, "hticsav%d.hsg" },
+ { { 3896, 4416, 4416 }, "GAME SAVED" },
+ { { 4016, 4456, 4456 }, E1TEXT },
+ { { 4536, 4976, 4976 }, E2TEXT },
+ { { 5068, 5508, 5508 }, E3TEXT },
+ { { 0, 6072, 6072 }, E4TEXT },
+ { { 0, 6780, 6780 }, E5TEXT },
+ { { 5632, 7468, 7468 }, "FLOOR25" },
+ { { 5640, 7476, 7476 }, "FLATHUH1" },
+ { { 5652, 7488, 7488 }, "FLTWAWA2" },
+ { { 0, 7500, 7500 }, "FLOOR28" },
+ { { 0, 7508, 7508 }, "FLOOR08" },
+ { { 5664, 7516, 7516 }, "FONTA_S" },
+ { { 5704, 7524, 7524 }, "PLAYPAL" },
+ { { 5672, 7532, 7532 }, "FINAL1" },
+ { { 5680, 7540, 7540 }, "FINAL2" },
+ { { 5688, 7548, 7548 }, "E2PAL" },
+ { { 5696, 7556, 7556 }, "E2END" },
+ { { 7884, 7564, 7564 }, "TITLE" },
+ { { 5712, 7572, 7572 }, "ORDER" },
+ { { 0, 7580, 7580 }, "CREDIT" },
+ { { 5720, 7588, 7588 }, "IMPX" },
+ { { 5728, 7596, 7596 }, "ACLO" },
+ { { 5736, 7604, 7604 }, "PTN1" },
+ { { 5744, 7612, 7612 }, "SHLD" },
+ { { 5752, 7620, 7620 }, "SHD2" },
+ { { 5760, 7628, 7628 }, "BAGH" },
+ { { 5768, 7636, 7636 }, "SPMP" },
+ { { 5776, 7644, 7644 }, "INVS" },
+ { { 5784, 7652, 7652 }, "PTN2" },
+ { { 5792, 7660, 7660 }, "SOAR" },
+ { { 5800, 7668, 7668 }, "INVU" },
+ { { 5808, 7676, 7676 }, "PWBK" },
+ { { 5816, 7684, 7684 }, "EGGC" },
+ { { 5824, 7692, 7692 }, "EGGM" },
+ { { 5832, 7700, 7700 }, "FX01" },
+ { { 5840, 7708, 7708 }, "SPHL" },
+ { { 5848, 7716, 7716 }, "TRCH" },
+ { { 5856, 7724, 7724 }, "FBMB" },
+ { { 5864, 7732, 7732 }, "XPL1" },
+ { { 5872, 7740, 7740 }, "ATLP" },
+ { { 5880, 7748, 7748 }, "PPOD" },
+ { { 5888, 7756, 7756 }, "AMG1" },
+ { { 5896, 7764, 7764 }, "SPSH" },
+ { { 5904, 7772, 7772 }, "LVAS" },
+ { { 5912, 7780, 7780 }, "SLDG" },
+ { { 5920, 7788, 7788 }, "SKH1" },
+ { { 5928, 7796, 7796 }, "SKH2" },
+ { { 5936, 7804, 7804 }, "SKH3" },
+ { { 5944, 7812, 7812 }, "SKH4" },
+ { { 5952, 7820, 7820 }, "CHDL" },
+ { { 5960, 7828, 7828 }, "SRTC" },
+ { { 5968, 7836, 7836 }, "SMPL" },
+ { { 5976, 7844, 7844 }, "STGS" },
+ { { 5984, 7852, 7852 }, "STGL" },
+ { { 5992, 7860, 7860 }, "STCS" },
+ { { 6000, 7868, 7868 }, "STCL" },
+ { { 6008, 7876, 7876 }, "KFR1" },
+ { { 6016, 7884, 7884 }, "BARL" },
+ { { 6024, 7892, 7892 }, "BRPL" },
+ { { 6032, 7900, 7900 }, "MOS1" },
+ { { 6040, 7908, 7908 }, "MOS2" },
+ { { 6048, 7916, 7916 }, "WTRH" },
+ { { 6056, 7924, 7924 }, "HCOR" },
+ { { 6064, 7932, 7932 }, "KGZ1" },
+ { { 6072, 7940, 7940 }, "KGZB" },
+ { { 6080, 7948, 7948 }, "KGZG" },
+ { { 6088, 7956, 7956 }, "KGZY" },
+ { { 6096, 7964, 7964 }, "VLCO" },
+ { { 6104, 7972, 7972 }, "VFBL" },
+ { { 6112, 7980, 7980 }, "VTFB" },
+ { { 6120, 7988, 7988 }, "SFFI" },
+ { { 6128, 7996, 7996 }, "TGLT" },
+ { { 6136, 8004, 8004 }, "TELE" },
+ { { 6144, 8012, 8012 }, "STFF" },
+ { { 6152, 8020, 8020 }, "PUF3" },
+ { { 6160, 8028, 8028 }, "PUF4" },
+ { { 6168, 8036, 8036 }, "BEAK" },
+ { { 6176, 8044, 8044 }, "WGNT" },
+ { { 6184, 8052, 8052 }, "GAUN" },
+ { { 6192, 8060, 8060 }, "PUF1" },
+ { { 6200, 8068, 8068 }, "WBLS" },
+ { { 6208, 8076, 8076 }, "BLSR" },
+ { { 6216, 8084, 8084 }, "FX18" },
+ { { 6224, 8092, 8092 }, "FX17" },
+ { { 6232, 8100, 8100 }, "WMCE" },
+ { { 6240, 8108, 8108 }, "MACE" },
+ { { 6248, 8116, 8116 }, "FX02" },
+ { { 6256, 8124, 8124 }, "WSKL" },
+ { { 6264, 8132, 8132 }, "HROD" },
+ { { 6272, 8140, 8140 }, "FX00" },
+ { { 6280, 8148, 8148 }, "FX20" },
+ { { 6288, 8156, 8156 }, "FX21" },
+ { { 6296, 8164, 8164 }, "FX22" },
+ { { 6304, 8172, 8172 }, "FX23" },
+ { { 6312, 8180, 8180 }, "GWND" },
+ { { 6320, 8188, 8188 }, "PUF2" },
+ { { 6328, 8196, 8196 }, "WPHX" },
+ { { 6336, 8204, 8204 }, "PHNX" },
+ { { 6344, 8212, 8212 }, "FX04" },
+ { { 6352, 8220, 8220 }, "FX08" },
+ { { 6360, 8228, 8228 }, "FX09" },
+ { { 6368, 8236, 8236 }, "WBOW" },
+ { { 6376, 8244, 8244 }, "CRBW" },
+ { { 6384, 8252, 8252 }, "FX03" },
+ { { 6392, 8260, 8260 }, "BLOD" },
+ { { 6400, 8268, 8268 }, "PLAY" },
+ { { 6408, 8276, 8276 }, "FDTH" },
+ { { 6416, 8284, 8284 }, "BSKL" },
+ { { 6424, 8292, 8292 }, "CHKN" },
+ { { 6432, 8300, 8300 }, "MUMM" },
+ { { 6440, 8308, 8308 }, "FX15" },
+ { { 6448, 8316, 8316 }, "BEAS" },
+ { { 6456, 8324, 8324 }, "FRB1" },
+ { { 6464, 8332, 8332 }, "SNKE" },
+ { { 6472, 8340, 8340 }, "SNFX" },
+ { { 6480, 8348, 8348 }, "HEAD" },
+ { { 6488, 8356, 8356 }, "FX05" },
+ { { 6496, 8364, 8364 }, "FX06" },
+ { { 6504, 8372, 8372 }, "FX07" },
+ { { 6512, 8380, 8380 }, "CLNK" },
+ { { 6520, 8388, 8388 }, "WZRD" },
+ { { 6528, 8396, 8396 }, "FX11" },
+ { { 6536, 8404, 8404 }, "FX10" },
+ { { 6544, 8412, 8412 }, "KNIG" },
+ { { 6552, 8420, 8420 }, "SPAX" },
+ { { 6560, 8428, 8428 }, "RAXE" },
+ { { 6568, 8436, 8436 }, "SRCR" },
+ { { 6576, 8444, 8444 }, "FX14" },
+ { { 6584, 8452, 8452 }, "SOR2" },
+ { { 6592, 8460, 8460 }, "SDTH" },
+ { { 6600, 8468, 8468 }, "FX16" },
+ { { 6608, 8476, 8476 }, "MNTR" },
+ { { 6616, 8484, 8484 }, "FX12" },
+ { { 6624, 8492, 8492 }, "FX13" },
+ { { 6632, 8500, 8500 }, "AKYY" },
+ { { 6640, 8508, 8508 }, "BKYY" },
+ { { 6648, 8516, 8516 }, "CKYY" },
+ { { 6656, 8524, 8524 }, "AMG2" },
+ { { 6664, 8532, 8532 }, "AMM1" },
+ { { 6672, 8540, 8540 }, "AMM2" },
+ { { 6680, 8548, 8548 }, "AMC1" },
+ { { 6688, 8556, 8556 }, "AMC2" },
+ { { 6696, 8564, 8564 }, "AMS1" },
+ { { 6704, 8572, 8572 }, "AMS2" },
+ { { 6712, 8580, 8580 }, "AMP1" },
+ { { 6720, 8588, 8588 }, "AMP2" },
+ { { 6728, 8596, 8596 }, "AMB1" },
+ { { 6736, 8604, 8604 }, "AMB2" },
+ { { 6744, 8612, 8612 }, "K" },
+ { { 6748, 8616, 8616 }, "I" },
+ { { 6752, 8620, 8620 }, "L" },
+ { { 6756, 8624, 8624 }, "E" },
+ { { 6760, 8628, 8628 }, "R" },
+ { { 6764, 8632, 8632 }, "S" },
+ { { 6768, 8636, 8636 }, "PLAYPAL" },
+ { { 6776, 8644, 8644 }, "MAPE1" },
+ { { 6784, 8652, 8652 }, "MAPE2" },
+ { { 6792, 8660, 8660 }, "MAPE3" },
+ { { 6800, 8668, 8668 }, "IN_X" },
+ { { 6808, 8676, 8676 }, "IN_YAH" },
+ { { 6816, 8684, 8684 }, "FONTB16" },
+ { { 6824, 8692, 8692 }, "FONTB_S" },
+ { { 6832, 8700, 8700 }, "FONTB13" },
+ { { 6840, 8708, 8708 }, "FONTB15" },
+ { { 6848, 8716, 8716 }, "FONTB05" },
+ { { 6856, 8724, 8724 }, "FACEA0" },
+ { { 6864, 8732, 8732 }, "FACEB0" },
+ { { 6940, 8808, 8808 }, "FLOOR16" },
+ { { 6948, 8816, 8816 }, "FINISHED" },
+ { { 6960, 8828, 8828 }, "NOW ENTERING:" },
+ { { 6976, 8844, 8844 }, "KILLS" },
+ { { 6984, 8852, 8852 }, "ITEMS" },
+ { { 6992, 8860, 8860 }, "SECRETS" },
+ { { 7000, 8868, 8868 }, "TIME" },
+ { { 7008, 8876, 8876 }, "BONUS" },
+ { { 7016, 8884, 8884 }, "SECRET" },
+ { { 7024, 8892, 8892 }, "TOTAL" },
+ { { 7032, 8900, 8900 }, "VICTIMS" },
+ { { 7040, 8908, 8908 }, ":" },
+ { { 7044, 8912, 8912 }, "NEW GAME" },
+ { { 7056, 8924, 8924 }, "OPTIONS" },
+ { { 7064, 8932, 8932 }, "GAME FILES" },
+ { { 7076, 8944, 8944 }, "INFO" },
+ { { 7084, 8952, 8952 }, "QUIT GAME" },
+ { { 7096, 8964, 8964 }, "CITY OF THE DAMNED" },
+ { { 7116, 8984, 8984 }, "HELL'S MAW" },
+ { { 7128, 8996, 8996 }, "THE DOME OF D'SPARIL" },
+ { { 0, 9020, 9020 }, "THE OSSUARY" },
+ { { 0, 9032, 9032 }, "THE STAGNANT DEMESNE" },
+ { { 7152, 9056, 9056 }, "LOAD GAME" },
+ { { 7164, 9068, 9068 }, "SAVE GAME" },
+ { { 7176, 9080, 9080 }, "THOU NEEDETH A WET-NURSE" },
+ { { 7204, 9108, 9108 }, "YELLOWBELLIES-R-US" },
+ { { 7224, 9128, 9128 }, "BRINGEST THEM ONETH" },
+ { { 7244, 9148, 9148 }, "THOU ART A SMITE-MEISTER" },
+ { { 7272, 9176, 9176 }, "BLACK PLAGUE POSSESSES THEE" },
+ { { 7300, 9204, 9204 }, "END GAME" },
+ { { 7312, 9216, 9216 }, "MESSAGES : " },
+ { { 7324, 9228, 9228 }, "MOUSE SENSITIVITY" },
+ { { 7344, 9248, 9248 }, "MORE..." },
+ { { 7352, 9256, 9256 }, "SCREEN SIZE" },
+ { { 7364, 9268, 9268 }, "SFX VOLUME" },
+ { { 7376, 9280, 9280 }, "MUSIC VOLUME" },
+ { { 7416, 9296, 9296 }, "ARE YOU SURE YOU WANT TO QUIT?" },
+ { { 7448, 9328, 9328 }, "ARE YOU SURE YOU WANT TO END THE GAME?" },
+ { { 7488, 9368, 9368 }, "DO YOU WANT TO QUICKSAVE THE GAME NAMED" },
+ { { 7528, 9408, 9408 }, "DO YOU WANT TO QUICKLOAD THE GAME NAMED" },
+ { { 7392, 9448, 9448 }, "M_SKL00" },
+ { { 7400, 9456, 9456 }, "FONTA_S" },
+ { { 7408, 9464, 9464 }, "FONTB_S" },
+ { { 7568, 9472, 9472 }, "?" },
+ { { 7572, 9476, 9476 }, "M_SLCTR1" },
+ { { 7584, 9488, 9488 }, "M_SLCTR2" },
+ { { 7596, 9500, 9500 }, "M_HTIC" },
+ { { 7604, 9508, 9508 }, "c:\\heretic.cd\\hticsav%d.hsg" },
+ { { 7632, 9536, 9536 }, "hticsav%d.hsg" },
+ { { 7652, 9556, 9556 }, "M_FSLOT" },
+ { { 7660, 9564, 9564 }, "ON" },
+ { { 7664, 9568, 9568 }, "OFF" },
+ { { 0, 9572, 9572 }, "YOU CAN'T START A NEW GAME IN NETPLAY!" },
+ { { 0, 9612, 9612 }, "YOU CAN'T LOAD A GAME IN NETPLAY!" },
+ { { 7668, 9648, 9648 }, "MESSAGES ON" },
+ { { 7680, 9660, 9660 }, "MESSAGES OFF" },
+ { { 7748, 9676, 9676 }, "ONLY AVAILABLE IN THE REGISTERED VERSION" },
+ { { 7792, 9720, 9720 }, "PLAYPAL" },
+ { { 7800, 9728, 9728 }, "QUICKSAVING...." },
+ { { 7816, 9744, 9744 }, "QUICKLOADING...." },
+ { { 7836, 9764, 9764 }, "CHOOSE A QUICKSAVE SLOT" },
+ { { 7860, 9788, 9788 }, "CHOOSE A QUICKLOAD SLOT" },
+ { { 0, 9812, 9812 }, "TITLE" },
+ { { 7892, 9820, 9820 }, "M_SLDLT" },
+ { { 7900, 9828, 9828 }, "M_SLDMD1" },
+ { { 7912, 9840, 9840 }, "M_SLDMD2" },
+ { { 7924, 9852, 9852 }, "M_SLDRT" },
+ { { 7932, 9860, 9860 }, "M_SLDKB" },
+ { { 9016, 10944, 10944 }, "SCREEN SHOT" },
+ { { 9028, 10956, 10956 }, "YOU NEED A BLUE KEY TO OPEN THIS DOOR" },
+ { { 9068, 10996, 10996 }, "YOU NEED A YELLOW KEY TO OPEN THIS DOOR" },
+ { { 9108, 11036, 11036 }, "YOU NEED A GREEN KEY TO OPEN THIS DOOR" },
+ { { 9244, 11172, 11172 }, "CRYSTAL VIAL" },
+ { { 9260, 11188, 11188 }, "SILVER SHIELD" },
+ { { 9276, 11204, 11204 }, "ENCHANTED SHIELD" },
+ { { 9296, 11224, 11224 }, "BAG OF HOLDING" },
+ { { 9312, 11240, 11240 }, "MAP SCROLL" },
+ { { 9324, 11252, 11252 }, "BLUE KEY" },
+ { { 9336, 11264, 11264 }, "YELLOW KEY" },
+ { { 9348, 11276, 11276 }, "GREEN KEY" },
+ { { 9360, 11288, 11288 }, "QUARTZ FLASK" },
+ { { 9376, 11304, 11304 }, "WINGS OF WRATH" },
+ { { 9392, 11320, 11320 }, "RING OF INVINCIBILITY" },
+ { { 9416, 11344, 11344 }, "TOME OF POWER" },
+ { { 9432, 11360, 11360 }, "SHADOWSPHERE" },
+ { { 9448, 11376, 11376 }, "MORPH OVUM" },
+ { { 9460, 11388, 11388 }, "MYSTIC URN" },
+ { { 9472, 11400, 11400 }, "TORCH" },
+ { { 9480, 11408, 11408 }, "TIME BOMB OF THE ANCIENTS" },
+ { { 9508, 11436, 11436 }, "CHAOS DEVICE" },
+ { { 9524, 11452, 11452 }, "WAND CRYSTAL" },
+ { { 9540, 11468, 11468 }, "CRYSTAL GEODE" },
+ { { 9556, 11484, 11484 }, "MACE SPHERES" },
+ { { 9572, 11500, 11500 }, "PILE OF MACE SPHERES" },
+ { { 9596, 11524, 11524 }, "ETHEREAL ARROWS" },
+ { { 9612, 11540, 11540 }, "QUIVER OF ETHEREAL ARROWS" },
+ { { 9640, 11568, 11568 }, "CLAW ORB" },
+ { { 9652, 11580, 11580 }, "ENERGY ORB" },
+ { { 9664, 11592, 11592 }, "LESSER RUNES" },
+ { { 9680, 11608, 11608 }, "GREATER RUNES" },
+ { { 9696, 11624, 11624 }, "FLAME ORB" },
+ { { 9708, 11636, 11636 }, "INFERNO ORB" },
+ { { 9720, 11648, 11648 }, "FIREMACE" },
+ { { 9732, 11660, 11660 }, "ETHEREAL CROSSBOW" },
+ { { 9752, 11680, 11680 }, "DRAGON CLAW" },
+ { { 9764, 11692, 11692 }, "HELLSTAFF" },
+ { { 9776, 11704, 11704 }, "PHOENIX ROD" },
+ { { 9788, 11716, 11716 }, "GAUNTLETS OF THE NECROMANCER" },
+ { { 10088, 12016, 12016 }, "FLTWAWA1" },
+ { { 10100, 12028, 12028 }, "FLTFLWW1" },
+ { { 10112, 12040, 12040 }, "FLTLAVA1" },
+ { { 10124, 12052, 12052 }, "FLATHUH1" },
+ { { 10136, 12064, 12064 }, "FLTSLUD1" },
+ { { 10148, 12076, 12076 }, "END" },
+ { { 10236, 12164, 12164 }, "texture2" },
+ { { 10444, 12372, 12372 }, "PLAYPAL" },
+ { { 10596, 12488, 12488 }, "PNAMES" },
+ { { 10604, 12496, 12496 }, "TEXTURE1" },
+ { { 10616, 12508, 12508 }, "TEXTURE2" },
+ { { 10628, 12520, 12520 }, "S_END" },
+ { { 10636, 12528, 12528 }, "S_START" },
+ { { 10728, 12620, 12620 }, "F_START" },
+ { { 10736, 12628, 12628 }, "F_END" },
+ { { 10744, 12636, 12636 }, "COLORMAP" },
+ { { 10756, 12648, 12648 }, "\nR_InitTextures " },
+ { { 10776, 12668, 12668 }, "R_InitFlats\n" },
+ { { 10792, 12684, 12684 }, "R_InitSpriteLumps " },
+ { { 10948, 12772, 12772 }, "TINTTAB" },
+ { { 10984, 12780, 12780 }, "FLOOR04" },
+ { { 10992, 12788, 12788 }, "FLAT513" },
+ { { 11000, 12796, 12796 }, "bordt" },
+ { { 11008, 12804, 12804 }, "bordb" },
+ { { 11016, 12812, 12812 }, "bordl" },
+ { { 11024, 12820, 12820 }, "bordr" },
+ { { 11032, 12828, 12828 }, "bordtl" },
+ { { 11040, 12836, 12836 }, "bordtr" },
+ { { 11048, 12844, 12844 }, "bordbr" },
+ { { 11056, 12852, 12852 }, "bordbl" },
+ { { 11064, 12860, 12860 }, "R_InitData " },
+ { { 11076, 12872, 12872 }, "R_InitPointToAngle\n" },
+ { { 11096, 12892, 12892 }, "R_InitTables " },
+ { { 11112, 12908, 12908 }, "R_InitPlanes\n" },
+ { { 11128, 12924, 12924 }, "R_InitLightTables " },
+ { { 11148, 12944, 12944 }, "R_InitSkyMap\n" },
+ { { 11164, 12960, 12960 }, "F_SKY1" },
+ { { 12120, 13484, 13484 }, "LTFACE" },
+ { { 12128, 13492, 13492 }, "RTFACE" },
+ { { 12136, 13500, 13500 }, "BARBACK" },
+ { { 12144, 13508, 13508 }, "INVBAR" },
+ { { 12152, 13516, 13516 }, "CHAIN" },
+ { { 12160, 13524, 13524 }, "STATBAR" },
+ { { 12168, 13532, 13532 }, "LIFEBAR" },
+ { { 12176, 13540, 13540 }, "LIFEGEM2" },
+ { { 12188, 13552, 13552 }, "LIFEGEM0" },
+ { { 12200, 13564, 13564 }, "LTFCTOP" },
+ { { 12208, 13572, 13572 }, "RTFCTOP" },
+ { { 12224, 13580, 13580 }, "SELECTBOX" },
+ { { 12236, 13592, 13592 }, "INVGEML1" },
+ { { 12248, 13604, 13604 }, "INVGEML2" },
+ { { 12260, 13616, 13616 }, "INVGEMR1" },
+ { { 12272, 13628, 13628 }, "INVGEMR2" },
+ { { 12284, 13640, 13640 }, "BLACKSQ" },
+ { { 12292, 13648, 13648 }, "ARMCLEAR" },
+ { { 12304, 13660, 13660 }, "CHAINBACK" },
+ { { 12316, 13672, 13672 }, "IN0" },
+ { { 12320, 13676, 13676 }, "NEGNUM" },
+ { { 12328, 13684, 13684 }, "FONTB16" },
+ { { 12336, 13692, 13692 }, "SMALLIN0" },
+ { { 12348, 13704, 13704 }, "PLAYPAL" },
+ { { 12356, 13712, 13712 }, "SPINBK0" },
+ { { 12364, 13720, 13720 }, "SPFLY0" },
+ { { 12372, 13728, 13728 }, "LAME" },
+ { { 12380, 13736, 13736 }, "*** SOUND DEBUG INFO ***" },
+ { { 12408, 13764, 13764 }, "NAME" },
+ { { 12416, 13772, 13772 }, "MO.T" },
+ { { 12424, 13780, 13780 }, "MO.X" },
+ { { 12432, 13788, 13788 }, "MO.Y" },
+ { { 12440, 13796, 13796 }, "ID" },
+ { { 12444, 13800, 13800 }, "PRI" },
+ { { 12448, 13804, 13804 }, "DIST" },
+ { { 12456, 13812, 13812 }, "------" },
+ { { 12464, 13820, 13820 }, "%s" },
+ { { 12468, 13824, 13824 }, "%d" },
+ { { 12472, 13828, 13828 }, "GOD1" },
+ { { 12480, 13836, 13836 }, "GOD2" },
+ { { 12488, 13844, 13844 }, "useartia" },
+ { { 12500, 13856, 13856 }, "ykeyicon" },
+ { { 12512, 13868, 13868 }, "gkeyicon" },
+ { { 12524, 13880, 13880 }, "bkeyicon" },
+ { { 12216, 13892, 13892 }, "ARTIBOX" },
+ { { 12536, 13900, 13900 }, "GOD MODE ON" },
+ { { 12548, 13912, 13912 }, "GOD MODE OFF" },
+ { { 12564, 13928, 13928 }, "NO CLIPPING ON" },
+ { { 12580, 13944, 13944 }, "NO CLIPPING OFF" },
+ { { 12596, 13960, 13960 }, "ALL WEAPONS" },
+ { { 12608, 13972, 13972 }, "POWER OFF" },
+ { { 12620, 13984, 13984 }, "POWER ON" },
+ { { 12632, 13996, 13996 }, "FULL HEALTH" },
+ { { 12644, 14008, 14008 }, "ALL KEYS" },
+ { { 12656, 14020, 14020 }, "SOUND DEBUG ON" },
+ { { 12672, 14036, 14036 }, "SOUND DEBUG OFF" },
+ { { 12688, 14052, 14052 }, "TICKER ON" },
+ { { 12700, 14064, 14064 }, "TICKER OFF" },
+ { { 12712, 14076, 14076 }, "CHOOSE AN ARTIFACT ( A - J )" },
+ { { 12744, 14108, 14108 }, "HOW MANY ( 1 - 9 )" },
+ { { 12764, 14128, 14128 }, "YOU GOT IT" },
+ { { 12776, 14140, 14140 }, "BAD INPUT" },
+ { { 12788, 14152, 14152 }, "LEVEL WARP" },
+ { { 12800, 14164, 14164 }, "CHICKEN OFF" },
+ { { 12812, 14176, 14176 }, "CHICKEN ON" },
+ { { 12824, 14188, 14188 }, "MASSACRE" },
+ { { 12836, 14200, 14200 }, "CHEATER - YOU DON'T DESERVE WEAPONS" },
+ { { 12872, 14236, 14236 }, "TRYING TO CHEAT, EH? NOW YOU DIE!" },
+};
+
+// String offsets that are valid but we don't support.
+
+static const int unsupported_strings_1_0[] =
+{
+ 0, 4, 64, 104, 160, 200, 220, 236,
+ 244, 252, 272, 288, 296, 316, 332, 372,
+ 436, 500, 504, 536, 544, 560, 576, 584,
+ 592, 612, 640, 664, 708, 712, 744, 764,
+ 808, 820, 828, 840, 876, 884, 908, 952,
+ 992, 1028, 1036, 1048, 1088, 1128, 1160, 1192,
+ 1212, 1912, 2044, 2056, 2068, 2128, 2140, 2168,
+ 2184, 2196, 2212, 2228, 2240, 2252, 2260, 2264,
+ 2284, 2292, 2296, 2300, 2328, 2340, 2352, 2364,
+ 2372, 2384, 2388, 2404, 2428, 2436, 2444, 2464,
+ 2496, 2508, 2520, 2552, 2564, 2572, 2584, 3120,
+ 3128, 3140, 3184, 3220, 3248, 3252, 3256, 3280,
+ 3304, 3320, 3352, 3380, 3400, 3432, 3464, 3548,
+ 3600, 3624, 3664, 3696, 3812, 3872, 3932, 3940,
+ 3976, 3996, 6872, 6896, 7648, 7696, 7940, 7964,
+ 7968, 7992, 8020, 8028, 8052, 8056, 8076, 8088,
+ 8104, 8116, 8128, 8136, 8148, 8164, 8180, 8192,
+ 8204, 8220, 8232, 8248, 8264, 8276, 8292, 8308,
+ 8320, 8328, 8340, 8352, 8364, 8376, 8392, 8408,
+ 8424, 8436, 8448, 8460, 8472, 8488, 8504, 8520,
+ 8536, 8548, 8560, 8572, 8584, 8596, 8608, 8612,
+ 8624, 8648, 8660, 8668, 8680, 8708, 8720, 8728,
+ 8740, 8752, 8764, 8788, 8800, 8812, 8824, 8848,
+ 8860, 8864, 8868, 8876, 8888, 8896, 8916, 8944,
+ 8948, 8960, 8964, 8968, 8980, 9148, 9172, 9212,
+ 9216, 9220, 9820, 9860, 9892, 9940, 9972, 10012,
+ 10036, 10040, 10052, 10080, 10152, 10192, 10248, 10284,
+ 10320, 10360, 10392, 10452, 10488, 10508, 10556, 10644,
+ 10684, 10812, 10844, 10880, 10912, 10956, 11172, 11200,
+ 11232, 11272, 11312, 11348, 11380, 11404, 11436, 11492,
+ 11548, 11616, 11684, 11748, 11792, 11840, 11896, 11936,
+ 11980, 12028, 12072, 12908, 12924, 12956, 12960, 12968,
+ 12976, 13020, 13048, 13076, 13104, 13136, 13168, 13196,
+ 13240, 13272, 13292, 13296, 13308, 13312, 13320, 13324,
+ 13364, 13408, 13460, 13492, 13516, 13560, 13612, 13664,
+ 13700, 13744, 13796, 13848, 13884, 13940, 13996, 14040,
+ 14084, 14140, 14148, 14156, 14164, 14184, 14192, 14204,
+ 14208, 14212, 14256, 14272, 14284, 14296, 14300, 14312,
+ 14320, 14324, 14348, 14356, 14360, 14372, 14380, 14392,
+ 14432, 14440, 14444, 14472, 14496, 14516, 14536, 14548,
+ 14560, 14572, 14580, 14588, 14596, 14604, 14612, 14620,
+ 14636, 14660, 14704, 14740, 14748, 14756, 14760, 14768,
+ -1,
+};
+
+static const int unsupported_strings_1_2[] =
+{
+ 0, 4, 64, 104, 160, 200, 220, 236,
+ 244, 252, 272, 288, 296, 316, 332, 372,
+ 436, 500, 504, 536, 544, 560, 576, 584,
+ 592, 612, 640, 664, 708, 712, 744, 756,
+ 776, 820, 832, 840, 852, 888, 896, 920,
+ 964, 1004, 1040, 1048, 1060, 1100, 1140, 1172,
+ 1204, 1224, 2312, 2436, 2448, 2464, 2480, 2492,
+ 2512, 2524, 2536, 2596, 2608, 2636, 2652, 2656,
+ 2676, 2684, 2688, 2720, 2732, 2744, 2752, 2764,
+ 2772, 2776, 2792, 2816, 2824, 2832, 2852, 2884,
+ 2896, 2908, 2940, 2952, 2960, 2972, 3520, 3528,
+ 3540, 3584, 3620, 3648, 3652, 3656, 3680, 3704,
+ 3720, 3776, 3804, 3824, 3856, 3888, 4020, 4044,
+ 4084, 4116, 4156, 4272, 4288, 4296, 4332, 4352,
+ 4428, 4432, 8740, 8764, 9552, 9868, 9888, 9900,
+ 9916, 9928, 9940, 9948, 9960, 9976, 9992, 10004,
+ 10016, 10032, 10044, 10060, 10076, 10088, 10104, 10120,
+ 10132, 10140, 10152, 10164, 10176, 10188, 10204, 10220,
+ 10236, 10248, 10260, 10272, 10284, 10300, 10316, 10332,
+ 10348, 10360, 10372, 10384, 10396, 10408, 10420, 10424,
+ 10436, 10460, 10472, 10480, 10492, 10520, 10532, 10540,
+ 10552, 10564, 10576, 10600, 10612, 10624, 10636, 10660,
+ 10672, 10676, 10700, 10704, 10728, 10756, 10764, 10788,
+ 10792, 10796, 10804, 10816, 10824, 10844, 10872, 10876,
+ 10888, 10892, 10896, 10908, 11076, 11100, 11140, 11144,
+ 11148, 11748, 11788, 11820, 11868, 11900, 11940, 11964,
+ 11968, 11980, 12008, 12080, 12120, 12176, 12212, 12248,
+ 12288, 12320, 12380, 12400, 12448, 12536, 12576, 12704,
+ 12736, 12968, 13000, 13024, 13080, 13136, 13204, 13272,
+ 13336, 13380, 13428, 14272, 14288, 14320, 14324, 14332,
+ 14340, 14384, 14412, 14440, 14468, 14500, 14532, 14560,
+ 14604, 14636, 14656, 14696, 14740, 14792, 14824, 14848,
+ 14892, 14944, 14996, 15032, 15076, 15128, 15180, 15216,
+ 15272, 15328, 15372, 15416, 15472, 15480, 15488, 15496,
+ 15516, 15524, 15536, 15540, 15544, 15588, 15604, 15616,
+ 15628, 15632, 15644, 15652, 15656, 15680, 15688, 15692,
+ 15704, 15712, 15724, 15764, 15772, 15776, 15804, 15828,
+ 15848, 15868, 15880, 15892, 15904, 15912, 15920, 15928,
+ 15936, -1,
+};
+
+static const int unsupported_strings_1_3[] =
+{
+ 0, 4, 64, 104, 160, 200, 220, 236,
+ 244, 252, 272, 288, 296, 316, 332, 372,
+ 436, 500, 504, 536, 544, 560, 576, 584,
+ 592, 612, 640, 664, 708, 712, 744, 756,
+ 776, 820, 832, 840, 852, 888, 896, 920,
+ 964, 1004, 1040, 1048, 1060, 1100, 1140, 1172,
+ 1204, 1224, 2312, 2436, 2448, 2464, 2480, 2492,
+ 2512, 2524, 2536, 2596, 2608, 2636, 2652, 2656,
+ 2676, 2684, 2688, 2720, 2732, 2744, 2752, 2764,
+ 2772, 2776, 2792, 2816, 2824, 2832, 2852, 2884,
+ 2896, 2908, 2940, 2952, 2960, 2972, 3520, 3528,
+ 3540, 3584, 3620, 3648, 3652, 3656, 3680, 3704,
+ 3720, 3776, 3804, 3824, 3856, 3888, 4020, 4044,
+ 4084, 4116, 4156, 4272, 4288, 4296, 4332, 4352,
+ 4428, 4432, 8740, 8764, 9552, 9868, 9888, 9900,
+ 9916, 9928, 9940, 9948, 9960, 9976, 9992, 10004,
+ 10016, 10032, 10044, 10060, 10076, 10088, 10104, 10120,
+ 10132, 10140, 10152, 10164, 10176, 10188, 10204, 10220,
+ 10236, 10248, 10260, 10272, 10284, 10300, 10316, 10332,
+ 10348, 10360, 10372, 10384, 10396, 10408, 10420, 10424,
+ 10436, 10460, 10472, 10480, 10492, 10520, 10532, 10540,
+ 10552, 10564, 10576, 10600, 10612, 10624, 10636, 10660,
+ 10672, 10676, 10700, 10704, 10728, 10756, 10764, 10788,
+ 10792, 10796, 10804, 10816, 10824, 10844, 10872, 10876,
+ 10888, 10892, 10896, 10908, 11076, 11100, 11140, 11144,
+ 11148, 11748, 11788, 11820, 11868, 11900, 11940, 11964,
+ 11968, 11980, 12008, 12080, 12120, 12176, 12212, 12248,
+ 12288, 12320, 12380, 12400, 12448, 12536, 12576, 12704,
+ 12736, 12968, 13000, 13024, 13080, 13136, 13204, 13272,
+ 13336, 13380, 13428, 14272, 14288, 14320, 14324, 14332,
+ 14340, 14384, 14412, 14440, 14468, 14500, 14532, 14560,
+ 14604, 14636, 14656, 14696, 14740, 14792, 14824, 14848,
+ 14892, 14944, 14996, 15032, 15076, 15128, 15180, 15216,
+ 15272, 15328, 15372, 15416, 15472, 15480, 15488, 15496,
+ 15516, 15524, 15536, 15540, 15544, 15588, 15604, 15616,
+ 15628, 15632, 15644, 15652, 15656, 15680, 15688, 15692,
+ 15704, 15712, 15724, 15764, 15772, 15776, 15804, 15828,
+ 15848, 15868, 15880, 15892, 15904, 15912, 15920, 15928,
+ 15936, -1,
+};
+
+static const int *unsupported_strings[] =
+{
+ unsupported_strings_1_0,
+ unsupported_strings_1_2,
+ unsupported_strings_1_3,
+};
+
+static boolean StringIsUnsupported(unsigned int offset)
+{
+ const int *string_list;
+ int i;
+
+ string_list = unsupported_strings[deh_hhe_version];
+
+ for (i=0; string_list[i] >= 0; ++i)
+ {
+ if ((unsigned int) string_list[i] == offset)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+static boolean GetStringByOffset(unsigned int offset, char **result)
+{
+ int i;
+
+ for (i=0; i<arrlen(strings); ++i)
+ {
+ if (strings[i].offsets[deh_hhe_version] == offset)
+ {
+ *result = strings[i].string;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// Given a string length, find the maximum length of a
+// string that can replace it.
+
+static int MaxStringLength(int len)
+{
+ // Enough bytes for the string and the NUL terminator
+
+ len += 1;
+
+ // All strings in doom.exe are on 4-byte boundaries, so we may be able
+ // to support a slightly longer string.
+ // Extend up to the next 4-byte boundary
+
+ len += (4 - (len % 4)) % 4;
+
+ // Less one for the NUL terminator.
+
+ return len - 1;
+}
+
+// If a string offset does not match any string, it may be because
+// we are running in the wrong version mode, and the patch was generated
+// for a different Heretic version. Search the lookup tables to find
+// versiosn that match.
+
+static void SuggestOtherVersions(unsigned int offset)
+{
+ const int *string_list;
+ unsigned int i;
+ unsigned int v;
+
+ // Check main string table.
+
+ for (i=0; i<arrlen(strings); ++i)
+ {
+ for (v=0; v<deh_hhe_num_versions; ++v)
+ {
+ if (strings[i].offsets[v] == offset)
+ {
+ DEH_SuggestHereticVersion(v);
+ }
+ }
+ }
+
+ // Check unsupported string tables.
+
+ for (v=0; v<deh_hhe_num_versions; ++v)
+ {
+ string_list = unsupported_strings[v];
+
+ for (i=0; string_list[i] >= 0; ++i)
+ {
+ if (string_list[i] == offset)
+ {
+ DEH_SuggestHereticVersion(v);
+ }
+ }
+ }
+}
+
+static void *DEH_TextStart(deh_context_t *context, char *line)
+{
+ char *repl_text;
+ char *orig_text;
+ int orig_offset, repl_len;
+ int i;
+
+ if (sscanf(line, "Text %i %i", &orig_offset, &repl_len) != 2)
+ {
+ DEH_Warning(context, "Parse error on section start");
+ return NULL;
+ }
+
+ repl_text = Z_Malloc(repl_len + 1, PU_STATIC, NULL);
+
+ // read in the "to" text
+
+ for (i=0; i<repl_len; ++i)
+ {
+ int c;
+
+ c = DEH_GetChar(context);
+
+ repl_text[i] = c;
+ }
+ repl_text[repl_len] = '\0';
+
+ // We don't support all strings, but at least recognise them:
+
+ if (StringIsUnsupported(orig_offset))
+ {
+ DEH_Warning(context, "Unsupported string replacement: %i", orig_offset);
+ }
+
+ // Find the string to replace:
+
+ else if (!GetStringByOffset(orig_offset, &orig_text))
+ {
+ SuggestOtherVersions(orig_offset);
+ DEH_Error(context, "Unknown string offset: %i", orig_offset);
+ }
+
+ // Only allow string replacements that are possible in Vanilla Doom.
+ // Chocolate Doom is unforgiving!
+
+ else if (!deh_allow_long_strings
+ && repl_len > MaxStringLength(strlen(orig_text)))
+ {
+ DEH_Error(context, "Replacement string is longer than the maximum "
+ "possible in heretic.exe");
+ }
+ else
+ {
+ // Success.
+
+ DEH_AddStringReplacement(orig_text, repl_text);
+
+ return NULL;
+ }
+
+ // Failure.
+
+ Z_Free(repl_text);
+
+ return NULL;
+}
+
+static void DEH_TextParseLine(deh_context_t *context, char *line, void *tag)
+{
+ // not used
+}
+
+deh_section_t deh_section_heretic_text =
+{
+ "Text",
+ NULL,
+ DEH_TextStart,
+ DEH_TextParseLine,
+ NULL,
+ NULL,
+};
+
diff --git a/src/heretic/deh_htic.c b/src/heretic/deh_htic.c
new file mode 100644
index 00000000..440fde96
--- /dev/null
+++ b/src/heretic/deh_htic.c
@@ -0,0 +1,186 @@
+// Emacs style mode select -*- C++ -*-
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 2005 Simon Howard
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+//
+//-----------------------------------------------------------------------------
+//
+// Top-level dehacked definitions for Heretic dehacked (HHE).
+//
+//-----------------------------------------------------------------------------
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "deh_defs.h"
+#include "deh_main.h"
+#include "deh_htic.h"
+#include "info.h"
+#include "m_argv.h"
+
+char *deh_signatures[] =
+{
+ "Patch File for HHE v1.0",
+ "Patch File for HHE v1.1",
+ NULL
+};
+
+static char *hhe_versions[] =
+{
+ "1.0", "1.2", "1.3"
+};
+
+// Version number for patches.
+
+deh_hhe_version_t deh_hhe_version = deh_hhe_1_0;
+
+// deh_ammo.c:
+extern deh_section_t deh_section_ammo;
+// deh_frame.c:
+extern deh_section_t deh_section_frame;
+// deh_ptr.c:
+extern deh_section_t deh_section_pointer;
+// deh_sound.c
+extern deh_section_t deh_section_sound;
+// deh_htext.c:
+extern deh_section_t deh_section_heretic_text;
+// deh_thing.c:
+extern deh_section_t deh_section_thing;
+// deh_weapon.c:
+extern deh_section_t deh_section_weapon;
+
+//
+// List of section types:
+//
+
+deh_section_t *deh_section_types[] =
+{
+ &deh_section_ammo,
+ &deh_section_frame,
+// &deh_section_pointer, TODO
+ &deh_section_sound,
+ &deh_section_heretic_text,
+ &deh_section_thing,
+ &deh_section_weapon,
+ NULL
+};
+
+static void SetHHEVersionByName(char *name)
+{
+ int i;
+
+ for (i=0; i<arrlen(hhe_versions); ++i)
+ {
+ if (!strcmp(hhe_versions[i], name))
+ {
+ deh_hhe_version = i;
+ return;
+ }
+ }
+
+ fprintf(stderr, "Unknown Heretic version: %s\n", name);
+ fprintf(stderr, "Valid versions:\n");
+
+ for (i=0; i<arrlen(hhe_versions); ++i)
+ {
+ fprintf(stderr, "\t%s\n", hhe_versions[i]);
+ }
+}
+
+// Initialize Heretic(HHE)-specific dehacked bits.
+
+void DEH_HereticInit(void)
+{
+ int i;
+
+ //!
+ // @arg <version>
+ //
+ // Select the Heretic version number that was used to generate the
+ // HHE patch to be loaded. Patches for each of the Vanilla
+ // Heretic versions (1.0, 1.2, 1.3) can be loaded, but the correct
+ // version number must be specified.
+
+ i = M_CheckParm("-hhever");
+
+ if (i > 0)
+ {
+ SetHHEVersionByName(myargv[i + 1]);
+ }
+
+ // For v1.0 patches, we must apply a slight change to the states[]
+ // table. The table was changed between 1.0 and 1.3 to add two extra
+ // frames to the player "burning death" animation.
+ //
+ // If we are using a v1.0 patch, we must change the table to cut
+ // these out again.
+
+ if (deh_hhe_version < deh_hhe_1_2)
+ {
+ states[S_PLAY_FDTH18].nextstate = S_NULL;
+ }
+}
+
+int DEH_MapHereticFrameNumber(int frame)
+{
+ if (deh_hhe_version < deh_hhe_1_2)
+ {
+ // Between Heretic 1.0 and 1.2, two new frames
+ // were added to the "states" table, to extend the "flame death"
+ // animation displayed when the player is killed by fire. Therefore,
+ // we must map Heretic 1.0 frame numbers to corresponding indexes
+ // for our state table.
+
+ if (frame >= S_PLAY_FDTH19)
+ {
+ frame = (frame - S_PLAY_FDTH19) + S_BLOODYSKULL1;
+ }
+ }
+ else
+ {
+ // After Heretic 1.2, three unused frames were removed from the
+ // states table, unused phoenix rod frames. Our state table includes
+ // these missing states for backwards compatibility. We must therefore
+ // adjust frame numbers for v1.2/v1.3 to corresponding indexes for
+ // our state table.
+
+ if (frame >= S_PHOENIXFXIX_1)
+ {
+ frame = (frame - S_PHOENIXFXIX_1) + S_PHOENIXPUFF1;
+ }
+ }
+
+ return frame;
+}
+
+void DEH_SuggestHereticVersion(deh_hhe_version_t version)
+{
+ fprintf(stderr,
+ "\n"
+ "This patch may be for version %s. You are currently running in\n"
+ "Heretic %s mode. For %s mode, this mode, add this to your command line:\n"
+ "\n"
+ "\t-hhever %s\n"
+ "\n",
+ hhe_versions[version],
+ hhe_versions[deh_hhe_version],
+ hhe_versions[version],
+ hhe_versions[version]);
+}
+
diff --git a/src/heretic/deh_htic.h b/src/heretic/deh_htic.h
new file mode 100644
index 00000000..7855da8c
--- /dev/null
+++ b/src/heretic/deh_htic.h
@@ -0,0 +1,60 @@
+// Emacs style mode select -*- C++ -*-
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 2010 Simon Howard
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+//
+//-----------------------------------------------------------------------------
+//
+// Common header for Heretic dehacked (HHE) support.
+//
+//-----------------------------------------------------------------------------
+
+#ifndef DEH_HTIC_H
+#define DEH_HTIC_H
+
+#include "info.h"
+
+// HHE executable version. Loading HHE patches is (unfortunately)
+// dependent on the version of the Heretic executable used to make them.
+
+typedef enum
+{
+ deh_hhe_1_0,
+ deh_hhe_1_2,
+ deh_hhe_1_3,
+ deh_hhe_num_versions
+} deh_hhe_version_t;
+
+// HHE doesn't know about the last two states in the state table, so
+// these are considered invalid.
+
+#define DEH_HERETIC_NUMSTATES (NUMSTATES - 2)
+
+// It also doesn't know about the last two things in the mobjinfo table
+// (which correspond to the states above)
+
+#define DEH_HERETIC_NUMMOBJTYPES (NUMMOBJTYPES - 2)
+
+void DEH_HereticInit(void);
+int DEH_MapHereticFrameNumber(int frame);
+void DEH_SuggestHereticVersion(deh_hhe_version_t version);
+
+extern deh_hhe_version_t deh_hhe_version;
+
+#endif /* #ifndef DEH_HTIC_H */
+
diff --git a/src/heretic/deh_sound.c b/src/heretic/deh_sound.c
new file mode 100644
index 00000000..d1f266dd
--- /dev/null
+++ b/src/heretic/deh_sound.c
@@ -0,0 +1,118 @@
+// Emacs style mode select -*- C++ -*-
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 2005 Simon Howard
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+//
+//-----------------------------------------------------------------------------
+//
+// Parses "Sound" sections in dehacked files
+//
+//-----------------------------------------------------------------------------
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "doomfeatures.h"
+#include "doomtype.h"
+#include "deh_defs.h"
+#include "deh_main.h"
+#include "deh_mapping.h"
+
+#include "doomdef.h"
+#include "i_sound.h"
+
+#include "sounds.h"
+
+DEH_BEGIN_MAPPING(sound_mapping, sfxinfo_t)
+ DEH_MAPPING_STRING("Name", name)
+ DEH_UNSUPPORTED_MAPPING("Special")
+ DEH_MAPPING("Value", priority)
+ DEH_MAPPING("Unknown 1", usefulness)
+ DEH_UNSUPPORTED_MAPPING("Unknown 2")
+ DEH_UNSUPPORTED_MAPPING("Unknown 3")
+ DEH_MAPPING("One/Two", numchannels)
+DEH_END_MAPPING
+
+static void *DEH_SoundStart(deh_context_t *context, char *line)
+{
+ int sound_number = 0;
+
+ if (sscanf(line, "Sound %i", &sound_number) != 1)
+ {
+ DEH_Warning(context, "Parse error on section start");
+ return NULL;
+ }
+
+ if (sound_number < 0 || sound_number >= NUMSFX)
+ {
+ DEH_Warning(context, "Invalid sound number: %i", sound_number);
+ return NULL;
+ }
+
+ if (sound_number >= DEH_VANILLA_NUMSFX)
+ {
+ DEH_Warning(context, "Attempt to modify SFX %i. This will cause "
+ "problems in Vanilla dehacked.", sound_number);
+ }
+
+ return &S_sfx[sound_number];
+}
+
+static void DEH_SoundParseLine(deh_context_t *context, char *line, void *tag)
+{
+ sfxinfo_t *sfx;
+ char *variable_name, *value;
+
+ if (tag == NULL)
+ return;
+
+ sfx = (sfxinfo_t *) tag;
+
+ // Parse the assignment
+
+ if (!DEH_ParseAssignment(line, &variable_name, &value))
+ {
+ // Failed to parse
+ DEH_Warning(context, "Failed to parse assignment");
+ return;
+ }
+
+ // Set the field value:
+
+ if (!strcasecmp(variable_name, "Name"))
+ {
+ DEH_SetStringMapping(context, &sound_mapping, sfx,
+ variable_name, value);
+ }
+ else
+ {
+ DEH_SetMapping(context, &sound_mapping, sfx,
+ variable_name, atoi(value));
+ }
+}
+
+deh_section_t deh_section_sound =
+{
+ "Sound",
+ NULL,
+ DEH_SoundStart,
+ DEH_SoundParseLine,
+ NULL,
+ NULL,
+};
+
diff --git a/src/heretic/deh_thing.c b/src/heretic/deh_thing.c
new file mode 100644
index 00000000..ffededf2
--- /dev/null
+++ b/src/heretic/deh_thing.c
@@ -0,0 +1,150 @@
+// Emacs style mode select -*- C++ -*-
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 2005 Simon Howard
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+//
+//-----------------------------------------------------------------------------
+//
+// Parses "Thing" sections in dehacked files
+//
+//-----------------------------------------------------------------------------
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "doomtype.h"
+#include "m_misc.h"
+
+#include "deh_defs.h"
+#include "deh_main.h"
+#include "deh_mapping.h"
+#include "deh_htic.h"
+
+#include "info.h"
+
+DEH_BEGIN_MAPPING(thing_mapping, mobjinfo_t)
+ DEH_MAPPING("ID #", doomednum)
+ DEH_MAPPING("Initial frame", spawnstate)
+ DEH_MAPPING("Hit points", spawnhealth)
+ DEH_MAPPING("First moving frame", seestate)
+ DEH_MAPPING("Alert sound", seesound)
+ DEH_MAPPING("Reaction time", reactiontime)
+ DEH_MAPPING("Attack sound", attacksound)
+ DEH_MAPPING("Injury frame", painstate)
+ DEH_MAPPING("Pain chance", painchance)
+ DEH_MAPPING("Pain sound", painsound)
+ DEH_MAPPING("Close attack frame", meleestate)
+ DEH_MAPPING("Far attack frame", missilestate)
+ DEH_MAPPING("Burning frame", crashstate)
+ DEH_MAPPING("Death frame", deathstate)
+ DEH_MAPPING("Exploding frame", xdeathstate)
+ DEH_MAPPING("Death sound", deathsound)
+ DEH_MAPPING("Speed", speed)
+ DEH_MAPPING("Width", radius)
+ DEH_MAPPING("Height", height)
+ DEH_MAPPING("Mass", mass)
+ DEH_MAPPING("Missile damage", damage)
+ DEH_MAPPING("Action sound", activesound)
+ DEH_MAPPING("Bits 1", flags)
+ DEH_MAPPING("Bits 2", flags2)
+DEH_END_MAPPING
+
+static void *DEH_ThingStart(deh_context_t *context, char *line)
+{
+ int thing_number = 0;
+ mobjinfo_t *mobj;
+
+ if (sscanf(line, "Thing %i", &thing_number) != 1)
+ {
+ DEH_Warning(context, "Parse error on section start");
+ return NULL;
+ }
+
+ // HHE thing numbers are indexed from 1
+ --thing_number;
+
+ if (thing_number < 0 || thing_number >= DEH_HERETIC_NUMMOBJTYPES)
+ {
+ DEH_Warning(context, "Invalid thing number: %i", thing_number);
+ return NULL;
+ }
+
+ mobj = &mobjinfo[thing_number];
+
+ return mobj;
+}
+
+static void DEH_ThingParseLine(deh_context_t *context, char *line, void *tag)
+{
+ mobjinfo_t *mobj;
+ char *variable_name, *value;
+ int ivalue;
+
+ if (tag == NULL)
+ return;
+
+ mobj = (mobjinfo_t *) tag;
+
+ // Parse the assignment
+
+ if (!DEH_ParseAssignment(line, &variable_name, &value))
+ {
+ // Failed to parse
+
+ DEH_Warning(context, "Failed to parse assignment");
+ return;
+ }
+
+ // all values are integers
+
+ ivalue = atoi(value);
+
+ // If the value to be set is a frame, the frame number must
+ // undergo transformation from a Heretic 1.0 index to a
+ // Heretic 1.3 index.
+
+ if (M_StrCaseStr(variable_name, "frame") != NULL)
+ {
+ ivalue = DEH_MapHereticFrameNumber(ivalue);
+ }
+
+ // Set the field value
+
+ DEH_SetMapping(context, &thing_mapping, mobj, variable_name, ivalue);
+}
+
+static void DEH_ThingMD5Sum(md5_context_t *context)
+{
+ int i;
+
+ for (i=0; i<NUMMOBJTYPES; ++i)
+ {
+ DEH_StructMD5Sum(context, &thing_mapping, &mobjinfo[i]);
+ }
+}
+
+deh_section_t deh_section_thing =
+{
+ "Thing",
+ NULL,
+ DEH_ThingStart,
+ DEH_ThingParseLine,
+ NULL,
+ DEH_ThingMD5Sum,
+};
+
diff --git a/src/heretic/deh_weapon.c b/src/heretic/deh_weapon.c
new file mode 100644
index 00000000..28a90c68
--- /dev/null
+++ b/src/heretic/deh_weapon.c
@@ -0,0 +1,131 @@
+// Emacs style mode select -*- C++ -*-
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 2005 Simon Howard
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+//
+//-----------------------------------------------------------------------------
+//
+// Parses "Weapon" sections in dehacked files
+//
+//-----------------------------------------------------------------------------
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "doomtype.h"
+#include "m_misc.h"
+
+#include "doomdef.h"
+
+#include "deh_defs.h"
+#include "deh_main.h"
+#include "deh_mapping.h"
+#include "deh_htic.h"
+
+DEH_BEGIN_MAPPING(weapon_mapping, weaponinfo_t)
+ DEH_MAPPING("Ammo type", ammo)
+ DEH_MAPPING("Deselect frame", upstate)
+ DEH_MAPPING("Select frame", downstate)
+ DEH_MAPPING("Bobbing frame", readystate)
+ DEH_MAPPING("Shooting frame", atkstate)
+ DEH_MAPPING("Firing frame", holdatkstate)
+ DEH_MAPPING("Unknown frame", flashstate)
+DEH_END_MAPPING
+
+static void *DEH_WeaponStart(deh_context_t *context, char *line)
+{
+ int weapon_number = 0;
+
+ if (sscanf(line, "Weapon %i", &weapon_number) != 1)
+ {
+ DEH_Warning(context, "Parse error on section start");
+ return NULL;
+ }
+
+ if (weapon_number < 0 || weapon_number >= NUMWEAPONS * 2)
+ {
+ DEH_Warning(context, "Invalid weapon number: %i", weapon_number);
+ return NULL;
+ }
+
+ // Because of the tome of power, we have two levels of weapons:
+
+ if (weapon_number < NUMWEAPONS)
+ {
+ return &wpnlev1info[weapon_number];
+ }
+ else
+ {
+ return &wpnlev2info[weapon_number - NUMWEAPONS];
+ }
+}
+
+static void DEH_WeaponParseLine(deh_context_t *context, char *line, void *tag)
+{
+ char *variable_name, *value;
+ weaponinfo_t *weapon;
+ int ivalue;
+
+ if (tag == NULL)
+ return;
+
+ weapon = (weaponinfo_t *) tag;
+
+ if (!DEH_ParseAssignment(line, &variable_name, &value))
+ {
+ // Failed to parse
+
+ DEH_Warning(context, "Failed to parse assignment");
+ return;
+ }
+
+ ivalue = atoi(value);
+
+ // If this is a frame field, we need to map from Heretic 1.0 frame
+ // numbers to Heretic 1.3 frame numbers.
+
+ if (M_StrCaseStr(variable_name, "frame") != NULL)
+ {
+ ivalue = DEH_MapHereticFrameNumber(ivalue);
+ }
+
+ DEH_SetMapping(context, &weapon_mapping, weapon, variable_name, ivalue);
+}
+
+static void DEH_WeaponMD5Sum(md5_context_t *context)
+{
+ int i;
+
+ for (i=0; i<NUMWEAPONS ;++i)
+ {
+ DEH_StructMD5Sum(context, &weapon_mapping, &wpnlev1info[i]);
+ DEH_StructMD5Sum(context, &weapon_mapping, &wpnlev2info[i]);
+ }
+}
+
+deh_section_t deh_section_weapon =
+{
+ "Weapon",
+ NULL,
+ DEH_WeaponStart,
+ DEH_WeaponParseLine,
+ NULL,
+ DEH_WeaponMD5Sum,
+};
+
diff --git a/src/heretic/doomdef.h b/src/heretic/doomdef.h
index 3f976c3d..aa1d0c0d 100644
--- a/src/heretic/doomdef.h
+++ b/src/heretic/doomdef.h
@@ -581,6 +581,7 @@ extern boolean singletics; // debug flag to cancel adaptiveness
extern boolean DebugSound; // debug flag for displaying sound info
extern int maxammo[NUMAMMO];
+extern int GetWeaponAmmo[NUMWEAPONS];
extern boolean demoplayback;
extern int skytexture;
diff --git a/src/heretic/dstrings.h b/src/heretic/dstrings.h
index aea5548e..93900f9d 100644
--- a/src/heretic/dstrings.h
+++ b/src/heretic/dstrings.h
@@ -26,42 +26,6 @@
//---------------------------------------------------------------------------
//
-// M_menu.c
-//
-//---------------------------------------------------------------------------
-#define PRESSKEY "press a key."
-#define PRESSYN "press y or n."
-#define TXT_PAUSED "PAUSED"
-#define QUITMSG "are you sure you want to\nquit this great game?"
-#define LOADNET "you can't do load while in a net game!\n\n"PRESSKEY
-#define QLOADNET "you can't quickload during a netgame!\n\n"PRESSKEY
-#define QSAVESPOT "you haven't picked a quicksave slot yet!\n\n"PRESSKEY
-#define SAVEDEAD "you can't save if you aren't playing!\n\n"PRESSKEY
-#define QSPROMPT "quicksave over your game named\n\n'%s'?\n\n"PRESSYN
-#define QLPROMPT "do you want to quickload the game named"\
- "\n\n'%s'?\n\n"PRESSYN
-#define NEWGAME "you can't start a new game\n"\
- "while in a network game.\n\n"PRESSKEY
-#define NIGHTMARE "are you sure? this skill level\n"\
- "isn't even remotely fair.\n\n"PRESSYN
-#define SWSTRING "this is the shareware version of doom.\n\n"\
- "you need to order the entire trilogy.\n\n"PRESSKEY
-#define MSGOFF "Messages OFF"
-#define MSGON "Messages ON"
-#define NETEND "you can't end a netgame!\n\n"PRESSKEY
-#define ENDGAME "are you sure you want to end the game?\n\n"PRESSYN
-#define DOSY "(press y to quit to dos.)"
-#define DETAILHI "High detail"
-#define DETAILLO "Low detail"
-#define GAMMALVL0 "Gamma correction OFF"
-#define GAMMALVL1 "Gamma correction level 1"
-#define GAMMALVL2 "Gamma correction level 2"
-#define GAMMALVL3 "Gamma correction level 3"
-#define GAMMALVL4 "Gamma correction level 4"
-#define EMPTYSTRING "empty slot"
-
-//---------------------------------------------------------------------------
-//
// P_inter.c
//
//---------------------------------------------------------------------------
@@ -170,74 +134,6 @@
//---------------------------------------------------------------------------
//
-// HU_stuff.c
-//
-//---------------------------------------------------------------------------
-
-#define HUSTR_E1M1 "E1M1: Hangar"
-#define HUSTR_E1M2 "E1M2: Nuclear Plant"
-#define HUSTR_E1M3 "E1M3: Toxin Refinery"
-#define HUSTR_E1M4 "E1M4: Command Control"
-#define HUSTR_E1M5 "E1M5: Phobos Lab"
-#define HUSTR_E1M6 "E1M6: Central Processing"
-#define HUSTR_E1M7 "E1M7: Computer Station"
-#define HUSTR_E1M8 "E1M8: Phobos Anomaly"
-#define HUSTR_E1M9 "E1M9: Military Base"
-
-#define HUSTR_E2M1 "E2M1: Deimos Anomaly"
-#define HUSTR_E2M2 "E2M2: Containment Area"
-#define HUSTR_E2M3 "E2M3: Refinery"
-#define HUSTR_E2M4 "E2M4: Deimos Lab"
-#define HUSTR_E2M5 "E2M5: Command Center"
-#define HUSTR_E2M6 "E2M6: Halls of the Damned"
-#define HUSTR_E2M7 "E2M7: Spawning Vats"
-#define HUSTR_E2M8 "E2M8: Tower of Babel"
-#define HUSTR_E2M9 "E2M9: Fortress of Mystery"
-
-#define HUSTR_E3M1 "E3M1: Hell Keep"
-#define HUSTR_E3M2 "E3M2: Slough of Despair"
-#define HUSTR_E3M3 "E3M3: Pandemonium"
-#define HUSTR_E3M4 "E3M4: House of Pain"
-#define HUSTR_E3M5 "E3M5: Unholy Cathedral"
-#define HUSTR_E3M6 "E3M6: Mt. Erebus"
-#define HUSTR_E3M7 "E3M7: Limbo"
-#define HUSTR_E3M8 "E3M8: Dis"
-#define HUSTR_E3M9 "E3M9: Warrens"
-
-#define HUSTR_CHATMACRO1 "I'm ready to kick butt!"
-#define HUSTR_CHATMACRO2 "I'm OK."
-#define HUSTR_CHATMACRO3 "I'm not looking too good!"
-#define HUSTR_CHATMACRO4 "Help!"
-#define HUSTR_CHATMACRO5 "You suck!"
-#define HUSTR_CHATMACRO6 "Next time, scumbag..."
-#define HUSTR_CHATMACRO7 "Come here!"
-#define HUSTR_CHATMACRO8 "I'll take care of it."
-#define HUSTR_CHATMACRO9 "Yes"
-#define HUSTR_CHATMACRO0 "No"
-
-#define HUSTR_TALKTOSELF1 "You mumble to yourself"
-#define HUSTR_TALKTOSELF2 "Who's there?"
-#define HUSTR_TALKTOSELF3 "You scare yourself"
-#define HUSTR_TALKTOSELF4 "You start to rave"
-#define HUSTR_TALKTOSELF5 "You've lost it..."
-
-#define HUSTR_MESSAGESENT "[Message Sent]"
-
-// The following should NOT be changed unless it seems
-// just AWFULLY necessary
-
-#define HUSTR_PLRGREEN "Green: "
-#define HUSTR_PLRINDIGO "Indigo: "
-#define HUSTR_PLRBROWN "Brown: "
-#define HUSTR_PLRRED "Red: "
-
-#define HUSTR_KEYGREEN 'g'
-#define HUSTR_KEYINDIGO 'i'
-#define HUSTR_KEYBROWN 'b'
-#define HUSTR_KEYRED 'r'
-
-//---------------------------------------------------------------------------
-//
// AM_map.c
//
//---------------------------------------------------------------------------
@@ -253,26 +149,6 @@
//---------------------------------------------------------------------------
//
-// ST_stuff.c
-//
-//---------------------------------------------------------------------------
-
-#define STSTR_DQDON "Degreelessness Mode On"
-#define STSTR_DQDOFF "Degreelessness Mode Off"
-
-#define STSTR_KFAADDED "Very Happy Ammo Added"
-
-#define STSTR_NCON "No Clipping Mode ON"
-#define STSTR_NCOFF "No Clipping Mode OFF"
-
-#define STSTR_BEHOLD "inVuln, Str, Inviso, Rad, Allmap, or Lite-amp"
-#define STSTR_BEHOLDX "Power-up Toggled"
-
-#define STSTR_CHOPPERS "... doesn't suck - GM"
-#define STSTR_CLEV "Changing Level..."
-
-//---------------------------------------------------------------------------
-//
// F_finale.c
//
//---------------------------------------------------------------------------
@@ -374,56 +250,3 @@
"surrender without a fight. eyes\n"\
"wide, you go to meet your fate."
-/*
-#define E1TEXT "Once you beat the big badasses and\n"\
- "clean out the moon base you're supposed\n"\
- "to win, aren't you? Aren't you? Where's\n"\
- "your fat reward and ticket home? What\n"\
- "the hell is this? It's not supposed to\n"\
- "end this way!\n"\
- "\n" \
- "It stinks like rotten meat, but looks\n"\
- "like the lost Deimos base. Looks like\n"\
- "you're stuck on The Shores of Hell.\n"\
- "The only way out is through.\n"\
- "\n"\
- "To continue the DOOM experience, play\n"\
- "The Shores of Hell and its amazing\n"\
- "sequel, Inferno!\n"
-
-#define E2TEXT "You've done it! The hideous cyber-\n"\
- "demon lord that ruled the lost Deimos\n"\
- "moon base has been slain and you\n"\
- "are triumphant! But ... where are\n"\
- "you? You clamber to the edge of the\n"\
- "moon and look down to see the awful\n"\
- "truth.\n" \
- "\n"\
- "Deimos floats above Hell itself!\n"\
- "You've never heard of anyone escaping\n"\
- "from Hell, but you'll make the bastards\n"\
- "sorry they ever heard of you! Quickly,\n"\
- "you rappel down to the surface of\n"\
- "Hell.\n"\
- "\n" \
- "Now, it's on to the final chapter of\n"\
- "DOOM! -- Inferno."
-
-#define E3TEXT "The loathsome spiderdemon that\n"\
- "masterminded the invasion of the moon\n"\
- "bases and caused so much death has had\n"\
- "its ass kicked for all time.\n"\
- "\n"\
- "A hidden doorway opens and you enter.\n"\
- "You've proven too tough for Hell to\n"\
- "contain, and now Hell at last plays\n"\
- "fair -- for you emerge from the door\n"\
- "to see the green fields of Earth!\n"\
- "Home at last.\n" \
- "\n"\
- "You wonder what's been happening on\n"\
- "Earth while you were battling evil\n"\
- "unleashed. It's good that no Hell-\n"\
- "spawn could have come through that\n"\
- "door with you ..."
-*/
diff --git a/src/heretic/f_finale.c b/src/heretic/f_finale.c
index 03806214..4077bb82 100644
--- a/src/heretic/f_finale.c
+++ b/src/heretic/f_finale.c
@@ -26,6 +26,7 @@
#include <ctype.h>
#include "doomdef.h"
+#include "deh_str.h"
#include "i_swap.h"
#include "i_video.h"
#include "s_sound.h"
@@ -37,11 +38,6 @@ int finalecount;
#define TEXTSPEED 3
#define TEXTWAIT 250
-char *e1text = E1TEXT;
-char *e2text = E2TEXT;
-char *e3text = E3TEXT;
-char *e4text = E4TEXT;
-char *e5text = E5TEXT;
char *finaletext;
char *finaleflat;
@@ -72,30 +68,30 @@ void F_StartFinale(void)
switch (gameepisode)
{
case 1:
- finaleflat = "FLOOR25";
- finaletext = e1text;
+ finaleflat = DEH_String("FLOOR25");
+ finaletext = DEH_String(E1TEXT);
break;
case 2:
- finaleflat = "FLATHUH1";
- finaletext = e2text;
+ finaleflat = DEH_String("FLATHUH1");
+ finaletext = DEH_String(E2TEXT);
break;
case 3:
- finaleflat = "FLTWAWA2";
- finaletext = e3text;
+ finaleflat = DEH_String("FLTWAWA2");
+ finaletext = DEH_String(E3TEXT);
break;
case 4:
- finaleflat = "FLOOR28";
- finaletext = e4text;
+ finaleflat = DEH_String("FLOOR28");
+ finaletext = DEH_String(E4TEXT);
break;
case 5:
- finaleflat = "FLOOR08";
- finaletext = e5text;
+ finaleflat = DEH_String("FLOOR08");
+ finaletext = DEH_String(E5TEXT);
break;
}
finalestage = 0;
finalecount = 0;
- FontABaseLump = W_GetNumForName("FONTA_S") + 1;
+ FontABaseLump = W_GetNumForName(DEH_String("FONTA_S")) + 1;
// S_ChangeMusic(mus_victor, true);
S_StartSong(mus_cptd, true);
@@ -277,8 +273,8 @@ void F_DemonScroll(void)
{
return;
}
- p1 = W_CacheLumpName("FINAL1", PU_LEVEL);
- p2 = W_CacheLumpName("FINAL2", PU_LEVEL);
+ p1 = W_CacheLumpName(DEH_String("FINAL1"), PU_LEVEL);
+ p2 = W_CacheLumpName(DEH_String("FINAL2"), PU_LEVEL);
if (finalecount < 70)
{
memcpy(I_VideoBuffer, p1, SCREENHEIGHT * SCREENWIDTH);
@@ -319,8 +315,8 @@ void F_DrawUnderwater(void)
{
underwawa = true;
memset((byte *) 0xa0000, 0, SCREENWIDTH * SCREENHEIGHT);
- I_SetPalette(W_CacheLumpName("E2PAL", PU_CACHE));
- V_DrawRawScreen(W_CacheLumpName("E2END", PU_CACHE));
+ I_SetPalette(W_CacheLumpName(DEH_String("E2PAL"), PU_CACHE));
+ V_DrawRawScreen(W_CacheLumpName(DEH_String("E2END"), PU_CACHE));
}
paused = false;
MenuActive = false;
@@ -328,7 +324,7 @@ void F_DrawUnderwater(void)
break;
case 2:
- V_DrawRawScreen(W_CacheLumpName("TITLE", PU_CACHE));
+ V_DrawRawScreen(W_CacheLumpName(DEH_String("TITLE"), PU_CACHE));
//D_StartTitle(); // go to intro/demo mode.
}
}
diff --git a/src/heretic/g_game.c b/src/heretic/g_game.c
index a256b63b..b37f95e0 100644
--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -28,6 +28,7 @@
#include <string.h>
#include "doomdef.h"
#include "doomkeys.h"
+#include "deh_str.h"
#include "i_timer.h"
#include "i_system.h"
#include "m_controls.h"
@@ -862,12 +863,16 @@ void G_Ticker(void)
{
if (netgame)
{
- strcpy(savedescription, "NET GAME");
+ strncpy(savedescription, DEH_String("NET GAME"),
+ sizeof(savedescription));
}
else
{
- strcpy(savedescription, "SAVE GAME");
+ strncpy(savedescription, DEH_String("SAVE GAME"),
+ sizeof(savedescription));
}
+
+ savedescription[sizeof(savedescription) - 1] = '\0';
}
savegameslot =
(players[i].cmd.
@@ -1320,7 +1325,9 @@ void G_DoLoadGame(void)
save_p = savebuffer + SAVESTRINGSIZE;
// Skip the description field
memset(vcheck, 0, sizeof(vcheck));
- sprintf(vcheck, "version %i", HERETIC_VERSION);
+
+ DEH_snprintf(vcheck, VERSIONSIZE, "version %i", HERETIC_VERSION);
+
if (strcmp((char *) save_p, vcheck) != 0)
{ // Bad version
return;
@@ -1449,11 +1456,11 @@ void G_InitNew(skill_t skill, int episode, int map)
// Set the sky map
if (episode > 5)
{
- skytexture = R_TextureNumForName("SKY1");
+ skytexture = R_TextureNumForName(DEH_String("SKY1"));
}
else
{
- skytexture = R_TextureNumForName(skyLumpNames[episode - 1]);
+ skytexture = R_TextureNumForName(DEH_String(skyLumpNames[episode - 1]));
}
//
@@ -1694,7 +1701,7 @@ void G_DoSaveGame(void)
SV_Open(name);
SV_Write(description, SAVESTRINGSIZE);
memset(verString, 0, sizeof(verString));
- sprintf(verString, "version %i", HERETIC_VERSION);
+ DEH_snprintf(verString, VERSIONSIZE, "version %i", HERETIC_VERSION);
SV_Write(verString, VERSIONSIZE);
SV_WriteByte(gameskill);
SV_WriteByte(gameepisode);
@@ -1714,7 +1721,7 @@ void G_DoSaveGame(void)
gameaction = ga_nothing;
savedescription[0] = 0;
- P_SetMessage(&players[consoleplayer], TXT_GAMESAVED, true);
+ P_SetMessage(&players[consoleplayer], DEH_String(TXT_GAMESAVED), true);
}
//==========================================================================
diff --git a/src/heretic/in_lude.c b/src/heretic/in_lude.c
index 33b75956..3c382814 100644
--- a/src/heretic/in_lude.c
+++ b/src/heretic/in_lude.c
@@ -30,6 +30,7 @@
*/
#include "doomdef.h"
+#include "deh_str.h"
#include "s_sound.h"
#include "i_system.h"
#include "i_video.h"
@@ -161,7 +162,7 @@ extern void AM_Stop(void);
void IN_Start(void)
{
- I_SetPalette(W_CacheLumpName("PLAYPAL", PU_CACHE));
+ I_SetPalette(W_CacheLumpName(DEH_String("PLAYPAL"), PU_CACHE));
IN_LoadPics();
IN_InitStats();
intermission = true;
@@ -308,26 +309,26 @@ static void IN_LoadUnloadPics(void (*callback)(char *lumpname,
switch (gameepisode)
{
case 1:
- callback("MAPE1", 0, &patchINTERPIC);
+ callback(DEH_String("MAPE1"), 0, &patchINTERPIC);
break;
case 2:
- callback("MAPE2", 0, &patchINTERPIC);
+ callback(DEH_String("MAPE2"), 0, &patchINTERPIC);
break;
case 3:
- callback("MAPE3", 0, &patchINTERPIC);
+ callback(DEH_String("MAPE3"), 0, &patchINTERPIC);
break;
default:
break;
}
- callback("IN_X", 0, &patchBEENTHERE);
- callback("IN_YAH", 0, &patchGOINGTHERE);
- callback("FONTB13", 0, &FontBNegative);
+ callback(DEH_String("IN_X"), 0, &patchBEENTHERE);
+ callback(DEH_String("IN_YAH"), 0, &patchGOINGTHERE);
+ callback(DEH_String("FONTB13"), 0, &FontBNegative);
- callback("FONTB15", 0, &FontBSlash);
- callback("FONTB05", 0, &FontBPercent);
+ callback(DEH_String("FONTB15"), 0, &FontBSlash);
+ callback(DEH_String("FONTB05"), 0, &FontBPercent);
- FontBLumpBase = W_GetNumForName("FONTB16");
+ FontBLumpBase = W_GetNumForName(DEH_String("FONTB16"));
for (i = 0; i < 10; i++)
{
@@ -355,9 +356,9 @@ static void LoadLumpCallback(char *lumpname, int lumpnum, patch_t **ptr)
void IN_LoadPics(void)
{
- FontBLump = W_GetNumForName("FONTB_S") + 1;
- patchFaceOkayBase = W_GetNumForName("FACEA0");
- patchFaceDeadBase = W_GetNumForName("FACEB0");
+ FontBLump = W_GetNumForName(DEH_String("FONTB_S")) + 1;
+ patchFaceOkayBase = W_GetNumForName(DEH_String("FACEA0"));
+ patchFaceDeadBase = W_GetNumForName(DEH_String("FACEB0"));
IN_LoadUnloadPics(LoadLumpCallback);
}
@@ -580,7 +581,7 @@ void IN_DrawStatBack(void)
byte *src;
byte *dest;
- src = W_CacheLumpName("FLOOR16", PU_CACHE);
+ src = W_CacheLumpName(DEH_String("FLOOR16"), PU_CACHE);
dest = I_VideoBuffer;
for (y = 0; y < SCREENHEIGHT; y++)
@@ -612,8 +613,8 @@ void IN_DrawOldLevel(void)
x = 160 - MN_TextBWidth(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] +
7) / 2;
IN_DrTextB(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] + 7, x, 3);
- x = 160 - MN_TextAWidth("FINISHED") / 2;
- MN_DrTextA("FINISHED", x, 25);
+ x = 160 - MN_TextAWidth(DEH_String("FINISHED")) / 2;
+ MN_DrTextA(DEH_String("FINISHED"), x, 25);
if (prevmap == 9)
{
@@ -660,8 +661,8 @@ void IN_DrawYAH(void)
int i;
int x;
- x = 160 - MN_TextAWidth("NOW ENTERING:") / 2;
- MN_DrTextA("NOW ENTERING:", x, 10);
+ x = 160 - MN_TextAWidth(DEH_String("NOW ENTERING:")) / 2;
+ MN_DrTextA(DEH_String("NOW ENTERING:"), x, 10);
x = 160 - MN_TextBWidth(LevelNames[(gameepisode - 1) * 9 + gamemap - 1] +
7) / 2;
IN_DrTextB(LevelNames[(gameepisode - 1) * 9 + gamemap - 1] + 7, x, 20);
@@ -698,15 +699,15 @@ void IN_DrawSingleStats(void)
int x;
static int sounds;
- IN_DrTextB("KILLS", 50, 65);
- IN_DrTextB("ITEMS", 50, 90);
- IN_DrTextB("SECRETS", 50, 115);
+ IN_DrTextB(DEH_String("KILLS"), 50, 65);
+ IN_DrTextB(DEH_String("ITEMS"), 50, 90);
+ IN_DrTextB(DEH_String("SECRETS"), 50, 115);
x = 160 - MN_TextBWidth(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] +
7) / 2;
IN_DrTextB(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] + 7, x, 3);
- x = 160 - MN_TextAWidth("FINISHED") / 2;
- MN_DrTextA("FINISHED", x, 25);
+ x = 160 - MN_TextAWidth(DEH_String("FINISHED")) / 2;
+ MN_DrTextA(DEH_String("FINISHED"), x, 25);
if (intertime < 30)
{
@@ -757,13 +758,13 @@ void IN_DrawSingleStats(void)
if (gamemode != retail || gameepisode <= 3)
{
- IN_DrTextB("TIME", 85, 160);
+ IN_DrTextB(DEH_String("TIME"), 85, 160);
IN_DrawTime(155, 160, hours, minutes, seconds);
}
else
{
- x = 160 - MN_TextAWidth("NOW ENTERING:") / 2;
- MN_DrTextA("NOW ENTERING:", x, 160);
+ x = 160 - MN_TextAWidth(DEH_String("NOW ENTERING:")) / 2;
+ MN_DrTextA(DEH_String("NOW ENTERING:"), x, 160);
x = 160 -
MN_TextBWidth(LevelNames[(gameepisode - 1) * 9 + gamemap - 1] +
7) / 2;
@@ -787,14 +788,14 @@ void IN_DrawCoopStats(void)
static int sounds;
- IN_DrTextB("KILLS", 95, 35);
- IN_DrTextB("BONUS", 155, 35);
- IN_DrTextB("SECRET", 232, 35);
+ IN_DrTextB(DEH_String("KILLS"), 95, 35);
+ IN_DrTextB(DEH_String("BONUS"), 155, 35);
+ IN_DrTextB(DEH_String("SECRET"), 232, 35);
x = 160 - MN_TextBWidth(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] +
7) / 2;
IN_DrTextB(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] + 7, x, 3);
- x = 160 - MN_TextAWidth("FINISHED") / 2;
- MN_DrTextA("FINISHED", x, 25);
+ x = 160 - MN_TextAWidth(DEH_String("FINISHED")) / 2;
+ MN_DrTextA(DEH_String("FINISHED"), x, 25);
ypos = 50;
for (i = 0; i < MAXPLAYERS; i++)
@@ -845,11 +846,11 @@ void IN_DrawDMStats(void)
xpos = 90;
ypos = 55;
- IN_DrTextB("TOTAL", 265, 30);
- MN_DrTextA("VICTIMS", 140, 8);
+ IN_DrTextB(DEH_String("TOTAL"), 265, 30);
+ MN_DrTextA(DEH_String("VICTIMS"), 140, 8);
for (i = 0; i < 7; i++)
{
- MN_DrTextA(KillersText[i], 10, 80 + 9 * i);
+ MN_DrTextA(DEH_String(KillersText[i]), 10, 80 + 9 * i);
}
if (intertime < 20)
{
@@ -940,7 +941,7 @@ void IN_DrawTime(int x, int y, int h, int m, int s)
if (h)
{
IN_DrawNumber(h, x, y, 2);
- IN_DrTextB(":", x + 26, y);
+ IN_DrTextB(DEH_String(":"), x + 26, y);
}
x += 34;
if (m || h)
@@ -950,7 +951,7 @@ void IN_DrawTime(int x, int y, int h, int m, int s)
x += 34;
if (s)
{
- IN_DrTextB(":", x - 8, y);
+ IN_DrTextB(DEH_String(":"), x - 8, y);
IN_DrawNumber(s, x, y, 2);
}
}
diff --git a/src/heretic/info.c b/src/heretic/info.c
index e566222c..b6dd921f 100644
--- a/src/heretic/info.c
+++ b/src/heretic/info.c
@@ -22,7 +22,7 @@
//
//-----------------------------------------------------------------------------
#include "doomdef.h"
-// generated by multigen
+#include "p_action.h"
char *sprnames[] = {
"IMPX","ACLO","PTN1","SHLD","SHD2","BAGH","SPMP","INVS","PTN2","SOAR",
@@ -41,132 +41,6 @@ char *sprnames[] = {
NULL
};
-void A_FreeTargMobj();
-void A_RestoreSpecialThing1();
-void A_RestoreSpecialThing2();
-void A_HideThing();
-void A_UnHideThing();
-void A_RestoreArtifact();
-void A_Scream();
-void A_Explode();
-void A_PodPain();
-void A_RemovePod();
-void A_MakePod();
-void A_InitKeyGizmo();
-void A_VolcanoSet();
-void A_VolcanoBlast();
-void A_BeastPuff();
-void A_VolcBallImpact();
-void A_SpawnTeleGlitter();
-void A_SpawnTeleGlitter2();
-void A_AccTeleGlitter();
-void A_Light0();
-void A_WeaponReady();
-void A_Lower();
-void A_Raise();
-void A_StaffAttackPL1();
-void A_ReFire();
-void A_StaffAttackPL2();
-void A_BeakReady();
-void A_BeakRaise();
-void A_BeakAttackPL1();
-void A_BeakAttackPL2();
-void A_GauntletAttack();
-void A_FireBlasterPL1();
-void A_FireBlasterPL2();
-void A_SpawnRippers();
-void A_FireMacePL1();
-void A_FireMacePL2();
-void A_MacePL1Check();
-void A_MaceBallImpact();
-void A_MaceBallImpact2();
-void A_DeathBallImpact();
-void A_FireSkullRodPL1();
-void A_FireSkullRodPL2();
-void A_SkullRodPL2Seek();
-void A_AddPlayerRain();
-void A_HideInCeiling();
-void A_SkullRodStorm();
-void A_RainImpact();
-void A_FireGoldWandPL1();
-void A_FireGoldWandPL2();
-void A_FirePhoenixPL1();
-void A_InitPhoenixPL2();
-void A_FirePhoenixPL2();
-void A_ShutdownPhoenixPL2();
-void A_PhoenixPuff();
-void A_FlameEnd();
-void A_FloatPuff();
-void A_FireCrossbowPL1();
-void A_FireCrossbowPL2();
-void A_BoltSpark();
-void A_Pain();
-void A_NoBlocking();
-void A_AddPlayerCorpse();
-void A_SkullPop();
-void A_FlameSnd();
-void A_CheckBurnGone();
-void A_CheckSkullFloor();
-void A_CheckSkullDone();
-void A_Feathers();
-void A_ChicLook();
-void A_ChicChase();
-void A_ChicPain();
-void A_FaceTarget();
-void A_ChicAttack();
-void A_Look();
-void A_Chase();
-void A_MummyAttack();
-void A_MummyAttack2();
-void A_MummySoul();
-void A_ContMobjSound();
-void A_MummyFX1Seek();
-void A_BeastAttack();
-void A_SnakeAttack();
-void A_SnakeAttack2();
-void A_HeadAttack();
-void A_BossDeath();
-void A_HeadIceImpact();
-void A_HeadFireGrow();
-void A_WhirlwindSeek();
-void A_ClinkAttack();
-void A_WizAtk1();
-void A_WizAtk2();
-void A_WizAtk3();
-void A_GhostOff();
-void A_ImpMeAttack();
-void A_ImpMsAttack();
-void A_ImpMsAttack2();
-void A_ImpDeath();
-void A_ImpXDeath1();
-void A_ImpXDeath2();
-void A_ImpExplode();
-void A_KnightAttack();
-void A_DripBlood();
-void A_Sor1Chase();
-void A_Sor1Pain();
-void A_Srcr1Attack();
-void A_SorZap();
-void A_SorcererRise();
-void A_SorRise();
-void A_SorSightSnd();
-void A_Srcr2Decide();
-void A_Srcr2Attack();
-void A_Sor2DthInit();
-void A_SorDSph();
-void A_Sor2DthLoop();
-void A_SorDExp();
-void A_SorDBon();
-void A_BlueSpark();
-void A_GenWizard();
-void A_MinotaurAtk1();
-void A_MinotaurDecide();
-void A_MinotaurAtk2();
-void A_MinotaurAtk3();
-void A_MinotaurCharge();
-void A_MntrFloorFire();
-void A_ESound();
-
state_t states[NUMSTATES] = {
{SPR_IMPX, 0, -1, NULL, S_NULL, 0, 0}, // S_NULL
{SPR_ACLO, 4, 1050, A_FreeTargMobj, S_NULL, 0, 0}, // S_FREETARGMOBJ
@@ -663,6 +537,9 @@ state_t states[NUMSTATES] = {
{SPR_FX08, 32773, 4, NULL, S_PHOENIXFXI1_7, 0, 0}, // S_PHOENIXFXI1_6
{SPR_FX08, 32774, 4, NULL, S_PHOENIXFXI1_8, 0, 0}, // S_PHOENIXFXI1_7
{SPR_FX08, 32775, 4, NULL, S_NULL, 0, 0}, // S_PHOENIXFXI1_8
+ {SPR_FX08, 32776, 8, NULL, S_PHOENIXFXIX_1, 0, 0 }, // S_PHOENIXFXIX_1
+ {SPR_FX08, 32777, 8, A_RemovedPhoenixFunc, S_PHOENIXFXIX_2, 0, 0 }, // S_PHOENIXFXIX_2
+ {SPR_FX08, 32778, 8, NULL, S_NULL, 0, 0 }, // S_PHOENIXFXIX_3
{SPR_FX04, 1, 4, NULL, S_PHOENIXPUFF2, 0, 0}, // S_PHOENIXPUFF1
{SPR_FX04, 2, 4, NULL, S_PHOENIXPUFF3, 0, 0}, // S_PHOENIXPUFF2
{SPR_FX04, 3, 4, NULL, S_PHOENIXPUFF4, 0, 0}, // S_PHOENIXPUFF3
@@ -3727,6 +3604,37 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = {
MF2_THRUGHOST | MF2_NOTELEPORT // flags2
},
+ // The following thing is present in the mobjinfo table from Heretic 1.0,
+ // but not in Heretic 1.3 (ie. it was removed). It has been re-inserted
+ // here to support HHE patches.
+
+ { // MT_PHOENIXFX_REMOVED
+ -1, // doomednum
+ S_PHOENIXFXIX_1, // spawnstate
+ 1000, // spawnhealth
+ S_NULL, // seestate
+ sfx_None, // seesound
+ 8, // reactiontime
+ sfx_None, // attacksound
+ S_NULL, // painstate
+ 0, // painchance
+ sfx_None, // painsound
+ S_NULL, // meleestate
+ S_NULL, // missilestate
+ S_NULL, // crashstate
+ S_PHOENIXFXIX_3, // deathstate
+ S_NULL, // xdeathstate
+ sfx_None, // deathsound
+ 0, // speed
+ 2 * FRACUNIT, // radius
+ 4 * FRACUNIT, // height
+ 100, // mass
+ 0, // damage
+ sfx_None, // activesound
+ MF_NOBLOCKMAP | MF_MISSILE | MF_DROPOFF | MF_NOGRAVITY, // flags
+ MF2_NOTELEPORT // flags2
+ },
+
{ // MT_PHOENIXPUFF
-1, // doomednum
S_PHOENIXPUFF1, // spawnstate
diff --git a/src/heretic/info.h b/src/heretic/info.h
index f9581298..236826cb 100644
--- a/src/heretic/info.h
+++ b/src/heretic/info.h
@@ -21,7 +21,9 @@
// 02111-1307, USA.
//
//-----------------------------------------------------------------------------
-// generated by multigen
+
+#ifndef HERETIC_INFO_H
+#define HERETIC_INFO_H
typedef enum
{
@@ -653,6 +655,9 @@ typedef enum
S_PHOENIXFXI1_6,
S_PHOENIXFXI1_7,
S_PHOENIXFXI1_8,
+ S_PHOENIXFXIX_1, // [ States in Heretic 1.0 that were removed
+ S_PHOENIXFXIX_2,
+ S_PHOENIXFXIX_3, // ]
S_PHOENIXPUFF1,
S_PHOENIXPUFF2,
S_PHOENIXPUFF3,
@@ -773,8 +778,8 @@ typedef enum
S_PLAY_FDTH16,
S_PLAY_FDTH17,
S_PLAY_FDTH18,
- S_PLAY_FDTH19,
- S_PLAY_FDTH20,
+ S_PLAY_FDTH19, // < These two frames were not present in the Heretic
+ S_PLAY_FDTH20, // < 1.0 executable (fire death animation was extended)
S_BLOODYSKULL1,
S_BLOODYSKULL2,
S_BLOODYSKULL3,
@@ -1470,6 +1475,7 @@ typedef enum
MT_GOLDWANDPUFF2,
MT_WPHOENIXROD,
MT_PHOENIXFX1,
+ MT_PHOENIXFX_REMOVED, // In Heretic 1.0, but removed.
MT_PHOENIXPUFF,
MT_PHOENIXFX2,
MT_MISC15,
@@ -1575,3 +1581,6 @@ typedef struct
} mobjinfo_t;
extern mobjinfo_t mobjinfo[NUMMOBJTYPES];
+
+#endif /* #ifndef HERETIC_INFO_H */
+
diff --git a/src/heretic/mn_menu.c b/src/heretic/mn_menu.c
index 33024a96..955e0124 100644
--- a/src/heretic/mn_menu.c
+++ b/src/heretic/mn_menu.c
@@ -25,6 +25,8 @@
// MN_menu.c
#include <ctype.h>
+
+#include "deh_str.h"
#include "doomdef.h"
#include "doomkeys.h"
#include "i_system.h"
@@ -73,7 +75,7 @@ typedef struct
{
ItemType_t type;
char *text;
- boolean(*func) (int option);
+ boolean(*func) (int option);
int option;
MenuType_t menu;
} MenuItem_t;
@@ -305,7 +307,7 @@ void MN_Init(void)
InitFonts();
MenuActive = false;
messageson = true;
- SkullBaseLump = W_GetNumForName("M_SKL00");
+ SkullBaseLump = W_GetNumForName(DEH_String("M_SKL00"));
if (gamemode == retail)
{ // Add episodes 4 and 5 to the menu
@@ -322,8 +324,8 @@ void MN_Init(void)
static void InitFonts(void)
{
- FontABaseLump = W_GetNumForName("FONTA_S") + 1;
- FontBBaseLump = W_GetNumForName("FONTB_S") + 1;
+ FontABaseLump = W_GetNumForName(DEH_String("FONTA_S")) + 1;
+ FontBBaseLump = W_GetNumForName(DEH_String("FONTB_S")) + 1;
}
//---------------------------------------------------------------------------
@@ -476,26 +478,28 @@ void MN_Drawer(void)
int x;
int y;
MenuItem_t *item;
+ char *message;
char *selName;
if (MenuActive == false)
{
if (askforquit)
{
- MN_DrTextA(QuitEndMsg[typeofask - 1], 160 -
- MN_TextAWidth(QuitEndMsg[typeofask - 1]) / 2, 80);
+ message = DEH_String(QuitEndMsg[typeofask - 1]);
+
+ MN_DrTextA(message, 160 - MN_TextAWidth(message) / 2, 80);
if (typeofask == 3)
{
MN_DrTextA(SlotText[quicksave - 1], 160 -
MN_TextAWidth(SlotText[quicksave - 1]) / 2, 90);
- MN_DrTextA("?", 160 +
+ MN_DrTextA(DEH_String("?"), 160 +
MN_TextAWidth(SlotText[quicksave - 1]) / 2, 90);
}
if (typeofask == 4)
{
MN_DrTextA(SlotText[quickload - 1], 160 -
MN_TextAWidth(SlotText[quickload - 1]) / 2, 90);
- MN_DrTextA("?", 160 +
+ MN_DrTextA(DEH_String("?"), 160 +
MN_TextAWidth(SlotText[quickload - 1]) / 2, 90);
}
UpdateState |= I_FULLSCRN;
@@ -525,13 +529,13 @@ void MN_Drawer(void)
{
if (item->type != ITT_EMPTY && item->text)
{
- MN_DrTextB(item->text, x, y);
+ MN_DrTextB(DEH_String(item->text), x, y);
}
y += ITEM_HEIGHT;
item++;
}
y = CurrentMenu->y + (CurrentItPos * ITEM_HEIGHT) + SELECTOR_YOFFSET;
- selName = MenuTime & 16 ? "M_SLCTR1" : "M_SLCTR2";
+ selName = DEH_String(MenuTime & 16 ? "M_SLCTR1" : "M_SLCTR2");
V_DrawPatch(x + SELECTOR_XOFFSET, y,
W_CacheLumpName(selName, PU_CACHE));
}
@@ -548,7 +552,7 @@ static void DrawMainMenu(void)
int frame;
frame = (MenuTime / 3) % 18;
- V_DrawPatch(88, 0, W_CacheLumpName("M_HTIC", PU_CACHE));
+ V_DrawPatch(88, 0, W_CacheLumpName(DEH_String("M_HTIC"), PU_CACHE));
V_DrawPatch(40, 10, W_CacheLumpNum(SkullBaseLump + (17 - frame),
PU_CACHE));
V_DrawPatch(232, 10, W_CacheLumpNum(SkullBaseLump + frame, PU_CACHE));
@@ -597,7 +601,11 @@ static void DrawFilesMenu(void)
static void DrawLoadMenu(void)
{
- MN_DrTextB("LOAD GAME", 160 - MN_TextBWidth("LOAD GAME") / 2, 10);
+ char *title;
+
+ title = DEH_String("LOAD GAME");
+
+ MN_DrTextB(title, 160 - MN_TextBWidth(title) / 2, 10);
if (!slottextloaded)
{
MN_LoadSlotText();
@@ -613,7 +621,11 @@ static void DrawLoadMenu(void)
static void DrawSaveMenu(void)
{
- MN_DrTextB("SAVE GAME", 160 - MN_TextBWidth("SAVE GAME") / 2, 10);
+ char *title;
+
+ title = DEH_String("SAVE GAME");
+
+ MN_DrTextB(title, 160 - MN_TextBWidth(title) / 2, 10);
if (!slottextloaded)
{
MN_LoadSlotText();
@@ -675,7 +687,7 @@ static void DrawFileSlots(Menu_t * menu)
y = menu->y;
for (i = 0; i < 6; i++)
{
- V_DrawPatch(x, y, W_CacheLumpName("M_FSLOT", PU_CACHE));
+ V_DrawPatch(x, y, W_CacheLumpName(DEH_String("M_FSLOT"), PU_CACHE));
if (SlotStatus[i])
{
MN_DrTextA(SlotText[i], x + 5, y + 5);
@@ -694,11 +706,11 @@ static void DrawOptionsMenu(void)
{
if (messageson)
{
- MN_DrTextB("ON", 196, 50);
+ MN_DrTextB(DEH_String("ON"), 196, 50);
}
else
{
- MN_DrTextB("OFF", 196, 50);
+ MN_DrTextB(DEH_String("OFF"), 196, 50);
}
DrawSlider(&OptionsMenu, 3, 10, mouseSensitivity);
}
@@ -796,11 +808,11 @@ static boolean SCMessages(int option)
messageson ^= 1;
if (messageson)
{
- P_SetMessage(&players[consoleplayer], "MESSAGES ON", true);
+ P_SetMessage(&players[consoleplayer], DEH_String("MESSAGES ON"), true);
}
else
{
- P_SetMessage(&players[consoleplayer], "MESSAGES OFF", true);
+ P_SetMessage(&players[consoleplayer], DEH_String("MESSAGES OFF"), true);
}
S_StartSound(NULL, sfx_chat);
return true;
@@ -1460,7 +1472,7 @@ boolean MN_Responder(event_t * event)
if (CurrentMenu->items[i].text)
{
if (toupper(charTyped)
- == toupper(CurrentMenu->items[i].text[0]))
+ == toupper(DEH_String(CurrentMenu->items[i].text)[0]))
{
CurrentItPos = i;
return (true);
@@ -1628,13 +1640,13 @@ static void DrawSlider(Menu_t * menu, int item, int width, int slot)
x = menu->x + 24;
y = menu->y + 2 + (item * ITEM_HEIGHT);
- V_DrawPatch(x - 32, y, W_CacheLumpName("M_SLDLT", PU_CACHE));
+ V_DrawPatch(x - 32, y, W_CacheLumpName(DEH_String("M_SLDLT"), PU_CACHE));
for (x2 = x, count = width; count--; x2 += 8)
{
- V_DrawPatch(x2, y, W_CacheLumpName(count & 1 ? "M_SLDMD1"
- : "M_SLDMD2", PU_CACHE));
+ V_DrawPatch(x2, y, W_CacheLumpName(DEH_String(count & 1 ? "M_SLDMD1"
+ : "M_SLDMD2"), PU_CACHE));
}
- V_DrawPatch(x2, y, W_CacheLumpName("M_SLDRT", PU_CACHE));
+ V_DrawPatch(x2, y, W_CacheLumpName(DEH_String("M_SLDRT"), PU_CACHE));
V_DrawPatch(x + 4 + slot * 8, y + 7,
- W_CacheLumpName("M_SLDKB", PU_CACHE));
+ W_CacheLumpName(DEH_String("M_SLDKB"), PU_CACHE));
}
diff --git a/src/heretic/p_action.h b/src/heretic/p_action.h
new file mode 100644
index 00000000..8d8e383c
--- /dev/null
+++ b/src/heretic/p_action.h
@@ -0,0 +1,160 @@
+// Emacs style mode select -*- C++ -*-
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 1993-1996 Id Software, Inc.
+// Copyright(C) 1993-2008 Raven Software
+// Copyright(C) 2008 Simon Howard
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+//
+//-----------------------------------------------------------------------------
+//
+// External definitions for action pointer functions.
+//
+//-----------------------------------------------------------------------------
+
+#ifndef HERETIC_P_ACTION_H
+#define HERETIC_P_ACTION_H
+
+void A_FreeTargMobj();
+void A_RestoreSpecialThing1();
+void A_RestoreSpecialThing2();
+void A_HideThing();
+void A_UnHideThing();
+void A_RestoreArtifact();
+void A_Scream();
+void A_Explode();
+void A_PodPain();
+void A_RemovePod();
+void A_MakePod();
+void A_InitKeyGizmo();
+void A_VolcanoSet();
+void A_VolcanoBlast();
+void A_BeastPuff();
+void A_VolcBallImpact();
+void A_SpawnTeleGlitter();
+void A_SpawnTeleGlitter2();
+void A_AccTeleGlitter();
+void A_Light0();
+void A_WeaponReady();
+void A_Lower();
+void A_Raise();
+void A_StaffAttackPL1();
+void A_ReFire();
+void A_StaffAttackPL2();
+void A_BeakReady();
+void A_BeakRaise();
+void A_BeakAttackPL1();
+void A_BeakAttackPL2();
+void A_GauntletAttack();
+void A_FireBlasterPL1();
+void A_FireBlasterPL2();
+void A_SpawnRippers();
+void A_FireMacePL1();
+void A_FireMacePL2();
+void A_MacePL1Check();
+void A_MaceBallImpact();
+void A_MaceBallImpact2();
+void A_DeathBallImpact();
+void A_FireSkullRodPL1();
+void A_FireSkullRodPL2();
+void A_SkullRodPL2Seek();
+void A_AddPlayerRain();
+void A_HideInCeiling();
+void A_SkullRodStorm();
+void A_RainImpact();
+void A_FireGoldWandPL1();
+void A_FireGoldWandPL2();
+void A_FirePhoenixPL1();
+void A_InitPhoenixPL2();
+void A_FirePhoenixPL2();
+void A_ShutdownPhoenixPL2();
+void A_PhoenixPuff();
+void A_RemovedPhoenixFunc();
+void A_FlameEnd();
+void A_FloatPuff();
+void A_FireCrossbowPL1();
+void A_FireCrossbowPL2();
+void A_BoltSpark();
+void A_Pain();
+void A_NoBlocking();
+void A_AddPlayerCorpse();
+void A_SkullPop();
+void A_FlameSnd();
+void A_CheckBurnGone();
+void A_CheckSkullFloor();
+void A_CheckSkullDone();
+void A_Feathers();
+void A_ChicLook();
+void A_ChicChase();
+void A_ChicPain();
+void A_FaceTarget();
+void A_ChicAttack();
+void A_Look();
+void A_Chase();
+void A_MummyAttack();
+void A_MummyAttack2();
+void A_MummySoul();
+void A_ContMobjSound();
+void A_MummyFX1Seek();
+void A_BeastAttack();
+void A_SnakeAttack();
+void A_SnakeAttack2();
+void A_HeadAttack();
+void A_BossDeath();
+void A_HeadIceImpact();
+void A_HeadFireGrow();
+void A_WhirlwindSeek();
+void A_ClinkAttack();
+void A_WizAtk1();
+void A_WizAtk2();
+void A_WizAtk3();
+void A_GhostOff();
+void A_ImpMeAttack();
+void A_ImpMsAttack();
+void A_ImpMsAttack2();
+void A_ImpDeath();
+void A_ImpXDeath1();
+void A_ImpXDeath2();
+void A_ImpExplode();
+void A_KnightAttack();
+void A_DripBlood();
+void A_Sor1Chase();
+void A_Sor1Pain();
+void A_Srcr1Attack();
+void A_SorZap();
+void A_SorcererRise();
+void A_SorRise();
+void A_SorSightSnd();
+void A_Srcr2Decide();
+void A_Srcr2Attack();
+void A_Sor2DthInit();
+void A_SorDSph();
+void A_Sor2DthLoop();
+void A_SorDExp();
+void A_SorDBon();
+void A_BlueSpark();
+void A_GenWizard();
+void A_MinotaurAtk1();
+void A_MinotaurDecide();
+void A_MinotaurAtk2();
+void A_MinotaurAtk3();
+void A_MinotaurCharge();
+void A_MntrFloorFire();
+void A_ESound();
+
+#endif /* #ifndef HERETIC_P_ACTION_H */
+
diff --git a/src/heretic/p_doors.c b/src/heretic/p_doors.c
index e0e82fbe..56e37119 100644
--- a/src/heretic/p_doors.c
+++ b/src/heretic/p_doors.c
@@ -25,6 +25,7 @@
// P_doors.c
#include "doomdef.h"
+#include "deh_str.h"
#include "p_local.h"
#include "s_sound.h"
#include "v_video.h"
@@ -232,7 +233,7 @@ void EV_VerticalDoor(line_t * line, mobj_t * thing)
}
if (!player->keys[key_blue])
{
- P_SetMessage(player, TXT_NEEDBLUEKEY, false);
+ P_SetMessage(player, DEH_String(TXT_NEEDBLUEKEY), false);
S_StartSound(NULL, sfx_plroof);
return;
}
@@ -245,7 +246,7 @@ void EV_VerticalDoor(line_t * line, mobj_t * thing)
}
if (!player->keys[key_yellow])
{
- P_SetMessage(player, TXT_NEEDYELLOWKEY, false);
+ P_SetMessage(player, DEH_String(TXT_NEEDYELLOWKEY), false);
S_StartSound(NULL, sfx_plroof);
return;
}
@@ -258,7 +259,7 @@ void EV_VerticalDoor(line_t * line, mobj_t * thing)
}
if (!player->keys[key_green])
{
- P_SetMessage(player, TXT_NEEDGREENKEY, false);
+ P_SetMessage(player, DEH_String(TXT_NEEDGREENKEY), false);
S_StartSound(NULL, sfx_plroof);
return;
}
diff --git a/src/heretic/p_inter.c b/src/heretic/p_inter.c
index fba6d215..afdb37f2 100644
--- a/src/heretic/p_inter.c
+++ b/src/heretic/p_inter.c
@@ -25,6 +25,7 @@
// P_inter.c
#include "doomdef.h"
+#include "deh_str.h"
#include "i_system.h"
#include "i_timer.h"
#include "m_random.h"
@@ -54,7 +55,7 @@ int maxammo[NUMAMMO] = {
150 // mace
};
-static int GetWeaponAmmo[NUMWEAPONS] = {
+int GetWeaponAmmo[NUMWEAPONS] = {
0, // staff
25, // gold wand
10, // crossbow
@@ -580,21 +581,21 @@ void P_TouchSpecialThing(mobj_t * special, mobj_t * toucher)
{
return;
}
- P_SetMessage(player, TXT_ITEMHEALTH, false);
+ P_SetMessage(player, DEH_String(TXT_ITEMHEALTH), false);
break;
case SPR_SHLD: // Item_Shield1
if (!P_GiveArmor(player, 1))
{
return;
}
- P_SetMessage(player, TXT_ITEMSHIELD1, false);
+ P_SetMessage(player, DEH_String(TXT_ITEMSHIELD1), false);
break;
case SPR_SHD2: // Item_Shield2
if (!P_GiveArmor(player, 2))
{
return;
}
- P_SetMessage(player, TXT_ITEMSHIELD2, false);
+ P_SetMessage(player, DEH_String(TXT_ITEMSHIELD2), false);
break;
case SPR_BAGH: // Item_BagOfHolding
if (!player->backpack)
@@ -610,21 +611,21 @@ void P_TouchSpecialThing(mobj_t * special, mobj_t * toucher)
P_GiveAmmo(player, am_crossbow, AMMO_CBOW_WIMPY);
P_GiveAmmo(player, am_skullrod, AMMO_SKRD_WIMPY);
P_GiveAmmo(player, am_phoenixrod, AMMO_PHRD_WIMPY);
- P_SetMessage(player, TXT_ITEMBAGOFHOLDING, false);
+ P_SetMessage(player, DEH_String(TXT_ITEMBAGOFHOLDING), false);
break;
case SPR_SPMP: // Item_SuperMap
if (!P_GivePower(player, pw_allmap))
{
return;
}
- P_SetMessage(player, TXT_ITEMSUPERMAP, false);
+ P_SetMessage(player, DEH_String(TXT_ITEMSUPERMAP), false);
break;
// Keys
case SPR_BKYY: // Key_Blue
if (!player->keys[key_blue])
{
- P_SetMessage(player, TXT_GOTBLUEKEY, false);
+ P_SetMessage(player, DEH_String(TXT_GOTBLUEKEY), false);
}
P_GiveKey(player, key_blue);
sound = sfx_keyup;
@@ -636,7 +637,7 @@ void P_TouchSpecialThing(mobj_t * special, mobj_t * toucher)
case SPR_CKYY: // Key_Yellow
if (!player->keys[key_yellow])
{
- P_SetMessage(player, TXT_GOTYELLOWKEY, false);
+ P_SetMessage(player, DEH_String(TXT_GOTYELLOWKEY), false);
}
sound = sfx_keyup;
P_GiveKey(player, key_yellow);
@@ -648,7 +649,7 @@ void P_TouchSpecialThing(mobj_t * special, mobj_t * toucher)
case SPR_AKYY: // Key_Green
if (!player->keys[key_green])
{
- P_SetMessage(player, TXT_GOTGREENKEY, false);
+ P_SetMessage(player, DEH_String(TXT_GOTGREENKEY), false);
}
sound = sfx_keyup;
P_GiveKey(player, key_green);
@@ -662,70 +663,70 @@ void P_TouchSpecialThing(mobj_t * special, mobj_t * toucher)
case SPR_PTN2: // Arti_HealingPotion
if (P_GiveArtifact(player, arti_health, special))
{
- P_SetMessage(player, TXT_ARTIHEALTH, false);
+ P_SetMessage(player, DEH_String(TXT_ARTIHEALTH), false);
P_SetDormantArtifact(special);
}
return;
case SPR_SOAR: // Arti_Fly
if (P_GiveArtifact(player, arti_fly, special))
{
- P_SetMessage(player, TXT_ARTIFLY, false);
+ P_SetMessage(player, DEH_String(TXT_ARTIFLY), false);
P_SetDormantArtifact(special);
}
return;
case SPR_INVU: // Arti_Invulnerability
if (P_GiveArtifact(player, arti_invulnerability, special))
{
- P_SetMessage(player, TXT_ARTIINVULNERABILITY, false);
+ P_SetMessage(player, DEH_String(TXT_ARTIINVULNERABILITY), false);
P_SetDormantArtifact(special);
}
return;
case SPR_PWBK: // Arti_TomeOfPower
if (P_GiveArtifact(player, arti_tomeofpower, special))
{
- P_SetMessage(player, TXT_ARTITOMEOFPOWER, false);
+ P_SetMessage(player, DEH_String(TXT_ARTITOMEOFPOWER), false);
P_SetDormantArtifact(special);
}
return;
case SPR_INVS: // Arti_Invisibility
if (P_GiveArtifact(player, arti_invisibility, special))
{
- P_SetMessage(player, TXT_ARTIINVISIBILITY, false);
+ P_SetMessage(player, DEH_String(TXT_ARTIINVISIBILITY), false);
P_SetDormantArtifact(special);
}
return;
case SPR_EGGC: // Arti_Egg
if (P_GiveArtifact(player, arti_egg, special))
{
- P_SetMessage(player, TXT_ARTIEGG, false);
+ P_SetMessage(player, DEH_String(TXT_ARTIEGG), false);
P_SetDormantArtifact(special);
}
return;
case SPR_SPHL: // Arti_SuperHealth
if (P_GiveArtifact(player, arti_superhealth, special))
{
- P_SetMessage(player, TXT_ARTISUPERHEALTH, false);
+ P_SetMessage(player, DEH_String(TXT_ARTISUPERHEALTH), false);
P_SetDormantArtifact(special);
}
return;
case SPR_TRCH: // Arti_Torch
if (P_GiveArtifact(player, arti_torch, special))
{
- P_SetMessage(player, TXT_ARTITORCH, false);
+ P_SetMessage(player, DEH_String(TXT_ARTITORCH), false);
P_SetDormantArtifact(special);
}
return;
case SPR_FBMB: // Arti_FireBomb
if (P_GiveArtifact(player, arti_firebomb, special))
{
- P_SetMessage(player, TXT_ARTIFIREBOMB, false);
+ P_SetMessage(player, DEH_String(TXT_ARTIFIREBOMB), false);
P_SetDormantArtifact(special);
}
return;
case SPR_ATLP: // Arti_Teleport
if (P_GiveArtifact(player, arti_teleport, special))
{
- P_SetMessage(player, TXT_ARTITELEPORT, false);
+ P_SetMessage(player, DEH_String(TXT_ARTITELEPORT), false);
P_SetDormantArtifact(special);
}
return;
@@ -736,84 +737,84 @@ void P_TouchSpecialThing(mobj_t * special, mobj_t * toucher)
{
return;
}
- P_SetMessage(player, TXT_AMMOGOLDWAND1, false);
+ P_SetMessage(player, DEH_String(TXT_AMMOGOLDWAND1), false);
break;
case SPR_AMG2: // Ammo_GoldWandHefty
if (!P_GiveAmmo(player, am_goldwand, special->health))
{
return;
}
- P_SetMessage(player, TXT_AMMOGOLDWAND2, false);
+ P_SetMessage(player, DEH_String(TXT_AMMOGOLDWAND2), false);
break;
case SPR_AMM1: // Ammo_MaceWimpy
if (!P_GiveAmmo(player, am_mace, special->health))
{
return;
}
- P_SetMessage(player, TXT_AMMOMACE1, false);
+ P_SetMessage(player, DEH_String(TXT_AMMOMACE1), false);
break;
case SPR_AMM2: // Ammo_MaceHefty
if (!P_GiveAmmo(player, am_mace, special->health))
{
return;
}
- P_SetMessage(player, TXT_AMMOMACE2, false);
+ P_SetMessage(player, DEH_String(TXT_AMMOMACE2), false);
break;
case SPR_AMC1: // Ammo_CrossbowWimpy
if (!P_GiveAmmo(player, am_crossbow, special->health))
{
return;
}
- P_SetMessage(player, TXT_AMMOCROSSBOW1, false);
+ P_SetMessage(player, DEH_String(TXT_AMMOCROSSBOW1), false);
break;
case SPR_AMC2: // Ammo_CrossbowHefty
if (!P_GiveAmmo(player, am_crossbow, special->health))
{
return;
}
- P_SetMessage(player, TXT_AMMOCROSSBOW2, false);
+ P_SetMessage(player, DEH_String(TXT_AMMOCROSSBOW2), false);
break;
case SPR_AMB1: // Ammo_BlasterWimpy
if (!P_GiveAmmo(player, am_blaster, special->health))
{
return;
}
- P_SetMessage(player, TXT_AMMOBLASTER1, false);
+ P_SetMessage(player, DEH_String(TXT_AMMOBLASTER1), false);
break;
case SPR_AMB2: // Ammo_BlasterHefty
if (!P_GiveAmmo(player, am_blaster, special->health))
{
return;
}
- P_SetMessage(player, TXT_AMMOBLASTER2, false);
+ P_SetMessage(player, DEH_String(TXT_AMMOBLASTER2), false);
break;
case SPR_AMS1: // Ammo_SkullRodWimpy
if (!P_GiveAmmo(player, am_skullrod, special->health))
{
return;
}
- P_SetMessage(player, TXT_AMMOSKULLROD1, false);
+ P_SetMessage(player, DEH_String(TXT_AMMOSKULLROD1), false);
break;
case SPR_AMS2: // Ammo_SkullRodHefty
if (!P_GiveAmmo(player, am_skullrod, special->health))
{
return;
}
- P_SetMessage(player, TXT_AMMOSKULLROD2, false);
+ P_SetMessage(player, DEH_String(TXT_AMMOSKULLROD2), false);
break;
case SPR_AMP1: // Ammo_PhoenixRodWimpy
if (!P_GiveAmmo(player, am_phoenixrod, special->health))
{
return;
}
- P_SetMessage(player, TXT_AMMOPHOENIXROD1, false);
+ P_SetMessage(player, DEH_String(TXT_AMMOPHOENIXROD1), false);
break;
case SPR_AMP2: // Ammo_PhoenixRodHefty
if (!P_GiveAmmo(player, am_phoenixrod, special->health))
{
return;
}
- P_SetMessage(player, TXT_AMMOPHOENIXROD2, false);
+ P_SetMessage(player, DEH_String(TXT_AMMOPHOENIXROD2), false);
break;
// Weapons
@@ -822,7 +823,7 @@ void P_TouchSpecialThing(mobj_t * special, mobj_t * toucher)
{
return;
}
- P_SetMessage(player, TXT_WPNMACE, false);
+ P_SetMessage(player, DEH_String(TXT_WPNMACE), false);
sound = sfx_wpnup;
break;
case SPR_WBOW: // Weapon_Crossbow
@@ -830,7 +831,7 @@ void P_TouchSpecialThing(mobj_t * special, mobj_t * toucher)
{
return;
}
- P_SetMessage(player, TXT_WPNCROSSBOW, false);
+ P_SetMessage(player, DEH_String(TXT_WPNCROSSBOW), false);
sound = sfx_wpnup;
break;
case SPR_WBLS: // Weapon_Blaster
@@ -838,7 +839,7 @@ void P_TouchSpecialThing(mobj_t * special, mobj_t * toucher)
{
return;
}
- P_SetMessage(player, TXT_WPNBLASTER, false);
+ P_SetMessage(player, DEH_String(TXT_WPNBLASTER), false);
sound = sfx_wpnup;
break;
case SPR_WSKL: // Weapon_SkullRod
@@ -846,7 +847,7 @@ void P_TouchSpecialThing(mobj_t * special, mobj_t * toucher)
{
return;
}
- P_SetMessage(player, TXT_WPNSKULLROD, false);
+ P_SetMessage(player, DEH_String(TXT_WPNSKULLROD), false);
sound = sfx_wpnup;
break;
case SPR_WPHX: // Weapon_PhoenixRod
@@ -854,7 +855,7 @@ void P_TouchSpecialThing(mobj_t * special, mobj_t * toucher)
{
return;
}
- P_SetMessage(player, TXT_WPNPHOENIXROD, false);
+ P_SetMessage(player, DEH_String(TXT_WPNPHOENIXROD), false);
sound = sfx_wpnup;
break;
case SPR_WGNT: // Weapon_Gauntlets
@@ -862,7 +863,7 @@ void P_TouchSpecialThing(mobj_t * special, mobj_t * toucher)
{
return;
}
- P_SetMessage(player, TXT_WPNGAUNTLETS, false);
+ P_SetMessage(player, DEH_String(TXT_WPNGAUNTLETS), false);
sound = sfx_wpnup;
break;
default:
diff --git a/src/heretic/p_pspr.c b/src/heretic/p_pspr.c
index 7f9660ac..bd47c9a1 100644
--- a/src/heretic/p_pspr.c
+++ b/src/heretic/p_pspr.c
@@ -1650,6 +1650,17 @@ void A_PhoenixPuff(mobj_t * actor)
puff->momz = 0;
}
+//
+// This function was present in the Heretic 1.0 executable for the
+// removed "secondary phoenix flash" object (MT_PHOENIXFX_REMOVED).
+// The purpose of this object is unknown, as is this function.
+//
+
+void A_RemovedPhoenixFunc(mobj_t *actor)
+{
+ I_Error("Action function invoked for removed Phoenix action!");
+}
+
//----------------------------------------------------------------------------
//
// PROC A_InitPhoenixPL2
diff --git a/src/heretic/p_spec.c b/src/heretic/p_spec.c
index 6227237b..49c067fa 100644
--- a/src/heretic/p_spec.c
+++ b/src/heretic/p_spec.c
@@ -25,6 +25,7 @@
// P_Spec.c
#include "doomdef.h"
+#include "deh_str.h"
#include "i_system.h"
#include "i_timer.h"
#include "m_random.h"
@@ -204,18 +205,12 @@ struct
int type;
} TerrainTypeDefs[] =
{
- {
- "FLTWAWA1", FLOOR_WATER},
- {
- "FLTFLWW1", FLOOR_WATER},
- {
- "FLTLAVA1", FLOOR_LAVA},
- {
- "FLATHUH1", FLOOR_LAVA},
- {
- "FLTSLUD1", FLOOR_SLUDGE},
- {
- "END", -1}
+ { "FLTWAWA1", FLOOR_WATER },
+ { "FLTFLWW1", FLOOR_WATER },
+ { "FLTLAVA1", FLOOR_LAVA },
+ { "FLATHUH1", FLOOR_LAVA },
+ { "FLTSLUD1", FLOOR_SLUDGE },
+ { "END", -1 }
};
mobj_t LavaInflictor;
@@ -266,35 +261,40 @@ void P_InitTerrainTypes(void)
void P_InitPicAnims(void)
{
+ char *startname;
+ char *endname;
int i;
lastanim = anims;
for (i = 0; animdefs[i].istexture != -1; i++)
{
+ startname = DEH_String(animdefs[i].startname);
+ endname = DEH_String(animdefs[i].endname);
+
if (animdefs[i].istexture)
{ // Texture animation
- if (R_CheckTextureNumForName(animdefs[i].startname) == -1)
+ if (R_CheckTextureNumForName(startname) == -1)
{ // Texture doesn't exist
continue;
}
- lastanim->picnum = R_TextureNumForName(animdefs[i].endname);
- lastanim->basepic = R_TextureNumForName(animdefs[i].startname);
+ lastanim->picnum = R_TextureNumForName(endname);
+ lastanim->basepic = R_TextureNumForName(startname);
}
else
{ // Flat animation
- if (W_CheckNumForName(animdefs[i].startname) == -1)
+ if (W_CheckNumForName(startname) == -1)
{ // Flat doesn't exist
continue;
}
- lastanim->picnum = R_FlatNumForName(animdefs[i].endname);
- lastanim->basepic = R_FlatNumForName(animdefs[i].startname);
+ lastanim->picnum = R_FlatNumForName(endname);
+ lastanim->basepic = R_FlatNumForName(startname);
}
lastanim->istexture = animdefs[i].istexture;
lastanim->numpics = lastanim->picnum - lastanim->basepic + 1;
if (lastanim->numpics < 2)
{
I_Error("P_InitPicAnims: bad cycle from %s to %s",
- animdefs[i].startname, animdefs[i].endname);
+ startname, endname);
}
lastanim->speed = animdefs[i].speed;
lastanim++;
@@ -1132,7 +1132,7 @@ void P_SpawnSpecials(void)
int episode;
episode = 1;
- if (W_CheckNumForName("texture2") >= 0)
+ if (W_CheckNumForName(DEH_String("texture2")) >= 0)
episode = 2;
//
diff --git a/src/heretic/p_switch.c b/src/heretic/p_switch.c
index cef6a74b..2ec758b6 100644
--- a/src/heretic/p_switch.c
+++ b/src/heretic/p_switch.c
@@ -23,6 +23,7 @@
//-----------------------------------------------------------------------------
#include "doomdef.h"
+#include "deh_str.h"
#include "i_system.h"
#include "p_local.h"
#include "s_sound.h"
@@ -129,9 +130,9 @@ void P_InitSwitchList(void)
if (alphSwitchList[i].episode <= episode)
{
switchlist[index++] =
- R_TextureNumForName(alphSwitchList[i].name1);
+ R_TextureNumForName(DEH_String(alphSwitchList[i].name1));
switchlist[index++] =
- R_TextureNumForName(alphSwitchList[i].name2);
+ R_TextureNumForName(DEH_String(alphSwitchList[i].name2));
}
}
}
diff --git a/src/heretic/p_user.c b/src/heretic/p_user.c
index 63368bab..16dbed49 100644
--- a/src/heretic/p_user.c
+++ b/src/heretic/p_user.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include "doomdef.h"
+#include "deh_str.h"
#include "m_random.h"
#include "p_local.h"
#include "s_sound.h"
@@ -394,7 +395,7 @@ void P_DeathThink(player_t * player)
{
if (player == &players[consoleplayer])
{
- I_SetPalette((byte *) W_CacheLumpName("PLAYPAL", PU_CACHE));
+ I_SetPalette(W_CacheLumpName(DEH_String("PLAYPAL"), PU_CACHE));
inv_ptr = 0;
curpos = 0;
newtorch = 0;
diff --git a/src/heretic/r_data.c b/src/heretic/r_data.c
index ee005248..5bb79aa4 100644
--- a/src/heretic/r_data.c
+++ b/src/heretic/r_data.c
@@ -25,6 +25,8 @@
// R_data.c
#include "doomdef.h"
+#include "deh_str.h"
+
#include "i_swap.h"
#include "i_system.h"
#include "r_local.h"
@@ -316,12 +318,17 @@ void R_InitTextures(void)
int offset, maxoff, maxoff2;
int numtextures1, numtextures2;
int *directory;
+ char *texture1, *texture2, *pnames;
+
+ texture1 = DEH_String("TEXTURE1");
+ texture2 = DEH_String("TEXTURE2");
+ pnames = DEH_String("PNAMES");
//
// load the patch names from pnames.lmp
//
name[8] = 0;
- names = W_CacheLumpName("PNAMES", PU_STATIC);
+ names = W_CacheLumpName(pnames, PU_STATIC);
nummappatches = LONG(*((int *) names));
name_p = names + 4;
patchlookup = Z_Malloc(nummappatches * sizeof(*patchlookup), PU_STATIC, NULL);
@@ -330,21 +337,21 @@ void R_InitTextures(void)
strncpy(name, name_p + i * 8, 8);
patchlookup[i] = W_CheckNumForName(name);
}
- W_ReleaseLumpName("PNAMES");
+ W_ReleaseLumpName(pnames);
//
// load the map texture definitions from textures.lmp
//
- maptex = maptex1 = W_CacheLumpName("TEXTURE1", PU_STATIC);
+ maptex = maptex1 = W_CacheLumpName(texture1, PU_STATIC);
numtextures1 = LONG(*maptex);
- maxoff = W_LumpLength(W_GetNumForName("TEXTURE1"));
+ maxoff = W_LumpLength(W_GetNumForName(texture1));
directory = maptex + 1;
- if (W_CheckNumForName("TEXTURE2") != -1)
+ if (W_CheckNumForName(texture2) != -1)
{
- maptex2 = W_CacheLumpName("TEXTURE2", PU_STATIC);
+ maptex2 = W_CacheLumpName(texture2, PU_STATIC);
numtextures2 = LONG(*maptex2);
- maxoff2 = W_LumpLength(W_GetNumForName("TEXTURE2"));
+ maxoff2 = W_LumpLength(W_GetNumForName(texture2));
}
else
{
@@ -358,8 +365,11 @@ void R_InitTextures(void)
// Init the startup thermometer at this point...
//
{
+ int start, end;
int spramount;
- spramount = W_GetNumForName("S_END") - W_GetNumForName("S_START") + 1;
+ start = W_GetNumForName(DEH_String("S_START"));
+ end = W_GetNumForName(DEH_String("S_END"));
+ spramount = end - start + 1;
InitThermo(spramount + numtextures + 6);
}
@@ -427,10 +437,10 @@ void R_InitTextures(void)
Z_Free(patchlookup);
- W_ReleaseLumpName("TEXTURE1");
+ W_ReleaseLumpName(texture1);
if (maptex2)
{
- W_ReleaseLumpName("TEXTURE2");
+ W_ReleaseLumpName(texture2);
}
//
@@ -463,8 +473,8 @@ void R_InitFlats(void)
{
int i;
- firstflat = W_GetNumForName("F_START") + 1;
- lastflat = W_GetNumForName("F_END") - 1;
+ firstflat = W_GetNumForName(DEH_String("F_START")) + 1;
+ lastflat = W_GetNumForName(DEH_String("F_END")) - 1;
numflats = lastflat - firstflat + 1;
// translation table for global animation
@@ -489,8 +499,8 @@ void R_InitSpriteLumps(void)
int i;
patch_t *patch;
- firstspritelump = W_GetNumForName("S_START") + 1;
- lastspritelump = W_GetNumForName("S_END") - 1;
+ firstspritelump = W_GetNumForName(DEH_String("S_START")) + 1;
+ lastspritelump = W_GetNumForName(DEH_String("S_END")) - 1;
numspritelumps = lastspritelump - firstspritelump + 1;
spritewidth = Z_Malloc(numspritelumps * sizeof(fixed_t), PU_STATIC, 0);
spriteoffset = Z_Malloc(numspritelumps * sizeof(fixed_t), PU_STATIC, 0);
@@ -527,7 +537,7 @@ void R_InitColormaps(void)
// load in the light tables
// 256 byte align tables
//
- lump = W_GetNumForName("COLORMAP");
+ lump = W_GetNumForName(DEH_String("COLORMAP"));
length = W_LumpLength(lump);
colormaps = Z_Malloc(length, PU_STATIC, 0);
W_ReadLump(lump, colormaps);
diff --git a/src/heretic/r_draw.c b/src/heretic/r_draw.c
index 5a20b50a..88653df1 100644
--- a/src/heretic/r_draw.c
+++ b/src/heretic/r_draw.c
@@ -24,6 +24,7 @@
// R_draw.c
#include "doomdef.h"
+#include "deh_str.h"
#include "r_local.h"
#include "i_video.h"
#include "v_video.h"
@@ -386,11 +387,11 @@ void R_DrawViewBorder(void)
if (gamemode == shareware)
{
- src = W_CacheLumpName("FLOOR04", PU_CACHE);
+ src = W_CacheLumpName(DEH_String("FLOOR04"), PU_CACHE);
}
else
{
- src = W_CacheLumpName("FLAT513", PU_CACHE);
+ src = W_CacheLumpName(DEH_String("FLAT513"), PU_CACHE);
}
dest = I_VideoBuffer;
@@ -409,24 +410,26 @@ void R_DrawViewBorder(void)
}
for (x = viewwindowx; x < viewwindowx + viewwidth; x += 16)
{
- V_DrawPatch(x, viewwindowy - 4, W_CacheLumpName("bordt", PU_CACHE));
- V_DrawPatch(x, viewwindowy + viewheight, W_CacheLumpName("bordb",
- PU_CACHE));
+ V_DrawPatch(x, viewwindowy - 4,
+ W_CacheLumpName(DEH_String("bordt"), PU_CACHE));
+ V_DrawPatch(x, viewwindowy + viewheight,
+ W_CacheLumpName(DEH_String("bordb"), PU_CACHE));
}
for (y = viewwindowy; y < viewwindowy + viewheight; y += 16)
{
- V_DrawPatch(viewwindowx - 4, y, W_CacheLumpName("bordl", PU_CACHE));
- V_DrawPatch(viewwindowx + viewwidth, y, W_CacheLumpName("bordr",
- PU_CACHE));
+ V_DrawPatch(viewwindowx - 4, y,
+ W_CacheLumpName(DEH_String("bordl"), PU_CACHE));
+ V_DrawPatch(viewwindowx + viewwidth, y,
+ W_CacheLumpName(DEH_String("bordr"), PU_CACHE));
}
- V_DrawPatch(viewwindowx - 4, viewwindowy - 4, W_CacheLumpName("bordtl",
- PU_CACHE));
+ V_DrawPatch(viewwindowx - 4, viewwindowy - 4,
+ W_CacheLumpName(DEH_String("bordtl"), PU_CACHE));
V_DrawPatch(viewwindowx + viewwidth, viewwindowy - 4,
- W_CacheLumpName("bordtr", PU_CACHE));
+ W_CacheLumpName(DEH_String("bordtr"), PU_CACHE));
V_DrawPatch(viewwindowx + viewwidth, viewwindowy + viewheight,
- W_CacheLumpName("bordbr", PU_CACHE));
+ W_CacheLumpName(DEH_String("bordbr"), PU_CACHE));
V_DrawPatch(viewwindowx - 4, viewwindowy + viewheight,
- W_CacheLumpName("bordbl", PU_CACHE));
+ W_CacheLumpName(DEH_String("bordbl"), PU_CACHE));
}
/*
@@ -450,11 +453,11 @@ void R_DrawTopBorder(void)
if (gamemode == shareware)
{
- src = W_CacheLumpName("FLOOR04", PU_CACHE);
+ src = W_CacheLumpName(DEH_String("FLOOR04"), PU_CACHE);
}
else
{
- src = W_CacheLumpName("FLAT513", PU_CACHE);
+ src = W_CacheLumpName(DEH_String("FLAT513"), PU_CACHE);
}
dest = I_VideoBuffer;
@@ -476,20 +479,20 @@ void R_DrawTopBorder(void)
for (x = viewwindowx; x < viewwindowx + viewwidth; x += 16)
{
V_DrawPatch(x, viewwindowy - 4,
- W_CacheLumpName("bordt", PU_CACHE));
+ W_CacheLumpName(DEH_String("bordt"), PU_CACHE));
}
- V_DrawPatch(viewwindowx - 4, viewwindowy, W_CacheLumpName("bordl",
- PU_CACHE));
+ V_DrawPatch(viewwindowx - 4, viewwindowy,
+ W_CacheLumpName(DEH_String("bordl"), PU_CACHE));
V_DrawPatch(viewwindowx + viewwidth, viewwindowy,
- W_CacheLumpName("bordr", PU_CACHE));
+ W_CacheLumpName(DEH_String("bordr"), PU_CACHE));
V_DrawPatch(viewwindowx - 4, viewwindowy + 16,
- W_CacheLumpName("bordl", PU_CACHE));
+ W_CacheLumpName(DEH_String("bordl"), PU_CACHE));
V_DrawPatch(viewwindowx + viewwidth, viewwindowy + 16,
- W_CacheLumpName("bordr", PU_CACHE));
+ W_CacheLumpName(DEH_String("bordr"), PU_CACHE));
V_DrawPatch(viewwindowx - 4, viewwindowy - 4,
- W_CacheLumpName("bordtl", PU_CACHE));
+ W_CacheLumpName(DEH_String("bordtl"), PU_CACHE));
V_DrawPatch(viewwindowx + viewwidth, viewwindowy - 4,
- W_CacheLumpName("bordtr", PU_CACHE));
+ W_CacheLumpName(DEH_String("bordtr"), PU_CACHE));
}
}
diff --git a/src/heretic/r_plane.c b/src/heretic/r_plane.c
index e35e2931..cc86b118 100644
--- a/src/heretic/r_plane.c
+++ b/src/heretic/r_plane.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include "doomdef.h"
+#include "deh_str.h"
#include "i_system.h"
#include "r_local.h"
@@ -90,7 +91,7 @@ fixed_t cachedystep[SCREENHEIGHT];
void R_InitSkyMap(void)
{
- skyflatnum = R_FlatNumForName("F_SKY1");
+ skyflatnum = R_FlatNumForName(DEH_String("F_SKY1"));
skytexturemid = 200 * FRACUNIT;
skyiscale = FRACUNIT;
}
diff --git a/src/heretic/r_things.c b/src/heretic/r_things.c
index 6302303e..e5ff4b4b 100644
--- a/src/heretic/r_things.c
+++ b/src/heretic/r_things.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "doomdef.h"
+#include "deh_str.h"
#include "i_swap.h"
#include "i_system.h"
#include "r_local.h"
@@ -154,7 +155,7 @@ void R_InstallSpriteLump(int lump, unsigned frame, unsigned rotation,
void R_InitSpriteDefs(char **namelist)
{
char **check;
- int i, l, intname, frame, rotation;
+ int i, l, frame, rotation;
int start, end;
// count the number of sprite names
@@ -176,17 +177,16 @@ void R_InitSpriteDefs(char **namelist)
// Just compare 4 characters as ints
for (i = 0; i < numsprites; i++)
{
- spritename = namelist[i];
+ spritename = DEH_String(namelist[i]);
memset(sprtemp, -1, sizeof(sprtemp));
maxframe = -1;
- intname = *(int *) namelist[i];
//
// scan the lumps, filling in the frames for whatever is found
//
for (l = start + 1; l < end; l++)
- if (*(int *) lumpinfo[l].name == intname)
+ if (!strncasecmp(lumpinfo[l].name, spritename, 4))
{
frame = lumpinfo[l].name[4] - 'A';
rotation = lumpinfo[l].name[5] - '0';
@@ -209,7 +209,7 @@ void R_InitSpriteDefs(char **namelist)
if (gamemode == shareware)
continue;
I_Error("R_InitSprites: No lumps found for sprite %s",
- namelist[i]);
+ spritename);
}
maxframe++;
@@ -219,7 +219,7 @@ void R_InitSpriteDefs(char **namelist)
{
case -1: // no rotations were found for that frame at all
I_Error("R_InitSprites: No patches found for %s frame %c",
- namelist[i], frame + 'A');
+ spritename, frame + 'A');
case 0: // only the first rotation is needed
break;
@@ -228,7 +228,7 @@ void R_InitSpriteDefs(char **namelist)
if (sprtemp[frame].lump[rotation] == -1)
I_Error
("R_InitSprites: Sprite %s frame %c is missing rotations",
- namelist[i], frame + 'A');
+ spritename, frame + 'A');
}
}
diff --git a/src/heretic/s_sound.c b/src/heretic/s_sound.c
index bdd24594..73942201 100644
--- a/src/heretic/s_sound.c
+++ b/src/heretic/s_sound.c
@@ -33,6 +33,8 @@
#include "r_local.h"
#include "p_local.h"
+#include "sounds.h"
+
#include "w_wad.h"
#include "z_zone.h"
@@ -55,9 +57,6 @@ int mus_lumpnum;
void *mus_sndptr;
byte *soundCurve;
-extern sfxinfo_t S_sfx[];
-extern musicinfo_t S_music[];
-
int snd_MaxVolume = 10;
int snd_MusicVolume = 10;
int snd_Channels = 16;
@@ -529,7 +528,7 @@ void S_Init(void)
{
snd_Channels = 8;
}
- I_SetMusicVolume(snd_MusicVolume);
+ I_SetMusicVolume(snd_MusicVolume * 8);
S_SetMaxVolume(true);
I_AtExit(S_ShutDown, true);
@@ -550,8 +549,16 @@ void S_GetChannelInfo(SoundInfo_t * s)
c->priority = channel[i].priority;
c->name = S_sfx[c->id].name;
c->mo = channel[i].mo;
- c->distance = P_AproxDistance(c->mo->x - viewx, c->mo->y - viewy)
- >> FRACBITS;
+
+ if (c->mo != NULL)
+ {
+ c->distance = P_AproxDistance(c->mo->x - viewx, c->mo->y - viewy)
+ >> FRACBITS;
+ }
+ else
+ {
+ c->distance = 0;
+ }
}
}
@@ -579,7 +586,7 @@ void S_SetMaxVolume(boolean fullprocess)
static boolean musicPaused;
void S_SetMusicVolume(void)
{
- I_SetMusicVolume(snd_MusicVolume);
+ I_SetMusicVolume(snd_MusicVolume * 8);
if (snd_MusicVolume == 0)
{
I_PauseSong();
diff --git a/src/heretic/sb_bar.c b/src/heretic/sb_bar.c
index 77bd40c2..51bd3b9c 100644
--- a/src/heretic/sb_bar.c
+++ b/src/heretic/sb_bar.c
@@ -25,6 +25,7 @@
// SB_bar.c
#include "doomdef.h"
+#include "deh_str.h"
#include "i_video.h"
#include "m_cheat.h"
#include "m_misc.h"
@@ -196,53 +197,53 @@ void SB_Init(void)
int i;
int startLump;
- PatchLTFACE = W_CacheLumpName("LTFACE", PU_STATIC);
- PatchRTFACE = W_CacheLumpName("RTFACE", PU_STATIC);
- PatchBARBACK = W_CacheLumpName("BARBACK", PU_STATIC);
- PatchINVBAR = W_CacheLumpName("INVBAR", PU_STATIC);
- PatchCHAIN = W_CacheLumpName("CHAIN", PU_STATIC);
+ PatchLTFACE = W_CacheLumpName(DEH_String("LTFACE"), PU_STATIC);
+ PatchRTFACE = W_CacheLumpName(DEH_String("RTFACE"), PU_STATIC);
+ PatchBARBACK = W_CacheLumpName(DEH_String("BARBACK"), PU_STATIC);
+ PatchINVBAR = W_CacheLumpName(DEH_String("INVBAR"), PU_STATIC);
+ PatchCHAIN = W_CacheLumpName(DEH_String("CHAIN"), PU_STATIC);
if (deathmatch)
{
- PatchSTATBAR = W_CacheLumpName("STATBAR", PU_STATIC);
+ PatchSTATBAR = W_CacheLumpName(DEH_String("STATBAR"), PU_STATIC);
}
else
{
- PatchSTATBAR = W_CacheLumpName("LIFEBAR", PU_STATIC);
+ PatchSTATBAR = W_CacheLumpName(DEH_String("LIFEBAR"), PU_STATIC);
}
if (!netgame)
{ // single player game uses red life gem
- PatchLIFEGEM = W_CacheLumpName("LIFEGEM2", PU_STATIC);
+ PatchLIFEGEM = W_CacheLumpName(DEH_String("LIFEGEM2"), PU_STATIC);
}
else
{
- PatchLIFEGEM = W_CacheLumpNum(W_GetNumForName("LIFEGEM0")
+ PatchLIFEGEM = W_CacheLumpNum(W_GetNumForName(DEH_String("LIFEGEM0"))
+ consoleplayer, PU_STATIC);
}
- PatchLTFCTOP = W_CacheLumpName("LTFCTOP", PU_STATIC);
- PatchRTFCTOP = W_CacheLumpName("RTFCTOP", PU_STATIC);
- PatchSELECTBOX = W_CacheLumpName("SELECTBOX", PU_STATIC);
- PatchINVLFGEM1 = W_CacheLumpName("INVGEML1", PU_STATIC);
- PatchINVLFGEM2 = W_CacheLumpName("INVGEML2", PU_STATIC);
- PatchINVRTGEM1 = W_CacheLumpName("INVGEMR1", PU_STATIC);
- PatchINVRTGEM2 = W_CacheLumpName("INVGEMR2", PU_STATIC);
- PatchBLACKSQ = W_CacheLumpName("BLACKSQ", PU_STATIC);
- PatchARMCLEAR = W_CacheLumpName("ARMCLEAR", PU_STATIC);
- PatchCHAINBACK = W_CacheLumpName("CHAINBACK", PU_STATIC);
- startLump = W_GetNumForName("IN0");
+ PatchLTFCTOP = W_CacheLumpName(DEH_String("LTFCTOP"), PU_STATIC);
+ PatchRTFCTOP = W_CacheLumpName(DEH_String("RTFCTOP"), PU_STATIC);
+ PatchSELECTBOX = W_CacheLumpName(DEH_String("SELECTBOX"), PU_STATIC);
+ PatchINVLFGEM1 = W_CacheLumpName(DEH_String("INVGEML1"), PU_STATIC);
+ PatchINVLFGEM2 = W_CacheLumpName(DEH_String("INVGEML2"), PU_STATIC);
+ PatchINVRTGEM1 = W_CacheLumpName(DEH_String("INVGEMR1"), PU_STATIC);
+ PatchINVRTGEM2 = W_CacheLumpName(DEH_String("INVGEMR2"), PU_STATIC);
+ PatchBLACKSQ = W_CacheLumpName(DEH_String("BLACKSQ"), PU_STATIC);
+ PatchARMCLEAR = W_CacheLumpName(DEH_String("ARMCLEAR"), PU_STATIC);
+ PatchCHAINBACK = W_CacheLumpName(DEH_String("CHAINBACK"), PU_STATIC);
+ startLump = W_GetNumForName(DEH_String("IN0"));
for (i = 0; i < 10; i++)
{
PatchINumbers[i] = W_CacheLumpNum(startLump + i, PU_STATIC);
}
- PatchNEGATIVE = W_CacheLumpName("NEGNUM", PU_STATIC);
- FontBNumBase = W_GetNumForName("FONTB16");
- startLump = W_GetNumForName("SMALLIN0");
+ PatchNEGATIVE = W_CacheLumpName(DEH_String("NEGNUM"), PU_STATIC);
+ FontBNumBase = W_GetNumForName(DEH_String("FONTB16"));
+ startLump = W_GetNumForName(DEH_String("SMALLIN0"));
for (i = 0; i < 10; i++)
{
PatchSmNumbers[i] = W_CacheLumpNum(startLump + i, PU_STATIC);
}
- playpalette = W_GetNumForName("PLAYPAL");
- spinbooklump = W_GetNumForName("SPINBK0");
- spinflylump = W_GetNumForName("SPFLY0");
+ playpalette = W_GetNumForName(DEH_String("PLAYPAL"));
+ spinbooklump = W_GetNumForName(DEH_String("SPINBK0"));
+ spinflylump = W_GetNumForName(DEH_String("SPFLY0"));
}
//---------------------------------------------------------------------------
@@ -311,7 +312,7 @@ static void DrINumber(signed int val, int x, int y)
{
if (val < -9)
{
- V_DrawPatch(x + 1, y + 1, W_CacheLumpName("LAME", PU_CACHE));
+ V_DrawPatch(x + 1, y + 1, W_CacheLumpName(DEH_String("LAME"), PU_CACHE));
}
else
{
@@ -458,7 +459,7 @@ static void DrawSoundInfo(void)
if (leveltime & 16)
{
- MN_DrTextA("*** SOUND DEBUG INFO ***", xPos[0], 20);
+ MN_DrTextA(DEH_String("*** SOUND DEBUG INFO ***"), xPos[0], 20);
}
S_GetChannelInfo(&s);
if (s.channelCount == 0)
@@ -466,13 +467,13 @@ static void DrawSoundInfo(void)
return;
}
x = 0;
- MN_DrTextA("NAME", xPos[x++], 30);
- MN_DrTextA("MO.T", xPos[x++], 30);
- MN_DrTextA("MO.X", xPos[x++], 30);
- MN_DrTextA("MO.Y", xPos[x++], 30);
- MN_DrTextA("ID", xPos[x++], 30);
- MN_DrTextA("PRI", xPos[x++], 30);
- MN_DrTextA("DIST", xPos[x++], 30);
+ MN_DrTextA(DEH_String("NAME"), xPos[x++], 30);
+ MN_DrTextA(DEH_String("MO.T"), xPos[x++], 30);
+ MN_DrTextA(DEH_String("MO.X"), xPos[x++], 30);
+ MN_DrTextA(DEH_String("MO.Y"), xPos[x++], 30);
+ MN_DrTextA(DEH_String("ID"), xPos[x++], 30);
+ MN_DrTextA(DEH_String("PRI"), xPos[x++], 30);
+ MN_DrTextA(DEH_String("DIST"), xPos[x++], 30);
for (i = 0; i < s.channelCount; i++)
{
c = &s.chan[i];
@@ -480,7 +481,7 @@ static void DrawSoundInfo(void)
y = 40 + i * 10;
if (c->mo == NULL)
{ // Channel is unused
- MN_DrTextA("------", xPos[0], y);
+ MN_DrTextA(DEH_String("------"), xPos[0], y);
continue;
}
sprintf(text, "%s", c->name);
@@ -570,8 +571,10 @@ void SB_Drawer(void)
V_DrawPatch(0, 158, PatchBARBACK);
if (players[consoleplayer].cheats & CF_GODMODE)
{
- V_DrawPatch(16, 167, W_CacheLumpName("GOD1", PU_CACHE));
- V_DrawPatch(287, 167, W_CacheLumpName("GOD2", PU_CACHE));
+ V_DrawPatch(16, 167,
+ W_CacheLumpName(DEH_String("GOD1"), PU_CACHE));
+ V_DrawPatch(287, 167,
+ W_CacheLumpName(DEH_String("GOD2"), PU_CACHE));
}
oldhealth = -1;
}
@@ -776,8 +779,10 @@ void DrawMainBar(void)
if (ArtifactFlash)
{
V_DrawPatch(180, 161, PatchBLACKSQ);
- V_DrawPatch(182, 161, W_CacheLumpNum(W_GetNumForName("useartia")
- + ArtifactFlash - 1, PU_CACHE));
+
+ temp = W_GetNumForName(DEH_String("useartia")) + ArtifactFlash - 1;
+
+ V_DrawPatch(182, 161, W_CacheLumpNum(temp, PU_CACHE));
ArtifactFlash--;
oldarti = -1; // so that the correct artifact fills in after the flash
UpdateState |= I_STATBAR;
@@ -789,7 +794,7 @@ void DrawMainBar(void)
if (CPlayer->readyArtifact > 0)
{
V_DrawPatch(179, 160,
- W_CacheLumpName(patcharti[CPlayer->readyArtifact],
+ W_CacheLumpName(DEH_String(patcharti[CPlayer->readyArtifact]),
PU_CACHE));
DrSmallNumber(CPlayer->inventory[inv_ptr].count, 201, 182);
}
@@ -839,15 +844,15 @@ void DrawMainBar(void)
{
if (CPlayer->keys[key_yellow])
{
- V_DrawPatch(153, 164, W_CacheLumpName("ykeyicon", PU_CACHE));
+ V_DrawPatch(153, 164, W_CacheLumpName(DEH_String("ykeyicon"), PU_CACHE));
}
if (CPlayer->keys[key_green])
{
- V_DrawPatch(153, 172, W_CacheLumpName("gkeyicon", PU_CACHE));
+ V_DrawPatch(153, 172, W_CacheLumpName(DEH_String("gkeyicon"), PU_CACHE));
}
if (CPlayer->keys[key_blue])
{
- V_DrawPatch(153, 180, W_CacheLumpName("bkeyicon", PU_CACHE));
+ V_DrawPatch(153, 180, W_CacheLumpName(DEH_String("bkeyicon"), PU_CACHE));
}
oldkeys = playerkeys;
UpdateState |= I_STATBAR;
@@ -861,7 +866,7 @@ void DrawMainBar(void)
{
DrINumber(temp, 109, 162);
V_DrawPatch(111, 172,
- W_CacheLumpName(ammopic[CPlayer->readyweapon - 1],
+ W_CacheLumpName(DEH_String(ammopic[CPlayer->readyweapon - 1]),
PU_CACHE));
}
oldammo = temp;
@@ -887,6 +892,7 @@ void DrawMainBar(void)
void DrawInventoryBar(void)
{
+ char *patch;
int i;
int x;
@@ -899,10 +905,9 @@ void DrawInventoryBar(void)
if (CPlayer->inventorySlotNum > x + i
&& CPlayer->inventory[x + i].type != arti_none)
{
- V_DrawPatch(50 + i * 31, 160,
- W_CacheLumpName(patcharti
- [CPlayer->inventory[x + i].type],
- PU_CACHE));
+ patch = DEH_String(patcharti[CPlayer->inventory[x + i].type]);
+
+ V_DrawPatch(50 + i * 31, 160, W_CacheLumpName(patch, PU_CACHE));
DrSmallNumber(CPlayer->inventory[x + i].count, 69 + i * 31, 182);
}
}
@@ -921,6 +926,7 @@ void DrawInventoryBar(void)
void DrawFullScreenStuff(void)
{
+ char *patch;
int i;
int x;
int temp;
@@ -950,10 +956,9 @@ void DrawFullScreenStuff(void)
{
if (CPlayer->readyArtifact > 0)
{
- V_DrawTLPatch(286, 170, W_CacheLumpName("ARTIBOX", PU_CACHE));
- V_DrawPatch(286, 170,
- W_CacheLumpName(patcharti[CPlayer->readyArtifact],
- PU_CACHE));
+ patch = DEH_String(patcharti[CPlayer->readyArtifact]);
+ V_DrawTLPatch(286, 170, W_CacheLumpName(DEH_String("ARTIBOX"), PU_CACHE));
+ V_DrawPatch(286, 170, W_CacheLumpName(patch, PU_CACHE));
DrSmallNumber(CPlayer->inventory[inv_ptr].count, 307, 192);
}
}
@@ -962,15 +967,14 @@ void DrawFullScreenStuff(void)
x = inv_ptr - curpos;
for (i = 0; i < 7; i++)
{
- V_DrawTLPatch(50 + i * 31, 168, W_CacheLumpName("ARTIBOX",
- PU_CACHE));
+ V_DrawTLPatch(50 + i * 31, 168,
+ W_CacheLumpName(DEH_String("ARTIBOX"), PU_CACHE));
if (CPlayer->inventorySlotNum > x + i
&& CPlayer->inventory[x + i].type != arti_none)
{
+ patch = DEH_String(patcharti[CPlayer->inventory[x + i].type]);
V_DrawPatch(50 + i * 31, 168,
- W_CacheLumpName(patcharti
- [CPlayer->inventory[x + i].type],
- PU_CACHE));
+ W_CacheLumpName(patch, PU_CACHE));
DrSmallNumber(CPlayer->inventory[x + i].count, 69 + i * 31,
190);
}
@@ -1051,11 +1055,11 @@ static void CheatGodFunc(player_t * player, Cheat_t * cheat)
player->cheats ^= CF_GODMODE;
if (player->cheats & CF_GODMODE)
{
- P_SetMessage(player, TXT_CHEATGODON, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATGODON), false);
}
else
{
- P_SetMessage(player, TXT_CHEATGODOFF, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATGODOFF), false);
}
SB_state = -1;
}
@@ -1065,11 +1069,11 @@ static void CheatNoClipFunc(player_t * player, Cheat_t * cheat)
player->cheats ^= CF_NOCLIP;
if (player->cheats & CF_NOCLIP)
{
- P_SetMessage(player, TXT_CHEATNOCLIPON, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATNOCLIPON), false);
}
else
{
- P_SetMessage(player, TXT_CHEATNOCLIPOFF, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATNOCLIPOFF), false);
}
}
@@ -1102,7 +1106,7 @@ static void CheatWeaponsFunc(player_t * player, Cheat_t * cheat)
{
player->ammo[i] = player->maxammo[i];
}
- P_SetMessage(player, TXT_CHEATWEAPONS, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATWEAPONS), false);
}
static void CheatPowerFunc(player_t * player, Cheat_t * cheat)
@@ -1110,12 +1114,12 @@ static void CheatPowerFunc(player_t * player, Cheat_t * cheat)
if (player->powers[pw_weaponlevel2])
{
player->powers[pw_weaponlevel2] = 0;
- P_SetMessage(player, TXT_CHEATPOWEROFF, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATPOWEROFF), false);
}
else
{
P_UseArtifact(player, arti_tomeofpower);
- P_SetMessage(player, TXT_CHEATPOWERON, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATPOWERON), false);
}
}
@@ -1129,7 +1133,7 @@ static void CheatHealthFunc(player_t * player, Cheat_t * cheat)
{
player->health = player->mo->health = MAXHEALTH;
}
- P_SetMessage(player, TXT_CHEATHEALTH, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATHEALTH), false);
}
static void CheatKeysFunc(player_t * player, Cheat_t * cheat)
@@ -1140,7 +1144,7 @@ static void CheatKeysFunc(player_t * player, Cheat_t * cheat)
player->keys[key_green] = true;
player->keys[key_blue] = true;
playerkeys = 7; // Key refresh flags
- P_SetMessage(player, TXT_CHEATKEYS, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATKEYS), false);
}
static void CheatSoundFunc(player_t * player, Cheat_t * cheat)
@@ -1148,11 +1152,11 @@ static void CheatSoundFunc(player_t * player, Cheat_t * cheat)
DebugSound = !DebugSound;
if (DebugSound)
{
- P_SetMessage(player, TXT_CHEATSOUNDON, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATSOUNDON), false);
}
else
{
- P_SetMessage(player, TXT_CHEATSOUNDOFF, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATSOUNDOFF), false);
}
}
@@ -1161,11 +1165,11 @@ static void CheatTickerFunc(player_t * player, Cheat_t * cheat)
DisplayTicker = !DisplayTicker;
if (DisplayTicker)
{
- P_SetMessage(player, TXT_CHEATTICKERON, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATTICKERON), false);
}
else
{
- P_SetMessage(player, TXT_CHEATTICKEROFF, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATTICKEROFF), false);
}
I_DisplayFPSDots(DisplayTicker);
@@ -1173,12 +1177,12 @@ static void CheatTickerFunc(player_t * player, Cheat_t * cheat)
static void CheatArtifact1Func(player_t * player, Cheat_t * cheat)
{
- P_SetMessage(player, TXT_CHEATARTIFACTS1, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATARTIFACTS1), false);
}
static void CheatArtifact2Func(player_t * player, Cheat_t * cheat)
{
- P_SetMessage(player, TXT_CHEATARTIFACTS2, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATARTIFACTS2), false);
}
static void CheatArtifact3Func(player_t * player, Cheat_t * cheat)
@@ -1206,7 +1210,7 @@ static void CheatArtifact3Func(player_t * player, Cheat_t * cheat)
P_GiveArtifact(player, i, NULL);
}
}
- P_SetMessage(player, TXT_CHEATARTIFACTS3, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATARTIFACTS3), false);
}
else if (type > arti_none && type < NUMARTIFACTS
&& count > 0 && count < 10)
@@ -1214,18 +1218,18 @@ static void CheatArtifact3Func(player_t * player, Cheat_t * cheat)
if (gamemode == shareware
&& (type == arti_superhealth || type == arti_teleport))
{
- P_SetMessage(player, TXT_CHEATARTIFACTSFAIL, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATARTIFACTSFAIL), false);
return;
}
for (i = 0; i < count; i++)
{
P_GiveArtifact(player, type, NULL);
}
- P_SetMessage(player, TXT_CHEATARTIFACTS3, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATARTIFACTS3), false);
}
else
{ // Bad input
- P_SetMessage(player, TXT_CHEATARTIFACTSFAIL, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATARTIFACTSFAIL), false);
}
}
@@ -1242,7 +1246,7 @@ static void CheatWarpFunc(player_t * player, Cheat_t * cheat)
if (D_ValidEpisodeMap(gamemission, gamemode, episode, map))
{
G_DeferedInitNew(gameskill, episode, map);
- P_SetMessage(player, TXT_CHEATWARP, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATWARP), false);
}
}
@@ -1254,19 +1258,19 @@ static void CheatChickenFunc(player_t * player, Cheat_t * cheat)
{
if (P_UndoPlayerChicken(player))
{
- P_SetMessage(player, TXT_CHEATCHICKENOFF, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATCHICKENOFF), false);
}
}
else if (P_ChickenMorphPlayer(player))
{
- P_SetMessage(player, TXT_CHEATCHICKENON, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATCHICKENON), false);
}
}
static void CheatMassacreFunc(player_t * player, Cheat_t * cheat)
{
P_Massacre();
- P_SetMessage(player, TXT_CHEATMASSACRE, false);
+ P_SetMessage(player, DEH_String(TXT_CHEATMASSACRE), false);
}
static void CheatIDKFAFunc(player_t * player, Cheat_t * cheat)
@@ -1281,11 +1285,11 @@ static void CheatIDKFAFunc(player_t * player, Cheat_t * cheat)
player->weaponowned[i] = false;
}
player->pendingweapon = wp_staff;
- P_SetMessage(player, TXT_CHEATIDKFA, true);
+ P_SetMessage(player, DEH_String(TXT_CHEATIDKFA), true);
}
static void CheatIDDQDFunc(player_t * player, Cheat_t * cheat)
{
P_DamageMobj(player->mo, NULL, player->mo, 10000);
- P_SetMessage(player, TXT_CHEATIDDQD, true);
+ P_SetMessage(player, DEH_String(TXT_CHEATIDDQD), true);
}
diff --git a/src/heretic/sounds.h b/src/heretic/sounds.h
index 707185c0..e50a6ad6 100644
--- a/src/heretic/sounds.h
+++ b/src/heretic/sounds.h
@@ -27,6 +27,8 @@
#ifndef __SOUNDSH__
#define __SOUNDSH__
+#include "i_sound.h"
+
#define MAX_SND_DIST 1600
#define MAX_CHANNELS 16
@@ -291,4 +293,7 @@ typedef enum
NUMSFX
} sfxenum_t;
+extern sfxinfo_t S_sfx[];
+extern musicinfo_t S_music[];
+
#endif