Commit Graph

7255 Commits

Author SHA1 Message Date
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
df314f2974 Refactors Preprocessor testing and adds more tests
Reviewed By: Stan
Differential Revision: https://code.wildfiregames.com/D2574
This was SVN commit r23405.
2020-01-16 00:02:22 +00:00
215447a761 Upgrade the Ogre GLSL Preprocessor
Add #elif support and some fixes.

Reviewed by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D2456
This was SVN commit r23404.
2020-01-15 18:20:36 +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
49415f8716 Splits debug display of frustums for an easier debugging of a culling and shadows
This was SVN commit r23395.
2020-01-14 23:51:29 +00:00
dbb69285a5 Set source and executable character sets to UTF-8 on Windows, removes a platform discrepancy, fixes #5094.
Patch By: Inari
Tested By: Angen
Differential Revision: https://code.wildfiregames.com/D1411
This was SVN commit r23383.
2020-01-12 20:19:56 +00:00
601892a2bb Officially drop support for Visual Studio 2013, which stopped working after 3a839517ce, fixes #5379.
This was SVN commit r23382.
2020-01-12 20:04:22 +00:00
b6300eb417 Reorder rendering passes to decrease a possible driver synchronization
Hack inside the ShadowMap was added in b889826a3d and became outdated in
1866c2d3b7.

Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2541
This was SVN commit r23370.
2020-01-11 15:25:05 +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
604ec667f3 Removes possible copying of CStr in CTerrainTextureEntry and adds const where possible.
The copy returning was introduced in 7577d224a6.

This was SVN commit r23363.
2020-01-10 22:36:22 +00:00
39986f80e1 Adds const to PathfinderPassability where possible.
This was SVN commit r23362.
2020-01-10 20:37:59 +00:00
c3ded34cf7 Improves performance of Atlas terrain elevation by updating the only changed terrain.
Reviewed By: Itms
Comments By: Stan
Differential Revision: https://code.wildfiregames.com/D2557
This was SVN commit r23361.
2020-01-10 19:54:35 +00:00
8e48e1b17e Adds optional fixed shadows without swimming effect
Fixed shadows have fixed rendering distance. Also they don't have a
swimming (blinking) effect on camera movement/rotation.

Comments By: Stan
Differential Revision: https://code.wildfiregames.com/D2465
This was SVN commit r23333.
2020-01-05 22:44:39 +00:00
a8f241da5d Adds snapping to edges for buildings
Allows to place buildings a bit faster and more perfectly aligned. Also
it helps to find a nearest placeable position in some cases.

Reviewed By: elexis
Comments By: Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D2079
This was SVN commit r23330.
2020-01-05 01:08:05 +00:00
cf7635f57b Remove JSInterface_Lobby IsRankedGame function duplicitous with g_GameAttributes.settings.RatingEnabled && !g_IsReplay, refs #3550, D2483.
This was SVN commit r23329.
2020-01-04 17:10:12 +00:00
df109bd246 Fix XmppClient upon registration or entering wrong password following 2cccd9825d/D2412.
Differential Revision: https://code.wildfiregames.com/D2482
Tested on: clang 9.0.1, Jenkins/VS2015, Jenkins/gcc6

This was SVN commit r23323.
2020-01-02 22:14:14 +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
f96f0ec78e Throw JS exceptions instead of C++ breakpoints if lobby JS code calls a JSInterface_Lobby function under an invalid circumstance.
Differential Revision: https://code.wildfiregames.com/D2526
Tested on: clang 9.0.1, Jenkins/gcc6, Jenkins/VS2015, Jenkins/macOS

This was SVN commit r23319.
2020-01-01 21:49:13 +00:00
Angen
5ad75fa580 Precompiled logic update [Windows build]
Nuke HAVE_PCH and use only one macro for PCH logic.
This macro is enabled (=1) or disabled (=0) based on --without-pch and
no_pch parameters in premake5
Visual studio does not more override this logic

