Commit Graph

1493 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 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
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 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
Vladislav Belov 1709149740 Adds instancing to particles
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
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
Vladislav Belov 54b529ddac Fixes crash for too many particles
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
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 3af4287f6d Change the return type of event-handler
The return value is more strongly typed.
2026-06-19 20:53:52 +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 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 aced56c336 Adds material passes to choose different shaders
All shaders were selected by context (set of defines) which increases
the number of needed permutations. For example: we don't need to know
about shadows when rendering silhouettes.
2026-05-10 23:57:16 +02:00
phosit 7758c98e7c Remove IXmppClient.h
This is now possible after 0a455fbe2d.
2026-04-14 19:38:05 +02:00
Vladislav Belov cb1fe07540 Removes GetDeviceCommandContext call from CFont
We need remove all occurences of GetDeviceCommandContext to be able to
add multithreading support in the future.
2026-04-10 23:53:23 +02:00
Vantha 01476b9836 Only render the minimap texture if it'll be displayed
This patch implements a way for minimap-type GUI objects to request the rendering
of the minimap texture each frame. If it wasn't requested the minimap
texture isn't rendered at all and the objects only request it while they are
being displayed. This saves unnecessary work and fixes a bug where the
minimap briefly showed the revealed map after a cinema path ended
playing, since it isn't updated every frame (only 2x per second).
2026-03-03 11:25:52 +01:00
Vantha 67c96094f0 Disable smooth LOS during cinema paths
The whole map is revealed when starting to play a cinema path and
then hidden again when it finished (if necessary).
This patch fixes the ugly fade in at the start and fade out after
the end previously caused by this.
2026-03-03 11:25:52 +01:00
Vantha 004fdfdb58 Initialise m_DrawPaths inside the class
Default values like this are better set inside the class already rather
than in the constructor.
2026-03-03 11:25:52 +01:00
Vantha d882ab74a1 Revamp CinemaManager component
Clean up the the implementation, improve the naming, and
add some more documentation as well as more in-depth tests.
2026-03-03 11:25:52 +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 e79f8ea327 Without entities, don't require a simulation
Since 067a7abc72 a simulation is required when loading a non generated
map.
This breaks the serializationtest as it doesn't pass the simulation to
the secondary map-reader.
2026-02-17 20:37:21 +01:00
Vladislav Belov 2e0c34d479 Adds sort mode to particles 2026-02-09 21:29:42 +01:00
Vladislav Belov cce01f4d6c Fixes compilation after #8621
Fixes #8685
2026-01-25 16:29:16 +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
Chrzanof 5daae13525 Pass device command context by reference in DebugRenderer
Improve the DebugRenderer API by passing the IDeviceCommandContext
as a reference instead of calling g_Renderer.

Fixes: #6650
2026-01-24 11:54:01 +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
Atrik f856565de9 Add formations paths to UnitMotionDebugOverlay
Formation controllers now display their movement paths when enabling
UnitMotion debug overlay.

Key changes:
- Formation controllers show long paths in blue and short paths in green
- Formation controllers path are rendered if selecting
  some of the formation's members
- Prevent the gui from making redundant calls to SetMotionDebugOverlay

Existing limitations (not regressions):
- Paths are often cleared before entities complete them
- Formation members have short paths that rarely get rendered
2025-12-29 14:30:14 +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 cea77c497c Fixes TerrainTextureManager after refactoring
In fb98f5059a the manager was refactored
and the order of deinitialization was incorrectly changed.
2025-12-28 12:34:26 +01:00
phosit 067a7abc72 Don't use PS::Loader::Task outside of Loader
PS::Loader::Task is made for the Loader and it's combersome to use it
outside. Also there is an overhead.
2025-12-21 15:51:58 +01:00
phosit 2fc61dd172 Remove ProgressiveLoadEntities
It's a coroutine. The resumer can decide whether it's loaded
progressively or not.
2025-12-21 15:51:58 +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 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
phosit f257ce8f9c Remove the unused time_left parameter
The `time_left` was passed to the registered functions but it was never
used.
2025-12-13 18:58:17 +01:00
phosit 873b91774b Use std::unique_ptr for xml_reader in CMapReader
With this the destructor can be defaulted. Also the `SAVE_DELETE` can be
changed to a `.reset()` with that it's header doesn't has to be
included.
2025-12-13 18:58:17 +01:00
phosit efe0ed598f Apply rule of five to CMapReader 2025-12-13 18:58:17 +01:00
phosit 3c9b4b922e Make getCameraProperty a lambda
A lambda is more explicit which argument it takes.
2025-11-18 20:02:06 +01:00
phosit 5b1ce0957d Make getEnvironmentProperty a lambda
A lambda is more explicit which argument it takes.
2025-11-18 20:02:06 +01:00
phosit 3d26b9123a Make getTerrainProperty a lambda
A lambda is more explicit which argument it takes.
2025-11-18 20:02:06 +01:00
Ralph Sennhauser eba8439295 Replace boost::filesystem std::filyestem
Bumping the minimum version of macOS to 10.15 for spidermonky [1] also
allows us to use std::filesystem instead of boosts implementation.

[1] f14a98e26f

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-29 09:56:32 +01:00
Vladislav Belov cb58116270 Fixes lseek for big files on Windows
It was broken in ef69c37f66, before that we were using _lseeki64.

Fixes #8459
2025-10-25 13:35:59 +02:00
Vladislav Belov 99bf50cd4e Reduces boost usage for strings 2025-10-16 09:17:05 +02:00
Vladislav Belov f2752f7230 Removes ARBShader capability 2025-10-14 13:04:16 +02:00
Vladislav Belov fb94cc704f Makes loading terrain textures more smooth 2025-10-13 00:14:45 +02:00