From b868352951acee0e556d702e5e90aa67d9a2b39e Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 11 Sep 2008 21:03:48 +0000 Subject: Refactor configuration file system to allow configuration file variables to be bound in a distributed fashion around the program. Remove dependency of m_config.c on doom/. Subversion-branch: /branches/raven-branch Subversion-revision: 1222 --- src/m_controls.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/m_controls.c') diff --git a/src/m_controls.c b/src/m_controls.c index 56084a79..9b81d9c3 100644 --- a/src/m_controls.c +++ b/src/m_controls.c @@ -23,6 +23,8 @@ #include "doomtype.h" #include "doomkeys.h" + +#include "m_config.h" // // Keyboard controls @@ -76,3 +78,41 @@ int dclick_use = 1; int novert = 0; +// +// Bind all of the common controls used by Doom and all other games. +// + +void M_BindBaseControls(void) +{ + M_BindVariable("key_right", &key_right), + M_BindVariable("key_left", &key_left), + M_BindVariable("key_up", &key_up), + M_BindVariable("key_down", &key_down), + M_BindVariable("key_strafeleft", &key_strafeleft), + M_BindVariable("key_straferight", &key_straferight), + M_BindVariable("key_fire", &key_fire), + M_BindVariable("key_use", &key_use), + M_BindVariable("key_strafe", &key_strafe), + M_BindVariable("key_speed", &key_speed), + + M_BindVariable("mouseb_fire", &mousebfire), + M_BindVariable("mouseb_strafe", &mousebstrafe), + M_BindVariable("mouseb_forward", &mousebforward), + + M_BindVariable("joyb_fire", &joybfire), + M_BindVariable("joyb_strafe", &joybstrafe), + M_BindVariable("joyb_use", &joybuse), + M_BindVariable("joyb_speed", &joybspeed), + + // Extra controls that are not in the Vanilla versions: + + M_BindVariable("joyb_strafeleft", &joybstrafeleft); + M_BindVariable("joyb_straferight", &joybstraferight); + M_BindVariable("mouseb_strafeleft", &mousebstrafeleft); + M_BindVariable("mouseb_straferight", &mousebstraferight); + M_BindVariable("mouseb_use", &mousebuse); + M_BindVariable("mouseb_backward", &mousebbackward); + M_BindVariable("dclick_use", &dclick_use); + M_BindVariable("novert", &novert); +} + -- cgit v1.2.3