1
1
forked from 0ad/0ad
Commit Graph

1893 Commits

Author SHA1 Message Date
12cceed3d9 Fix hotkeys not releasing properly.
a4852c4c01 changed hotkeys to use scancode, but didn't change g_keys to
reflect that, and this could break hotkey release.
This fixes that by explicitly using scancodes. Note that we might want a
g_keys map in the future, but it seems un-necessary at the moment.

Also remove the last remnants of 'negated' hotkeys, which were disabled
following b995135138.

Tested By: OptimusShepard
Fixes #5922

Differential Revision: https://code.wildfiregames.com/D3379
This was SVN commit r24645.
2021-01-16 15:24:58 +00:00
6a67e9a52d Address concerns in 5473393e30 (RL interface)
Fixes 5473393e30.

This:
- Puts RL code under the RL namespace to avoid name collisions
- Avoids usage of new/delete
- Adds more documentation
- Does general cleanup (const-correctness, move semantics, argument
types, early returns...)

Patch by: irishninja
Comments by: Vladislavbelov, wraitii
Differential Revision: https://code.wildfiregames.com/D2947
This was SVN commit r24631.
2021-01-15 16:30:05 +00:00
6282960991 Removes useless option for shadows on water
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3368
This was SVN commit r24630.
2021-01-15 15:45:39 +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
0944856cc1 Allow hotkeys/config settings to be empty.
This changes ConfigDB to support empty settings, marked with `= ""`. It
also changes hotkey to handle unused hotkeys, but stil have them appear
in the hotkey editor.
Fixes an issue where the current editor would bug when saving an empty
hotkey.
Removes the old system for unused hotkeys, adjust hotkey files
accordingly.

Reported by: FeldFeld
Differential Revision: https://code.wildfiregames.com/D3307
This was SVN commit r24618.
2021-01-15 08:05:10 +00:00
205486d6f3 Fix sound errors when no sound card is detected.
Based on a patch by: @Imarok
Refs: #3285

Differential Revision: https://code.wildfiregames.com/D1481
This was SVN commit r24551.
2021-01-11 18:56:33 +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
1bb336829d Add initial support for MCST Elbrus 2000 (e2k) CPU architecture
patch by: @r-a-sattarov
Reviewed by: @Stan
Fixes #5877, Refs #5869

Differential Revision: https://code.wildfiregames.com/D3162
This was SVN commit r24490.
2020-12-31 15:52:12 +00:00
d28d17e96c Remove SSE detection duplication in Colors and ModelRenderer
- Rename macros to be more explicit
 - Move detection code to a separate file
 - Remove a lot of checks in ARB mode (ModelDef.cpp would check for sse
multiple times per frame)
 - Make explicit the SSE2 dependency for Windows

Comments by: @vladislavbelov @wraitii @OptimusShepard
Differential Revision: https://code.wildfiregames.com/D3212
This was SVN commit r24489.
2020-12-31 15:37:28 +00:00
e009d322cc Add missing files in 4942cabab5
This was SVN commit r24488.
2020-12-31 14:27:02 +00:00
82d079d06c Add a Dev Overlay checkbox to activate RejoinTest from the session.
This makes this feature, very useful for checking for OOS, more easily
accessible.

Differential Revision: https://code.wildfiregames.com/D3199
This was SVN commit r24407.
2020-12-17 17:53:13 +00:00
dd0b56c8aa Replace DISCARD macro with ignore_result template.
Fixes eb7940b418.
As reported by Vladislav, there is possibly confusion on what exactly is
being ignored when there are multiple statements after DISCARD. Explicit
wrapping avoids that.

Differential Revision: https://code.wildfiregames.com/D3206
This was SVN commit r24397.
2020-12-15 09:03:44 +00:00
aa3bd08513 Fix non-visual replay on Windows. Use the actual detected resolution.
Differential Revision: https://code.wildfiregames.com/D3208
This was SVN commit r24381.
2020-12-12 08:18:24 +00:00
ea38089853 Fix userreport detection of sound cards
Differential Revision: https://code.wildfiregames.com/D3025
This was SVN commit r24367.
2020-12-10 18:36:05 +00:00
369c2e8801 Further header & precompiled cleanup, fix no-PCH builds.
GUIObjectBase is made a IGUIObject* to avoid including those headers
un-necessarily. Subsequent diffs ought to clean up the various of
pointers for that with a similar type with reference semantics.

Also:
- Add standard C and C++ headers (mostly cstring for memcpy, string and
vector) where needed.
- Swap out some includes for forward declarations
- Clean up un-necessary boost includes in precompiled and other headers.
- Clean up precompiled headers, including fewer things.
- Move ACPI to the windows-specific folder as it's included there only
and mostly specific to that platform.

Thanks Stan for the testing.

Differential Revision: https://code.wildfiregames.com/D3129
This was SVN commit r24352.
2020-12-09 14:39:14 +00:00
421fbfd278 Make Profiler2 configurable in visual mode. Non visual doesn't load the config so it's not possible. Also update the profiler2 page to be able to change the port
Differential Revision: https://code.wildfiregames.com/D2444
This was SVN commit r24340.
2020-12-07 08:11:23 +00:00
d92a2118b0 [SM78 2/2] Update to Spidermonkey 78 APIs
This ugprades 0 A.D. to the latest ESR at the moment of writing.

Mostly straighforward API changes (see meta-Bug 1633145)
- js::Class is merged with JSClass
- JSNewArrayObject becomes JS::NewArrayObject
- ArrayObject-functions are moved to a new public header Array.h
- JSMSG error messages have again been changed, requiring some tweaks.
- AutoValueArray becomes RootedBalueArray (Bug 1634435)
- 'uneval' is behind a Realm flag (Bug 1565170), but no removal is
planned in the short-term future.
- Some minor GC API changes (Bugs 1569564 and 1633405)
- Error reporting has had some tweaks, and error flags have been removed
(Bug 1620583)
- StructuredClone are now always thread-safe, simplifying an API change
introduced in SM52 (Bug 1607791)

Tested by: Stan, Freagarach, mammadori
Closes #5861

Differential Revision: https://code.wildfiregames.com/D3168
This was SVN commit r24333.
2020-12-06 14:03:02 +00:00
f44390f3fc Fix 3391542fec: AA / Sharpness not being correctly enabled at the start.
Reported by: OptimusShepard
Tested By: OptimusShepard, Stan
Differential Revision: https://code.wildfiregames.com/D3138
This was SVN commit r24318.
2020-12-03 12:19:44 +00:00
46399371ed Remove binary_function usage.
std::binary_function was a pre-C++11 construct, that is removed entirely
in c++17, and no longer necessary regardless.

Refs #5862

Differential Revision: https://code.wildfiregames.com/D3164
This was SVN commit r24301.
2020-11-30 15:45:05 +00:00
ad2f08a355 Use a more common locale, en_US.UTF-8 is not always present.
Refs https://code.wildfiregames.com/D2101
Thread:
https://wildfiregames.com/forum/topic/28209-binariessystemtest-fmtsprintf-f-with-separator/?tab=comments#comment-396875

This was SVN commit r24300.
2020-11-30 13:59:05 +00:00
02578e46bf [SM68 2/2] Update to Spidermonkey 68 APIs
No noteworthy API changes.

Details:
- Remove UTF16 script execution since UTF8 is supported in SM68 and
going forward
- Several new headers includes are required
- Realms replace Compartments as "global holders" (see meta-Bug 1357862)
- JSRequests are removed entirely (Bug 722345), see also aae417bd29
- Trivial API updates in ProxyHandlers, ArrayBuffer, Warnings, GC
reasons, Context options, ObjectIsFunction, ValueVectors and
JSCompartment

See also the migration guide:
https://github.com/mozilla-spidermonkey/spidermonkey-embedding-examples/blob/esr78/docs/Migration%20Guide.md

