1
0
forked from 0ad/0ad
Commit Graph

19756 Commits

Author SHA1 Message Date
d403d750f0 Stop copying color every draw call for every GUI object using colors.
Avoid color copies for rendering Draw calls in
GUIRenderer::UpdateDrawCallCache, CButton::Draw, CChart::DrawAxes,
CDropDown::Draw, CList::DrawList, COList::DrawList, refs #1984,
8f4f8e240f, 3028551b91, a905fbbc98.
Avoid color copies during XML loading in CGUI::Xeromyces_ReadImage,
CGUI::Xeromyces_ReadEffects, COList::HandleAdditionalChildren.
Add CGUI::HasPreDefinedColor and mark m_PreDefinedColors,
CGUI::GetPreDefinedColor, IGUIButtonBehavior::ChooseColor() as const for
consistency with the other "databases", refs 3028551b91.
Mark CGUIColor as NONCOPYABLE to add compiler errors if there is an
unexplicit copy, refs 3028551b91.
Explicit ugly copy in CGUI::Xeromyces_ReadColor and
CGUIColor::ParseString.
Deregister copying <CGUIColor>GetSetting functions, refs 8f4f8e240f.
Uses the const ref GetSetting from 3dfa23cd25.

This was SVN commit r22694.
2019-08-19 12:53:58 +00:00
3dfa23cd25 Use a new GetSetting returning a reference instead of GetSettingPointer when the setting is known to exist.
Differential Revision: https://code.wildfiregames.com/D2192
This was SVN commit r22693.
2019-08-19 10:32:29 +00:00
5cfef19a06 Simplify the translations maintenance script.
- Removed bashisms
- Removed the call to SVN update which is usually done beforehand in CI
- Removed the git alternative which is never used
- Fixed the call to poediff which seems to fail with latest poediff

Tested on Jenkins since the revamp.
Reviewed By: Gallaecio
Differential Revision: https://code.wildfiregames.com/D2078
This was SVN commit r22690.
2019-08-18 18:13:04 +00:00
9985fcf5bd Move GUI<>::FallBackSprite and GUI<>::FallBackColor to CGUIColor::operator|| and CGUISpriteInstance::operator||.
Leaves only setting management in GUIutil.h.

Differential Revision: https://code.wildfiregames.com/D2185
This was SVN commit r22689.
2019-08-18 15:17:49 +00:00
4e55808cf9 Scipio Aeminialus → Scipio Aemilianus
Reported by xtother90 at Transifex

This was SVN commit r22688.
2019-08-18 13:44:57 +00:00
e0c739c8d9 Standardized catafalque aura descriptions
Differential Revision: D1807
This was SVN commit r22687.
2019-08-18 13:25:54 +00:00
491fe12f85 Capitalize classes in team bonus descriptions
Differential Revision: D2179
This was SVN commit r22686.
2019-08-18 13:12:59 +00:00
4bdea62915 Upgrade into a %(name)s → Upgrade to %(name)s
Differential Revision: D2165
This was SVN commit r22685.
2019-08-18 13:03:31 +00:00
Alexandermb
a33857537d Animations re-export "Cavalry Javelinist Rider Animations"
Thread:
https://wildfiregames.com/forum/index.php?/topic/26012-task-animations-re-export-and-unit-meshes-fix/page/7/&tab=comments#comment-382340

Comment: An animation re-export of all unit meshes and armatures for fix
3 duplicated vertex groups in all files from the initial infantry
update.

This was SVN commit r22683.
2019-08-17 12:59:57 +00:00
c9c82d9daf Use shared_ptr to avoid copying and deleting SGUIImageEffects, 2.5x faster in a benchmark, refs ba0ebd6644.
Differential Revision: https://code.wildfiregames.com/D2184
Refs 3028551b91/D2163
Tested on: gcc 9, Jenkins

