Commit Graph

25825 Commits

Author SHA1 Message Date
Vantha e02a2e0b31 Add support for different types of tutorial steps
This patch doesn't add any new functionality and keeps the introductory
tutorial and economy walkthrough as they are. Instead, it rearranges some
code to enable easily adding different types of tutorial steps in the
future. The idea is for each type to be displayed on a different panel
and for the TutorialManager to switch back and forth between them, and
to handle and translate the received messages from the simulation and
pass them along to the active panel. Currently, there are only
"instruction"-type steps, which are handled by the InstructionPanel in
the GUI. But new ones can be added in the future, like information boxes
or bigger objectives.
2026-07-22 23:51:49 +02:00
Vantha ab4a9d6def Rename tutorial "goals" to "steps"
While it's currently the case everywhere, tutorial "steps" don't
necessarily have to be goals, they could be stuff like tips or info too
in general, if different types of "steps" are added in the future.
2026-07-22 23:51:49 +02:00
Vantha dd396f19b6 Separate handling of tutorial goals and warnings
This is more explicit and makes the code cleaner.
2026-07-22 23:51:49 +02:00
Vantha ca8a0a5611 Move "TutorialPanel" style to session styles
It's not used anywhere else besides there, so that where it belongs.
2026-07-22 23:51:49 +02:00
Vantha 663f5c5ff6 Create designated tutorial class in the GUI
This keeps messags.js shorter, prevents unnecessary GetGUIObjectByName
calls and, most importantly, makes it a lot more extensible for the
future.
2026-07-22 23:51:49 +02:00
Vantha 0e6e0280fc Prevent segfault in CMiniMap::Tick
Oversight in 01476b9836
For example, it could cause a segfault when rendering a frame after
EndGame was called therefore g_Game already deleted.
2026-07-22 23:51:49 +02:00
Ralph Sennhauser adfe6b0c36 Convert wxString using ToStdWstring
Avoid using c-style cast to convert wxString to std::wstring.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-22 16:49:41 +02:00
Ralph Sennhauser eae57d9aab Fix clang-tidy modernize-avoid-bind check
And enable the check in the config.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-21 17:15:07 +02:00
Ralph Sennhauser 91a4b834a8 Add clang-tidy linting script
Add groups we might be interested in and disable failing checks.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-21 17:15:07 +02:00
phosit 9598c6c2e1 Only clone this.position when it's an object
Refs: #8951
2026-07-19 13:01:04 +02:00
phosit e6f75f2c33 Fix displaying errors of map generation scripts
Displaying the error lead to a freeze.

Introduced in d842a134f9.
2026-07-19 11:17:35 +02:00
Ralph Sennhauser 6244d25f90 Don't generate SDL events on Atlas shutdown
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>
2026-07-19 08:59:06 +02:00
Ralph Sennhauser 63629195ba Wait for work to be finished before shutting down
Stopping the timers isn't sufficient, also wait for in-flight work to be
finished first.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-19 08:59:06 +02:00
Ralph Sennhauser 2fae39df3b Use new WX event macros
Were added in 2010.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-18 13:32:23 +02:00
Ralph Sennhauser f1181bada0 Don't install SDL default signal handler for Atlas
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>
2026-07-18 11:50:31 +02:00
Ralph Sennhauser 309ed5ef28 Add fullscreen support to Atlas
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>
2026-07-18 11:33:17 +02:00
Ralph Sennhauser 3c8b7dfa7a Fix Enter key behaviour on Windows
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>
2026-07-18 11:24:36 +02:00
Ralph Sennhauser 32b9713781 Modernize Brush in Atlas
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>
2026-07-18 11:24:36 +02:00
Vladislav Belov 7ee476928b Fixes missing window preview on Alt+Tab
There was a crash on Alt+Tab in fullscreen for some specific driver:

https://code.wildfiregames.com/D1212

It was related only to post processing so it's time to try to enable
rendering again (but with provided option to disable it). Also without
rendering we might have some bugs in other components. See:

https://github.com/libsdl-org/SDL/issues/5033#issuecomment-981819661

The issue is reported here (first one):

