tron
8208ee5ea2
(svn r3891) Fix r3885
2006-03-15 19:53:25 +00:00
tron
0c9a269bd3
(svn r3890) Simplify deleting a bridge by handling the ramps outside of the removal loop
2006-03-15 17:38:00 +00:00
tron
23d5188b7b
(svn r3889) Change a part of the bridge drawing code to make it more comprehensible and add the needed accessors
2006-03-15 17:27:15 +00:00
tron
e74d77211f
(svn r3888) If you think you've checked everything, check once more. *sigh* Fix r3887
2006-03-15 16:47:35 +00:00
tron
626109f3f9
(svn r3887) Add a function to get the other bridge end when you're at a bridge ramp
2006-03-15 16:44:50 +00:00
tron
bd5def0092
(svn r3885) Simplify DoConvertTunnelBridgeRail() a bit
2006-03-15 16:09:23 +00:00
tron
c515c34008
(svn r3877) Add functions to turn a tile into a rail/road bridge ramp/middle part
2006-03-15 07:10:41 +00:00
tron
273533d4c7
(svn r3857) Add and use GetBridgeRampDirection()
...
Note: This slightly changes the behavior of GetAnyRoadBits() to only return a road piece for the start of the bridge ramp instead of a full ROAD_[XY]
2006-03-14 12:00:11 +00:00
tron
23ae850484
(svn r3849) Fix bug in r3846
2006-03-13 15:38:52 +00:00
tron
26815f7405
(svn r3846) Add functions to set the type of stuff (clear, water, rail, road) under bridges
2006-03-13 12:55:20 +00:00
tron
3e932a0a4f
(svn r3838) Demystify building bridge middle parts a bit by removing some magic numbers and generic names
2006-03-13 07:12:49 +00:00
tron
8259a29ead
(svn r3837) Partially unmagicfy restoring the tiles when deleting a bridge
...
Existing bug: When restoring a road piece which belongs to a town the town index unconditionally gets set to 0
2006-03-12 20:59:56 +00:00
tron
0100871412
(svn r3830) Move IsTunnelTile() from tile.h to tunnel_map.h and add IsTunnel(), which just checks for a tunnel, but not the tile type as IsTunnelTile() does
2006-03-12 15:04:03 +00:00
tron
7a0071cc53
(svn r3829) Reduce the use of _error_message by directly returning error codes instead of using this global variable
2006-03-12 12:19:25 +00:00
tron
6c30c9ae4d
(svn r3823) Remove dead code: A value for 'image' gets calculated and overwritten just a few lines later without being used in between
2006-03-12 08:47:18 +00:00
tron
86491ca257
(svn r3820) Be a bit more strict with types: use special types instead of generic byte and don't fill arbitrary data into inappropriate types
2006-03-11 17:06:16 +00:00
tron
0e4ee1241f
(svn r3814) Remove another call to FindLandscapeHeight()
2006-03-10 17:01:51 +00:00
tron
ee03f15f27
(svn r3803) Change the second parameter of UpdateSignalsOnSegment() from Direction to DiagDirection as that's what it really operates on
2006-03-09 12:32:25 +00:00
tron
8cfcdaa733
(svn r3783) Replace further ints and magic numbers by Direction, DiagDirection and friends
2006-03-08 06:55:33 +00:00
tron
3027b8673e
(svn r3779) Move CheckTunnelInWay() to a more appropriate place, invert its result and give it a less ambiguous name (IsTunnelInWay)
2006-03-07 07:51:05 +00:00
tron
af42610321
(svn r3777) Add some functions to handle tunnels
2006-03-06 20:55:24 +00:00
tron
49cb8eb470
(svn r3776) Replace many ints and magic numbers by Direction, DiagDirection and friends
2006-03-06 20:28:28 +00:00
tron
4efa560ffc
(svn r3763) Adapt to the new 'map accessors go in foo_map.h'-scheme
2006-03-05 10:19:33 +00:00
tron
2f8e3dcc05
(svn r3658) Add functions and symbolic names to retrieve road tile types and road pieces
2006-02-23 08:20:28 +00:00
tron
251f519d26
(svn r3654) Turn another if-cascade into a switch
2006-02-22 21:35:45 +00:00
tron
c9d540c0f0
(svn r3653) -Fix: You didn't pay for terraforming at the end tile when building a tunnel
2006-02-22 21:11:31 +00:00
tron
9d4400c89f
(svn r3652) Rewrite CmdBuildTunnel in the hope to make it a bit more comprehensible
...
This implementation is also significantly shorter because it removes many redundant checks
2006-02-22 21:09:55 +00:00
tron
08f132fef2
(svn r3645) Fix stupid typos in last (r3644) commit *sigh*
2006-02-21 07:44:33 +00:00
tron
b8b6084da2
(svn r3644) Don't use FindLandscapeHeightByTile() when it's overkill - often it was just a complicated way of writing GetTileSlope(tile, NULL)
2006-02-21 07:41:54 +00:00
tron
7692556c62
(svn r3613) Some more const, indentation, whitespace and similar stuff
2006-02-18 14:41:24 +00:00
tron
5352e9fbcb
(svn r3597) Miscellaneous (I like that word) changes: Fix some indentation, add consts, reduce indentation level by short-circuit logic, convert if cascades to switch, whitespace, bracing, plus some minor stuff
2006-02-13 21:15:00 +00:00
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
2006-02-06 09:18:04 +00:00
tron
17ec6ed70d
(svn r3520) Remove unused parameters from some functions
2006-02-02 07:15:46 +00:00
tron
1c3e8630fe
(svn r3511) More whitespace ([FS#46] by Rubidium)
2006-02-01 07:36:15 +00:00
tron
9712d6f639
(svn r3510) Fiddle with whitespace and parentheses
2006-02-01 06:32:03 +00:00
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
2006-01-30 17:18:45 +00:00
tron
a56ab08f3b
(svn r3487) -Fix: Price for demolishing a bridge was dependent on orientation and map size
2006-01-30 16:48:24 +00:00
Darkvater
4014e36aec
(svn r3472) - [PBS] Remove from trunk. Anyone interested can still find it in branch/pbs. This reverts revisions r3158, r3140, r3075, r2977, r2674, r2625, r2621, r2529, r2528, r2525, r2524, r2519, r2517, r2516, r2507, r2499. (in conjunction with Tron)
...
- The only change is that the nsignalsw.grf file is kept and that existing nightlies with PBS signals get those signals converted to combo-signals.
2006-01-29 18:57:26 +00:00
peter1138
bea2d63154
(svn r3418) - Fix: When removing a town-owned tunnel the player's rating was not reduced, as it checked the ownership of the tunnel after clearing it. Now we perform the rating adjustment before clearing the tiles. (spotted by glx)
2006-01-22 16:23:05 +00:00
peter1138
7ae5e344a2
(svn r3391) - PBS Fix: Keep PBS reservation state when building a bridge over rail.
2006-01-08 12:44:11 +00:00
tron
49f0691c1a
(svn r3308) BAD
...
foo.h: int bar;
GOOD
foo.h: extern int bar;
foo.c: int bar;
2005-12-15 17:55:59 +00:00
peter1138
80986fcd32
(svn r3282) - Codechange: Replace tests against CMD_ERROR with CmdFailed()
2005-12-10 12:05:39 +00:00
bjarni
16e65960b9
(svn r3218) -Feature: Multiheaded train engines will now stay in the same train
...
This means that any user attempt to remove a rear engine will tell the user to move the front engine instead
This fixes the assert when moving multiheaded engines (introduced in r3144)
Note: to make old savegames use this feature, some engines might be turned around in order to link engines in pairs
-Codechange: train subtype is now a bitmask
This allows fast access to info like if it is a wagon or engine and if it is in front and so on
Note: savegame version bump
2005-11-18 23:41:03 +00:00
tron
ef7fb8b515
(svn r3205) Some more uses for GB/SB
2005-11-16 13:11:28 +00:00
tron
ca1dfe94d2
(svn r3186) Unnecessary casts and truncation
2005-11-15 09:05:16 +00:00
tron
84a16a0b30
(svn r3184) GB/SB
2005-11-15 08:49:46 +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
71d293f2a3
(svn r3066) Constify the parameter of GetSlopeZ_*()
2005-10-19 14:49:46 +00:00
celestar
ab049c7bca
(svn r3065) -Codechange/Add: Modified the bridge drawing code so that the basic offset is read from the RailTypeInfo struct. This is (hopefully) the last DrawTile change on the way to electrified railways. While being at it, de-mystified the function a bit and added some asserts.
2005-10-19 08:34:37 +00:00
tron
b17b87469c
(svn r3064) Replace some numbers by sprite names
2005-10-19 06:46:41 +00:00
tron
53a4a6a0f4
(svn r3046) Replace some numbers with sprite names and fix a typo in the sprite list
2005-10-15 11:06:54 +00:00
tron
4529d1fc8e
(svn r3037) Don't deduce the sprites for tunnels and level crossings from magic numbers, but fetch them from the central rail info array. This is a preparation step for electrified rails
2005-10-13 16:00:14 +00:00
tron
7ab7d79190
(svn r3028) s/255/OWNER_SPECTATOR/
2005-10-10 10:36:37 +00:00
tron
39f5dbfd3b
(svn r3019) -Codechange: Replace explicit shifting/anding/oring with GB and SB
2005-10-05 07:20:26 +00:00
peter1138
0941c388d9
(svn r3004) -Feature, NewGRF: Support loading of bridge attributes and tables from GRF. Currently drawing tall pillars uses old data.
2005-10-01 17:38:48 +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
truelight
4936e93654
(svn r2948) -Fix: the old AI needs a special flag that triggers all kind of special
...
abilities you really don't want to know about (free bridges, etc..)
I removed this flag some revisions ago, but the Aircraft part
depends on it, so I re-enabled it again..
2005-09-13 12:19:27 +00:00
tron
7cca146b0a
(svn r2840) Remove 3 unnecessary strings (they're empty) and fix the alignment of the musick track display
2005-08-08 10:42:02 +00:00
bjarni
9952ff0b59
(svn r2817) -Codechange: [autoreplace]: moved autoreplace and autorenew to serverside
...
-This means that one company can only have one setting for renew and replacing
more clients will not fight due to different settings anymore
-This is a needed step in the line to fix autoreplacing dualheaded locomotives
NOTE: savegame revision bump (peter1138 + me in coop)
2005-08-06 16:07:22 +00:00
celestar
ba0c0ceaa3
(svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
2005-08-01 20:23:38 +00:00
ludde
9a060a0f24
(svn r2781) Fix some of the issues with variables in .h files.
2005-08-01 16:31:19 +00:00
tron
2ae758a32b
(svn r2780) Remove some more unused strings and make the use of a few strings more explicit
2005-08-01 13:01:14 +00:00
celestar
5352ad4582
(svn r2774) -Codechange: Removed TRACKTYPE_SPRITE_PITCH globally and replaced it by a member of RailtypeInfo
2005-07-31 22:53:57 +00:00
celestar
a3739aecdf
(svn r2702) -Codechange: Cleaned up the sprite code and replaced many magic numbers
...
by enums. There remains work in gfx.c to move the "transparency" and
"recolor" bits around to make space for more sprites. However, 2800
additional sprites can now be loaded. There also remains cleanup and
Doxygen work on many of the header files.
2005-07-24 15:56:31 +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
71140a5768
(svn r2669) Shuffle some more stuff around to reduce dependencies
2005-07-21 22:15:02 +00:00
tron
6ad3895306
(svn r2660) Get rid of some more shifting/anding/casting
2005-07-21 06:31:02 +00:00
celestar
1fed0046ac
(svn r2658) -Codechange: Use MAKE_TRANSPARENT to display a transparented sprite
2005-07-20 22:05:13 +00:00
tron
f09638ad3d
(svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read
2005-07-20 15:29:28 +00:00
tron
7269771544
(svn r2643) Get rid of some unnecessary casts
2005-07-19 21:49:35 +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
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
hackykid
ab9c6f126d
(svn r2516) - Feature: [pbs] Implement path-based-signalling. This allows multiple trains within the same signal block, provided their paths dont intersect. For this the block must have all exit and entry signals be pbs signals. Place these by ctrl-clicking 4 times on a normal signal.
...
- Feature: [pbs] Implement autoplacement of pbs blocks, when a block has an entry and an exit pbs signal, covert the entire block to pbs. Can be turned off in the patch settings.
- Feature: [pbs] Allow showing of reserved status by making the tracks darker, when the pbs debug level is at least 1.
2005-07-04 14:58:55 +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
Darkvater
6e052ccca2
(svn r2436) - Fix: Deleting canals under bridges removes bridges first in certain configurations (peter1138)
2005-06-09 13:54:08 +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
hackykid
2f1a224ea9
(svn r2390) - Codechange: Fix some warnings on GCC 4.0.0
2005-06-01 11:52:44 +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
Darkvater
84b0d2d19d
(svn r2286) - CodeChange: paramcheck the next batch of commands.
...
- Fix (regression): fix up terraform land where every player can terraform land (towns, map generation), and player can terraform different corners; used for building tunnels
2005-05-09 16:37:40 +00:00
Darkvater
da1a7587af
(svn r2285) - Codechange: Fix up some of the missing things from server-checking; namely bridge-type, bridge-length, dragged end-tile (bridge/station), station_spread
...
- Fix: [ 1197256 ] max station spread patch < 7 does not work. Station spread was not taking into account when not using drag&drop. Fix this up, and add a callback to the settings window to immediately reflect the changes.
2005-05-09 13:26:15 +00:00
Darkvater
419af5cece
(svn r2279) - Fix: Check the parameters of the first 10 Commands. While there also add proper comments for the functions and fix up CmdFailed()
2005-05-07 10:26:12 +00:00
tron
c6b211d0aa
(svn r2091) Small cleanup: uint -> TileIndex, const, don't call FindLandscapeHeightByTile()
2005-03-27 16:40:01 +00:00
pasky
730986eeb9
(svn r2089) - Codechange: Simplify slopes check in CmdBuildBridge(). Inspired by st3wis' patch 1144746.
2005-03-27 15:56:54 +00:00
Darkvater
4089c85653
(svn r2066) - Fix: [ 1164248 ] game crash while AI builds bridge. Also protect bridge building against invalid bridges and some safeguards when drawing.
2005-03-25 17:30:54 +00:00
truelight
d1e158d6f7
(svn r2046) -Codechange: moved all waypoint code to waypoint.c/waypoint.h
...
-Codechange: rewrote some functions while moving waypoint-stuff
-Add: added support for 64k waypoints
-Fix: made the waypoint struct a bit more logic (no bit-fucking)
2005-03-24 17:03:37 +00:00
tron
3892aece72
(svn r1934) Small cleanup (uint -> TileIndex, (uint)-1 -> INVALID_TILE and similar stuff)
2005-03-06 12:31:07 +00:00
Darkvater
4713b11ffe
(svn r1923) - Fix: [ 1155696 ] Crash with german umlauts in station names. The width was not calculated using unsigned values, so all characters above 128 were "negative"
...
- Codechange: a more proper check for a null pointer in tunnelbridge_cmd.c should have gone in with the previous commit
2005-03-04 00:14:28 +00:00
tron
830565514c
(svn r1867) Include tables/sprites.h only in files which need it
2005-02-13 11:18:02 +00:00
tron
7d56d1d841
(svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more explicit types as parameters
2005-02-07 10:41:45 +00:00
matthijs
cc0966405b
(svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
...
- Add: asserts to find the v->u.rail.track == 0 problem.
- Add: IsValidDepot(), IsValidTown(), IsValidSign(), IsValidVehicle(), IsValidStation()
- Add: GetTileOwner(), IsTileOwner()
- Codechange: Replaced IsShipDepotTile(), IsTrainDepotTile(), IsRoadDepotTile() by IsTileDepotType().
- Codechange: typedeffed the MAP_OWNERS as Owner. Should be used as variable type.
- Codechange: Replaced a few uint by TileIndex.
2005-02-06 22:36:08 +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
372b9cb827
(svn r1696) Use GetTileSlope() instead of FindLandscapeHeightByTile() where it is sufficient. FindLandscapeHeightByTile() uses GetTileSlope() internally and adds some more info, which is discarded in these cases.
...
While touching the code make a bit more clear how GetBridgeHeight() works.
2005-01-27 12:52:20 +00:00
tron
81ee2d931b
(svn r1610) Remove trailing whitespace (last time ever, i hope)
2005-01-23 13:09:35 +00:00
tron
97f893ae2f
(svn r1596) Add some more statics
2005-01-22 22:47:58 +00:00
tron
ba79ff1210
(svn r1592) -Fix: [1090495] Slopes under high bridges weren't flooded
2005-01-22 19:05:30 +00:00