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.
* 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
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.
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.
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?).
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.
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`