Tested by: Freagarach, Stan, Subitaneo
Fixes #5860

Differential Revision: https://code.wildfiregames.com/D3144
This was SVN commit r24297.
2020-11-30 09:03:20 +00:00
9ae084519f Fix most of the new vs2017 induced warnings.
Refs: https://code.wildfiregames.com/D3096
https://code.wildfiregames.com/D3103 #5862
Reviewed by: @wraitii
Comments by: @Angen
Differential Revision: https://code.wildfiregames.com/D3126
This was SVN commit r24268.
2020-11-26 22:28:50 +00:00
d7d0f142d8 Update (and debundle) fmt dependancy
We now support the most recent released version of `fmt` available (at
the time
of committing).

As we no longer patch `fmt` to get it to work within `pyrogenesis`, this
commit
also mostly removes its source from our code-tree (some headers are
retained for
Windows builds).


If you are a user of...

Linux/BSD: You will now need to have `fmt` installed from your
distribution's
           package repository. The minimum supported version of `fmt` is
`4.0`.

      OSX: The source is acquired and compiled (in `build-osx-libs.sh`),
           then included and linked automatically.

  Windows: The relevant header files are retained and, along with a
pre-built
           library, are the only things still bundled.


Accepted by: wraitii
Tested by:
* Freagarach (Lubuntu 18.04, `fmt 4.0.0`)
* Krinkle (MacOS 10.14, `fmt 6.1.2`)
* nephele (Alpine Linux)
* wraitii (MacOS 10.14)
* Nescio (Fedora 33, `fmt 7.0.3`)

Windows library files built by: Stan
Fixes: #3190
Differential Revision: https://code.wildfiregames.com/D2689
This was SVN commit r24267.
2020-11-26 21:01:32 +00:00
eb7940b418 Silence warnings about unused result.
Introduce a DISCARD macro to ignore the warn_unused_result attribute
used by Spidermonkey, and reuse it elsewhere.

Differential Revision: https://code.wildfiregames.com/D3147
This was SVN commit r24261.
2020-11-26 13:58:59 +00:00
3391542fec Fix rendering options failures following 8a1b3d6769
Two issues are fixed:
- Atlas on non-Mac crashed when started from within the game.
- MSAA options crashed if enabled on startup.

