Commit Graph

42 Commits (jgrpp)

Author SHA1 Message Date
Jonathan G Rennison f993e30850 Take cargo refit into account in build vehicle window capacity sort modes 2 weeks ago
Jonathan G Rennison 9d65fd9c2a Adjust handling of vehicles introduced before vehicle expiry stop year
See: #646
3 months ago
Jonathan G Rennison 7ce06e22b8 Split date types into calendar and economy dates
See: 735abfe1
3 months ago
Jonathan G Rennison 97e6f3062e Adding of _t to (u)int types, and WChar to char32_t
See: eaae0bb5e
4 months ago
Jonathan G Rennison 42c8f50551 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/release-linux.yml
#	.github/workflows/release-macos.yml
#	.github/workflows/release-windows.yml
#	.gitignore
#	COMPILING.md
#	src/company_gui.cpp
#	src/date_gui.cpp
#	src/engine.cpp
#	src/engine_func.h
#	src/fileio.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/newgrf_debug_gui.cpp
#	src/newgrf_gui.cpp
#	src/order_gui.cpp
#	src/osk_gui.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/script/api/script_event_types.hpp
#	src/sl/oldloader_sl.cpp
#	src/smallmap_gui.cpp
#	src/station_cmd.cpp
#	src/toolbar_gui.cpp
#	src/town_gui.cpp
#	src/transparency_gui.cpp
#	src/vehicle_gui.cpp
#	src/widget.cpp
#	src/widget_type.h
#	src/widgets/dropdown.cpp
#	src/widgets/dropdown_func.h
#	src/widgets/dropdown_type.h
#	src/widgets/group_widget.h
#	src/widgets/vehicle_widget.h
#	src/window.cpp
#	src/window_gui.h
#	src/window_type.h
5 months ago
Peter Nelson 934545a674
Fix: Calculation of initial engine age was inaccurate. (#11660)
Engine age in months was calculated as the difference in days / 32, instead of the actually difference in months. This would result in engines being artificially younger if a game was started at a later date.
5 months 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
10 months ago
Tyler Trahan 930f0a16d8 Codechange: Define Date/Year/Month/Day within TimerGameCalendar class 1 year ago
Jonathan G Rennison 10e76b2788 Fix #10032: Capacities of articulated vehicles in build window
See also: #9954
1 year ago
Jonathan G Rennison 64c210f770 Merge branch 'master' into jgrpp
# Conflicts:
#	src/build_vehicle_gui.cpp
#	src/engine.cpp
#	src/engine_func.h
#	src/group_gui.cpp
#	src/lang/english.txt
#	src/newgrf.cpp
#	src/saveload/oldloader_sl.cpp
#	src/timetable_cmd.cpp
#	src/timetable_cmd.h
#	src/timetable_gui.cpp
1 year ago
Peter Nelson cbf48c4dd9 Change: Add extra random seed to StartupEngines().
This means that calling reset_engines will rerandomise introduction dates
and reliability.

Probably not necessary.
1 year ago
Peter Nelson 3485709f53 Add: Additional vehicle flags to control variants. 1 year ago
Jonathan G Rennison c7e4dbf2f6 Fix displayed capacities/weights of articulated vehicles in build window
Simplify handling of multi-part capacities and refits

See: https://github.com/OpenTTD/OpenTTD/issues/9954
See: https://github.com/OpenTTD/OpenTTD/issues/10032
2 years ago
Jonathan G Rennison a15e26f369 NewGRF: Elide unmasked vehicle callbacks where possible
This includes:
* CBID_VEHICLE_32DAY_CALLBACK
* CBID_VEHICLE_REFIT_COST
* CBID_VEHICLE_MODIFY_PROPERTY
  This is on a per-property basis

The main benefit of this is to avoid callbacks not handled by the
vehicle's current sprite group from using the full graphics chain as
the "default" branch in the callback switch.
In the case where the graphics chain is long/expensive, a lot of work
had to be done before a callback failure result was eventually returned.
3 years ago
Jonathan G Rennison a670e369db Add setting for no vehicles introduced after given year 3 years ago
glx b50d77b831 Fix #8064: Incorrect display of refit capacity 4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
peter1138 e6bb90543e Change: Show additional cost and refitted capacity in build vehicle window. 5 years ago
PeterN 4cebebcf68
Change: Add CargoTypes type for cargo masks. (#6790) 6 years ago
alberth bc84c52b30 (svn r26849) -Fix[FS#6113]: Better display of refit information in articulated vehicles. 10 years ago
rubidium 1efc64fa7d (svn r25553) -Fix [FS#5530]: provide a warning when no vehicles are available, and tell what to do in that case 11 years ago
frosch b78a459613 (svn r22977) -Codechange: Rename SetCachedEngineCounts() to GroupStatistics::UpdateAfterLoad(). 13 years ago
alberth 7303f7d199 (svn r21595) -Codechange: Some header files had their name changed, update the ifndef/define/endif lines. 14 years ago
rubidium 82fc28f77f (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 15 years ago
rubidium 1c5a92ae98 (svn r18121) -Codechange: pass the maximum left/right location to the Draw*Engine functions 15 years ago
frosch 9a9d0ee7c0 (svn r17728) -Cleanup: Remove some more unneeded/unused parameters. 15 years ago
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 15 years ago
rubidium fa78027ffd (svn r15666) -Fix [FS#2689]: sorting of engines in the purchase list didn't use the same numbers as the GUI showed, e.g. articulated parts weren't taken into accound when ordering by capacity. 15 years ago
frosch d3850e101c (svn r15541) -Revert (r15399): 'v->cargo_type' is also used in other places, which cannot accept CT_INVALID.
-Codechange: Add Engine::GetDefaultCargoType() and Engine::CanCarryCargo() and use them.
-Fix [FS#2617]: When articulated parts have no available default cargo, use the cargo type of the first part for livery selection.
-Change: To decide whether a vehicle is refittable do not test its current capacity for being zero, but always use the 'capacity property'.
  Note: The property is used unmodifed without calling CB 15/36. By setting it to a non-zero value and returning zero in the callback vehicles can be refitted to/from zero capacity for e.g. livery effects.
  Note: It is intentional that you cannot control refittability by CB 36.
15 years ago
peter1138 748d4d2fb9 (svn r15412) -Fix: Clearing custom engine names could cause desyncs due to be client-side only; GUI parts of save/load of custom engine names also removed as it was never implemented. 16 years ago
smatz 6dffd8ae82 (svn r15216) -Feature: native support for Transport Tycoon (Original) savegames. Based on SVXConverter's source code and documentation by Roman Vetter 16 years ago
smatz a9a8bb3590 (svn r15166) -Codechange: reduce number of includes in afterload.cpp 16 years ago
peter1138 0052c85002 (svn r14926) -Feature: Automatically set last engine ageing year to the last 'introduction year plus half model life', to allow engines later than 2050 to appear. 16 years ago
rubidium c7c65cf5bc (svn r14683) -Change: only say a engine/vehicle is refittable when it can be refitted to at least two cargo type or when it has subcargos.
NOTE: it is still possible that a vehicle is marked refittable when there is nothing to refit to, e.g. when only one subcargo is available but that cannot be determined without a vehicle chain.
16 years ago
rubidium 3b798599b6 (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with. 16 years ago
peter1138 f7a9c4f522 (svn r13287) -Codechange: move engine list gui code away from engine.cpp (and its headers) to engine_gui.cpp 16 years ago
smatz a9cc987929 (svn r13077) -Codechange: move function that updates cached num_engines to engine.cpp, make it run only 1 loop 16 years ago
smatz 3445b8054c (svn r12995) -Codechange: use std::vector for EngineList instead of C/C++ wrapper for CBlobT 16 years ago
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. 16 years ago
peter1138 a00371c8db (svn r12924) -Feature: Introducing the so called 'engine pool' which primarily removes the fixed engine type limits and also happens to allow (with the patch option 'dynamic_engines') multiple NewGRF vehicle sets to coexist. 16 years ago
rubidium c84fe27ca9 (svn r12787) -Documentation: add/fix documentation of some functions. Patch by Alberth. 16 years ago
rubidium ef2be7d0fc (svn r12490) -Codechange: rename engine.h to engine_func.h and remove unneeded inclusions of engine.h and/or replace them with engine_type.h. 16 years ago