Commit Graph

790 Commits

Author SHA1 Message Date
4bcbc72274 Don't use std::shared_ptr to store m_ScriptContext and m_ScriptInterface in the CGUIManager
`std::shared_ptr` is intrusive. When a function expects a
`std::shared_ptr` the caller has to use it too and can't store the
element on the stack for example.

Comments by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5221
This was SVN commit r28131.
2024-06-27 19:09:30 +00:00
74afb17aa4 Split the Shutdown function
Comments By: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5148
This was SVN commit r28056.
2024-03-24 12:45:27 +00:00
6b31999b64 Don't use std::shared_ptr<ScriptContext> in the CSimulation2
Since 1bccfef6fb the `CSimulation2` uses the `std::shared_ptr` only in
the constructor and stores a `ScriptContext&` (inside it's members).
That's a bit dangerous: A caller might think `CSimulation2` takes
ownership of the `ScriptContext`.
With this commit the caller has to pass an `ScriptContext&` to the
constructor.

Comments By: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5223
This was SVN commit r28046.
2024-03-08 17:15:25 +00:00
ffc4a56b9f Revert non-ASCII characters from source and configuration files introduced in 157c6af18e.
Fixes #6846

Differential Revision: https://code.wildfiregames.com/D5185
This was SVN commit r27965.
2023-12-03 00:30:12 +00:00
949be94aab Introduce CLogger::ScopedReplacement and FileLogger
Comments By: @sera, @vladislavbelov, @Stan
Differential Revision: https://code.wildfiregames.com/D5167
This was SVN commit r27953.
2023-11-23 20:42:18 +00:00
3fff9df4a0 Return CTerrain and CUnitManager references from CWorld instead of pointers
Accepted By: @vladislavbelov
Comments By: @Stan
Differential Revision: https://code.wildfiregames.com/D4739
This was SVN commit r27861.
2023-09-26 20:10:40 +00:00
c86d3bbb56 Refactors models and materials, part 2, replaces raw pointer by unique_ptr and adds test.
Comments By: phosit
Differential Revision: https://code.wildfiregames.com/D5128
This was SVN commit r27846.
2023-09-21 19:00:28 +00:00
bb
157c6af18e Make the space in 0 A.D. non-breaking throughout the codebase.
Avoid cases of filenames
Update years in terms and other legal(ish) documents
Don't update years in license headers, since change is not meaningful

Will add linter rule in seperate commit

Happy recompiling everyone!

Original Patch By: Nescio
Comment By: Gallaecio
Differential Revision: D2620
This was SVN commit r27786.
2023-07-27 20:54:46 +00:00
4e86f99fe2 Replaces boost string general includes by more precise ones.
Differential Revision: https://code.wildfiregames.com/D5066
This was SVN commit r27746.
2023-06-30 19:10:13 +00:00
8f78ac1ef8 Decouples renderer code from VideoMode to get backend device.
Differential Revision: https://code.wildfiregames.com/D5043
This was SVN commit r27693.
2023-06-14 07:06:22 +00:00
8472240573 Fix compilation with GCC 13.
gcc-13 less often includes cstdint so one might need to include it
manually if needed.

The headers already included in Message.h are included within namespace
AtlasMessage which didn't break by chance, move them out and add
cstdint.

Patch by: @sera
Reviewed by: @phosit
Fixes: #6800
Differential Revision: https://code.wildfiregames.com/D4997
This was SVN commit r27644.
2023-05-13 12:08:23 +00:00
0fce64ed5a Fixes Atlas previews after e4455a8e8f.
Differential Revision: https://code.wildfiregames.com/D4919
This was SVN commit r27521.
2023-02-01 21:56:35 +00:00
c422eb242a ATLAS UI be aware of GUI Scale user config
Comment by: @Phosit, @Stan, @Vladislav
Differential Revision: https://code.wildfiregames.com/D4915
Fixes: #6715

This was SVN commit r27513.
2023-01-30 22:05:17 +00:00
5d7a8b9d1b Fix: Crash atlas in relation to Terrain.cpp CalcPosition
Patch by: @trompetin17
Differential revision: https://code.wildfiregames.com/D4900
Comments by: @Langbart, @Stan, @Vladislav
Fixes #6550

This was SVN commit r27499.
2023-01-28 22:42:00 +00:00
c0e888e2af Removes SetViewport from CRenderer.
Differential Revision: https://code.wildfiregames.com/D4849
This was SVN commit r27313.
2022-12-29 06:53:06 +00:00
3723cbf692 Fixes big screenshots after 29368cf776 and 3a4c8342a0.
Differential Revision: https://code.wildfiregames.com/D4835
This was SVN commit r27269.
2022-12-04 19:28:34 +00:00
29368cf776 Adds framebuffer attachment load and store operations.
Comments By: phosit, Stan
Differential Revision: https://code.wildfiregames.com/D4830
This was SVN commit r27256.
2022-11-26 21:55:17 +00:00
8e51dfa91a Moves post processing out of scene rendering to avoid framebuffer pass duplicate.
Comments By: phosit, Stan
Differential Revision: https://code.wildfiregames.com/D4827
This was SVN commit r27232.
2022-11-18 19:59:18 +00:00
3a4c8342a0 Makes AcquireNextBackbuffer returns true in case of successful backbuffer acquirement.
This was SVN commit r27184.
2022-10-30 00:38:45 +00:00
8ae3a2bfd6 Adds AcquireNextBackbuffer to CDevice to have something to present.
This was SVN commit r27148.
2022-10-11 22:48:07 +00:00
4d77de66d4 Removes GUI dependency from Canvas2D.
Initially the GetDefaultGuiMatrix function was added in 4113aa0a36 and
renamed in 04c63a4093.

This was SVN commit r27111.
2022-10-04 20:25:39 +00:00
62e589ab76 Adds renderer backend interface and dummy backend.
Comments By: phosit, Stan
Tested By: Langbart, phosit
Differential Revision: https://code.wildfiregames.com/D4636
This was SVN commit r26858.
2022-05-08 22:02:46 +00:00
3ed4eaf247 Removes ogl_WarnIfError from regular renderer code.
This was SVN commit r26850.
2022-05-02 21:52:21 +00:00
3f8cbecd72 Remove hardcoded shadows in Atlas UI
Fixes c9a7aabbea
Patch by: @nwtour
Accepted by: @phosit
Tested by: @Langbart
Differential Revision: https://code.wildfiregames.com/D4400
This was SVN commit r26730.
2022-03-28 22:47:52 +00:00
8f85f24608 Update the water height slider if the water height is set using the picker.
Patch by: @phosit
Fixes: #6424
Differential Revision: https://code.wildfiregames.com/D4576
This was SVN commit r26727.
2022-03-28 22:36:17 +00:00
518a1421ab Clears the color attachment of the main framebuffer only if needed.
Differential Revision: https://code.wildfiregames.com/D4539
This was SVN commit r26623.
2022-03-11 22:26:49 +00:00
d494bbd583 Replaces M_PIf by M_PI in Atlas, fixes compilation with gcc 11.2.0 and glibc 2.35.
There was added a workaround in glibc to fix tests.

Refs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103735
https://sourceware.org/bugzilla/show_bug.cgi?id=28713

This was SVN commit r26536.
2022-03-03 18:10:05 +00:00
23a023507a Replaces GL_LINES, GL_QUADS, GL_TRIANGLE_STRIP and GL_TRIANGLE_FAN by GL_TRIANGLES.
This was SVN commit r26488.
2022-02-26 00:37:27 +00:00
8a63adc40d Uses CDeviceCommandContext as an input parameter for CCanvas2D.
This was SVN commit r26480.
2022-02-25 08:14:11 +00:00
4de89c3db1 Moves texture management to CDeviceCommandContext, adds quality options.
Comments By: nwtour, Stan
Tested By: nwtour, Stan
Differential Revision: https://code.wildfiregames.com/D4488
This was SVN commit r26365.
2022-02-13 19:30:28 +00:00
ea72437739 Move GenericName, History and Icon from the civ-JSON to cmpIdentity.
Since the players/civs already have cmpIdentity, use it.
This forces civs to have corresponding XML in the `special/players/`
folder.

Also moves the files from `special/player/` to `special/players/`
consistent with other folders. And moves the generic `player.xml` one
level up.

Differential revision: https://code.wildfiregames.com/D4473
Help and comments by: @Stan, @wraitii
This was SVN commit r26298.
2022-02-05 06:24:45 +00:00
a1f98b016b Moves depth and stencil tests to PipelineState and DeviceCommandContext.
Differential Revision: https://code.wildfiregames.com/D4471
This was SVN commit r26286.
2022-02-01 16:38:55 +00:00
e0d98cd94d Call SetTerrainDirty on CModelAbstract without going through CmpVisualActor
The UnitManager already lists all units, so we do not need to go through
the visual actor of entities to update them. This is faster and
decouples simulation & graphics code slightly.

Further, the simulation does not need to know about texture changes (see
also 410d2e883a), so remove those calls in Atlas.

Differential Revision: https://code.wildfiregames.com/D4455
This was SVN commit r26270.
2022-01-29 08:28:04 +00:00
330b570ba8 Remove RENDERDATA_UPDATE_COLOR, which is not used, and cleanup.
RENDERDATA_UPDATE_COLOR was used to precompute lightEnv-dependent data
on the CPU. This is no longer done following engine upgrades, and in
particular d7d02a4740 which explictly always did this on the GPU.

ModelAbstract had a 'SetDirtyRec' hack for it because of decals, which
can also be removed. The 'dirty' bit of CRenderableObject is renderdata
for the specific item, never its props, so it never actually needs to be
recursive.

CheckLightEnv is also useless as a result, and removed.

Differential Revision: https://code.wildfiregames.com/D4453
This was SVN commit r26249.
2022-01-25 16:59:29 +00:00
4ce609bb1f Uses MIPs for terrain textures previews following e4455a8e8f.
Comments By: Stan
Differential Revision: https://code.wildfiregames.com/D4447
This was SVN commit r26239.
2022-01-24 07:00:55 +00:00
5adbe4f1a3 Moves blend state management to DeviceCommandContext. Fixes #6420
Tested By: Langbart
Comments By: Stan
Differential Revision: https://code.wildfiregames.com/D4441
This was SVN commit r26228.
2022-01-19 17:28:47 +00:00
795fb070af Removes asking GL of current bind framebuffer to avoid syncs.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4422
This was SVN commit r26193.
2022-01-09 07:36:56 +00:00
15c40861b4 Separates terrain alphamap combining and uploading.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4419
This was SVN commit r26184.
2022-01-07 14:33:54 +00:00
fd976456d7 Performs texture uploads via DeviceCommandContext interface.
Tested By: Langbart, Stan
Differential Revision: https://code.wildfiregames.com/D4415
This was SVN commit r26170.
2022-01-05 14:49:54 +00:00
5e3426794c Moves frame rendering function to CRenderer and combines with making screenshots.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4414
This was SVN commit r26166.
2022-01-04 18:13:45 +00:00
87b5c233c5 Splits CRenderer part about scene to CSceneRenderer.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4412
This was SVN commit r26165.
2022-01-04 13:29:01 +00:00
4fba543488 Unifies providing SkyManager and WaterManager like other managers, refs b889826a3d.
This was SVN commit r26158.
2022-01-03 10:49:12 +00:00
273d336364 Removes unused Atlas functionality to set clear color added in 2f53eea71a and removed in 0d6882dad2.
This was SVN commit r26156.
2022-01-03 09:39:54 +00:00
e9070a2630 Removes rand function usage from Atlas and unused rand include from particles.
This was SVN commit r26153.
2022-01-02 22:35:17 +00:00
202e248c93 Removes cinema path recording from atlas added in 2c71c22045 and not removed with ffmpeg in [[SVN:9520]], 4c395f4bf2 and 47b26e56d3.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4411
This was SVN commit r26147.
2021-12-31 10:35:56 +00:00
e4455a8e8f Speedups terrain painting tab in Atlas by asynchronous texture loading.
Tested By: Silier, Stan
Differential Revision: https://code.wildfiregames.com/D4405
This was SVN commit r26142.
2021-12-30 16:24:07 +00:00
9696df3c28 Removes unused ogl/ogl_tex includes.
This was SVN commit r26121.
2021-12-27 10:11:26 +00:00
478164962f Removes static linking of OpenGL library.
Tested By: Langbart, Stan
Differential Revision: https://code.wildfiregames.com/D4387
This was SVN commit r26104.
2021-12-24 08:02:27 +00:00
c9bea80e0d Use GLAD2 a multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator.
Comments by: @nwtour, @Langbart, @bb
Based on patch by: @echotangoecho
Tested on Windows 7 & 10, Ubuntu and macos.

Differential Revision: https://code.wildfiregames.com/D721
This was SVN commit r26093.
2021-12-21 22:03:31 +00:00
a32ab00f4d Moves backbuffer swap and error check to GL device.
This was SVN commit r26092.
2021-12-21 17:02:04 +00:00