Commit Graph

195 Commits (a9d33943d734671990920fc093d0025845479370)

Author SHA1 Message Date
celestar 3608788f6b (svn r1872) -Fix: Fixed an inline problem which caused MSVC6 to not compile :/ 20 years ago
tron 830565514c (svn r1867) Include tables/sprites.h only in files which need it 20 years ago
tron 7d56d1d841 (svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more explicit types as parameters 20 years ago
tron 6984d6cd31 (svn r1832) Next byte -> char iteration: custom names 20 years ago
truelight 79d1ed2c66 (svn r1818) -Add: Dynamic orders (up to 64k orders) 20 years ago
truelight bd7f37d592 (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
tron 36c9758c94 (svn r1803) Move debugging stuff into files of it's own 20 years ago
celestar ff39c260f7 (svn r1799) -Codechange: [ Multistop ] Added debug class "ms" and more debugging
output for multistops
20 years ago
truelight 52ce9d21cc (svn r1789) -Fix: there is no need to save the index, it is done for us 20 years ago
truelight d3aa3043e3 (svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops. 20 years ago
truelight 3eda5e61f7 (svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations 20 years ago
truelight 0668a6b485 (svn r1770) -Fix: Hopefully last pieces of code that are containing a station-id
(and should be an uint16, not uint8)
20 years ago
tron c51ed8465d (svn r1769) Don't compute the same value twice, remove one function call 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
celestar 337de948c1 (svn r1743) -Fix: Multistop: Added some debug output and made sure that orphaned slots are cleared. 20 years ago
celestar 9a3089b403 (svn r1735) -Fix: [ 1112285 ] Fixed an assertion error with stations where stops
were deleted, the assertions were just plain wrong at that place. Used a
more graceful handling. Todo: What happens if ALL stations in a schedule
have no suitable stop?
20 years ago
celestar 3c82a2b3c7 (svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
a single station.
Thanks to: Truelight for the saveload code, Darkvater and Hackykid for
network testing and Tron for proof-reading 1500 lines of diff.
20 years ago
tron 38587b60f7 (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
This makes it necessary to rename TileType() to GetTileType() because a type and a function may not share the same name.
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
celestar 558dcd8ee0 (svn r1694) -Fix: Forgot to remove a DEBUG statement :( 20 years ago
Celestar 0a531338e9 (svn r1693) -Fix: [ 1108618 ] A wrong error message was displayed when trying to
expand railroad stations beyond maximum spread
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 94d5aeabb2 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile 20 years ago
dominik 274b4f01ee (svn r1579) Fix: [ 1105963 ] Buoys can now only be removed if no ship has it in their schedule.
This makes buoys more useable in multiplayer games again, as buoys can't be deleted by other players if they are used.
20 years ago
bjarni 467e4b82bf (svn r1568) made an enum of train subtypes to make the code more readable 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 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 58484ce6ee (svn r1533) Turn an if cascade into a switch and move a const array to the only location where it is used 20 years ago
truelight 7cafdf3b0b (svn r1525) -Codechange: rewrote the _order_array, now it can be made dynamic.
-Codechange: renamed all 'schedule' stuff to 'order(list)'
-Codechange: moved all order-stuff to order_cmd.c / order.h
-Codechange: vehicles that share orders are now linked to eachother
  with next_shared/prev_shared in Vehicle

  Developers: please use AssignOrder to assign data to an order. If not, 
   you _WILL_ make the save-routine to assert!
20 years ago
tron 412cf98eb4 (svn r1512) Replace probably incorrect test of loading_count with probably correct test of loaded_count 20 years ago
darkvater 4734a0e690 (svn r1472) -Fix: correct error message for when trying to build a railroad station over a bus/truck/etc-station. 20 years ago
Celestar 91a75191a2 (svn r1467) Fixed a nasty bug where one could build one station OVER the other 20 years ago
celestar e0a8b21404 (svn r1441) Fixed a couple of warnings, and removed a pointless assert 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
truelight b450603437 (svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
(in prepare of dynamic arrays):
  - DEREF_XXX is changed into GetXXX
  - All direct call are directed via GetXXX
  - struct Industry has now an index-field
  - ENUM'd some stuff
  - Replaced home built loops with FOR_ALL_XXX
  - Added _stations_size, _vehicles_size, ... which gives the length of the
    array (which will be dynamic in the near future)
  - Changed lengtof(XXX) to _XXX_size (e.g. _stations_size)
  - Removed all endof(XXX) (because mostly it was part of a FOR_ALL_XXX)
  - Made the sort-functions of all 4 dynamic
  - Made all 4 Initialize functions more of the same
  - Some minor tab-fixing and stuff
  (tnx to Tron for proof-reading my 100kb patch ;))

  Note for all: please do NOT directly call _stations, _vehicles, _towns and
  _industries, but use the right wrapper to access them. Thank you.
  Ps: please also do not use 'v++', where v is of type Vehicle *.
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
darkvater fc52b512aa (svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky. 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
tron df1f0010f9 (svn r1328) Turn loop with explicit terminator element into loop using endof() 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
darkvater 452db59121 (svn r1211) -Feature: Introduce sticky windows to all vehicle windows...Just make sure you do not sticky more than 23 at a time. Also a lot of places in the code invalidated the 'status bar' of the vehicle, referring to it as widget 4. This is now widget 5 and has been #definitized 20 years ago
tron e33a63ee8d (svn r1161) Don't make redundant GetAirport() calls, use the cached value 20 years ago
truelight c2fd88b9b6 (svn r1153) -Fix: FindCatchmentRadius is now a function that uses the enums instead
of magic numbers (tnx to Stumo)
20 years ago
tron 0cdcb1d6c7 (svn r1151) Fix last commit |: 20 years ago
tron 11d477044c (svn r1150) Fixes:
- Don't crash when building or destroying airport without depots (bugs were latent before r1149)
- Delete all hangar windows when destroying an airport, not just the first one (before r1149 none where deleted)
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
Celestar 969d07925a (svn r1017) Solved a Segfault if a station was built too close to the northern corner 20 years ago
Celestar 945ceb06fc (svn r979) Allow more realistically sized catchment areas 20 years ago
tron b8e83ca03f (svn r955) Replace uint16 for orders with struct Order
This adds no functionality, but is a stepping stone for future improvement (like 16bit order indices) and is easier to read.
This changes preserves binary compatibility wrt savegames.
20 years ago
truelight d6a1f3e412 (svn r942) -Merged branch/network back into the trunk 20 years ago
tron ecf1c35849 (svn r907) Sprinkle holy ANSI water:
- "inline" must before the return type (and after "static")
- Initialise all struct members, not just some of them
- Remove (one) spurious semicolon
20 years ago
tron 265ac67183 (svn r901) Small step in the process to clean up the DPARAM mess:
- reduce to 2 sizes (*DParam64 for 64bit values, *DParam for the rest)
- use inline functions instead of macros
- add assert()s to check for buffer overruns
20 years ago
tron acbd1801c7 (svn r815) Include strings.h only in the files which need it.
This should reduce the compile time after altering english.txt by about 1/3, because "only" 62 instead of 90 .c files must be recompiled.
20 years ago
tron fca55e3741 (svn r793) Merge INLINE -> inline replacement (revision 376) 20 years ago
tron e8537f5512 (svn r787) Invert the sense of the DO_TRANS_BUILDINGS flag to be consistent with its own name and all other DO_* flags.
Now it is active-true.
20 years ago
tron c5b0ecac4f (svn r780) Always report a bus/lorry station as unpassable.
The current behavior just causes bugs and the pathfinder does the necessary magic to handle stations as destinations and enter them anyway.
This fixes [ 1058809 ]
20 years ago
tron 57adc97733 (svn r724) Remove restriction that a tile can only accept 3 cargo types.
This especially enables houses to accept passengers, mail, goods AND food.
Add string templates for up to 5 cargo types for the tile info window. If more are needed just add them.
Simplify (de-uglify) the logic for cargo acceptence for houses and split the goods/food table into two. The acceptance is unmodified, but accepting goods AND food is now trivially possible. The exact amounts have to be decided.
This is based on Celestar's changes in the map branch plus some further bits that will be merged there soon.
20 years ago
tron 83ffb9c7fa (svn r667) Fix bug in rendering stations from savegames
Also don't pitch custom station sprites by railtype
(pasky)
20 years ago
dominik 4612dcdb48 (svn r662) [newgrf] Moved grfspecial.c to newgrf.c/newgrf.h 20 years ago
tron 3a7abc2a35 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky) 20 years ago
tron 13f0b6c0cf (svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky) 20 years ago
miham 86d19cb577 (svn r647) Cleanup custom station classes handling. (pasky) 20 years ago
tron b65bda506c (svn r635) Fix choosing a spritegroup from deterministic variational spritegroups if there is no structure to search (i.e. in purchase lists) (pasky) 20 years ago
tron 2f35fea097 (svn r625) Almost complete support for deterministic variational vehicle spritegroups. (pasky) 20 years ago
darkvater ec434b208e (svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky). 20 years ago
darkvater 183c33931d (svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky). 20 years ago
darkvater e656a91736 (svn r602) -newgrf: Move DrawTileSeqStruct & co and struct SpriteGroup to sprite.h (pasky) 20 years ago
darkvater 5fcd71cf28 (svn r600) -newgrf: Relocation offset for custom station sprites is now stored separately, making it possible to show different sprites in waypoint selection dialog (pasky). 20 years ago
darkvater 5847317526 (svn r592) -newgrf: Dynamically allocate global custom station IDs (pasky). 20 years ago
darkvater ccc496ba2c (svn r591) -newgrf: Store whole struct StationSpec in SetCustomStation(), not just the rendering data. This will be needed for variational stationspecs (pasky). 20 years ago
celestar eb50427670 (svn r581) -newgrf: Basic support for new stations - only waypoints supported now and only
the first custom one can be placed (no selector GUI, coming soon). This
also moves some global variables to {struct GRFFile} and reorders which
actions are processed in what stage, to get it all working together --
(pasky)
20 years ago
darkvater 7930faace9 (svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky) 20 years ago
tron 65058d0d57 (svn r542) -Fix: Display correct rail type in "build railway station" window
Thanks, ln--
20 years ago
truelight 75a54521e8 (svn r319) -Fix: [ 1029064 ] Building a station acted weird in some rare situations 20 years ago
darkvater c79e8ad626 (svn r244) -Fix: Stations were not sorted for non-player-0 players
-Fix: Correctly resorting vehicle list of player when the list of another player is open.
20 years ago
darkvater e295e46e3e (svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
-CodeLayout: Remove trailing spaces and Windows linebreaks
20 years ago
truelight eb49a19460 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way! 20 years ago
truelight 10d54ac604 (svn r160) -Codechange: made GetTileTrackStatus more readable (blathijs)
-Fix: some minor fixes around GetTileTrackStatus (blathijs)
20 years ago
darkvater 7b02cd3248 (svn r150) -Fix: [1010833] Turning on the magic bulldozer removes oil rigs
-Fix: [993493] Buildings on water
-Feature: Water floods everything, including vehicles.
20 years ago
dominik 74852c4652 (svn r124) Prepared code for removal of block_months variable in next major savegame version 20 years ago
dominik 770f86bbbe (svn r122) Change: exclusive transport rights are now stored per town instead of per station
Exclusive rights from old savegames will be reset.
20 years ago
truelight 788ace088d (svn r85) -Add: initial commit of new AI (enable in Patch menu)
-Add: generalised A* Algorithm
-Add: generalised queues (Fifo, Stack, InsSort, BinaryHeap)
20 years ago
truelight a21fa40127 (svn r72) -Add: build_date of station (viewable with Query tool) 20 years ago
darkvater 68c9b7c3ad (svn r66) -Fix Station list updated on station deletion/station rename
-Changed debug messages to comply with DEBUG(name, level) heuristics
20 years ago
darkvater 27f6fcae4c (svn r60) -Fix: signal_density is given as a parameter to autosignal. This means all players can define it for themselves.
-Fix a few warnings
20 years ago
dominik 43d691df17 (svn r56) Improved order checker + patch setting for it (celestar) 20 years ago
dominik 7af3360c5a (svn r44) Fix: Coast line near edge of map and near oilrigs (Dribbel) 20 years ago
dominik ca120eedad (svn r40) Final slope graphics fix 20 years ago
darkvater 52f8e963c1 (svn r29) -Fix You cannot take ownership of an oilrig by building right next to it
-Fix when adding parts to a statin max size is not 15x15 anymore, but _patches.station_spread
20 years ago
darkvater cbec93d9b6 (svn r28) -Fix removing station merged with oilrig, will reset oilrigs ownership 20 years ago
darkvater f422014960 (svn r23) -Some omments on the code (blathijs) 20 years ago
truelight efaeb275f7 (svn r1) Import of revision 975 of old (crashed) SVN 20 years ago