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>
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>
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>
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>
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
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.
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.
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
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.
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>
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>
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>
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>
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.
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>
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>
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.