A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 374 lines 10 kB view raw
1// Emacs style mode select -*- C++ -*- 2//----------------------------------------------------------------------------- 3// 4// $Id$ 5// 6// Copyright (C) 1993-1996 by id Software, Inc. 7// 8// This program is free software; you can redistribute it and/or 9// modify it under the terms of the GNU General Public License 10// as published by the Free Software Foundation; either version 2 11// of the License, or (at your option) any later version. 12// 13// This program is distributed in the hope that it will be useful, 14// but WITHOUT ANY WARRANTY; without even the implied warranty of 15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16// GNU General Public License for more details. 17// 18// DESCRIPTION: 19// All the global variables that store the internal state. 20// Theoretically speaking, the internal state of the engine 21// should be found by looking at the variables collected 22// here, and every relevant module will have to include 23// this header file. 24// In practice, things are a bit messy. 25// 26//----------------------------------------------------------------------------- 27 28 29#ifndef __D_STATE__ 30#define __D_STATE__ 31 32// We need globally shared data structures, 33// for defining the global state variables. 34#include "doomdata.h" 35#include "d_net.h" 36 37// We need the playr data structure as well. 38#include "d_player.h" 39 40 41#ifdef __GNUG__ 42#pragma interface 43#endif 44 45 46// ------------------------ 47// Command line parameters. 48// 49extern boolean nomonsters; // checkparm of -nomonsters 50extern boolean respawnparm; // checkparm of -respawn 51extern boolean fastparm; // checkparm of -fast 52 53extern boolean devparm; // DEBUG: launched with -devparm 54 55enum { 56 am_active = 1, // currently shown 57 am_overlay= 2, // covers the screen, i.e. not overlay mode 58 am_rotate = 4, // rotates to the player facing direction 59 am_follow = 8, // keep the player centred 60 am_grid =16, // show grid 61}; 62typedef unsigned automapmode_e; 63extern automapmode_e automapmode; // Mode that the automap is in 64 65// ----------------------------------------------------- 66// Game Mode - identify IWAD as shareware, retail etc. 67// 68extern GameMode_t gamemode; 69extern GameMission_t gamemission; 70 71// Set if homebrew PWAD stuff has been added. 72extern boolean modifiedgame; 73 74// CPhipps - new compatibility handling 75extern complevel_t compatibility_level, default_compatibility_level; 76 77// CPhipps - old compatibility testing flags aliased to new handling 78#define compatibility (compatibility_level<=boom_compatibility_compatibility) 79#define demo_compatibility (compatibility_level <= doom_demo_compatibility) 80#define mbf_features (compatibility_level>=mbf_compatibility) 81 82extern int default_translucency; 83extern boolean general_translucency; // true if translucency is ok // phares 84 85extern int demo_insurance, default_demo_insurance; // killough 4/5/98 86 87// ------------------------------------------- 88// killough 10/98: compatibility vector 89 90enum { 91 comp_telefrag, 92 comp_dropoff, 93 comp_vile, 94 comp_pain, 95 comp_skull, 96 comp_blazing, 97 comp_doorlight, 98 comp_model, 99 comp_god, 100 comp_falloff, 101 comp_floors, 102 comp_skymap, 103 comp_pursuit, 104 comp_doorstuck, 105 comp_staylift, 106 comp_zombie, 107 comp_stairs, 108 comp_infcheat, 109 comp_zerotags, 110 comp_moveblock, 111 comp_respawn, /* cph - this is the inverse of comp_respawnfix from eternity */ 112 comp_sound, 113 COMP_NUM, /* cph - should be last in sequence */ 114 COMP_TOTAL=32 // Some extra room for additional variables 115}; 116 117extern int comp[COMP_TOTAL], default_comp[COMP_TOTAL]; 118 119extern boolean enable_sound; 120extern boolean rockblock; 121 122// ------------------------------------------- 123// Language. 124extern Language_t language; 125 126 127// ------------------------------------------- 128// Selected skill type, map etc. 129// 130 131// Defaults for menu, methinks. 132extern skill_t startskill; 133extern int startepisode; 134extern int startmap; 135 136extern boolean autostart; 137 138// Selected by user. 139extern skill_t gameskill; 140extern int gameepisode; 141extern int gamemap; 142 143// Nightmare mode flag, single player. 144extern boolean respawnmonsters; 145 146// Netgame? Only true if >1 player. 147extern boolean netgame; 148 149// Flag: true only if started as net deathmatch. 150// An enum might handle altdeath/cooperative better. 151extern boolean deathmatch; 152 153// ------------------------- 154// Internal parameters for sound rendering. 155// These have been taken from the DOS version, 156// but are not (yet) supported with Linux 157// (e.g. no sound volume adjustment with menu. 158 159// These are not used, but should be (menu). 160// From m_menu.c: 161// Sound FX volume has default, 0 - 15 162// Music volume has default, 0 - 15 163// These are multiplied by 8. 164extern int snd_SfxVolume; // maximum volume for sound 165extern int snd_MusicVolume; // maximum volume for music 166 167// Current music/sfx card - index useless 168// w/o a reference LUT in a sound module. 169// Ideally, this would use indices found 170// in: /usr/include/linux/soundcard.h 171extern int snd_MusicDevice; 172extern int snd_SfxDevice; 173// Config file? Same disclaimer as above. 174extern int snd_DesiredMusicDevice; 175extern int snd_DesiredSfxDevice; 176 177 178// ------------------------- 179// Status flags for refresh. 180// 181 182// Depending on view size - no status bar? 183// Note that there is no way to disable the 184// status bar explicitely. 185extern boolean statusbaractive; 186 187extern boolean automapactive; // In AutoMap mode? 188extern boolean menuactive; // Menu overlayed? 189extern boolean paused; // Game Pause? 190 191 192extern boolean viewactive; 193 194extern boolean nodrawers; 195extern boolean noblit; 196 197extern int viewwindowx; 198extern int viewwindowy; 199extern int viewheight; 200extern int viewwidth; 201extern int scaledviewwidth; 202 203// This one is related to the 3-screen display mode. 204// ANG90 = left side, ANG270 = right 205extern int viewangleoffset; 206 207// Player taking events, and displaying. 208extern int consoleplayer; 209extern int displayplayer; 210 211 212// ------------------------------------- 213// Scores, rating. 214// Statistics on a given map, for intermission. 215// 216extern int totalkills, totallive; 217extern int totalitems; 218extern int totalsecret; 219 220// Timer, for scores. 221extern int levelstarttic; // gametic at level start 222extern int basetic; /* killough 9/29/98: levelstarttic, adjusted */ 223extern int leveltime; // tics in game play for par 224 225 226 227// -------------------------------------- 228// DEMO playback/recording related stuff. 229// No demo, there is a human player in charge? 230// Disable save/end game? 231extern boolean usergame; 232 233//? 234extern boolean demoplayback; 235extern boolean demorecording; 236 237// Quit after playing a demo from cmdline. 238extern boolean singledemo; 239 240 241 242 243//? 244extern gamestate_t gamestate; 245 246//----------------------------- 247// Internal parameters, fixed. 248// These are set by the engine, and not changed 249// according to user inputs. Partly load from 250// WAD, partly set at startup time. 251 252extern int gametic; 253 254// Bookkeeping on players - state. 255extern player_t players[MAXPLAYERS]; 256 257// Alive? Disconnected? 258extern boolean playeringame[MAXPLAYERS]; 259 260 261// Player spawn spots for deathmatch. 262#define MAX_DM_STARTS 10 263//extern mapthing_t deathmatchstarts[MAX_DM_STARTS]; 264extern mapthing_t *deathmatchstarts; // killough 265extern size_t num_deathmatchstarts; // killough 266extern mapthing_t* deathmatch_p; 267 268// Player spawn spots. 269extern mapthing_t playerstarts[MAXPLAYERS]; 270 271// Intermission stats. 272// Parameters for world map / intermission. 273extern wbstartstruct_t wminfo; 274 275 276// LUT of ammunition limits for each kind. 277// This doubles with BackPack powerup item. 278extern int maxammo[NUMAMMO]; 279 280//----------------------------------------- 281// Internal parameters, used for engine. 282// 283 284// File handling stuff. 285extern char basedefault[]; 286extern int debugfile; 287 288// if true, load all graphics at level load 289extern boolean precache; 290 291 292// wipegamestate can be set to -1 293// to force a wipe on the next draw 294extern gamestate_t wipegamestate; 295 296extern int mouseSensitivity; 297//? 298// debug flag to cancel adaptiveness 299extern boolean singletics; 300 301extern int bodyqueslot; 302 303 304 305// Needed to store the number of the dummy sky flat. 306// Used for rendering, 307// as well as tracking projectiles etc. 308extern int skyflatnum; 309 310// Netgame stuff (buffers and pointers, i.e. indices). 311extern doomcom_t* doomcom; 312extern doomdata_t* netbuffer; // This points inside doomcom. 313 314extern int rndindex; 315 316extern int maketic; 317 318extern ticcmd_t netcmds[][BACKUPTICS]; 319 320extern int ticdup; 321 322extern int nettics[MAXNETNODES]; 323 324//----------------------------------------------------------------------------- 325 326// v1.1-like pitched sounds 327extern int pitched_sounds; // killough 2/21/98 328 329extern int allow_pushers; // MT_PUSH Things // phares 3/10/98 330extern int default_allow_pushers; 331 332extern int variable_friction; // ice & mud // phares 3/10/98 333extern int default_variable_friction; 334 335extern int monsters_remember; // killough 3/1/98 336extern int default_monsters_remember; 337 338extern int weapon_recoil; // weapon recoil // phares 339extern int default_weapon_recoil; 340 341extern int player_bobbing; // whether player bobs or not // phares 2/25/98 342extern int default_player_bobbing; // killough 3/1/98: make local to each game 343 344#ifdef DOGS 345extern int dogs, default_dogs; // killough 7/19/98: Marine's best friend :) 346extern int dog_jumping, default_dog_jumping; // killough 10/98 347#endif 348 349/* killough 8/8/98: distance friendly monsters tend to stay from player */ 350extern int distfriend, default_distfriend; 351 352/* killough 9/8/98: whether monsters are allowed to strafe or retreat */ 353extern int monster_backing, default_monster_backing; 354 355/* killough 9/9/98: whether monsters intelligently avoid hazards */ 356extern int monster_avoid_hazards, default_monster_avoid_hazards; 357 358/* killough 10/98: whether monsters are affected by friction */ 359extern int monster_friction, default_monster_friction; 360 361/* killough 9/9/98: whether monsters help friends */ 362extern int help_friends, default_help_friends; 363 364extern int flashing_hom; // killough 10/98 365 366extern int doom_weapon_toggles; // killough 10/98 367 368/* killough 7/19/98: whether monsters should fight against each other */ 369extern int monster_infighting, default_monster_infighting; 370 371extern int monkeys, default_monkeys; 372 373 374#endif