429 Commits

Author SHA1 Message Date
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 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
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
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
Ralph Sennhauser 3b9ec75e28 Split out View main menu in Atlas
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>
2026-07-08 08:53:02 +02:00
Ralph Sennhauser 0bfd703eda Drop XInitThreads workaround
GTK used by wxWidgets on Unix calls it when creating an X11 window as
does SDL. As such this is no longer needed and we avoid a direct
dependency on X11.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:25 +02:00
Vladislav Belov 45cb592f22 Adds ability to enable smooth framerate in Atlas 2026-06-21 11:30:27 +02:00
Ralph Sennhauser f9af0e571a Mark ownership using unique_ptr in Atlas sections
And remove unused destructors.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-21 09:16:11 +02:00
Ralph Sennhauser 310c4bf028 Add staticbox padding style in Atlas
GTK static box doesn't have padding, so add a style variable to allow
adding a custom padding.

Replace implicit padding with explicit padding where needed.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-20 14:38:42 +02:00
Ralph Sennhauser 628713859f Don't send default setting to engine
Sending default setting on first view of a section/tool to the engine
triggers the "you have changes" mechanism. Sending them just in case
isn't needed unless there is a bug in a different place.

Drop this preemptive measure.

Fixes: #3029
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-19 19:25:09 +02:00
Ralph Sennhauser ca3bacf6c1 Update Atlas sidebar layout
Replace the wxBoxSizer with a wxFlexGridSizer so the gaps between main
elements, typically wxStaticBoxSizer, remain uniform across the tools.

Add a style variable to control the wxFlexGridSizer on platform basis.

Also replace the obsolete wxScrolledWindow by inheriting from
wxScrolled<wxPanel> instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-17 18:58:02 +02:00
Ralph Sennhauser 6b4ecbdc40 Create dedicated stylesheet for Atlas
This is meant as a central place to tweak layout per platform.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-15 21:27:42 +02:00
Ralph Sennhauser 1ab55e7f2e Remove leftover code from wxCollapsiblePane use
There is a workaround for an old bug with the use of wxCollapsiblePane.
As the widget itself is no longer in use, just remove the now dead code.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-13 18:34:09 +02:00
Ralph Sennhauser b4fe426963 Replace notebook with choicebook
The terrain selection notebook is painful to navigate with a large
amount of tabs. Further the control is broken on macOS. As such replace
the wxNotebook with a wxChoicebook.

Fixes: #8705
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-13 16:57:32 +02:00
Ralph Sennhauser 8cb4f5e4a3 Fix negative content width GTK warnings in Atlas
Interdependent content width in terrain selection panel results in GTK
throwing warnings. Don't expand the grid cell content.

Also wrap the grid to keep spacing consistent and not variable for the
terrain buttons.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-13 13:38:44 +02:00
Ralph Sennhauser 9388692a47 Add bird view to Atlas
Fixes: #2657
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-12 21:54:01 +02:00
Ralph Sennhauser fa9584fdc0 Fix some Atlas header includes
iwyu 0.26 now want's full declaration of TYPE in case of
std::vector<TYPE>, which is good as it allows the header to be
self standing.

There are some other changes suggested in part of the headers not being
updated when they should have been and some due to changes in iwyu
itself.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-12 21:22:36 +02:00
Ralph Sennhauser 7f4377c086 Treat <wx/defs.h> as private header
Add the header to iwyu mappings as private as the wx documentation
doesn't suggest otherwise.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-12 21:22:36 +02:00
Ralph Sennhauser 0599848330 Cleanup Atlas SectionLayout
Don't declare empty constructor and destructor, avoid c-style cast and
remove TODO about a bug that can't be reproduced any longer.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-07 09:36:57 +02:00
Ralph Sennhauser e3afa15966 Cleanup Atlas section headers
Make not otherwise used functions private and use override as
appropriate.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-07 09:36:57 +02:00
Ralph Sennhauser cf5501a35b Support numpad with player hotkey in ActorViewer
KEY_DOWN means we need to check for the "down" values instead of "char"
value which differer for numpad.