Differential Revision: https://code.wildfiregames.com/D1380
Reviewed by: @Itms
This was SVN commit r23314.
2019-12-31 13:58:48 +00:00
cc7071c691 Upgrade NVTT to version 2.1.1, fixes #4549.
Windows binaries built with toolset v140_xp.
Tested under Windows, Linux and macOS.
Includes a patch for building on musl Linux, contributed by voroskoi,
containing code by leper.
Use the opportunity to set native line endings in the NVTT bundle.

The NVTT DLL was the last one built with VS 2010, refs #5379, #5527.

Differential Revision: https://code.wildfiregames.com/D2475
This was SVN commit r23305.
2019-12-29 11:21:33 +00:00
Angen
b1a78ce285 Treat min range in the same manner as max range when computing goal
Problem description:
When unit gets command to move to the range exactly X units from some
point/entity, what means minRange == maxRange, that triggers computing
goal when distance < minRange with result distance(goal, target) >
maxRange, because minRange computation uses clearance even when is
treating target as circle.

Solution:
Do not use clearance when treating target as circle, so computation when
distance < minimum range is done in same way as computation when
distance > maximum range and so computed goal has correct position.

Reported on forum:
https://wildfiregames.com/forum/index.php?/topic/27384-strange-landing-on-the-island-and-unable-to-attack/
Differential Revision: https://code.wildfiregames.com/D2512
Tested by: gameboy
This was SVN commit r23283.
2019-12-26 21:03:15 +00:00
dd1678287d Marks unused arguments in macOS implementation of try_gui_display_error
This was SVN commit r23275.
2019-12-21 14:31:47 +00:00
b276c9b76f Enable hardware S3TC on GLES too by using GL_EXT_texture_compression_s3tc
Patch By: linkmauve
Differential Revision: https://code.wildfiregames.com/D2489
This was SVN commit r23274.
2019-12-21 12:12:38 +00:00
e269466f51 Splits CameraController and adds ICameraController interface
Comments By: Stan
Differential Revision: https://code.wildfiregames.com/D2478
This was SVN commit r23272.
2019-12-21 00:44:18 +00:00
091f3167e0 Use raise() instead of kill() for debug_break()
Patch By: linkmauve
Differential Revision: https://code.wildfiregames.com/D2480
This was SVN commit r23271.
2019-12-21 00:30:34 +00:00
d6d6cb0696 Refactors ownership of SOverlayTexturedLine in CCmpRangeOverlayRenderer
Differential Revision: https://code.wildfiregames.com/D2463
This was SVN commit r23270.
2019-12-20 22:33:50 +00:00
0406509823 Merges two camera JS interface functions into the single one.
Differential Revision: https://code.wildfiregames.com/D2467
This was SVN commit r23264.
2019-12-19 23:41:20 +00:00
e1cf1e16b9 Unbind the correct texture slot in SkyManager
Wrong binding pair was introduced in 779a33ee30.

Patch By: linkmauve
Differential Revision: https://code.wildfiregames.com/D2487
This was SVN commit r23263.
2019-12-19 21:41:01 +00:00
4171d62d1b Workaround for L3 cache detection of Ryzen 3000
This code is planned to get refactored or removed anyway, so just do a
cheap workaround.

Reviewed by: Imarok
Fixes: #4360
Differential Revision: https://code.wildfiregames.com/D2353
This was SVN commit r23262.
2019-12-19 16:52:47 +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
b5bac2a2a2 Fixes overlay renderer on fixed render path, it was introduced in 14bfbbf9d4.
This was SVN commit r23247.
2019-12-16 18:45:03 +00:00
b2665437fc Allow calling timer_DisplayClientTotals multiple times.
According to the `timer_DisplayClientTotals` comment 953d2621dd broke
correctness of `clients` after the function call.

