Commit Graph

2227 Commits

Author SHA1 Message Date
Vladislav Belov 46af67b5bd Removes RenderPath
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
Vladislav Belov 0538e95793 Makes GameView::GetCamera constant 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 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
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 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
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
Vladislav Belov f72c0c1c09 Enables fragment PBR resolve shader in PostProc 2026-06-20 13:29:11 +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
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
`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
phosit 3bf8e92ed4 Move the profileViewer handler to CProfileViewer
`CProfileViewer::InputThunk` 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
phosit 80d5fd7a52 Move the gui input handler to CGUIManager
`gui_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
phosit b2a8f94a20 Move the console input handler to CConsole
`conInputHandler` 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
phosit 596c0c2ddd Split screenshot from main input handler
This enables the screenshot hotkeys in atlas.
2026-06-19 20:53:52 +02:00
phosit 464d40ab61 Split window from main event handler
Two globals can be removed.
2026-06-19 20:53:52 +02:00
phosit 3af4287f6d Change the return type of event-handler
The return value is more strongly typed.
2026-06-19 20:53:52 +02:00
phosit 47e8a17a41 New input handling system
The new system allows to register all function objects as Input::Handler
not only function pointers.
To not get dangling references a handler is unsubscribed on it's
destruction.
The order in with the handlers are executed has to be specified by the
slot-argument, instead of the reverse order of registration.
2026-06-19 20:53:51 +02:00
Ralph Sennhauser 8336e679af Replace all uses of POSIX realpath
Use `<filesystem>` instead of `realpath` and remove wrapper.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-16 14:08:02 +02:00
Ralph Sennhauser 518ed74496 Replace all use of POSIX unlink
Use `<filesystem>` instead of `unlink` and remove `unlink` portability
wrapper.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-15 15:33:59 +02:00
Vladislav Belov 4d83aa28e5 Uses SwapChain instead of direct Device calls 2026-06-08 18:27:06 +02:00
Ralph Sennhauser a0bb103390 Unwrap SDL_Event
Since C++11 a C typedef'ed union can be forward declared, so the wrapper
is no longer needed.

While at it switch signatures to refs and convert C style casts.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-05-20 19:44:52 +02:00
Vladislav Belov 18a16aa135 Moves all rendering to material passes
Now we should use material passes instead of context and defines to
select a needed shader. It allows us to reduce the number of
shader combinations we use and reduce memory consumption.
2026-05-10 23:57:20 +02:00
Vladislav Belov 75bd640bd8 Removes context of terrain shadows and silhouettes
We were unnecessary passing all combinations of our scene shader context
even if we don't need it as for shadows and silhouettes for terrain
rendering. Since we only need to draw a solid color.
2026-05-10 23:56:57 +02:00
phosit c042b3ca2c Start the serializationtest at a specivic turn
This enables to only test critical game sections.
2026-05-10 14:18:48 +02:00
Ralph Sennhauser 6514230330 Allow building without lobby
Commit 6a8366b99a added additional
libraries to the report but didn't consider gloox be optional. Address
this false assumption allowing to build pyrogenesis without lobby
support.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-05-01 08:20:38 +02:00
Vladislav Belov a7967d4ad9 Adds PBR output texture to PostProc 2026-04-29 19:25:14 +02:00
phosit 7758c98e7c Remove IXmppClient.h
This is now possible after 0a455fbe2d.
2026-04-14 19:38:05 +02:00
Vladislav Belov 68091177ac Removes ArrayDeleter 2026-04-10 23:03:00 +02:00
Daniel Richard G. eab11c247c Add nominal support for LoongArch64 and RISC-V 64
Fixes #6584, #6834
2026-03-23 08:20:10 +01:00
phosit 46b27f22ca Wait for autostart by promise
Since the completion is checked using the promise the `onTick` function
can be removed.
This replaces the `AutoStart` `AutoStartClient` and `AutoStartHost` by
async functions.
The functions can now return something to the engine. That is used to
inform the engine which page to open. That was previously done in
JavaScript. Which is ugly because it doesn't know whether it's in
visual-mode.
2026-03-19 18:44:52 +01:00
phosit 262c5c037e Use promises to fetch net messages
Refs: #5585
2026-03-13 18:07:56 +01:00
Vladislav Belov aae957ec7b Adds fixed orientation to particles
New features:

