Commit graph

3193 commits

Author SHA1 Message Date
Simon Howard
74f35cea77 textscreen: Add widget for conditionally hiding.
A common pattern when using libtextscreen is to want to show or hide
particular UI components depending on the values of particular
variables. It is also common to want to only add things to the UI if
a particular boolean condition is true. Add a new conditional widget
to cover the first case, and a convenience TXT_If() function for the
latter.
2016-06-05 00:04:59 -04:00
Simon Howard
15425bce9c setup: Overhaul sound config dialog.
Many of the sound options in here were UI crackrock - the volume
controls are all configurable from within the game, and the sound
channels option is something that probably nobody cares about.
Replace this with a layout based on radio buttons to select the
different sfx/music options.
2016-06-04 21:28:19 -04:00
Simon Howard
a44cef9789 Merge remote-tracking branch 'origin/master' into sdl2-branch 2016-06-04 20:31:42 -04:00
Simon Howard
2532daf4e1 video: Remove useless command line arguments.
The -grabmouse, -novert and -nonovert command line arguments were added
in the early days of the project, before the setup tool existed. With
hindsight there do not appear to be clear use cases for them and it's
better that these are just configured through the config files.

The -nograbmouse argument is the one exception, which is useful for
debugging purposes as a temporary override. Change this to only be a
temporary override that does not have any permanent effect on the
config option, making it consistent with arguments found in vanilla
Doom (-nomouse, -noblit, -nosound, etc.).

This fixes #212.
2016-06-04 20:15:57 -04:00
Simon Howard
d36dafa3fc Merge remote-tracking branch 'origin/master' into sdl2-branch 2016-06-04 19:36:32 -04:00
Simon Howard
ed77a8fe11 osx: Bump OSX deployment target to 10.7.
We recently switched to targeting 10.4 because of build problems with
SDL on old versions on OSX. So make this match.
2016-06-04 19:32:59 -04:00
Simon Howard
d8cfdba5bf osx: Tweak launcher interface.
Change preferences window to use standard NSPathControl controls for
selecting IWAD file paths. Make the command line arguments text box
multiline to better support long command lines.
2016-06-04 19:29:09 -04:00
Simon Howard
f802aa44fd Merge branch 'master' of github.com:chocolate-doom/chocolate-doom 2016-06-01 14:34:18 -04:00
Simon Howard
46b0556624 video: Tweak command line parameters.
Previously we interpreted -geometry parameters with an 'f' suffix to
indicate that the provided parameter should be a screen mode. Since
fullscreen is now usually implemented using a desktop window, this is
now redundant. Instead, interpret -geometry to imply that windowed
mode should be used, and change other command line parameters to be
consistent with this behavior.
2016-06-01 01:19:07 +01:00
Simon Howard
2cc60a0d43 video: Fix rounding up of window_height adjust.
The correct behavior here is to round up to the nearest pixel; the past
logic mostly worked but wasn't quite correct.
2016-06-01 01:07:11 +01:00
Simon Howard
075ca5a761 video: Add a back door for non-desktop fullscreen.
There are some circumstances where it may be useful to be able to
specify plain SDL_WINDOW_FULLSCREEN rather than the "desktop window"
variant. Examples are for embedded devices. Implement this as two
new separate config file variables, but default them to 0x0 to mean
"use SDL_WINDOW_FULLSCREEN_DESKTOP".
2016-05-31 23:27:44 +01:00
Simon Howard
3c5aa343cb video: Rename screen_{width,height} variables.
These variables no longer mean the same thing they meant in the SDL1
versions of Chocolate Doom, and they have misleading names. To avoid
confusion, rename them to window_{width,height}.
2016-05-31 23:03:42 +01:00
Simon Howard
5a10d99d7b Remove autoadjust_video_settings variable.
Now that we are always doing hardware-based scaling, this variable
no longer does anything. In the past this used to fix broken config
files which referred to nonexistent screen modes and scaling factors,
but none of that is relevant any more.
2016-05-31 22:49:49 +01:00
Simon Howard
09d1b09dc9 video: Fix aspect ratio when resizing windows.
When resizing windows there is no restriction on the aspect ratio (or
any way to apply such a restriction through the SDL2 API). When windows
are resized, fix the aspect ratio of the window so that we never get
black borders around the game content.
2016-05-31 22:44:35 +01:00
Simon Howard
af271211eb video: Set minimum window size for SDL window.
When resizing, scaling breaks down at really small sizes. It's best to
enforce a limit so that we don't scale down beyond the base size.
2016-05-31 22:41:54 +01:00
Simon Howard
4fa746dac5 video: Get rid of SCREENWIDTH_4_3 constant.
This is redundant now that we got rid of software scaling.
2016-05-31 22:35:57 +01:00
Simon Howard
ff884786c7 video: Fix up behavior for fullscreen mode change.
The existing code had (and has) some assumptions that it will only
ever run in fullscreen or non-fullscreen mode. Because now we can
change between the two dynamically, we must fix these.