Patch By: echotangoecho
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D812
This was SVN commit r23240.
2019-12-14 22:49:44 +00:00
2fa18b1503 Replaces direct Camera member usage by appropriate method call (m_Orientation > GetOrientation()).
This was SVN commit r23234.
2019-12-14 12:56:47 +00:00
df329d1b81 Optimise out of frustum rendering of texture overlays.
Reviewed By: wraitii
Commented By: Stan
Differential Revision: https://code.wildfiregames.com/D1847
This was SVN commit r23229.
2019-12-10 23:13:37 +00:00
6110d108c1 Removes hard-coded clip planes from water shader.
Differential Revision: https://code.wildfiregames.com/D2443
This was SVN commit r23228.
2019-12-10 21:39:09 +00:00
9391756294 Add a more explicit message when requested animation rig does not match rigged model.
Reviewed By: @Angen
Discussed With: @Alexandermb

Differential Revision: https://code.wildfiregames.com/D2447
This was SVN commit r23225.
2019-12-08 19:50:36 +00:00
Angen
0fa06de9b6 Refactor ColorActivateFastImpl function
Refactor function from 6fbce9c355, making it shorter, cleaner and easier
to read.


Differential Revision: https://code.wildfiregames.com/D2415
This was SVN commit r23220.
2019-12-07 18:17:08 +00:00
Angen
f4562b87b6 Remove duplication of code from WaterManager
Use already defined function ReloadWaterNormalTextures with the same
code.
Fixes the TODO from 2d7d5b446d / aab15123f1

Differential Revision: https://code.wildfiregames.com/D2413
Reviewed By: @vladislavbelov
This was SVN commit r23219.
2019-12-07 15:32:47 +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
Angen
a3941e8cca Fix UnitmotionFlying and implement CMessageMotionUpdate::FromJSVal
In 32e8ed51aa have been changed message from MotionChanged to
MotionUpdate and CMessageMotionUpdate::FromJSVal was not implemented to
reflect changes in message structure.
As a result UnitMotionFlying tries to send MotionChanged message which
not only was renamed, but sending it from js is not supported anymore.
Also reported at this thread:
https://wildfiregames.com/forum/index.php?/topic/27294-cheats-error/

Differential Revision: https://code.wildfiregames.com/D2450
Tested by: @gameboy
Tested on: Jenkins/vs2015, Jenkins/gcc6
Fixes: #5626

This was SVN commit r23208.
2019-12-06 17:36:25 +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
52f282a7e1 Move CGUI constructor to the top of its file following 5cc814759f.
Move object type definitions to own file, since CGUI doesn't use the
GUIObject types otherwise and for similarity with GUISettingTypes,
making it slightly easier to maintain and read.

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

This was SVN commit r23184.
2019-11-24 10:26:48 +00:00
2cccd9825d Rewrite lobby page to use class semantics, add more gamedetails labels, improve performance using batch processing and caching and gain possibility for game creation/player-join/leave events, refs #5387.
Game selection details features:
* Display victory conditions following their sending but missing display
following bffe917914, refs 7b0f6f530c.
* Display the host of the match and the game name in the selected game
details following 61261d14fc, refs D1666.
* Display mods if the mods differ (without having to attempt to join the
game prior) following eca956a513.

Performance features:
* Implement batch message processing in the XmppClient to rebuild GUI
objects only once when receiving backlog or returning from a match.
* Implement Game class to cache gamelist, filter and sorting values, as
they rarely change but are accessed often.
* Cache sprintf objects.

Security fixes:
* Add escapeText in lobby/ to avoid players breaking the lobby for every
participant, supersedes D720, comments by bb.
* Do not hide broadcasted unrecognized chat commands that mods used as
leaking private channels, fixes #5615.

