WX may still generate mouse events after calling CVideoMode::Shutdown(),
so don't create SDL events triggering assertions.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
If we catch the signal we'd have to communicate that we terminated by
signal, which might depend on shell. There is also the issue of various
dialogs blocking regular quit which we don't want, so that would need
extra work as well.
As such just let the SIGINT/SIGTERM do there default action and forgo
cleanup and let the OS handle it.
Fixes: #198
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add a fullscreen toggle to the View menu and with a global hotkey,
reusing the default one from the main game.
Unlike the current implementation this one doesn't need the game canvas
to be focused and also works on GTK.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Commit fe192fe58f made it possible for
events to properly propagate to the top window. As on Windows Enter is
also used for navigation, i.e. used to trigger the dialogs default action,
which in our case seems to be quit.
Tell the wxSpinCtrl to fire wxEVT_TEXT_ENTER instead and handle it.
The wxCommandEvent wxEVT_TEXT_ENTER doesn't carry the value, so need to
use dynamic event binding (which is preferred way anyway).
Also show the numPlayerSpinner as a spinner instead of a text field to
match visuals to actual behaviour.
Fixes: #9026
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Use dynamic event bindings allowing to bind all events in all sort of
ways. Addionally no need for subclassing wx widgets.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The functions were defined on the `Headquarters` prototype. But not all
functions are needed outside of "startingStrategy.js". Also doing it
this way, "startingStrategy.js" and "headquarters.js" had to mutually
import each other.
This adds support for the compilcommands action, which allows to improve
the cppcheck workflow and is a requirement for include-what-you-use.
Also disable unused dependencies like is done for macOS.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
In case of incompatible mods listed on the command line we can't launch
the mod selector from Atlas. Instead list the offending mods and launch
with the default mods.
Fixes: #8852
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Otherwise we might try to render a view when half the infrastructure is
already taken down, which results in segfaults or asserts.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
On request by @nifa add a checked menu item to View menu to set birds eye view.
When game view is focused, the focus which it hogs almost always, then
'B' doesn't propagate properly so use Ctrl+B instead in line with other
main menu shortcuts.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
We have GL_KHR_debug for proper error handling. ogl_WarnIfError isn't
really useful since it doesn't provide per-call granularity and requires
recompilation. So if it'll be really needed we can wrap all GL calls
into a macro like GL_CALL.
Instead query g_VideoMode where needed. As both g_xres and g_yres aren't
global anymore remove static from UpdateRenderer. While at it use more
desicriptive names: GetXRes -> GetWindowWidth, GetYRes ->
GetWindowHeight.
This reduces the amount of variables tracking width and height by one
each.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
It looked ok as long as the window had a 16:9 aspect ratio, however
default window size is 4:3 which squishes the balcony.
Add a horizontal alignment support for background layers, which allows
to fix this issue for any aspect ratio.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Using the no args constructor m_RoundCoordinates doesn't get
initialized, meaning the memory can contain whatever. We were lucky in
that in most cases random means true.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
On suggestion by @nifa add a View menu.
Initially move wireframe, smooth framerate and reset camera actions
there.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>