shithub: choc

Download patch

ref: 16e361951eb7bce9726e4a96699429f2883bd68c
parent: d35a4b7cf3a206a35ac57e279fb36bad9436ab0b
author: Simon Howard <[email protected]>
date: Wed Oct 1 15:10:02 EDT 2008

Remove Hexen duplicate KEY_ definitions.

Subversion-branch: /branches/raven-branch
Subversion-revision: 1317

--- a/src/hexen/am_map.c
+++ b/src/hexen/am_map.c
@@ -23,6 +23,7 @@
 
 
 #include "h2def.h"
+#include "doomkeys.h"
 #include "i_video.h"
 #include "i_swap.h"
 #include "p_local.h"
--- a/src/hexen/ct_chat.c
+++ b/src/hexen/ct_chat.c
@@ -25,6 +25,7 @@
 #include <string.h>
 #include <ctype.h>
 #include "h2def.h"
+#include "doomkeys.h"
 #include "p_local.h"
 #include "soundst.h"
 #include "v_video.h"
--- a/src/hexen/d_net.c
+++ b/src/hexen/d_net.c
@@ -23,6 +23,7 @@
 
 
 #include "h2def.h"
+#include "doomkeys.h"
 #include "i_video.h"
 #include "i_system.h"
 #include "i_timer.h"
--- a/src/hexen/g_game.c
+++ b/src/hexen/g_game.c
@@ -24,6 +24,7 @@
 
 #include <string.h>
 #include "h2def.h"
+#include "doomkeys.h"
 #include "i_video.h"
 #include "i_system.h"
 #include "i_timer.h"
@@ -30,6 +31,7 @@
 #include "m_misc.h"
 #include "p_local.h"
 #include "soundst.h"
+#include "v_video.h"
 
 #define AM_STARTKEY	9
 
@@ -596,41 +598,41 @@
         gamekeydown[KEY_BACKSPACE] = false;     // Use one of each artifact
         cmd->arti = NUMARTIFACTS;
     }
-    else if (gamekeydown[KEY_BACKSLASH] && !cmd->arti
+    else if (gamekeydown['\\'] && !cmd->arti
              && (players[consoleplayer].mo->health < MAXHEALTH))
     {
-        gamekeydown[KEY_BACKSLASH] = false;
+        gamekeydown['\\'] = false;
         cmd->arti = arti_health;
     }
-    else if (gamekeydown[KEY_ZERO] && !cmd->arti)
+    else if (gamekeydown['0'] && !cmd->arti)
     {
-        gamekeydown[KEY_ZERO] = false;
+        gamekeydown['0'] = false;
         cmd->arti = arti_poisonbag;
     }
-    else if (gamekeydown[KEY_NINE] && !cmd->arti)
+    else if (gamekeydown['9'] && !cmd->arti)
     {
-        gamekeydown[KEY_NINE] = false;
+        gamekeydown['9'] = false;
         cmd->arti = arti_blastradius;
     }
-    else if (gamekeydown[KEY_EIGHT] && !cmd->arti)
+    else if (gamekeydown['8'] && !cmd->arti)
     {
-        gamekeydown[KEY_EIGHT] = false;
+        gamekeydown['8'] = false;
         cmd->arti = arti_teleport;
     }
-    else if (gamekeydown[KEY_SEVEN] && !cmd->arti)
+    else if (gamekeydown['7'] && !cmd->arti)
     {
-        gamekeydown[KEY_SEVEN] = false;
+        gamekeydown['7'] = false;
         cmd->arti = arti_teleportother;
     }
-    else if (gamekeydown[KEY_SIX] && !cmd->arti)
+    else if (gamekeydown['6'] && !cmd->arti)
     {
-        gamekeydown[KEY_SIX] = false;
+        gamekeydown['6'] = false;
         cmd->arti = arti_egg;
     }
-    else if (gamekeydown[KEY_FIVE] && !cmd->arti
+    else if (gamekeydown['5'] && !cmd->arti
              && !players[consoleplayer].powers[pw_invulnerability])
     {
-        gamekeydown[KEY_FIVE] = false;
+        gamekeydown['5'] = false;
         cmd->arti = arti_invulnerability;
     }
 
--- a/src/hexen/h2def.h
+++ b/src/hexen/h2def.h
@@ -93,53 +93,6 @@
 
 extern byte *destview, *destscreen;     // PC direct to screen pointers
 
-//
-// most key data are simple ascii (uppercased)
-//
-#define	KEY_RIGHTARROW		0xae
-#define	KEY_LEFTARROW		0xac
-#define	KEY_UPARROW			0xad
-#define	KEY_DOWNARROW		0xaf
-#define	KEY_ESCAPE			27
-#define	KEY_ENTER			13
-#define	KEY_F1				(0x80+0x3b)
-#define	KEY_F2				(0x80+0x3c)
-#define	KEY_F3				(0x80+0x3d)
-#define	KEY_F4				(0x80+0x3e)
-#define	KEY_F5				(0x80+0x3f)
-#define	KEY_F6				(0x80+0x40)
-#define	KEY_F7				(0x80+0x41)
-#define	KEY_F8				(0x80+0x42)
-#define	KEY_F9				(0x80+0x43)
-#define	KEY_F10				(0x80+0x44)
-#define	KEY_F11				(0x80+0x57)
-#define	KEY_F12				(0x80+0x58)
-
-#define	KEY_BACKSPACE		127
-#define	KEY_PAUSE			0xff
-
-#define KEY_EQUALS			0x3d
-#define KEY_MINUS			0x2d
-
-#define	KEY_RSHIFT			(0x80+0x36)
-#define	KEY_RCTRL			(0x80+0x1d)
-#define	KEY_RALT			(0x80+0x38)
-
-#define	KEY_LALT			KEY_RALT
-
-#define KEY_FIVE			0x35
-#define KEY_SIX				0x36
-#define KEY_SEVEN			0x37
-#define KEY_EIGHT			0x38
-#define KEY_NINE			0x39
-#define KEY_ZERO			0x30
-#define KEY_BACKSLASH		0x5C
-
-
-#define	FINEANGLES			8192
-#define	FINEMASK			(FINEANGLES-1)
-#define	ANGLETOFINESHIFT	19      // 0x100000000 to 0x2000
-
 /*
 ===============================================================================
 
--- a/src/hexen/m_misc.c
+++ b/src/hexen/m_misc.c
@@ -34,6 +34,7 @@
 #endif
 #include <ctype.h>
 #include "h2def.h"
+#include "doomkeys.h"
 #include "i_system.h"
 #include "m_argv.h"
 #include "p_local.h"
--- a/src/hexen/mn_menu.c
+++ b/src/hexen/mn_menu.c
@@ -26,6 +26,7 @@
 
 #include <ctype.h>
 #include "h2def.h"
+#include "doomkeys.h"
 #include "i_system.h"
 #include "i_video.h"
 #include "p_local.h"