Commit Graph

106 Commits

Author SHA1 Message Date
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
frosch e81313e93e Feature: Base graphics can offer parameters for additional settings. 2023-10-31 01:41:50 +01:00
frosch de3f29d7b2 Add: store base graphics parameters in openttd.cfg. 2023-10-31 01:41:50 +01:00
frosch 82c8720814 Fix #8846: When upgrading NewGRF presets, copy NewGRF parameters only if the NewGRF are compatible. Otherwise reset to defaults. 2023-10-02 22:32:30 +02:00
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
PeterN 509471f7f8
Codechange: Use std::optional for GRFConfig::GRFError (#11066)
This changes the semantics from "object pointer ownership" to "optional object", and simplifies copies.
2023-06-25 11:57:58 +01:00
Rubidium 4fdde00e25 Codechange: use std::string to create the GRF parameter list 2023-05-25 05:43:00 +02:00
Peter Nelson 6b87fe6540 Codechange: Use std::array for GRF(File|Config) parameters.
This simplifies comparison, copying and assignment operations.
2023-05-19 16:53:56 +01:00
Peter Nelson c23aae96a2 Codechange: Use std::array instead of C array for automatic deep-copies. 2023-05-19 16:53:56 +01:00
Rubidium d9a04ba446 Codechange: make the MD5 hash/digest/checksum variables a std::array 2023-05-19 11:24:44 +02:00
Peter Nelson 7934418133 Codechange: Remove comment alignment from GRFConfig. 2023-05-18 20:48:37 +01:00
Peter Nelson f14479d27d Codechange: Use std::optional for GRF Parameter list. 2023-05-18 20:48:37 +01:00
Peter Nelson c51a7f629e Codechange: GRFParameterInfo no longer needs deep-copy constructor. 2023-05-18 20:48:37 +01:00
Peter Nelson c38df2d589 Codechange: Use std::map instead of custom SmallMap. 2023-05-18 12:18:30 +01:00
Patric Stout 199e41c762
Codechange: use default dtor instead of empty (#10826) 2023-05-14 23:31:03 +02:00
Rubidium 68ff3fd062 Change: include fmt.h C++ headers in stdafx.h
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
2023-05-08 16:49:23 +02:00
Rubidium 877349c13d Codechange: use std::string for text file name resolution 2023-05-05 08:54:29 +02:00
Rubidium 3901ef9760 Codechange: use std::string for the GRF filenames 2023-05-04 23:23:32 +02:00
Rubidium f78aa1e720 Codechange: use std::unique_ptr to manager GRFErrors in GRFConfig 2023-05-04 23:23:32 +02:00
rubidium42 09a7825d1e Remove: the concept of UnknownGRFs
These were filled with "<Unknown>" (before 8a2da49) and later their name would get filled via UDP requests to the server. These UDP packets do not exist anymore, so they will always remain "<Unknown>".
Remove that logic and just use the generic translated error GRF UNKNOWN string instead.
2021-07-18 11:42:25 +02:00
rubidium42 08308d808c Codechange: use separate pre and post callbacks for int settings 2021-05-29 10:07:30 +02:00
rubidium42 db54e20825 Change: mark copy-assignment as deleted for classes with a copy-constructor that is not trivial
This to prevent the default copy-assignment getting used when during the assignment also some other memory needs to be allocated as that would otherwise be freed.
2021-05-27 18:30:56 +02:00
Michael Lutz 9c2e47d03c Codechange: Use std::string for storing GRF error messages. 2020-05-21 20:02:34 +02:00
Michael Lutz 43cd892e0c Codechange: Replace custom linked list for GRF texts with STL vectors and strings. 2020-05-21 20:02:34 +02:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Henry Wilson cc62f4163f Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector 2019-03-26 20:15:57 +00:00
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 2019-03-26 20:15:57 +00:00
Patric Stout e3c639a09f Remove: ENABLE_NETWORK switch
This switch has been a pain for years. Often disabling broke
compilation, as no developer compiles OpenTTD without, neither do
any of our official binaries.

Additionaly, it has grown so hugely in our codebase, that it
clearly shows that the current solution was a poor one. 350+
instances of "#ifdef ENABLE_NETWORK" were in the code, of which
only ~30 in the networking code itself. The rest were all around
the code to do the right thing, from GUI to NewGRF.

A more proper solution would be to stub all the functions, and
make sure the rest of the code can simply assume network is
available. This was also partially done, and most variables were
correct if networking was disabled. Despite that, often the #ifdefs
were still used.

With the recent removal of DOS, there is also no platform anymore
which we support where networking isn't working out-of-the-box.

All in all, it is time to remove the ENABLE_NETWORK switch. No
replacement is planned, but if you feel we really need this option,
we welcome any Pull Request which implements this in a way that
doesn't crawl through the code like this diff shows we used to.
2019-03-20 19:24:55 +01:00
frosch 7b553d255e (svn r27732) -Change: Turn the message about 'missing baseset sprites' from a popup into a static message that only shows in non-release versions, just like the 'missing translations' message. 2017-01-14 18:30:26 +00:00
frosch a3b356e057 (svn r27725) -Codechange: Remove IsOpenTTDBaseGRF and test for GCF_CONFIG instead, which does the same in all use-cases. 2017-01-07 21:36:25 +00:00
alberth 3c9d3f5ecd (svn r26612) -Add: Method to copy newgrf parameters. 2014-05-24 19:13:34 +00:00
frosch 41b7a04a68 (svn r26317) -Fix [FS#5897]: Check whether NewGRF change vehicle capacity when they are not supposed to, and truncate cargo appropiately if they are allowed to. 2014-02-07 23:48:56 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
frosch c3ca57c42b (svn r24318) -Feature: Add dropdowns to NewGRF configurations, if all values have labels. 2012-06-01 15:20:18 +00:00
rubidium e8dbcf9043 (svn r23932) -Codechange: split the NewGRF text window into its own source files 2012-02-12 10:32:41 +00:00
michi_cc 6db39410a1 (svn r23887) -Feature: [NewGRF] Support for container version 2. 2012-02-04 13:29:04 +00:00
frosch 92700c1262 (svn r23807) -Codechange: GRFError::num_params is not needed, remove it. 2012-01-15 17:33:35 +00:00
truebrain 1c9bec1999 (svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC) 2011-12-20 17:57:56 +00:00
rubidium df16ebd730 (svn r23595) -Codechange: add comma after last enum to get a more uniform coding style 2011-12-19 17:48:04 +00:00
rubidium 3d88c74389 (svn r23526) -Codechange: unify cargos vs cargoes 2011-12-15 21:56:00 +00:00
yexo 7a7d9a7b6b (svn r23494) -Feature: [NewGRF] action14 node INFO->URL_ to add an url 2011-12-11 12:55:04 +00:00
rubidium 5891099f24 (svn r23422) -Fix [FS#4863] (r22797): the default palette setting wasn't applied correctly anymore as the configuration file is loaded after the first NewGRF scan 2011-12-04 11:18:43 +00:00
frosch 0d901d599f (svn r23249) -Feature: Also allow viewing of the other two textfiles supplied by BaNaNaS tars, i.e. changelog and license. 2011-11-18 14:40:57 +00:00
frosch b725913f3b (svn r23248) -Codechange: Rename everything related to the NewGRF 'readme' to 'textfile', so it is more generic. 2011-11-18 13:05:55 +00:00
rubidium 514d887690 (svn r23178) -Feature [FS#4780]: in-game readme.txt readmer (LordAro) 2011-11-10 06:15:03 +00:00
frosch 56e5144f71 (svn r23140) -Add: ErrorUnknownCallbackResult() 2011-11-08 17:24:15 +00:00
michi_cc 71bd681d87 (svn r23001) -Feature: [NewGRF] Automatically switch to a 32 bpp blitter on NewGRF indication. 2011-10-04 21:35:52 +00:00
rubidium 8e5f433b22 (svn r22826) -Codechange: pass sub directory to NewGRF loading functions 2011-08-24 13:48:29 +00:00
rubidium dc5f44883b (svn r22797) -Add: progress bar for scanning NewGRFs 2011-08-21 12:53:13 +00:00