1
0
forked from 0ad/0ad
Commit Graph

2302 Commits

Author SHA1 Message Date
a591e5aa69 Removes unused/not implemented hooks from AppHooks. Refs f947fa6afe.
This was SVN commit r26024.
2021-11-29 18:21:49 +00:00
809e3ed0bd Removes rand function usage from tests to avoid non-uniform distributions.
This was SVN commit r26012.
2021-11-25 17:57:59 +00:00
265a2246f0 Removes unused fnv_lc_hash, also file paths case sensitive so we can't use the function.
This was SVN commit r26010.
2021-11-25 16:58:04 +00:00
25ce179cbc Adds collision test for fnv_hash, removes unused include forgotten in b4a33851e6.
This was SVN commit r26007.
2021-11-21 11:59:02 +00:00
4bae03c6c8 Enables GL_TEXTURE_2D always since we don't support FPP anymore.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4327
This was SVN commit r25982.
2021-10-30 14:34:20 +00:00
0e599a3176 Moves cursor to VideoMode to draw it via SDL.
It removes the software implementation intentionally. Because it
duplicates SDL functionality. But it might be added in future on demand.

Tested By: bb, Langbart
Differential Revision: https://code.wildfiregames.com/D4278
This was SVN commit r25936.
2021-09-21 22:44:46 +00:00
31b70309b3 Debundle Valgrind and make it optional
If a *nix user wishes to build `pyrogenesis` with support for Valgrind
(such as
it is), then can do so by passing `--with-valgrind` to
`update-workspaces.sh`.
(They will need Valgrind installed and locateable via `pkg-config`.)


Reviewed By: sera, Stan
Fixes: #2904
Differential Revision: https://code.wildfiregames.com/D3646
This was SVN commit r25933.
2021-09-20 22:18:28 +00:00
ce08f57f51 Removes ogl_tex_find function, which duplicates cache-like logic in TextureManager.
This was SVN commit r25932.
2021-09-20 16:39:51 +00:00
645e053fd2 Remove executable bit on some source files.
Reported by: Ralph Sennhauser
Fixes: #6325

This was SVN commit r25917.
2021-09-12 18:41:51 +00:00
6272ba2344 Remove Custom implementation of wrename on windows. 52baaa4bbd removed the other occurences.
Reviewed by: @wraitii
Differential Revision: https://code.wildfiregames.com/D4225
This was SVN commit r25907.
2021-09-09 17:53:17 +00:00
55f9d78e7e Moves tex tests to the related folder, was forgotten to move in 63086f4e26.
This was SVN commit r25884.
2021-09-01 19:27:34 +00:00
Angen
52baaa4bbd Fix updating existing mods
Replace wrename, that fails when mod exists already with RenameFile by
@Stan
Check if mod was actually installed when downloading it
error if mod cannot be coppied into modTemp

Differential revision: D4222
This was SVN commit r25854.
2021-08-22 11:35:34 +00:00
67539a8837 Fixes an old bug with missed handle appeared in 63c1347ef7.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4115
This was SVN commit r25735.
2021-06-07 18:45:28 +00:00
63c1347ef7 Removes windows enumeration on Windows to retrieve HWND taking it from SDL and wxWidgets.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4064
This was SVN commit r25709.
2021-06-06 15:31:55 +00:00
fdb4040838 Adds HiDPI mode for testing. HiDPI on Windows isn't supported in SDL yet. So we use a custom code.
Differential Revision: https://code.wildfiregames.com/D4076
This was SVN commit r25692.
2021-06-05 19:01:37 +00:00
1b35d36daa Implement a global task manager using a pool of worker threads
Tasks are simple callables (e.g. lambdas), and can be pushed with 2
priority levels. Pushing a task returns a future.
Futures can be waited on, can return results, and can be cancelled
deterministically. Futures can also not be waited on.

This gives 'hardware concurrency - 1' threads to maximize CPU usage in a
work-stealing workflow.

Reviewed by: vladislavbelov
Refs #5874