This was SVN commit r22682.
2019-08-17 11:52:57 +00:00
742f361b2d Improve performance of ScriptInterface::CreateObject from b4626359f5 / D2080 by creating the JSAutoRequest struct only once instead of once per property.
Differential Revision: https://code.wildfiregames.com/D2127
Comments By: Vladislav
This was SVN commit r22680.
2019-08-17 03:30:07 +00:00
ba56191dc2 Move CGUI::GenerateText to CGUIText constructor, CGUI::DrawText to CGUIText::Draw, SGenerateTextImage from CGUI to CGUIText.
Makes GUI text construction 30x faster for empty strings, otherwise less
than 1% faster.
Split the constructor into smaller helper functions to reduce nesting
and improve readability.
Change m_GeneratedTexts from pointer to reference, so that one doesn't
have to keep track to delete it correctly in several places, without
having to resort to copy or move assignments but constructing in place.
Mark CGUIText as NONCOPYABLE and MOVABLE which is already implicitly the
case due to the CGUISpriteInstance members, refs 0a7d0ecdde/D2133,
D2163/3028551b91.

Differential Revision: https://code.wildfiregames.com/D2168
Prepared by the GUIText.h file split in 838889ab12 / D2167.
Comments By: Vladislav
Tested on: gcc 9, clang 8, VS2015, Jenkins
Inlining tested using: clang -Rpass=inline and gcc -Winline

This was SVN commit r22679.
2019-08-17 01:32:11 +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
Alexandermb
06c1bca952 Fix issue with two wrong path and name following c2e9e2263a
Noted by @minohaka

This was SVN commit r22677.
2019-08-16 21:58:25 +00:00
86c151ebaa PushGuiPage support for passing a function instead of a function name.
Allows coding the GUI without global functions which break
prototype-oriented coding, refs #5322, fixing the concern in 4b1297b328.

Supports stacked message boxes and removes the according workaround.
Change structree / civinfo switch-dialog code from 760a47335d to perform
the callback for page that actually registered the callback.
Ensure the parent that the callbackhandler is always called if the page
is closed.
Merge PopGuiPage and PopGuiPageCB following that choice, incidentally
leaving cleaner code.

Differential Revision: https://code.wildfiregames.com/D1684
Comments by: Yves, Vladislav, wraitii, leper
This was SVN commit r22676.
2019-08-16 18:46:04 +00:00
a06cfe309b Fix miniupnp memory leak from 667537ee49 again after it was fixed in 5876ec38d1 and probably accidentally reverted in 0ba25e9968, refs #2305.
Differential Revision: https://code.wildfiregames.com/D2183
Comments by: wraitii
Tested on: gcc 9, valgrind

This was SVN commit r22675.
2019-08-16 18:07:23 +00:00
8a4d2a8ccc Fix e83f24e3a6 and 1ff20e8f6a miniupnpc leak and crash on thread exit.
std::thread crashes when destroyed without being joined or detached.
Joining would wait on the UPnP thread, which can take upwards of 10
seconds, so detach instead.

Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2181
This was SVN commit r22674.
2019-08-16 17:38:58 +00:00
Alexandermb
c2e9e2263a Animations re-export "Skeleton and Bodies"
Thread:
https://wildfiregames.com/forum/index.php?/topic/26012-task-animations-re-export-and-unit-meshes-fix/page/7/&tab=comments#comment-382340

Comment: An animation re-export of all unit meshes and armatures for fix
3 duplicated vertex groups in all files from the initial infantry
update.

This was SVN commit r22673.
2019-08-16 17:32:21 +00:00
43df94c246 Fix 2a485c5e3b Wind computation - switch to signed integers.
Silences a GCC 9 warning and the logic was faulty.

Reported by: elexis
Differential Revision: https://code.wildfiregames.com/D2180
This was SVN commit r22670.
2019-08-15 17:02:53 +00:00
e370c509a6 Small closePage() cleanup for D1684.
Rename close() to closePage() for structree / template viewer / civ info
for global consistency.
Remove a splashscreen proxy and move splashscreen closing from XML to
closePage() in JS.

