Age | Commit message (Collapse) | Author |
|
|
|
This fixes the following two warnings
cast from pointer to integer of different size
cast to pointer from integer of different size
by either changing some ints that are supposed to hold pointers
to intptr_t type or by intermediate casting to (intptr_t).
|
|
When using the -playdemo parameter, we support a convenience feature
where the .lmp extension is not appended if it is already part of the
filename. This makes tab completion much nicer. But if the .lmp file
has a filename that is in all-caps (.LMP) we were still appending the
extension because the check was case sensitive. Change the check to
be case insensitive.
This fixes #501 (thanks Ioan Chera).
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
The st_stuff.c status bar code passes pointer to an entry in
weaponowned[] as an int pointer, but weaponowned[] is an array
of booleans and booleans are not always represented as 32-bit ints.
Remove the (int *) cast and ensure correct behavior.
This fixes the immediate issue in #509 (thanks floppes).
|
|
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.
|
|
|
|
This reverts commit 12ecb4550e46ffdc28248be185738a88be033afd.
|
|
* Grid is not supported and gives no such message
* Spot marking behavior is substantially different
|
|
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.
|
|
|
|
during the initialization instead of a hard-coded diversion in the
options menu itself
|
|
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.
|
|
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.
|
|
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).
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
- 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
|
|
|
|
This fixes conflicting array sizes for the variable "spechit" as
reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748393.
Fixes #414
|
|
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.
|
|
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).
|
|
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.
|
|
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.
|
|
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.
|
|
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).
|
|
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.
|
|
Use snprintf() or other functions in place of sprintf(). This is part
of fixing #371.
|
|
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.
|
|
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.
|
|
Eliminate use of strcpy, strcat, strncpy, and use the new safe
alternatives.
|
|
Just as M_StringCopy behaves the same as strlcpy(), M_StringConcat
behaves the same as strlcat(). Use this in one location.
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
Add -gameversion options for v1.666, v1.7, v1.8. Set demo and savegame
headers appropriately depending on version. Also add an enum entry for
Doom v1.2 but no code support for it yet.
|
|
A deathmatch player spawning facing directly west does not see the
normal teleport fog (or hear it). This is because of an angle that
should be unsigned but is actually signed. Import PrBoom's code to
emulate this bug. This fixes #186.
|
|
Print a warning if the user is attempting to record or playback a demo o...
|