Commit Graph

81 Commits

Author SHA1 Message Date
matthijs
7dca474b5f (svn r4389) -Fix: [NPF] Don't mark tiles when debugging in multiplayer, this will cause desyncs. 2006-04-12 15:08:27 +00:00
celestar
86138ce3cc (svn r4387) -Codechange: Use map accessors even for debugging purposes (npf).
-Codechange: Removed unused code from NPF
2006-04-12 14:17:07 +00:00
celestar
62ded2f58d (svn r4376) -Codechange Renamed GetSignalState to GetSignalStateByTrackdir 2006-04-12 08:28:03 +00:00
tron
93789afac7 (svn r4349) Remove GetCrossingTransportType(), it's slightly overkill 2006-04-10 20:46:37 +00:00
celestar
715bee332b (svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h 2006-04-04 11:35:52 +00:00
celestar
2ab5b8e666 (svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency 2006-03-31 19:10:54 +00:00
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. 2006-03-29 16:30:26 +00:00
tron
d0a445db41 (svn r4111) Fix/Remove some stale comments 2006-03-26 11:08:44 +00:00
tron
f6285a659c (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile 2006-03-24 08:55:08 +00:00
matthijs
4e3714b391 (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) 2006-03-23 17:49:50 +00:00
matthijs
3c76671078 (svn r4023) - Fix: [ 1453646 NPF ] Road vehicles planning through the back of depots and stations. 2006-03-22 16:37:59 +00:00
tron
4fb11f23ad (svn r3912) Move the signal type enum and GetSignalType() to rail_map.h; also add SetSignalType() and use the functions 2006-03-17 06:26:37 +00:00
tron
7bd2b37fe7 (svn r3908) Fix last commit (I'm saying that way too often *sigh*) (Pointed out by Celestar) 2006-03-16 15:28:44 +00:00
tron
6e988259a4 (svn r3907) Replace many bridge related direct map accesses with calls to shiny new functions and mark some strange constructs with XXX 2006-03-16 15:16:27 +00:00
tron
0100871412 (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 2006-03-12 15:04:03 +00:00
tron
25606a2e0b (svn r3816) Use existing accessors 2006-03-11 09:10:46 +00:00
tron
af42610321 (svn r3777) Add some functions to handle tunnels 2006-03-06 20:55:24 +00:00
tron
f6176a89f9 (svn r3767) Move all direction related enums and functions to a separate header 2006-03-05 12:34:55 +00:00
tron
2942939ad1 (svn r3750) Use INVALID_STATION instead of -1 in NPF 2006-03-03 20:54:54 +00:00
Darkvater
a83de6a33c (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 2006-02-21 01:15:59 +00:00
tron
5352e9fbcb (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 2006-02-13 21:15:00 +00:00
tron
1c3e8630fe (svn r3511) More whitespace ([FS#46] by Rubidium) 2006-02-01 07:36:15 +00:00
tron
9712d6f639 (svn r3510) Fiddle with whitespace and parentheses 2006-02-01 06:32:03 +00:00
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.
2006-01-29 18:57:26 +00:00
peter1138
063aa48b0b (svn r3426) - Fix typo from r3019 -- only affected NPF debugging. 2006-01-24 18:38:06 +00:00
hackykid
c50ef5bc07 (svn r3271) Remove some debug statements of mine which somehow got into svn. 2005-12-08 09:12:25 +00:00
peter1138
acf4b5181d (svn r3142) Remove a now invalid case fall-through and use helper function instead of map access. 2005-11-05 18:32:21 +00:00
tron
39f5dbfd3b (svn r3019) -Codechange: Replace explicit shifting/anding/oring with GB and SB 2005-10-05 07:20:26 +00:00
tron
5d2c743ef4 (svn r2942) Staticise some functions 2005-09-11 15:01:00 +00:00
matthijs
6f45959d1e (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.
2005-09-09 23:14:38 +00:00
tron
647cbd6bdd (svn r2701) Insert Id tags into all source files 2005-07-24 14:12:37 +00:00
tron
5293ee67ca (svn r2696) Remove stray semicolons 2005-07-23 19:48:24 +00:00
hackykid
aed6f08640 (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. 2005-07-22 08:40:19 +00:00
tron
54cbd01825 (svn r2673) Include functions.h directly, not globally via openttd.h 2005-07-22 07:02:20 +00:00
hackykid
552aa1b4dc (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.
2005-07-17 20:09:02 +00:00
Darkvater
bc11fe03ee (svn r2585) - Fix [Makefile]: some small cleanups, remove warnings, and add mersenne to makefile (Luca) 2005-07-15 21:28:26 +00:00
tron
a4bf608d40 (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. 2005-07-13 18:04:01 +00:00
hackykid
3091f97c41 (svn r2538) - Fix: Use IsCompatibleRailType() function instead of checking this yourself. 2005-07-09 11:39:35 +00:00
hackykid
6b3b784c85 (svn r2517) - Fix: [pbs] Detect end-of-lines properly regarding depots. 2005-07-04 15:25:06 +00:00
hackykid
ab9c6f126d (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.
2005-07-04 14:58:55 +00:00
matthijs
e675794812 (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)
2005-07-03 13:02:54 +00:00
tron
7a372227ff (svn r2489) static, bracing style and use clamp() 2005-06-25 19:08:58 +00:00
tron
9617614b04 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY 2005-06-25 16:44:57 +00:00
matthijs
c074f4e935 (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.
2005-06-22 22:38:18 +00:00
matthijs
bf761af163 (svn r2471) - Fix: [ 1221249 ] [NPF] Vehicles try to drive into a tunnel entrance from above. 2005-06-22 01:06:04 +00:00
matthijs
84655ddb15 (svn r2456) * Prettyfied npf.c using enums and wrappers from rail.h.
* Moved GetTileRailType() from npf.c to rail.[ch].
2005-06-17 17:11:05 +00:00
matthijs
13b7f222f3 (svn r2451) * Fix: Assertion caused by passing a trackdir where a track was expected. 2005-06-17 00:46:33 +00:00
matthijs
a63a84ef5d (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.
2005-06-17 00:22:46 +00:00
matthijs
1876744744 (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.
2005-06-16 18:04:02 +00:00
matthijs
65de40f547 (svn r2447) * Add: [NPF] Penalty for road vehicles making turns. 2005-06-16 17:53:40 +00:00