Differential Revision: https://code.wildfiregames.com/D3848
This was SVN commit r25656.
2021-06-03 14:48:38 +00:00
455b784f62 Delete test .zip file after running tests
Issue spotted by kalimaps
Reviewed by: wraitii
Code parts by: wraitii
Differential Revision: https://code.wildfiregames.com/D4043
This was SVN commit r25646.
2021-06-02 21:31:18 +00:00
cf454fe533 Removes unused BitBuf added in 5b5726ed4d.
Bit operations can be done via std::bitset. The current implementation
is too specific to have it just for a future. Refs 479f59e386,
5ca66fc757.

This was SVN commit r25569.
2021-05-25 19:42:06 +00:00
db9356944c Removes unused base32 encoding added in 5cc814759f.
For modern standards base64 costs a bit less space and might be
implemented on demand. base32 usage was introduced in e0dfbe719d and
removed in 93cffe9deb.

Refs a34b759720, 317f98a6c0.

This was SVN commit r25568.
2021-05-25 19:18:22 +00:00
38e085a8c0 Removes unused wutil command line arguments parsing added in 5383eff15c.
We already have a single place to access arguments, so we don't need
a platform dependent place for that.

Refs 3f58951808, 8c1bd05ab9.

This was SVN commit r25567.
2021-05-25 18:42:27 +00:00
007d30f4b4 Removes outdated user32.dll preload hack added in 7a889deca3 and became useless in bbcd9b34cc.
Refs 4b33f49da1, b242eafd02, 56bd5b59b4.

Tested By: Angen
Differential Revision: https://code.wildfiregames.com/D4007
This was SVN commit r25566.
2021-05-25 18:29:50 +00:00
1e18a93302 Removes using shared_ptr to make STL usages consistent.
Differential Revision: https://code.wildfiregames.com/D4005
This was SVN commit r25533.
2021-05-23 22:01:18 +00:00
10cf87f3d1 Adds std namespace to shared_ptr usages in lib/tex.
This was SVN commit r25530.
2021-05-22 19:34:39 +00:00
5656c4117d Adds std namespace to shared_ptr usages in lib.
This was SVN commit r25529.
2021-05-22 19:32:38 +00:00
faca950e83 Removes unused CONFIG2_CACHE_READ_ONLY config macro forgotten in 2374caac3e.
Refs 149ebb67c0, 9269be9ee3.

This was SVN commit r25522.
2021-05-22 14:04:11 +00:00
53369d593b Removes Dehydra config macro. Introduced in 378bd89c1d.
Dehydra was abandoned in 2010s.

This was SVN commit r25521.
2021-05-22 13:28:55 +00:00
0812ded348 Removes unused CONFIG_OMIT_FP config macro forgotten in 0d23e3f333.
This was SVN commit r25520.
2021-05-22 13:18:15 +00:00
c73f674055 Removes unused DynHashTbl. Last usage was removed in 6c915291cc.
STL or Boost provides containers with DynHashTbl's functionality (and
not worse performance). Refs 9fd08fb044, 5ca66fc757.

This was SVN commit r25519.
2021-05-22 12:59:41 +00:00
b5535c4ba3 Removes OpenMP from external libraries. It's better to avoid its usage with a custom thread management.
This was SVN commit r25518.
2021-05-22 12:24:18 +00:00
04549a081d Rework Mod into a class.
`Mod` currently modifies 4 global arrays, including some that are
'public'.

The logic flow is easier to understand if this becomes a real class with
const-correctness and public/private methods.

Differential Revision: https://code.wildfiregames.com/D3981
This was SVN commit r25469.
2021-05-20 08:32:11 +00:00
e908733220 Speed up GetAvailableMods for archives.
Refs 64bfa089af and 44ec2e324e

When a .zip file is encountered by the VFS population, it reads the info
for all files in the archives. This is quite slow for the public archive
(400-500ms on my computer), which means calling GetEngineInfo()
repeatedly is impossible.

