Commit Graph

60 Commits

Author SHA1 Message Date
Darkvater
89a9939112 (svn r3467) - CodeChange: Remove an useless assignment (reads a value and just writes it back)" tree_cmd.c 2006-01-29 10:57:23 +00:00
Darkvater
5e7526948a (svn r3446) - Fix: incorrect validating of tree-planting command which can allow a buffer-overflow (Tron) 2006-01-26 18:45:04 +00:00
tron
3bdb92446c (svn r3196) Use structs instead of magic offsets into arrays 2005-11-16 12:01:46 +00:00
tron
ca1dfe94d2 (svn r3186) Unnecessary casts and truncation 2005-11-15 09:05:16 +00:00
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
2005-11-14 19:48:04 +00:00
tron
524fd25cbd (svn r3177) GB, CLRBIT, HASBIT, TOGGLEBIT 2005-11-14 08:09:57 +00:00
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
2005-10-22 06:39:32 +00:00
tron
71d293f2a3 (svn r3066) Constify the parameter of GetSlopeZ_*() 2005-10-19 14:49:46 +00:00
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
2005-09-18 20:56:44 +00:00
tron
3f424aa673 (svn r2763) Small cleanup and improve a few comments 2005-07-30 18:30:07 +00:00
tron
2f1d530bb5 (svn r2758) Add the AB() macro to add a value to a bit range and use it in a few places, also make use of GB and SB nearby 2005-07-30 09:29:20 +00:00
tron
0dcbecd357 (svn r2750) -Fix: Tree tiles above the snow line got redrawn disproportionately often 2005-07-29 18:22:04 +00:00
tron
0e64dc50b6 (svn r2738) Small bit fiddling cleanup 2005-07-28 19:18:27 +00:00
tron
647cbd6bdd (svn r2701) Insert Id tags into all source files 2005-07-24 14:12:37 +00:00
tron
54cbd01825 (svn r2673) Include functions.h directly, not globally via openttd.h 2005-07-22 07:02:20 +00:00
tron
b0779b4b65 (svn r2663) Include variables.h only in these files which need it, not globally via openttd.h 2005-07-21 18:44:27 +00:00
celestar
1fed0046ac (svn r2658) -Codechange: Use MAKE_TRANSPARENT to display a transparented sprite 2005-07-20 22:05:13 +00:00
Darkvater
c966fc23fb (svn r2628) - Fix: Planting trees does not result in a MapSize() assertion anymore; introduced in r2598 2005-07-18 00:17:19 +00:00
tron
06a6cc59ea (svn r2598) Small cleanup, especially get rid of a FindLandscapeHeight(), because it was overkill 2005-07-17 11:09:03 +00:00
celestar
de19186be3 (svn r2595) -Codechange: Introduced "IsSteepTileh" to find whether a tile is steep
(i.e. spans two height levels) and use it throughout the code.
-Codechange: Add CanBuildDepotByTileh to find if a tile is suitable to
build a depot on it. Wraps some bitmagic which seems quite unreadable at
first glance
2005-07-16 23:47:37 +00:00
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.
2005-07-13 19:51:31 +00:00
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. 2005-07-13 18:04:01 +00:00
tron
9617614b04 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY 2005-06-25 16:44:57 +00:00
tron
a733fede9b (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile" 2005-06-24 12:38:35 +00:00
tron
ff0030936e (svn r2408) Introduce SetTileOwner() and use it 2005-06-04 12:13:24 +00:00
tron
a9b95b3cbb (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner 2005-06-04 11:56:32 +00:00
Darkvater
ba8c649fac (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 2005-06-02 19:30:21 +00:00
Darkvater
6d349b6284 (svn r2288) - CodeChange: protected the next batch of commands (41 so far, out of 115).
- CodeChange: changed the airport gui airport-type checking. Added function GetValidAirports() that returns bitmasked availibility, is also used for checking.
- CodeChange: to check tree-planting, 2 const arrays have been moved to table/tree_land.h (type and count)
- CodeChange: added IsTownIndex() in following of IsStationIndex(), etc.
- Fix (regression): road tunnels did not work anymore, forgot that their type was 0x200 (documented now)
2005-05-09 22:33:00 +00:00
tron
1e2f9ba5a5 (svn r1874) Fix bug introduced in r1839 which placed snow covered trees below the snow line ([1121680]) 2005-02-14 18:55:10 +00:00
tron
361d415b88 (svn r1790) Make CmdPlantTree() and related functions more safe and (hopefully) more readable:
- check if end tile is on the map
- uint -> TileIndex
- if cascades -> switch
2005-02-04 16:50:18 +00:00
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 2005-01-29 12:19:05 +00:00
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.
2005-01-28 15:31:04 +00:00
tron
94d5aeabb2 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile 2005-01-22 20:23:18 +00:00
tron
90cafa9b15 (svn r1560) Introduce SetTileType() and SetTileHeight()
Replace direct references to _map_type_and_height with these
2005-01-18 18:41:56 +00:00
tron
61a6bc544d (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts 2005-01-16 11:24:58 +00:00
celestar
957635121c (svn r1504) enummed town ratings (Jango) 2005-01-14 09:20:12 +00:00
truelight
97dd511971 (svn r1486) -Codechange: moved all 'signs' stuff to signs.c/h and prepared it for
dynamic arrays
2005-01-12 11:21:28 +00:00
tron
4450ff105c (svn r1451) Fix some of the signed/unsigned comparison warnings 2005-01-09 21:25:44 +00:00
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] 2005-01-07 17:02:43 +00:00
tron
2eb7aedf69 (svn r1402) Trim trailing whitespace 2005-01-06 18:45:28 +00:00
tron
d3c6855320 (svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff 2005-01-06 11:39:00 +00:00
darkvater
d088cb6131 (svn r1366) -Fix: [1093186] rough land in snow upon dying of tree 2005-01-04 00:53:52 +00:00
darkvater
d2569e5b6e (svn r1355) -Fix: [1092473] random trees in scenario editor do not overwrite rocks as well 2005-01-03 21:47:52 +00:00
darkvater
3d51f4d689 (svn r1353) -Fix: [1092707] placing rocks in scenario editor. You can place rocks on trees and vice versa 2005-01-03 21:26:09 +00:00
darkvater
20a2843920 (svn r1347) -Fix: Some were fixed for the trees -> Only copy the lowest two bits (amount of snow/desert) from map5 to map2 when placing trees, before this happened implicitly because map2 was just 8 bits wide; 2005-01-03 19:34:07 +00:00
tron
f772d1a263 (svn r1345) Only copy the lowest two bits (amount of snow/desert) from map5 to map2 when placing trees, before this happened implicitly because map2 was just 8 bits wide 2005-01-03 19:06:16 +00:00
truelight
a538fb3213 (svn r1299) -Fix: [ 1092473 ] In SE, when trees are placed randomly, they are no
longer placed on farmland
2004-12-30 09:43:12 +00:00
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!!
2004-12-28 11:51:31 +00:00
tron
a148ff4e0d (svn r1117) Move map arrays and some related macros into their own files map.c and map.h 2004-12-15 22:18:54 +00:00
tron
291d25a88b (svn r925) Use sound enums
Also play the correct sound when a toyland road vehicle breaks down
2004-12-04 09:26:39 +00:00