Commit graph

25926 commits

Author SHA1 Message Date
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
phosit
2c44b5301c
Only clone this.targetPos when it's an object
When writing 55f2d356ff, I didn't know that `clone` only handles
objects. Now there is an extra path for `undefined`.

Fixes: #8951
2026-07-08 17:00:59 +02:00
Ralph Sennhauser
99bbc24265
Remove global g_xres and x_yres
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
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>
2026-07-08 11:35:46 +02:00
Ralph Sennhauser
b588b62304
Fix Kush main menu background
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>
2026-07-08 10:55:24 +02:00
Ralph Sennhauser
173d768087
Fix UB in GUISprite Draw
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>
2026-07-08 09:51:17 +02:00
Vladislav Belov
2bc674cbaa
Removes extensions prior 2.1
Since we generate GL headers using GLAD with 2.1 version we don't need
to check extensions prior that.
2026-07-08 09:28:52 +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
Vladislav Belov
eb3f55ae27
Removes unused ogl_SquelchError
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
2026-07-08 08:13:48 +02:00
Vladislav Belov
0a22bc66f7
Makes GL error handling explicit in report 2026-07-08 08:13:46 +02:00
Vladislav Belov
0168f45a65
Refactors GL device report
It makes the report function easier to read.
2026-07-08 08:13:44 +02:00
Vladislav Belov
46af67b5bd
Removes RenderPath
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
We can render the game only with shaders so we don't need to support
fixed function pipeline as a separate render path. We only need to know
when to warn a user.

Fixes #6244
2026-07-07 23:12:45 +02:00
Vantha
fb38c8781b More versatile placement of research buttons
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
This patch allows techs to optionally define a property "placeBelow"
specifying a combination of class requirements. The selection panel then
tries to place their research button below the training button whose
unit matches these classes -- if there is only and exactly one.
This is useful for techs only affecting a single type of unit: it e.g.
allows always placing the fishing nets research button below the fishing
boats training button.
To prevent duplicating information in "placeBelow" (e.g. from
"affects"), it can also be set to two magic values: "{AffectedUnit}" and
"{UnlockedUnit}". In practice, many techs use those, but class
combination remain useful for granular control in very specific cases.

Regarding tech pairs, as explained in a comment, their two research
buttons can now be placed in three different arrangements (with
descending preference):
1. Vertically below a single training button.
2. Horizontally below two adjacent training buttons.
3. Horizontally adjacent in the bottom row (below no training buttons).

Vertically in the third and fourth rows (below no training button) --
how it was previously -- is no longer done as it'd conflict with and
doesn't fit the new layout and the clear separation between "generic"
and "specific" techs.

Whenever a research button can't be placed in their preferred location
because it is already occupied, the code simply falls back to the default
position in the bottom row.

This patch also adds a new game option to hide the new small arrows above
the research buttons in order to give more experienced players who already
know the techs well the possibility to reduce visual clutter. By
default, the arrows are shown.
2026-07-06 05:01:12 +02:00
Vantha
280a19587f Define technology pairs in an array
This patch renames the "pair" property of paired technologies to
"partOfPair" for clarity and in the pair parent packs the two techs
(previously "top" and "bottom") into an array called "pair".
This makes the hierarchy more clear in the code and pairs might not be
always placed vertically in the future.
2026-07-06 05:01:12 +02:00
Vladislav Belov
8491b7f084
Removes Unattach from emitter
We don't really need that proxy. As the main idea is to move the
ownership from a model to the particle manager.
2026-07-06 01:05:09 +02:00
joeybadz
961dfc9279 Fix the deserialization of game state for AIs
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
Adjust function arguments to prevent errors when loading/rejoining a game with AI. These occurred due to 2f2cbb96bf not adding arguments for the state/playerID

Fixes: #9001
2026-07-02 21:50:32 +02:00
Dunedan
b848e760e4
Re-use XMPP resource GUID for whole app runtime
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
Instead of using a new GUID as part of the XMPP resource for each XMPP
connection, this keeps the same GUID as long as pyrogenesis is running.

This is meant to make it easier to detect players violating the Terms of
Use by using multiple accounts to smurf or circumvent bans, as after
this change it's not sufficient anymore to connect with another account
to stay anonymous, but instead players have to restart pyrogenesis as
well.
2026-07-01 15:36:51 +02:00
Ralph Sennhauser
bc0e043696
Don't allow rotation in atlas bird view
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
except for rotation around the y axis. This makes the behaviour
consistent with the main game.

Ref: #8931
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-29 20:12:31 +02:00
Vladislav Belov
0538e95793
Makes GameView::GetCamera constant
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
2026-06-28 17:57:26 +02:00
Vladislav Belov
e0d131854d
Makes GameView returning reference on camera 2026-06-28 17:57:16 +02:00
Vladislav Belov
0cc07aa209
Removes legacy glEnable of GL_TEXTURE_2D
It needs to bo enabled only for fixed-function pipeline.

https://registry.khronos.org/OpenGL-Refpages/gl2.1/

> If enabled and no fragment shader is active, two-dimensional texturing is performed
2026-06-28 15:56:33 +02:00
Vladislav Belov
74f11d2fd2
Adds const to particle emitter type
Emitter type must not be changed during any emitter update.
2026-06-28 14:30:44 +02:00
Vladislav Belov
7790c0972b
Removes legacy timers
Modern profiling tools provide more details and more precise
measurements for more platforms. For simpler cases we have our in-game
profiler.
2026-06-28 13:34:01 +02:00
Vladislav Belov
fa0e593669
Replaces virtual by override for particle emitters 2026-06-28 12:01:39 +02:00
Ralph Sennhauser
4967922447
Don't load WGL
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
Depend on SDL and wxWidgets doing the necessary work.

