Commit Graph

167 Commits (2fd9096070cf5af8548dadafdaf32e49909f6a8b)

Author SHA1 Message Date
Peter Nelson 2fd9096070
Change: Decouple and remove landscape-dependent cargo types. (#11719)
Cargo types of default engines, industries and houses are now specified in terms of label.
4 months ago
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 4 months ago
frosch abfeeea849 Codechange: Compose engine preview text from multiple strings. 4 months ago
Peter Nelson 7737aa6640 Codechange: Make all NWidgetPart arrays constexpr.
This ensures that the arrays are not created at runtime and prevents using non-constexpr values.
5 months ago
Peter Nelson 952d111b94 Codechange: Split CT_INVALID into CT_INVALID and INVALID_CARGO.
INVALID_CARGO is a CargoID and should be used for most purposes in game.
CT_INVALID is a CargoType used for defining default properties.
5 months ago
Peter Nelson a0dfb76e34 Codechange: Replace mishmash of types for widget index with WidgetID.
Indices were stored as int, but often passed around as uint/uint8_t and casts.

Now they should all use WidgetID.
5 months ago
Peter Nelson c18a1494b7
Codechange: Remove FONT_HEIGHT_... macros. (#11481)
These make it look like we're dealing with a constant, but actually each is a call to `GetCharacterHeight(...)`.
7 months ago
Peter Nelson 18fb8e153f Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
This is to allow unit-tests to produce more useful output.
7 months ago
Peter Nelson 616fb48e25 Change: Use modalpopup spacing for engine preview window. 7 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 9 months ago
Peter Nelson e8015e497d Codechange: Use begin/end of nwidget parts of begin/length.
This simplifies processing nwidget parts as, unlike the remaining length, the pointer to the end of the list never changes. This is the same principle as we use(d) for tracking end instead of length for C-style strings.

And this removes 160~ instances of the lengthof() macro.
9 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
11 months ago
glx22 46b504a700 Fix: ini_key issues reported by the script 11 months ago
PeterN 64930c343a
Codechange: Pass reference instead of pointer to GUI*Lists. (#10822)
Pointer-avoidance.
1 year ago
PeterN f1144de509
Feature: Separate rail/road and sea/air velocity units, and add knots. (#10594)
This is achieved by packing vehicle type along with the velocity so that
the string system can decode and pick the appropriate unit.
1 year ago
Michael Lutz 05ed9f56fd Feature: [NewGRF] Engine name callback. 1 year ago
Rubidium 8aeef665c7 Fix #10377, Fix 94167df: bad sorting of rail vehicles when primary variant is missing 1 year ago
PeterN 53b827c460
Fix: Maximum space for engine preview image was never scaled. (#10219) 2 years ago
Peter Nelson 890b2666d3 Change: Use scaled WidgetDimensions. 2 years ago
Peter Nelson cd0d5a771d Fix: Engine preview text overly padded.
WIP_EP_QUESTION is already padded at the widget level, so no need to apply
extra padding to left/right.
2 years ago
Peter Nelson f5f035a22b Codechange: Make use of Rect Width/Height helpers. 2 years ago
Michael Lutz 21675ec7e2 Codechange: Un-bitstuff vehicle/engine commands. 3 years ago
Michael Lutz 0f64ee5ce1 Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
3 years ago
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 3 years ago
glx22 994bf19aef Fix f6d5c01: Delay deletion when closing windows 3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 5 years ago
glx b52561fd38 Codechange: use std::sort() in EngList_Sort[Partial]() 5 years ago
glx22 66dd7c3879
Fix: MSVC warnings (#7423) 5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 5 years ago
Henry Wilson aa7ca7fe64 Codechange: Replaced SmallVector::Get(n) non-const with std::vector::data() + n 5 years ago
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 5 years ago
peter1138 317f69c152 Codechange: Use override specifier in Window-derived classes. 5 years ago
Nikolas Nyby 6a56a4ce84 Fix #6584: text layout problem in engine preview dialog
With language set to German, there was a problem in this dialog box due
to the long strings in this language. It looks like the call to
`GetStringHeight()` here is using `r.top` to help calculate the
max width, rather than `r.left`.
5 years ago
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
frosch a682962719 (svn r27889) -Change: Do not cancel headquarter construction and engine-preview-query when shift-clicking (adf88) 7 years ago
alberth da608f6214 (svn r27802) -Add: Display aircraft type in engine preview window (patch by Samu) 7 years ago
alberth dda71fab19 (svn r27800) -Change: Rename long aircraft string names of the preview window 7 years ago
peter1138 1748d7ad6b (svn r26934) -Fix (r26933): Don't statically initialise non-static variables. 10 years ago
peter1138 2b9782fd95 (svn r26933) -Codechange: Resize engine preview window to fit vehicle sprite. 10 years ago
alberth 4ff3ab1357 (svn r26848) -Codechange: Unduplicate summing of cargo capacities in GetTotalCapacityOfArticulatedParts. 10 years ago
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
frosch 8157a8afd8 (svn r25290) -Add: Assign string names to notable windows. 11 years ago
frosch 56e4a8c4d6 (svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction. 11 years ago
frosch 5c358c4173 (svn r24811) -Add: Close engine preview window when another client accepts it. 12 years ago
frosch 2bb54f09d8 (svn r24809) -Feature(ette) [FS#2632]: Consider engine preview windows always sticky, so non-shift mass-closure does not affect them. 12 years ago
frosch 77ff4c9155 (svn r24058) -Fix [FS#5124]: Wrong numbering of string parameters. 12 years ago
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 13 years ago
truebrain e9f584ac21 (svn r23531) -Codechange: document and rename widgets to be consistent and understandable 13 years ago