truelight
5fd9aeb12b
(svn r6055) -Codechange: added GetXXXArraySize, which returns HighestID + 1 (or, will do that).
...
It isn't the best name, but we couldn't find any better.
This unifies the pool-system even more.
18 years ago
rubidium
480af9c917
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
18 years ago
Darkvater
b13a60db42
(svn r5910) Fix some more warnings on MSVC by using (void*) casts. Followup of r5907.
18 years ago
tron
4ad8d1c7a2
(svn r5907) Remove more indirection by using pointers instead of IDs. Also fix some bogus warnings on MSVC by using (void*) casts
18 years ago
tron
c16d77874e
(svn r5895) Remove dead code
18 years ago
tron
ba14683912
(svn r5894) Remove a totally unnecessary indirection in the vehicle sorter code. Less code, less data, simply better
18 years ago
rubidium
243872b4fd
(svn r5887) -Cleanup: move date related functions, defines and variables to date.[ch]
...
-Cleanup: fix whitespace related coding style issues in date.[ch]
-Cleanup: make original comments doxygen compatible and remove/change outdated comments
18 years ago
peter1138
e0d8223355
(svn r5820) - NewGRF: Add support for extra vehicle text in the purchase list for road vehicles, aircraft and ships.
18 years ago
tron
6302469aa8
(svn r5399) Simplify a conditional expression: (a && b) || (!a && !b) -> a == b
18 years ago
tron
d2f6cb9e2d
(svn r5262) Add symbolic names for the aircraft subtypes. not perfect, but better than raw numbers
18 years ago
peter1138
efd0d2d2b7
(svn r4561) - NewGRF: implement most of callback 0x23: additional text in vehicle purchase windows.
19 years ago
peter1138
4fcd2f0643
(svn r4343) [Autoreplace] Fix drawing of train list for outdated engines. Fixes FS#106
19 years ago
peter1138
2039471d3c
(svn r4229) [elrail & autoreplace] Always show compatible rail vehicles in the left list, and only the selected rail type in the right list, to
...
allow converting electric engines to non-electric.
19 years ago
peter1138
cd0a67dc65
(svn r4201) - Codechange: Do for _engine_info[] what we do for _*_vehicle_info[]; create and use a function to retrieve data, and ensure constness.
19 years ago
celestar
a7d8ad0004
(svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
19 years ago
peter1138
4f9ea7640a
(svn r3620) - 2cc: Replace use of macro to determine colour map with a function call for drawing of vehicles.
19 years ago
tron
480ce3d931
(svn r3610) And one more (see r3608/r3609)
19 years ago
tron
04d350aa9a
(svn r3609) Some more simplification in the same function as r3608
19 years ago
tron
6cde2661c5
(svn r3608) No functional change, just make some code more comprehensible: Reduce variable scope, remove write-only variables, turn do-while-loops with multiple induction variables into canonical for-loops
19 years ago
peter1138
fe7267ca91
(svn r3605) - Remove silly macro and fix indenting in DrawVehicleRefitWindow()
19 years ago
tron
453b30e387
(svn r3564) Several smaller changes:
...
- Don't treat non-booleans as booleans
- Reduce variable scope
- Bracing
- Use DeMorgan's law to make conditionals easier to read
- if cascade -> switch
- Replace some magic numbers by symbolic names
- Avoid assignments within other statements
19 years ago
peter1138
500a7e6627
(svn r3546) - NewGRF feature: Implement rail vehicle 'property' 0x1A: allows shuffling order of rail vehicle purchase list (and replace vehicle list)
19 years ago
bjarni
78b51cbec2
(svn r3535) -Feature: [autoreplace] allow autoreplacing of train wagons
...
currently ALL available wagons are displayed in the right menu in the replace window
however the replacement will only be done if the new wagon can be refitted to carry same cargo as the old one is currently carrying
Since the standard vehicles do not have any valid wagon replacements, this feature can only be used when using newgrf sets
19 years ago
peter1138
6dd2affaad
(svn r3528) - Feature: Allow sorting of vehicle lists by model or value (based on meush's work)
19 years ago
peter1138
b88904f345
(svn r3524) - Split newgrf features from engine.[ch] into newgrf_engine.[ch], and add the new files to project files.
19 years ago
tron
22dc05faf2
(svn r3510) Fiddle with whitespace and parentheses
19 years ago
peter1138
90aff7a026
(svn r3396) - Autoreplace changes:
...
- Change fixed array per player to a single pool. This avoids future problems
with vehicle numbers and decreases savegame size. Engine replacements from
previous savegames will be lost.
- Move engine replacement code from players.c to engine.c.
(thanks to blathijs for rewriting this)
19 years ago
tron
5ac1a89f92
(svn r3366) Make an unnecessarily global variable local
19 years ago
peter1138
eeeebf9f6d
(svn r3359) - Autoreplace GUI: When starting or stopping a replacement, redraw the replace window after the command has completed, rather than after calling the command.
19 years ago
tron
246c126d25
(svn r3353) Simplify the automatic length adjustment algorithm for replacing trains: Use the length of the train before the replacement as reference length
19 years ago
tron
bf98086de8
(svn r3298) Remove unused and write-only variables
19 years ago
peter1138
560a4a9c4a
(svn r3292) - Autoreplace: Disallow replacing to an engine type that already has a replacement set up; this stops loops being set up.
19 years ago
peter1138
04f39ef749
(svn r3291) - Codechange, Autoreplace: Replace int with EngineID and -1 with INVALID_ENGINE, as appropriate.
19 years ago
peter1138
1c57091230
(svn r3270) Correct all (mis)uses of WWT_CLOSEBOX / WWT_TEXTBTN to reflect their actual use, and add "Close Window" tooltip where missing.
19 years ago
peter1138
87f54ebf92
(svn r3239) - Codechange: Introduce and use helper functions for engine replacement code.
19 years ago
bjarni
22a4679837
(svn r3218) -Feature: Multiheaded train engines will now stay in the same train
...
This means that any user attempt to remove a rear engine will tell the user to move the front engine instead
This fixes the assert when moving multiheaded engines (introduced in r3144)
Note: to make old savegames use this feature, some engines might be turned around in order to link engines in pairs
-Codechange: train subtype is now a bitmask
This allows fast access to info like if it is a wagon or engine and if it is in front and so on
Note: savegame version bump
19 years ago
tron
f7abff5f96
(svn r3181) -Bracing
...
-Indentation
-Whitespace
-DeMorgan's Law
-Test with NULL or 0 for non-booleans
-'\0' instead of 0 for chars
-Remove redundantly redundant comments (like DoFoo(); // Do foo)
-Join multiple short lines with a single statement
-Split single lines with multiple statements
-Avoid assignments in if
19 years ago
tron
ee15e3de13
(svn r3172) static, const
19 years ago
bjarni
5481dcd191
(svn r3155) -Feature: [autoreplace] autoreplace can now remove cars from too long trains
...
-Trains will now remember the length of stations it visits and sell cars
when being autoreplaced if they became too long
-If it needs to remove cars, then it starts from the front and sells
all it can find until the train is short enough
-This only works for trains, that knows the station length of the route
so a full uninterrupted run is needed
-a train needs 1-2 runs to detect if the shortest station is expanded
-This feature can be turned on and off in the train replace window
and each company can have it's own setting
-NOTE: minor savegame version bump
19 years ago
peter1138
bc25cd89bf
(svn r3148) -NewGRF, Feature: Add support for cargo refitting specification by cargo classes.
19 years ago
peter1138
328158395b
(svn r3106) -Autoreplace feature: Continue to show old vehicles in replace window after all player's vehicles of that type have been replaced. This allows the replacement to be removed. These vehicles are shown in grey instead of the player's colour.
19 years ago
peter1138
b97473e874
(svn r3089) Fix possible issue with out-of-bounds array access in replace vehicle gui, and add brief commenting.
19 years ago
bjarni
7cace07e01
(svn r3082) made ChangeVehicleViewWindow() more readable (added in last commit)
19 years ago
bjarni
bf467bd99c
(svn r3081) -Codechange: [autoreplace] complete rewrite of autoreplace
...
this is a complete rewrite, that makes use of existing commands like build and sell
this means that multiheaded train engines are replaced correctly
19 years ago
tron
47137cefb7
(svn r3078) Some more stuff, which piled up:
...
- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
19 years ago
tron
f3de172560
(svn r3059) Use bitfields to encode railtype and climates of engines instead of manual shifting/anding
19 years ago
tron
66bf4f863d
(svn r3049) Replace byte/int/uint by RailType where appropriate
19 years ago
tron
ab657338ec
(svn r3048) Replace 0/1/2 by RAILTYPE_RAIL/MONO/MAGLEV where appropriate
19 years ago
tron
0cc45ecd8e
(svn r3003) Change int, uint, uin16 and byte to EngineID where appropriate, plus some related changes (mostly casts)
19 years ago
tron
ff30404170
(svn r2992) Use PlayerID, StationID and INVALID_STATION instead of int, int and -1
19 years ago