Commit Graph

1122 Commits (3a676a5af09c94e9de8a1ce584156fb04a6b2b00)

Author SHA1 Message Date
Rubidium ede3f79475 Codechange: use the name string in SaveLoad for the name of the Setting as well 3 years ago
Rubidium 01139d3368 Codechange: access the name of a setting via an accessor function 3 years ago
Rubidium 94881f5a34 Codechange: name a few unnamed settings as to not to have to check for that being empty 3 years ago
Stephan a70aa5df49
Add #9188: netsave now keeps multiple version around, similar to autosave (#9395) 3 years ago
Patric Stout 8f5d0ecde3
Codechange: split settings.ini over several files (#9421)
This reduced the load on compilers, as currently for example MacOS
doesn't like the huge settings-tables.

Additionally, nobody can find settings, as the list is massive and
unordered. By splitting it, it becomes a little bit more sensible.
3 years ago
Patric Stout c1f13e0372
Fix: reduce the amount of debug messages on -dsl=2 (#9420)
LoadCheck makes it sound like something is really broken while
loading savegames, while it really is perfectly normal, as most
chunks do not implement LoadCheck.
3 years ago
glx22 7bcc7e11ff Codechange: Use a common sub-class for NewGRFMapping chunks 3 years ago
glx22 6e627f35ac Cleanup: Remove now unneeded ChunkHandler members 3 years ago
glx22 2c941cd8b3 Codechange: Use ChunkHandlers sub-classes 3 years ago
glx22 c1a9fe6fbd Codechange: Use static array of references to ChunkHandler 3 years ago
glx22 f371a5ad70 Codechange: Preparation for ChunkHandler subclassing 3 years ago
Rubidium 7e7a4aad72 Codechange: split off the settings saveload code from the main settings handling logic 3 years ago
Loïc Guilloux ddafc0de05
Fix 39e90ec: Integers for scripts are 64bit, but saved as 32bit (#9415) 3 years ago
Loïc Guilloux 0fa2007560
Fix cdb3dd049: GOAL chunk was not using the header for loading (#9409) 3 years ago
Patric Stout 3e3049fd0e Codechange: make savegame-version checks more obvious in SlCompanyLiveries::Load
num_liveries indirectly contained the same information, but this
makes reading these things pretty difficult. So use IsSavegameVersionBefore()
like everywhere else instead.
3 years ago
Patric Stout 4e645ce749 Codechange: using "until" in function names can be confusing
IsSavegameVersionUntil() did a [0, N] check, not [0, N) as the
name suggests.

Until can be a confusing word, where people consider it to be
including the upperbound. Dictionary states it means "before",
excluding the upperbound. There are long debates about who is right.

So, simply remove away from this ambiguity, and call it "before"
and "before or at". This makes the world easier for everyone.
3 years ago
Patric Stout 1ed2405907 Cleanup: remove SLE_NULL and friends
We no longer need them. If you want to remove a field .. just
remove it! Because of the headers in the savegame, on loading,
it will do the right thing and skip the field.

Do remember to bump the savegame version, as otherwise older
clients can still load the game, but will reset the field you
have removed .. that might be unintentially.
3 years ago
Patric Stout 3826703bc3 Add: store headers for chunks with SL_STRUCTLIST 3 years ago
Patric Stout cdb3dd0493 Add: store headers for most savegame chunks
When a header is added, the chunk changes from CH_ARRAY type to
CH_TABLE type.
3 years ago
Patric Stout 7dd5fd6ed4 Feature: framework to make savegames self-descriptive
We won't be able to make it fully self-descriptive (looking at you
MAP-chunks), but anything else can. With this framework, we can
add headers for each chunk explaining how each chunk looks like
in detail.

They also will all be tables, making it a lot easier to read in
external tooling, and opening the way to consider a database
(like SQLite) to use as savegame format.

Lastly, with the headers in the savegame, you can freely add
fields without needing a savegame version bump; older versions
of OpenTTD will simply ignore the new field. This also means
we can remove all the SLE_CONDNULL, as they are irrelevant.

The next few commits will start using this framework.
3 years ago
rubidium42 f7f1d530b8 Codechange: instead of "naked" initializer lists, declare the type in the saveload macros
This to help variant's constructor to be able to resolve the constructor of the setting
3 years ago
Rubidium 281a65b3e1 Cleanup: simplify some boolean expressions 3 years ago
Rubidium 357af686dc Cleanup: use true/false instead of 1/0 where applicable 3 years ago
Patric Stout 8e91527251 Codechange: mark chunks that are not stored as CH_READONLY
This makes it easier to spot chunks that have a save_proc that
is a nullptr, but also prevents confusion, where it looks like
the CH_ type of a chunk has influence on how it is being read.
It is not, it is only used for saving.
3 years ago
Patric Stout 4c4b55ecbd Change: rework GLOG chunk to be more like the rest
Basically it is very similar to Vehicles, where there first is
a type field, followed by data of that type. So this commit makes
it looks like how Vehicles solved that.
This removes a lot of custom "keeping track of length" stuff.
3 years ago
Patric Stout 88edfd4ef1 Change: rework several CH_RIFF chunks to use CH_ARRAY instead
This adds two byte extra to those chunks, and might feel a bit
silly at first. But in later changes we will prefix CH_ARRAY with
a table header, and then this change shines.

Without this, we could still add headers to these chunks, but any
external reader wouldn't know if the CH_RIFF has them or not. This
way is much more practical, as they are now more like any other
chunk.
3 years ago
Patric Stout b9ab9e4d05 Codechange: add the ability to save/load a std::vector
std::vector<bool> is not possible, as .. that is a nice special
case in C++.

This new type will be used in next commit.
3 years ago
Patric Stout 97b94bdc9a Change: prefix SL_ARR with the length of the array
This means that during loading we can validate that what is saved
is also that what is expected. Additionally, this makes all list
types similar to how they are stored on disk:
First a gamma to indicate length, followed by the data.
The size still depends on the type.
3 years ago
Patric Stout f67af5cbe5 Codechange: make it more obvious SlArray supports SLE_VAR_NULL
In the end, the code was already doing the right thing, but a few
functions deep, and not really obvious. When validating what objects
can handle SLE_VAR_NULL, it is nicer to just have this obvious.
3 years ago
Patric Stout d5cda58158 Codechange: use SL_NULL if you want to store null-bytes or load to nothing
Using SL_ARR for this gives us a bit of trouble later on, where we
add a length-field to SL_ARR. This of course is not the intention
of SLE_CONDNULL. So better seperate it.
3 years ago
Patric Stout 0d2e3437e3 Change: switch SL_DEQUE and SL_REFLIST length field to a gamma
The current SaveLoad is a bit inconsistent how long a length field
is. Sometimes it is a 32bit, sometimes a gamma. Make it consistent
across the board by making them all gammas.
3 years ago
Patric Stout 75e7451151 Change: indicate in the savegame if a SL_STRUCT contains any data
This helps external tooling to understand if a SL_STRUCT should
be skipped when reading. Basically, this transforms an SL_STRUCT
into a SL_STRUCTLIST with either 0 or 1 length.
3 years ago
Patric Stout a146bcfe93 Change: store length of SL_STRUCTLIST in the savegame
This wasn't consistently done, and often variables were used that
were read by an earlier blob. By moving it next to the struct
itself, the code becomes a bit more self-contained and easier to
read.

Additionally, this allows for external tooling to know how many
structs to expect, instead of having to know where to find the
length-field or a hard-coded value that can change at any moment.
3 years ago
Patric Stout 7b135a8269 Codechange: use SLE_STRUCT(LIST) for Linkgraph chunks 3 years ago
Patric Stout 5cd0c65787 Codechange: move Save/Load functions of same chunk next to each other 3 years ago
Patric Stout af3aba7a88 Codechange: use SLE_STRUCT(LIST) for GameScript chunks 3 years ago
Patric Stout aa02bf27f6 Codechange: use as much of STNN code for STNS as possible
There was a lot of code duplication for no real reason. Now with
SLEG_STRUCT support, we can just re-use the code, hopefully making
it easier for future-us to make changes to this, without breaking
everything for old games.
3 years ago
Patric Stout 0bdca02bdf Codechange: use SLE_STRUCT(LIST) for Station chunks 3 years ago
Patric Stout af43fc3d62 Codechange: use SLE_STRUCT(LIST) for Company chunks 3 years ago
Patric Stout 0bb1d2fa8e Codechange: use SLE_STRUCT(LIST) for Town chunks 3 years ago
Patric Stout 4e4720f217 Codechange: remove the special station/vehicle code from SaveLoad
With the new SLEG_STRUCT it is much easier to embed a struct
in a struct, where the sub-struct has limitations on when it is
being used.
This makes both the code easier to read (less magic) and avoids
the SaveLoad needing to know all these things about Stations
and Vehicles.
3 years ago
Patric Stout 4600d289b5 Codechange: ability to store structs and list of structs in savegames
The commits following this will use this new functionality.

Currently, a few places do this manually. This has as drawback that
the Save() and Load() code need to be in sync, and that any change
can result in (old) savegames no longer loading. In general, it is
annoying code to maintain.

By putting everything in a description table, and use that for
both Save() and Load(), it becomes easier to see what is going on,
and hopefully less likely for people to make mistakes.
3 years ago
Patric Stout 1e432fbd71
Fix 81062163: for (really) old games, station bus/truck station cache was not updated (#9366) 3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
Tyler Trahan d09210e1c6 Feature: Configurable subsidy duration 3 years ago
Patric Stout 174952440a Codechange: rework CHTS-chunk save/load to be more like the others 3 years ago
Patric Stout 8f323855b1 Codechange: rename SL_LST to SL_REFLIST to highlight the "reference" part
You can easily mistake SlList / SL_LST to be a list of SL_VAR, but
it is a list of SL_REF. With this rename, it hopefully saves a few
people from "wtf?" moments.
3 years ago
Patric Stout aa6443d57a Codechange: refactor SlList to use SlStorageHelper 3 years ago
Patric Stout 23857af693 Codechange: refactor SlDequeueHelper to work with unsigned and be more generic
Future additions will start using it for std::list too.
3 years ago
Patric Stout a2147d437e Codechange: use wrappers to get Var[Mem|File]Type, instead of GB() 3 years ago
Patric Stout fba86f711f Codechange: move GetVariableAddress inside SlObjectMember
Also move it to static, as nobody else is using it.
3 years ago
Patric Stout f997eb6ca4
Fix: compatible NewGRFs in crash-log reported wrong md5 (#9340)
The text suggests it reports the original md5, but it does in fact
report the replaced md5. Now it reports both.
3 years ago
Patric Stout 1e564b333f
Codechange: make [Save|Load]Settings() behave more like other Save/Load code (#9335)
Prepare the full description and send it to SlObject. This does
require some code to be able to read to a SLE_VAR_NULL, like strings
etc, as there is no way to know their length beforehand.
3 years ago
Patric Stout 648ee88a02 Codechange: merge guiflags and flags in settings .ini files
It was rather confusing which one was for what, especially as some
SaveLoad flags were settings-only. Clean up this mess a bit by
having only Setting flags.
3 years ago
Patric Stout 264991dfa5 Codechange: move SLF_NO_NETWORK_SYNC into settings
It is a settings-only flag, so don't pollute SaveLoad code with it.
3 years ago
Patric Stout 414e12d26b Codechange: move SLF_NOT_IN_SAVE into settings
It is a settings-only flag, so don't pollute SaveLoad code with it.
3 years ago
Patric Stout 7572603c9d Codechange: remove the unused SLF_HEX flag 3 years ago
glx22 c27afdf3f6 Codechange: Remove FOR_ALL_CHUNK_HANDLERS
Co-Authored-By: Patric Stout <truebrain@openttd.org>
3 years ago
Patric Stout 28e90769f7 Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this
is always set if assert() is valid. No matter if NDEBUG is set
or not.
3 years ago
Patric Stout 9fff00ba20
Codechange: C++-ify lists for SaveLoad (#9323)
Basically, this changes "SaveLoad *" to either:
1) "SaveLoadTable" if a list of SaveLoads was meant
2) "SaveLoad &" if a single entry was meant

As added bonus, this removes SL_END / SLE_END / SLEG_END. This
also adds core/span.hpp, a "std::span"-lite.
3 years ago
Patric Stout 0c96884700
Codechange: add a wrapper function to find all settings based on prefix (#9312) 3 years ago
Patric Stout ca9a7df752
Codechange: rename str_validate to StrMakeValid(InPlace) (#9304)
This to be more explicit the function changes the value, and not
returns yes/no.
3 years ago
rubidium42 3bb6ce8827 Codechange: use initializer_lists for the settings tables
Not using vectors as those require copying from the initializer list and that
makes unique_ptrs to the actual SettingDesc objects later impossible.
3 years ago
rubidium42 425d50372f Codechange: let SettingDesc extend SettingDescBase 3 years ago
rubidium42 44ca7d9377 Change: Use gender-neutral pronouns 3 years ago
rubidium42 ddaedaf32a Fix: empty undocumented branches 3 years ago
Rubidium bb9121dbd4 Fix: comparison of narrow type to wide type in loop (potential for infinite loops) 3 years ago
rubidium42 0f062b3882 Codechange: clean up C-string support from settings 3 years ago
rubidium42 a032714dc4 Codechange: move script settings to std::string 3 years ago
rubidium42 95386dc2b8 Codechange: move misc settings to std::string 3 years ago
glx22 38c97e1492 Codechange: Replace TILE_AREA_LOOP with range-based for loops 3 years ago
Patric Stout b136e65cf9
Change: reworked the debug levels for network facility (#9251)
It now follows very simple rules:
0 - Fatal, user should know about this
1 - Error, but we are recovering
2 - Warning, wrong but okay if you don't know
3 - Info, information you might care about
4 -
5 - Debug #1 - High level debug messages
6 - Debug #2 - Low level debug messages
7 - Trace information
3 years ago
PeterN 3d9436bd75
Fix #9202: Invalid test for unset NewGRF override mapping. (#9226) 3 years ago
PeterN 69e5da0b54
Codechange: Don't save unused NewGRF override mappings. (#9202) 3 years ago
William Davis 881e1da51d
Change: Use gender-neutral pronouns in console command messages (and comments) (#9203) 3 years ago
glx22 2feb801e56 Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loops 3 years ago
PeterN 18651dd8b1
Fix: Update text effect size when font zoom is changed. (#9174) 3 years ago
Loïc Guilloux 356bbbb90a
Fix: [MinGW] Set minimum OS version to Windows XP (#9135) 3 years ago
peter1138 a05bc04b63 Feature: Per-group wagon removal flag. 3 years ago
peter1138 27a956ba62 Codechange: Replace Group::replace_protection with Group::flags 3 years ago
Milek7 aade177d79
Fix: Corrupted savegame could cause heap corruption by writing outside link graph edge matrix. (#9046) 3 years ago
Milek7 da55286c2c
Fix: Corrupted savegame could crash the game by providing invalid gamelog enums. (#9045) 3 years ago
Patric Stout 13a5264438 Fix: store the recent new game_creation settings in savegames
This allows us to later on see what someone did, and makes sure
that "restart" command still knows how the game was created.
3 years ago
Patric Stout 1a1049bc0d Change: rename setting "max_heightlevel" to "map_height_limit"
This better reflects what it is, and hopefully removes a bit of
the confusion people are having what this setting actually does.

Additionally, update the text on the setting to better inform
users what it is doing exactly, so they can make an educated
decision on how to change it.

Next commit will introduce an "auto" value, which should be the
new default. The rename has as added benefit that everyone will
start out on the "auto" value.
3 years ago
Patric Stout 9bfa7198fd
Change: Heading for 1.12 now (#8862) 3 years ago
Patric Stout c3dc27e37e Add: settings to limit your fast-forward game speed
By default this setting is set to 2500% normal game speed.
3 years ago
Michael Lutz 7845434270 Codechange: Don't use cpp_offsetof in the save/load code.
Many of the member variables that are used in save/load are inside types
that are not standard layout types. Using pointer arithmetics to determine
addresses of members inside types that are not standard layout is generally
undefined behaviour. If we'd use C++17, it is conditionally supported, which means
each compiler may or may not support it. And even then using it for individual
array elements is syntactically not supported the the standard offsetof function.

Unfortunately, the trickery employed for saving linkgraph settings causes quite some
clutter in the settings ini files.
3 years ago
Michael Lutz 9c9292949f Codechange: Don't use cpp_offsetof in the TTO/TTD savegame loader.
Many of the member variables that are used in the oldloader are inside types
that are not standard layout types. Using pointer arithmetics to determine
addresses of members inside types that are not standard layout is generally
undefined behaviour. If we'd use C++17, it is conditionally supported, which means
each compiler may or may not support it. And even then using it for individual
array elements is syntactically not supported the the standard offsetof function.
3 years ago
glx22 6b8ad5a9b1 Change: Apply some consistency to singleplayer related comments 3 years ago
dP bab7de6cf2 Feature: Allow GameScripts to add additional text to Industry view window 3 years ago
Michael Lutz 7da224d29d
Fix #8589, 653e7fa548: Motion counter is NewGRF-visible but not saved, leading to desyncs. (#8591) 3 years ago
Matt Kimber 40d5fe1631
Fix eeb88e8: Trains reversed while paused do not correctly update sprite bounds (#8540) 3 years ago
Patric Stout ef6b17baf7 Fix 2fd871e2af5: load correct ending-year for old (pre 0.7) savegames
Despite what it looked like, you could never really change the
ending-year (it was always reset to 2050 on start-up). See commit
683b65ee1 for details. As a side-effect, the variable that was
suppose to store the ending-year was just zero, never containing
a real ending-year.
4 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 4 years ago
Matt Kimber 9b28b15e67 Codechange: create MutableSpriteCache to remove the need to cast Vehicle to a mutable type in render methods 4 years ago
Patric Stout 8596b43b2b
Codechange: move some DEBUG-levels and remove some others in saveload routine (#8474)
When running with -dsl=2 it is very easy to miss important information
as there was a lot of noise in between too. This tunes the debug
levels a bit to be less noisy while keeping the important bits.
4 years ago
Michael Lutz b408fe77f7 Codechange: Use std::string in file scanners. 4 years ago
Michael Lutz 5cbb2da794 Codechange: Even more std::string usage in file IO. 4 years ago
Michael Lutz 65f65ad2ad Codechange: Convert some more FIO functions to take std::string. 4 years ago
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 4 years ago
cirdan 395a5d9991 Cleanup: Remove unused ChunkType flag CH_AUTO_LENGTH
CH_AUTO_LENGTH is no longer used anywhere, so remove all code
that depends on it.
4 years ago
cirdan 46ff7d918b Cleanup: Remove save-only autolength flag from economy chunk handlers
CH_AUTO_LENGTH is only used when saving chunks; it makes no sense
to set it for chunks without a save handler.
4 years ago
glx22 d8605ad18d Codechange: Replace FOR_VEHICLE_ORDERS with range-based for loops 4 years ago
Jonathan G Rennison 0c5dc5d41e Change: [Linkgraph] Pause the game when linkgraph jobs lag (#6470)
Check if the job is still running two date fract ticks before it is due
to join, and if so pause the game until its done.
When loading a game, check if the game would block immediately due to
a job which is scheduled to be joined within two date fract ticks,
and if so pause the game until its done.
This avoids the main thread being blocked on a thread join, which appears
to the user as if the game is unresponsive, as the UI does not repaint
and cannot be interacted with.
Show if pause is due to link graph job in status bar, update network
messages.
This does not apply for network clients.
4 years ago
Pavel Stupnikov 9a45a0f535
Feature: Set exclusive access to industry from GS (#8115) 4 years ago
Niels Martin Hansen b7751c483e
Feature: Influence industry production changes from GS (#7912) 4 years ago
Patric Stout d8c8f4e72d
Fix: next 67 savegame versions are used in PatchPacks; skip them (#8411)
Various of PatchPacks (Spring 2013, Joker, ChillPP) used versions
slightly higher than ours. Of course, as time went by, this
caught up with us, and we are now almost pushing a new version
that would conflict with them. To avoid users creating unneeded
issues about "why can I not load my savegame", lets be ahead of
the curve and flat-out refuse to load them.

Version-wise, this is totally fine. We have ~32k versions to go
before we run out (0x8000 is masked by JGRPP; we should avoid
using that). At the rate we bump savegames, this is not going to
happen in any sane reality.
4 years ago
Patric Stout d15dc9f40f Add: support for emscripten (play-OpenTTD-in-the-browser)
Emscripten compiles to WASM, which can be loaded via
HTML / JavaScript. This allows you to play OpenTTD inside a
browser.

Co-authored-by: milek7 <me@milek7.pl>
4 years ago
Michael Lutz 79240eab1e Codechange: Make use of the improved C++17 emplace_back function. 4 years ago
Patric Stout 731af1f1f3 Codechange: don't do work GetVariableAddress() is already doing 4 years ago
Patric Stout c98717cb45 Fix: do not add an offset to a nullptr
This is, by specs, undefined behaviour. See
https://reviews.llvm.org/D67122

In cases where this is done, optimizations done by LLVM can
generate code that causes crashes.

GetVariableAddress() had two (legit) ways this could happen:
- For SaveLoad set to global
- For SaveLoad set to SLE_VAR_NULL, where sld->address is always
  a nullptr, and object could or could not be a nullptr.
4 years ago
Michael Lutz c558936ec3
Fix 63ccb36ef3: Crash trying to load TTO/TTD savegames. (#8356) 4 years ago
dP 452e1e3328 Codechange #8258: Remove unused town cargo caches from the savegame 4 years ago
TechGeekNZ a10013dd00 Codechange: Spell 'Viewport' consistently
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
4 years ago
dP 7045186594 Change #8159: Remove now unused town cargo caches without bumping the savegame version 4 years ago
dP ca2604c4e2 Revert #8157: Redundant change 4 years ago
Jonathan G Rennison 7a09413a1a Fix: Incorrect save/load array size of Town::cargo_accepted
In 11ab3c4e the number of cargo types was changed from 32 to 64.
The save/load of Town::cargo_accepted was not updated, such that
only half of the data structure is saved/loaded in savegame versions
199 to 218.
Discard and regenerate data from all savegame versions prior to 219.
4 years ago
Jonathan G Rennison 54237b0e98 Codechange: Move SlSkipBytes to saveload.h 4 years ago
Charles Pigott 64b1c70fdd Codechange: Add WARN_FORMAT to vseprintf and fix the cascade of warnings that followed 4 years ago
Jonathan G Rennison e6f3e15c32 Fix 63ccb36e: Incorrect string type for OrderBackup::name save/load
In 63ccb36e BaseConsist::name was changed from a malloced char*
to a std::string.
OrderBackup inherits from BaseConsist.
The saveload of OrderBackup::name was not updated.
4 years ago
Patric Stout 56d54cf60e Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.

Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.

This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.

Addtiionally, this heavily improves our detection of libraries, etc.
4 years ago
Michael Lutz 63ccb36ef3 Codechange: Use std::string for most of the user-settable custom names. 4 years ago
Michael Lutz 9b6f5e3bb8 Codechange: Store GS lang texts in std::strings. 4 years ago
glx22 cca613e3b8
Fix #8142, 5aa6351: Buoy owner and tile owner can be different (#8143) 4 years ago
glx 5aa6351042 Fix #8132: Corrupted savegame crashing OpenTTD on load 4 years ago
glx 0ed00ae111 Fix: Stop any gamelog action when recovering from SlError() 4 years ago
glx bc8333723c Fix #8021: limit savegame range for docking tiles fixing 4 years ago
Yexo 64278fd598 Fix: reset roadtype/streetcartype info for non-road bridges 4 years ago
Yexo 19dc31e0b3 Fix #8108: always update tile_hash after updating v->tile 4 years ago
SamuXarick 8edbb42fe8 Fix c01a2e2: crash on loading old savegames with invalid animated tile information 4 years ago
SamuXarick c01803cd42 Fix #8108: possible crash on loading TTD savegames with phantom oil rigs 4 years ago
SamuXarick 57553cd809 Fix #8020: Add missing docking tiles around industry neutral stations 4 years ago
glx 9116b22386 Fix #8011, f5381798: Dock tile in TTD savegame was only 2 bytes 4 years ago
glx 2f264f2c92 Change: Heading for 1.11 now 4 years ago
Johannes E. Krause 107283748a Feature: SLF_HEX to print hexadecimal numbers in the config file 4 years ago
Jonathan G Rennison c3223903ed Codechange: Cache resolved town, station and industry name strings 5 years ago
frosch a4be4514c9 Fix #7925: Reset temporary saveload data at the start of loading a savegame instead of at the end.
Otherwise temporary data may be passed from an aborted load action to the next load action.
5 years ago
Charles Pigott d1cead7f25 Fix: When loading old timetabled saves, also reset cached timetable duration 5 years ago
Charles Pigott cddb8a4605 Fix #7587: Crash when loading saves with waypoints with invalid locations 5 years ago
Niels Martin Hansen 2fd871e2af Feature: Configurable game ending year
Functionally reverts 683b65ee1
5 years ago
glx ee7a8eebca Codechange: Replace FOR_ALL_TOWNS with range-based for loops 5 years ago
glx 0b489f9924 Codechange: Replace FOR_ALL_SUBSIDIES with range-based for loops 5 years ago
glx 847e5f33d4 Codechange: Replace story related FOR_ALL with range-based for loops 5 years ago
glx 869581eb23 Codechange: Replace FOR_ALL_SIGNS with range-based for loops 5 years ago
glx b91abd3af9 Codechange: Replace FOR_ALL_ROADSTOPS with range-based for loops 5 years ago
glx 514565fad6 Codechange: Replace FOR_ALL_OBJECTS with range-based for loops 5 years ago
glx 11f178a312 Codechange: Replace FOR_ALL_STORAGES with range-based for loops 5 years ago
glx d8a1be48cd Codechange: Replace vehicle related FOR_ALL with range-based for loops 5 years ago
glx 9892d90b26 Codechange: Replace order related FOR_ALL with range-based for loops 5 years ago
glx 09fa39c5b5 Codechange: Replace linkgraph related FOR_ALL with range-based for loops 5 years ago
glx 00c2a98cf3 Codechange: Replace FOR_ALL_INDUSTRIES with range-based for loops 5 years ago
glx 4ae829cb27 Codechange: Replace FOR_ALL_GROUPS with range-based for loops 5 years ago
glx f58ce3db19 Codechange: Replace FOR_ALL_GOALS with range-based for loops 5 years ago
glx 1f6b3a37f9 Codechange: Replace FOR_ALL_ENGINES with range-based for loops 5 years ago
glx 1c92ba8ebe Codechange: Replace FOR_ALL_CARGO_PAYMENTS with range-based for loops 5 years ago
glx fa9769f81a Codechange: Replace FOR_ALL_DEPOTS with range-based for loops 5 years ago
glx 5fce5fa300 Codechange: Replace FOR_ALL_CARGOPACKETS with range-based for loops 5 years ago
glx 60e3cf8aff Codechange: Replace FOR_ALL_ENGINE_RENEWS with range-based for loops 5 years ago
glx ddabfed1cd Codechange: Replace station related FOR_ALL with range-based for loops 5 years ago
glx 3a14cea068 Codechange: Replace FOR_ALL_COMPANIES with range-based for loops 5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Jack Baron e4f08f2880 Fix: Bump savegame version 5 years ago
JMcKiern 04f659e768 Fix: Some typos found using codespell 5 years ago
peter1138 f538179878 Feature: Multi-tile docks and docking points. 5 years ago
Niels Martin Hansen 140a96b3a0 Change: Limit memory allocations for each Squirrel instance
This can avoid out-of-memory situations due to single scripts using up the entire address space.
Instead, scripts that go above the maximum are killed.
The maximum is default 1 GB per script, but can be configured by a setting.
5 years ago
PeterN 83c1678f9e
Fix #7577: Check if linkgraph station index is valid before dereferencing. (#7583) 5 years ago
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 5 years ago
Charles Pigott 63a7df027d Fix 5db883f: Railtype bits were moved too late, leading to rails under bridges losing their type 5 years ago
Charles Pigott d9f9a64389 Fix #6507: Don't try to load invalid depots from older savegames 5 years ago
Charles Pigott 3299d6540b Cleanup: Delete GetSavegameType function since it's been commented out since 2005 5 years ago
Charles Pigott 9da1c5bb0b Fix: Crash when attempting to load old save game with GRFs set
GroupStatistics pool was not initialised before trying to delete vehicles (specifically, trams with no tram track)
5 years ago
Charles Pigott 327ff89808 Codechange: Remove PauseModeByte 5 years ago
Charles Pigott 5b34c8019f Codechange: Remove Company/OwnerByte types 5 years ago
Charles Pigott 931d32f414 Codechange: Remove RailTypeByte type 5 years ago
Charles Pigott f20b75d712 Codechange: Remove TownLayoutByte type 5 years ago
Charles Pigott 96a4787710 Codechange: Set ZoomLevel's base type to byte instead of using ZoomLevelByte 5 years ago
Michael Lutz 4e85ccf3c0 Codechange: Replace SmallStackSafeStackAlloc with std::array.
The only port that ever used it to make heap allocations instead of stack ones was the NDS port, which got thrown out some time ago.
5 years ago
peter1138 4f052fc2a4 Cleanup: Fix alignment after NULL -> nullptr change. 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Michael Lutz 8b1880187a Remove: AutoFreeSmallVector.
The last use was for storing a list of memory blocks. As the way these lists are accessed is very
specific, it is easier to just write an explicit destructor instead of trying to exactly match the behaviour.
5 years ago
Michael Lutz e804173595 Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector. 5 years ago
Michael Lutz d3e113eb5f Codechange: Use std::vector instead of AutoDeleteSmallVector in GS text handling. 5 years ago
Michael Lutz 94c5269fa7 Codechange: Use atomic variables for thread synchronization where useful. 5 years ago
Michael Lutz 05bc2ed7cb Codechange: Replace custom thread code with C++11 thread objects.
We assume a conforming C++11 compiler environment that has a valid <thread>-header.
Failure to run a real thread is handled gracefully.
5 years ago
glx22 66dd7c3879
Fix: MSVC warnings (#7423) 5 years ago
Henry Wilson cc62f4163f Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector 5 years ago
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 5 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 5 years ago
Henry Wilson f3938fdb83 Codechange: Replaced SmallVector::Reset() with std::vector::clear() + shrink_to_fit() 5 years ago
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 5 years ago
Henry Wilson bfd79e59dc Codechange: Replace SmallVector::Clear() with std::vector::clear() 5 years ago
Peter Nelson f6264e5212 Change: Bump savegame version for tree tile water class conversion. 5 years ago
Peter Nelson 76e77aefad Fix #7400: Water class for tree tiles was not converted for old saves preventing industry creation.
As the information is always available from the tree ground type, unconditionally
update the map array for tree tiles.
5 years ago
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.
5 years ago
Charles Pigott fe448a2616 Remove: OPF 5 years ago
Patric Stout 7adae09897 Codechange: liblzma is called liblzma, how ever strange that might be
It is the only library we use that calls itself with 'lib' in the
name. This might be confusing, but with the arrival of cmake a lot
of these things are automated. And detection will find 'liblzma',
not 'lzma', like with 'lzo', 'zlib', ..
5 years ago
Niels Martin Hansen e8d397e4ee Codechange: Make a merged k-d tree index of all viewport signs 5 years ago
Niels Martin Hansen d84b67e54d Codechange: Make a k-d tree index of stations 5 years ago
Niels Martin Hansen 7b56be0f3a Codechange: Make a k-d tree index of towns 5 years ago