Ref: #501
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-05 16:22:28 +02:00
Ralph Sennhauser fcbc3d3f71 Limit max PlayerID in Atlas hotkeys
9 isn't a valid playerID, setting this value causes a JS error
and corrupting the viewport.

Further limit selectable max playerID to what the mapSettings say.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-05 16:22:28 +02:00
Ralph Sennhauser 0c0552a428 Replace M_PI with C++ numbers
C++20 added π (pi) to the standard, replace the C macro globally.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-04 20:29:48 +02:00
Ralph Sennhauser 4379194255 Fix sidepanel layout in Atlas
In many places there are missing gaps/borders and where there are there
are almost random values used (2/3/4/5/8/10/15).

Add missing and standardize on using gaps 5 and 10 pixel only.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-03 19:17:28 +02:00
Vladislav Belov 70c15abadb Fixes Atlas Terrain panel in dark mode 2026-02-06 15:21:15 +01:00
Cayleb-Ordo 4536190ab4 Update Icon handling of ActorEditor
Previously on non Windows Platforms the Programm would not get its
icon, as the *.rc is not used on e.g. Linux.
Use an xpm File for non Windows Platforms. Use the convenience macro
from wxWidgets to load the icon in a single call.

The icon was converted using GIMP 3.0.6. To avoid `-Wwrite-strings` the
static char* was converted to a const char*.
2026-01-08 11:12:24 +01:00
Ralph Sennhauser d22d8776e6 Fix layouting of texture preview in atlas
Commit fe192fe58f added one extra level,
so we have to layout the parent of the parent now to actually layout the
sidebar.

Fixes: #8388
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-01 14:40:30 +02:00
Ralph Sennhauser f44855126e Fix scrolling with GTK/QT wxWidgets backends
wxWidgets can use X11 APIs or the GUI toolkits GTK or QT on Linux, with
pure Wayland only the option to use the toolkits remains for
wxGetKeyState().

wxGetKeyState() is only usable for modifier keys with either toolkit and
so we need to bookkeep ourself.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-09-06 17:59:32 +02:00
Ralph Sennhauser fe192fe58f Make wxStaticBox' content children
As per the docs[1]: Note that since wxWidgets 2.9.1 you are strongly
encouraged to create the windows which are added to wxStaticBoxSizer as
children of wxStaticBox itself.

wxWigets 3.3 added a warning to that end.

[1] https://docs.wxwidgets.org/3.2/classwx_static_box_sizer.html

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-24 18:27:30 +02:00
Ralph Sennhauser e22c5bd05e Fix some includes in atlas
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.

Update premake script to include missing deps and drop various extra
paths for simplification.

Don't always include wx/wx.h via precompiled.h in case PCH is disabled.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-21 14:18:38 +02:00
Ralph Sennhauser 827116cd35 Fix issues pointed out by cppcheck
For the memleak warning actually wx will free it for us, so just
suppress the warning.

```
source/soundmanager/data/SoundData.cpp:48:29: error: Iterators of different containers 'CSoundData::sSoundData' and 'sSoundData' are used together. [mismatchingContainers]
  if ((itemFind = CSoundData::sSoundData.find( theData->GetFileName().string() )) != sSoundData.end())
                            ^
source/soundmanager/data/SoundData.cpp:62:28: error: Iterators of different containers 'CSoundData::sSoundData' and 'sSoundData' are used together. [mismatchingContainers]
 if ((itemFind = CSoundData::sSoundData.find(itemPath.string())) != sSoundData.end())
                           ^
source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp:145:3: error: Memory leak: buf [memleak]
  }
  ^
```

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-13 17:09:36 +02:00
Ralph Sennhauser d6b0198bab Fix some includes in atlas
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.

Define ATLASDLLIMPEXP in a regular header instead of a PCH header and
dedupe its definition.