Defect fixes:
* Fix XmppClient.cpp storing unused historic message types resulting in
memory waste and unintentional replay of for instance
disconnect/announcements messages following both e8dfde9ba6/D819 and
6bf74902a7/D2265, refs #3306.
* Fix XmppClient.cpp victoryCondition -> victoryConditions gamesetup.js
change from 6d54ab4c1f/D1240.
* Fix leaderboard/profile page cancel hotkey closing the lobby dialog as
well and removes cancel hotkey note from lobby_panels.xml from
960f2d7c31/D817 since the described issue was fixed by f9b529f2fb/D1701.
* Fix lobby playing menu sound in a running game after having closed the
lobby dialog following introduction in 960f2d7c31/D817.
* Fix GUI on nick change by updating g_Username.
* Update profile panel only with data matching the player requested.

Hack erasure:
* Object semantics make it cheap to add state and cache values, storing
literals in properties while removing globals, adding events while
decoupling components and gaining moddability.
* Erase comments and translation comments stating that this would be
IRC!!, supersedes D1136.
* Introduce Status chat message type to supersede "/special" chat
command + "isSpecial" property from bffe917914 (formerly g_specialKey
e6840f5fca) deluxe hack.
* Introduce System chat message type to supersede system errors
disguising as chat from a mock user called "system".

Code cleanups:
* Move code from XML to JS.
* Move size values from JS to XML, especially following 960f2d7c31/D817
and 7752219cef/D1051.
* Rename "user" to "player".
* Fix lobby/ eslint warnings, refs D2261.
* Remove message.nick emptiness check from 0940db3fc0/D835, since
XEP-0045 dictates that it is non-empty.
* Add translated string for deleted subjects.
* Add TODOs for some evident COList issues, refs #5638.

Differential Revision: https://code.wildfiregames.com/D2412
This was SVN commit r23172.
2019-11-21 13:44:41 +00:00
92cbcf85e5 Rename CProgressBar numeric "caption" setting to "progress" to distinguish it from the Button, Input, Text and Tooltip "caption" setting values that are tag-formatted texts.
Remove TODO question from c4684effb6 since the class updates correctly.

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

This was SVN commit r23151.
2019-11-12 16:53:19 +00:00
235e238f9d Fix 34ce0f865d resetting the cursor after calling the GUI pages script "init" function, refs #539.
Reset the cursor everytime the GUI page is opened, therefore also when
hotloading.

The init function shall be able to determine a cursor, such as already
present in the loading screen.

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

This was SVN commit r23149.
2019-11-12 14:43:58 +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
570891e362 Fix session quickload taking ownership of frozen objects by providing a clone following 003d588d13/D2302 and a report by minohaka.
Differential Revision: https://code.wildfiregames.com/D2406
Tested on: gcc 9.2.0, Jenkins

This was SVN commit r23136.
2019-11-05 14:24:24 +00:00
f7161ad5c6 Support deleting GUI Object event handlers following af9c336b43, refs #5387.
Differential Revision: https://code.wildfiregames.com/D2395
Reported by: nani
Tested on: gcc 9.2.0, Jenkins/vs2015

This was SVN commit r23103.
2019-10-28 11:35:04 +00:00
197ab42bd2 Remove catch of critical PSERROR_Scripting exceptions in the GUI that is obsolete for the intended case and wrong for the unintended case.
The catch had been introduced in 953fb41c82, seemingly to catch the case
PSERROR_Scripting_LoadFile_OpenFailed from 1e40ed1543 which was removed
in 4b1297b328, refs D2363.
The LoadGlobalScript and LoadGlobalScriptFile functions don't throw
these errors unless that JS code calls broken C++ code throwing that.
In that case catching the error and continuing like nothing happened
leads to subsequent segfaults and similarly severe errors caused by C++,
not XML.

Differential Revision: https://code.wildfiregames.com/D2366
Tested on: clang 9.0.0, gcc 9.2.0, Jenkins/vs2015
Accepted By: nani
This was SVN commit r23068.
2019-10-11 19:30:28 +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
8cd9d402fe Correct button hovering following 8190293f8b / D2325, clarify difference between IsMouseOver and IsMouseHovering following 5122b0f906.
Differential Revision: https://code.wildfiregames.com/D2354
Tested on: clang 8.0.1, Jenkins/vs2015

