Commit Graph

75 Commits (a7d8ad0004e00e1d917d636f4d69fd58f5edbfa3)

Author SHA1 Message Date
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. 18 years ago
tron 9ad72f2d47 (svn r4111) Fix/Remove some stale comments 18 years ago
tron 9be713f1ae (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile 18 years ago
matthijs 6d4e7d565d (svn r4071) - Fix: [NPF] Trains & busses were unable to find a route when leaving a depot or bus stop. Small omission from r4023 (fix by glx) 18 years ago
matthijs 8ea31d293a (svn r4023) - Fix: [ 1453646 NPF ] Road vehicles planning through the back of depots and stations. 18 years ago
tron 41ee22ed99 (svn r3912) Move the signal type enum and GetSignalType() to rail_map.h; also add SetSignalType() and use the functions 18 years ago
tron 83ba8bdf77 (svn r3908) Fix last commit (I'm saying that way too often *sigh*) (Pointed out by Celestar) 18 years ago
tron b8da06ddb1 (svn r3907) Replace many bridge related direct map accesses with calls to shiny new functions and mark some strange constructs with XXX 18 years ago
tron 78083f0da7 (svn r3830) Move IsTunnelTile() from tile.h to tunnel_map.h and add IsTunnel(), which just checks for a tunnel, but not the tile type as IsTunnelTile() does 18 years ago
tron 929fae7b68 (svn r3816) Use existing accessors 18 years ago
tron f2dc736554 (svn r3777) Add some functions to handle tunnels 19 years ago
tron 586388c9f1 (svn r3767) Move all direction related enums and functions to a separate header 19 years ago
tron 08720b6fd7 (svn r3750) Use INVALID_STATION instead of -1 in NPF 19 years ago
Darkvater e9e4b7735f (svn r3642) There is a 'npf' debug level for a reason, use that instead of bastardizing 'misc'. Also, pointers are checked against NULL in an if-statement 19 years ago
tron ea73b46684 (svn r3597) Miscellaneous (I like that word) changes: Fix some indentation, add consts, reduce indentation level by short-circuit logic, convert if cascades to switch, whitespace, bracing, plus some minor stuff 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 42a9353ae2 (svn r3426) - Fix typo from r3019 -- only affected NPF debugging. 19 years ago
hackykid 2148e1fa89 (svn r3271) Remove some debug statements of mine which somehow got into svn. 19 years ago
peter1138 58785904a6 (svn r3142) Remove a now invalid case fall-through and use helper function instead of map access. 19 years ago
tron ae4a1f3675 (svn r3019) -Codechange: Replace explicit shifting/anding/oring with GB and SB 19 years ago
tron aa08027ab3 (svn r2942) Staticise some functions 19 years ago
matthijs cd54bf48d1 (svn r2929) * Move DistanceTrack from map.c to npf.c and rename to NPFDistanceTrack.
* Make NPFDistanceTrack return the distance multiplied by NPF_TILE_LENGTH to prevent rounding
  This should make ship and train pathfinding more accurate and faster.
* Update IsEndOfLine to prevent trains from trying to go off a slope onto a tunnel entrance.
19 years ago
tron a227065ab7 (svn r2701) Insert Id tags into all source files 19 years ago
tron 23c20173b1 (svn r2696) Remove stray semicolons 19 years ago
hackykid aa29ee6eda (svn r2674) - CodeChange: [pbs] Generalise the PSBISPbsDepot function so it can check if an arbitrary junction is a pbs junction. Preparations for making pbs more safe. 19 years ago
tron 559babcdc9 (svn r2673) Include functions.h directly, not globally via openttd.h 19 years ago
hackykid 1d11bbb34d (svn r2625) - Fix: [pbs] Store the end of a train's reserved path explicitly. Prevents trains from unreserving eachothers paths in some cases.
- CodeChange: Use the TrackdirToTrack function instead of &7, and remove an unneeded variable.
19 years ago
Darkvater 95463428c8 (svn r2585) - Fix [Makefile]: some small cleanups, remove warnings, and add mersenne to makefile (Luca) 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 418e032fac (svn r2538) - Fix: Use IsCompatibleRailType() function instead of checking this yourself. 19 years ago
hackykid 5fb14350a0 (svn r2517) - Fix: [pbs] Detect end-of-lines properly regarding depots. 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.
19 years ago
matthijs fb8e5f61b1 (svn r2514) - Codechange: [NPF] Move the checking of railtype into a funciton IsCompatibleRail().
- Codechange: [NPF] Check the railtype along a route against the engine type instead of against the previouse tile. This clears the way for electriefied rails.
- Add: [NPF] [ 1209644 ] A penalty for crossings (peter1138)
19 years ago
tron d29b922636 (svn r2489) static, bracing style and use clamp() 19 years ago
tron bec5e4fb4c (svn r2487) Replace TILE_XY by TileXY/TileDiffXY 19 years ago
matthijs 7549cb5271 (svn r2473) - Add: VehicleMayEnterTile(), which checks if the tile owner of a tile is correct for a vehicle to enter it. Based upon glx's code.
- Fix: [ 1203769 ] [NPF] NPF tries to plan over bridges, through tunnels, over level crossings of other players. (glx)
- Codechange: Renamed TRANSPORT_MAX to TRANSPORT_END and added INVALID_TRANSPORT.
- Codechange: Moved IsLevelCrossing() from tile.h to rail.h
- Add: GetCrossingTransportType(), which returns the transport type (road, rail) of both tracks on a level crossing.
- Removed old TODO that was fulfilled already.
19 years ago
matthijs 4806ac05a7 (svn r2471) - Fix: [ 1221249 ] [NPF] Vehicles try to drive into a tunnel entrance from above. 19 years ago
matthijs d90840f7f8 (svn r2456) * Prettyfied npf.c using enums and wrappers from rail.h.
* Moved GetTileRailType() from npf.c to rail.[ch].
19 years ago
matthijs c81de3e1e9 (svn r2451) * Fix: Assertion caused by passing a trackdir where a track was expected. 19 years ago
matthijs 8e53533786 (svn r2450) * Codechange: Replaced all uses of the arrays in tile.h with calls to the associated wrapper functions.
* Codechange: Made npf.c use some map array accessing wrappers instead of direct access.
* Codechange/Fix: Named every enum in tile.h. Fixes a nasty bug on MSVC where arrays would be initialised with zeroes (tnx Asterix_)
* Removed magic numbers from tables in tile.c.
* Added some explicit casts in tile.h.
19 years ago
matthijs 9cb58e0bb3 (svn r2448) General cleanup of rail related code, more to follow.
* Add: rail.[ch] for rail-related enums and wrapper functions.
* Codechange: Removed dozens of magic numbers with below enums.
* Codechange: Rewrote CheckTrackCombination().
* Add: TILE_SIZE, TILE_PIXELS and TILE_HEIGHT constants.
* Add: enums RailTileType, RailTileSubtype, SignalType to mask against the map arrays.
* Add: enums Track, TrackBits, Trackdir, TrackdirBits for railway track data. (Note that the old RAIL_BIT constants are replaced by TRACK_BIT ones).
* Add: enums Direction and DiagDirection
* Codechange: Moved a bunch of track(dir) related lookup arrays from npf.[ch] to rail.[ch].
* Codechange: move RailType enum from tile.h to rail.h.
* Add: Wrapper functions for masking signal status in the map arrays: SignalAlongTrackdir, SignalAgainstTrackdir and SignalOnTrack.
* Add: Wrapper functions to access rail tiles, using above enums
* Add: Wrapper functions to modify tracks, trackdirs, directions, etc.
* Add: Wrapper functions for all lookup arrays in rail.[ch] (Arrays are still used in parts of the code)
* Codechange: Renamed some variables and arguments to better represent what they contain (railbit -> track, bits -> trackdirbits, etc.). 
* Codechange: Don't use FindLandscapeHeight() in CmdRemoveSingleRail(), since it returns way too much info. Use GetTileSlope() instead.
* Codechange: [NPF] Removed some unused globals and code from npf.c.
19 years ago
matthijs fc5784a310 (svn r2447) * Add: [NPF] Penalty for road vehicles making turns. 19 years ago
Darkvater 0171aae109 (svn r2433) - CodeChange: unmagicify all road/train crossings with IsLevelCrossing() function (peter1138) 19 years ago
Darkvater b438b1248c (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 19 years ago
matthijs a2f691b24a (svn r2363) - Codechange: [NPF] Removed caching the endnode check. The code for this was buggy, fundamentally flawed and barely useful. (Hackykid) 19 years ago
matthijs 0e08878a68 (svn r2281) - Fix: [ 1115204 ] [NPF] When pressing the goto depot button, trains will now also look behind it if there is no depot in front. If so, the train reverses immediately. This also work anywhere, not just at stations.
- Add: [NPF] Reversing inside of depots now has a penalty. It also applies to trains only, other vehicles shouldn't bother reversing.
- Fix: [NPF] When checking whether to reverse a train, the trackdir of the first loc was used instead of the last vehicle as a starting node for pathfindig.
	This might have caused some trains not reversing when they should have (or vice versa). Typo introduced when converting to GetVehicleTrackdir() in r2256.
- CodeChange: [NPF] Removed duplicate code by letting NPFRouteTjoStationOrTile() call NPFRouteToStationOrTileTwoWay().
- Add: [NPF] NPFRouteToDepotBreadthFirstTwoWay() to find a depot while also looking backwards.
- Add: It is now possibly to specify a path cost for aystar starting nodes.
19 years ago
matthijs b22ebeda61 (svn r2257) - Fix: [NPF] NPF debug markings modify _map2 instead of _map3_hi for street tiles, corrupting them.
Some info got moved around in r1768 for street tiles, but NPF did not get updated.
19 years ago
matthijs 2ab5eee78b (svn r2255) - Fix: [ 9680363 ] [NPF] Broken buoy handling for ships
Buoys will now try to get within 3 tiles of a buoy instead of a the actual buoy tile. This gets ships to got past buoys in a realistic (IMO) way instead of barging right through them.
- Fix: [NPF] Trains get curves penalties sometimes even when the track is straight.
- Add: [NPF] Ships get a penalty for going over buoys now, so they will try to go around.
- Add: [NPF] Ships get a penalty for curves too, yay for straight lines.
- Add: TrackdirToTrack(), TrackToTrackdir(), IsDiagonalTrack() and IsDiagonalTrackdir() helper functions.
- Add: IsBuoy() and IsBuoyTile() helper functions.
- Codechange: Rearranged part of the control flow of ShipController(), removing a goto.
19 years ago