9544 Commits
Author SHA1 Message Date
Vantha f903a20486 Hide scrollbars if they don't have any effect
Scrolling up and down might not do anything (not even a little bit) not
only if the max pos is 0, but also if it's smaller than 1. It depends on
the parent's position and whether or how the rendered rounds positions
of the scroll content. E.g. text positions are rounded up.
It's preferable to hide the scrollbar if it's between 0 and 1, cutting of
1 single pixel in unfortunate cases is better than rendering a useless
scrollbar.
2026-10-02 12:39:04 +02:00
Ralph Sennhauser cfb8ee9225 Fix ModeTToPerms
Needs bitwise AND instead of OR, else irrespective of filemode requested
all permissions are given in CreateDirectories.

Fixes: 43e7dbc6da
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-09-30 17:03:11 +02:00
Vantha d412813f25 Fix crash due to uninitialised LOS framebuffer
The issue was introduced by fd976456d7 and made appearant by
67c96094f0.
If a cinema path was played right at the start of a game, then the
smooth LOS rendering option was disabled before `InterpolateLOS` was
called for the first time, so in turn when `ConstructTextures` was
called for the first time, it didn't fill the `m_SmoothFrameBuffers`
and `m_SmoothTextures`. And when smooth LOS was enabled again (by the
cinema path ending), `ConstructTexture` wasn't called again by
`RecomputeTexture` since `m_Texture` already existed. This means that
the `m_SmoothTextures` and `m_SmoothFramebuffers` remained unfilled,
which then caused a crash when they were accessed and used in
`InterpolateLOS`.
Since creating the shader and filling `m_SmoothTextures` and
m_SmoothFramebuffer` isn't expensive, the simplest solution is to always
do that no matter if smooth LOS is enabled or not.
2026-09-30 17:00:18 +02:00
Ralph Sennhauser dfa16d185f Use absolute path in CreateDirectories
This allows to create nonextising relative paths, this is useful for
example for `HOME=tmp ./binaries/system/pyrogenesis` running pyrogenesis
with a default config.

Fixes: 43e7dbc6da
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-09-29 13:41:53 +02:00
Vantha a55ffa8ba8 Complete the cinema path timescale implementation
This patch fixes the previously broken implementation of the timescale
property of cinema paths, now cinema paths with timescale 0.5, for
example, play twice as fast.
Unlike the comment stated, negative timescales weren't actually
supported, which is now enforced.
For demonstration, the timescale of the demo map's path is changed to
0.85.
2026-09-28 15:19:33 +02:00
Vantha 7dfdfbeaef Remove m_PathQueueDuration and m_QueuePlayingElapsedTime
Both aren't actually necessary for the functionality, so removing them
just simplifies the script.
2026-09-28 15:19:33 +02:00
Vantha f87e149141 Remove unused m_QueueEndedElapsedTime
Oversight of d882ab74a1
2026-09-28 15:19:33 +02:00
Vantha 7c32cf81d4 Serialize CCmpRangeManager::m_LosRevealWholeMapForAll
Oversight of c7247936bf
2026-09-28 15:19:33 +02:00
Vantha 3b50a02f17 Don't call StartPlayingQueue after deserializing
There is no point in calling `CCmpCinemaManager::StartPlayingQueue`
again after deserializing, `m_WasMapRevealed` is (de)serialized anyway
and that call always overwrote it to false, which caused OOS.
2026-09-28 15:19:33 +02:00
Vantha 9923d0d508 Fix OOS issue in CCmpCinemaManager::UpdateActivePath
`UpdateActivePath`, which is called each frame during rendering, mustn't
call `StopPlayingQueue`, since that impacts the serialized simulation
state.
And it is safe to assume `!m_PathQueue.empty()` if
`m_IsPlayingPathQueue`
2026-09-28 15:19:33 +02:00
Vantha d269faf336 Send CinemaQueueEnded message at the proper time
Only send the CinemaQueueEnded message at the end of
`CCmpCinemaManager::StopPlayingQueue`, after resetting everything.
The other components would expect the queue to actually have ended
(`CCmpCinemaManager::IsPlayingQueue` to be returning false) when
receiving the message.
2026-09-28 15:19:33 +02:00
Vantha 2de7bfcce5 Remove unused OverrideVisible flags
They were forgotten to be removed in 5a4e8e1896
2026-09-28 15:19:33 +02:00
phosit a056f0f516 Store the distribution in the particle-var
A distribution is statefull it might store some unused entropy so that
the rng might be called less ofthen.
So this commit might increase the object size and improve performance.
2026-09-25 11:48:36 +02:00
trompetin17 0ed48b3a1f Add viewer entity template and update entity naming in ActorViewer
After #7164, entities in the ActorViewer are loaded through the
preview filter, which disables shadows by design. As a result, the
shadow toggle no longer has any visible effect.

Adds a dedicated viewer.xml template so the ActorViewer no longer
inherits the preview filter's shadow behaviour, keeping preview.xml
untouched for the entities that legitimately need shadows off.

Refs #7164
Reported by: Vladislav
2026-09-24 09:10:47 -05:00
Atrik 46db652641 Ensure buildings always own territory they are on
Territory influence weights could cause other players' territories to
overlap with buildings, leading to incorrect territory ownership and
buildings decaying even when they should be within their own territory.

This fix ensures that all tiles occupied by a building's footprint are
always owned by the building's owner, regardless of influence weights
from nearby structures.
2026-09-23 14:04:41 +02:00
Vladislav Belov b75edb9b3f Replaces HostHasSSE by SDL_HasSSE
SDL also includes fixes for E2K:
https://github.com/libsdl-org/SDL/commit/67f0b9b86dd16c38b8d4c6e16cceaa166d31a83e
2026-09-22 21:57:57 +02:00
phosit 7b188fb71c Remove lib/types.h
This file is now almost empty.
It was included in some files which didn't required it.
2026-09-21 18:12:08 +02:00
phosit 281e8cd862 Remove uint
It's better to use the native types.
2026-09-21 18:11:47 +02:00
phosit ae7801c9c7 Remove u64
It's better to use types from the standard library.
2026-09-21 18:11:38 +02:00
phosit 6a0c8c1a5a Remove u32
It's better to use types from the standard library.
2026-09-21 18:11:31 +02:00
phosit 500606e587 Remove u16
It's better to use types from the standard library.
2026-09-21 18:11:22 +02:00
phosit 00ee825374 Remove u8
It's better to use types from the standard library.
2026-09-21 18:11:14 +02:00
phosit a4f5cbc23e Remove i64
It's better to use types from the standard library.
2026-09-21 18:10:59 +02:00
phosit 3e7263f0db Remove i32
It's better to use types from the standard library.
2026-09-21 18:10:39 +02:00
phosit b7c310535d Remove i16
It's better to use types from the standard library.
2026-09-21 18:10:26 +02:00
phosit 6ccc54ad6c Remove i8
It's better to use types from the standard library.
2026-09-21 18:10:08 +02:00
stevenlau 06f3ea58bf Fix engine obstruction cluster position typo
Obstruction cluster are found in walls. Since position of walls would never change, that erroneous code path was probably never executed, hence it never caused any observable problems. Fixing this anyway in case it would be relevant in future.
2026-09-21 14:08:46 +02:00
Vladislav Belov 9dec9c1d53 Removes SMBIOS
It was implemented on Windows only. It doesn't really contain a useful
for us information which can not be obtained by diagnostic tools like
dxdiag when needed.
2026-09-21 01:10:35 +02:00
Vladislav Belov 63016196ce Removes unused code from lib/bits.h 2026-09-21 00:47:17 +02:00
Vladislav Belov 2c68f7e426 Replaces ceil_log2 by std::bit_width
Also removes unused floor_log2.
2026-09-21 00:47:15 +02:00
Vladislav Belov 0650721b19 Replaces round to closest power of two by std ones 2026-09-21 00:47:13 +02:00
Vladislav Belov 0b90eea56b Replaces is_pow2 by std::has_single_bit 2026-09-21 00:47:11 +02:00
Vladislav Belov 93eb35a618 Replaces PopulationCount by std::popcount 2026-09-21 00:47:09 +02:00
phosit a56456495c Remove debug_printf filtering
The filter was rarely used. The implementation was overly complex and
might have filtered out strings that should have been printed.

Tags like "FILES|" have been removed.
For the loader a macro `LOADER_LOG` has been introduced.
2026-09-19 08:52:27 +02:00
Atrik a8ee3c2b92 Warn only once per missing icon
Mods may dynamically request icons
(e.g., [icon=\"emblem_${civ}\"], [icon=\"icon_${res}\"]) that
don't exist when another mod introduced the new civ or resource
but hasn't added that icon.
This results in excessive error log spam during normal gameplay.
2026-09-17 15:21:59 +02:00
phosit 1fc267080d Deduplicate BuildTextureRGBA functions
All of them contain the same loop.
2026-09-17 09:35:39 +02:00
phosit 926d230c6c Remove classes inheriting TerrainTextureOverlay
Those classes only exposed one function. It's better to use
`std::function` for that, because it's not intrusive.
2026-09-17 09:35:39 +02:00
phosit 7a0aead3cd Remove unused TerrainTextureOverlay parameter 2026-09-17 09:35:38 +02:00
7wells 779021c9dc Fix nondeterministic CinemaManager serialization
Fixes #8867
2026-09-14 11:06:34 +02:00
Lancelot de Ferrière 6a46e74443 Vertex pathfinder: skip vertices with worse g cost
This reduces the number of expensive visibility checks we run,
leading to 5-10% better performance on average.
2026-09-11 15:22:37 +02:00
Vladislav Belov 58e2c59466 Adds Load with unique_ptr to VFS
Also replaces some usages of Load with shared_ptr by unique_ptr.
2026-09-10 16:39:29 +02:00
Vladislav Belov aecd2b4245 Uses span for vfs instead of passing shared_ptr 2026-09-10 16:39:24 +02:00
Vladislav Belov 1b4397d2ae Adds final to VFS 2026-09-10 16:39:18 +02:00
Vladislav Belov 571047a64a Adds explicit check for VFS create alignment 2026-09-10 16:39:14 +02:00
Vladislav Belov 4ae50fd4a4 Reduces memory peak during window resize 2026-09-10 15:38:55 +02:00
Vladislav Belov 63e05d3c65 Removes unused updateFlags from GPU skinning 2026-09-10 15:27:18 +02:00
Vladislav Belov 100a13343a Uses default group for vertex buffer for skinning 2026-09-10 15:27:14 +02:00
Vladislav Belov e933d18a36 Moves tracking of requiring update models to upper
We need to track models to update in a single place. SceneRenderer in
that case. It allows us to make ModelVertexRenderer implementations more
straightforward.
2026-09-10 15:27:09 +02:00
Vladislav Belov a374411279 Separates preparing for rendering of CPU skinned
Only CPU skinned models require preparing for rendering to mark vertex
buffer chunks as needed.
2026-09-10 15:27:04 +02:00
Vladislav Belov 39c0dc69e4 Uses std::filesystem to get a file_size 2026-09-10 13:58:28 +02:00