This was SVN commit r23054.
2019-10-05 09:58:31 +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
e2f0e409f0 Adds containers serialization tests, std::set serialization and movement semantics
Reviewed By: elexis
Tested By: elexis, Freagarach
Differential Revision: https://code.wildfiregames.com/D2352
This was SVN commit r23044.
2019-10-04 21:30: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
8d2b143cb8 Cleanup Camera related code and uses constant references where possible, fixes #5408.
Patch By: shh
Reviewed By: wraitii
Tested By: Angen
Commented By: Stan, Itms, historic_bruno
Differential Revision: https://code.wildfiregames.com/D1784
This was SVN commit r23034.
2019-10-03 13:20:56 +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
7f38bef8e1 Splits Camera control from CGameView to separate file.
Commented By: elexis, Stan
Differential Revision: https://code.wildfiregames.com/D2347
This was SVN commit r23031.
2019-10-02 20:55:43 +00:00
28e94c0d96 Cleanup CCmpRallyPointRenderer
Replace std::deque by std::vector
Replace some casts by cpp casts
Move the class and struct declaration to a separate file for clarity.
Fixes db864f10c3 by removing offending function
Refs #5288
Refs D1681

Reviewed by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1682
This was SVN commit r23029.
2019-10-02 15:01:46 +00:00
6db0f91823 Sort GUI Object types, GUI Object bases and GUI Setting value types into three new folders.
Differential Revision: https://code.wildfiregames.com/D2345
Tested on: gcc 9.1.0
Comments By: Vladislav
This was SVN commit r23028.
2019-10-02 09:44:00 +00:00
1cf6c6b63c Moves CSmoothedValue to separate file.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2346
This was SVN commit r23026.
2019-10-01 22:42:54 +00:00
45a18c652d Removes unused methods and hides private member.
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D2342
This was SVN commit r23025.
2019-10-01 21:11:29 +00:00
32d6d07eda Rename CClientArea to CGUISize, GUIbase.h to CGUISize.h, avoid temporary instances and default value and error duplication.
The name is in accordance with its JS classname, member names and
setting names.

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

This was SVN commit r23023.
2019-10-01 15:06:13 +00:00
07cc1ba34c Move GUIbase structs and enums to separate files.
Differential Revision: https://code.wildfiregames.com/D2340
Tested on: clang 8.0.1, Jenkins

This was SVN commit r23022.
2019-10-01 12:46:55 +00:00
8190293f8b Remove virtual inheritance from the codebase, refs 6b51d71c85, e21ebb37f5 e326ebae46.
Remove workaround in 3d07327837 / D2136, the pointer from IGUIObject to
IGUITextOwner that avoided the dynamic_cast.
Have the GUIObject implementing class take responsibility of calling the
virtual methods in the base classes.
Leaves the code in a clean state that can serve as an example for new
GUI object classes, such as D1346, refs #4683.

Differential Revision: https://code.wildfiregames.com/D2325
Comments By: Vladislav on IRC 2019-07-30, 2019-08-22, 2019-09-20-23
Tested on: clang 8.0.1, Jenkins

This was SVN commit r23020.
2019-09-30 14:08:14 +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
218399bf3d Rename JSInterface_GUITypes to JSInterface_GUISize, refs 8734efca94, 9be8a560a9.
Rename init to RegisterScriptClass.

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

This was SVN commit r23018.
2019-09-30 08:19:56 +00:00
52b7fd5cd9 Remove redundant IGUITextOwner::AddText IGUIObject/this argument.
Differential Revision: https://code.wildfiregames.com/D2333
Tested on: clang 8.0.1., Jenkins/vs2015

This was SVN commit r23009.
2019-09-28 11:46:06 +00:00
b097f38a79 Remove little IGUIButtonBehavior::DrawButton duplication.
Differential Revision: https://code.wildfiregames.com/D2332
Tested on: clang 8.0.1., gcc 9.1.0, Jenkins/vs2015

