summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-04-28include <string.h> in z_zone.c for memset()Fabian Greffrath
2015-04-26doom: Clear origin pointer when stopping sound.Simon Howard
When an mobj_t is freed, any currently-playing sounds attached to that object are stopped, but the sound code was leaving a dangling pointer to the freed mobj_t that was flagged by the -zonescan checks.
2015-04-26zone: Add -zonescan parameter.Simon Howard
As further tooling to help debug bugs like #530, add a command line parameter that will scan the zone heap every time a block of memory is freed with Z_Free(), to detect dangling pointers to the freed block.
2015-04-26zone: Add -zonezero parameter.Simon Howard
As seen in bug #530, some of the game code can in some situations hold pointers to, and dereference, freed sections of the zone heap. Add a new command line parameter that zeroes out memory of blocks when they are freed with Z_Free(), hopefully exposing code that depends on reading freed memory.
2015-04-26Don't read currentthinker->next after Z_Free().Simon Howard
Save the next pointer in the P_RunThinkers() loop when iterating through thinkers, so that if the current thinker is freed we can still advance to the next thinker without dereferencing freed memory.
2015-04-26Merge branch 'master' of github.com:chocolate-doom/chocolate-doomSimon Howard
2015-04-26hexen: Remove m_misc.c.Simon Howard
This file is empty and contains no code, as it was factored out into the common m_misc.c during raven-branch development. The Heretic version got removed once it was empty but the Hexen one wasn't, for some reason.
2015-04-21deh: fix parsing of last lines in files without newline at EOFFabian Greffrath
Chocolate Doom fails to properly parse the last line in DEHACKED files that are missing a newline character at the end of the file (which might have been a common sickness to DOS editors). This is, because DEH_GetChar() returns -1 at EOF and DEH_ReadLine() in turn immediately returns NULL if the result of (DEH_GetChar() < 0), regardless of the content of the readbuffer. It only returns a pointer to the content of the readbuffer if DEH_GetChar() returns '\n' which is, however, impossible if there is no such character before the file ends. Now DEH_ReadLine() only returns NULL if the readbuffer is empty at the end of the file and returns a valid pointer else. Fixes #531
2015-04-15setup: Remove "enable gamepad" checkbox.Simon Howard
This control seemed redundant, as we have the control below it that selects the gamepad to use. So remove it and set the usejoystick variable automatically based on whether joystick_index has been configured to point to a valid device.
2015-04-15setup: Add joyb_jump to empty defaults.Simon Howard
When applying defaults for a particular gamepad, we must clear all the current buttons, and the jump binding wasn't on this list for some reason.
2015-04-15setup: Undo axis reversal for Gameport adapter.Simon Howard
This reverts my last change. I was testing with the Gravis Gamepad and had the switch for left-handed mode turned on and didn't realise (embarrassing!)
2015-04-13Merge branch 'master' of github.com:chocolate-doom/chocolate-doomSimon Howard
2015-04-13setup: Invert both axes for Gameport adapter.Simon Howard
Directions were backwards for both X and Y axes when testing with an original Gravis Gamepad.
2015-04-13Fix assigning structs not compiling on Visual StudioFabian Greffrath
2015-04-11Clear mouse events caused by mouse warp.Simon Howard
SDL_WarpMouse() can create mouse events that are later interpreted as user mouse input. Thanks Super6-4 for this fix.
2015-04-11Merge branch 'master' of github.com:chocolate-doom/chocolate-doomSimon Howard
2015-04-11Merge pull request #521 from chungy/xbone-padSimon Howard
setup: add support for the Xbox One controller on Linux
2015-04-11setup: Add OS X config for Gameport adapter.Simon Howard
The identified name/signature for this adapter is different under OS X. Also fix a mistake in the last commit.
2015-04-12Merge branch 'master' of https://github.com/chocolate-doom/chocolate-doomSimon Howard
2015-04-12setup: Add config for USB Gameport adapter.Simon Howard
This configuration supports the "Super Joy Box 7" USB gameport adapter, for people using old PC gameport joysticks / gamepads. The button configuration matches the original Vanilla configuration, for authenticity.
2015-04-10Strip out SDL_VERSION_ATLEAST #ifdef conditionals.Simon Howard
These were added ages ago as hacks to make the code compile with SDL2, back when SDL2 was still in development. They aren't relevant any more and aren't useful - the actual SDL2 port is proceeding on sdl2-branch.
2015-04-10Add missing #includes.Simon Howard
2015-04-04setup: Add help URLs for configuration windows.Simon Howard
The wiki now has documentation pages for most of the windows in the setup tool. Add help URLs that link to these. One other minor change here is that the warp button on the main menu had to change to F2 instead of F1, which is now the help key.
2015-04-04textscreen: Add help URL functionality for windows.Simon Howard
This adds the ability to associate a URL with a window that gives some extra information about it and the configuration options found in it.
2015-03-30Merge pull request #523 from chocolate-doom/hexndemoFabian Greffrath
Add support for the Hexen 4 Level Demo Version
2015-03-30The 4-Level Demo Version also has 3 Info pagesFabian Greffrath
2015-03-30Turn maxplayers into a global variableFabian Greffrath
... and decrease its value from MAXPLAYERS (i.e. 8) to 4 if (gamemode == shareware). It seems that it was hard-coded to this value until some time between the releases of the Demo and the Full version. Arrays are still declared with their full width of 8, though, they are just not iterated over the whole range anymore. This fixes playback of the IWAD demos.
2015-03-29textscreen: Remove screen size-based font selection.Simon Howard
This was removed on Windows a while back in favour of a more conservative approach that examined the system DPI settings, but the logic still remained for other systems and it really isn't a good idea. Remove the logic that chooses a large font on large monitors, and add a TODO comment to add proper Linux font selection in the future, based on the Gtk+ HiDPI setting.
2015-03-28net: Include port number in address strings.Simon Howard
When generating string representations of network addresses, include the UDP port number if it isn't the standard port number. This is necessary because the string version of the address is used by the setup tool when filling in the address field; if a non-standard port is used then it needs to be included. Also fix byte swapping on the address portion in the same function. Thanks to Alexandre-Xavier for the bug report on #469.
2015-03-27misc: Handle M_StringCopy() short buffer case.Simon Howard
M_StringCopy() must always be provided a buffer of at least one character long, so that a NUL character can be written. If this is not the case, return immediately and indicate that the buffer was truncated.
2015-03-27Remove old DOS source files.Simon Howard
These are leftover files that were kept around for posterity in the heretic/ and hexen/ directories, that contained system-specific DOS code used in the DOS versions of the games. There's no real reason to keep these files around any more and it's confusing having them around: some people who have tried to compile the code have mistakenly tried to include these files in compilation.
2015-03-27Avoid calling strlen() on a potentially unterminated stringFabian Greffrath
The src string may be unterminated and the call to strncpy() be terminated by reaching dest_size. Instead of calling strlen() on the src string, check if it has a NUL byte at the same position as the dest string -- if not, the string was truncated. Valgrind now gives thumbs up!
2015-03-26Add a wrapper with "void (void)" signature around G_CheckDemoStatusFabian Greffrath
This is meant to be passed over to I_AtExit() which expects an argument of void type. It thus prevents undefined behaviour because of the different signature of G_CheckDemoStatus() which is of boolean type. Fixes #519
2015-03-26Move MSVC-specific inline definition to doomtype.hFabian Greffrath
I think it fits better there and in case further inline fuctions are introduced in files other than i_scale.c, it should not be necessary to copy this definition around.
2015-03-26Merge branch 'master' of https://github.com/chocolate-doom/chocolate-doom ↵Fabian Greffrath
into hexndemo
2015-03-25setup: add support for the Xbox One controller on LinuxMike Swanson
Effectively it's a slightly re-arranged Xbox 360 controller, no major changes, so we can just use the same config as that one.
2015-03-25man: Use \- to denote dashes. Fixes #512Mike Swanson
2015-03-23play sound when trying to enter a forbidden map in the demo versionFabian Greffrath
2015-03-23maintain an explicit switch list for the demo versionFabian Greffrath
instead of interating through the list for the full version and letting missing texture lumps slip through.
2015-03-10OPL code guideline style fixkhokh2001
2015-03-09Hexen and Heretic use older DMX. Since OPL Voice Allocating algorithm ↵khokh2001
differ. This commit adds old DMX's voice allocating alogrithm for Hexen and Heretic.
2015-03-05Merge branch 'master' of https://github.com/chocolate-doom/chocolate-doomFabian Greffrath
2015-03-05Initialize floor->type and floor->crush fields in EV_BuildStairs()Fabian Greffrath
The floor->type and floor->crush fields of the floor thinkers added in EV_BuildStairs() were originally left uninitialized and thus contained random memory content. Initialize them to make sure the floor->type field does not trigger propagation of random content into the special and texture fields of the adjacent sector in T_MoveFloor(). That is, make sure its value is neither donutRaise, i.e. 11, nor lowerAndChange, i.e. 6. Also, the chances of 32 bit of random memory being "true", i.e. 0, are negligible. This is functionally equivalent to what PrBoom+ is doing. Fixes desync of mm09-512.lmp. Fixes #368.
2015-02-26Tweak HACKING style guide.Simon Howard
There was no example for how to write function calls. Do this to make clear that there should be no space between the function name and the open paren. Give examples of assignments and if() conditions as well, and tweak the for() style - there's no reason to omit spaces around operators for the looping conditions.
2015-02-23Switch pick-up messages for Chaos Device and Disc of RepulsionFabian Greffrath
For bug compatibility with the original 4-level Demo. Confirmed on map04 with the Demo version with the following md5sums: 458d3ff08d32fc50abb55a5b68660b6b HEXEN.EXE 876a5a44c7b68f04b3bb9bc7a5bd69d6 HEXEN.WAD
2015-02-22Merge branch 'master' of github.com:chocolate-doom/chocolate-doomSimon Howard
2015-02-22Fix mistaken uses of memcpy() on overlapping memory.Simon Howard
The source and destination arguments to memcpy() cannot be overlapping as this is undefined behavior. In these situations memmove() must be used instead, and OpenBSD actually throws an error if this is done. Thanks to ryan-sg for reporting this. This fixes #510.
2015-02-20Strife sound priority fixJames Haley
The Strife binary has another priority check in the first loop inside S_GetChannel. TODO: Does DOS Doom have this as well? Find out. Resolves issue #506.
2015-02-20Warning fixesJames Haley
Signed/unsigned comparison mismatches
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.