wxWidgets uses WX_ATTRIBUTE_PRINTF this days, so remove the workaround
for ATTRIBUTE_PRINTF.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 19:52:40 +02:00
Ralph Sennhauser fbc74482db Fix some includes in atlas
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.

Drop the wxWidgets specific handling of precompiled headers in some
places, it isn't consistently used which it would have to to have meaning
and was mostly for early VS implementation of precompiled headers and a
lot of time has gone by since.

Drop Borland C++ compiler specific quirk, that compiler was
discontinued long ago and doesn't support modern C++.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-09 18:28:46 +02:00
Ralph Sennhauser 73ca3d303b Fix some includes in atlas
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.

Add "source" to include path for AtlasUI target to allow for absolute
includes. In the future all but one should be removed.

Drop check for at least boost 1.40.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-09 06:52:41 +02:00
Ralph Sennhauser 58219b974c Fix trailing whitespace and add pre-commit hook
Some have their editor configured to remove trailing whitespace and
editing such a file would "fix" it, adding an unrelated change.

Fix whitespace violations excluding third party libs and generated files
like glad or patches.

Enable pre-commit hook trailing-whitespace to enforce it in the future.

Fixes: #8016
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-15 20:08:48 +02:00
Ralph Sennhauser 06e2f0bcc3 Fix cast to void for Win64
Make what could be considered a legendary hack less brittle.

    C4312: 'reinterpret_cast': conversion from 'long' to 'void *' of greater size

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:39 +02:00
Ralph Sennhauser ead62bba78 Update trac links with gitea links
This replaces all links pointing to trac with their corresponding links
to gitea. Also replace http with https while at it.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-12-10 11:29:48 +01:00
real_tabasco_sauce 8d78e3165b Rename TeamPlacement -> PlayerPlacement 2024-10-23 18:37:35 +02:00
Ralph Sennhauser b1f0ebda41 Fix wxString to std::string conversion in Atlas
At least on Linux this resulted in the help menu in Atlas not being
populated. This fixes the issue.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-10-18 19:30:26 +02:00
Ralph Sennhauser b5d08a4833 Use XWayland for Atlas if needed
GlCanvas currently doesn't support runtime selection of GDK backend [1].

Therefore to run Atlas under Wayland wxWidgets needs to be built with
GLCANVAS_EGL which is usually not the case to support X11 at the same
time.

Check if the EGL backend is available and if not and running under
Wayland force use of XWayland with the GLX backend.

[1] https://github.com/wxWidgets/wxWidgets/issues/22325

Closes: #6939
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-10-09 06:28:56 +02:00
phosit f9ad0c1df4 Allow selecting a TeamPlacement in Atlas 2024-10-06 19:37:39 +02:00
Itms ad3537c414 Revert 1e504cd64c which used a deprecated API
The fix doesn't seem needed anymore on supported versions of macOS,
refs #1554.
2024-09-28 21:55:30 +02:00
phosit ac54096bb2 Allow selecting a biome in Atlas
Original patch by: lyv
2024-09-26 19:47:36 +02:00
vladislavbelov ffc4a56b9f Revert non-ASCII characters from source and configuration files introduced in 157c6af18e.
Fixes #6846

Differential Revision: https://code.wildfiregames.com/D5185
This was SVN commit r27965.
2023-12-03 00:30:12 +00:00
bb 157c6af18e Make the space in 0 A.D. non-breaking throughout the codebase.
Avoid cases of filenames
Update years in terms and other legal(ish) documents
Don't update years in license headers, since change is not meaningful

Will add linter rule in seperate commit

Happy recompiling everyone!

Original Patch By: Nescio
Comment By: Gallaecio
Differential Revision: D2620
This was SVN commit r27786.
2023-07-27 20:54:46 +00:00
vladislavbelov 4e86f99fe2 Replaces boost string general includes by more precise ones.
Differential Revision: https://code.wildfiregames.com/D5066
This was SVN commit r27746.
2023-06-30 19:10:13 +00:00