First, always set the SDL_WINDOW_RESIZABLE property on windows now so
that we can resize windows if we start in fullscreen mode and switch
to windowed.

Second, set the window size when switching to windowed mode, since
the window size was not set if we started in fullscreen mode. Adjust
window sizes to have the correct aspect ratio both on startup and
when switching.
2016-05-31 22:31:16 +01:00
Simon Howard
f0999abcf1 setup: Remove widget for disk activity icon.
This seems like UI crackrock and the disk icon code is in a good
enough state that we're already turning it on by default. In keeping
with chocolate philosophy, if people really care they can manually
turn it off by editing the config file.
2016-05-31 20:14:27 +01:00
Simon Howard
2730a06cf1 video: Remove show_diskicon from video code.
Since this is game-specific there is no real reason for this to be
defined in the common video code. This also fixes the show_diskicon
variable which was broken by recent changes.
2016-05-31 20:03:55 +01:00
Simon Howard
90a455e539 diskicon: De-dupe icon dimension constants.
These were already defined in v_diskicon.h.
2016-05-31 19:58:58 +01:00
Simon Howard
70b90f34d9 diskicon: Fix Strife disk icon.
Strife has no STCDROM lump; it always uses STDISK. Change the
V_EnableLoadingDisk() function to take the lump name as an argument,
as the lump to use for the loading disk is really game-specific.

