summaryrefslogtreecommitdiff
path: root/src/heretic
diff options
context:
space:
mode:
Diffstat (limited to 'src/heretic')
-rw-r--r--src/heretic/d_main.c51
-rw-r--r--src/heretic/doomdef.h10
-rw-r--r--src/heretic/g_game.c221
-rw-r--r--src/heretic/p_mobj.c8
-rw-r--r--src/heretic/p_user.c8
-rw-r--r--src/heretic/r_main.c9
6 files changed, 36 insertions, 271 deletions
diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c
index 273b3f26..a8f8bbe1 100644
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -465,6 +465,7 @@ void wadprintf(void)
{
return;
}
+ // haleyjd FIXME: convert to textscreen code?
#ifdef __WATCOMC__
_settextposition(23, 2);
_setbkcolor(1);
@@ -519,13 +520,9 @@ void hprintf(char *string)
TXT_UpdateScreen();
}
-#ifdef __WATCOMC__
+ // haleyjd: shouldn't be WATCOMC-only
if (debugmode)
- {
puts(string);
- return;
- }
-#endif
}
void drawstatus(void)
@@ -664,6 +661,7 @@ static void finishStartup(void)
char tmsg[300];
void tprintf(char *msg, int initflag)
{
+ // haleyjd FIXME: convert to textscreen code?
#ifdef __WATCOMC__
char temp[80];
int start;
@@ -694,16 +692,23 @@ void tprintf(char *msg, int initflag)
#endif
}
-void CheckAbortStartup(void)
+// haleyjd: moved up, removed WATCOMC code
+void CleanExit(void)
{
-#ifdef __WATCOMC__
- extern int lastpress;
+ printf("Exited from HERETIC.\n");
+ exit(1);
+}
- if (lastpress == 1)
- { // Abort if escape pressed
- CleanExit();
+void CheckAbortStartup(void)
+{
+ // haleyjd: removed WATCOMC
+ // haleyjd FIXME: this should actually work in text mode too, but how to
+ // get input before SDL video init?
+ if(using_graphical_startup)
+ {
+ if(TXT_GetChar() == 27)
+ CleanExit();
}
-#endif
}
void IncThermo(void)
@@ -719,19 +724,6 @@ void InitThermo(int max)
thermCurrent = 0;
}
-#ifdef __WATCOMC__
-void CleanExit(void)
-{
- union REGS regs;
-
- I_ShutdownKeyboard();
- regs.x.eax = 0x3;
- int386(0x10, &regs, &regs);
- printf("Exited from HERETIC.\n");
- exit(1);
-}
-#endif
-
//
// Add configuration file variable bindings.
//
@@ -951,10 +943,7 @@ void D_DoomMain(void)
I_PrintStartupBanner(gamedescription);
-#ifdef __WATCOMC__
- I_StartupKeyboard();
- I_StartupJoystick();
-#endif
+ // haleyjd: removed WATCOMC
initStartup();
//
@@ -1007,9 +996,7 @@ void D_DoomMain(void)
D_CheckNetGame();
IncThermo();
-#ifdef __WATCOMC__
- I_CheckExternDriver(); // Check for an external device driver
-#endif
+ // haleyjd: removed WATCOMC
tprintf("SB_Init: Loading patches.\n", 1);
SB_Init();
diff --git a/src/heretic/doomdef.h b/src/heretic/doomdef.h
index 02797f92..0580f9b0 100644
--- a/src/heretic/doomdef.h
+++ b/src/heretic/doomdef.h
@@ -28,11 +28,7 @@
#define __DOOMDEF__
#include <stdio.h>
#include <string.h>
-#ifdef __WATCOMC__
-#include <malloc.h>
-#define strcasecmp strcmpi
-#define strncasecmp strnicmp
-#endif
+//haleyjd: removed WATCOMC
#include <limits.h>
#define HERETIC_VERSION 130
@@ -688,7 +684,9 @@ byte *I_ZoneBase(int *size);
byte *I_AllocLow(int length);
// allocates from low memory under dos, just mallocs under unix
-#ifdef __WATCOMC__
+// haleyjd: was WATCOMC, preserved for historical interest.
+// This is similar to the -control structure in DOOM v1.4 and Strife.
+#if 0
extern boolean useexterndriver;
#define EBT_FIRE 1
diff --git a/src/heretic/g_game.c b/src/heretic/g_game.c
index 30fdc0cd..22c17f13 100644
--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -173,9 +173,7 @@ char savedescription[32];
int inventoryTics;
-#ifdef __WATCOMC__
-extern externdata_t *i_ExternData;
-#endif
+// haleyjd: removed WATCOMC
//=============================================================================
// Not used - ripped out for Heretic
@@ -222,15 +220,7 @@ void G_BuildTiccmd(ticcmd_t * cmd)
extern boolean noartiskip;
-#ifdef __WATCOMC__
- int angleDelta;
- static int oldAngle;
- extern int newViewAngleOff;
- static int externInvKey;
- extern boolean automapactive;
- event_t ev;
-#endif
-
+ // haleyjd: removed externdriver crap
memset(cmd, 0, sizeof(*cmd));
//cmd->consistancy =
@@ -244,14 +234,9 @@ void G_BuildTiccmd(ticcmd_t * cmd)
speed = joybspeed >= MAX_JOY_BUTTONS
|| gamekeydown[key_speed]
|| joybuttons[joybspeed];
-#ifdef __WATCOMC__
- if (useexterndriver)
- {
- speed |= (i_ExternData->buttons & EBT_SPEED);
- strafe |= (i_ExternData->buttons & EBT_STRAFE);
- }
-#endif
+ // haleyjd: removed externdriver crap
+
forward = side = look = arti = flyheight = 0;
//
@@ -334,198 +319,14 @@ void G_BuildTiccmd(ticcmd_t * cmd)
{
look = -lspeed;
}
-#ifdef __WATCOMC__
- if (gamekeydown[key_lookcenter] && !useexterndriver)
- {
- look = TOCENTER;
- }
-#else
+ // haleyjd: removed externdriver crap
if (gamekeydown[key_lookcenter])
{
look = TOCENTER;
}
-#endif
-
-#ifdef __WATCOMC__
- if (useexterndriver && look != TOCENTER && (gamestate == GS_LEVEL ||
- gamestate == GS_INTERMISSION))
- {
- if (i_ExternData->moveForward)
- {
- forward += i_ExternData->moveForward;
- if (speed)
- {
- forward <<= 1;
- }
- }
- if (i_ExternData->angleTurn)
- {
- if (strafe)
- {
- side += i_ExternData->angleTurn;
- }
- else
- {
- cmd->angleturn += i_ExternData->angleTurn;
- }
- }
- if (i_ExternData->moveSideways)
- {
- side += i_ExternData->moveSideways;
- if (speed)
- {
- side <<= 1;
- }
- }
- if (i_ExternData->buttons & EBT_CENTERVIEW)
- {
- look = TOCENTER;
- oldAngle = 0;
- }
- else if (i_ExternData->pitch)
- {
- angleDelta = i_ExternData->pitch - oldAngle;
- if (abs(angleDelta) < 35)
- {
- look = angleDelta / 5;
- }
- else
- {
- look = 7 * (angleDelta > 0 ? 1 : -1);
- }
- if (look == TOCENTER)
- {
- look++;
- }
- oldAngle += look * 5;
- }
- if (i_ExternData->flyDirection)
- {
- if (i_ExternData->flyDirection > 0)
- {
- flyheight = 5;
- }
- else
- {
- flyheight = -5;
- }
- }
- if (abs(newViewAngleOff - i_ExternData->angleHead) < 3000)
- {
- newViewAngleOff = i_ExternData->angleHead;
- }
- if (i_ExternData->buttons & EBT_FIRE)
- {
- cmd->buttons |= BT_ATTACK;
- }
- if (i_ExternData->buttons & EBT_OPENDOOR)
- {
- cmd->buttons |= BT_USE;
- }
- if (i_ExternData->buttons & EBT_PAUSE)
- {
- cmd->buttons = BT_SPECIAL | BTS_PAUSE;
- i_ExternData->buttons &= ~EBT_PAUSE;
- }
- if (externInvKey & EBT_USEARTIFACT)
- {
- ev.type = ev_keyup;
- ev.data1 = key_useartifact;
- D_PostEvent(&ev);
- externInvKey &= ~EBT_USEARTIFACT;
- }
- else if (i_ExternData->buttons & EBT_USEARTIFACT)
- {
- externInvKey |= EBT_USEARTIFACT;
- ev.type = ev_keydown;
- ev.data1 = key_useartifact;
- D_PostEvent(&ev);
- }
- if (externInvKey & EBT_INVENTORYRIGHT)
- {
- ev.type = ev_keyup;
- ev.data1 = key_invright;
- D_PostEvent(&ev);
- externInvKey &= ~EBT_INVENTORYRIGHT;
- }
- else if (i_ExternData->buttons & EBT_INVENTORYRIGHT)
- {
- externInvKey |= EBT_INVENTORYRIGHT;
- ev.type = ev_keydown;
- ev.data1 = key_invright;
- D_PostEvent(&ev);
- }
- if (externInvKey & EBT_INVENTORYLEFT)
- {
- ev.type = ev_keyup;
- ev.data1 = key_invleft;
- D_PostEvent(&ev);
- externInvKey &= ~EBT_INVENTORYLEFT;
- }
- else if (i_ExternData->buttons & EBT_INVENTORYLEFT)
- {
- externInvKey |= EBT_INVENTORYLEFT;
- ev.type = ev_keydown;
- ev.data1 = key_invleft;
- D_PostEvent(&ev);
- }
- if (i_ExternData->buttons & EBT_FLYDROP)
- {
- flyheight = TOCENTER;
- }
- if (gamestate == GS_LEVEL)
- {
- if (externInvKey & EBT_MAP)
- { // AutoMap
- ev.type = ev_keyup;
- ev.data1 = AM_STARTKEY;
- D_PostEvent(&ev);
- externInvKey &= ~EBT_MAP;
- }
- else if (i_ExternData->buttons & EBT_MAP)
- {
- externInvKey |= EBT_MAP;
- ev.type = ev_keydown;
- ev.data1 = AM_STARTKEY;
- D_PostEvent(&ev);
- }
- }
-#if 0
- if ((i =
- (i_ExternData->buttons >> EBT_WEAPONSHIFT) & EBT_WEAPONMASK) !=
- 0)
- {
- cmd->buttons |= BT_CHANGE;
- cmd->buttons |= (i - 1) << BT_WEAPONSHIFT;
- }
-#endif
- if (i_ExternData->buttons & EBT_WEAPONCYCLE)
- {
- int curWeapon;
- player_t *pl;
-
- pl = &players[consoleplayer];
- curWeapon = pl->readyweapon;
- for (curWeapon = (curWeapon + 1) & 7;
- curWeapon != pl->readyweapon;
- curWeapon = (curWeapon + 1) & 7)
- {
- if (pl->weaponowned[curWeapon])
- {
- if (curWeapon >= wp_goldwand && curWeapon <= wp_mace &&
- !pl->ammo[wpnlev1info[curWeapon].ammo])
- { // weapon that requires ammo is empty
- continue;
- }
- break;
- }
- }
- cmd->buttons |= BT_CHANGE;
- cmd->buttons |= curWeapon << BT_WEAPONSHIFT;
- }
- }
-#endif
+ // haleyjd: removed externdriver crap
+
// Fly up/down/drop keys
if (gamekeydown[key_flyup])
{
@@ -538,14 +339,8 @@ void G_BuildTiccmd(ticcmd_t * cmd)
if (gamekeydown[key_flycenter])
{
flyheight = TOCENTER;
-#ifdef __WATCOMC__
- if (!useexterndriver)
- {
- look = TOCENTER;
- }
-#else
+ // haleyjd: removed externdriver crap
look = TOCENTER;
-#endif
}
// Use artifact key
diff --git a/src/heretic/p_mobj.c b/src/heretic/p_mobj.c
index 73698263..b5366501 100644
--- a/src/heretic/p_mobj.c
+++ b/src/heretic/p_mobj.c
@@ -553,14 +553,8 @@ void P_ZMovement(mobj_t * mo)
{
mo->player->deltaviewheight = mo->momz >> 3;
S_StartSound(mo, sfx_plroof);
-#ifdef __WATCOMC__
- if (!useexterndriver)
- {
- mo->player->centering = true;
- }
-#else
+ // haleyjd: removed externdriver crap
mo->player->centering = true;
-#endif
}
mo->momz = 0;
}
diff --git a/src/heretic/p_user.c b/src/heretic/p_user.c
index 4b8f38f7..63368bab 100644
--- a/src/heretic/p_user.c
+++ b/src/heretic/p_user.c
@@ -675,17 +675,11 @@ void P_PlayerThink(player_t * player)
{
if (!--player->powers[pw_flight])
{
-#ifdef __WATCOMC__
- if (player->mo->z != player->mo->floorz && !useexterndriver)
- {
- player->centering = true;
- }
-#else
+ // haleyjd: removed externdriver crap
if (player->mo->z != player->mo->floorz)
{
player->centering = true;
}
-#endif
player->mo->flags2 &= ~MF2_FLY;
player->mo->flags &= ~MF_NOGRAVITY;
diff --git a/src/heretic/r_main.c b/src/heretic/r_main.c
index 69b18e1f..1101c234 100644
--- a/src/heretic/r_main.c
+++ b/src/heretic/r_main.c
@@ -32,9 +32,7 @@
int viewangleoffset;
-#ifdef __WATCOMC__
-int newViewAngleOff;
-#endif
+// haleyjd: removed WATCOMC
int validcount = 1; // increment every time a check is made
@@ -735,9 +733,8 @@ void R_SetupFrame(player_t * player)
//drawbsp = 1;
viewplayer = player;
-#ifdef __WATCOMC__
- viewangleoffset = newViewAngleOff << ANGLETOFINESHIFT;
-#endif
+ // haleyjd: removed WATCOMC
+ // haleyjd FIXME: viewangleoffset handling?
viewangle = player->mo->angle + viewangleoffset;
tableAngle = viewangle >> ANGLETOFINESHIFT;
if (player->chickenTics && player->chickenPeck)