summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2014-04-29setup: Detect and ignore bad joystick axes.Simon Howard
In some cases a joystick axis can be "stuck" and have a large uncentered value. These must be detected and ignored, otherwise the axis can be chosen during calibration instead of the user's actual desired axis.
2014-04-29setup: Allow backspace or del to clear controls.Simon Howard
Backspace or delete clears other input boxes; make it do the same for keyboard, mouse and joystick inputs.
2014-04-29hexen: Fix joystick strafe left/right buttons.Simon Howard
Hexen was missing the code to handle the strafe left/right buttons.
2014-04-28setup: Detect and configure hat-based D-pads.Simon Howard
As a second fallback, if all joysticks are centered and no buttons are pressed, look at the hats on the joystick to see if one of those is uncentered. Bizarre as it seems, some gamepads actually present the D-pad as a hat.
2014-04-28joystick: Add "hat axis" support.Simon Howard
Just as some controllers have D-pads that are presented as a set of buttons, some other controllers actually present their D-pads as joystick hats. Add "hat axis" support where the hat number and axis can be packed into a single integer value.
2014-04-28joystick: Increase 'dead zone' size.Simon Howard
The joystick dead zone is the range within which the joystick is interpreted as being centered. Increase this range significantly, as some controllers (eg. the PS2 controller + USB connector) can be very sensitive, leading to the player spinning randomly even when the stick is centered.
2014-04-28setup: Add support for button axis calibration.Simon Howard
Detect when we need to configure a "button axis" by falling back to buttons when none of the joystick axes are significantly outside of the centered range. Add extra calibration stages to get the D-pad buttons for right and down in these cases.
2014-04-28joystick: Add support for "button axes".Simon Howard
Some gamepads, notably the PS3 SIXAXIS controller, provide the D-pad not as a pair of axes, but rather as four separate buttons. Define a special axis numbering scheme that packs two button numbers into a single number, and allow an axis to be defined this way.
2014-04-27music: Add loop point Ogg/Flac metadata support.Simon Howard
ZDoom has defined a format for Vorbis metadata comments named LOOP_START and LOOP_END that allow the start and end points to be defined in .ogg and .flac files for looping music. Add support for these (they are used in Brandon Blume's SC-55 recordings).
2014-04-22Fix a segfault in i_sdlmusic.cFabian Greffrath
We are free()ing the const char* a few lines later.
2014-04-19server: Fix sending of WAD/DEH checksums to clients.Simon Howard
Clients receive the WAD and dehacked checksums of the controlling player and are supposed to display a warning at the startup screen if they do not match. However, reversed logic in the code that sends the waiting data to clients meant that they were always sent their own checksums, so the error message was never displayed. This fixes #384.
2014-04-19setup: Make iwad_t pointers const.Simon Howard
The table of IWAD data is stored in const memory, so make all iwad_t pointers const to fix compiler warnings.
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-19setup: Change labelling to clarify gamepad support.Simon Howard
Vanilla Doom's setup.exe only made reference to "joysticks" as back then gamepads were relatively uncommon for PCs and ports for game controllers canonically known as "joystick ports". Nowadays it's far more likely (and ergonomic) that the player will be using a gamepad than a joystick. Change the labelling to refer to "Gamepad/Joystick" or "controller" instead.
2014-04-19joystick: Add joystick button to toggle menu.Simon Howard
When using a joystick or gamepad it's nice to be able to bring up the menu without having to reach for the keyboard. This makes modern gamepads more useful/usable.
2014-04-19joystick: Add an axis to allow strafing.Simon Howard
Modern gamepads typically have 2-3 D-pads and joysticks. This means that it's desirable to be able to use one joystick for turning and another for strafing. Add another axis in addition to the current X and y axes that performs strafe movement.
2014-04-13setup: Call TXT_Shutdown on exit.Simon Howard
Some systems (fbcon SDL driver) get messed up if not cleanly shut down. Make sure that we call SDL_QuitSubsystem on shutdown.
2014-04-12music: Fix -dumpsubstconfig for Heretic/Hexen.Simon Howard
The config dumping command line option assumed that music lumps were named like D_MYLUMP, but this is not the case for Heretic and Hexen, where there is no D_ prefix and music lumps can have any name. Change the logic to instead look at the contents of lumps and identify music lumps from the MUS / MIDI header.
2014-04-12video: Change default for screen_bpp to 0.Simon Howard
Some machines don't work well with 8-bit screen depths any more. It's better to default to just using the machine's native color depth instead. Change the default to 0 (for SDL_SetVideoMode this means "use native color depth"), auto-adjust to native color depth on startup if screen_bpp=0 (so that debug messages at least make sense) and document for the config file value that a value of zero means "use native".
2014-04-12net: Add -nodes command line argument.Simon Howard
This matches the -nodes parameter that ipxsetup has; interpret it as an "auto-start" parameter that launches the game when the intended number of clients have joined the server.
2014-04-12hexen: Create HR (startup) screen at native bpp.Simon Howard
Always call SDL_SetVideoMode() with bpp=0 to use the native pixel depth of the display. This avoids problems with some systems that don't properly support 8-bit screen modes any more. Draw into an intermediate buffer and let SDL take care of the pixel depth conversion for us.
2014-04-10setup: Save selected game when browsing menus.Simon Howard
Once a game type (IWAD) has been selected, remember that selection rather than resetting to the first item in the list when the window is closed and reopened. This fixes #169 (thanks Alexandre Xavier).
2014-04-10doom: Allow warp up to MAP40 to match Vanilla.Simon Howard
Vanilla Doom allows warp with the IDCLEV cheat up to MAP40, though it normally crashes. Match this behavior and set MAP40 as the maximum rather than MAP34. This fixes #181 (thanks Alexandre Xavier).
2014-04-10midifile: Fix portability issue with malloc(0).Simon Howard
In the C standards, malloc(0) may return NULL without indicating a failure to allocate. As values read from the MIDI file may be arbitrary, add one to the allocated length so that we always allocated a positive value. This fixes #165 (thanks nmain).
2014-04-10sound: Fix crash with large values of snd_channels.Simon Howard
Sanity check the handles passed to the i_sdlsound.c API functions and ignore requests that involve channel numbers higher than 15. This fixes a crash if the user sets the snd_channels config variable is set to a high value. This fixes #149 (thanks Alexandre Xavier).
2014-04-09setup: Show error when server address not entered.Simon Howard
Don't launch the game if a server address has not been entered; show a message to the user instead. This fixes #121.
2014-04-07music: Suggest using .ogg format, not .mp3.Simon Howard
Using the .mp3 extension in generated music config files carries an implicit recommendation to use that format. There are a number of reasons to prefer other formats. The biggest is that MP3 is patent encumbered. Furthermore, while FLAC and Ogg Vorbis both support the Vorbis comment format that allows metadata loop point tags to be specified.
2014-04-05music: Minor tweaks to substitute music code.Simon Howard
Use appropriate directory separator for OS when generating config file paths. When generating config files, include a header line that indicates what is being assigned.
2014-04-05music: First code for HQ music substitution.Simon Howard
This adds support for high quality music packs that replace Doom's built-in MIDI music with digital recordings. In particular this allows recordings of the Roland SC-55 to be used in Chocolate Doom. This is the first essential step for bug #245.
2014-04-05setup: Add missing argument to M_StringJoin.Simon Howard
Last argument to M_StringJoin needs to be NULL.
2014-04-05setup: Adjust positioning of sound dialog.Simon Howard
When configuring Chocolate Strife the sound dialog can become quite tall, and the dialog is visibly uncentered vertically. Move it up slightly to counterbalance it.
2014-04-03deh_main.c: Fix bogus check in DEH_ParseAssignment()Fabian Greffrath
The function would return false on lines without a '=' character, but only if that character is at least the third one on the line. :) Closes #376
2014-04-01misc: Fix safe vsnprintf() function.Simon Howard
An off-by-one error in the function caused the strings to be truncated one character too early. Change the return value check so that negative values are also interpreted as indicating truncation; this is the behavior of the Win32 API.
2014-04-01misc: Tweak safe string functions slightly.Simon Howard
Properly handle cases where a very small string buffer is specified.
2014-04-01textscreen: Use safe string functions.Simon Howard
Define TXT_{StringCopy,StringConcat,snprintf,vsnprintf} as analogs of the m_misc.c versions so that the textscreen library does not need a dependency on the Doom code, and change all textscreen code to use these instead of unsafe functions. This fixes #372.
2014-04-01setup: Eliminate use of sprintf().Simon Howard
Use M_snprintf() or M_StringJoin() instead where appropriate. This fixes #371.
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-31strife: Add missing NULL to M_StringJoin call.Simon Howard
2014-03-31Fix typo in src/strife/p_saveg.cFabian Greffrath
2014-03-30sound: Fix compile when using libsamplerate.Simon Howard
The change in commit 62b5c6028.. broke the compile.
2014-03-30strife: Eliminate use of sprintf().Simon Howard
Use snprintf() in place of sprintf(). This is part of fixing #371.
2014-03-30hexen: Eliminate use of sprintf().Simon Howard
Use snprintf() in place of sprintf(). This is part of fixing #371.
2014-03-30heretic: Eliminate use of sprintf().Simon Howard
Use snprintf() in place of sprintf(). This is part of fixing #371.
2014-03-30doom: Eliminate use of sprintf().Simon Howard
Use snprintf() or other functions in place of sprintf(). This is part of fixing #371.
2014-03-30music: Free string using free() rather than Z_Free().Simon Howard
Mistake introduced in previous commit.
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-30dehacked: Eliminate some more uses of strncpy().Simon Howard
Use M_StringCopy() instead of strncpy() in the Dehacked code.
2014-03-30hexen: Make -playdemo cope with paths.Simon Howard
Vanilla Hexen makes you specify the demo name to play by giving the plain lump name, eg. heretic -playdemo mydemo to load mydemo.lmp. It doesn't work if you specify the extension or the full file path. As a convenience and to match the behavior of Chocolate Doom, allow paths and extensions. Also rework the code for other games so that they're slightly more consistent. This fixes #301.
2014-03-30heretic: Make -playdemo cope with paths.Simon Howard
Vanilla Heretic makes you specify the demo name to play by giving the plain lump name, eg. heretic -playdemo mydemo to load mydemo.lmp. It doesn't work if you specify the extension or the full file path. As a convenience and to match the behavior of Chocolate Doom, allow paths and extensions. This fixes half of #301.
2014-03-29common: Eliminate use of unsafe string functions.Simon Howard
Remove some remaining uses of strncpy() and use M_StringCopy() instead.