By only opening the external mod.json, we skip most of the work. The
archive can still be opened if needed as fallback.


Differential Revision: https://code.wildfiregames.com/D3216
This was SVN commit r25446.
2021-05-16 13:50:05 +00:00
abb124a36f Fix cpuid call with -fPIC on i386 architectures.
GCC < 5 used to reserve the ebx register for PIC (position-independent
code) metadata. This meant that we needed to save the state of ebx
before calling cpuid (fixed in #2675)
However, the original patch from 03eaf9b461 did not force a particular
register to store this value in. Following the GCC 5 upgrade, GCC
stopped reserving ebx, and that register silently got used instead. The
code became non-sensical, and our ASM __cpuidex started returning random
garbage in edx.

Since we now only support GCC7 and above, the PIC-specific branch is no
longer necessary and is removed.

Fixes #6028. The assertion was a result of random data in ebx.
Refs #2675 / reverts 6334ee3f8b and reverts 03eaf9b461.

Patch by: nwtour
Comments by: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3575
This was SVN commit r25405.
2021-05-09 12:41:45 +00:00
f4905066ab Reduces number of allocations during error message formatting.
Differential Revision: https://code.wildfiregames.com/D3871
This was SVN commit r25300.
2021-04-22 06:53:03 +00:00
2d53308e1b Fix console not preventing hotkeys from firing / Clean up hotkey-input conflict.
- Fix mistake in 4b46c09222 (similar to one in a4852c4c01) that allowed
hotkeys to fire while typing in the console.
- Prevent Alt+key to fire hotkeys in input boxes & console as that is
often text input.
- Split the hotkey triggering logic in two: a preparatory phase & an
actual firing phase.
This allows the GUI code to check which hotkeys are about to fire and
selectively allow them to go through. This makes it easier to change
hardcoded hotkeys, such as the console toggling one.

Differential Revision: https://code.wildfiregames.com/D3786
This was SVN commit r25180.
2021-04-02 14:18:20 +00:00
b477892440 Fix issues in 87a2c3347f
Fixes 87a2c3347f:
- NoPCH was broken
- two warnings slipped through.

Differential Revision: https://code.wildfiregames.com/D3751
This was SVN commit r25147.
2021-03-28 07:01:34 +00:00
87a2c3347f Make real directory paths on the VFS predictable (retry)
This is the same commit as 4bb31f084e, reverted in 5d1899785a. Noted
issues were fixed.

Partial revert/fix of 2f19cf86d3 and 2567fee329.

Before this diff, it was possible for a mod containing a cache/ or a
config/ folder to get written to incorrectly.
The issue is VFS can map multiple directories to one 'virtual' path, for
reading mods. However, writing data is problematic: which path to
choose?
The only viable solution is to use a path relative to the highest
priority directory encountered in the VFS path, or write paths could be
'hijacked' by lower-priority mods.

This fixes these issues by:
- Adding a new lookup mode ('Real-path') that explicitly picks the real
path relative to the highest-priority subdirectory in the VFS Path.
- Preventing overwriting a real directory with a lower priority one in
general.
- Revert c0c8132dd4's GetRealPath change, re-introducing the function as
GetOriginalPath.

This also cleans up some duplication that led to empty mod folders in
the user mod path, and cleans up loading the 'user' mod.
It also makes it explicit that a directory must be passed to Mount().

Note that the new 'realpath' lookup can still be somewhat complex with
many mount points at various hierarchy levels, but it is at least
predictable/deterministic without having to be careful about populating
order.

Fixes #2553

Differential Revision: https://code.wildfiregames.com/D3728
This was SVN commit r25107.
2021-03-23 12:46:59 +00:00
5d1899785a Revert 4bb31f084e
4bb31f084e led to an issue in windows-specific code not detected by the
tests. I'll debug later.

This was SVN commit r25105.
2021-03-22 19:52:07 +00:00
4bb31f084e Make real directory paths on the VFS predictable.
Partial revert/fix of 2f19cf86d3 and 2567fee329.

Before this diff, it was possible for a mod containing a cache/ or a
config/ folder to get written to incorrectly.
The issue is VFS can map multiple directories to one 'virtual' path, for
reading mods. However, writing data is problematic: which path to
choose?
The only viable solution is to use a path relative to the highest
priority directory encountered in the VFS path, or write paths could be
'hijacked' by lower-priority mods.

This fixes these issues by:
- Adding a new lookup mode ('Real-path') that explicitly picks the real
path relative to the highest-priority subdirectory in the VFS Path.
- Preventing overwriting a real directory with a lower priority one in
general.
- Revert c0c8132dd4's GetRealPath change, re-introducing the function as
GetOriginalPath.

This also cleans up some duplication that led to empty mod folders in
the user mod path, and cleans up loading the 'user' mod.

Note that the new 'realpath' lookup can still be somewhat complex with
many mount points at various hierarchy levels, but it is at least
predictable/deterministic without having to be careful about populating
order.

Fixes #2553

Differential Revision: https://code.wildfiregames.com/D3217
This was SVN commit r25104.
2021-03-22 18:49:42 +00:00
2e4639e6dc Removes unused containers included in headers.
This was SVN commit r25004.
2021-03-03 23:01:08 +00:00
1c7f2661ce Add missing file in previous commit.
This was SVN commit r24996.
2021-03-03 15:18:44 +00:00
c16d961cd2 Enable support for powerpc64 systems. New problems with NVTT will be addressed in another diff.
Patch by: @tpearson-raptor
Comments by: @q66
Refs:
https://github.com/void-linux/void-packages/blob/master/srcpkgs/0ad/patches/ppc64.patch

Differential Revision: https://code.wildfiregames.com/D1619
This was SVN commit r24995.
2021-03-03 15:13:47 +00:00
9ed3b88d25 Guarantees no memset for allocation of DynamicArena::Block
Differential Revision: https://code.wildfiregames.com/D3609
This was SVN commit r24968.
2021-03-01 20:35:30 +00:00
7a71011149 Refactors smart pointers creation, reduces code duplication and improves exception safety.
This was SVN commit r24915.
2021-02-13 23:53:40 +00:00
fc7da5edd1 Fixes leaking of a file handle in case of an error. Refs #5288
Reported By: PVS-Studio
This was SVN commit r24903.
2021-02-13 17:57:37 +00:00
b2310ad70a Makes DynamicArena more cache-friendly and removes useless member.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D3560
This was SVN commit r24899.
2021-02-13 17:33:05 +00:00
dd9e14d5d1 Move SSE.h to a better place. Rename it to simd.h after discussion with @OptimusShepard and @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3437
This was SVN commit r24840.
2021-02-05 12:40:59 +00:00
321e3652f9 Fix and disable some pesky Windows warnings.
Differential Revision: https://code.wildfiregames.com/D3511
This was SVN commit r24838.
2021-02-05 12:20:06 +00:00
b1a89fbd89 Replaces UNICODE characters in the code by consistent ASCII characters.
Beside consistency improves reading for such console tools like svn diff
or vim diff.

This was SVN commit r24625.
2021-01-15 10:07:36 +00:00
687a9335f0 Remove cache detection
Reviewed by: wraitii
Fixes: #4360
Differential Revision: https://code.wildfiregames.com/D3165
This was SVN commit r24550.
2021-01-11 17:30:16 +00:00
5ee8354e99 Fix windows SEH hook when crashing in an std::thread
Follows 107d3d461f and other 'pthread->std::thread' diffs.

Windows uses Structured Exception Handling to allow reporting errors
(both C++ and hardware) nicely. This works by wrapping the code in a
__try __catch block.
The pthread wrapper did this automatically, but we now need to do it
explicitly for std::thread.

Tested by: Stan
Differential Revision: https://code.wildfiregames.com/D3261
This was SVN commit r24530.
2021-01-10 08:39:54 +00:00