0ad/source/ps
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
..
GameSetup 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
scripting 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
tests Revert 09916ce6cb which broken jenkins build. 2019-07-20 13:10:53 +00:00
XML Clean up ThreadUtil, use standard C++11 constructs instead of custom ones. 2019-06-06 19:30:48 +00:00
ArchiveBuilder.cpp Add a confirmation message when packaging ends. 2019-01-07 23:57:18 +00:00
ArchiveBuilder.h Handle mods specified on the command line when using the archive builder. 2014-06-15 16:43:08 +00:00
CacheLoader.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
CacheLoader.h Fix biome-specific mappreviews in 7f602037ba for zipped mods, refs #4962. 2018-08-05 21:50:00 +00:00
CConsole.cpp Move GetDefaultGuiMatrix to a separate file. 2019-08-04 03:52:00 +00:00
CConsole.h Clean up ThreadUtil, use standard C++11 constructs instead of custom ones. 2019-06-06 19:30:48 +00:00
CLogger.cpp Clean up ThreadUtil, use standard C++11 constructs instead of custom ones. 2019-06-06 19:30:48 +00:00
CLogger.h Clean up ThreadUtil, use standard C++11 constructs instead of custom ones. 2019-06-06 19:30:48 +00:00
Compress.cpp More build fixes for FreeBSD. 2012-01-31 00:06:56 +00:00
Compress.h More FreeBSD build fixes. 2012-01-30 06:21:11 +00:00
ConfigDB.cpp Clean up ThreadUtil, use standard C++11 constructs instead of custom ones. 2019-06-06 19:30:48 +00:00
ConfigDB.h Clean up ThreadUtil, use standard C++11 constructs instead of custom ones. 2019-06-06 19:30:48 +00:00
CStr.cpp Actually remove trailing tabs from source/. 2016-11-23 14:09:58 +00:00
CStr.h Remove duplicated layers of unescaping which required multiple escapes in some places. 2014-12-13 01:08:29 +00:00
CStrIntern.cpp Fix build without precompiled headers following the Atlas UTF8 fix in 800bf0da24 and ThreadUtil include removal in ba736916fc. 2019-07-07 21:52:52 +00:00
CStrIntern.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
CStrInternStatic.h Option to disable fog effects. 2017-12-04 15:54:24 +00:00
DllLoader.cpp Automatically replace %hs/%ls with %s in CLogger format strings. 2015-01-22 20:36:24 +00:00
DllLoader.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
Errors.cpp Delete CInternalCGUIAccessorBase class from c2a71e41bf. 2019-07-28 02:39:52 +00:00
Errors.h Catch exceptions by reference (by convention), based on patch from Markus, refs #1852 2013-05-22 22:27:53 +00:00
FileIo.cpp Fix gcc 8 compiler warning in FileIo.cpp about truncating use of strncpy [-Wstringop-truncation]. 2019-08-07 15:38:40 +00:00
FileIo.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
Filesystem.cpp Use in-place construction. 2015-07-29 23:44:17 +00:00
Filesystem.h Move GUI schemas to the mod mod. Fix some validation related errors in the mod mod. 2015-06-15 16:00:26 +00:00
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
Game.h 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
Globals.cpp Fix out of bounds access in Hotkey.cpp. Patch by echotangoecho. 2017-05-19 18:01:22 +00:00
Globals.h Fix out of bounds access in Hotkey.cpp. Patch by echotangoecho. 2017-05-19 18:01:22 +00:00
GUID.cpp Actually remove trailing whitespace for non-header files as well. 2016-11-23 13:02:58 +00:00
GUID.h Multiplayer lobby based on the XmPP protocol. Special thanks to Philip, alpha123, scythetwirler, and anyone else who has helped build, debug or test the lobby. 2013-11-07 20:07:24 +00:00
Hotkey.cpp Try to recognise unknown hotkey mappings using SDL2. 2017-05-21 08:05:52 +00:00
Hotkey.h Unload hotkeys on shutdown. 2014-09-15 01:27:06 +00:00
Joystick.cpp Remove disabled by default SDL1 support. 2015-12-14 10:52:21 +00:00
Joystick.h Renames our sdl.h to libsdl.h, to avoid case sensitivity errors when it includes SDL.h. 2012-01-12 23:32:27 +00:00
KeyName.cpp Actually remove trailing whitespace for non-header files as well. 2016-11-23 13:02:58 +00:00
KeyName.h Fix out of bounds access in Hotkey.cpp. Patch by echotangoecho. 2017-05-19 18:01:22 +00:00
Loader.cpp Convert debug_printf to take UTF-8 strings instead of wchar_t. 2015-02-14 01:45:13 +00:00
Loader.h cleanup (requires update-workspaces) 2011-05-03 12:38:42 +00:00
LoaderThunks.h warning fixes: mostly size_t vs. specialized API type and other type conversion. 2010-09-05 09:38:30 +00:00
Mod.cpp Provide ScriptInterface CreateObject and CreateArray functions to replace Eval calls following 7c2e9027c2, 1c0536bf08 and later. 2019-07-22 19:35:14 +00:00
Mod.h Alpha 23 "lobby lag" release fix. 2018-05-24 18:08:56 +00:00
ModInstaller.cpp mod.io support. 2018-04-22 18:14:45 +00:00
ModInstaller.h mod.io support. 2018-04-22 18:14:45 +00:00
ModIo.cpp Upgrade SpiderMonkey to version 45.0.2, refs #4893. 2019-08-07 22:37:43 +00:00
ModIo.h mod.io support. 2018-04-22 18:14:45 +00:00
Preprocessor.cpp Add FALLTHROUGH, which in the best case is just [[fallthrough]]. 2017-09-01 20:04:53 +00:00
Preprocessor.h Fix CPreprocessor uninitialised data causing error messages on "#endif" followed by EOF with no newline. Warn about unrecognised "#elif". 2012-04-02 16:12:46 +00:00
PreprocessorWrapper.cpp Automatically replace %hs/%ls with %s in CLogger format strings. 2015-01-22 20:36:24 +00:00
PreprocessorWrapper.h Set svn:eol-style=native, fix some inconsistent line endings 2013-12-06 00:42:50 +00:00
Profile.cpp Pthread -> std::thread (2/7) - Remove pthread in Profilers 2019-08-04 08:11:58 +00:00
Profile.h Clean up ThreadUtil, use standard C++11 constructs instead of custom ones. 2019-06-06 19:30:48 +00:00
Profiler2.cpp 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. 2019-08-07 14:45:13 +00:00
Profiler2.h 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. 2019-08-07 14:45:13 +00:00
Profiler2GPU.cpp Pthread -> std::thread (2/7) - Remove pthread in Profilers 2019-08-04 08:11:58 +00:00
Profiler2GPU.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
ProfileViewer.cpp Move GetDefaultGuiMatrix to a separate file. 2019-08-04 03:52:00 +00:00
ProfileViewer.h Remove disabled remains of the performance data (= profiler data + text input) upload feature from the UserReporter from 0da7e822ff. 2018-08-05 15:18:00 +00:00
Pyrogenesis.cpp Bump version to alpha 24. 2018-12-26 11:28:37 +00:00
Pyrogenesis.h Move engine version to common file. Patch by elexis. Fixes #3359. 2015-08-01 23:03:13 +00:00
Replay.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
Replay.h Test all full hashes in non-visual replaymode by default and keep skipping quick-hash by default. 2018-05-29 02:14:38 +00:00
SavedGame.cpp Remove unused GUIUtil functions, unused GUI includes and some tails in GUIUtil. 2019-08-25 08:57:36 +00:00
SavedGame.h Bump copyright header year numbers. 2018-02-21 18:44:52 +00:00
Shapes.cpp Fix some gcc 8 and gcc 9 compiler warnings that were thrown 4500 times. 2019-07-09 00:18:48 +00:00
Shapes.h Fix some gcc 8 and gcc 9 compiler warnings that were thrown 4500 times. 2019-07-09 00:18:48 +00:00
Singleton.h Simple refactoring of Singleton. Make it non-copyable. 2019-01-13 15:11:40 +00:00
TemplateLoader.cpp Remove unneeded include. 2017-09-30 15:29:13 +00:00
TemplateLoader.h More ScriptInterface const. 2017-11-25 06:49:58 +00:00
ThreadUtil.cpp Clean up ThreadUtil, use standard C++11 constructs instead of custom ones. 2019-06-06 19:30:48 +00:00
ThreadUtil.h Clean up ThreadUtil, use standard C++11 constructs instead of custom ones. 2019-06-06 19:30:48 +00:00
TouchInput.cpp Remove disabled by default SDL1 support. 2015-12-14 10:52:21 +00:00
TouchInput.h Set svn:eol-style=native, fix some inconsistent line endings 2013-12-06 00:42:50 +00:00
UniDoubler.h Use default Unicode encoding in source code on Windows. 2017-11-29 20:14:22 +00:00
UserReport.cpp pthread -> std::thread (5/7) - Replace sdl semaphore with condition variable 2019-08-24 11:26:58 +00:00
UserReport.h 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. 2018-08-22 22:17:42 +00:00
utf16string.h Fix -Wconversion warnings in simulation code. 2011-08-16 11:18:32 +00:00
Util.cpp Refactors camera projections - makes projection functions of camera more clear. 2019-06-26 22:54:05 +00:00
Util.h 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
VideoMode.cpp Fix the window icon that cannot be loaded in release packages, refs 27d99765bb. 2018-05-01 20:29:36 +00:00
VideoMode.h Fixes the Alt + Tab crash in the fullscreen mode. Refs #4181. 2018-03-09 22:23:03 +00:00
VisualReplay.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
VisualReplay.h Fix possibly using uninitialized global in 80635665f7 and rename GetDirectoryName 2019-05-14 10:13:02 +00:00
World.cpp Always delete CMapReader. Patch by Sandarac. Fixes #4154. 2017-08-25 00:37:48 +00:00
World.h Always delete CMapReader. Patch by Sandarac. Fixes #4154. 2017-08-25 00:37:48 +00:00