We rely on the parent pointer to determine if the widget is being
hovered over. Set the parent pointer so that the background is set
properly for a widget in a conditional container.
File selectors widgets currently just look like an empty area of
background. Because of this they can be hard to identify as widgets.
To make them more distinguishing give them a black background, and
add a triple bar next to them.
This function was only added in SDL2 v2.0.4. So refactor to avoid
using it, since it's not strictly necessary. This should also fix
failing build on Travis, which is using an older version of SDL2.
Previously we tried to find the "nearest" window size when we were
using a window size that was not an integer multiple of the base size.
Instead, create an extra window size radio button when the configured
size is a non-standard one, to preserve the existing configuration.
Also, change all of the code that refers to "screen modes" to now
refer to "window sizes" since that is all we are doing now.
The level selection dialog was crashing on open when Chex Quest was
selected as an IWAD. This appears to have been caused by b0585fa6
which changed Chex Quest to be considered as a retail IWAD rather
than a shareware one, but did not update the tables in d_iwad.c to
match. Change the tables there to match and fix the crash.
The 'sudo apt-get install' instructions on the travis-ci website don't
work for containerized builds; instead we must specify packages to
install using the apt addon.
When the game is configured to run in full screen mode it is misleading
to keep showing the window size selectors as this can give the
impression that a fullscreen video mode is being selected. Instead,
hide the window sizes so that they only appear when running in windowed
mode. This fixes#717.
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.
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.
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.
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.
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.
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".
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}.
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.
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.
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.
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.
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.
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.
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.
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.
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.