This was SVN commit r22669.
2019-08-15 13:29:11 +00:00
2a485c5e3b Wind speed computation rework.
This reworks wind-speed computation to not use a blurred-heightmap
approach but rather a slightly more wind simulation approach. It fixes
issues near the edges of some maps.

Differential Revision: https://code.wildfiregames.com/D1721
This was SVN commit r22668.
2019-08-15 11:56:00 +00:00
99f770f911 typography corrections in quotes
Differential Revision: D1547
This was SVN commit r22667.
2019-08-15 09:24:13 +00:00
1ff20e8f6a pthread -> std::thread (4/7) - Replace pthread in remaining files
This removes pthread mutexes/threads from:
- vfs
- the resource handler manager
- timer
- the network server.

This allows removing it from our general posix include header.

Differential Revision: https://code.wildfiregames.com/D1920
This was SVN commit r22666.
2019-08-15 09:07:16 +00:00
9f42c8d6ae Move manual page values back to the page itself due to a lack of that page being reusable.
Instead encourage developers to create a custom GUI page for their
needs, since that is cheap and since they won't be stuck with this
inextensible page.

0da7e822ff reused the manual page to display userfeedback terms.
dfacf5358c moved more values to the calling pages and introduced a Title
string that is never displayed.
da49aa1541 stopped using the manual page to display terms, because one
could actually not reuse the page to do something more than just
displaying text and using one website link.

refs D1684

This was SVN commit r22665.
2019-08-14 13:55:45 +00:00
6ad90aa1b8 Delete wrongful proxy CGUIManager::GetPreDefinedColor from f0d9806b3f.
It is wrong because the predefined colors should be loaded from the GUI
page that requests to have the color parsed, which may be different from
the topmost page.
Similar to FindObjectByName removed in f9b529f2fb.

Achieve this by implementing the CGUISetting<CGUIColor>::FromJSVal
specialization, moved from ScriptInterface::FromJSVal<CGUIColor>,
instead of adding a CGUI pointer to CGUIColor.
Mark ScriptInterface::FromJSVal<GUIColor> and inherited
CColor::ParseString explicitly as deleted, so that people get a compile
error if they forget to check for predefined colors when parsing a
color.

Refs #5387, D1746 > D1684 > this > f9b529f2fb, 9be8a560a9, 415939b59b,
2c47fbd66a, 85a622b13a.

Differential Revision: https://code.wildfiregames.com/D2108
Tested on: clang 8, VS2015

This was SVN commit r22663.
2019-08-13 18:00:41 +00:00
02d23d1ff0 Remove useless proxy GUI<int>::ParseColor, refs 31f0e62c83, 2c14d94559.
Tested on: clang 8.

This was SVN commit r22662.
2019-08-13 15:42:14 +00:00
64e80471d0 Replace JS_THIS_OBJECT and JS::CallReceiver in preparation for SpiderMonkey 49 and 61.
Differential Revision: https://code.wildfiregames.com/D2173
Refs #4893, D1699, D2142, D844, 7c2e9027c2, ...
Refs https://bugzilla.mozilla.org/show_bug.cgi?id=1270977
Refs https://bugzilla.mozilla.org/show_bug.cgi?id=1255800
Tested on: clang 8, VS2015, Jenkins

This was SVN commit r22661.
2019-08-13 14:11:43 +00:00
8dc425be5d Update update-workspaces.sh and premake5.lua with the with-system-mozjs45 flag from SpiderMonkey 45 in 64b477625d, refs #4893.
Differential Revision: https://code.wildfiregames.com/D2170
This was SVN commit r22660.
2019-08-13 11:30:46 +00:00
Alexandermb
a0be131afe Add a better normal map for celt_shield texture
This was SVN commit r22658.
2019-08-13 02:20:01 +00:00
1a06f6ddad Revert the move from territory_pull to special/ in 20da0b727f, introduce template variants to make the feature more versatile, fix missing the Visibility component, refs b05879e151.
The special/ folder is determined by the TemplateLoader to not store
entities placeable in Atlas.