https://wildfiregames.com/forum/topic/129061-two-vulkan-issues-in-a27-and-unrelated-choppiness-caused-by-control-groups/
2026-07-14 19:54:00 +02:00
phosit b89ab85415 Export functions from startingStrategy.js
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.
2026-07-14 10:40:42 +02:00
Ralph Sennhauser c0645c8b90 Fix value of nativewchar in premake5.lua
Available option values or "On" and "Off".

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-14 08:56:36 +02:00
Ralph Sennhauser ca536a8cf1 Bump premake to 5.0.0-dev (2026-07-03)
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>
2026-07-14 08:56:36 +02:00
Ralph Sennhauser df48ad5813 Add support for premake-5.0.0-beta8
"flags" where deprecated and replaced by dedicated functions.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-14 08:56:35 +02:00
Vladislav Belov 2a6f17fbae Uses std::string_view for UTF-8 conversions 2026-07-14 00:14:27 +02:00
Vladislav Belov ef5088e595 Uses std::string_view for Script::Interface::Eval 2026-07-13 23:53:24 +02:00
phosit ad08462626 Remove the first isResourceExhausted
This function is overwritten later.
This redundancy has been introduced in 4e664dd712 before only the
second existed.
2026-07-13 21:15:48 +02:00
Baelish 161da119ba Increase Max Gatherers for 'Small' Ruins
The maximum number of gathers is 1 for small ruins, I change it to 5. It is the issue 8599.
2026-07-13 19:29:03 +02:00
real_tabasco_sauce 60f9737cfb Buff halberdiers by increasing movement speed and adding 1 hack armor. 2026-07-13 09:05:10 +02:00
Vladislav Belov 5778ef6cac Removes std::shared_ptr usages from particles 2026-07-13 01:01:03 +02:00
Vladislav Belov d2375de187 Splits PrepareScene and remove intermediates
We don't need to have intermediate functions as they don't add something
useful.
2026-07-13 00:40:36 +02:00
Vladislav Belov 43dd988ee7 Removes render methods from GameView 2026-07-13 00:40:34 +02:00
Vladislav Belov a2798b733f Splits render frame function 2026-07-13 00:40:32 +02:00
Ralph Sennhauser 38d247467f Handle incompatible mods for Atlas
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>
2026-07-12 20:16:52 +02:00
Ralph Sennhauser f4bb99094d Stop timers on closing Atlas
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>
2026-07-12 20:04:20 +02:00
Ralph Sennhauser 16188c7305 Add birds eye view toggle to View menu
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>
2026-07-12 19:45:30 +02:00
Vladislav Belov abf444d91c Reduces vertex maximum stride to 16
https://wikis.khronos.org/opengl/Vertex_Specification_Best_Practices

> The alignment of any attribute's data should be no less than 4 bytes.

But to make it a bit safer for older drivers we prefer to use 16 bytes
alignment (vec4) for now to match std140.
2026-07-12 17:54:26 +02:00
Vladislav Belov db8c05572f Adds Vulkan vertex format verification 2026-07-12 17:09:11 +02:00
Vladislav Belov fd99348d56 Fixes AMD Vulkan drivers crash with GPU skinning
R16G16B16_SFLOAT isn't guaranteed to be supported:
https://docs.vulkan.org/spec/latest/chapters/formats.html
See Table 17. Mandatory Format Support: 16-bit Components

It's safe to use less components:
https://docs.vulkan.org/spec/latest/chapters/fxvertex.html

> The number of components in the vertex shader input variable
> need not exactly match the number of components in the format.
> If the vertex shader has fewer components, the extra components
> are discarded.

The issue is reported here (second one):

https://wildfiregames.com/forum/topic/129061-two-vulkan-issues-in-a27-and-unrelated-choppiness-caused-by-control-groups/
2026-07-12 17:09:09 +02:00
Ralph Sennhauser 9add728945 Don't track fullscreen mode
SDL already does it.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-10 21:37:14 +02:00
Ralph Sennhauser 89c6bd5de6 Remove unused ActionButton
Unused and doesn't add value on top of regular wxButton, just a slightly
different API.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-10 20:24:35 +02:00
Vladislav Belov 92ee2dba9e Removes unused OGL legacy 2026-07-09 22:53:30 +02:00
Vladislav Belov 552d91e92a Removes legacy GL error handling
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.
2026-07-09 22:53:29 +02:00
Ralph Sennhauser 711a584d3e Remove workaround for old SDL2 on Windows
This removes the workaround for a bug[1] @Stan confirmed was fixed
upstream in SDL2 2.20 in the mentioned bug report. On Windows we are
using 2.32.8 now.

[1] https://github.com/libsdl-org/SDL/issues/5033

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-09 16:24:09 +02:00
Atrik d85cea244e Add projectile count to template viewer & tooltips 2026-07-09 09:25:37 +02:00
Atrik 20d8fdba43 Make onager throw 4 stones per attack 2026-07-09 09:25:37 +02:00
Atrik ec00288b36 Add support for throwing multiple projectils
Fixes #8918
2026-07-09 09:25:37 +02:00
Vladislav Belov 63b4b35bd3 Removes unused code about GL version from OGL 2026-07-08 20:54:11 +02:00
Vladislav Belov 11f78e5c1a Uses GLAD to get GL version 2026-07-08 20:52:23 +02:00
Vladislav Belov cd872e38d7 Removes functions about extension from OGL
We use GLAD directly now.
2026-07-08 20:06:36 +02:00
Vladislav Belov 4ca83fa071 Uses GLAD to check extensions
If GLAD failed to load an extension then we can't use it. Because all
its functions are nullptr.
2026-07-08 20:06:18 +02:00