Jonathan G Rennison
0d4d4a9cac
Merge branch 'master' into jgrpp
...
# Conflicts:
# cmake/CompileFlags.cmake
# src/3rdparty/squirrel/squirrel/sqclosure.h
# src/3rdparty/squirrel/squirrel/sqobject.h
# src/3rdparty/squirrel/squirrel/sqvm.h
# src/aircraft.h
# src/airport_gui.cpp
# src/blitter/32bpp_sse_func.hpp
# src/blitter/null.hpp
# src/bridge_gui.cpp
# src/build_vehicle_gui.cpp
# src/cargotype.h
# src/cheat_gui.cpp
# src/command.cpp
# src/command_func.h
# src/company_gui.cpp
# src/console_gui.cpp
# src/date_gui.cpp
# src/depot_gui.cpp
# src/dock_gui.cpp
# src/economy.cpp
# src/error_gui.cpp
# src/fileio.cpp
# src/fios.cpp
# src/fios_gui.cpp
# src/fontcache/spritefontcache.h
# src/framerate_gui.cpp
# src/game/game_text.cpp
# src/gamelog.cpp
# src/genworld_gui.cpp
# src/gfx_layout_fallback.cpp
# src/group_gui.cpp
# src/highscore_gui.cpp
# src/hotkeys.cpp
# src/industry_cmd.cpp
# src/industry_gui.cpp
# src/landscape.cpp
# src/main_gui.cpp
# src/misc_cmd.cpp
# src/misc_gui.cpp
# src/network/core/tcp_game.cpp
# src/network/core/udp.cpp
# src/network/network_chat_gui.cpp
# src/network/network_content_gui.cpp
# src/network/network_gui.cpp
# src/network/network_server.cpp
# src/network/network_server.h
# src/newgrf_airport.cpp
# src/newgrf_airport.h
# src/newgrf_airporttiles.cpp
# src/newgrf_airporttiles.h
# src/newgrf_animation_base.h
# src/newgrf_canal.cpp
# src/newgrf_commons.h
# src/newgrf_config.cpp
# src/newgrf_debug_gui.cpp
# src/newgrf_engine.cpp
# src/newgrf_engine.h
# src/newgrf_generic.cpp
# src/newgrf_gui.cpp
# src/newgrf_house.cpp
# src/newgrf_house.h
# src/newgrf_industries.cpp
# src/newgrf_industries.h
# src/newgrf_industrytiles.cpp
# src/newgrf_industrytiles.h
# src/newgrf_object.cpp
# src/newgrf_object.h
# src/newgrf_railtype.cpp
# src/newgrf_railtype.h
# src/newgrf_roadstop.cpp
# src/newgrf_roadstop.h
# src/newgrf_roadtype.cpp
# src/newgrf_roadtype.h
# src/newgrf_spritegroup.cpp
# src/newgrf_spritegroup.h
# src/newgrf_station.cpp
# src/newgrf_station.h
# src/newgrf_town.cpp
# src/newgrf_town.h
# src/news_gui.cpp
# src/object_gui.cpp
# src/order_gui.cpp
# src/os/macosx/crashlog_osx.cpp
# src/os/unix/crashlog_unix.cpp
# src/os/windows/crashlog_win.cpp
# src/os/windows/win32.cpp
# src/os/windows/win32_main.cpp
# src/pathfinder/npf/npf.cpp
# src/pathfinder/npf/queue.cpp
# src/rail_cmd.cpp
# src/rail_gui.cpp
# src/road_gui.cpp
# src/roadveh.h
# src/saveload/saveload.cpp
# src/screenshot.cpp
# src/script/api/script_text.hpp
# src/settings.cpp
# src/settings_gui.cpp
# src/settings_internal.h
# src/settings_table.cpp
# src/signs_cmd.cpp
# src/signs_gui.cpp
# src/smallmap_gui.cpp
# src/smallmap_gui.h
# src/spriteloader/grf.hpp
# src/station_cmd.cpp
# src/station_gui.cpp
# src/station_map.h
# src/statusbar_gui.cpp
# src/stdafx.h
# src/strgen/strgen.cpp
# src/table/newgrf_debug_data.h
# src/terraform_gui.cpp
# src/timer/timer_game_calendar.cpp
# src/timer/timer_window.cpp
# src/town.h
# src/town_cmd.cpp
# src/town_gui.cpp
# src/train_gui.cpp
# src/transparency_gui.cpp
# src/vehicle_gui.cpp
# src/water_cmd.cpp
# src/waypoint_cmd.cpp
# src/widget.cpp
# src/widget_type.h
# src/widgets/dropdown.cpp
# src/widgets/rail_widget.h
# src/widgets/terraform_widget.h
# src/window.cpp
# src/window_gui.h
11 months ago
Jonathan G Rennison
c929f7075e
Merge branch 'master' into jgrpp
...
# Conflicts:
# cmake/SourceList.cmake
# src/build_vehicle_gui.cpp
# src/company_gui.cpp
# src/console_cmds.cpp
# src/depot_base.h
# src/elrail.cpp
# src/network/core/udp.cpp
# src/network/network_admin.cpp
# src/network/network_chat_gui.cpp
# src/network/network_gui.cpp
# src/network/network_server.cpp
# src/newgrf.cpp
# src/newgrf_engine.cpp
# src/newgrf_railtype.cpp
# src/newgrf_railtype.h
# src/newgrf_storage.h
# src/os/unix/crashlog_unix.cpp
# src/rail.h
# src/rail_cmd.cpp
# src/rail_gui.cpp
# src/road_cmd.cpp
# src/road_map.h
# src/saveload/labelmaps_sl.cpp
# src/settings_gui.cpp
# src/settings_type.h
# src/sl/oldloader_sl.cpp
# src/station_cmd.cpp
# src/station_gui.cpp
# src/table/settings/world_settings.ini
# src/tests/test_script_admin.cpp
# src/textfile_gui.cpp
# src/toolbar_gui.cpp
# src/train_cmd.cpp
# src/tunnelbridge_cmd.cpp
# src/vehicle_gui.cpp
# src/widget.cpp
# src/window.cpp
# src/window_gui.h
# src/window_type.h
11 months ago
Patric Stout
a15847cf4f
Codechange: simplify splitting of CargoPacket ( #11286 )
...
(cherry picked from commit d1a0ca67be
)
1 year ago
Patric Stout
f5d685a525
Fix b0e73277: cargodist information got lost when splitting of cargo ( #11280 )
...
During b0e73277
we removed loaded_at_xy, but I kinda forgot that
it was a union with next_station. Now next_station wasn't copied
anymore, or checked in AreMergable.
(cherry picked from commit e6c02ebee6
)
1 year ago
Patric Stout
e5673a1756
Codechange: cleanup CargoPacket in terms of variable/function names ( #11278 )
...
Over the years, things got reused and changed, making the current
names somewhat unclear in what they actually mean and do.
(cherry picked from commit 30172fc037
)
1 year ago
Patric Stout
2890127675
Codechange: remove loaded_at_xy from CargoPacket as it was unused ( #11276 )
...
(cherry picked from commit b0e73277d6
)
1 year ago
Peter Nelson
49dae08a3b
Codechange: Add missing override specifiers.
1 year ago
Patric Stout
d1a0ca67be
Codechange: simplify splitting of CargoPacket ( #11286 )
1 year ago
Patric Stout
e6c02ebee6
Fix b0e73277: cargodist information got lost when splitting of cargo ( #11280 )
...
During b0e73277
we removed loaded_at_xy, but I kinda forgot that
it was a union with next_station. Now next_station wasn't copied
anymore, or checked in AreMergable.
1 year ago
Patric Stout
b0e73277d6
Codechange: remove loaded_at_xy from CargoPacket as it was unused ( #11276 )
1 year ago
Peter Nelson
9040d7813d
Codechange: Use std::array and std::unique_ptr for PersistentStorageArrays.
...
This (mostly) avoids the need for manual memory management and copying.
1 year ago
Jonathan G Rennison
19835b51ee
Move StationCargoList and FlowStatMap out of GoodsEntry struct
...
Move them into a new GoodsEntryData struct referenced
using a std::unique_ptr from GoodsEntry.
The unique_ptr may be nullptr if the cargo list and flow stat map
are both empty (this is the case for unused cargoes).
This reduces GoodsEntry from 128 to 24 bytes,
and Station from 8680 to 2024 bytes,
(on Linux x86_64).
1 year ago
Jonathan G Rennison
23ad010d70
Replace remaining uses of std::deque with ring buffers
...
Cargo packet lists and associated save/load
1 year ago
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
1 year ago
rubidium42
9f6fec01cd
Codechange: rename cargo aging days to periods, as they are not really days ( #11112 )
1 year ago
Jonathan G Rennison
ac2f9a21e8
Move upstream saveload to src/saveload/, move jgrpp saveload to src/sl/
...
Leave afterload in src/saveload/
1 year ago
Jonathan G Rennison
36fadb5424
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/base_station_base.h
# src/newgrf.cpp
# src/newgrf_class.h
# src/newgrf_class_func.h
# src/newgrf_commons.cpp
# src/newgrf_commons.h
# src/newgrf_roadstop.cpp
# src/newgrf_roadstop.h
# src/newgrf_station.cpp
# src/saveload/newgrf_sl.cpp
# src/saveload/saveload.h
# src/saveload/station_sl.cpp
1 year ago
Peter Nelson
e6740046ee
Codechange: Use range-for iteration.
1 year ago
Peter Nelson
912eb68981
Change: Extend entity override manager and station spec lists to support 16 bit IDs.
1 year ago
Tyler Trahan
930f0a16d8
Codechange: Define Date/Year/Month/Day within TimerGameCalendar class
1 year ago
Rubidium
580d0a6343
Codechange: make use of Tile in for all direct map accesses
2 years ago
Jonathan G Rennison
4c1406a4b5
Add: NewGRF road stops
2 years ago
Jonathan G Rennison
dceafaf2db
GRF: Initial support for > 255 road stop specs per GRF
...
Add new variable for road stop info of nearby tiles
Bump roadstops version
2 years ago
Rubidium
3c54344825
Fix: comparison of narrow type with wide type in loop condition
...
Technically this can't be triggered with the currently returned values though.
2 years ago
Jonathan G Rennison
1a5b485b41
Road stops: Use a struct for road stop tile data
2 years ago
Jonathan G Rennison
aa4501747f
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/base_station_base.h
# src/lang/german.txt
# src/saveload/station_sl.cpp
# src/station.cpp
# src/station_cmd.cpp
2 years ago
Peter Nelson
22803f997b
Codechange: Use std::vector for station speclist
...
This removes manual memory allocation, although we still manage the list
size in roughly the same way.
2 years ago
Jonathan G Rennison
5a39734a1c
Allow station cargo histories to record larger values than 64k
...
See: #414
2 years ago
Jonathan G Rennison
23c472d2a0
Add support for road stop animation, availability callback
...
Add animation, callback mask, general flags properties
Add animation frame variables
3 years ago
Jonathan G Rennison
1084bb8566
Initial support for NewGRF road stops (bus and lorry stops)
3 years ago
Jonathan G Rennison
b4fc0b4dc5
Initial implementation of road waypoints
3 years ago
Jonathan G Rennison
d81cbc25b8
Add setting to allow hiding viewport labels of inidivudal waypoints
3 years ago
Jonathan G Rennison
ffef1c9e44
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# src/saveload/cargopacket_sl.cpp
# src/saveload/cheat_sl.cpp
# src/saveload/company_sl.cpp
# src/saveload/engine_sl.cpp
# src/saveload/map_sl.cpp
# src/saveload/order_sl.cpp
# src/saveload/saveload.cpp
# src/saveload/saveload.h
# src/saveload/station_sl.cpp
# src/saveload/vehicle_sl.cpp
# src/settings.cpp
# src/settings_gui.cpp
# src/settings_internal.h
# src/stdafx.h
# src/table/settings/settings.ini
# src/town_cmd.cpp
# src/vehicle.cpp
3 years ago
Jonathan G Rennison
544da99102
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# src/cargopacket.h
# src/lang/korean.txt
# src/linkgraph/linkgraph.h
# src/linkgraph/linkgraphjob.h
# src/linkgraph/linkgraphschedule.h
# src/network/network_admin.h
# src/network/network_func.h
# src/network/network_server.cpp
# src/network/network_server.h
# src/order_base.h
# src/rail_cmd.cpp
# src/saveload/company_sl.cpp
# src/saveload/depot_sl.cpp
# src/saveload/economy_sl.cpp
# src/saveload/linkgraph_sl.cpp
# src/saveload/map_sl.cpp
# src/saveload/newgrf_sl.cpp
# src/saveload/order_sl.cpp
# src/saveload/saveload.cpp
# src/saveload/saveload.h
# src/saveload/signs_sl.cpp
# src/saveload/station_sl.cpp
# src/saveload/subsidy_sl.cpp
# src/saveload/town_sl.cpp
# src/saveload/vehicle_sl.cpp
# src/script/api/script_object.cpp
# src/settings.cpp
# src/string.cpp
# src/string_func.h
# src/table/CMakeLists.txt
# src/table/settings/settings.ini
# src/viewport_sprite_sorter_sse4.cpp
3 years ago
Jonathan G Rennison
0b0d154788
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# .github/workflows/ci-build.yml
# src/lang/german.txt
# src/lang/romanian.txt
# src/lang/slovak.txt
# src/lang/turkish.txt
# src/network/core/address.cpp
# src/network/core/tcp.h
# src/network/core/udp.cpp
# src/network/network.cpp
# src/network/network_client.cpp
# src/network/network_server.cpp
# src/network/network_server.h
# src/network/network_udp.cpp
# src/openttd.cpp
# src/saveload/newgrf_sl.cpp
# src/tree_cmd.cpp
# src/video/video_driver.hpp
# src/window.cpp
# src/window_gui.h
3 years ago
Jonathan G Rennison
4174fe727c
Add NewGRF feature: Extra station name strings
...
These are used when all the default names have been used up,
instead of "Town Station #NNN".
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
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
Jonathan G Rennison
b438380a1e
Add station cargo history save/load support
3 years ago
Jonathan G Rennison
5698507d0b
Change station cargo history storage format
...
Use uint16 to avoid truncation issues
Don't reserve memory for unused cargoes
Store history as ring buffer
Update history graph immediately on storage date
Show total waiting cargo
3 years ago
Andreas Schmitt
9b1783809d
Add station cargo history
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
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
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
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