Differential Revision: https://code.wildfiregames.com/D2083
Patch by: Nescio
Reported by: fatherbushido
This was SVN commit r22657.
2019-08-12 15:16:37 +00:00
0a22f32a21 Fix svn prop lineendings following 332e59bdbe, 8d4d70add9, 5c4d124d2a.
This was SVN commit r22656.
2019-08-12 15:00:47 +00:00
1f421c266a Fix ESLint no-multi-assign, default-case, no-empty, no-shadow warnings, refs #5524.
Differential Revision: https://code.wildfiregames.com/D2146
Based on patch By: Krinkle
This was SVN commit r22655.
2019-08-12 14:48:10 +00:00
057d033541 Duplicate clearChatMessages since that ends up being cleaner
than having a stray function in gui/common/ that refers to page specific
names and logic with a try-catch block to shield against reference
errors, refs #3396, 6e80288d30, 25e6136786.

Incidentally fixes ESLint no-empty hint triggered for empty catch
blocks, refs #5524, D2146.

This was SVN commit r22654.
2019-08-12 14:13:04 +00:00
a908ce889c Hierarchical Pathfinder - Add Global Regions / Optimise MakeGoalReachable
Optimise MakeGoalReachable using global regions, by leveraging the fact
that we can easily know which goal regions we can reach. Particularly
for point-goals, it becomes almost instant.
This does not change hashes.

Differential Revision: https://code.wildfiregames.com/D1835
This was SVN commit r22653.
2019-08-12 13:19:01 +00:00
07dfacdc67 Fix build without precompiled headers in 107d3d461f.
Also remove an un-needed variable.

Patch by: elexis
This was SVN commit r22652.
2019-08-12 12:56:32 +00:00
353c415072 Hide ESLint no-unmodified-loop-condition hint for a while (const) in gamesetup.js, refs #5524.
Differential Revision: https://code.wildfiregames.com/D2147
Patch By: Krinkle
This was SVN commit r22651.
2019-08-12 11:53:30 +00:00
214f805f83 Diplomacy and Objectives dialog hotkey.
Delete unused pauseMenuButton from 7a7ebaa983.

Differential Revision: https://code.wildfiregames.com/D2132
Reported By: minohaka
This was SVN commit r22650.
2019-08-12 10:54:25 +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
8ef8a9de89 Fix VisualActor OOS introduced in rp22586
A call to SelectAnimation("idle") was left over.

Reported by: elexis
Fixes #5552

Differential Revision: https://code.wildfiregames.com/D2169
This was SVN commit r22648.
2019-08-12 08:05:04 +00:00
801d5cbe68 Fix checkrefs script following eab4f9fdde (phenotypes), and fix the unit_motion_integration_test map from b637fdbae9.
In eab4f9fdde the `gender`-tag was replaced with `phenotype`. the
checkrefs script however was not updated and complained.

b637fdbae9 introduced a map that checkrefs did not validate.

Based on a patch by: Freagarach
Differential Revision: https://code.wildfiregames.com/D2141
This was SVN commit r22647.
2019-08-12 08:03:23 +00:00
Alexandermb
b152ee155f Fix wrong sele_horse_crest on antiochus the great horse
This was SVN commit r22645.
2019-08-11 17:05:38 +00:00
838889ab12 Split CGUIString.h from GUIText.h, so that one may have the SGUIText implementation in a separate cpp file.
Differential Revision: https://code.wildfiregames.com/D2167
Reviewed By: Vladislav
Tested on: gcc 9.0.1, VS2015, Jenkins

This was SVN commit r22643.
2019-08-10 19:16:52 +00:00
d3e56f0f57 Unfriend the 20 IGUIObject classes from CGUI.
Improves separation of concerns and makes the code less error prone,
since the IGUIObject classes can't break CGUI private members without
CGUIs help anymore.

This is achieved by making CGUI GetFocusedObject, UpdateObjects public,
by introducing public CGUI GetBaseObject, GetMousePos, GetMouseButtons,
HasStyle, GetStyle getters,
and by removing the pointless IGUIObject GetMousePos proxy.

