Commit Graph

48 Commits

Author SHA1 Message Date
Peter Nelson 774f811217
Codechange: Use std::optional for town parent scope resolver. (#12530)
When resolving NewGRF, the parent town_scope is lazily initialised as it does not always need to be used.

Replace the manually managed pointer with std::optional to simplify. Using std::optional avoids extra memory allocation.
2024-04-18 22:14:16 +01:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 2024-02-02 22:29:28 +01:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +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
Niels Martin Hansen c8779fb311
Feature: NewGRF callback profiling (#7868)
Adds a console command newgrf_profile to collect some profiling data about NewGRF action 2 callbacks and produce a CSV file.
2020-01-26 13:45:51 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Niels Martin Hansen 53f8d0b815 Codechange: Use std::vector for industry tile layouts 2019-10-19 17:16:25 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Henry Wilson af7d9020a1 Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual
member declaration overrides a base-class member with the same signature.

Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked
as virtual despite being a template.
2019-03-24 16:10:04 +01:00
frosch d9d669dcf8 (svn r27984) -Codechange: Make ScopeResolver constructors/destructors inlineable. Speedup sprite resolving by about 8 percent. 2018-03-11 13:19:41 +00:00
frosch 82ae414e8d (svn r27928) -Fix: [NewGRF] While executing random triggers, var 5F should include the new triggers.
-Fix: [NewGRF] Reset used random triggers only after all A123 chains have been resolved, so that all RA2 in all chains can test the shard triggers. This also includes multiple RA2 in the same A123 chain.
-Fix: [NewGRF] Industry random triggers are stored per tile, even when randomising the shared random bits of the parent industry.
2017-10-25 15:38:14 +00:00
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 2017-08-13 18:38:42 +00:00
frosch db894b0b3f (svn r26085) -Codechange: Pass ResolverObjects as reference instead of pointer since they are never NULL. 2013-11-24 14:41:19 +00:00
alberth 33ff55a8f1 (svn r24693) -Doc: Add some doxymentation into the newgrf code. 2012-11-10 20:46:39 +00:00
alberth 4c9bea2a71 (svn r24692) -Cleanup: Cleanup final parts of the old resolver code. 2012-11-10 20:45:59 +00:00
alberth e087503fd6 (svn r24690) -Codechange: Add resolver classes for industry tiles. 2012-11-10 20:44:38 +00:00
alberth f7352871fa (svn r24689) -Codechange: Add resolver classes for industries. 2012-11-10 20:44:10 +00:00
alberth 0849fb8d36 (svn r24535) -Doc: Two additions, lots of small spelling fixes, and some Doxygen improvements. 2012-09-21 09:47:21 +00:00
rubidium e40eb8177a (svn r23735) -Codechange: remove ~50 includes from headers that weren't needed 2012-01-03 20:26:05 +00:00
frosch 8f4c6d42f9 (svn r23154) -Change: [NewGRF v8] Use heightlevel units in nearby tile info variables. (rubidium) 2011-11-08 17:29:01 +00:00
frosch b98c7763de (svn r23146) -Change: [NewGRF v8] Make callback 22 return a probability to use instead of property 18. 2011-11-08 17:26:13 +00:00
frosch 1ad7239247 (svn r23138) -Feature: [NewGRF] Allow passing 32bit parameters to 60+x variables (using var 7B). Currently most useful for vehicle var 60. 2011-11-08 17:23:30 +00:00
yexo 9373ee71d9 (svn r20996) -Change: [NewGRF] the X and Y offsets in the parameter for industry vars 60,61,62,63 are unsigned instead of signed 2010-10-19 21:00:45 +00:00
rubidium 0b67a7ccd5 (svn r20942) -Feature [NewGRF]: make it possible to distinguish player built/randomly placed industries in the location and land slope check callbacks 2010-10-16 13:15:54 +00:00
rubidium 30f2afac9b (svn r20632) -Cleanup: remove "a few" unneeded includes, and add them to some headers 2010-08-26 22:01:16 +00:00
yexo e80f339086 (svn r20396) -Codechange: introduce a helper function to test whether an industry temporarily refues to accept some cargo 2010-08-07 20:11:27 +00:00
frosch e296eeb20c (svn r19901) -Add: [NewGRF] Access to industry founder (var A7) during callbacks 28 and 2F. (yexo) 2010-05-29 13:08:50 +00:00
frosch 910aade284 (svn r19744) -Add [FS#3477]: [NewGRF] Access to random bits of houses and industries from construction callbacks 17, 28 and 2F. That is: The randombits the house/industry will start with, if construction succeeds. 2010-05-01 13:09:49 +00:00
alberth 82a4d532b6 (svn r19185) -Codechange: Return succeeded or failed CommandCost from CheckIfCallBackAllowsCreation(). 2010-02-21 17:01:23 +00:00
yexo e80f4f20af (svn r18878) -Fix [NewGRF]: crash when a newgrf used var62 in an industry tile chain when the industry tile was part of an original industry 2010-01-21 18:32:44 +00:00
rubidium 82fc28f77f (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 2010-01-15 16:41:15 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
rubidium d03994098b (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description. 2008-05-06 15:11:33 +00:00
rubidium 1629699094 (svn r12006) -Fix: implement FS#1697 without the nasty side effects as specified in FS#1712. 2008-01-29 00:36:55 +00:00
rubidium 38115acf5a (svn r11776) -Codechange: more header splittings to reduce the dependencies. 2008-01-07 14:02:26 +00:00
rubidium fc371ad994 (svn r11152) -Fix: GetIndustryIDAtOffset crashed when translation of the GFX ID would be needed. Fix by Belugas.
-Fix: GetIndustryIDAtOffset crashed when the industry->xy tile was not an industry tile.
2007-09-23 19:55:42 +00:00
rubidium 4dca543135 (svn r11151) -Codechange: add (partial) support for randomizing industry triggers (part of the backend for it). Furthermore update the documentation of the map's bits wrt to industries. 2007-09-23 19:27:35 +00:00
rubidium 9e3ee0e689 (svn r10690) -Codechange: use the enum that describes all callback IDs in favor of "just" using an untyped integer. 2007-07-25 19:06:29 +00:00
belugas 318f19f5a4 (svn r10572) -Codechange: Add function CheckIfCallBackAllowsAvailability for industries 2007-07-15 00:19:40 +00:00
rubidium 5f7f99e381 (svn r10515) -Codechange: allow getting some more data about the environment of an industry. 2007-07-11 23:10:22 +00:00
rubidium 57268fa7e3 (svn r10514) -Codechange: add support for getting the nearest industry with a given type. 2007-07-11 22:57:47 +00:00
rubidium bb8923c336 (svn r10485) -Codechange: add a callback mechanism to determine whether building an industry is allowed at a given location. 2007-07-09 13:21:49 +00:00
rubidium 86c14c239f (svn r10442) -Codechange: implement the industry production callback. 2007-07-05 05:41:56 +00:00
belugas c1218e88e1 (svn r10369) -Codechange: Add the IndustryType parameter to the GetIndustryCallback function.
Sometimes, the industry might not be able to provide its type, since it does not exists at all
2007-06-28 02:14:40 +00:00
belugas 30863358f9 (svn r10127) -Add: Addition of basic structure for industry tiles callbacks (unfinished).
-Codechange: ResolverObject receives member gfx, making it compatible for both industries and industry tiles
-Codechange: NewIndustryResolver now has his randombits and triggers (even if not implemented)
2007-06-13 02:29:08 +00:00
belugas 8efb7e53ec (svn r10108) -Codechange: implement variable 0x60 (Get industry tile ID at offset) for industries.
It is exposed for for industry tiles who will reuse it too, for variable 0x62.
2007-06-12 00:49:50 +00:00
belugas 9a4a911bde (svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries 2007-06-09 02:05:51 +00:00