Commit graph

4157 commits

Author SHA1 Message Date
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
Simon Howard
59dae316be music: Add table of common hashes->filenames.
Having a built-in table of common hashes and well-known filenames means
that configuration files will not be necessary in the majority of cases.

This implements most of the functionality of #1051.
2018-10-21 16:27:04 -04:00
David Carlier
bbefecc258 Update angle_t type.
Typically to avoid few overflows.
2018-10-21 07:12:39 +01:00
Simon Howard
ba65f433fe music: Allow shortened hashes for subst configs.
Just as with (eg.) Git it's nice to be able to refer to as hash by a
prefix instead of having to type the whole thing, it's convenient to
be able to give a hash prefix in a substitute music configuration.
This change to the internals will also make it simpler to support
a preconfigured table of filenames.
2018-10-21 01:20:31 -04:00
Simon Howard
243df30e08 video: Add -borderless command line parameter.
When playing in three window mode it's potentially helpful to have a
borderless mode so that the user can line up three windows next to
each other on a single desktop. However, without the windows borders
it's difficult/impossible to move windows around, so I'm not sure yet
how useful this actually is. It probably depends on the OS.

Thanks to joshthenesnerd for the suggestion.
2018-10-20 12:25:04 -04:00
Simon Howard
ffbc2b3492 Fix formatting for -response argument. 2018-10-15 00:40:56 -04:00
Simon Howard
9d4b4aeea5 Merge branch 'master' of github.com:chocolate-doom/chocolate-doom 2018-10-14 11:35:56 -04:00
Simon Howard
5e32affd97 Add '-response' command line argument.
Doom has always had the ability to load response files containing
extra command line arguments but the command line syntax of
'@filename.rsp' is unpleasant to use on modern Unix shells because
it breaks tab completion. It's actually more convenient to just have
a normal command line argument, so add one.
2018-10-14 11:34:03 -04:00
Simon Howard
08bb28ed91
Merge pull request #1094 from mfrancis95/master
Heretic: Call W_GenerateHashTable()
2018-10-14 10:59:27 -04:00
Simon Howard
2531f324e3 dehacked: Fix mistake in comment.
Thanks to Grazza for identifying this error on Doomworld (in reference
to DEH9000, although that text came from here).
2018-10-11 22:27:46 -04:00
mfrancis95
e295bb014b Heretic: Call W_GenerateHashTable() 2018-10-11 02:20:17 -04:00
Mike Swanson
02fc812eff iwad: Search Steam-on-Linux paths for WAD files
Windows games can now be installed via the Linux version of Steam,
so let’s automatically find any installed copies of the games.
2018-10-06 01:34:02 -07:00
Fabian Greffrath
3bf06ab27b video: explicitly check for aspect_ratio_correct's value being 1
This doesn't make any factual change for Choco but allows forks to
assign different values to this variable.
2018-10-04 13:43:00 +02:00
Mike Swanson
b9416dc6f9 Merge branch 'master' of gh:mfrancis95/chocolate-doom 2018-10-02 14:04:12 -07:00
mfrancis95
cb49854d10 Make sure SDL_HINT_NO_SIGNAL_HANDLERS is only set if using SDL >= 2.0.4 2018-10-02 16:31:50 -04:00
mfrancis95
28e6533feb Format the previous commit according to Chocolate Doom's coding style guidelines 2018-10-02 09:47:11 -04:00
mfrancis95
09f9ffb63f Fix SIGINT being ignored when Dehacked SHA1 warning dialog open 2018-10-02 01:51:06 -04:00
mfrancis95
3e21ed71a3 Gracefully error out when player starts are missing 2018-10-01 18:27:50 -04:00
Simon Howard
560cdc3e45 configure: add AM_PROG_AR macro.
Some platforms (eg. Emscripten) have their own version of the ar tool,
so it is important to pick one that matches the target architecture.
Without this macro we always use the default system-installed version
of ar.
2018-09-30 23:34:52 -04:00
Simon Howard
0a7d77c2a7
Merge pull request #1081 from hifi/wipe-refactor
doom: Refactor wipe to advance once per frame
2018-09-30 22:53:44 -04:00
Mike Swanson
54a2c31efc video: remove errant code for the -width and -height parameters
This prevented either paramater from working properly, since they
would be incorrectly trying to set the other dimension and immediately
switching video modes.  Now works like -geometry does.

Resolves #1086
2018-09-18 20:48:20 -07:00
Simon Howard
50d2f52b21
travis: Remove sdl2-branch
This work is now complete.
2018-09-16 20:32:21 -04:00
Simon Howard
b69888222b
Merge pull request #1084 from chungy/win32_html_docs
Use pandoc to generate HTML documentation files in win32 packages
2018-09-16 20:29:52 -04:00
Mike Swanson
5d629db9be pkg/win32: Use pandoc to create HTML versions of the docs
While plain-text versions generally worked, they have been slightly
littered recently with Markdown syntax.  We should be able to assume
every Windows user has a web browser and can view these documents
in nicely-formatted HTML pages instead of opening Notepad.
2018-09-16 05:28:28 -07:00
Mike Swanson
aa72812ca7 man: Generate Markdown versions of CMDLINE 2018-09-16 05:28:25 -07:00
Mike Swanson
eccaa5aace docgen: add Markdown output mode 2018-09-16 05:14:16 -07:00
Mike Swanson
aff22a2eaa INSTALL: Convert document to Markdown format 2018-09-16 04:53:38 -07:00
Simon Howard
3e0dc2d65c Fix warnings introduced by previous commits. 2018-09-09 18:54:20 -04:00
Simon Howard
b695b71233 iwad: Check executable location for IWADs.
This adds an additional search path when looking for IWADs - in addition
to checking the current working directory, also look in the directory
where the program executable is located.

To give some context for why I'm adding this: apparently there's a small
number of users who do something very unpleasant that I'd really prefer
they didn't: they "install" Chocolate Doom into Steam by replacing
dosbox.exe from their Steam installation of Doom with a renamed version
of `chocolate-doom.exe`. Yuck, I don't approve - it's a grotesque hack.

This works but it has a bug: Chocolate Doom picks up the Steam IWADs
from Windows registry keys. This means that it always starts doom2.wad,
and launching "Ultimate Doom" will actually launch Doom II. This solves
that problem, and while I don't approve of dumb Steam hacks, the change
itself is reasonable and it's an eminently sensible place to look for an
IWAD file.
2018-09-09 18:45:23 -04:00