summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
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-10-24strife: Allow inventory items > 255.Simon Howard
The 'inventory' field in ticcmd structures can refer to inventory values greater than the 8-bit range, so this needs to be transferred over the network as at least a 16-bit value in order to avoid network desyncs. This fixes #454 (thanks Quasar).
2014-10-24Proceed by pressing enter at netgame warning screen.Simon Howard
If there's some discrepancy between clients who are to play a game together, a warning dialog is displayed. To acknowledge this message and proceed, make the user press enter, not escape, which is counter-intuitive. This fixes #453 (thanks Alexandre-Xavier).
2014-10-24Ignore metadata loop tags if both are zero.Simon Howard
If LOOP_START and LOOP_END are both set to zero, ignore them. This is consistent with other source ports.
2014-10-24Ignore loop tags on non-looping substitute tracks.Simon Howard
If a substitute music track is played in a non-looping configuration (eg. the title screen music), ignore loop tags in the file to be consistent with other source ports. This fixes a bug that was discussed on #245.
2014-10-24Fix 4: Changing player name on local clientJames Haley
Totally left out one of the two sprintf calls found in HU_Responder which is responsible for setting the player's name on the consoleplayer node (other nodes receive it through the chat system).
2014-10-24Upstream fix 3James Haley
Propagation of allegiance from teleport beacons to rebels missing; verfied positioning of missing assignment against disassembly.
2014-10-24Upstream fix 2James Haley
Incorrect field being used to retrieve player names during deathmatch for "%s killed %s" msg; changed to match disassembly.
2014-10-24Upstream fix 1James Haley
Same fix applied to wp_torpedo selection in P_PlayerThink must also be applied to weapon rotation code in g_game
2014-10-21Merge pull request #447 from chungy/masterSimon Howard
allow -geometry to specify fullscreen or windowed modes, like PrBoom
2014-10-21Merge branch 'master' of github.com:chocolate-doom/chocolate-doomSimon Howard
2014-10-21bfgedition: remap menu graphics by means of DEH_AddStringReplacement()Fabian Greffrath
during the initialization instead of a hard-coded diversion in the options menu itself
2014-10-21doom: Add -pack parameter to specify mission pack.Simon Howard
The main purpose for this parameter is to allow mods made for the Final Doom IWADs to be played properly with Freedoom. Chocolate Doom detects mission packs (pack_tnt/pack_plut) based on the file name. However, the Freedoom: Phase 2 IWAD contains the textures for all three Doom2-format IWADs, so can be used to play MegaWADs like Plutonia 2 that were designed to be played with plutonia.wad. Because mission pack detection is done based on filename, freedoom2.wad is handled the same as doom2.wad (a sensible default). But this means that when playing using a mod like Plutonia 2, the wrong level name is shown on the automap screen (along with eg. intermission text). To fix this we need a way to manually override the mission pack. -pack allows this to be done. It's kind of tedious that this has to be done manually but at least it can be done. Thanks chungy for the bug report/suggestion. This fixes #449.
2014-10-19doom: Write -cdrom savegames to c:\doomdata.Simon Howard
When using the -cdrom command line parameter (does anyone still use that?), savegames should be written to c:\doomdata to properly reproduce Vanilla behavior. These were being incorrectly written to c:\doomdata\savegames\foo.wad instead. This fixes #175. Thanks Alexandre-Xavier.
2014-10-19i_video: fix an if condition in my previous commitMike Swanson
`else if (f == 'w')` doesn't really secure itself against uninitialized memory, it still needs to test that `s == 3`.
2014-10-19allow -geometry to specify fullscreen or windowed modes, like PrBoomMike Swanson
This allows strings like "640x480w" to cause the engine to run in a window, while strings like "1280x800f" cause the engine to run in fullscreen mode. This is inspired by the behavior of the PrBoom -geometry parameter.
2014-10-19doom: Add game names for Freedoom IWADs.Simon Howard
When playing using one of the Freedoom IWADs, set the gamedescription string to be the full title of the IWAD being played, rather than showing "Ultimate Doom" or "Doom II: Hell on Earth" etc. This fixes #446 (thanks chungy).
2014-10-18Fix dehacked patch loading order.Simon Howard
The order in which we load dehacked patches is important. Change the order so that IWAD dehacked patches are loaded before any others, and so if, for example, we're playing with Freedoom, the Freedoom string replacements can be overridden by those from extra mods we're playing with. As part of this, ditch DEH_Init() and use DEH_ParseCommandLine() instead to handle the -deh option. Remove the DEH_Init() message from startup and show messages about dehacked patches that we load with the WAD files that we load.
2014-10-18dehacked: Allow override of string replacements.Simon Howard
If loading two dehacked patches and both replace the same string, the second replacement should override the first. Change the API function DEH_AddStringReplacement so that the from_text and to_text are implicitly duplicated, and we can free to_text and replace it later if we subsequently change it to something else.
2014-10-18doom: Refactor IWAD dehacked patch loading.Simon Howard
As per suggestions from Fabian Greffrath: * Change -noiwaddeh to -nodeh for consistency with other source ports (Boom-derived source ports use this to disable loading of DEHACKED lumps). * Extend the parameter so that it also disables loading of the Chex Quest dehacked patch. * Refactor the code for loading IWAD dehacked patches to all be in a single function.
2014-10-17doom: Add -noiwaddeh command line parameter.Simon Howard
Both the Freedoom IWADs and the rereleased HACX IWAD contain embedded DEHACKED lumps that are automatically loaded on startup. However, there may be some situations where it is undesirable to load these patches - when loading certain mods such as BTSX, for example. For these cases, allow the user to override the default behavior with a command line parameter.
2014-10-17Call SDL_Quit() on exitBrad Harding
Hopefully this may fix issue where exe very occasionally continues to run in background after exit. See chocolate-doom/chocolate-doom#408. Conflicts: src/i_system.c
2014-10-16Fix crash caused by adding a new WAD file.Simon Howard
This fixes #442, a crash caused by adding a new WAD file after a lump has been loaded (and cached) from a previous WAD. This manifested when playing using the Freedoom IWADs and also loading a PWAD at the same time. The Freedoom IWADs have DEHACKED lumps that are loaded from within the IWAD file. The ultimate cause (thanks to Fabian Greffrath for uncovering it) is that lumpinfo is realloc()ed after each new WAD load to store the lumpinfo_t structures from the new WAD. If a lump has been read and cached from a previous WAD file, it may end up having an invalid 'user' pointer that points to somewhere in the old lumpinfo[] array, not the new one. I think this bug was masked because realloc() will often not move data if the previous location can simply be extended. The bug was discovered when loading BTSX as a PWAD, probably because it's a large WAD that contains a lot of lumps, and forced a move during realloc.
2014-10-14Fix OPL MIDI tempo calculations.Simon Howard
It turns out that the way that tempo has been calculated in OPL playback has been broken for a long time. The mysterious "fudge factor" that I had to apply to tempo calculations is actually completely unnecessary: the byte-swapping in the MIDI_GetFileTimeDivision() function was being done wrong, so the time division being used by the OPL MIDI code was completely wrong. Presumably the multiply by 260 was close enough to an 8-bit bitshift that it worked okayish, but large enough time division values would overflow a single byte and screw up. This fixes long-running OPL playback problems in a number of WADs, most notably Alien Vendetta. This *really* fixes #352.
2014-10-08Allow -warp to episodes beyond episode 4.Simon Howard
Vanilla Doom's -warp parameter allows warping to episodes beyond E4. This didn't work in Chocolate Doom because of some changes made to the G_InitNew code before the source release. Actual decompilation of that function in Vanilla Doom shows that the episode/map sanity checking is not present: http://pastie.org/8140437 There is at least one known WAD (2002ado) that has a map on E5M1 that is playable in Vanilla, and this stops that map from being possible to play. Comment out that code because it obviously doesn't deserve to be there. This fixes #426. Thanks plumsinus.
2014-10-08Disable -oldsync startup message.Simon Howard
A message is printed if you are playing a game using the old sync code, which could put you at a disadvantage compared to other players. Disable this message for now as we're defaulting to old sync for the time being.
2014-10-08Use old network sync code by default.Simon Howard
The new netgame client sync code has the potential to be much better than the original sync code. However, it currently has a buggy controller and needs revisiting and overhauling (#358). For the time being, switch back to the old sync code by default and allow the new code to be enabled using the -newsync parameter (replacing the -oldsync parameter).
2014-10-08midi: Fix "D_DDTBLU disease".Simon Howard
The Doom II MAP14/MAP20 music has a hanging note at the end of the track that is never turned off. If this is not reset when the track loops, there is a continuous (and annoying) drone sound throughout the next iteration of the song. Some information is here: http://www.doomworld.com/vb/source-ports/66802-the-d-ddtblu-disease/ This changes the mus2mid code to generate an "all notes off" controller event at the start of the MIDI track. This is specifically done at the start and not the end of the track because otherwise the looping of tracks like D_RUNNING is affected. Thanks to a whole host of people for help on this: @plumsinus for reporting the bug, @bradharding for devising a fix as part of Doom Retro, and Quasar for feedback and his own fix to the Eternity Engine. This fixes #412.
2014-10-07Allow multiple substitute mappings for music tracks.Simon Howard
For the Hexen substitute mapping configuration file, it's desirable to be able to include two mappings for each music lump: a straight high quality recording of that lump, and the recording that was included on the Hexen CD audio tracks. So allow multiple mappings so that we can fall back to try other filenames if the first choice file doesn't appear to exist.
2014-10-06terminate the destination string in M_StringReplace()Fabian Greffrath
fixes #428
2014-10-01Merge branch 'master' of github.com:chocolate-doom/chocolate-doomSimon Howard
2014-10-01hexen: Add workaround for Mac Hexen IWAD.Simon Howard
The Mac version of hexen.wad is slightly different from the normal DOS one: it contains a bunch of extra lumps but more importantly, the GENMIDI and DMXGUS lumps are missing. This means that Chocolate Hexen would crash on startup with the default settings (as OPL is the default music output). To work around this problem and allow the game to start up properly, detect if the required lump is missing and adjust the music settings, printing a helpful message to stdout to inform the user.
2014-09-24Upstream fix to torpedo weapon changingJames Haley
Use of the wrong enum value as an index into weaponinfo left the torpedo's selectability accidentally relying on you having 30 or more rockets instead of cells. Verified against binary as a choco error.
2014-09-19Upstream fixes to stair building issuesJames Haley
First sector moved instantly for buildDown16 stairs due to neglect of using direction instead of constant 1. Also found that Strife clears the tag of the first stair sector.
2014-09-18Upstream bug fix to teleport beacon allegianceJames Haley
Was not propagating properly from player to beacon to rebels due to mistranslated assembly code; access to wrong structure.
2014-09-15deh_main.c: fix "warning: implicit declaration of function ‘I_Error’"Fabian Greffrath
2014-09-13Add vld_ prefix for vldoor_e enum values.Simon Howard
It was pointed out to me recently that vldoor_e has enum values named 'open' and 'close'. These can potentially conflict with POSIX standard functions that have the same names, if the right header files are included. This doesn't currently cause any problems. However, to avoid any possibility of a conflict occurring if a different compiler is used, add a vld_ prefix to all the enum values, to namespace them.
2014-09-13dehacked: Load Freedoom DEHACKED lump on startup.Simon Howard
If using one of the Freedoom IWADs, detect it by checking for the FREEDOOM lump, and then load its DEHACKED lump to apply the cosmetic string changes that it includes. In case we're using an old version of one of the Freedoom IWADs, don't bomb out with an error while parsing the DEHACKED lump.
2014-09-13dehacked: Set stricter scoping for magic comments.Simon Howard
Magic comments allow some of the Vanilla limits to be overridden, but they should only apply to the files in which they were defined. Reset the flag variables that control these overrides before every new Dehacked file is parsed, so that a flag set in one file cannot spill over into other files that are parsed subsequently.
2014-09-13dehacked: Fix BEX string expansions.Simon Howard
The Dehacked code must pass a special flag to DEH_ReadLine() when parsing the [STRINGS] section, so that lines can be escaped onto following lines. However, this flag value was calculated incorrectly. The BEX [STRINGS] section cannot be looked up at the start of parsing a Dehacked file, because GetSectionByName() will return NULL for it (extended strings are not available yet). Instead, simplify the logic to look at the name of the current section and check that way.
2014-09-11simplify and generalize deh_allow_extended_strings usageFabian Greffrath
2014-09-11improvements to the [STRINGS] section parserFabian Greffrath
- restructure DEH_ReadLine() to avoid use of "goto" - bex_string_t type name ends in "_t" - declare constant table as "static const" - add magic comment *allow-extended-strings* and corresponding variable deh_allow_extended_strings - fix logical error when no [STRINGS] section is registered to which corrent_section could be compared
2014-09-08add parser for [STRINGS] sections in BEX filesFabian Greffrath
2014-08-24setup: Add gamepad config for Buffalo Classic Gamepad.Simon Howard
The Buffalo Classic USB Gamepad is a USB gamepad that resembles the classic SNES controller. Thansk to Fabian Greffrath for sending in the report.
2014-08-18setup: Add config for Multilaser JS030 gamepad.Simon Howard
Thanks to "Absolute Zero" for the report with the gamepad settings.
2014-08-17Merge branch 'master' of github.com:chocolate-doom/chocolate-doomSimon Howard
2014-08-17setup: Add gamepad config for XBOX One controller.Simon Howard
The XBOX One controller apparently appears identical to the Xbox 360 controller. Thanks Brad Harding.
2014-08-16Fix finding of voices.wad when -iwad is only hintJames Haley
Somebody broke this by using sizeof() on a malloc'd char *
2014-08-16Warning fixes (23 remain...)James Haley
2014-08-13Merge branch 'master' of github.com:chocolate-doom/chocolate-doomSimon Howard