Also remove WGL from glad.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:26 +02:00
Ralph Sennhauser
d58e605992
Remove dependency on X11
Glad GLX was the last consumer of X11 libraries as such we no longer
depend on X11 directly.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:26 +02:00
Ralph Sennhauser
a27fe1f8a1
Drop EGL and GLX from glad
Also regenerate files with latest glad and vulkan 1.4.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:26 +02:00
Ralph Sennhauser
c5a9d18cfa
Drop use of GLX and EGL
Only used for hw-report and only when using GLX which is for X11 only.
The usefulness of those reported properties is questionable and X11 is
becoming rarer.

This allows us to drop a direct dependency on X11 delegating the
handling to SDL and wxWidgets respectively GTK.

Further SDL3 wont expose supported video driver at compile time making
this step more meaningful.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:26 +02:00
Ralph Sennhauser
9baa3bcd62
Drop DGA mouse workaround
Is no longer supported in SDL2, so this workaround does nothing anymore.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:25 +02:00
Ralph Sennhauser
08cd7e9096
Drop vsync workaround for wxWidgets
wxWidgets already sets it's prefered mode.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:25 +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
1709149740
Adds instancing to particles
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
We use instancing to provide dynamic data for particle only once and not
for each vertex.
2026-06-22 23:18:29 +02:00
Vladislav Belov
50d82810bc
Moves UV coordinates to a separate vertex buffer
UV coordinates are constant so we don't need to upload them each frame.
Ideally we shouldn't have UV coordinates at all as we could use
gl_VertexID but it's not available on all supported GLSL versions.
2026-06-22 23:18:27 +02:00
Vladislav Belov
1380a93077
Packs particle size and angle to axes
We need to have per-vertex data to be constant to use instancing.
Now we have only UV coordinates.
2026-06-22 23:18:26 +02:00
phosit
e82f8ac5ac
Log instead of crash on compile error in the gui
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
Refs: #8195
2026-06-21 20:05:39 +02:00
phosit
b0af0971e3
Don't crash on compile error of hotloads
Hotload functions aren't expected to throw an error. Instead return the
error to the function who is waiting for the module.
2026-06-21 20:05:39 +02:00
Vladislav Belov
db9f60b540
Renders only alive and visiable particles
We don't need to update and render dead or invisible particles. The
code still uploads the whole chunk but I'll improve that later.
2026-06-21 18:40:52 +02:00
Ralph Sennhauser
8bb72251ec
Drop use of off_t in soundmanger
The ogg library itself doesn't use off_t, mostly just int and long.

With off_t being problematic as Windows doesn't support _FILE_OFFSET_BITS
replacing this removes a potential headache.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-21 13:27:00 +02:00
Vladislav Belov
45cb592f22
Adds ability to enable smooth framerate in Atlas
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
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
Vladislav Belov
54b529ddac
Fixes crash for too many particles
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
The maximum number of particles was unbound. It's bound by the
number of maximum vertices per vertex buffer.
2026-06-20 21:45:55 +02:00
vyordan
ec8b420abc
Move Script* classes to Script namespace
- Rename ScriptEngine, ScriptContext, ScriptInterface, ScriptRequest to
  Script::Engine, Script::Context, Script::Interface, Script::Request
- Remove 'Script' prefix from filenames:
  ScriptContext.* → Context.*
  ScriptInterface.* → Interface.*
  ScriptRequest.* → Request.*
  ScriptEngine.* → Engine.*
  ScriptConversions.* → Conversions.*
  ScriptExceptions.* → Exceptions.*
  ScriptForward.* → ForwardDeclarations.*
  ScriptStats.* → Stats.*
- Update all includes, forward declarations, and friend classes
- Use namespace Script { ... } in .cpp definitions to avoid repetitive
  Script:: prefix (keeping global callbacks outside)
- Rename internal implementation structs:
  ScriptInterface_impl → Interface_impl
  ScriptFunction → Function
- Update copyright year to 2026 in all touched files
- Suppress pre-existing cppcheck warnings (uninitvar, nullPointer, unknown
  macro) by adding them to suppressions-list.txt (these are not caused
  by this refactor)

Fixes #7516
2026-06-20 17:43:00 +02:00
Ralph Sennhauser
310c4bf028
Add staticbox padding style in Atlas
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
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
Vladislav Belov
d23f9e1da3
Adds a storage check for resolve PBR shader
We need to check for storage support because we outpout result into a
storage. Note: it seems we might have a bug inside GL backend or inside
Mesa drivers which prevents us from running resolve on compute.
2026-06-20 13:29:14 +02:00
Vladislav Belov
7a19f38070
Allows floating point textures based on extension 2026-06-20 13:29:13 +02:00
Vladislav Belov
f72c0c1c09
Enables fragment PBR resolve shader in PostProc 2026-06-20 13:29:11 +02:00
Vladislav Belov
8c5416e2c5
Adds fragment shader PBR resolve
It allows to have PBR for devices without properly detected compute
shaders.
2026-06-20 13:29:01 +02:00
Ralph Sennhauser
181a29597d
Remove helper function FileExists
Use std::filesystem at caller site instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-20 12:01:38 +02:00
Vladislav Belov
5ca4c93f55
Reduces canvas2d layout for SPIR-V
It's preferrable to keep push constant under 64 bytes for some vendors.
The layout optimization rule is similar to C++ one.
2026-06-20 11:22:29 +02:00
Ralph Sennhauser
355c068068
Remove helper function FileSize
Use std::filesystem at caller site instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-20 09:00:57 +02:00
phosit
364d50e184
Move the gameView input handler to CGameView
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
`game_view_handler` isn't global anymore. That makes the interface
simpler and might make the compilation and the runtime faster.
2026-06-19 20:53:52 +02:00