Commit Graph

26 Commits (1b43dec1d6cb5363b9de63b1646f7952abf5fa8a)

Author SHA1 Message Date
tron cec0261223 (svn r1937) TILE_FROM_XY() returns a TileIndex, not an int 20 years ago
tron a370af76d2 (svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers 20 years ago
matthijs cc0966405b (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
matthijs eb78cdb2d4 (svn r1751) - Feature: New PathFinder (NPF).
- Supports trains, road vehicles and ships.
	- Uses A* pathfinding (same codebase as the new ai).
	- Currently unlimited search depth, so might perform badly on large maps/networks (especially ships).
	- Will always find a route if there is one.
	- Allows custom penalties for obstacles to be set in openttd.cfg (npf_ values).
	- With NPF enabled, ships can have orders that are very far apart. Be careful, this will break (ships get lost) when the old pathfinder is used again.
- Feature: Disabling 90 degree turns for trains and ships.
	- Requires NPF to be enabled.
	- Ships and trains can no longer make weird 90 degree turns on tile borders.
- Codechange: Removed table/directions.h.
	- table/directions.h contained ugly static tables but was included more than once. The tables, along with a few new ones are in npf.[ch] now. Better suggestions for a location?
- Fix: Binary heap in queue.c did not allocate enough space, resulting in a segfault.
- Codechange: Rewritten FindFirstBit2x64, added KillFirstBit2x64.
- Codechange: Introduced constant INVALID_TILE, to replace the usage of 0 as an invalid tile. Also replaces TILE_WRAPPED.
- Codechange: Moved TileAddWrap() to map.[ch] 
- Add TileIndexDiffCByDir(), TileIndexDiffCByDir(). 
- Codechange: Moved IsTrainStationTile() to station.h
- Add: IsRoadStationTile() and GetRoadStationDir().
20 years ago
tron bb680056b1 (svn r1749) Move the functions which calculate distances to map.[ch] and give the more meaningful names 20 years ago
tron 001aa8e453 (svn r1722) -Feature: Bigger maps - anyone? 20 years ago
tron 3515b670d2 (svn r1714) Add missing include 20 years ago
tron 39858e696b (svn r1713) Split off several functions which query/set information about a single tile from map.h and put them into a seperate file tile.h 20 years ago
tron 400f07fdb8 (svn r1706) Implement ScaleByMapSize() and ScaleByMapSize1D()
These scale a number relative to the map size/circumference.
Use them to scale the amount of map objects.
Of course at the moment they return just the input, because there are no bigger/smaller maps yet.
20 years ago
tron 07cb3068ae (svn r1676) Increase the size of TileIndex and TileIndexDiff to 32bits and adapt the save/load data and some other parts of the code to that change
WARNING: If i made any mistake here it WILL lead to corrupted savegames!
20 years ago
tron 90cafa9b15 (svn r1560) Introduce SetTileType() and SetTileHeight()
Replace direct references to _map_type_and_height with these
20 years ago
tron 27057ae4b0 (svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
Replace some direct references to _map_type_and_height with TileHeight()/IsTileType()
20 years ago
tron ca8eb44828 (svn r1542) Rename TileHeight to TilePixelHeight, because this is what it actually returns 20 years ago
tron 61a6bc544d (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts 20 years ago
tron f0be7b6192 (svn r1475) Fix some more signed/unsigned comparison warnings 20 years ago
tron 7ee55362c5 (svn r1447) Move TILE_ADD(), TILE_ADDXY() and SafeTileAdd() to map.[ch] and make the latter map size agnostic 20 years ago
tron 872c51f134 (svn r1415) Move TILE_FROM_XY and TILE_XY to map.h and push TILE_[XY] bits from map.h into map.c.
Now the whole source except map.c is independent of TILE_[XY]_BITS!
20 years ago
tron 414ac3286b (svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY] 20 years ago
tron d3c6855320 (svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff 20 years ago
tron e4cf2ba1b3 (svn r1386) Move TileIndexDiff to map.h
Move _tileoffs_by_dir to map.[ch] and encapsulate it in TileOffsByDir()
20 years ago
tron bcff0ab932 (svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY] 20 years ago
tron 181e9b6cf9 (svn r1337) Use MapMax[XY]() (or MapSize[XY]() if appropriate) instead of TILE_MAX_[XY]
While here replace one erroneous TILE_MAX_X with MapMaxY()
20 years ago
truelight 2f9e0b8e0c (svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and loaded as
an uint8 till the savegame version is bumped to version 5. Then it works 
automaticly as a fully uint16. So _stations[] can not be increased till 
after the bump!!
20 years ago
tron 6318ba9598 (svn r1144) Don't rely on sizeof() to determine the map size, use MapSize() instead 20 years ago
tron b976a349c6 (svn r1130) Add helper functions to query map size 20 years ago
tron a148ff4e0d (svn r1117) Move map arrays and some related macros into their own files map.c and map.h 20 years ago