This was SVN commit r23008.
2019-09-28 11:33:58 +00:00
813fc38420 Fix alphabetic sorting induced syntax error in previous, a33fd55e81/D2313, reported by go2die.
This was SVN commit r23006.
2019-09-27 14:08:00 +00:00
a33fd55e81 Change GUI Object Setting values to be members of the IGUIObject inheriting class, rename AddSetting to RegisterSetting.
Improves performance for Draw calls by 3-5% according to a shady
benchmark.
Improves memory layout, since the values are not on the heap anymore but
in the using class.
Reduces complexity of the implementation and increases type safety.
Allows specifying default values at setting value construction time,
refs D2242.
Inspired by Vladislav introducing members that cached GetSetting values
in c016a74309/D325, refs #4039, ee38f0db37/D763, refs 4225,
a1c4c23ce4/D474, D406, which were formerly proposed to be removed in
D2241.

Differential Revision: https://code.wildfiregames.com/D2313
Tested on: clang 8.0.1, gcc 9.1.0, Jenkins vs2015
Comments By: Vladislav
This was SVN commit r23005.
2019-09-27 12:49:59 +00:00
7790fd7d29 Removes duplication of Clamp function.
Reviewed By: wraitii
Commented By: Stan
Differential Revision: https://code.wildfiregames.com/D1763
This was SVN commit r23002.
2019-09-26 21:14:21 +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
0817d5d715 Always inform clients why the server chose to disconnect them, i.e. stop using NDR_UNKNOWN as a disconnect reason when the reason is known and add a LOGWARNING for future authors.
Differential Revision: https://code.wildfiregames.com/D1561
Tested on: clang 8.0.1, Jenkins

This was SVN commit r22996.
2019-09-26 11:36:03 +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
92ad6a61fa Fix OOS introduced by pathfinder threading preparation diff d592bf9cb6
Following d592bf9cb6, paths were computed at the end of turn N, and then
messages were sent at the beginning of turn N+1. However, the path
requests were removed at the end of turn N and so weren't serialised,
and neither were computed paths. This meant rejoiners would OOS when the
game was serialised with pending path results.

To fix this in preparation for threading, the architecture needs to
change slightly so that requests are kept and serialised correctly, and
rejoiners can compute the paths after deserialisation, in order to send
the messages at the beginning of turn N+1.

Fixes #5604

Reported By: elexis
Differential Revision: https://code.wildfiregames.com/D2317
This was SVN commit r22979.
2019-09-23 06:38:16 +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
e67f364887 Warn if the derived class and the base class have the same AddSetting call instead of silently ignoring it.
Enabled by f69261d37b (refs d412b2010b / D2314, 7bb0f2ea69 / D2318).
Helps structuring the GUI so that AddSetting and GetSetting are in the
same file, which defragments code and may allow for future optimizations
(setting values as class members for Draw calls), refs D2313.

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

