0ad/source/ps/scripting
elexis 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
..
JSInterface_ConfigDB.cpp redo 2d57478781, Create a ConfigDB_CreateAndWriteValueToFile function to absorb some duplication in the gui 2019-08-05 14:12:55 +00:00
JSInterface_ConfigDB.h redo 2d57478781, Create a ConfigDB_CreateAndWriteValueToFile function to absorb some duplication in the gui 2019-08-05 14:12:55 +00:00
JSInterface_Console.cpp Clean some forward declarations. 2018-04-27 16:06:42 +00:00
JSInterface_Console.h Add missing ScriptInterface includes to 2018-04-27 16:48:44 +00:00
JSInterface_Debug.cpp Refactor build information getters and remove the useless code. 2019-01-06 14:32:54 +00:00
JSInterface_Debug.h Refactor build information getters and remove the useless code. 2019-01-06 14:32:54 +00:00
JSInterface_Game.cpp 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. 2019-08-25 11:02:55 +00:00
JSInterface_Game.h Add missing ScriptInterface includes to 2018-04-27 16:48:44 +00:00
JSInterface_Main.cpp Unify duplicate u8* to hex string functions in a new Hexify function variant, similar to bb1f86f515, used by Tests, CacheLoader, Terms and Conditions, Lobby and mod.io. 2018-08-08 12:59:05 +00:00
JSInterface_Main.h Persist the lobby Terms Of Use and Terms Of Service checkbox if the logged in user and the accepted versions of the pages didn't change since last login, refs #5218. 2018-06-21 16:38:08 +00:00
JSInterface_Mod.cpp Main.cpp cleanup. 2018-05-08 09:45:54 +00:00
JSInterface_Mod.h Clean some forward declarations. 2018-04-27 16:06:42 +00:00
JSInterface_ModIo.cpp Provide ScriptInterface CreateObject and CreateArray functions to replace Eval calls following 7c2e9027c2, 1c0536bf08 and later. 2019-07-22 19:35:14 +00:00
JSInterface_ModIo.h Clean some forward declarations. 2018-04-27 16:06:42 +00:00
JSInterface_SavedGame.cpp 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. 2019-08-25 11:02:55 +00:00
JSInterface_SavedGame.h Add missing ScriptInterface includes to 2018-04-27 16:48:44 +00:00
JSInterface_UserReport.cpp New UserReporter Terms and Conditions, hopefully GDPR compliant, refs #5257. 2018-10-05 22:19:28 +00:00
JSInterface_UserReport.h New UserReporter Terms and Conditions, hopefully GDPR compliant, refs #5257. 2018-10-05 22:19:28 +00:00
JSInterface_VFS.cpp Provide ScriptInterface CreateObject and CreateArray functions to replace Eval calls following 7c2e9027c2, 1c0536bf08 and later. 2019-07-22 19:35:14 +00:00
JSInterface_VFS.h Add missing ScriptInterface includes to 2018-04-27 16:48:44 +00:00
JSInterface_VisualReplay.cpp Fix possibly using uninitialized global in 80635665f7 and rename GetDirectoryName 2019-05-14 10:13:02 +00:00
JSInterface_VisualReplay.h Add missing ScriptInterface includes to 2018-04-27 16:48:44 +00:00