glx
8bb61ca472
(svn r4785) - Newstations: don't draw catenary on non-track tiles
19 years ago
peter1138
bfaf9e1489
(svn r4780) - Newstations: when building using a dynamic layout, add the station axis to the returned tile type. Also supply correct parameters to var 10.
19 years ago
peter1138
9d6ddd364e
(svn r4767) - Newstations: fix loading / use of custom ground sprites
19 years ago
peter1138
36e27af00c
(svn r4763) - Newstations: revert r4762, instead map bit the palette modifier from bit 14 to bit 31 on GRF load.
19 years ago
peter1138
8573da9d96
(svn r4762) - Newstations: make child sprites transparent.
19 years ago
peter1138
77a4bc5aac
(svn r4761) - Newstations: support platform information in variable 10 (callback parameter 1) when building a station
19 years ago
peter1138
c778716264
(svn r4758) - Newstations: add support for 'blocked' station tiles, which no train can pass.
19 years ago
peter1138
6b8b8395e4
(svn r4757) - Newstations: add saveload support for custom station speclists
19 years ago
peter1138
09bb8ba10c
(svn r4754) - Newstations: expose default station display data via a function so we can use it (rarely) in other places.
19 years ago
peter1138
cf30c682a8
(svn r4742) - Newstations: Add callbacks for building and drawing custom stations.
19 years ago
peter1138
e5d936d0fe
(svn r4739) - Newstations: remove cargo type parameter of GetCustomStationRelocation() as we can determine it internally
19 years ago
peter1138
7826236b23
(svn r4724) - Newstations: Add per-tile random data for station tiles.
19 years ago
peter1138
c722c88f43
(svn r4723) - Newstations: add TileIndex parameter to station resolver.
19 years ago
peter1138
62e6493dd0
(svn r4719) - Newstations: instead of drawing nothing, fall back to the default sprite layout if a station layout specifies so.
19 years ago
matthijs
6756304fc1
(svn r4640) - Add: IsValidDiagDirection, IsValidDirection and IsValidAxis functions.
...
- Codechange: Use IsValidDiagDirection() in CmdBuildRoadStop().
19 years ago
celestar
d50f899420
(svn r4619) -Codechange: Rename FindRoadStationSpot into FindRoadStopSpot and try to document it a little.
...
if anyone comes up with an idea on how to simplify this thing a bit, I'd be grateful
19 years ago
peter1138
d5837d5e8d
(svn r4612) - NewStations: add random bits (for graphic variation) to stations
19 years ago
glx
07ac5f583b
(svn r4602) - Fix: an assertion triggered when building a station near the south corner of the map (appeared in r4367)
19 years ago
belugas
3ac1832fd1
(svn r4593) CodeChange : Renamed spec (when using StationSpec) to statspec.
...
This is following the same scheme as for IndustrySpec
19 years ago
tron
b57640e28a
(svn r4572) Remove vehicle_leave_tile_proc
...
There's exactly one implemented function (unbarring a level crossing) and one place where it can be triggered (a train leaves a level crossing)
It's a bit overkill, so just handle this one case where it can happen
19 years ago
tron
6dbc9c9ced
(svn r4554) Replace magic numbers by TILE_{HEIGHT,SIZE}
19 years ago
tron
dd180a1e18
(svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums
19 years ago
Darkvater
0a0b8f22aa
(svn r4529) - Codechange: Use proper naming for hex numbers in debug prints eg. 0xF3A6. Use fixed lengths where applicable (newgrf). Unfortunately '%#X' is unusable since it gives 0XFF3 and '%#x' gives 0xff3 while we want 0xFF3 :P
19 years ago
peter1138
65c43cb425
(svn r4473) - Newstations:
...
- Alter parameters of CMD_BUILD_RAILROAD_STATION to accept a custom station class and id.
- Add a dynamically allocated list of custom stations that the SpecIndex (m4) references.
19 years ago
peter1138
100cc6fea7
(svn r4471) - Pools: Add a facility for calling a custom function during pool block clean up.
19 years ago
celestar
277f8cbda2
(svn r4466) -Fix: (FS#71) Game no longer crashes when the last vehicle serving a station has been deleted.
...
-Negative side effect: upon loading old games, stations whose last vehicle was a station have (temporarily) lower ratings.
-Positive side effect: station.h no longer includes vehicle.h (breaks the station.h->vehicle.h->rail.h chain)
19 years ago
peter1138
49160bde23
(svn r4462) - Newstations: ensure the chosen tile layout is available from a custom station
19 years ago
peter1138
7331bfd36a
(svn r4460) - Newstations: remove unused class_id / stat_id variables from the
...
Station struct.
19 years ago
peter1138
f52f3fa55d
(svn r4450) - NewStations, rename *CustomStationSprite() to *CustomStationSpecIndex() to reflect their use, and alter the test for determining if a station has customised graphics.
19 years ago
belugas
6ac73b104e
(svn r4426) Code Cleaning : replacing tabs with spaces, removing obvious comments, aligning arrays etc...
19 years ago
belugas
ccfeb13047
(svn r4425) Fix bug introduced in r4411 : while IS_BYTE_INSIDE, max value is STRICKLY LESS THEN. This caused airports animations to stay unanimated. Industries were similarly affected.
...
Thanks to Richk67 for finding it.
Also, more Gfx define and use.
19 years ago
belugas
c09109cc67
(svn r4411) CodeChange : Define and use some Gfx for both stations and industries. More are still to come
...
Also, a bit of code cleaning, as pointed by Tron
19 years ago
belugas
e09b87f56e
(svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
19 years ago
peter1138
7b6e932d82
(svn r4383) - Codechange: Remove extraneous code from 4354; no need to get RailTypeInfo when we already have it...
19 years ago
belugas
6f708b2efe
(svn r4367) CodeChange : Remove another direct map access in station_cmd.c. Replace an array of TileIndexDiffC by a use of loop with TileDiffXY. Thanks to Rubidium
19 years ago
peter1138
b87b68842a
(svn r4354) [Elrail][NewGRF] Codechange: Drawing of custom waypoints with custom ground sprites used the index of the rail type as an offset. With the introduction of elrails this offset is incorrect, so instead there is now a lookup table within the RailTypeInfo struct to explicitly list the offset.
19 years ago
tron
35e93e451f
(svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
...
Remove DoCommandByTile(), because now it does the same as DoCommand()
19 years ago
tron
25366909ae
(svn r4331) Replace some direction calculation magic with DiagDirection to make a bit more clear what's going on
19 years ago
tron
78a74a94a6
(svn r4325) When updating the vehicle count for road stops after load use the slot pointer of the vehicle instead of recalculating the road stop using the destination tile of the vehicle. Apart from being more simple this could prevent a inconsistency of slot information in the edge case when the destination tile isn't the tile of the assigned slot.
19 years ago
tron
a0e471a025
(svn r4324) Remove the unused road stop type attribute from struct RoadStop
19 years ago
tron
d3f3f9ff3c
(svn r4323) -Regression: Clear the slot assignments of all vehicles heading twoards a road stop if that road stop gets removed
...
This issue was fixed in r2210 and reintroduced in r4259 when the multistop handling was overhauled.
19 years ago
celestar
a12466403b
(svn r4320) -Fix/Codechange: rs->num_vehicles is no longer saved or loaded, but computed on the fly. Partly fixes FS#101
19 years ago
celestar
75fa1601f2
(svn r4319) -Codechange: Station map accessors
19 years ago
celestar
59c8408ccf
(svn r4316) -Codechange: finished r4257 (forgot one variable there)
19 years ago
Darkvater
b02fc3b62b
(svn r4265) - Fix: compile warning on VS2005 (parameter 2 different from declaration)
19 years ago
celestar
8cbe98a3fd
(svn r4259) -[multistop] Fix/Feature/Codechange:
...
1) Improved the road vehicle allocation (aka slotting) for multistop. Stops can now accept unlimited, er... 256, vehicles.
2) Removed the "wait for stop" feature, because it did not work in practise.
3) Slotting now ignores unreachable stations. Uses NPF at the moment because the old pathfinder cannot do it (yet)
4) Now matter how many vehicles approach a station, they will always be distributed evenly over existing stops.
5) Hopefully the last fundamental change to multistop
19 years ago
celestar
c6aac81a9d
(svn r4257) -Codechange: Renamed the airport_map5_tiles_* variables into airport_sections_*
19 years ago
celestar
69e1c716e8
(svn r4249) -Codechange: Replace more occurences of 16 by TILE_SIZE and of 8 by TILE_HEIGHT. Reverted one change from the previous commit because it was faulty
19 years ago
tron
7163a64c25
(svn r4242) Pass TileIndex and slope to GetSlopeTileh_*() instead of TileInfo
19 years ago
celestar
45f65b1788
(svn r4173) -Codechange: Use IsClearWaterTile for buoy construction
19 years ago
belugas
1cadf4ea53
(svn r4157) CodeChange : Keep on cleaning up Celestar's elrail merge
19 years ago
celestar
6c44bf5012
(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
Darkvater
e91fa54a15
(svn r4128) - CodeChange: Add proper semantics for CargoID for such variables instead of using the general byte-type.
19 years ago
celestar
9b3b545259
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
...
Some work with animated tiles remains. Thanks to Tron for parts of the code and lots of proof-reading and suggesting
19 years ago
tron
d0a445db41
(svn r4111) Fix/Remove some stale comments
19 years ago
tron
f6285a659c
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
19 years ago
tron
4d3364d811
(svn r3996) -Fix: Slope and height information returned for some tile types is wrong
...
This leads to graphical glitches when drawing foundations.
This doesn't fix all problems, but at least some of them.
19 years ago
celestar
480ea7c671
(svn r3939) -Fix: No longer assume that the number of slots is 2. It was not a problem up to now, but it's not The Right Thing (TM) to do either
19 years ago
tron
7b1c7c31fb
(svn r3916) Get/Set the rail type by [GS]etRailType{Crossing,OnBridge,}()
19 years ago
Darkvater
650b1b0c93
(svn r3895) - Add proper SLE(G)_CONDNULL macros for the empty space reservation in savegames and update where used
...
- Also add this capability to settings
19 years ago
tron
7a0071cc53
(svn r3829) Reduce the use of _error_message by directly returning error codes instead of using this global variable
19 years ago
tron
ab9af3b05d
(svn r3787) Use DirToDiagDir() instead of >> 1
19 years ago
tron
8cfcdaa733
(svn r3783) Replace further ints and magic numbers by Direction, DiagDirection and friends
19 years ago
celestar
db4777c818
(svn r3730) Multistop modifications:
...
-Codechange: Completely rewritten the slot assignment system. It now consumes less CPU cycles and memory
-Codechange: Increased maximum number of roadstops to 16.
-Fix: Several conditions where a slot becomes unliked from a vehicle
-Codechange: ClearSlot now only takes one parameter, the vehicle
-Feature: Console command 'clearslots' to clear ALL currently assinged slots. debug usage only
-Feature: vehicles that cannot get a slot now wait on the road instead of planlessly blocking stops or circling around
-Codechange: Adjusted debug levels
TODO: Make the slot finder compatible with (a) pathfinder(s).
19 years ago
tron
116fb6dff6
(svn r3714) Add functions to turn tiles into water and shore tiles
19 years ago
tron
7b106a3d8f
(svn r3697) Rename DIAG1/DIAG2 to X resp. Y as this conveys a bit better in which direction a pieces of rail goes
19 years ago
tron
b8b6084da2
(svn r3644) Don't use FindLandscapeHeightByTile() when it's overkill - often it was just a complicated way of writing GetTileSlope(tile, NULL)
19 years ago
Darkvater
bf27f0c77b
(svn r3627) - Change all hardcoded 255 max-saveload versions with the define SL_MAX_VERSION
19 years ago
tron
7692556c62
(svn r3613) Some more const, indentation, whitespace and similar stuff
19 years ago
peter1138
95ce125633
(svn r3612) - RoadStop->slot[] stores a vehicle index. Adjust its type and use INVALID_VEHICLE instead of nonsense INVALID_SLOT.
19 years ago
tron
d9a5483d1a
(svn r3582) Restructure MoveGoodsToStation() to avoid double bookkeeping of StationIDs and station pointers
19 years ago
tron
d0a84a4cb9
(svn r3581) Just noticed the indentation was totally off, fix it
19 years ago
tron
0a7b664ae5
(svn r3580) Some small cleanups before the real change, especially reduce the indentation by one by using continue
19 years ago
tron
087fe86ed2
(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
a3c14182d3
(svn r3530) - NewGRF: Move station resolver to newgrf_station
19 years ago
tron
1c3e8630fe
(svn r3511) More whitespace ([FS#46] by Rubidium)
19 years ago
tron
9712d6f639
(svn r3510) Fiddle with whitespace and parentheses
19 years ago
Darkvater
4014e36aec
(svn r3472) - [PBS] Remove from trunk. Anyone interested can still find it in branch/pbs. This reverts revisions r3158, r3140, r3075, r2977, r2674, r2625, r2621, r2529, r2528, r2525, r2524, r2519, r2517, r2516, r2507, r2499. (in conjunction with Tron)
...
- The only change is that the nsignalsw.grf file is kept and that existing nightlies with PBS signals get those signals converted to combo-signals.
19 years ago
peter1138
d639318abd
(svn r3372) - Fix: update signal states when building or removing rail station blocks
19 years ago
tron
318fe153eb
(svn r3365) Staticise 36 functions
19 years ago
tron
ed4b89ee36
(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
truelight
a980ddc219
(svn r3341) -Codechange: make mingw32 happy, and renamed Rectangle, because it already exists on that platform
19 years ago
tron
d5aa95b87e
(svn r3313) Remove GPMI related changes from trunk
...
Revisions in detail: 2542, 3226 (partial), 3229, 3231, 3232, 3238, 3242-3245, 3251, 3253, 3260, 3263, 3265, 3266, 3269, 3277, 3278, 3279, 3283 (partial), 3304, 3305, 3306
19 years ago
truelight
6ca528ec82
(svn r3305) -Rename: Changed all instances of ottd_ related to the AI to ttai_
19 years ago
tron
9822b4d755
(svn r3297) Staticise
19 years ago
peter1138
80986fcd32
(svn r3282) - Codechange: Replace tests against CMD_ERROR with CmdFailed()
19 years ago
truelight
8315736569
(svn r3232) -Add: implemented the event-system for AIs
...
-Add: added several hooks (event-callbacks) for road-related-stuff
19 years ago
truelight
898bb915ac
(svn r3227) -Codechange: [Savegame] removed 'minor' version, and renamed 'major' version to just: version.
19 years ago
bjarni
16e65960b9
(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
peter1138
2a9d325930
(svn r3213) - Codechange: Clean up handling of road stops, avoiding unnecessary use of pointers and using the *BIT() macros.
19 years ago
tron
3c0179dd07
(svn r3202) If cascade -> switch
19 years ago
tron
8a3587fa28
(svn r3185) const
19 years ago
tron
84a16a0b30
(svn r3184) GB/SB
19 years ago
tron
0e075e271e
(svn r3182) Fix braino in r3181
19 years ago
tron
9d0e7b6458
(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
53f00c8f9d
(svn r3173) Use the trinary operator and switch to improve readability
...
Also align short cases nicely
19 years ago
tron
81e5b16d71
(svn r3172) static, const
19 years ago
peter1138
12009af1c5
(svn r3167) - NewGRF: Start moving custom station code to separate files.
...
Rewrite handling of station classes.
Allow for more than 8 station tile layouts.
Start of code to unload custom stations.
19 years ago
peter1138
ce9f2fe823
(svn r3166) Constify read-only accesses of custom stations
19 years ago
bjarni
df6c48fdba
(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