There's no reason to having a different name for .conf file on every
platform, it only makes things more difficult from user and developer
perspective.
Windows and macOS config files are left as they were, this change
affects mostly Linux users.
Users are not forced to migrate, but visible warning is being issued if
they aren't. Majority of users probably won't notice it, as the stable
release should generate newly named .conf file.
Ubuntu 16.04 would provide better distro compatibility, but we need SDL
in version 2.0.5 or newer to enable resizable window support on Linux.
Pretty soon Ubuntu 20.04 LTS will be released, so targetting previous
LTS release should be enough.
We need this option to make snapshot/nightly builds compatible with
older distros and runtimes (which might not provide libpng 1.6 by
default). Examples are: Ubuntu 16.04 LTS (and derived distros, such as
LTS Mint) or e.g. Steam Runtime.
Change X11 Window WM_CLASS to 'dosbox-staging' to avoid conflicts with
upstream DOSBox, which might be provided by package manager.
Update .desktop file to specify WMClass to be correlated with
dosbox-staging process (even if executable file conflicts with dosbox
upstream).
Update contrib/icons/Makefile to generate 'hicolor' directory structure.
This is dosbox-staging icon (see contrib/icons/), rendered to size
128x128 with rsvg-convert (128x128 is recommended for various Linux DEs,
as this icon will mostly see usage on Linux - macOS and Windows have
icons in their native formats). Data dump created with GIMP with
following settings:
- Use 1 byte Run-Length-Encoding
- Save alpha channel
The host_read*, and host_write* functions currently rely on
casting unaligned memory to translate from byte arrays into
higher-level types (like 16and 32bit ints), however this
approach is implementation specific, can cause undefined
behavior, and forces the compiler to use less efficient
aliasing rules.
Unaligned memory casts have historically been corrected by
expanding multi-byte types into their constituents bytes,
shifting them, and re-packing. They've also been solved using
union objects to access the same underlying memory for each
member (legal under C, but not C++). However, we use memcpy
which is compact, readable, universally compatible, and
compiles down efficient inline single-instructions; therefore
imparting no penalty.
This commit adds host_add* functions (for 16 and 32bit values)
that add a host-formatted value to the implied value at a
memory address.
This commit adds handling for quad-words as well: host_readq,
host_writeq, which we use in the cache, which otherwise suffers
from the same alignment issues.
This way it's more obvious to the reader, what given parameter does
(instead of non-descriptive 'false/true'.
Create alias 'FIXED_SIZE' for 'false' meaning "non-resizable" window. It's a
constexpr bool global variable, so compiler will remind us when it'll
be time to remove it.
This call was useful during development and testing with
output=opengl, but now it's no longer necessary. This call causes
output=texture to go into initialization loop, which falls back to
surface, which we definitely do not want.
'resizable' option turns on resizable window if all the prerequisites
are met (OpenGL and compatible shader). Right now only shader 'sharp' was
tested as compatible, but other built-in shaders might be whitelisted in
the future as well (e.g. 'advmame*' shaders seem like good candidates).
Using incompatible shader does not cause any particular problems for the
users, but it looks really ugly - shader implementations clearly were
implemented only for a fixed window size.
'default' option acts as 'resizable' on Linux and 'original' everywhere
else. It also gives as an option to tweak available windowresolution
settings without causing too much disruption to end users.
It's necessary for usecase when game changes resolution while in game.
We don't want to resize the window in such case, just change minimum
size (SDL might decide to update the window size in the result, if new
resolution is higher than current window size).