Also fix the location where the Strife disk icon is shown on screen;
the vertical position wasn't quite right.
2016-05-31 19:56:16 +01:00
Simon Howard
5bddaa7c57 diskicon: Draw disk icon with black background.
Vanilla {Doom,Strife} show a black background to the disk icons if the
icons are transparent, a side effect of how the disk icon code works
(the commented-out version can be found in Heretic's i_ibm.c). To be
consistent with how the vanilla code works, don't use V_DrawPatch to
draw the loading icon every time, but rather draw it to a buffer on
startup and blit the whole disk region to the screen.
2016-05-31 19:47:48 +01:00
Fabian Greffrath
7607140288 Use a heuristic approach to detect infinite state cycles
Count the number of times the loop in P_SetMobjState() executes
and exit with an error once an arbitrary very large limit is reached.
2016-05-24 21:02:05 +02:00
Simon Howard
512f850d91 Fix STDISK patch offset calculation.
Directions were backwards for these offsets; the STDISK lump has a -1
y offset, so we were grabbing and restoring the background from the
wrong location in the video buffer.
2016-05-22 22:36:44 +02:00
Mike Swanson
ed8cbb08e8 NEWS: change khokh2001 attribution to Nuke.YKT 2016-05-22 10:41:37 -07:00
Simon Howard
ced40ce2c4 Refactor loading disk icon code.
Only draw the disk icon just before doing the SDL blit to the screen,
and restore the background to I_VideoBuffer immediately after doing
so. This avoids the possibility of the disk remaining in the video
buffer and fixes #668.

Also centralize most loading disk code inside v_diskicon.c.
2016-05-22 17:34:17 +02:00
Mike Swanson
ebeccb0ff2 NEWS: Use past-tense rather than present and imperative. 2016-05-22 07:43:55 -07:00
Mike Swanson
d0467c9ae2 NEWS: Strife IWAD/voices.wad loading behavior tweak 2016-05-21 12:38:27 -07:00
James Haley
7742f0d459 Swap order of checks for voices.wad; resolve issue #675 2016-05-21 13:57:58 -05:00
Mike Swanson
1efd274daf NEWS: Update for the current state of the repo. Maybe release soon...? 2016-05-20 07:40:15 -07:00
Mike Swanson
c0492ef8da d_iwad: Find Strife from a GOG.com installation 2016-05-19 08:44:33 -07:00
Simon Howard
e94e6cd994 Merge pull request #705 from nukeykt/dmxgus
music: DMX's "GUS instrument mappings bug" emulation
2016-05-14 14:17:02 -04:00
Simon Howard
c2d26f92d2 Merge pull request #710 from fragglet/sdl2-branch
joystick: Use SDL GUID to identify joysticks.
2016-05-14 14:16:36 -04:00
Mike Swanson
6c5c62c349 textscreen/fonts: Support Pillow in addition to PIL 2016-05-12 08:52:44 -07:00
Simon Howard
7500dff589 Merge pull request #711 from adararnon/bugfix/windows-codeblocks
All projects now compile correctly on Windows
2016-05-12 10:49:15 -04:00
Adar Arnon
18296c6e81 All projects now compile correctly on Windows
* Updated link libraries to SDL2
* Removed files that no longer exist
* Removed `-mwindows` option from projects since it is already defined
  because the projects are defined as Windows GUI
2016-05-12 16:06:40 +03:00
Simon Howard
206603577a joystick: Use SDL GUID to identify joysticks.
The current configuration system uses joystick_index to identify
the joystick which is configured. This has the downside of assuming
a static configuration; joystick indexes can change if devices are
plugged or unplugged.

SDL2 introduces the idea of Joystick GUIDs which can uniquely
identify a class of device, so use this as the primary configuration
variable instead; that way, if the number or ordering of joystick
devices changes, we will still use the same device. As GUID can only
identify a "class" of device (eg. "Xbox controller"), we still keep
joystick_index around to try to differentiate between devices when
there are multiple identical devices connected.
2016-05-08 17:06:09 -04:00
Simon Howard
79d38c7d1e setup: Fix use of SDL_JoystickID.
The event 'which' fields now refer to an SDL_JoystickID in SDL2,
which does not equate to the index given to SDL_JoystickOpen() (see
the documentation for that function). This fixes a crash when
configuring which joystick to use in the setup tool.
2016-05-08 15:24:34 -04:00
Mike Swanson
5f5334df00 Merge pull request #709 from adararnon/bugfix/codeblocks
Fixed Codeblocks projects
2016-05-07 17:28:05 -07:00
Adar Arnon
47ce03613c Fixed Codeblocks projects 2016-05-07 23:54:38 +03:00
Mike Swanson
1db8ff0b4b doom: Use inequality comparison for the freedoom variant (thanks Jon) 2016-05-05 07:58:44 -07:00
Mike Swanson
4bab09e993 Merge pull request #702 from chungy/master
doom: Always allow loading PWADs for Freedoom: Phase 1
2016-05-05 07:29:57 -07:00
Fabian Greffrath
901ee2fe75 consider aspect_ratio_correct when saving PNG screenshot 2016-05-05 14:53:03 +02:00
Jonathan Dowland
d534cb633e Merge pull request #696 from jmtd/sdl2-fullscreen-toggle
[sdl2-branch] toggle fullscreen with cmd+enter
2016-05-05 12:39:20 +01:00
nukeykt
bd0a63d92b music: DMX's "GUS instrument mappings bug" emulation 2016-05-03 22:42:30 +09:00
Fabian Greffrath
07afb7749f video: depend on SDL_Image for taking PNG screenshots
Remove any libpbg-specific code, let SDL_Image handle this for us.

For now, this uses a slow software-scaling routine for up-scaling the
original 320x200 RGBA buffer up to the desired 1600x1200 dimensions.
In the future, we might want to fall back to using the
hardware-accelerated texture-based approach of the main rendering
stack (though this may seem like an overkill here).

However, it might be easier to take screenshots in the actual screen
dimensions with this approach (though I somehow remember that we
decided on 1600x1200 being the ideal solution that we should stay
with?).
2016-05-02 22:42:26 +02:00
Mike Swanson
b5dabaf78e doom: Always allow loading PWADs for Freedoom: Phase 1
With the combination of freedoom1.wad and -gameversion 1.666 through
1.9, Chocolate Doom would fail to pass the checks against loading
PWADs on the shareware version of Doom.
2016-04-30 22:45:56 -07:00
Simon Howard
0fd26e606c Merge pull request #703 from chocolate-doom/gamevariant
introduce a "gamevariant" variable to tell different IWADs apart
2016-05-01 00:52:09 -04:00
Simon Howard
59b322bd84 Merge pull request #635 from chungy/automake_bindir
automake: install binaries to ${bindir} not ${exec_prefix}/games
2016-04-29 11:08:00 -04:00
Mike Swanson
7b95fbbff4 automake: install binaries to ${bindir} not ${exec_prefix}/games
This has been enforcing an optional part of the FHS that proves
problematic on distributions that do not include /usr/games or
/usr/local/games on the $PATH by default.  On the packagers’ side, the
Arch, Fedora, and OpenBSD packages (at least) have been patching the
Makefile.in files in order to get it to install to the bin directory
instead.  On the users’ side, this comes as a rather nasty surprise
when neither the terminal nor GUI will launch the games when they have
been installed to a location not in the $PATH.

If desired by packagers or end-users, the old behavior can still be
effectively implemented by using `./configure --bindir=/usr/games`
2016-04-28 15:21:25 -07:00