Delete GetGUI() checks that are either always or never true following
2c47fbd66a.
Use const references instead of copies for some mouse positions.

Differential Revision: https://code.wildfiregames.com/D2166
This was SVN commit r22641.
2019-08-10 12:51:27 +00:00
ca00267faf Referring a path into an island: land → shallow water
Differential Revision: D1820
This was SVN commit r22640.
2019-08-10 09:28:29 +00:00
a905fbbc98 Use NONCOPYABLE for most GUI classes and structs to have the compiler indicate unintended copies, refs 3028551b91 / D2163.
That is CChartData, CGUIList, CGUISeries, COListColumn, GUITooltip,
SGUIMessage, SSpriteCall, STextCall, SFeedback, IGUISetting,
CGUISetting, GUI, IGUIObject, IGUIScrollBar.
Drop copying GetSetting and SetSetting template functions for CGUIList,
CGUISeries, CClientArea, CGUIString.
Stop copying COListColumn.
Drop copying GUI<CClientArea>::GetSetting call in
IGUIObject::UpdateCachedSize() and four copying
GUI<CGUIString>::GetSetting calls in SetupText() functions.
Delete unused GUIRenderer IGLState class from 849f50a500 obsolete since
1f5b8f1c9a.

Differential Revision: https://code.wildfiregames.com/D2164
This was SVN commit r22638.
2019-08-10 00:04:17 +00:00
3028551b91 MOVABLE idiom, const CGUI struct maps, in place move construction instead of copying temporaries during CGUI XML loading and GenerateText.
Introduce MOVABLE idiom indicating that a class can use move semantics.
Make values of CGUI struct maps holding XML data const to ensure at the
root that the data is not modified.
Use NONCOPYABLE and MOVABLE for SGUIIcon and SGUIStyle to enforce the
non-copy policy on the compiler level (until someone changes the GUI
design to make modifications needed).

As indicated by that:
  Replace copy operations by in place move operations for these CGUI
struct maps in the CGUI Xeromyces XML loading functions.
  Replace copy operations by const references for CSize and SGUIIcon in
CGUIString::GenerateTextCall and CGUI::GenerateText.
  This avoids copying of non primitive members, such as the strings and
containers of strings.

Further related cleanup to be kept separated for auditability.

Differential Revision: https://code.wildfiregames.com/D2163
Few comments on IRC by: wraitii, Itms
Tested on: gcc 9, Jenkins, partially VS2015

Refs #1984,
  NONCOPYABLE CGUISpriteInstances: 0a7d0ecdde, 8f4f8e240f, c19f3608a5
  NONCOPYABLE Image, Sprite: fb8032043b
  NONCOPYABLE GUI page: 94c57085e9
  NONCOPYABLE GUIManager: 7c2e9027c2
  NONCOPYABLE macro: 16ccae10cd

This was SVN commit r22637.
2019-08-09 17:25:55 +00:00
f804226b89 Fix failure of the CGUIColor constructor author to call the base constructor following f236c07a56, refs 415939b59b.
Tested on: gcc 9, VS2015

This was SVN commit r22636.
2019-08-09 14:54:14 +00:00
d192c160de Replace an incorrect math.max() by math.min() in tileclass
Summary:  Patch by smiley fixing 8585040f27

Test Plan:
Check that is the correct fix.
Measure how badly it affected performance.

Reviewers: O14 Maps, elexis, Stan

Reviewed By: O14 Maps, elexis
Subscribers: smiley

Trac Tickets: #4992

Differential Revision: https://code.wildfiregames.com/D2010
This was SVN commit r22635.
2019-08-09 10:47:20 +00:00
8bc31ee0d2 English review of cavalry unit references
Differential Revision: D1614
This was SVN commit r22632.
2019-08-09 05:48:53 +00:00
306d73e864 acropolis → citadel (non-Greek fort), plateau (orography)
Differential Revision: D1805
This was SVN commit r22631.
2019-08-09 05:37:07 +00:00