summaryrefslogtreecommitdiff
path: root/src/d_iwad.c
AgeCommit message (Collapse)Author
2015-08-24Make IWAD search paths compliant with XDG spec.Simon Howard
The XDG Base Directory Specification defines standard directories that are searched for data files via the XDG_DATA_HOME and XDG_DATA_DIRS environment variables: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html To make Chocolate Doom a good citizen, use these directories to determine some of the locations in which to look for IWAD files. This includes /usr/share/games/doom, which is absorbed under the default value of the XDG_DATA_DIRS variable. We also now support the alternative ~/.local/share/games/doom as a user-writeable path in the user's home directory that doesn't require root privileges. This is part of #597 (thanks to @chungy for the suggestion).
2015-02-20Refactor config file API.Simon Howard
The config file API previously relied on binding config variables using M_BindVariable() which took a void pointer. It occurred to me that if used on a boolean variable, this would be erroneous, but the void pointer would make it impossible to tell. Split this into separate M_Bind{Foo}Variable() functions based on type, which allows for proper type checking on the pointers that are passed. Vaguely related to #509.
2014-12-14Add Steam IWAD path for Strife: Veteran EditionMike Swanson
2014-10-24Replace strdup() with M_StringDuplicate().Simon Howard
strdup() can theoretically fail and return NULL. This could lead to a crash or undesirable behavior. Add M_StringDuplicate() which does the same thing but exits with an error if a string cannot be allocated. This fixes #456. Thanks to Quasar for the suggestion.
2014-05-05Clean up file headers.Simon Howard
This change rewrites and simplifies the copyright headers at the top of all source files: * Remove "Emacs style mode select" line; this line was included in the headers for the originally released source files and appears to be to set the file type for old versions of Emacs. I'm not sure entirely why it was required but I don't think it is any more. * Remove "You should have received a copy of..." text from copyright header. This refers to the old 59 Temple Place address where the FSF headquarters used to be located and is no longer correct. Rather than change to the new address, just remove the paragraph as it is superfluous anyway. This fixes #311. * Remove ---- separator lines so that the file headers are barer and more simplified.
2014-04-19Exit with error on startup if using the wrong IWAD.Simon Howard
Having multiple binaries can cause some confusion - some users try to run chocolate-doom with hexen.wad, thinking it is supported. Add a startup check that makes sure the user is not trying to start the game using the wrong IWAD file for the binary being run. This fixes #382.
2014-04-01Replace all snprintf() calls with M_snprintf().Simon Howard
The Windows API has an _snprintf function that is not the same as Unix's snprintf(): if the string is truncated then no trailing NUL character is appended. This makes the function unsafe. Define a replacement/wrapper called M_snprintf that works the same but always appends a trailing NUL, for safety on Windows and other OSes that behave like this. Do the same thing for vsnprintf(), and update HACKING to list snprintf/vsnprintf as forbidden functions. This fixes #375; thanks to Quasar for pointing out the different behavior of these functions.
2014-03-30Eliminate some uses of sprintf() from common code.Simon Howard
As part of this, add DIR_SEPARATOR_S as a string version of the DIR_SEPARATOR macro. Change M_TempFile() to return a string allocated on the C heap rather than the zone heap. This is a first step towards fixing #371.
2014-03-29Fix erroneous call to M_StringJoinSimon Howard
2014-03-29misc: Add string utility functions.Simon Howard
It's more readable to write "M_StringEndsWith(..." than doing a bunch of pointer arithmetic, and this is a common pattern. Also add M_StringStartsWith, M_StringJoin and M_StringCopy. The latter is a safe alternative for strcpy() that works the same as OpenBSD's strlcpy(). Use these functions in a few places where it makes sense.
2014-03-26Fix typos in config API usageFabian Greffrath
2014-03-25Set GUS patch path variable using D_SetVariable.Simon Howard
commit 42faefce1fd03 added code to set the GUS patch path automatically when the BFG Edition is installed, but this caused problems because gusconf.c is not included as part of the build for the setup tool. Use D_SetVariable() instead which accomplishes the same thing without a hard dependency.
2014-03-23Autodetect GUS patches installed with BFG Edition.Simon Howard
Doom 3: BFG Edition installs copies of the GUS instrument files (patches) that can be used for the GUS pseudo-emulation. Detect these on startup if no GUS patch path has been configured and configure gus_patch_path config variable automatically. This fixes #333.
2014-01-19doom: Add support for Freedoom IWAD names.Simon Howard
Freedoom has new IWAD names. Support these as fallbacks if no other IWAD file can be found, but prefer FreeDM as it has Vanilla- compatible levels. Show a warning on startup if running using the main Freedoom IWADs.
2013-11-06Add Steam IWAD path for Hexen Deathkings WAD (thanks chungy).Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2745
2013-11-02Add default DOS installer paths for Heretic, Hexen and Strife to IWADSimon Howard
detection code (thanks chungy). Subversion-branch: /branches/v2-branch Subversion-revision: 2741
2013-10-15Fix accidental string concatenation that broke Steam Heretic IWADSimon Howard
detection (thanks Dragonsbrethren). Subversion-branch: /branches/v2-branch Subversion-revision: 2711
2013-08-17Fix IWAD registry locations when using 64-bit Windows. Change importedSimon Howard
from Odamex r4128 (thanks AlexMax). Subversion-branch: /branches/v2-branch Subversion-revision: 2618
2013-08-11Remove Windows CE support.Simon Howard
What support exists is for obsolete devices I no longer possess; I've never been contacted about the port and it's been several years since I even bothered to build a new version. All the extra overrides are clutter that can just be removed. Subversion-branch: /branches/v2-branch Subversion-revision: 2615
2012-12-14Merge from trunk.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2546
2012-11-12Fix registry handles not being closed (thanks Quasar).Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2540
2012-10-28Merge from trunk.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2537
2012-10-23Add Steam path for Doom 3: BFG Edition IWAD path (thanks Gez for theSimon Howard
information). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2529
2011-09-24Oops.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2393
2011-09-20Add dedicated pack_chex and pack_hacx values for the Chex Quest and HacxSimon Howard
IWADs. Subversion-branch: /branches/v2-branch Subversion-revision: 2390
2011-09-20Display a warning message when trying to join a server playing a gameSimon Howard
that we don't have the IWAD for. Subversion-branch: /branches/v2-branch Subversion-revision: 2389
2011-09-11Merge from raven-branch.Simon Howard
Subversion-branch: /branches/strife-branch Subversion-revision: 2367
2011-09-11Oops.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 2366
2011-09-11Merge from trunk.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 2365
2011-09-05Refactor savegamedir calculation code to work the same as trunk.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 2360
2011-08-29Fix bug with detection of IWAD type by filename (thanks mether).Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2359
2011-02-12Merge from raven-branch. FEATURE_MULTIPLAYER has been disabledSimon Howard
temporarily until the netgame changes on raven-branch are finished. Subversion-branch: /branches/strife-branch Subversion-revision: 2259
2011-02-12Merge from trunk.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 2258
2010-12-18Add a M_CheckParmWithArgs function, that behaves like M_CheckParm butSimon Howard
also checks that extra options were provided on the command line (thanks Sander van Dijk). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2223
2010-12-10Merge from trunk. This is slightly out of date as I did the mergeSimon Howard
several days ago. Subversion-branch: /branches/raven-branch Subversion-revision: 2212
2010-11-30Add support for HACX v1.2 IWAD file.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2176
2010-09-11Added code (some possibly temporary?) to load voices.wad. Fixed severalJames Haley
problems with playing of voice sounds - especially had to add a dynamic hashtable of voice sfxinfo_t's because Choco won't tolerate overwriting them once they've been used (see channel_playing array in i_sdlsound.c) - PROBLEM: Random Z_Malloc failures when trying to play sounds. Cannot catch in debugger so far. Subversion-branch: /branches/strife-branch Subversion-revision: 2065
2010-02-06Merge from trunk.Simon Howard
Subversion-branch: /branches/strife-branch Subversion-revision: 1849
2010-02-05Merge from trunk.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1845
2010-01-26Merge from raven-branchJames Haley
Subversion-branch: /branches/strife-branch Subversion-revision: 1825
2009-12-27Oops.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1767
2009-12-27Allow DOOMWADDIR/DOOMWADPATH to contain the complete path to IWAD files,Simon Howard
as well as directories in which to search for IWAD files. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1766
2009-11-21Merge from trunk.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1737
2009-09-30Change British English spellings to American English, for consistency.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1699
2009-07-12Add strife1.wad to IWAD search list.Simon Howard
Subversion-branch: /branches/strife-branch Subversion-revision: 1623
2009-06-09Merge from trunk.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1579
2009-06-07Add IWAD search dirs for Windows CE.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1565
2009-06-06Don't check for Steam/CD installer versions on Windows CE.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1552
2009-05-10Use the internal IWAD search for the setup multiplayer dialogs ratherSimon Howard
than the -findiwads command line hack. Subversion-branch: /branches/raven-branch Subversion-revision: 1516
2009-01-07Create the ~/.chocolate-doom/savegames directory on startup if it doesSimon Howard
not exist. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1426