summaryrefslogtreecommitdiff
path: root/src/heretic
AgeCommit message (Collapse)Author
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-10Add missing #includes.Simon Howard
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-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.
2015-02-20Fix game code that makes false boolean assumptions.Simon Howard
Various bits of code assume that booleans are represented as 32-bit ints and that they can be assigned to from 32-bit values. This isn't true on all systems; fix code that does this to convert to boolean values properly. This is more progress towards fixing #509.
2015-01-19Add extra checks to weapon cycling loops.Simon Howard
Ensure that the loops to find the next weapon always terminate - even if there are somehow no weapons equipped. Also, only ever do weapon cycling when in the GS_LEVEL gamestate. This fixes #503 - thanks to Fabian and raithe on Doomworld.
2014-12-29add missing includes for calling SHORT() in HereticFabian Greffrath
fixes #497
2014-12-29Merge pull request #493 from derek57/patch-3Fabian Greffrath
No. 2: even more endianness fixes by myself (Ronald Lasmanowicz)
2014-12-29Merge pull request #492 from derek57/patch-2Fabian Greffrath
No. 1: even more endianness fixes by myself (Ronald Lasmanowicz)
2014-12-26allow building in subdirectory or outside source directoryDave Murphy
2014-12-22even more endianness fixes by myself (Ronald Lasmanowicz)derek57
I figured this out while porting Chocolate to the Nintendo Wii and also had to change these lines of code.
2014-12-22even more endianness fixes by myself (Ronald Lasmanowicz)derek57
I figured this out while porting Chocolate to the Nintendo Wii and also had to change these lines of code.
2014-12-18fix some more endianess issues with the width fields in patch_t structsFabian Greffrath
as pointed out necessary by Ronald Lasmanowicz for his Wii ports
2014-12-18fix a bug that causes monsters to become partly invisibleFabian Greffrath
when walking inside liquids like water -- on big-endian systems Originally reported by Ronald Lasmanowicz and fixed in his wii-hexen port: https://code.google.com/p/wii-hexen/source/detail?r=17
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-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-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-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-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-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-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-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-30heretic: Eliminate use of sprintf().Simon Howard
Use snprintf() in place of sprintf(). This is part of fixing #371.
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-29heretic: Eliminate use of unsafe string functions.Simon Howard
Eliminate use of strcpy, strcat, strncpy, and use the new safe alternatives.
2014-03-24Fix various Clang compiler warnings.Simon Howard
2014-03-23Rearrange order of SDL sound startup.Simon Howard
Initialize low-level sound startup (calls to I_InitSound) separately from the high-level sound startup (S_Init). In particular, make sure that SDL sound is initialized before the textscreen multiplayer waiting screen is shown. This is an attempt to fix a bug with sound in multiplayer games on Windows; calling SDL_QuitSubSystem(SDL_INIT_VIDEO) (on closedown of the textscreen library) causes subsequent attempts to initialize audio to fail. Big thanks go to Alexandre-Xavier (AXDOOMER) for working out a fix for this bug and James Haley (Quasar) for giving some technical background about the lack of separation between SDL subsystems. This (hopefully) fixes #270.
2014-03-23Set default for key_menu_screenshot to 0.Simon Howard
In #364 I recommended -1 as the default to avoid taking screenshots in some situations where a key event is posted for key 0. It turns out that wasn't such a great idea, as -1 is not parsed properly by the config parser, and is shown as ??-1 in the setup tool. Default to zero instead, and add guards to prevent screenshots being taken by mistake. Thanks to Alexandre-Xavier for pointing this out.
2014-03-23heretic/hexen: Fix -timedemo.Simon Howard
The -timedemo flag is broken in Vanilla Heretic/Hexen, as not all fields are read from the demo headers. Fix it, as there's no utility in having it nonfunctional and plenty of utility in having it functional. This fixes #300.
2014-03-22heretic/hexen: Fix automap background scrolling.Simon Howard
There was a bug where it was possible to keep moving the background when the boundaries of the map were reached. This is because the code to move the background was done in calls to AM_Drawer(), which is fundamentally a bad idea. Some old commented-out code shows that this was previously done in AM_Drawer (same location that scrolls the map itself), but it was moved. Move it back. Thanks to Chris Fielder for the bug report; this fixes #321.
2014-03-18Add a dedicated key for taking screenshots.Fabian Greffrath
2014-03-17Allow for PNG screenshots.Fabian Greffrath
2014-03-16heretic/hexen: Fix pause key remapping.Simon Howard
Heretic and Hexen had the pause key hard-coded to KEY_PAUSE when they should actually use key_pause so that they can be remapped by the user. Thanks to Fabian Greffrath for the bug report (fixes #337).
2014-03-16heretic: Fix plat_t read when loading savegames.Simon Howard
The fix-up of the thinker function was (unnecessarily) guarded by an if() condition that meant it was not being reset properly on load. This caused moving platforms to be not restored properly when loading savegames. Fixes #343. Thanks to romeroyakovlev for the bug report.
2013-12-28heretic: fix automap panning leftChris Fielder
When follow mode is off, hitting left would cause it to scroll all the way to the west of the map without stopping.
2013-12-23heretic, hexen: Fix mouse (and joystick) weapon cycling.svdijk
Implement this the same way it is implemented for doom and strife.
2013-11-28Fix Heretic demo desync caused by r1228 (thanks marineController).Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2755
2013-11-17Remove KEY_RSHIFT special-casing from Heretic/Hexen menu code to fixSimon Howard
crashes when pressing shift while entering save game names (thanks chungy). Subversion-branch: /branches/v2-branch Subversion-revision: 2750
2013-10-26Don't crash Heretic in A_SkullPop() if a player is gibbed and respawnsSimon Howard
before the head separates from the body (thanks Tumlee). Subversion-branch: /branches/v2-branch Subversion-revision: 2720
2013-10-23When loading Heretic savegames, NULL out certain special values whichSimon Howard
hold pointers to other mobj_t objects that will no longer be valid. Subversion-branch: /branches/v2-branch Subversion-revision: 2718
2013-10-15Remove gamemission variables for Heretic and Hexen and hard-code to theSimon Howard
appropriate values. Subversion-branch: /branches/v2-branch Subversion-revision: 2708
2013-10-12Tweak mouse grab behavior: don't arbitrarily warp the mouse at gameSimon Howard
startup. Subversion-branch: /branches/v2-branch Subversion-revision: 2699
2013-10-08Set window title/icon for Heretic/Hexen startup windows, to match theSimon Howard
main game window. Subversion-branch: /branches/v2-branch Subversion-revision: 2696
2013-09-27Translate HHE thing numbers according to patch exe version number, asSimon Howard
our mobjinfo table contains an extra entry. Subversion-branch: /branches/v2-branch Subversion-revision: 2688
2013-09-27Fix comments: HHE, not Dehacked.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2687
2013-09-27Map thing type and state table indexes to those used by Vanilla HereticSimon Howard
v1.3, for savegame compatibility. Subversion-branch: /branches/v2-branch Subversion-revision: 2686
2013-09-27Use portable functions for reading/writing sector effect thinkerSimon Howard
structures. Subversion-branch: /branches/v2-branch Subversion-revision: 2685