Commit Graph

96 Commits (acac44820b15d0387cd4b246c3c42d90381acf8c)

Author SHA1 Message Date
Darkvater e0787f3afa (svn r6739) -Fix (r6001): Crash on removing farmland belonging to a farm. The search would loop
around the edges causing some troubles. Also make sure that the land after
 farm removal is not barren but 2/3rd grass. Better suited.
18 years ago
Darkvater 544ff2aaf9 (svn r6407) -Fix: Check return values of DoCommand() with CmdFailed and that of DoCommandP
with a boolean type.
18 years ago
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
rubidium 908d3bcfe6 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct. 18 years ago
truelight 95b4248f25 (svn r6032) -Fix: when a farm is gone, remove the fields when it is full grown and should be harvest (not before that) 18 years ago
truelight 0c760998b3 (svn r6001) -Feature: when removing a farm, his farmland is removed too (over time) (based on peter1138's patch, FS#82)
To make this to work, in older games farmland is removed on load, and replanted
18 years ago
truelight 7abad2b20e (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
- New optional landscape generator (TerraGenesis Perlin)
  - Load heightmaps (either BMP or PNG)
  - Progress dialog while generating worlds (no longer a 'hanging' screen)
  - New dialogs for NewGame, Create Scenario and Play Heightmap
    - Easier to configure your landscape
    - More things to configure (tree-placer, ..)
  - Speedup of world generation
  - New console command 'restart': restart the map EXACTLY as it was when you
      first started it (needs a game made after or with this commit)
  - New console command 'getseed': get the seed of your map and share it with
      others (of course only works with generated maps)
  - Many new, world generation related, things
  - Many internal cleanups and rewrites
  Many tnx to those people who helped making this:
     Belugas, DaleStan, glx, KUDr, RichK67, Rubidium, and TrueLight (alfabetic)
  Many tnx to those who helped testing:
     Arnau, Bjarni, and tokai (alfabetic)
  And to all other people who helped testing and sending comments / bugs
  Stats: 673 lines changed, 3534 new lines, 79 new strings
18 years ago
tron d8b8035f9f (svn r5794) Pass the TileIndex plus x and y coordinates into GetSlopeZ_* instead of a TileInfo 18 years ago
tron c51d0c0a09 (svn r5581) Slightly alter some snow line related calculations to make them a bit clearer 18 years ago
tron 276055a574 (svn r5365) -Fix: It was possible to dig into a tunnel if certain rail combinations were ontop of it
(Hopefully this time it works for real)
18 years ago
tron 4b2c02afde (svn r5364) Clean up r5363 18 years ago
tron ef4b0ab5b6 (svn r5363) Revert 5312, 5288, 5248, 3992, 3249, 3228
They were all aimed at fixing the terraform-into-tunnel problem, but introduced new sideeffects while doing so
18 years ago
Darkvater c0ca6fbd66 (svn r5312) - Fix (r5288): Be very strict about terraforming. If a rail tile has a foundation already, bail out. 18 years ago
tron 000497273c (svn r5309) Partially fix the rail header dependency fiasco: rail_map.h now depends on rail.h and not the other way round anymore 18 years ago
Darkvater fcf19e18eb (svn r5288) - Fix [FS#199]: Tunnel construction could erronously terraform a foundationed tile with rails. This also fixes another bug where you could implicitly remove a foundation by raising nearby sloped land. Desirable perhaps, but unwanted. 18 years ago
Darkvater 1ae2eba279 (svn r5248) - [Codechange]: Remove TerraformProc()'s mode parameter as it is not used 18 years ago
tron a2362674e3 (svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc. 18 years ago
tron 7fd88e5798 (svn r5155) - Remove the bridge branch merge (revision r5070) 18 years ago
celestar b618b75c9b (svn r5070) Merged the bridge branch
-Feature: Bridges can now be placed above:
	Any railway track combination (excluding depots and waypoints)
	Any road combination (excluding depots)
	Clear tiles (duh), including fields
	Tunnel entrances
	Bridge heads

Thanks to Tron for idea and implementation, KUDr for the yapf synchronization and many others for hours of testing

There are still a number of visual problems remaining, especially when electric railways are on or under the bridge.
DO NOT REPORT THOSE BUGS FOR THE TIME BEING please.
18 years ago
Darkvater 725cfc26d0 (svn r4586) - Codechange: Recursive commands that rely on _error_message to handle success/failure can fail if a recursive call fails but doesn't set the error message, thus resulting in an old, possibly erroneous being used (see FS#130 prior to r4585). Now properly reset the global variable _error_message in these cases. 18 years ago
tron b57640e28a (svn r4572) Remove vehicle_leave_tile_proc
There's exactly one implemented function (unbarring a level crossing) and one place where it can be triggered (a train leaves a level crossing)
It's a bit overkill, so just handle this one case where it can happen
18 years ago
tron 6dbc9c9ced (svn r4554) Replace magic numbers by TILE_{HEIGHT,SIZE} 18 years ago
tron dd180a1e18 (svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums 18 years ago
tron 35e93e451f (svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
Remove DoCommandByTile(), because now it does the same as DoCommand()
18 years ago
tron aa5777c874 (svn r4279) s/\<CL_/CLEAR_/ 19 years ago
celestar 69e1c716e8 (svn r4249) -Codechange: Replace more occurences of 16 by TILE_SIZE and of 8 by TILE_HEIGHT. Reverted one change from the previous commit because it was faulty 19 years ago
tron 7163a64c25 (svn r4242) Pass TileIndex and slope to GetSlopeTileh_*() instead of TileInfo 19 years ago
belugas 1b28d92fc8 (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear. 19 years ago
tron 747fe64b31 (svn r4073) Add functions to make and test for (most) unmovable tiles 19 years ago
celestar b5b348bdce (svn r3992) -Fix: Rewrote the code to determine whether a rail-tile can be terraformed.
Fixes a bug where you could terraform a tunnel (fixed by r3228, but reverted that one)
Fixes a bug introduced by r3228 which allowed steep rail tiles resulting in ... unwanted effects such as display artifacts.
That means the terraform feature should not work as intended; it also uses _valid_tileh_slopes to determine valid configurations instead of hand-brewn stuff.
TODO: _terraform_err_tile and similar TileIndices should have INVALID_TILE as "unused", not 0. (0 is a valid tile).
19 years ago
tron bf3811122d (svn r3979) Move GetRailFoundation() to rail_map.h and use it and friends to get information about rail tiles 19 years ago
tron c3fffd07f2 (svn r3794) Use already available accessor functions instead of GB() 19 years ago
tron 3027b8673e (svn r3779) Move CheckTunnelInWay() to a more appropriate place, invert its result and give it a less ambiguous name (IsTunnelInWay) 19 years ago
tron 4efa560ffc (svn r3763) Adapt to the new 'map accessors go in foo_map.h'-scheme 19 years ago
tron 087fe86ed2 (svn r3564) Several smaller changes:
- Don't treat non-booleans as booleans
- Reduce variable scope
- Bracing
- Use DeMorgan's law to make conditionals easier to read
- if cascade -> switch
- Replace some magic numbers by symbolic names
- Avoid assignments within other statements
19 years ago
tron 99f55ae733 (svn r3554) Add accessors for the field type and fences of clear tiles 19 years ago
tron 41dda81b29 (svn r3515) Fix copy&pasto in r3514 19 years ago
tron 5e0c8a239e (svn r3514) -Codechange: Replace direct fiddling of bits for the ground type and density of clear tiles with symbolic names and accessors.
See clear.h for details
19 years ago
tron 1c3e8630fe (svn r3511) More whitespace ([FS#46] by Rubidium) 19 years ago
tron 9712d6f639 (svn r3510) Fiddle with whitespace and parentheses 19 years ago
tron 244d4ab5cb (svn r3490) -Fix: A bunch (10) of off-by-one errors when checking if a TileIndex points to a tile on the map 19 years ago
peter1138 9e142209fc (svn r3249) Fix for issue introduced in r3228. The original code was good for raising, then for lowering, now for both. 19 years ago
peter1138 48855806d6 (svn r3228) - Fix: [ 1327011 ] Fix: don't lower land on tunnel, even with diag tracks on it (based on patch by glx) 19 years ago
tron 9d0e7b6458 (svn r3181) -Bracing
-Indentation
-Whitespace
-DeMorgan's Law
-Test with NULL or 0 for non-booleans
-'\0' instead of 0 for chars
-Remove redundantly redundant comments (like DoFoo(); // Do foo)
-Join multiple short lines with a single statement
-Split single lines with multiple statements
-Avoid assignments in if
19 years ago
tron 524fd25cbd (svn r3177) GB, CLRBIT, HASBIT, TOGGLEBIT 19 years ago
tron 71d293f2a3 (svn r3066) Constify the parameter of GetSlopeZ_*() 19 years ago
tron 53a4a6a0f4 (svn r3046) Replace some numbers with sprite names and fix a typo in the sprite list 19 years ago
Darkvater 4a58250cb9 (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
- change a lot of byte player types to PlayerID
- beautify header files, same "#endif /* filename */" ending
19 years ago
tron ae44d3aa1f (svn r2739) -Fix(?): Change the fence algorithm so it removes fences when no farm tile is adjacent 19 years ago
tron 0e64dc50b6 (svn r2738) Small bit fiddling cleanup 19 years ago