belugas
b505564ee7
(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
f733f94677
(svn r4383) - Codechange: Remove extraneous code from 4354; no need to get RailTypeInfo when we already have it...
19 years ago
belugas
88440522fe
(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
5f24141cb8
(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
81e6d68f95
(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
fade7a5997
(svn r4331) Replace some direction calculation magic with DiagDirection to make a bit more clear what's going on
19 years ago
tron
4e577f689a
(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
90836a461d
(svn r4324) Remove the unused road stop type attribute from struct RoadStop
19 years ago
tron
da60a82021
(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
fd10af66d7
(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
9760d3dccf
(svn r4319) -Codechange: Station map accessors
19 years ago
celestar
da095bc941
(svn r4316) -Codechange: finished r4257 (forgot one variable there)
19 years ago
Darkvater
fc68881906
(svn r4265) - Fix: compile warning on VS2005 (parameter 2 different from declaration)
19 years ago
celestar
5931b34aff
(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
13812b08ec
(svn r4257) -Codechange: Renamed the airport_map5_tiles_* variables into airport_sections_*
19 years ago
celestar
cc87f682b9
(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
892a4c587d
(svn r4242) Pass TileIndex and slope to GetSlopeTileh_*() instead of TileInfo
19 years ago
celestar
b364658f42
(svn r4173) -Codechange: Use IsClearWaterTile for buoy construction
19 years ago
belugas
3633d56923
(svn r4157) CodeChange : Keep on cleaning up Celestar's elrail merge
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
Darkvater
d5909f901a
(svn r4128) - CodeChange: Add proper semantics for CargoID for such variables instead of using the general byte-type.
19 years ago
celestar
3770ad0637
(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
9ad72f2d47
(svn r4111) Fix/Remove some stale comments
19 years ago
tron
9be713f1ae
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
19 years ago
tron
820b8ca230
(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
e54f1e1e2b
(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
89090790c2
(svn r3916) Get/Set the rail type by [GS]etRailType{Crossing,OnBridge,}()
19 years ago
Darkvater
d9ee10d3b8
(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
b394f72fa9
(svn r3829) Reduce the use of _error_message by directly returning error codes instead of using this global variable
19 years ago
tron
2181a72e9e
(svn r3787) Use DirToDiagDir() instead of >> 1
19 years ago
tron
fbe939b31f
(svn r3783) Replace further ints and magic numbers by Direction, DiagDirection and friends
19 years ago
celestar
9d54e51ef9
(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
819d210acc
(svn r3714) Add functions to turn tiles into water and shore tiles
19 years ago
tron
793613a286
(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
4b46883751
(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
45e85d2eb2
(svn r3627) - Change all hardcoded 255 max-saveload versions with the define SL_MAX_VERSION
19 years ago
tron
49c7eb934b
(svn r3613) Some more const, indentation, whitespace and similar stuff
19 years ago
peter1138
6cfefdb275
(svn r3612) - RoadStop->slot[] stores a vehicle index. Adjust its type and use INVALID_VEHICLE instead of nonsense INVALID_SLOT.
19 years ago
tron
e407ced537
(svn r3582) Restructure MoveGoodsToStation() to avoid double bookkeeping of StationIDs and station pointers
19 years ago
tron
8097d92162
(svn r3581) Just noticed the indentation was totally off, fix it
19 years ago
tron
c4f992bad9
(svn r3580) Some small cleanups before the real change, especially reduce the indentation by one by using continue
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
05d7d046c7
(svn r3530) - NewGRF: Move station resolver to newgrf_station
19 years ago
tron
84fb96fe85
(svn r3511) More whitespace ([FS#46] by Rubidium)
19 years ago
tron
22dc05faf2
(svn r3510) Fiddle with whitespace and parentheses
19 years ago
Darkvater
4e09974975
(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
183f6f6d07
(svn r3372) - Fix: update signal states when building or removing rail station blocks
19 years ago
tron
e272b03fee
(svn r3365) Staticise 36 functions
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
truelight
8ffe9da482
(svn r3341) -Codechange: make mingw32 happy, and renamed Rectangle, because it already exists on that platform
19 years ago
tron
b06b3e2ca2
(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
531073bea0
(svn r3305) -Rename: Changed all instances of ottd_ related to the AI to ttai_
19 years ago
tron
23bfc03054
(svn r3297) Staticise
19 years ago
peter1138
809b03c81a
(svn r3282) - Codechange: Replace tests against CMD_ERROR with CmdFailed()
19 years ago
truelight
8733f49e88
(svn r3232) -Add: implemented the event-system for AIs
...
-Add: added several hooks (event-callbacks) for road-related-stuff
19 years ago
truelight
4845ff063b
(svn r3227) -Codechange: [Savegame] removed 'minor' version, and renamed 'major' version to just: version.
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
peter1138
3e702afc08
(svn r3213) - Codechange: Clean up handling of road stops, avoiding unnecessary use of pointers and using the *BIT() macros.
19 years ago
tron
d177e5da67
(svn r3202) If cascade -> switch
19 years ago
tron
b9729fb72e
(svn r3185) const
19 years ago
tron
1b0091e0d2
(svn r3184) GB/SB
19 years ago
tron
7b7593d092
(svn r3182) Fix braino in r3181
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
4a14a586e2
(svn r3173) Use the trinary operator and switch to improve readability
...
Also align short cases nicely
19 years ago
tron
ee15e3de13
(svn r3172) static, const
19 years ago
peter1138
ff8223150a
(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
b1075ca7a4
(svn r3166) Constify read-only accesses of custom stations
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
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
2cc2154ad2
(svn r3077) static, const, bracing, indentation, 0 -> '\0'/NULL, typos in comments, excess empty lines, minor other changes
...
nothing spectacular, just some stuff, which piled up
19 years ago
tron
ece9b9b2b6
(svn r3066) Constify the parameter of GetSlopeZ_*()
19 years ago
tron
66bf4f863d
(svn r3049) Replace byte/int/uint by RailType where appropriate
19 years ago
tron
d5042d4ab2
(svn r3046) Replace some numbers with sprite names and fix a typo in the sprite list
19 years ago
tron
9fea263c77
(svn r3030) More work for GB/SB, this time concerning the waiting_acceptance attribute of stations
19 years ago
tron
76db75d81a
(svn r3028) s/255/OWNER_SPECTATOR/
19 years ago
tron
3397e202c8
(svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants
19 years ago
tron
ae4a1f3675
(svn r3019) -Codechange: Replace explicit shifting/anding/oring with GB and SB
19 years ago
peter1138
d1591e864d
(svn r3015) -NewGRF: Add a new sprite group result type, and support loading of callbacks results within random and "real" groups. (Not fully supported yet.)
19 years ago
peter1138
9fabe008a0
(svn r3014) -NewGRF, Codechange: Make all sprite group references be pointers instead of copying the data around.
19 years ago
tron
ce1c72cf6e
(svn r2995) Replace 0xFF/0xFFFF with CT_INVALID/OWNER_SPECTATOR/INVALID_STATION where appropriate
19 years ago
Darkvater
8e6a911700
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
...
- change a lot of byte player types to PlayerID
- beautify header files, same "#endif /* filename */" ending
19 years ago
Darkvater
7164ff86f9
(svn r2953) - Fix: [ 1257766 ] Cannot make ships go to an oil platform (oilrig has no station). While it is still possible that oilrigs end up without a station, it is only the case where no more stations can be built at all
19 years ago
Darkvater
2131f68ae2
(svn r2951) - Fix: [ 1259345 ] Changing engine in netgame opens train window for everyone
...
- Add IsLocalPlayer() which substitutes _local_player == _current_player
19 years ago
truelight
2e87864d0b
(svn r2948) -Fix: the old AI needs a special flag that triggers all kind of special
...
abilities you really don't want to know about (free bridges, etc..)
I removed this flag some revisions ago, but the Aircraft part
depends on it, so I re-enabled it again..
19 years ago
truelight
991d5c6234
(svn r2921) -Codechange: moved all AI-code to 1 central place (ai/ai.c)
...
-Fix: removed the ability for the oldAI to cheat (this will criple him somewhat)
-Add: base-code for many improvements to come in the AI-system
-Add: added base-code for multiplayer AIs (DOES NOT WORK YET!)
19 years ago
tron
03e860d06d
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
19 years ago
celestar
fcf5ace08f
(svn r2774) -Codechange: Removed TRACKTYPE_SPRITE_PITCH globally and replaced it by a member of RailtypeInfo
19 years ago
celestar
502718caa6
(svn r2731) -Fix [ 1244171 ]: Hangar orders are now properly invalidated as soon as the airport is removed
19 years ago
celestar
238e47cd42
(svn r2702) -Codechange: Cleaned up the sprite code and replaced many magic numbers
...
by enums. There remains work in gfx.c to move the "transparency" and
"recolor" bits around to make space for more sprites. However, 2800
additional sprites can now be loaded. There also remains cleanup and
Doxygen work on many of the header files.
19 years ago
tron
a227065ab7
(svn r2701) Insert Id tags into all source files
19 years ago
tron
559babcdc9
(svn r2673) Include functions.h directly, not globally via openttd.h
19 years ago
celestar
85f06d6e7b
(svn r2658) -Codechange: Use MAKE_TRANSPARENT to display a transparented sprite
19 years ago
tron
ac66e3e28f
(svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read
19 years ago
tron
7c694f2553
(svn r2643) Get rid of some unnecessary casts
19 years ago
celestar
9ca761b065
(svn r2595) -Codechange: Introduced "IsSteepTileh" to find whether a tile is steep
...
(i.e. spans two height levels) and use it throughout the code.
-Codechange: Add CanBuildDepotByTileh to find if a tile is suitable to
build a depot on it. Wraps some bitmagic which seems quite unreadable at
first glance
19 years ago
tron
8c1d74162f
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
19 years ago
hackykid
60ddaf95f0
(svn r2516) - Feature: [pbs] Implement path-based-signalling. This allows multiple trains within the same signal block, provided their paths dont intersect. For this the block must have all exit and entry signals be pbs signals. Place these by ctrl-clicking 4 times on a normal signal.
...
- Feature: [pbs] Implement autoplacement of pbs blocks, when a block has an entry and an exit pbs signal, covert the entire block to pbs. Can be turned off in the patch settings.
- Feature: [pbs] Allow showing of reserved status by making the tracks darker, when the pbs debug level is at least 1.
20 years ago
tron
bec5e4fb4c
(svn r2487) Replace TILE_XY by TileXY/TileDiffXY
20 years ago
tron
61f6f07edd
(svn r2486) Turn TILE_FROM_XY into an inline function and rename it to TileVirtXY
20 years ago
tron
3154e7148d
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
20 years ago