summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/heretic/am_map.c215
-rw-r--r--src/heretic/am_map.h23
-rw-r--r--src/heretic/d_main.c1
3 files changed, 118 insertions, 121 deletions
diff --git a/src/heretic/am_map.c b/src/heretic/am_map.c
index 036c7ffb..aa1b273b 100644
--- a/src/heretic/am_map.c
+++ b/src/heretic/am_map.c
@@ -28,6 +28,7 @@
#include "doomdef.h"
#include "i_video.h"
+#include "m_controls.h"
#include "p_local.h"
#include "am_map.h"
#include "am_data.h"
@@ -503,100 +504,116 @@ void AM_maxOutWindowScale(void)
boolean AM_Responder(event_t * ev)
{
int rc;
+ int key;
static int cheatstate = 0;
static int bigstate = 0;
+ key = ev->data1;
rc = false;
+
if (!automapactive)
{
- if (ev->type == ev_keydown && ev->data1 == AM_STARTKEY
- && gamestate == GS_LEVEL)
+
+ if (ev->type == ev_keydown && key == key_map_toggle
+ && gamestate == GS_LEVEL)
{
AM_Start();
viewactive = false;
-// viewactive = true;
+ // viewactive = true;
rc = true;
}
}
else if (ev->type == ev_keydown)
{
-
rc = true;
- switch (ev->data1)
+
+ if (key == key_map_east) // pan right
{
- case AM_PANRIGHTKEY: // pan right
- if (!followplayer)
- m_paninc.x = FTOM(F_PANINC);
- else
- rc = false;
- break;
- case AM_PANLEFTKEY: // pan left
- if (!followplayer)
- m_paninc.x = -FTOM(F_PANINC);
- else
- rc = false;
- break;
- case AM_PANUPKEY: // pan up
- if (!followplayer)
- m_paninc.y = FTOM(F_PANINC);
- else
- rc = false;
- break;
- case AM_PANDOWNKEY: // pan down
- if (!followplayer)
- m_paninc.y = -FTOM(F_PANINC);
- else
- rc = false;
- break;
- case AM_ZOOMOUTKEY: // zoom out
- mtof_zoommul = M_ZOOMOUT;
- ftom_zoommul = M_ZOOMIN;
- break;
- case AM_ZOOMINKEY: // zoom in
- mtof_zoommul = M_ZOOMIN;
- ftom_zoommul = M_ZOOMOUT;
- break;
- case AM_ENDKEY:
- bigstate = 0;
- viewactive = true;
- AM_Stop();
- break;
- case AM_GOBIGKEY:
- bigstate = !bigstate;
- if (bigstate)
- {
- AM_saveScaleAndLoc();
- AM_minOutWindowScale();
- }
- else
- AM_restoreScaleAndLoc();
- break;
- case AM_FOLLOWKEY:
- followplayer = !followplayer;
- f_oldloc.x = INT_MAX;
- P_SetMessage(plr,
- followplayer ? AMSTR_FOLLOWON : AMSTR_FOLLOWOFF,
- true);
- break;
-/*
- case AM_GRIDKEY:
- grid = !grid;
- plr->message = grid ? AMSTR_GRIDON : AMSTR_GRIDOFF;
- break;
- case AM_MARKKEY:
- sprintf(buffer, "%s %d", AMSTR_MARKEDSPOT, markpointnum);
- plr->message = buffer;
- AM_addMark();
- break;
- case AM_CLEARMARKKEY:
- AM_clearMarks();
- plr->message = AMSTR_MARKSCLEARED;
- break;
-*/
- default:
- cheatstate = 0;
+ if (!followplayer)
+ m_paninc.x = FTOM(F_PANINC);
+ else
+ rc = false;
+ }
+ else if (key == key_map_west) // pan left
+ {
+ if (!followplayer)
+ m_paninc.x = -FTOM(F_PANINC);
+ else
+ rc = false;
+ }
+ else if (key == key_map_north) // pan up
+ {
+ if (!followplayer)
+ m_paninc.y = FTOM(F_PANINC);
+ else
rc = false;
}
+ else if (key == key_map_south) // pan down
+ {
+ if (!followplayer)
+ m_paninc.y = -FTOM(F_PANINC);
+ else
+ rc = false;
+ }
+ else if (key == key_map_zoomout) // zoom out
+ {
+ mtof_zoommul = M_ZOOMOUT;
+ ftom_zoommul = M_ZOOMIN;
+ }
+ else if (key == key_map_zoomin) // zoom in
+ {
+ mtof_zoommul = M_ZOOMIN;
+ ftom_zoommul = M_ZOOMOUT;
+ }
+ else if (key == key_map_toggle) // toggle map (tab)
+ {
+ bigstate = 0;
+ viewactive = true;
+ AM_Stop();
+ }
+ else if (key == key_map_maxzoom)
+ {
+ bigstate = !bigstate;
+ if (bigstate)
+ {
+ AM_saveScaleAndLoc();
+ AM_minOutWindowScale();
+ }
+ else
+ AM_restoreScaleAndLoc();
+ }
+ else if (key == key_map_follow)
+ {
+ followplayer = !followplayer;
+ f_oldloc.x = INT_MAX;
+ P_SetMessage(plr,
+ followplayer ? AMSTR_FOLLOWON : AMSTR_FOLLOWOFF,
+ true);
+ }
+ /*
+ else if (key == key_map_grid)
+ {
+ grid = !grid;
+ plr->message = grid ? AMSTR_GRIDON : AMSTR_GRIDOFF;
+ }
+ else if (key == key_map_mark)
+ {
+ sprintf(buffer, "%s %d", AMSTR_MARKEDSPOT, markpointnum);
+ plr->message = buffer;
+ AM_addMark();
+ }
+ else if (key == key_map_clearmark)
+ {
+ AM_clearMarks();
+ plr->message = AMSTR_MARKSCLEARED;
+ }
+ */
+ else
+ {
+ cheatstate = 0;
+ rc = false;
+ }
+
if (cheat_amap[cheatcount] == ev->data1 && !netgame)
cheatcount++;
else
@@ -612,29 +629,31 @@ boolean AM_Responder(event_t * ev)
else if (ev->type == ev_keyup)
{
rc = false;
- switch (ev->data1)
+
+ if (key == key_map_east)
{
- case AM_PANRIGHTKEY:
- if (!followplayer)
- m_paninc.x = 0;
- break;
- case AM_PANLEFTKEY:
- if (!followplayer)
- m_paninc.x = 0;
- break;
- case AM_PANUPKEY:
- if (!followplayer)
- m_paninc.y = 0;
- break;
- case AM_PANDOWNKEY:
- if (!followplayer)
- m_paninc.y = 0;
- break;
- case AM_ZOOMOUTKEY:
- case AM_ZOOMINKEY:
- mtof_zoommul = FRACUNIT;
- ftom_zoommul = FRACUNIT;
- break;
+ if (!followplayer)
+ m_paninc.x = 0;
+ }
+ else if (key == key_map_east)
+ {
+ if (!followplayer)
+ m_paninc.x = 0;
+ }
+ else if (key == key_map_north)
+ {
+ if (!followplayer)
+ m_paninc.y = 0;
+ }
+ else if (key == key_map_south)
+ {
+ if (!followplayer)
+ m_paninc.y = 0;
+ }
+ else if (key == key_map_zoomout || key == key_map_zoomin)
+ {
+ mtof_zoommul = FRACUNIT;
+ ftom_zoommul = FRACUNIT;
}
}
diff --git a/src/heretic/am_map.h b/src/heretic/am_map.h
index ff22be1f..cbd2935a 100644
--- a/src/heretic/am_map.h
+++ b/src/heretic/am_map.h
@@ -68,29 +68,6 @@
// drawing stuff
#define FB 0
-#define KEY_TAB 9
-#define AM_PANDOWNKEY KEY_DOWNARROW
-#define AM_PANUPKEY KEY_UPARROW
-#define AM_PANRIGHTKEY KEY_RIGHTARROW
-#define AM_PANLEFTKEY KEY_LEFTARROW
-//#define AM_PANDOWNKEY SC_DOWNARROW
-//#define AM_PANUPKEY SC_UPARROW
-//#define AM_PANRIGHTKEY SC_RIGHTARROW
-//#define AM_PANLEFTKEY SC_LEFTARROW
-
-#define AM_ZOOMINKEY '='
-//#define AM_ZOOMINKEY 13
-//#define AM_ZOOMOUTKEY 12
-#define AM_ZOOMOUTKEY '-'
-#define AM_STARTKEY KEY_TAB
-#define AM_ENDKEY KEY_TAB
-#define AM_GOBIGKEY '0'
-//#define AM_GOBIGKEY 11
-//#define AM_FOLLOWKEY 33
-//#define AM_GRIDKEY 34
-#define AM_FOLLOWKEY 'f'
-#define AM_GRIDKEY 'g'
-
#define AM_NUMMARKPOINTS 10
#define AM_MSGHEADER (('a'<<24)+('m'<<16))
diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c
index 89f35937..2026e3c0 100644
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -745,6 +745,7 @@ void D_BindVariables(void)
M_BindHereticControls();
M_BindMenuControls();
+ M_BindMapControls();
M_BindVariable("mouse_sensitivity", &mouseSensitivity);
M_BindVariable("sfx_volume", &snd_MaxVolume);