add binding of config variables (#1677)

* rename mn_setup.h->mn_internal.h

* binding of video and render variables

* bind input variables

* bind gamepad variables

* bind automap and HUD variables
This commit is contained in:
Roman Fomin 2024-05-07 18:09:13 +07:00 committed by GitHub
parent 323674e18d
commit 6db18d5e00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
69 changed files with 1420 additions and 3368 deletions

View File

@ -60,7 +60,7 @@ set(WOOF_SOURCES
m_io.c m_io.h
mn_font.c mn_font.h
mn_menu.c mn_menu.h
mn_setup.c mn_setup.h
mn_setup.c mn_internal.h
m_misc.c m_misc.h
m_random.c m_random.h
mn_snapshot.c mn_snapshot.h

View File

@ -27,8 +27,10 @@
#include "doomdata.h"
#include "doomdef.h"
#include "doomstat.h"
#include "doomtype.h"
#include "hu_stuff.h"
#include "i_video.h"
#include "m_config.h"
#include "m_input.h"
#include "mn_menu.h"
#include "m_misc.h"
@ -48,38 +50,44 @@
#include "z_zone.h"
//jff 1/7/98 default automap colors added
int mapcolor_back; // map background
int mapcolor_grid; // grid lines color
int mapcolor_wall; // normal 1s wall color
int mapcolor_fchg; // line at floor height change color
int mapcolor_cchg; // line at ceiling height change color
int mapcolor_clsd; // line at sector with floor=ceiling color
int mapcolor_rkey; // red key color
int mapcolor_bkey; // blue key color
int mapcolor_ykey; // yellow key color
int mapcolor_rdor; // red door color (diff from keys to allow option)
int mapcolor_bdor; // blue door color (of enabling one but not other )
int mapcolor_ydor; // yellow door color
int mapcolor_tele; // teleporter line color
int mapcolor_secr; // secret sector boundary color
int mapcolor_revsecr; // revealed secret sector boundary color
int mapcolor_exit; // jff 4/23/98 add exit line color
int mapcolor_unsn; // computer map unseen line color
int mapcolor_flat; // line with no floor/ceiling changes
int mapcolor_sprt; // general sprite color
int mapcolor_hair; // crosshair color
int mapcolor_sngl; // single player arrow color
int mapcolor_plyr[4]; // colors for player arrows in multiplayer
int mapcolor_frnd; // colors for friends of player
int mapcolor_item; // item sprite color
int mapcolor_enemy; // enemy sprite color
static int mapcolor_back; // map background
static int mapcolor_grid; // grid lines color
static int mapcolor_wall; // normal 1s wall color
static int mapcolor_fchg; // line at floor height change color
static int mapcolor_cchg; // line at ceiling height change color
static int mapcolor_clsd; // line at sector with floor=ceiling color
static int mapcolor_rkey; // red key color
static int mapcolor_bkey; // blue key color
static int mapcolor_ykey; // yellow key color
static int mapcolor_rdor; // red door color (diff from keys to allow option)
static int mapcolor_bdor; // blue door color (of enabling one but not other )
static int mapcolor_ydor; // yellow door color
static int mapcolor_tele; // teleporter line color
static int mapcolor_secr; // secret sector boundary color
static int mapcolor_revsecr; // revealed secret sector boundary color
static int mapcolor_exit; // jff 4/23/98 add exit line color
static int mapcolor_unsn; // computer map unseen line color
static int mapcolor_flat; // line with no floor/ceiling changes
static int mapcolor_sprt; // general sprite color
static int mapcolor_hair; // crosshair color
static int mapcolor_sngl; // single player arrow color
static int mapcolor_plyr[4]; // colors for player arrows in multiplayer
static int mapcolor_frnd; // colors for friends of player
static int mapcolor_item; // item sprite color
static int mapcolor_enemy; // enemy sprite color
//jff 3/9/98 add option to not show secret sectors until entered
int map_secret_after;
static boolean map_secret_after;
int map_keyed_door; // keyed doors are colored or flashing
enum {
MAP_KEYED_DOOR_OFF,
MAP_KEYED_DOOR_COLOR,
MAP_KEYED_DOOR_FLASH
};
int map_smooth_lines;
static int map_keyed_door; // keyed doors are colored or flashing
static boolean map_smooth_lines;
// [Woof!] FRACTOMAPBITS: overflow-safe coordinate system.
// Written by Andrey Budko (entryway), adapted from prboom-plus/src/am_map.*
@ -209,7 +217,7 @@ static mline_t thintriangle_guy[] =
int ddt_cheating = 0; // killough 2/7/98: make global, rename to ddt_*
int automap_grid = 0;
boolean automap_grid = false;
boolean automapactive = false;
static boolean automapfirststart = true;
@ -274,7 +282,7 @@ static patch_t *marknums[10]; // numbers used for marking by the automap
mpoint_t *markpoints = NULL; // where the points are
int markpointnum = 0; // next point to be assigned (also number of points now)
int markpointnum_max = 0; // killough 2/22/98
int followplayer = 1; // specifies whether to follow the player around
boolean followplayer = true; // specifies whether to follow the player around
static boolean stopped = true;
@ -290,10 +298,6 @@ static void AM_rotatePoint(mpoint_t *pt);
static mpoint_t mapcenter;
static angle_t mapangle;
// [FG] prev/next weapon keys and buttons
extern int mousebprevweapon;
extern int mousebnextweapon;
//
// AM_activateNewScale()
//
@ -1030,11 +1034,11 @@ static void AM_doFollowPlayer(void)
// pointer. Allows map inspection without moving player to the location.
//
int map_point_coordinates;
static boolean map_point_coord;
void AM_Coordinates(const mobj_t *mo, fixed_t *x, fixed_t *y, fixed_t *z)
{
*z = followplayer || !map_point_coordinates || !automapactive ? *x = mo->x, *y = mo->y, mo->z :
*z = followplayer || !map_point_coord || !automapactive ? *x = mo->x, *y = mo->y, mo->z :
R_PointInSubsector(*x = (m_x+m_w/2) << FRACTOMAPBITS, *y = (m_y+m_h/2) << FRACTOMAPBITS)->sector->floorheight;
}
@ -2351,6 +2355,70 @@ void AM_ColorPreset(void)
}
}
void AM_BindAutomapVariables(void)
{
M_BindBool("followplayer", &followplayer, NULL, true, ss_auto, wad_no,
"1 to enable automap follow player mode");
M_BindNum("automapoverlay", &automapoverlay, NULL, AM_OVERLAY_OFF,
AM_OVERLAY_OFF, AM_OVERLAY_DARK, ss_auto, wad_no,
"Automap overlay mode (1 = On, 2 = Dark)");
M_BindBool("automaprotate", &automaprotate, NULL, false, ss_auto, wad_no,
"1 to enable automap rotate mode");
M_BindBool("map_point_coord", &map_point_coord, NULL, true, ss_auto, wad_no,
"1 to show automap pointer coordinates in non-follow mode");
M_BindBool("map_secret_after", &map_secret_after, NULL, false, ss_auto, wad_no,
"1 to not show secret sectors till after entered");
M_BindNum("map_keyed_door", &map_keyed_door, NULL,
MAP_KEYED_DOOR_COLOR, MAP_KEYED_DOOR_OFF, MAP_KEYED_DOOR_FLASH,
ss_auto, wad_no,
"Keyed doors are colored (1) or flashing (2) on the automap");
M_BindBool("map_smooth_lines", &map_smooth_lines, NULL, true, ss_auto,
wad_no, "1 to enable smooth automap lines");
M_BindNum("mapcolor_preset", &mapcolor_preset, NULL, 1, 0, 2, ss_auto, wad_no,
"Automap color preset (0 = Vanilla Doom, 1 = Boom (default), "
"2 = ZDoom)");
#define BIND_CR(name, v, help) \
M_BindNum(#name, &name, NULL, (v), 0, 255, ss_none, wad_yes, help)
BIND_CR(mapcolor_back, 247, "Color used as background for automap");
BIND_CR(mapcolor_grid, 104, "Color used for automap grid lines");
BIND_CR(mapcolor_wall, 23, "Color used for one side walls on automap");
BIND_CR(mapcolor_fchg, 55, "Color used for lines floor height changes across");
BIND_CR(mapcolor_cchg, 215, "Color used for lines ceiling height changes across");
BIND_CR(mapcolor_clsd, 208, "Color used for lines denoting closed doors, objects");
BIND_CR(mapcolor_rkey, 175, "Color used for red key sprites");
BIND_CR(mapcolor_bkey, 204, "Color used for blue key sprites");
BIND_CR(mapcolor_ykey, 231, "Color used for yellow key sprites");
BIND_CR(mapcolor_rdor, 175, "Color used for closed red doors");
BIND_CR(mapcolor_bdor, 204, "Color used for closed blue doors");
BIND_CR(mapcolor_ydor, 231, "Color used for closed yellow doors");
BIND_CR(mapcolor_tele, 119, "Color used for teleporter lines");
BIND_CR(mapcolor_secr, 252, "Color used for lines around secret sectors");
BIND_CR(mapcolor_revsecr, 112, "Color used for lines around revealed secret sectors");
BIND_CR(mapcolor_exit, 0, "Color used for exit lines");
BIND_CR(mapcolor_unsn, 104, "Color used for lines not seen without computer map");
BIND_CR(mapcolor_flat, 88, "Color used for lines with no height changes");
BIND_CR(mapcolor_sprt, 112, "Color used as things");
BIND_CR(mapcolor_hair, 208, "Color used for dot crosshair denoting center of map");
BIND_CR(mapcolor_sngl, 208, "Color used for the single player arrow");
#define BIND_PLR_CR(num, v, help) \
M_BindNum("mapcolor_ply"#num, &mapcolor_plyr[(num)-1], NULL, (v), 0, 255, \
ss_none, wad_yes, help)
BIND_PLR_CR(1, 112, "Color used for the green player arrow");
BIND_PLR_CR(2, 88, "Color used for the gray player arrow");
BIND_PLR_CR(3, 64, "Color used for the brown player arrow");
BIND_PLR_CR(4, 176, "Color used for the red player arrow");
BIND_CR(mapcolor_frnd, 252, "Color used for friends");
BIND_CR(mapcolor_enemy, 177, "Color used for enemies");
BIND_CR(mapcolor_item, 231, "Color used for countable items");
}
//----------------------------------------------------------------------------
//
// $Log: am_map.c,v $

View File

@ -62,6 +62,8 @@ void AM_EnableSmoothLines(void);
void AM_ColorPreset(void);
void AM_BindAutomapVariables(void);
typedef struct
{
int64_t x,y;
@ -69,56 +71,11 @@ typedef struct
extern mpoint_t *markpoints;
extern int markpointnum, markpointnum_max;
extern int followplayer;
extern int automap_grid;
extern boolean followplayer;
extern boolean automap_grid;
// end changes -- killough 2/22/98
// killough 5/2/98: moved from m_misc.c
//jff 1/7/98 automap colors added
extern int mapcolor_back; // map background
extern int mapcolor_grid; // grid lines color
extern int mapcolor_wall; // normal 1s wall color
extern int mapcolor_fchg; // line at floor height change color
extern int mapcolor_cchg; // line at ceiling height change color
extern int mapcolor_clsd; // line at sector with floor=ceiling color
extern int mapcolor_rkey; // red key color
extern int mapcolor_bkey; // blue key color
extern int mapcolor_ykey; // yellow key color
extern int mapcolor_rdor; // red door color (diff from keys to allow option)
extern int mapcolor_bdor; // blue door color (of enabling one not other)
extern int mapcolor_ydor; // yellow door color
extern int mapcolor_tele; // teleporter line color
extern int mapcolor_secr; // secret sector boundary color
extern int mapcolor_revsecr; // revealed secret sector boundary color
//jff 4/23/98
extern int mapcolor_exit; // exit line
extern int mapcolor_unsn; // computer map unseen line color
extern int mapcolor_flat; // line with no floor/ceiling changes
extern int mapcolor_sprt; // general sprite color
extern int mapcolor_hair; // crosshair color
extern int mapcolor_sngl; // single player arrow color
extern int mapcolor_plyr[4]; // colors for player arrows in multiplayer
extern int mapcolor_frnd; // killough 8/8/98: colors for friends
extern int mapcolor_enemy;
extern int mapcolor_item;
extern int mapcolor_preset;
//jff 3/9/98
extern int map_secret_after; // secrets do not appear til after bagged
enum {
MAP_KEYED_DOOR_OFF,
MAP_KEYED_DOOR_COLOR,
MAP_KEYED_DOOR_FLASH
};
extern int map_keyed_door; // keyed doors are colored or flashing
extern int map_smooth_lines;
extern int map_point_coordinates; // killough 10/98
#endif
//----------------------------------------------------------------------------

View File

@ -161,11 +161,14 @@ char *basedefault = NULL; // default file
char *basesavegame = NULL; // killough 2/16/98: savegame directory
char *screenshotdir = NULL; // [FG] screenshot directory
boolean organize_savefiles;
int organize_savefiles;
boolean coop_spawns = false;
boolean demobar;
static boolean demobar;
// [FG] colored blood and gibs
static boolean colored_blood;
void D_ConnectNetGame (void);
void D_CheckNetGame (void);
@ -260,8 +263,7 @@ void D_UpdateDeltaTics(void)
// wipegamestate can be set to -1 to force a wipe on the next draw
gamestate_t wipegamestate = GS_DEMOSCREEN;
boolean screen_melt = true;
extern int showMessages;
static int screen_melt = wipe_Melt;
void D_Display (void)
{
@ -1949,7 +1951,7 @@ void D_SetBloodColor(void)
// killough 2/22/98: Add support for ENDBOOM, which is PC-specific
// killough 8/1/98: change back to ENDOOM
int show_endoom;
static int show_endoom;
// Don't show ENDOOM if we have it disabled.
boolean D_CheckEndDoom(void)
@ -2533,6 +2535,8 @@ void D_DoomMain(void)
if ((p = M_CheckParm("-dumplumps")) && p < myargc-1)
WritePredefinedLumpWad(myargv[p+1]);
M_InitConfig();
M_LoadDefaults(); // load before initing other systems
PrintVersion();
@ -2728,7 +2732,6 @@ void D_DoomMain(void)
I_InitController();
I_InitSound();
I_InitMusic();
MN_InitMidiPlayer();
I_Printf(VB_INFO, "NET_Init: Init network subsystem.");
NET_Init();
@ -2956,6 +2959,25 @@ void D_DoomMain(void)
}
}
void D_BindMiscVariables(void)
{
BIND_NUM_GENERAL(show_endoom, 0, 0, 2,
"Show ENDOOM screen (0 = Off, 1 = On, 2 = PWAD only)");
BIND_BOOL_GENERAL(demobar, false, "1 to enable demo progress bar");
BIND_NUM_GENERAL(screen_melt, wipe_Melt, wipe_None, wipe_Fizzle,
"Screen wipe effect (0 = None, 1 = Melt, 2 = Crossfade, 3 = Fizzlefade)");
BIND_BOOL_GENERAL(palette_changes, true, "0 to disable palette changes");
BIND_NUM_GENERAL(organize_savefiles, -1, -1, 1,
"1 to organize save files");
M_BindStr("net_player_name", &net_player_name, DEFAULT_PLAYER_NAME, wad_no,
"Network setup player name");
BIND_NUM(default_verbosity, VB_INFO, VB_ERROR, VB_MAX - 1,
"Verbosity level (1 = Errors only, 2 = Warnings, 3 = Info, 4 = Debug)");
M_BindBool("colored_blood", &colored_blood, NULL, false, ss_enem, wad_no,
"1 to enable colored blood");
}
//----------------------------------------------------------------------------
//
// $Log: d_main.c,v $

View File

@ -50,6 +50,8 @@ void D_PostEvent(struct event_s *ev);
void D_UpdateDeltaTics(void);
void D_BindMiscVariables(void);
//
// BASE LEVEL
//

View File

@ -199,6 +199,11 @@ typedef enum {
ss_max
} ss_types;
typedef enum {
wad_no,
wad_yes
} wad_allowed_t;
// phares 3/20/98:
//
// Player friction is variable, based on controlling

View File

@ -18,6 +18,7 @@
//-----------------------------------------------------------------------------
#include "doomstat.h"
#include "doomtype.h"
#include "m_misc.h"
// Game Mode - identify IWAD as shareware, retail etc.
@ -50,8 +51,6 @@ int compatibility, default_compatibility; // killough 1/31/98
int comp[COMP_TOTAL], default_comp[COMP_TOTAL]; // killough 10/98
invul_mode_t invul_mode;
// [FG] overflow emulation
overflow_t overflow[EMU_TOTAL] = {
{ true, false, "spechits_overflow"},
@ -64,9 +63,9 @@ overflow_t overflow[EMU_TOTAL] = {
demo_version_t demo_version; // killough 7/19/98: Boom version of demo
// v1.1-like pitched sounds
int pitched_sounds; // killough 10/98
boolean pitched_sounds; // killough 10/98
int translucency; // killough 10/98
boolean translucency; // killough 10/98
int allow_pushers = 1; // MT_PUSH Things // phares 3/10/98
int default_allow_pushers; // killough 3/1/98: make local to each game
@ -74,47 +73,43 @@ int default_allow_pushers; // killough 3/1/98: make local to each game
int variable_friction = 1; // ice & mud // phares 3/10/98
int default_variable_friction; // killough 3/1/98: make local to each game
int weapon_recoil; // weapon recoil // phares
int default_weapon_recoil; // killough 3/1/98: make local to each game
boolean weapon_recoil; // weapon recoil // phares
boolean default_weapon_recoil; // killough 3/1/98: make local to each game
int player_bobbing; // whether player bobs or not // phares 2/25/98
int default_player_bobbing; // killough 3/1/98: make local to each game
boolean player_bobbing; // whether player bobs or not // phares 2/25/98
boolean default_player_bobbing; // killough 3/1/98: make local to each game
int monsters_remember=1; // killough 3/1/98
int default_monsters_remember=1;
boolean monsters_remember = true; // killough 3/1/98
boolean default_monsters_remember = true;
int monster_infighting=1; // killough 7/19/98: monster<=>monster attacks
int default_monster_infighting=1;
boolean monster_infighting = true; // killough 7/19/98: monster<=>monster attacks
boolean default_monster_infighting = true;
int monster_friction=1; // killough 10/98: monsters affected by friction
int default_monster_friction=1;
boolean monster_friction = true; // killough 10/98: monsters affected by friction
boolean default_monster_friction = true;
// killough 7/19/98: classic Doom BFG
int classic_bfg, default_classic_bfg;
boolean classic_bfg, default_classic_bfg;
// killough 7/24/98: Emulation of Press Release version of Doom
int beta_emulation;
int dogs, default_dogs; // killough 7/19/98: Marine's best friend :)
int dog_jumping, default_dog_jumping; // killough 10/98
boolean dog_jumping, default_dog_jumping; // killough 10/98
// killough 8/8/98: distance friends tend to move towards players
int distfriend = 128, default_distfriend = 128;
// killough 9/8/98: whether monsters are allowed to strafe or retreat
int monster_backing, default_monster_backing;
boolean monster_backing, default_monster_backing;
// killough 9/9/98: whether monsters are able to avoid hazards (e.g. crushers)
int monster_avoid_hazards, default_monster_avoid_hazards;
boolean monster_avoid_hazards, default_monster_avoid_hazards;
// killough 9/9/98: whether monsters help friends
int help_friends, default_help_friends;
boolean help_friends, default_help_friends;
int flashing_hom; // killough 10/98
int doom_weapon_toggles; // killough 10/98
int monkeys, default_monkeys;
boolean monkeys, default_monkeys;
boolean hide_weapon;

View File

@ -114,21 +114,14 @@ extern demo_version_t demo_version; // killough 7/19/98: Version of de
#define mbf21 (demo_version == DV_MBF21)
// killough 7/19/98: whether monsters should fight against each other
extern int monster_infighting, default_monster_infighting;
extern boolean monster_infighting, default_monster_infighting;
extern int monkeys, default_monkeys;
extern boolean monkeys, default_monkeys;
// v1.1-like pitched sounds
extern int pitched_sounds;
extern boolean pitched_sounds;
extern int translucency;
enum {
TRANSLUCENCY_OFF,
TRANSLUCENCY_WALLS,
TRANSLUCENCY_THINGS,
TRANSLUCENCY_ALL
};
extern boolean translucency;
extern int demo_insurance; // killough 4/5/98
@ -173,15 +166,6 @@ enum {
extern int comp[COMP_TOTAL], default_comp[COMP_TOTAL];
typedef enum
{
INVUL_VANILLA,
INVUL_MBF,
INVUL_GRAY,
} invul_mode_t;
extern invul_mode_t invul_mode;
// -------------------------------------------
// Language.
extern Language_t language;
@ -377,7 +361,7 @@ extern wbstartstruct_t wminfo;
// File handling stuff.
extern char *basedefault;
extern boolean organize_savefiles;
extern int organize_savefiles;
// if true, load all graphics at level load
extern boolean precache;
@ -386,11 +370,6 @@ extern boolean precache;
// to force a wipe on the next draw
extern gamestate_t wipegamestate;
extern int mouseSensitivity_horiz; // killough
extern int mouseSensitivity_vert;
extern int mouseSensitivity_horiz_strafe; // [FG] strafe
extern int mouseSensitivity_vert_look; // [FG] look
// debug flag to cancel adaptiveness
extern boolean singletics;
@ -416,44 +395,38 @@ extern int default_allow_pushers;
extern int variable_friction; // ice & mud // phares 3/10/98
extern int default_variable_friction;
extern int monsters_remember; // killough 3/1/98
extern int default_monsters_remember;
extern boolean monsters_remember; // killough 3/1/98
extern boolean default_monsters_remember;
extern int weapon_recoil; // weapon recoil // phares
extern int default_weapon_recoil;
extern boolean weapon_recoil; // weapon recoil // phares
extern boolean default_weapon_recoil;
extern int player_bobbing; // whether player bobs or not // phares 2/25/98
extern int default_player_bobbing; // killough 3/1/98: make local to each game
extern boolean player_bobbing; // whether player bobs or not // phares 2/25/98
extern boolean default_player_bobbing; // killough 3/1/98: make local to each game
// killough 7/19/98: Classic Pre-Beta BFG
extern int classic_bfg, default_classic_bfg;
extern boolean classic_bfg, default_classic_bfg;
// killough 7/24/98: Emulation of Press Release version of Doom
extern int beta_emulation;
extern int dogs, default_dogs; // killough 7/19/98: Marine's best friend :)
extern int dog_jumping, default_dog_jumping; // killough 10/98
extern boolean dog_jumping, default_dog_jumping; // killough 10/98
// killough 8/8/98: distance friendly monsters tend to stay from player
extern int distfriend, default_distfriend;
// killough 9/8/98: whether monsters are allowed to strafe or retreat
extern int monster_backing, default_monster_backing;
extern boolean monster_backing, default_monster_backing;
// killough 9/9/98: whether monsters intelligently avoid hazards
extern int monster_avoid_hazards, default_monster_avoid_hazards;
extern boolean monster_avoid_hazards, default_monster_avoid_hazards;
// killough 10/98: whether monsters are affected by friction
extern int monster_friction, default_monster_friction;
extern boolean monster_friction, default_monster_friction;
// killough 9/9/98: whether monsters help friends
extern int help_friends, default_help_friends;
extern boolean pistolstart, default_pistolstart;
extern int flashing_hom; // killough 10/98
extern int doom_weapon_toggles; // killough 10/98
extern boolean help_friends, default_help_friends;
extern boolean hide_weapon;

View File

@ -33,8 +33,10 @@
#include "d_player.h"
#include "d_ticcmd.h"
#include "doomdata.h"
#include "doomdef.h"
#include "doomkeys.h"
#include "doomstat.h"
#include "doomtype.h"
#include "f_finale.h"
#include "g_game.h"
#include "hu_obituary.h"
@ -51,21 +53,23 @@
#include "m_config.h"
#include "m_input.h"
#include "m_io.h"
#include "mn_menu.h"
#include "m_misc.h"
#include "m_random.h"
#include "mn_setup.h"
#include "mn_snapshot.h"
#include "m_swap.h" // [FG] LONG
#include "memio.h"
#include "mn_menu.h"
#include "mn_snapshot.h"
#include "net_defs.h"
#include "p_enemy.h"
#include "p_inter.h"
#include "p_map.h"
#include "p_maputl.h"
#include "p_mobj.h"
#include "p_pspr.h"
#include "p_saveg.h"
#include "p_setup.h"
#include "p_tick.h"
#include "p_user.h"
#include "r_data.h"
#include "r_defs.h"
#include "r_draw.h"
@ -146,17 +150,18 @@ boolean precache = true; // if true, load all graphics at start
wbstartstruct_t wminfo; // parms for world map / intermission
boolean haswolflevels = false;// jff 4/18/98 wolf levels present
byte *savebuffer;
int autorun = false; // always running? // phares
boolean autostrafe50;
int novert = false;
boolean autorun = false; // always running? // phares
static boolean autostrafe50;
boolean novert = false;
boolean mouselook = false;
boolean padlook = false;
// killough 4/13/98: Make clock rate adjustable by scale factor
int realtic_clock_rate = 100;
static boolean doom_weapon_toggles;
complevel_t force_complevel, default_complevel;
boolean pistolstart, default_pistolstart;
static boolean pistolstart, default_pistolstart;
boolean strictmode, default_strictmode;
boolean force_strictmode;
@ -170,10 +175,15 @@ static ticcmd_t* last_cmd = NULL;
//
int key_escape = KEY_ESCAPE; // phares 4/13/98
int key_help = KEY_F1; // phares 4/13/98
static int mouse_sensitivity;
static int mouse_sensitivity_y;
static int mouse_sensitivity_strafe; // [FG] strafe
static int mouse_sensitivity_y_look; // [FG] look
// [FG] double click acts as "use"
int dclick_use;
static boolean dclick_use;
// [FG] invert vertical axis
int mouse_y_invert;
static boolean mouse_y_invert;
#define MAXPLMOVE (forwardmove[1])
#define TURBOTHRESHOLD 0x32
@ -220,7 +230,7 @@ int savegameslot = -1;
char savedescription[32];
//jff 3/24/98 declare startskill external, define defaultskill here
int defaultskill; //note 1-based
int default_skill; //note 1-based
// killough 2/8/98: make corpse queue variable in size
int bodyqueslot, bodyquesize, default_bodyquesize; // killough 2/8/98, 10/98
@ -489,39 +499,39 @@ static int CarryMouseSide(double side)
static double CalcMouseAngle(int mousex)
{
if (!mouseSensitivity_horiz)
if (!mouse_sensitivity)
return 0.0;
return (I_AccelerateMouse(mousex) * (mouseSensitivity_horiz + 5) * 8 / 10);
return (I_AccelerateMouse(mousex) * (mouse_sensitivity + 5) * 8 / 10);
}
static double CalcMousePitch(int mousey)
{
double pitch;
if (!mouseSensitivity_vert_look)
if (!mouse_sensitivity_y_look)
return 0.0;
pitch = I_AccelerateMouse(mousey) * (mouseSensitivity_vert_look + 5) * 8 / 10;
pitch = I_AccelerateMouse(mousey) * (mouse_sensitivity_y_look + 5) * 8 / 10;
return pitch * FRACUNIT * direction[mouse_y_invert];
}
static double CalcMouseSide(int mousex)
{
if (!mouseSensitivity_horiz_strafe)
if (!mouse_sensitivity_strafe)
return 0.0;
return (I_AccelerateMouse(mousex) *
(mouseSensitivity_horiz_strafe + 5) * 2 / 10);
(mouse_sensitivity_strafe + 5) * 2 / 10);
}
static double CalcMouseVert(int mousey)
{
if (!mouseSensitivity_vert)
if (!mouse_sensitivity_y)
return 0.0;
return (I_AccelerateMouse(mousey) * (mouseSensitivity_vert + 5) / 10);
return (I_AccelerateMouse(mousey) * (mouse_sensitivity_y + 5) / 10);
}
void G_PrepTiccmd(void)
@ -3411,8 +3421,8 @@ void G_ReloadDefaults(boolean keep_demover)
//jff 3/24/98 set startskill from defaultskill in config file, unless
// it has already been set by a -skill parameter
if (startskill==sk_default)
startskill = (skill_t)(defaultskill-1);
if (startskill == sk_default)
startskill = (skill_t)(default_skill - 1);
demoplayback = false;
singledemo = false; // killough 9/29/98: don't stop after 1 demo
@ -4470,8 +4480,6 @@ boolean G_CheckDemoStatus(void)
#define MAX_MESSAGE_SIZE 1024
extern int show_toggle_messages, show_pickup_messages;
void doomprintf(player_t *player, msg_category_t category, const char *s, ...)
{
static char msg[MAX_MESSAGE_SIZE];
@ -4492,6 +4500,172 @@ void doomprintf(player_t *player, msg_category_t category, const char *s, ...)
players[displayplayer].message = msg; // set new message
}
void G_BindGameInputVariables(void)
{
BIND_BOOL(autorun, true, "1 to enable autorun");
BIND_BOOL_GENERAL(mouselook, false, "1 to enable mouselook");
BIND_NUM_GENERAL(mouse_sensitivity, 5, 0, UL,
"Adjust horizontal (x) mouse sensitivity for turning");
BIND_NUM_GENERAL(mouse_sensitivity_y, 5, 0, UL,
"Adjust vertical (y) mouse sensitivity for moving");
BIND_NUM_GENERAL(mouse_sensitivity_strafe, 5, 0, UL,
"Adjust horizontal (x) mouse sensitivity for strafing");
BIND_NUM_GENERAL(mouse_sensitivity_y_look, 5, 0, UL,
"Adjust vertical (y) mouse sensitivity for looking");
BIND_BOOL_GENERAL(mouse_y_invert, false, "1 to invert vertical axis");
BIND_BOOL_GENERAL(dclick_use, true, "Double click acts as \"use\"");
BIND_BOOL(novert, true, "1 to disable vertical mouse movement");
BIND_BOOL_GENERAL(padlook, false, "1 to enable padlook");
}
void G_BindGameVariables(void)
{
BIND_BOOL(shorttics, false, "1 to use low resolution turning");
BIND_NUM_GENERAL(default_skill, 3, 1, 5,
"Selects default skill (1 = ITYTD, 2 = HNTR, 3 = HMP, 4 = UV, 5 = NM)");
BIND_NUM_GENERAL(realtic_clock_rate, 100, 10, 1000,
"Percentage of normal speed realtic clock runs at");
M_BindNum("max_player_corpse", &default_bodyquesize, NULL,
32, UL, UL, ss_none, wad_no,
"Number of dead bodies in view supported (Negative value = No limit)");
BIND_NUM_GENERAL(death_use_action, 0, 0, 2,
"\"Use\" button action on death (0 = Default, 1 = Load save, 2 = Nothing)");
}
void G_BindEnemVariables(void)
{
M_BindNum("player_helpers", &default_dogs, &dogs, 0, 0, 3, ss_enem, wad_yes,
"Number of dogs");
M_BindBool("ghost_monsters", &ghost_monsters, NULL, true, ss_enem, wad_no,
"1 to enable \"ghost monsters\" (resurrected pools of gore are "
"translucent)");
M_BindBool("monsters_remember", &default_monsters_remember, &monsters_remember,
true, ss_none, wad_yes,
"1 to enable monsters remembering enemies after killing others");
M_BindBool("monster_infighting", &default_monster_infighting, &monster_infighting,
true, ss_none, wad_yes,
"1 to enable monsters fighting against each other when provoked");
M_BindBool("monster_backing", &default_monster_backing, &monster_backing,
false, ss_none, wad_yes,
"1 to enable monsters backing away from targets");
M_BindBool("monster_avoid_hazards", &default_monster_avoid_hazards, &monster_avoid_hazards,
true, ss_none, wad_yes,
"1 to enable monsters to intelligently avoid hazards");
M_BindBool("monkeys", &default_monkeys, &monkeys, false, ss_none, wad_yes,
"1 to enable monsters to move up/down steep stairs");
M_BindBool("monster_friction", &default_monster_friction, &monster_friction,
true, ss_none, wad_yes,
"1 to enable monsters to be affected by friction");
M_BindBool("help_friends", &default_help_friends, &help_friends,
false, ss_none, wad_yes, "1 to enable monsters to help dying friends");
M_BindNum("friend_distance", &default_distfriend, &distfriend,
128, 0, 999, ss_none, wad_yes, "Distance friends stay away");
M_BindBool("dog_jumping", &default_dog_jumping, &dog_jumping,
true, ss_none, wad_yes, "1 to enable dogs to jump");
}
void G_BindCompVariables(void)
{
M_BindNum("default_complevel", &default_complevel, NULL,
CL_MBF21, CL_VANILLA, CL_MBF21, ss_comp, wad_no,
"0 = Vanilla, 1 = Boom, 2 = MBF, 3 = MBF21");
M_BindBool("autostrafe50", &autostrafe50, NULL, false, ss_comp, wad_no,
"1 to enable auto strafe50");
M_BindBool("strictmode", &default_strictmode, &strictmode,
false, ss_comp, wad_no, "1 to enable strict mode");
M_BindBool("hangsolid", &hangsolid, NULL, false, ss_comp, wad_no,
"1 to walk under solid hanging bodies");
M_BindBool("blockmapfix", &blockmapfix, NULL, false, ss_comp, wad_no,
"1 to enable blockmap bug fix");
M_BindBool("checksight12", &checksight12, NULL, false, ss_comp, wad_no,
"1 to enable fast blockmap-based line-of-sight calculation");
M_BindBool("direct_vertical_aiming", &default_direct_vertical_aiming, &direct_vertical_aiming,
false, ss_comp, wad_no, "1 to enable direct vertical aiming");
M_BindBool("pistolstart", &default_pistolstart, &pistolstart,
false, ss_comp, wad_no, "1 to enable pistol start");
#define BIND_COMP(id, v, help) \
M_BindNum(#id, &default_comp[(id)], &comp[(id)], (v), 0, 1, ss_none, wad_yes, help)
BIND_COMP(comp_zombie, 1, "Zombie players can exit levels");
BIND_COMP(comp_infcheat, 0, "Powerup cheats are not infinite duration");
BIND_COMP(comp_stairs, 0, "Build stairs exactly the same way that Doom does");
BIND_COMP(comp_telefrag, 0, "Monsters can telefrag on MAP30");
BIND_COMP(comp_dropoff, 0, "Some objects never move over tall ledges");
BIND_COMP(comp_falloff, 0, "Objects don't fall off ledges under their own weight");
BIND_COMP(comp_staylift, 0, "Monsters randomly walk off of moving lifts");
BIND_COMP(comp_doorstuck, 0, "Monsters get stuck on doortracks");
BIND_COMP(comp_pursuit, 1, "Monsters don't give up pursuit of targets");
BIND_COMP(comp_vile, 0, "Arch-Vile resurrects invincible ghosts");
BIND_COMP(comp_pain, 0, "Pain Elemental limited to 20 lost souls");
BIND_COMP(comp_skull, 0, "Lost souls get stuck behind walls");
BIND_COMP(comp_blazing, 0, "Blazing doors make double closing sounds");
BIND_COMP(comp_doorlight, 0, "Tagged doors don't trigger special lighting");
BIND_COMP(comp_god, 0, "God mode isn't absolute");
BIND_COMP(comp_skymap, 0, "Sky is unaffected by invulnerability");
BIND_COMP(comp_floors, 0, "Use exactly Doom's floor motion behavior");
BIND_COMP(comp_model, 0, "Use exactly Doom's linedef trigger model");
BIND_COMP(comp_zerotags, 0, "Linedef effects work with sector tag = 0");
BIND_COMP(comp_respawn, 0, "Creatures with no spawnpoint respawn at (0,0)");
BIND_COMP(comp_ledgeblock, 1, "Ledges block ground enemies");
BIND_COMP(comp_friendlyspawn, 1, "A_Spawn new thing inherits friendliness");
BIND_COMP(comp_voodooscroller, 0, "Voodoo dolls on slow scrollers move too slowly");
BIND_COMP(comp_reservedlineflag, 1, "ML_RESERVED clears extended flags");
#define BIND_EMU(id, v, help) \
M_BindBool(#id, &overflow[(id)].enabled, NULL, (v), ss_none, wad_no, help)
BIND_EMU(emu_spechits, true, "SPECHITS overflow emulation");
BIND_EMU(emu_reject, true, "REJECT overflow emulation");
M_BindBool("emu_intercepts", &overflow[emu_intercepts].enabled, NULL, true,
ss_comp, wad_no, "INTERCEPTS overflow emulation");
BIND_EMU(emu_missedbackside, false, "Missed backside emulation");
BIND_EMU(emu_donut, true, "Donut overrun emulation");
}
void G_BindWeapVariables(void)
{
M_BindNum("view_bobbing_pct", &view_bobbing_pct, NULL, 4, 0, 4, ss_weap, wad_no,
"Player View Bobbing (0 - 0%, 1 - 25% ... 4 - 100%)");
M_BindNum("weapon_bobbing_pct", &weapon_bobbing_pct, NULL,
4, 0, 4, ss_weap, wad_no,
"Player Weapon Bobbing (0 - 0%, 1 - 25% ... 4 - 100%)");
M_BindBool("hide_weapon", &hide_weapon, NULL, false, ss_weap, wad_no,
"1 to hide weapon");
M_BindNum("center_weapon", &center_weapon, NULL, 0, 0, 2, ss_weap, wad_no,
"1 to center the weapon sprite during attack, 2 to keep it bobbing");
M_BindBool("weapon_recoilpitch", &weapon_recoilpitch, NULL,
false, ss_weap, wad_no,
"1 to enable recoil pitch from weapon fire");
M_BindBool("weapon_recoil", &default_weapon_recoil, &weapon_recoil,
false, ss_none, wad_yes,
"1 to enable recoil from weapon fire (Boom version)");
M_BindBool("doom_weapon_toggles", &doom_weapon_toggles, NULL,
true, ss_weap, wad_no,
"1 to toggle between SG/SSG and Fist/Chainsaw");
M_BindBool("player_bobbing", &default_player_bobbing, &player_bobbing,
true, ss_none, wad_no, "1 to enable player bobbing (Boom version");
#define BIND_WEAP(num, v, help) \
M_BindNum("weapon_choice_"#num, &weapon_preferences[0][(num) - 1], NULL, \
(v), 1, 9, ss_weap, wad_yes, help)
BIND_WEAP(1, 6, "First choice for weapon (best)");
BIND_WEAP(2, 9, "Second choice for weapon");
BIND_WEAP(3, 4, "Third choice for weapon");
BIND_WEAP(4, 3, "Fourth choice for weapon");
BIND_WEAP(5, 2, "Fifth choice for weapon");
BIND_WEAP(6, 8, "Sixth choice for weapon");
BIND_WEAP(7, 5, "Seventh choice for weapon");
BIND_WEAP(8, 7, "Eighth choice for weapon");
BIND_WEAP(9, 1, "Ninth choice for weapon (worst)");
M_BindBool("classic_bfg", &default_classic_bfg, &classic_bfg,
false, ss_weap, wad_yes, "1 to enable pre-beta BFG2704");
}
//----------------------------------------------------------------------------
//
// $Log: g_game.c,v $

View File

@ -76,6 +76,12 @@ const char *G_GetCurrentComplevelName(void);
int G_GotoNextLevel(int *pEpi, int *pMap);
void G_BindGameInputVariables(void);
void G_BindGameVariables(void);
void G_BindEnemVariables(void);
void G_BindCompVariables(void);
void G_BindWeapVariables(void);
typedef enum
{
CL_NONE = -1,
@ -93,17 +99,15 @@ extern int realtic_clock_rate;
extern int key_escape;
extern int key_enter;
extern int key_help;
extern int autorun; // always running? // phares
extern boolean autostrafe50;
extern int novert;
extern boolean autorun; // always running? // phares
extern boolean novert;
extern boolean mouselook;
extern boolean padlook;
extern int dclick_use; // [FG] double click acts as "use"
extern fixed_t *forwardmove;
extern fixed_t *sidemove;
extern int defaultskill; //jff 3/24/98 default skill
extern int default_skill; //jff 3/24/98 default skill
extern boolean haswolflevels; //jff 4/18/98 wolf levels present
extern int bodyquesize, default_bodyquesize; // killough 2/8/98, 10/98

View File

@ -36,7 +36,7 @@
#define HU_GAPX 2
static int left_margin, right_margin;
int hud_widescreen_widgets;
boolean hud_widescreen_widgets;
void HUlib_set_margins (void)
{

View File

@ -29,7 +29,7 @@
#include "net_client.h"
#include "p_mobj.h"
int show_obituary_messages;
boolean show_obituary_messages;
int hudcolor_obituary;
// [FG] gender-neutral pronouns
@ -46,7 +46,7 @@ struct
{"%r", "they're"},
};
static char *playerstr[] = {
static const char *playerstr[] = {
"Player 1",
"Player 2",
"Player 3",

View File

@ -18,6 +18,7 @@
#ifndef __HU_OBITUARY_H__
#define __HU_OBITUARY_H__
#include "doomtype.h"
struct mobj_s;
typedef enum
@ -33,7 +34,7 @@ typedef enum
void HU_InitObituaries(void);
void HU_Obituary(struct mobj_s *target, struct mobj_s *source, method_t mod);
extern int show_obituary_messages;
extern boolean show_obituary_messages;
extern int hudcolor_obituary;
#endif

View File

@ -26,13 +26,16 @@
#include "d_event.h"
#include "d_items.h"
#include "d_player.h"
#include "doomdef.h"
#include "doomkeys.h"
#include "doomstat.h"
#include "doomtype.h"
#include "dstrings.h"
#include "hu_lib.h"
#include "hu_obituary.h"
#include "hu_stuff.h"
#include "i_video.h" // fps
#include "m_config.h"
#include "m_fixed.h"
#include "m_input.h"
#include "m_misc.h"
@ -57,10 +60,10 @@
// global heads up display controls
int hud_active; //jff 2/17/98 controls heads-up display mode
int hud_displayed; //jff 2/23/98 turns heads-up display on/off
int hud_secret_message; // "A secret is revealed!" message
int hud_widget_font;
int hud_widget_layout;
boolean hud_displayed; //jff 2/23/98 turns heads-up display on/off
boolean hud_secret_message; // "A secret is revealed!" message
static int hud_widget_font;
static boolean hud_widget_layout;
int hud_type; // Crispy HUD or Boom variants
boolean draw_crispy_hud;
@ -75,7 +78,7 @@ boolean draw_crispy_hud;
#define HU_TITLEP (*mapnamesp[gamemap-1])
#define HU_TITLET (*mapnamest[gamemap-1])
char *chat_macros[] = // Ty 03/27/98 - *not* externalized
static const char *chat_macros[] = // Ty 03/27/98 - *not* externalized
{
HUSTR_CHATMACRO0,
HUSTR_CHATMACRO1,
@ -155,23 +158,26 @@ static int chat_count; // killough 11/98
static boolean secret_on;
static int secret_counter;
boolean message_centered;
boolean message_colorized;
static boolean message_centered;
static boolean message_colorized;
boolean show_messages;
boolean show_toggle_messages;
boolean show_pickup_messages;
extern int showMessages;
static boolean headsupactive = false;
//jff 2/16/98 hud supported automap colors added
int hudcolor_titl; // color range of automap level title
int hudcolor_xyco; // color range of new coords on automap
//jff 2/16/98 hud text colors, controls added
int hudcolor_mesg; // color range of scrolling messages
int hudcolor_chat; // color range of chat lines
int hud_msg_lines; // number of message lines in window
int message_list; // killough 11/98: made global
static int hudcolor_mesg; // color range of scrolling messages
static int hudcolor_chat; // color range of chat lines
static int hud_msg_lines; // number of message lines in window
static boolean message_list; // killough 11/98: made global
int message_timer = HU_MSGTIMEOUT * (1000/TICRATE); // killough 11/98
int chat_msg_timer = HU_MSGTIMEOUT * (1000/TICRATE); // killough 11/98
static int message_timer = HU_MSGTIMEOUT * (1000/TICRATE); // killough 11/98
static int chat_msg_timer = HU_MSGTIMEOUT * (1000/TICRATE); // killough 11/98
static void HU_InitCrosshair(void);
static void HU_StartCrosshair(void);
@ -1239,11 +1245,11 @@ static void HU_widget_build_rate (void)
// Crosshair
boolean hud_crosshair_health;
static boolean hud_crosshair_health;
crosstarget_t hud_crosshair_target;
boolean hud_crosshair_lockon; // [Alaux] Crosshair locks on target
int hud_crosshair_color;
int hud_crosshair_target_color;
static int hud_crosshair_target_color;
typedef struct
{
@ -1405,7 +1411,7 @@ boolean HU_DemoProgressBar(boolean force)
// [FG] level stats and level time widgets
int hud_player_coords, hud_level_stats, hud_level_time;
int hud_time_use;
boolean hud_time_use;
//
// HU_Drawer()
@ -1537,7 +1543,7 @@ void HU_Ticker(void)
// this allows the notification of turning messages off to be seen
// display message if necessary
if ((showMessages || message_dontfuckwithme) && plr->message &&
if ((show_messages || message_dontfuckwithme) && plr->message &&
(!message_nottobefuckedwith || message_dontfuckwithme))
{
//post the message to the message widget
@ -1713,7 +1719,7 @@ char HU_dequeueChatChar(void)
boolean HU_Responder(event_t *ev)
{
static char lastmessage[HU_MAXLINELENGTH+1];
char* macromessage;
const char *macromessage;
boolean eatkey = false;
static boolean shiftdown = false;
static boolean altdown = false;
@ -2132,6 +2138,109 @@ static void HU_ParseHUD (void)
U_ScanClose(s);
}
void HU_BindHUDVariables(void)
{
M_BindBool("hud_displayed", &hud_displayed, NULL, false, ss_none, wad_yes,
"1 to enable display of HUD");
M_BindNum("hud_active", &hud_active, NULL, 2, 0, 2, ss_stat, wad_yes,
"0 for HUD off, 1 for HUD small, 2 for full HUD");
M_BindNum("hud_player_coords", &hud_player_coords, NULL,
HUD_WIDGET_AUTOMAP, HUD_WIDGET_OFF, HUD_WIDGET_ALWAYS,
ss_stat, wad_no,
"Show player coords widget (1 = on Automap, 2 = on HUD, 3 = always)");
M_BindNum("hud_level_stats", &hud_level_stats, NULL,
HUD_WIDGET_OFF, HUD_WIDGET_OFF, HUD_WIDGET_ALWAYS,
ss_stat, wad_no,
"Show level stats (kill, items and secrets) widget (1 = on "
"Automap, 2 = on HUD, 3 = always)");
M_BindNum("hud_level_time", &hud_level_time, NULL,
HUD_WIDGET_OFF, HUD_WIDGET_OFF, HUD_WIDGET_ALWAYS,
ss_stat, wad_no,
"Show level time widget (1 = on Automap, 2 = on HUD, 3 = always)");
M_BindBool("hud_time_use", &hud_time_use, NULL, false, ss_stat, wad_no,
"Show split time when pressing the use button");
M_BindNum("hud_type", &hud_type, NULL,
HUD_TYPE_BOOM, HUD_TYPE_CRISPY, NUM_HUD_TYPES - 1,
ss_stat, wad_no,
"Fullscreen HUD (0 = Crispy, 1 = Boom (No Bars), 2 = Boom)");
M_BindBool("hud_backpack_thresholds", &hud_backpack_thresholds, NULL,
true, ss_stat, wad_no, "Backpack changes thresholds");
M_BindBool("hud_armor_type", &hud_armor_type, NULL, false, ss_stat, wad_no,
"Color of armor depends on type");
M_BindBool("hud_widescreen_widgets", &hud_widescreen_widgets, NULL,
true, ss_stat, wad_no, "Arrange widgets on widescreen edges");
M_BindNum("hud_widget_font", &hud_widget_font, NULL,
HUD_WIDGET_OFF, HUD_WIDGET_OFF, HUD_WIDGET_ALWAYS,
ss_stat, wad_no,
"Use standard Doom font for widgets (1 = on Automap, 2 = on HUD, 3 "
"= always)");
M_BindBool("hud_widget_layout", &hud_widget_layout, NULL,
false, ss_stat, wad_no, "Widget layout (0 = Horizontal, 1 = Vertical)");
M_BindNum("hud_crosshair", &hud_crosshair, NULL, 0, 0, 10 - 1, ss_stat, wad_no,
"Enable crosshair");
M_BindBool("hud_crosshair_health", &hud_crosshair_health, NULL,
false, ss_stat, wad_no, "1 to change crosshair color by player health");
M_BindNum("hud_crosshair_target", &hud_crosshair_target, NULL,
0, 0, 2, ss_stat, wad_no,
"Change crosshair color on target (1 = Highlight, 2 = Health)");
M_BindBool("hud_crosshair_lockon", &hud_crosshair_lockon, NULL,
false, ss_stat, wad_no, "1 to lock crosshair on target");
M_BindNum("hud_crosshair_color", &hud_crosshair_color, NULL,
CR_GRAY, CR_BRICK, CR_NONE, ss_stat, wad_no,
"Default crosshair color");
M_BindNum("hud_crosshair_target_color", &hud_crosshair_target_color, NULL,
CR_YELLOW, CR_BRICK, CR_NONE, ss_stat, wad_no,
"Target crosshair color");
M_BindNum("hudcolor_titl", &hudcolor_titl, NULL,
CR_GOLD, CR_BRICK, CR_NONE, ss_none, wad_yes,
"Color range used for automap level title");
M_BindNum("hudcolor_xyco", &hudcolor_xyco, NULL,
CR_GREEN, CR_BRICK, CR_NONE, ss_none, wad_yes,
"Color range used for automap coordinates");
BIND_BOOL(show_messages, true, "1 to enable message display");
M_BindBool("hud_secret_message", &hud_secret_message, NULL,
true, ss_stat, wad_no, "\"A secret is revealed!\" message");
M_BindBool("show_toggle_messages", &show_toggle_messages, NULL,
true, ss_stat, wad_no, "1 to enable toggle messages");
M_BindBool("show_pickup_messages", &show_pickup_messages, NULL,
true, ss_stat, wad_no, "1 to enable pickup messages");
M_BindBool("show_obituary_messages", &show_obituary_messages, NULL,
true, ss_stat, wad_no, "1 to enable obituaries");
M_BindNum("hudcolor_mesg", &hudcolor_mesg, NULL, CR_NONE, CR_BRICK, CR_NONE,
ss_none, wad_yes, "Color range used for messages during play");
M_BindNum("hudcolor_chat", &hudcolor_chat, NULL, CR_GOLD, CR_BRICK, CR_NONE,
ss_none, wad_yes, "Color range used for chat messages and entry");
BIND_NUM(hudcolor_obituary, CR_GRAY, CR_BRICK, CR_NONE,
"Color range used for obituaries");
BIND_NUM(message_timer, 4000, 0, UL, "Duration of normal Doom messages (ms)");
BIND_NUM(chat_msg_timer, 4000, 0, UL, "Duration of chat messages (ms)");
BIND_NUM(hud_msg_lines, 4, 1, HU_MAXMESSAGES, "Number of message lines");
M_BindBool("message_colorized", &message_colorized, NULL,
false, ss_stat, wad_no, "1 to colorize player messages");
M_BindBool("message_centered", &message_centered, NULL,
false, ss_stat, wad_no, "1 to center messages");
BIND_BOOL(message_list, false, "1 means multiline message list is active");
#define BIND_CHAT(num) \
M_BindStr("chatmacro" #num, &chat_macros[(num)], HUSTR_CHATMACRO##num, \
wad_yes, "Chat string associated with " #num " key")
BIND_CHAT(0);
BIND_CHAT(1);
BIND_CHAT(2);
BIND_CHAT(3);
BIND_CHAT(4);
BIND_CHAT(5);
BIND_CHAT(6);
BIND_CHAT(7);
BIND_CHAT(8);
BIND_CHAT(9);
}
//----------------------------------------------------------------------------
//
// $Log: hu_stuff.c,v $

View File

@ -53,26 +53,17 @@ void HU_ResetMessageColors(void);
//jff 2/16/98 hud supported automap colors added
extern int hudcolor_titl; // color range of automap level title
extern int hudcolor_xyco; // color range of new coords on automap
//jff 2/16/98 hud text colors, controls added
extern int hudcolor_mesg; // color range of scrolling messages
extern int hudcolor_chat; // color range of chat lines
//jff 2/26/98 hud message list color and background enable
extern int hud_msg_lines; // number of message lines in window up to 16
extern int message_list; // killough 11/98: whether message list is active
extern int message_timer; // killough 11/98: timer used for normal messages
extern int chat_msg_timer; // killough 11/98: timer used for chat messages
//jff 2/23/98 hud is currently displayed
extern int hud_displayed; // hud is displayed
extern boolean hud_displayed; // hud is displayed
//jff 2/18/98 hud/status control
extern int hud_active; // hud mode 0=off, 1=small, 2=full
extern int hud_secret_message; // "A secret is revealed!" message
extern boolean hud_secret_message; // "A secret is revealed!" message
extern int hud_player_coords, hud_level_stats, hud_level_time;
extern int hud_time_use;
extern int hud_widget_font;
extern int hud_widescreen_widgets;
extern int hud_widget_layout;
extern boolean message_centered; // center messages
extern boolean message_colorized; // colorize player messages
extern boolean hud_widescreen_widgets;
extern boolean hud_time_use;
extern boolean show_messages;
extern boolean show_toggle_messages;
extern boolean show_pickup_messages;
extern int playback_tic, playback_totaltics;
@ -89,7 +80,6 @@ extern int hud_type;
extern boolean draw_crispy_hud;
extern int hud_crosshair;
extern boolean hud_crosshair_health;
enum
{
@ -114,12 +104,13 @@ void HU_UpdateCrosshairLock(int x, int y);
void HU_DrawCrosshair(void);
extern int hud_crosshair_color;
extern int hud_crosshair_target_color;
#define HU_CROSSHAIRS 10
extern const char *crosshair_lumps[HU_CROSSHAIRS];
extern const char *crosshair_strings[HU_CROSSHAIRS];
void HU_BindHUDVariables(void);
#endif
//----------------------------------------------------------------------------

View File

@ -319,7 +319,7 @@ static void I_3D_UpdateListenerParams(const mobj_t *listener)
I_OAL_UpdateListenerParams(lis.position, lis.velocity, lis.orientation);
}
static boolean I_3D_StartSound(int channel, sfxinfo_t *sfx, int pitch)
static boolean I_3D_StartSound(int channel, sfxinfo_t *sfx, float pitch)
{
if (src.use_3d)
{
@ -333,10 +333,20 @@ static boolean I_3D_StartSound(int channel, sfxinfo_t *sfx, int pitch)
return I_OAL_StartSound(channel, sfx, pitch);
}
static boolean I_3D_InitSound(void)
{
return I_OAL_InitSound(SND_MODULE_3D);
}
static boolean I_3D_ReinitSound(void)
{
return I_OAL_ReinitSound(SND_MODULE_3D);
}
const sound_module_t sound_3d_module =
{
I_OAL_InitSound,
I_OAL_ReinitSound,
I_3D_InitSound,
I_3D_ReinitSound,
I_OAL_AllowReinitSound,
I_OAL_CacheSound,
I_3D_AdjustSoundParams,
@ -349,4 +359,5 @@ const sound_module_t sound_3d_module =
I_OAL_ShutdownModule,
I_OAL_DeferUpdates,
I_OAL_ProcessUpdates,
I_OAL_BindSoundVariables,
};

View File

@ -22,6 +22,7 @@
#include "config.h"
#include "i_oalstream.h"
#include "m_config.h"
#if (FLUIDSYNTH_VERSION_MAJOR < 2 \
|| (FLUIDSYNTH_VERSION_MAJOR == 2 && FLUIDSYNTH_VERSION_MINOR < 2))
@ -43,9 +44,9 @@ typedef fluid_long_long_t fluid_int_t;
#include "w_wad.h"
#include "z_zone.h"
char *soundfont_dir = "";
boolean mus_chorus;
boolean mus_reverb;
static const char *soundfont_dir = "";
static boolean mus_chorus;
static boolean mus_reverb;
static fluid_synth_t *synth = NULL;
static fluid_settings_t *settings = NULL;
@ -427,6 +428,25 @@ static const char **I_FL_DeviceList(void)
return devices;
}
static void I_FL_BindVariables(void)
{
M_BindStr("soundfont_dir", &soundfont_dir,
#if defined(_WIN32)
"soundfonts",
#else
// RedHat/Fedora/Arch
"/usr/share/soundfonts:"
// Debian/Ubuntu/OpenSUSE
"/usr/share/sounds/sf2:"
"/usr/share/sounds/sf3:"
// AppImage
"../share/" PROJECT_SHORTNAME "/soundfonts",
#endif
wad_no, "FluidSynth soundfont directories");
BIND_BOOL(mus_chorus, false, "1 to enable FluidSynth chorus");
BIND_BOOL(mus_reverb, false, "1 to enable FluidSynth reverb");
}
stream_module_t stream_fl_module =
{
I_FL_InitStream,
@ -436,4 +456,5 @@ stream_module_t stream_fl_module =
I_FL_CloseStream,
I_FL_ShutdownStream,
I_FL_DeviceList,
I_FL_BindVariables,
};

View File

@ -23,30 +23,31 @@
#include "doomtype.h"
#include "g_game.h"
#include "i_timer.h"
#include "m_config.h"
#define MIN_DEADZONE 0.00003f // 1/32768
#define SGNF(x) ((float)((0.0f < (x)) - ((x) < 0.0f)))
#define REMAP(x, min, max) (((x) - (min)) / ((max) - (min)))
boolean joy_enable;
int joy_layout;
int joy_sensitivity_forward;
int joy_sensitivity_strafe;
int joy_sensitivity_turn;
int joy_sensitivity_look;
int joy_extra_sensitivity_turn;
int joy_extra_sensitivity_look;
int joy_extra_ramp_time;
boolean joy_scale_diagonal_movement;
int joy_response_curve_movement;
int joy_response_curve_camera;
int joy_deadzone_type_movement;
int joy_deadzone_type_camera;
int joy_deadzone_movement;
int joy_deadzone_camera;
int joy_threshold_movement;
int joy_threshold_camera;
int joy_threshold_trigger;
static int joy_layout;
static int joy_sensitivity_forward;
static int joy_sensitivity_strafe;
static int joy_sensitivity_turn;
static int joy_sensitivity_look;
static int joy_extra_sensitivity_turn;
static int joy_extra_sensitivity_look;
static int joy_extra_ramp_time;
static boolean joy_scale_diagonal_movement;
static int joy_response_curve_movement;
static int joy_response_curve_camera;
static int joy_deadzone_type_movement;
static int joy_deadzone_type_camera;
static int joy_deadzone_movement;
static int joy_deadzone_camera;
static int joy_threshold_movement;
static int joy_threshold_camera;
static int joy_threshold_trigger;
boolean joy_invert_forward;
boolean joy_invert_strafe;
boolean joy_invert_turn;
@ -387,3 +388,39 @@ void I_ResetController(void)
UpdateStickLayout();
RefreshSettings();
}
void I_BindGamepadVariables(void)
{
BIND_BOOL(joy_enable, true, "Enable game controller");
BIND_NUM_GENERAL(joy_layout, LAYOUT_DEFAULT, 0, NUM_LAYOUTS - 1,
"Analog stick layout (0 = Default, 1 = Swap, 2 = Legacy, 3 = Legacy Swap)");
BIND_NUM(joy_sensitivity_forward, 50, 0, 100, "Forward axis sensitivity");
BIND_NUM(joy_sensitivity_strafe, 50, 0, 100, "Strafe axis sensitivity");
BIND_NUM_GENERAL(joy_sensitivity_turn, 36, 0, 100, "Turn axis sensitivity");
BIND_NUM_GENERAL(joy_sensitivity_look, 28, 0, 100, "Look axis sensitivity");
BIND_NUM_GENERAL(joy_extra_sensitivity_turn, 14, 0, 100,
"Extra turn sensitivity at outer threshold (joy_threshold_camera)");
BIND_NUM(joy_extra_sensitivity_look, 0, 0, 100,
"Extra look sensitivity at outer threshold (joy_threshold_camera)");
BIND_NUM(joy_extra_ramp_time, 300, 0, 1000,
"Ramp time for extra sensitivity (0 = Instant, 1000 = 1 second)");
BIND_BOOL(joy_scale_diagonal_movement, true,
"Scale diagonal movement (0 = Linear, 1 = Circle to Square)");
BIND_NUM(joy_response_curve_movement, 10, 10, 30,
"Movement response curve (10 = Linear, 20 = Squared, 30 = Cubed)");
BIND_NUM_GENERAL(joy_response_curve_camera, 20, 10, 30,
"Camera response curve (10 = Linear, 20 = Squared, 30 = Cubed)");
BIND_NUM(joy_deadzone_type_movement, 1, 0, 1,
"Movement deadzone type (0 = Axial, 1 = Radial)");
BIND_NUM(joy_deadzone_type_camera, 1, 0, 1,
"Camera deadzone type (0 = Axial, 1 = Radial)");
BIND_NUM_GENERAL(joy_deadzone_movement, 15, 0, 50, "Movement deadzone percent");
BIND_NUM_GENERAL(joy_deadzone_camera, 15, 0, 50, "Camera deadzone percent");
BIND_NUM(joy_threshold_movement, 2, 0, 30, "Movement outer threshold percent");
BIND_NUM(joy_threshold_camera, 2, 0, 30, "Camera outer threshold percent");
BIND_NUM(joy_threshold_trigger, 12, 0, 50, "Trigger threshold percent");
BIND_BOOL(joy_invert_forward, false, "Invert forward axis");
BIND_BOOL(joy_invert_strafe, false, "Invert strafe axis");
BIND_BOOL(joy_invert_turn, false, "Invert turn axis");
BIND_BOOL_GENERAL(joy_invert_look, false, "Invert look axis");
}

View File

@ -22,24 +22,6 @@
#include "doomtype.h"
extern boolean joy_enable; // Enable game controller.
extern int joy_layout; // Analog stick layout.
extern int joy_sensitivity_forward; // Forward axis sensitivity.
extern int joy_sensitivity_strafe; // Strafe axis sensitivity.
extern int joy_sensitivity_turn; // Turn axis sensitivity.
extern int joy_sensitivity_look; // Look axis sensitivity.
extern int joy_extra_sensitivity_turn; // Extra turn sensitivity.
extern int joy_extra_sensitivity_look; // Extra look sensitivity.
extern int joy_extra_ramp_time; // Ramp time for extra sensitivity.
extern boolean joy_scale_diagonal_movement; // Scale diagonal movement.
extern int joy_response_curve_movement; // Movement response curve.
extern int joy_response_curve_camera; // Camera response curve.
extern int joy_deadzone_type_movement; // Movement deadzone type.
extern int joy_deadzone_type_camera; // Camera deadzone type.
extern int joy_deadzone_movement; // Movement deadzone percent.
extern int joy_deadzone_camera; // Camera deadzone percent.
extern int joy_threshold_movement; // Movement outer threshold percent.
extern int joy_threshold_camera; // Camera outer threshold percent.
extern int joy_threshold_trigger; // Trigger threshold percent.
extern boolean joy_invert_forward; // Invert forward axis.
extern boolean joy_invert_strafe; // Invert strafe axis.
extern boolean joy_invert_turn; // Invert turn axis.
@ -54,4 +36,6 @@ void I_ResetControllerAxes(void);
void I_ResetControllerLevel(void);
void I_ResetController(void);
void I_BindGamepadVariables(void);
#endif

View File

@ -23,6 +23,7 @@
#include "i_gamepad.h"
#include "i_printf.h"
#include "i_system.h"
#include "m_config.h"
#include "r_main.h"
#define AXIS_BUTTON_DEADZONE (SDL_JOYSTICK_AXIS_MAX / 3)
@ -469,8 +470,8 @@ void I_DelayEvent(void)
// exceed the value of mouse_acceleration_threshold, they are multiplied by
// mouse_acceleration to increase the speed.
int mouse_acceleration;
int mouse_acceleration_threshold;
static int mouse_acceleration;
static int mouse_acceleration_threshold;
static double AccelerateMouse_Thresh(int val)
{
@ -592,3 +593,11 @@ void I_HandleKeyboardEvent(SDL_Event *sdlevent)
break;
}
}
void I_BindInputVarianles(void)
{
BIND_NUM_GENERAL(mouse_acceleration, 10, 0, 40,
"Adjust mouse acceleration (0 = 1.0, 40 = 5.0)");
BIND_NUM(mouse_acceleration_threshold, 10, 0, 32,
"Adjust mouse acceleration threshold");
}

View File

@ -37,4 +37,6 @@ void I_HandleJoystickEvent(SDL_Event *sdlevent);
void I_HandleKeyboardEvent(SDL_Event *sdlevent);
void I_HandleMouseEvent(SDL_Event *sdlevent);
void I_BindInputVarianles(void);
#endif

View File

@ -24,12 +24,13 @@
#include "doomtype.h"
#include "i_oalsound.h"
#include "i_sound.h"
#include "m_config.h"
#include "m_fixed.h"
#include "p_mobj.h"
#include "r_main.h"
#include "tables.h"
int forceFlipPan;
static boolean force_flip_pan;
static boolean I_MBF_AdjustSoundParams(const mobj_t *listener,
const mobj_t *source, int chanvol,
@ -129,7 +130,7 @@ static boolean I_MBF_AdjustSoundParams(const mobj_t *listener,
void I_MBF_UpdateSoundParams(int channel, int volume, int separation)
{
// SoM 7/1/02: forceFlipPan accounted for here
if (forceFlipPan)
if (force_flip_pan)
{
separation = 254 - separation;
}
@ -138,10 +139,25 @@ void I_MBF_UpdateSoundParams(int channel, int volume, int separation)
I_OAL_SetPan(channel, separation);
}
static boolean I_MBF_InitSound(void)
{
return I_OAL_InitSound(SND_MODULE_MBF);
}
static boolean I_MBF_ReinitSound(void)
{
return I_OAL_ReinitSound(SND_MODULE_MBF);
}
static void I_MBF_BindVariables(void)
{
BIND_BOOL(force_flip_pan, false, "1 to force reversal of stereo audio channels");
}
const sound_module_t sound_mbf_module =
{
I_OAL_InitSound,
I_OAL_ReinitSound,
I_MBF_InitSound,
I_MBF_ReinitSound,
I_OAL_AllowReinitSound,
I_OAL_CacheSound,
I_MBF_AdjustSoundParams,
@ -154,4 +170,5 @@ const sound_module_t sound_mbf_module =
I_OAL_ShutdownModule,
I_OAL_DeferUpdates,
I_OAL_ProcessUpdates,
I_MBF_BindVariables,
};

View File

@ -25,6 +25,7 @@
#include "i_sound.h"
#include "i_timer.h"
#include "m_array.h"
#include "m_config.h"
#include "memio.h"
#include "midiout.h"
#include "midifallback.h"
@ -47,6 +48,7 @@ enum
COMP_VANILLA,
COMP_STANDARD,
COMP_FULL,
COMP_NUM,
};
enum
@ -55,12 +57,13 @@ enum
RESET_TYPE_GM,
RESET_TYPE_GS,
RESET_TYPE_XG,
RESET_NUM,
};
int midi_complevel = COMP_STANDARD;
int midi_reset_type = RESET_TYPE_GM;
int midi_reset_delay = -1;
boolean midi_ctf = true;
static int midi_complevel = COMP_STANDARD;
static int midi_reset_type = RESET_TYPE_GM;
static int midi_reset_delay = -1;
static boolean midi_ctf = true;
static const byte gm_system_on[] =
{
@ -1216,7 +1219,7 @@ static int PlayerThread(void *unused)
return 0;
}
const char **midi_devices = NULL;
static const char **midi_devices = NULL;
static void GetDevices(void)
{
@ -1439,6 +1442,18 @@ static const char **I_MID_DeviceList(void)
return midi_devices;
}
static void I_MID_BindVariables(void)
{
BIND_NUM(midi_complevel, COMP_STANDARD, 0, COMP_NUM - 1,
"Native MIDI compatibility level (0 = Vanilla, 1 = Standard, 2 = Full)");
BIND_NUM(midi_reset_type, RESET_TYPE_GM, 0, RESET_NUM - 1,
"Reset type for native MIDI (0 = No SysEx, 1 = GM, 2 = GS, 3 = XG)");
BIND_NUM(midi_reset_delay, -1, -1, 2000,
"Delay after reset for native MIDI (-1 = Auto, 0 = None, 1-2000 = Milliseconds)");
BIND_BOOL(midi_ctf, true,
"1 to fix invalid instruments by emulating SC-55 capital tone fallback");
}
music_module_t music_mid_module =
{
I_MID_InitMusic,
@ -1451,4 +1466,5 @@ music_module_t music_mid_module =
I_MID_StopSong,
I_MID_UnRegisterSong,
I_MID_DeviceList,
I_MID_BindVariables,
};

View File

@ -26,6 +26,7 @@
#include "i_printf.h"
#include "i_sound.h"
#include "m_array.h"
#include "m_config.h"
// Define the number of buffers and buffer size (in milliseconds) to use. 4
// buffers with 4096 samples each gives a nice per-chunk size, and lets the
@ -293,8 +294,8 @@ static boolean I_OAL_InitMusic(int device)
return false;
}
int mus_gain = 100;
int opl_gain = 200;
static int mus_gain = 100;
static int opl_gain = 200;
static void I_OAL_SetMusicVolume(int volume)
{
@ -457,6 +458,20 @@ static const char **I_OAL_DeviceList(void)
return devices;
}
static void I_OAL_BindVariables(void)
{
BIND_NUM(opl_gain, 200, 100, 1000,
"Fine tune OPL emulation output level (default 200%)");
#if defined (HAVE_FLUIDSYNTH)
BIND_NUM(mus_gain, 100, 10, 1000,
"Fine tune FluidSynth output level (default 100%)");
#endif
for (int i = 0; i < arrlen(midi_modules); ++i)
{
midi_modules[i]->BindVariables();
}
}
music_module_t music_oal_module =
{
I_OAL_InitMusic,
@ -469,4 +484,5 @@ music_module_t music_oal_module =
I_OAL_StopSong,
I_OAL_UnRegisterSong,
I_OAL_DeviceList,
I_OAL_BindVariables,
};

View File

@ -30,8 +30,8 @@
#include "i_sndfile.h"
#include "i_sound.h"
#include "m_array.h"
#include "m_config.h"
#include "m_fixed.h"
#include "m_misc.h"
#include "sounds.h"
#include "w_wad.h"
#include "z_zone.h"
@ -58,12 +58,13 @@
# define FUNCTION_CAST(T, ptr) (T)(ptr)
#endif
int snd_resampler;
boolean snd_limiter;
boolean snd_hrtf;
int snd_absorption;
int snd_doppler;
static int snd_resampler;
static boolean snd_limiter;
static boolean snd_hrtf;
static int snd_absorption;
static int snd_doppler;
static int oal_snd_module;
boolean oal_use_doppler;
typedef struct oal_system_s
@ -355,7 +356,7 @@ static void UpdateUserSoundSettings(void)
{
I_OAL_SetResampler();
if (snd_module == SND_MODULE_3D)
if (oal_snd_module == SND_MODULE_3D)
{
oal->absorption = (ALfloat)snd_absorption / 2.0f;
alDopplerFactor((ALfloat)snd_doppler * snd_doppler / 100.0f);
@ -428,7 +429,7 @@ static void PrintDeviceInfo(ALCdevice *device)
static void GetAttribs(ALCint **attribs)
{
const boolean use_3d = (snd_module == SND_MODULE_3D);
const boolean use_3d = (oal_snd_module == SND_MODULE_3D);
if (alcIsExtensionPresent(oal->device, "ALC_SOFT_HRTF") == ALC_TRUE)
{
@ -457,10 +458,25 @@ static void GetAttribs(ALCint **attribs)
array_push(*attribs, 0);
}
boolean I_OAL_InitSound(void)
void I_OAL_BindSoundVariables(void)
{
BIND_BOOL_GENERAL(snd_hrtf, false,
"[OpenAL 3D] Headphones mode (0 = No, 1 = Yes)");
BIND_NUM_GENERAL(snd_resampler, 1, 0, UL,
"Sound resampler (0 = Nearest, 1 = Linear, ...)");
BIND_NUM(snd_absorption, 0, 0, 10,
"[OpenAL 3D] Air absorption effect (0 = Off, 10 = Max)");
BIND_NUM(snd_doppler, 0, 0, 10,
"[OpenAL 3D] Doppler effect (0 = Off, 10 = Max)");
BIND_BOOL(snd_limiter, false, "1 to enable sound output limiter");
}
boolean I_OAL_InitSound(int snd_module)
{
ALCint *attribs = NULL;
oal_snd_module = snd_module;
if (oal)
{
I_OAL_ShutdownSound();
@ -509,7 +525,7 @@ boolean I_OAL_InitSound(void)
return true;
}
boolean I_OAL_ReinitSound(void)
boolean I_OAL_ReinitSound(int snd_module)
{
LPALCRESETDEVICESOFT alcResetDeviceSOFT = NULL;
ALCint *attribs = NULL;
@ -521,6 +537,8 @@ boolean I_OAL_ReinitSound(void)
return false;
}
oal_snd_module = snd_module;
if (alcIsExtensionPresent(oal->device, "ALC_SOFT_HRTF") != ALC_TRUE)
{
I_Printf(VB_ERROR, "I_OAL_ReinitSound: Extension not present.");
@ -723,15 +741,14 @@ boolean I_OAL_CacheSound(sfxinfo_t *sfx)
return true;
}
boolean I_OAL_StartSound(int channel, sfxinfo_t *sfx, int pitch)
boolean I_OAL_StartSound(int channel, sfxinfo_t *sfx, float pitch)
{
if (!oal)
{
return false;
}
alSourcef(oal->sources[channel], AL_PITCH,
pitch == NORM_PITCH ? OAL_DEFAULT_PITCH : steptable[pitch]);
alSourcef(oal->sources[channel], AL_PITCH, pitch);
alSourcei(oal->sources[channel], AL_BUFFER, sfx->buffer);

View File

@ -50,15 +50,15 @@ void I_OAL_UpdateListenerParams(const ALfloat *position,
const char **I_OAL_GetResamplerStrings(void);
boolean I_OAL_InitSound(void);
boolean I_OAL_InitSound(int snd_module);
boolean I_OAL_ReinitSound(void);
boolean I_OAL_ReinitSound(int snd_module);
boolean I_OAL_AllowReinitSound(void);
boolean I_OAL_CacheSound(struct sfxinfo_s *sfx);
boolean I_OAL_StartSound(int channel, struct sfxinfo_s *sfx, int pitch);
boolean I_OAL_StartSound(int channel, struct sfxinfo_s *sfx, float pitch);
void I_OAL_StopSound(int channel);
@ -68,4 +68,6 @@ void I_OAL_SetVolume(int channel, int volume);
void I_OAL_SetPan(int channel, int separation);
void I_OAL_BindSoundVariables(void);
#endif

View File

@ -31,6 +31,7 @@ typedef struct
void (*I_CloseStream)(void);
void (*I_ShutdownStream)(void);
const char **(*I_DeviceList)(void);
void (*BindVariables)(void);
} stream_module_t;
extern stream_module_t stream_opl_module;

View File

@ -359,8 +359,8 @@ static unsigned int last_perc_count;
// Configuration file variable, containing the port number for the
// adlib chip.
char *snd_dmxoption = "-opl3"; // [crispy] default to OPL3 emulation
int opl_io_port = 0x388;
static char *snd_dmxoption = "-opl3"; // [crispy] default to OPL3 emulation
static int opl_io_port = 0x388;
// If true, OPL sound channels are reversed to their correct arrangement
// (as intended by the MIDI standard) rather than the backwards one
@ -1660,7 +1660,7 @@ static void I_OPL_ShutdownStream(void)
static const char **I_OPL_DeviceList(void)
{
static const char **devices = NULL;
if (devices)
if (array_size(devices))
{
return devices;
}
@ -1668,6 +1668,11 @@ static const char **I_OPL_DeviceList(void)
return devices;
}
static void I_OPL_BindVariables(void)
{
;
}
stream_module_t stream_opl_module =
{
I_OPL_InitStream,
@ -1677,4 +1682,5 @@ stream_module_t stream_opl_module =
I_OPL_CloseStream,
I_OPL_ShutdownStream,
I_OPL_DeviceList,
I_OPL_BindVariables,
};

View File

@ -337,7 +337,7 @@ static void InitPCSound(void)
static boolean I_PCS_ReinitSound(void)
{
if (!I_OAL_ReinitSound())
if (!I_OAL_ReinitSound(SND_MODULE_PCS))
{
return false;
}
@ -349,7 +349,7 @@ static boolean I_PCS_ReinitSound(void)
static boolean I_PCS_InitSound(void)
{
if (!I_OAL_InitSound())
if (!I_OAL_InitSound(SND_MODULE_PCS))
{
return false;
}
@ -439,7 +439,7 @@ static void I_PCS_UpdateSoundParams(int channel, int volume, int separation)
alSourcef(callback_source, AL_GAIN, (float)snd_SfxVolume / 15);
}
static boolean I_PCS_StartSound(int channel, sfxinfo_t *sfx, int pitch)
static boolean I_PCS_StartSound(int channel, sfxinfo_t *sfx, float pitch)
{
boolean result;
@ -515,4 +515,5 @@ const sound_module_t sound_pcs_module =
I_PCS_ShutdownModule,
I_OAL_DeferUpdates,
I_OAL_ProcessUpdates,
NULL,
};

View File

@ -55,7 +55,7 @@ int I_ConsoleStdout(void)
}
static verbosity_t verbosity = VB_INFO;
verbosity_t cfg_verbosity;
verbosity_t default_verbosity;
#ifdef _WIN32
static HANDLE hConsole;
@ -114,7 +114,7 @@ void I_InitPrintf(void)
EnableVTMode();
#endif
verbosity = cfg_verbosity;
verbosity = default_verbosity;
//!
//

View File

@ -30,7 +30,7 @@ typedef enum
VB_MAX
} verbosity_t;
extern verbosity_t cfg_verbosity;
extern verbosity_t default_verbosity;
int I_ConsoleStdout(void);

View File

@ -709,6 +709,11 @@ static const char **I_SND_DeviceList(void)
return NULL;
}
static void I_SND_BindVariables(void)
{
;
}
stream_module_t stream_snd_module =
{
I_SND_InitStream,
@ -718,4 +723,5 @@ stream_module_t stream_snd_module =
I_SND_CloseStream,
I_SND_ShutdownStream,
I_SND_DeviceList,
I_SND_BindVariables,
};

View File

@ -29,11 +29,14 @@
#include "i_printf.h"
#include "i_system.h"
#include "m_array.h"
#include "mn_menu.h"
#include "p_mobj.h"
#include "s_sound.h"
#include "sounds.h"
#include "w_wad.h"
#include "m_config.h"
int snd_module;
static int snd_module;
static const sound_module_t *sound_modules[] =
{
@ -60,6 +63,9 @@ static music_module_t *music_modules[] =
static music_module_t *active_module = NULL;
static music_module_t *midi_module = NULL;
static int midi_player_menu;
static const char *midi_player_string = "";
// haleyjd: safety variables to keep changes to *_card from making
// these routines think that sound has been initialized when it hasn't
static boolean snd_init = false;
@ -75,10 +81,13 @@ typedef struct
int idnum;
} channel_info_t;
channel_info_t channelinfo[MAX_CHANNELS];
static channel_info_t channelinfo[MAX_CHANNELS];
// [FG] variable pitch bend range
static int pitch_bend_range;
// Pitch to stepping lookup.
float steptable[256];
static float steptable[256];
//
// StopChannel
@ -174,9 +183,6 @@ void I_ProcessSoundUpdates(void)
sound_module->ProcessUpdates();
}
// [FG] variable pitch bend range
int pitch_bend_range;
//
// I_SetChannels
//
@ -292,7 +298,9 @@ int I_StartSound(sfxinfo_t *sfx, int vol, int sep, int pitch)
I_UpdateSoundParams(channel, vol, sep);
if (sound_module->StartSound(channel, sfx, pitch) == false)
float step = (pitch == NORM_PITCH) ? 1.0f : steptable[pitch];
if (sound_module->StartSound(channel, sfx, step) == false)
{
I_Printf(VB_WARNING, "I_StartSound: Error playing sfx.");
StopChannel(channel);
@ -431,6 +439,8 @@ void I_InitSound(void)
I_AtExit(I_ShutdownSound, true);
MN_UpdateAdvancedSoundItems(snd_module != SND_MODULE_3D);
snd_init = true;
if (nosfxparm)
@ -477,7 +487,7 @@ boolean I_AllowReinitSound(void)
return sound_module->AllowReinitSound();
}
void I_SetSoundModule(int device)
void I_SetSoundModule(void)
{
int i;
@ -487,7 +497,7 @@ void I_SetSoundModule(int device)
return;
}
if (device < 0 || device >= arrlen(sound_modules))
if (snd_module < 0 || snd_module >= arrlen(sound_modules))
{
I_Printf(VB_WARNING, "I_SetSoundModule: Invalid choice.");
return;
@ -500,22 +510,24 @@ void I_SetSoundModule(int device)
sound_module->ShutdownModule();
sound_module = sound_modules[device];
sound_module = sound_modules[snd_module];
if (!sound_module->ReinitSound())
{
I_Printf(VB_WARNING, "I_SetSoundModule: Failed to reinitialize sound.");
}
MN_UpdateAdvancedSoundItems(snd_module != SND_MODULE_3D);
}
void I_SetMidiPlayer(int *menu_index)
void I_SetMidiPlayer(void)
{
if (nomusicparm)
{
return;
}
const int device = *menu_index;
const int device = midi_player_menu;
if (midi_module)
{
@ -534,6 +546,7 @@ void I_SetMidiPlayer(int *menu_index)
if (music_modules[i]->I_InitMusic(device - count_devices))
{
midi_module = music_modules[i];
midi_player_string = strings[device - count_devices];
return;
}
}
@ -552,7 +565,8 @@ void I_SetMidiPlayer(int *menu_index)
if (music_modules[i]->I_InitMusic(0))
{
midi_module = music_modules[i];
*menu_index = count_devices;
midi_player_menu = count_devices;
midi_player_string = strings[0];
return;
}
@ -576,6 +590,18 @@ boolean I_InitMusic(void)
I_AtExit(I_ShutdownMusic, true);
const char **strings = I_DeviceList();
for (int i = 0; i < array_size(strings); ++i)
{
if (!strcasecmp(strings[i], midi_player_string))
{
midi_player_menu = i;
break;
}
}
I_SetMidiPlayer();
return true;
}
@ -670,7 +696,10 @@ const char **I_DeviceList(void)
{
static const char **devices = NULL;
array_clear(devices);
if (array_size(devices))
{
return devices;
}
for (int i = 0; i < arrlen(music_modules); ++i)
{
@ -684,3 +713,35 @@ const char **I_DeviceList(void)
return devices;
}
void I_BindSoundVariables(void)
{
M_BindNum("sfx_volume", &snd_SfxVolume, NULL, 8, 0, 15, ss_none, wad_no,
"Adjust sound effects volume");
M_BindNum("music_volume", &snd_MusicVolume, NULL, 8, 0, 15, ss_none, wad_no,
"Adjust music volume");
BIND_BOOL(pitched_sounds, false,
"1 to enable variable pitch in sound effects (from id's original code)");
BIND_NUM(pitch_bend_range, 120, 100, 300,
"Variable pitch bend range (100 none, 120 default)");
BIND_BOOL_GENERAL(full_sounds, false, "1 to play sounds in full length");
M_BindNum("snd_channels", &default_numChannels, NULL,
MAX_CHANNELS, 1, MAX_CHANNELS, ss_none, wad_no,
"Number of sound effects handled simultaneously");
BIND_NUM_GENERAL(snd_module, SND_MODULE_MBF, 0, NUM_SND_MODULES - 1,
"Sound module (0 = Standard, 1 = OpenAL 3D, 2 = PC Speaker Sound)");
for (int i = 0; i < arrlen(sound_modules); ++i)
{
if (sound_modules[i]->BindVariables)
{
sound_modules[i]->BindVariables();
}
}
BIND_NUM(midi_player_menu, 0, 0, UL, "MIDI Player menu index");
M_BindStr("midi_player_string", &midi_player_string, "", wad_no,
"MIDI Player string");
for (int i = 0; i < arrlen(music_modules); ++i)
{
music_modules[i]->BindVariables();
}
}

View File

@ -27,8 +27,6 @@
#include "doomtype.h"
#include "m_fixed.h"
struct stream_module_s;
// when to clip out sounds
// Does not fit the large outdoor areas.
#define S_CLIPPING_DIST (1200 << FRACBITS)
@ -56,12 +54,6 @@ struct stream_module_s;
#define SND_SAMPLERATE 44100
// [FG] variable pitch bend range
extern int pitch_bend_range;
// Pitch to stepping lookup.
extern float steptable[256];
// Init at program start...
void I_InitSound(void);
@ -72,14 +64,6 @@ void I_ShutdownSound(void);
// SFX I/O
//
extern int forceFlipPan;
extern int snd_resampler;
extern boolean snd_limiter;
extern int snd_module;
extern boolean snd_hrtf;
extern int snd_absorption;
extern int snd_doppler;
struct mobj_s;
struct sfxinfo_s;
@ -95,20 +79,21 @@ typedef struct sound_module_s
int *vol, int *sep, int *pri);
void (*UpdateSoundParams)(int channel, int vol, int sep);
void (*UpdateListenerParams)(const struct mobj_s *listener);
boolean (*StartSound)(int channel, struct sfxinfo_s *sfx, int pitch);
boolean (*StartSound)(int channel, struct sfxinfo_s *sfx, float pitch);
void (*StopSound)(int channel);
boolean (*SoundIsPlaying)(int channel);
void (*ShutdownSound)(void);
void (*ShutdownModule)(void);
void (*DeferUpdates)(void);
void (*ProcessUpdates)(void);
void (*BindVariables)(void);
} sound_module_t;
extern const sound_module_t sound_mbf_module;
extern const sound_module_t sound_3d_module;
extern const sound_module_t sound_pcs_module;
typedef enum snd_module_e
enum
{
SND_MODULE_MBF,
SND_MODULE_3D,
@ -116,10 +101,10 @@ typedef enum snd_module_e
SND_MODULE_PCS,
#endif
NUM_SND_MODULES
} snd_module_t;
};
boolean I_AllowReinitSound(void);
void I_SetSoundModule(int device);
void I_SetSoundModule(void);
// Initialize channels?
void I_SetChannels(void);
@ -170,16 +155,16 @@ typedef struct
void (*I_StopSong)(void *handle);
void (*I_UnRegisterSong)(void *handle);
const char **(*I_DeviceList)(void);
void (*BindVariables)(void);
} music_module_t;
// Music modules
extern music_module_t music_oal_module;
extern music_module_t music_mid_module;
boolean I_InitMusic(void);
void I_ShutdownMusic(void);
void I_SetMidiPlayer(int *menu_index);
void I_SetMidiPlayer(void);
// Volume.
void I_SetMusicVolume(int volume);
@ -211,6 +196,8 @@ boolean IsMid(byte *mem, int len);
// Determine whether memory block is a .mus file
boolean IsMus(byte *mem, int len);
void I_BindSoundVariables(void);
#endif
//----------------------------------------------------------------------------

View File

@ -41,6 +41,7 @@
#include "i_timer.h"
#include "i_video.h"
#include "m_argv.h"
#include "m_config.h"
#include "m_fixed.h"
#include "m_io.h"
#include "mn_menu.h"
@ -59,39 +60,38 @@
#include "icon.c"
int current_video_height, default_current_video_height;
static int GetCurrentVideoHeight(void);
// [AM] Fractional part of the current tic, in the half-open
// range of [0.0, 1.0). Used for interpolation.
fixed_t fractionaltic;
boolean dynamic_resolution;
boolean use_vsync; // killough 2/8/98: controls whether vsync is called
boolean use_aspect;
boolean uncapped, default_uncapped; // [FG] uncapped rendering frame rate
int fpslimit; // when uncapped, limit framerate to this value
boolean fullscreen;
boolean exclusive_fullscreen;
boolean change_display_resolution;
aspect_ratio_mode_t widescreen, default_widescreen; // widescreen mode
int custom_fov;
boolean vga_porch_flash; // emulate VGA "porch" behaviour
boolean smooth_scaling;
int current_video_height;
static int default_current_video_height;
static int GetCurrentVideoHeight(void);
boolean uncapped;
static boolean default_uncapped;
int custom_fov;
int fps; // [FG] FPS counter widget
boolean resetneeded;
boolean setrefreshneeded;
boolean toggle_fullscreen;
boolean toggle_exclusive_fullscreen;
int video_display = 0; // display index
static int window_width, window_height;
int default_window_width, default_window_height;
int window_position_x, window_position_y;
// [AM] Fractional part of the current tic, in the half-open
// range of [0.0, 1.0). Used for interpolation.
fixed_t fractionaltic;
boolean disk_icon; // killough 10/98
int fps; // [FG] FPS counter widget
static boolean use_vsync; // killough 2/8/98: controls whether vsync is called
static boolean correct_aspect_ratio;
static int fpslimit; // when uncapped, limit framerate to this value
static boolean fullscreen;
static boolean exclusive_fullscreen;
static boolean change_display_resolution;
static int widescreen, default_widescreen;
static boolean vga_porch_flash; // emulate VGA "porch" behaviour
static boolean smooth_scaling;
static int video_display = 0; // display index
static boolean disk_icon; // killough 10/98
// [FG] rendering window, renderer, intermediate ARGB frame buffer and texture
@ -104,10 +104,17 @@ static SDL_Texture *texture_upscaled;
static SDL_Rect blit_rect = {0};
static int window_x, window_y;
static int window_width, window_height;
static int default_window_width, default_window_height;
static int window_position_x, window_position_y;
static boolean window_resize;
static boolean window_focused = true;
static int scalefactor;
static int actualheight;
static int unscaled_actualheight;
int max_video_width, max_video_height;
static int max_video_width, max_video_height;
static int max_width, max_height;
static int max_height_adjusted;
static int display_refresh_rate;
@ -115,21 +122,15 @@ static int display_refresh_rate;
static boolean use_limiter;
static int targetrefresh;
static boolean window_resize;
static int scalefactor;
// haleyjd 10/08/05: Chocolate DOOM application focus state code added
// Grab the mouse?
boolean grabmouse = true, default_grabmouse;
static boolean grabmouse = true, default_grabmouse;
// Flag indicating whether the screen is currently visible:
// when the screen isnt visible, don't render the screen
boolean screenvisible = true;
boolean window_focused = true;
boolean drs_skip_frame;
void *I_GetSDLWindow(void)
@ -316,7 +317,7 @@ static boolean ToggleFullScreenKeyShortcut(SDL_Keysym *sym)
static void AdjustWindowSize(void)
{
if (!use_aspect)
if (!correct_aspect_ratio)
{
return;
}
@ -1164,7 +1165,7 @@ static void ResetResolution(int height, boolean reset_pitch)
{
double aspect_ratio = CurrentAspectRatio();
actualheight = use_aspect ? (int)(height * 1.2) : height;
actualheight = correct_aspect_ratio ? (int)(height * 1.2) : height;
video.height = height;
video.unscaledw = (int)(unscaled_actualheight * aspect_ratio);
@ -1340,6 +1341,11 @@ static void I_ResetTargetRefresh(void)
{
uncapped = default_uncapped;
if (fpslimit < TICRATE)
{
fpslimit = 0;
}
if (uncapped)
{
// SDL may report native refresh rate as zero.
@ -1351,6 +1357,7 @@ static void I_ResetTargetRefresh(void)
}
UpdateLimiter();
MN_UpdateFpsLimitItem();
drs_skip_frame = true;
}
@ -1371,7 +1378,7 @@ static void I_InitVideoParms(void)
if (max_video_width && max_video_height)
{
if (use_aspect && max_video_height < ACTUALHEIGHT)
if (correct_aspect_ratio && max_video_height < ACTUALHEIGHT)
{
I_Error("The vertical resolution is too low, turn off the aspect "
"ratio correction.");
@ -1391,7 +1398,7 @@ static void I_InitVideoParms(void)
max_height = mode.h;
}
if (use_aspect)
if (correct_aspect_ratio)
{
max_height_adjusted = (int)(max_height / 1.2);
unscaled_actualheight = ACTUALHEIGHT;
@ -1490,7 +1497,6 @@ static void I_InitVideoParms(void)
{
scalefactor = tmp_scalefactor;
GetCurrentVideoHeight();
MN_UpdateDynamicResolutionItem();
MN_DisableResolutionScaleItem();
}
@ -1517,6 +1523,7 @@ static void I_InitVideoParms(void)
}
MN_UpdateFpsLimitItem();
MN_UpdateDynamicResolutionItem();
}
static void I_InitGraphicsMode(void)
@ -1696,7 +1703,7 @@ static void CreateSurfaces(int w, int h)
int n = (scalefactor == 1 ? 1 : 2);
SDL_SetWindowMinimumSize(screen, video.unscaledw * n,
use_aspect ? ACTUALHEIGHT * n : SCREENHEIGHT * n);
correct_aspect_ratio ? ACTUALHEIGHT * n : SCREENHEIGHT * n);
if (!fullscreen)
{
@ -1779,6 +1786,49 @@ void I_InitGraphics(void)
I_ResetRelativeMouseState();
}
void I_BindVideoVariables(void)
{
M_BindNum("current_video_height", &default_current_video_height,
&current_video_height, 600, 200, UL, ss_none, wad_no,
"Vertical resolution (600p by default)");
BIND_BOOL_GENERAL(dynamic_resolution, true, "1 to enable dynamic resolution");
BIND_BOOL(correct_aspect_ratio, true, "1 to perform aspect ratio correction");
BIND_BOOL(fullscreen, true, "1 to enable fullscreen");
BIND_BOOL(exclusive_fullscreen, false, "1 to enable exclusive fullscreen");
BIND_BOOL_GENERAL(use_vsync, true,
"1 to enable wait for vsync to avoid display tearing");
M_BindBool("uncapped", &default_uncapped, &uncapped, true, ss_gen, wad_no,
"1 to enable uncapped rendering frame rate");
BIND_NUM_GENERAL(fpslimit, 0, 0, 500,
"Framerate limit in frames per second (< 35 = disable)");
M_BindNum("widescreen", &default_widescreen, &widescreen, RATIO_AUTO, 0,
NUM_RATIOS - 1, ss_gen, wad_no,
"Widescreen (0 = Off, 1 = Auto, 2 = 16:10, 3 = 16:9, 4 = 21:9)");
M_BindNum("fov", &custom_fov, NULL, FOV_DEFAULT, FOV_MIN, FOV_MAX, ss_gen,
wad_no, "Field of view in degrees");
BIND_NUM_GENERAL(gamma2, 9, 0, 17, "Custom gamma level (0 = -4, 9 = 0, 17 = 4)");
BIND_BOOL_GENERAL(smooth_scaling, true, "1 to enable smooth pixel scaling");
BIND_BOOL(vga_porch_flash, false, "1 to emulate VGA \"porch\" behaviour");
BIND_BOOL(disk_icon, false, "1 to enable flashing icon during disk IO");
BIND_NUM(video_display, 0, 0, UL, "Current video display index");
BIND_NUM(max_video_width, 0, SCREENWIDTH, UL,
"Maximum horizontal resolution (native by default)");
BIND_NUM(max_video_height, 0, SCREENHEIGHT, UL,
"Maximum vertical resolution (native by default)");
BIND_BOOL(change_display_resolution, false,
"1 to change display resolution with exclusive fullscreen (only useful for CRTs)");
BIND_NUM(window_position_x, 0, UL, UL, "Window position X (0 = Center)");
BIND_NUM(window_position_y, 0, UL, UL, "Window position Y (0 = Center)");
M_BindNum("window_width", &default_window_width, &window_width, 1065, 0, UL,
ss_none, wad_no, "Window width");
M_BindNum("window_height", &default_window_height, &window_height, 600, 0, UL,
ss_none, wad_no, "Window height");
M_BindBool("grabmouse", &default_grabmouse, &grabmouse, true, ss_none,
wad_no, "1 to grab mouse during play");
}
//----------------------------------------------------------------------------
//
// $Log: i_video.c,v $

View File

@ -66,38 +66,18 @@ void I_ToggleVsync(void); // [JN] Calls native SDL vsync toggle
void I_DynamicResolution(void);
extern int current_video_height;
extern boolean drs_skip_frame;
extern boolean use_vsync; // killough 2/8/98: controls whether vsync is called
extern boolean disk_icon; // killough 10/98
extern int max_video_width, max_video_height;
extern int current_video_height, default_current_video_height;
#define DRS_MIN_HEIGHT 400
extern boolean dynamic_resolution;
extern boolean use_aspect;
extern boolean uncapped,
default_uncapped; // [FG] uncapped rendering frame rate
extern boolean fullscreen;
extern boolean exclusive_fullscreen;
extern boolean change_display_resolution;
extern int fpslimit; // when uncapped, limit framerate to this value
extern boolean uncapped;
extern int fps;
extern boolean vga_porch_flash; // emulate VGA "porch" behaviour
extern aspect_ratio_mode_t widescreen, default_widescreen; // widescreen mode
extern int custom_fov; // Custom FOV set by the player.
extern int video_display; // display index
extern boolean screenvisible;
extern boolean window_focused;
extern boolean resetneeded;
extern boolean setrefreshneeded;
extern boolean smooth_scaling;
extern boolean toggle_fullscreen;
extern boolean toggle_exclusive_fullscreen;
extern boolean default_grabmouse;
extern boolean screenvisible;
extern int gamma2;
byte I_GetPaletteIndex(byte *palette, int r, int g, int b);
@ -112,6 +92,8 @@ void I_InitWindowIcon(void);
void I_ShowMouseCursor(boolean toggle);
void I_ResetRelativeMouseState(void);
void I_BindVideoVariables(void);
#endif
//----------------------------------------------------------------------------

View File

@ -150,6 +150,11 @@ static const char **I_XMP_DeviceList(void)
return NULL;
}
static void I_XMP_BindVariables(void)
{
;
}
stream_module_t stream_xmp_module =
{
I_XMP_InitStream,
@ -159,4 +164,5 @@ stream_module_t stream_xmp_module =
I_XMP_CloseStream,
I_XMP_ShutdownStream,
I_XMP_DeviceList,
I_XMP_BindVariables,
};

View File

@ -1281,7 +1281,6 @@ static const struct {
{ input_idbeholdi, not_net|not_demo, {cheat_pw}, pw_invisibility },
{ input_idbeholdr, not_net|not_demo, {cheat_pw}, pw_ironfeet },
{ input_idbeholdl, not_dm, {cheat_pw}, pw_infrared },
{ input_idrate, always, {cheat_rate}, 0 },
{ input_iddt, not_dm, {cheat_ddt}, 0 },
{ input_notarget, not_net|not_demo, {cheat_notarget}, 0 },
{ input_freeze, not_net|not_demo, {cheat_freeze}, 0 },

File diff suppressed because it is too large Load Diff

View File

@ -15,20 +15,13 @@
//
// DESCRIPTION:
//
//
//-----------------------------------------------------------------------------
#ifndef __M_CONFIG__
#define __M_CONFIG__
#include "doomtype.h"
#include "doomdef.h"
#include "m_input.h"
//
// MISC
//
#include "doomtype.h"
void M_LoadDefaults(void);
void M_SaveDefaults(void);
@ -36,44 +29,33 @@ struct default_s *M_LookupDefault(const char *name); // killough 11/98
boolean M_ParseOption(const char *name, boolean wad); // killough 11/98
void M_LoadOptions(void); // killough 11/98
// phares 4/21/98:
// Moved from m_misc.c so m_menu.c could see it.
//
// killough 11/98: totally restructured
void M_InitConfig(void);
// [FG] use a union of integer and string pointer to store config values, instead
// of type-punning string pointers to integers which won't work on 64-bit systems anyway
void M_BindNum(const char *name, void *location, void *current,
int default_val, int min_val, int max_val,
ss_types screen, wad_allowed_t wad,
const char *help);
typedef union config_u
{
int i;
char *s;
} config_t;
#define BIND_NUM(name, v, a, b, help) \
M_BindNum(#name, &name, NULL, (v), (a), (b), ss_none, wad_no, help)
typedef struct default_s
{
const char *const name; // name
config_t *const location; // default variable
config_t *const current; // possible nondefault variable
config_t const defaultvalue; // built-in default value
struct {int min, max;} const limit; // numerical limits
enum {number, string, input} const type; // type
ss_types const setupscreen; // setup screen this appears on
enum {wad_no, wad_yes} const wad_allowed; // whether it's allowed in wads
const char *const help; // description of parameter
#define BIND_NUM_GENERAL(name, v, a, b, help) \
M_BindNum(#name, &name, NULL, (v), (a), (b), ss_gen, wad_no, help)
int input_id;
input_t inputs[NUM_INPUTS];
void M_BindBool(const char *name, boolean *location, boolean *current,
boolean default_val, ss_types screen, wad_allowed_t wad,
const char *help);
// internal fields (initialized implicitly to 0) follow
#define BIND_BOOL(name, v, help) \
M_BindBool(#name, &name, NULL, (v), ss_none, wad_no, help)
struct default_s *first, *next; // hash table pointers
int modified; // Whether it's been modified
config_t orig_default; // Original default, if modified
struct setup_menu_s *setup_menu; // Xref to setup menu item, if any
} default_t;
#define BIND_BOOL_GENERAL(name, v, help) \
M_BindBool(#name, &name, NULL, (v), ss_gen, wad_no, help)
extern default_t defaults[];
void M_BindStr(char *name, const char **location, char *default_val,
wad_allowed_t wad, const char *help);
void M_BindInput(const char *name, int input_id, const char *help);
#define UL (-123456789) /* magic number for no min or max for parameter */

View File

@ -19,6 +19,7 @@
#include "d_event.h"
#include "doomkeys.h"
#include "m_input.h"
#include "m_config.h"
#define M_ARRAY_INIT_CAPACITY NUM_INPUTS
#include "m_array.h"
@ -218,7 +219,6 @@ void M_InputGameDeactivate(int id)
void M_InputReset(int id)
{
input_t *inputs = composite_inputs[id];
array_clear(inputs);
}
@ -242,11 +242,6 @@ static void InputSet(int id, input_t *inputs, int size)
composite_inputs[id] = local_inputs;
}
void M_InputSetDefault(int id, input_t *inputs)
{
InputSet(id, inputs, NUM_INPUTS);
}
static const struct
{
int key;
@ -497,4 +492,185 @@ void M_InputPredefined(void)
M_InputAddKey(input_help, KEY_F1);
M_InputAddKey(input_escape, KEY_ESCAPE);
M_InputAddKey(input_chat_backspace, KEY_BACKSPACE);
M_InputAddKey(input_chat_enter, KEY_ENTER);
}
static input_t default_inputs[NUM_INPUT_ID][NUM_INPUTS] =
{
[input_forward] = { {INPUT_KEY, 'w'}, {INPUT_KEY, KEY_UPARROW} },
[input_backward] = { {INPUT_KEY, 's'}, {INPUT_KEY, KEY_DOWNARROW} },
[input_turnright] = { {INPUT_KEY, KEY_RIGHTARROW} },
[input_turnleft] = { {INPUT_KEY, KEY_LEFTARROW} },
[input_strafeleft] = { {INPUT_KEY, 'a'} },
[input_straferight] = { {INPUT_KEY, 'd'} },
[input_speed] = { {INPUT_KEY, KEY_RSHIFT} },
[input_strafe] = { {INPUT_KEY, KEY_RALT},
{INPUT_MOUSEB, MOUSE_BUTTON_RIGHT} },
[input_autorun] = { {INPUT_KEY, KEY_CAPSLOCK},
{INPUT_JOYB, CONTROLLER_LEFT_STICK} },
[input_reverse] = { {INPUT_KEY, '/'} },
[input_use] = { {INPUT_KEY,' '},
{INPUT_JOYB, CONTROLLER_A} },
[input_fire] = { {INPUT_KEY, KEY_RCTRL},
{INPUT_MOUSEB, MOUSE_BUTTON_LEFT},
{INPUT_JOYB, CONTROLLER_RIGHT_TRIGGER} },
[input_prevweapon] = { {INPUT_MOUSEB, MOUSE_BUTTON_WHEELDOWN},
{INPUT_JOYB, CONTROLLER_LEFT_SHOULDER} },
[input_nextweapon] = { {INPUT_MOUSEB, MOUSE_BUTTON_WHEELUP},
{INPUT_JOYB, CONTROLLER_RIGHT_SHOULDER} },
[input_weapon1] = { {INPUT_KEY, '1'} },
[input_weapon2] = { {INPUT_KEY, '2'} },
[input_weapon3] = { {INPUT_KEY, '3'} },
[input_weapon4] = { {INPUT_KEY, '4'} },
[input_weapon5] = { {INPUT_KEY, '5'} },
[input_weapon6] = { {INPUT_KEY, '6'} },
[input_weapon7] = { {INPUT_KEY, '7'} },
[input_weapon8] = { {INPUT_KEY, '8'} },
[input_weapon9] = { {INPUT_KEY, '9'} },
[input_weapontoggle] = { {INPUT_KEY, '0'} },
[input_savegame] = { {INPUT_KEY, KEY_F2} },
[input_loadgame] = { {INPUT_KEY, KEY_F3} },
[input_soundvolume] = { {INPUT_KEY, KEY_F4} },
[input_hud] = { {INPUT_KEY, KEY_F5} },
[input_quicksave] = { {INPUT_KEY, KEY_F6} },
[input_endgame] = { {INPUT_KEY, KEY_F7} },
[input_messages] = { {INPUT_KEY, KEY_F8} },
[input_quickload] = { {INPUT_KEY, KEY_F9} },
[input_quit] = { {INPUT_KEY, KEY_F10} },
[input_gamma] = { {INPUT_KEY, KEY_F11} },
[input_spy] = { {INPUT_KEY, KEY_F12} },
[input_zoomin] = { {INPUT_KEY, '='} },
[input_zoomout] = { {INPUT_KEY, '-'} },
[input_screenshot] = { {INPUT_KEY, KEY_PRTSCR} },
[input_pause] = { {INPUT_KEY, KEY_PAUSE} },
[input_map] = { {INPUT_KEY, KEY_TAB},
{INPUT_JOYB, CONTROLLER_Y} },
[input_map_up] = { {INPUT_KEY, KEY_UPARROW} },
[input_map_down] = { {INPUT_KEY, KEY_DOWNARROW} },
[input_map_left] = { {INPUT_KEY, KEY_LEFTARROW} },
[input_map_right] = { {INPUT_KEY, KEY_RIGHTARROW} },
[input_map_follow] = { {INPUT_KEY, 'f'} },
[input_map_zoomin] = { {INPUT_KEY, '='},
{INPUT_MOUSEB, MOUSE_BUTTON_WHEELUP} },
[input_map_zoomout] = { {INPUT_KEY, '-'},
{INPUT_MOUSEB, MOUSE_BUTTON_WHEELDOWN} },
[input_map_mark] = { {INPUT_KEY, 'm'} },
[input_map_clear] = { {INPUT_KEY, 'c'} },
[input_map_gobig] = { {INPUT_KEY, '0'} },
[input_map_grid] = { {INPUT_KEY, 'g'} },
[input_map_overlay] = { {INPUT_KEY, 'o'} },
[input_map_rotate] = { {INPUT_KEY, 'r'} },
[input_chat] = { {INPUT_KEY, 't'} },
[input_chat_dest0] = { {INPUT_KEY, 'g'} },
[input_chat_dest1] = { {INPUT_KEY, 'i'} },
[input_chat_dest2] = { {INPUT_KEY, 'b'} },
[input_chat_dest3] = { {INPUT_KEY, 'r'} },
};
void M_InputSetDefault(int id)
{
InputSet(id, default_inputs[id], NUM_INPUTS);
}
void M_BindInputVariables(void)
{
#define BIND_INPUT(id, help) M_BindInput(#id, id, help)
BIND_INPUT(input_forward, "Move forward");
BIND_INPUT(input_backward, "Move backward");
BIND_INPUT(input_turnright, "Turn right");
BIND_INPUT(input_turnleft, "Turn left");
BIND_INPUT(input_strafeleft, "Strafe left (sideways left)");
BIND_INPUT(input_straferight, "Strafe right (sideways right)");
BIND_INPUT(input_speed, "Run (move fast)");
BIND_INPUT(input_strafe, "Hold to strafe");
BIND_INPUT(input_autorun, "Toggle always run mode");
BIND_INPUT(input_reverse, "Spin 180 instantly");
BIND_INPUT(input_use, "Open a door, use a switch");
BIND_INPUT(input_fire, "Fire current weapon");
BIND_INPUT(input_prevweapon, "Cycle to the previous weapon");
BIND_INPUT(input_nextweapon, "Cycle to the next weapon");
BIND_INPUT(input_novert, "Toggle vertical mouse movement");
BIND_INPUT(input_freelook, "Toggle free look");
BIND_INPUT(input_weapon1, "Switch to weapon 1 (fist/chainsaw)");
BIND_INPUT(input_weapon2, "Switch to weapon 2 (pistol)");
BIND_INPUT(input_weapon3, "Switch to weapon 3 (supershotgun/shotgun)");
BIND_INPUT(input_weapon4, "Switch to weapon 4 (chaingun)");
BIND_INPUT(input_weapon5, "Switch to weapon 5 (rocket launcher)");
BIND_INPUT(input_weapon6, "Switch to weapon 6 (plasma rifle)");
BIND_INPUT(input_weapon7, "Switch to weapon 7 (bfg9000)");
BIND_INPUT(input_weapon8, "Switch to weapon 8 (chainsaw)");
BIND_INPUT(input_weapon9, "Switch to weapon 9 (supershotgun)");
BIND_INPUT(input_weapontoggle, "Toggle between two most preferred weapons with ammo");
BIND_INPUT(input_menu_reloadlevel, "Restart current level/demo");
BIND_INPUT(input_menu_nextlevel, "Go to next level");
BIND_INPUT(input_hud_timestats, "Show level stats and time");
BIND_INPUT(input_savegame, "Save current game");
BIND_INPUT(input_loadgame, "Restore from saved games");
BIND_INPUT(input_soundvolume, "Bring up sound control panel");
BIND_INPUT(input_hud, "Adjust heads up display mode");
BIND_INPUT(input_quicksave, "Save to last slot saved");
BIND_INPUT(input_endgame, "End the game");
BIND_INPUT(input_messages, "Toggle messages");
BIND_INPUT(input_quickload, "Load from quick saved game");
BIND_INPUT(input_quit, "Quit game");
BIND_INPUT(input_gamma, "Adjust screen brightness (gamma correction)");
BIND_INPUT(input_spy, "View from another player's vantage");
BIND_INPUT(input_screenshot, "Take a screenshot");
BIND_INPUT(input_clean_screenshot, "Take a clean screenshot");
BIND_INPUT(input_pause, "Pause the game");
BIND_INPUT(input_demo_quit, "Finish recording demo");
BIND_INPUT(input_demo_join, "Continue recording current demo");
BIND_INPUT(input_demo_fforward, "Fast-forward demo");
BIND_INPUT(input_speed_up, "Increase game speed");
BIND_INPUT(input_speed_down, "Decrease game speed");
BIND_INPUT(input_speed_default, "Reset game speed");
BIND_INPUT(input_map, "Toggle automap display");
BIND_INPUT(input_map_up, "Shift automap up");
BIND_INPUT(input_map_down, "Shift automap down");
BIND_INPUT(input_map_left, "Shift automap left");
BIND_INPUT(input_map_right, "Shift automap right");
BIND_INPUT(input_map_follow, "Toggle scrolling/moving with automap");
BIND_INPUT(input_map_zoomin, "Enlarge automap");
BIND_INPUT(input_map_zoomout, "Reduce automap");
BIND_INPUT(input_map_mark, "Drop a marker on automap");
BIND_INPUT(input_map_clear, "Clear all markers on automap");
BIND_INPUT(input_map_gobig, "Max zoom for automap");
BIND_INPUT(input_map_grid, "Toggle grid display over automap");
BIND_INPUT(input_map_overlay, "Toggle overlay mode");
BIND_INPUT(input_map_rotate, "Toggle rotate mode");
BIND_INPUT(input_chat, "Enter a chat message");
BIND_INPUT(input_chat_dest0, "Chat with player 1");
BIND_INPUT(input_chat_dest1, "Chat with player 2");
BIND_INPUT(input_chat_dest2, "Chat with player 3");
BIND_INPUT(input_chat_dest3, "Chat with player 4");
BIND_INPUT(input_iddqd, "Toggle god mode");
BIND_INPUT(input_idkfa, "Give ammo/keys");
BIND_INPUT(input_idfa, "Give ammo");
BIND_INPUT(input_idclip, "Toggle no clipping mode");
BIND_INPUT(input_idbeholdh, "Give health");
BIND_INPUT(input_idbeholdm, "Give mega armor");
BIND_INPUT(input_idbeholdv, "Give invulnerability");
BIND_INPUT(input_idbeholds, "Give berserk");
BIND_INPUT(input_idbeholdi, "Give partial invisibility");
BIND_INPUT(input_idbeholdr, "Give radiation suit");
BIND_INPUT(input_idbeholdl, "Give light amplification");
BIND_INPUT(input_iddt, "Reveal map");
BIND_INPUT(input_notarget, "No target mode");
BIND_INPUT(input_freeze, "Freeze mode");
BIND_INPUT(input_avj, "Fake Archvile Jump");
}

View File

@ -35,13 +35,13 @@ enum
input_speed,
input_strafe,
input_autorun,
input_novert,
input_reverse,
input_use,
input_fire,
input_prevweapon,
input_nextweapon,
input_novert,
input_freelook,
input_weapon1,
@ -84,9 +84,9 @@ enum
input_zoomout,
input_screenshot,
input_clean_screenshot,
input_setup,
input_pause,
input_spy,
input_demo_quit,
input_demo_fforward,
input_demo_join,
@ -128,7 +128,6 @@ enum
input_idbeholdi,
input_idbeholdr,
input_idbeholdl,
input_idrate,
input_iddt,
input_notarget,
input_freeze,
@ -167,7 +166,7 @@ boolean M_InputGameActive(int id);
void M_InputGameDeactivate(int id);
void M_InputReset(int id);
void M_InputSetDefault(int id, input_t *inputs);
void M_InputSetDefault(int id);
const char *M_GetNameForKey(int key);
int M_GetKeyForName(const char *name);
@ -182,4 +181,6 @@ boolean M_IsMouseWheel(int mouseb);
void M_InputPredefined(void);
void M_BindInputVariables(void);
#endif

View File

@ -48,6 +48,8 @@ typedef enum
extern menu_input_mode_t menu_input, old_menu_input;
void MN_ResetMouseCursor(void);
extern boolean traditional_menu; // display the menu traditional way
extern boolean setup_active;
extern short whichSkull; // which skull to draw (he blinks)
extern int saved_screenblocks;
@ -56,7 +58,6 @@ extern boolean default_verify;
extern int warning_about_changes, print_warning_about_changes;
void MN_InitDefaults(void);
void MN_UpdateFreeLook(void);
extern const char *gamma_strings[];
void MN_ResetGamma(void);
void MN_DrawDelVerify(void);
@ -93,10 +94,6 @@ void MN_DrawAutoMap(void);
void MN_DrawWeapons(void);
void MN_DrawEnemy(void);
extern int resolution_scale;
extern int midi_player_menu;
extern const char *midi_player_string;
/////////////////////////////
//
// The following #defines are for the m_flags field of each item on every
@ -200,3 +197,41 @@ typedef struct setup_menu_s
void (*action)(void); // killough 10/98: function to call after changing
mrect_t rect;
} setup_menu_t;
// phares 4/21/98: Moved from m_misc.c so m_menu.c could see it.
//
// killough 11/98: totally restructured
// [FG] use a union of integer and string pointer to store config values,
// instead of type-punning string pointers to integers which won't work on
// 64-bit systems anyway
typedef union config_u
{
int i;
char *s;
} config_t;
typedef struct default_s
{
const char *name; // name
config_t *location; // default variable
config_t *current; // possible nondefault variable
config_t defaultvalue; // built-in default value
struct {int min, max;} limit; // numerical limits
enum {number, string, input} type; // type
ss_types setupscreen; // setup screen this appears on
wad_allowed_t wad_allowed; // whether it's allowed in wads
const char *help; // description of parameter
int input_id;
// internal fields (initialized implicitly to 0) follow
struct default_s *first, *next; // hash table pointers
int modified; // Whether it's been modified
config_t orig_default; // Original default, if modified
struct setup_menu_s *setup_menu; // Xref to setup menu item, if any
} default_t;
extern default_t *defaults;

View File

@ -47,7 +47,7 @@
#include "m_swap.h"
#include "mn_font.h"
#include "mn_menu.h"
#include "mn_setup.h"
#include "mn_internal.h"
#include "mn_snapshot.h"
#include "p_saveg.h"
#include "r_defs.h"
@ -73,16 +73,7 @@ extern boolean chat_on; // in heads-up code
// defaulted values
//
int mouseSensitivity_horiz; // has default // killough
int mouseSensitivity_vert; // has default
int mouseSensitivity_horiz_strafe; // [FG] strafe
int mouseSensitivity_vert_look; // [FG] look
int showMessages; // Show messages has default, 0 = off, 1 = on
int show_toggle_messages;
int show_pickup_messages;
int traditional_menu;
boolean traditional_menu;
// Blocky mode, has default, 0 = high, 1 = normal
// int detailLevel; obsolete -- killough
@ -1538,9 +1529,9 @@ static void M_ChangeMessages(int choice)
{
// warning: unused parameter `int choice'
choice = 0;
showMessages = 1 - showMessages;
show_messages = 1 - show_messages;
if (!showMessages)
if (!show_messages)
{
displaymsg("%s", s_MSGOFF); // Ty 03/27/98 - externalized
}
@ -2287,15 +2278,6 @@ static boolean ShortcutResponder(const event_t *ev)
return true;
}
// killough 10/98: allow key shortcut into Setup menu
if (M_InputActivated(input_setup))
{
MN_StartControlPanel();
M_StartSound(sfx_swtchn);
SetNextMenu(&SetupDef);
return true;
}
static boolean fastdemo_timer = false;
// [FG] reload current level / go to next level
@ -3034,7 +3016,7 @@ void MN_StartControlPanel(void)
// Fix to make "always floating" with menu selections, and to always follow
// defaultskill, instead of -skill.
NewDef.lastOn = defaultskill - 1;
NewDef.lastOn = default_skill - 1;
default_verify = 0; // killough 10/98
menuactive = 1;

View File

@ -59,6 +59,8 @@ void MN_ForcedLoadGame(const char *msg); // killough 5/15/98: forced loadgames
void MN_Trans(void); // killough 11/98: reset translucency
void MN_ResetMenu(void); // killough 11/98: reset main menu ordering
void MN_SetupResetMenu(void);
void MN_UpdateFreeLook(void);
void MN_UpdateAdvancedSoundItems(boolean toggle);
void MN_ResetTimeScale(void);
void MN_DrawCredits(void); // killough 11/98
void MN_SetHUFontKerning(void);
@ -67,8 +69,6 @@ void MN_UpdateDynamicResolutionItem(void);
void MN_DisableResolutionScaleItem(void);
void MN_UpdateFpsLimitItem(void);
extern int traditional_menu; // display the menu traditional way
typedef enum
{
MENU_BG_OFF,
@ -81,8 +81,6 @@ boolean MN_MenuIsShaded(void);
void MN_SetQuickSaveSlot(int slot);
void MN_InitMidiPlayer(void);
void MN_InitMenuStrings(void);
boolean MN_StartsWithMapIdentifier(char *str);
@ -94,6 +92,8 @@ void MN_DrawString(int cx, int cy, int color, const char *ch);
void M_StartSound(int sound_id);
void MN_BindMenuVariables(void);
#endif
//----------------------------------------------------------------------------

View File

@ -13,7 +13,7 @@
// GNU General Public License for more details.
//
#include "mn_setup.h"
#include "mn_internal.h"
#include "am_map.h"
#include "d_main.h"
#include "doomdef.h"
@ -1828,7 +1828,7 @@ static setup_tab_t gen_tabs[] = {
{NULL}
};
int resolution_scale;
static int resolution_scale;
static const char **GetResolutionScaleStrings(void)
{
@ -1939,13 +1939,8 @@ static void ToggleExclusiveFullScreen(void)
toggle_exclusive_fullscreen = true;
}
static void CoerceFPSLimit(void)
static void UpdateFPSLimit(void)
{
if (fpslimit < TICRATE)
{
fpslimit = 0;
}
setrefreshneeded = true;
}
@ -1989,10 +1984,10 @@ static setup_menu_t gen_settings1[] = {
MI_GAP,
{"Uncapped Framerate", S_ONOFF, M_X, M_SPC, {"uncapped"}, m_null, input_null,
str_empty, MN_UpdateFpsLimitItem},
str_empty, UpdateFPSLimit},
{"Framerate Limit", S_NUM, M_X, M_SPC, {"fpslimit"}, m_null, input_null,
str_empty, CoerceFPSLimit},
str_empty, UpdateFPSLimit},
{"VSync", S_ONOFF, M_X, M_SPC, {"use_vsync"}, m_null, input_null, str_empty,
I_ToggleVsync},
@ -2032,12 +2027,8 @@ static const char *sound_module_strings[] = {
#endif
};
static void UpdateAdvancedSoundItems(void);
static void SetSoundModule(void)
{
UpdateAdvancedSoundItems();
if (!I_AllowReinitSound())
{
// The OpenAL implementation doesn't support the ALC_SOFT_HRTF extension
@ -2046,21 +2037,15 @@ static void SetSoundModule(void)
return;
}
I_SetSoundModule(snd_module);
I_SetSoundModule();
}
int midi_player_menu;
const char *midi_player_string = "";
static void SetMidiPlayer(void)
{
S_StopMusic();
I_SetMidiPlayer(&midi_player_menu);
I_SetMidiPlayer();
S_SetMusicVolume(snd_MusicVolume);
S_RestartMusic();
const char **strings = GetStrings(str_midi_player);
midi_player_string = strings[midi_player_menu];
}
static setup_menu_t gen_settings2[] = {
@ -2360,15 +2345,14 @@ void MN_UpdateDynamicResolutionItem(void)
"dynamic_resolution");
}
static void UpdateAdvancedSoundItems(void)
void MN_UpdateAdvancedSoundItems(boolean toggle)
{
DisableItem(snd_module != SND_MODULE_3D, gen_settings2, "snd_hrtf");
DisableItem(toggle, gen_settings2, "snd_hrtf");
}
void MN_UpdateFpsLimitItem(void)
{
DisableItem(!default_uncapped, gen_settings1, "fpslimit");
setrefreshneeded = true;
DisableItem(!uncapped, gen_settings1, "fpslimit");
}
void MN_DisableVoxelsRenderingItem(void)
@ -2557,7 +2541,7 @@ static void ResetDefaults()
}
else if (current_item->input_id == dp->input_id)
{
M_InputSetDefault(dp->input_id, dp->inputs);
M_InputSetDefault(dp->input_id);
}
}
}
@ -3830,34 +3814,16 @@ static void UpdateHUDModeStrings(void)
selectstrings[str_hudmode] = GetHUDModeStrings();
}
void MN_InitMidiPlayer(void)
static const char **GetMidiPlayerStrings(void)
{
const char **devices = I_DeviceList();
for (int i = 0; i < array_size(devices); ++i)
{
if (!strcasecmp(devices[i], midi_player_string))
{
midi_player_menu = i;
break;
}
}
if (midi_player_menu >= array_size(devices))
{
midi_player_menu = 0;
}
I_SetMidiPlayer(&midi_player_menu);
midi_player_string = devices[midi_player_menu];
selectstrings[str_midi_player] = devices;
return I_DeviceList();
}
void MN_InitMenuStrings(void)
{
UpdateHUDModeStrings();
selectstrings[str_resolution_scale] = GetResolutionScaleStrings();
selectstrings[str_midi_player] = GetMidiPlayerStrings();
selectstrings[str_mouse_accel] = GetMouseAccelStrings();
selectstrings[str_resampler] = GetResamplerStrings();
}
@ -3874,11 +3840,16 @@ void MN_SetupResetMenu(void)
DisableItem(deh_set_blood_color, enem_settings1, "colored_blood");
DisableItem(!brightmaps_found || force_brightmaps, gen_settings5,
"brightmaps");
DisableItem(default_current_video_height <= DRS_MIN_HEIGHT, gen_settings1,
"dynamic_resolution");
UpdateInterceptsEmuItem();
CoerceFPSLimit();
UpdateCrosshairItems();
UpdateCenteredWeaponItem();
UpdateAdvancedSoundItems();
}
void MN_BindMenuVariables(void)
{
BIND_NUM(resolution_scale, 0, 0, UL, "Resolution scale menu index");
BIND_NUM_GENERAL(menu_backdrop, MENU_BG_DARK, MENU_BG_OFF, MENU_BG_TEXTURE,
"Draw menu backdrop (0 = Off, 1 = Dark (default), 2 = Texture)");
M_BindBool("traditional_menu", &traditional_menu, NULL,
true, ss_none, wad_yes, "1 to use Doom's main menu ordering");
}

View File

@ -119,7 +119,7 @@ boolean net_waiting_for_launch = false;
// Name that we send to the server
char *net_player_name = NULL;
const char *net_player_name = NULL;
// Connected but not participating in the game (observer)

View File

@ -41,7 +41,7 @@ extern boolean net_client_received_wait_data;
extern net_waitdata_t net_client_wait_data;
extern char *net_client_reject_reason;
extern boolean net_waiting_for_launch;
extern char *net_player_name;
extern const char *net_player_name;
extern sha1_digest_t net_server_wad_sha1sum;
extern sha1_digest_t net_server_deh_sha1sum;

View File

@ -22,6 +22,8 @@
#ifndef __P_ENEMY__
#define __P_ENEMY__
#include "doomtype.h"
struct mobj_s;
void P_NoiseAlert(struct mobj_s *target, struct mobj_s *emmiter);
@ -31,6 +33,8 @@ extern struct brain_s { // killough 3/26/98: global state of boss brain
int easy, targeton;
} brain;
extern boolean ghost_monsters;
#endif // __P_ENEMY__
//----------------------------------------------------------------------------

View File

@ -85,6 +85,7 @@ extern struct mobj_s *linetarget; // who got hit (or NULL)
extern struct msecnode_s *sector_list; // phares 3/16/98
extern fixed_t tmbbox[4]; // phares 3/20/98
extern struct line_s *blockline; // killough 8/11/98
extern boolean hangsolid;
#endif // __P_MAP__

View File

@ -84,6 +84,8 @@ extern fixed_t openrange;
extern fixed_t lowfloor;
extern divline_t trace;
extern boolean blockmapfix;
#endif // __P_MAPUTL__
//----------------------------------------------------------------------------

View File

@ -47,8 +47,6 @@
#include "v_video.h"
#include "z_zone.h"
// [FG] colored blood and gibs
boolean colored_blood;
boolean direct_vertical_aiming, default_direct_vertical_aiming;
void P_UpdateDirectVerticalAiming(void)

View File

@ -419,9 +419,6 @@ extern int itemrespawntime[];
extern int iquehead;
extern int iquetail;
// [FG] colored blood and gibs
extern boolean colored_blood;
extern boolean direct_vertical_aiming, default_direct_vertical_aiming;
void P_UpdateDirectVerticalAiming(void);

View File

@ -35,6 +35,7 @@
#include "doomstat.h"
#include "g_game.h"
#include "hu_obituary.h"
#include "hu_stuff.h"
#include "i_system.h"
#include "info.h"
#include "m_argv.h"
@ -56,6 +57,7 @@
#include "r_plane.h" // killough 10/98
#include "r_sky.h" // R_GetSkyColor
#include "r_state.h"
#include "r_swirl.h"
#include "s_sound.h"
#include "sounds.h"
#include "st_stuff.h"
@ -2154,8 +2156,6 @@ int disable_nuke; // killough 12/98: nukage disabling cheat
static void P_SecretRevealed(player_t *player)
{
extern int hud_secret_message;
if (hud_secret_message && player == &players[consoleplayer])
{
player->secretmessage = s_HUSTR_SECRETFOUND;
@ -2335,8 +2335,6 @@ int levelTimeCount;
boolean levelFragLimit; // Ty 03/18/98 Added -frags support
int levelFragLimitCount; // Ty 03/18/98 Added -frags support
boolean r_swirl;
void P_UpdateSpecials (void)
{
anim_t* anim;

View File

@ -39,6 +39,7 @@
#include "r_defs.h"
#include "r_main.h"
#include "r_state.h"
#include "st_stuff.h"
static fixed_t PlayerSlope(player_t *player)
{
@ -270,13 +271,6 @@ void P_MovePlayer (player_t* player)
#define ANG5 (ANG90/18)
typedef enum
{
death_use_default,
death_use_reload,
death_use_nothing
} death_use_action_t;
death_use_action_t death_use_action;
//
@ -369,7 +363,6 @@ void P_PlayerThink (player_t* player)
{
ticcmd_t* cmd;
weapontype_t newweapon;
extern boolean palette_changes;
// [AM] Assume we can interpolate at the beginning
// of the tic.

View File

@ -33,6 +33,15 @@ void P_DeathThink(struct player_s *player);
void P_MovePlayer(struct player_s *player);
void P_Thrust(struct player_s *player, angle_t angle, fixed_t move);
typedef enum
{
death_use_default,
death_use_reload,
death_use_nothing
} death_use_action_t;
extern death_use_action_t death_use_action;
#endif // __P_USER__
//----------------------------------------------------------------------------

View File

@ -848,6 +848,7 @@ void R_InitSpriteLumps(void)
// killough 4/4/98: Add support for C_START/C_END markers
//
invul_mode_t invul_mode;
static byte invul_orig[256];
void R_InvulMode(void)

View File

@ -55,6 +55,15 @@ extern byte *main_tranmap, *tranmap;
extern int tran_filter_pct;
typedef enum
{
INVUL_VANILLA,
INVUL_MBF,
INVUL_GRAY,
} invul_mode_t;
extern invul_mode_t invul_mode;
#endif
//----------------------------------------------------------------------------

View File

@ -23,6 +23,7 @@
#include "doomdef.h"
#include "doomstat.h"
#include "doomtype.h"
#include "i_system.h"
#include "i_video.h"
#include "r_bsp.h"
@ -609,7 +610,7 @@ static void R_DrawFuzzColumn_block(void)
// [FG] spectre drawing mode: 0 original, 1 blocky (hires)
int fuzzcolumn_mode;
boolean fuzzcolumn_mode;
void (*R_DrawFuzzColumn) (void) = R_DrawFuzzColumn_orig;
void R_SetFuzzColumnMode (void)
{

View File

@ -48,7 +48,7 @@ void R_SetFuzzPosTic(void);
void R_SetFuzzPosDraw(void);
// [FG] spectre drawing mode
extern int fuzzcolumn_mode;
extern boolean fuzzcolumn_mode;
void R_SetFuzzColumnMode(void);
void R_DrawSkyColumn(void);

View File

@ -38,11 +38,14 @@
#include "r_defs.h"
#include "r_draw.h"
#include "r_main.h"
#include "r_bmaps.h"
#include "r_plane.h"
#include "r_sky.h"
#include "r_state.h"
#include "r_swirl.h"
#include "r_things.h"
#include "r_voxel.h"
#include "m_config.h"
#include "st_stuff.h"
#include "v_flextran.h"
#include "v_video.h"
@ -559,7 +562,7 @@ void R_ExecuteSetViewSize (void)
scaledviewwidth_nonwide = setblocks * 32;
scaledviewheight = (setblocks * st_screen / 10) & ~7; // killough 11/98
if (widescreen)
if (video.unscaledw > SCREENWIDTH)
scaledviewwidth = (scaledviewheight * video.unscaledw / st_screen) & ~7;
else
scaledviewwidth = scaledviewwidth_nonwide;
@ -836,6 +839,7 @@ static void R_ClearStats(void)
rendered_voxels = 0;
}
static boolean flashing_hom;
int autodetect_hom = 0; // killough 2/7/98: HOM autodetection flag
//
@ -960,6 +964,37 @@ void R_InitAnyRes(void)
R_InitPlanesRes();
}
void R_BindRenderVariables(void)
{
BIND_NUM_GENERAL(extra_level_brightness, 0, 0, 4, "Level brightness");
BIND_BOOL_GENERAL(stretchsky, false, "1 to stretch short skies");
BIND_BOOL_GENERAL(linearsky, false, "1 for linear horizontal sky scrolling");
BIND_BOOL_GENERAL(r_swirl, false, "1 to enable swirling animated flats");
BIND_BOOL_GENERAL(smoothlight, false, "1 to enable smooth diminishing lighting");
M_BindBool("voxels_rendering", &default_voxels_rendering, &voxels_rendering,
true, ss_none, wad_no, "1 to enable voxels rendering");
BIND_BOOL_GENERAL(brightmaps, false,
"1 to enable brightmaps for textures and sprites");
BIND_NUM_GENERAL(invul_mode, INVUL_MBF, INVUL_VANILLA, INVUL_GRAY,
"Invulnerability effect (0 = Vanilla, 1 = MBF, 2 = Gray)");
BIND_BOOL(flashing_hom, true, "1 to enable flashing HOM indicator");
BIND_NUM(screenblocks, 10, 3, 11, "Initial play screen size");
M_BindBool("translucency", &translucency, NULL, true, ss_gen, wad_yes,
"1 to enable translucency for some things");
M_BindNum("tran_filter_pct", &tran_filter_pct, NULL,
66, 0, 100, ss_gen, wad_yes,
"Set percentage of foreground/background translucency mix");
M_BindBool("flipcorpses", &flipcorpses, NULL, false, ss_enem, wad_no,
"1 to enable randomly mirrored death animations");
M_BindBool("fuzzcolumn_mode", &fuzzcolumn_mode, NULL, true, ss_enem, wad_no,
"0 original, 1 blocky");
BIND_BOOL(raw_input, true,
"Raw gamepad/mouse input for turning/looking (0 = Interpolate, 1 = Raw)");
}
//----------------------------------------------------------------------------
//
// $Log: r_main.c,v $

View File

@ -55,6 +55,8 @@ extern fixed_t viewheightfrac; // [FG] sprite clipping optimizations
extern int rendered_visplanes, rendered_segs, rendered_vissprites, rendered_voxels;
void R_BindRenderVariables(void);
//
// Lighting LUT.
// Used for z-depth cuing per column/row,

View File

@ -27,6 +27,8 @@
#include "w_wad.h"
#include "z_zone.h"
boolean r_swirl;
// swirl factors determine the number of waves per flat width
// 1 cycle per 64 units

View File

@ -24,4 +24,6 @@
byte *R_DistortedFlat(int flatnum);
extern boolean r_swirl;
#endif

View File

@ -40,6 +40,7 @@ extern fixed_t pspritescale;
extern fixed_t pspriteiscale;
extern boolean pspr_interp; // weapon bobbing interpolation
extern boolean flipcorpses;
extern lighttable_t **spritelights;

View File

@ -26,8 +26,8 @@
#include "w_wad.h"
#include "z_zone.h"
int sts_colored_numbers; //jff 2/18/98 control to disable status color changes
int sts_pct_always_gray; // killough 2/21/98: always gray %'s? bug or feature?
boolean sts_colored_numbers; //jff 2/18/98 control to disable status color changes
boolean sts_pct_always_gray; // killough 2/21/98: always gray %'s? bug or feature?
extern boolean st_crispyhud;

View File

@ -27,6 +27,9 @@
// We are referring to patches.
struct patch_s;
extern boolean sts_colored_numbers;// status numbers do not change colors
extern boolean sts_pct_always_gray;// status percents do not change colors
//
// Typedefs of widgets
//

View File

@ -33,6 +33,7 @@
#include "i_video.h"
#include "info.h"
#include "m_cheat.h"
#include "m_config.h"
#include "m_misc.h"
#include "m_random.h"
#include "m_swap.h"
@ -202,7 +203,8 @@ static int lu_palette;
// whether left-side main status bar is active
static boolean st_statusbaron;
// [crispy] distinguish classic status bar with background and player face from Crispy HUD
// [crispy] distinguish classic status bar with background and player face
// from Crispy HUD
boolean st_crispyhud;
static boolean st_classicstatusbar;
@ -251,7 +253,7 @@ static patch_t *arms[6][2];
static st_number_t w_ready;
// [Alaux]
int hud_animated_counts;
static boolean hud_animated_counts;
int st_health = 100;
int st_armor = 0;
@ -265,8 +267,8 @@ int armor_red; // armor amount less than which status is red
int armor_yellow; // armor amount less than which status is yellow
int armor_green; // armor amount above is blue, below is green
int hud_backpack_thresholds; // backpack changes thresholds
int hud_armor_type; // color of armor depends on type
boolean hud_backpack_thresholds; // backpack changes thresholds
boolean hud_armor_type; // color of armor depends on type
// in deathmatch only, summary of frags stats
static st_number_t w_frags;
@ -323,7 +325,7 @@ extern char *mapnames[];
void ST_Stop(void);
int st_solidbackground;
static boolean st_solidbackground;
static void ST_DrawSolidBackground(int st_x)
{
@ -669,8 +671,8 @@ void ST_updateFaceWidget(void)
}
int sts_traditional_keys; // killough 2/28/98: traditional status bar keys
int hud_blink_keys; // [crispy] blinking key or skull in the status bar
static boolean sts_traditional_keys; // killough 2/28/98: traditional status bar keys
static boolean hud_blink_keys; // [crispy] blinking key or skull in the status bar
void ST_SetKeyBlink(player_t* player, int blue, int yellow, int red)
{
@ -1474,6 +1476,40 @@ void ST_ResetPalette(void)
I_SetPalette(W_CacheLumpNum(lu_palette, PU_CACHE));
}
void ST_BindSTSVariables(void)
{
M_BindBool("sts_colored_numbers", &sts_colored_numbers, NULL,
false, ss_stat, wad_yes, "1 to enable use of color on status bar");
M_BindBool("sts_pct_always_gray", &sts_pct_always_gray, NULL,
false, ss_stat, wad_yes,
"1 to make percent signs on status bar always gray");
M_BindBool("sts_traditional_keys", &sts_traditional_keys, NULL,
false, ss_stat, wad_yes,
"1 to make percent signs on status bar always gray");
M_BindBool("hud_blink_keys", &hud_blink_keys, NULL,
false, ss_stat, wad_no,
"1 to make missing keys blink when trying to trigger linedef actions");
M_BindBool("st_solidbackground", &st_solidbackground, NULL,
false, ss_stat, wad_no,
"1 for solid color status bar background in widescreen mode");
M_BindBool("hud_animated_counts", &hud_animated_counts, NULL,
false, ss_stat, wad_no, "1 to enable animated health/armor counts");
M_BindNum("health_red", &health_red, NULL, 25, 0, 200, ss_none, wad_yes,
"Amount of health for red to yellow transition");
M_BindNum("health_yellow", &health_yellow, NULL, 50, 0, 200, ss_none, wad_yes,
"Amount of health for yellow to green transition");
M_BindNum("health_green", &health_green, NULL, 100, 0, 200, ss_none, wad_yes,
"Amount of health for green to blue transition");
M_BindNum("armor_red", &armor_red, NULL, 25, 0, 200, ss_none, wad_yes,
"Amount of armor for red to yellow transition");
M_BindNum("armor_yellow", &armor_yellow, NULL, 50, 0, 200, ss_none, wad_yes,
"Amount of armor for yellow to green transition");
M_BindNum("armor_green", &armor_green, NULL, 100, 0, 200, ss_none, wad_yes,
"Amount of armor for green to blue transition");
M_BindNum("ammo_red", &ammo_red, NULL, 25, 0, 100, ss_none, wad_yes,
"Percent of ammo for red to yellow transition");
}
//----------------------------------------------------------------------------
//
// $Log: st_stuff.c,v $

View File

@ -63,7 +63,6 @@ void ST_InitRes(void);
// killough 5/2/98: moved from m_misc.c:
// [Alaux]
extern int hud_animated_counts;
extern int st_health;
extern int st_armor;
@ -75,22 +74,19 @@ extern int armor_yellow; // armor amount less than which status is yellow
extern int armor_green; // armor amount above is blue, below is green
extern int ammo_red; // ammo percent less than which status is red
extern int ammo_yellow; // ammo percent less is yellow more green
extern int sts_colored_numbers;// status numbers do not change colors
extern int sts_pct_always_gray;// status percents do not change colors
extern int sts_traditional_keys; // display keys the traditional way
// [crispy] blinking key or skull in the status bar
extern int hud_blink_keys;
#define KEYBLINKMASK 0x8
#define KEYBLINKTICS (7*KEYBLINKMASK)
extern void ST_SetKeyBlink(struct player_s *player, int blue, int yellow, int red);
extern int ST_BlinkKey(struct player_s *player, int index);
extern int st_keyorskull[3];
extern int hud_backpack_thresholds; // backpack changes thresholds
extern int hud_armor_type; // color of armor depends on type
extern boolean hud_backpack_thresholds; // backpack changes thresholds
extern boolean hud_armor_type; // color of armor depends on type
extern int st_solidbackground;
extern boolean palette_changes;
void ST_BindSTSVariables(void);
#endif