Commit Graph

31 Commits (2df539e30d548d33a2a2acde4b1e68e5fe4d1c99)

Author SHA1 Message Date
Darkvater 7e4d0f112e (svn r6406) -Codechange: Rename TileOffsByDir to TileOffsByDiagDir because it accepts
DiagDirections, and add TileOffsByDir that handles Directions.
-Codechange: Make the treeloop use TileOffsByDir().
18 years ago
peter1138 e6abf41768 (svn r4688) - Ensure the map memory is cleared after it is allocated. This fixes random deserts that sometimes occurred. 18 years ago
tron 0b936c3222 (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
Darkvater e1acd38bc5 (svn r3008) [ 1247535 ] Native Support for Win64 (compile&run only) (michi_cc)
Fix warning in graph_gui.c with const problem
19 years ago
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.
19 years ago
tron 647cbd6bdd (svn r2701) Insert Id tags into all source files 19 years ago
tron 71140a5768 (svn r2669) Shuffle some more stuff around to reduce dependencies 19 years ago
ludde 2123deff13 (svn r2560) Fix: various minor code changes.
Added RandomTile/RandomTileSeed functions to generate a random tile.
Changed landscape routines so they don't assume that the Y map side is a power of two. (support for this is not complete, though)
Changed some frequently used map macros to not compute the values each time.
Silence some warnings on MSVC.
19 years ago
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. 19 years ago
ludde f8c6d84f0b (svn r2552) - Fix: [map] Fix so the code compiles correctly and doesn't crash on MSVC6 in optimization mode. 19 years ago
tron fde78bb03f (svn r2533) Move misplaced parenthesis, found by ludde 19 years ago
tron 9617614b04 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY 19 years ago
Darkvater ba8c649fac (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 19 years ago
matthijs 81fd47ac28 (svn r2181) - Add: DistanceTrack() to calculate the distance over optimally laid out tracks.
- Codechange: [NPF] Removed unused heuristic function NPFCalcTileHeuristic().
- Codechange: [NPF] Use DistanceTrack() instead of DistanceManhattan() for ship and train heuristic.
- Codechange: Renamed variables x and y to dx and dy in some of the distance calculation functions.
20 years ago
Darkvater 29ddbfab90 (svn r1914) - Fix: [ 1119147 ] Stop startup memory corruption crash using optimized MSVC6. MSVC6 workaround as it's too stupid again for its own good 20 years ago
tron 36c9758c94 (svn r1803) Move debugging stuff into files of it's own 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 77072aedab (svn r1748) Enforce map size limits 20 years ago
tron b188b30e2d (svn r1737) Add DEBUG category "map" and use it to print the map size when allocating the map 20 years ago
tron 001aa8e453 (svn r1722) -Feature: Bigger maps - anyone? 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
darkvater 55604e354f (svn r1449) -Fix: signed/unsigned error on windows
-Change: Makefile added -Wsign-compare flag
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 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
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 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