Commit graph

4336 commits

Author SHA1 Message Date
Simon Howard
847770da1e Clean up previous -version change.
A few nitpick points here.
2018-11-10 01:01:01 -05:00
Simon Howard
b88a8cdb76 net: Use -newsync by default again.
Now that the synchronization code has been improved, re-enable it
by default, remove the -newsync parameter and add back -oldsync
instead for users who want to opt out.

This fixes #358 and #489.
2018-11-10 00:58:19 -05:00
Simon Howard
94ed513e58 net: Improve -newsync to use a PID controller.
The previous -newsync code wasn't too bad but was basically a hacky
version of a PID controller. So replace this with an actual PID
controller with tuning parameters manually tuned based on an evening
of experimentation. So far this seems to be a significant improvement
over the old -newsync code.
2018-11-10 00:55:34 -05:00
Mike Swanson
b00a10ae33 Add a -version parameter like most programs have
Supports both -version and --version, even though the later breaks
the normal convention of Doom parameters, it is common enough with
any general program that it should be useful to include in this.
2018-11-08 12:17:33 -08:00
Fabian Greffrath
54500659f9
Merge pull request #1103 from mfrancis95/master
Fix memory leak related to Steam directories
2018-11-08 20:46:53 +01:00
mfrancis95
8442508444 Fix memory leak related to Steam directories 2018-11-08 13:59:48 -05:00
Fabian Greffrath
dac0cda28d i_system: mark I_Quit() and I_Error() with GCC's 'noreturn' attribute
Thanks @turol for the tip.
2018-11-06 15:43:44 +01:00
Fabian Greffrath
62571c3de6 d_iwad: fix a missing pointer indicator in a variable declaration 2018-11-06 15:26:08 +01:00
Simon Howard
602ea481c5 glob: Fix build failure.
Correctly handle failed mallocs.
2018-11-03 13:34:17 -04:00
Simon Howard
65ae592ca6 strife: Add autoloading for .seh files.
I'm not sure there are any mods for Strife people would want to
autoload on startup every time, but this is at least consistent with
other executables.
2018-11-03 13:22:16 -04:00
Simon Howard
221e62bfc2 strife: Allow SEH replacement for "empty slot".
This string was not wrapped in a DEH_String() call so could not be
replaced in a SeHackEd file. Thanks to chungy for feedback (part
of #1040)
2018-11-03 13:19:16 -04:00
Simon Howard
f6717da5dd heretic: Add autoloading for .hhe patches.
Heretic uses HHE instead of .deh, which have a different extension,
although some HHE patches actually have the .deh extension.
2018-11-03 13:14:04 -04:00
Simon Howard
036484b643 wad: Autoload both .wad and .lmp files.
Useful in the case of mods that are just .lmp replacements (DMXOPL?)
2018-11-03 13:12:12 -04:00
Simon Howard
f5da1a45b1 glob: Add multi-pattern matching.
Sometimes we want to glob for more than one type of file at once.
2018-11-03 13:11:55 -04:00
Simon Howard
5705be4c62 doom: Bump tempstring[] size to 90 bytes.
tempstring[] is currently 80 bytes which means that the quickload
message gets truncated for long savegame names. I believe this was
always an issue (even in Vanilla?) but recent changes to use safe
string functions (commit 040ca1cfb5) surfaced the bug.

This fixes #1069.
2018-11-03 12:37:00 -04:00
Simon Howard
c06b2c5f8e Add WAD file autoloading.
Implements most of #1052, adding a new config file variable named
`autoload_path` that is auto-configured on first run. The actual
files are autoloaded from subdirectories named by IWAD file name that
are automatically created. It's sufficient to just drop .WAD and .DEH
files into the appropriate directory to have them automatically load
on startup.

Also add a -noautoload command line parameter to disable the autoload
functionality on occasion if desired.
2018-11-02 22:24:18 -04:00
Simon Howard
0121b8c02b glob: Fix includes.
Resolve warning about missing header for strcmp(), and move Unix-
specific includes to the Unix-specific #ifdef section. Remove include
of unistd.h since it does not appear to be needed anyway.
2018-11-01 18:38:19 -04:00
Simon Howard
6a87a917af Oops. 2018-10-29 23:24:13 -04:00
Simon Howard
829c1e4c88 glob: Make sorting respect GLOB_FLAG_NOCASE.
The nocase flag should apply to sort ordering as well as glob
matching.
2018-10-29 20:58:04 -04:00
Simon Howard
65c7edcdb2 glob: Add flag for reading filenames sorted.
This will be important for autoload functionality. As a start, set
the flag for substitute MIDI .cfg files.
2018-10-29 20:53:06 -04:00
Simon Howard
0a85811d62 glob: Add flags arg for case insensitive matching.
It shouldn't matter if a file is named .cfg or .CFG.
2018-10-29 20:05:55 -04:00
Simon Howard
2bfb1bbabb video: Bump default window size to 800x600.
640x480 was the default for a long time but modern monitors are higher
resolution and now we use hardware scaling there's no reason to hold
back for any CPU reason. 800x600 is also a good default because on 2x
retina displays it doubles up to 1600x1200 which is a perfect integer
scale-up.
2018-10-29 19:32:42 -04:00
Simon Howard
301a9f0428 Merge branch 'master' of github.com:chocolate-doom/chocolate-doom 2018-10-29 18:51:37 -04:00
Simon Howard
62e2373050
Merge pull request #1099 from devnexen/cmake_build_fix
cmake build fix
2018-10-29 17:22:03 -04:00
David Carlier
01991be296 cmake build fix
undefined references due to missing bits.
2018-10-29 20:21:21 +00:00
Fabian Greffrath
35c999fa86 glob: handle file systems returning DT_UNKNOWN for d_type (e.g. XFS)
While at it, also handle the symbolic links and simplify the previous
implementation by having only one function definition.
2018-10-29 11:14:34 +01:00
Fabian Greffrath
67d4033dab glob: repair for systems without d_type field in struct dirent
The d_type field in struct dirent is not mandated by POSIX and is missing
e.g. on MinGW where this leads to a failing build. Fall back to using
stat() here.
2018-10-29 09:57:24 +01:00
Simon Howard
4ae3076411 Use M_StringJoin() instead of hand-rolled malloc. 2018-10-28 19:05:52 -04:00
Simon Howard
b98b4e6be6 misc: Fix bug with M_StringStartsWith().
A full string match still counts as "starting with". This fixes a bug
with substitute MIDI packs where substitutions were not being loaded
when the full hash was specified.
2018-10-28 02:35:45 -04:00
Simon Howard
bfb2dd3faa Oops. 2018-10-27 18:41:56 -04:00
Simon Howard
1c8880feb8 strife: Convert to new glob API.
This removes the need to do system-specific stuff to read the contents
of a directory - this is all now hidden away in i_glob.c.
2018-10-27 18:31:37 -04:00
Simon Howard
1bbbdea98a glob: Fix quirk with patterns ending in '*'.
If a glob pattern ends in a '*' then we will expect to find an empty
string at the end of our attempted matches.
2018-10-27 18:29:25 -04:00
Simon Howard
cd71cb306f glob: Fix for Watcom, too.
Copied from src/strife/m_saves.c.
2018-10-27 18:08:57 -04:00
Simon Howard
d676cd7af1 glob: Hook in win32 implementation for _MSC_VER.
I'm flying blind here so I don't know if this will actually work, but
I copied the cmake part from src/strife.
2018-10-27 18:05:04 -04:00
Simon Howard
f01ac84ab3 music: Find .cfg files by globbing, not by name.
This allows additional music packs with other filenames beyond the
"well-known" ones. This opens the door for eg. music packs for PWADs
if that's something people want.

This fixes #1051.
2018-10-27 17:59:43 -04:00
Simon Howard
d113f44369 glob: Allow symlinks to be globbed.
Instead of checking explicitly for regular files, check that matches
are not directories. Other file types probably aren't worth worrying
about.
2018-10-27 17:57:33 -04:00
Simon Howard
419776fc72 Add system-specific globbing API.
Part of #1051.
2018-10-27 17:50:14 -04:00
Simon Howard
7f03c58cbf music: Add argument to disable substitute music.
This mirrors the -nomusic command line argument by just disabling the
substitute music.
2018-10-27 16:31:44 -04:00
Simon Howard
e49be7d6b3 setup: Always show music packs action.
Now that this works regardless of the music output type, it's no longer
necessary to hide this behind a conditional widget. So just always show
it.

Part of #440 but will also aid discoverability for music packs
configuration, as part of #1051.
2018-10-24 20:08:18 -04:00
Simon Howard
3bde136c60 opl: Use SDL_mixer post-mix hook for OPL output.
Using Mix_HookMusic() to generate the OPL output stream works fine if
you only ever play OPL music and don't want to use the normal music
output functionality of SDL_mixer. However, now that it's possible to
use substitute music packs with any music output type, this is no longer
the case. Using Mix_HookMusic() disables normal output from eg. Ogg and
FLAC playback. As an alternative, use the post-mix hook and mix the
output from the OPL emulator there.

Cleanup fix as part of #440.
2018-10-24 20:03:34 -04:00
Simon Howard
00f6a3e75b music: Factor out music packs to separate file.
As described in #440, it's counterintuitive that music packs can only
be used if the music device is configured as native MIDI mode. Factor
the music pack part of `i_sdlmusic.c` out into a new file,
`i_musicpack.c`, separating the code that deals specifically with music
packs from the code that deals with MIDIs. This is easily expressible
as a `music_module_t`, doesn't result in a huge amount of duplicated
code, and only requires some minor hooks in `i_sound.c` to support the
overrides.

As an added bonus, the code in both files ends up being significantly
simpler as a result of the refactoring.

This fixes #440 and fixes #528.
2018-10-24 19:05:11 -04:00
Simon Howard
2db2e37b14 setup: Fix warning about unused result.
Just show an error dialog if the command fails.
2018-10-21 20:17:28 -04:00
Simon Howard
a066000012 music: Show message about filename-based substs.
We already show a message if substitutions are loaded from a config
file, so show a similar message as well if substitutions are found
based on filenames.
2018-10-21 20:00:54 -04:00
Simon Howard
f5ea51bcb1 Merge branch 'master' of github.com:chocolate-doom/chocolate-doom 2018-10-21 19:46:00 -04:00
Simon Howard
9e14ceab62 setup: Add window action to open music pack dir.
This replaces the widget that controls the music pack path with a
window action button that just opens the configured music pack path.
The path is now automatically created and populated with an
explanatory README file that should explain the purpose to users.

Another major step in implementing #1051.
2018-10-21 19:44:01 -04:00
Simon Howard
ceb3e49189 music: Auto-configure a music pack directory.
Currently the user has to create a music pack directory themselves and
configure the path to it in the setup tool. To make configuration
simpler, just create a directory automatically along with a README file
about how to use it, since the user can now just dump files in this
directory.

Part of #1051.
2018-10-21 19:30:44 -04:00
Simon Howard
8c43337af2 textscreen: Allow any widget in action area.
It may be desirable to wrap a window action in a txt_conditional_t
sometimes so that actions dynamically appear based on how the config
changes. So change the TXT_SetWindowAction() API to accept any widget
instead of mandating a txt_window_action_t.
2018-10-21 17:40:18 -04:00
Fabian Greffrath
38a3e0922b
Merge pull request #1097 from devnexen/update_angle_t_type
Update angle_t type.
2018-10-21 23:36:56 +02:00
Simon Howard
74cdbeddf5 music: Disable Strife d_intro table entry.
This clashes with Doom's one. Disabling this isn't too bad since we
autoload the Strife VE subst config anyway.
2018-10-21 16:59:28 -04:00
Simon Howard
1996d03d74 music: Allow filename template for substitution.
Music packs may be in .flac or .ogg format, so check for both by
using a template with .{ext} where the .flac or .ogg should go. This
also allows the .{ext} syntax to be used in config files.

Part of #1051.
2018-10-21 16:54:57 -04:00