* Relative position
* Relative and absolute fixed axis
* Local space
* Axis along velocity vector
2026-02-20 22:46:49 +01:00
Vladislav Belov 0432b86de7 Removes ARB (legacy OpenGL) backend
ARB is a legacy backend which uses old assembly shaders. It makes
writing shaders more complex. According to the stats
https://feedback.wildfiregames.com we small amount of players with
ARB.

Fixes #8533
2026-02-20 22:07:38 +01:00
phosit df18e22277 Remove Script::CreateArray
It's better to construct a js-array from a `JS::RootedValueVector`.
Because it is more strongly typed and the index doesn't has to be
specified when appending an element.
Some usages are replaced with `JS::RootedValueArray`.

Fixes: #8702
2026-02-08 19:27:50 +01:00
Ralph Sennhauser 0d60bdfd2e Readd JS API function Engine.Exit()
Requested in #8244 for scripting purposes and automated testing. Extend
the original design by adding a means to pass an exit status. This also
comes in handy in case one wants to cleanly error out from JS on parsing
errors of command line arguments as reported in #7967.

Fixes: #8244
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-29 20:03:56 +01:00
phosit 13453a3c7b Remove ScriptContext::CreateContext
This function nudges one into using it instead of the constructor. Even
though a `std::shared_ptr` isn't required.
2026-01-24 12:03:05 +01:00
Ralph Sennhauser ba4ef61c15 Use cpp-httplib instead of mongoose
Use cpp-httplib for Profiler2 and RLInterface instead of mongoose.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-24 10:45:48 +01:00
phosit 03a5198ed3 Remove g_GUI usage in simulation2/*
This is the last remaining inclusion of a gui file in simulation2/.
2026-01-23 21:05:18 +01:00
phosit 153dfe7ef1 Don't use g_GUI in TurnManager
The turn-manager shouldn't know about the gui.
2026-01-23 21:05:14 +01:00
phosit ba2351611c Remove LoadScripts from CSimualation2
`LoadScripts` and `LoadDefaultScripts` have to be called imediately
after the `CSimulation2` constructor.

By doing the necesarry work in the constructor and removing
`LoadScripts` and `LoadDefaultScripts` the interface of `CSimulation2`
is simplified.
2026-01-01 17:27:54 +01:00
trompetin17 8e820a988e Fix exceeding input boundaries in console
After 734386ce9f the new font system calculate height and cap height,
previously was having some magic number. Now we are using cap height
divide 2 to give a more nice space.

Remove an extra pixel in the buffer and improves background color for
better reading and eye care.

This also support the change console font option added in d549cbeeaa

Fixes: #8351
2025-12-28 20:35:20 +01:00
Vladislav Belov df9c6f510c Fixes ProfilerViewer when drawing empty cells
Currently CalculateStringSize can't handle empty string (see #8630).
As a simple fix for RC just avoid drawing empty texts.

Refs: #8630
2025-12-28 17:36:36 +01:00
phosit 426ec45751 Don't suspend loader after each finished task
By moving the common `goto done;` ouf of the if-block 5586802b86 changed
the code so that the loader suspend after each task.
This normally isn't a problem as it will continue in the next frame. But
when entering atlas it is treated as an error.
2025-12-27 17:17:06 +01:00
Vantha 4d08446285 Improve Engine.GetTextSize deprecation message 2025-12-23 14:37:23 +01:00
phosit 5586802b86 Use a coroutine for Loader tasks
Some tasks are invoked multiple times. Normally those tasks are broken
up inside a loop and had to be continued there. With coroutines that is
easier as it's possible to suspend inside a loop.

Coroutines which are lambdas should not capture anythig as the lifetime
of the captured values might end before the coroutine completes. For
that purpose `std::bind_front` is used.
2025-12-21 15:51:46 +01:00
phosit 2a2d5de350 Replace LDR_* with PS::Loader::* in comments
This has been forgoten in 1917d034fd.
2025-12-16 19:35:25 +01:00
phosit ca0d6d3768 Remove references to InitEverything in Loader.h
This function seems to be removed a long time ago.
2025-12-16 19:29:05 +01:00
phosit 14a5ccee52 Propagate error from autostart
The JavaScript error wasn't propagated leading to an infinite loop.

Fixes: #7967
2025-12-14 19:07:01 +01:00
phosit 1917d034fd Introduce a namespace in Loader
All functions had a `LDR_` prefix. The prefix is removed.
Functions and globals which are only used in Loader.cpp are now
contained in an anonymous namespace.
2025-12-13 18:58:17 +01:00