This was SVN commit r22975.
2019-09-22 22:49:20 +00:00
987b36d53c Do not send Reflection and Refraction matrices to shader when not needed
Patch By: Angen
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1954
This was SVN commit r22971.
2019-09-22 14:56:22 +00:00
077c4f2576 Adds a "properties"-property to resources and let mods be able to prevent resources from being bartered, traded and/or tributed.
Patch By: Freagarach
Comments By: elexis, Stan`, Nescio
Reviewed By: wraitii, Angen
Fixes #4370

Differential Revision: https://code.wildfiregames.com/D1846
This was SVN commit r22970.
2019-09-22 14:53:47 +00:00
7bb0f2ea69 Defragment IGUIButtonBehavior Settings.
Moves the AddSetting sound calls from CButton and CCheckbox to
IGUIButtonBehavior, since the latter is the only class to use them.
Moves ChooseColor from IGUIButtonBehavior to CButton, since that's the
only class to use it and the only class registering the dependent
Settings following b1422137e5 (refs d412b2010b / D2314)

Initialize m_PressedRight in the constructor to prevent undefined
behavior in possible future code following 0d204037b6, refs #1028.
Remove unused soundPath variable following 0e26503cc6 / D2209.

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

This was SVN commit r22969.
2019-09-22 14:53:27 +00:00
d1bcce55db Improve js glue code in D1839/61e3f1ec0d (hotkey state fix) and deal with rebase leftovers.
The code could be improved by using more modern code.

Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2295
This was SVN commit r22963.
2019-09-22 07:38:13 +00:00
f69261d37b Remove AddSetting<CStrW>("tooltip") and AddSetting<CStr>("tooltip_style") calls redundant with the ones in the IGUIObject base constructor.
If all redundant calls are removed, the code will be able to warn about
them.

Tested on: clang 8.0.1

This was SVN commit r22958.
2019-09-21 16:13:18 +00:00
d412b2010b Delete unused CCheckbox text setting remains following b1422137e5, refs 0f807c643a.
Differential Revision: https://code.wildfiregames.com/D2314
Tested on: clang 8.0.1., Jenkins

This was SVN commit r22952.
2019-09-21 03:11:18 +00:00
aa72791b69 Fixes compilation errors about missed include and unused argument introduced in c17e7ee92f.
Patch By: elexis
Reported By: elexis
This was SVN commit r22950.
2019-09-20 19:44:58 +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
e05f939fab Delete empty IGUIObject::Destroy function and MEGA TODO from 5122b0f906, e21ebb37f5.
None of the GUI object types implemented in the past two decades owns
children, only the CGUI page.

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

This was SVN commit r22943.
2019-09-20 15:25:13 +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
8f7729bfdb Fixes values of clip planes in PostProcManager.
Reviewed By: wraitii
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D2196
This was SVN commit r22940.
2019-09-20 07:54:44 +00:00
c17e7ee92f Adds a helper function to pick entities with a given component and a given filter on screen.
Reviewed By: wraitii
Commented By: Stan, elexis
Differential Revision: https://code.wildfiregames.com/D2207
This was SVN commit r22939.
2019-09-20 07:45:55 +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
7985ea4b8e Removes usages of duplication of Clamp function in simulation and atlas. Refs D1763.
This was SVN commit r22927.
2019-09-18 15:02:36 +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
050f1dc8df Removes usages of duplication of Clamp function in graphics. Refs D1763.
This was SVN commit r22925.
2019-09-18 08:34:36 +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
41475093b0 Fix struc tree / civ info hotkeys following rebase error in adf448db4d / D2240 and don't trigger global hotkey handlers upon release following f192d4a2fa / D2260.
Differential Revision: https://code.wildfiregames.com/D2273
Tested on: clang 8.0.1., Jenkins
Tested by: Nescio
This was SVN commit r22920.
2019-09-17 22:42:50 +00:00
da958bf0e4 Fix wrong GlooxScriptConversions include in 9023f4bebb / D2264 triggering VS2015 build warning but no clang build warning, refs #5596.
Differential Revision: https://code.wildfiregames.com/D2298
Tested on: clang 8.0.1., Jenkins

This was SVN commit r22919.
2019-09-17 20:39:09 +00:00
a3d8807833 Fix 61e3f1ec0d on Windows.
Patch By: Angen
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2299
This was SVN commit r22917.
2019-09-17 19:27:38 +00:00
d468535df3 Split NetFileTransfer message parsing into one function per case, refs #5212.
Avoid redundant map lookups by caching the iterator.
Remove c-style casts by using type specific printf parameters, and
static_cast elsewhere.
Use references while at it, and typedef -> using.

Differential Revision: https://code.wildfiregames.com/D1567
Comments by: Vladislav
Tested on: clang 8.0.1, gcc 9.1.0

This was SVN commit r22916.
2019-09-17 14:18:46 +00:00