The underlying issues where improper shutdown, and assuming the renderer
was initialised than it might not be (in particular, the post-processor
wasn't).

Tested by: Stan
Differential Revision: https://code.wildfiregames.com/D3131
This was SVN commit r24233.
2020-11-22 11:09:13 +00:00
8a1b3d6769 Allow registering hooks that trigger on config changes.
Rendering options use this capability to simplify their implementation.
This makes it easier to add new options.

Comments by: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D2293
This was SVN commit r24228.
2020-11-21 11:57:14 +00:00
f6348b9617 Clean up header includes, add new forward declarations.
This cleans up many un-necessary header includes, either simply
providing nothing or forward declarations in their place.

No major compilation time change here, though this does reduce depencies
in some headers.

Also fix up old MacOS STL-include fixes that are no longer relevant.

Differential Revision: https://code.wildfiregames.com/D3128
This was SVN commit r24227.
2020-11-21 11:20:29 +00:00
ff924aaffc Fix no-PCH builds and checkrefs following a4852c4c01
Fixes D2814 / a4852c4c01.


Differential Revision: https://code.wildfiregames.com/D3123
This was SVN commit r24222.
2020-11-20 11:41:56 +00:00
640efa557e Add a hashing function for CStr8 & CStrW
Reviewed by: @wraitii
Differential Revision: https://code.wildfiregames.com/D3106
This was SVN commit r24218.
2020-11-19 15:25:27 +00:00
a4852c4c01 Let players remap hotkeys in-game, fix default hotkeys being qwerty-specific.
- Provide a "Hotkey" screen to let players remap hotkeys in-game using a
convenient setup.
- Make all .cfg hotkeys refer to scancodes (i.e. position on the
keyboard), so that default hotkeys now translate correctly for AZERTY,
QWERTZ and other layouts.
- 'BackSpace' is now an alias for 'Delete', and works for killing units.
This fixes #1917, as macs don't have a proper delete key and would need
to use Fn+Del otherwise. This shifts "timewarp" to Shift+BackSpace.

Functionally, this switches hotkeys to scancodes, as that makes more
sense (they are combinations of key positions, not actual text output).
SDL includes are cleaned and key names are reused.

Fixes #2850, Fixes #2604, Refs #1810, Fixes #1917.

Follows work in 3d7784d2af.

Various diffs tested by: Angen, Stan, Freagarach
Comments by: Nescio
Differential Revision: https://code.wildfiregames.com/D2814
This was SVN commit r24215.
2020-11-19 09:27:26 +00:00
fd8f5abd2e [SM52 2/2] Update to Spidermonkey 52 APIs.
No particularly noteworthy changes, as most complex API changes were
already supported in SM45 and done.
The addition of JSStructuredCloneData allows to remove our custom class.

Changes:
- InformalValueTypeName is back in the API, so remove our
implementation.
- Stop using JSRuntime entirely in favour of JSContext*
- JSPropertyDescriptor is renamed.
- CompartmentOptions are tweaked slightly (no functional changes)
- JS::Construct - API update.
- JSClass split - API update.
- A js.msg error message was removed, so we had to use a different one.
- Tests fix: fix comparison of union instances
- Disable warning in spidermonkey Vector.h
- Update error reporting to SM52 (minor API updates)
- Ignore warnings about unused return values (would come from OOM, which
isn't recoverable)

Most of the patching was done by Itms.

Tested by: Stan, Freagarach
Fixes #4893

Differential Revision: https://code.wildfiregames.com/D3095
This was SVN commit r24203.
2020-11-18 14:39:04 +00:00
935af751b9 Fix building without precompiled headers.
Broken in several recent diffs.
This also fixes (very) old missing standard headers.

Differential Revision: https://code.wildfiregames.com/D3110
This was SVN commit r24200.
2020-11-18 11:35:36 +00:00
25490bfec3 Improve JS Exception handling.
- Check for pending exceptions after function calls and script
executions.
- Call LOGERROR instead of JS_ReportError when there is a conversion
error in FromJSVal, since that can only be called from C++ (where JS
errors don't really make sense). Instead, C++ callers of FromJSVal
should handle the failure and, themselves, either report an error or
simply do something else.
- Wrap JS_ReportError since that makes updating it later easier.

This isn't a systematical fix since ToJSVal also ought return a boolean
for failures, and we probably should trigger errors instead of warnings
on 'implicit' conversions, rather a preparation diff.

Part of the SM52 migration, stage: SM45 compatible (actually SM52
incompatible, too).

Based on a patch by: Itms
Comments by: Vladislavbelov, Stan`
Refs #742, #4893

Differential Revision: https://code.wildfiregames.com/D3093
This was SVN commit r24187.
2020-11-15 18:29:17 +00:00
88bc973530 Delete useless JS::Value forward declaration.
ProfileViewer.h forward-declares JS::Value but doesn't use it. Starting
in SM68, JS::Value is a union, and this breaks at compilation.

Last modified in c02a7e1a7b, useless since 2af94c5898

Differential Revision: https://code.wildfiregames.com/D3102
This was SVN commit r24186.
2020-11-15 07:51:15 +00:00
aa15066c69 Rename ScriptRuntime to ScriptContext
SM52 essentially replaces JSRuntime with JSContext (though JSContext
itself was replaced with JSCompartment).
To prepare for this migration, rename all Runtime-related things to
Context.

Part of the SM52 migration, stage: SM45 compatible.

Patch by: Itms
Refs #4893

Differential Revision: https://code.wildfiregames.com/D3091
This was SVN commit r24181.
2020-11-14 10:57:50 +00:00
aae417bd29 Explicitly make ScriptInterface a Compartment wrapper.
ScriptInterface is now a wrapper around a JSCompartment, and thus always
has a well-defined global.

The error reporter is moved to ScriptRuntime in anticipation of that
handling JSContext in a later diff.

Part of the SM52 migration, stage: SM45 compatible.

Patch by: Itms
Tested By: Freagarach
Refs #4893

Differential Revision: https://code.wildfiregames.com/D3090
This was SVN commit r24180.
2020-11-14 08:46:32 +00:00
ab5616b4c4 Mass rename CxPrivate to CmptPrivate.
As part of the SM45->52 migration, a ScriptInterface becomes a wrapper
around a JSCompartment, not a JSContext, thus we ought to store private
data for the compartment and not the context.
This is a mass rename of CxPrivate to CmptPrivate to match that before
the actual changes.

Part of the SM52 migration, stage: SM45 compatible

Patch by: Itms
Tested By: Freagarach
Refs #4893

Differential Revision: https://code.wildfiregames.com/D3089
This was SVN commit r24177.
2020-11-13 16:44:15 +00:00
ee0d204bf6 Wrap JSAutoRequest and replace usage of JSContext* with the wrapper.
JSAutoRequest is required before calling into most JSAPI methods, for GC
reasons.
Calling it is required and fragile as one must not forget.
Further, SM52 and later make manipulating JSContext* dangerous as that
can cross Compartment(Realm in SM68) barriers (and ScriptInterface now
matches a Compartment).

The solution to both problems is to avoid using JSContext* in 0 A.D.
itself. To achieve this, a Request class is introduced, and must be used
to access a JSContext* from a scriptInterface. Further, Request is
passed to other ScriptInterface functions isntead of JSContext*, making
it obvious that the caller has already called it, reducing errors and
redundant JSAutoRequest calls.
Only JSNative functions now get a naked JSContext* without protection,
but the likelihood of forgetting a request is lower since many
ScriptInterface functions now expect it.

JSContext* is directly passed to JSAPI functions only.

Part of the SM52 migration, stage: SM45 compatible

Based on a patch by: Itms
Tested By: Freagarach
Refs #4893

Differential Revision: https://code.wildfiregames.com/D3088
This was SVN commit r24176.
2020-11-13 13:18:22 +00:00
66cc595c53 Encapsulate runtime creation.
- Makes it easier to change down the line (and change is coming)
- Allows making g_ScriptRuntime thread-local easily.
- Remove ParentRuntime, which is not used at the moment.

Part of the SM52 migration, stage: SM45 compatible.

Patch by: Itms
Tested By: Freagarach
Refs #4893

Differential Revision: https://code.wildfiregames.com/D3087
This was SVN commit r24171.
2020-11-12 09:34:40 +00:00
90367cdc53 Remove DefPersistentRooted and unneeded includes.
DefPersistentRooted is essentially a wrapper around unique_ptr and has
no real reason to exist.

Part of SM52 migration, stage: SM45 compatible.

Patch by: Itms
Tested by: Freagarach
Refs #4893

Differential Revision: https://code.wildfiregames.com/D3086
This was SVN commit r24170.
2020-11-12 08:24:30 +00:00
9669b5f1a9 Removes additional depth texture copying and reusing existing refraction depth.
Tested By: Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D3084
This was SVN commit r24160.
2020-11-11 18:46:52 +00:00
e038f7844b Fixes terrain overlays by removing fixed pipeline dependency.
Tested By: Freagarach, wraitii
Differential Revision: https://code.wildfiregames.com/D3074
This was SVN commit r24154.
2020-11-09 18:50:40 +00:00
9d53bed0bd Adds a LOS mask to Minimap.
Commented By: elexis, Stan
Differential Revision: https://code.wildfiregames.com/D2216
This was SVN commit r24141.
2020-11-08 08:51:54 +00:00
b7cbfecd19 Replacing losMap usages by existed and more consistent losTex.
losMap was introduces in fe21c5e023.

This was SVN commit r24130.
2020-11-04 22:55:34 +00:00
ad965e167d Moves simple water from fixed pipeline to shader pipelines (ARB/GLSL).
Commented By: Stan
Reported By: Freagarach
Tested By: Freagarach, Stan
Differential Revision: https://code.wildfiregames.com/D3059
This was SVN commit r24129.
2020-11-04 22:25:08 +00:00
acc254533b Refactors water shader to move refraction in a separate function.
Commented By: Angen, asterix, linkmauve, Stan, wraitii
Reviewed By: Angen
Tested By: Angen, asterix, linkmauve, Stan
Differential Revision: https://code.wildfiregames.com/D2908
This was SVN commit r24110.
2020-10-25 21:00:52 +00:00
acfd466c32 Fixes crash with mod packing on a wrong path.
Reviewed By: Stan
Differential Revision: https://code.wildfiregames.com/D3026
This was SVN commit r24087.
2020-10-04 10:17:34 +00:00
1273307b58 Don't detect audio card when audio is disabled, Fix compilation with --without-audio, fix a few warnings.
Reviewed by: @bb
Comments by: @vladislavbelov, @wraitii
Differential Revision: https://code.wildfiregames.com/D2809
This was SVN commit r24079.
2020-10-02 07:35:59 +00:00
92cbf5ead0 Reduces memory usage for fancy water by merging two textures.
Two textures were added in 9ce51f4357.

Reviewed By: wraitii
Tested By: Angen, Freagarach
Differential Revision: https://code.wildfiregames.com/D2983
This was SVN commit r24046.
2020-09-16 18:03:51 +00:00
26ae55cad0 Adds contrast-adaptiv-sharpening filter, also helps to partly remove FXAA texture blurring.
Patch By: OptimusShepard
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2642
This was SVN commit r23947.
2020-08-07 22:16:55 +00:00
395a10beb0 Fix compilation error on arch introduced by 5473393e30
CLogger.h uses std::deque but doesn't include the required header file.
This fails since 5473393e30 on Arch Linux

Reported by: navigo_ps91
Reviewed By: irishninja
Differential Revision: https://code.wildfiregames.com/D2928
This was SVN commit r23933.
2020-08-05 09:25:24 +00:00
01118c1196 Fix issues relating to SDL and wxWidgets interaction in Atlas.
This fixes the transfer of key inputs from WxWidgets to SDL, making it
possible to type in the in-game GUI from Atlas.

Also fixes whitespace issues in some Atlas files.

The following improvements are OSX specific:
- fixes an SDL assertion related to unused subsystems in Atlas.
- Remove the 'osxguiapplication' override. This fixes the editor
starting up in the background and not accepting input when launched from
in-game.
- To prevent an issue with sdl/wxwidgets conflict when running from
inside the game, actually boot a new instance (see #2427)


Reported by: wik (Many thanks for your investigations)
Tested by: trompetin17, Stan
Fixes #2427
Fixes #2846

Differential Revision: https://code.wildfiregames.com/D2788
This was SVN commit r23926.
2020-08-03 12:23:16 +00:00
21cdcf44bc Fix segfault when sending a very large net chat message.
This crash occured on the receiver machine, making it effectively a
remote crash attack.

Reported by: Riddler66
Based on a patch by: elexis
Fixes #5726

Differential Revision: https://code.wildfiregames.com/D2629
This was SVN commit r23918.
2020-08-01 15:25:13 +00:00
eb0d89e220 Delete unused function left behind in e9361705ae
e9361705ae cleaned up our config setup, but left behind isOverriden,
triggering a compilation warning.

Reported by: Imarok
This was SVN commit r23885.
2020-07-25 07:05:36 +00:00
Angen
6f1d17c954 Stop failing if mod is broken and display invalid mods in downloader [Mod Io]
If one mod is not signed or broken in any other way, mod.io downloader
fails and does not display any mod.
The problem with unsigned mod is that its metadata are empty.

That means one cannot break mod io downloader with mods having invalid
data.

mark mod as invalid and display in list as disabled and display reason
instead description to not spam ugly error messages on screen as this is
not error by the game but of the moder
report failed signatures back to list of mods
fail if property is not set using strict mode when getting from js
check in js for undefined values

Allow to filter only valid mods.

Differential Revision: https://code.wildfiregames.com/D2114
Reviewed by: @Itms
Fixes: #5459

This was SVN commit r23821.
2020-07-12 09:25:03 +00:00
9f4e398585 Fix rooting mistake in CGame::ReallyStartGame, detected by Bellaz89, fixes #5776.
Differential Revision: https://code.wildfiregames.com/D2869
Accepted By: Bellaz89
This was SVN commit r23815.
2020-07-11 14:24:09 +00:00
409c436ae2 Remove obsolete GetVideoMode platform-specifics, replaces by platform-agnostic SDL2`s APIs.
Before and after the commit we don't support multiple displays and HiDPI
properly.

Patch By: linkmauve
Tested By: Angen, elexis, Stan
Differential Revision: https://code.wildfiregames.com/D2476
This was SVN commit r23754.
2020-06-08 17:49:26 +00:00
b62308a301 Fix error in e9361705ae.
The HWDetect changes were not working properly.

Reported by: Nescio
Tested by: Nescio
Differential Revision: https://code.wildfiregames.com/D2799
This was SVN commit r23748.
2020-06-07 20:11:37 +00:00
e9361705ae Refactor HWDetect and rendering options setup.
Remove duplication when setting graphic options by reading the configDB
directly.
Properly protect the ModIO config keys.

Approved By: linkmauve
Refs #5538

Differential Revision: https://code.wildfiregames.com/D1931
This was SVN commit r23747.
2020-06-07 13:16:57 +00:00
945ac4fc3b Do not change the gamma of the display on startup.
Added in df6fceba62 to (most likely) have some control over brightness,
this conflicted with dimming utilities and would not play nice with
starting 0 A.D. in windowed mode.

If gamma handling were to be reintroduced later, it should only affect
the 0 A.D. window.

Reviewed By: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1976
This was SVN commit r23722.
2020-06-01 05:12:51 +00:00
ebd9786268 Add missing cpp files in last commit refs D2503
This was SVN commit r23704.
2020-05-28 18:18:00 +00:00
bb
5cfce692e7 Implement keyDown event
Change HotkeyPress event to be non-repeating (HotkeyDown to replace the
repeating case)
Fix shiftlag
Make toggle hotkeys only respond to the first SDL event.

Many iterations of review by: elexis
Test done by: Imarok
Comments By: vladislav, Stan
Reviewed By: wraitii
Fixes: #5055
Differential Revision: https://code.wildfiregames.com/D1398
This was SVN commit r23701.
2020-05-26 21:47:03 +00:00
76909984b2 Removes obsolete clipboard, replaces by platform-agnostic SDL2`s APIs. Refs D2476.
Patch By: linkmauve
Tested By: bb, elexis, Stan
This was SVN commit r23624.
2020-05-05 11:18:00 +00:00
32a105d6f8 Update cppformat from v0.11.0 to v1.1.0, fixes #5646, refs #3190.
Use the opportunity to rename the lib from cppformat to fmt, refs #4148.

Patch By: adrian
Rebased By: s0600204
Differential Revision: https://code.wildfiregames.com/D2613
This was SVN commit r23562.
2020-04-01 07:29:33 +00:00
c50a621cea Disable Quicksave during multiplayer, since the feature is not implemented and triggering it can crash the turnmanager.
Differential Revision: https://code.wildfiregames.com/D2584
Comments By: Stan
This was SVN commit r23429.
2020-01-22 14:05:17 +00:00
Angen
d33f1c7321 Remove not needed checks and code for VS2015 [VS2013 -> VS2015]
Some pragma warnings are not more needed for VS2015 compilation this
removes them.
Removing some specific code for older version than VS2015.
Forcing build to fail if compiling with VS older than VS2015.

Differential Revision: https://code.wildfiregames.com/D1396
Reviewed by: @Itms
This was SVN commit r23416.
2020-01-19 12:43:41 +00:00
7c72cb7bb9 Reports SDL builtin and runtime versions and video backend in hwdetect report.
Patch By: linkmauve
Differential Revision: https://code.wildfiregames.com/D2485
This was SVN commit r23412.
2020-01-18 16:45:50 +00:00
1750b0b34c Fixes GLES mode builds on Mesa and running on Intel Iris drivers.
Patch By: linkmauve
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2448
This was SVN commit r23410.
2020-01-17 21:13:51 +00:00
eafd44cfc5 Remove counterproductive lowercasing of GUI ScriptEvent names, refs #127.
a8f48ff7e0 introduced XeroXMB lowercasing of element and attribute names
as a feature.
cf9d8b9797, 4d390f501c, dda6268466 added bugfixes and TODOs because of
that.
f76d0ffdc6, 44fe226dd2 removed the XeroXMB lowercase feature.
This patch removes the lowercasing GUI bugfixes that don't fix any bug
anymore while increasing code complexity and lowering performance
(string copies).

Do not send mouse coordinates objects for events that do not relate to
the mouse.

Store event names in static const members to:
(1) improve performance, ensuring that the CStr is not reconstructed
every call,
(2) obtain compile errors when misspelling event names,
(3) allow reuse of the strings in inherited and friend classes.

Differential Revision: https://code.wildfiregames.com/D2445
Comments by Matei, Philip on 2006-03-11-QuakeNet-#wfg-Meeting-0126.log
and 2006-06-24-QuakeNet-#wfg-Meeting-0139.log

This was SVN commit r23403.
2020-01-15 16:00:37 +00:00
bbcd9b34cc Removes obsolete sys_cursor. Refs D2557.
sys_cursor was introduced in 7e1bcd5159 and partially in 5299dcad86.
Usage of sys_cursor was completely removed in 9a2d0f803e. At the moment
we use SDL and GL cursors.

Patch By: linkmauve
Comments By: Stan
This was SVN commit r23364.
2020-01-10 23:45:40 +00:00
8abc7c051b Include Pyrogenesis.h and os_path.h where needed
These two headers were missing in various places, preventing build in
some cases.

Patch By: linkmauve
Tested By: Freagarach
Differential Revision: https://code.wildfiregames.com/D2481
This was SVN commit r23321.
2020-01-02 18:07:40 +00:00
dd891f6193 Fix User Reporter worker thread always using a full CPU-Thread
Summary:
This bug was introduced in 62dd922bc0.
Fixed by not using the predicate of the `wait` command.
It was wrong and even if it was right it wouldn't be really usefull.

Reviewed by: Angen
Fixes: #5620

Differential Revision: https://code.wildfiregames.com/D2373
This was SVN commit r23259.
2019-12-18 17:19:56 +00:00
aef0c3c13a Move Ogre3D GLSL Preprocessor to a third_party folder and restore its original name. Also restore the Wrapper name to reflect what it's wrapping and move it to renderer.
Reviewed by: @Angen
Comments by: @elexis
Differential Revision: https://code.wildfiregames.com/D2338
This was SVN commit r23215.
2019-12-07 11:48:03 +00:00
5d2c20beb0 Replace boost::unordered_map, boost::unordered_set with std::unordered_map, std::unordered_set to establish consistency.
Replace boost::hash_combine with a lib/hash.h hash_combine performing
the same statement.
Replace inconspicuous global boost hash_value specializations with
std::hash specializations.
No performance difference was observed in three simple MeshManager
measurements.

Remove unused TAG_MASK and h_tag in h_mgr.cpp following 0748c5a75e.
Replace typedef with using keyword and sort header includes.

Differential Revision: https://code.wildfiregames.com/D2441
Tested on: clang  9.0.0, gcc 9.2.0, Jenkins/vs2015, Jenkins/gcc6

This was SVN commit r23191.
2019-11-25 14:30:25 +00:00
6a97c59c67 Change CGUIManager::SendEventToAll to send to all GUI pages.
Notably enables processing of GuiInterface messages when dialogs are
opened.

Differential Revision: https://code.wildfiregames.com/D2408
Tested on: clang 9.0.0, Jenkins/vs2015

This was SVN commit r23138.
2019-11-06 00:30:18 +00:00
a01e68a4ea Don't leak all GUI objects on name ambiguity following 5cc814759f and remove ERROR_GROUP GUI.
Delete CGUI::UpdateObjects and don't recreate the entire object
hierarchy by recursing through the existing one each time when inserting
one GUI Object.
Change CGUI::AddObject to only insert the one relevant pointer into the
map hierarchy, return success value and delete the child upon failed
insertion in the caller instead of leaking it.
Defer GUIM_LOAD and UpdateCachedSize recursion until all XML files
linked in the page XML file were loaded.
Delete related ERROR_TYPE NameAmbiguity, ObjectNeedsName, and unrelated
JSOpenFailed and in consistency with the rest, do the LOGERROR in the
scope where the error occurs.
Delete ERROR_TYPE InvalidSetting from 90f6641c1d unused following
85a622b13a, 1a49ccb294, ERROR_TYPE OperationNeedsGUIObject from
90f6641c1d unused following d3e56f0f57, see also e1014aad3b, refs #128.

This was SVN commit r23067.
2019-10-11 16:20:50 +00:00
d7ea078583 Removes unused variables after 7f38bef8e1 and 75d9c6293b. Reported by elexis.
This was SVN commit r23046.
2019-10-04 22:06:52 +00:00
75d9c6293b Adds projection type to CCamera to control usages of projection dependent properties.
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D2351
This was SVN commit r23036.
2019-10-03 18:51:40 +00:00
a19b14aeb7 Cleanup Camera related code and uses constant references where possible.
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D2350
This was SVN commit r23033.
2019-10-03 12:58:47 +00:00
1679510bb8 Resolve Loader memory leak from 1f1642bfe3.
Use C++11 featured shared_ptr to avoid conditional deletion in multiple
locations.
Drops C compatibility(?) of Loader.h.

Differential Revision: https://code.wildfiregames.com/D2331
Tested on: clang 8.0.1., Jenkins
Comments on IRC #wfg 2005-05-07
Refs 77d3c5d0b5, 5e3b0f06ec, f19d8dafee.

This was SVN commit r23019.
2019-09-30 08:49:00 +00:00
fc08fe60ab Support testing rejoins on turn 0, refs #3460, #4242, #5185, #5162, 2bf1dbfd13
Differential Revision: https://code.wildfiregames.com/D1522
This was SVN commit r22998.
2019-09-26 12:09:19 +00:00
00b58fc2ed Fix previous, don't save replay metadata if a multiplayer gamesetup page was opened and closed, refs 35408e7e7e / D2197, refs #5565.
This was SVN commit r22992.
2019-09-25 16:41:14 +00:00
35408e7e7e Save replay metadata for non-visual games too, refs #4577, #5548, fixes #5565.
Remove gui/common/ hack by going through the GUIInterface and fragile
EndGame() hardcoding by saving if and only if a ReplayLogger exists
following 7470e88624, refs #4020.
Refs D2211, D2213.

Differential Revision: https://code.wildfiregames.com/D2197
Based on patch by: irishninja
Tested on: clang 8.0.1, Jenkins

This was SVN commit r22991.
2019-09-25 10:06:12 +00:00
b9d413852b Cleanup GUI includes, whitespace, map iterators, nullptr.
Remove TODO comment about m_Children deletion from e21ebb37f5, refs
e05f939fab / D2311.

Differential Revision: https://code.wildfiregames.com/D2321
Tested on: clang 8.0.1, Jenkins

This was SVN commit r22976.
2019-09-22 23:28:25 +00:00
734d21464b Fix missing JSAutoRequest before JS_ReportError in various commits.
Differential Revision: https://code.wildfiregames.com/D2256
Tested on: clang 8.0.1, Jenkins

This was SVN commit r22949.
2019-09-20 19:18:07 +00:00
1bc6d778bb Delete GUI.h umbrella include following 8d0cb1b954.
Differential Revision: https://code.wildfiregames.com/D2304
Tested on: clang 8.0.1., VS2015, Jenkins
Comments By: Vladislav, Angen, Stan
Tested by: Angen
This was SVN commit r22941.
2019-09-20 13:11:18 +00:00
a936cc618a Move CGUIDummyObject class used for empty GUI objects to a separate file, and put the according CGUI page base object on the stack.
Differential Revision: https://code.wildfiregames.com/D2206
Tested on: clang 8.0.1., Jenkins

This was SVN commit r22931.
2019-09-18 20:51:45 +00:00
f1de8eb4ba Removes usages of duplication of Clamp function in gui, ps and renderer. Refs D1763.
This was SVN commit r22926.
2019-09-18 14:44:31 +00:00
003d588d13 Happy savegame hack removal following e0ea53a8ee, refs #2030.
Simply pass the JS value to the Save functions instead of letting those
obtain the data later from the topmost GUI page.
The JS hack incidence appears to be unused since 4b1297b328.

Differential Revision: https://code.wildfiregames.com/D2302
Tested on: clang 8.0.1, Jenkins

This was SVN commit r22922.
2019-09-18 00:17:56 +00:00
93fed19c6a Reliably report and reject invalid XML files following a18fbd12ec, refs #245, fixes #5222.
Don't write XMB files for XML files that failed the validation,
otherwise the XML validation error will not be reported on consecutive
program starts anymore (as the XMB is loaded, skipping validation).
This had resulted in invalid XML  going unnoticed and committed in
credentials.xml in 80dbd1f2a3.

Differential Revision: https://code.wildfiregames.com/D1574
Reported by: gameboy
Comments By: bb
Tested on: clang 8.0.1, Jenkins

This was SVN commit r22921.
2019-09-17 23:00:36 +00:00
61e3f1ec0d Fix hotkey events synching with hotkey state.
This is a semi-revert of 78bc56f33e and a correct fix for #3194.

The core issue is that the GUI handler must come behore the hotkey
handler, otherwise typing in boxes can set off hotkeys, and the hotkey
handler is repsonsible for updating the hotkey state.
Thus the GUI handler never has an up-to-date hotkey state, since that's
done later. 78bc56f33e fixed that by calling HotkeyInputHandler
manually, but that was still broken in some (unused) cases and was hacky
(indeed, it even looked hacky as noted by elexis).

The simplest fix is to split the 'hotkey creator' handler from the
'hotkey state change' handler, and run the 'hotkey state change handler'
before any other handler. Thus the gui handler remains in front of the
'hotkey creator' handler, but it has a correct hotkey state at any time.

Differential Revision: https://code.wildfiregames.com/D1839
This was SVN commit r22909.
2019-09-15 12:16:28 +00:00
c6e5c83b6d Workaround differences between libc and libstd string stream parsing of float/doubles.
libc and libstd differ on how they parse strings. This has a remote
chance of breaking mods and 0 A.D. code, and it broke tests on MacOS.

Add a workaround to ensure they are consistent.

Comments by: vladislavbelov
Fixes #2780

Differential Revision: https://code.wildfiregames.com/D1988
This was SVN commit r22908.
2019-09-15 12:02:26 +00:00
89e511def9 Allow JS GUI pages to find out if the game is running.
Differential Revision: https://code.wildfiregames.com/D2289
Tested on: clang 8.0.1.

This was SVN commit r22900.
2019-09-14 15:33:46 +00:00
a84e2e57df Use ScriptInterface::CreateObject for ToJSVal<CColor>, and for ToJSVal<Grid<u8> >, ToJSVal<Grid<u16> > used by the AIManager obtaining the pathfinder grid.
Make that function static, so that it can be used for these functions
without slowly having to obtain the ScriptInterface instance using
GetScriptInterfaceAndCBData just to get the JSContext again.
Remove few redundant conversions for CreateObject arguments.

Differential Revision: https://code.wildfiregames.com/D2128
Tested on: gcc 9.1.0, clang 8.0.1, Jenkins
Tedious performance testing in: D2128, D2127

This was SVN commit r22894.
2019-09-13 00:56:51 +00:00
508da732af Implement NetClient PushGuiMessage using parameter pack and ScriptInterface::CreateObject from D2080 / b4626359f5 to replace remaining Eval function calls.
Specialize ToJSVal<char[n]> to allow passing string literals as
arguments.
Freeze NetClient GUI messages.
Supersede related c-style casts with static casts.
Remove few unneeded conversions.

Differential Revision: https://code.wildfiregames.com/D2267
Tested: clang 8.0.1, Jenkins

This was SVN commit r22867.
2019-09-07 16:51:44 +00:00
de050ef7e2 Remove some unused Profiler.h and CLogger.h includes.
NativeWrapperDefns.h from 4e87fef3da, found in audit of 7c21a0cf8e.

Differential Revision: https://code.wildfiregames.com/D2268
Tested on: clang 8.0.1, Jenkins

This was SVN commit r22863.
2019-09-07 13:35:45 +00:00
d5c1fd09a4 Add ToJSVal<CRect> to make the conversion reusable, remove unused PSERROR_Scripting_ConversionFailed and dead catch.
Avoids the CRect copy or stops relying on optimization to avoid the
copy.
Split from D2142.

Differential Revision: https://code.wildfiregames.com/D2259
Tested on: gcc 9.1.0, Jenkins

This was SVN commit r22847.
2019-09-04 16:15:37 +00:00
c25ab670e6 Don't crash if a JS GUI author calls Engine.PopGuiPage too often.
Differential Revision: https://code.wildfiregames.com/D2255
Tested On: clang 8.0.1, Jenkins
Comments By: Stan
This was SVN commit r22846.
2019-09-04 15:45:48 +00:00
719f2d7967 Remove default CGame constructor values to make the code less error-prone, use CRenderer::IsInitialised() to test if the CGame should be rendered to remove indirection/proxies, making the code easier to read.
1c0536bf08 introduced a disableGraphics bool with a default value and
relied on the default being reasonable except for the few needed cases.
be93b31411 introduced the replayLog argument with a default value and
relied on the default being reasonable except for the few needed cases.
5747619c39 fixed a bug in that commit because the default value hadn't
actually been considered to be correct for all CGame constructor calls
and was wrong for two.

By requiring callers to specify the value, authors are forced to
establish thought which value is the correct one, as opposed to hoping
that a default value will be good by default.
As you can see in the diff, it also makes it easier to compare what
values changed if they are always defined in the caller.

Use CRenderer::IsInitialised() to determine if this is a non-visual
CGame,
for the purpose of removing less transparent proxy functions that are
unneeded as long as there are about 30 other calls testing for
CRenderer::IsInitialised() to determine if the Game should be rendered.

Supersedes:
* CGame constructor argument bool disableGraphics from 1c0536bf08.
* CGame::IsGraphicsDisabled() proxy from a533fff883 to the proxy from
1c0536bf08 and two local nonVisual = args.Has("autostart-nonvisual")
variables in GameSetup.cpp from a533fff883.

Call the Renderer destructor instead of calling delete on the
non-pointer (SAFE_DELETE would not be supported for instance).

Started as a preparation for D2197, but actually independent.

Differential Revision: https://code.wildfiregames.com/D2211
This was SVN commit r22785.
2019-08-25 11:02:55 +00:00
4919a6185e Remove unused GUIUtil functions, unused GUI includes and some tails in GUIUtil.
HasSetting from 3dfa23cd25 is actually redundant with
IGUIObject::SettingExists.
GetSettingPointer from 8f4f8e240f is superseded by GetSetting reference
following 3dfa23cd25 and 040624acff.
Deregister copying SetSetting variants for CStr and CStrW following copy
removal in 040624acff.
The default template <typename T=int> from c2a71e41bf can be removed
following FallBackSprite/FallBackColor removal in 9985fcf5bd and
RecurseObject unification in d4d5187c9d.
Delete all unused GUI includes, refs D1478.
Remove GUIUtil friend class following something.

Differential Revision: https://code.wildfiregames.com/D2225
Tested on: gcc 9.1.0, Jenkins

This was SVN commit r22779.
2019-08-25 08:57:36 +00:00
62dd922bc0 pthread -> std::thread (5/7) - Replace sdl semaphore with condition variable
This removes a dependency on the SDL_Thread header.

Differential Revision: https://code.wildfiregames.com/D1921
This was SVN commit r22772.
2019-08-24 11:26:58 +00:00
24f97d9fd5 Fix unreported glooxwrapper leaks following 61261d14fc, refs #2305.
Fixes an occurring leak indicated by the reported clang unused variable
compiler warning, refs #5294, #5550,
by adding the missing glooxwrapper::Jingle::Session::Session destructor
.

Fix two leaks that would have occurred if the according code had been
used:
Delete unused glooxwrapper::Jingle::ICEUDP::ICEUDP instead of adding the
missing destructor.
Delete unused glooxwrapper::Jingle::Content::Content instead of adding
the missing destructor.

Explain why glooxwrapper::Client::registerStanzaExtension doesn't leak
the new StanzaExtensionWrapper.
Explain why glooxwrapper::Jingle::Session::sessionInitiate doesn't leak
the new gloox::Jingle::Content, nor the new gloox::Jingle::ICEUDP.
Explain why glooxwrapper::SessionManager::registerPlugins doesn't leak
the new gloox::Jingle::Content and new gloox::Jingle::ICEUDP.
Explain why glooxwrapper::SessionManager::createSession doesn't leak the
gloox::Jingle::Session.

I will not leak memory in the glooxwrapper.
I will not leak memory in the glooxwrapper.
I will not leak memory in the glooxwrapper.

Use references in the StunClient and glooxwrapper to anticipate any
confusion as to whose obligation it is to delete variables when they are
passed around across several files.
Use static_cast and reinterpret_cast instead of C-style casts in the
StunClient.

Differential Revision: https://code.wildfiregames.com/D2094
Refs D2093 for the reported leaks.
Reviewed By: Josh
Comments By: fcxSanya, Vladislav for D2094, and echotangoecho, leper in
61261d14fc

This was SVN commit r22678.
2019-08-17 00:12:19 +00:00
107d3d461f pthread -> std::thread (3/7) - Replace pthread in other engine files
MapGenerator, TextureConverter, and some other files used pthread.

Differential Revision: https://code.wildfiregames.com/D1917
This was SVN commit r22649.
2019-08-12 08:16:28 +00:00
64b477625d Upgrade SpiderMonkey to version 45.0.2, refs #4893.
- Various build changes, in particular NSPR is not needed on Unix
anymore
- Add js/Initialization.h to source/scriptinterface/ScriptEngine.h
- Use nullptr instead of JS::NullPtr(), see
https://bugzilla.mozilla.org/show_bug.cgi?id=1164602
- Remove `JS::RuntimeOptionsRef.varObjFix`, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1171177
- Remove uses of `AutoIdArray`, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1191529
- `JS_InternUCStringN` has been renamed, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1178581
- `JS::Evaluate` now takes scope chains explicitly, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1097987
- Array functions (such as `JS_IsArrayObject`) are fallible and output
to params, see https://bugzilla.mozilla.org/show_bug.cgi?id=f3d35d8
- Remove `JSCLASS_CACHED_PROTO_WIDTH` workaround in our code, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1236373
- Remove compile'n go (`setCompileAndGo`) and replace it by
`setIsRunOnce` which will become the default in the future, see
https://bugzilla.mozilla.org/show_bug.cgi?id=679939
- Mark shared memory in direct access operations
(`JS_GetUint16ArrayData` and `JS_GetUint8ArrayData`), see
https://bugzilla.mozilla.org/show_bug.cgi?id=1176214
- Use new `JS::ObjectOpResult`, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1113369

Thanks to wraitii, elexis, Krinkle and historic_bruno for contributions
and comments, and to gentz, madpilot, s0600204 and Stan for testing and
indirect contributions.

Differential Revision: https://code.wildfiregames.com/D1510
This was SVN commit r22627.
2019-08-07 22:37:43 +00:00
7876ca7acb Fix gcc 8 compiler warning in FileIo.cpp about truncating use of strncpy [-Wstringop-truncation].
Refs #5294
Differential Revision: https://code.wildfiregames.com/D2159
Tested on: gcc 9, Jenkins

This was SVN commit r22626.
2019-08-07 15:38:40 +00:00
82f765b4cc Add Profiler2 static const member definition, since the declaration itself is insufficient for const ref access, as revealed in debug builds but not release builds following f89f90d56e and 9965f43067.
Differential Revision: https://code.wildfiregames.com/D2158
This was SVN commit r22625.
2019-08-07 14:45:13 +00:00
f89f90d56e Fix Profiler2 gcc 8 compiler warning about possible out-of-bounds array access and replace auto with their type, refs #5294, 3cbe96d24c.
Tested with gcc 9, clang 8

This was SVN commit r22624.
2019-08-07 09:12:28 +00:00
df40b88c71 Fix ModIo.cpp gcc 7 compiler warning about extended alignment by using a pointer for hash_state as expected by sodium anyhow, following 833c9f108c, refs #5294.
Differential Revision: https://code.wildfiregames.com/D2102
Reviewed By: Itms
Comments By: historic_bruno
This was SVN commit r22619.
2019-08-06 13:06:15 +00:00
bb
7e1f959db0 redo 2d57478781, Create a ConfigDB_CreateAndWriteValueToFile function to absorb some duplication in the gui
Move two duplicated lines from 7e14a33411 in a function

fixes 2d57478781
Reviewed By: elexis
Comments By: Stan, vladislav
Differential Revision: https://code.wildfiregames.com/D1939
This was SVN commit r22615.
2019-08-05 14:12:55 +00:00
5c4d124d2a Refactor renderer options.
This moves the renderer options into their own class to:@
  - allow one to only include the rendering options, not the whole
renderer header, when one wants access to rendering options.
  - centralise rendering changes and their side-effects.
  - clean up code.

Tested by: historic_bruno, Freagarach
Commented by: historic_bruno
Differential Revision: https://code.wildfiregames.com/D1929
This was SVN commit r22610.
2019-08-04 08:28:30 +00:00
9ece3e7088 Pthread -> std::thread (2/7) - Remove pthread in Profilers
Use std::thread and thread_local instead of pthread specific calls.

Differential Revision: https://code.wildfiregames.com/D1916
This was SVN commit r22608.
2019-08-04 08:11:58 +00:00
da4e601d8f Move GetDefaultGuiMatrix to a separate file.
The function was located in the wrong file, because it is not logically
related to IGUIObject settings.
The separate file allows the various users to include it without
including the GUIRenderer.

This was SVN commit r22605.
2019-08-04 03:52:00 +00:00
ad4de3d3be Delete CInternalCGUIAccessorBase class from c2a71e41bf.
Delete GetSetting/SetSetting variants that operate on a GUI page other
than the one that the setting is defined in; introduced in c2a71e41bf,
obsolete since f0d9806b3f.

Delete CInternalCGUIAccessorBase::GetObjectPointer as these variants
were the only caller for that.
Delete CInternalCGUIAccessorBase::HandleMessage from a08cbd2f74 as it's
an unnecessary proxy.
Delete CInternalCGUIAccessorBase::QueryResetting from 953f72a91c by
making ResetStates public, equal to UpdateCachedSize from 90bbd48a14
(public required for VS2015 but not gcc 9).
Move ResetStates to implementation file.

Tested on: gcc 9, VS2015

This was SVN commit r22563.
2019-07-28 02:39:52 +00:00
b7d1ea671f Update Errors definition file following:
I18n Script SetupFailed removal in 818ea52c3b,
Renderer VBOFailed removal in 2f28b07356,
CVFSFile InvalidBufferAccess removal in b253cbbee6.

Differential Revision: https://code.wildfiregames.com/D2124
This was SVN commit r22559.
2019-07-26 19:27:10 +00:00
1e9cc3d43e Fixes missing Engine.DisplayErrorDialog in hwdetect.js (lost in 4b1297b328).
Fixes #5533.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2123
This was SVN commit r22549.
2019-07-25 05:21:25 +00:00
ae7e43ff19 Alt+tab fix for ca9109be75 - call sound IdleTask in Atlas and swap buffers only once in Atlas.
- ca9109be75 moved SwapBuffers inside Render - this makes Atlas call it
twice in a row which might behave oddly (did not seem to though) and
anyways was wasteful.
- ca9109be75 moved IdleTask from the sound manager outside of Render.
This means atlas never called IdleTask, and this broke sounds after a
few seconds.

Reviewed By: Angen
Differential Revision: https://code.wildfiregames.com/D2029
This was SVN commit r22544.
2019-07-24 16:40:34 +00:00
b4626359f5 Provide ScriptInterface CreateObject and CreateArray functions to replace Eval calls following 7c2e9027c2, 1c0536bf08 and later.
Differential Revision: https://code.wildfiregames.com/D2080
Previous version reviewed By: Krinkle
Comments By: historic_bruno, wraitii
This was SVN commit r22528.
2019-07-22 19:35:14 +00:00
13209c3183 Revert 09916ce6cb which broken jenkins build.
This was SVN commit r22519.
2019-07-20 13:10:53 +00:00
09916ce6cb Fix incorrect use of setlocale() in cppformat CStr tests following 61db02790c
Reported By: elexis
Differential Revision: https://code.wildfiregames.com/D2013
This was SVN commit r22518.
2019-07-20 12:57:03 +00:00
feb88a337a Pass arbitrary arguments to GUI events / SendEventToAll and remove loading screen progess workaround, refs D1716, 6d792365aa, bd3bd084c0, 4b1297b328, db5d4bb5f1.
Differential Revision: https://code.wildfiregames.com/D1754
Reviewed By: Itms
Comments By: leper
This was SVN commit r22515.
2019-07-19 21:15:04 +00:00
8a32b0b3d4 Fix some gcc 8 and gcc 9 compiler warnings that were thrown 4500 times.
Refs #5294
Differential Revision: https://code.wildfiregames.com/D2055
Reviewed By: Vladislav
This was SVN commit r22443.
2019-07-09 00:18:48 +00:00
01161e3451 Fix build without precompiled headers following the Atlas UTF8 fix in 800bf0da24 and ThreadUtil include removal in ba736916fc.
Differential Revision: https://code.wildfiregames.com/D2043
Reviewed By: Vladislav, wraitii
This was SVN commit r22437.
2019-07-07 21:52:52 +00:00
da2f644428 Adds a possibility to disable saving of replay in autostart mode.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2017
This was SVN commit r22432.
2019-07-03 21:36:40 +00:00
8babfe2330 Refactors camera projections - makes projection functions of camera more clear.
Reviewed By: elexis
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2012
This was SVN commit r22404.
2019-06-26 22:54:05 +00:00
61db02790c Fix cppformat failures on MacOS tests.
cppformat tests failed on MacOS - the global locale was not set and
defaulted to something unexcpeted.
It is now fixed to US notation.

Patch By: Krinkle
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1978
This was SVN commit r22378.
2019-06-16 15:25:17 +00:00
ba736916fc Clean up ThreadUtil, use standard C++11 constructs instead of custom ones.
ThreadUtil shipped a scope lock and a mutex implementation, which can be
removed since we now have these in the standard library.
This lets us clean up this header which get included everywhere (through
profiler includes).

Tested By: Angen and Stan
Differential Revision: https://code.wildfiregames.com/D1915
This was SVN commit r22344.
2019-06-06 19:30:48 +00:00
ca9109be75 Fix a crash on some system when Alt-tabbing during game setup.
Move checks for rendering a frame in Render() to avoid missing calls to
this functions, which can crash on certain systems.

Move the sound manager's idle task out of Render().
Move the buffer swapping in Render() since we do not need to swap
buffers unless we are rendering.

Patch By: Angen
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1495
This was SVN commit r22314.
2019-05-28 13:18:32 +00:00
dc34d9c5d0 Fix possibly using uninitialized global in 80635665f7 and rename GetDirectoryName
Reviewed by: weberkai
Fixes: #4789
Differential Revision: https://code.wildfiregames.com/D1852
This was SVN commit r22284.
2019-05-14 10:13:02 +00:00
75d0c56070 Don't crash when calling the profiler from a 'non-main' thread
Motive behind the change: calls to Profile() currently crash unless they
are triggered from the main thread, but it's somewhat difficult to know
that from the code. It makes more sense to silently ignore those
particularly so we can easily have the same code be threaded or not.

This also removes a few profiling calls that don't make much sense.

Differential Revision: https://code.wildfiregames.com/D1853
This was SVN commit r22248.
2019-05-04 15:03:10 +00:00
3a031128f7 Refactor and cleanup of CGameView.
Commented By: asterix, elexis, Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D1571
This was SVN commit r22214.
2019-04-22 22:12:08 +00:00
285db48813 Simple cleanup of Shapes, removes old style format.
Reviewed By: wraitii
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D1809
This was SVN commit r22213.
2019-04-22 21:53:11 +00:00
3a7335d723 Removes unused iterator in Xeromyces. Its usage was removed in a07add11c6.
Patch By: Angen
Differential Revision: https://code.wildfiregames.com/D1814
This was SVN commit r22170.
2019-04-07 18:23:04 +00:00
bb
702127b8df Add autostart conquest default description to readme.txt and add endless support for autostart in both readme.txt and GameSetup.cpp
Reported By: elexis
Fixes: 6d54ab4c1f, 22903b09a6

This was SVN commit r22112.
2019-03-16 14:20:28 +00:00
db5d4bb5f1 SpiderMonkey-related changes in preparation for the upgrade to SpiderMonkey 45, refs #4893.
- Remove JSVAL_ZERO and JSVAL_NULL
https://bugzilla.mozilla.org/show_bug.cgi?id=1177825
- Remove *_TO_JSVAL https://bugzilla.mozilla.org/show_bug.cgi?id=1177892
- Drop support for parent object in the deserializer
https://bugzilla.mozilla.org/show_bug.cgi?id=1136345,
https://bugzilla.mozilla.org/show_bug.cgi?id=805052
- Correctly use boolean values in JS::RuntimeOptionsRef
- Use JS_FN instead of JS_FS: in future versions, JS_FS is not public
because it isn't supposed to be used in JSAPI code
- Allow to select flags for global objects, and correctly mark progress
bars in the loading screen as not readonly+permanent
- Remove empty JSI_props in IGUIObject

Reviewed By: wraitii, elexis
Differential Revision: https://code.wildfiregames.com/D1716
This was SVN commit r22052.
2019-01-13 16:37:41 +00:00
651cf8b364 Split CColor from Shapes.
Reviewed By: wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1515
This was SVN commit r22051.
2019-01-13 15:38:41 +00:00
43a291a071 Simple refactoring of Singleton. Make it non-copyable.
Reviewed By: wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1564
This was SVN commit r22050.
2019-01-13 15:11:40 +00:00
43758bcb92 Fix warnings in vs2015 when building tests.
Reviewed by: @Angen, @Itms
Differential Revision: https://code.wildfiregames.com/D1678
This was SVN commit r22048.
2019-01-12 16:23:47 +00:00
74a26820f2 Add a confirmation message when packaging ends.
Reviewed by: elexis
Differential Revision: https://code.wildfiregames.com/D1585
This was SVN commit r22042.
2019-01-07 23:57:18 +00:00
14a7147540 Removes active values from UserReport, they are not hardware statistics.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D1621
This was SVN commit r22038.
2019-01-06 21:18:55 +00:00
2d56e62e11 Refactor build information getters and remove the useless code.
Reviewed By: elexis, Stan
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1348
This was SVN commit r22035.
2019-01-06 14:32:54 +00:00
962815c898 Fix build without PCH for some targets.
Patch By: Angen
Reviewed By: vladislavbelov
Tested By: Stan, vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1361
This was SVN commit r21964.
2018-12-28 14:58:35 +00:00
6fe427664b Bump version to alpha 24.
Last alpha 23 commit was 0044c5c2e8.

Differential Revision: https://code.wildfiregames.com/D1705
Reviewed By: Itms
Comments By: Stan, smiley, bb
This was SVN commit r21951.
2018-12-26 11:28:37 +00:00
d7ff9722c6 Don't delay the pyrogenesis shutdown for 5 minutes but at most 10 seconds if the server is not responding, refs #968;
in particular Philips server not responding to SSL which became a
requirement by the client following 209bab0255 or following GDPR 32.1.a,
refs #5257 while the new backend is not ready yet.

Mark file emptied in 209bab0255 as deleted.
Add scrolling to the UserReporter window, so that the timeout error
strings that became visible following the bugfixes in b496168d0a and
c898c19735 and don't overlap with the buttons.

This was SVN commit r21900.
2018-10-09 16:27:42 +00:00
209bab0255 New UserReporter Terms and Conditions, hopefully GDPR compliant, refs #5257.
Require SSL for the UserReporter clientside.

Differential Revision: https://code.wildfiregames.com/D1598
Includes contributions by bb and Itms

This was SVN commit r21898.
2018-10-05 22:19:28 +00:00
b496168d0a Fix UserReporter passing uninitialized data through the JS Interface and displaying it in the UI following 0da7e822ff if the curl connection failed.
Display a generic error message using curl_easy_strerror if the detailed
error description is unavailable.

Differential Revision: https://code.wildfiregames.com/D1625
This was SVN commit r21892.
2018-09-23 00:20:17 +00:00
d19e32b2ea Fix mod.io curl error handling, following 833c9f108c / D1029 / cdc324f7f5.
Displays if the server is down instead of a misleading unrelated later
error message.

Differential Revision: https://code.wildfiregames.com/D1608
This was SVN commit r21891.
2018-09-23 00:06:25 +00:00
27c107a448 Inform users that they are subject to the mod.io Terms and Conditions and Privacy Policy and provide links following 833c9f108c / D1029. Refs GDPR #5257.
Add link to feedback.wildfiregames.com, which demonstrates users how
their data is going to be used.

Add link buttons to the Terms dialog (refs #4583), so that users are
informed of the terms prior to becoming subject to them.
Don't link the DMCA / copyright terms of mod.io now since I found no UI
with support for 3 buttons that doesn't appear unsatisfyingly ugly.
Adds 3 button captions and 1 tooltip string.

Differential Revision: https://code.wildfiregames.com/D1627
A Comment and a relatable patch in D1601 by smiley / (-_-).

This was SVN commit r21890.
2018-09-22 16:27:49 +00:00
dd008af2f8 Write UserReport data to local logfiles, so that users can review the personal data impact without exposing the data to JS/mods, refs #5257, b3438cabd2.
Write the logfiles even if the UserReporter is disabled, so that the
assessment can be done prior to use.

This was SVN commit r21868.
2018-08-22 22:17:42 +00:00
b3438cabd2 Hide userreporter ID from mods and logfiles, since it shall be used as an authentication token for GDPR personal data requests, refs #5257, f51f78c999 / D1563.
Comments by: Vladislav in irc on 2018-08-13
This was SVN commit r21867.
2018-08-22 16:02:05 +00:00