tron
4b74fa1923
(svn r3981) More work for the rail accessing functions and enums
19 years ago
tron
2181a72e9e
(svn r3787) Use DirToDiagDir() instead of >> 1
19 years ago
tron
03536a32a1
(svn r3786) More work for DirDiff
19 years ago
tron
fbe939b31f
(svn r3783) Replace further ints and magic numbers by Direction, DiagDirection and friends
19 years ago
tron
453b30e387
(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
84fb96fe85
(svn r3511) More whitespace ([FS#46] by Rubidium)
19 years ago
tron
22dc05faf2
(svn r3510) Fiddle with whitespace and parentheses
19 years ago
Darkvater
a87ff2dc88
(svn r3216) - Fix (regression): endless loop introduced in revision 3190
19 years ago
truelight
c1b012171d
(svn r3210) -Codechange: use IsRailWaypoint where possible (instead of magicnumbers)
...
-Codechange: IsRailWaypoint should take 'tile', not 'm5'
19 years ago
tron
8cebe2f607
(svn r3204) Make handling of clicking on vehicles a bit less ugly by avoiding function declarations in .c files and unnecessary indirection
19 years ago
tron
d76fc8d7d1
(svn r3197) Use a better bias so you can directly see the date range a disaster can happen in
19 years ago
tron
3bf8d2ccbb
(svn r3190) Turn some loops into canonical for loop form
19 years ago
tron
1b0091e0d2
(svn r3184) GB/SB
19 years ago
tron
f7abff5f96
(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
5fa6b7eb06
(svn r3179) - RandomRange() and RandomTile() instead of home brewed versions
...
- CHANCE*() instead of mumbling strange numbers
19 years ago
tron
833032adc0
(svn r3177) GB, CLRBIT, HASBIT, TOGGLEBIT
19 years ago
tron
2cc2154ad2
(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
tron
758ae7e8f6
(svn r3064) Replace some numbers by sprite names
19 years ago
tron
db3b1228bf
(svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them
19 years ago
Darkvater
3097ee2429
(svn r2961) - Fix: [ 1219123 ] Fix for [ 1216203 ] UFO-broken waypoint (lucaspiller)
19 years ago
tron
b45aeb5c36
(svn r2886) Rename the "owner" attribute to "m1", because when it stores an owner it is accessed by [GS]etOwner anyway and when it doesn't store an owner, but arbitrary data, accessing a field called "owner" is confusing.
19 years ago
tron
a227065ab7
(svn r2701) Insert Id tags into all source files
19 years ago
tron
559babcdc9
(svn r2673) Include functions.h directly, not globally via openttd.h
19 years ago
tron
0762aa9ec9
(svn r2669) Shuffle some more stuff around to reduce dependencies
19 years ago
tron
ac66e3e28f
(svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read
19 years ago
ludde
6013b327f7
(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
8c1d74162f
(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
tron
1b4a0897b6
(svn r2535) Tabs
19 years ago
tron
229fbefc03
(svn r2505) Remove some unnecessary #includes
19 years ago
tron
bec5e4fb4c
(svn r2487) Replace TILE_XY by TileXY/TileDiffXY
19 years ago
tron
61f6f07edd
(svn r2486) Turn TILE_FROM_XY into an inline function and rename it to TileVirtXY
19 years ago
tron
3154e7148d
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
19 years ago
tron
0c4ecbe9ec
(svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner
19 years ago
Darkvater
b438b1248c
(svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
20 years ago
tron
6b83a05ada
(svn r1863) Give the effect vehicle type enums more descriptive names and use the enum as parameter type for CreateEffectVehicle*()
...
-Fix: [1116619] Generate the correct smoke type for diesel trains
20 years ago
tron
97ae59fe1a
(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
f2af1ed332
(svn r1716) Prevent zeppelins from accessing non-existent tiles when leaving the map
20 years ago
tron
5885b31bb4
(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
189ca73707
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
20 years ago
tron
fb0c3c8061
(svn r1549) Clean up some functions:
...
uint tile -> TileIndex tile
if () cascade -> switch ()
20 years ago
tron
022b8cea37
(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
ae796740aa
(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
7ca6b2b8b0
(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
63e97754fb
(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
f8c95a1dbe
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
20 years ago
tron
67161506ad
(svn r1386) Move TileIndexDiff to map.h
...
Move _tileoffs_by_dir to map.[ch] and encapsulate it in TileOffsByDir()
20 years ago
darkvater
79d29b7633
(svn r1346) -Fix: fix signed/unsigned warnings
...
-Fix: latent removal of 2 lines from ttd.c which I forgot because the file was not saved :O
20 years ago
tron
c0702318d2
(svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
20 years ago
truelight
546fcfa3ec
(svn r1301) -Codechange: _industries finally has FOR_ALL_INDUSTRIES too
20 years ago
tron
765ecfed84
(svn r1117) Move map arrays and some related macros into their own files map.c and map.h
20 years ago