Commit Graph

108 Commits (f12b3a0c1816dc5a8b95132b95025740f6c2b438)

Author SHA1 Message Date
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
Darkvater 480ced43c9 (svn r2529) - Fix: PBS signals showed up as normal signals with the query tool
- Update landscape_grid.html to show busy bits used by PBS.
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
celestar b872cf7f7b (svn r2515) -Codechange: Removed a good deal of magic sprite numbers in the rail drawing code, and placed neatly into arrays and enums. This also makes way to implement more railtypes without having to do tons of ugly hacks. 19 years ago
tron 229fbefc03 (svn r2505) Remove some unnecessary #includes 19 years ago
celestar 27e61cbd84 (svn r2499) -Codechange: Moved the semaphore bit from bit 2 to bit 3 in _map_hi for rails, in order to make way for pbs 19 years ago
tron ab7b8b50e3 (svn r2492) Remove some pointless casts and fix some nearby indentation 19 years ago
tron bec5e4fb4c (svn r2487) Replace TILE_XY by TileXY/TileDiffXY 19 years ago
tron 61f6f07edd (svn r2486) Turn TILE_FROM_XY into an inline function and rename it to TileVirtXY 19 years ago
tron 3154e7148d (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile" 19 years ago
hackykid 5119cce2a8 (svn r2469) - Add: When removing tracks with the 'remove' tool, have it automatically remove signals on the tracks. 19 years ago
hackykid 4754dad0d6 (svn r2460) - Fix: Prevent assertion failure when trying to drag signals starting from a non-rail tile.
- CodeChange: Remove unused variable in CmdSignalTrackHelper.
19 years ago
tron 8c6fa13faa (svn r2452) Fix defect in r2448 which caused building tracks unexpectedly fail or succeed 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
tron ea0f21fbcc (svn r2434) Fix some defects in r2433 19 years ago
Darkvater 0171aae109 (svn r2433) - CodeChange: unmagicify all road/train crossings with IsLevelCrossing() function (peter1138) 19 years ago
hackykid 6d78b70075 (svn r2428) - Feature: [newgrf] Implement shorter train vehicles (Therax), and the callback that goes with it.
- Codechange: Remove some magic numbers (PALETTE_CRASH)
19 years ago
tron c2e977a0b8 (svn r2409) Missed one _map_owner -> IsTileOwner() 19 years ago
tron 74541c1dcc (svn r2408) Introduce SetTileOwner() and use it 19 years ago
tron 0c4ecbe9ec (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner 19 years ago
Darkvater b438b1248c (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 19 years ago
Darkvater 3fd39ec630 (svn r2322) - CodeChange: doxygen commented the tunnel-crash fix. Also if (bla) {return;} else {return;} is not proper code. It's if (bla) {return;} return; ;) 19 years ago
matthijs 2151550631 (svn r2320) - Fix: [ 1185176 ] Train in tunnel is not properly detected by signal code (Hackykid) 19 years ago
Darkvater 0ddf93956e (svn r2317) - Fix: [ 1193048 ] Pre-signal stays red when there is only a single exit signal (dinno) 19 years ago
Darkvater 033995ec6e (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
- CodeChange: remove cmd-misuses CmdStartScenario() and CmdDestroyCompanyHQ()
- Fix (invisible): when parameter checking CmdRestoreOrderIndex() the vehicle did not have its orders yet, so it would fail. So move doing this until AFTER the orders have been added back in RestoreVehicleOrders()
19 years ago
Darkvater edd8c87502 (svn r2286) - CodeChange: paramcheck the next batch of commands.
- Fix (regression): fix up terraform land where every player can terraform land (towns, map generation), and player can terraform different corners; used for building tunnels
19 years ago
Darkvater 2b96754673 (svn r2285) - Codechange: Fix up some of the missing things from server-checking; namely bridge-type, bridge-length, dragged end-tile (bridge/station), station_spread
- Fix: [ 1197256 ] max station spread patch < 7 does not work. Station spread was not taking into account when not using drag&drop. Fix this up, and add a callback to the settings window to immediately reflect the changes.
19 years ago
Darkvater 3ad11e0ad4 (svn r2279) - Fix: Check the parameters of the first 10 Commands. While there also add proper comments for the functions and fix up CmdFailed() 19 years ago
tron 566df8dc65 (svn r2223) When adding tracks to a railway tile reset the ground to bare land, fix for a glitch in r2131 19 years ago
tron cada1e24b5 (svn r2195) Add CmdFailed() as the One True Way(tm) to check if a command failed. 20 years ago
celestar 91d44ef577 (svn r2173) -Fix: [ 1179380 ] Rail now builds on reserved land. Cause by the problem that CMD_ERROR is just the highest bit of the return value, but CMD_CLEAR_LANDSCAPE returns a negative value for owned land. So the highest bit is set as well. Note to self: Finish Command Patch 20 years ago
tron 0f830b79e1 (svn r2134) Return the correct error message if rail is already under a bridge, fix for r2131 20 years ago
tron 10e4c9bfab (svn r2132) Fix copy&paste bug in r2131 20 years ago
tron ad7f157ac4 (svn r2131) -Fix: Rewrite CmdBuildSingleRail(), this addresses several issues:
- Check input parameters for validity
- Adhere patch settings - you were able to build foundations under bridges even if foundations where deactivated
- Charge for foundations in all cases - foundations under bridges were for free
- Make the control flow more clear
20 years ago
truelight c6f56edcff (svn r2113) -Fix: first check if a vehicle is a train, before accessing u.rail 20 years ago
tron 9d2406729e (svn r2102) Fix bug introduced in r2038, which gave you money for clearing occupied railway tiles ([1171926]) 20 years ago
tron bba102e624 (svn r2095) In CheckTrackCombination(): if () cascade -> switch, improve readability 20 years ago
tron ae359d0d02 (svn r2094) In GetTileDesc_Track(): uint -> TileIndex, use enums, if () cascade -> switch 20 years ago
truelight 6d75cce924 (svn r2059) -Codechange: rewrote SetSignalsAfterProc so now the tiles from the PF
are checked against the vehicle-position-hash, instead all vehicles to 
the PF-position-hash. Big speed increase (function usages drops from 9% 
to 0.5%!) for maps with a lot of trains.
20 years ago
truelight 83637d164e (svn r2046) -Codechange: moved all waypoint code to waypoint.c/waypoint.h
-Codechange: rewrote some functions while moving waypoint-stuff
-Add: added support for 64k waypoints
-Fix: made the waypoint struct a bit more logic (no bit-fucking)
20 years ago
tron ccd6a0614f (svn r2040) Readd check that got accidently removed in r2022 20 years ago
tron bfc1d43a27 (svn r2039) IS_RAIL_DEPOT -> IsRailDepot, IS_RAIL_WAYPOINT -> IsRailWaypoint
remove now unused enums and remove a redundant condition in one if
20 years ago
tron 71dba5f511 (svn r2038) -Fix: A player only received the money for one rail when clearing a tile with 2 rails and signals
While here rewrite parts of the function to (hopefully) increase clarity
20 years ago
tron e5036891f6 (svn r2022) Revise CmdRemoveSingleSignal: Check parameters for validity and simplify the function 20 years ago
tron 4bf173e9c1 (svn r1981) Typedef some structs and enums 20 years ago
tron 20b8c48440 (svn r1903) Replace some casts and macro magic with proper typing, similar to r1902 20 years ago
tron 204d08140a (svn r1867) Include tables/sprites.h only in files which need it 20 years ago
matthijs c5c5c9b17c (svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
- Add: asserts to find the v->u.rail.track == 0 problem.
- Add: IsValidDepot(), IsValidTown(), IsValidSign(), IsValidVehicle(), IsValidStation()
- Add: GetTileOwner(), IsTileOwner()
- Codechange: Replaced IsShipDepotTile(), IsTrainDepotTile(), IsRoadDepotTile() by IsTileDepotType().
- Codechange: typedeffed the MAP_OWNERS as Owner. Should be used as variable type.
- Codechange: Replaced a few uint by TileIndex.
20 years ago
tron 27dc506a03 (svn r1832) Next byte -> char iteration: custom names 20 years ago
truelight e9c93f9c0c (svn r1817) -Codechange: Moved depot-functions to depot.c
-Codechange: Added wrappers around depot-access (GetDepot no exists)
-Codechange: Made depot-functions a bit more logic (no longer 
GetDepotByTile crashes your game when you request it on a non-depot tile)
-Add: made depots dynamic (yes, 64k depots are possible now)
20 years ago