(svn r9575) [NoAI] -Sync with trunk r9504:9574 noai
authorglx
Sun, 08 Apr 2007 14:46:55 +0000
branchnoai
changeset 9574 698395509d12
parent 9573 fa56261c7142
child 9575 a4b6bbfa6c96
(svn r9575) [NoAI] -Sync with trunk r9504:9574
projects/openttd.vcproj
projects/openttd_vs80.vcproj
source.list
src/aircraft.h
src/aircraft_cmd.cpp
src/aircraft_gui.cpp
src/airport.cpp
src/airport.h
src/airport_movement.h
src/autoreplace_gui.cpp
src/bridge_map.cpp
src/bridge_map.h
src/clear_map.h
src/command.cpp
src/console.cpp
src/console_cmds.cpp
src/dedicated.cpp
src/depot_gui.cpp
src/direction.h
src/disaster_cmd.cpp
src/economy.cpp
src/elrail.cpp
src/endian_check.cpp
src/fileio.cpp
src/fontcache.cpp
src/industry.h
src/industry_cmd.cpp
src/industry_map.h
src/lang/american.txt
src/lang/brazilian_portuguese.txt
src/lang/bulgarian.txt
src/lang/catalan.txt
src/lang/czech.txt
src/lang/danish.txt
src/lang/dutch.txt
src/lang/english.txt
src/lang/esperanto.txt
src/lang/estonian.txt
src/lang/finnish.txt
src/lang/french.txt
src/lang/galician.txt
src/lang/german.txt
src/lang/hungarian.txt
src/lang/icelandic.txt
src/lang/italian.txt
src/lang/japanese.txt
src/lang/korean.txt
src/lang/lithuanian.txt
src/lang/norwegian_bokmal.txt
src/lang/norwegian_nynorsk.txt
src/lang/polish.txt
src/lang/portuguese.txt
src/lang/romanian.txt
src/lang/russian.txt
src/lang/simplified_chinese.txt
src/lang/slovak.txt
src/lang/slovenian.txt
src/lang/spanish.txt
src/lang/swedish.txt
src/lang/traditional_chinese.txt
src/lang/turkish.txt
src/lang/ukrainian.txt
src/lang/unfinished/afrikaans.txt
src/lang/unfinished/croatian.txt
src/lang/unfinished/frisian.txt
src/main_gui.cpp
src/misc/autocopyptr.hpp
src/namegen.h
src/network/network_udp.cpp
src/newgrf.cpp
src/newgrf_callbacks.h
src/newgrf_config.cpp
src/newgrf_config.h
src/newgrf_house.cpp
src/news_gui.cpp
src/openttd.cpp
src/openttd.h
src/players.cpp
src/rail.cpp
src/rail.h
src/rail_cmd.cpp
src/rail_map.h
src/railtypes.h
src/resource.h
src/road.h
src/road_cmd.cpp
src/road_cmd.h
src/road_gui.cpp
src/road_map.cpp
src/road_map.h
src/roadveh.h
src/roadveh_cmd.cpp
src/roadveh_gui.cpp
src/saveload.cpp
src/saveload.h
src/screenshot.cpp
src/screenshot.h
src/sdl.cpp
src/sdl.h
src/settings.cpp
src/settings.h
src/settings_gui.cpp
src/ship.h
src/ship_cmd.cpp
src/ship_gui.cpp
src/signs.cpp
src/signs.h
src/signs_gui.cpp
src/slope.h
src/smallmap_gui.cpp
src/sound.cpp
src/sound.h
src/sprite.h
src/spritecache.cpp
src/spritecache.h
src/station.cpp
src/station.h
src/station_cmd.cpp
src/station_gui.cpp
src/station_map.cpp
src/station_map.h
src/stdafx.h
src/string.cpp
src/string.h
src/strings.cpp
src/strings.h
src/subsidy_gui.cpp
src/table/build_industry.h
src/table/namegen.h
src/table/roadveh.h
src/terraform_gui.cpp
src/texteff.cpp
src/tgp.cpp
src/tgp.h
src/thread.cpp
src/thread.h
src/tile.cpp
src/tile.h
src/town.h
src/town_cmd.cpp
src/town_gui.cpp
src/town_map.h
src/train.h
src/train_cmd.cpp
src/train_gui.cpp
src/transparency_gui.cpp
src/transparency_gui.h
src/tree_cmd.cpp
src/tree_map.h
src/tunnel_map.cpp
src/tunnel_map.h
src/tunnelbridge_cmd.cpp
src/unix.cpp
src/unmovable.h
src/unmovable_cmd.cpp
src/unmovable_map.h
src/variables.h
src/vehicle.cpp
src/vehicle.h
src/vehicle_gui.cpp
src/vehicle_gui.h
src/viewport.cpp
src/viewport.h
src/void_map.h
src/water_cmd.cpp
src/water_map.h
src/waypoint.cpp
src/waypoint.h
src/widget.cpp
src/win32.cpp
src/window.cpp
src/window.h
--- a/projects/openttd.vcproj	Sat Mar 31 12:36:57 2007 +0000
+++ b/projects/openttd.vcproj	Sun Apr 08 14:46:55 2007 +0000
@@ -164,10 +164,10 @@
 				RelativePath=".\..\src\airport.cpp">
 			</File>
 			<File
-				RelativePath=".\..\src\aystar.cpp">
+				RelativePath=".\..\src\autoreplace_cmd.cpp">
 			</File>
 			<File
-				RelativePath=".\..\src\autoreplace_cmd.cpp">
+				RelativePath=".\..\src\aystar.cpp">
 			</File>
 			<File
 				RelativePath=".\..\src\bmp.cpp">
@@ -423,6 +423,9 @@
 				RelativePath=".\..\src\depot.h">
 			</File>
 			<File
+				RelativePath=".\..\src\direction.h">
+			</File>
+			<File
 				RelativePath=".\..\src\music\dmusic.h">
 			</File>
 			<File
@@ -645,6 +648,9 @@
 				RelativePath=".\..\src\train.h">
 			</File>
 			<File
+				RelativePath=".\..\src\transparency_gui.h">
+			</File>
+			<File
 				RelativePath=".\..\src\variables.h">
 			</File>
 			<File
@@ -772,6 +778,9 @@
 				RelativePath=".\..\src\train_gui.cpp">
 			</File>
 			<File
+				RelativePath=".\..\src\transparency_gui.cpp">
+			</File>
+			<File
 				RelativePath=".\..\src\vehicle_gui.cpp">
 			</File>
 		</Filter>
--- a/projects/openttd_vs80.vcproj	Sat Mar 31 12:36:57 2007 +0000
+++ b/projects/openttd_vs80.vcproj	Sun Apr 08 14:46:55 2007 +0000
@@ -448,11 +448,11 @@
 				>
 			</File>
 			<File
-				RelativePath=".\..\src\aystar.cpp"
+				RelativePath=".\..\src\autoreplace_cmd.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\..\src\autoreplace_cmd.cpp"
+				RelativePath=".\..\src\aystar.cpp"
 				>
 			</File>
 			<File
@@ -792,6 +792,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\direction.h"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\music\dmusic.h"
 				>
 			</File>
@@ -1088,6 +1092,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\transparency_gui.h"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\variables.h"
 				>
 			</File>
@@ -1256,6 +1264,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\transparency_gui.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\vehicle_gui.cpp"
 				>
 			</File>
--- a/source.list	Sat Mar 31 12:36:57 2007 +0000
+++ b/source.list	Sun Apr 08 14:46:55 2007 +0000
@@ -1,7 +1,7 @@
 # Source Files
 airport.cpp
+autoreplace_cmd.cpp
 aystar.cpp
-autoreplace_cmd.cpp
 bmp.cpp
 callback_table.cpp
 cargotype.cpp
@@ -108,6 +108,7 @@
 debug.h
 video/dedicated_v.h
 depot.h
+direction.h
 music/dmusic.h
 driver.h
 economy.h
@@ -182,6 +183,7 @@
 tile.h
 town.h
 train.h
+transparency_gui.h
 variables.h
 vehicle.h
 vehicle_gui.h
@@ -225,6 +227,7 @@
 terraform_gui.cpp
 town_gui.cpp
 train_gui.cpp
+transparency_gui.cpp
 vehicle_gui.cpp
 
 # Landscape
--- a/src/aircraft.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/aircraft.h	Sun Apr 08 14:46:55 2007 +0000
@@ -8,11 +8,12 @@
 #include "station_map.h"
 #include "vehicle.h"
 
+/** An aircraft can be one ot those types */
 enum AircraftSubType {
-	AIR_HELICOPTER = 0,
-	AIR_AIRCRAFT   = 2,
-	AIR_SHADOW     = 4,
-	AIR_ROTOR      = 6
+	AIR_HELICOPTER = 0, ///< an helicopter
+	AIR_AIRCRAFT   = 2, ///< an airplane
+	AIR_SHADOW     = 4, ///< shadow of the aircraft
+	AIR_ROTOR      = 6  ///< rotor of an helicopter
 };
 
 
@@ -30,13 +31,20 @@
 	return v->subtype <= AIR_AIRCRAFT;
 }
 
-
+/** Check if this aircraft is in a hangar
+ * @param v vehicle to check
+ * @return true if in hangar
+ */
 static inline bool IsAircraftInHangar(const Vehicle* v)
 {
 	assert(v->type == VEH_AIRCRAFT);
 	return v->vehstatus & VS_HIDDEN && IsHangarTile(v->tile);
 }
 
+/** Check if this aircraft is in a hangar and stopped
+ * @param v vehicle to check
+ * @return true if in hangar and stopped
+ */
 static inline bool IsAircraftInHangarStopped(const Vehicle* v)
 {
 	return IsAircraftInHangar(v) && v->vehstatus & VS_STOPPED;
@@ -56,13 +64,49 @@
 	return (apc->flags & (avi->subtype & AIR_CTOL ? AirportFTAClass::AIRPLANES : AirportFTAClass::HELICOPTERS)) != 0;
 }
 
-uint16 AircraftDefaultCargoCapacity(CargoID cid, const AircraftVehicleInfo*);
+/**
+ * Calculates cargo capacity based on an aircraft's passenger
+ * and mail capacities.
+ * @param cid Which cargo type to calculate a capacity for.
+ * @param avi Which engine to find a cargo capacity for.
+ * @return New cargo capacity value.
+ */
+uint16 AircraftDefaultCargoCapacity(CargoID cid, const AircraftVehicleInfo *avi);
 
+/**
+ * This is the Callback method after the construction attempt of an aircraft
+ * @param success indicates completion (or not) of the operation
+ * @param tile of depot where aircraft is built
+ * @param p1 unused
+ * @param p2 unused
+ */
 void CcBuildAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2);
+
+/**
+ * This is the Callback method after the cloning attempt of an aircraft
+ * @param success indicates completion (or not) of the operation
+ * @param tile unused
+ * @param p1 unused
+ * @param p2 unused
+ */
 void CcCloneAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2);
+
+/** Handle Aircraft specific tasks when a an Aircraft enters a hangar
+ * @param *v Vehicle that enters the hangar
+ */
 void HandleAircraftEnterHangar(Vehicle *v);
+
+/** Get the size of the sprite of an aircraft sprite heading west (used for lists)
+ * @param engine The engine to get the sprite from
+ * @param width The width of the sprite
+ * @param height The height of the sprite
+ */
 void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height);
 
+/**
+ * Updates the status of the Aircraft heading or in the station
+ * @param st Station been updated
+ */
 void UpdateAirplanesOnNewStation(const Station *st);
 
 #endif /* AIRCRAFT_H */
--- a/src/aircraft_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/aircraft_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -174,8 +174,8 @@
 
 /** Get the size of the sprite of an aircraft sprite heading west (used for lists)
  * @param engine The engine to get the sprite from
- * @param &width The width of the sprite
- * @param &height The height of the sprite
+ * @param width The width of the sprite
+ * @param height The height of the sprite
  */
 void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height)
 {
@@ -207,7 +207,7 @@
  * Calculates cargo capacity based on an aircraft's passenger
  * and mail capacities.
  * @param cid Which cargo type to calculate a capacity for.
- * @param engine Which engine to find a cargo capacity for.
+ * @param avi Which engine to find a cargo capacity for.
  * @return New cargo capacity value.
  */
 uint16 AircraftDefaultCargoCapacity(CargoID cid, const AircraftVehicleInfo *avi)
@@ -237,7 +237,7 @@
  */
 int32 CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	if (!IsEngineBuildable(p1, VEH_AIRCRAFT, _current_player)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
+	if (!IsEngineBuildable(p1, VEH_AIRCRAFT, _current_player)) return_cmd_error(STR_AIRCRAFT_NOT_AVAILABLE);
 
 	const AircraftVehicleInfo *avi = AircraftVehInfo(p1);
 	int32 value = EstimateAircraftCost(avi);
@@ -944,6 +944,42 @@
 }
 
 /**
+ * Find the entry point to an airport depending on direction which
+ * the airport is being approached from. Each airport can have up to
+ * four entry points for its approach system so that approaching
+ * aircraft do not fly through each other or are forced to do 180
+ * degree turns during the approach. The arrivals are grouped into
+ * four sectors dependent on the DiagDirection from which the airport
+ * is approached.
+ *
+ * @param v   The vehicle that is approaching the airport
+ * @param apc The Airport Class being approached.
+ * @returns   The index of the entry point
+ */
+static byte AircraftGetEntryPoint(const Vehicle *v, const AirportFTAClass *apc)
+{
+	assert(v != NULL);
+	assert(apc != NULL);
+
+	const Station *st = GetStation(v->u.air.targetairport);
+	/* Make sure we don't go to 0,0 if the airport has been removed. */
+	TileIndex tile = (st->airport_tile != 0) ? st->airport_tile : st->xy;
+
+	int delta_x = v->x_pos - TileX(tile) * TILE_SIZE;
+	int delta_y = v->y_pos - TileY(tile) * TILE_SIZE;
+
+	DiagDirection dir;
+	if (abs(delta_y) < abs(delta_x)) {
+		/* We are northeast or southwest of the airport */
+		dir = delta_x < 0 ? DIAGDIR_NE : DIAGDIR_SW;
+	} else {
+		/* We are northwest or southeast of the airport */
+		dir = delta_y < 0 ? DIAGDIR_NW : DIAGDIR_SE;
+	}
+	return apc->entry_points[dir];
+}
+
+/**
  * Controls the movement of an aircraft. This function actually moves the vehicle
  * on the map and takes care of minor things like sound playback.
  * @todo    De-mystify the cur_speed values for helicopter rotors.
@@ -954,17 +990,24 @@
 {
 	int count;
 	const Station *st = GetStation(v->u.air.targetairport);
+	const AirportFTAClass *afc = st->Airport();
+	const AirportMovingData *amd;
 
 	/* prevent going to 0,0 if airport is deleted. */
 	TileIndex tile = st->airport_tile;
-	if (tile == 0) tile = st->xy;
+	if (tile == 0) {
+		tile = st->xy;
+
+		/* Jump into our "holding pattern" state machine if possible */
+	if (v->u.air.pos >= afc->nofelements) v->u.air.pos = v->u.air.previous_pos = AircraftGetEntryPoint(v, afc);
+	}
+
+	/*  get airport moving data */
+	amd = afc->MovingData(v->u.air.pos);
+
 	int x = TileX(tile) * TILE_SIZE;
 	int y = TileY(tile) * TILE_SIZE;
 
-	/*  get airport moving data */
-	const AirportFTAClass *afc = st->Airport();
-	const AirportMovingData *amd = afc->MovingData(v->u.air.pos);
-
 	/* Helicopter raise */
 	if (amd->flag & AMED_HELI_RAISE) {
 		Vehicle *u = v->next->next;
@@ -1470,42 +1513,6 @@
 	MaybeCrashAirplane(v);
 }
 
-/**
- * Find the entry point to an airport depending on direction which
- * the airport is being approached from. Each airport can have up to
- * four entry points for its approach system so that approaching
- * aircraft do not fly through each other or are forced to do 180
- * degree turns during the approach. The arrivals are grouped into
- * four sectors dependent on the DiagDirection from which the airport
- * is approached.
- *
- * @param v   The vehicle that is approaching the airport
- * @param apc The Airport Class being approached.
- * @returns   The index of the entry point
- */
-static byte AircraftGetEntryPoint(const Vehicle *v, const AirportFTAClass *apc)
-{
-	assert(v != NULL);
-	assert(apc != NULL);
-
-	const Station *st = GetStation(v->u.air.targetairport);
-	/* Make sure we don't go to 0,0 if the airport has been removed. */
-	TileIndex tile = (st->airport_tile != 0) ? st->airport_tile : st->xy;
-
-	int delta_x = v->x_pos - TileX(tile) * TILE_SIZE;
-	int delta_y = v->y_pos - TileY(tile) * TILE_SIZE;
-
-	DiagDirection dir;
-	if (abs(delta_y) < abs(delta_x)) {
-		/* We are northeast or southwest of the airport */
-		dir = delta_x < 0 ? DIAGDIR_NE : DIAGDIR_SW;
-	} else {
-		/* We are northwest or southeast of the airport */
-		dir = delta_y < 0 ? DIAGDIR_NW : DIAGDIR_SE;
-	}
-	return apc->entry_points[dir];
-}
-
 
 /** set the right pos when heading to other airports after takeoff */
 static void AircraftNextAirportPos_and_Order(Vehicle *v)
@@ -1906,9 +1913,9 @@
 }
 
 /**
- * ...
+ * "reserve" a block for the plane
  * @param v airplane that requires the operation
- * @param currentpos of the vehicle in the list of blocks
+ * @param current_pos of the vehicle in the list of blocks
  * @param apc airport on which block is requsted to be set
  * @returns true on success. Eg, next block was free and we have occupied it
  */
@@ -2155,6 +2162,10 @@
 	}
 }
 
+/**
+ * Updates the status of the Aircraft heading or in the station
+ * @param st Station been updated
+ */
 void UpdateAirplanesOnNewStation(const Station *st)
 {
 	/* only 1 station is updated per function call, so it is enough to get entry_point once */
@@ -2165,7 +2176,7 @@
 		if (v->type == VEH_AIRCRAFT && IsNormalAircraft(v)) {
 			if (v->u.air.targetairport == st->index) { // if heading to this airport
 				/* update position of airplane. If plane is not flying, landing, or taking off
-				 *you cannot delete airport, so it doesn't matter */
+				 * you cannot delete airport, so it doesn't matter */
 				if (v->u.air.state >= FLYING) { // circle around
 					v->u.air.pos = v->u.air.previous_pos = AircraftGetEntryPoint(v, ap);
 					v->u.air.state = FLYING;
--- a/src/aircraft_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/aircraft_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -36,6 +36,13 @@
 	}
 }
 
+/**
+ * This is the Callback method after the construction attempt of an aircraft
+ * @param success indicates completion (or not) of the operation
+ * @param tile of depot where aircraft is built
+ * @param p1 unused
+ * @param p2 unused
+ */
 void CcBuildAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2)
 {
 	if (success) {
@@ -49,6 +56,13 @@
 	}
 }
 
+/**
+ * This is the Callback method after the cloning attempt of an aircraft
+ * @param success indicates completion (or not) of the operation
+ * @param tile unused
+ * @param p1 unused
+ * @param p2 unused
+ */
 void CcCloneAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2)
 {
 	if (success) ShowAircraftViewWindow(GetVehicle(_new_vehicle_id));
--- a/src/airport.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/airport.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -20,6 +20,7 @@
  * - false: give a summarized report which only shows current and next position */
 //#define DEBUG_AIRPORT false
 
+static AirportFTAClass *DummyAirport;
 static AirportFTAClass *CountryAirport;
 static AirportFTAClass *CityAirport;
 static AirportFTAClass *Oilrig;
@@ -34,6 +35,20 @@
 
 void InitializeAirports()
 {
+	DummyAirport = new AirportFTAClass(
+		_airport_moving_data_dummy,
+		NULL,
+		NULL,
+		_airport_entries_dummy,
+		AirportFTAClass::ALL,
+		_airport_fta_dummy,
+		NULL,
+		0,
+		0, 0,
+		0,
+		0
+	);
+
 	CountryAirport = new AirportFTAClass(
 		_airport_moving_data_country,
 		_airport_terminal_country,
@@ -463,6 +478,7 @@
 		case AT_HELIDEPOT:     return HeliDepot;
 		case AT_INTERCON:      return IntercontinentalAirport;
 		case AT_HELISTATION:   return HeliStation;
+		case AT_DUMMY:         return DummyAirport;
 	}
 }
 
--- a/src/airport.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/airport.h	Sun Apr 08 14:46:55 2007 +0000
@@ -14,16 +14,17 @@
 
 // Airport types
 enum {
-	AT_SMALL         =  0,
-	AT_LARGE         =  1,
-	AT_HELIPORT      =  2,
-	AT_METROPOLITAN  =  3,
-	AT_INTERNATIONAL =  4,
-	AT_COMMUTER      =  5,
-	AT_HELIDEPOT     =  6,
-	AT_INTERCON      =  7,
-	AT_HELISTATION   =  8,
-	AT_OILRIG        = 15
+	AT_SMALL         =   0,
+	AT_LARGE         =   1,
+	AT_HELIPORT      =   2,
+	AT_METROPOLITAN  =   3,
+	AT_INTERNATIONAL =   4,
+	AT_COMMUTER      =   5,
+	AT_HELIDEPOT     =   6,
+	AT_INTERCON      =   7,
+	AT_HELISTATION   =   8,
+	AT_OILRIG        =  15,
+	AT_DUMMY         = 255
 };
 
 
--- a/src/airport_movement.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/airport_movement.h	Sun Apr 08 14:46:55 2007 +0000
@@ -17,6 +17,14 @@
 
 ///////////////////////////////////////////////////////////////////////
 /////*********Movement Positions on Airports********************///////
+
+static const AirportMovingData _airport_moving_data_dummy[] = {
+	{    0,    0, AMED_NOSPDCLAMP | AMED_SLOWTURN,     {DIR_N} },
+	{    0,   96, AMED_NOSPDCLAMP | AMED_SLOWTURN,     {DIR_N} },
+	{   96,   96, AMED_NOSPDCLAMP | AMED_SLOWTURN,     {DIR_N} },
+	{   96,    0, AMED_NOSPDCLAMP | AMED_SLOWTURN,     {DIR_N} },
+};
+
 // Country Airfield (small) 4x3
 static const AirportMovingData _airport_moving_data_country[22] = {
 	{   53,    3, AMED_EXACTPOS,                   {DIR_SE} }, // 00 In Hangar
@@ -376,6 +384,15 @@
 
 ///////////////////////////////////////////////////////////////////////
 /////**********Movement Machine on Airports*********************///////
+static const byte _airport_entries_dummy[] = {0, 1, 2, 3};
+static const AirportFTAbuildup _airport_fta_dummy[] = {
+	{ 0, 0, 0, 3},
+	{ 1, 0, 0, 0},
+	{ 2, 0, 0, 1},
+	{ 3, 0, 0, 2},
+	{ MAX_ELEMENTS, 0, 0, 0 } // end marker. DO NOT REMOVE
+};
+
 /* First element of terminals array tells us how many depots there are (to know size of array)
  * this may be changed later when airports are moved to external file  */
 static const TileIndexDiffC _airport_depots_country[] = {{3, 0}};
--- a/src/autoreplace_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/autoreplace_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -261,14 +261,14 @@
 
 				/* set wagon/engine button */
 				SetDParam(2, WP(w, replaceveh_d).wagon_btnstate ? STR_ENGINES : STR_WAGONS);
+
+				/* sets the colour of that art thing */
+				w->widget[13].color = _player_colors[_local_player];
+				w->widget[16].color = _player_colors[_local_player];
 			}
 
-			w->widget[13].color = _player_colors[_local_player]; // sets the colour of that art thing
-			w->widget[16].color = _player_colors[_local_player]; // sets the colour of that art thing
-
 			DrawWindowWidgets(w);
 
-
 			if (w->window_number == VEH_TRAIN) {
 				/* Draw the selected railtype in the pulldown menu */
 				RailType railtype = _railtype_selected_in_replace_gui;
--- a/src/bridge_map.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/bridge_map.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,10 +1,11 @@
 /* $Id$ */
 
-/** @file bridge_map.cpp */
+/** @file bridge_map.cpp Map accessor functions for bridges. */
 
 #include "stdafx.h"
 #include "openttd.h"
 #include "bridge_map.h"
+#include "bridge.h"
 #include "variables.h"
 
 
--- a/src/bridge_map.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/bridge_map.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,6 +1,6 @@
 /* $Id$ */
 
-/** @file bridge_map.h */
+/** @file bridge_map.h Map accessor functions for bridges. */
 
 #ifndef BRIDGE_MAP_H
 #define BRIDGE_MAP_H
@@ -13,18 +13,34 @@
 #include "tile.h"
 
 
+/**
+ * Checks if this is a bridge, instead of a tunnel
+ * @param t The tile to analyze
+ * @pre IsTileType(t, MP_TUNNELBRIDGE)
+ * @return true if the structure is a bridge one
+ */
 static inline bool IsBridge(TileIndex t)
 {
 	assert(IsTileType(t, MP_TUNNELBRIDGE));
 	return HASBIT(_m[t].m5, 7);
 }
 
+/**
+ * checks if there is a bridge on this tile
+ * @param t The tile to analyze
+ * @return true if a bridge is present
+ */
 static inline bool IsBridgeTile(TileIndex t)
 {
 	return IsTileType(t, MP_TUNNELBRIDGE) && IsBridge(t);
 }
 
-
+/**
+ * checks for the possibility that a bridge may be on this tile
+ * These are in fact all the tile types on which a bridge can be found
+ * @param t The tile to analyze
+ * @return true if a bridge migh be present
+ */
 static inline bool MayHaveBridgeAbove(TileIndex t)
 {
 	return
@@ -36,7 +52,12 @@
 		IsTileType(t, MP_UNMOVABLE);
 }
 
-
+/**
+ * checks if a bridge is set above the ground of this tile
+ * @param t The tile to analyze
+ * @pre MayHaveBridgeAbove(t)
+ * @return true if a bridge is detected above
+ */
 static inline bool IsBridgeAbove(TileIndex t)
 {
 	assert(MayHaveBridgeAbove(t));
@@ -46,7 +67,8 @@
 
 /**
  * Determines the type of bridge on a tile
- * @param tile The tile to analyze
+ * @param t The tile to analyze
+ * @pre IsBridgeTile(t)
  * @return The bridge type
  */
 static inline uint GetBridgeType(TileIndex t)
@@ -58,7 +80,8 @@
 
 /**
  * Get the direction pointing onto the bridge
- * @param tile The tile to analyze
+ * @param t The tile to analyze
+ * @pre IsBridgeTile(t)
  * @return the above mentionned direction
  */
 static inline DiagDirection GetBridgeRampDirection(TileIndex t)
@@ -68,6 +91,12 @@
 }
 
 
+/**
+ * Get the axis of the bridge that goes over the tile. Not the axis or the ramp.
+ * @param t The tile to analyze
+ * @pre IsBridgeAbove(t)
+ * @return the above mentioned axis
+ */
 static inline Axis GetBridgeAxis(TileIndex t)
 {
 	assert(IsBridgeAbove(t));
@@ -75,6 +104,12 @@
 }
 
 
+/**
+ * Get the transport type of the bridge's ramp.
+ * @param t The ramp tile to analyze
+ * @pre IsBridgeTile(t)
+ * @return the transport type of the bridge
+ */
 static inline TransportType GetBridgeTransportType(TileIndex t)
 {
 	assert(IsBridgeTile(t));
@@ -82,6 +117,12 @@
 }
 
 
+/**
+ * Does the bridge ramp lie in a snow or desert area?
+ * @param t The ramp tile to analyze
+ * @pre IsBridgeTile(t)
+ * @return true if and only if in a snow or desert area
+ */
 static inline bool HasBridgeSnowOrDesert(TileIndex t)
 {
 	assert(IsBridgeTile(t));
@@ -89,6 +130,12 @@
 }
 
 
+/**
+ * Sets whether the bridge ramp lies in a snow or desert area.
+ * @param t              The ramp tile to set (un)make a snow/desert area
+ * @param snow_or_desert Make (true) or unmake the tile a snow/desert area
+ * @pre IsBridgeTile(t)
+ */
 static inline void SetBridgeSnowOrDesert(TileIndex t, bool snow_or_desert)
 {
 	assert(IsBridgeTile(t));
@@ -97,28 +144,43 @@
 
 /**
  * Finds the end of a bridge in the specified direction starting at a middle tile
+ * @param t the bridge tile to find the bridge ramp for
+ * @param d the direction to search in
  */
-TileIndex GetBridgeEnd(TileIndex, DiagDirection);
+TileIndex GetBridgeEnd(TileIndex t, DiagDirection d);
 
 /**
  * Finds the northern end of a bridge starting at a middle tile
+ * @param t the bridge tile to find the bridge ramp for
  */
 TileIndex GetNorthernBridgeEnd(TileIndex t);
 
 /**
  * Finds the southern end of a bridge starting at a middle tile
+ * @param t the bridge tile to find the bridge ramp for
  */
 TileIndex GetSouthernBridgeEnd(TileIndex t);
 
 
 /**
  * Starting at one bridge end finds the other bridge end
+ * @param t the bridge ramp tile to find the other bridge ramp for
  */
-TileIndex GetOtherBridgeEnd(TileIndex);
+TileIndex GetOtherBridgeEnd(TileIndex t);
 
+/**
+ * Get the height ('z') of a bridge in pixels.
+ * @param tile the bridge ramp tile to get the bridge height from
+ * @return the height of the bridge in pixels
+ */
 uint GetBridgeHeight(TileIndex tile);
-uint GetBridgeFoundation(Slope tileh, Axis axis);
 
+/**
+ * Remove the bridge over the given axis.
+ * @param t the tile to remove the bridge from
+ * @param a the axis of the bridge to remove
+ * @pre MayHaveBridgeAbove(t)
+ */
 static inline void ClearSingleBridgeMiddle(TileIndex t, Axis a)
 {
 	assert(MayHaveBridgeAbove(t));
@@ -126,12 +188,23 @@
 }
 
 
+/**
+ * Removes bridges from the given, that is bridges along the X and Y axis.
+ * @param t the tile to remove the bridge from
+ * @pre MayHaveBridgeAbove(t)
+ */
 static inline void ClearBridgeMiddle(TileIndex t)
 {
 	ClearSingleBridgeMiddle(t, AXIS_X);
 	ClearSingleBridgeMiddle(t, AXIS_Y);
 }
 
+/**
+ * Set that there is a bridge over the given axis.
+ * @param t the tile to add the bridge to
+ * @param a the axis of the bridge to add
+ * @pre MayHaveBridgeAbove(t)
+ */
 static inline void SetBridgeMiddle(TileIndex t, Axis a)
 {
 	assert(MayHaveBridgeAbove(t));
@@ -139,6 +212,15 @@
 }
 
 
+/**
+ * Generic part to make a bridge ramp for both roads and rails.
+ * @param t          the tile to make a bridge ramp
+ * @param o          the new owner of the bridge ramp
+ * @param bridgetype the type of bridge this bridge ramp belongs to
+ * @param d          the direction this ramp must be facing
+ * @param tt         the transport type of the bridge
+ * @note this function should not be called directly.
+ */
 static inline void MakeBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, TransportType tt)
 {
 	SetTileType(t, MP_TUNNELBRIDGE);
@@ -148,12 +230,27 @@
 	_m[t].m5 = 1 << 7 | tt << 2 | d;
 }
 
+/**
+ * Make a bridge ramp for roads.
+ * @param t          the tile to make a bridge ramp
+ * @param o          the new owner of the bridge ramp
+ * @param bridgetype the type of bridge this bridge ramp belongs to
+ * @param d          the direction this ramp must be facing
+ */
 static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d)
 {
 	MakeBridgeRamp(t, o, bridgetype, d, TRANSPORT_ROAD);
 	_m[t].m3 = 0;
 }
 
+/**
+ * Make a bridge ramp for rails.
+ * @param t          the tile to make a bridge ramp
+ * @param o          the new owner of the bridge ramp
+ * @param bridgetype the type of bridge this bridge ramp belongs to
+ * @param d          the direction this ramp must be facing
+ * @param r          the rail type of the bridge
+ */
 static inline void MakeRailBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, RailType r)
 {
 	MakeBridgeRamp(t, o, bridgetype, d, TRANSPORT_RAIL);
--- a/src/clear_map.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/clear_map.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,6 +1,6 @@
 /* $Id$ */
 
-/** @file clear_map.h */
+/** @file clear_map.h Map accessors for 'clear' tiles */
 
 #ifndef CLEAR_MAP_H
 #define CLEAR_MAP_H
@@ -9,8 +9,8 @@
 #include "tile.h"
 #include "bridge_map.h"
 
-/* ground type, m5 bits 2...4
- * valid densities (bits 0...1) in comments after the enum
+/**
+ * Ground types. Valid densities in comments after the enum.
  */
 enum ClearGround {
 	CLEAR_GRASS  = 0, ///< 0-3
@@ -22,24 +22,48 @@
 };
 
 
+/**
+ * Get the type of clear tile.
+ * @param t the tile to get the clear ground type of
+ * @pre IsTileType(t, MP_CLEAR)
+ * @return the ground type
+ */
 static inline ClearGround GetClearGround(TileIndex t)
 {
 	assert(IsTileType(t, MP_CLEAR));
 	return (ClearGround)GB(_m[t].m5, 2, 3);
 }
 
+/**
+ * Set the type of clear tile.
+ * @param t  the tile to set the clear ground type of
+ * @param ct the ground type
+ * @pre IsTileType(t, MP_CLEAR)
+ */
 static inline bool IsClearGround(TileIndex t, ClearGround ct)
 {
 	return GetClearGround(t) == ct;
 }
 
 
+/**
+ * Get the density of a non-field clear tile.
+ * @param t the tile to get the density of
+ * @pre IsTileType(t, MP_CLEAR)
+ * @return the density
+ */
 static inline uint GetClearDensity(TileIndex t)
 {
 	assert(IsTileType(t, MP_CLEAR));
 	return GB(_m[t].m5, 0, 2);
 }
 
+/**
+ * Increment the density of a non-field clear tile.
+ * @param t the tile to increment the density of
+ * @param d the amount to increment the density with
+ * @pre IsTileType(t, MP_CLEAR)
+ */
 static inline void AddClearDensity(TileIndex t, int d)
 {
 	assert(IsTileType(t, MP_CLEAR)); // XXX incomplete
@@ -47,18 +71,36 @@
 }
 
 
+/**
+ * Get the counter used to advance to the next clear density/field type.
+ * @param t the tile to get the counter of
+ * @pre IsTileType(t, MP_CLEAR)
+ * @return the value of the counter
+ */
 static inline uint GetClearCounter(TileIndex t)
 {
 	assert(IsTileType(t, MP_CLEAR));
 	return GB(_m[t].m5, 5, 3);
 }
 
+/**
+ * Increments the counter used to advance to the next clear density/field type.
+ * @param t the tile to increment the counter of
+ * @param c the amount to increment the counter with
+ * @pre IsTileType(t, MP_CLEAR)
+ */
 static inline void AddClearCounter(TileIndex t, int c)
 {
 	assert(IsTileType(t, MP_CLEAR)); // XXX incomplete
 	_m[t].m5 += c << 5;
 }
 
+/**
+ * Sets the counter used to advance to the next clear density/field type.
+ * @param t the tile to set the counter of
+ * @param c the amount to set the counter to
+ * @pre IsTileType(t, MP_CLEAR)
+ */
 static inline void SetClearCounter(TileIndex t, uint c)
 {
 	assert(IsTileType(t, MP_CLEAR)); // XXX incomplete
@@ -66,7 +108,13 @@
 }
 
 
-/* Sets type and density in one go, also sets the counter to 0 */
+/**
+ * Sets ground type and density in one go, also sets the counter to 0
+ * @param t       the tile to set the ground type and density for
+ * @param type    the new ground type of the tile
+ * @param density the density of the ground tile
+ * @pre IsTileType(t, MP_CLEAR)
+ */
 static inline void SetClearGroundDensity(TileIndex t, ClearGround type, uint density)
 {
 	assert(IsTileType(t, MP_CLEAR)); // XXX incomplete
@@ -74,49 +122,99 @@
 }
 
 
+/**
+ * Get the field type (production stage) of the field
+ * @param t the field to get the type of
+ * @pre GetClearGround(t) == CLEAR_FIELDS
+ * @return the field type
+ */
 static inline uint GetFieldType(TileIndex t)
 {
 	assert(GetClearGround(t) == CLEAR_FIELDS);
 	return GB(_m[t].m3, 0, 4);
 }
 
+/**
+ * Set the field type (production stage) of the field
+ * @param t the field to get the type of
+ * @param f the field type
+ * @pre GetClearGround(t) == CLEAR_FIELDS
+ */
 static inline void SetFieldType(TileIndex t, uint f)
 {
 	assert(GetClearGround(t) == CLEAR_FIELDS); // XXX incomplete
 	SB(_m[t].m3, 0, 4, f);
 }
 
-static inline uint16 GetIndustryIndexOfField(TileIndex t)
+/**
+ * Get the industry (farm) that made the field
+ * @param t the field to get creating industry of
+ * @pre GetClearGround(t) == CLEAR_FIELDS
+ * @return the industry that made the field
+ */
+static inline IndustryID GetIndustryIndexOfField(TileIndex t)
 {
 	assert(GetClearGround(t) == CLEAR_FIELDS);
-	return _m[t].m2;
+	return(IndustryID) _m[t].m2;
 }
 
-static inline void SetIndustryIndexOfField(TileIndex t, uint16 i)
+/**
+ * Set the industry (farm) that made the field
+ * @param t the field to get creating industry of
+ * @param i the industry that made the field
+ * @pre GetClearGround(t) == CLEAR_FIELDS
+ */
+static inline void SetIndustryIndexOfField(TileIndex t, IndustryID i)
 {
 	assert(GetClearGround(t) == CLEAR_FIELDS);
 	_m[t].m2 = i;
 }
 
-/* Is used by tree tiles, too */
+
+/**
+ * Is there a fence at the south eastern border?
+ * @param t the tile to check for fences
+ * @pre IsTileType(t, MP_CLEAR) || IsTileType(t, MP_TREES)
+ * @return 0 if there is no fence, otherwise the fence type
+ */
 static inline uint GetFenceSE(TileIndex t)
 {
 	assert(IsTileType(t, MP_CLEAR) || IsTileType(t, MP_TREES));
 	return GB(_m[t].m4, 2, 3);
 }
 
+/**
+ * Sets the type of fence (and whether there is one) for the south
+ * eastern border.
+ * @param t the tile to check for fences
+ * @param h 0 if there is no fence, otherwise the fence type
+ * @pre IsTileType(t, MP_CLEAR) || IsTileType(t, MP_TREES)
+ */
 static inline void SetFenceSE(TileIndex t, uint h)
 {
 	assert(IsTileType(t, MP_CLEAR) || IsTileType(t, MP_TREES)); // XXX incomplete
 	SB(_m[t].m4, 2, 3, h);
 }
 
+/**
+ * Is there a fence at the south western border?
+ * @param t the tile to check for fences
+ * @pre IsTileType(t, MP_CLEAR) || IsTileType(t, MP_TREES)
+ * @return 0 if there is no fence, otherwise the fence type
+ */
 static inline uint GetFenceSW(TileIndex t)
 {
 	assert(IsTileType(t, MP_CLEAR) || IsTileType(t, MP_TREES));
 	return GB(_m[t].m4, 5, 3);
 }
 
+/**
+ * Sets the type of fence (and whether there is one) for the south
+ * western border.
+ * @param t the tile to check for fences
+ * @param h 0 if there is no fence, otherwise the fence type
+ * @pre IsTileType(t, MP_CLEAR) || IsTileType(t, MP_TREES)
+ */
 static inline void SetFenceSW(TileIndex t, uint h)
 {
 	assert(IsTileType(t, MP_CLEAR) || IsTileType(t, MP_TREES)); // XXX incomplete
@@ -124,6 +222,12 @@
 }
 
 
+/**
+ * Make a clear tile.
+ * @param t       the tile to make a clear tile
+ * @param g       the type of ground
+ * @param density the density of the grass/snow/desert etc
+ */
 static inline void MakeClear(TileIndex t, ClearGround g, uint density)
 {
 	/* If this is a non-bridgeable tile, clear the bridge bits while the rest
@@ -140,7 +244,13 @@
 }
 
 
-static inline void MakeField(TileIndex t, uint field_type, uint16 industry)
+/**
+ * Make a (farm) field tile.
+ * @param t          the tile to make a farm field
+ * @param field_type the 'growth' level of the field
+ * @param industry   the industry this tile belongs to
+ */
+static inline void MakeField(TileIndex t, uint field_type, IndustryID industry)
 {
 	SetTileType(t, MP_CLEAR);
 	SetTileOwner(t, OWNER_NONE);
--- a/src/command.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/command.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -455,13 +455,17 @@
 	 * restrictions which may cause the test run to fail (the previous
 	 * road fragments still stay there and the town won't let you
 	 * disconnect the road system), but the exec will succeed and this
-	 * fact will trigger an assertion failure. --pasky */
+	 * fact will trigger an assertion failure. --pasky
+	 * CMD_CLONE_VEHICLE: You can only refit vehicles once they have been
+	 * bought, so you can't estimate the cost of cloning if the vehicle to be
+	 * cloned has been refitted. */
 	notest =
 		(cmd & 0xFF) == CMD_CLEAR_AREA ||
 		(cmd & 0xFF) == CMD_CONVERT_RAIL ||
 		(cmd & 0xFF) == CMD_LEVEL_LAND ||
 		(cmd & 0xFF) == CMD_REMOVE_ROAD ||
-		(cmd & 0xFF) == CMD_REMOVE_LONG_ROAD;
+		(cmd & 0xFF) == CMD_REMOVE_LONG_ROAD ||
+		(cmd & 0xFF) == CMD_CLONE_VEHICLE;
 
 	_docommand_recursive = 1;
 
--- a/src/console.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/console.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -411,7 +411,7 @@
 /**
  * Handle the printing of text entered into the console or redirected there
  * by any other means. Uses printf() style format, for more information look
- * at @IConsolePrint()
+ * at IConsolePrint()
  */
 void CDECL IConsolePrintF(uint16 color_code, const char *s, ...)
 {
@@ -428,7 +428,7 @@
 /**
  * It is possible to print debugging information to the console,
  * which is achieved by using this function. Can only be used by
- * @debug() in debug.c. You need at least a level 2 (developer) for debugging
+ * debug() in debug.cpp. You need at least a level 2 (developer) for debugging
  * messages to show up
  * @param dbg debugging category
  * @param string debugging message
@@ -489,7 +489,7 @@
 
 /**
  * General internal hooking code that is the same for both commands and variables
- * @param hooks @IConsoleHooks structure that will be set according to
+ * @param hooks IConsoleHooks structure that will be set according to
  * @param type type access trigger
  * @param proc function called when the hook criteria is met
  */
@@ -514,7 +514,7 @@
 /**
  * Handle any special hook triggers. If the hook type is met check if
  * there is a function associated with that and if so, execute it
- * @param hooks @IConsoleHooks structure that will be checked
+ * @param hooks IConsoleHooks structure that will be checked
  * @param type type of hook, trigger that needs to be activated
  * @return true on a successfull execution of the hook command or if there
  * is no hook/trigger present at all. False otherwise
@@ -767,8 +767,11 @@
 /**
  * Special function for adding string-type variables. They in addition
  * also need a 'size' value saying how long their string buffer is.
+ * @param name name of the variable that will be used
+ * @param addr memory location the variable will point to
  * @param size the length of the string buffer
- * For more information see @IConsoleVarRegister()
+ * @param help the help string shown for the variable
+ * For more information see IConsoleVarRegister()
  */
 void IConsoleVarStringRegister(const char *name, void *addr, uint32 size, const char *help)
 {
--- a/src/console_cmds.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/console_cmds.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1416,6 +1416,19 @@
 	return true;
 }
 
+DEF_CONSOLE_CMD(ConListPatches)
+{
+	if (argc == 0) {
+		IConsoleHelp("List patch options. Usage: 'list_patches'");
+		return true;
+	}
+
+	if (argc != 1) return false;
+
+	IConsoleListPatches();
+	return true;
+}
+
 DEF_CONSOLE_CMD(ConListDumpVariables)
 {
 	const IConsoleVar *var;
@@ -1497,6 +1510,7 @@
 	IConsoleCmdRegister("pwd",          ConPrintWorkingDirectory);
 	IConsoleCmdRegister("clear",        ConClearBuffer);
 	IConsoleCmdRegister("patch",        ConPatch);
+	IConsoleCmdRegister("list_patches", ConListPatches);
 
 	IConsoleAliasRegister("dir",      "ls");
 	IConsoleAliasRegister("del",      "rm %+");
--- a/src/dedicated.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/dedicated.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -63,6 +63,7 @@
 
 #else
 
+/** Empty helper function call for NOT(UNIX and not MORPHOS) systems */
 void DedicatedFork() {}
 
 #endif /* ENABLE_NETWORK */
--- a/src/depot_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/depot_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -176,7 +176,7 @@
 
 	switch (v->type) {
 		case VEH_TRAIN:
-			DrawTrainImage(v, x + 21, sprite_y, w->widget[DEPOT_WIDGET_MATRIX].right - 32, w->hscroll.pos, WP(w,depot_d).sel);
+			DrawTrainImage(v, x + 21, sprite_y, w->hscroll.cap + 4, w->hscroll.pos, WP(w,depot_d).sel);
 
 			/* Number of wagons relative to a standard length wagon (rounded up) */
 			SetDParam(0, (v->u.rail.cached_total_length + 7) / 8);
@@ -638,7 +638,7 @@
 /* Array to hold the default resize capacities
 * First part is the vehicle type, while the last is 0 = x, 1 = y */
 const uint _resize_cap[][2] = {
-/* VEH_TRAIN */    {6, 10 * 29 + 36}, ///< flags, unitnumber and unit count uses a total of 36 pixels and we set default to 10 units
+/* VEH_TRAIN */    {6, 10 * 29},
 /* VEH_ROAD */     {5, 5},
 /* VEH_SHIP */     {3, 3},
 /* VEH_AIRCRAFT */ {3, 4},
@@ -719,8 +719,9 @@
 				 _block_sizes[type][1] * w->vscroll.cap);
 
 	if (type == VEH_TRAIN) {
-		/* The train depot has a horizontal scroller so we should make room for it */
-		ResizeWindow(w, 0, 12);
+		/* Make space for the horizontal scrollbar vertically, and the unit
+		 * number, flag, and length counter horizontally. */
+		ResizeWindow(w, 36, 12);
 		/* substract the newly added space from the matrix since it was meant for the scrollbar */
 		w->widget[DEPOT_WIDGET_MATRIX].bottom -= 12;
 	}
--- a/src/direction.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/direction.h	Sun Apr 08 14:46:55 2007 +0000
@@ -24,7 +24,7 @@
 
 /** Define basic enum properties */
 template <> struct EnumPropsT<Direction> : MakeEnumPropsT<Direction, byte, DIR_BEGIN, DIR_END, INVALID_DIR> {};
-typedef TinyEnumT<Direction> DirectionByte;
+typedef TinyEnumT<Direction> DirectionByte; //typedefing-enumification of Direction
 
 static inline Direction ReverseDir(Direction d)
 {
@@ -73,7 +73,7 @@
 
 /** Define basic enum properties */
 template <> struct EnumPropsT<DiagDirection> : MakeEnumPropsT<DiagDirection, byte, DIAGDIR_BEGIN, DIAGDIR_END, INVALID_DIAGDIR> {};
-typedef TinyEnumT<DiagDirection> DiagDirectionByte;
+typedef TinyEnumT<DiagDirection> DiagDirectionByte; //typedefing-enumification of DiagDirection
 
 static inline DiagDirection ReverseDiagDir(DiagDirection d)
 {
@@ -137,7 +137,9 @@
 
 /**
  * Convert an axis and a flag for north/south into a DiagDirection
+ * @param xy axis to convert
  * @param ns north -> 0, south -> 1
+ * @return the desired DiagDirection
  */
 static inline DiagDirection XYNSToDiagDir(Axis xy, uint ns)
 {
--- a/src/disaster_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/disaster_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -459,7 +459,7 @@
 		ind = GetIndustryIndex(tile);
 		v->dest_tile = ind;
 
-		if (GetIndustry(ind)->type == IT_OIL_REFINERY) {
+		if (GetIndustrySpec(GetIndustry(ind)->type)->behaviour & INDUSTRYBEH_AIRPLANE_ATTACKS) {
 			v->current_order.dest = 1;
 			v->age = 0;
 		}
@@ -532,7 +532,7 @@
 		ind = GetIndustryIndex(tile);
 		v->dest_tile = ind;
 
-		if (GetIndustry(ind)->type == IT_FACTORY) {
+		if (GetIndustrySpec(GetIndustry(ind)->type)->behaviour & INDUSTRYBEH_CHOPPER_ATTACKS) {
 			v->current_order.dest = 1;
 			v->age = 0;
 		}
@@ -828,7 +828,7 @@
 	found = NULL;
 
 	FOR_ALL_INDUSTRIES(i) {
-		if (i->type == IT_OIL_REFINERY &&
+		if ((GetIndustrySpec(i->type)->behaviour & INDUSTRYBEH_AIRPLANE_ATTACKS) &&
 				(found == NULL || CHANCE16(1, 2))) {
 			found = i;
 		}
@@ -864,7 +864,7 @@
 	found = NULL;
 
 	FOR_ALL_INDUSTRIES(i) {
-		if (i->type == IT_FACTORY &&
+		if ((GetIndustrySpec(i->type)->behaviour & INDUSTRYBEH_CHOPPER_ATTACKS) &&
 				(found == NULL || CHANCE16(1, 2))) {
 			found = i;
 		}
@@ -982,7 +982,7 @@
 		const Industry *i;
 
 		FOR_ALL_INDUSTRIES(i) {
-			if (i->type == IT_COAL_MINE && --index < 0) {
+			if ((GetIndustrySpec(i->type)->behaviour & INDUSTRYBEH_CAN_SUBSIDENCE) && --index < 0) {
 				SetDParam(0, i->town->index);
 				AddNewsItem(STR_B005_COAL_MINE_SUBSIDENCE_LEAVES,
 					NEWS_FLAGS(NM_THIN,NF_VIEWPORT|NF_TILE,NT_ACCIDENT,0), i->xy + TileDiffXY(1, 1), 0);
--- a/src/economy.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/economy.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -254,6 +254,41 @@
 {
 	Town *t;
 	PlayerID old = _current_player;
+
+	assert(old_player != new_player);
+
+	{
+		Player *p;
+		uint i;
+
+		/* See if the old_player had shares in other companies */
+		_current_player = old_player;
+		FOR_ALL_PLAYERS(p) {
+			for (i = 0; i < 4; i++) {
+				if (p->share_owners[i] == old_player) {
+					/* Sell his shares */
+					int32 res = DoCommand(0, p->index, 0, DC_EXEC, CMD_SELL_SHARE_IN_COMPANY);
+					/* Because we are in a DoCommand, we can't just execute an other one and
+					 *  expect the money to be removed. We need to do it ourself! */
+					SubtractMoneyFromPlayer(res);
+				}
+			}
+		}
+
+		/* Sell all the shares that people have on this company */
+		p = GetPlayer(old_player);
+		for (i = 0; i < 4; i++) {
+			_current_player = p->share_owners[i];
+			if (_current_player != PLAYER_SPECTATOR) {
+				/* Sell the shares */
+				int32 res = DoCommand(0, old_player, 0, DC_EXEC, CMD_SELL_SHARE_IN_COMPANY);
+				/* Because we are in a DoCommand, we can't just execute an other one and
+				 *  expect the money to be removed. We need to do it ourself! */
+				SubtractMoneyFromPlayer(res);
+			}
+		}
+	}
+
 	_current_player = old_player;
 
 	/* Temporarily increase the player's money, to be sure that
@@ -346,25 +381,6 @@
 	/* Change color of existing windows */
 	if (new_player != PLAYER_SPECTATOR) ChangeWindowOwner(old_player, new_player);
 
-	{
-		Player *p;
-		uint i;
-
-		/* Check for shares */
-		FOR_ALL_PLAYERS(p) {
-			for (i = 0; i < 4; i++) {
-				/* 'Sell' the share if this player has any */
-				if (p->share_owners[i] == _current_player) {
-					p->share_owners[i] = PLAYER_SPECTATOR;
-				}
-			}
-		}
-		p = GetPlayer(_current_player);
-		/* Sell all the shares that people have on this company */
-		for (i = 0; i < 4; i++)
-			p->share_owners[i] = PLAYER_SPECTATOR;
-	}
-
 	_current_player = old;
 
 	MarkWholeScreenDirty();
@@ -1673,6 +1689,7 @@
 
 /** Acquire shares in an opposing company.
  * @param tile unused
+ * @param flags type of operation
  * @param p1 player to buy the shares from
  * @param p2 unused
  */
@@ -1718,6 +1735,7 @@
 
 /** Sell shares in an opposing company.
  * @param tile unused
+ * @param flags type of operation
  * @param p1 player to sell the shares from
  * @param p2 unused
  */
@@ -1753,18 +1771,23 @@
  * that company.
  * @todo currently this only works for AI players
  * @param tile unused
+ * @param flags type of operation
  * @param p1 player/company to buy up
  * @param p2 unused
  */
 int32 CmdBuyCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	Player *p;
+	PlayerID pid = (PlayerID)p1;
 
 	/* Disable takeovers in multiplayer games */
-	if (!IsValidPlayer((PlayerID)p1) || _networking) return CMD_ERROR;
+	if (!IsValidPlayer(pid) || _networking) return CMD_ERROR;
+
+	/* Do not allow players to take over themselves */
+	if (pid == _current_player) return CMD_ERROR;
 
 	SET_EXPENSES_TYPE(EXPENSES_OTHER);
-	p = GetPlayer((PlayerID)p1);
+	p = GetPlayer(pid);
 
 	if (!p->is_ai) return CMD_ERROR;
 
--- a/src/elrail.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/elrail.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -269,7 +269,14 @@
 						continue; /* No neighbour, go looking for a better position */
 					}
 
-					AddSortableSpriteToDraw(pylons_normal[temp], PAL_NONE, x, y, 1, 1, 10,
+					SpriteID img = pylons_normal[temp];
+					SpriteID pal = PAL_NONE;
+					if (_transparent_opt & TO_BUILDINGS) {
+						SETBIT(img, PALETTE_MODIFIER_TRANSPARENT);
+						pal = PALETTE_TO_TRANSPARENT;
+					}
+
+					AddSortableSpriteToDraw(img, pal, x, y, 1, 1, 10,
 							GetSlopeZ(ti->x + x_pcp_offsets[i], ti->y + y_pcp_offsets[i]));
 					break; /* We already have drawn a pylon, bail out */
 				}
@@ -278,7 +285,7 @@
 	}
 
 	/* Don't draw a wire under a low bridge */
-	if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile) && !(_display_opt & DO_TRANS_BUILDINGS)) {
+	if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile) && !(_transparent_opt & TO_BUILDINGS)) {
 		uint height = GetBridgeHeight(GetNorthernBridgeEnd(ti->tile));
 
 		if (height <= TilePixelHeight(ti->tile) + TILE_HEIGHT) return;
@@ -307,7 +314,14 @@
 			assert(!IsSteepSlope(tileh[TS_HOME]));
 			sss = &CatenarySpriteData[Wires[tileh_selector][t][PCPconfig]];
 
-			AddSortableSpriteToDraw( sss->image, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset,
+			SpriteID img = sss->image;
+			SpriteID pal = PAL_NONE;
+			if (HASBIT(_transparent_opt, TO_BUILDINGS)) {
+				SETBIT(img, PALETTE_MODIFIER_TRANSPARENT);
+				pal = PALETTE_TO_TRANSPARENT;
+			}
+
+			AddSortableSpriteToDraw(img, pal, ti->x + sss->x_offset, ti->y + sss->y_offset,
 				sss->x_size, sss->y_size, sss->z_size, GetSlopeZ(ti->x + min(sss->x_offset, TILE_SIZE - 1), ti->y + min(sss->y_offset, TILE_SIZE - 1)) + sss->z_offset);
 		}
 	}
@@ -339,7 +353,14 @@
 
 	height = GetBridgeHeight(end);
 
-	AddSortableSpriteToDraw( sss->image, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset,
+	SpriteID img = sss->image;
+	SpriteID pal = PAL_NONE;
+	if (HASBIT(_transparent_opt, TO_BUILDINGS)) {
+		SETBIT(img, PALETTE_MODIFIER_TRANSPARENT);
+		pal = PALETTE_TO_TRANSPARENT;
+	}
+
+	AddSortableSpriteToDraw(img, pal, ti->x + sss->x_offset, ti->y + sss->y_offset,
 		sss->x_size, sss->y_size, sss->z_size, height + sss->z_offset
 	);
 
@@ -347,18 +368,26 @@
 	/* every other tile needs a pylon on the northern end */
 	if (num % 2) {
 		if (axis == AXIS_X) {
-			AddSortableSpriteToDraw(pylons_bridge[0 + HASBIT(tlg, 0)], PAL_NONE, ti->x, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, height);
+			img = pylons_bridge[0 + HASBIT(tlg, 0)];
+			if (HASBIT(_transparent_opt, TO_BUILDINGS)) SETBIT(img, PALETTE_MODIFIER_TRANSPARENT);
+			AddSortableSpriteToDraw(img, pal, ti->x, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, height);
 		} else {
-			AddSortableSpriteToDraw(pylons_bridge[2 + HASBIT(tlg, 1)], PAL_NONE, ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y, 1, 1, 10, height);
+			img = pylons_bridge[2 + HASBIT(tlg, 1)];
+			if (HASBIT(_transparent_opt, TO_BUILDINGS)) SETBIT(img, PALETTE_MODIFIER_TRANSPARENT);
+			AddSortableSpriteToDraw(img, pal, ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y, 1, 1, 10, height);
 		}
 	}
 
 	/* need a pylon on the southern end of the bridge */
 	if (DistanceMax(ti->tile, start) == length) {
 		if (axis == AXIS_X) {
-			AddSortableSpriteToDraw(pylons_bridge[0 + HASBIT(tlg, 0)], PAL_NONE, ti->x + 16, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, height);
+			img = pylons_bridge[0 + HASBIT(tlg, 0)];
+			if (HASBIT(_transparent_opt, TO_BUILDINGS)) SETBIT(img, PALETTE_MODIFIER_TRANSPARENT);
+			AddSortableSpriteToDraw(img, pal, ti->x + 16, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, height);
 		} else {
-			AddSortableSpriteToDraw(pylons_bridge[2 + HASBIT(tlg, 1)], PAL_NONE, ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y + 16, 1, 1, 10, height);
+			img = pylons_bridge[2 + HASBIT(tlg, 1)];
+			if (HASBIT(_transparent_opt, TO_BUILDINGS)) SETBIT(img, PALETTE_MODIFIER_TRANSPARENT);
+			AddSortableSpriteToDraw(img, pal, ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y + 16, 1, 1, 10, height);
 		}
 	}
 }
@@ -379,8 +408,15 @@
 			if (IsRailDepot(ti->tile)) {
 				const SortableSpriteStruct *sss = &CatenarySpriteData_Depot[GetRailDepotDirection(ti->tile)];
 
+				SpriteID img = sss->image;
+				SpriteID pal = PAL_NONE;
+				if (HASBIT(_transparent_opt, TO_BUILDINGS)) {
+					SETBIT(img, PALETTE_MODIFIER_TRANSPARENT);
+					pal = PALETTE_TO_TRANSPARENT;
+				}
+
 				AddSortableSpriteToDraw(
-					sss->image, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset,
+					img, pal, ti->x + sss->x_offset, ti->y + sss->y_offset,
 					sss->x_size, sss->y_size, sss->z_size,
 					GetTileMaxZ(ti->tile) + sss->z_offset
 				);
--- a/src/endian_check.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/endian_check.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -12,6 +12,10 @@
 #include <stdio.h>
 #include <string.h>
 
+/** Main call of the endian_check program
+ * @param argc argument count
+ * @param argv arguments themselves
+ * @return exit code */
 int main (int argc, char *argv[]) {
 	unsigned char EndianTest[2] = { 1, 0 };
 	int force_BE = 0, force_LE = 0, force_PREPROCESSOR = 0;
--- a/src/fileio.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/fileio.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -170,7 +170,7 @@
 	FioFreeHandle();
 #endif /* LIMITED_FDS */
 	f = FioFOpenFile(filename);
-	if (f == NULL) error("Cannot open file '%s%s'", _paths.data_dir, filename);
+	if (f == NULL) error("Cannot open file '%s'", filename);
 
 	FioCloseFile(slot); // if file was opened before, close it
 	_fio.handles[slot] = f;
@@ -206,12 +206,16 @@
 	FILE *f;
 	char buf[MAX_PATH];
 
-	snprintf(buf, lengthof(buf), "%s%s", _paths.data_dir, filename);
+	if (strrchr(filename, PATHSEPCHAR) == NULL) {
+		snprintf(buf, lengthof(buf), "%s%s", _paths.data_dir, filename);
+	} else {
+		ttd_strlcpy(buf, filename, lengthof(buf));
+	}
 
 	f = fopen(buf, "rb");
 #if !defined(WIN32)
 	if (f == NULL) {
-		strtolower(buf + strlen(_paths.data_dir) - 1);
+		strtolower(strrchr(buf, PATHSEPCHAR));
 		f = fopen(buf, "rb");
 
 #if defined SECOND_DATA_DIR
@@ -308,6 +312,8 @@
 #if defined(SECOND_DATA_DIR)
 	_paths.second_data_dir = MallocT<char>(MAX_PATH);
 	ttd_strlcpy(_paths.second_data_dir, SECOND_DATA_DIR, MAX_PATH);
+#else
+	_paths.second_data_dir = NULL;
 #endif
 
 #if defined(USE_HOMEDIR)
--- a/src/fontcache.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/fontcache.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -147,10 +147,10 @@
 
 
 folder_error:
+registry_no_font_found:
 #if defined(UNICODE)
-	free(font_path);
+	free(font_namep);
 #endif
-registry_no_font_found:
 	RegCloseKey(hKey);
 	return err;
 }
--- a/src/industry.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/industry.h	Sun Apr 08 14:46:55 2007 +0000
@@ -6,6 +6,7 @@
 #define INDUSTRY_H
 
 #include "oldpool.h"
+#include "helpers.hpp"
 
 typedef byte IndustryGfx;
 typedef uint8 IndustryType;
@@ -21,6 +22,27 @@
 	INDUSTRYLIFE_CLOSABLE,         ///< Industry can only close (no production change)
 };
 
+enum IndustyBehaviour {
+	INDUSTRYBEH_NONE                  =      0,
+	INDUSTRYBEH_PLANT_FIELDS          = 1 << 0,  ///< periodically plants fileds around itself (temp and artic farms)
+	INDUSTRYBEH_CUT_TREES             = 1 << 1,  ///< cuts trees and produce first output cargo from them (lumber mill)
+	INDUSTRYBEH_BUILT_ONWATER         = 1 << 2,  ///< is built on water (oil rig)
+	INDUSTRYBEH_TOWN1200_MORE         = 1 << 3,  ///< can only be built in towns larger then 1200 inhabitants (temperate bank)
+	INDUSTRYBEH_ONLY_INTOWN           = 1 << 4,  ///< can only be built in towns (arctic/tropic banks, water tower)
+	INDUSTRYBEH_ONLY_NEARTOWN         = 1 << 5,  ///< is always built near towns (toy shop)
+	INDUSTRYBEH_PLANT_ON_BUILT        = 1 << 6,  ///< Fields are planted around when built (all farms)
+	INDUSTRYBEH_DONT_INCR_PROD        = 1 << 7,  ///< do not increase production (oil wells)
+	INDUSTRYBEH_BEFORE_1950           = 1 << 8,  ///< can only be built before 1950 (oil wells)
+	INDUSTRYBEH_AFTER_1960            = 1 << 9,  ///< can only be built after 1960 (oil rigs)
+	INDUSTRYBEH_AI_AIRSHIP_ROUTES     = 1 << 10, ///< ai will attempt to establish air/ship routes to this industry (oil rig)
+	INDUSTRYBEH_AIRPLANE_ATTACKS      = 1 << 11, ///< can be exploded by a military airplane (oil refinery)
+	INDUSTRYBEH_CHOPPER_ATTACKS       = 1 << 12, ///< can be exploded by a military helicopter (factory)
+	INDUSTRYBEH_CAN_SUBSIDENCE        = 1 << 13, ///< can cause a subsidence (coal mine, shaft that collapses)
+};
+
+
+DECLARE_ENUM_AS_BIT_SET(IndustyBehaviour);
+
 /**
  * Defines the internal data of a functionnal industry
  */
@@ -71,11 +93,14 @@
 	CargoID accepts_cargo[3];             ///< 3 accepted cargos
 	IndustryLifeType life_type;           ///< This is also known as Industry production flag, in newgrf specs
 	byte climate_availability;            ///< Bitmask, giving landscape enums as bit position
+	IndustyBehaviour behaviour;           ///< How this industry will behave, and how others entities can use it
 	StringID name;                        ///< Displayed name of the industry
 	StringID new_industry_text;           ///< Message appearing when the industry is built
 	StringID closure_text;                ///< Message appearing when the industry closes
 	StringID production_up_text;          ///< Message appearing when the industry's production is increasing
 	StringID production_down_text;        ///< Message appearing when the industry's production is decreasing
+	byte appear_ingame[NUM_LANDSCAPE];    ///< Probability of appearance in game
+	byte appear_creation[NUM_LANDSCAPE];  ///< Probability of appearance during map creation
 };
 
 /**
--- a/src/industry_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/industry_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -117,7 +117,7 @@
 		}
 	END_TILE_LOOP(tile_cur, i->width, i->height, i->xy);
 
-	if (i->type == IT_FARM || i->type == IT_FARM_2) {
+	if (GetIndustrySpec(i->type)->behaviour & INDUSTRYBEH_PLANT_FIELDS) {
 		/* Remove the farmland and convert it to regular tiles over time. */
 		BEGIN_TILE_LOOP(tile_cur, 42, 42, i->xy - TileDiffXY(21, 21)) {
 			tile_cur = TILE_MASK(tile_cur);
@@ -259,7 +259,7 @@
 	/* Add industry on top of the ground? */
 	image = dits->building.sprite;
 	if (image != 0) {
-		if (_display_opt & DO_TRANS_BUILDINGS) {
+		if (HASBIT(_transparent_opt, TO_INDUSTRIES)) {
 			SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 			pal = PALETTE_TO_TRANSPARENT;
 		} else {
@@ -274,7 +274,7 @@
 			dits->dz,
 			z);
 
-		if (_display_opt & DO_TRANS_BUILDINGS) return;
+		if (HASBIT(_transparent_opt, TO_INDUSTRIES)) return;
 	}
 
 	{
@@ -323,6 +323,7 @@
 static int32 ClearTile_Industry(TileIndex tile, byte flags)
 {
 	Industry *i = GetIndustryByTile(tile);
+	const IndustrySpec *indspec = GetIndustrySpec(i->type);
 
 	/* water can destroy industries
 	 * in editor you can bulldoze industries
@@ -331,8 +332,8 @@
 	 */
 	if ((_current_player != OWNER_WATER && _game_mode != GM_EDITOR &&
 			!_cheats.magic_bulldozer.value) ||
-			(_current_player == OWNER_WATER && i->type == IT_OIL_RIG)) {
-		SetDParam(0, GetIndustrySpec(i->type)->name);
+			(_current_player == OWNER_WATER && (indspec->behaviour & INDUSTRYBEH_BUILT_ONWATER))) {
+		SetDParam(0, indspec->name);
 		return_cmd_error(STR_4800_IN_THE_WAY);
 	}
 
@@ -975,12 +976,13 @@
 
 	/* produce some cargo */
 	if ((i->counter & 0xFF) == 0) {
+		IndustyBehaviour indbehav = GetIndustrySpec(i->type)->behaviour;
 		i->cargo_waiting[0] = min(0xffff, i->cargo_waiting[0] + i->production_rate[0]);
 		i->cargo_waiting[1] = min(0xffff, i->cargo_waiting[1] + i->production_rate[1]);
 
-		if (i->type == IT_FARM || i->type == IT_FARM_2) {
+		if (indbehav & INDUSTRYBEH_PLANT_FIELDS) {
 			MaybePlantFarmField(i);
-		} else if (i->type == IT_LUMBER_MILL && (i->counter & 0x1FF) == 0) {
+		} else if ((indbehav & INDUSTRYBEH_CUT_TREES) && (i->counter & 0x1FF) == 0) {
 			ChopLumberMillTrees(i);
 		}
 	}
@@ -1156,8 +1158,12 @@
 			}
 		} else {
 			if (!EnsureNoVehicle(cur_tile)) return false;
+			IndustyBehaviour ind_behav = GetIndustrySpec(type)->behaviour;
 
-			if (type == IT_OIL_RIG)  {
+			if (ind_behav & INDUSTRYBEH_BUILT_ONWATER) {
+				/* As soon as the tile is not water, bail out.
+				 * But that does not mean the search is over.  You have
+				 * to make sure every tile of the industry will be only water*/
 				if (!IsClearWaterTile(cur_tile)) return false;
 			} else {
 				Slope tileh;
@@ -1186,27 +1192,19 @@
 					}
 				}
 
-				if (type == IT_BANK_TEMP) {
+				if (ind_behav & INDUSTRYBEH_ONLY_INTOWN) {
 					if (!IsTileType(cur_tile, MP_HOUSE)) {
 						_error_message = STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS;
 						return false;
 					}
-				} else if (type == IT_BANK_TROPIC_ARCTIC) {
-					if (!IsTileType(cur_tile, MP_HOUSE)) {
-						_error_message = STR_030D_CAN_ONLY_BE_BUILT_IN_TOWNS;
-						return false;
+				} else {
+					if (ind_behav & INDUSTRYBEH_ONLY_NEARTOWN) {
+						if (!IsTileType(cur_tile, MP_HOUSE)) goto do_clear;
+					} else {
+do_clear:
+						if (CmdFailed(DoCommand(cur_tile, 0, 0, DC_AUTO, CMD_LANDSCAPE_CLEAR)))
+							return false;
 					}
-				} else if (type == IT_TOY_SHOP) {
-					if (!IsTileType(cur_tile, MP_HOUSE)) goto do_clear;
-				} else if (type == IT_WATER_TOWER) {
-					if (!IsTileType(cur_tile, MP_HOUSE)) {
-						_error_message = STR_0316_CAN_ONLY_BE_BUILT_IN_TOWNS;
-						return false;
-					}
-				} else {
-do_clear:
-					if (CmdFailed(DoCommand(cur_tile, 0, 0, DC_AUTO, CMD_LANDSCAPE_CLEAR)))
-						return false;
 				}
 			}
 		}
@@ -1217,12 +1215,12 @@
 
 static bool CheckIfIndustryIsAllowed(TileIndex tile, int type, const Town *t)
 {
-	if (type == IT_BANK_TEMP && t->population < 1200) {
+	if ((GetIndustrySpec(type)->behaviour & INDUSTRYBEH_TOWN1200_MORE) && t->population < 1200) {
 		_error_message = STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS;
 		return false;
 	}
 
-	if (type == IT_TOY_SHOP && DistanceMax(t->xy, tile) > 9) {
+	if ((GetIndustrySpec(type)->behaviour & INDUSTRYBEH_ONLY_NEARTOWN) && DistanceMax(t->xy, tile) > 9) {
 		_error_message = STR_0239_SITE_UNSUITABLE;
 		return false;
 	}
@@ -1450,7 +1448,7 @@
 	i->width++;
 	i->height++;
 
-	if (i->type == IT_FARM || i->type == IT_FARM_2) {
+	if (GetIndustrySpec(i->type)->behaviour & INDUSTRYBEH_PLANT_ON_BUILT) {
 		for (j = 0; j != 50; j++) PlantRandomFarmField(i);
 	}
 	_industry_sort_dirty = true;
@@ -1723,34 +1721,61 @@
 	}
 }
 
-static const byte _new_industry_rand[4][32] = {
-	{12, 12, 12, 12, 12, 12, 12,  0,  0,  6,  6,  9,  9,  3,  3,  3, 18, 18,  4,  4,  2,  2,  5,  5,  5,  5,  5,  5,  1,  1,  8,  8},
-	{16, 16, 16,  0,  0,  0,  9,  9,  9,  9, 13, 13,  3,  3,  3,  3, 15, 15, 15,  4,  4, 11, 11, 11, 11, 11, 14, 14,  1,  1,  7,  7},
-	{21, 21, 21, 24, 22, 22, 22, 22, 23, 23, 16, 16, 16,  4,  4, 19, 19, 19, 13, 13, 20, 20, 20, 11, 11, 11, 17, 17, 17, 10, 10, 10},
-	{30, 30, 30, 36, 36, 31, 31, 31, 27, 27, 27, 28, 28, 28, 26, 26, 26, 34, 34, 34, 35, 35, 35, 29, 29, 29, 32, 32, 32, 33, 33, 33},
+/** Simple helper that will collect data for the generation of industries */
+struct ProbabilityHelper {
+	uint16 prob;      ///< probability
+	IndustryType ind; ///< industry id correcponding
 };
 
-static void MaybeNewIndustry(uint32 r)
+/**
+ * Try to create a random industry, during gameplay
+ */
+static void MaybeNewIndustry(void)
 {
-	int type =_new_industry_rand[_opt.landscape][GB(r, 16, 5)];
-	int j;
-	Industry *i;
-	const IndustrySpec *ind_spc = GetIndustrySpec(type);;
+	Industry *ind;               //will receive the industry's creation pointer
+	IndustryType rndtype, j;     // Loop controlers
+	const IndustrySpec *ind_spc;
+	uint num = 0;
+	ProbabilityHelper cumulative_probs[IT_END]; // probability collector
+	uint16 probability_max = 0;
 
-	if (type == IT_OIL_WELL && _cur_year > 1950) return;
-	if (type == IT_OIL_RIG  && _cur_year < 1960) return;
+	/* Generate a list of all possible industries that can be built. */
+	for (j = 0; j < IT_END; j++) {
+		byte chance = GetIndustrySpec(j)->appear_ingame[_opt.landscape];
 
-	j = 2000;
+		/* if appearing chance for this landscape is above 0, this industry can be chosen */
+		if (chance != 0) {
+			probability_max += chance;
+			/* adds the result for this industry */
+			cumulative_probs[num].ind = j;
+			cumulative_probs[num++].prob = probability_max;
+		}
+	}
+
+	/* Find a random type, with maximum being what has been evaluate above*/
+	rndtype = RandomRange(probability_max);
+	for (j = 0; j < IT_END; j++) {
+		/* and choose the index of the industry that matches as close as possible this random type */
+		if (cumulative_probs[j].prob >= rndtype) break;
+	}
+
+	ind_spc = GetIndustrySpec(cumulative_probs[j].ind);
+	/*  Check if it is allowed */
+	if ((ind_spc->behaviour & INDUSTRYBEH_BEFORE_1950) && _cur_year > 1950) return;
+	if ((ind_spc->behaviour & INDUSTRYBEH_AFTER_1960) && _cur_year < 1960) return;
+
+	/* try to create 2000 times this industry */
+	num = 2000;
 	for (;;) {
-		i = CreateNewIndustry(RandomTile(), type);
-		if (i != NULL) break;
-		if (--j == 0) return;
+		ind = CreateNewIndustry(RandomTile(), cumulative_probs[j].ind);
+		if (ind != NULL) break;
+		if (--num == 0) return;
 	}
 
 	SetDParam(0, ind_spc->name);
-	SetDParam(1, i->town->index);
+	SetDParam(1, ind->town->index);
 	AddNewsItem(ind_spc->new_industry_text,
-		NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_OPENCLOSE, 0), i->xy, 0);
+		NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_OPENCLOSE, 0), ind->xy, 0);
 }
 
 static void ChangeIndustryProduction(Industry *i)
@@ -1766,7 +1791,7 @@
 
 		case INDUSTRYLIFE_PRODUCTION:
 			/* decrease or increase */
-			if (type == IT_OIL_WELL && _opt.landscape == LT_TEMPERATE)
+			if ((indspec->behaviour & INDUSTRYBEH_DONT_INCR_PROD) && _opt.landscape == LT_TEMPERATE)
 				only_decrease = true;
 
 			if (only_decrease || CHANCE16(1,3)) {
@@ -1833,7 +1858,7 @@
 
 	/* 3% chance that we start a new industry */
 	if (CHANCE16(3, 100)) {
-		MaybeNewIndustry(Random());
+		MaybeNewIndustry();
 	} else if (!_patches.smooth_economy) {
 		i = GetRandomIndustry();
 		if (i != NULL) ChangeIndustryProduction(i);
--- a/src/industry_map.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/industry_map.h	Sun Apr 08 14:46:55 2007 +0000
@@ -51,17 +51,35 @@
 	NUM_INDUSTRY_GFXES                 = 175,
 };
 
+/**
+ * Get the industry ID of the given tile
+ * @param t the tile to get the industry ID from
+ * @pre IsTileType(t, MP_INDUSTRY)
+ * @return the industry ID
+ */
 static inline IndustryID GetIndustryIndex(TileIndex t)
 {
 	assert(IsTileType(t, MP_INDUSTRY));
 	return _m[t].m2;
 }
 
+/**
+ * Get the industry of the given tile
+ * @param t the tile to get the industry from
+ * @pre IsTileType(t, MP_INDUSTRY)
+ * @return the industry
+ */
 static inline Industry* GetIndustryByTile(TileIndex t)
 {
 	return GetIndustry(GetIndustryIndex(t));
 }
 
+/**
+ * Is this industry tile fully built?
+ * @param t the tile to analyze
+ * @pre IsTileType(t, MP_INDUSTRY)
+ * @return true if and only if the industry tile is fully built
+ */
 static inline bool IsIndustryCompleted(TileIndex t)
 {
 	assert(IsTileType(t, MP_INDUSTRY));
@@ -106,18 +124,36 @@
 	SB(_m[tile].m1, 0, 2, value);
 }
 
+/**
+ * Get the industry graphics ID for the given industry tile
+ * @param t the tile to get the gfx for
+ * @pre IsTileType(t, MP_INDUSTRY)
+ * @return the gfx ID
+ */
 static inline IndustryGfx GetIndustryGfx(TileIndex t)
 {
 	assert(IsTileType(t, MP_INDUSTRY));
 	return _m[t].m5;
 }
 
+/**
+ * Set the industry graphics ID for the given industry tile
+ * @param t   the tile to set the gfx for
+ * @pre IsTileType(t, MP_INDUSTRY)
+ * @param gfx the graphics ID
+ */
 static inline void SetIndustryGfx(TileIndex t, IndustryGfx gfx)
 {
 	assert(IsTileType(t, MP_INDUSTRY));
 	_m[t].m5 = gfx;
 }
 
+/**
+ * Make the given tile an industry tile
+ * @param t     the tile to make an industry tile
+ * @param index the industry this tile belongs to
+ * @param gfx   the graphics to use for the tile
+ */
 static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx)
 {
 	SetTileType(t, MP_INDUSTRY);
@@ -157,7 +193,6 @@
  * as well as the completion bit.
  * In fact, it is the same as restarting construction frmo ground up
  * @param tile the tile to query
- * @param generating_world whether generating a world or not
  * @pre IsTileType(tile, MP_INDUSTRY)
  */
 static inline void ResetIndustryConstructionStage(TileIndex tile)
@@ -166,12 +201,14 @@
 	_m[tile].m1 = 0;
 }
 
+/** Structure used to make a mapping from industry gfx to industry type */
 struct IndustryTypeSolver {
-	IndustryGfx MinGfx;
-	IndustryGfx MaxGfx;
+	IndustryGfx MinGfx; ///< The first gfx index for the industry type
+	IndustryGfx MaxGfx; ///< The last gfx index for the industry type
 };
 
-static const IndustryTypeSolver industry_gfx_Solver [IT_END] = {
+/** Mapping of industry gfx to industry type */
+static const IndustryTypeSolver industry_gfx_Solver[IT_END] = {
 	{  0,   6}, ///< IT_COAL_MINE
 	{  7,  10}, ///< IT_POWER_STATION,
 	{ 11,  15}, ///< IT_SAWMILL,
@@ -247,7 +284,7 @@
 /**
  * Set the animation state
  * @param tile the tile to set the animation state of
- * @param count the new animation state
+ * @param state the new animation state
  * @pre IsTileType(tile, MP_INDUSTRY)
  */
 static inline void SetIndustryAnimationState(TileIndex tile, byte state)
--- a/src/lang/american.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/american.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -3012,7 +3012,6 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Make autoreplace keep the length of a train the same by removing cars (starting at the front), if replacing the engine would make the train longer.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Replacing: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EXPERIMENTAL FEATURE {}Switch between engine and car replacement windows.{}Car replacement will only be done if the new car can be refitted into carrying the same type of cargo as the old one. This is checked for each car when the actual replacement takes place.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Engine is not buildable
 
 STR_ENGINES                                                     :Engines
 STR_WAGONS                                                      :Cars
--- a/src/lang/brazilian_portuguese.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/brazilian_portuguese.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -729,6 +729,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Colocar farol
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Colocar transmissor
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Define área desértica.{} Pressione e segure CTRL para removê-la
+STR_CREATE_LAKE                                                 :{BLACK}Define área com água.{} Faz um canal, a menos se CTRL for pressionado ao nível do mar, neste caso inundará ao redor
 STR_0290_DELETE                                                 :{BLACK}Remover
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Remover esta cidade completamente
 STR_0292_SAVE_SCENARIO                                          :Salvar cenário
@@ -803,6 +804,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Mapa mundi
 STR_EXTRA_VIEW_PORT                                             :Visualizador extra
 STR_SIGN_LIST                                                   :Lista de placas
+STR_TRANSPARENCY_OPTIONS                                        :Opções de Transparência
 STR_02DF_TOWN_DIRECTORY                                         :Lista de cidades
 STR_TOWN_POPULATION                                             :{BLACK}População mundial: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Visualizador {COMMA}
@@ -3015,7 +3017,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Faz autosubstituição manter o tamanho do trem removendo vagões (começando pela frente), se ao substituir a locomotiva o trem ficar maior.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Substituindo: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EXPERIMENTAL {}Troca entre substituir máquinas e substituir vagões.{} Só haverá a substituição se puder haver o reacondicionamento para carregar o mesmo tipo de carga. Essa checagem ocorre para cada vagão enquanto a substituição ocorre.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}A locomotiva não pode ser construída
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Trem não disponível
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Automóvel não disponível
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Embarcação não disponível
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Aeronave não disponível
 
 STR_ENGINES                                                     :Motores
 STR_WAGONS                                                      :Vagões
@@ -3152,3 +3157,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Transferir Dinheiro: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...é uma rua local
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...rua na direção errada
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Opções de Transparência
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Alternar transparência para sinais de estação
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Alternar transparência para árvores
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Alternar transparência para casas
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Alternar transparência para indústrias
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Alternar transparência para construções como estações, depósitos, pontos de controle e eletrificação da ferrovia
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Alternar transparência para pontes
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Alternar transparência para estruturas como faróis e antenas, talvez no futuro para efeitos visuais
--- a/src/lang/bulgarian.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/bulgarian.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -804,6 +804,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Карта на света
 STR_EXTRA_VIEW_PORT                                             :Допълнителна камера
 STR_SIGN_LIST                                                   :Списък с табели
+STR_TRANSPARENCY_OPTIONS                                        :Опций на прозрачност
 STR_02DF_TOWN_DIRECTORY                                         :Списък със селищата
 STR_TOWN_POPULATION                                             :{BLACK}Световна популация: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Камера {COMMA}
@@ -3014,7 +3015,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Автоматичната замяна ще запази дължината на влака като премахне вагони (започвайки от предните), ако замяната довежда до по-дълъг влак.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Замяна: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} ЕКСПЕРИМЕНТАЛНА ВЪЗМОЖНОСТ {}Превключване между замяна на локомотиви и вагони.{}Замяната на вагони ще бъде направена само ако новия тип вагони може да се преустрои да превозва същия тип товар като старите. Това се проверява за всеки вагон когато замяната се случва.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Двигателя не е строим
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Превозното средство не е на разположение
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Превозното средство не е на разположение
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Корабът не е на разположение
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Самолетът не е на разположение
 
 STR_ENGINES                                                     :Двигатели
 STR_WAGONS                                                      :Вагони
@@ -3151,3 +3155,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Сума за преместване: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...този път принадлежи на градът
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...пътят е насочен в погрешната посока
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Опций на прозрачност
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Използвай прозрачност за знаци на гара
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Използвай прозрачност за дървета
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Използвай прозрачност за къщи
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Използвай прозрачност за промишленост
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Използвай прозрачност за сгради като гари, депа, пътни точки и висящи жици
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Използвай прозрачност за мостове
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Използвай прозрачност за сгради като фарове и антени, може би в бъдеще за украси
--- a/src/lang/catalan.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/catalan.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -802,6 +802,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Mapa del món
 STR_EXTRA_VIEW_PORT                                             :Vista extra
 STR_SIGN_LIST                                                   :Llista de senyals
+STR_TRANSPARENCY_OPTIONS                                        :Opcions de transparència
 STR_02DF_TOWN_DIRECTORY                                         :Directori de Poblacions
 STR_TOWN_POPULATION                                             :{BLACK}Població mundial: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Vista {COMMA}
@@ -3012,7 +3013,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Fer que la sustitució automàtica mantingui la llargària del tren eliminant vagons (començant pel front), si substituint la màquina el tren es fa més llarg
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Sustituint: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} CARACTERÍSTICA EXPERIMENTAL {}Alterna entre finestres de sustitució de vagons i de motors{}La sustitució del vagó només tindrà lloc si el nou vagó pot ser remodelat per admetre el mateix tipus de càrrega que el vell. Això es comprova per a cada vagó quan el reemplaçament es produeix.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}El motor no es pot construir
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}El tren no està disponible
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}El vehicle no està disponible
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}El vaixell no està disponible
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}L'avió no està disponible
 
 STR_ENGINES                                                     :Motors
 STR_WAGONS                                                      :Vagons
@@ -3149,3 +3153,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Transferir Crèdits: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...aquesta carretera es propietat del poble
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...sentit de la carretera en la direcció incorrecta
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Opcions de transparència
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Activa/Desactiva transparència dels rètols d'estació
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Activa/Desactiva transparència dels arbres
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Activa/Desactiva transparència de les cases
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Activa/Desactiva transparència de les indústries
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Activa/Desactiva transparència dels edificis com ara estacions, cotxeres, punts de trobada i catenàries
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Activa/Desactiva transparència dels ponts
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Activa/Desactiva transparència de les estructures com ara fars i antenes
--- a/src/lang/czech.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/czech.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -860,6 +860,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Mapa světa
 STR_EXTRA_VIEW_PORT                                             :Další pohled
 STR_SIGN_LIST                                                   :Seznam popisků
+STR_TRANSPARENCY_OPTIONS                                        :Nastavení průhlednosti
 STR_02DF_TOWN_DIRECTORY                                         :Seznam měst
 STR_TOWN_POPULATION                                             :{BLACK}Populace světa: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Pohled {COMMA}
@@ -3076,7 +3077,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Funkce automatického vylepšování vlaků může udržovat stejnou délku vlaku odstraňovaním vagonů (od začátku vlaku), pokud by změna mašiny vlak prodloužila.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Vyměňování: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EXPERIMENTÁLNÍ VLASTNOST {}Přepne mezi okny na výměnu lokomotiv a vagonů.{}Vagon se vymění, jen když je nový vagon schopen vozit stejnou komoditu, jako ten starý. Toto se ověřuje pro každý vagon.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Stroj nelze postavit
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vozidlo není dostupné
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vůz není dostupné
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Loď není dostupná
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Letadlo není dostupné
 
 STR_ENGINES                                                     :lokomotivy
 STR_WAGONS                                                      :vagony
@@ -3213,3 +3217,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Podíl za převoz: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}... tato silnice je ve vlastnictví obce
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}... silnice je otočena jiným směrem
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Nastavení průhlednosti
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Změna průhlednosti jmen stanic
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Změna průhlednosti stromů
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Změna průhlednosti domů
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Změna průhlednosti továren
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Změna průhlednosti postavitelných objektů, jako stanic, kontrolních bodů a vedení
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Změna průhlednosti mostů
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Změna průhlednosti staveb jako majáků, vysílačů a doplňků (v budoucnosti)
--- a/src/lang/danish.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/danish.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -802,6 +802,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Kort over verden
 STR_EXTRA_VIEW_PORT                                             :Flere lokalitetsvinduer
 STR_SIGN_LIST                                                   :Liste over skilte
+STR_TRANSPARENCY_OPTIONS                                        :Gennemsigtighedsvalg
 STR_02DF_TOWN_DIRECTORY                                         :Byoversigt
 STR_TOWN_POPULATION                                             :{BLACK}Verdens befolkning: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Lokalitetsvinduer {COMMA}
@@ -3012,7 +3013,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Få autoudskift til at bevare længden af tog ved at fjerne vogne (startende fra fronten), hvis autoudskiftningen gør toget længere.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Udskifter: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EKSPERIMENTEL EGENSKAB {}Skift imellem lokomotiv- og vogn-udskiftningsvindue.{}Vognudskiftning vil kun finde sted hvis den nye vogn kan ændres til at transportere samme godstype some den gamle vogn. Dette bliver checket for hver vogn, når udskiftningen finder sted.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Køretøjet kan ikke bygges
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Tog er ikke tilgængelig
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vejkøretøj er ikke tilgængelig
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Skib er ikke tilgængelig
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Fly er ikke tilgængelig
 
 STR_ENGINES                                                     :Lokomotiver
 STR_WAGONS                                                      :Vogne
@@ -3149,3 +3153,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Værdi af overført gods: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...denne vej er ejet af en by
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...vejen peger i den forkerte retning
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Gennemsigtighedsvalg
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Skift gennemsigtighed for stationsskilte
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Skift gennemsigtighed for træer
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Skift gennemsigtighed for huse
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Skift gennemsigtighed for industrier
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Skift gennemsigtighed for konstruktioner som stationer, værksteder, kontrolsteder og køreledninger
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Skift gennemsigtighed for broer
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Skift gennemsigtighed for strukturer som fyrtårne og antenner, og måske i fremtiden for øjeguf
--- a/src/lang/dutch.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/dutch.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -802,6 +802,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Kaart
 STR_EXTRA_VIEW_PORT                                             :Extra kijkvenster
 STR_SIGN_LIST                                                   :Bordenlijst
+STR_TRANSPARENCY_OPTIONS                                        :Doorzichtigheidsopties
 STR_02DF_TOWN_DIRECTORY                                         :Stedenlijst
 STR_TOWN_POPULATION                                             :{BLACK}Wereldbevolking: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Kijkvenster {COMMA}
@@ -3012,7 +3013,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}De te vervangen trein behoudt zijn lengte door wagons weg te halen (startend aan de voorkant), als het vervangen de trein langer zou maken
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Aan het vervangen: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EXPERIMENTEEL {}Wissel tussen motor- en wagonvervangvensters.{}Wagonvervanging wordt alleen uitgevoerd als de nieuwe wagon omgebouwd kan worden om hetzelfde ladingtype te dragen als de oude wagon. Dit wordt gecontroleerd voor elke wagon wanneer de daadwerkelijke vervanging plaats vindt.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Locomotief kan niet gebouwd worden
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Trein is niet beschikbaar
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Voertuig is niet beschikbaar
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Schip is niet beschikbaar
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Vliegtuig is niet beschikbaar
 
 STR_ENGINES                                                     :Motoren
 STR_WAGONS                                                      :Wagons
@@ -3149,3 +3153,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Geldoverdracht: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...deze weg is van een stad
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...weg is in de verkeerde richting
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Doorzichtigheidsopties
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Wissel doorzichtigheid voor stationsnamen
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Wissel doorzichtigheid voor bomen
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Wissel doorzichtigheid voor huizen
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Wissel doorzichtigheid voor industriën
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Wissel doorzichtigheid voor gebouwen zoals stations, depots, waypoints en bovenleiding
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Wissel doorzichtigheid voor bruggen
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Wissel doorzichtigheid voor structuren zoals vuurtoren en antennes, in de toekomst misschien voor eyecandy
--- a/src/lang/english.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/english.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -802,6 +802,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Map of world
 STR_EXTRA_VIEW_PORT                                             :Extra viewport
 STR_SIGN_LIST                                                   :Sign list
+STR_TRANSPARENCY_OPTIONS                                        :Transparency options
 STR_02DF_TOWN_DIRECTORY                                         :Town directory
 STR_TOWN_POPULATION                                             :{BLACK}World population: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Viewport {COMMA}
@@ -3012,7 +3013,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Make autoreplace keep the length of a train the same by removing wagons (starting at the front), if replacing the engine would make the train longer.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Replacing: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EXPERIMENTAL FEATURE {}Switch between engine and wagon replacement windows.{}Wagon replacement will only be done if the new wagon can be refitted into carrying the same type of cargo as the old one. This is checked for each wagon when the actual replacement takes place.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Engine is not buildable
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vehicle is not available
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vehicle is not available
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Ship is not available
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Aircraft is not available
 
 STR_ENGINES                                                     :Engines
 STR_WAGONS                                                      :Wagons
@@ -3149,3 +3153,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Transfer Credits: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...this is a town owned road
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...road facing in the wrong direction
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Transparency Options
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Toggle transparency for station signs
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Toggle transparency for trees
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Toggle transparency for houses
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Toggle transparency for industries
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Toggle transparency for buildables like stations, depots, waypoints and catenary
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Toggle transparency for bridges
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Toggle transparency for structures like lighthouses and antennas, maybe in future for eyecandy
--- a/src/lang/esperanto.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/esperanto.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -803,6 +803,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Mondomapo
 STR_EXTRA_VIEW_PORT                                             :Plia videjo
 STR_SIGN_LIST                                                   :Afiŝa listo
+STR_TRANSPARENCY_OPTIONS                                        :Ebloj por travidebleco
 STR_02DF_TOWN_DIRECTORY                                         :Urbaro
 STR_TOWN_POPULATION                                             :{BLACK}Monda enloĝantaro: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Videjo {COMMA}
@@ -989,7 +990,7 @@
 STR_TRAIN_HAS_TOO_FEW_ORDERS                                    :{WHITE}Trajno {COMMA} havas maltro da ordenoj enplane
 STR_TRAIN_HAS_VOID_ORDER                                        :{WHITE}Trajno {COMMA} havas malplenan ordenon
 STR_TRAIN_HAS_DUPLICATE_ENTRY                                   :{WHITE}Trajno {COMMA} havas duoblajn ordenojn
-STR_TRAIN_HAS_INVALID_ENTRY                                     :{WHITE}Trajnno {COMMA} havas nevalidan stacion en la ordenoj
+STR_TRAIN_HAS_INVALID_ENTRY                                     :{WHITE}Trajno {COMMA} havas nevalidan stacion en la ordenoj
 STR_ROADVEHICLE_HAS_TOO_FEW_ORDERS                              :{WHITE}Vojveturilo {COMMA} havas maltro da ordenoj enplane
 STR_ROADVEHICLE_HAS_VOID_ORDER                                  :{WHITE}Vojveturilo {COMMA} havas malplenan ordenon
 STR_ROADVEHICLE_HAS_DUPLICATE_ENTRY                             :{WHITE}Vojveturilo {COMMA} havas duoblajn ordenojn
@@ -3013,7 +3014,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Ĉe aŭtomata anstataŭigo tenu saman longecon de la trajno per forigo de vagonoj (defronte), se per nova maŝino la trajno plilongiĝas
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Anstataŭante: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EKSPERIMENTA AĴO {}Ŝaltu inter maŝina kaj vagona anstataŭigo.{}Vagona anstataŭigo nur okazos se la nova vagono povas transformiĝi por porti saman ŝarĝon kiel la malnova. Por ĉiu vagono tio kontroliĝos dum anstataŭado.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Maŝino ne kreeblas
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Trajno ne haveblas
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Veturilo ne haveblas
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Ŝipo ne haveblas
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Aviadilo ne haveblas
 
 STR_ENGINES                                                     :Maŝinoj
 STR_WAGONS                                                      :Vagonoj
@@ -3150,3 +3154,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Transigaj Kreditoj: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...ĉi tiun vojon posedas la urbo
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...vojo direktiĝas malĝuste
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Ebloj por travidebleco
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}(Ne)travideblu la staciaj afiŝoj
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}(Ne)travideblu la arboj
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}(Ne)travideblu la domoj
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}(Ne)travideblu la industrioj
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}(Ne)travideblu konstrueblaĵoj kiel stacidomoj, deponejoj, trairejoj kaj kondukdratoj
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}(Ne)travideblu la pontoj
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}(Ne)travideblu aĵoj kiel lumturoj kaj antenoj, kaj eble estonte vidĝuaĵoj
--- a/src/lang/estonian.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/estonian.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -691,6 +691,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Konkurendi jaama saabus esimene veovahend
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Õnnetused / katastroofid
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Ettevõtte teave
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Ava / sulge tööstuseid
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Muutused majanduses
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Soovitused ja teated mängija veovahendite kohta
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Uued veovahendid
@@ -730,7 +731,7 @@
 STR_022E_LANDSCAPE_GENERATION                                   :{BLACK}Maastiku loomine
 STR_022F_TOWN_GENERATION                                        :{BLACK}Linnade loomine
 STR_0230_INDUSTRY_GENERATION                                    :{BLACK}Tööstuste loomine
-STR_0231_ROAD_CONSTRUCTION                                      :{BLACK}Teede ehitamine
+STR_0231_ROAD_CONSTRUCTION                                      :{BLACK}Teeehitus
 STR_0233_TOWN_GENERATION                                        :{WHITE}Linnade loomine
 STR_0234_NEW_TOWN                                               :{BLACK}Uus linn
 STR_0235_CONSTRUCT_NEW_TOWN                                     :{BLACK}Ehita uus linn
@@ -791,12 +792,12 @@
 STR_026A_CONSTRUCT_FARM                                         :{BLACK}Raja farm
 STR_026B_CONSTRUCT_IRON_ORE_MINE                                :{BLACK}Ehita rauamaagikaevandus
 STR_026C_CONSTRUCT_OIL_WELLS                                    :{BLACK}Ehita naftapuuraugud
-STR_026D_CONSTRUCT_BANK_CAN_ONLY                                :{BLACK}Ehita pank (seda saab ehitada vaid linnadesse, mille rahvastikuarv ületab 1200)
+STR_026D_CONSTRUCT_BANK_CAN_ONLY                                :{BLACK}Ehita pank (saab ehitada vaid linnadesse, mille rahvastikuarv ületab 1200)
 STR_026E_CONSTRUCT_PAPER_MILL                                   :{BLACK}Ehita paberitehas
 STR_026F_CONSTRUCT_FOOD_PROCESSING                              :{BLACK}Ehita toidutööstus
 STR_0270_CONSTRUCT_PRINTING_WORKS                               :{BLACK}Ehita trükikoda
 STR_0271_CONSTRUCT_GOLD_MINE                                    :{BLACK}Ehita kullakaevandus
-STR_0272_CONSTRUCT_BANK_CAN_ONLY                                :{BLACK}Ehita pank (seda saab vaid linnadesse ehitada)
+STR_0272_CONSTRUCT_BANK_CAN_ONLY                                :{BLACK}Ehita pank (saab vaid linnadesse ehitada)
 STR_0273_CONSTRUCT_LUMBER_MILL_TO                               :{BLACK}Ehita saeveski (vihmametsade puhustamiseks ja puidu tootmiseks)
 STR_0274_PLANT_FRUIT_PLANTATION                                 :{BLACK}Istuta puuviljaistandus
 STR_0275_PLANT_RUBBER_PLANTATION                                :{BLACK}Istuta kummipuuistandus
@@ -826,6 +827,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Ehita tuletorn
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Paigalda saatjamast
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Loo kõrbealad.{}Eemaldamiseks klõpsa hoides all CTRL nuppu
+STR_CREATE_LAKE                                                 :{BLACK}Määratle veealad.{}Ehita kanal. CTRL-klahvi all hoides ujutab ümbruskonna üle.
 STR_0290_DELETE                                                 :{BLACK}Kustuta
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Hävita see linn täielikult
 STR_0292_SAVE_SCENARIO                                          :Salvesta kaart
@@ -1141,6 +1143,7 @@
 STR_CONFIG_PATCHES_NONUNIFORM_STATIONS                          :{LTBLUE}Luba suvalise kujuga jaamad: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_NEW_PATHFINDING_ALL                          :{LTBLUE}Uus teeotsimise algoritm(NPF asendab NTP): {ORANGE}{STRING}
 STR_CONFIG_PATCHES_FREIGHT_TRAINS                               :{LTBLUE}Raskete rongide simuleerimiseks kasutatav raskuse korrutaja: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_STOP_ON_TOWN_ROAD                            :{LTBLUE}Luba läbisõidupeatused linnateedel: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_SMALL_AIRPORTS                               :{LTBLUE}Luba väikesed lennujaamad kuni mängu lõpuni: {ORANGE}{STRING}
 
@@ -2624,7 +2627,7 @@
 
 STR_UNKNOWN_DESTINATION                                         :tundmatu sihtpunkt
 STR_8812_EMPTY                                                  :{LTBLUE}Tühi
-STR_8813_FROM                                                   :{LTBLUE}{CARGO} {STATION}'st
+STR_8813_FROM                                                   :{LTBLUE}{CARGO} jaamast {STATION}
 STR_FROM_MULT                                                   :{LTBLUE}{CARGO} jaamast {STATION} (x{NUM})
 STR_8814_TRAIN_IS_WAITING_IN_DEPOT                              :{WHITE}Rong {COMMA} ootab depoos
 STR_8815_NEW_VEHICLES                                           :{BLACK}Uus rong
@@ -3109,7 +3112,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Sunni automaatvahetus hoidma rongi pikkust samaks eemaldades vaguneid (alustades eestpoolt), kui vahetatav mootor muudaks rongi pikemaks.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Vahetamisel: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} TESTIMISEL! {}Vaheta aken mootori ja vaguni vahetamise aknate vahel.{}Vaguni vahetus tehakse ainult siis kui uus vagun suudetakse muuta kandmaks sama tüüpi kaupa kui vana vagun. See valitakse igale vagunile kui tegelik vahetus käib
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Vedurit ei saa ehitada
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Sõiduk pole saadaval
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Sõiduk pole saadaval
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Laev pole saadaval
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Lennuk pole saadaval
 
 STR_ENGINES                                                     :Vedurid
 STR_WAGONS                                                      :Vaguneid
--- a/src/lang/finnish.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/finnish.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -802,6 +802,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Maailmankartta
 STR_EXTRA_VIEW_PORT                                             :Lisänäkymä
 STR_SIGN_LIST                                                   :Kylttilista
+STR_TRANSPARENCY_OPTIONS                                        :Läpinäkyvyysvalinnat
 STR_02DF_TOWN_DIRECTORY                                         :Kaupunkihakemisto
 STR_TOWN_POPULATION                                             :{BLACK}Maailman asukasluku: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Näkymä {COMMA}
@@ -2199,6 +2200,7 @@
 STR_707F_HAS_BEEN_TAKEN_OVER_BY                                 :{BLACK}{BIGFONT}Yhtiön {COMPANY} on ottanut haltuun {COMPANY}!
 STR_7080_PROTECTED                                              :{WHITE}Tällä yhtiöllä ei ole vielä osakkeita...
 
+STR_LIVERY_DEFAULT                                              :Normaalit tunnusvärit
 STR_LIVERY_STEAM                                                :Höyryveturi
 STR_LIVERY_DIESEL                                               :Dieselveturi
 STR_LIVERY_ELECTRIC                                             :Sähköveturi
@@ -3011,7 +3013,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Automaattikorvaus pitäköön junan vakiopituisena poistamalla vaunuja (edestä) jos veturi pidentäisi junaa.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Korvataan: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} ERIKOIS OMINAISUUS {} Vaihda toiseen korvausikkunaan. {} Vaunu vaihdetaan ainoastaan jos uusi vaunu kuljettaa samaa rahtia. Tämä tarkistetaan, joka kerta kun vaunu korvataan.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Veturi ei ole rakennettavissa
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Juna tai vaunu ei ole saatavilla
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Ajoneuvo ei ole saatavilla
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Laiva ei ole saatavilla
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Lentokone ei ole saatavilla
 
 STR_ENGINES                                                     :Veturit
 STR_WAGONS                                                      :Vaunut
@@ -3147,3 +3152,15 @@
 
 ########
 
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}Siirrä rahaa: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...kaupunki omistaa tien
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...tie on väärin päin
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Läpinäkyvyysvalinnat
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Läpinäkyvät kyltit
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Läpinäkyvät puut
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Läpinäkyvät talot
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Läpinäkyvät tehtaat
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Läpinäkyvät asemat, varikot, rastit ja sähkölinjat
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Läpinäkyvät sillat
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Läpinäkyvät rakenteet kuten majakat ja antennit
--- a/src/lang/french.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/french.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -803,6 +803,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Carte du monde
 STR_EXTRA_VIEW_PORT                                             :Vue supplémentaire
 STR_SIGN_LIST                                                   :Liste des panneaux
+STR_TRANSPARENCY_OPTIONS                                        :Options de transparence
 STR_02DF_TOWN_DIRECTORY                                         :Annuaire des villes
 STR_TOWN_POPULATION                                             :{BLACK}Population mondiale : {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Vue {COMMA}
@@ -3013,7 +3014,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}L'autoremplacement conserve la même longueur du train en retirant des wagons (d'abord par la tête), si le remplacement fait en sorte que le train ne devienne plus long.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}En Remplacement: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} FONCTION EXPERIMENTALE {}Passer à la fenêtre de remplacement de locomotives/wagons.{}Le remplacement de wagon ne se fera que si le nouveau wagon peut être réaménagé pour le même type de cargaison que l'ancien. Ceci est vérifié pour chaque wagon lors du remplacement.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Ce véhicule ne peut pas être construit
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Véhicule non disponible
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Véhicule non disponible
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Navire non disponible
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Aéronef non disponible
 
 STR_ENGINES                                                     :Locomotives
 STR_WAGONS                                                      :Wagons
@@ -3150,3 +3154,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Crédits de transfert: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...cette route appartient à une ville
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...mauvaise orientation de la route
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Options de transparence
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Transparence des noms de station
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Transparence des arbres
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Transparence des maisons
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Transparence des industries
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Transparence des éléments constructibles tels que stations, dépôts, points de contrôle et caténaire
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Transparence des ponts
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Transparence des structures telles que phares et antennes
--- a/src/lang/galician.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/galician.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -2550,6 +2550,7 @@
 STR_TRAIN_STOPPING_VEL                                          :{RED}Parando, {VELOCITY}
 STR_TRAIN_NO_POWER                                              :{RED}Sen enerxía
 
+
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Haí un vehículo de estrada no camiño
 STR_9001_ROAD_VEHICLES                                          :{WHITE}{COMPANY} - {COMMA} Vehículos de Estrada
@@ -2803,6 +2804,7 @@
 STR_NEWGRF_GRF_ID                                               :{BLACK}GRF ID: {SILVER}{STRING}
 STR_NEWGRF_MD5SUM                                               :{BLACK}Suma MD5: {SILVER}{STRING}
 
+
 STR_NEWGRF_ADD                                                  :{BLACK}Engadir
 STR_NEWGRF_REMOVE                                               :{BLACK}Eliminar
 STR_NEWGRF_REMOVE_TIP                                           :{BLACK}Elimina-lo arquivo NewGRF seleccionado da lista
@@ -2815,6 +2817,7 @@
 
 STR_NEWGRF_DISABLED                                             :{RED}Desactivado
 
+
 STR_CURRENCY_WINDOW                                             :{WHITE}Moeda persoalizada
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Taxa de cambio: {ORANGE}{CURRENCY} = £ {COMMA}
 STR_CURRENCY_SEPARATOR                                          :{LTBLUE}Separador:
@@ -2919,6 +2922,7 @@
 STR_RANDOM_SEED                                                 :{BLACK}Semilla Aleatoria:
 STR_RANDOM_SEED_HELP                                            :{BLACK}Pincha para introducir unha semilla
 STR_LAND_GENERATOR                                              :{BLACK}Xerador de terreo:
+STR_TREE_PLACER                                                 :{BLACK}Algoritmo para árbores:
 STR_TERRAIN_TYPE                                                :{BLACK}Tipo de terreo:
 STR_QUANTITY_OF_SEA_LAKES                                       :{BLACK}Nivel do mar:
 STR_SMOOTHNESS                                                  :{BLACK}Suavidade:
@@ -2939,7 +2943,9 @@
 STR_WORLD_GENERATION                                            :{BLACK}Xeración do mundo
 STR_SETTINGUP_GAME                                              :{BLACK}Configurando partida
 STR_PREPARING_GAME                                              :{BLACK}Preparando partida
+STR_DIFFICULTY_TO_CUSTOM                                        :{WHITE}Esta acción cambiou o nivel de dificultade a Personalizado
 STR_SE_FLAT_WORLD                                               :{WHITE}Terreo Chan
+STR_SE_RANDOM_LAND                                              :{WHITE}Terreo aleatorio
 STR_SE_NEW_WORLD                                                :{BLACK}Crear novo escenario
 STR_SE_CAPTION                                                  :{WHITE}Tipo de escenario
 STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
@@ -2968,4 +2974,19 @@
 STR_MEASURE_LENGTH_HEIGHTDIFF                                   :{BLACK}Lonxitude: {NUM}{}Diferencia de altura: {NUM} m
 STR_MEASURE_AREA_HEIGHTDIFF                                     :{BLACK}Área: {NUM} x {NUM}{}Diferencia de altura: {NUM} m
 
+############ Date formatting
+STR_DATE_TINY                                                   :{STRING}-{STRING}-{NUM}
+STR_DATE_SHORT                                                  :{STRING} {NUM}
+STR_DATE_LONG                                                   :{STRING} {STRING} {NUM}
+
 ########
+
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}Transferir Créditos: {LTBLUE}{CURRENCY}
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Opcións de Transparencia
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Habilitar transparencia para as sinais das estacións
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Habilitar transparencia para árbores
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Habilitar transparencia para casas
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Habilitar transparencia para industrias
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Habilitar transparencia para construibles como estacións, depósitos, puntos de ruta e catenaria
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Habilitar transparencia para pontes
--- a/src/lang/german.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/german.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -803,6 +803,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Weltkarte
 STR_EXTRA_VIEW_PORT                                             :Zusatzansicht
 STR_SIGN_LIST                                                   :Schilderliste
+STR_TRANSPARENCY_OPTIONS                                        :Transparenzeinstellungen
 STR_02DF_TOWN_DIRECTORY                                         :Städteverzeichnis
 STR_TOWN_POPULATION                                             :{BLACK}Weltbevölkerung: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Ansicht {COMMA}
@@ -3010,7 +3011,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Zwinge das automatische Ersetzen die Länge eines Zuges beizubehalten, indem (vorne beginnend) Waggons entfernt werden, falls das Ersetzen der Lokomotive den Zug verlängern würde.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Ersetze: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EXPERIMENTELLE FUNKTION {}Umschalter für Lok- oder Waggonersetzung{}Waggons werden nur ersetzt, wenn der neue Waggon den selben Warentyp transportieren kann wie der alte. Dies wird beim Ersetzen eines jeden Waggons einzeln geprüft.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Lokomotive ist nicht baubar
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Fahrzeug nicht verfügbar
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Fahrzeug nicht verfügbar
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Schiff nicht verfügbar
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Flugzeug nicht verfügbar
 
 STR_ENGINES                                                     :Loks
 STR_WAGONS                                                      :Waggons
@@ -3147,3 +3151,5 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Überweise Geld: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...diese Straße ist in kommunaler Trägerschaft
+
--- a/src/lang/hungarian.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/hungarian.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -868,6 +868,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Világtérkép
 STR_EXTRA_VIEW_PORT                                             :Extra látkép
 STR_SIGN_LIST                                                   :Feliratok listája
+STR_TRANSPARENCY_OPTIONS                                        :Átlátszósági beállítások
 STR_02DF_TOWN_DIRECTORY                                         :Városlista
 STR_TOWN_POPULATION                                             :{BLACK}Világnépesség: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}{COMMA}. látkép
@@ -3115,7 +3116,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Az automatikus cserénél a szerelvény hosszának a megtartása kocsik lekapcsolásával (előröl kezdve), ha a csere után a mozdony hosszabb lenne.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Lecserél: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} KISÉRLETI TULAJDONSÁG {}Váltás a mozdony és a vasúti-kocsi cserélő ablak között.{}A vagonok cseréje csak akkor történik meg, ha az új vagon átalakítható ugyanolyan típusú teher szállítására. Ez minden vagoncserénél ellenőrződik.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}A mozdony így nem építhető meg
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}A jármű nem elérhető.
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}A jármű nem elérhető.
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}A hajó nem elérhető.
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}A repülő nem elérhető.
 
 STR_ENGINES                                                     :Mozdonyok
 STR_WAGONS                                                      :Vagonok
@@ -3251,3 +3255,15 @@
 
 ########
 
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}Szállítási díj: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...ez egy városi tulajdonú út
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...az út másik irányba vezet
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Átlátszósági beállítások
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Átkapcsolni az állomásjelzésekre
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Átkapcsolni a fákra
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Átkapcsolni az épületekre
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Átkapcsolni az ipari létesítményekre
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Átkapcsolni az építhető elemekre (állomások, depók, útipontok és felsővezeték)
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Átkapcsolni a hidakra
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Átkapcsolni egyéb épületekre, mint világítótorony és antennák (esetleg egyéb jövőbeni díszek)
--- a/src/lang/icelandic.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/icelandic.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -2989,7 +2989,6 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Heldur lengd lestar með því að fjarlægja vagna (framan frá) ef útskipting dráttarvagna myndi lengja hana.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Skipti út: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} TILRAUNAEIGINLEIKI {}Skipta á milli útskiptiglugga dráttar- og flutningavagna.{}Útskipting vagna fer aðeins fram ef hægt er að breyta nýju vögnunum til að flytja sama farm og þeir gömlu. Það er kannað fyrir hvern vagn þegar útskipting á honum fer fram.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Ekki hægt að smíða dráttarvagn
 
 STR_ENGINES                                                     :Dráttarvagnar
 STR_WAGONS                                                      :Vagnar
--- a/src/lang/italian.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/italian.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -803,6 +803,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Mappa del mondo
 STR_EXTRA_VIEW_PORT                                             :Mini visuale extra
 STR_SIGN_LIST                                                   :Lista cartelli
+STR_TRANSPARENCY_OPTIONS                                        :Opzioni trasparenza
 STR_02DF_TOWN_DIRECTORY                                         :Elenco città
 STR_TOWN_POPULATION                                             :{BLACK}Popolazione mondiale: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Mini visuale {COMMA}
@@ -2915,7 +2916,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Parametri invalidi per {STRING}: parametri {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} deve essere caricato prima di {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} deve essere caricato dopo {STRING}.
-STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :il file GRF se questo era progettato per essere tradotto
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :il file GRF che era progettato per tradurre
 
 STR_NEWGRF_ADD                                                  :{BLACK}Aggiungi
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Aggiungi un file NewGRF alla lista
@@ -3013,7 +3014,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}La autosostituzione mantiene la lunghezza del treno togliendo vagoni (iniziando dalla testa), se la sostituzione della locomotiva lo farebbe piu lungo.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Sostituzione: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} FEATURE SPERIMENTALE {}Scambia tra loro le finestre di sostituizione locomotive e vagoni. {}La sostituizione del vagone avverrà solo se il nuovo vagone può essere convertito nello stesso tipo di merce del  vecchio vagone. Questo controllo viene fatto per ogni vagone sostituito.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Non puoi costruire la locomotiva
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Il veicolo non è disponibile
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}L'automezzo non è disponibile
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}La nave non è disponibile
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}L'aeromobile non è disponibile
 
 STR_ENGINES                                                     :Locomotive
 STR_WAGONS                                                      :Vagoni
@@ -3150,3 +3154,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Crediti Trasferiti: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...questa è una strada di proprietà della città
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...strada rivolta nella direzione sbagliata
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Opzioni trasparenza
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Attiva/disattiva la trasparenza dei nomi delle stazioni
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Attiva/disattiva la trasparenza degli alberi
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Attiva/disattiva la trasparenza degli edifici
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Attiva/disattiva la trasparenza delle industrie
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Attiva/disattiva la trasparenza delle strutture edificabili come stazioni, depositi, waypoint e catenarie
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Attiva/disattiva la trasparenza dei ponti
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Attiva/disattiva la trasparenza di strutture come fari, antenne e altri futuri oggetti decorativi
--- a/src/lang/japanese.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/japanese.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -3011,7 +3011,6 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}自動交換によって列車の長さが長くなる場合は、列車の長さを保守するには客車/貨車を取り除くことができます。列車の先頭から開始します。
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}交換:{ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK}実験的機能{}機関車/貨車のウィンドウに切り替えます。{}貨車交換は新貨車が旧貨車と同様の貨物種類に再装備できるときのみに行います。自動交換中に各貨車を検査します。
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}機関車が購入できません
 
 STR_ENGINES                                                     :機関車
 STR_WAGONS                                                      :貨車
--- a/src/lang/korean.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/korean.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -803,6 +803,7 @@
 STR_02DE_MAP_OF_WORLD                                           :전체 지도 보기
 STR_EXTRA_VIEW_PORT                                             :추가 뷰포인트
 STR_SIGN_LIST                                                   :팻말 목록
+STR_TRANSPARENCY_OPTIONS                                        :투명 옵션
 STR_02DF_TOWN_DIRECTORY                                         :도시 목록
 STR_TOWN_POPULATION                                             :{BLACK}세계 인구: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}뷰포인트 {COMMA}
@@ -3013,7 +3014,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}자동교체시에 열차가 기존보다 길어지면 화물차를 제거함으로써 교체시 달라지는 열차의 길이를 같게 조정합니다 (앞쪽부터 시작됨)
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}교체중: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} 실험적 기능! {}기관차/화물차 교체 창을 번갈아 띄웁니다.{}화물차 교체는 예전 화물차가 싣던 화물을 실을 수 있도록 개조할 수 있는 새로운 화물차에만 성공할 것입니다. 실제 교체가 이루어질 때 각 화물차에 체크되었습니다.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}기관차를 생성할 수 없습니다!
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}열차는 불가능합니다
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}차량은 불가능합니다
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}선박은 불가능합니다
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}항공기는 불가능합니다
 
 STR_ENGINES                                                     :기관차
 STR_WAGONS                                                      :화물차
@@ -3150,3 +3154,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}환승 단위: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...여기는 마을 소유의 도로 입니다
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...도로가 잘못된 반향을 향하고 있습니다
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}투명 옵션
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}역이름 팻말 투명 전환
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}나무 투명 전환
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}집 투명 전환
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}산업시설 투명 전환
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}정거장, 차량기지, 웨이포인트, 연결고리와 같은 건설 가능한 것들에 대한 투명 전환
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}다리 투명 전환
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}등대와 안테나와 같은 구조물 투명 전환
--- a/src/lang/lithuanian.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/lithuanian.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -3018,7 +3018,6 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Pakeitimo metu išlaikyti traukinio ilgį atjungiant vagonus (pradedant juo priekio), jeigu pakeitus garvežį traukinys pailgėtų.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Keicima: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EKSPERIMENTINĖ GALIMYBĖ {}Pereidinėti tarp garvežių ir vagonų pakeitimo langų.{}Vagonai bus pakeičiami tik tada, jeigu naujasis vagonas galės gabenti tą patį krovinio tipą kaip ir senasis. Tai atliekama patikrinant kiekvieną vagoną jo keitimo metu.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Variklio neimanoma pagaminti
 
 STR_ENGINES                                                     :Varikliai
 STR_WAGONS                                                      :Vagonai
--- a/src/lang/norwegian_bokmal.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/norwegian_bokmal.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -280,6 +280,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...eies av {STRING}
 STR_013C_CARGO                                                  :{BLACK}Last
@@ -590,6 +591,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Ankommst av første kjøretøy på motstanders stasjon
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Ulykker/katastrofer
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Firmainformasjon
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Åpninger / Stengninger av industrier
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Økonomiske endringer
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Råd/informasjon om spillers kjøretøy
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nye kjøretøy
@@ -1087,6 +1089,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Eget firma
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Alle firmaer
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Foretrekk lagchat med <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Rullehjulets funksjon: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom kartet
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Rull kartet
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Av
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Rullehjulets hastighet på kartet: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Maks antall tog per spiller: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Maks antall kjøretøy per spiller: {ORANGE}{STRING}
@@ -2631,6 +2638,9 @@
 STR_TRAIN_NO_POWER                                              :{RED}Ingen strøm
 STR_TRAIN_START_NO_CATENARY                                     :Dette sporet mangler et kjede, så toget kan ikke starte
 
+STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}Ny {STRING} nå tilgjengelig!
+STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{STRING}
+STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Ny {STRING} Nå tilgjengelig!  -  {STRING}
 
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Kjøretøy i veien
@@ -2902,6 +2912,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Ugyldig parameter for {STRING}: parameter {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} må være lastet før {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} må være lastet etter {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :GRF filen den var laget for å oversette
 
 STR_NEWGRF_ADD                                                  :{BLACK}Legg til
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Legg en ny NewGRF-fil til listen
@@ -2999,7 +3010,6 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}La den automatiske utskiftningen beholde lengen på toget ved å fjerne vogner (fra første vogn), hvis utskiftningen gjør toget lenger.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Erstatter: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} Eksperimentell del {}Skift mellom tog- og vognvinduet.{}Vognutskiftningen vil bare bli utført hvis den nye vognen kan ha samme last som den gamle. Dette blir sjekket når utskiftingen finner sted.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Motoren kan ikke bygges
 
 STR_ENGINES                                                     :Motorer
 STR_WAGONS                                                      :Vogner
@@ -3135,3 +3145,4 @@
 
 ########
 
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}Overfør kreditt: {LTBLUE}{CURRENCY}
--- a/src/lang/norwegian_nynorsk.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/norwegian_nynorsk.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -728,6 +728,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Plasser fyrtårn
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Plasser radiosendar
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Definer ørkenområde.{}Trykk og held inne CTRL for å fjerne det
+STR_CREATE_LAKE                                                 :{BLACK}Definer vassområde.{}Lag ein kanal. Viss CTRL er halde nede ved havnivå, vil vatnet i staden fløyme over omgivnadene
 STR_0290_DELETE                                                 :{BLACK}Slett
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Slett byen heilt
 STR_0292_SAVE_SCENARIO                                          :Lagre scenario
@@ -802,6 +803,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Verdskart
 STR_EXTRA_VIEW_PORT                                             :Ekstra vindauge
 STR_SIGN_LIST                                                   :Skiltliste
+STR_TRANSPARENCY_OPTIONS                                        :Gjennomsiktigheitsinnstillingar
 STR_02DF_TOWN_DIRECTORY                                         :Byoversikt
 STR_TOWN_POPULATION                                             :{BLACK}Verdsinnbyggjartal: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Vindauge {COMMA}
@@ -1093,6 +1095,8 @@
 STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Funksjonen til scrollhjulet: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom kart
 STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Scroll kart
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Av
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Fart på rullehjul: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Maks antal tog per speler: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Maks antal køyretøy per spelar: {ORANGE}{STRING}
@@ -3010,7 +3014,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Lat den automatiske utskiftinga behalde lengda på toget ved å fjerne vogner (frå første vogn), dersom utskiftinga gjer toget lenger.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Erstatter: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} Eksperimentell del {}Skift mellom tog- og vognvindauget.{} Utskiftinga av vogner skjer berre dersom den nye vogna kan ha same last som den nye.  Dette vert sjekka når skiftet skjer.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Motoren kan ikkje byggjast
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Køyretøyet er ikkje tilgjengeleg
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Køyretøyet er ikkje tilgjengeleg
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Skipet er ikkje tilgjengeleg
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Flyet er ikkje tilgjengeleg
 
 STR_ENGINES                                                     :Motorar
 STR_WAGONS                                                      :Vogner
@@ -3147,3 +3154,5 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Overfør kreditt: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...denne vegen eigast av ein by
+
--- a/src/lang/polish.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/polish.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -889,6 +889,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Mapa świata
 STR_EXTRA_VIEW_PORT                                             :Dodatkowy podgląd
 STR_SIGN_LIST                                                   :Lista tablic
+STR_TRANSPARENCY_OPTIONS                                        :Opcje przeźroczystości
 STR_02DF_TOWN_DIRECTORY                                         :Lista miast
 STR_TOWN_POPULATION                                             :{BLACK}Populacja świata: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Podgląd {COMMA}
@@ -3141,7 +3142,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Autowymiana zachowuje długość pociągu poprzez usuwanie wagonów (począwszy od początku), jeśli wymiana lokomotywy spowoduje wydłużenie pociągu.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Zastępowanie: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EKSPERYMENTALNE NARZEDZIE {}Przejdź pomiędzy oknami zamiany lokomotyw i wagonów.{}Wymiana wagonu nastąpi tylko jeśli nowy wagon może być przebudowany do przewożenia tego samego towaru co poprzedni. Każdy wagon pociągu jest sprawdzany podczas procesu zamiany.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Lokomotywa nie może być zbudowana
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Pojazd nie jest dostępny
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Pojazd nie jest dostępny
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Statek nie jest dostępny
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Samolot nie jest dostępny
 
 STR_ENGINES                                                     :Lokomotywy
 STR_WAGONS                                                      :Wagony
@@ -3233,7 +3237,7 @@
 STR_SETTINGUP_GAME                                              :{BLACK}Ustawianie gry
 STR_PREPARING_TILELOOP                                          :{BLACK}Uaktywnianie pól
 STR_PREPARING_GAME                                              :{BLACK}Przygotowywanie gry
-STR_DIFFICULTY_TO_CUSTOM                                        :{WHITE}Ta akcja zmieniła poziom trudności na "własny"
+STR_DIFFICULTY_TO_CUSTOM                                        :{WHITE}Zmieniono poziom trudności na "własny"
 STR_SE_FLAT_WORLD                                               :{WHITE}Płaski świat
 STR_SE_FLAT_WORLD_TIP                                           :{BLACK}Stwórz płaski świat
 STR_SE_RANDOM_LAND                                              :{WHITE}Losowy teren
@@ -3277,3 +3281,15 @@
 
 ########
 
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}Wartość transferu: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...ta droga należy do miasta
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...droga jest zorientowana w złym kierunku
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Opcje Przeźroczystości
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Przełącz przeźroczystość nazw stacji
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Przełącz przeźroczystość drzew
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Przełącz przeźroczystość budynków miejskich
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Przełącz przeźroczystość przedsiębiorstw
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Przełącz przeźroczystość infrastruktury takiej jak stacje, zajezdnie, punkty kontrolne i trakcja elektryczna
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Przełącz przeźroczystość mostów
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Przełącz przeźroczystość obiektów takich jak latarnie morskie i nadajniki, być może w przyszłości dodatki graficzne
--- a/src/lang/portuguese.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/portuguese.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -802,6 +802,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Mapa do mundo
 STR_EXTRA_VIEW_PORT                                             :Visualizador extra
 STR_SIGN_LIST                                                   :Lista de sinais
+STR_TRANSPARENCY_OPTIONS                                        :Opções de Transparência
 STR_02DF_TOWN_DIRECTORY                                         :Lista de cidades
 STR_TOWN_POPULATION                                             :{BLACK}População Mundial: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Visualizador {COMMA}
@@ -3012,7 +3013,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Forçar a substituição automática a manter o comprimento do comboio, removendo vagões (do início), nas situações em que a substituição da locomotiva resultar num comboio maior.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Trocando: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} FUNCIONALIDADE EXPERIMENTAL{}Alternar entre a janela de substituição de locomotivas e a janela de substituição de vagões.{}A substituição de vagões só ocorrerá se o novo vagão puder ser reconvertido para o mesmo tipo de carga que o vagão antigo. Esta verificação ocorre para cada vagão, durante a substituição.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Locomotiva não construível
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Veículo não está disponível
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Veículo não está disponível
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Barco não está disponível
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Aeronave não está disponível
 
 STR_ENGINES                                                     :Locomotivas
 STR_WAGONS                                                      :Vagões
@@ -3149,3 +3153,5 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Créditos de Transferência: {LTBLUE}{CURRENCY}
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Opções de Transparência
--- a/src/lang/romanian.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/romanian.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -3001,7 +3001,6 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Fã optiunea de autoînlocuire sã pãstreze identicã lungimea unui tren prin eliminarea vagoanelor (începând din fatã), dacã înlocuirea motorului ar face trenul mai lung.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Înlocuire: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} ELEMENT EXPERIMENTAL {}Comutã între ferestrele de ]nlocuire motoare si vagoane.{}Înlocuirea de vagoane va fi efectuatã numai dacã noul vagon poate transporta acelasi tip de încãrcãturã ca cel vechi. Aceast lucru este verificat pentru fiecare vagon atunci când este fãcutã înlocuirea efectivã.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Motorul nu poate fi construit
 
 STR_ENGINES                                                     :Motoare
 STR_WAGONS                                                      :Vagoane
--- a/src/lang/russian.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/russian.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -804,6 +804,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Карта мира
 STR_EXTRA_VIEW_PORT                                             :Доп. окно просмотра
 STR_SIGN_LIST                                                   :Список меток
+STR_TRANSPARENCY_OPTIONS                                        :Настройки прозрачности.
 STR_02DF_TOWN_DIRECTORY                                         :Список городов
 STR_TOWN_POPULATION                                             :{BLACK}Население: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Окно просмотра {COMMA}
@@ -2915,18 +2916,19 @@
 STR_NEWGRF_FILENAME                                             :{BLACK}Имя файла: {SILVER}{STRING}
 STR_NEWGRF_GRF_ID                                               :{BLACK}GRF ID: {SILVER}{STRING}
 STR_NEWGRF_MD5SUM                                               :{BLACK}Сумма MD5: {SILVER}{STRING}
-STR_NEWGRF_CONFIRMATION_TEXT                                    :{YELLOW}Вы хотите сделать изменения в уже запущенной игре - это может привести к ошибке игры, и ее вылету.{}Вы абсолютно уверены в том, что хотите сделать?
+STR_NEWGRF_CONFIRMATION_TEXT                                    :{YELLOW}Вы хотите сделать изменения в уже запущенной игре - это может привести к сбоям и игровым несоответствиям.{}Вы абсолютно уверены в том, что хотите сделать?
 
 STR_NEWGRF_ERROR_MSG_INFO                                       :{SILVER}{STRING}
 STR_NEWGRF_ERROR_MSG_WARNING                                    :{RED}Внимание: {SILVER}{STRING}
 STR_NEWGRF_ERROR_MSG_ERROR                                      :{RED}Ошибка: {SILVER}{STRING}
 STR_NEWGRF_ERROR_MSG_FATAL                                      :{RED}Критическая ошибка: {SILVER}{STRING}
 STR_NEWGRF_ERROR_VERSION_NUMBER                                 :{STRING} не будет работать с версией TTDPatch, сообщенной OpenTTD.
-STR_NEWGRF_ERROR_DOS_OR_WINDOWS                                 :{STRING} для {STRING}-версии TTD.
-STR_NEWGRF_ERROR_UNSET_SWITCH                                   :{STRING} сделан для использования в {STRING}
+STR_NEWGRF_ERROR_DOS_OR_WINDOWS                                 :Файл {STRING} требует {STRING}-версию TTD.
+STR_NEWGRF_ERROR_UNSET_SWITCH                                   :{STRING} сделан для использования совместно с {STRING}
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Неверный параметр {STRING}: параметр {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} должен быть загружен перед {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} должен быть загружен после {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :файл GRF, который им переводится.
 
 STR_NEWGRF_ADD                                                  :{BLACK}Добавить
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Добавить файл NewGRF в список
@@ -3024,7 +3026,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Разрешить при автозамене сохранять длину поездов удалением вагонов (начиная с головы поезда), если при автозамене локомотив увеличит длину поезда.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Заменяем: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK}ЭКСПЕРИМЕНТАЛЬНО {}Переключение между окнами замены локомотивов и вагонов.{}Автозамена вагонов производится только в том случае, если совпадает тип перевозимых грузов. Эта проверка производится для каждого вагона во время автозамены.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Нельзя построить локомотив
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Локомотив недоступен
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Автотранспорт недоступен
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Корабль недоступен
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Авиатранспорт недоступен
 
 STR_ENGINES                                                     :Локомотивы
 STR_WAGONS                                                      :Вагоны
@@ -3161,3 +3166,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Выручка перевозки: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...эта дорога принадлежит городу
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...дорога неправильного направления
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Настройки прозрачности.
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Переключить прозрачность значков станций.
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Переключить прозрачность деревьев.
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Переключить прозрачность зданий.
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Переключить прозрачность зданий промышленности.
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Переключить прозрачность зданий, которые можно строить игроком. Например -- станции, депо, точки пути и столбы для электричества.
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Переключить прозрачность мостов
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Переключить прозрачность зданий, вроде антенн и маяков.
--- a/src/lang/simplified_chinese.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/simplified_chinese.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -802,6 +802,7 @@
 STR_02DE_MAP_OF_WORLD                                           :世界地图
 STR_EXTRA_VIEW_PORT                                             :额外视点
 STR_SIGN_LIST                                                   :标志列表
+STR_TRANSPARENCY_OPTIONS                                        :透明选项
 STR_02DF_TOWN_DIRECTORY                                         :城镇地图
 STR_TOWN_POPULATION                                             :{BLACK}世界人口:{COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}视点 {COMMA}
@@ -3012,7 +3013,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}当引擎升级可能造成列车变长时,自动去掉最开始的若干挂车以保证列车长度不变。
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}替换项目: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK}试验功能:{}可以切换引擎/挂车替换模式。{}只有当新的挂车可以改装成与原始挂车装载货物类型相同的时候,才能替换挂车。当替换过程进行时,系统将自动检查每节挂车的类型。
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}不能建造这种引擎。
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}列车不可用
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}车辆不可用
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}船只不可用
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}飞机不可用
 
 STR_ENGINES                                                     :引擎
 STR_WAGONS                                                      :挂车
@@ -3149,3 +3153,8 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}转运评分: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}这是一条城镇所属的道路
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}道路方向不对
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}透明选项
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}调整站牌的透明度
--- a/src/lang/slovak.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/slovak.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -866,6 +866,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Mapa sveta
 STR_EXTRA_VIEW_PORT                                             :Dalsi pohlad
 STR_SIGN_LIST                                                   :Zoznam popisov
+STR_TRANSPARENCY_OPTIONS                                        :Nastavenia priehladnosti
 STR_02DF_TOWN_DIRECTORY                                         :Zoznam miest
 STR_TOWN_POPULATION                                             :{BLACK}Svetova populacia: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Pohlad {COMMA}
@@ -3076,7 +3077,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Funkcia automatickeho vylepsovania vlakov moze udrzovat rovnaku dlzku vlakov odstranovanim vagonov (od zaciatku vlakov), pokial by zmena rusna vlak predlzila.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Vymena: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EXPERIMENTALNA VLASTNOST {}Prepne medzi oknami na vymenu lokomotiv a vagonov.{}Vagon sa vymeni, len ked je nový vagon schopny vozit rovnaky naklad, ako ten stary. Toto sa overuje pre kazdy vagon.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Lokomotiva sa nevyraba
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vozidlo nie je dostupné
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vozidlo nie je dostupné
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Lod nie je dostupná
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Lietadlo nie je dostupné
 
 STR_ENGINES                                                     :Lokomotívy
 STR_WAGONS                                                      :Vagonov
@@ -3213,3 +3217,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Transfer kredity: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}... cesta vlastnená mestom
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}... nesprávna orientácia cesty
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Nastavenia priehladnosti
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Prepnút priehladnost názvov staníc
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Prepnút priehladnost stromov
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Prepnút priehladnost domov
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Prepnút priehladnost priemyslu
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Prepnút priehladnost staníc, garáží, tratí, ...
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Prepnút priehladnost mostov
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Prepnút priehladnost objektov ako sú majáky a antény
--- a/src/lang/slovenian.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/slovenian.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -769,6 +769,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Postavi svetilnik
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Postavi oddajnik
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Določi območja puščave.{}Pritisni in drži CTRL za odstranitev
+STR_CREATE_LAKE                                                 :{BLACK}Določi področje vode.{}Naredi kanal, razen če je pritisnjen CTRL na morski gladini, ko bo poplavilo okolico.
 STR_0290_DELETE                                                 :{BLACK}Izbriši
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Popolnoma izbriši mesto
 STR_0292_SAVE_SCENARIO                                          :Shrani scenarij
@@ -843,6 +844,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Zemljevid sveta
 STR_EXTRA_VIEW_PORT                                             :Dodaten pogled
 STR_SIGN_LIST                                                   :Seznam napisov
+STR_TRANSPARENCY_OPTIONS                                        :Nastavitve prozornega pogleda
 STR_02DF_TOWN_DIRECTORY                                         :Imenik mest
 STR_TOWN_POPULATION                                             :{BLACK}Svetovno prebivalstvo: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Pogled {COMMA}
@@ -1254,6 +1256,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Postavi drevesa naključne vrste
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Ni mogoče zgraditi kanalov tukaj ...
+STR_BUILD_CANALS_TIP                                            :{BLACK}Zgradi kanale.
 STR_LANDINFO_CANAL                                              :Kanal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Ni mogoče zgraditi zapornic tukaj ...
@@ -3090,7 +3093,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Dovoli samozamenjavi, da z odstranitvijo vagonov, začenši na začetku, ohrani isto dolžino vlaka, če bi ga menjava lokomotive podaljšala.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Zamenjuje: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} POSKUSNA MOŽNOST {}Preklop med okni za menjavo lokomotiv in vagonov.{}Zamenjava vagonov je možna edino, če je lahko drugi tip vagona predelan za prevoz iste vrste tovora, kot prvi. To je preverjeno za vsak vagon, ko se izvrši zamenjava,
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Lokomotive ni moč zgraditi
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vozilo ni na voljo
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vozilo ni na voljo
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Ladja ni na voljo
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Letalo ni na voljo
 
 STR_ENGINES                                                     :Lokomotive
 STR_WAGONS                                                      :Vagoni
@@ -3227,3 +3233,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Prenesi kredite: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...ta cesta je last mesta
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...cesta je obrnjena napačno
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Nastavitve prozornega pogleda
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Prozoren ali poln pogled imen postaj
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Prozoren ali poln pogled dreves
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Prozoren ali navaden pogled hiš
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Prozoren ali navaden pogled industrij
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Prozoren ali navaden pogled ostalih objektov kot so postaje, garaže...
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Prozoren ali navaden pogled mostov
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Prozoren ali navaden pogled struktur kot so antene, svetilniki...
--- a/src/lang/spanish.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/spanish.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -803,6 +803,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Mapa del mundo
 STR_EXTRA_VIEW_PORT                                             :Punto de vista extra
 STR_SIGN_LIST                                                   :Lista de señales
+STR_TRANSPARENCY_OPTIONS                                        :Opciones de transparencia
 STR_02DF_TOWN_DIRECTORY                                         :Listado de poblaciones
 STR_TOWN_POPULATION                                             :{BLACK}Población mundial: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Vista {COMMA}
@@ -3013,7 +3014,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Hacer que el cambio automático mantenga la longitud del tren quitando vagones (empezando por adelante), si el cambio de locomotora produce un tren más largo.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Reemplazando: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} FUNCIÓN EXPERIMENTAL {}Cambia entre las ventanas de cambio de vagón y locomotora.{}Los cambios de vagón solo se harán si el nuevo vagón puede ser reparado para transportar el mismo tipo de carga que el anterior. Está marcado para cada vagón cuando el cambio actual se realiza.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}No es posible construir este motor
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vehículo no disponible
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vehículo no disponible
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Barco no disponible
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Aeronave no disponible
 
 STR_ENGINES                                                     :Motores
 STR_WAGONS                                                      :Vagones
@@ -3150,3 +3154,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Transferir Créditos: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...esta es una carretera propiedad de una ciudad
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...revestimientos del camino en la dirección incorrecta
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Opciones de Transparencia
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Activar transparencia para las señales de estaciones
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Activar transparencia para los árboles
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Activar transparencia para las casas
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Activar transparencia para las industrias
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Activar transparencias para construcciones como estaciones, depósitos, puntos de paso, etc.
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Activar transparencias para puentes
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Activar transparencias para estructuras como faros, antenas, etc.
--- a/src/lang/swedish.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/swedish.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -3012,7 +3012,6 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Gör så att automatiskt utbytning behåller ett tågs längd genom att ta bort vagnar (med början längst fram) om utbytandet av loket skulle göra tåget längre.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Ersätter: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EXPERIMENTIELL FEATURE {}Välj mellan lok och vagn ersättnings-fönster.{}Vagns-ersättning kommer endast ske om den nya vagnen kan bli omrustad till att bära samma typ av last som den gamla. Detta kollas för varje vagn när den faktiska ersättningen sker
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Loket går inte att bygga
 
 STR_ENGINES                                                     :Lok
 STR_WAGONS                                                      :Vagnar
--- a/src/lang/traditional_chinese.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/traditional_chinese.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -282,11 +282,11 @@
 STR_OSNAME_OS2                                                  :OS/2
 STR_OSNAME_SUNOS                                                :SunOS
 
-STR_013B_OWNED_BY                                               :{WHITE}...已被{STRING}擁有
+STR_013B_OWNED_BY                                               :{WHITE}...{STRING} 所有
 STR_013C_CARGO                                                  :{BLACK}貨物
 STR_013D_INFORMATION                                            :{BLACK}資訊
 STR_013E_CAPACITIES                                             :{BLACK}載量
-STR_013E_TOTAL_CARGO                                            :{BLACK}總貨物數
+STR_013E_TOTAL_CARGO                                            :{BLACK}總貨物量
 STR_013F_CAPACITY                                               :{BLACK}總載量: {LTBLUE}{CARGO}
 STR_CAPACITY_MULT                                               :{BLACK}載量: {LTBLUE}{CARGO} (x{NUM})
 STR_013F_TOTAL_CAPACITY_TEXT                                    :{BLACK}此列車的總載量:
@@ -453,9 +453,9 @@
 STR_0187_OPTIONS                                                :{BLACK}選項
 STR_0188                                                        :{BLACK}{SMALLUPARROW}
 STR_0189                                                        :{BLACK}{SMALLDOWNARROW}
-STR_018A_CAN_T_CHANGE_SERVICING                                 :{WHITE}不能更改維修週期...
+STR_018A_CAN_T_CHANGE_SERVICING                                 :{WHITE}不能更改檢修週期...
 STR_018B_CLOSE_WINDOW                                           :{BLACK}關閉視窗
-STR_018C_WINDOW_TITLE_DRAG_THIS                                 :{BLACK}視窗標題 - 拖曳這裏以移動視窗
+STR_018C_WINDOW_TITLE_DRAG_THIS                                 :{BLACK}視窗標題 - 點此拖曳可移動視窗
 STR_STICKY_BUTTON                                               :{BLACK}「關閉所有視窗」不會關閉本視窗
 STR_RESIZE_BUTTON                                               :{BLACK}點按拖放更改視窗大小
 STR_SAVELOAD_HOME_BUTTON                                        :{BLACK}跳到預設儲存檔目錄
@@ -464,7 +464,7 @@
 STR_018F_RAISE_A_CORNER_OF_LAND                                 :{BLACK}上昇土地上的一角
 STR_0190_SCROLL_BAR_SCROLLS_LIST                                :{BLACK}捲軸 - 上下捲動清單
 STR_HSCROLL_BAR_SCROLLS_LIST                                    :{BLACK}捲動棒 - 左右捲動清單
-STR_0191_SHOW_LAND_CONTOURS_ON_MAP                              :{BLACK}於地圖上顯示地形
+STR_0191_SHOW_LAND_CONTOURS_ON_MAP                              :{BLACK}於地圖上顯示地形輪廓
 STR_0192_SHOW_VEHICLES_ON_MAP                                   :{BLACK}於地圖上顯示交通公具
 STR_0193_SHOW_INDUSTRIES_ON_MAP                                 :{BLACK}於地圖上顯示各種工業
 STR_0194_SHOW_TRANSPORT_ROUTES_ON                               :{BLACK}於地圖上顯示運輸路線
@@ -727,7 +727,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}建立燈塔
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}建立發射站
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}定義沙漠區。{}請按住 CTRL 移除
-STR_CREATE_LAKE                                                 :{BLACK}劃出湖泊範圍。{}開鑿運河。在海平面上按 CTRL 鍵則會淹沫週遭土地
+STR_CREATE_LAKE                                                 :{BLACK}劃出湖泊範圍。{}開鑿運河。在海平面上按 CTRL 鍵則會淹沒週遭土地
 STR_0290_DELETE                                                 :{BLACK}刪除
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}完全移除這個市鎮
 STR_0292_SAVE_SCENARIO                                          :儲存場景
@@ -802,6 +802,7 @@
 STR_02DE_MAP_OF_WORLD                                           :世界地圖
 STR_EXTRA_VIEW_PORT                                             :打開新視野
 STR_SIGN_LIST                                                   :標誌清單
+STR_TRANSPARENCY_OPTIONS                                        :透明度選項
 STR_02DF_TOWN_DIRECTORY                                         :市鎮索引
 STR_TOWN_POPULATION                                             :{BLACK}世界人口: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}視野 {COMMA}
@@ -3012,7 +3013,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}如果替換後的車廂較長的話,讓自動替換功能移除車廂 (從頭開始) 以便維持列車長度。
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}取代: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} 實驗功能 {}在車頭與車廂取代畫面之間切換。{}車廂取代只有在新車廂能改裝運送舊車廂酬載的時候才會執行。每個車廂都會進行一次檢查。
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}無法購買車頭
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}載具已經停產
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}車輛已經停產
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}船舶已經停產
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}飛機已經停產
 
 STR_ENGINES                                                     :車頭
 STR_WAGONS                                                      :車廂
@@ -3149,3 +3153,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}轉運進帳: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...此路段為市鎮所有
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...此路面向錯誤的方向
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}透明度選項
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}將透明度套用於車站名稱
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}將透明度套用於樹木
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}將透明度套用於房屋
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}將透明度套用於工業
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}將透明度套用於建物,如車站、廠棚、路標及電線
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}將透明度套用於橋樑
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}將透明度套用於設施,如燈塔、天線塔等
--- a/src/lang/turkish.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/turkish.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -280,6 +280,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...sahibi {STRING}
 STR_013C_CARGO                                                  :{BLACK}Kargo
@@ -590,6 +591,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Rakibin durağına ilk aracın gelişi
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Kazalar / felaketler
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Şirket bilgisi
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Fabrika açılış/kapanışları
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Ekonomi değişimleri
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Oyuncunun araçlarıyla ilgili ögüt / bilgi
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Yeni araçlar
@@ -725,6 +727,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Deniz feneri koy
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Verici koy
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Çöl yap, kaldırmak için CTRL'ye basılı tut
+STR_CREATE_LAKE                                                 :{BLACK}Su alanını belirle.{}Deniz seviyesinde CTRL tuşu basılı olmadığı sürece kanal yapar, basılıysa etraftakileri su altında bırakır
 STR_0290_DELETE                                                 :{BLACK}Sil
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Sehri tamamen sil
 STR_0292_SAVE_SCENARIO                                          :Kaydet
@@ -1087,6 +1090,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Şirketi al
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Tüm şirketler
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}<ENTER> tuşu takım içi sohbette kullanılsın: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Fare tekerleğinin fonksiyonu: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Haritayı yakınaştır
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Haritayı kaydır
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Kapalı
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Tekerlek hızı: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Her oyuncu için en fazla tren: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Her oyuncu için en fazla araba: {ORANGE}{STRING}
@@ -1205,6 +1213,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Rastgele türde ağaçlar koy
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Buraya kanal yapılamaz...
+STR_BUILD_CANALS_TIP                                            :{BLACK}Kanal yap.
 STR_LANDINFO_CANAL                                              :Kanal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Buraya kilit yapılamaz...
@@ -2631,6 +2640,10 @@
 STR_TRAIN_NO_POWER                                              :{RED}Elektrik yok
 STR_TRAIN_START_NO_CATENARY                                     :Bu rayda elektrik olmadiği için bu tren çalışamaz
 
+STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}{STRING} artık kullanılabilir!
+STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{STRING}
+STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}{STRING} artık kullanılabilir!  -  {STRING}
+
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Yolda araba var
 STR_9001_ROAD_VEHICLES                                          :{WHITE}{COMPANY} - {COMMA} Arabalar
@@ -2998,7 +3011,6 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Otomatik yenilemede tren boyutunun artması gerekiyorsa vagonları kaldır(en önden başlayarak yeterli sayıda vagon silinir).
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Değiştiriyor: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} DENEYSEL ÖZELLiK {}Lokomotif ve vagon değişimi pencereleri arasında geçiş yap.{}Vagon değişimi sadece yeni vagon eskisinin taşıdığı türde yükü taşıyabiliyorsa yapılir. Değiştirme işlemi sırasında tüm vagonlar için bu durum kontrol edilir.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Lokomotif alınamaz
 
 STR_ENGINES                                                     :Lokomotifler
 STR_WAGONS                                                      :Vagon
@@ -3133,3 +3145,4 @@
 STR_DATE_LONG                                                   :{STRING} {STRING} {NUM}
 
 ########
+
--- a/src/lang/ukrainian.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/ukrainian.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -928,6 +928,7 @@
 STR_02DE_MAP_OF_WORLD                                           :Карта світу
 STR_EXTRA_VIEW_PORT                                             :Додаткове вікно
 STR_SIGN_LIST                                                   :Список позначень
+STR_TRANSPARENCY_OPTIONS                                        :Опції прозорості
 STR_02DF_TOWN_DIRECTORY                                         :Список міст
 STR_TOWN_POPULATION                                             :{BLACK}Населення світу: {COMMA}
 STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Вікно {COMMA}
@@ -3175,7 +3176,10 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Дозволити автооновленню видаляти вагони зберігаючи довжину потягу(починаючи спереду), якщо оновлення робить поїзд довшим.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Оновлення: {ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} ЕКСПЕРИМЕНТАЛЬНО {}Переключення між вікнами заміни потягів та вагонів.{}Автозаміна потягів відбудеться лише в тому випадку, якщо співпаде тип вантажу що перевозиться. Ця перевірка проводиться для кожного вагону під час автозаміни.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}потяг неможливо побудувати
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Поїзд недоступний
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Автомобіль недоступний
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Корабель недоступний
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Літак недоступний
 
 STR_ENGINES                                                     :Потяги
 STR_WAGONS                                                      :Вагони
@@ -3312,3 +3316,14 @@
 ########
 
 STR_FEEDER_CARGO_VALUE                                          :{BLACK}Плата за трансфер: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...ця дорога у власності міста
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...дорога не в тому напрямку
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Опції прозорості
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Переключити прозорість для знаків станцій
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Переключити прозорість для дерев
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Переключити прозорість для будинків
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Переключити прозорість для промисловості
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Переключити прозорість для споруд, таких як станції, депо, ЛЕП тощо
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Переключити прозорість для мостів
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Переключити прозорість для споруд, таких як маяки та антенни (може, потім)
--- a/src/lang/unfinished/afrikaans.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/unfinished/afrikaans.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -2796,7 +2796,6 @@
 
 STR_NOT_REPLACING                                               :{BLACK}Word nie vervang nie
 STR_NOT_REPLACING_VEHICLE_SELECTED                              :{BLACK}Geen voertuig gekies
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Enjin is nie boubaar nie
 
 STR_ENGINES                                                     :Enjine
 
--- a/src/lang/unfinished/croatian.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/unfinished/croatian.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -2781,7 +2781,6 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Neka automatska zamijena drži dužinu vlaka istom brišući vagone(počevši od naprijed), ako bi zamijena lokomotive vlak učinila dužim.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Zamjenjujem:{ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK}EXPERIMENTALNA FUNKCIJA {} Prebaci između prozora za izmjenu lokomotiva i vagona.{}Izmjena vagona će se izvršiti samo ako novi vagon može biti prenamijenjen za prijevoz istog tipa tereta kao i stari vagon. Ovo se provjerava za svaki vagon kada se stvarna zamjena odvija.
-STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Lokomotiva se nemože izgraditi
 
 STR_ENGINES                                                     :Lokomotive
 STR_WAGONS                                                      :Vagoni
--- a/src/lang/unfinished/frisian.txt	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/lang/unfinished/frisian.txt	Sun Apr 08 14:46:55 2007 +0000
@@ -232,8 +232,10 @@
 STR_0140_NEW_GAME                                               :{BLACK}Nei Spul
 STR_0141_LOAD_GAME                                              :{BLACK}Laad Spul
 
+STR_64                                                          :64
 STR_128                                                         :128
 STR_256                                                         :256
+STR_512                                                         :512
 STR_1024                                                        :1024
 STR_2048                                                        :2048
 STR_0148_GAME_OPTIONS                                           :{BLACK}Spul Opsjes
@@ -461,20 +463,16 @@
 STR_021B_ACHIEVES_STATUS                                        :{BLACK}{BIGFONT}{COMPANY} behellet '{STRING}' status!
 STR_021C_OF_ACHIEVES_STATUS                                     :{WHITE}{BIGFONT}{PLAYERNAME} fan {COMPANY} behellet '{STRING}' status!
 STR_021F                                                        :{BLUE}{COMMA}
-STR_0220_CREATE_SCENARIO                                        :{BLACK}Meitsje Lânskip
 STR_0221_OPENTTD                                                :{YELLOW}OpenTTD
 STR_0222_SCENARIO_EDITOR                                        :{YELLOW}Lânskip Ferbouer
 STR_0223_LAND_GENERATION                                        :{WHITE}Lân Generaasje
 STR_0224                                                        :{BLACK}{UPARROW}
 STR_0225                                                        :{BLACK}{DOWNARROW}
-STR_0226_RANDOM_LAND                                            :{BLACK}Samar wat lân
-STR_0227_RESET_LAND                                             :{BLACK}Set lân werom
 STR_0228_INCREASE_SIZE_OF_LAND_AREA                             :{BLACK}Fergrutsje gebiet om te ferheegjen/ferleegjen
 STR_0229_DECREASE_SIZE_OF_LAND_AREA                             :{BLACK}Ferlyts gebiet om te ferheegjen/ferleegjen
 STR_022A_GENERATE_RANDOM_LAND                                   :{BLACK}Meitsje samar wat lân
 STR_022B_RESET_LANDSCAPE                                        :{BLACK}Set it lânskip werom
 STR_022C_RESET_LANDSCAPE                                        :{WHITE}Lânskip weromsette
-STR_022D_ARE_YOU_SURE_YOU_WANT_TO                               :{WHITE}Bist der wis fan dast it lânskip weromsette wolst?
 STR_022E_LANDSCAPE_GENERATION                                   :{BLACK}Lânskip generaasje
 STR_022F_TOWN_GENERATION                                        :{BLACK}Stêd generaasje
 STR_0230_INDUSTRY_GENERATION                                    :{BLACK}Yndustry generaasje
@@ -1099,8 +1097,26 @@
 STR_482F_COST                                                   :{BLACK}Kostet: {YELLOW}{CURRENCY}
 
 ##id 0x5000
+STR_5006_MUST_DEMOLISH_TUNNEL_FIRST                             :{WHITE}Tunnel mat earst fuorthelle wurde
+STR_5007_MUST_DEMOLISH_BRIDGE_FIRST                             :{WHITE}Brêge mat earst fuorthelle wurde
+STR_5008_CANNOT_START_AND_END_ON                                :{WHITE}Begjin en ein kin net op itselde plak wêze
+STR_500A_START_AND_END_MUST_BE_IN                               :{WHITE}Begjin en ein mat yn ien lijn wêze
+STR_500D                                                        :{GOLD}{STRING},{} {VELOCITY} {WHITE}{CURRENCY}
+STR_5012_WOODEN                                                 :Hout
+STR_5013_CONCRETE                                               :Beton
+STR_5014_TUBULAR_STEEL                                          :Buis, Stiel
+STR_5015_CAN_T_BUILD_BRIDGE_HERE                                :{WHITE}Kin hjir gjin brêge bouwe...
+STR_5016_CAN_T_BUILD_TUNNEL_HERE                                :{WHITE}Kin hjir gjin tunnel bouwe...
+STR_5017_RAILROAD_TUNNEL                                        :Spoartunnel
+STR_501F_WOODEN_RAIL_BRIDGE                                     :Houten spoarbrêge
+STR_5020_CONCRETE_RAIL_BRIDGE                                   :Betonnen spoarbrêge
 
 ##id 0x5800
+STR_5800_OBJECT_IN_THE_WAY                                      :{WHITE}Objekt yn it paad
+STR_5801_TRANSMITTER                                            :Sendmast
+STR_5802_LIGHTHOUSE                                             :Fjoertoer
+STR_5806_CAN_T_PURCHASE_THIS_LAND                               :{WHITE}Kin dit stikje lân net keapje...
+STR_5807_YOU_ALREADY_OWN_IT                                     :{WHITE}...it is al fan dy!
 
 
 ############ WARNING, using range 0x6000 for strings that are stored in the savegame
@@ -1113,14 +1129,93 @@
 ##id 0x6800
 
 ############ range for difficulty levels starts
+STR_6801_EASY                                                   :{BLACK}Maklik
+STR_6802_MEDIUM                                                 :{BLACK}Gewoan
 ############ range for difficulty levels ends
 
 ############ range for difficulty settings starts
+STR_6805_MAXIMUM_NO_COMPETITORS                                 :{LTBLUE}Maksimum oantal tsjinstanders: {ORANGE}{COMMA}
+STR_6806_COMPETITOR_START_TIME                                  :{LTBLUE}Tsjinstander begjint: {ORANGE}{STRING}
+STR_6807_NO_OF_TOWNS                                            :{LTBLUE}Oantal stêden: {ORANGE}{STRING}
+STR_6808_NO_OF_INDUSTRIES                                       :{LTBLUE}Oantal yndustrieen: {ORANGE}{STRING}
+STR_680C_CONSTRUCTION_SPEED_OF_COMPETITOR                       :{LTBLUE}Konstruksjesnelhyd fan tsjinstanders: {ORANGE}{STRING}
+STR_6810_COST_OF_CONSTRUCTION                                   :{LTBLUE}Konstruksjekosten: {ORANGE}{STRING}
+STR_6811_TERRAIN_TYPE                                           :{LTBLUE}Terreinsoart: {ORANGE}{STRING}
+STR_6813_ECONOMY                                                :{LTBLUE}Ekonomy: {ORANGE}{STRING}
 ############ range for difficulty settings ends
 
 STR_26816_NONE                                                  :Gjin
+STR_6816_LOW                                                    :Leech
+STR_6817_NORMAL                                                 :Gewoan
+STR_6818_HIGH                                                   :Heech
+STR_6819                                                        :{BLACK}{SMALLLEFTARROW}
+STR_681A                                                        :{BLACK}{SMALLRIGHTARROW}
+STR_681B_VERY_SLOW                                              :Hiel dreech
+STR_681C_SLOW                                                   :Dreech
+STR_681D_MEDIUM                                                 :Gewoan
+STR_681E_FAST                                                   :Hurd
+STR_681F_VERY_FAST                                              :Hiel hurd
+STR_6820_LOW                                                    :Leech
+STR_6821_MEDIUM                                                 :Gewoan
+STR_6822_HIGH                                                   :Heech
+STR_6823_NONE                                                   :Gjin
+STR_6824_REDUCED                                                :Minder
+STR_6825_NORMAL                                                 :Gewoan
+STR_6826_X1_5                                                   :x1.5
+STR_6827_X2                                                     :x2
+STR_6828_X3                                                     :x3
+STR_6829_X4                                                     :x4
+STR_682A_VERY_FLAT                                              :Hiel Flak
+STR_682B_FLAT                                                   :Flak
+STR_682D_MOUNTAINOUS                                            :Bergachtich
+STR_682F_FLUCTUATING                                            :Wikseljend
+STR_6830_IMMEDIATE                                              :Fuortendaliks
+STR_6831_3_MONTHS_AFTER_PLAYER                                  :3 moannen nei spyler
+STR_6832_6_MONTHS_AFTER_PLAYER                                  :6 moannen nei spyler
+STR_6833_9_MONTHS_AFTER_PLAYER                                  :9 moannen nei spyler
+STR_6836_OFF                                                    :Ut
+STR_6837_ON                                                     :Oan
 
 ##id 0x7000
+STR_7000                                                        :
+STR_7001                                                        :{WHITE}{COMPANY} {BLACK}{PLAYERNAME}
+STR_7002_PLAYER                                                 :(Spyler {COMMA})
+STR_7004_NEW_FACE                                               :{BLACK}Nei Gesicht
+STR_7005_COLOR_SCHEME                                           :{BLACK}Kleurenskema
+STR_7006_COLOR_SCHEME                                           :{GOLD}Kleurenskema:
+STR_7007_NEW_COLOR_SCHEME                                       :{WHITE}Nei Kleurenskema
+STR_700E_FINANCES                                               :{WHITE}{COMPANY} Finansieen {BLACK}{PLAYERNAME}
+STR_700F_EXPENDITURE_INCOME                                     :{WHITE}Utjeften/Ynkomsten
+STR_7010                                                        :{WHITE}{NUM}
+STR_7011_CONSTRUCTION                                           :{GOLD}Konstruksje
+STR_7018_TRAIN_INCOME                                           :{GOLD}Ynkomsten Treinen
+STR_701A_AIRCRAFT_INCOME                                        :{GOLD}Ynkomsten Fleantúgen
+STR_701B_SHIP_INCOME                                            :{GOLD}Ynkomsten Skepen
+STR_701C_LOAN_INTEREST                                          :{GOLD}Rinte Liening
+STR_701D_OTHER                                                  :{GOLD}Oaren
+STR_701E                                                        :{BLACK}-{CURRENCY64}
+STR_701F                                                        :{BLACK}+{CURRENCY64}
+STR_7020_TOTAL                                                  :{WHITE}Totaal:
+STR_7021                                                        :{COMPANY}{PLAYERNAME}
+STR_7022_INCOME_GRAPH                                           :{WHITE}Ynkomsten Grafyk
+STR_7024                                                        :{COMMA}
+STR_7027_LOAN                                                   :{WHITE}Liening
+STR_7028                                                        :{BLACK}{CURRENCY64}
+STR_7029_BORROW                                                 :{BLACK}Lien {SKIP}{SKIP}{SKIP}{SKIP}{CURRENCY}
+STR_702A_REPAY                                                  :{BLACK}Betelje {SKIP}{SKIP}{SKIP}{SKIP}{CURRENCY} werom
+STR_702C_CAN_T_BORROW_ANY_MORE_MONEY                            :{WHITE}Kin net mear jild liene
+STR_702E_REQUIRED                                               :{WHITE}...{CURRENCY} nedich
+STR_702F_CAN_T_REPAY_LOAN                                       :{WHITE}Kin liening net werombetelje
+STR_7030_SELECT_NEW_FACE_FOR_PRESIDENT                          :{BLACK}Selektear nei gesicht foar de bedriuwslieder
+STR_7035_INCREASE_SIZE_OF_LOAN                                  :{BLACK}Lien mear jild
+STR_7036_REPAY_PART_OF_LOAN                                     :{BLACK}Betelje in diel fan de liening werom
+STR_7037_PRESIDENT                                              :{WHITE}{PLAYERNAME}{}{GOLD}(Bedriuwslieder)
+STR_7038_INAUGURATED                                            :{GOLD}Oprjochte: {WHITE}{NUM}
+STR_7042_NONE                                                   :{WHITE}Gjin
+STR_7044_MALE                                                   :{BLACK}Man
+STR_7045_FEMALE                                                 :{BLACK}Frou
+STR_7046_NEW_FACE                                               :{BLACK}Nei Gesicht
+STR_704C_KEY                                                    :{BLACK}Kaai
 
 
 
@@ -1135,6 +1230,7 @@
 
 
 
+
 ##id 0x9000
 
 
@@ -1164,6 +1260,7 @@
 
 
 
+
 ### depot strings
 
 
@@ -1194,4 +1291,8 @@
 ############ Tooltip measurment
 
 
+############ Date formatting
+
 ########
+
+
--- a/src/main_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/main_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -37,6 +37,7 @@
 #include "settings.h"
 #include "date.h"
 #include "vehicle_gui.h"
+#include "transparency_gui.h"
 #include "newgrf_config.h"
 
 #include "network/network_data.h"
@@ -160,8 +161,8 @@
 		case  8: _display_opt ^= DO_WAYPOINTS;          break;
 		case  9: _display_opt ^= DO_FULL_ANIMATION;     break;
 		case 10: _display_opt ^= DO_FULL_DETAIL;        break;
-		case 11: _display_opt ^= DO_TRANS_BUILDINGS;    break;
-		case 12: _display_opt ^= DO_TRANS_SIGNS;        break;
+		case 11: TOGGLEBIT(_transparent_opt, TO_BUILDINGS); break;
+		case 12: TOGGLEBIT(_transparent_opt, TO_SIGNS);     break;
 	}
 	MarkWholeScreenDirty();
 }
@@ -192,6 +193,7 @@
 		case 0: ShowSmallMap();            break;
 		case 1: ShowExtraViewPortWindow(); break;
 		case 2: ShowSignList();            break;
+		case 3: ShowTransparencyToolbar(); break;
 	}
 }
 
@@ -206,7 +208,8 @@
 		case 0: ShowSmallMap();            break;
 		case 1: ShowExtraViewPortWindow(); break;
 		case 2: ShowSignList();            break;
-		case 3: ShowTownDirectory();       break;
+		case 3: ShowTransparencyToolbar(); break;
+		case 4: ShowTownDirectory();       break;
 	}
 }
 
@@ -762,7 +765,7 @@
 
 static void ToolbarMapClick(Window *w)
 {
-	PopupMainToolbMenu(w, 4, STR_02DE_MAP_OF_WORLD, 3, 0);
+	PopupMainToolbMenu(w, 4, STR_02DE_MAP_OF_WORLD, 4, 0);
 }
 
 static void ToolbarTownClick(Window *w)
@@ -961,8 +964,8 @@
 	if (_display_opt & DO_WAYPOINTS)          SETBIT(x,  8);
 	if (_display_opt & DO_FULL_ANIMATION)     SETBIT(x,  9);
 	if (_display_opt & DO_FULL_DETAIL)        SETBIT(x, 10);
-	if (_display_opt & DO_TRANS_BUILDINGS)    SETBIT(x, 11);
-	if (_display_opt & DO_TRANS_SIGNS)        SETBIT(x, 12);
+	if (HASBIT(_transparent_opt, TO_BUILDINGS)) SETBIT(x, 11);
+	if (HASBIT(_transparent_opt, TO_SIGNS))     SETBIT(x, 12);
 	WP(w,menu_d).checked_items = x;
 }
 
@@ -1001,7 +1004,7 @@
 static void ToolbarScenMapTownDir(Window *w)
 {
 	/* Scenario editor button, *hack*hack* use different button to activate */
-	PopupMainToolbMenu(w, 8 | (17 << 8), STR_02DE_MAP_OF_WORLD, 4, 0);
+	PopupMainToolbMenu(w, 8 | (17 << 8), STR_02DE_MAP_OF_WORLD, 5, 0);
 }
 
 static void ToolbarScenZoomIn(Window *w)
@@ -2330,11 +2333,34 @@
 				break;
 #endif
 
-			case 'X':
-				_display_opt ^= DO_TRANS_BUILDINGS;
+			case '1' | WKC_CTRL:
+			case '2' | WKC_CTRL:
+			case '3' | WKC_CTRL:
+			case '4' | WKC_CTRL:
+			case '5' | WKC_CTRL:
+			case '6' | WKC_CTRL:
+			case '7' | WKC_CTRL:
+				/* Transparency toggle hot keys */
+				TOGGLEBIT(_transparent_opt, e->we.keypress.key - '1');
 				MarkWholeScreenDirty();
 				break;
 
+			case 'X' | WKC_CTRL:
+				ShowTransparencyToolbar();
+				break;
+
+			case 'X': {
+				static byte trans_opt = ~0;
+				if (_transparent_opt == 0) {
+					_transparent_opt = trans_opt;
+				} else {
+					trans_opt = _transparent_opt;
+					_transparent_opt = 0;
+				}
+				MarkWholeScreenDirty();
+				break;
+			}
+
 #ifdef ENABLE_NETWORK
 			case WKC_RETURN: case 'T': // smart chat; send to team if any, otherwise to all
 				if (_networking) {
--- a/src/misc/autocopyptr.hpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/misc/autocopyptr.hpp	Sun Apr 08 14:46:55 2007 +0000
@@ -8,7 +8,7 @@
  *  It is non-invasive smart pointer (reference counter is held outside
  *  of Tdata).
  *  When copied, its new copy shares the same underlaying structure Tdata.
- *  When dereferenced, its behavior depends on 2 factors:
+ *  When dereferenced, its behaviour depends on 2 factors:
  *     - whether the data is shared (used by more than one pointer)
  *     - type of access (read/write)
  *    When shared pointer is dereferenced for write, new clone of Tdata
--- a/src/namegen.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/namegen.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,6 +1,6 @@
 /* $Id$ */
 
-/** @file namegen.h */
+/** @file src/namegen.h Town name generator stuff */
 
 #ifndef NAMEGEN_H
 #define NAMEGEN_H
--- a/src/network/network_udp.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/network/network_udp.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -391,12 +391,13 @@
 		/* Don't know the GRF, so mark game incompatible and the (possibly)
 		 * already resolved name for this GRF (another server has sent the
 		 * name of the GRF already */
-		config->name     = FindUnknownGRFName(config->grfid, config->md5sum, true);
-		config->status   = GCS_NOT_FOUND;
+		config->name   = FindUnknownGRFName(config->grfid, config->md5sum, true);
+		config->status = GCS_NOT_FOUND;
 	} else {
-		config->filename = f->filename;
-		config->name     = f->name;
-		config->info     = f->info;
+		config->filename  = f->filename;
+		config->full_path = f->full_path;
+		config->name      = f->name;
+		config->info      = f->info;
 	}
 	SETBIT(config->flags, GCF_COPY);
 }
--- a/src/newgrf.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/newgrf.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -4305,7 +4305,7 @@
 
 	if (newfile == NULL) error ("Out of memory");
 
-	newfile->filename = strdup(config->filename);
+	newfile->filename = strdup(config->full_path);
 	newfile->sprite_offset = sprite_offset;
 
 	/* Copy the initial parameter list */
@@ -4583,7 +4583,7 @@
 
 void LoadNewGRFFile(GRFConfig *config, uint file_index, GrfLoadingStage stage)
 {
-	const char *filename = config->filename;
+	const char *filename = config->full_path;
 	uint16 num;
 
 	/* A .grf file is activated only if it was active when the game was
@@ -4699,7 +4699,7 @@
 			if (c->status == GCS_DISABLED || c->status == GCS_NOT_FOUND) continue;
 
 			/* @todo usererror() */
-			if (!FioCheckFileExists(c->filename)) error("NewGRF file is missing '%s'", c->filename);
+			if (!FileExists(c->full_path)) error("NewGRF file is missing '%s'", c->filename);
 
 			if (stage == GLS_LABELSCAN) InitNewGRFFile(c, _cur_spriteid);
 			LoadNewGRFFile(c, slot++, stage);
--- a/src/newgrf_callbacks.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/newgrf_callbacks.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,10 +1,11 @@
 /* $Id$ */
 
+/** @file newgrf_callbacks.h
+ */
+
 #ifndef NEWGRF_CALLBACKS_H
 #define NEWGRF_CALLBACKS_H
 
-/** @file newgrf_callbacks.h
- */
 
 /**
  * List of implemented NewGRF callbacks.
@@ -73,6 +74,9 @@
 	 * determine if a house should be destroyed. */
 	CBID_HOUSE_DESTRUCTION          = 0x21,
 
+	/* Called to determine if the given industry type is available */
+	CBID_INDUSTRY_AVAILABLE         = 0x22, // not yet implemented
+
 	/* This callback is called from vehicle purchase lists. It returns a value to be
 	 * used as a custom string ID in the 0xD000 range. */
 	CBID_VEHICLE_ADDITIONAL_TEXT    = 0x23,
@@ -80,10 +84,31 @@
 	/* Called when building a station to customize the tile layout */
 	CBID_STATION_TILE_LAYOUT        = 0x24,
 
+	/* Called for periodically starting or stopping the animation. */
+	CBID_INDTILE_ANIM_START_STOP    = 0x25, // not yet implemented
+
+	/* Called to determine industry tile next animation frame. */
+	CBID_INDTILE_ANIM_NEXT_FRAME    = 0x26, // not yet implemented
+
+	/* Called to indicate how long the current animation frame should last. */
+	CBID_INDTILE_ANIMATION_SPEED    = 0x27, // not yet implemented
+
+	/* Called to determine if the given industry can be built on specific area */
+	CBID_INDUSTRY_LOCATION          = 0x28, // not yet implemented
+
+	/* Called on production changes, so it can be adjusted */
+	CBID_INDUSTRY_PRODUCTION_CHANGE = 0x29, // not yet implemented
+
 	/* Called (if appropriate bit in callback mask is set) to determine which
 	 * cargoes a town building should accept. */
 	CBID_HOUSE_ACCEPT_CARGO         = 0x2A, // not yet implemented
 
+	/* Called to query the cargo acceptance of the industry tile */
+	CBID_INDTILE_ACCEPT_CARGO       = 0x2B, // not yet implemented
+
+	/* Called to determine which cargoes an industry should accept. */
+	CBID_INDUSTRY_ACCEPT_CARGO      = 0x2C, // not yet implemented
+
 	/* Called to determine if a specific colour map should be used for a vehicle
 	 * instead of the default livery */
 	CBID_VEHICLE_COLOUR_MAPPING     = 0x2D,
@@ -92,6 +117,12 @@
 	 * cargo a town building produces. */
 	CBID_HOUSE_PRODUCE_CARGO        = 0x2E, // not yet implemented
 
+	/* Called to determine if the given industry tile can be built on specific tile */
+	CBID_INDTILE_SHAPE_CHECK        = 0x2F, // not yet implemented
+
+	/* Called to determine the type (if any) of foundation to draw for industry tile */
+	CBID_INDUSTRY_DRAW_FOUNDATIONS  = 0x30, // not yet implemented
+
 	/* Called when the player (or AI) tries to start or stop a vehicle. Mainly
 	 * used for preventing a vehicle from leaving the depot. */
 	CBID_VEHICLE_START_STOP_CHECK   = 0x31,
@@ -99,9 +130,30 @@
 	/* Called to play a special sound effect */
 	CBID_VEHICLE_SOUND_EFFECT       = 0x33,
 
+	/* Called monthly on production changes, so it can be adjusted more frequently */
+	CBID_INDUSTRY_MONTHLYPROD_CHANGE= 0x35, // not yet implemented
+
+	/* Called to determine text to display after cargo name */
+	CBID_INDUSTRY_CARGO_SUFFIX      = 0x37, // not yet implemented
+
+	/* Called to determine more text in the fund industry window */
+	CBID_INDUSTRY_FUND_MORE_TEXT    = 0x38, // not yet implemented
+
 	/* Called to calculate the income of delivered cargo */
 	CBID_CARGO_PROFIT_CALC          = 0x39,
 
+	/* Called to determine more text in the industry window */
+	CBID_INDUSTRY_WINDOW_MORE_TEXT  = 0x3A, // not yet implemented
+
+	/* Called to determine industry special effects */
+	CBID_INDUSTRY_SPECIAL_EFFECT    = 0x3B, // not yet implemented
+
+	/* Called to determine if industry can alter the ground below industry tile */
+	CBID_INDUSTRY_AUTOSLOPE         = 0x3C, // not yet implemented
+
+	/* Called to determine if the industry can still accept or refuse  more cargo arrival */
+	CBID_INDUSTRY_REFUSE_CARGO      = 0x3D, // not yet implemented
+
 	/* Called (if appropriate bit in callback mask set) to determine whether a
 	 * town building can be destroyed. */
 	CBID_HOUSE_DENY_DESTRUCTION     = 0x143,
@@ -159,6 +211,36 @@
 };
 
 /**
+ * Callback masks for Industries
+ */
+enum IndustryCallbackMask {
+	CBM_IND_AVAILABLE                 = 0,  ///< industry availability callback
+	CBM_IND_PRODUCTION_CARGO_ARRIVAL  = 1,  ///< call production callback when cargo arrives at the industry
+	CBM_IND_PRODUCTION_256_TICKS      = 2,  ///< call production callback every 256 ticks
+	CBM_IND_LOCATION                  = 3,  ///< check industry construction on given area
+	CBM_IND_PRODUCTION_CHANGE         = 4,  ///< controls random production change
+	CBM_IND_MONTHLYPROD_CHANGE        = 5,  ///< controls monthly random production change
+	CBM_IND_CARGO_SUFFIX              = 6,  ///< cargo sub-type display
+	CBM_IND_FUND_MORE_TEXT            = 7,  ///< additional text in fund window
+	CBM_IND_WINDOW_MORE_TEXT          = 8,  ///< additional text in industry window
+	CBM_IND_SPECIAL_EFFECT            = 9,  ///< control special effects
+	CBM_IND_REFUSE_CARGO              = 10, ///< option out of accepting cargo
+};
+
+/**
+ * Callback masks for industry tiles
+ */
+enum IndustryTileCallbackMask {
+	CBM_INDT_ANIM_NEXT_FRAME          = 0,  ///< decides next animation frame
+	CBM_INDT_ANIM_SPEED               = 1,  ///< decides animation speed
+	CBM_INDT_ACCEPTANCE_CARGO         = 2,  ///< decides amount of cargo acceptance
+	CBM_INDT_ACCEPT_CARGO             = 3,  ///< decides accepted types
+	CBM_INDT_SHAPE_CHECK              = 4,  ///< decides slope suitability
+	CBM_INDT_DRAW_FOUNDATIONS         = 5,  ///< decides if default foundations need to be drawn
+	CBM_INDT_AUTOSLOPE                = 6,  ///< decides allowance of autosloping
+};
+
+/**
  * Result of a failed callback.
  */
 enum {
--- a/src/newgrf_config.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/newgrf_config.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,6 +1,6 @@
 /* $Id$ */
 
-/** @file newgfr_config.cpp */
+/** @file newgrf_config.cpp */
 
 #include "stdafx.h"
 #include "openttd.h"
@@ -35,14 +35,12 @@
 static bool CalcGRFMD5Sum(GRFConfig *config)
 {
 	FILE *f;
-	char filename[MAX_PATH];
 	md5_state_t md5state;
 	md5_byte_t buffer[1024];
 	size_t len;
 
 	/* open the file */
-	snprintf(filename, lengthof(filename), "%s%s", _paths.data_dir, config->filename);
-	f = fopen(filename, "rb");
+	f = fopen(config->full_path, "rb");
 	if (f == NULL) return false;
 
 	/* calculate md5sum */
@@ -61,11 +59,15 @@
 /* Find the GRFID and calculate the md5sum */
 bool FillGRFDetails(GRFConfig *config, bool is_static)
 {
-	if (!FioCheckFileExists(config->filename)) {
+	if (!FileExists(config->full_path)) {
 		config->status = GCS_NOT_FOUND;
 		return false;
 	}
 
+	if (config->filename == NULL) {
+		config->filename = strdup(strrchr(config->full_path, PATHSEPCHAR) + 1);
+	}
+
 	/* Find and load the Action 8 information */
 	/* 62 is the last file slot before sample.cat.
 	 * Should perhaps be some "don't care" value */
@@ -91,6 +93,7 @@
 	/* GCF_COPY as in NOT strdupped/alloced the filename, name and info */
 	if (!HASBIT((*config)->flags, GCF_COPY)) {
 		free((*config)->filename);
+		free((*config)->full_path);
 		free((*config)->name);
 		free((*config)->info);
 		free((*config)->error);
@@ -123,10 +126,11 @@
 	for (; src != NULL; src = src->next) {
 		GRFConfig *c = CallocT<GRFConfig>(1);
 		*c = *src;
-		if (src->filename != NULL) c->filename = strdup(src->filename);
-		if (src->name     != NULL) c->name     = strdup(src->name);
-		if (src->info     != NULL) c->info     = strdup(src->info);
-		if (src->error    != NULL) {
+		if (src->filename  != NULL) c->filename  = strdup(src->filename);
+		if (src->full_path != NULL) c->full_path = strdup(src->full_path);
+		if (src->name      != NULL) c->name      = strdup(src->name);
+		if (src->info      != NULL) c->info      = strdup(src->info);
+		if (src->error     != NULL) {
 			c->error = CallocT<GRFError>(1);
 			memcpy(c->error, src->error, sizeof(GRFError));
 		}
@@ -255,7 +259,9 @@
 			 * already a local one, so there is no need to replace it. */
 			if (!HASBIT(c->flags, GCF_COPY)) {
 				free(c->filename);
+				free(c->full_path);
 				c->filename = strdup(f->filename);
+				c->full_path = strdup(f->full_path);
 				memcpy(c->md5sum, f->md5sum, sizeof(c->md5sum));
 				if (c->name == NULL && f->name != NULL) c->name = strdup(f->name);
 				if (c->info == NULL && f->info != NULL) c->info = strdup(f->info);
@@ -278,7 +284,7 @@
 	struct dirent *dirent;
 	DIR *dir;
 
-	if ((dir = ttd_opendir(path)) == NULL) return 0;
+	if (path == NULL || (dir = ttd_opendir(path)) == NULL) return 0;
 
 	while ((dirent = readdir(dir)) != NULL) {
 		const char *d_name = FS2OTTD(dirent->d_name);
@@ -286,24 +292,25 @@
 
 		if (!FiosIsValidFile(path, dirent, &sb)) continue;
 
-		snprintf(filename, lengthof(filename), "%s" PATHSEP "%s", path, d_name);
+		snprintf(filename, lengthof(filename), "%s%s", path, d_name);
 
 		if (sb.st_mode & S_IFDIR) {
 			/* Directory */
 			if (strcmp(d_name, ".") == 0 || strcmp(d_name, "..") == 0) continue;
+			AppendPathSeparator(filename, lengthof(filename));
 			num += ScanPath(filename);
 		} else if (sb.st_mode & S_IFREG) {
 			/* File */
 			char *ext = strrchr(filename, '.');
-			char *file = filename + strlen(_paths.data_dir) + 1; // Crop base path
 
 			/* If no extension or extension isn't .grf, skip the file */
 			if (ext == NULL) continue;
 			if (strcasecmp(ext, ".grf") != 0) continue;
 
 			GRFConfig *c = CallocT<GRFConfig>(1);
-			c->filename = strdup(file);
+			c->full_path = strdup(filename);
 
+			bool added = true;
 			if (FillGRFDetails(c, false)) {
 				if (_all_grfs == NULL) {
 					_all_grfs = c;
@@ -312,20 +319,28 @@
 					 * name, so the list is sorted as we go along */
 					GRFConfig **pd, *d;
 					for (pd = &_all_grfs; (d = *pd) != NULL; pd = &d->next) {
+						if (c->grfid == d->grfid && memcmp(c->md5sum, d->md5sum, sizeof(c->md5sum)) == 0) added = false;
 						if (strcasecmp(c->name, d->name) <= 0) break;
 					}
-					c->next = d;
-					*pd = c;
+					if (added) {
+						c->next = d;
+						*pd = c;
+					}
 				}
+			} else {
+				added = false;
+			}
 
-				num++;
-			} else {
+			if (!added) {
 				/* File couldn't be opened, or is either not a NewGRF or is a
-				 * 'system' NewGRF, so forget about it. */
+				 * 'system' NewGRF or it's already known, so forget about it. */
 				free(c->filename);
+				free(c->full_path);
 				free(c->name);
 				free(c->info);
 				free(c);
+			} else {
+				num++;
 			}
 		}
 	}
@@ -344,7 +359,8 @@
 	ClearGRFConfigList(&_all_grfs);
 
 	DEBUG(grf, 1, "Scanning for NewGRFs");
-	num = ScanPath(_paths.data_dir);
+	num  = ScanPath(_paths.data_dir);
+	num += ScanPath(_paths.second_data_dir);
 	DEBUG(grf, 1, "Scan complete, found %d files", num);
 }
 
--- a/src/newgrf_config.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/newgrf_config.h	Sun Apr 08 14:46:55 2007 +0000
@@ -45,6 +45,7 @@
 
 struct GRFConfig : public GRFIdentifier {
 	char *filename;
+	char *full_path;
 	char *name;
 	char *info;
 	GRFError *error;
--- a/src/newgrf_house.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/newgrf_house.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -406,7 +406,7 @@
 		image = dtss->image + stage;
 		pal   = dtss->pal;
 
-		if (!HASBIT(image, SPRITE_MODIFIER_OPAQUE) && ((_display_opt & DO_TRANS_BUILDINGS))) {
+		if (!HASBIT(image, SPRITE_MODIFIER_OPAQUE) && HASBIT(_transparent_opt, TO_HOUSES)) {
 			SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 			pal = PALETTE_TO_TRANSPARENT;
 		} else if (HASBIT(image, PALETTE_MODIFIER_COLOR)) {
--- a/src/news_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/news_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -128,10 +128,11 @@
 					DrawStringMultiCenter(215, ni->display_mode == NM_NORMAL ? 76 : 56,
 						ni->string_id, w->width - 4);
 				} else {
-					byte bk = _display_opt;
-					_display_opt &= ~DO_TRANS_BUILDINGS;
+					/* Back up transparency options to draw news view */
+					byte to_backup = _transparent_opt;
+					_transparent_opt = 0;
 					DrawWindowViewport(w);
-					_display_opt = bk;
+					_transparent_opt = to_backup;
 
 					/* Shade the viewport into gray, or color*/
 					vp = w->viewport;
--- a/src/openttd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/openttd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -310,7 +310,10 @@
 	char filename[256];
 
 	_game_mode = GM_MENU;
-	CLRBITS(_display_opt, DO_TRANS_BUILDINGS); // don't make buildings transparent in intro
+
+	/* Clear transparency options */
+	_transparent_opt = 0;
+
 	_opt_ptr = &_opt_newgame;
 	ResetGRFConfig(false);
 
--- a/src/openttd.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/openttd.h	Sun Apr 08 14:46:55 2007 +0000
@@ -175,10 +175,18 @@
 	DO_SHOW_STATION_NAMES = 1 << 1,
 	DO_SHOW_SIGNS         = 1 << 2,
 	DO_FULL_ANIMATION     = 1 << 3,
-	DO_TRANS_BUILDINGS    = 1 << 4,
 	DO_FULL_DETAIL        = 1 << 5,
 	DO_WAYPOINTS          = 1 << 6,
-	DO_TRANS_SIGNS        = 1 << 7,
+};
+
+enum {
+	TO_SIGNS,
+	TO_TREES,
+	TO_HOUSES,
+	TO_INDUSTRIES,
+	TO_BUILDINGS,
+	TO_BRIDGES,
+	TO_STRUCTURES,
 };
 
 /* Landscape types */
@@ -461,6 +469,7 @@
 	WC_GENERATE_LANDSCAPE,
 	WC_GENERATE_PROGRESS_WINDOW,
 	WC_CONFIRM_POPUP_QUERY,
+	WC_TRANSPARENCY_TOOLBAR,
 };
 
 
--- a/src/players.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/players.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -819,8 +819,8 @@
 		}
 
 		/* This is the joining client who wants a new company */
-		if (_local_player != _network_playas) {
-			assert(_local_player == PLAYER_SPECTATOR && _network_playas == p->index);
+		if (_local_player != _network_playas && _network_playas == p->index) {
+			assert(_local_player == PLAYER_SPECTATOR);
 			SetLocalPlayer(p->index);
 			MarkWholeScreenDirty();
 		}
--- a/src/rail.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/rail.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file rail.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "bridge_map.h"
@@ -79,7 +81,7 @@
 	{TRACKDIR_RIGHT_N,  TRACKDIR_RIGHT_S,  INVALID_TRACKDIR,  INVALID_TRACKDIR}
 };
 
-extern const Trackdir _track_enterdir_to_trackdir[][DIAGDIR_END] = { // TODO: replace magic with enums
+extern const Trackdir _track_enterdir_to_trackdir[][DIAGDIR_END] = {
 	{TRACKDIR_X_NE,     INVALID_TRACKDIR,  TRACKDIR_X_SW,     INVALID_TRACKDIR},
 	{INVALID_TRACKDIR,  TRACKDIR_Y_SE,     INVALID_TRACKDIR,  TRACKDIR_Y_NW},
 	{INVALID_TRACKDIR,  TRACKDIR_UPPER_E,  TRACKDIR_UPPER_W,  INVALID_TRACKDIR},
--- a/src/rail.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/rail.h	Sun Apr 08 14:46:55 2007 +0000
@@ -223,7 +223,7 @@
 	 * 1) All the sprites in a railset MUST be in the same order. This order
 	 *    is determined by normal rail. Check sprites 1005 and following for this order<p>
 	 * 2) The position where the railtype is loaded must always be the same, otherwise
-	 *    the offset will fail.<p>
+	 *    the offset will fail.
 	 * @note: Something more flexible might be desirable in the future.
 	 */
 	SpriteID total_offset;
@@ -240,10 +240,10 @@
 };
 
 
-// these are the maximums used for updating signal blocks, and checking if a depot is in a pbs block
+/** these are the maximums used for updating signal blocks, and checking if a depot is in a pbs block */
 enum {
-	NUM_SSD_ENTRY = 256, // max amount of blocks
-	NUM_SSD_STACK =  32, // max amount of blocks to check recursively
+	NUM_SSD_ENTRY = 256, ///< max amount of blocks
+	NUM_SSD_STACK =  32, ///< max amount of blocks to check recursively
 };
 
 /**
--- a/src/rail_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/rail_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file rail_cmd.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "bridge_map.h"
@@ -77,8 +79,8 @@
 
 static bool CheckTrackCombination(TileIndex tile, TrackBits to_build, uint flags)
 {
-	TrackBits current; /* The current track layout */
-	TrackBits future; /* The track layout we want to build */
+	TrackBits current; // The current track layout
+	TrackBits future;  // The track layout we want to build
 	_error_message = STR_1001_IMPOSSIBLE_TRACK_COMBINATION;
 
 	if (!IsPlainRailTile(tile)) return false;
@@ -109,7 +111,7 @@
 
 static const TrackBits _valid_tileh_slopes[][15] = {
 
-// set of normal ones
+/* set of normal ones */
 {
 	TRACK_BIT_ALL,
 	TRACK_BIT_RIGHT,
@@ -131,7 +133,7 @@
 	TRACK_BIT_RIGHT,
 },
 
-// allowed rail for an evenly raised platform
+/* allowed rail for an evenly raised platform */
 {
 	TRACK_BIT_NONE,
 	TRACK_BIT_LEFT,
@@ -197,13 +199,13 @@
 	} else {
 		rail_bits |= existing;
 
-		// don't allow building on the lower side of a coast
+		/* don't allow building on the lower side of a coast */
 		if (IsTileType(tile, MP_WATER) &&
 				~_valid_tileh_slopes[1][tileh] & rail_bits) {
 			return_cmd_error(STR_3807_CAN_T_BUILD_ON_WATER);
 		}
 
-		// no special foundation
+		/* no special foundation */
 		if ((~_valid_tileh_slopes[0][tileh] & rail_bits) == 0)
 			return 0;
 
@@ -252,12 +254,12 @@
 	switch (GetTileType(tile)) {
 		case MP_RAILWAY:
 			if (!CheckTrackCombination(tile, trackbit, flags) ||
-					!EnsureNoVehicle(tile)) {
+					!EnsureNoVehicleOnGround(tile)) {
 				return CMD_ERROR;
 			}
 			if (!IsTileOwner(tile, _current_player) ||
 					!IsCompatibleRail(GetRailType(tile), railtype)) {
-				// Get detailed error message
+				/* Get detailed error message */
 				return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 			}
 
@@ -287,7 +289,7 @@
 			}
 #undef M
 
-			if (!EnsureNoVehicle(tile)) return CMD_ERROR;
+			if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 
 			if (GetRoadTileType(tile) == ROAD_TILE_NORMAL) {
 				if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS);
@@ -350,7 +352,7 @@
 			if (!IsLevelCrossing(tile) ||
 					GetCrossingRailBits(tile) != trackbit ||
 					(_current_player != OWNER_WATER && !CheckTileOwnership(tile)) ||
-					!EnsureNoVehicle(tile)) {
+					!EnsureNoVehicleOnGround(tile)) {
 				return CMD_ERROR;
 			}
 
@@ -365,7 +367,7 @@
 
 			if (!IsPlainRailTile(tile) ||
 					(_current_player != OWNER_WATER && !CheckTileOwnership(tile)) ||
-					!EnsureNoVehicle(tile)) {
+					!EnsureNoVehicleOnGround(tile)) {
 				return CMD_ERROR;
 			}
 
@@ -432,11 +434,11 @@
 
 	if (!ValParamTrackOrientation(TrackdirToTrack(*trackdir))) return CMD_ERROR;
 
-	// calculate delta x,y from start to end tile
+	/* calculate delta x,y from start to end tile */
 	dx = ex - x;
 	dy = ey - y;
 
-	// calculate delta x,y for the first direction
+	/* calculate delta x,y for the first direction */
 	trdx = _trackdelta[*trackdir].x;
 	trdy = _trackdelta[*trackdir].y;
 
@@ -445,7 +447,7 @@
 		trdy += _trackdelta[*trackdir ^ 1].y;
 	}
 
-	// validate the direction
+	/* validate the direction */
 	while (
 		(trdx <= 0 && dx > 0) ||
 		(trdx >= 0 && dx < 0) ||
@@ -461,8 +463,8 @@
 		}
 	}
 
-	// (for diagonal tracks, this is already made sure of by above test), but:
-	// for non-diagonal tracks, check if the start and end tile are on 1 line
+	/* (for diagonal tracks, this is already made sure of by above test), but:
+	 * for non-diagonal tracks, check if the start and end tile are on 1 line */
 	if (!IsDiagonalTrackdir(*trackdir)) {
 		trdx = _trackdelta[*trackdir].x;
 		trdy = _trackdelta[*trackdir].y;
@@ -515,7 +517,7 @@
 
 		tile += ToTileIndexDiff(_trackdelta[trackdir]);
 
-		// toggle railbit for the non-diagonal tracks
+		/* toggle railbit for the non-diagonal tracks */
 		if (!IsDiagonalTrackdir(trackdir)) ToggleBitT(trackdir, 0);
 	}
 
@@ -620,7 +622,7 @@
 	SignalVariant sigvar = (pre_signal ^ HASBIT(p1, 4)) ? SIG_SEMAPHORE : SIG_ELECTRIC;
 	int32 cost;
 
-	if (!ValParamTrackOrientation(track) || !IsTileType(tile, MP_RAILWAY) || !EnsureNoVehicle(tile))
+	if (!ValParamTrackOrientation(track) || !IsTileType(tile, MP_RAILWAY) || !EnsureNoVehicleOnGround(tile))
 		return CMD_ERROR;
 
 	/* Protect against invalid signal copying */
@@ -646,35 +648,35 @@
 	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
 
 	if (!HasSignalOnTrack(tile, track)) {
-		// build new signals
+		/* build new signals */
 		cost = _price.build_signals;
 	} else {
 		if (p2 != 0 && sigvar != GetSignalVariant(tile)) {
-			// convert signals <-> semaphores
+			/* convert signals <-> semaphores */
 			cost = _price.build_signals + _price.remove_signals;
 		} else {
-			// it is free to change orientation/pre-exit-combo signals
+			/* it is free to change orientation/pre-exit-combo signals */
 			cost = 0;
 		}
 	}
 
 	if (flags & DC_EXEC) {
 		if (!HasSignals(tile)) {
-			// there are no signals at all on this tile yet
+			/* there are no signals at all on this tile yet */
 			SetHasSignals(tile, true);
 			_m[tile].m2 |= 0xF0;              // all signals are on
-			_m[tile].m3 &= ~0xF0;          // no signals built by default
+			_m[tile].m3 &= ~0xF0;             // no signals built by default
 			SetSignalType(tile, SIGTYPE_NORMAL);
 			SetSignalVariant(tile, sigvar);
 		}
 
 		if (p2 == 0) {
 			if (!HasSignalOnTrack(tile, track)) {
-				// build new signals
+				/* build new signals */
 				_m[tile].m3 |= SignalOnTrack(track);
 			} else {
 				if (pre_signal) {
-					// cycle between normal -> pre -> exit -> combo -> ...
+					/* cycle between normal -> pre -> exit -> combo -> ... */
 					SignalType type = GetSignalType(tile);
 
 					SetSignalType(tile, type == SIGTYPE_COMBO ? SIGTYPE_NORMAL : (SignalType)(type + 1));
@@ -738,12 +740,12 @@
 
 	track = TrackdirToTrack(trackdir); /* trackdir might have changed, keep track in sync */
 
-	// copy the signal-style of the first rail-piece if existing
+	/* copy the signal-style of the first rail-piece if existing */
 	if (HasSignals(tile)) {
 		signals = _m[tile].m3 & SignalOnTrack(track);
 		if (signals == 0) signals = SignalOnTrack(track); /* Can this actually occur? */
 
-		// copy signal/semaphores style (independent of CTRL)
+		/* copy signal/semaphores style (independent of CTRL) */
 		semaphores = GetSignalVariant(tile) != SIG_ELECTRIC;
 	} else { // no signals exist, drag a two-way signal stretch
 		signals = SignalOnTrack(track);
@@ -759,7 +761,7 @@
 	 * remove     - 1 remove signals, 0 build signals */
 	signal_ctr = total_cost = 0;
 	for (;;) {
-		// only build/remove signals with the specified density
+		/* only build/remove signals with the specified density */
 		if (signal_ctr % signal_density == 0) {
 			uint32 p1 = GB(TrackdirToTrack(trackdir), 0, 3);
 			SB(p1, 3, 1, mode);
@@ -778,7 +780,7 @@
 		tile += ToTileIndexDiff(_trackdelta[trackdir]);
 		signal_ctr++;
 
-		// toggle railbit for the non-diagonal tracks (|, -- tracks)
+		/* toggle railbit for the non-diagonal tracks (|, -- tracks) */
 		if (!IsDiagonalTrackdir(trackdir)) ToggleBitT(trackdir, 0);
 	}
 
@@ -807,7 +809,7 @@
 
 	if (!ValParamTrackOrientation(track) ||
 			!IsTileType(tile, MP_RAILWAY) ||
-			!EnsureNoVehicle(tile) ||
+			!EnsureNoVehicleOnGround(tile) ||
 			!HasSignalOnTrack(tile, track)) {
 		return CMD_ERROR;
 	}
@@ -864,17 +866,17 @@
 
 	if (GetRailType(tile) == totype) return CMD_ERROR;
 
-	if (!EnsureNoVehicle(tile) && (!IsCompatibleRail(GetRailType(tile), totype) || IsPlainRailTile(tile))) return CMD_ERROR;
+	if (!EnsureNoVehicleOnGround(tile) && (!IsCompatibleRail(GetRailType(tile), totype) || IsPlainRailTile(tile))) return CMD_ERROR;
 
-	// 'hidden' elrails can't be downgraded to normal rail when elrails are disabled
+	/* 'hidden' elrails can't be downgraded to normal rail when elrails are disabled */
 	if (_patches.disable_elrails && totype == RAILTYPE_RAIL && GetRailType(tile) == RAILTYPE_ELECTRIC) return CMD_ERROR;
 
-	// change type.
+	/* change type. */
 	if (exec) {
 		SetRailType(tile, totype);
 		MarkTileDirtyByTile(tile);
 
-		// notify YAPF about the track layout change
+		/* notify YAPF about the track layout change */
 		TrackBits tracks = GetTrackBits(tile);
 		while (tracks != TRACK_BIT_NONE) {
 			YapfNotifyTrackLayoutChange(tile, RemoveFirstTrack(&tracks));
@@ -920,7 +922,7 @@
 	if (!ValParamRailtype(p2)) return CMD_ERROR;
 	if (p1 >= MapSize()) return CMD_ERROR;
 
-	// make sure sx,sy are smaller than ex,ey
+	/* make sure sx,sy are smaller than ex,ey */
 	ex = TileX(tile);
 	ey = TileY(tile);
 	sx = TileX(p1);
@@ -968,7 +970,7 @@
 	if (!CheckTileOwnership(tile) && _current_player != OWNER_WATER)
 		return CMD_ERROR;
 
-	if (!EnsureNoVehicle(tile))
+	if (!EnsureNoVehicleOnGround(tile))
 		return CMD_ERROR;
 
 	if (flags & DC_EXEC) {
@@ -1185,7 +1187,7 @@
 	SpriteID pal = PAL_NONE;
 	bool junction = false;
 
-	// Select the sprite to use.
+	/* Select the sprite to use. */
 	(image = rti->base_sprites.track_y, track == TRACK_BIT_Y) ||
 	(image++,                           track == TRACK_BIT_X) ||
 	(image++,                           track == TRACK_BIT_UPPER) ||
@@ -1209,8 +1211,8 @@
 
 		if (foundation != 0) DrawFoundation(ti, foundation);
 
-		// DrawFoundation() modifies ti.
-		// Default sloped sprites..
+		/* DrawFoundation() modifies it.
+		 * Default sloped sprites.. */
 		if (ti->tileh != SLOPE_FLAT)
 			image = _track_sloped_sprites[ti->tileh - 1] + rti->base_sprites.track_y;
 	}
@@ -1223,7 +1225,7 @@
 
 	DrawGroundSprite(image, pal);
 
-	// Draw track pieces individually for junction tiles
+	/* Draw track pieces individually for junction tiles */
 	if (junction) {
 		if (track & TRACK_BIT_X)     DrawGroundSprite(rti->base_sprites.single_y, PAL_NONE);
 		if (track & TRACK_BIT_Y)     DrawGroundSprite(rti->base_sprites.single_x, PAL_NONE);
@@ -1285,7 +1287,7 @@
 
 		if (HasSignals(ti->tile)) DrawSignals(ti->tile, rails);
 	} else {
-		// draw depot/waypoint
+		/* draw depot/waypoint */
 		const DrawTileSprites* dts;
 		const DrawTileSeqStruct* dtss;
 		uint32 relocation;
@@ -1300,8 +1302,8 @@
 			image = dts->ground_sprite;
 			if (image != SPR_FLAT_GRASS_TILE) image += rti->total_offset;
 
-			// adjust ground tile for desert
-			// don't adjust for snow, because snow in depots looks weird
+			/* adjust ground tile for desert
+			 * don't adjust for snow, because snow in depots looks weird */
 			if (IsSnowRailGround(ti->tile) && _opt.landscape == LT_TROPIC) {
 				if (image != SPR_FLAT_GRASS_TILE) {
 					image += rti->snow_offset; // tile with tracks
@@ -1310,12 +1312,12 @@
 				}
 			}
 		} else {
-			// look for customization
+			/* look for customization */
 			byte stat_id = GetWaypointByTile(ti->tile)->stat_id;
 			const StationSpec *statspec = GetCustomStationSpec(STAT_CLASS_WAYP, stat_id);
 
 			if (statspec != NULL) {
-				// emulate station tile - open with building
+				/* emulate station tile - open with building */
 				const Station* st = ComposeWaypointStation(ti->tile);
 				uint gfx = 2;
 
@@ -1345,7 +1347,7 @@
 				}
 			} else {
 default_waypoint:
-				// There is no custom layout, fall back to the default graphics
+				/* There is no custom layout, fall back to the default graphics */
 				dts = &_waypoint_gfx_table[GetWaypointAxis(ti->tile)];
 				relocation = 0;
 				image = dts->ground_sprite + rti->total_offset;
@@ -1370,7 +1372,7 @@
 				image += relocation;
 			}
 
-			if (_display_opt & DO_TRANS_BUILDINGS) {
+			if (HASBIT(_transparent_opt, TO_BUILDINGS)) {
 				SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 				pal = PALETTE_TO_TRANSPARENT;
 			} else if (HASBIT(image, PALETTE_MODIFIER_COLOR)) {
@@ -1432,15 +1434,15 @@
 	bool stop;
 	bool has_presignal;
 
-	// presignal info
+	/* presignal info */
 	int presignal_exits;
 	int presignal_exits_free;
 
-	// these are used to keep track of the signals that change.
+	/* these are used to keep track of the signals that change. */
 	TrackdirByte bit[NUM_SSD_ENTRY];
 	TileIndex tile[NUM_SSD_ENTRY];
 
-	// these are used to keep track of the stack that modifies presignals recursively
+	/* these are used to keep track of the stack that modifies presignals recursively */
 	TileIndex next_tile[NUM_SSD_STACK];
 	DiagDirectionByte next_dir[NUM_SSD_STACK];
 
@@ -1452,22 +1454,22 @@
 
 	if (!IsTileType(tile, MP_RAILWAY)) return false;
 
-	// the tile has signals?
+	/* the tile has signals? */
 	if (HasSignalOnTrack(tile, TrackdirToTrack(trackdir))) {
 		if (HasSignalOnTrackdir(tile, ReverseTrackdir(trackdir))) {
-			// yes, add the signal to the list of signals
+			/* yes, add the signal to the list of signals */
 			if (ssd->cur != NUM_SSD_ENTRY) {
 				ssd->tile[ssd->cur] = tile; // remember the tile index
 				ssd->bit[ssd->cur] = trackdir; // and the controlling bit number
 				ssd->cur++;
 			}
 
-			// remember if this block has a presignal.
+			/* remember if this block has a presignal. */
 			ssd->has_presignal |= IsPresignalEntry(tile);
 		}
 
 		if (HasSignalOnTrackdir(tile, trackdir) && IsPresignalExit(tile)) {
-			// this is an exit signal that points out from the segment
+			/* this is an exit signal that points out from the segment */
 			ssd->presignal_exits++;
 			if (GetSignalStateByTrackdir(tile, trackdir) != SIGNAL_STATE_RED)
 				ssd->presignal_exits_free++;
@@ -1525,21 +1527,21 @@
 
 		dest.track = 1 << (direction & 1); // get the trackbit the vehicle would have if it has not entered the tunnel yet (ie is still visible)
 
-		// check for a vehicle with that trackdir on the start tile of the tunnel
+		/* check for a vehicle with that trackdir on the start tile of the tunnel */
 		if (VehicleFromPos(tile, &dest, SignalVehicleCheckProc) != NULL) return true;
 
-		// check for a vehicle with that trackdir on the end tile of the tunnel
+		/* check for a vehicle with that trackdir on the end tile of the tunnel */
 		if (VehicleFromPos(end, &dest, SignalVehicleCheckProc) != NULL) return true;
 
-		// now check all tiles from start to end for a warping vehicle
-		// NOTE: the hashes for tiles may overlap, so this could maybe be optimised a bit by not checking every tile?
+		/* now check all tiles from start to end for a warping vehicle
+		 * NOTE: the hashes for tiles may overlap, so this could maybe be optimised a bit by not checking every tile? */
 		dest.track = 0x40;   //Vehicle inside a tunnel or on a bridge
 		for (; tile != end; tile += TileOffsByDiagDir(direction)) {
 			if (VehicleFromPos(tile, &dest, SignalVehicleCheckProc) != NULL)
 				return true;
 		}
 
-		// no vehicle found
+		/* no vehicle found */
 		return false;
 	}
 
@@ -1594,39 +1596,39 @@
 {
 	int i;
 
-	// thinking about presignals...
-	// the presignal is green if,
-	//   if no train is in the segment AND
-	//   there is at least one green exit signal OR
-	//   there are no exit signals in the segment
+	/* thinking about presignals...
+	 * the presignal is green if,
+	 *   if no train is in the segment AND
+	 *   there is at least one green exit signal OR
+	 *   there are no exit signals in the segment */
 
-	// then mark the signals in the segment accordingly
+	/* then mark the signals in the segment accordingly */
 	for (i = 0; i != ssd->cur; i++) {
 		TileIndex tile = ssd->tile[i];
 		byte bit = SignalAgainstTrackdir(ssd->bit[i]);
 		uint16 m2 = _m[tile].m2;
 
-		// presignals don't turn green if there is at least one presignal exit and none are free
+		/* presignals don't turn green if there is at least one presignal exit and none are free */
 		if (IsPresignalEntry(tile)) {
 			int ex = ssd->presignal_exits, exfree = ssd->presignal_exits_free;
 
-			// subtract for dual combo signals so they don't count themselves
+			/* subtract for dual combo signals so they don't count themselves */
 			if (IsPresignalExit(tile) && HasSignalOnTrackdir(tile, ssd->bit[i])) {
 				ex--;
 				if (GetSignalStateByTrackdir(tile, ssd->bit[i]) != SIGNAL_STATE_RED) exfree--;
 			}
 
-			// if we have exits and none are free, make red.
+			/* if we have exits and none are free, make red. */
 			if (ex && !exfree) goto make_red;
 		}
 
-		// check if the signal is unaffected.
+		/* check if the signal is unaffected. */
 		if (ssd->stop) {
 make_red:
-			// turn red
+			/* turn red */
 			if ((bit & m2) == 0) continue;
 		} else {
-			// turn green
+			/* turn green */
 			if ((bit & m2) != 0) continue;
 		}
 
@@ -1641,7 +1643,7 @@
 			}
 		}
 
-		// it changed, so toggle it
+		/* it changed, so toggle it */
 		_m[tile].m2 = m2 ^ bit;
 		MarkTileDirtyByTile(tile);
 	}
@@ -1656,23 +1658,23 @@
 	ssd.cur_stack = 0;
 
 	for (;;) {
-		// go through one segment and update all signals pointing into that segment.
+		/* go through one segment and update all signals pointing into that segment. */
 		ssd.cur = ssd.presignal_exits = ssd.presignal_exits_free = 0;
 		ssd.has_presignal = false;
 
 		FollowTrack(tile, 0xC000 | TRANSPORT_RAIL, direction, SetSignalsEnumProc, SetSignalsAfterProc, &ssd);
 		ChangeSignalStates(&ssd);
 
-		// remember the result only for the first iteration.
+		/* remember the result only for the first iteration. */
 		if (result < 0) {
-			// stay in depot while segment is occupied or while all presignal exits are blocked
+			/* stay in depot while segment is occupied or while all presignal exits are blocked */
 			result = ssd.stop || (ssd.presignal_exits > 0 && ssd.presignal_exits_free == 0);
 		}
 
-		// if any exit signals were changed, we need to keep going to modify the stuff behind those.
+		/* if any exit signals were changed, we need to keep going to modify the stuff behind those. */
 		if (ssd.cur_stack == 0) break;
 
-		// one or more exit signals were changed, so we need to update another segment too.
+		/* one or more exit signals were changed, so we need to update another segment too. */
 		tile = ssd.next_tile[--ssd.cur_stack];
 		direction = ssd.next_dir[ssd.cur_stack];
 	}
@@ -1765,7 +1767,7 @@
 
 	new_ground = RAIL_GROUND_GRASS;
 
-	if (old_ground != RAIL_GROUND_BARREN) { /* wait until bottom is green */
+	if (old_ground != RAIL_GROUND_BARREN) { // wait until bottom is green
 		/* determine direction of fence */
 		TrackBits rail = GetTrackBits(tile);
 
@@ -1959,7 +1961,7 @@
 	DiagDirection dir;
 	int length;
 
-	// this routine applies only to trains in depot tiles
+	/* this routine applies only to trains in depot tiles */
 	if (v->type != VEH_TRAIN || !IsTileDepotType(tile, TRANSPORT_RAIL)) return VETSB_CONTINUE;
 
 	/* depot direction */
--- a/src/rail_map.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/rail_map.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file rail_map.h Hides the direct accesses to the map array with map accessors */
+
 #ifndef RAIL_MAP_H
 #define RAIL_MAP_H
 
--- a/src/railtypes.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/railtypes.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,12 +1,12 @@
 /* $Id$ */
 
-#ifndef RAILTYPES_H
-#define RAILTYPES_H
-
 /** @file railtypes.h
  * All the railtype-specific information is stored here.
  */
 
+#ifndef RAILTYPES_H
+#define RAILTYPES_H
+
 /** Global Railtype definition
  */
 RailtypeInfo _railtypes[] = {
--- a/src/resource.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/resource.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file resource.h */
+
 //{{NO_DEPENDENCIES}}
 // Microsoft Developer Studio generated include file.
 // Used by ttd.rc
--- a/src/road.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/road.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file road.h */
+
 #ifndef ROAD_H
 #define ROAD_H
 
--- a/src/road_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/road_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file road_cmd.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "bridge_map.h"
@@ -46,16 +48,16 @@
 
 	if (_game_mode == GM_EDITOR) return true;
 
-	// Only do the special processing for actual players.
+	/* Only do the special processing for actual players. */
 	if (!IsValidPlayer(_current_player)) return true;
 
-	// Only do the special processing if the road is owned
-	// by a town
+	/* Only do the special processing if the road is owned
+	 * by a town */
 	if (owner != OWNER_TOWN) return (owner == OWNER_NONE) || CheckOwnership(owner);
 
 	if (_cheats.magic_bulldozer.value) return true;
 
-	// Get a bitmask of which neighbouring roads has a tile
+	/* Get a bitmask of which neighbouring roads has a tile */
 	n = ROAD_NONE;
 	present = GetAnyRoadBits(tile);
 	if (present & ROAD_NE && GetAnyRoadBits(TILE_ADDXY(tile,-1, 0)) & ROAD_SW) n |= ROAD_NE;
@@ -63,12 +65,12 @@
 	if (present & ROAD_SW && GetAnyRoadBits(TILE_ADDXY(tile, 1, 0)) & ROAD_NE) n |= ROAD_SW;
 	if (present & ROAD_NW && GetAnyRoadBits(TILE_ADDXY(tile, 0,-1)) & ROAD_SE) n |= ROAD_NW;
 
-	// If 0 or 1 bits are set in n, or if no bits that match the bits to remove,
-	// then allow it
+	/* If 0 or 1 bits are set in n, or if no bits that match the bits to remove,
+	 * then allow it */
 	if ((n & (n - 1)) != 0 && (n & remove) != 0) {
 		Town *t;
 		*edge_road = false;
-		// you can remove all kind of roads with extra dynamite
+		/* you can remove all kind of roads with extra dynamite */
 		if (_patches.extra_dynamite) return true;
 
 		t = ClosestTownFromTile(tile, (uint)-1);
@@ -93,7 +95,7 @@
  */
 int32 CmdRemoveRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	// cost for removing inner/edge -roads
+	/* cost for removing inner/edge -roads */
 	static const uint16 road_remove_cost[2] = {50, 18};
 
 	Owner owner;
@@ -118,10 +120,10 @@
 
 	if (!CheckAllowRemoveRoad(tile, pieces, &edge_road)) return CMD_ERROR;
 
-	if (!EnsureNoVehicle(tile)) return CMD_ERROR;
+	if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 
-	// check if you're allowed to remove the street owned by a town
-	// removal allowance depends on difficulty setting
+	/* check if you're allowed to remove the street owned by a town
+	 * removal allowance depends on difficulty setting */
 	if (!CheckforTownRating(flags, t, ROAD_REMOVE)) return CMD_ERROR;
 
 	switch (GetRoadTileType(tile)) {
@@ -137,7 +139,7 @@
 				c |= (RoadBits)((c & 0x3) << 2);
 			}
 
-			// limit the bits to delete to the existing bits.
+			/* limit the bits to delete to the existing bits. */
 			c &= present;
 			if (c == 0) return CMD_ERROR;
 
@@ -178,7 +180,7 @@
 
 
 static const RoadBits _valid_tileh_slopes_road[][15] = {
-	// set of normal ones
+	/* set of normal ones */
 	{
 		ROAD_ALL, ROAD_NONE, ROAD_NONE,
 		ROAD_X,   ROAD_NONE, ROAD_NONE,  // 3, 4, 5
@@ -186,7 +188,7 @@
 		ROAD_Y,   ROAD_NONE, ROAD_NONE,  // 9, 10, 11
 		ROAD_X,   ROAD_NONE, ROAD_NONE
 	},
-	// allowed road for an evenly raised platform
+	/* allowed road for an evenly raised platform */
 	{
 		ROAD_NONE,
 		ROAD_SW | ROAD_NW,
@@ -216,7 +218,7 @@
 
 	if (IsSteepSlope(tileh)) {
 		if (existing == 0) {
-			// force full pieces.
+			/* force full pieces. */
 			*pieces |= (RoadBits)((*pieces & 0xC) >> 2);
 			*pieces |= (RoadBits)((*pieces & 0x3) << 2);
 			if (*pieces == ROAD_X || *pieces == ROAD_Y) return _price.terraform;
@@ -225,21 +227,21 @@
 	}
 	road_bits = *pieces | existing;
 
-	// no special foundation
+	/* no special foundation */
 	if ((~_valid_tileh_slopes_road[0][tileh] & road_bits) == 0) {
-		// force that all bits are set when we have slopes
+		/* force that all bits are set when we have slopes */
 		if (tileh != SLOPE_FLAT) *pieces |= _valid_tileh_slopes_road[0][tileh];
 		return 0; // no extra cost
 	}
 
-	// foundation is used. Whole tile is leveled up
+	/* foundation is used. Whole tile is leveled up */
 	if ((~_valid_tileh_slopes_road[1][tileh] & road_bits) == 0) {
 		return existing != 0 ? 0 : _price.terraform;
 	}
 
-	// partly leveled up tile, only if there's no road on that tile
+	/* partly leveled up tile, only if there's no road on that tile */
 	if (existing == 0 && (tileh == SLOPE_W || tileh == SLOPE_S || tileh == SLOPE_E || tileh == SLOPE_N)) {
-		// force full pieces.
+		/* force full pieces. */
 		*pieces |= (RoadBits)((*pieces & 0xC) >> 2);
 		*pieces |= (RoadBits)((*pieces & 0x3) << 2);
 		if (*pieces == ROAD_X || *pieces == ROAD_Y) return _price.terraform;
@@ -279,7 +281,7 @@
 					if ((existing & pieces) == pieces) {
 						return_cmd_error(STR_1007_ALREADY_BUILT);
 					}
-					if (!EnsureNoVehicle(tile)) return CMD_ERROR;
+					if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 					break;
 
 				case ROAD_TILE_CROSSING:
@@ -323,7 +325,7 @@
 				default: goto do_clear;
 			}
 
-			if (!EnsureNoVehicle(tile)) return CMD_ERROR;
+			if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 
 			if (flags & DC_EXEC) {
 				YapfNotifyTrackLayoutChange(tile, FindFirstTrack(GetTrackBits(tile)));
@@ -349,7 +351,7 @@
 	cost += ret;
 
 	if (IsTileType(tile, MP_STREET)) {
-		// Don't put the pieces that already exist
+		/* Don't put the pieces that already exist */
 		pieces &= ComplementRoadBits(existing);
 	}
 
@@ -377,15 +379,15 @@
  */
 int32 DoConvertStreetRail(TileIndex tile, RailType totype, bool exec)
 {
-	// not a railroad crossing?
+	/* not a railroad crossing? */
 	if (!IsLevelCrossing(tile)) return CMD_ERROR;
 
-	// not owned by me?
-	if (!CheckTileOwnership(tile) || !EnsureNoVehicle(tile)) return CMD_ERROR;
+	/* not owned by me? */
+	if (!CheckTileOwnership(tile) || !EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 
 	if (GetRailType(tile) == totype) return CMD_ERROR;
 
-	// 'hidden' elrails can't be downgraded to normal rail when elrails are disabled
+	/* 'hidden' elrails can't be downgraded to normal rail when elrails are disabled */
 	if (_patches.disable_elrails && totype == RAILTYPE_RAIL && GetRailType(tile) == RAILTYPE_ELECTRIC) return CMD_ERROR;
 
 	if (exec) {
@@ -431,7 +433,7 @@
 
 	cost = 0;
 	tile = start_tile;
-	// Start tile is the small number.
+	/* Start tile is the small number. */
 	for (;;) {
 		RoadBits bits = HASBIT(p2, 2) ? ROAD_Y : ROAD_X;
 
@@ -487,14 +489,14 @@
 
 	cost = 0;
 	tile = start_tile;
-	// Start tile is the small number.
+	/* Start tile is the small number. */
 	for (;;) {
 		RoadBits bits = HASBIT(p2, 2) ? ROAD_Y : ROAD_X;
 
 		if (tile == end_tile && !HASBIT(p2, 1)) bits &= ROAD_NW | ROAD_NE;
 		if (tile == start_tile && HASBIT(p2, 0)) bits &= ROAD_SE | ROAD_SW;
 
-		// try to remove the halves.
+		/* try to remove the halves. */
 		if (bits != 0) {
 			ret = DoCommand(tile, bits, 0, flags, CMD_REMOVE_ROAD);
 			if (!CmdFailed(ret)) cost += ret;
@@ -618,13 +620,13 @@
 {
 	uint i;
 
-	// normal level sloped building
+	/* normal level sloped building */
 	if (!IsSteepSlope(tileh) &&
 			(~_valid_tileh_slopes_road[1][tileh] & bits) == 0) {
 		return tileh;
 	}
 
-	// inclined sloped building
+	/* inclined sloped building */
 	switch (bits) {
 		case ROAD_X: i = 0; break;
 		case ROAD_Y: i = 1; break;
@@ -669,8 +671,8 @@
 
 		if (foundation != 0) DrawFoundation(ti, foundation);
 
-		// DrawFoundation() modifies ti.
-		// Default sloped sprites..
+		/* DrawFoundation() modifies ti.
+		 * Default sloped sprites.. */
 		if (ti->tileh != SLOPE_FLAT) image = _road_sloped_sprites[ti->tileh - 1] + 0x53F;
 	}
 
@@ -692,15 +694,15 @@
 	DrawGroundSprite(image, pal);
 
 	if (HasRoadWorks(ti->tile)) {
-		// Road works
+		/* Road works */
 		DrawGroundSprite(road & ROAD_X ? SPR_EXCAVATION_X : SPR_EXCAVATION_Y, PAL_NONE);
 		return;
 	}
 
-	// Return if full detail is disabled, or we are zoomed fully out.
+	/* Return if full detail is disabled, or we are zoomed fully out. */
 	if (!(_display_opt & DO_FULL_DETAIL) || _cur_dpi->zoom == 2) return;
 
-	// Draw extra details.
+	/* Draw extra details. */
 	for (drts = _road_display_table[roadside][road]; drts->image != 0; drts++) {
 		int x = ti->x | drts->subcoord_x;
 		int y = ti->y | drts->subcoord_y;
@@ -760,7 +762,7 @@
 				SpriteID image = dtss->image;
 				SpriteID pal;
 
-				if (_display_opt & DO_TRANS_BUILDINGS) {
+				if (HASBIT(_transparent_opt, TO_BUILDINGS)) {
 					SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 					pal = PALETTE_TO_TRANSPARENT;
 				} else if (HASBIT(image, PALETTE_MODIFIER_COLOR)) {
@@ -893,11 +895,11 @@
 		if (t != NULL) {
 			grp = GetTownRadiusGroup(t, tile);
 
-			// Show an animation to indicate road work
+			/* Show an animation to indicate road work */
 			if (t->road_build_months != 0 &&
 					(DistanceManhattan(t->xy, tile) < 8 || grp != 0) &&
 					GetRoadTileType(tile) == ROAD_TILE_NORMAL && (GetRoadBits(tile) == ROAD_X || GetRoadBits(tile) == ROAD_Y)) {
-				if (GetTileSlope(tile, NULL) == SLOPE_FLAT && EnsureNoVehicle(tile) && CHANCE16(1, 20)) {
+				if (GetTileSlope(tile, NULL) == SLOPE_FLAT && EnsureNoVehicleOnGround(tile) && CHANCE16(1, 20)) {
 					StartRoadWorks(tile);
 
 					SndPlayTileFx(SND_21_JACKHAMMER, tile);
--- a/src/road_cmd.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/road_cmd.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file road_cmd.h */
+
 #ifndef ROAD_CMD_H
 #define ROAD_CMD_H
 
--- a/src/road_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/road_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file road_gui.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "road_cmd.h"
--- a/src/road_map.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/road_map.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file road_map.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "bridge_map.h"
@@ -45,7 +47,7 @@
 {
 	uint32 r;
 
-	// Don't allow local authorities to build roads through road depots or road stops.
+	/* Don't allow local authorities to build roads through road depots or road stops. */
 	if ((IsTileType(tile, MP_STREET) && IsTileDepotType(tile, TRANSPORT_ROAD)) || (IsTileType(tile, MP_STATION) && !IsDriveThroughStopTile(tile))) {
 		return TRACK_BIT_NONE;
 	}
--- a/src/road_map.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/road_map.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file road_map.h */
+
 #ifndef ROAD_MAP_H
 #define ROAD_MAP_H
 
@@ -166,15 +168,24 @@
 
 /**
  * Returns the RoadBits on an arbitrary tile
- * Special behavior:
+ * Special behaviour:
  * - road depots: entrance is treated as road piece
  * - road tunnels: entrance is treated as road piece
  * - bridge ramps: start of the ramp is treated as road piece
  * - bridge middle parts: bridge itself is ignored
+ * @param tile the tile to get the road bits for
+ * @return the road bits of the given tile
  */
-RoadBits GetAnyRoadBits(TileIndex);
+RoadBits GetAnyRoadBits(TileIndex tile);
 
-
+/**
+ * Get the accessible track bits for the given tile.
+ * Special behaviour:
+ *  - road depots: no track bits
+ *  - non-drive-through stations: no track bits
+ * @param tile the tile to get the track bits for
+ * @return the track bits for the given tile
+ */
 TrackBits GetAnyRoadTrackBits(TileIndex tile);
 
 
--- a/src/roadveh.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/roadveh.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file src/roadveh.h Road vehicle states */
+
 #ifndef ROADVEH_H
 #define ROADVEH_H
 
--- a/src/roadveh_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/roadveh_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file roadveh_cmd.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
@@ -129,7 +131,7 @@
 	UnitID unit_num;
 	Engine *e;
 
-	if (!IsEngineBuildable(p1, VEH_ROAD, _current_player)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
+	if (!IsEngineBuildable(p1, VEH_ROAD, _current_player)) return_cmd_error(STR_ROAD_VEHICLE_NOT_AVAILABLE);
 
 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
@@ -533,7 +535,7 @@
 {
 	byte new_z, old_z;
 
-	// need this hint so it returns the right z coordinate on bridges.
+	/* need this hint so it returns the right z coordinate on bridges. */
 	v->x_pos = x;
 	v->y_pos = y;
 	new_z = GetSlopeZ(x, y);
@@ -663,7 +665,7 @@
 
 	switch (v->current_order.type) {
 		case OT_GOTO_DEPOT:
-			// Let a depot order in the orderlist interrupt.
+			/* Let a depot order in the orderlist interrupt. */
 			if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return;
 			if (v->current_order.flags & OF_SERVICE_IF_NEEDED &&
 					!VehicleNeedsService(v)) {
@@ -723,7 +725,7 @@
 				}
 				v->dest_tile = dest;
 			} else {
-				// There is no stop left at the station, so don't even TRY to go there
+				/* There is no stop left at the station, so don't even TRY to go there */
 				v->cur_order_index++;
 				v->dest_tile = 0;
 			}
@@ -828,10 +830,10 @@
 	rvf.veh = v;
 	u = (Vehicle*)VehicleFromPos(TileVirtXY(x, y), &rvf, EnumCheckRoadVehClose);
 
-	// This code protects a roadvehicle from being blocked for ever
-	//  If more than 1480 / 74 days a road vehicle is blocked, it will
-	//  drive just through it. The ultimate backup-code of TTD.
-	// It can be disabled.
+	/* This code protects a roadvehicle from being blocked for ever
+	 * If more than 1480 / 74 days a road vehicle is blocked, it will
+	 * drive just through it. The ultimate backup-code of TTD.
+	 * It can be disabled. */
 	if (u == NULL) {
 		v->u.road.blocked_ctr = 0;
 		return NULL;
@@ -881,13 +883,13 @@
 	uint spd = v->cur_speed + 1 + (v->u.road.overtaking != 0 ? 1 : 0);
 	byte t;
 
-	// Clamp
+	/* Clamp */
 	spd = min(spd, v->max_speed);
 	if (v->u.road.state == RVSB_WORMHOLE && !(v->vehstatus & VS_HIDDEN)) {
 		spd = min(spd, GetBridge(GetBridgeType(v->tile))->speed * 2);
 	}
 
-	//updates statusbar only if speed have changed to save CPU time
+	/* updates statusbar only if speed have changed to save CPU time */
 	if (spd != v->cur_speed) {
 		v->cur_speed = spd;
 		if (_patches.vehicle_speed) {
@@ -895,7 +897,7 @@
 		}
 	}
 
-	// Decrease somewhat when turning
+	/* Decrease somewhat when turning */
 	if (!(v->direction & 1)) spd = spd * 3 >> 2;
 
 	if (spd == 0) return false;
@@ -1153,9 +1155,9 @@
 
 		ftd = PerfNPFRouteToStationOrTile(tile - TileOffsByDiagDir(enterdir), trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE);
 		if (ftd.best_trackdir == INVALID_TRACKDIR) {
-			/* We are already at our target. Just do something */
-			//TODO: maybe display error?
-			//TODO: go straight ahead if possible?
+			/* We are already at our target. Just do something
+			 * @todo: maybe display error?
+			 * @todo: go straight ahead if possible? */
 			return_track(FindFirstBit2x64(trackdirs));
 		} else {
 			/* If ftd.best_bird_dist is 0, we found our target and ftd.best_trackdir contains
@@ -1223,10 +1225,10 @@
 {
 	uint dist;
 	if (_patches.yapf.road_use_yapf) {
-		// use YAPF
+		/* use YAPF */
 		dist = YapfRoadVehDistanceToTile(v, tile);
 	} else {
-		// use NPF
+		/* use NPF */
 		NPFFindStationOrTileData fstd;
 		Trackdir trackdir = GetVehicleTrackdir(v);
 		assert(trackdir != INVALID_TRACKDIR);
@@ -1235,7 +1237,7 @@
 		fstd.station_index = INVALID_STATION; // indicates that the destination is a tile, not a station
 
 		dist = NPFRouteToStationOrTile(v->tile, trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE).best_path_dist;
-		// change units from NPF_TILE_LENGTH to # of tiles
+		/* change units from NPF_TILE_LENGTH to # of tiles */
 		if (dist != UINT_MAX)
 			dist = (dist + NPF_TILE_LENGTH - 1) / NPF_TILE_LENGTH;
 	}
@@ -1277,11 +1279,11 @@
 	int x,y;
 	uint32 r;
 
-	// decrease counters
+	/* decrease counters */
 	v->tick_counter++;
 	if (v->u.road.reverse_ctr != 0) v->u.road.reverse_ctr--;
 
-	// handle crashed
+	/* handle crashed */
 	if (v->u.road.crashed_ctr != 0) {
 		RoadVehIsCrashed(v);
 		return;
@@ -1289,7 +1291,7 @@
 
 	RoadVehCheckTrainCrash(v);
 
-	// road vehicle has broken down?
+	/* road vehicle has broken down? */
 	if (v->breakdown_ctr != 0) {
 		if (v->breakdown_ctr <= 2) {
 			HandleBrokenRoadVeh(v);
@@ -1628,9 +1630,9 @@
 			/* We are leaving the correct station */
 			ClearSlot(v);
 		} else if (v->u.road.slot != NULL) {
-			/* We are leaving the wrong station */
-			//XXX The question is .. what to do? Actually we shouldn't be here
-			//but I guess we need to clear the slot
+			/* We are leaving the wrong station
+			 * XXX The question is .. what to do? Actually we shouldn't be here
+			 * but I guess we need to clear the slot */
 			DEBUG(ms, 0, "Vehicle %d (index %d) arrived at wrong stop", v->unitnumber, v->index);
 			if (v->tile != v->dest_tile) {
 				DEBUG(ms, 2, " current tile 0x%X is not destination tile 0x%X. Route problem", v->tile, v->dest_tile);
@@ -1692,13 +1694,13 @@
 	if (v->vehstatus & VS_STOPPED) return;
 	if (_patches.gotodepot && VehicleHasDepotOrders(v)) return;
 
-	// Don't interfere with a depot visit scheduled by the user, or a
-	// depot visit by the order list.
+	/* Don't interfere with a depot visit scheduled by the user, or a
+	 * depot visit by the order list. */
 	if (v->current_order.type == OT_GOTO_DEPOT &&
 			(v->current_order.flags & (OF_HALT_IN_DEPOT | OF_PART_OF_ORDERS)) != 0)
 		return;
 
-	// If we already got a slot at a stop, use that FIRST, and go to a depot later
+	/* If we already got a slot at a stop, use that FIRST, and go to a depot later */
 	if (v->u.road.slot != NULL) return;
 
 	if (IsRoadVehInDepot(v)) {
@@ -1706,7 +1708,7 @@
 		return;
 	}
 
-	// XXX If we already have a depot order, WHY do we search over and over?
+	/* XXX If we already have a depot order, WHY do we search over and over? */
 	depot = FindClosestRoadDepot(v);
 
 	if (depot == NULL || DistanceManhattan(v->tile, depot->xy) > 12) {
@@ -1743,7 +1745,7 @@
 
 	CheckOrders(v);
 
-	//Current slot has expired
+	/* Current slot has expired */
 	if (v->current_order.type == OT_GOTO_STATION && v->u.road.slot != NULL && v->u.road.slot_age-- == 0) {
 		DEBUG(ms, 3, "Slot expired for vehicle %d (index %d) at stop 0x%X",
 			v->unitnumber, v->index, v->u.road.slot->xy);
--- a/src/roadveh_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/roadveh_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file roadveh_gui.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
@@ -34,7 +36,7 @@
 		StringID str;
 
 		SetWindowWidgetDisabledState(w, 2, v->owner != _local_player);
-		// disable service-scroller when interval is set to disabled
+		/* disable service-scroller when interval is set to disabled */
 		SetWindowWidgetDisabledState(w, 5, !_patches.servint_roadveh);
 		SetWindowWidgetDisabledState(w, 6, !_patches.servint_roadveh);
 
--- a/src/saveload.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/saveload.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -412,8 +412,8 @@
 /** Write the value of a setting
  * @param ptr pointer to the variable
  * @param conv type of variable, can be a non-clean type, eg
- * with other flags. It is parsed upon read
- * @param var the new value being given to the variable */
+ *             with other flags. It is parsed upon read
+ * @param val the new value being given to the variable */
 void WriteValue(void *ptr, VarType conv, int64 val)
 {
 	switch (GetVarMemType(conv)) {
@@ -498,6 +498,7 @@
  * by SlCalcNetStringLen and the length that the index will occupy.
  * @param ptr pointer to the stringbuffer
  * @param length maximum length of the string (buffer size, etc.)
+ * @param conv type of data been used
  * @return return the gross length of the string */
 static inline size_t SlCalcStringLen(const void *ptr, size_t length, VarType conv)
 {
@@ -525,7 +526,7 @@
 /**
  * Save/Load a string.
  * @param ptr the string being manipulated
- * @param the length of the string (full length)
+ * @param length of the string (full length)
  * @param conv must be SLE_FILE_STRING */
 static void SlString(void *ptr, size_t length, VarType conv)
 {
@@ -650,7 +651,9 @@
 
 /**
  * Calculate the size of an object.
+ * @param object to be measured
  * @param sld The SaveLoad description of the object so we know how to manipulate it
+ * @return size of given objetc
  */
 static size_t SlCalcObjLength(const void *object, const SaveLoad *sld)
 {
@@ -768,7 +771,7 @@
 
 /**
  * Save or Load (a list of) global variables
- * @param desc The global variable that is being loaded or saved
+ * @param sldg The global variable that is being loaded or saved
  */
 void SlGlobList(const SaveLoadGlobVarList *sldg)
 {
--- a/src/saveload.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/saveload.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file saveload.h */
+
 #ifndef SAVELOAD_H
 #define SAVELOAD_H
 
@@ -14,9 +16,9 @@
 };
 
 enum SaveOrLoadResult {
-	SL_OK     = 0, // completed successfully
-	SL_ERROR  = 1, // error that was caught before internal structures were modified
-	SL_REINIT = 2, // error that was caught in the middle of updating game state, need to clear it. (can only happen during load)
+	SL_OK     = 0, ///< completed successfully
+	SL_ERROR  = 1, ///< error that was caught before internal structures were modified
+	SL_REINIT = 2, ///< error that was caught in the middle of updating game state, need to clear it. (can only happen during load)
 };
 
 enum SaveOrLoadMode {
--- a/src/screenshot.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/screenshot.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -20,7 +20,7 @@
 uint _cur_screenshot_format;
 ScreenshotType current_screenshot_type;
 
-// called by the ScreenShot proc to generate screenshot lines.
+/* called by the ScreenShot proc to generate screenshot lines. */
 typedef void ScreenshotCallback(void *userdata, Pixel *buf, uint y, uint pitch, uint n);
 typedef bool ScreenshotHandlerProc(const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const Colour *palette);
 
@@ -62,7 +62,7 @@
 };
 assert_compile(sizeof(RgbQuad) == 4);
 
-// generic .BMP writer
+/* generic .BMP writer */
 static bool MakeBmpImage(const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const Colour *palette)
 {
 	BitmapFileHeader bfh;
@@ -72,23 +72,23 @@
 	uint i, padw;
 	uint n, maxlines;
 
-	// only implemented for 8bit images so far.
+	/* only implemented for 8bit images so far. */
 	if (pixelformat != 8)
 		return false;
 
 	f = fopen(name, "wb");
 	if (f == NULL) return false;
 
-	// each scanline must be aligned on a 32bit boundary
+	/* each scanline must be aligned on a 32bit boundary */
 	padw = ALIGN(w, 4);
 
-	// setup the file header
+	/* setup the file header */
 	bfh.type = TO_LE16('MB');
 	bfh.size = TO_LE32(sizeof(bfh) + sizeof(bih) + sizeof(RgbQuad) * 256 + padw * h);
 	bfh.reserved = 0;
 	bfh.off_bits = TO_LE32(sizeof(bfh) + sizeof(bih) + sizeof(RgbQuad) * 256);
 
-	// setup the info header
+	/* setup the info header */
 	bih.size = TO_LE32(sizeof(BitmapInfoHeader));
 	bih.width = TO_LE32(w);
 	bih.height = TO_LE32(h);
@@ -101,7 +101,7 @@
 	bih.clrused = 0;
 	bih.clrimp = 0;
 
-	// convert the palette to the windows format
+	/* convert the palette to the windows format */
 	for (i = 0; i != 256; i++) {
 		rq[i].red   = palette[i].r;
 		rq[i].green = palette[i].g;
@@ -109,15 +109,15 @@
 		rq[i].reserved = 0;
 	}
 
-	// write file header and info header and palette
+	/* write file header and info header and palette */
 	if (fwrite(&bfh, sizeof(bfh), 1, f) != 1) return false;
 	if (fwrite(&bih, sizeof(bih), 1, f) != 1) return false;
 	if (fwrite(rq, sizeof(rq), 1, f) != 1) return false;
 
-	// use by default 64k temp memory
+	/* use by default 64k temp memory */
 	maxlines = clamp(65536 / padw, 16, 128);
 
-	// now generate the bitmap bits
+	/* now generate the bitmap bits */
 	Pixel *buff = MallocT<Pixel>(padw * maxlines); // by default generate 128 lines at a time.
 	if (buff == NULL) {
 		fclose(f);
@@ -125,16 +125,16 @@
 	}
 	memset(buff, 0, padw * maxlines); // zero the buffer to have the padding bytes set to 0
 
-	// start at the bottom, since bitmaps are stored bottom up.
+	/* start at the bottom, since bitmaps are stored bottom up. */
 	do {
-		// determine # lines
+		/* determine # lines */
 		n = min(h, maxlines);
 		h -= n;
 
-		// render the pixels
+		/* render the pixels */
 		callb(userdata, buff, h, padw, n);
 
-		// write each line
+		/* write each line */
 		while (n)
 			if (fwrite(buff + (--n) * padw, padw, 1, f) != 1) {
 				free(buff);
@@ -175,7 +175,7 @@
 	png_structp png_ptr;
 	png_infop info_ptr;
 
-	// only implemented for 8bit images so far.
+	/* only implemented for 8bit images so far. */
 	if (pixelformat != 8)
 		return false;
 
@@ -209,7 +209,7 @@
 	png_set_IHDR(png_ptr, info_ptr, w, h, pixelformat, PNG_COLOR_TYPE_PALETTE,
 		PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
 
-	// convert the palette to the .PNG format.
+	/* convert the palette to the .PNG format. */
 	for (i = 0; i != 256; i++) {
 		rq[i].red   = palette[i].r;
 		rq[i].green = palette[i].g;
@@ -220,10 +220,10 @@
 	png_write_info(png_ptr, info_ptr);
 	png_set_flush(png_ptr, 512);
 
-	// use by default 64k temp memory
+	/* use by default 64k temp memory */
 	maxlines = clamp(65536 / w, 16, 128);
 
-	// now generate the bitmap bits
+	/* now generate the bitmap bits */
 	Pixel *buff = MallocT<Pixel>(w * maxlines); // by default generate 128 lines at a time.
 	if (buff == NULL) {
 		png_destroy_write_struct(&png_ptr, &info_ptr);
@@ -234,14 +234,14 @@
 
 	y = 0;
 	do {
-		// determine # lines to write
+		/* determine # lines to write */
 		n = min(h - y, maxlines);
 
-		// render the pixels into the buffer
+		/* render the pixels into the buffer */
 		callb(userdata, buff, y, w, n);
 		y += n;
 
-		// write them to png
+		/* write them to png */
 		for (i = 0; i != n; i++)
 			png_write_row(png_ptr, buff + i * w);
 	} while (y != h);
@@ -295,7 +295,7 @@
 
 	memset(&pcx, 0, sizeof(pcx));
 
-	// setup pcx header
+	/* setup pcx header */
 	pcx.manufacturer = 10;
 	pcx.version = 5;
 	pcx.rle = 1;
@@ -310,16 +310,16 @@
 	pcx.width = pcx.pitch = TO_LE16(w);
 	pcx.height = TO_LE16(h);
 
-	// write pcx header
+	/* write pcx header */
 	if (fwrite(&pcx, sizeof(pcx), 1, f) != 1) {
 		fclose(f);
 		return false;
 	}
 
-	// use by default 64k temp memory
+	/* use by default 64k temp memory */
 	maxlines = clamp(65536 / w, 16, 128);
 
-	// now generate the bitmap bits
+	/* now generate the bitmap bits */
 	Pixel *buff = MallocT<Pixel>(w * maxlines); // by default generate 128 lines at a time.
 	if (buff == NULL) {
 		fclose(f);
@@ -329,22 +329,22 @@
 
 	y = 0;
 	do {
-		// determine # lines to write
+		/* determine # lines to write */
 		uint n = min(h - y, maxlines);
 		uint i;
 
-		// render the pixels into the buffer
+		/* render the pixels into the buffer */
 		callb(userdata, buff, y, w, n);
 		y += n;
 
-		// write them to pcx
+		/* write them to pcx */
 		for (i = 0; i != n; i++) {
 			const Pixel* bufp = buff + i * w;
 			byte runchar = bufp[0];
 			uint runcount = 1;
 			uint j;
 
-			// for each pixel...
+			/* for each pixel... */
 			for (j = 1; j < w; j++) {
 				Pixel ch = bufp[j];
 
@@ -366,7 +366,7 @@
 				runcount++;
 			}
 
-			// write remaining bytes..
+			/* write remaining bytes.. */
 			if (runcount > 1 || (runchar & 0xC0) == 0xC0)
 				if (fputc(0xC0 | runcount, f) == EOF) {
 					free(buff);
@@ -383,7 +383,7 @@
 
 	free(buff);
 
-	// write 8-bit color palette
+	/* write 8-bit color palette */
 	if (fputc(12, f) == EOF) {
 		fclose(f);
 		return false;
@@ -445,7 +445,7 @@
 	strcpy(_screenshot_format_name, _screenshot_formats[i].extension);
 }
 
-// screenshot generator that dumps the current video buffer
+/* screenshot generator that dumps the current video buffer */
 static void CurrentScreenCallback(void *userdata, Pixel *buf, uint y, uint pitch, uint n)
 {
 	for (; n > 0; --n) {
@@ -455,7 +455,7 @@
 	}
 }
 
-// generate a large piece of the world
+/* generate a large piece of the world */
 static void LargeWorldCallback(void *userdata, Pixel *buf, uint y, uint pitch, uint n)
 {
 	ViewPort *vp = (ViewPort *)userdata;
--- a/src/screenshot.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/screenshot.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file screenshot.h */
+
 #ifndef SCREENSHOT_H
 #define SCREENSHOT_H
 
--- a/src/sdl.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/sdl.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file sdl.cpp */
+
 #include "stdafx.h"
 
 #ifdef WITH_SDL
--- a/src/sdl.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/sdl.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file sdl.h */
+
 #ifndef SDL_H
 #define SDL_H
 
--- a/src/settings.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/settings.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,6 +1,6 @@
 /* $Id$ */
 
-/** @file
+/** @file settings.cpp
  * All actions handling saving and loading of the settings/configuration goes on in this file.
  * The file consists of four parts:
  * <ol>
@@ -95,10 +95,10 @@
 
 	size = ALIGN(size, sizeof(void*));
 
-	// first check if there's memory in the next pool
+	/* first check if there's memory in the next pool */
 	if (p->next && p->next->pos + size <= p->next->size) {
 		p = p->next;
-	// then check if there's not memory in the cur pool
+	/* then check if there's not memory in the cur pool */
 	} else if (p->pos + size > p->size) {
 		SettingsMemoryPool *n = pool_new(size);
 		*pool = n;
@@ -130,7 +130,7 @@
 	}
 }
 
-// structs describing the ini format.
+/** structs describing the ini format. */
 struct IniItem {
 	char *name;
 	char *value;
@@ -139,21 +139,21 @@
 };
 
 struct IniGroup {
-	char *name; // name of group
-	char *comment; //comment for group
+	char *name;        ///< name of group
+	char *comment;     ///<comment for group
 	IniItem *item, **last_item;
 	IniGroup *next;
 	IniFile *ini;
-	IniGroupType type; // type of group
+	IniGroupType type; ///< type of group
 };
 
 struct IniFile {
 	SettingsMemoryPool *pool;
 	IniGroup *group, **last_group;
-	char *comment; // last comment in file
+	char *comment;     ///< last comment in file
 };
 
-// allocate an inifile object
+/** allocate an inifile object */
 static IniFile *ini_alloc()
 {
 	IniFile *ini;
@@ -167,7 +167,7 @@
 	return ini;
 }
 
-// allocate an ini group object
+/** allocate an ini group object */
 static IniGroup *ini_group_alloc(IniFile *ini, const char *grpt, int len)
 {
 	IniGroup *grp = (IniGroup*)pool_alloc(&ini->pool, sizeof(IniGroup));
@@ -199,7 +199,7 @@
 	return item;
 }
 
-// load an ini file into the "abstract" format
+/** load an ini file into the "abstract" format */
 static IniFile *ini_load(const char *filename)
 {
 	char buffer[1024], c, *s, *t, *e;
@@ -217,23 +217,23 @@
 	in = fopen(filename, "r");
 	if (in == NULL) return ini;
 
-	// for each line in the file
+	/* for each line in the file */
 	while (fgets(buffer, sizeof(buffer), in)) {
 
-		// trim whitespace from the left side
+		/* trim whitespace from the left side */
 		for (s = buffer; *s == ' ' || *s == '\t'; s++);
 
-		// trim whitespace from right side.
+		/* trim whitespace from right side. */
 		e = s + strlen(s);
 		while (e > s && ((c=e[-1]) == '\n' || c == '\r' || c == ' ' || c == '\t')) e--;
 		*e = '\0';
 
-		// skip comments and empty lines
+		/* skip comments and empty lines */
 		if (*s == '#' || *s == ';' || *s == '\0') {
 			uint ns = comment_size + (e - s + 1);
 			uint a = comment_alloc;
 			uint pos;
-			// add to comment
+			/* add to comment */
 			if (ns > a) {
 				a = max(a, 128U);
 				do a*=2; while (a < ns);
@@ -246,7 +246,7 @@
 			continue;
 		}
 
-		// it's a group?
+		/* it's a group? */
 		if (s[0] == '[') {
 			if (e[-1] != ']') {
 				ShowInfoF("ini: invalid group name '%s'", buffer);
@@ -260,30 +260,36 @@
 				comment_size = 0;
 			}
 		} else if (group) {
-			// find end of keyname
-			for (t = s; *t != '\0' && *t != '=' && *t != '\t' && *t != ' '; t++);
+			/* find end of keyname */
+			if (*s == '\"') {
+				s++;
+				for (t = s; *t != '\0' && *t != '\"'; t++);
+				if (*t == '\"') *t = ' ';
+			} else {
+				for (t = s; *t != '\0' && *t != '=' && *t != '\t' && *t != ' '; t++);
+			}
 
-			// it's an item in an existing group
+			/* it's an item in an existing group */
 			item = ini_item_alloc(group, s, t-s);
 			if (comment_size) {
 				item->comment = (char*)pool_strdup(&ini->pool, comment, comment_size);
 				comment_size = 0;
 			}
 
-			// find start of parameter
+			/* find start of parameter */
 			while (*t == '=' || *t == ' ' || *t == '\t') t++;
 
 
-			// remove starting quotation marks
+			/* remove starting quotation marks */
 			if (*t == '\"') t++;
-			// remove ending quotation marks
+			/* remove ending quotation marks */
 			e = t + strlen(t);
 			if (e > t && e[-1] == '\"') e--;
 			*e = '\0';
 
 			item->value = (char*)pool_strdup(&ini->pool, t, e - t);
 		} else {
-			// it's an orphan item
+			/* it's an orphan item */
 			ShowInfoF("ini: '%s' outside of group", buffer);
 		}
 	}
@@ -299,25 +305,25 @@
 	return ini;
 }
 
-// lookup a group or make a new one
+/** lookup a group or make a new one */
 static IniGroup *ini_getgroup(IniFile *ini, const char *name, int len)
 {
 	IniGroup *group;
 
 	if (len == -1) len = strlen(name);
 
-	// does it exist already?
+	/* does it exist already? */
 	for (group = ini->group; group; group = group->next)
 		if (!memcmp(group->name, name, len) && group->name[len] == 0)
 			return group;
 
-	// otherwise make a new one
+	/* otherwise make a new one */
 	group = ini_group_alloc(ini, name, len);
 	group->comment = (char*)pool_strdup(&ini->pool, "\n", 1);
 	return group;
 }
 
-// lookup an item or make a new one
+/** lookup an item or make a new one */
 static IniItem *ini_getitem(IniGroup *group, const char *name, bool create)
 {
 	IniItem *item;
@@ -328,11 +334,11 @@
 
 	if (!create) return NULL;
 
-	// otherwise make a new one
+	/* otherwise make a new one */
 	return ini_item_alloc(group, name, len);
 }
 
-// save ini file from the "abstract" format.
+/** save ini file from the "abstract" format. */
 static bool ini_save(const char *filename, IniFile *ini)
 {
 	FILE *f;
@@ -349,11 +355,18 @@
 			assert(item->value != NULL);
 			if (item->comment != NULL) fputs(item->comment, f);
 
+			/* protect item->name with quotes if needed */
+			if (strchr(item->name, ' ') != NULL) {
+				fprintf(f, "\"%s\"", item->name);
+			} else {
+				fprintf(f, "%s", item->name);
+			}
+
 			/* Don't give an equal sign to list items that don't have a parameter */
 			if (group->type == IGT_LIST && *item->value == '\0') {
-				fprintf(f, "%s\n", item->name);
+				fprintf(f, "\n");
 			} else {
-				fprintf(f, "%s = %s\n", item->name, item->value);
+				fprintf(f, " = %s\n", item->value);
 			}
 		}
 	}
@@ -380,13 +393,13 @@
 
 	if (onelen == -1) onelen = strlen(one);
 
-	// check if it's an integer
+	/* check if it's an integer */
 	if (*one >= '0' && *one <= '9')
 		return strtoul(one, NULL, 0);
 
 	idx = 0;
 	for (;;) {
-		// find end of item
+		/* find end of item */
 		s = many;
 		while (*s != '|' && *s != 0) s++;
 		if (s - many == onelen && !memcmp(one, many, onelen)) return idx;
@@ -408,7 +421,7 @@
 	uint32 res = 0;
 
 	for (;;) {
-		// skip "whitespace"
+		/* skip "whitespace" */
 		while (*str == ' ' || *str == '\t' || *str == '|') str++;
 		if (*str == 0) break;
 
@@ -522,7 +535,7 @@
 {
 	int orig_id = id;
 
-	// Look for the id'th element
+	/* Look for the id'th element */
 	while (--id >= 0) {
 		for (; *many != '|'; many++) {
 			if (*many == '\0') { // not found
@@ -533,7 +546,7 @@
 		many++; // pass the |-character
 	}
 
-	// copy string until next item (|) or the end of the list if this is the last one
+	/* copy string until next item (|) or the end of the list if this is the last one */
 	while (*many != '\0' && *many != '|') *buf++ = *many++;
 	*buf = '\0';
 }
@@ -685,7 +698,7 @@
 
 		if (!SlIsObjectCurrentlyValid(sld->version_from, sld->version_to)) continue;
 
-		// XXX - wtf is this?? (group override?)
+		/* XXX - wtf is this?? (group override?) */
 		s = strchr(sdb->name, '.');
 		if (s != NULL) {
 			group = ini_getgroup(ini, sdb->name, s - sdb->name);
@@ -761,7 +774,7 @@
 		if (!SlIsObjectCurrentlyValid(sld->version_from, sld->version_to)) continue;
 		if (sld->conv & SLF_CONFIG_NO) continue;
 
-		// XXX - wtf is this?? (group override?)
+		/* XXX - wtf is this?? (group override?) */
 		s = strchr(sdb->name, '.');
 		if (s != NULL) {
 			group = ini_getgroup(ini, sdb->name, s - sdb->name);
@@ -776,7 +789,7 @@
 		ptr = GetVariableAddress(object, sld);
 
 		if (item->value != NULL) {
-			// check if the value is the same as the old value
+			/* check if the value is the same as the old value */
 			const void *p = string_to_val(sdb, item->value);
 
 			/* The main type of a variable/setting is in bytes 8-15
@@ -1069,7 +1082,7 @@
 #include "gui.h"
 #include "town.h"
 #include "gfx.h"
-// virtual PositionMainToolbar function, calls the right one.
+/* virtual PositionMainToolbar function, calls the right one.*/
 static int32 v_PositionMainToolbar(int32 p1)
 {
 	if (_game_mode != GM_MENU) PositionMainToolbar(NULL);
@@ -1198,7 +1211,7 @@
 #endif /* WIN32 */
 
 static const SettingDescGlobVarList _misc_settings[] = {
-	SDTG_MMANY("display_opt",     SLE_UINT8, S, 0, _display_opt,       (DO_SHOW_TOWN_NAMES|DO_SHOW_STATION_NAMES|DO_SHOW_SIGNS|DO_FULL_ANIMATION|DO_FULL_DETAIL|DO_TRANS_BUILDINGS|DO_WAYPOINTS), "SHOW_TOWN_NAMES|SHOW_STATION_NAMES|SHOW_SIGNS|FULL_ANIMATION|TRANS_BUILDINGS|FULL_DETAIL|WAYPOINTS", STR_NULL, NULL),
+	SDTG_MMANY("display_opt",     SLE_UINT8, S, 0, _display_opt,       (DO_SHOW_TOWN_NAMES|DO_SHOW_STATION_NAMES|DO_SHOW_SIGNS|DO_FULL_ANIMATION|DO_FULL_DETAIL|DO_WAYPOINTS), "SHOW_TOWN_NAMES|SHOW_STATION_NAMES|SHOW_SIGNS|FULL_ANIMATION|FULL_DETAIL|WAYPOINTS", STR_NULL, NULL),
 	 SDTG_BOOL("news_ticker_sound",          S, 0, _news_ticker_sound,     true,    STR_NULL, NULL),
 	 SDTG_BOOL("fullscreen",                 S, 0, _fullscreen,           false,    STR_NULL, NULL),
 	  SDTG_STR("videodriver",      SLE_STRB,C|S,0, _ini_videodriver,       NULL,    STR_NULL, NULL),
@@ -1453,7 +1466,7 @@
 	SDT_CONDVAR (Patches, npf_road_drive_through_penalty, SLE_UINT, 47, SL_MAX_VERSION, 0, 0,  8 * NPF_TILE_LENGTH, 0, 1000000, 0, STR_NULL, NULL),
 
 
-	// The maximum number of nodes to search
+	/* The maximum number of nodes to search */
 	SDT_CONDBOOL(Patches, yapf.disable_node_optimization  ,           28, SL_MAX_VERSION, 0, 0, false                   ,                       STR_NULL, NULL),
 	SDT_CONDVAR (Patches, yapf.max_search_nodes           , SLE_UINT, 28, SL_MAX_VERSION, 0, 0, 10000                   ,      500, 1000000, 0, STR_NULL, NULL),
 	SDT_CONDBOOL(Patches, yapf.rail_firstred_twoway_eol   ,           28, SL_MAX_VERSION, 0, 0,  true                   ,                       STR_NULL, NULL),
@@ -1465,22 +1478,22 @@
 	SDT_CONDVAR (Patches, yapf.rail_slope_penalty         , SLE_UINT, 28, SL_MAX_VERSION, 0, 0,     2 * YAPF_TILE_LENGTH,        0, 1000000, 0, STR_NULL, NULL),
 	SDT_CONDVAR (Patches, yapf.rail_curve45_penalty       , SLE_UINT, 28, SL_MAX_VERSION, 0, 0,     1 * YAPF_TILE_LENGTH,        0, 1000000, 0, STR_NULL, NULL),
 	SDT_CONDVAR (Patches, yapf.rail_curve90_penalty       , SLE_UINT, 28, SL_MAX_VERSION, 0, 0,     6 * YAPF_TILE_LENGTH,        0, 1000000, 0, STR_NULL, NULL),
-	// This penalty is applied when a train reverses inside a depot
+	/* This penalty is applied when a train reverses inside a depot */
 	SDT_CONDVAR (Patches, yapf.rail_depot_reverse_penalty , SLE_UINT, 28, SL_MAX_VERSION, 0, 0,    50 * YAPF_TILE_LENGTH,        0, 1000000, 0, STR_NULL, NULL),
-	// This is the penalty for level crossings (for trains only)
+	/* This is the penalty for level crossings (for trains only) */
 	SDT_CONDVAR (Patches, yapf.rail_crossing_penalty      , SLE_UINT, 28, SL_MAX_VERSION, 0, 0,     3 * YAPF_TILE_LENGTH,        0, 1000000, 0, STR_NULL, NULL),
-	// look-ahead how many signals are checked
+	/* look-ahead how many signals are checked */
 	SDT_CONDVAR (Patches, yapf.rail_look_ahead_max_signals, SLE_UINT, 28, SL_MAX_VERSION, 0, 0,    10                   ,        1,     100, 0, STR_NULL, NULL),
-	// look-ahead n-th red signal penalty polynomial: penalty = p2 * n^2 + p1 * n + p0
+	/* look-ahead n-th red signal penalty polynomial: penalty = p2 * n^2 + p1 * n + p0 */
 	SDT_CONDVAR (Patches, yapf.rail_look_ahead_signal_p0  , SLE_INT , 28, SL_MAX_VERSION, 0, 0,   500                   , -1000000, 1000000, 0, STR_NULL, NULL),
 	SDT_CONDVAR (Patches, yapf.rail_look_ahead_signal_p1  , SLE_INT , 28, SL_MAX_VERSION, 0, 0,  -100                   , -1000000, 1000000, 0, STR_NULL, NULL),
 	SDT_CONDVAR (Patches, yapf.rail_look_ahead_signal_p2  , SLE_INT , 28, SL_MAX_VERSION, 0, 0,     5                   , -1000000, 1000000, 0, STR_NULL, NULL),
-	// penalties for too long or too short station platforms
+	/* penalties for too long or too short station platforms */
 	SDT_CONDVAR (Patches, yapf.rail_longer_platform_penalty,           SLE_UINT, 33, SL_MAX_VERSION, 0, 0,  8 * YAPF_TILE_LENGTH, 0,   20000, 0, STR_NULL, NULL),
 	SDT_CONDVAR (Patches, yapf.rail_longer_platform_per_tile_penalty,  SLE_UINT, 33, SL_MAX_VERSION, 0, 0,  0 * YAPF_TILE_LENGTH, 0,   20000, 0, STR_NULL, NULL),
 	SDT_CONDVAR (Patches, yapf.rail_shorter_platform_penalty,          SLE_UINT, 33, SL_MAX_VERSION, 0, 0, 40 * YAPF_TILE_LENGTH, 0,   20000, 0, STR_NULL, NULL),
 	SDT_CONDVAR (Patches, yapf.rail_shorter_platform_per_tile_penalty, SLE_UINT, 33, SL_MAX_VERSION, 0, 0,  0 * YAPF_TILE_LENGTH, 0,   20000, 0, STR_NULL, NULL),
-	// road vehicles - penalties
+	/* road vehicles - penalties */
 	SDT_CONDVAR (Patches, yapf.road_slope_penalty                    , SLE_UINT, 33, SL_MAX_VERSION, 0, 0,  2 * YAPF_TILE_LENGTH, 0, 1000000, 0, STR_NULL, NULL),
 	SDT_CONDVAR (Patches, yapf.road_curve_penalty                    , SLE_UINT, 33, SL_MAX_VERSION, 0, 0,  1 * YAPF_TILE_LENGTH, 0, 1000000, 0, STR_NULL, NULL),
 	SDT_CONDVAR (Patches, yapf.road_crossing_penalty                 , SLE_UINT, 33, SL_MAX_VERSION, 0, 0,  3 * YAPF_TILE_LENGTH, 0, 1000000, 0, STR_NULL, NULL),
@@ -1569,7 +1582,7 @@
 
 	for (item = group->item; item != NULL; item = item->next) {
 		GRFConfig *c = CallocT<GRFConfig>(1);
-		c->filename = strdup(item->name);
+		c->full_path = strdup(item->name);
 
 		/* Parse parameters */
 		if (*item->value != '\0') {
@@ -1646,7 +1659,7 @@
 		char params[512];
 		GRFBuildParamList(params, c, lastof(params));
 
-		*item = ini_item_alloc(group, c->filename, strlen(c->filename));
+		*item = ini_item_alloc(group, c->full_path, strlen(c->full_path));
 		(*item)->value = (char*)pool_strdup(&ini->pool, params, strlen(params));
 		item = &(*item)->next;
 	}
@@ -1822,6 +1835,25 @@
 		name, value, (sd->desc.flags & SGF_0ISDISABLED) ? "(0) " : "", sd->desc.min, sd->desc.max);
 }
 
+void IConsoleListPatches()
+{
+	IConsolePrintF(_icolour_warn, "All patches with their current value:");
+
+	for (const SettingDesc *sd = _patch_settings; sd->save.cmd != SL_END; sd++) {
+		char value[80];
+		const void *ptr = GetVariableAddress((_game_mode == GM_MENU) ? &_patches_newgame : &_patches, &sd->save);
+
+		if (sd->desc.cmd == SDT_BOOLX) {
+			snprintf(value, lengthof(value), (*(bool*)ptr == 1) ? "on" : "off");
+		} else {
+			snprintf(value, lengthof(value), "%d", (uint32)ReadValue(ptr, sd->save.conv));
+		}
+		IConsolePrintF(_icolour_def, "%s = %s", sd->desc.name, value);
+	}
+
+	IConsolePrintF(_icolour_warn, "Use 'patch' command to change a value");
+}
+
 /** Save and load handler for patches/settings
  * @param osd SettingDesc struct containing all information
  * @param object can be either NULL in which case we load global variables or
--- a/src/settings.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/settings.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file settings.h */
+
 #ifndef SETTINGS_H
 #define SETTINGS_H
 
@@ -12,12 +14,12 @@
 enum SettingDescTypeLong {
 	/* 4 bytes allocated a maximum of 16 types for GenericType */
 	SDT_BEGIN       = 0,
-	SDT_NUMX        = 0, // any number-type
-	SDT_BOOLX       = 1, // a boolean number
-	SDT_ONEOFMANY   = 2, // bitmasked number where only ONE bit may be set
-	SDT_MANYOFMANY  = 3, // bitmasked number where MULTIPLE bits may be set
-	SDT_INTLIST     = 4, // list of integers seperated by a comma ','
-	SDT_STRING      = 5, // string with a pre-allocated buffer
+	SDT_NUMX        = 0, ///< any number-type
+	SDT_BOOLX       = 1, ///< a boolean number
+	SDT_ONEOFMANY   = 2, ///< bitmasked number where only ONE bit may be set
+	SDT_MANYOFMANY  = 3, ///< bitmasked number where MULTIPLE bits may be set
+	SDT_INTLIST     = 4, ///< list of integers seperated by a comma ','
+	SDT_STRING      = 5, ///< string with a pre-allocated buffer
 	SDT_END,
 	/* 10 more possible primitives */
 };
@@ -84,6 +86,7 @@
 
 bool IConsoleSetPatchSetting(const char *name, int32 value);
 void IConsoleGetPatchSetting(const char *name);
+void IConsoleListPatches();
 const SettingDesc *GetPatchFromName(const char *name, uint *i);
 bool SetPatchValue(uint index, const Patches *object, int32 value);
 
--- a/src/settings_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/settings_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file settings_gui.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "currency.h"
@@ -352,9 +354,9 @@
  */
 static const int16 _default_game_diff[3][GAME_DIFFICULTY_NUM] = { /*
 	 A, B, C, D,   E, F, G, H, I, J, K, L, M, N, O, P, Q, R*/
-	{2, 2, 1, 3, 300, 2, 0, 2, 0, 1, 2, 0, 1, 0, 0, 0, 0, 0}, //easy
-	{4, 1, 1, 2, 150, 3, 1, 3, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1}, //medium
-	{7, 0, 2, 2, 100, 4, 1, 3, 2, 2, 0, 2, 3, 2, 1, 1, 1, 2}, //hard
+	{2, 2, 1, 3, 300, 2, 0, 2, 0, 1, 2, 0, 1, 0, 0, 0, 0, 0}, ///< easy
+	{4, 1, 1, 2, 150, 3, 1, 3, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1}, ///< medium
+	{7, 0, 2, 2, 100, 4, 1, 3, 2, 2, 0, 2, 3, 2, 1, 1, 1, 2}, ///< hard
 };
 
 void SetDifficultyLevel(int mode, GameOptions *gm_opt)
@@ -393,7 +395,7 @@
 	GAMEDIFF_WND_ROWSIZE    = 9
 };
 
-// Temporary holding place of values in the difficulty window until 'Save' is clicked
+/* Temporary holding place of values in the difficulty window until 'Save' is clicked */
 static GameOptions _opt_mod_temp;
 // 0x383E = (1 << 13) | (1 << 12) | (1 << 11) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1)
 #define DIFF_INGAME_DISABLED_BUTTONS 0x383E
@@ -457,7 +459,7 @@
 			uint btn, dis;
 			int16 val;
 
-			// Don't allow clients to make any changes
+			/* Don't allow clients to make any changes */
 			if  (_networking && !_network_server)
 				return;
 
@@ -469,12 +471,12 @@
 			if (y < 0)
 				return;
 
-			// Get button from Y coord.
+			/* Get button from Y coord. */
 			btn = y / (GAMEDIFF_WND_ROWSIZE + 2);
 			if (btn >= GAME_DIFFICULTY_NUM || y % (GAMEDIFF_WND_ROWSIZE + 2) >= 9)
 				return;
 
-			// Clicked disabled button?
+			/* Clicked disabled button? */
 			dis = (_game_mode == GM_NORMAL) ? DIFF_INGAME_DISABLED_BUTTONS : 0;
 
 			if (HASBIT(dis, btn))
--- a/src/ship.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/ship.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file ship.h */
+
 #ifndef SHIP_H
 #define SHIP_H
 
--- a/src/ship_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/ship_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file ship_cmd.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "ship.h"
@@ -62,8 +64,8 @@
 
 /** Get the size of the sprite of a ship sprite heading west (used for lists)
  * @param engine The engine to get the sprite from
- * @param &width The width of the sprite
- * @param &height The height of the sprite
+ * @param width The width of the sprite
+ * @param height The height of the sprite
  */
 void GetShipSpriteSize(EngineID engine, uint &width, uint &height)
 {
@@ -191,7 +193,7 @@
 	SubtractMoneyFromPlayerFract(v->owner, cost);
 
 	InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
-	//we need this for the profit
+	/* we need this for the profit */
 	InvalidateWindowClasses(WC_SHIPS_LIST);
 }
 
@@ -376,10 +378,10 @@
 	tile = v->tile;
 	axis = GetShipDepotAxis(tile);
 
-	// Check first side
+	/* Check first side */
 	if (_ship_sometracks[axis] & GetTileShipTrackStatus(TILE_ADD(tile, ToTileIndexDiff(_ship_leave_depot_offs[axis])))) {
 		m = (axis == AXIS_X) ? 0x101 : 0x207;
-	// Check second side
+	/* Check second side */
 	} else if (_ship_sometracks[axis + 2] & GetTileShipTrackStatus(TILE_ADD(tile, -2 * ToTileIndexDiff(_ship_leave_depot_offs[axis])))) {
 		m = (axis == AXIS_X) ? 0x105 : 0x203;
 	} else {
@@ -405,14 +407,14 @@
 
 	spd = min(v->cur_speed + 1, v->max_speed);
 
-	//updates statusbar only if speed have changed to save CPU time
+	/*updates statusbar only if speed have changed to save CPU time */
 	if (spd != v->cur_speed) {
 		v->cur_speed = spd;
 		if (_patches.vehicle_speed)
 			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
 	}
 
-	// Decrease somewhat when turning
+	/* Decrease somewhat when turning */
 	if (!(v->direction & 1)) spd = spd * 3 / 4;
 
 	if (spd == 0) return false;
@@ -455,7 +457,7 @@
 
 static bool ShipTrackFollower(TileIndex tile, PathFindShip *pfs, int track, uint length, byte *state)
 {
-	// Found dest?
+	/* Found dest? */
 	if (tile == pfs->dest_coords) {
 		pfs->best_bird_dist = 0;
 
@@ -463,7 +465,7 @@
 		return true;
 	}
 
-	// Skip this tile in the calculation
+	/* Skip this tile in the calculation */
 	if (tile != pfs->skiptile) {
 		pfs->best_bird_dist = minu(pfs->best_bird_dist, DistanceMaxPlusManhattan(pfs->dest_coords, tile));
 	}
@@ -543,7 +545,7 @@
 	return ret;
 }
 
-/* returns the track to choose on the next tile, or -1 when it's better to
+/** returns the track to choose on the next tile, or -1 when it's better to
  * reverse. The tile given is the tile we are about to enter, enterdir is the
  * direction in which we are entering the tile */
 static Track ChooseShipTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks)
@@ -558,7 +560,7 @@
 		NPFFoundTargetData ftd;
 		TileIndex src_tile = TILE_ADD(tile, TileOffsByDiagDir(ReverseDiagDir(enterdir)));
 		Trackdir trackdir = GetVehicleTrackdir(v);
-		assert(trackdir != INVALID_TRACKDIR); /* Check that we are not in a depot */
+		assert(trackdir != INVALID_TRACKDIR); // Check that we are not in a depot
 
 		NPFFillWithOrderData(&fstd, v);
 
@@ -731,7 +733,7 @@
 
 							/* Process station in the orderlist. */
 							st = GetStation(v->current_order.dest);
-							if (st->facilities & FACIL_DOCK) { /* ugly, ugly workaround for problem with ships able to drop off cargo at wrong stations */
+							if (st->facilities & FACIL_DOCK) { // ugly, ugly workaround for problem with ships able to drop off cargo at wrong stations
 								v->BeginLoading();
 								v->current_order.flags &= OF_FULL_LOAD | OF_UNLOAD | OF_TRANSFER;
 								v->current_order.flags |= OF_NON_STOP;
@@ -743,7 +745,7 @@
 									MarkShipDirty(v);
 								}
 								InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
-							} else { /* leave stations without docks right aways */
+							} else { // leave stations without docks right aways
 								v->current_order.type = OT_LEAVESTATION;
 								v->cur_order_index++;
 								InvalidateVehicleOrder(v);
@@ -834,6 +836,7 @@
 
 /** Build a ship.
  * @param tile tile of depot where ship is built
+ * @param flags type of operation
  * @param p1 ship type being built (engine)
  * @param p2 bit 0 when set, the unitnumber will be 0, otherwise it will be a free number
  */
@@ -844,7 +847,7 @@
 	UnitID unit_num;
 	Engine *e;
 
-	if (!IsEngineBuildable(p1, VEH_SHIP, _current_player)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
+	if (!IsEngineBuildable(p1, VEH_SHIP, _current_player)) return_cmd_error(STR_SHIP_NOT_AVAILABLE);
 
 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
@@ -930,6 +933,7 @@
 
 /** Sell a ship.
  * @param tile unused
+ * @param flags type of operation
  * @param p1 vehicle ID to be sold
  * @param p2 unused
  */
@@ -963,6 +967,7 @@
 
 /** Start/Stop a ship.
  * @param tile unused
+ * @param flags type of operation
  * @param p1 ship ID to start/stop
  * @param p2 unused
  */
@@ -1001,6 +1006,7 @@
 
 /** Send a ship to the depot.
  * @param tile unused
+ * @param flags type of operation
  * @param p1 vehicle ID to send to the depot
  * @param p2 various bitmasked elements
  * - p2 bit 0-3 - DEPOT_ flags (see vehicle.h)
@@ -1073,6 +1079,7 @@
 
 /** Refits a ship to the specified cargo type.
  * @param tile unused
+ * @param flags type of operation
  * @param p1 vehicle ID of the ship to refit
  * @param p2 various bitstuffed elements
  * - p2 = (bit 0-7) - the new cargo type to refit to (p2 & 0xFF)
--- a/src/ship_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/ship_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file ship_gui.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
@@ -32,7 +34,7 @@
 		StringID str;
 
 		SetWindowWidgetDisabledState(w, 2, v->owner != _local_player);
-		// disable service-scroller when interval is set to disabled
+		/* disable service-scroller when interval is set to disabled */
 		SetWindowWidgetDisabledState(w, 5, !_patches.servint_ships);
 		SetWindowWidgetDisabledState(w, 6, !_patches.servint_ships);
 
--- a/src/signs.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/signs.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file signs.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "table/strings.h"
@@ -31,6 +33,7 @@
 /**
  *
  * Update the coordinate of one sign
+ * @param si Pointer to the Sign
  *
  */
 static void UpdateSignVirtCoords(Sign *si)
@@ -98,6 +101,10 @@
 	return NULL;
 }
 
+/**
+ * Destroy a sign placed on the map
+ * @param si Pointer to the Sign to remove
+ */
 void DestroySign(Sign *si)
 {
 	DeleteName(si->str);
@@ -108,6 +115,7 @@
  * no effect whatsoever except for the colour the sign gets for easy recognition,
  * but everybody is able to rename/remove it.
  * @param tile tile to place sign at
+ * @param flags type of operation
  * @param p1 unused
  * @param p2 unused
  */
@@ -144,8 +152,10 @@
  * the user wanted to delete it. So delete it. Ownership of signs
  * has no meaning/effect whatsoever except for eyecandy
  * @param tile unused
+ * @param flags type of operation
  * @param p1 index of the sign to be renamed/removed
  * @param p2 unused
+ * @return 0 if succesfull, otherwise CMD_ERROR
  */
 int32 CmdRenameSign(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
@@ -177,7 +187,7 @@
 			/* Free the name, because we did not assign it yet */
 			DeleteName(str);
 		}
-	} else { /* Delete sign */
+	} else { // Delete sign
 		if (flags & DC_EXEC) {
 			Sign *si = GetSign(p1);
 
@@ -194,9 +204,11 @@
 }
 
 /**
- *
  * Callback function that is called after a sign is placed
- *
+ * @param success of the operation
+ * @param tile unused
+ * @param p1 unused
+ * @param p2 unused
  */
 void CcPlaceSign(bool success, TileIndex tile, uint32 p1, uint32 p2)
 {
@@ -210,7 +222,7 @@
  *
  * PlaceProc function, called when someone pressed the button if the
  *  sign-tool is selected
- *
+ * @param tile on which to place the sign
  */
 void PlaceProc_Sign(TileIndex tile)
 {
--- a/src/signs.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/signs.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file signs.h */
+
 #ifndef SIGNS_H
 #define SIGNS_H
 
@@ -69,7 +71,7 @@
 void UpdateAllSignVirtCoords();
 void PlaceProc_Sign(TileIndex tile);
 
-/* misc.c */
+/* misc.cpp */
 void ShowRenameSignWindow(const Sign *si);
 
 void ShowSignList();
--- a/src/signs_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/signs_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file signs_gui.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "table/strings.h"
--- a/src/slope.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/slope.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file slope.h */
+
 #ifndef SLOPE_H
 #define SLOPE_H
 
--- a/src/smallmap_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/smallmap_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file smallmap_gui.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "functions.h"
@@ -332,13 +334,13 @@
 	Pixel *dst_ptr_end = _screen.dst_ptr + _screen.width * _screen.height - _screen.width;
 
 	do {
-		// check if the tile (xc,yc) is within the map range
+		/* check if the tile (xc,yc) is within the map range */
 		if (xc < MapMaxX() && yc < MapMaxY()) {
-			// check if the dst pointer points to a pixel inside the screen buffer
+			/* check if the dst pointer points to a pixel inside the screen buffer */
 			if (dst > _screen.dst_ptr && dst < dst_ptr_end)
 				WRITE_PIXELS_OR(dst, proc(TileXY(xc, yc)) & mask);
 		}
-	// switch to next tile in the column
+	/* switch to next tile in the column */
 	} while (xc++, yc++, dst += pitch, --reps != 0);
 }
 
@@ -454,7 +456,7 @@
 			default:              bits = MKCOLOR(0xFFFFFFFF); break;
 		}
 	} else {
-		// ground color
+		/* ground color */
 		bits = ApplyMask(MKCOLOR(0x54545454), &_smallmap_contours_andor[t]);
 	}
 	return bits;
@@ -693,7 +695,7 @@
 		FOR_ALL_VEHICLES(v) {
 			if (v->type != VEH_SPECIAL &&
 					(v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) == 0) {
-				// Remap into flat coordinates.
+				/* Remap into flat coordinates. */
 				Point pt = RemapCoords(
 					v->x_pos / TILE_SIZE - WP(w,smallmap_d).scroll_x / TILE_SIZE, // divide each one separately because (a-b)/c != a/c-b/c in integer world
 					v->y_pos / TILE_SIZE - WP(w,smallmap_d).scroll_y / TILE_SIZE, //    dtto
@@ -701,32 +703,32 @@
 				x = pt.x;
 				y = pt.y;
 
-				// Check if y is out of bounds?
+				/* Check if y is out of bounds? */
 				y -= dpi->top;
 				if (!IS_INT_INSIDE(y, 0, dpi->height)) continue;
 
-				// Default is to draw both pixels.
+				/* Default is to draw both pixels. */
 				skip = false;
 
-				// Offset X coordinate
+				/* Offset X coordinate */
 				x -= WP(w,smallmap_d).subscroll + 3 + dpi->left;
 
 				if (x < 0) {
-					// if x+1 is 0, that means we're on the very left edge,
-					//  and should thus only draw a single pixel
+					/* if x+1 is 0, that means we're on the very left edge,
+					 *  and should thus only draw a single pixel */
 					if (++x != 0) continue;
 					skip = true;
 				} else if (x >= dpi->width - 1) {
-					// Check if we're at the very right edge, and if so draw only a single pixel
+					/* Check if we're at the very right edge, and if so draw only a single pixel */
 					if (x != dpi->width - 1) continue;
 					skip = true;
 				}
 
-				// Calculate pointer to pixel and the color
+				/* Calculate pointer to pixel and the color */
 				ptr = dpi->dst_ptr + y * dpi->pitch + x;
 				color = (type == 1) ? _vehicle_type_colors[v->type] : 0xF;
 
-				// And draw either one or two pixels depending on clipping
+				/* And draw either one or two pixels depending on clipping */
 				ptr[0] = color;
 				if (!skip) ptr[1] = color;
 			}
@@ -737,7 +739,7 @@
 		const Town *t;
 
 		FOR_ALL_TOWNS(t) {
-			// Remap the town coordinate
+			/* Remap the town coordinate */
 			Point pt = RemapCoords(
 				(int)(TileX(t->xy) * TILE_SIZE - WP(w, smallmap_d).scroll_x) / TILE_SIZE,
 				(int)(TileY(t->xy) * TILE_SIZE - WP(w, smallmap_d).scroll_y) / TILE_SIZE,
@@ -745,23 +747,23 @@
 			x = pt.x - WP(w,smallmap_d).subscroll + 3 - (t->sign.width_2 >> 1);
 			y = pt.y;
 
-			// Check if the town sign is within bounds
+			/* Check if the town sign is within bounds */
 			if (x + t->sign.width_2 > dpi->left &&
 					x < dpi->left + dpi->width &&
 					y + 6 > dpi->top &&
 					y < dpi->top + dpi->height) {
-				// And draw it.
+				/* And draw it. */
 				SetDParam(0, t->index);
 				DrawString(x, y, STR_2056, 12);
 			}
 		}
 	}
 
-	// Draw map indicators
+	/* Draw map indicators */
 	{
 		Point pt;
 
-		// Find main viewport.
+		/* Find main viewport. */
 		vp = FindWindowById(WC_MAIN_WINDOW,0)->viewport;
 
 		pt = RemapCoords(WP(w, smallmap_d).scroll_x, WP(w, smallmap_d).scroll_y, 0);
@@ -1033,7 +1035,7 @@
 			int x = WP(w, vp_d).scrollpos_x; // Where is the main looking at
 			int y = WP(w, vp_d).scrollpos_y;
 
-			// set this view to same location. Based on the center, adjusting for zoom
+			/* set this view to same location. Based on the center, adjusting for zoom */
 			WP(w2, vp_d).scrollpos_x =  x - (w2->viewport->virtual_width -  w->viewport->virtual_width) / 2;
 			WP(w2, vp_d).scrollpos_y =  y - (w2->viewport->virtual_height - w->viewport->virtual_height) / 2;
 		} break;
@@ -1094,18 +1096,18 @@
 	Window *w, *v;
 	int i = 0;
 
-	// find next free window number for extra viewport
+	/* find next free window number for extra viewport */
 	while (FindWindowById(WC_EXTRA_VIEW_PORT, i) != NULL) i++;
 
 	w = AllocateWindowDescFront(&_extra_view_port_desc, i);
 	if (w != NULL) {
 		int x, y;
-		// the main window with the main view
+		/* the main window with the main view */
 		v = FindWindowById(WC_MAIN_WINDOW, 0);
-		// New viewport start ats (zero,zero)
+		/* New viewport start ats (zero,zero) */
 		AssignWindowViewport(w, 3, 17, 294, 214, 0 , 0);
 
-		// center on same place as main window (zoom is maximum, no adjustment needed)
+		/* center on same place as main window (zoom is maximum, no adjustment needed) */
 		x = WP(v, vp_d).scrollpos_x;
 		y = WP(v, vp_d).scrollpos_y;
 		WP(w, vp_d).scrollpos_x = x + (v->viewport->virtual_width  - (294)) / 2;
--- a/src/sound.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/sound.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file sound.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "functions.h"
@@ -51,12 +53,12 @@
 
 		FioSeekTo(fe->file_offset, SEEK_SET);
 
-		// Check for special case, see else case
+		/* Check for special case, see else case */
 		FioReadBlock(name, FioReadByte()); // Read the name of the sound
 		if (strcmp(name, "Corrupt sound") != 0) {
 			FioSeekTo(12, SEEK_CUR); // Skip past RIFF header
 
-			// Read riff tags
+			/* Read riff tags */
 			for (;;) {
 				uint32 tag = FioReadDword();
 				uint32 size = FioReadDword();
@@ -130,7 +132,7 @@
 	return true;
 }
 
-// Low level sound player
+/* Low level sound player */
 static void StartSound(uint sound, int panning, uint volume)
 {
 	MixerChannel *mc;
--- a/src/sound.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/sound.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file sound.h */
+
 #ifndef SOUND_H
 #define SOUND_H
 
--- a/src/sprite.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/sprite.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file sprite.h */
+
 #ifndef SPRITE_H
 #define SPRITE_H
 
@@ -40,7 +42,7 @@
 	byte draw_proc;  /* this allows to specify a special drawing procedure.*/
 };
 
-// Iterate through all DrawTileSeqStructs in DrawTileSprites.
+/** Iterate through all DrawTileSeqStructs in DrawTileSprites. */
 #define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++)
 
 
--- a/src/spritecache.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/spritecache.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file spritechache.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
@@ -237,7 +239,7 @@
 
 void IncreaseSpriteLRU()
 {
-	// Increase all LRU values
+	/* Increase all LRU values */
 	if (_sprite_lru_counter > 16384) {
 		SpriteID i;
 
@@ -256,15 +258,15 @@
 		_sprite_lru_counter = 0;
 	}
 
-	// Compact sprite cache every now and then.
+	/* Compact sprite cache every now and then. */
 	if (++_compact_cache_counter >= 740) {
 		CompactSpriteCache();
 		_compact_cache_counter = 0;
 	}
 }
 
-// Called when holes in the sprite cache should be removed.
-// That is accomplished by moving the cached data.
+/** Called when holes in the sprite cache should be removed.
+ * That is accomplished by moving the cached data. */
 static void CompactSpriteCache()
 {
 	MemBlock *s;
@@ -277,26 +279,26 @@
 			MemBlock temp;
 			SpriteID i;
 
-			// Since free blocks are automatically coalesced, this should hold true.
+			/* Since free blocks are automatically coalesced, this should hold true. */
 			assert(!(next->size & S_FREE_MASK));
 
-			// If the next block is the sentinel block, we can safely return
+			/* If the next block is the sentinel block, we can safely return */
 			if (next->size == 0)
 				break;
 
-			// Locate the sprite belonging to the next pointer.
+			/* Locate the sprite belonging to the next pointer. */
 			for (i = 0; GetSpriteCache(i)->ptr != next->data; i++) {
 				assert(i != _spritecache_items);
 			}
 
 			GetSpriteCache(i)->ptr = s->data; // Adjust sprite array entry
-			// Swap this and the next block
+			/* Swap this and the next block */
 			temp = *s;
 			memmove(s, next, next->size);
 			s = NextBlock(s);
 			*s = temp;
 
-			// Coalesce free blocks
+			/* Coalesce free blocks */
 			while (NextBlock(s)->size & S_FREE_MASK) {
 				s->size += NextBlock(s)->size & ~S_FREE_MASK;
 			}
@@ -324,18 +326,18 @@
 		}
 	}
 
-	// Display an error message and die, in case we found no sprite at all.
-	// This shouldn't really happen, unless all sprites are locked.
+	/* Display an error message and die, in case we found no sprite at all.
+	 * This shouldn't really happen, unless all sprites are locked. */
 	if (best == (uint)-1)
 		error("Out of sprite memory");
 
-	// Mark the block as free (the block must be in use)
+	/* Mark the block as free (the block must be in use) */
 	s = (MemBlock*)GetSpriteCache(best)->ptr - 1;
 	assert(!(s->size & S_FREE_MASK));
 	s->size |= S_FREE_MASK;
 	GetSpriteCache(best)->ptr = NULL;
 
-	// And coalesce adjacent free blocks
+	/* And coalesce adjacent free blocks */
 	for (s = _spritecache_ptr; s->size != 0; s = NextBlock(s)) {
 		if (s->size & S_FREE_MASK) {
 			while (NextBlock(s)->size & S_FREE_MASK) {
@@ -364,10 +366,10 @@
 				 * big enough for an additional free block? */
 				if (cur_size == mem_req ||
 						cur_size >= mem_req + sizeof(MemBlock)) {
-					// Set size and in use
+					/* Set size and in use */
 					s->size = mem_req;
 
-					// Do we need to inject a free block too?
+					/* Do we need to inject a free block too? */
 					if (cur_size != mem_req) {
 						NextBlock(s)->size = (cur_size - mem_req) | S_FREE_MASK;
 					}
@@ -377,7 +379,7 @@
 			}
 		}
 
-		// Reached sentinel, but no block found yet. Delete some old entry.
+		/* Reached sentinel, but no block found yet. Delete some old entry. */
 		DeleteEntryFromSpriteCache();
 	}
 }
@@ -392,12 +394,12 @@
 
 	sc = GetSpriteCache(sprite);
 
-	// Update LRU
+	/* Update LRU */
 	sc->lru = ++_sprite_lru_counter;
 
 	p = sc->ptr;
 
-	// Load the sprite, if it is not loaded, yet
+	/* Load the sprite, if it is not loaded, yet */
 	if (p == NULL) p = ReadSprite(sc, sprite);
 	return p;
 }
@@ -405,12 +407,12 @@
 
 void GfxInitSpriteMem()
 {
-	// initialize sprite cache heap
+	/* initialize sprite cache heap */
 	if (_spritecache_ptr == NULL) _spritecache_ptr = (MemBlock*)malloc(SPRITE_CACHE_SIZE);
 
-	// A big free block
+	/* A big free block */
 	_spritecache_ptr->size = (SPRITE_CACHE_SIZE - sizeof(MemBlock)) | S_FREE_MASK;
-	// Sentinel block (identified by size == 0)
+	/* Sentinel block (identified by size == 0) */
 	NextBlock(_spritecache_ptr)->size = 0;
 
 	/* Reset the spritecache 'pool' */
--- a/src/spritecache.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/spritecache.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file spritecache.h */
+
 #ifndef SPRITECACHE_H
 #define SPRITECACHE_H
 
--- a/src/station.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/station.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -55,12 +55,12 @@
 }
 
 /**
-	* Clean up a station by clearing vehicle orders and invalidating windows.
-	* Aircraft-Hangar orders need special treatment here, as the hangars are
-	* actually part of a station (tiletype is STATION), but the order type
-	* is OT_GOTO_DEPOT.
-	* @param st Station to be deleted
-	*/
+ * Clean up a station by clearing vehicle orders and invalidating windows.
+ * Aircraft-Hangar orders need special treatment here, as the hangars are
+ * actually part of a station (tiletype is STATION), but the order type
+ * is OT_GOTO_DEPOT.
+ * @param st Station to be deleted
+ */
 Station::~Station()
 {
 	DEBUG(station, cDebugCtorLevel, "I-%3d", index);
@@ -106,7 +106,7 @@
 }
 
 /** Called when new facility is built on the station. If it is the first facility
-	* it initializes also 'xy' and 'random_bits' members */
+ * it initializes also 'xy' and 'random_bits' members */
 void Station::AddFacility(byte new_facility_bit, TileIndex facil_xy)
 {
 	if (facilities == 0) {
@@ -182,7 +182,7 @@
 /** Obtain the length of a platform
  * @pre tile must be a railway station tile
  * @param tile A tile that contains the platform in question
- * @returns The length of the platform
+ * @return The length of the platform
  */
 uint Station::GetPlatformLength(TileIndex tile) const
 {
--- a/src/station.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/station.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file station.h */
+
 #ifndef STATION_H
 #define STATION_H
 
@@ -82,8 +84,8 @@
 
 struct StationSpecList {
 	const StationSpec *spec;
-	uint32 grfid;      /// GRF ID of this custom station
-	uint8  localidx;   /// Station ID within GRF of station
+	uint32 grfid;      ///< GRF ID of this custom station
+	uint8  localidx;   ///< Station ID within GRF of station
 };
 
 /** StationRect - used to track station spread out rectangle - cheaper than scanning whole map */
@@ -118,7 +120,7 @@
 
 		const AirportFTAClass *Airport() const
 		{
-			assert(airport_tile != 0);
+			if (airport_tile == 0) return GetAirport(AT_DUMMY);
 			return GetAirport(airport_type);
 		}
 
@@ -142,7 +144,7 @@
 	byte facilities;
 	byte airport_type;
 
-	// trainstation width/height
+	/* trainstation width/height */
 	byte trainst_w, trainst_h;
 
 	/** List of custom stations (StationSpecs) allocated to the station */
@@ -151,7 +153,7 @@
 
 	Date build_date;
 
-	uint64 airport_flags;   /// stores which blocks on the airport are taken. was 16 bit earlier on, then 32
+	uint64 airport_flags;   ///< stores which blocks on the airport are taken. was 16 bit earlier on, then 32
 	StationID index;
 
 	byte last_vehicle_type;
--- a/src/station_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/station_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -118,7 +118,7 @@
 
 static Station* GetStationAround(TileIndex tile, int w, int h, StationID closest_station)
 {
-	// check around to see if there's any stations there
+	/* check around to see if there's any stations there */
 	BEGIN_TILE_LOOP(tile_cur, w + 2, h + 2, tile - TileDiffXY(1, 1))
 		if (IsTileType(tile_cur, MP_STATION)) {
 			StationID t = GetStationIndex(tile_cur);
@@ -1190,9 +1190,12 @@
 	/* If it is a drive-through stop check for valid axis */
 	if (is_drive_through && !IsValidAxis((Axis)p1)) return CMD_ERROR;
 	/* Road bits in the wrong direction */
-	if (build_over_road && (GetRoadBits(tile) & ((Axis)p1 == AXIS_X ? ROAD_Y : ROAD_X)) != 0) return CMD_ERROR;
+	if (build_over_road && (GetRoadBits(tile) & ((Axis)p1 == AXIS_X ? ROAD_Y : ROAD_X)) != 0) return_cmd_error(STR_DRIVE_THROUGH_ERROR_DIRECTION);
 	/* Not allowed to build over this road */
-	if (build_over_road && !IsTileOwner(tile, _current_player) && !(IsTileOwner(tile, OWNER_TOWN) && _patches.road_stop_on_town_road)) return CMD_ERROR;
+	if (build_over_road) {
+		if (IsTileOwner(tile, OWNER_TOWN) && !_patches.road_stop_on_town_road) return_cmd_error(STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD);
+		if (!IsTileOwner(tile, OWNER_TOWN) && !CheckOwnership(GetTileOwner(tile))) return CMD_ERROR;
+	}
 
 	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
 
@@ -1600,6 +1603,13 @@
 
 	int32 cost = w * h * _price.remove_airport;
 
+	Vehicle *v;
+	FOR_ALL_VEHICLES(v) {
+		if (!(v->type == VEH_AIRCRAFT && IsNormalAircraft(v))) continue;
+
+		if (v->u.air.targetairport == st->index && v->u.air.state != FLYING) return CMD_ERROR;
+	}
+
 	BEGIN_TILE_LOOP(tile_cur, w, h, tile) {
 		if (!EnsureNoVehicle(tile_cur)) return CMD_ERROR;
 
@@ -1949,7 +1959,7 @@
 		}
 
 		SpriteID pal;
-		if (_display_opt & DO_TRANS_BUILDINGS) {
+		if (HASBIT(_transparent_opt, TO_BUILDINGS)) {
 			SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 			pal = PALETTE_TO_TRANSPARENT;
 		} else if (HASBIT(image, PALETTE_MODIFIER_COLOR)) {
--- a/src/station_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/station_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file station_gui.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
@@ -51,7 +53,8 @@
  * goes for the rating: at above 90% orso (224) it is also 'full'
  * Each cargo-bar is 16 pixels wide and 6 pixels high
  * Each rating 14 pixels wide and 1 pixel high and is 1 pixel below the cargo-bar
- * @param x,y X/Y coordinate to draw the box at
+ * @param x coordinate to draw the box at
+ * @param y coordinate to draw the box at
  * @param type Cargo type
  * @param amount Cargo amount
  * @param rating ratings data for that particular cargo */
@@ -230,7 +233,7 @@
 						}
 					}
 				}
-				//stations without waiting cargo
+				/* stations without waiting cargo */
 				if (num_waiting_cargo == 0 && include_empty) {
 					station_sort[n++] = st;
 				}
@@ -320,7 +323,7 @@
 			int cg_ofst;
 			int x = 89;
 			int y = 14;
-			int xb = 2; // offset from left of widget
+			int xb = 2; ///< offset from left of widget
 
 			uint i = 0;
 			for (CargoID c = 0; c < NUM_CARGO; c++) {
@@ -363,7 +366,7 @@
 				SetDParam(1, st->facilities);
 				x = DrawString(xb, y, STR_3049_0, 0) + 5;
 
-				// show cargo waiting and station ratings
+				/* show cargo waiting and station ratings */
 				for (CargoID j = 0; j < NUM_CARGO; j++) {
 					uint amount = GB(st->goods[j].waiting_acceptance, 0, 12);
 					if (amount != 0) {
@@ -510,7 +513,7 @@
 
 		case WE_DROPDOWN_SELECT: /* we have selected a dropdown item in the list */
 			if (sl->sort_type != e->we.dropdown.index) {
-				// value has changed -> resort
+				/* value has changed -> resort */
 				sl->sort_type = e->we.dropdown.index;
 				station_sort.criteria = sl->sort_type;
 				sl->flags |= SL_RESORT;
--- a/src/station_map.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/station_map.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file station_map.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "station_map.h"
--- a/src/station_map.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/station_map.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file station_map.h */
+
 #ifndef STATION_MAP_H
 #define STATION_MAP_H
 
--- a/src/stdafx.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/stdafx.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file stdfax.h */
+
 #ifndef STDAFX_H
 #define STDAFX_H
 
--- a/src/string.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/string.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file string.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "functions.h"
@@ -123,7 +125,8 @@
  * not found, this is sufficient. If more, or general functionality is
  * needed, look to r7271 where it was removed because it was broken when
  * using certain locales: eg in Turkish the uppercase 'I' was converted to
- * '?', so just revert to the old functionality */
+ * '?', so just revert to the old functionality
+ * @param str string to convert */
 void strtolower(char *str)
 {
 	for (; *str != '\0'; str++) *str = tolower(*str);
--- a/src/string.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/string.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,26 +1,28 @@
 /* $Id$ */
 
+/** @file string.h */
+
 #ifndef STRING_H
 #define STRING_H
 
 #include "macros.h"
 
-/*
- * dst: destination buffer
- * src: string to copy/concatenate
- * size: size of the destination buffer
- * usage: ttd_strlcpy(dst, src, lengthof(dst));
+/**
+ * usage ttd_strlcpy(dst, src, lengthof(dst));
+ * @param dst destination buffer
+ * @param src string to copy/concatenate
+ * @param size size of the destination buffer
  */
 void ttd_strlcat(char *dst, const char *src, size_t size);
 void ttd_strlcpy(char *dst, const char *src, size_t size);
 
-/*
- * dst: destination buffer
- * src: string to copy
- * last: pointer to the last element in the dst array
- *       if NULL no boundary check is performed
- * returns a pointer to the terminating \0 in the destination buffer
+/**
  * usage: strecpy(dst, src, lastof(dst));
+ * @param dst destination buffer
+ * @param src string to copy
+ * @param last pointer to the last element in the dst array
+ *             if NULL no boundary check is performed
+ * @return a pointer to the terminating \0 in the destination buffer
  */
 char* strecat(char* dst, const char* src, const char* last);
 char* strecpy(char* dst, const char* src, const char* last);
@@ -38,9 +40,9 @@
  * Valid filter types for IsValidChar.
  */
 enum CharSetFilter {
-	CS_ALPHANUMERAL,      //! Both numeric and alphabetic and spaces and stuff
-	CS_NUMERAL,           //! Only numeric ones
-	CS_ALPHA,             //! Only alphabetic values
+	CS_ALPHANUMERAL,      ///< Both numeric and alphabetic and spaces and stuff
+	CS_NUMERAL,           ///< Only numeric ones
+	CS_ALPHA,             ///< Only alphabetic values
 };
 
 /** Convert the given string to lowercase, only works with ASCII! */
@@ -105,6 +107,8 @@
  * Return the length of an UTF-8 encoded value based on a single char. This
  * char should be the first byte of the UTF-8 encoding. If not, or encoding
  * is invalid, return value is 0
+ * @param c char to query length of
+ * @return requested size
  */
 static inline size_t Utf8EncodedCharLen(char c)
 {
@@ -127,7 +131,7 @@
 /**
  * Retrieve the previous UNICODE character in an UTF-8 encoded string.
  * @param s char pointer pointing to (the first char of) the next character
- * @returns a pointer in 's' to the previous UNICODE character's first byte
+ * @return a pointer in 's' to the previous UNICODE character's first byte
  * @note The function should not be used to determine the length of the previous
  * encoded char because it might be an invalid/corrupt start-sequence
  */
--- a/src/strings.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/strings.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file strings.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "currency.h"
@@ -37,7 +39,7 @@
 static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei, const char* last);
 
 struct LanguagePack {
-	uint32 ident;
+	uint32 ident;       // 32-bits identifier
 	uint32 version;     // 32-bits of auto generated version info which is basically a hash of strings.h
 	char name[32];      // the international name of this language
 	char own_name[32];  // the localized name of this language
@@ -45,16 +47,16 @@
 	uint16 offsets[32]; // the offsets
 	byte plural_form;   // how to compute plural forms
 	byte pad[3];        // pad header to be a multiple of 4
-	char data[VARARRAY_SIZE];
+	char data[VARARRAY_SIZE]; // list of strings
 };
 
 static char **_langpack_offs;
 static LanguagePack *_langpack;
-static uint _langtab_num[32]; // Offset into langpack offs
+static uint _langtab_num[32];   // Offset into langpack offs
 static uint _langtab_start[32]; // Offset into langpack offs
 
 
-// Read an int64 from the argv array.
+/** Read an int64 from the argv array. */
 static inline int64 GetInt64(const int32 **argv)
 {
 	int64 result;
@@ -65,14 +67,14 @@
 	return result;
 }
 
-// Read an int32 from the argv array.
+/** Read an int32 from the argv array. */
 static inline int32 GetInt32(const int32 **argv)
 {
 	assert(argv);
 	return *(*argv)++;
 }
 
-// Read an array from the argv array.
+/** Read an array from the argv array. */
 static inline const int32 *GetArgvPtr(const int32 **argv, int n)
 {
 	const int32 *result;
@@ -85,13 +87,13 @@
 
 #define NUM_BOUND_STRINGS 8
 
-// Array to hold the bound strings.
+/* Array to hold the bound strings. */
 static const char *_bound_strings[NUM_BOUND_STRINGS];
 
-// This index is used to implement a "round-robin" allocating of
-// slots for BindCString. NUM_BOUND_STRINGS slots are reserved.
-// Which means that after NUM_BOUND_STRINGS calls to BindCString,
-// the indices will be reused.
+/* This index is used to implement a "round-robin" allocating of
+ * slots for BindCString. NUM_BOUND_STRINGS slots are reserved.
+ * Which means that after NUM_BOUND_STRINGS calls to BindCString,
+ * the indices will be reused. */
 static int _bind_index;
 
 static const char *GetStringPtr(StringID string)
@@ -99,10 +101,16 @@
 	return _langpack_offs[_langtab_start[string >> 11] + (string & 0x7FF)];
 }
 
-// The highest 8 bits of string contain the "case index".
-// These 8 bits will only be set when FormatString wants to print
-// the string in a different case. No one else except FormatString
-// should set those bits, therefore string CANNOT be StringID, but uint32.
+/** The highest 8 bits of string contain the "case index".
+ * These 8 bits will only be set when FormatString wants to print
+ * the string in a different case. No one else except FormatString
+ * should set those bits, therefore string CANNOT be StringID, but uint32.
+ * @param buffr
+ * @param string
+ * @param argv
+ * @param last
+ * @return a formatted string of char
+ */
 static char *GetStringWithArgs(char *buffr, uint string, const int32 *argv, const char* last)
 {
 	uint index = GB(string,  0, 11);
@@ -122,8 +130,8 @@
 				return GetSpecialPlayerNameString(buffr, index - 0xE4, argv, last);
 			break;
 
-		// User defined name
 		case 15:
+			/* User defined name */
 			return GetName(buffr, index, last);
 
 		case 26:
@@ -147,8 +155,8 @@
 			return FormatString(buffr, buff, argv, 0, last);
 
 		case 31:
-			// dynamic strings. These are NOT to be passed through the formatter,
-			// but passed through verbatim.
+			/* dynamic strings. These are NOT to be passed through the formatter,
+			 * but passed through verbatim. */
 			if (index < (STR_SPEC_USERSTRING & 0x7FF)) {
 				return strecpy(buffr, _bound_strings[index], last);
 			}
@@ -184,7 +192,8 @@
  * This function takes a C-string and allocates a temporary string ID.
  * The StringID of the bound string is valid until BindCString is called
  * another NUM_BOUND_STRINGS times. So be careful when using it.
- *
+ * @param str temp string to add
+ * @return the id of that temp string
  * @note formatting a DATE_TINY calls BindCString twice, thus reduces the
  *       amount of 'user' bound strings by 2.
  * @todo rewrite the BindCString system to make the limit flexible and
@@ -198,7 +207,10 @@
 	return idx + STR_SPEC_DYNSTRING;
 }
 
-// This function is used to "bind" a C string to a OpenTTD dparam slot.
+/** This function is used to "bind" a C string to a OpenTTD dparam slot.
+ * @param n slot of the string
+ * @param str string to bind
+ */
 void SetDParamStr(uint n, const char *str)
 {
 	SetDParam(n, BindCString(str));
@@ -331,10 +343,10 @@
 	char* p;
 	int j;
 
-	// multiply by exchange rate
+	/* multiply by exchange rate */
 	number *= spec->rate;
 
-	// convert from negative
+	/* convert from negative */
 	if (number < 0) {
 		buff = strecpy(buff, "-", last);
 		number = -number;
@@ -345,7 +357,7 @@
 	 * The only remaining value is 1 (suffix), so everything that is not 1 */
 	if (spec->symbol_pos != 1) buff = strecpy(buff, spec->prefix, last);
 
-	// for huge numbers, compact the number into k or M
+	/* for huge numbers, compact the number into k or M */
 	if (compact) {
 		if (number >= 1000000000) {
 			number = (number + 500000) / 1000000;
@@ -356,7 +368,7 @@
 		}
 	}
 
-	// convert to ascii number and add commas
+	/* convert to ascii number and add commas */
 	p = endof(buf);
 	*--p = '\0';
 	j = 4;
@@ -381,63 +393,63 @@
 
 static int DeterminePluralForm(int32 n)
 {
-	// The absolute value determines plurality
+	/* The absolute value determines plurality */
 	if (n < 0) n = -n;
 
 	switch (_langpack->plural_form) {
-	// Two forms, singular used for one only
-	// Used in:
-	//   Danish, Dutch, English, German, Norwegian, Swedish, Estonian, Finnish,
-	//   Greek, Hebrew, Italian, Portuguese, Spanish, Esperanto
+	/* Two forms, singular used for one only
+	 * Used in:
+	 *   Danish, Dutch, English, German, Norwegian, Swedish, Estonian, Finnish,
+	 *   Greek, Hebrew, Italian, Portuguese, Spanish, Esperanto */
 	case 0:
 	default:
 		return n != 1;
 
-	// Only one form
-	// Used in:
-	//   Hungarian, Japanese, Korean, Turkish
+	/* Only one form
+	 * Used in:
+	 *   Hungarian, Japanese, Korean, Turkish */
 	case 1:
 		return 0;
 
-	// Two forms, singular used for zero and one
-	// Used in:
-	//   French, Brazilian Portuguese
+	/* Two forms, singular used for zero and one
+	 * Used in:
+	 *   French, Brazilian Portuguese */
 	case 2:
 		return n > 1;
 
-	// Three forms, special case for zero
-	// Used in:
-	//   Latvian
+	/* Three forms, special case for zero
+	 * Used in:
+	 *   Latvian */
 	case 3:
 		return n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2;
 
-	// Three forms, special case for one and two
-	// Used in:
-	//   Gaelige (Irish)
+	/* Three forms, special case for one and two
+	 * Used in:
+	 *   Gaelige (Irish) */
 	case 4:
 		return n==1 ? 0 : n==2 ? 1 : 2;
 
-	// Three forms, special case for numbers ending in 1[2-9]
-	// Used in:
-	//   Lithuanian
+	/* Three forms, special case for numbers ending in 1[2-9]
+	 * Used in:
+	 *   Lithuanian */
 	case 5:
 		return n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2;
 
-	// Three forms, special cases for numbers ending in 1 and 2, 3, 4, except those ending in 1[1-4]
-	// Used in:
-	//   Croatian, Czech, Russian, Slovak, Ukrainian
+	/* Three forms, special cases for numbers ending in 1 and 2, 3, 4, except those ending in 1[1-4]
+	 * Used in:
+	 *   Croatian, Czech, Russian, Slovak, Ukrainian */
 	case 6:
 		return n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
 
-	// Three forms, special case for one and some numbers ending in 2, 3, or 4
-	// Used in:
-	//   Polish
+	/* Three forms, special case for one and some numbers ending in 2, 3, or 4
+	 * Used in:
+	 *   Polish */
 	case 7:
 		return n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
 
-	// Four forms, special case for one and all numbers ending in 02, 03, or 04
-	// Used in:
-	//   Slovenian
+	/* Four forms, special case for one and all numbers ending in 02, 03, or 04
+	 * Used in:
+	 *   Slovenian */
 	case 8:
 		return n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;
 	}
@@ -561,9 +573,9 @@
 				break;
 
 			case SCC_CARGO_SHORT: { /* {SHORTCARGO} */
-				// Short description of cargotypes. Layout:
-				// 8-bit = cargo type
-				// 16-bit = cargo count
+				/* Short description of cargotypes. Layout:
+				 * 8-bit = cargo type
+				 * 16-bit = cargo count */
 				StringID cargo_str = GetCargo(GetInt32(&argv))->units_volume;
 				switch (cargo_str) {
 					case STR_TONS: {
@@ -599,13 +611,13 @@
 			} break;
 
 			case SCC_CURRENCY_COMPACT_64: { /* {CURRCOMPACT64} */
-				// 64 bit compact currency-unit
+				/* 64 bit compact currency-unit */
 				buff = FormatGenericCurrency(buff, _currency, GetInt64(&argv), true, last);
 				break;
 			}
 
 			case SCC_STRING1: { /* {STRING1} */
-				// String that consumes ONE argument
+				/* String that consumes ONE argument */
 				uint str = modifier + GetInt32(&argv);
 				buff = GetStringWithArgs(buff, str, GetArgvPtr(&argv, 1), last);
 				modifier = 0;
@@ -613,7 +625,7 @@
 			}
 
 			case SCC_STRING2: { /* {STRING2} */
-				// String that consumes TWO arguments
+				/* String that consumes TWO arguments */
 				uint str = modifier + GetInt32(&argv);
 				buff = GetStringWithArgs(buff, str, GetArgvPtr(&argv, 2), last);
 				modifier = 0;
@@ -621,7 +633,7 @@
 			}
 
 			case SCC_STRING3: { /* {STRING3} */
-				// String that consumes THREE arguments
+				/* String that consumes THREE arguments */
 				uint str = modifier + GetInt32(&argv);
 				buff = GetStringWithArgs(buff, str, GetArgvPtr(&argv, 3), last);
 				modifier = 0;
@@ -629,7 +641,7 @@
 			}
 
 			case SCC_STRING4: { /* {STRING4} */
-				// String that consumes FOUR arguments
+				/* String that consumes FOUR arguments */
 				uint str = modifier + GetInt32(&argv);
 				buff = GetStringWithArgs(buff, str, GetArgvPtr(&argv, 4), last);
 				modifier = 0;
@@ -637,7 +649,7 @@
 			}
 
 			case SCC_STRING5: { /* {STRING5} */
-				// String that consumes FIVE arguments
+				/* String that consumes FIVE arguments */
 				uint str = modifier + GetInt32(&argv);
 				buff = GetStringWithArgs(buff, str, GetArgvPtr(&argv, 5), last);
 				modifier = 0;
@@ -653,11 +665,11 @@
 				const Industry* i = GetIndustry(GetInt32(&argv));
 				int32 args[2];
 
-				// industry not valid anymore?
+				/* industry not valid anymore? */
 				if (!IsValidIndustry(i)) break;
 
-				// First print the town name and the industry type name
-				// The string STR_INDUSTRY_PATTERN controls the formatting
+				/* First print the town name and the industry type name
+				 * The string STR_INDUSTRY_PATTERN controls the formatting */
 				args[0] = i->town->index;
 				args[1] = GetIndustrySpec(i->type)->name;
 				buff = FormatString(buff, GetStringPtr(STR_INDUSTRY_FORMAT), args, modifier >> 24, last);
@@ -690,9 +702,9 @@
 			}
 
 			case SCC_CARGO: { // {CARGO}
-				// Layout now is:
-				//   8bit   - cargo type
-				//   16-bit - cargo count
+				/* Layout now is:
+				 *   8bit   - cargo type
+				 *   16-bit - cargo count */
 				CargoID cargo = GetInt32(&argv);
 				StringID cargo_str = (cargo == CT_INVALID) ? (StringID)STR_8838_N_A : GetCargo(cargo)->quantifier;
 				buff = GetStringWithArgs(buff, cargo_str, argv++, last);
@@ -748,17 +760,17 @@
 				argv++;
 				break;
 
-			// This sets up the gender for the string.
-			// We just ignore this one. It's used in {G 0 Der Die Das} to determine the case.
+			/* This sets up the gender for the string.
+			 * We just ignore this one. It's used in {G 0 Der Die Das} to determine the case. */
 			case SCC_GENDER_INDEX: // {GENDER 0}
 				str++;
 				break;
 
 			case SCC_STRING: {// {STRING}
 				uint str = modifier + GetInt32(&argv);
-				// WARNING. It's prohibited for the included string to consume any arguments.
-				// For included strings that consume argument, you should use STRING1, STRING2 etc.
-				// To debug stuff you can set argv to NULL and it will tell you
+				/* WARNING. It's prohibited for the included string to consume any arguments.
+				 * For included strings that consume argument, you should use STRING1, STRING2 etc.
+				 * To debug stuff you can set argv to NULL and it will tell you */
 				buff = GetStringWithArgs(buff, str, argv, last);
 				modifier = 0;
 				break;
@@ -834,23 +846,23 @@
 			}
 
 			case SCC_SETCASE: { // {SETCASE}
-				// This is a pseudo command, it's outputted when someone does {STRING.ack}
-				// The modifier is added to all subsequent GetStringWithArgs that accept the modifier.
+				/* This is a pseudo command, it's outputted when someone does {STRING.ack}
+				 * The modifier is added to all subsequent GetStringWithArgs that accept the modifier. */
 				modifier = (byte)*str++ << 24;
 				break;
 			}
 
 			case SCC_SWITCH_CASE: { // {Used to implement case switching}
-				// <0x9E> <NUM CASES> <CASE1> <LEN1> <STRING1> <CASE2> <LEN2> <STRING2> <CASE3> <LEN3> <STRING3> <STRINGDEFAULT>
-				// Each LEN is printed using 2 bytes in big endian order.
+				/* <0x9E> <NUM CASES> <CASE1> <LEN1> <STRING1> <CASE2> <LEN2> <STRING2> <CASE3> <LEN3> <STRING3> <STRINGDEFAULT>
+				 * Each LEN is printed using 2 bytes in big endian order. */
 				uint num = (byte)*str++;
 				while (num) {
 					if ((byte)str[0] == casei) {
-						// Found the case, adjust str pointer and continue
+						/* Found the case, adjust str pointer and continue */
 						str += 3;
 						break;
 					}
-					// Otherwise skip to the next case
+					/* Otherwise skip to the next case */
 					str += 3 + (str[1] << 8) + str[2];
 					num--;
 				}
@@ -1018,20 +1030,20 @@
 			return strecpy(buff, origin_songs_specs[GetInt32(&argv) - 1].song_name, last);
 	}
 
-	// town name?
+	/* town name? */
 	if (IS_INT_INSIDE(ind - 6, 0, SPECSTR_TOWNNAME_LAST-SPECSTR_TOWNNAME_START + 1)) {
 		buff = GetSpecialTownNameString(buff, ind - 6, GetInt32(&argv), last);
 		return strecpy(buff, " Transport", last);
 	}
 
-	// language name?
+	/* language name? */
 	if (IS_INT_INSIDE(ind, (SPECSTR_LANGUAGE_START - 0x70E4), (SPECSTR_LANGUAGE_END - 0x70E4) + 1)) {
 		int i = ind - (SPECSTR_LANGUAGE_START - 0x70E4);
 		return strecpy(buff,
 			i == _dynlang.curr ? _langpack->own_name : _dynlang.ent[i].name, last);
 	}
 
-	// resolution size?
+	/* resolution size? */
 	if (IS_INT_INSIDE(ind, (SPECSTR_RESOLUTION_START - 0x70E4), (SPECSTR_RESOLUTION_END - 0x70E4) + 1)) {
 		int i = ind - (SPECSTR_RESOLUTION_START - 0x70E4);
 		buff += snprintf(
@@ -1040,7 +1052,7 @@
 		return buff;
 	}
 
-	// screenshot format name?
+	/* screenshot format name? */
 	if (IS_INT_INSIDE(ind, (SPECSTR_SCREENSHOT_START - 0x70E4), (SPECSTR_SCREENSHOT_END - 0x70E4) + 1)) {
 		int i = ind - (SPECSTR_SCREENSHOT_START - 0x70E4);
 		return strecpy(buff, GetScreenshotFormatDesc(i), last);
@@ -1050,7 +1062,10 @@
 	return NULL;
 }
 
-// remap a string ID from the old format to the new format
+/**
+ * remap a string ID from the old format to the new format
+ * @param s StringID that requires remapping
+ * @return translated ID*/
 StringID RemapOldStringID(StringID s)
 {
 	switch (s) {
@@ -1103,10 +1118,10 @@
 		tot_count += num;
 	}
 
-	// Allocate offsets
+	/* Allocate offsets */
 	langpack_offs = MallocT<char*>(tot_count);
 
-	// Fill offsets
+	/* Fill offsets */
 	s = lang_pack->data;
 	for (i = 0; i != tot_count; i++) {
 		len = (byte)*s;
@@ -1133,7 +1148,7 @@
 /** Determine the current charset based on the environment
  * First check some default values, after this one we passed ourselves
  * and if none exist return the value for $LANG
- * @param environment variable to check conditionally if default ones are not
+ * @param param environment variable to check conditionally if default ones are not
  *        set. Pass NULL if you don't want additional checks.
  * @return return string containing current charset, or NULL if not-determinable */
 const char *GetCurrentLocale(const char *param)
--- a/src/strings.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/strings.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file strings.h */
+
 #ifndef STRINGS_H
 #define STRINGS_H
 
--- a/src/subsidy_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/subsidy_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file subsidy_gui.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "table/strings.h"
--- a/src/table/build_industry.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/table/build_industry.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1083,312 +1083,351 @@
 	CHECK_END,
 };
 
-#define MK(tbl, d, c1, c2, c3, proc, p1, r1, p2, r2, m, a1, a2, a3, pr, clim, in, intx, s1, s2, s3) \
+#define MK(tbl, d, ai1, ai2, ai3, ai4, ag1, ag2, ag3, ag4, \
+           c1, c2, c3, proc, p1, r1, p2, r2, m, a1, a2, a3, pr, clim, bev, in, intx, s1, s2, s3) \
 	{tbl, lengthof(tbl), d, {c1, c2, c3}, proc, {p1, p2}, {r1, r2}, m,            \
-	 {a1, a2, a3}, pr, clim, in, intx, s1, s2, s3}
+	 {a1, a2, a3}, pr, clim, bev, in, intx, s1, s2, s3, {ai1, ai2, ai3, ai4}, {ag1, ag2, ag3, ag4}}
 
 static const IndustrySpec _industry_specs[] = {
 	/* Format:
-	   tile table                              cost multiplier
+	   tile table                              cost multiplier   appear (4xin game, 4xmap) chances
 	   cannot be close to these industries (3 times)             check proc
 	   (produced cargo + rate) (twice)         minimum cargo moved to station
 	   3 accepted cargo
 	   industry life                           climate availability
+	   industry behaviours
 	   industry name                           building text
 	   messages : Closure                      production up                      production down   */
-	MK(_tile_table_coal_mine,                  210,
+	MK(_tile_table_coal_mine,                  210,              2, 3, 0, 0,    8, 8, 0, 0,
 	   IT_POWER_STATION,  IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_COAL,       15, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TEMPERATE | 1 << LT_ARCTIC,
+	   INDUSTRYBEH_CAN_SUBSIDENCE,
 	   STR_4802_COAL_MINE,                     STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4836_NEW_COAL_SEAM_FOUND_AT,   STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_power_station,              30,
+	MK(_tile_table_power_station,              30,               2, 2, 0, 0,    5, 5, 0, 0,
 	   IT_COAL_MINE,      IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_INVALID,     0, CT_INVALID,       0, 5,
 	   CT_COAL,           CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_NOT_CLOSABLE,              1 << LT_TEMPERATE | 1 << LT_ARCTIC,
+	   INDUSTRYBEH_NONE,
 	   STR_4803_POWER_STATION,                 STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_sawmill,                    28,
+	MK(_tile_table_sawmill,                    28,               2, 0, 0, 0,    5, 0, 0, 0,
 	   IT_FOREST,         IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_GOODS,       0, CT_INVALID,       0, 5,
 	   CT_WOOD,           CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_TEMPERATE,
+	   INDUSTRYBEH_NONE,
 	   STR_4804_SAWMILL,                       STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_forest,                     200,
+	MK(_tile_table_forest,                     200,              3, 4, 0, 0,    5, 5, 0, 0,
 	   IT_SAWMILL,        IT_PAPER_MILL,       IT_INVALID,       CHECK_FOREST,
 	   CT_WOOD,       13, CT_INVALID,       0, 30,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TEMPERATE | 1 << LT_ARCTIC,
+	   INDUSTRYBEH_NONE,
 	   STR_4805_FOREST,                        STR_482E_NEW_BEING_PLANTED_NEAR,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_483A_INSECT_INFESTATION_CAUSES),
 
-	MK(_tile_table_oil_refinery,               31,
+	MK(_tile_table_oil_refinery,               31,               2, 2, 2, 0,    4, 4, 4, 0,
 	   IT_OIL_RIG,        IT_INVALID,          IT_INVALID,       CHECK_REFINERY,
 	   CT_GOODS,       0, CT_INVALID,       0, 5,
 	   CT_OIL,            CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_TEMPERATE | 1 << LT_ARCTIC | 1 << LT_TROPIC,
+	   INDUSTRYBEH_AIRPLANE_ATTACKS,
 	   STR_4806_OIL_REFINERY,                  STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_oil_rig,                    240,
+	MK(_tile_table_oil_rig,                    240,              6, 0, 0, 0,    0, 0, 0, 0,
 	   IT_OIL_REFINERY,   IT_INVALID,          IT_INVALID,       CHECK_OIL_RIG,
 	   CT_OIL,        15, CT_PASSENGERS,    2, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TEMPERATE,
+	   INDUSTRYBEH_BUILT_ONWATER | INDUSTRYBEH_AFTER_1960 | INDUSTRYBEH_AI_AIRSHIP_ROUTES,
 	   STR_4807_OIL_RIG,                       STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4837_NEW_OIL_RESERVES_FOUND,   STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_factory,                    26,
+	MK(_tile_table_factory,                    26,               2, 0, 0, 0,    5, 0, 0, 0,
 	   IT_FARM,           IT_STEEL_MILL,       IT_INVALID,       CHECK_NOTHING,
 	   CT_GOODS,       0, CT_INVALID,       0, 5,
 	   CT_LIVESTOCK,      CT_GRAIN,            CT_STEEL,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_TEMPERATE,
+	   INDUSTRYBEH_CHOPPER_ATTACKS,
 	   STR_4808_FACTORY,                       STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_printing_works,             26,
+	MK(_tile_table_printing_works,             26,               0, 2, 0, 0,    0, 5, 0, 0,
 	   IT_PAPER_MILL,     IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_GOODS,       0, CT_INVALID,       0, 5,
 	   CT_PAPER,          CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_ARCTIC,
+	   INDUSTRYBEH_NONE,
 	   STR_4809_PRINTING_WORKS,                STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_steel_mill,                 27,
+	MK(_tile_table_steel_mill,                 27,               2, 0, 0, 0,    5, 0, 0, 0,
 	   IT_IRON_MINE,      IT_FACTORY,          IT_INVALID,       CHECK_NOTHING,
 	   CT_STEEL,       0, CT_INVALID,       0, 5,
 	   CT_IRON_ORE,       CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_TEMPERATE,
+	   INDUSTRYBEH_NONE,
 	   STR_480A_STEEL_MILL,                    STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_farm,                       250,
+	MK(_tile_table_farm,                       250,              2, 4, 0, 0,    9, 9, 0, 0,
 	   IT_FACTORY,        IT_FOOD_PROCESS,     IT_INVALID,       CHECK_FARM,
 	   CT_GRAIN,      10, CT_LIVESTOCK,    10, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TEMPERATE | 1 << LT_ARCTIC,
+	   INDUSTRYBEH_PLANT_FIELDS | INDUSTRYBEH_PLANT_ON_BUILT,
 	   STR_480B_FARM,                          STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4838_IMPROVED_FARMING_METHODS, STR_483A_INSECT_INFESTATION_CAUSES),
 
-	MK(_tile_table_copper_mine,                205,
+	MK(_tile_table_copper_mine,                205,              0, 0, 3, 0,    0, 0, 4, 0,
 	   IT_FACTORY_2,      IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_COPPER_ORE, 10, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TROPIC,
+	   INDUSTRYBEH_NONE,
 	   STR_480C_COPPER_ORE_MINE,               STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_oil_well,                   220,
+	MK(_tile_table_oil_well,                   220,              0, 5, 3, 0,    4, 5, 5, 0,
 	   IT_OIL_REFINERY,   IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_OIL,        12, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TEMPERATE | 1 << LT_ARCTIC | 1 << LT_TROPIC,
+	   INDUSTRYBEH_DONT_INCR_PROD | INDUSTRYBEH_BEFORE_1950,
 	   STR_480D_OIL_WELLS,                     STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4837_NEW_OIL_RESERVES_FOUND,   STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_bank,                       193,
+	MK(_tile_table_bank,                       193,              7, 0, 0, 0,    0, 0, 0, 0,
 	   IT_BANK_TEMP,      IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_VALUABLES,   6, CT_INVALID,       0, 5,
 	   CT_VALUABLES,      CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_NOT_CLOSABLE,              1 << LT_TEMPERATE,
+	   INDUSTRYBEH_TOWN1200_MORE | INDUSTRYBEH_ONLY_INTOWN,
 	   STR_480E_BANK,                          STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_food_process,               26,
+	MK(_tile_table_food_process,               26,               0, 2, 2, 0,    0, 5, 8, 0,
 	   IT_FRUIT_PLANTATION, IT_FARM,           IT_FARM_2,        CHECK_NOTHING,
 	   CT_FOOD,        0, CT_INVALID,       0, 5,
 	   CT_FRUIT,          CT_MAIZE,            CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_ARCTIC | 1 << LT_TROPIC,
+	   INDUSTRYBEH_NONE,
 	   STR_480F_FOOD_PROCESSING_PLANT,         STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_paper_mill,                 28,
+	MK(_tile_table_paper_mill,                 28,               0, 0, 2, 0,    0, 0, 5, 0,
 	   IT_FOREST,         IT_PRINTING_WORKS,   IT_INVALID,       CHECK_NOTHING,
 	   CT_PAPER,       0, CT_INVALID,       0, 5,
 	   CT_WOOD,           CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_ARCTIC,
+	   INDUSTRYBEH_NONE,
 	   STR_4810_PAPER_MILL,                    STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_gold_mine,                  208,
+	MK(_tile_table_gold_mine,                  208,              0, 0, 3, 0,    0, 0, 4, 0,
 	   IT_BANK_TROPIC_ARCTIC, IT_INVALID,      IT_INVALID,       CHECK_NOTHING,
 	   CT_GOLD,        7, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TROPIC,
+	   INDUSTRYBEH_NONE,
 	   STR_4811_GOLD_MINE,                     STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_bank2,                      19,
+	MK(_tile_table_bank2,                      19,               0, 3, 3, 0,    0, 6, 5, 0,
 	   IT_GOLD_MINE,      IT_DIAMOND_MINE,     IT_INVALID,       CHECK_NOTHING,
 	   CT_INVALID,     0, CT_INVALID,       0, 5,
 	   CT_GOLD,           CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_NOT_CLOSABLE,              1 << LT_ARCTIC | 1 << LT_TROPIC,
+	   INDUSTRYBEH_ONLY_INTOWN,
 	   STR_4812_BANK,                          STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_diamond_mine,               213,
+	MK(_tile_table_diamond_mine,               213,              0, 0, 3, 0,    0, 0, 4, 0,
 	   IT_BANK_TROPIC_ARCTIC, IT_INVALID,      IT_INVALID,       CHECK_NOTHING,
 	   CT_DIAMONDS,    7, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TROPIC,
+	   INDUSTRYBEH_NONE,
 	   STR_4813_DIAMOND_MINE,                  STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_iron_mine,                  220,
+	MK(_tile_table_iron_mine,                  220,              2, 0, 0, 0,    5, 0, 0, 0,
 	   IT_STEEL_MILL,     IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_IRON_ORE,   10, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TEMPERATE,
+	   INDUSTRYBEH_NONE,
 	   STR_4814_IRON_ORE_MINE,                 STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_fruit_plantation,           225,
+	MK(_tile_table_fruit_plantation,           225,              0, 0, 3, 0,    0, 0, 4, 0,
 	   IT_FOOD_PROCESS,   IT_INVALID,          IT_INVALID,       CHECK_PLANTATION,
 	   CT_FRUIT,      10, CT_INVALID,       0, 15,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TROPIC,
+	   INDUSTRYBEH_NONE,
 	   STR_4815_FRUIT_PLANTATION,              STR_482E_NEW_BEING_PLANTED_NEAR,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4838_IMPROVED_FARMING_METHODS, STR_483A_INSECT_INFESTATION_CAUSES),
 
-	MK(_tile_table_rubber_plantation,          218,
+	MK(_tile_table_rubber_plantation,          218,              0, 0, 3, 0,    0, 0, 4, 0,
 	   IT_FACTORY_2,      IT_INVALID,          IT_INVALID,       CHECK_PLANTATION,
 	   CT_RUBBER,     10, CT_INVALID,       0, 15,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TROPIC,
+	   INDUSTRYBEH_NONE,
 	   STR_4816_RUBBER_PLANTATION,             STR_482E_NEW_BEING_PLANTED_NEAR,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4838_IMPROVED_FARMING_METHODS, STR_483A_INSECT_INFESTATION_CAUSES),
 
-	MK(_tile_table_water_supply,               199,
+	MK(_tile_table_water_supply,               199,              0, 0, 3, 0,    0, 0, 4, 0,
 	   IT_WATER_TOWER,    IT_INVALID,          IT_INVALID,       CHECK_WATER,
 	   CT_WATER,      12, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TROPIC,
+	   INDUSTRYBEH_NONE,
 	   STR_4817_WATER_SUPPLY,                  STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_water_tower,                14,
+	MK(_tile_table_water_tower,                14,               0, 0, 4, 0,    0, 0, 8, 0,
 	   IT_WATER_SUPPLY,   IT_INVALID,          IT_INVALID,       CHECK_WATER,
 	   CT_INVALID,     0, CT_INVALID,       0, 5,
 	   CT_WATER,          CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_NOT_CLOSABLE,              1 << LT_TROPIC,
+	   INDUSTRYBEH_ONLY_INTOWN,
 	   STR_4818_WATER_TOWER,                   STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_factory2,                   26,
+	MK(_tile_table_factory2,                   26,               0, 0, 2, 0,    0, 0, 4, 0,
 	   IT_RUBBER_PLANTATION, IT_COPPER_MINE,   IT_LUMBER_MILL,   CHECK_PLANTATION,
 	   CT_GOODS,       0, CT_INVALID,       0, 5,
 	   CT_RUBBER,         CT_COPPER_ORE,       CT_WOOD,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_TROPIC,
+	   INDUSTRYBEH_NONE,
 	   STR_4819_FACTORY,                       STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_farm2,                      250,
+	MK(_tile_table_farm2,                      250,              0, 0, 1, 0,    0, 0, 2, 0,
 	   IT_FOOD_PROCESS,   IT_INVALID,          IT_INVALID,       CHECK_PLANTATION,
 	   CT_MAIZE,      11, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TROPIC,
+	   INDUSTRYBEH_PLANT_FIELDS | INDUSTRYBEH_PLANT_ON_BUILT,
 	   STR_481A_FARM,                          STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4838_IMPROVED_FARMING_METHODS, STR_483A_INSECT_INFESTATION_CAUSES),
 
-	MK(_tile_table_lumber_mill,                17,
+	MK(_tile_table_lumber_mill,                17,               0, 0, 0, 0,    0, 0, 0, 0,
 	   IT_FACTORY_2,      IT_INVALID,          IT_INVALID,       CHECK_LUMBERMILL,
 	   CT_WOOD,        0, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_TROPIC,
+	   INDUSTRYBEH_CUT_TREES,
 	   STR_481B_LUMBER_MILL,                   STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4834_LACK_OF_NEARBY_TREES_CAUSES,   STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_cotton_candy,               195,
+	MK(_tile_table_cotton_candy,               195,              0, 0, 0, 3,    0, 0, 0, 5,
 	   IT_CANDY_FACTORY,  IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_COTTON_CANDY, 13, CT_INVALID,    0, 30,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TOYLAND,
+	   INDUSTRYBEH_NONE,
 	   STR_481C_COTTON_CANDY_FOREST,           STR_482E_NEW_BEING_PLANTED_NEAR,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4838_IMPROVED_FARMING_METHODS, STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_candy_factory,              26,
+	MK(_tile_table_candy_factory,              26,               0, 0, 0, 3,    0, 0, 0, 5,
 	   IT_COTTON_CANDY,   IT_TOFFEE_QUARRY,    IT_SUGAR_MINE,    CHECK_NOTHING,
 	   CT_CANDY,       0, CT_INVALID,       0, 5,
 	   CT_SUGAR,          CT_TOFFEE,           CT_COTTON_CANDY,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_TOYLAND,
+	   INDUSTRYBEH_NONE,
 	   STR_481D_CANDY_FACTORY,                 STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_battery_farm,               187,
+	MK(_tile_table_battery_farm,               187,              0, 0, 0, 3,    0, 0, 0, 4,
 	   IT_TOY_FACTORY,    IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_BATTERIES,  11, CT_INVALID,      0, 30,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TOYLAND,
+	   INDUSTRYBEH_NONE,
 	   STR_481E_BATTERY_FARM,                  STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4838_IMPROVED_FARMING_METHODS, STR_483A_INSECT_INFESTATION_CAUSES),
 
-	MK(_tile_table_cola_wells,                 193,
+	MK(_tile_table_cola_wells,                 193,              0, 0, 0, 3,    0, 0, 0, 5,
 	   IT_FIZZY_DRINK_FACTORY, IT_INVALID,     IT_INVALID,       CHECK_NOTHING,
 	   CT_COLA,       12, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TOYLAND,
+	   INDUSTRYBEH_NONE,
 	   STR_481F_COLA_WELLS,                    STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_toy_shop,                   17,
+	MK(_tile_table_toy_shop,                   17,               0, 0, 0, 3,    0, 0, 0, 4,
 	   IT_TOY_FACTORY,    IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_INVALID,     0, CT_INVALID,       0, 5,
 	   CT_TOYS,           CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_NOT_CLOSABLE,              1 << LT_TOYLAND,
+	   INDUSTRYBEH_ONLY_NEARTOWN,
 	   STR_4820_TOY_SHOP,                      STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_toy_factory,                20,
+	MK(_tile_table_toy_factory,                20,              0, 0, 0, 3,    0, 0, 0, 5,
 	   IT_PLASTIC_FOUNTAINS, IT_BATTERY_FARM,  IT_TOY_SHOP,     CHECK_NOTHING,
 	   CT_TOYS,        0, CT_INVALID,       0, 5,
 	   CT_PLASTIC,        CT_BATTERIES,        CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_TOYLAND,
+	   INDUSTRYBEH_NONE,
 	   STR_4821_TOY_FACTORY,                   STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_plastic_fountain,           192,
+	MK(_tile_table_plastic_fountain,           192,              0, 0, 0, 3,    0, 0, 0, 5,
 	   IT_TOY_FACTORY,    IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_PLASTIC,    14, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TOYLAND,
+	   INDUSTRYBEH_NONE,
 	   STR_4822_PLASTIC_FOUNTAINS,             STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_fizzy_drink,                22,
-	   IT_COLA_WELLS,     IT_BUBBLE_GENERATOR, IT_INVALID,     CHECK_NOTHING,
+	MK(_tile_table_fizzy_drink,                22,               0, 0, 0, 3,    0, 0, 0, 4,
+	   IT_COLA_WELLS,     IT_BUBBLE_GENERATOR, IT_INVALID,       CHECK_NOTHING,
 	   CT_FIZZY_DRINKS, 0, CT_INVALID,      0, 5,
 	   CT_COLA,           CT_BUBBLES,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_TOYLAND,
+	   INDUSTRYBEH_NONE,
 	   STR_4823_FIZZY_DRINK_FACTORY,           STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_bubble_generator,           203,
+	MK(_tile_table_bubble_generator,           203,              0, 0, 0, 3,    0, 0, 0, 5,
 	   IT_FIZZY_DRINK_FACTORY, IT_INVALID,     IT_INVALID,       CHECK_BUBBLEGEN,
 	   CT_BUBBLES,    13, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TOYLAND,
+	   INDUSTRYBEH_NONE,
 	   STR_4824_BUBBLE_GENERATOR,              STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_toffee_quarry,              213,
+	MK(_tile_table_toffee_quarry,              213,              0, 0, 0, 3,    0, 0, 0, 5,
 	   IT_CANDY_FACTORY,  IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_TOFFEE,     10, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TOYLAND,
+	   INDUSTRYBEH_NONE,
 	   STR_4825_TOFFEE_QUARRY,                 STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
-	MK(_tile_table_sugar_mine,                 210,
+	MK(_tile_table_sugar_mine,                 210,              0, 0, 0, 2,    0, 0, 0, 1,
 	   IT_CANDY_FACTORY,  IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_SUGAR,      11, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_TOYLAND,
+	   INDUSTRYBEH_NONE,
 	   STR_4826_SUGAR_MINE,                    STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 };
--- a/src/table/namegen.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/table/namegen.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file table/namegen.h Namepart tables for the town name generator */
+
 #include "../stdafx.h"
 #include "../openttd.h"
 
--- a/src/table/roadveh.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/table/roadveh.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file table/roadveh.h Data about how a road vehicle must drive on a tile */
+
 static const RoadDriveEntry _roadveh_drive_data_0[] = {
 	{15, 5},
 	{14, 5},
--- a/src/terraform_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/terraform_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file terraform_gui.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "bridge_map.h"
@@ -91,11 +93,11 @@
 
 /**
  * A central place to handle all X_AND_Y dragged GUI functions.
- * @param e @WindowEvent variable holding in its higher bits (excluding the lower
+ * @param e WindowEvent variable holding in its higher bits (excluding the lower
  * 4, since that defined the X_Y drag) the type of action to be performed
  * @return Returns true if the action was found and handled, and false otherwise. This
  * allows for additional implements that are more local. For example X_Y drag
- * of convertrail which belongs in rail_gui.c and not terraform_gui.c
+ * of convertrail which belongs in rail_gui.cpp and not terraform_gui.cpp
  **/
 bool GUIPlaceProcDragXY(const WindowEvent *e)
 {
--- a/src/texteff.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/texteff.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file texteff.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "functions.h"
@@ -121,7 +123,7 @@
 	}
 }
 
-/* Hide the textbox */
+/** Hide the textbox */
 void UndrawTextMessage()
 {
 	if (_textmessage_visible) {
@@ -172,7 +174,7 @@
 	}
 }
 
-/* Check if a message is expired every day */
+/** Check if a message is expired every day */
 void TextMessageDailyLoop()
 {
 	uint i;
@@ -196,7 +198,7 @@
 	}
 }
 
-/* Draw the textmessage-box */
+/** Draw the textmessage-box */
 void DrawTextMessage()
 {
 	if (!_textmessage_dirty) return;
--- a/src/tgp.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/tgp.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file tgp.cpp OTTD Perlin Noise Landscape Generator, aka TerraGenesis Perlin */
+
 #include "stdafx.h"
 #include <math.h>
 #include "openttd.h"
@@ -17,7 +19,6 @@
 #include "helpers.hpp"
 
 /*
- * OTTD Perlin Noise Landscape Generator, aka TerraGenesis Perlin
  *
  * Quickie guide to Perlin Noise
  * Perlin noise is a predictable pseudo random number sequence. By generating
@@ -167,11 +168,11 @@
 /** Height map - allocated array of heights (MapSizeX() + 1) x (MapSizeY() + 1) */
 struct HeightMap
 {
-	height_t *h;         //! array of heights
-	uint     dim_x;      //! height map size_x MapSizeX() + 1
-	uint     total_size; //! height map total size
-	uint     size_x;     //! MapSizeX()
-	uint     size_y;     //! MapSizeY()
+	height_t *h;         //< array of heights
+	uint     dim_x;      //< height map size_x MapSizeX() + 1
+	uint     total_size; //< height map total size
+	uint     size_x;     //< MapSizeX()
+	uint     size_y;     //< MapSizeY()
 };
 
 /** Global height map instance */
@@ -200,13 +201,13 @@
 /** Noise amplitudes (multiplied by 1024)
  * - indexed by "smoothness setting" and log2(frequency) */
 static const amplitude_t _amplitudes_by_smoothness_and_frequency[4][12] = {
-	// Very smooth
+	/* Very smooth */
 	{1000,  350,  123,   43,   15,    1,     1,    0,    0,    0,    0,    0},
-	// Smooth
+	/* Smooth */
 	{1000, 1000,  403,  200,   64,    8,     1,    0,    0,    0,    0,    0},
-	// Rough
+	/* Rough */
 	{1000, 1200,  800,  500,  200,   16,     4,    0,    0,    0,    0,    0},
-	// Very Rough
+	/* Very Rough */
 	{1500, 1000, 1200, 1000,  500,   32,    20,    0,    0,    0,    0,    0},
 };
 
@@ -215,13 +216,17 @@
 
 /** Desired maximum height - indexed by _opt.diff.terrain_type */
 static const int8 _max_height[4] = {
-	6,       // Very flat
-	9,       // Flat
-	12,      // Hilly
-	15       // Mountainous
+	6,       ///< Very flat
+	9,       ///< Flat
+	12,      ///< Hilly
+	15       ///< Mountainous
 };
 
-/** Check if a X/Y set are within the map. */
+/** Check if a X/Y set are within the map.
+ * @param x coordinate x
+ * @param y coordinate y
+ * @return true if within the map
+ */
 static inline bool IsValidXY(uint x, uint y)
 {
 	return ((int)x) >= 0 && x < _height_map.size_x && ((int)y) >= 0 && y < _height_map.size_y;
@@ -680,10 +685,10 @@
 
 /* The following decimals are the octave power modifiers for the Perlin noise */
 static const double _perlin_p_values[][7] = {    // perlin frequency per power
-	{ 0.35, 0.35, 0.35, 0.35, 0.35, 0.25, 0.539 }, // Very smooth
-	{ 0.45, 0.55, 0.45, 0.45, 0.35, 0.25, 0.89  }, // Smooth
-	{ 0.85, 0.80, 0.70, 0.45, 0.45, 0.35, 1.825 }, // Rough 1.825
-	{ 0.95, 0.85, 0.80, 0.55, 0.55, 0.45, 2.245 }  // Very Rough 2.25
+	{ 0.35, 0.35, 0.35, 0.35, 0.35, 0.25, 0.539 }, ///< Very smooth
+	{ 0.45, 0.55, 0.45, 0.45, 0.35, 0.25, 0.89  }, ///< Smooth
+	{ 0.85, 0.80, 0.70, 0.45, 0.45, 0.35, 1.825 }, ///< Rough 1.825
+	{ 0.95, 0.85, 0.80, 0.55, 0.55, 0.45, 2.245 }  //< Very Rough 2.25
 };
 
 /**
--- a/src/tgp.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/tgp.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file tgp.h */
+
 #ifndef TGP_H
 #define TGP_H
 
--- a/src/thread.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/thread.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file thread.cpp */
+
 #include "stdafx.h"
 #include "thread.h"
 #include "debug.h"
--- a/src/thread.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/thread.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file thread.h */
+
 #ifndef THREAD_H
 #define THREAD_H
 
--- a/src/tile.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/tile.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file tile.cpp */
+
 #include "stdafx.h"
 #include "tile.h"
 
--- a/src/tile.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/tile.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file tile.h */
+
 #ifndef TILE_H
 #define TILE_H
 
--- a/src/town.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/town.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file town.h */
+
 #ifndef TOWN_H
 #define TOWN_H
 
@@ -76,34 +78,34 @@
 struct Town {
 	TileIndex xy;
 
-	// Current population of people and amount of houses.
+	/* Current population of people and amount of houses. */
 	uint16 num_houses;
 	uint32 population;
 
-	// Town name
+	/* Town name */
 	uint16 townnametype;
 	uint32 townnameparts;
 
-	// NOSAVE: Location of name sign, UpdateTownVirtCoord updates this.
+	/* NOSAVE: Location of name sign, UpdateTownVirtCoord updates this. */
 	ViewportSign sign;
 
-	// Makes sure we don't build certain house types twice.
-	// bit 0 = Building funds received
-	// bit 1 = CHURCH
-	// bit 2 = STADIUM
+	/* Makes sure we don't build certain house types twice.
+	 * bit 0 = Building funds received
+	 * bit 1 = CHURCH
+	 * bit 2 = STADIUM */
 	byte flags12;
 
-	// Which players have a statue?
+	/* Which players have a statue? */
 	byte statues;
 
-	// Player ratings as well as a mask that determines which players have a rating.
+	/* Player ratings as well as a mask that determines which players have a rating. */
 	byte have_ratings;
-	uint8 unwanted[MAX_PLAYERS]; // how many months companies aren't wanted by towns (bribe)
-	PlayerByte exclusivity;        // which player has exslusivity
-	uint8 exclusive_counter;     // months till the exclusivity expires
+	uint8 unwanted[MAX_PLAYERS]; ///< how many months companies aren't wanted by towns (bribe)
+	PlayerByte exclusivity;      ///< which player has exslusivity
+	uint8 exclusive_counter;     ///< months till the exclusivity expires
 	int16 ratings[MAX_PLAYERS];
 
-	// Maximum amount of passengers and mail that can be transported.
+	/* Maximum amount of passengers and mail that can be transported. */
 	uint32 max_pass;
 	uint32 max_mail;
 	uint32 new_max_pass;
@@ -113,36 +115,36 @@
 	uint32 new_act_pass;
 	uint32 new_act_mail;
 
-	// Amount of passengers that were transported.
+	/* Amount of passengers that were transported. */
 	byte pct_pass_transported;
 	byte pct_mail_transported;
 
-	// Amount of food and paper that was transported. Actually a bit mask would be enough.
+	/* Amount of food and paper that was transported. Actually a bit mask would be enough. */
 	uint16 act_food;
 	uint16 act_water;
 	uint16 new_act_food;
 	uint16 new_act_water;
 
-	// Time until we rebuild a house.
+	/* Time until we rebuild a house. */
 	byte time_until_rebuild;
 
-	// When to grow town next time.
+	/* When to grow town next time. */
 	byte grow_counter;
 	byte growth_rate;
 
-	// Fund buildings program in action?
+	/* Fund buildings program in action? */
 	byte fund_buildings_months;
 
-	// Fund road reconstruction in action?
+	/* Fund road reconstruction in action? */
 	byte road_build_months;
 
-	// Index in town array
+	/* Index in town array */
 	TownID index;
 
-	// NOSAVE: UpdateTownRadius updates this given the house count.
+	/* NOSAVE: UpdateTownRadius updates this given the house count. */
 	uint16 radius[5];
 
-	// NOSAVE: The number of each type of building in the town.
+	/* NOSAVE: The number of each type of building in the town. */
 	BuildingCounts building_counts;
 };
 
@@ -197,8 +199,8 @@
 };
 
 enum {
-	// These refer to the maximums, so Appalling is -1000 to -400
-	// MAXIMUM RATINGS BOUNDARIES
+	/* These refer to the maximums, so Appalling is -1000 to -400
+	 * MAXIMUM RATINGS BOUNDARIES */
 	RATING_MINIMUM     = -1000,
 	RATING_APPALLING   =  -400,
 	RATING_VERYPOOR    =  -200,
@@ -207,11 +209,11 @@
 	RATING_GOOD        =   400,
 	RATING_VERYGOOD    =   600,
 	RATING_EXCELLENT   =   800,
-	RATING_OUTSTANDING =  1000,         // OUTSTANDING
+	RATING_OUTSTANDING =  1000,         ///< OUTSTANDING
 
 	RATING_MAXIMUM = RATING_OUTSTANDING,
 
-	// RATINGS AFFECTING NUMBERS
+	/* RATINGS AFFECTING NUMBERS */
 	RATING_TREE_DOWN_STEP = -35,
 	RATING_TREE_MINIMUM   = RATING_MINIMUM,
 	RATING_TREE_UP_STEP   = 7,
@@ -241,16 +243,16 @@
 	TOWN_HOUSE_COMPLETED  =  3,
 };
 
-/* This enum is used in conjonction with town->flags12.
+/** This enum is used in conjonction with town->flags12.
  * IT simply states what bit is used for.
  * It is pretty unrealistic (IMHO) to only have one church/stadium
  * per town, NO MATTER the population of it.
  * And there are 5 more bits available on flags12...
  */
 enum {
-	TOWN_IS_FUNDED      = 0,   // Town has received some funds for
-	TOWN_HAS_CHURCH     = 1,   // There can be only one church by town.
-	TOWN_HAS_STADIUM    = 2    // There can be only one stadium by town.
+	TOWN_IS_FUNDED      = 0,   ///< Town has received some funds for
+	TOWN_HAS_CHURCH     = 1,   ///< There can be only one church by town.
+	TOWN_HAS_STADIUM    = 2    ///< There can be only one stadium by town.
 };
 
 bool CheckforTownRating(uint32 flags, Town *t, byte type);
@@ -267,12 +269,19 @@
 
 /**
  * Check if a Town really exists.
+ * @param town to inquiry
+ * @return true if it exists
  */
 static inline bool IsValidTown(const Town* town)
 {
 	return town->xy != 0;
 }
 
+/**
+ * Check if a TownID is valid.
+ * @param TownID to inquiry
+ * @return true if it exists
+ */
 static inline bool IsValidTownID(TownID index)
 {
 	return index < GetTownPoolSize() && IsValidTown(GetTown(index));
--- a/src/town_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/town_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -151,7 +151,7 @@
 	/* Add a house on top of the ground? */
 	image = dcts->building.sprite;
 	if (image != 0) {
-		if (_display_opt & DO_TRANS_BUILDINGS) {
+		if (HASBIT(_transparent_opt, TO_HOUSES)) {
 			SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 			pal = PALETTE_TO_TRANSPARENT;
 		} else {
@@ -167,7 +167,7 @@
 			ti->z
 		);
 
-		if (_display_opt & DO_TRANS_BUILDINGS) return;
+		if (HASBIT(_transparent_opt, TO_HOUSES)) return;
 	}
 
 	{
@@ -198,10 +198,10 @@
 
 	if (_tick_counter & 3) return;
 
-	// If the house is not one with a lift anymore, then stop this animating.
-	// Not exactly sure when this happens, but probably when a house changes.
-	// Before this was just a return...so it'd leak animated tiles..
-	// That bug seems to have been here since day 1??
+	/* If the house is not one with a lift anymore, then stop this animating.
+	 * Not exactly sure when this happens, but probably when a house changes.
+	 * Before this was just a return...so it'd leak animated tiles..
+	 * That bug seems to have been here since day 1?? */
 	if (!(GetHouseSpecs(GetHouseType(tile))->building_flags & BUILDING_IS_ANIMATED)) {
 		DeleteAnimatedTile(tile);
 		return;
@@ -210,7 +210,7 @@
 	if (!LiftHasDestination(tile)) {
 		int i;
 
-		/** Building has 6 floors, number 0 .. 6, where 1 is illegal.
+		/*  Building has 6 floors, number 0 .. 6, where 1 is illegal.
 		 *  This is due to the fact that the first floor is, in the graphics,
 		 *  the height of 2 'normal' floors.
 		 *  Furthermore, there are 6 lift positions from floor N (incl) to floor N + 1 (excl) */
@@ -328,7 +328,7 @@
 	if (house_id >= NEW_HOUSE_OFFSET && !NewHouseTileLoop(tile)) return;
 
 	if (!IsHouseCompleted(tile)) {
-		/*Construction is not completed. See if we can go further in construction*/
+		/* Construction is not completed. See if we can go further in construction*/
 		MakeTownHouseBigger(tile);
 		return;
 	}
@@ -367,7 +367,7 @@
 
 		ClearTownHouse(t, tile);
 
-		// rebuild with another house?
+		/* rebuild with another house? */
 		if (GB(r, 24, 8) >= 12) DoBuildTownHouse(t, tile);
 	}
 
@@ -446,8 +446,8 @@
 	{ 0,  1},
 	{-1,  0},
 
-	// Store the first 3 elements again.
-	// Lets us rotate without using &3.
+	/* Store the first 3 elements again.
+	 * Lets us rotate without using &3. */
 	{ 0, -1},
 	{ 1,  0},
 	{ 0,  1}
@@ -510,16 +510,16 @@
 	Slope k;
 	Slope slope;
 
-	// If this assertion fails, it might be because the world contains
-	//  land at the edges. This is not ok.
+	/* If this assertion fails, it might be because the world contains
+	 *  land at the edges. This is not ok. */
 	TILE_ASSERT(tile);
 
 	for (;;) {
-		// Check if there already is a road at this point?
+		/* Check if there already is a road at this point? */
 		if (GetAnyRoadTrackBits(tile) == 0) {
-			// No, try to build one in the direction.
-			// if that fails clear the land, and if that fails exit.
-			// This is to make sure that we can build a road here later.
+			/* No, try to build one in the direction.
+			 * if that fails clear the land, and if that fails exit.
+			 * This is to make sure that we can build a road here later. */
 			if (CmdFailed(DoCommand(tile, (dir & 1 ? ROAD_X : ROAD_Y), 0, DC_AUTO, CMD_BUILD_ROAD)) &&
 					CmdFailed(DoCommand(tile, 0, 0, DC_AUTO, CMD_LANDSCAPE_CLEAR)))
 				return false;
@@ -528,20 +528,20 @@
 		slope = GetTileSlope(tile, NULL);
 		if (slope == SLOPE_FLAT) {
 no_slope:
-			// Tile has no slope
-			// Disallow the road if any neighboring tile has a road.
+			/* Tile has no slope
+			 * Disallow the road if any neighboring tile has a road. */
 			if (HASBIT(GetTownRoadMask(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[dir+1]))), dir^2) ||
 					HASBIT(GetTownRoadMask(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[dir+3]))), dir^2) ||
 					HASBIT(GetTownRoadMask(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[dir+1]) + ToTileIndexDiff(_roadblock_tileadd[dir+2]))), dir) ||
 					HASBIT(GetTownRoadMask(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[dir+3]) + ToTileIndexDiff(_roadblock_tileadd[dir+2]))), dir))
 				return false;
 
-			// Otherwise allow
+			/* Otherwise allow */
 			return true;
 		}
 
-		// If the tile is not a slope in the right direction, then
-		// maybe terraform some.
+		/* If the tile is not a slope in the right direction, then
+		 * maybe terraform some. */
 		k = (dir & 1) ? SLOPE_NE : SLOPE_NW;
 		if (k != slope && ComplementSlope(k) != slope) {
 			uint32 r = Random();
@@ -557,7 +557,7 @@
 					                      CMD_TERRAFORM_LAND);
 				}
 				if (CmdFailed(res) && CHANCE16I(1, 3, r)) {
-					// We can consider building on the slope, though.
+					/* We can consider building on the slope, though. */
 					goto no_slope;
 				}
 			}
@@ -585,12 +585,12 @@
 
 	TILE_ASSERT(tile);
 
-	// Don't terraform if land is plain or if there's a house there.
+	/* Don't terraform if land is plain or if there's a house there. */
 	if (IsTileType(tile, MP_HOUSE)) return;
 	tileh = GetTileSlope(tile, NULL);
 	if (tileh == SLOPE_FLAT) return;
 
-	// First try up, then down
+	/* First try up, then down */
 	if (!TerraformTownTile(tile, ~tileh & 0xF, 1)) {
 		TerraformTownTile(tile, tileh & 0xF, 0);
 	}
@@ -610,17 +610,17 @@
 		int a;
 		int b;
 
-		// Tile has no road. First reset the status counter
-		// to say that this is the last iteration.
+		/* Tile has no road. First reset the status counter
+		 * to say that this is the last iteration. */
 		_grow_town_result = 0;
 
-		// Remove hills etc
+		/* Remove hills etc */
 		LevelTownLand(tile);
 
-		// Is a road allowed here?
+		/* Is a road allowed here? */
 		if (!IsRoadAllowedHere(tile, block)) return;
 
-		// Randomize new road block numbers
+		/* Randomize new road block numbers */
 		a = block;
 		b = block ^ 2;
 		if (CHANCE16(1, 4)) {
@@ -630,29 +630,29 @@
 		}
 
 		if (!IsRoadAllowedHere(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[a])), a)) {
-			// A road is not allowed to continue the randomized road,
-			//   return if the road we're trying to build is curved.
+			/* A road is not allowed to continue the randomized road,
+			 *   return if the road we're trying to build is curved. */
 			if (a != (b ^ 2)) return;
 
-			// Return if neither side of the new road is a house
+			/* Return if neither side of the new road is a house */
 			if (!IsTileType(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[a + 1])), MP_HOUSE) &&
 					!IsTileType(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[a + 3])), MP_HOUSE))
 				return;
 
-			// That means that the road is only allowed if there is a house
-			//  at any side of the new road.
+			/* That means that the road is only allowed if there is a house
+			 *  at any side of the new road. */
 		}
 		rcmd = (RoadBits)((1 << a) + (1 << b));
 
 	} else if (block < 5 && !HASBIT(mask,block^2)) {
-		// Continue building on a partial road.
-		// Always OK.
+		/* Continue building on a partial road.
+		 * Always OK. */
 		_grow_town_result = 0;
 		rcmd = (RoadBits)(1 << (block ^ 2));
 	} else {
 		int i;
 
-		// Reached a tunnel/bridge? Then continue at the other side of it.
+		/* Reached a tunnel/bridge? Then continue at the other side of it. */
 		if (IsTileType(tile, MP_TUNNELBRIDGE)) {
 			if (IsTunnel(tile) && GetTunnelTransportType(tile) == TRANSPORT_ROAD) {
 				*tile_ptr = GetOtherTunnelEnd(tile);
@@ -662,27 +662,27 @@
 			return;
 		}
 
-		// Possibly extend the road in a direction.
-		// Randomize a direction and if it has a road, bail out.
+		/* Possibly extend the road in a direction.
+		 * Randomize a direction and if it has a road, bail out. */
 		i = GB(Random(), 0, 2);
 		if (HASBIT(mask, i)) return;
 
-		// This is the tile we will reach if we extend to this direction.
+		/* This is the tile we will reach if we extend to this direction. */
 		tmptile = TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[i]));
 
-		// Don't do it if it reaches to water.
+		/* Don't do it if it reaches to water. */
 		if (IsClearWaterTile(tmptile)) return;
 
-		// Build a house at the edge. 60% chance or
-		//  always ok if no road allowed.
+		/* Build a house at the edge. 60% chance or
+		 *  always ok if no road allowed. */
 		if (!IsRoadAllowedHere(tmptile, i) || CHANCE16(6, 10)) {
-			// But not if there already is a house there.
+			/* But not if there already is a house there. */
 			if (!IsTileType(tmptile, MP_HOUSE)) {
-				// Level the land if possible
+				/* Level the land if possible */
 				LevelTownLand(tmptile);
 
-				// And build a house.
-				// Set result to -1 if we managed to build it.
+				/* And build a house.
+				 * Set result to -1 if we managed to build it. */
 				if (BuildTownHouse(t1, tmptile)) _grow_town_result = -1;
 			}
 			return;
@@ -692,11 +692,11 @@
 		rcmd = (RoadBits)(1 << i);
 	}
 
-	// Return if a water tile
+	/* Return if a water tile */
 	if (IsClearWaterTile(tile)) return;
 
-	// Determine direction of slope,
-	//  and build a road if not a special slope.
+	/* Determine direction of slope,
+	 *  and build a road if not a special slope. */
 	switch (GetTileSlope(tile, NULL)) {
 		case SLOPE_SW: i = DIAGDIR_NE; break;
 		case SLOPE_SE: i = DIAGDIR_NW; break;
@@ -713,7 +713,7 @@
 
 	tmptile = tile;
 
-	// Now it contains the direction of the slope
+	/* Now it contains the direction of the slope */
 	j = -11; // max 11 tile long bridges
 	do {
 		if (++j == 0)
@@ -721,11 +721,11 @@
 		tmptile = TILE_MASK(tmptile + TileOffsByDiagDir(i));
 	} while (IsClearWaterTile(tmptile));
 
-	// no water tiles in between?
+	/* no water tiles in between? */
 	if (j == -10)
 		goto build_road_and_exit;
 
-	// Quit if it selecting an appropiate bridge type fails a large number of times.
+	/* Quit if it selecting an appropiate bridge type fails a large number of times. */
 	j = 22;
 	{
 		int32 bridge_len = GetBridgeLength(tile, tmptile);
@@ -735,38 +735,42 @@
 				if (!CmdFailed(DoCommand(tile, tmptile, 0x8000 + bridge_type, DC_EXEC | DC_AUTO, CMD_BUILD_BRIDGE)))
 					_grow_town_result = -1;
 
-				// obviously, if building any bridge would fail, there is no need to try other bridge-types
+				/* obviously, if building any bridge would fail, there is no need to try other bridge-types */
 				return;
 			}
 		} while (--j != 0);
 	}
 }
 
-// Returns true if a house was built, or no if the build failed.
+/** Returns "growth" if a house was built, or no if the build failed.
+ * @param t town to inquiry
+ * @param tile to inquiry
+ * @return something other than zero(0)if town expansion was possible
+ */
 static int GrowTownAtRoad(Town *t, TileIndex tile)
 {
 	int block = 5; // special case
 
 	TILE_ASSERT(tile);
 
-	// Number of times to search.
+	/* Number of times to search. */
 	_grow_town_result = 10 + t->num_houses * 4 / 9;
 
 	do {
-		// Get a bitmask of the road blocks on a tile
+		/* Get a bitmask of the road blocks on a tile */
 		RoadBits mask = GetTownRoadMask(tile);
 
-		// Try to grow the town from this point
-		GrowTownInTile(&tile,mask,block,t);
+		/* Try to grow the town from this point */
+		GrowTownInTile(&tile, mask, block, t);
 
-		// Exclude the source position from the bitmask
-		// and return if no more road blocks available
+		/* Exclude the source position from the bitmask
+		 * and return if no more road blocks available */
 		ClrBitT(mask, (block ^ 2));
 		if (mask == 0)
 			return _grow_town_result;
 
-		// Select a random bit from the blockmask, walk a step
-		// and continue the search from there.
+		/* Select a random bit from the blockmask, walk a step
+		 * and continue the search from there. */
 		do block = Random() & 3; while (!HASBIT(mask,block));
 		tile += ToTileIndexDiff(_roadblock_tileadd[block]);
 
@@ -782,15 +786,15 @@
 			}
 		}
 
-		// Max number of times is checked.
+		/* Max number of times is checked. */
 	} while (--_grow_town_result >= 0);
 
 	return (_grow_town_result == -2);
 }
 
-// Generate a random road block
-// The probability of a straight road
-// is somewhat higher than a curved.
+/** Generate a random road block
+ * The probability of a straight road
+ * is somewhat higher than a curved. */
 static RoadBits GenRandomRoadBits()
 {
 	uint32 r = Random();
@@ -800,8 +804,8 @@
 	return (RoadBits)((1 << a) + (1 << b));
 }
 
-// Grow the town
-// Returns true if a house was built, or no if the build failed.
+/** Grow the town
+ * @Return true if a house was built, or no if the build failed. */
 static bool GrowTown(Town *t)
 {
 	TileIndex tile;
@@ -824,11 +828,11 @@
 		{ 0,  0}
 	};
 
-	// Current player is a town
+	/* Current player is a town */
 	old_player = _current_player;
 	_current_player = OWNER_TOWN;
 
-	// Find a road that we can base the construction on.
+	/* Find a road that we can base the construction on. */
 	tile = t->xy;
 	for (ptr = _town_coord_mod; ptr != endof(_town_coord_mod); ++ptr) {
 		if (GetAnyRoadTrackBits(tile) != 0) {
@@ -839,8 +843,8 @@
 		tile = TILE_ADD(tile, ToTileIndexDiff(*ptr));
 	}
 
-	// No road available, try to build a random road block by
-	// clearing some land and then building a road there.
+	/* No road available, try to build a random road block by
+	 * clearing some land and then building a road there. */
 	tile = t->xy;
 	for (ptr = _town_coord_mod; ptr != endof(_town_coord_mod); ++ptr) {
 		/* Only work with plain land that not already has a house */
@@ -890,11 +894,11 @@
 		memcpy(t->radius, _town_radius_data[t->num_houses / 4], sizeof(t->radius));
 	} else {
 		int mass = t->num_houses / 8;
-		// At least very roughly extrapolate. Empirical numbers dancing between
-		// overwhelming by cottages and skyscrapers outskirts.
+		/* At least very roughly extrapolate. Empirical numbers dancing between
+		 * overwhelming by cottages and skyscrapers outskirts. */
 		t->radius[0] = mass * mass;
-		// Actually we are proportional to sqrt() but that's right because
-		// we are covering an area.
+		/* Actually we are proportional to sqrt() but that's right because
+		 * we are covering an area. */
 		t->radius[1] = mass * 7;
 		t->radius[2] = 0;
 		t->radius[3] = mass * 4;
@@ -926,12 +930,12 @@
 		SetDParam(0, r);
 		GetString(buf1, townnametype, lastof(buf1));
 
-		// Check size and width
+		/* Check size and width */
 		if (strlen(buf1) >= 31 || GetStringBoundingBox(buf1).width > 130) continue;
 
 		FOR_ALL_TOWNS(t2) {
-			// We can't just compare the numbers since
-			// several numbers may map to a single name.
+			/* We can't just compare the numbers since
+			 * several numbers may map to a single name. */
 			SetDParam(0, t2->index);
 			GetString(buf2, STR_TOWN, lastof(buf2));
 			if (strcmp(buf1, buf2) == 0) {
@@ -954,7 +958,7 @@
 {
 	int x, i;
 
-	// clear the town struct
+	/* clear the town struct */
 	i = t->index;
 	memset(t, 0, sizeof(Town));
 	t->index = i;
@@ -1046,6 +1050,7 @@
  * This obviously only works in the scenario editor. Function not removed
  * as it might be possible in the future to fund your own town :)
  * @param tile coordinates where town is built
+ * @param flags type of operation
  * @param p1 size of the town (0 = random, 1 = small, 2 = medium, 3 = large)
  * @param p2 unused
  */
@@ -1059,28 +1064,28 @@
 
 	SET_EXPENSES_TYPE(EXPENSES_OTHER);
 
-	// Check if too close to the edge of map
+	/* Check if too close to the edge of map */
 	if (DistanceFromEdge(tile) < 12)
 		return_cmd_error(STR_0237_TOO_CLOSE_TO_EDGE_OF_MAP);
 
-	// Can only build on clear flat areas, possibly with trees.
+	/* Can only build on clear flat areas, possibly with trees. */
 	if ((!IsTileType(tile, MP_CLEAR) && !IsTileType(tile, MP_TREES)) || GetTileSlope(tile, NULL) != SLOPE_FLAT) {
 		return_cmd_error(STR_0239_SITE_UNSUITABLE);
 	}
 
-	// Check distance to all other towns.
+	/* Check distance to all other towns. */
 	if (IsCloseToTown(tile, 20))
 		return_cmd_error(STR_0238_TOO_CLOSE_TO_ANOTHER_TOWN);
 
-	// Get a unique name for the town.
+	/* Get a unique name for the town. */
 	if (!CreateTownName(&townnameparts))
 		return_cmd_error(STR_023A_TOO_MANY_TOWNS);
 
-	// Allocate town struct
+	/* Allocate town struct */
 	t = AllocateTown();
 	if (t == NULL) return_cmd_error(STR_023A_TOO_MANY_TOWNS);
 
-	// Create the town
+	/* Create the town */
 	if (flags & DC_EXEC) {
 		_generating_world = true;
 		DoCreateTown(t, tile, townnameparts, p1);
@@ -1096,20 +1101,20 @@
 	uint32 townnameparts;
 
 	do {
-		// Generate a tile index not too close from the edge
+		/* Generate a tile index not too close from the edge */
 		tile = RandomTile();
 		if (DistanceFromEdge(tile) < 20) continue;
 
-		// Make sure the tile is plain
+		/* Make sure the tile is plain */
 		if (!IsTileType(tile, MP_CLEAR) || GetTileSlope(tile, NULL) != SLOPE_FLAT) continue;
 
-		// Check not too close to a town
+		/* Check not too close to a town */
 		if (IsCloseToTown(tile, 20)) continue;
 
-		// Get a unique name for the town.
+		/* Get a unique name for the town. */
 		if (!CreateTownName(&townnameparts)) break;
 
-		// Allocate a town struct
+		/* Allocate a town struct */
 		t = AllocateTown();
 		if (t == NULL) break;
 
@@ -1130,11 +1135,11 @@
 
 	do {
 		IncreaseGeneratingWorldProgress(GWP_TOWN);
-		// try 20 times to create a random-sized town for the first loop.
+		/* try 20 times to create a random-sized town for the first loop. */
 		if (CreateRandomTown(20, 0) != NULL) num++;
 	} while (--n);
 
-	// give it a last try, but now more aggressive
+	/* give it a last try, but now more aggressive */
 	if (num == 0 && CreateRandomTown(10000, 0) == NULL) {
 		if (GetNumTowns() == 0) {
 			/* XXX - can we handle that more gracefully? */
@@ -1223,10 +1228,10 @@
 	uint oneof = 0;
 	HouseSpec *hs;
 
-	// Above snow?
+	/* Above snow? */
 	slope = GetTileSlope(tile, &z);
 
-	// Get the town zone type
+	/* Get the town zone type */
 	{
 		uint rad = GetTownRadiusGroup(t, tile);
 
@@ -1236,16 +1241,16 @@
 		bitmask = (1 << rad) + (1 << (land + 12));
 	}
 
-	// bits 0-4 are used
-	// bits 11-15 are used
-	// bits 5-10 are not used.
+	/* bits 0-4 are used
+	 * bits 11-15 are used
+	 * bits 5-10 are not used. */
 	{
 		HouseID houses[HOUSE_MAX];
 		int num = 0;
 		uint cumulative_probs[HOUSE_MAX];
 		uint probability_max = 0;
 
-		// Generate a list of all possible houses that can be built.
+		/* Generate a list of all possible houses that can be built. */
 		for (i = 0; i < HOUSE_MAX; i++) {
 			hs = GetHouseSpecs(i);
 			if ((~hs->building_availability & bitmask) == 0 && hs->enabled) {
@@ -1282,7 +1287,7 @@
 
 			if (_cur_year < hs->min_date || _cur_year > hs->max_date) continue;
 
-			// Special houses that there can be only one of.
+			/* Special houses that there can be only one of. */
 			if (hs->building_flags & BUILDING_IS_CHURCH) {
 				SETBIT(oneof, TOWN_HAS_CHURCH);
 			} else if (hs->building_flags & BUILDING_IS_STADIUM) {
@@ -1293,7 +1298,7 @@
 
 			if (HASBITS(t->flags12 , oneof)) continue;
 
-			// Make sure there is no slope?
+			/* Make sure there is no slope? */
 			if (hs->building_flags & TILE_NOT_SLOPED && slope != SLOPE_FLAT) continue;
 
 			if (hs->building_flags & TILE_SIZE_2x2) {
@@ -1327,7 +1332,7 @@
 	t->num_houses++;
 	IncreaseBuildingCount(t, house);
 
-	// Special houses that there can be only one of.
+	/* Special houses that there can be only one of. */
 	t->flags12 |= oneof;
 
 	{
@@ -1379,7 +1384,7 @@
 
 	assert(IsTileType(tile, MP_HOUSE));
 
-	// need to align the tile to point to the upper left corner of the house
+	/* need to align the tile to point to the upper left corner of the house */
 	if (house >= 3) { // house id 0,1,2 MUST be single tile houses, or this code breaks.
 		if (GetHouseSpecs(house-1)->building_flags & TILE_SIZE_2x1) {
 			house--;
@@ -1398,7 +1403,7 @@
 
 	hs = GetHouseSpecs(house);
 
-	// Remove population from the town if the house is finished.
+	/* Remove population from the town if the house is finished. */
 	if (IsHouseCompleted(tile)) {
 		ChangePopulation(t, -hs->population);
 	}
@@ -1406,14 +1411,14 @@
 	t->num_houses--;
 	DecreaseBuildingCount(t, house);
 
-	// Clear flags for houses that only may exist once/town.
+	/* Clear flags for houses that only may exist once/town. */
 	if (hs->building_flags & BUILDING_IS_CHURCH) {
 		CLRBIT(t->flags12, TOWN_HAS_CHURCH);
 	} else if (hs->building_flags & BUILDING_IS_STADIUM) {
 		CLRBIT(t->flags12, TOWN_HAS_STADIUM);
 	}
 
-	// Do the actual clearing of tiles
+	/* Do the actual clearing of tiles */
 	eflags = hs->building_flags;
 	DoClearTownHouseHelper(tile);
 	if (eflags & BUILDING_2_TILES_X)   DoClearTownHouseHelper(tile + TileDiffXY(1, 0));
@@ -1423,6 +1428,7 @@
 
 /** Rename a town (server-only).
  * @param tile unused
+ * @param flags type of operation
  * @param p1 town ID to rename
  * @param p2 unused
  */
@@ -1452,7 +1458,7 @@
 	return 0;
 }
 
-// Called from GUI
+/** Called from GUI */
 void ExpandTown(Town *t)
 {
 	int amount, n;
@@ -1555,16 +1561,16 @@
 	TileIndex tile = t->xy;
 
 	if (CircularTileSearch(tile, 9, SearchTileForStatue, t->index))
-		SETBIT(t->statues, _current_player); ///< Once found and built, "inform" the Town
+		SETBIT(t->statues, _current_player); // Once found and built, "inform" the Town
 }
 
 static void TownActionFundBuildings(Town* t)
 {
-	// Build next tick
+	/* Build next tick */
 	t->grow_counter = 1;
-	// If we were not already growing
+	/* If we were not already growing */
 	SETBIT(t->flags12, TOWN_IS_FUNDED);
-	// And grow for 3 months
+	/* And grow for 3 months */
 	t->fund_buildings_months = 3;
 }
 
@@ -1581,18 +1587,18 @@
 	if (!RandomRange(15)) {
 		Station *st;
 
-		// set as unwanted for 6 months
+		/* set as unwanted for 6 months */
 		t->unwanted[_current_player] = 6;
 
-		// set all close by station ratings to 0
+		/* set all close by station ratings to 0 */
 		FOR_ALL_STATIONS(st) {
 			if (st->town == t && st->owner == _current_player) {
 				for (CargoID i = 0; i < NUM_CARGO; i++) st->goods[i].rating = 0;
 			}
 		}
 
-		// only show errormessage to the executing player. All errors are handled command.c
-		// but this is special, because it can only 'fail' on a DC_EXEC
+		/* only show errormessage to the executing player. All errors are handled command.c
+		 * but this is special, because it can only 'fail' on a DC_EXEC */
 		if (IsLocalPlayer()) ShowErrorMessage(STR_BRIBE_FAILED_2, STR_BRIBE_FAILED, 0, 0);
 
 		/* decrease by a lot!
@@ -1625,6 +1631,7 @@
  * This performs an action such as advertising, building a statue, funding buildings,
  * but also bribing the town-council
  * @param tile unused
+ * @param flags type of operation
  * @param p1 town to do the action at
  * @param p2 action to perform, @see _town_action_proc for the list of available actions
  */
@@ -1658,7 +1665,7 @@
 	byte m;
 	Player *p;
 
-	// Reset player ratings if they're low
+	/* Reset player ratings if they're low */
 	FOR_ALL_PLAYERS(p) {
 		if (p->is_active && t->ratings[p->index] <= 200) {
 			t->ratings[p->index] += 5;
@@ -1715,7 +1722,7 @@
 
 static void UpdateTownAmounts(Town *t)
 {
-	// Using +1 here to prevent overflow and division by zero
+	/* Using +1 here to prevent overflow and division by zero */
 	t->pct_pass_transported = t->new_act_pass * 256 / (t->new_max_pass + 1);
 
 	t->max_pass = t->new_max_pass; t->new_max_pass = 0;
@@ -1723,7 +1730,7 @@
 	t->act_food = t->new_act_food; t->new_act_food = 0;
 	t->act_water = t->new_act_water; t->new_act_water = 0;
 
-	// Using +1 here to prevent overflow and division by zero
+	/* Using +1 here to prevent overflow and division by zero */
 	t->pct_mail_transported = t->new_act_mail * 256 / (t->new_max_mail + 1);
 	t->max_mail = t->new_max_mail; t->new_max_mail = 0;
 	t->act_mail = t->new_act_mail; t->new_act_mail = 0;
@@ -1793,7 +1800,7 @@
 {
 	int rating;
 
-	// if magic_bulldozer cheat is active, town doesn't penaltize for removing stuff
+	/* if magic_bulldozer cheat is active, town doesn't penaltize for removing stuff */
 	if (t == NULL ||
 			!IsValidPlayer(_current_player) ||
 			(_cheats.magic_bulldozer.value && add < 0)) {
@@ -1820,17 +1827,17 @@
 
 /* penalty for removing town-owned stuff */
 static const int _default_rating_settings [3][3] = {
-	// ROAD_REMOVE, TUNNELBRIDGE_REMOVE, INDUSTRY_REMOVE
-	{  0, 128, 384}, // Permissive
-	{ 48, 192, 480}, // Neutral
-	{ 96, 384, 768}, // Hostile
+	/* ROAD_REMOVE, TUNNELBRIDGE_REMOVE, INDUSTRY_REMOVE */
+	{  0, 128, 384}, ///< Permissive
+	{ 48, 192, 480}, ///< Neutral
+	{ 96, 384, 768}, ///< Hostile
 };
 
 bool CheckforTownRating(uint32 flags, Town *t, byte type)
 {
 	int modemod;
 
-	// if magic_bulldozer cheat is active, town doesn't restrict your destructive actions
+	/* if magic_bulldozer cheat is active, town doesn't restrict your destructive actions */
 	if (t == NULL || !IsValidPlayer(_current_player) || _cheats.magic_bulldozer.value)
 		return true;
 
@@ -1900,7 +1907,7 @@
 };
 
 
-// Save and load of towns.
+/** Save and load of towns. */
 static const SaveLoad _town_desc[] = {
 	SLE_CONDVAR(Town, xy,                    SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
 	SLE_CONDVAR(Town, xy,                    SLE_UINT32,                 6, SL_MAX_VERSION),
@@ -1916,12 +1923,12 @@
 	    SLE_VAR(Town, flags12,               SLE_UINT8),
 	    SLE_VAR(Town, statues,               SLE_UINT8),
 
-	// sort_index_obsolete was stored here in savegame format 0 - 1
+	/* sort_index_obsolete was stored here in savegame format 0 - 1 */
 	SLE_CONDNULL(1, 0, 1),
 
 	    SLE_VAR(Town, have_ratings,          SLE_UINT8),
 	    SLE_ARR(Town, ratings,               SLE_INT16, 8),
-	// failed bribe attempts are stored since savegame format 4
+	/* failed bribe attempts are stored since savegame format 4 */
 	SLE_CONDARR(Town, unwanted,              SLE_INT8, 8, 4,SL_MAX_VERSION),
 
 	SLE_CONDVAR(Town, max_pass,              SLE_FILE_U16 | SLE_VAR_U32, 0, 8),
@@ -1958,7 +1965,7 @@
 
 	    SLE_VAR(Town, exclusivity,           SLE_UINT8),
 	    SLE_VAR(Town, exclusive_counter,     SLE_UINT8),
-	// reserve extra space in savegame here. (currently 30 bytes)
+	/* reserve extra space in savegame here. (currently 30 bytes) */
 	SLE_CONDNULL(30, 2, SL_MAX_VERSION),
 
 	SLE_END()
--- a/src/town_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/town_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file town_gui.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
@@ -32,9 +34,9 @@
 extern const byte _town_action_costs[8];
 
 /** Get a list of available actions to do at a town.
- * @param *nump if not NULL add put the number of available actions in it
+ * @param nump if not NULL add put the number of available actions in it
  * @param pid the player that is querying the town
- * @param *t the town that is queried
+ * @param t the town that is queried
  * @return bitmasked value of enabled actions
  */
 uint GetMaskOfTownActions(int *nump, PlayerID pid, const Town *t)
@@ -47,9 +49,9 @@
 	if (pid != PLAYER_SPECTATOR) {
 		uint i;
 
-		// bribe option enabled?
+		/* bribe option enabled? */
 		if (_patches.bribe) {
-			// if unwanted, disable everything.
+			/* if unwanted, disable everything. */
 			if (t->unwanted[pid]) {
 				avail_buttons = 0;
 			} else if (t->ratings[pid] < RATING_BRIBE_MAXIMUM) {
@@ -57,7 +59,7 @@
 			}
 		}
 
-		// Things worth more than this are not shown
+		/* Things worth more than this are not shown */
 		avail = GetPlayer(pid)->player_money + _price.station_value * 200;
 		ref = _price.build_industry >> 8;
 
@@ -119,7 +121,7 @@
 
 			DrawString(2, 15, STR_2023_TRANSPORT_COMPANY_RATINGS, 0);
 
-			// Draw list of players
+			/* Draw list of players */
 			y = 25;
 			FOR_ALL_PLAYERS(p) {
 				if (p->is_active && (HASBIT(t->have_ratings, p->index) || t->exclusivity == p->index)) {
@@ -150,7 +152,7 @@
 			}
 		}
 
-		// Draw actions list
+		/* Draw actions list */
 		{
 			int y = 107, i;
 			int pos = w->vscroll.pos;
@@ -234,7 +236,7 @@
 
 	switch (e->event) {
 	case WE_PAINT:
-		// disable renaming town in network games if you are not the server
+		/* disable renaming town in network games if you are not the server */
 		SetWindowWidgetDisabledState(w, 8, _networking && !_network_server);
 
 		SetDParam(0, t->index);
@@ -365,7 +367,7 @@
 };
 
 
-// used to get a sorted list of the towns
+/* used to get a sorted list of the towns */
 static uint _num_town_sort;
 
 static char _bufcache[64];
--- a/src/town_map.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/town_map.h	Sun Apr 08 14:46:55 2007 +0000
@@ -127,7 +127,7 @@
 /**
  * Set the position of the lift on this animated house
  * @param t the tile
- * @param pos, from 0 to 36
+ * @param pos position, from 0 to 36
  */
 static inline void SetLiftPosition(TileIndex t, byte pos)
 {
@@ -315,7 +315,8 @@
 /**
  * Set the activated triggers bits for this house.
  * This is required for newgrf house
- * @param t the tile of this house
+ * @param t        the tile of this house
+ * @param triggers the activated triggers
  * @pre IsTileType(t, MP_HOUSE)
  */
 static inline void SetHouseTriggers(TileIndex t, byte triggers)
--- a/src/train.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/train.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file train.h */
+
 #ifndef TRAIN_H
 #define TRAIN_H
 
@@ -14,12 +16,12 @@
  */
 
 enum TrainSubtype {
-	Train_Front             = 0, // Leading engine of a train
-	Train_Articulated_Part  = 1, // Articulated part of an engine
-	Train_Wagon             = 2, // Wagon
-	Train_Engine            = 3, // Engine, that can be front engines, but might be placed behind another engine
-	Train_Free_Wagon        = 4, // First in a wagon chain (in depot)
-	Train_Multiheaded       = 5, // Engine is a multiheaded
+	Train_Front             = 0, ///< Leading engine of a train
+	Train_Articulated_Part  = 1, ///< Articulated part of an engine
+	Train_Wagon             = 2, ///< Wagon
+	Train_Engine            = 3, ///< Engine, that can be front engines, but might be placed behind another engine
+	Train_Free_Wagon        = 4, ///< First in a wagon chain (in depot)
+	Train_Multiheaded       = 5, ///< Engine is a multiheaded
 };
 
 
--- a/src/train_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/train_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file train_cmd.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "bridge_map.h"
@@ -105,24 +107,24 @@
 	for (Vehicle *u = v; u != NULL; u = u->next) {
 		uint32 vweight = GetCargo(u->cargo_type)->weight * u->cargo_count * FreightWagonMult(u->cargo_type) / 16;
 
-		// Vehicle weight is not added for articulated parts.
+		/* Vehicle weight is not added for articulated parts. */
 		if (!IsArticulatedPart(u)) {
-			// vehicle weight is the sum of the weight of the vehicle and the weight of its cargo
+			/* vehicle weight is the sum of the weight of the vehicle and the weight of its cargo */
 			vweight += RailVehInfo(u->engine_type)->weight;
 
-			// powered wagons have extra weight added
+			/* powered wagons have extra weight added */
 			if (HASBIT(u->u.rail.flags, VRF_POWEREDWAGON))
 				vweight += RailVehInfo(u->u.rail.first_engine)->pow_wag_weight;
 		}
 
-		// consist weight is the sum of the weight of all vehicles in the consist
+		/* consist weight is the sum of the weight of all vehicles in the consist */
 		weight += vweight;
 
-		// store vehicle weight in cache
+		/* store vehicle weight in cache */
 		u->u.rail.cached_veh_weight = vweight;
 	}
 
-	// store consist weight in cache
+	/* store consist weight in cache */
 	v->u.rail.cached_weight = weight;
 
 	/* Now update train power (tractive effort is dependent on weight) */
@@ -151,10 +153,10 @@
 	for (Vehicle *u = v; u != NULL; u = u->next) {
 		const RailVehicleInfo *rvi_u = RailVehInfo(u->engine_type);
 
-		// Update the v->first cache. This is faster than having to brute force it later.
+		/* Update the v->first cache. This is faster than having to brute force it later. */
 		if (u->first == NULL) u->first = v;
 
-		// update the 'first engine'
+		/* update the 'first engine' */
 		u->u.rail.first_engine = v == u ? INVALID_ENGINE : first_engine;
 		u->u.rail.railtype = rvi_u->railtype;
 
@@ -164,13 +166,13 @@
 			u->u.rail.cached_vis_effect = rvi_u->visual_effect;
 		} else {
 			if (IsTrainWagon(u) || IsArticulatedPart(u)) {
-				// Wagons and articulated parts have no effect by default
+				/* Wagons and articulated parts have no effect by default */
 				u->u.rail.cached_vis_effect = 0x40;
 			} else if (rvi_u->engclass == 0) {
-				// Steam is offset by -4 units
+				/* Steam is offset by -4 units */
 				u->u.rail.cached_vis_effect = 4;
 			} else {
-				// Diesel fumes and sparks come from the centre
+				/* Diesel fumes and sparks come from the centre */
 				u->u.rail.cached_vis_effect = 8;
 			}
 		}
@@ -204,13 +206,13 @@
 				u->u.rail.compatible_railtypes |= (1 << RAILTYPE_RAIL);
 			}
 
-			// max speed is the minimum of the speed limits of all vehicles in the consist
+			/* max speed is the minimum of the speed limits of all vehicles in the consist */
 			if ((rvi_u->railveh_type != RAILVEH_WAGON || _patches.wagon_speed_limits) &&
 				rvi_u->max_speed != 0 && !UsesWagonOverride(u))
 				max_speed = min(rvi_u->max_speed, max_speed);
 		}
 
-		// check the vehicle length (callback)
+		/* check the vehicle length (callback) */
 		uint16 veh_len = CALLBACK_FAILED;
 		if (HASBIT(EngInfo(u->engine_type)->callbackmask, CBM_VEHICLE_LENGTH)) {
 			veh_len = GetVehicleCallback(CBID_TRAIN_VEHICLE_LENGTH, 0, 0, u->engine_type, u);
@@ -221,10 +223,10 @@
 		v->u.rail.cached_total_length += u->u.rail.cached_veh_length;
 	}
 
-	// store consist weight/max speed in cache
+	/* store consist weight/max speed in cache */
 	v->u.rail.cached_max_speed = max_speed;
 
-	// recalculate cached weights and power too (we do this *after* the rest, so it is known which wagons are powered and need extra weight added)
+	/* recalculate cached weights and power too (we do this *after* the rest, so it is known which wagons are powered and need extra weight added) */
 	TrainCargoChanged(v);
 }
 
@@ -263,8 +265,8 @@
 	StationID sid = GetStationIndex(tile);
 
 	assert(v->type == VEH_TRAIN);
-	//When does a train drive through a station
-	//first we deal with the "new nonstop handling"
+	/* When does a train drive through a station
+	 * first we deal with the "new nonstop handling" */
 	if (_patches.new_nonstop && o->flags & OF_NON_STOP && sid == o->dest) {
 		return false;
 	}
@@ -278,14 +280,14 @@
 	return true;
 }
 
-//new acceleration
+/** new acceleration*/
 static int GetTrainAcceleration(Vehicle *v, bool mode)
 {
 	int max_speed = 2000;
 	int speed = v->cur_speed * 10 / 16; //[mph]
 	int curvecount[2] = {0, 0};
 
-	//first find the curve speed limit
+	/*first find the curve speed limit */
 	int numcurve = 0;
 	int sum = 0;
 	int pos = 0;
@@ -309,7 +311,7 @@
 			}
 		}
 
-		//if we have a 90 degree turn, fix the speed limit to 60
+		/*if we have a 90 degree turn, fix the speed limit to 60 */
 		if (_curve_neighbours90[dir][0] == ndir ||
 				_curve_neighbours90[dir][1] == ndir) {
 			max_speed = 61;
@@ -402,7 +404,7 @@
 				break;
 		}
 	} else {
-		//"kickoff" acceleration
+		/* "kickoff" acceleration */
 		force = (mode == AM_ACCEL && v->u.rail.railtype != RAILTYPE_MAGLEV) ? min(max_te, power) : power;
 		force = max(force, (mass * 8) + resistance);
 	}
@@ -521,7 +523,7 @@
 		bool flip_image = HASBIT(callback, 7);
 		const RailVehicleInfo *rvi_artic = RailVehInfo(engine_type);
 
-		// get common values from first engine
+		/* get common values from first engine */
 		u->direction = v->direction;
 		u->owner = v->owner;
 		u->tile = v->tile;
@@ -535,7 +537,7 @@
 		u->vehstatus = v->vehstatus & ~VS_STOPPED;
 		u->u.rail.first_engine = v->engine_type;
 
-		// get more settings from rail vehicle info
+		/* get more settings from rail vehicle info */
 		u->spritenum = rvi_artic->image_index;
 		if (flip_image) u->spritenum++;
 		u->cargo_type = rvi_artic->cargo_type;
@@ -645,7 +647,7 @@
 	return value;
 }
 
-// Move all free vehicles in the depot to the train
+/** Move all free vehicles in the depot to the train */
 static void NormalizeTrainVehInDepot(const Vehicle* u)
 {
 	const Vehicle* v;
@@ -697,6 +699,7 @@
 
 /** Build a railroad vehicle.
  * @param tile tile of the depot where rail-vehicle is built
+ * @param flags type of operation
  * @param p1 engine type id
  * @param p2 bit 0 when set, the train will get number 0, otherwise it will get a free number
  *           bit 1 prevents any free cars from being added to the train
@@ -704,7 +707,7 @@
 int32 CmdBuildRailVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	/* Check if the engine-type is valid (for the player) */
-	if (!IsEngineBuildable(p1, VEH_TRAIN, _current_player)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
+	if (!IsEngineBuildable(p1, VEH_TRAIN, _current_player)) return_cmd_error(STR_RAIL_VEHICLE_NOT_AVAILABLE);
 
 	/* Check if the train is actually being built in a depot belonging
 	 * to the player. Doesn't matter if only the cost is queried */
@@ -874,7 +877,7 @@
  */
 static Vehicle *UnlinkWagon(Vehicle *v, Vehicle *first)
 {
-	// unlinking the first vehicle of the chain?
+	/* unlinking the first vehicle of the chain? */
 	if (v == first) {
 		v = GetNextVehicle(v);
 		if (v == NULL) return NULL;
@@ -898,7 +901,7 @@
 
 	FOR_ALL_VEHICLES(dst) {
 		if (dst->type == VEH_TRAIN && IsFreeWagon(dst) && dst->tile == tile) {
-			// check so all vehicles in the line have the same engine.
+			/* check so all vehicles in the line have the same engine. */
 			Vehicle *v = dst;
 
 			while (v->engine_type == eng) {
@@ -950,6 +953,7 @@
 
 /** Move a rail vehicle around inside the depot.
  * @param tile unused
+ * @param flags type of operation
  * @param p1 various bitstuffed elements
  * - p1 (bit  0 - 15) source vehicle index
  * - p1 (bit 16 - 31) what wagon to put the source wagon AFTER, XXX - INVALID_VEHICLE to make a new line
@@ -966,7 +970,7 @@
 
 	if (src->type != VEH_TRAIN || !CheckOwnership(src->owner)) return CMD_ERROR;
 
-	// if nothing is selected as destination, try and find a matching vehicle to drag to.
+	/* if nothing is selected as destination, try and find a matching vehicle to drag to. */
 	Vehicle *dst;
 	if (d == INVALID_VEHICLE) {
 		dst = IsTrainEngine(src) ? NULL : FindGoodVehiclePos(src);
@@ -976,13 +980,13 @@
 		if (dst->type != VEH_TRAIN || !CheckOwnership(dst->owner)) return CMD_ERROR;
 	}
 
-	// if an articulated part is being handled, deal with its parent vehicle
+	/* if an articulated part is being handled, deal with its parent vehicle */
 	while (IsArticulatedPart(src)) src = GetPrevVehicleInChain(src);
 	if (dst != NULL) {
 		while (IsArticulatedPart(dst)) dst = GetPrevVehicleInChain(dst);
 	}
 
-	// don't move the same vehicle..
+	/* don't move the same vehicle.. */
 	if (src == dst) return 0;
 
 	/* locate the head of the two chains */
@@ -991,7 +995,7 @@
 	if (dst != NULL) {
 		dst_head = GetFirstVehicleInChain(dst);
 		if (dst_head->tile != src_head->tile) return CMD_ERROR;
-		// Now deal with articulated part of destination wagon
+		/* Now deal with articulated part of destination wagon */
 		dst = GetLastEnginePart(dst);
 	} else {
 		dst_head = NULL;
@@ -1004,7 +1008,7 @@
 			dst = GetPrevVehicleInChain(dst);
 			/* Now if the vehicle we want to link to is the vehicle itself, drop out */
 			if (dst == src) return CMD_ERROR;
-			// if dst is NULL, it means that dst got a rear multiheaded engine as first engine. We can't use that
+			/* if dst is NULL, it means that dst got a rear multiheaded engine as first engine. We can't use that */
 			if (dst == NULL) return CMD_ERROR;
 		} else {
 			/* there are more units on this train, so we will add the wagon after the next one*/
@@ -1032,51 +1036,51 @@
 
 	if (IsMultiheaded(src) && !IsTrainEngine(src)) return_cmd_error(STR_REAR_ENGINE_FOLLOW_FRONT_ERROR);
 
-	// when moving all wagons, we can't have the same src_head and dst_head
+	/* when moving all wagons, we can't have the same src_head and dst_head */
 	if (HASBIT(p2, 0) && src_head == dst_head) return 0;
 
 	{
 		int max_len = _patches.mammoth_trains ? 100 : 9;
 
-		// check if all vehicles in the source train are stopped inside a depot.
+		/* check if all vehicles in the source train are stopped inside a depot. */
 		int src_len = CheckTrainStoppedInDepot(src_head);
 		if (src_len < 0) return_cmd_error(STR_881A_TRAINS_CAN_ONLY_BE_ALTERED);
 
-		// check the destination row if the source and destination aren't the same.
+		/* check the destination row if the source and destination aren't the same. */
 		if (src_head != dst_head) {
 			int dst_len = 0;
 
 			if (dst_head != NULL) {
-				// check if all vehicles in the dest train are stopped.
+				/* check if all vehicles in the dest train are stopped. */
 				dst_len = CheckTrainStoppedInDepot(dst_head);
 				if (dst_len < 0) return_cmd_error(STR_881A_TRAINS_CAN_ONLY_BE_ALTERED);
 			}
 
-			// We are moving between rows, so only count the wagons from the source
-			// row that are being moved.
+			/* We are moving between rows, so only count the wagons from the source
+			 * row that are being moved. */
 			if (HASBIT(p2, 0)) {
 				const Vehicle *u;
 				for (u = src_head; u != src && u != NULL; u = GetNextVehicle(u))
 					src_len--;
 			} else {
-				// If moving only one vehicle, just count that.
+				/* If moving only one vehicle, just count that. */
 				src_len = 1;
 			}
 
 			if (src_len + dst_len > max_len) {
-				// Abort if we're adding too many wagons to a train.
+				/* Abort if we're adding too many wagons to a train. */
 				if (dst_head != NULL && IsFrontEngine(dst_head)) return_cmd_error(STR_8819_TRAIN_TOO_LONG);
-				// Abort if we're making a train on a new row.
+				/* Abort if we're making a train on a new row. */
 				if (dst_head == NULL && IsTrainEngine(src)) return_cmd_error(STR_8819_TRAIN_TOO_LONG);
 			}
 		} else {
-			// Abort if we're creating a new train on an existing row.
+			/* Abort if we're creating a new train on an existing row. */
 			if (src_len > max_len && src == src_head && IsTrainEngine(GetNextVehicle(src_head)))
 				return_cmd_error(STR_8819_TRAIN_TOO_LONG);
 		}
 	}
 
-	// moving a loco to a new line?, then we need to assign a unitnumber.
+	/* moving a loco to a new line?, then we need to assign a unitnumber. */
 	if (dst == NULL && !IsFrontEngine(src) && IsTrainEngine(src)) {
 		UnitID unit_num = GetFreeUnitNumber(VEH_TRAIN);
 		if (unit_num > _patches.max_trains)
@@ -1104,7 +1108,7 @@
 		for (Vehicle *u = dst_head; u != NULL; u = u->next) u->first = NULL;
 
 		if (HASBIT(p2, 0)) {
-			// unlink ALL wagons
+			/* unlink ALL wagons */
 			if (src != src_head) {
 				Vehicle *v = src_head;
 				while (GetNextVehicle(v) != src) v = GetNextVehicle(v);
@@ -1114,9 +1118,9 @@
 				src_head = NULL;
 			}
 		} else {
-			// if moving within the same chain, dont use dst_head as it may get invalidated
+			/* if moving within the same chain, dont use dst_head as it may get invalidated */
 			if (src_head == dst_head) dst_head = NULL;
-			// unlink single wagon from linked list
+			/* unlink single wagon from linked list */
 			src_head = UnlinkWagon(src, src_head);
 			GetLastEnginePart(src)->next = NULL;
 		}
@@ -1125,10 +1129,10 @@
 			/* We make a new line in the depot, so we know already that we invalidate the window data */
 			InvalidateWindowData(WC_VEHICLE_DEPOT, src->tile);
 
-			// move the train to an empty line. for locomotives, we set the type to TS_Front. for wagons, 4.
+			/* move the train to an empty line. for locomotives, we set the type to TS_Front. for wagons, 4. */
 			if (IsTrainEngine(src)) {
 				if (!IsFrontEngine(src)) {
-					// setting the type to 0 also involves setting up the orders field.
+					/* setting the type to 0 also involves setting up the orders field. */
 					SetFrontEngine(src);
 					assert(src->orders == NULL);
 					src->num_orders = 0;
@@ -1139,7 +1143,7 @@
 			dst_head = src;
 		} else {
 			if (IsFrontEngine(src)) {
-				// the vehicle was previously a loco. need to free the order list and delete vehicle windows etc.
+				/* the vehicle was previously a loco. need to free the order list and delete vehicle windows etc. */
 				DeleteWindowById(WC_VEHICLE_VIEW, src->index);
 				DeleteVehicleOrders(src);
 			}
@@ -1151,7 +1155,7 @@
 				src->unitnumber = 0; // doesn't occupy a unitnumber anymore.
 			}
 
-			// link in the wagon(s) in the chain.
+			/* link in the wagon(s) in the chain. */
 			{
 				Vehicle *v;
 
@@ -1165,7 +1169,7 @@
 				src_head = src_head->next;
 			}
 			AddWagonToConsist(src->u.rail.other_multiheaded_part, src);
-			// previous line set the front engine to the old front. We need to clear that
+			/* previous line set the front engine to the old front. We need to clear that */
 			src->u.rail.other_multiheaded_part->first = NULL;
 		}
 
@@ -1184,7 +1188,7 @@
 			}
 			if (engine != NULL && engine->u.rail.other_multiheaded_part != NULL) {
 				AddWagonToConsist(engine->u.rail.other_multiheaded_part, engine);
-				// previous line set the front engine to the old front. We need to clear that
+				/* previous line set the front engine to the old front. We need to clear that */
 				engine->u.rail.other_multiheaded_part->first = NULL;
 			}
 		}
@@ -1233,6 +1237,7 @@
 
 /** Start/Stop a train.
  * @param tile unused
+ * @param flags type of operation
  * @param p1 train to start/stop
  * @param p2 unused
  */
@@ -1269,6 +1274,7 @@
 
 /** Sell a (single) train wagon/engine.
  * @param tile unused
+ * @param flags type of operation
  * @param p1 the wagon/engine index
  * @param p2 the selling mode
  * - p2 = 0: only sell the single dragged wagon/engine (and any belonging rear-engines)
@@ -1290,7 +1296,7 @@
 	while (IsArticulatedPart(v)) v = GetPrevVehicleInChain(v);
 	Vehicle *first = GetFirstVehicleInChain(v);
 
-	// make sure the vehicle is stopped in the depot
+	/* make sure the vehicle is stopped in the depot */
 	if (CheckTrainStoppedInDepot(first) < 0) {
 		return_cmd_error(STR_881A_TRAINS_CAN_ONLY_BE_ALTERED);
 	}
@@ -1596,8 +1602,8 @@
 	uint length = CountVehiclesInChain(v);
 
 	while (length > 2) {
-		// find pairwise matching wagon
-		// start<>end, start+1<>end-1, ...
+		/* find pairwise matching wagon
+		 * start<>end, start+1<>end-1, ... */
 		Vehicle *last = first;
 		for (uint i = length - 3; i > 0; i--) last = last->next;
 
@@ -1605,7 +1611,7 @@
 		if (before) differential *= -1;
 
 		if (differential > 0) {
-			// disconnect last car to make sure only this subset moves
+			/* disconnect last car to make sure only this subset moves */
 			Vehicle *tempnext = last->next;
 			last->next = NULL;
 
@@ -1643,7 +1649,7 @@
 		DisableTrainCrossing(tile);
 	}
 
-	// count number of vehicles
+	/* count number of vehicles */
 	int r = -1;
 	const Vehicle *u = v;
 	do r++; while ( (u = u->next) != NULL );
@@ -1667,6 +1673,7 @@
 
 /** Reverse train.
  * @param tile unused
+ * @param flags type of operation
  * @param p1 train to reverse
  * @param p2 if true, reverse a unit in a train (needs to be in a depot)
  */
@@ -1679,14 +1686,14 @@
 	if (v->type != VEH_TRAIN || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	if (p2) {
-		// turn a single unit around
+		/* turn a single unit around */
 
 		if (IsMultiheaded(v) || HASBIT(EngInfo(v->engine_type)->callbackmask, CBM_ARTIC_ENGINE)) {
 			return_cmd_error(STR_ONLY_TURN_SINGLE_UNIT);
 		}
 
 		Vehicle *front = GetFirstVehicleInChain(v);
-		// make sure the vehicle is stopped in the depot
+		/* make sure the vehicle is stopped in the depot */
 		if (CheckTrainStoppedInDepot(front) < 0) {
 			return_cmd_error(STR_881A_TRAINS_CAN_ONLY_BE_ALTERED);
 		}
@@ -1697,7 +1704,7 @@
 			InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
 		}
 	} else {
-		//turn the whole train around
+		/*turn the whole train around */
 		if (v->u.rail.crash_anim_pos != 0 || v->breakdown_ctr != 0) return CMD_ERROR;
 
 		if (flags & DC_EXEC) {
@@ -1715,6 +1722,7 @@
 
 /** Force a train through a red signal
  * @param tile unused
+ * @param flags type of operation
  * @param p1 train to ignore the red signal
  * @param p2 unused
  */
@@ -1733,6 +1741,7 @@
 
 /** Refits a train to the specified cargo type.
  * @param tile unused
+ * @param flags type of operation
  * @param p1 vehicle ID of the train to refit
  * param p2 various bitstuffed elements
  * - p2 = (bit 0-7) - the new cargo type to refit to
@@ -1854,8 +1863,8 @@
 	return false;
 }
 
-// returns the tile of a depot to goto to. The given vehicle must not be
-// crashed!
+/** returns the tile of a depot to goto to. The given vehicle must not be
+ * crashed! */
 static TrainFindDepotData FindClosestTrainDepot(Vehicle *v, int max_distance)
 {
 	assert(!(v->vehstatus & VS_CRASHED));
@@ -1893,7 +1902,7 @@
 			if (NPFGetFlag(&ftd.node, NPF_FLAG_REVERSE)) tfdd.reverse = true;
 		}
 	} else {
-		// search in the forward direction first.
+		/* search in the forward direction first. */
 		DiagDirection i = DirToDiagDir(v->direction);
 		if (!(v->direction & 1) && v->u.rail.track != _state_dir_table[i]) {
 			i = ChangeDiagDir(i, DIAGDIRDIFF_90LEFT);
@@ -1901,7 +1910,7 @@
 		NewTrainPathfind(tile, 0, v->u.rail.compatible_railtypes, i, (NTPEnumProc*)NtpCallbFindDepot, &tfdd);
 		if (tfdd.best_length == (uint)-1){
 			tfdd.reverse = true;
-			// search in backwards direction
+			/* search in backwards direction */
 			i = ReverseDiagDir(DirToDiagDir(v->direction));
 			if (!(v->direction & 1) && v->u.rail.track != _state_dir_table[i]) {
 				i = ChangeDiagDir(i, DIAGDIRDIFF_90LEFT);
@@ -1915,6 +1924,7 @@
 
 /** Send a train to a depot
  * @param tile unused
+ * @param flags type of operation
  * @param p1 train to send to the depot
  * @param p2 various bitmasked elements
  * - p2 bit 0-3 - DEPOT_ flags (see vehicle.h)
@@ -2010,7 +2020,7 @@
 		byte effect_type = GB(v->u.rail.cached_vis_effect, 4, 2);
 		bool disable_effect = HASBIT(v->u.rail.cached_vis_effect, 6);
 
-		// no smoke?
+		/* no smoke? */
 		if ((rvi->railveh_type == RAILVEH_WAGON && effect_type == 0) ||
 				disable_effect ||
 				rvi->railtype > RAILTYPE_ELECTRIC ||
@@ -2018,14 +2028,14 @@
 			continue;
 		}
 
-		// No smoke in depots or tunnels
+		/* No smoke in depots or tunnels */
 		if (IsTileDepotType(v->tile, TRANSPORT_RAIL) || IsTunnelTile(v->tile)) continue;
 
-		// No sparks for electric vehicles on nonelectrified tracks
+		/* No sparks for electric vehicles on nonelectrified tracks */
 		if (!HasPowerOnRail(v->u.rail.railtype, GetTileRailType(v->tile))) continue;
 
 		if (effect_type == 0) {
-			// Use default effect type for engine class.
+			/* Use default effect type for engine class. */
 			effect_type = rvi->engclass;
 		} else {
 			effect_type--;
@@ -2041,7 +2051,7 @@
 
 		switch (effect_type) {
 		case 0:
-			// steam smoke.
+			/* steam smoke. */
 			if (GB(v->tick_counter, 0, 4) == 0) {
 				CreateEffectVehicleRel(v, x, y, 10, EV_STEAM_SMOKE);
 				sound = true;
@@ -2049,7 +2059,7 @@
 			break;
 
 		case 1:
-			// diesel smoke
+			/* diesel smoke */
 			if (u->cur_speed <= 40 && CHANCE16(15, 128)) {
 				CreateEffectVehicleRel(v, 0, 0, 10, EV_DIESEL_SMOKE);
 				sound = true;
@@ -2057,7 +2067,7 @@
 			break;
 
 		case 2:
-			// blue spark
+			/* blue spark */
 			if (GB(v->tick_counter, 0, 2) == 0 && CHANCE16(1, 45)) {
 				CreateEffectVehicleRel(v, 0, 0, 10, EV_ELECTRIC_SPARK);
 				sound = true;
@@ -2094,12 +2104,12 @@
 
 static bool CheckTrainStayInDepot(Vehicle *v)
 {
-	// bail out if not all wagons are in the same depot or not in a depot at all
+	/* bail out if not all wagons are in the same depot or not in a depot at all */
 	for (const Vehicle *u = v; u != NULL; u = u->next) {
 		if (u->u.rail.track != TRACK_BIT_DEPOT || u->tile != v->tile) return false;
 	}
 
-	// if the train got no power, then keep it in the depot
+	/* if the train got no power, then keep it in the depot */
 	if (v->u.rail.cached_power == 0) {
 		v->vehstatus |= VS_STOPPED;
 		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
@@ -2151,10 +2161,10 @@
 
 static bool NtpCallbFindStation(TileIndex tile, TrainTrackFollowerData *ttfd, Trackdir track, uint length)
 {
-	// heading for nowhere?
+	/* heading for nowhere? */
 	if (ttfd->dest_coords == 0) return false;
 
-	// did we reach the final station?
+	/* did we reach the final station? */
 	if ((ttfd->station_index == INVALID_STATION && tile == ttfd->dest_coords) || (
 				IsTileType(tile, MP_STATION) &&
 				IsRailwayStation(tile) &&
@@ -2163,12 +2173,13 @@
 		/* We do not check for dest_coords if we have a station_index,
 		 * because in that case the dest_coords are just an
 		 * approximation of where the station is */
-		// found station
+
+		/* found station */
 		ttfd->best_track = track;
 		ttfd->best_bird_dist = 0;
 		return true;
 	} else {
-		// didn't find station, keep track of the best path so far.
+		/* didn't find station, keep track of the best path so far. */
 		uint dist = DistanceManhattan(tile, ttfd->dest_coords);
 		if (dist < ttfd->best_bird_dist) {
 			ttfd->best_bird_dist = dist;
@@ -2205,12 +2216,12 @@
 };
 
 static const byte _search_directions[6][4] = {
-	{ 0, 9, 2, 9 }, // track 1
-	{ 9, 1, 9, 3 }, // track 2
-	{ 9, 0, 3, 9 }, // track upper
-	{ 1, 9, 9, 2 }, // track lower
-	{ 3, 2, 9, 9 }, // track left
-	{ 9, 9, 1, 0 }, // track right
+	{ 0, 9, 2, 9 }, ///< track 1
+	{ 9, 1, 9, 3 }, ///< track 2
+	{ 9, 0, 3, 9 }, ///< track upper
+	{ 1, 9, 9, 2 }, ///< track lower
+	{ 3, 2, 9, 9 }, ///< track left
+	{ 9, 9, 1, 0 }, ///< track right
 };
 
 static const byte _pick_track_table[6] = {1, 3, 2, 2, 0, 0};
@@ -2219,7 +2230,7 @@
 static Track ChooseTrainTrack(Vehicle* v, TileIndex tile, DiagDirection enterdir, TrackBits tracks)
 {
 	Track best_track;
-	// pathfinders are able to tell that route was only 'guessed'
+	/* pathfinders are able to tell that route was only 'guessed' */
 	bool path_not_found = false;
 
 #ifdef PF_BENCHMARK
@@ -2250,9 +2261,9 @@
 		NPFFoundTargetData ftd = NPFRouteToStationOrTile(tile - TileOffsByDiagDir(enterdir), trackdir, &fstd, TRANSPORT_RAIL, v->owner, v->u.rail.compatible_railtypes);
 
 		if (ftd.best_trackdir == 0xff) {
-			/* We are already at our target. Just do something */
-			//TODO: maybe display error?
-			//TODO: go straight ahead if possible?
+			/* We are already at our target. Just do something
+			 * @todo maybe display error?
+			 * @todo: go straight ahead if possible? */
 			best_track = FindFirstTrack(tracks);
 		} else {
 			/* If ftd.best_bird_dist is 0, we found our target and ftd.best_trackdir contains
@@ -2280,11 +2291,11 @@
 		NewTrainPathfind(tile - TileOffsByDiagDir(enterdir), v->dest_tile,
 			v->u.rail.compatible_railtypes, enterdir, (NTPEnumProc*)NtpCallbFindStation, &fd);
 
-		// check whether the path was found or only 'guessed'
+		/* check whether the path was found or only 'guessed' */
 		if (fd.best_bird_dist != 0) path_not_found = true;
 
 		if (fd.best_track == 0xff) {
-			// blaha
+			/* blaha */
 			best_track = FindFirstTrack(tracks);
 		} else {
 			best_track = TrackdirToTrack(fd.best_track);
@@ -2293,13 +2304,13 @@
 		int time = NpfEndInterval(perf);
 		DEBUG(yapf, 4, "[NTPT] %d us - %d rounds - %d open - %d closed -- ", time, 0, 0, 0);
 	}
-	// handle "path not found" state
+	/* handle "path not found" state */
 	if (path_not_found) {
-		// PF didn't find the route
+		/* PF didn't find the route */
 		if (!HASBIT(v->u.rail.flags, VRF_NO_PATH_TO_DESTINATION)) {
-			// it is first time the problem occurred, set the "path not found" flag
+			/* it is first time the problem occurred, set the "path not found" flag */
 			SETBIT(v->u.rail.flags, VRF_NO_PATH_TO_DESTINATION);
-			// and notify user about the event
+			/* and notify user about the event */
 			if (_patches.lost_train_warn && v->owner == _local_player) {
 				SetDParam(0, v->unitnumber);
 				AddNewsItem(
@@ -2310,11 +2321,11 @@
 			}
 		}
 	} else {
-		// route found, is the train marked with "path not found" flag?
+		/* route found, is the train marked with "path not found" flag? */
 		if (HASBIT(v->u.rail.flags, VRF_NO_PATH_TO_DESTINATION)) {
-			// clear the flag as the PF's problem was solved
+			/* clear the flag as the PF's problem was solved */
 			CLRBIT(v->u.rail.flags, VRF_NO_PATH_TO_DESTINATION);
-			// can we also delete the "News" item somehow?
+			/* can we also delete the "News" item somehow? */
 		}
 	}
 
@@ -2440,14 +2451,14 @@
 		default: break;
 	}
 
-	// check if we've reached the waypoint?
+	/* check if we've reached the waypoint? */
 	bool at_waypoint = false;
 	if (v->current_order.type == OT_GOTO_WAYPOINT && v->tile == v->dest_tile) {
 		v->cur_order_index++;
 		at_waypoint = true;
 	}
 
-	// check if we've reached a non-stop station while TTDPatch nonstop is enabled..
+	/* check if we've reached a non-stop station while TTDPatch nonstop is enabled.. */
 	if (_patches.new_nonstop &&
 			v->current_order.flags & OF_NON_STOP &&
 			IsTileType(v->tile, MP_STATION) &&
@@ -2455,25 +2466,25 @@
 		v->cur_order_index++;
 	}
 
-	// Get the current order
+	/* Get the current order */
 	if (v->cur_order_index >= v->num_orders) v->cur_order_index = 0;
 
 	const Order *order = GetVehicleOrder(v, v->cur_order_index);
 
-	// If no order, do nothing.
+	/* If no order, do nothing. */
 	if (order == NULL) {
 		v->current_order.Free();
 		v->dest_tile = 0;
 		return false;
 	}
 
-	// If it is unchanged, keep it.
+	/* If it is unchanged, keep it. */
 	if (order->type  == v->current_order.type &&
 			order->flags == v->current_order.flags &&
 			order->dest  == v->current_order.dest)
 		return false;
 
-	// Otherwise set it, and determine the destination tile.
+	/* Otherwise set it, and determine the destination tile. */
 	v->current_order = *order;
 
 	v->dest_tile = 0;
@@ -2516,7 +2527,7 @@
 		case OT_LOADING: {
 			if (mode) return;
 
-			// don't mark the train as lost if we're loading on the final station.
+			/* don't mark the train as lost if we're loading on the final station. */
 			if (v->current_order.flags & OF_NON_STOP) {
 				v->u.rail.days_since_order_progr = 0;
 			}
@@ -2527,13 +2538,13 @@
 						v->current_order.flags & OF_FULL_LOAD ||
 						(_patches.gradual_loading && !HASBIT(v->vehicle_flags, VF_LOADING_FINISHED))
 					)) {
-				v->u.rail.days_since_order_progr = 0; /* Prevent a train lost message for full loading trains */
+				v->u.rail.days_since_order_progr = 0; // Prevent a train lost message for full loading trains
 				SET_EXPENSES_TYPE(EXPENSES_TRAIN_INC);
 				if (LoadUnloadVehicle(v, false)) {
 					InvalidateWindow(WC_TRAINS_LIST, v->owner);
 					MarkTrainDirty(v);
 
-					// need to update acceleration and cached values since the goods on the train changed.
+					/* need to update acceleration and cached values since the goods on the train changed. */
 					TrainCargoChanged(v);
 					UpdateTrainAcceleration(v);
 				}
@@ -2545,7 +2556,7 @@
 			Order b = v->current_order;
 			v->LeaveStation();
 
-			// If this was not the final order, don't remove it from the list.
+			/* If this was not the final order, don't remove it from the list. */
 			if (!(b.flags & OF_NON_STOP)) return;
 			break;
 		}
@@ -2614,16 +2625,16 @@
 		);
 	}
 
-	// Did we reach the final destination?
+	/* Did we reach the final destination? */
 	if (v->current_order.type == OT_GOTO_STATION &&
 			v->current_order.dest == station) {
-		// Yeah, keep the load/unload flags
-		// Non Stop now means if the order should be increased.
+		/* Yeah, keep the load/unload flags
+		 * Non Stop now means if the order should be increased. */
 		v->BeginLoading();
 		v->current_order.flags &= OF_FULL_LOAD | OF_UNLOAD | OF_TRANSFER;
 		v->current_order.flags |= OF_NON_STOP;
 	} else {
-		// No, just do a simple load
+		/* No, just do a simple load */
 		v->BeginLoading();
 		v->current_order.flags = 0;
 	}
@@ -2641,7 +2652,7 @@
 
 static byte AfterSetTrainPos(Vehicle *v, bool new_tile)
 {
-	// need this hint so it returns the right z coordinate on bridges.
+	/* need this hint so it returns the right z coordinate on bridges. */
 	byte new_z = GetSlopeZ(v->x_pos, v->y_pos);
 
 	byte old_z = v->z_pos;
@@ -2654,7 +2665,7 @@
 		if (new_z != old_z) {
 			TileIndex tile = TileVirtXY(v->x_pos, v->y_pos);
 
-			// XXX workaround, whole UP/DOWN detection needs overhaul
+			/* XXX workaround, whole UP/DOWN detection needs overhaul */
 			if (!IsTunnelTile(tile)) {
 				SETBIT(v->u.rail.flags, (new_z > old_z) ? VRF_GOINGUP : VRF_GOINGDOWN);
 			}
@@ -2727,13 +2738,13 @@
 
 static const RailtypeSlowdownParams _railtype_slowdown[] = {
 	// normal accel
-	{256 / 4, 256 / 2, 256 / 4, 2}, // normal
-	{256 / 4, 256 / 2, 256 / 4, 2}, // electrified
-	{256 / 4, 256 / 2, 256 / 4, 2}, // monorail
-	{0,       256 / 2, 256 / 4, 2}, // maglev
+	{256 / 4, 256 / 2, 256 / 4, 2}, ///< normal
+	{256 / 4, 256 / 2, 256 / 4, 2}, ///< electrified
+	{256 / 4, 256 / 2, 256 / 4, 2}, ///< monorail
+	{0,       256 / 2, 256 / 4, 2}, ///< maglev
 };
 
-/* Modify the speed of the vehicle due to a turn */
+/** Modify the speed of the vehicle due to a turn */
 static void AffectSpeedByDirChange(Vehicle* v, Direction new_dir)
 {
 	if (_patches.realistic_acceleration) return;
@@ -2745,7 +2756,7 @@
 	v->cur_speed -= (diff == DIRDIFF_45RIGHT || diff == DIRDIFF_45LEFT ? rsp->small_turn : rsp->large_turn) * v->cur_speed >> 8;
 }
 
-/* Modify the speed of the vehicle due to a change in altitude */
+/** Modify the speed of the vehicle due to a change in altitude */
 static void AffectSpeedByZChange(Vehicle *v, byte old_z)
 {
 	if (old_z == v->z_pos || _patches.realistic_acceleration) return;
@@ -2820,7 +2831,7 @@
 	return num;
 }
 
-/*
+/**
  * Checks whether the specified train has a collision with another vehicle. If
  * so, destroys this vehicle, and the other vehicle if its subtype has TS_Front.
  * Reports the incident in a flashy news item, modifies station ratings and
@@ -2848,10 +2859,10 @@
 			(v->u.rail.track == TRACK_BIT_WORMHOLE && (v->direction & 2) != (realcoll->direction & 2)))
 		return;
 
-	//two drivers + passangers killed in train v
+	/* two drivers + passangers killed in train v */
 	uint num = 2 + CountPassengersInTrain(v);
 	if (!(coll->vehstatus & VS_CRASHED))
-		//two drivers + passangers killed in train coll (if it was not crashed already)
+		/* two drivers + passangers killed in train coll (if it was not crashed already) */
 		num += 2 + CountPassengersInTrain(coll);
 
 	SetVehicleCrashed(v);
@@ -2959,8 +2970,8 @@
 
 					/* Check if it's a red signal and that force proceed is not clicked. */
 					if ((tracks >> 16) & chosen_track && v->u.rail.force_proceed == 0) {
-						// In front of a red signal
-						/* find the first set bit in ts. need to do it in 2 steps, since
+						/* In front of a red signal
+						 * find the first set bit in ts. need to do it in 2 steps, since
 						 * FIND_FIRST_BIT only handles 6 bits at a time. */
 						Trackdir i = FindFirstTrackdir((TrackdirBits)(uint16)ts);
 
@@ -3300,7 +3311,7 @@
 			return false;
 		}
 		if ((ts &= (ts >> 16)) == 0) {
-			// make a rail/road crossing red
+			/* make a rail/road crossing red */
 			if (IsLevelCrossingTile(tile)) {
 				if (!IsCrossingBarred(tile)) {
 					BarCrossing(tile);
@@ -3316,7 +3327,7 @@
 		return false;
 	}
 
-	// slow down
+	/* slow down */
 	v->vehstatus |= VS_TRAIN_SLOWING;
 	uint16 break_speed = _breakdown_speeds[x & 0xF];
 	if (!(v->direction & 1)) break_speed >>= 1;
@@ -3369,7 +3380,7 @@
 
 	int j = UpdateTrainSpeed(v);
 	if (j == 0) {
-		// if the vehicle has speed 0, update the last_speed field.
+		/* if the vehicle has speed 0, update the last_speed field. */
 		if (v->cur_speed != 0) return;
 	} else {
 		TrainCheckIfLineEnds(v);
@@ -3396,11 +3407,11 @@
 	if (IsFrontEngine(v)) {
 		TrainLocoHandler(v, false);
 
-		// make sure vehicle wasn't deleted.
+		/* make sure vehicle wasn't deleted. */
 		if (v->type == VEH_TRAIN && IsFrontEngine(v))
 			TrainLocoHandler(v, true);
 	} else if (IsFreeWagon(v) && HASBITS(v->vehstatus, VS_CRASHED)) {
-		// Delete flooded standalone wagon
+		/* Delete flooded standalone wagon */
 		if (++v->u.rail.crash_anim_pos >= 4400)
 			DeleteVehicle(v);
 	}
@@ -3415,8 +3426,8 @@
 	if (v->vehstatus & VS_STOPPED)                      return;
 	if (_patches.gotodepot && VehicleHasDepotOrders(v)) return;
 
-	// Don't interfere with a depot visit scheduled by the user, or a
-	// depot visit by the order list.
+	/* Don't interfere with a depot visit scheduled by the user, or a
+	 * depot visit by the order list. */
 	if (v->current_order.type == OT_GOTO_DEPOT &&
 			(v->current_order.flags & (OF_HALT_IN_DEPOT | OF_PART_OF_ORDERS)) != 0)
 		return;
@@ -3507,7 +3518,7 @@
 
 	FOR_ALL_VEHICLES(v) {
 		if (v->type == VEH_TRAIN && IsFrontEngine(v)) {
-			// show warning if train is not generating enough income last 2 years (corresponds to a red icon in the vehicle list)
+			/* show warning if train is not generating enough income last 2 years (corresponds to a red icon in the vehicle list) */
 			if (_patches.train_income_warn && v->owner == _local_player && v->age >= 730 && v->profit_this_year < 0) {
 				SetDParam(1, v->profit_this_year);
 				SetDParam(0, v->unitnumber);
@@ -3579,7 +3590,7 @@
 	}
 }
 
-/*
+/**
  *  Converts all trains to the new subtype format introduced in savegame 16.2
  *  It also links multiheaded engines or make them forget they are multiheaded if no suitable partner is found
  */
--- a/src/train_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/train_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file train_gui.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
@@ -22,7 +24,7 @@
 
 	if (!success) return;
 
-	// find a locomotive in the depot.
+	/* find a locomotive in the depot. */
 	found = NULL;
 	FOR_ALL_VEHICLES(v) {
 		if (v->type == VEH_TRAIN && IsFrontEngine(v) &&
@@ -33,10 +35,10 @@
 		}
 	}
 
-	// if we found a loco,
+	/* if we found a loco, */
 	if (found != NULL) {
 		found = GetLastVehicleInChain(found);
-		// put the new wagon at the end of the loco.
+		/* put the new wagon at the end of the loco. */
 		DoCommandP(0, _new_vehicle_id | (found->index << 16), 0, NULL, CMD_MOVE_RAIL_VEHICLE);
 		RebuildVehicleLists();
 	}
@@ -447,7 +449,7 @@
 	y = 57;
 	sel = w->vscroll.pos;
 
-	// draw the first 3 details tabs
+	/* draw the first 3 details tabs */
 	if (det_tab != 3) {
 		x = 1;
 		for (;;) {
@@ -470,7 +472,7 @@
 					default: NOT_REACHED();
 					case 0: TrainDetailsCargoTab(   v, px, py); break;
 					case 1:
-						// Only show name and value for the 'real' part
+						/* Only show name and value for the 'real' part */
 						if (!IsArticulatedPart(v)) {
 							TrainDetailsInfoTab(v, px, py);
 						}
@@ -481,7 +483,7 @@
 
 				v = u;
 			} else {
-				// Move to the next line
+				/* Move to the next line */
 				do {
 					v = v->next;
 				} while (v != NULL && IsArticulatedPart(v) && v->cargo_cap == 0);
@@ -489,7 +491,7 @@
 			if (v == NULL) return;
 		}
 	} else {
-		// draw total cargo tab
+		/* draw total cargo tab */
 		DrawString(x, y + 2, STR_013F_TOTAL_CAPACITY_TEXT, 0);
 		for (CargoID i = 0; i < NUM_CARGO; i++) {
 			if (max_cargo[i] > 0 && --sel < 0 && sel > -w->vscroll.cap) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/transparency_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -0,0 +1,68 @@
+/* $Id$ */
+
+#include "stdafx.h"
+#include "openttd.h"
+#include "table/sprites.h"
+#include "table/strings.h"
+#include "functions.h"
+#include "window.h"
+#include "gui.h"
+#include "viewport.h"
+#include "gfx.h"
+#include "sound.h"
+#include "variables.h"
+
+static void Transparent_Click(byte widget)
+{
+	TOGGLEBIT(_transparent_opt, widget);
+	SndPlayFx(SND_15_BEEP);
+}
+
+static void TransparencyToolbWndProc(Window *w, WindowEvent *e)
+{
+	switch (e->event) {
+		case WE_PAINT:
+			for (uint i = 0; i < 7; i++) {
+				SetWindowWidgetLoweredState(w, i + 3, HASBIT(_transparent_opt, i));
+			}
+			DrawWindowWidgets(w);
+			break;
+
+		case WE_CLICK:
+			if (e->we.click.widget >= 3) {
+				Transparent_Click(e->we.click.widget - 3);
+				MarkWholeScreenDirty();
+			}
+			break;
+	}
+}
+
+static const Widget _transparency_widgets[] = {
+{ WWT_CLOSEBOX,   RESIZE_NONE,  7,   0,  10,   0,  13, STR_00C5,                 STR_018B_CLOSE_WINDOW},
+{  WWT_CAPTION,   RESIZE_NONE,  7,  11, 162,   0,  13, STR_TRANSPARENCY_TOOLB,   STR_018C_WINDOW_TITLE_DRAG_THIS},
+{WWT_STICKYBOX,   RESIZE_NONE,  7, 163, 174,   0,  13, STR_NULL,                 STR_STICKY_BUTTON},
+
+/* transparency widgets: transparent signs, trees, houses, industries, player's buildings */
+{   WWT_IMGBTN,   RESIZE_NONE,  7,   0,  21,  14,  35, SPR_IMG_PLACE_SIGN,   STR_TRANSPARENT_SIGNS_DESC},
+{   WWT_IMGBTN,   RESIZE_NONE,  7,  22,  43,  14,  35, SPR_IMG_PLANTTREES,   STR_TRANSPARENT_TREES_DESC},
+{   WWT_IMGBTN,   RESIZE_NONE,  7,  44,  65,  14,  35, SPR_IMG_TOWN,         STR_TRANSPARENT_HOUSES_DESC},
+{   WWT_IMGBTN,   RESIZE_NONE,  7,  66,  87,  14,  35, SPR_IMG_INDUSTRY,     STR_TRANSPARENT_INDUSTRIES_DESC},
+{   WWT_IMGBTN,   RESIZE_NONE,  7,  88, 109,  14,  35, SPR_IMG_COMPANY_LIST, STR_TRANSPARENT_BUILDINGS_DESC},
+{   WWT_IMGBTN,   RESIZE_NONE,  7, 110, 152,  14,  35, SPR_IMG_BRIDGE,       STR_TRANSPARENT_BRIDGES_DESC},
+{   WWT_IMGBTN,   RESIZE_NONE,  7, 153, 174,  14,  35, SPR_IMG_TRANSMITTER,  STR_TRANSPARENT_STRUCTURES_DESC},
+
+{   WIDGETS_END},
+};
+
+static const WindowDesc _transparency_desc = {
+	WDP_ALIGN_TBR, 58+36, 175, 36,
+	WC_TRANSPARENCY_TOOLBAR, WC_NONE,
+	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
+	_transparency_widgets,
+	TransparencyToolbWndProc
+};
+
+void ShowTransparencyToolbar(void)
+{
+	AllocateWindowDescFront(&_transparency_desc, 0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/transparency_gui.h	Sun Apr 08 14:46:55 2007 +0000
@@ -0,0 +1,8 @@
+/* $Id$ */
+
+#ifndef TRANSPARENCY_GUI_H
+#define TRANSPARENCY_GUI_H
+
+void ShowTransparencyToolbar();
+
+#endif /* TRANSPARENCY_GUI_H */
--- a/src/tree_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/tree_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file tree_cmd.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "bridge_map.h"
@@ -53,7 +55,7 @@
 	if (tree != TREE_INVALID) {
 		MakeTree(tile, tree, GB(r, 22, 2), min(GB(r, 16, 3), 6), TREE_GROUND_GRASS, 0);
 
-		// above snowline?
+		/* above snowline? */
 		if (_opt.landscape == LT_ARCTIC && GetTileZ(tile) > GetSnowLine()) {
 			SetTreeGroundDensity(tile, TREE_GROUND_SNOW_DESERT, 3);
 			SetTreeCounter(tile, (TreeGround)GB(r, 24, 3));
@@ -207,6 +209,7 @@
 
 /** Plant a tree.
  * @param tile start tile of area-drag of tree plantation
+ * @param flags type of operation
  * @param p1 tree type, -1 means random.
  * @param p2 end tile of area-drag
  */
@@ -240,7 +243,7 @@
 
 			switch (GetTileType(tile)) {
 				case MP_TREES:
-					// no more space for trees?
+					/* no more space for trees? */
 					if (_game_mode != GM_EDITOR && GetTreeCount(tile) == 3) {
 						msg = STR_2803_TREE_ALREADY_HERE;
 						continue;
@@ -250,7 +253,7 @@
 						AddTreeCount(tile, 1);
 						MarkTileDirtyByTile(tile);
 					}
-					// 2x as expensive to add more trees to an existing tile
+					/* 2x as expensive to add more trees to an existing tile */
 					cost += _price.build_trees * 2;
 					break;
 
@@ -365,7 +368,7 @@
 
 	StartSpriteCombine();
 
-	if (!(_display_opt & DO_TRANS_BUILDINGS) || !_patches.invisible_trees) {
+	if (!HASBIT(_transparent_opt, TO_TREES) || !_patches.invisible_trees) {
 		TreeListEnt te[4];
 		uint i;
 
@@ -374,7 +377,7 @@
 		do {
 			SpriteID image = s[0].sprite + (--i == 0 ? GetTreeGrowth(ti->tile) : 3);
 			SpriteID pal;
-			if (_display_opt & DO_TRANS_BUILDINGS) {
+			if (HASBIT(_transparent_opt, TO_TREES)) {
 				SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 				pal = PALETTE_TO_TRANSPARENT;
 			} else {
@@ -622,7 +625,7 @@
 		MakeTree(tile, tree, 0, 0, ct == CLEAR_ROUGH ? TREE_GROUND_ROUGH : TREE_GROUND_GRASS, 0);
 	}
 
-	// byte underflow
+	/* byte underflow */
 	if (--_trees_tick_ctr != 0) return;
 
 	/* place a tree at a random spot */
--- a/src/tree_map.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/tree_map.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file tree_map.h */
+
 #ifndef TREE_MAP_H
 #define TREE_MAP_H
 
@@ -26,9 +28,9 @@
 /* ground type, m2 bits 4...5
  * valid densities (bits 6...7) in comments after the enum */
 enum TreeGround {
-	TREE_GROUND_GRASS       = 0, // 0
-	TREE_GROUND_ROUGH       = 1, // 0
-	TREE_GROUND_SNOW_DESERT = 2  // 0-3 for snow, 3 for desert
+	TREE_GROUND_GRASS       = 0, ///< 0
+	TREE_GROUND_ROUGH       = 1, ///< 0
+	TREE_GROUND_SNOW_DESERT = 2  ///< 0-3 for snow, 3 for desert
 };
 
 
--- a/src/tunnel_map.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/tunnel_map.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file tunnel_map.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "tile.h"
--- a/src/tunnel_map.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/tunnel_map.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file tunnel_map.h */
+
 #ifndef TUNNEL_MAP_H
 #define TUNNEL_MAP_H
 
--- a/src/tunnelbridge_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/tunnelbridge_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -61,8 +61,9 @@
 Bridge _bridge[MAX_BRIDGES];
 
 
-// calculate the price factor for building a long bridge.
-// basically the cost delta is 1,1, 1, 2,2, 3,3,3, 4,4,4,4, 5,5,5,5,5, 6,6,6,6,6,6,  7,7,7,7,7,7,7,  8,8,8,8,8,8,8,8,
+/** calculate the price factor for building a long bridge.
+ * basically the cost delta is 1,1, 1, 2,2, 3,3,3, 4,4,4,4, 5,5,5,5,5, 6,6,6,6,6,6,  7,7,7,7,7,7,7,  8,8,8,8,8,8,8,8,
+ */
 int CalcBridgeLenCostFactor(int x)
 {
 	int n;
@@ -79,11 +80,11 @@
 
 #define M(x) (1 << (x))
 enum BridgeFoundation {
-	// foundation, whole tile is leveled up --> 3 corners raised
+	/* foundation, whole tile is leveled up --> 3 corners raised */
 	BRIDGE_FULL_LEVELED_FOUNDATION = M(SLOPE_WSE) | M(SLOPE_NWS) | M(SLOPE_ENW) | M(SLOPE_SEN),
-	// foundation, tile is partly leveled up --> 1 corner raised
+	/* foundation, tile is partly leveled up --> 1 corner raised */
 	BRIDGE_PARTLY_LEVELED_FOUNDATION = M(SLOPE_W) | M(SLOPE_S) | M(SLOPE_E) | M(SLOPE_N),
-	// no foundations (X,Y direction)
+	/* no foundations (X,Y direction) */
 	BRIDGE_NO_FOUNDATION = M(SLOPE_FLAT) | M(SLOPE_SW) | M(SLOPE_SE) | M(SLOPE_NW) | M(SLOPE_NE),
 	BRIDGE_HORZ_RAMP = (BRIDGE_PARTLY_LEVELED_FOUNDATION | BRIDGE_NO_FOUNDATION) & ~M(SLOPE_FLAT)
 };
@@ -167,6 +168,7 @@
 
 /** Build a Bridge
  * @param end_tile end tile
+ * @param flags type of operation
  * @param p1 packed start tile coords (~ dx)
  * @param p2 various bitstuffed elements
  * - p2 = (bit 0- 7) - bridge type (hi bh)
@@ -202,7 +204,7 @@
 
 	if (p1 >= MapSize()) return CMD_ERROR;
 
-	// type of bridge
+	/* type of bridge */
 	if (HASBIT(p2, 15)) {
 		railtype = INVALID_RAILTYPE; // road bridge
 	} else {
@@ -255,7 +257,7 @@
 
 	if (z_start != z_end) return_cmd_error(STR_5009_LEVEL_LAND_OR_WATER_REQUIRED);
 
-	// Towns are not allowed to use bridges on slopes.
+	/* Towns are not allowed to use bridges on slopes. */
 	allow_on_slopes = ( _current_player != OWNER_TOWN && _patches.build_on_slopes);
 
 	TransportType transport_type = railtype == INVALID_RAILTYPE ? TRANSPORT_ROAD : TRANSPORT_RAIL;
@@ -314,7 +316,7 @@
 		if (CmdFailed(ret)) return ret;
 		cost += ret;
 
-		// false - end tile slope check
+		/* false - end tile slope check */
 		terraformcost = CheckBridgeSlopeSouth(direction, tileh_end);
 		if (CmdFailed(terraformcost) || (terraformcost != 0 && !allow_on_slopes))
 			return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
@@ -438,6 +440,7 @@
 
 /** Build Tunnel.
  * @param tile start tile of tunnel
+ * @param flags type of operation
  * @param p1 railtype, 0x200 for road tunnel
  * @param p2 unused
  */
@@ -495,10 +498,10 @@
 	/* Add the cost of the entrance */
 	cost += _price.build_tunnel + ret;
 
-	// if the command fails from here on we want the end tile to be highlighted
+	/* if the command fails from here on we want the end tile to be highlighted */
 	_build_tunnel_endtile = end_tile;
 
-	// slope of end tile must be complementary to the slope of the start tile
+	/* slope of end tile must be complementary to the slope of the start tile */
 	if (end_tileh != ComplementSlope(start_tileh)) {
 		ret = DoCommand(end_tile, end_tileh & start_tileh, 0, flags, CMD_TERRAFORM_LAND);
 		if (CmdFailed(ret)) return_cmd_error(STR_5005_UNABLE_TO_EXCAVATE_LAND);
@@ -590,12 +593,12 @@
 	}
 
 	if (flags & DC_EXEC) {
-		// We first need to request the direction before calling DoClearSquare
-		//  else the direction is always 0.. dah!! ;)
+		/* We first need to request the direction before calling DoClearSquare
+		 *  else the direction is always 0.. dah!! ;) */
 		DiagDirection dir = GetTunnelDirection(tile);
 		Track track;
 
-		// Adjust the town's player rating. Do this before removing the tile owner info.
+		/* Adjust the town's player rating. Do this before removing the tile owner info. */
 		if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR)
 			ChangeTownRating(t, RATING_TUNNEL_BRIDGE_DOWN_STEP, RATING_TUNNEL_BRIDGE_MINIMUM);
 
@@ -636,8 +639,8 @@
 
 	endtile = GetOtherBridgeEnd(tile);
 
-	if (!EnsureNoVehicle(tile) ||
-			!EnsureNoVehicle(endtile) ||
+	if (!EnsureNoVehicleOnGround(tile) ||
+			!EnsureNoVehicleOnGround(endtile) ||
 			IsVehicleOnBridge(tile, endtile, GetBridgeHeight(tile))) {
 		return CMD_ERROR;
 	}
@@ -660,8 +663,8 @@
 		TileIndex c;
 		Track track;
 
-		//checks if the owner is town then decrease town rating by RATING_TUNNEL_BRIDGE_DOWN_STEP until
-		// you have a "Poor" (0) town rating
+		/* checks if the owner is town then decrease town rating by RATING_TUNNEL_BRIDGE_DOWN_STEP until
+		 * you have a "Poor" (0) town rating */
 		if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR)
 			ChangeTownRating(t, RATING_TUNNEL_BRIDGE_DOWN_STEP, RATING_TUNNEL_BRIDGE_MINIMUM);
 
@@ -716,7 +719,7 @@
 
 		if (GetRailType(tile) == totype) return CMD_ERROR;
 
-		// 'hidden' elrails can't be downgraded to normal rail when elrails are disabled
+		/* 'hidden' elrails can't be downgraded to normal rail when elrails are disabled */
 		if (_patches.disable_elrails && totype == RAILTYPE_RAIL && GetRailType(tile) == RAILTYPE_ELECTRIC) return CMD_ERROR;
 
 		endtile = CheckTunnelBusy(tile, &length);
@@ -740,8 +743,8 @@
 
 		endtile = GetOtherBridgeEnd(tile);
 
-		if (!EnsureNoVehicle(tile) ||
-				!EnsureNoVehicle(endtile) ||
+		if (!EnsureNoVehicleOnGround(tile) ||
+				!EnsureNoVehicleOnGround(endtile) ||
 				IsVehicleOnBridge(tile, endtile, GetBridgeHeight(tile))) {
 			return CMD_ERROR;
 		}
@@ -791,7 +794,7 @@
 			{ 2, 4, 8, 1,   2, 16, 9, 0 }
 		};
 
-		if (_display_opt & DO_TRANS_BUILDINGS) {
+		if (HASBIT(_transparent_opt, TO_BRIDGES)) {
 			SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 			pal = PALETTE_TO_TRANSPARENT;
 		} else {
@@ -828,7 +831,7 @@
 
 	if (HASBIT(BRIDGE_FULL_LEVELED_FOUNDATION, tileh)) return tileh;
 
-	// inclined sloped building
+	/* inclined sloped building */
 	switch (tileh) {
 		case SLOPE_W:
 		case SLOPE_STEEP_W: i = 0; break;
@@ -849,6 +852,7 @@
  * For tunnels, this is rather simple, as you only needa draw the entrance.
  * Bridges are a bit more complex. base_offset is where the sprite selection comes into play
  * and it works a bit like a bitmask.<p> For bridge heads:
+ * @param ti TileInfo of the structure to draw
  * <ul><li>Bit 0: direction</li>
  * <li>Bit 1: northern or southern heads</li>
  * <li>Bit 2: Set if the bridge head is sloped</li>
@@ -883,7 +887,7 @@
 
 		if (GetBridgeTransportType(ti->tile) == TRANSPORT_RAIL) {
 			base_offset = GetRailTypeInfo(GetRailType(ti->tile))->bridge_offset;
-			assert(base_offset != 8); /* This one is used for roads */
+			assert(base_offset != 8); // This one is used for roads
 		} else {
 			base_offset = 8;
 		}
@@ -896,7 +900,7 @@
 			if (f != 0) DrawFoundation(ti, f);
 		}
 
-		// HACK Wizardry to convert the bridge ramp direction into a sprite offset
+		/* HACK Wizardry to convert the bridge ramp direction into a sprite offset */
 		base_offset += (6 - GetBridgeRampDirection(ti->tile)) % 4;
 
 		if (ti->tileh == SLOPE_FLAT) base_offset += 4; // sloped bridge head
@@ -914,8 +918,8 @@
 
 		image = psid->sprite;
 
-		// draw ramp
-		if (_display_opt & DO_TRANS_BUILDINGS) {
+		/* draw ramp */
+		if (HASBIT(_transparent_opt, TO_BRIDGES)) {
 			SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 			pal = PALETTE_TO_TRANSPARENT;
 		} else {
@@ -1007,7 +1011,7 @@
 	z = GetBridgeHeight(rampsouth) - 3;
 
 	image = psid->sprite;
-	if (_display_opt & DO_TRANS_BUILDINGS) {
+	if (HASBIT(_transparent_opt, TO_BRIDGES)) {
 		SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 		pal = PALETTE_TO_TRANSPARENT;
 	} else {
@@ -1022,14 +1026,14 @@
 
 	psid++;
 	image = psid->sprite;
-	if (_display_opt & DO_TRANS_BUILDINGS) {
+	if (HASBIT(_transparent_opt, TO_BRIDGES)) {
 		SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 		pal = PALETTE_TO_TRANSPARENT;
 	} else {
 		pal = psid->pal;
 	}
 
-	// draw roof, the component of the bridge which is logically between the vehicle and the camera
+	/* draw roof, the component of the bridge which is logically between the vehicle and the camera */
 	if (axis == AXIS_X) {
 		y += 12;
 		if (image & SPRITE_MASK) AddSortableSpriteToDraw(image, pal, x, y, 16, 1, 0x28, z);
@@ -1042,10 +1046,10 @@
 
 	psid++;
 	if (ti->z + 5 == z) {
-		// draw poles below for small bridges
+		/* draw poles below for small bridges */
 		if (psid->sprite != 0) {
 			image = psid->sprite;
-			if (_display_opt & DO_TRANS_BUILDINGS) {
+			if (HASBIT(_transparent_opt, TO_BRIDGES)) {
 				SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 				pal = PALETTE_TO_TRANSPARENT;
 			} else {
@@ -1055,7 +1059,7 @@
 			DrawGroundSpriteAt(image, pal, x, y, z);
 		}
 	} else if (_patches.bridge_pillars) {
-		// draw pillars below for high bridges
+		/* draw pillars below for high bridges */
 		DrawBridgePillars(psid, ti, axis, type, x, y, z);
 	}
 }
@@ -1072,13 +1076,13 @@
 	if (IsTunnel(tile)) {
 		uint pos = (DiagDirToAxis(GetTunnelDirection(tile)) == AXIS_X ? y : x);
 
-		// In the tunnel entrance?
+		/* In the tunnel entrance? */
 		if (5 <= pos && pos <= 10) return z;
 	} else {
 		DiagDirection dir = GetBridgeRampDirection(tile);
 		uint pos = (DiagDirToAxis(dir) == AXIS_X ? y : x);
 
-		// On the bridge ramp?
+		/* On the bridge ramp? */
 		if (5 <= pos && pos <= 10) {
 			uint delta;
 
@@ -1301,7 +1305,7 @@
 			dir = GetTunnelDirection(tile);
 			vdir = DirToDiagDir(v->direction);
 
-			// Enter tunnel?
+			/* Enter tunnel? */
 			if (v->u.road.state != RVSB_WORMHOLE && dir == vdir) {
 				if (fc == _tunnel_fractcoord_4[dir] ||
 						fc == _tunnel_fractcoord_5[dir]) {
--- a/src/unix.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/unix.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file unix.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "functions.h"
@@ -27,7 +29,7 @@
 #include <exec/types.h>
 ULONG __stack = (1024*1024)*2; // maybe not that much is needed actually ;)
 
-// The system supplied definition of SIG_IGN does not match
+/* The system supplied definition of SIG_IGN does not match */
 #undef SIG_IGN
 #define SIG_IGN (void (*)(int))1
 #endif /* __MORPHOS__ */
@@ -39,7 +41,7 @@
 
 #if defined(__APPLE__)
 	#if defined(WITH_SDL)
-		//the mac implementation needs this file included in the same file as main()
+		/*the mac implementation needs this file included in the same file as main() */
 		#include <SDL.h>
 	#endif
 #endif
@@ -104,11 +106,11 @@
 void ShowOSErrorBox(const char *buf)
 {
 #if defined(__APPLE__)
-	// this creates an NSAlertPanel with the contents of 'buf'
-	// this is the native and nicest way to do this on OSX
+	/* this creates an NSAlertPanel with the contents of 'buf'
+	 * this is the native and nicest way to do this on OSX */
 	ShowMacDialog( buf, "See readme for more info\nMost likely you are missing files from the original TTD", "Quit" );
 #else
-	// all systems, but OSX
+	/* all systems, but OSX */
 	fprintf(stderr, "\033[1;31mError: %s\033[0;39m\n", buf);
 #endif
 }
@@ -151,10 +153,10 @@
 }
 
 
-// multi os compatible sleep function
+/* multi os compatible sleep function */
 
 #ifdef __AMIGA__
-// usleep() implementation
+/* usleep() implementation */
 #	include <devices/timer.h>
 #	include <dos/dos.h>
 
@@ -174,7 +176,7 @@
 		ULONG signals;
 		ULONG TimerSigBit = 1 << TimerPort->mp_SigBit;
 
-		// send IORequest
+		/* send IORequest */
 		TimerRequest->tr_node.io_Command = TR_ADDREQUEST;
 		TimerRequest->tr_time.tv_secs    = (milliseconds * 1000) / 1000000;
 		TimerRequest->tr_time.tv_micro   = (milliseconds * 1000) % 1000000;
@@ -243,7 +245,7 @@
 	}
 
 	*outbuf = '\0';
-	// FIX: invalid characters will abort conversion, but they shouldn't occur?
+	/* FIX: invalid characters will abort conversion, but they shouldn't occur? */
 	return buf;
 }
 
--- a/src/unmovable.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/unmovable.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file unmovable.h */
+
 #ifndef UNMOVABLE_H
 #define UNMOVABLE_H
 
--- a/src/unmovable_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/unmovable_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file unmovable_cmd.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "table/strings.h"
@@ -44,7 +46,7 @@
 		InvalidateWindow(WC_COMPANY, pid);
 	}
 
-	// cost of relocating company is 1% of company value
+	/* cost of relocating company is 1% of company value */
 	return CalculateCompanyValue(p) / 100;
 }
 
@@ -69,12 +71,14 @@
 	MarkTileDirtyByTile(tile + TileDiffXY(1, 1));
 }
 
+extern int32 CheckFlatLandBelow(TileIndex tile, uint w, uint h, uint flags, uint invalid_dirs, StationID* station);
+
 /** Build or relocate the HQ. This depends if the HQ is already built or not
  * @param tile tile where the HQ will be built or relocated to
+ * @param flags type of operation
  * @param p1 unused
  * @param p2 unused
  */
-extern int32 CheckFlatLandBelow(TileIndex tile, uint w, uint h, uint flags, uint invalid_dirs, StationID* station);
 int32 CmdBuildCompanyHQ(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	Player *p = GetPlayer(_current_player);
@@ -87,7 +91,7 @@
 	if (CmdFailed(ret)) return ret;
 	cost = ret;
 
-	if (p->location_of_house != 0) { /* Moving HQ */
+	if (p->location_of_house != 0) { // Moving HQ
 		cost += DestroyCompanyHQ(_current_player, flags);
 	}
 
@@ -121,7 +125,7 @@
 			dtus = &_draw_tile_unmovable_data[GetUnmovableType(ti->tile)];
 
 			image = dtus->image;
-			if (_display_opt & DO_TRANS_BUILDINGS) {
+			if (HASBIT(_transparent_opt, TO_STRUCTURES)) {
 				SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 				pal = PALETTE_TO_TRANSPARENT;
 			} else {
@@ -139,7 +143,7 @@
 			DrawGroundSprite(SPR_CONCRETE_GROUND, PAL_NONE);
 
 			image = SPR_STATUE_COMPANY;
-			if (_display_opt & DO_TRANS_BUILDINGS) {
+			if (HASBIT(_transparent_opt, TO_STRUCTURES)) {
 				SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 				pal = PALETTE_TO_TRANSPARENT;
 			} else {
@@ -175,7 +179,7 @@
 
 			foreach_draw_tile_seq(dtss, t->seq) {
 				image = dtss->image;
-				if (_display_opt & DO_TRANS_BUILDINGS) {
+				if (HASBIT(_transparent_opt, TO_STRUCTURES)) {
 					SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 					pal = PALETTE_TO_TRANSPARENT;
 				} else {
@@ -224,7 +228,7 @@
 		return DoCommand(tile, 0, 0, flags, CMD_SELL_LAND_AREA);
 	}
 
-	// checks if you're allowed to remove unmovable things
+	/* checks if you're allowed to remove unmovable things */
 	if (_game_mode != GM_EDITOR && _current_player != OWNER_WATER && ((flags & DC_AUTO || !_cheats.magic_bulldozer.value)) )
 		return_cmd_error(STR_5800_OBJECT_IN_THE_WAY);
 
@@ -252,14 +256,14 @@
 
 	level = GetCompanyHQSize(tile) + 1;
 
-	// Top town building generates 10, so to make HQ interesting, the top
-	// type makes 20.
+	/* Top town building generates 10, so to make HQ interesting, the top
+	 * type makes 20. */
 	ac[CT_PASSENGERS] = max(1U, level);
 
-	// Top town building generates 4, HQ can make up to 8. The
-	// proportion passengers:mail is different because such a huge
-	// commercial building generates unusually high amount of mail
-	// correspondence per physical visitor.
+	/* Top town building generates 4, HQ can make up to 8. The
+	 * proportion passengers:mail is different because such a huge
+	 * commercial building generates unusually high amount of mail
+	 * correspondence per physical visitor. */
 	ac[CT_MAIL] = max(1U, level / 2);
 }
 
@@ -295,16 +299,16 @@
 	assert(level < 6);
 
 	r = Random();
-	// Top town buildings generate 250, so the top HQ type makes 256.
+	/* Top town buildings generate 250, so the top HQ type makes 256. */
 	if (GB(r, 0, 8) < (256 / 4 / (6 - level))) {
 		uint amt = GB(r, 0, 8) / 8 / 4 + 1;
 		if (_economy.fluct <= 0) amt = (amt + 1) >> 1;
 		MoveGoodsToStation(tile, 2, 2, CT_PASSENGERS, amt);
 	}
 
-	// Top town building generates 90, HQ can make up to 196. The
-	// proportion passengers:mail is about the same as in the acceptance
-	// equations.
+	/* Top town building generates 90, HQ can make up to 196. The
+	 * proportion passengers:mail is about the same as in the acceptance
+	 * equations. */
 	if (GB(r, 8, 8) < (196 / 4 / (6 - level))) {
 		uint amt = GB(r, 8, 8) / 8 / 4 + 1;
 		if (_economy.fluct <= 0) amt = (amt + 1) >> 1;
--- a/src/unmovable_map.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/unmovable_map.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file unmovable_map.h */
+
 #ifndef UNMOVABLE_MAP_H
 #define UNMOVABLE_MAP_H
 
--- a/src/variables.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/variables.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,18 +1,20 @@
 /* $Id$ */
 
+/** @file variables.h */
+
 #ifndef VARIABLES_H
 #define VARIABLES_H
 
 #include "yapf/yapf_settings.h"
 
-// ********* START OF SAVE REGION
+/* ********* START OF SAVE REGION */
 #if !defined(MAX_PATH)
 # define MAX_PATH 260
 #endif
 
 #include "gfx.h"
 
-// Prices and also the fractional part.
+/* Prices and also the fractional part. */
 VARDEF Prices _price;
 VARDEF uint16 _price_frac[NUM_PRICES];
 
@@ -38,47 +40,47 @@
 /* These are the default options for a new game */
 VARDEF GameOptions _opt_newgame;
 
-// Pointer to one of the two _opt OR _opt_newgame structs
+/* Pointer to one of the two _opt OR _opt_newgame structs */
 VARDEF GameOptions *_opt_ptr;
 
-// Amount of game ticks
+/* Amount of game ticks */
 VARDEF uint16 _tick_counter;
 
-// This one is not used anymore.
+/* This one is not used anymore. */
 VARDEF VehicleID _vehicle_id_ctr_day;
 
-// Skip aging of cargo?
+/* Skip aging of cargo? */
 VARDEF byte _age_cargo_skip_counter;
 
-// Position in tile loop
+/* Position in tile loop */
 VARDEF TileIndex _cur_tileloop_tile;
 
-// Also save scrollpos_x, scrollpos_y and zoom
+/* Also save scrollpos_x, scrollpos_y and zoom */
 VARDEF uint16 _disaster_delay;
 
-// Determines what station to operate on in the
-//  tick handler.
+/* Determines what station to operate on in the
+ *  tick handler. */
 VARDEF uint16 _station_tick_ctr;
 
 VARDEF uint32 _random_seeds[2][2];
 
-// Iterator through all towns in OnTick_Town
+/* Iterator through all towns in OnTick_Town */
 VARDEF uint32 _cur_town_ctr;
-// Frequency iterator at the same place
+/* Frequency iterator at the same place */
 VARDEF uint32 _cur_town_iter;
 
 VARDEF uint _cur_player_tick_index;
 VARDEF uint _next_competitor_start;
 
-// Determines how often to run the tree loop
+/* Determines how often to run the tree loop */
 VARDEF byte _trees_tick_ctr;
 
-// Keep track of current game position
+/* Keep track of current game position */
 VARDEF int _saved_scrollpos_x;
 VARDEF int _saved_scrollpos_y;
 VARDEF byte _saved_scrollpos_zoom;
 
-// ********* END OF SAVE REGION
+/* ********* END OF SAVE REGION */
 
 struct Patches {
 	bool modified_catchment;            // different-size catchment areas
@@ -200,22 +202,22 @@
 	 */
 	uint32 npf_max_search_nodes;
 
-	uint32 npf_rail_firstred_penalty;      /* The penalty for when the first signal is red (and it is not an exit or combo signal) */
-	uint32 npf_rail_firstred_exit_penalty; /* The penalty for when the first signal is red (and it is an exit or combo signal) */
-	uint32 npf_rail_lastred_penalty;       /* The penalty for when the last signal is red */
-	uint32 npf_rail_station_penalty;       /* The penalty for station tiles */
-	uint32 npf_rail_slope_penalty;         /* The penalty for sloping upwards */
-	uint32 npf_rail_curve_penalty;         /* The penalty for curves */
-	uint32 npf_rail_depot_reverse_penalty; /* The penalty for reversing in depots */
-	uint32 npf_buoy_penalty;               /* The penalty for going over (through) a buoy */
-	uint32 npf_water_curve_penalty;        /* The penalty for curves */
-	uint32 npf_road_curve_penalty;         /* The penalty for curves */
-	uint32 npf_crossing_penalty;           /* The penalty for level crossings */
-	uint32 npf_road_drive_through_penalty; /* The penalty for going through a drive-through road stop */
+	uint32 npf_rail_firstred_penalty;      // The penalty for when the first signal is red (and it is not an exit or combo signal)
+	uint32 npf_rail_firstred_exit_penalty; // The penalty for when the first signal is red (and it is an exit or combo signal)
+	uint32 npf_rail_lastred_penalty;       // The penalty for when the last signal is red
+	uint32 npf_rail_station_penalty;       // The penalty for station tiles
+	uint32 npf_rail_slope_penalty;         // The penalty for sloping upwards
+	uint32 npf_rail_curve_penalty;         // The penalty for curves
+	uint32 npf_rail_depot_reverse_penalty; // The penalty for reversing in depots
+	uint32 npf_buoy_penalty;               // The penalty for going over (through) a buoy
+	uint32 npf_water_curve_penalty;        // The penalty for curves
+	uint32 npf_road_curve_penalty;         // The penalty for curves
+	uint32 npf_crossing_penalty;           // The penalty for level crossings
+	uint32 npf_road_drive_through_penalty; // The penalty for going through a drive-through road stop
 
 	bool population_in_label; // Show the population of a town in his label?
 
-	uint8 freight_trains; ///< Value to multiply the weight of cargo by
+	uint8 freight_trains; // Value to multiply the weight of cargo by
 
 	/** YAPF settings */
 	YapfSettings  yapf;
@@ -233,9 +235,9 @@
 };
 
 
-// WARNING! Do _not_ remove entries in Cheats struct or change the order
-// of the existing ones! Would break downward compatibility.
-// Only add new entries at the end of the struct!
+/* WARNING! Do _not_ remove entries in Cheats struct or change the order
+ * of the existing ones! Would break downward compatibility.
+ * Only add new entries at the end of the struct! */
 
 struct Cheats {
 	Cheat magic_bulldozer;  // dynamite industries, unmovables
@@ -267,7 +269,7 @@
 
 VARDEF Paths _paths;
 
-// NOSAVE: Used in palette animations only, not really important.
+/* NOSAVE: Used in palette animations only, not really important. */
 VARDEF int _timer_counter;
 
 
@@ -277,6 +279,7 @@
 VARDEF int _autosave_ctr;
 
 VARDEF byte _display_opt;
+VARDEF byte _transparent_opt;
 VARDEF int _caret_timer;
 VARDEF uint32 _news_display_opt;
 VARDEF bool _news_ticker_sound;
@@ -288,20 +291,20 @@
 
 VARDEF bool _rightclick_emulate;
 
-// IN/OUT parameters to commands
+/* IN/OUT parameters to commands */
 VARDEF byte _yearly_expenses_type;
 VARDEF TileIndex _terraform_err_tile;
 VARDEF TileIndex _build_tunnel_endtile;
 VARDEF bool _generating_world;
 
-// Deals with the type of the savegame, independent of extension
+/* Deals with the type of the savegame, independent of extension */
 struct SmallFiosItem {
 	int mode;             // savegame/scenario type (old, new)
 	char name[MAX_PATH];  // name
 	char title[255];      // internal name of the game
 };
 
-// Used when switching from the intro menu.
+/* Used when switching from the intro menu. */
 VARDEF byte _switch_mode;
 VARDEF StringID _switch_mode_errorstr;
 VARDEF SmallFiosItem _file_to_saveload;
@@ -369,14 +372,14 @@
 	return _decode_parameters[n];
 }
 
-// Used to bind a C string name to a dparam number.
-// NOTE: This has a short lifetime. You can't
-//       use this string much later or it will be gone.
+/* Used to bind a C string name to a dparam number.
+ * NOTE: This has a short lifetime. You can't
+ *       use this string much later or it will be gone. */
 void SetDParamStr(uint n, const char *str);
 
-// This function takes a C-string and allocates a temporary string ID.
-// The duration of the bound string is valid only until the next acll to GetString,
-// so be careful.
+/** This function takes a C-string and allocates a temporary string ID.
+ * The duration of the bound string is valid only until the next acll to GetString,
+ * so be careful. */
 StringID BindCString(const char *str);
 
 
@@ -386,7 +389,7 @@
 
 #define SET_EXPENSES_TYPE(x) _yearly_expenses_type = x;
 
-/* landscape.c */
+/* landscape.cpp */
 extern const byte _tileh_to_sprite[32];
 extern const Slope _inclined_tileh[16];
 
--- a/src/vehicle.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/vehicle.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file vehicle.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "road_map.h"
@@ -104,7 +106,7 @@
 bool VehicleNeedsService(const Vehicle *v)
 {
 	if (v->vehstatus & VS_CRASHED)
-		return false; /* Crashed vehicles don't need service anymore */
+		return false; // Crashed vehicles don't need service anymore
 
 	if (_patches.no_servicing_if_no_breakdowns && _opt.diff.vehicle_breakdowns == 0) {
 		return EngineHasReplacementForPlayer(GetPlayer(v->owner), v->engine_type);  /* Vehicles set for autoreplacing needs to go to a depot even if breakdowns are turned off */
@@ -215,7 +217,7 @@
 	v->bottom_coord = pt.y + spr->height + 2;
 }
 
-// Called after load to update coordinates
+/** Called after load to update coordinates */
 void AfterLoadVehicles()
 {
 	Vehicle *v;
@@ -311,7 +313,7 @@
 	return NULL;
 }
 
-/*
+/**
  * finds a free vehicle in the memory or allocates a new one
  * returns a pointer to the first free vehicle or NULL if all vehicles are in use
  * *skip_vehicles is an offset to where in the array we should begin looking
@@ -327,7 +329,7 @@
 	const int offset = (1 << Vehicle_POOL_BLOCK_SIZE_BITS) * BLOCKS_FOR_SPECIAL_VEHICLES;
 
 	/* We don't use FOR_ALL here, because FOR_ALL skips invalid items.
-	 * TODO - This is just a temporary stage, this will be removed. */
+	 * @todo - This is just a temporary stage, this will be removed. */
 	if (*skip_vehicles < (_Vehicle_pool.total_items - offset)) { // make sure the offset in the array is not larger than the array itself
 		for (v = GetVehicle(offset + *skip_vehicles); v != NULL; v = (v->index + 1U < GetVehiclePoolSize()) ? GetVehicle(v->index + 1) : NULL) {
 			(*skip_vehicles)++;
@@ -381,7 +383,7 @@
 {
 	Point pt = RemapCoords(TileX(tile) * TILE_SIZE, TileY(tile) * TILE_SIZE, 0);
 
-	// The hash area to scan
+	/* The hash area to scan */
 	const int xl = GB(pt.x - 174, 7, 6);
 	const int xu = GB(pt.x + 104, 7, 6);
 	const int yl = GB(pt.y - 294, 6, 6) << 6;
@@ -498,7 +500,7 @@
 
 	u = GetFirstVehicleInChain(v);
 
-	// Check to see if this is the first
+	/* Check to see if this is the first */
 	if (v == u) return NULL;
 
 	for (; u->next != v; u = u->next) assert(u->next != NULL);
@@ -606,7 +608,7 @@
 static void EffectVehicle_Tick(Vehicle *v);
 void DisasterVehicle_Tick(Vehicle *v);
 
-// head of the linked list to tell what vehicles that visited a depot in a tick
+/** head of the linked list to tell what vehicles that visited a depot in a tick */
 static Vehicle* _first_veh_in_depot_list;
 
 /** Adds a vehicle to the list of vehicles, that visited a depot this tick
@@ -614,14 +616,14 @@
  */
 void VehicleEnteredDepotThisTick(Vehicle *v)
 {
-	// we need to set v->leave_depot_instantly as we have no control of it's contents at this time
+	/* we need to set v->leave_depot_instantly as we have no control of it's contents at this time */
 	if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT) && !HASBIT(v->current_order.flags, OFB_PART_OF_ORDERS) && v->current_order.type == OT_GOTO_DEPOT) {
-		// we keep the vehicle in the depot since the user ordered it to stay
+		/* we keep the vehicle in the depot since the user ordered it to stay */
 		v->leave_depot_instantly = false;
 	} else {
-		// the vehicle do not plan on stopping in the depot, so we stop it to ensure that it will not reserve the path
-		// out of the depot before we might autoreplace it to a different engine. The new engine would not own the reserved path
-		// we store that we stopped the vehicle, so autoreplace can start it again
+		/* the vehicle do not plan on stopping in the depot, so we stop it to ensure that it will not reserve the path
+		 * out of the depot before we might autoreplace it to a different engine. The new engine would not own the reserved path
+		 * we store that we stopped the vehicle, so autoreplace can start it again */
 		v->vehstatus |= VS_STOPPED;
 		v->leave_depot_instantly = true;
 	}
@@ -650,8 +652,8 @@
 	Vehicle *v;
 
 #ifdef ENABLE_NETWORK
-	// hotfix for desync problem:
-	//  for MP games invalidate the YAPF cache every tick to keep it exactly the same on the server and all clients
+	/* hotfix for desync problem:
+	 *  for MP games invalidate the YAPF cache every tick to keep it exactly the same on the server and all clients */
 	if (_networking) {
 		YapfNotifyTrackLayoutChange(INVALID_TILE, INVALID_TRACK);
 	}
@@ -679,7 +681,7 @@
 		}
 	}
 
-	// now we handle all the vehicles that entered a depot this tick
+	/* now we handle all the vehicles that entered a depot this tick */
 	v = _first_veh_in_depot_list;
 	while (v != NULL) {
 		Vehicle *w = v->depot_list;
@@ -695,19 +697,19 @@
 	bool keep_loading = false;
 	const GoodsEntry *ge = GetStation(v->last_station_visited)->goods;
 
-	//special handling of aircraft
-
-	//if the aircraft carries passengers and is NOT full, then
-	//continue loading, no matter how much mail is in
+	/* special handling of aircraft */
+
+	/* if the aircraft carries passengers and is NOT full, then
+	 *continue loading, no matter how much mail is in */
 	if (v->type == VEH_AIRCRAFT &&
 			IsCargoInClass(v->cargo_type, CC_PASSENGERS) &&
 			v->cargo_cap != v->cargo_count) {
 		return true;
 	}
 
-	// patch should return "true" to continue loading, i.e. when there is no cargo type that is fully loaded.
+	/* patch should return "true" to continue loading, i.e. when there is no cargo type that is fully loaded. */
 	do {
-		//Should never happen, but just in case future additions change this
+		/* Should never happen, but just in case future additions change this */
 		assert(v->cargo_type<32);
 
 		if (v->cargo_cap != 0) {
@@ -726,7 +728,7 @@
 		}
 	} while ((v = v->next) != NULL);
 
-	// continue loading if there is a non full cargo type and no cargo type that is full
+	/* continue loading if there is a non full cargo type and no cargo type that is full */
 	return keep_loading || (not_full && (full & ~not_full) == 0);
 }
 
@@ -743,7 +745,7 @@
 				IsTileType(TILE_ADDXY(tile, -2,  0), MP_STATION)
 			))) {
 
-		// If patch is active, use alternative CanFillVehicle-function
+		/* If patch is active, use alternative CanFillVehicle-function */
 		if (_patches.full_load_any && v->current_order.flags & OF_FULL_LOAD) return CanFillVehicle_FullLoadAny(v);
 
 		do {
@@ -821,13 +823,13 @@
 
 void ViewportAddVehicles(DrawPixelInfo *dpi)
 {
-	// The bounding rectangle
+	/* The bounding rectangle */
 	const int l = dpi->left;
 	const int r = dpi->left + dpi->width;
 	const int t = dpi->top;
 	const int b = dpi->top + dpi->height;
 
-	// The hash area to scan
+	/* The hash area to scan */
 	const int xl = GB(l - 70, 7, 6);
 	const int xu = GB(r,      7, 6);
 	const int yl = GB(t - 70, 6, 6) << 6;
@@ -1567,7 +1569,7 @@
 {
 	if (v->owner != _local_player) return;
 
-	// Do not show getting-old message if autorenew is active
+	/* Do not show getting-old message if autorenew is active */
 	if (GetPlayer(v->owner)->engine_renew) return;
 
 	SetDParam(0, _vehicle_type_names[v->type]);
@@ -1599,6 +1601,7 @@
 
 /** Starts or stops a lot of vehicles
  * @param tile Tile of the depot where the vehicles are started/stopped (only used for depots)
+ * @param flags type of operation
  * @param p1 Station/Order/Depot ID (only used for vehicle list windows)
  * @param p2 bitmask
  *   - bit 0-4 Vehicle type
@@ -1665,10 +1668,11 @@
 }
 
 /** Sells all vehicles in a depot
-* @param tile Tile of the depot where the depot is
-* @param p1 Vehicle type
-* @param p2 unused
-*/
+ * @param tile Tile of the depot where the depot is
+ * @param flags type of operation
+ * @param p1 Vehicle type
+ * @param p2 unused
+ */
 int32 CmdDepotSellAllVehicles(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	Vehicle **engines = NULL;
@@ -1717,10 +1721,11 @@
 }
 
 /** Autoreplace all vehicles in the depot
-* @param tile Tile of the depot where the vehicles are
-* @param p1 Type of vehicle
-* @param p2 Unused
-*/
+ * @param tile Tile of the depot where the vehicles are
+ * @param flags type of operation
+ * @param p1 Type of vehicle
+ * @param p2 Unused
+ */
 int32 CmdDepotMassAutoReplace(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	Vehicle **vl = NULL;
@@ -1784,6 +1789,7 @@
 
 /** Clone a vehicle. If it is a train, it will clone all the cars too
  * @param tile tile of the depot where the cloned vehicle is build
+ * @param flags type of operation
  * @param p1 the original vehicle's index
  * @param p2 1 = shared orders, else copied orders
  */
@@ -1801,10 +1807,9 @@
 	w_front = NULL;
 	w_rear = NULL;
 
-
 	/*
 	 * v_front is the front engine in the original vehicle
-	 * v is the car/vehicle of the original vehicle, that is currently being copied
+	 * v is the car/vehicle of the original vehicle that is currently being copied
 	 * w_front is the front engine of the cloned vehicle
 	 * w is the car/vehicle currently being cloned
 	 * w_rear is the rear end of the cloned train. It's used to add more cars and is only used by trains
@@ -1814,7 +1819,7 @@
 
 	if (v->type == VEH_TRAIN && (!IsFrontEngine(v) || v->u.rail.crash_anim_pos >= 4400)) return CMD_ERROR;
 
-	// check that we can allocate enough vehicles
+	/* check that we can allocate enough vehicles */
 	if (!(flags & DC_EXEC)) {
 		int veh_counter = 0;
 		do {
@@ -1849,11 +1854,18 @@
 			Vehicle *v2 = v;
 			do {
 				if (v2->cargo_type != w2->cargo_type || v2->cargo_subtype != w2->cargo_subtype) {
-					/* We can't pay for refitting because we can't estimate refitting costs for a vehicle before it's build.
-					 * If we pay for it anyway, the cost and the estimated cost will not be the same and we will have an assert.
-					 * We need to check the whole chain if it is a train because some newgrf articulated engines can refit some units only (and not the front) */
-					DoCommand(0, w->index, v2->cargo_type | (v2->cargo_subtype << 8), flags, GetCmdRefitVeh(v));
-					break; // We learned that the engine in question needed a refit. No need to check anymore
+					/* We need to check the whole chain if it is a train
+					 * because some newgrf articulated engines can refit some
+					 * units only (and not the front). */
+					cost = DoCommand(0, w->index, v2->cargo_type | (v2->cargo_subtype << 8), flags, GetCmdRefitVeh(v));
+					if (CmdFailed(cost)) return cost;
+
+					total_cost += cost;
+
+					/* The refit command will refit all the remaining
+					 * articulated parts if possible, so we don't need to
+					 * carry on checking. */
+					break;
 				}
 			} while (v->type == VEH_TRAIN && (w2 = w2->next) != NULL && (v2 = v2->next) != NULL);
 
@@ -1862,11 +1874,11 @@
 			}
 
 			if (v->type == VEH_TRAIN && !IsFrontEngine(v)) {
-				// this s a train car
-				// add this unit to the end of the train
+				/* this s a train car
+				 * add this unit to the end of the train */
 				DoCommand(0, (w_rear->index << 16) | w->index, 1, flags, CMD_MOVE_RAIL_VEHICLE);
 			} else {
-				// this is a front engine or not a train. It need orders
+				/* this is a front engine or not a train. It need orders */
 				w_front = w;
 				w->service_interval = v->service_interval;
 				DoCommand(0, (v->index << 16) | w->index, p2 & 1 ? CO_SHARE : CO_COPY, flags, CMD_CLONE_ORDER);
@@ -1876,7 +1888,7 @@
 	} while (v->type == VEH_TRAIN && (v = GetNextVehicle(v)) != NULL);
 
 	if (flags & DC_EXEC && v_front->type == VEH_TRAIN) {
-		// for trains this needs to be the front engine due to the callback function
+		/* for trains this needs to be the front engine due to the callback function */
 		_new_vehicle_id = w_front->index;
 	}
 
@@ -2220,6 +2232,7 @@
 
 /** Give a custom name to your vehicle
  * @param tile unused
+ * @param flags type of operation
  * @param p1 vehicle ID to name
  * @param p2 unused
  */
@@ -2253,6 +2266,7 @@
 
 /** Change the service interval of a vehicle
  * @param tile unused
+ * @param flags type of operation
  * @param p1 vehicle ID that is being service-interval-changed
  * @param p2 new service interval
  */
@@ -2349,27 +2363,27 @@
 
 	switch (v->type) {
 		case VEH_TRAIN:
-			if (v->u.rail.track == TRACK_BIT_DEPOT) /* We'll assume the train is facing outwards */
-				return DiagdirToDiagTrackdir(GetRailDepotDirection(v->tile)); /* Train in depot */
-
-			if (v->u.rail.track == TRACK_BIT_WORMHOLE) /* train in tunnel, so just use his direction and assume a diagonal track */
+			if (v->u.rail.track == TRACK_BIT_DEPOT) // We'll assume the train is facing outwards
+				return DiagdirToDiagTrackdir(GetRailDepotDirection(v->tile)); // Train in depot
+
+			if (v->u.rail.track == TRACK_BIT_WORMHOLE) // train in tunnel, so just use his direction and assume a diagonal track
 				return DiagdirToDiagTrackdir(DirToDiagDir(v->direction));
 
 			return TrackDirectionToTrackdir(FindFirstTrack(v->u.rail.track), v->direction);
 
 		case VEH_SHIP:
 			if (IsShipInDepot(v))
-				/* We'll assume the ship is facing outwards */
+				// We'll assume the ship is facing outwards
 				return DiagdirToDiagTrackdir(GetShipDepotDirection(v->tile));
 
 			return TrackDirectionToTrackdir(FindFirstTrack(v->u.ship.state), v->direction);
 
 		case VEH_ROAD:
-			if (IsRoadVehInDepot(v)) /* We'll assume the road vehicle is facing outwards */
+			if (IsRoadVehInDepot(v)) // We'll assume the road vehicle is facing outwards
 				return DiagdirToDiagTrackdir(GetRoadDepotDirection(v->tile));
 
-			if (IsStandardRoadStopTile(v->tile)) /* We'll assume the road vehicle is facing outwards */
-				return DiagdirToDiagTrackdir(GetRoadStopDir(v->tile)); /* Road vehicle in a station */
+			if (IsStandardRoadStopTile(v->tile)) // We'll assume the road vehicle is facing outwards
+				return DiagdirToDiagTrackdir(GetRoadStopDir(v->tile)); // Road vehicle in a station
 
 			if (IsDriveThroughStopTile(v->tile)) return DiagdirToDiagTrackdir(DirToDiagDir(v->direction));
 
@@ -2422,16 +2436,16 @@
 		cache = MallocT<bool>(max + 1);
 	}
 
-	// Clear the cache
+	/* Clear the cache */
 	memset(cache, 0, (max + 1) * sizeof(*cache));
 
-	// Fill the cache
+	/* Fill the cache */
 	FOR_ALL_VEHICLES(u) {
 		if (u->type == type && u->owner == _current_player && u->unitnumber != 0 && u->unitnumber <= max)
 			cache[u->unitnumber] = true;
 	}
 
-	// Find the first unused unit number
+	/* Find the first unused unit number */
 	for (unit = 1; unit <= max; unit++) {
 		if (!cache[unit]) break;
 	}
@@ -2562,7 +2576,7 @@
 	return GetEngineColourMap(v->engine_type, v->owner, INVALID_ENGINE, v);
 }
 
-// Save and load of vehicles
+/** Save and load of vehicles */
 extern const SaveLoad _common_veh_desc[] = {
 	    SLE_VAR(Vehicle, subtype,              SLE_UINT8),
 
@@ -2667,7 +2681,7 @@
 	    SLE_REF(Vehicle, next_shared,          REF_VEHICLE),
 	    SLE_REF(Vehicle, prev_shared,          REF_VEHICLE),
 
-	// reserve extra space in savegame here. (currently 10 bytes)
+	/* reserve extra space in savegame here. (currently 10 bytes) */
 	SLE_CONDNULL(10,                                                       2, SL_MAX_VERSION),
 
 	SLE_END()
@@ -2686,7 +2700,7 @@
 	SLE_CONDVARX(offsetof(Vehicle, u) + offsetof(VehicleRail, days_since_order_progr), SLE_UINT16, 2, SL_MAX_VERSION),
 
 	SLE_CONDNULL(2, 2, 19),
-	// reserve extra space in savegame here. (currently 11 bytes)
+	/* reserve extra space in savegame here. (currently 11 bytes) */
 	SLE_CONDNULL(11, 2, SL_MAX_VERSION),
 
 	SLE_END()
@@ -2706,7 +2720,7 @@
 	SLE_CONDREFX(offsetof(Vehicle, u) + offsetof(VehicleRoad, slot),     REF_ROADSTOPS, 6, SL_MAX_VERSION),
 	SLE_CONDNULL(1,                                                                     6, SL_MAX_VERSION),
 	SLE_CONDVARX(offsetof(Vehicle, u) + offsetof(VehicleRoad, slot_age), SLE_UINT8,     6, SL_MAX_VERSION),
-	// reserve extra space in savegame here. (currently 16 bytes)
+	/* reserve extra space in savegame here. (currently 16 bytes) */
 	SLE_CONDNULL(16,                                                                    2, SL_MAX_VERSION),
 
 	SLE_END()
@@ -2717,7 +2731,7 @@
 	SLE_INCLUDEX(0, INC_VEHICLE_COMMON),
 	SLE_VARX(offsetof(Vehicle, u) + offsetof(VehicleShip, state), SLE_UINT8),
 
-	// reserve extra space in savegame here. (currently 16 bytes)
+	/* reserve extra space in savegame here. (currently 16 bytes) */
 	SLE_CONDNULL(16, 2, SL_MAX_VERSION),
 
 	SLE_END()
@@ -2736,7 +2750,7 @@
 
 	SLE_CONDVARX(offsetof(Vehicle, u) + offsetof(VehicleAir, previous_pos),    SLE_UINT8,                 2, SL_MAX_VERSION),
 
-	// reserve extra space in savegame here. (currently 15 bytes)
+	/* reserve extra space in savegame here. (currently 15 bytes) */
 	SLE_CONDNULL(15,                                                                                      2, SL_MAX_VERSION),
 
 	SLE_END()
@@ -2768,7 +2782,7 @@
 	    SLE_VARX(offsetof(Vehicle, u) + offsetof(VehicleSpecial, unk0), SLE_UINT16),
 	    SLE_VARX(offsetof(Vehicle, u) + offsetof(VehicleSpecial, unk2), SLE_UINT8),
 
-	// reserve extra space in savegame here. (currently 16 bytes)
+	/* reserve extra space in savegame here. (currently 16 bytes) */
 	SLE_CONDNULL(16, 2, SL_MAX_VERSION),
 
 	SLE_END()
@@ -2810,7 +2824,7 @@
 	   SLE_VARX(offsetof(Vehicle, u) + offsetof(VehicleDisaster, image_override), SLE_UINT16),
 	   SLE_VARX(offsetof(Vehicle, u) + offsetof(VehicleDisaster, unk2),           SLE_UINT16),
 
-	// reserve extra space in savegame here. (currently 16 bytes)
+	/* reserve extra space in savegame here. (currently 16 bytes) */
 	SLE_CONDNULL(16,                                                 2, SL_MAX_VERSION),
 
 	SLE_END()
@@ -2826,18 +2840,18 @@
 	_disaster_desc,
 };
 
-// Will be called when the vehicles need to be saved.
+/** Will be called when the vehicles need to be saved. */
 static void Save_VEHS()
 {
 	Vehicle *v;
-	// Write the vehicles
+	/* Write the vehicles */
 	FOR_ALL_VEHICLES(v) {
 		SlSetArrayIndex(v->index);
 		SlObject(v, (SaveLoad*)_veh_descs[v->type]);
 	}
 }
 
-// Will be called when vehicles need to be loaded.
+/** Will be called when vehicles need to be loaded. */
 static void Load_VEHS()
 {
 	int index;
--- a/src/vehicle.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/vehicle.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @vehicle.h */
+
 #ifndef VEHICLE_H
 #define VEHICLE_H
 
@@ -108,13 +110,13 @@
 	uint16 crash_anim_pos;
 	uint16 days_since_order_progr;
 
-	// cached values, recalculated on load and each time a vehicle is added to/removed from the consist.
+	/* cached values, recalculated on load and each time a vehicle is added to/removed from the consist. */
 	uint16 cached_max_speed;  // max speed of the consist. (minimum of the max speed of all vehicles in the consist)
 	uint32 cached_power;      // total power of the consist.
 	uint8 cached_veh_length;  // length of this vehicle in units of 1/8 of normal length, cached because this can be set by a callback
 	uint16 cached_total_length; ///< Length of the whole train, valid only for first engine.
 
-	// cached values, recalculated when the cargo on a train changes (in addition to the conditions above)
+	/* cached values, recalculated when the cargo on a train changes (in addition to the conditions above) */
 	uint32 cached_weight;     // total weight of the consist.
 	uint32 cached_veh_weight; // weight of the vehicle.
 	uint32 cached_max_te;     // max tractive effort of consist
@@ -127,8 +129,8 @@
 	 */
 	byte cached_vis_effect;
 
-	// NOSAVE: for wagon override - id of the first engine in train
-	// 0xffff == not in train
+	/* NOSAVE: for wagon override - id of the first engine in train
+	 * 0xffff == not in train */
 	EngineID first_engine;
 
 	TrackBitsByte track;
@@ -138,27 +140,27 @@
 
 	byte flags;
 
-	// Link between the two ends of a multiheaded engine
+	/* Link between the two ends of a multiheaded engine */
 	Vehicle *other_multiheaded_part;
 };
 
 enum {
 	VRF_REVERSING         = 0,
 
-	// used to calculate if train is going up or down
+	/* used to calculate if train is going up or down */
 	VRF_GOINGUP           = 1,
 	VRF_GOINGDOWN         = 2,
 
-	// used to store if a wagon is powered or not
+	/* used to store if a wagon is powered or not */
 	VRF_POWEREDWAGON      = 3,
 
-	// used to reverse the visible direction of the vehicle
+	/* used to reverse the visible direction of the vehicle */
 	VRF_REVERSE_DIRECTION = 4,
 
-	// used to mark train as lost because PF can't find the route
+	/* used to mark train as lost because PF can't find the route */
 	VRF_NO_PATH_TO_DESTINATION = 5,
 
-	// used to mark that electric train engine is allowed to run on normal rail
+	/* used to mark that electric train engine is allowed to run on normal rail */
 	VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL = 6,
 };
 
@@ -171,7 +173,7 @@
 };
 
 struct VehicleRoad {
-	byte state;             /// @see RoadVehicleStates
+	byte state;             ///< @see RoadVehicleStates
 	byte frame;
 	uint16 blocked_ctr;
 	byte overtaking;
@@ -210,7 +212,7 @@
 	StringID string_id;      // Displayed string
 
 	UnitID unitnumber;       // unit number, for display purposes only
-	PlayerByte owner;          // which player owns the vehicle?
+	PlayerByte owner;        // which player owns the vehicle?
 
 	TileIndex tile;          // Current tile index
 	TileIndex dest_tile;     // Heading for this tile
@@ -231,9 +233,9 @@
 	int8 y_offs;             // y offset for vehicle sprite
 	EngineID engine_type;
 
-	// for randomized variational spritegroups
-	// bitmask used to resolve them; parts of it get reseeded when triggers
-	// of corresponding spritegroups get matched
+	/* for randomized variational spritegroups
+	 * bitmask used to resolve them; parts of it get reseeded when triggers
+	 * of corresponding spritegroups get matched */
 	byte random_bits;
 	byte waiting_triggers;   // triggers to be yet matched
 
@@ -269,15 +271,15 @@
 	Vehicle *prev_shared;    ///< If not NULL, this points to the prev vehicle that shared the order
 	/* End Order-stuff */
 
-	// Boundaries for the current position in the world and a next hash link.
-	// NOSAVE: All of those can be updated with VehiclePositionChanged()
+	/* Boundaries for the current position in the world and a next hash link.
+	 * NOSAVE: All of those can be updated with VehiclePositionChanged() */
 	int32 left_coord;
 	int32 top_coord;
 	int32 right_coord;
 	int32 bottom_coord;
 	Vehicle *next_hash;
 
-	// Related to age and service time
+	/* Related to age and service time */
 	Date age;     // Age in days
 	Date max_age; // Maximum age
 	Date date_of_last_service;
@@ -492,7 +494,7 @@
 
 /**
  * Check if an index is a vehicle-index (so between 0 and max-vehicles)
- *
+ * @param index of the vehicle to query
  * @return Returns true if the vehicle-id is in range
  */
 static inline bool IsValidVehicleID(uint index)
@@ -513,7 +515,11 @@
 	return order;
 }
 
-/* Returns the last order of a vehicle, or NULL if it doesn't exists */
+/**
+ * Returns the last order of a vehicle, or NULL if it doesn't exists
+ * @param v Vehicle to query
+ * @return last order of a vehicle, if available
+ */
 static inline Order *GetLastVehicleOrder(const Vehicle *v)
 {
 	Order *order = v->orders;
@@ -526,7 +532,10 @@
 	return order;
 }
 
-/* Get the first vehicle of a shared-list, so we only have to walk forwards */
+/** Get the first vehicle of a shared-list, so we only have to walk forwards
+ * @param v Vehicle to query
+ * @return first vehicle of a shared-list
+ */
 static inline Vehicle *GetFirstVehicleFromSharedList(const Vehicle *v)
 {
 	Vehicle *u = (Vehicle *)v;
@@ -535,7 +544,7 @@
 	return u;
 }
 
-// NOSAVE: Return values from various commands.
+/* NOSAVE: Return values from various commands. */
 VARDEF VehicleID _new_vehicle_id;
 VARDEF uint16 _returned_refit_capacity;
 
--- a/src/vehicle_gui.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/vehicle_gui.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file vehicle_gui.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
@@ -162,12 +164,12 @@
 	qsort((void*)v, length, sizeof(v[0]), _vehicle_sorter[0]);
 }
 
-// draw the vehicle profit button in the vehicle list window.
+/** draw the vehicle profit button in the vehicle list window. */
 void DrawVehicleProfitButton(const Vehicle *v, int x, int y)
 {
 	SpriteID pal;
 
-	// draw profit-based colored icons
+	/* draw profit-based colored icons */
 	if (v->age <= 365 * 2) {
 		pal = PALETTE_TO_GREY;
 	} else if (v->profit_last_year < 0) {
@@ -421,6 +423,7 @@
 
 /** Show the refit window for a vehicle
 * @param *v The vehicle to show the refit window for
+* @param order of the vehicle (?)
 */
 void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order)
 {
@@ -466,18 +469,18 @@
 	}
 }
 
-/* Display additional text from NewGRF in the purchase information window */
+/** Display additional text from NewGRF in the purchase information window */
 uint ShowAdditionalText(int x, int y, uint w, EngineID engine)
 {
 	uint16 callback = GetVehicleCallback(CBID_VEHICLE_ADDITIONAL_TEXT, 0, 0, engine, NULL);
 	if (callback == CALLBACK_FAILED) return 0;
 
-	// STR_02BD is used to start the string with {BLACK}
+	/* STR_02BD is used to start the string with {BLACK} */
 	SetDParam(0, GetGRFStringID(GetEngineGRFID(engine), 0xD000 + callback));
 	return DrawStringMultiLine(x, y, STR_02BD, w);
 }
 
-/* Count the number of bits that are set in a mask */
+/** Count the number of bits that are set in a mask */
 static uint CountBits(uint32 mask)
 {
 	uint c = 0;
@@ -485,7 +488,7 @@
 	return c;
 }
 
-/* Display list of cargo types of the engine, for the purchase information window */
+/** Display list of cargo types of the engine, for the purchase information window */
 uint ShowRefitOptionsList(int x, int y, uint w, EngineID engine)
 {
 	/* List of cargo types of this engine */
@@ -529,7 +532,7 @@
 }
 
 
-// if the sorting criteria had the same value, sort vehicle by unitnumber
+/* if the sorting criteria had the same value, sort vehicle by unitnumber */
 #define VEHICLEUNITNUMBERSORTER(r, a, b) {if (r == 0) {r = a->unitnumber - b->unitnumber;}}
 
 static int CDECL VehicleNumberSorter(const void *a, const void *b)
@@ -1140,7 +1143,7 @@
 			switch (e->we.dropdown.button) {
 				case VLW_WIDGET_SORT_BY_PULLDOWN:
 					if (vl->l.sort_type != e->we.dropdown.index) {
-						// value has changed -> resort
+						/* value has changed -> resort */
 						vl->l.flags |= VL_RESORT;
 						vl->l.sort_type = e->we.dropdown.index;
 						vl->_sorting->criteria = vl->l.sort_type;
--- a/src/vehicle_gui.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/vehicle_gui.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file vehicle_gui.h */
+
 #ifndef VEHICLE_GUI_H
 #define VEHICLE_GUI_H
 
--- a/src/viewport.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/viewport.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -25,7 +25,7 @@
 
 #define VIEWPORT_DRAW_MEM (65536 * 2)
 
-// XXX - maximum viewports is maximum windows - 2 (main toolbar + status bar)
+/* XXX - maximum viewports is maximum windows - 2 (main toolbar + status bar) */
 static ViewPort _viewports[25 - 2];
 static uint32 _active_viewports;    ///< bitmasked variable where each bit signifies if a viewport is in use or not
 assert_compile(lengthof(_viewports) < sizeof(_active_viewports) * 8);
@@ -91,8 +91,8 @@
 	byte zmax;
 };
 
-// Quick hack to know how much memory to reserve when allocating from the spritelist
-// to prevent a buffer overflow.
+/* Quick hack to know how much memory to reserve when allocating from the spritelist
+ * to prevent a buffer overflow. */
 #define LARGEST_SPRITELIST_STRUCT ParentSpriteToDraw
 
 struct ViewportDrawer {
@@ -438,7 +438,7 @@
 void DrawGroundSprite(SpriteID image, SpriteID pal)
 {
 	if (_offset_ground_sprites) {
-		// offset ground sprite because of foundation?
+		/* offset ground sprite because of foundation? */
 		AddChildSpriteScreen(image, pal, _cur_vd->offs_x, _cur_vd->offs_y);
 	} else {
 		_added_tile_sprite = true;
@@ -493,12 +493,12 @@
 	ps = (ParentSpriteToDraw*)vd->spritelist_mem;
 
 	if (vd->parent_list >= vd->eof_parent_list) {
-		// This can happen rarely, mostly when you zoom out completely
-		//  and have a lot of stuff that moves (and is added to the
-		//  sort-list, this function). To solve it, increase
-		//  parent_list somewhere below to a higher number.
-		// This can not really hurt you, it just gives some black
-		//  spots on the screen ;)
+		/* This can happen rarely, mostly when you zoom out completely
+		 *  and have a lot of stuff that moves (and is added to the
+		 *  sort-list, this function). To solve it, increase
+		 *  parent_list somewhere below to a higher number.
+		 * This can not really hurt you, it just gives some black
+		 *  spots on the screen ;) */
 		DEBUG(sprite, 0, "Out of sprite memory (parent_list)");
 		return;
 	}
@@ -646,23 +646,23 @@
 	SpriteID image;
 	SpriteID pal;
 
-	// Draw a red error square?
+	/* Draw a red error square? */
 	if (_thd.redsq != 0 && _thd.redsq == ti->tile) {
 		DrawSelectionSprite(SPR_SELECT_TILE + _tileh_to_sprite[ti->tileh], PALETTE_TILE_RED_PULSATING, ti);
 		return;
 	}
 
-	// no selection active?
+	/* no selection active? */
 	if (_thd.drawstyle == 0) return;
 
-	// Inside the inner area?
+	/* Inside the inner area? */
 	if (IS_INSIDE_1D(ti->x, _thd.pos.x, _thd.size.x) &&
 			IS_INSIDE_1D(ti->y, _thd.pos.y, _thd.size.y)) {
 		if (_thd.drawstyle & HT_RECT) {
 			image = SPR_SELECT_TILE + _tileh_to_sprite[ti->tileh];
 			DrawSelectionSprite(image, _thd.make_square_red ? PALETTE_SEL_TILE_RED : PAL_NONE, ti);
 		} else if (_thd.drawstyle & HT_POINT) {
-			// Figure out the Z coordinate for the single dot.
+			/* Figure out the Z coordinate for the single dot. */
 			byte z = ti->z;
 			if (ti->tileh & SLOPE_N) {
 				z += TILE_HEIGHT;
@@ -670,7 +670,7 @@
 			}
 			DrawGroundSpriteAt(_cur_dpi->zoom != 2 ? SPR_DOT : SPR_DOT_SMALL, PAL_NONE, ti->x, ti->y, z);
 		} else if (_thd.drawstyle & HT_RAIL /*&& _thd.place_mode == VHM_RAIL*/) {
-			// autorail highlight piece under cursor
+			/* autorail highlight piece under cursor */
 			uint type = _thd.drawstyle & 0xF;
 			int offset;
 
@@ -688,7 +688,7 @@
 			DrawSelectionSprite(image, _thd.make_square_red ? PALETTE_SEL_TILE_RED : pal, ti);
 
 		} else if (IsPartOfAutoLine(ti->x, ti->y)) {
-			// autorail highlighting long line
+			/* autorail highlighting long line */
 			int dir = _thd.drawstyle & ~0xF0;
 			int offset;
 			uint side;
@@ -714,12 +714,12 @@
 		return;
 	}
 
-	// Check if it's inside the outer area?
+	/* Check if it's inside the outer area? */
 	if (_thd.outersize.x &&
 			_thd.size.x < _thd.size.x + _thd.outersize.x &&
 			IS_INSIDE_1D(ti->x, _thd.pos.x + _thd.offs.x, _thd.size.x + _thd.outersize.x) &&
 			IS_INSIDE_1D(ti->y, _thd.pos.y + _thd.offs.y, _thd.size.y + _thd.outersize.y)) {
-		// Draw a blue rect.
+		/* Draw a blue rect. */
 		DrawSelectionSprite(SPR_SELECT_TILE + _tileh_to_sprite[ti->tileh], PALETTE_SEL_TILE_BLUE, ti);
 		return;
 	}
@@ -734,11 +734,11 @@
 
 	_cur_ti = &ti;
 
-	// Transform into tile coordinates and round to closest full tile
+	/* Transform into tile coordinates and round to closest full tile */
 	x = ((vd->dpi.top >> 1) - (vd->dpi.left >> 2)) & ~0xF;
 	y = ((vd->dpi.top >> 1) + (vd->dpi.left >> 2) - 0x10) & ~0xF;
 
-	// determine size of area
+	/* determine size of area */
 	{
 		Point pt = RemapCoords(x, y, 241);
 		width = (vd->dpi.left + vd->dpi.width - pt.x + 95) >> 6;
@@ -1128,7 +1128,7 @@
 					}
 				}
 
-				// Swap the two sprites ps and ps2 using bubble-sort algorithm.
+				/* Swap the two sprites ps and ps2 using bubble-sort algorithm. */
 				psd3 = psd;
 				do {
 					ParentSpriteToDraw* temp = *psd3;
@@ -1193,11 +1193,12 @@
 
 		/* Draw the rectangle if 'tranparent station signs' is off,
 		 * or if we are drawing a general text sign (STR_2806) */
-			if (!(_display_opt & DO_TRANS_SIGNS) || ss->string == STR_2806)
+			if (!HASBIT(_transparent_opt, TO_SIGNS) || ss->string == STR_2806) {
 				DrawFrameRect(
 					x, y, x + w, bottom, ss->color,
-					(_display_opt & DO_TRANS_BUILDINGS) ? FR_TRANSPARENT : FR_NONE
+					HASBIT(_transparent_opt, TO_SIGNS) ? FR_TRANSPARENT : FR_NONE
 				);
+			}
 		}
 
 		SetDParam(0, ss->params[0]);
@@ -1205,8 +1206,8 @@
 		/* if we didn't draw a rectangle, or if transparant building is on,
 		 * draw the text in the color the rectangle would have */
 		if ((
-					(_display_opt & DO_TRANS_BUILDINGS) ||
-					(_display_opt & DO_TRANS_SIGNS && ss->string != STR_2806)
+					HASBIT(_transparent_opt, TO_BUILDINGS) ||
+					(HASBIT(_transparent_opt, TO_SIGNS) && ss->string != STR_2806)
 				) && ss->width != 0) {
 			/* Real colors need the IS_PALETTE_COLOR flag
 			 * otherwise colors from _string_colormap are assumed. */
@@ -1273,8 +1274,8 @@
 	ViewportAddSigns(&vd.dpi);
 	ViewportAddWaypoints(&vd.dpi);
 
-	// This assert should never happen (because the length of the parent_list
-	//  is checked)
+	/* This assert should never happen (because the length of the parent_list
+	 *  is checked) */
 	assert(vd.parent_list <= endof(parent_list));
 
 	if (vd.first_tile != NULL) ViewportDrawTileSprites(vd.first_tile);
@@ -1290,8 +1291,8 @@
 	_cur_dpi = old_dpi;
 }
 
-// Make sure we don't draw a too big area at a time.
-// If we do, the sprite memory will overflow.
+/** Make sure we don't draw a too big area at a time.
+ * If we do, the sprite memory will overflow. */
 static void ViewportDrawChk(const ViewPort *vp, int left, int top, int right, int bottom)
 {
 	if (((bottom - top) * (right - left) << (2 * vp->zoom)) > 180000) {
@@ -1359,20 +1360,20 @@
 		int vx;
 		int vy;
 
-		// Center of the viewport is hot spot
+		/* Center of the viewport is hot spot */
 		x = WP(w,vp_d).scrollpos_x + vp->virtual_width / 2;
 		y = WP(w,vp_d).scrollpos_y + vp->virtual_height / 2;
-		// Convert viewport coordinates to map coordinates
-		// Calculation is scaled by 4 to avoid rounding errors
+		/* Convert viewport coordinates to map coordinates
+		 * Calculation is scaled by 4 to avoid rounding errors */
 		vx = -x + y * 2;
 		vy =  x + y * 2;
-		// clamp to size of map
+		/* clamp to size of map */
 		vx = clamp(vx, 0 * 4, MapMaxX() * TILE_SIZE * 4);
 		vy = clamp(vy, 0 * 4, MapMaxY() * TILE_SIZE * 4);
-		// Convert map coordinates to viewport coordinates
+		/* Convert map coordinates to viewport coordinates */
 		x = (-vx + vy) / 2;
 		y = ( vx + vy) / 4;
-		// Set position
+		/* Set position */
 		WP(w, vp_d).scrollpos_x = x - vp->virtual_width / 2;
 		WP(w, vp_d).scrollpos_y = y - vp->virtual_height / 2;
 
@@ -1859,13 +1860,13 @@
 	_thd.new_outersize.y = sy * TILE_SIZE;
 }
 
-/* returns the best autorail highlight type from map coordinates */
+/** returns the best autorail highlight type from map coordinates */
 static byte GetAutorailHT(int x, int y)
 {
 	return HT_RAIL | _AutorailPiece[x & 0xF][y & 0xF];
 }
 
-// called regular to update tile highlighting in all cases
+/** called regular to update tile highlighting in all cases */
 void UpdateTileSelection()
 {
 	int x1;
@@ -1912,13 +1913,13 @@
 		}
 	}
 
-	// redraw selection
+	/* redraw selection */
 	if (_thd.drawstyle != _thd.new_drawstyle ||
 			_thd.pos.x != _thd.new_pos.x || _thd.pos.y != _thd.new_pos.y ||
 			_thd.size.x != _thd.new_size.x || _thd.size.y != _thd.new_size.y ||
 	    _thd.outersize.x != _thd.new_outersize.x ||
 	    _thd.outersize.y != _thd.new_outersize.y) {
-		// clear the old selection?
+		/* clear the old selection? */
 		if (_thd.drawstyle) SetSelectionTilesDirty();
 
 		_thd.drawstyle = _thd.new_drawstyle;
@@ -1927,12 +1928,12 @@
 		_thd.outersize = _thd.new_outersize;
 		_thd.dirty = 0xff;
 
-		// draw the new selection?
+		/* draw the new selection? */
 		if (_thd.new_drawstyle) SetSelectionTilesDirty();
 	}
 }
 
-// highlighting tiles while only going over them with the mouse
+/** highlighting tiles while only going over them with the mouse */
 void VpStartPlaceSizing(TileIndex tile, int user)
 {
 	_thd.userdata = user;
@@ -1982,7 +1983,7 @@
 	_special_mouse_mode = WSM_PRESIZE;
 }
 
-/* returns information about the 2x1 piece to be build.
+/** returns information about the 2x1 piece to be build.
  * The lower bits (0-3) are the track type. */
 static byte Check2x1AutoRail(int mode)
 {
@@ -2133,7 +2134,7 @@
 
 static const StringID measure_strings_length[] = {STR_NULL, STR_MEASURE_LENGTH, STR_MEASURE_LENGTH_HEIGHTDIFF};
 
-// while dragging
+/** while dragging */
 static void CalcRaildirsDrawstyle(TileHighlightData *thd, int x, int y, int method)
 {
 	HighLightStyle b;
@@ -2384,7 +2385,7 @@
 	_thd.selend.y = y;
 }
 
-// while dragging
+/** while dragging */
 bool VpHandlePlaceSizingDrag()
 {
 	Window *w;
@@ -2394,14 +2395,14 @@
 
 	e.we.place.userdata = _thd.userdata;
 
-	// stop drag mode if the window has been closed
+	/* stop drag mode if the window has been closed */
 	w = FindWindowById(_thd.window_class,_thd.window_number);
 	if (w == NULL) {
 		ResetObjectToPlace();
 		return false;
 	}
 
-	// while dragging execute the drag procedure of the corresponding window (mostly VpSelectTilesWithMethod() )
+	/* while dragging execute the drag procedure of the corresponding window (mostly VpSelectTilesWithMethod() ) */
 	if (_left_button_down) {
 		e.event = WE_PLACE_DRAG;
 		e.we.place.pt = GetTileBelowCursor();
@@ -2409,8 +2410,8 @@
 		return false;
 	}
 
-	// mouse button released..
-	// keep the selected tool, but reset it to the original mode.
+	/* mouse button released..
+	 * keep the selected tool, but reset it to the original mode. */
 	_special_mouse_mode = WSM_NONE;
 	if (_thd.next_drawstyle == HT_RECT) {
 		_thd.place_mode = VHM_RECT;
@@ -2425,7 +2426,7 @@
 	}
 	SetTileSelectSize(1, 1);
 
-	// and call the mouseup event.
+	/* and call the mouseup event. */
 	e.event = WE_PLACE_MOUSEUP;
 	e.we.place.pt = _thd.selend;
 	e.we.place.tile = TileVirtXY(e.we.place.pt.x, e.we.place.pt.y);
@@ -2446,7 +2447,7 @@
 {
 	Window *w;
 
-	// undo clicking on button
+	/* undo clicking on button */
 	if (_thd.place_mode != 0) {
 		_thd.place_mode = 0;
 		w = FindWindowById(_thd.window_class, _thd.window_number);
--- a/src/viewport.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/viewport.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file viewport.h */
+
 #ifndef VIEWPORT_H
 #define VIEWPORT_H
 
@@ -15,7 +17,7 @@
 
 void SetSelectionRed(bool);
 
-/* viewport.c */
+/* viewport.cpp */
 void InitViewports();
 void DeleteWindowViewport(Window *w);
 void AssignWindowViewport(Window *w, int x, int y,
@@ -74,28 +76,28 @@
 	VPM_SIGNALDIRS      = 6
 };
 
-// viewport highlight mode (for highlighting tiles below cursor)
+/* viewport highlight mode (for highlighting tiles below cursor) */
 enum {
-	VHM_NONE    = 0, // default
-	VHM_RECT    = 1, // rectangle (stations, depots, ...)
-	VHM_POINT   = 2, // point (lower land, raise land, level land, ...)
-	VHM_SPECIAL = 3, // special mode used for highlighting while dragging (and for tunnels/docks)
-	VHM_DRAG    = 4, // dragging items in the depot windows
-	VHM_RAIL    = 5, // rail pieces
+	VHM_NONE    = 0, ///< default
+	VHM_RECT    = 1, ///< rectangle (stations, depots, ...)
+	VHM_POINT   = 2, ///< point (lower land, raise land, level land, ...)
+	VHM_SPECIAL = 3, ///< special mode used for highlighting while dragging (and for tunnels/docks)
+	VHM_DRAG    = 4, ///< dragging items in the depot windows
+	VHM_RAIL    = 5, ///< rail pieces
 };
 
 void VpSelectTilesWithMethod(int x, int y, int method);
 
-// highlighting draw styles
+/* highlighting draw styles */
 typedef byte HighLightStyle;
 enum HighLightStyles {
 	HT_NONE   = 0x00,
 	HT_RECT   = 0x80,
 	HT_POINT  = 0x40,
-	HT_LINE   = 0x20, /* used for autorail highlighting (longer streches)
-	                   * (uses lower bits to indicate direction) */
-	HT_RAIL   = 0x10, /* autorail (one piece)
-	                  * (uses lower bits to indicate direction) */
+	HT_LINE   = 0x20,    ///< used for autorail highlighting (longer streches)
+	                     ///< (uses lower bits to indicate direction)
+	HT_RAIL   = 0x10,    ///< autorail (one piece)
+	                     ///< (uses lower bits to indicate direction)
 	HT_DRAG_MASK = 0xF0, ///< masks the drag-type
 
 	/* lower bits (used with HT_LINE and HT_RAIL):
@@ -138,7 +140,7 @@
 };
 
 
-// common button handler
+/* common button handler */
 bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, int mode, PlaceProc *placeproc);
 
 VARDEF Point _tile_fract_coords;
--- a/src/void_map.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/void_map.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file void_map.h */
+
 #ifndef VOID_MAP_H
 #define VOID_MAP_H
 
--- a/src/water_cmd.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/water_cmd.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file water_cmd.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "bridge_map.h"
@@ -47,6 +49,7 @@
 
 /** Build a ship depot.
  * @param tile tile where ship depot is built
+ * @param flags type of operation
  * @param p1 bit 0 depot orientation (Axis)
  * @param p2 unused
  */
@@ -76,7 +79,7 @@
 	ret = DoCommand(tile2, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 	if (CmdFailed(ret)) return CMD_ERROR;
 
-	// pretend that we're not making land from the water even though we actually are.
+	/* pretend that we're not making land from the water even though we actually are. */
 	cost = 0;
 
 	depot = AllocateDepot();
@@ -120,25 +123,25 @@
 	return _price.remove_ship_depot;
 }
 
-// build a shiplift
+/** build a shiplift */
 static int32 DoBuildShiplift(TileIndex tile, DiagDirection dir, uint32 flags)
 {
 	int32 ret;
 	int delta;
 
-	// middle tile
+	/* middle tile */
 	ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 	if (CmdFailed(ret)) return CMD_ERROR;
 
 	delta = TileOffsByDiagDir(dir);
-	// lower tile
+	/* lower tile */
 	ret = DoCommand(tile - delta, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 	if (CmdFailed(ret)) return CMD_ERROR;
 	if (GetTileSlope(tile - delta, NULL) != SLOPE_FLAT) {
 		return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
 	}
 
-	// upper tile
+	/* upper tile */
 	ret = DoCommand(tile + delta, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 	if (CmdFailed(ret)) return CMD_ERROR;
 	if (GetTileSlope(tile + delta, NULL) != SLOPE_FLAT) {
@@ -167,7 +170,7 @@
 
 	if (!CheckTileOwnership(tile)) return CMD_ERROR;
 
-	// make sure no vehicle is on the tile.
+	/* make sure no vehicle is on the tile. */
 	if (!EnsureNoVehicle(tile) || !EnsureNoVehicle(tile + delta) || !EnsureNoVehicle(tile - delta))
 		return CMD_ERROR;
 
@@ -190,6 +193,7 @@
 
 /** Builds a lock (ship-lift)
  * @param tile tile where to place the lock
+ * @param flags type of operation
  * @param p1 unused
  * @param p2 unused
  */
@@ -211,6 +215,7 @@
 
 /** Build a piece of canal.
  * @param tile end tile of stretch-dragging
+ * @param flags type of operation
  * @param p1 start tile of stretch-dragging
  * @param p2 ctrl pressed - toggles ocean / canals at sealevel (ocean only allowed in the scenario editor)
  */
@@ -249,7 +254,7 @@
 			return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
 		}
 
-		// can't make water of water!
+		/* can't make water of water! */
 		if (IsTileType(tile, MP_WATER) && (!IsTileOwner(tile, OWNER_WATER) || HASBIT(p2, 0))) continue;
 
 		ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
@@ -282,10 +287,10 @@
 		case WATER_TILE_CLEAR:
 			if (flags & DC_NO_WATER) return_cmd_error(STR_3807_CAN_T_BUILD_ON_WATER);
 
-			// Make sure no vehicle is on the tile
+			/* Make sure no vehicle is on the tile */
 			if (!EnsureNoVehicle(tile)) return CMD_ERROR;
 
-			// Make sure it's not an edge tile.
+			/* Make sure it's not an edge tile. */
 			if (!IS_INT_INSIDE(TileX(tile), 1, MapMaxX() - 1) ||
 					!IS_INT_INSIDE(TileY(tile), 1, MapMaxY() - 1)) {
 				return_cmd_error(STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP);
@@ -299,10 +304,10 @@
 		case WATER_TILE_COAST: {
 			Slope slope = GetTileSlope(tile, NULL);
 
-			// Make sure no vehicle is on the tile
+			/* Make sure no vehicle is on the tile */
 			if (!EnsureNoVehicle(tile)) return CMD_ERROR;
 
-			// Make sure it's not an edge tile.
+			/* Make sure it's not an edge tile. */
 			if (!IS_INT_INSIDE(TileX(tile), 1, MapMaxX() - 1) ||
 					!IS_INT_INSIDE(TileY(tile), 1, MapMaxY() - 1)) {
 				return_cmd_error(STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP);
@@ -325,7 +330,7 @@
 
 			if (flags & DC_AUTO) return_cmd_error(STR_2004_BUILDING_MUST_BE_DEMOLISHED);
 			if (_current_player == OWNER_WATER) return CMD_ERROR;
-			// move to the middle tile..
+			/* move to the middle tile.. */
 			return RemoveShiplift(tile + ToTileIndexDiff(_shiplift_tomiddle_offs[GetSection(tile)]), flags);
 		}
 
@@ -339,7 +344,7 @@
 	}
 }
 
-// return true if a tile is a water tile.
+/** return true if a tile is a water tile. */
 static bool IsWateredTile(TileIndex tile)
 {
 	switch (GetTileType(tile)) {
@@ -362,12 +367,12 @@
 	}
 }
 
-// draw a canal styled water tile with dikes around
+/** draw a canal styled water tile with dikes around */
 void DrawCanalWater(TileIndex tile)
 {
 	uint wa;
 
-	// determine the edges around with water.
+	/* determine the edges around with water. */
 	wa = IsWateredTile(TILE_ADDXY(tile, -1, 0)) << 0;
 	wa += IsWateredTile(TILE_ADDXY(tile, 0, 1)) << 1;
 	wa += IsWateredTile(TILE_ADDXY(tile, 1, 0)) << 2;
@@ -378,25 +383,25 @@
 	if (!(wa & 4)) DrawGroundSprite(SPR_CANALS_BASE + 59, PAL_NONE);
 	if (!(wa & 8)) DrawGroundSprite(SPR_CANALS_BASE + 60, PAL_NONE);
 
-	// right corner
+	/* right corner */
 	switch (wa & 0x03) {
 		case 0: DrawGroundSprite(SPR_CANALS_BASE + 57 + 4, PAL_NONE); break;
 		case 3: if (!IsWateredTile(TILE_ADDXY(tile, -1, 1))) DrawGroundSprite(SPR_CANALS_BASE + 57 + 8, PAL_NONE); break;
 	}
 
-	// bottom corner
+	/* bottom corner */
 	switch (wa & 0x06) {
 		case 0: DrawGroundSprite(SPR_CANALS_BASE + 57 + 5, PAL_NONE); break;
 		case 6: if (!IsWateredTile(TILE_ADDXY(tile, 1, 1))) DrawGroundSprite(SPR_CANALS_BASE + 57 + 9, PAL_NONE); break;
 	}
 
-	// left corner
+	/* left corner */
 	switch (wa & 0x0C) {
 		case  0: DrawGroundSprite(SPR_CANALS_BASE + 57 + 6, PAL_NONE); break;
 		case 12: if (!IsWateredTile(TILE_ADDXY(tile, 1, -1))) DrawGroundSprite(SPR_CANALS_BASE + 57 + 10, PAL_NONE); break;
 	}
 
-	// upper corner
+	/* upper corner */
 	switch (wa & 0x09) {
 		case 0: DrawGroundSprite(SPR_CANALS_BASE + 57 + 7, PAL_NONE); break;
 		case 9: if (!IsWateredTile(TILE_ADDXY(tile, -1, -1))) DrawGroundSprite(SPR_CANALS_BASE + 57 + 11, PAL_NONE); break;
@@ -421,7 +426,7 @@
 		SpriteID image = wdts->image + base;
 		SpriteID pal;
 
-		if (_display_opt & DO_TRANS_BUILDINGS) {
+		if (HASBIT(_transparent_opt, TO_BUILDINGS)) {
 			SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 			pal = PALETTE_TO_TRANSPARENT;
 		} else {
@@ -524,7 +529,7 @@
 {
 	TileIndex target = TILE_ADD(tile, ToTileIndexDiff(offs[0]));
 
-	// type of this tile mustn't be water already.
+	/* type of this tile mustn't be water already. */
 	if (IsTileType(target, MP_WATER)) return;
 
 	if (TileHeight(TILE_ADD(tile, ToTileIndexDiff(offs[1]))) != 0 ||
@@ -534,7 +539,7 @@
 
 	if (TileHeight(TILE_ADD(tile, ToTileIndexDiff(offs[3]))) != 0 ||
 			TileHeight(TILE_ADD(tile, ToTileIndexDiff(offs[4]))) != 0) {
-		// make coast..
+		/* make coast.. */
 		switch (GetTileType(target)) {
 			case MP_RAILWAY: {
 				TrackBits tracks;
@@ -626,7 +631,7 @@
 			u = v;
 			if (IsFrontEngine(v)) pass = 4; // driver
 
-			// crash all wagons, and count passangers
+			/* crash all wagons, and count passangers */
 			BEGIN_ENUM_WAGONS(v)
 				if (IsCargoInClass(v->cargo_type, CC_PASSENGERS)) pass += v->cargo_count;
 				v->vehstatus |= VS_CRASHED;
@@ -653,7 +658,7 @@
 	}
 }
 
-// called from tunnelbridge_cmd, and by TileLoop_Industry()
+/** called from tunnelbridge_cmd, and by TileLoop_Industry() */
 void TileLoop_Water(TileIndex tile)
 {
 	static const TileIndexDiffC _tile_loop_offs_array[][5] = {
@@ -675,11 +680,10 @@
 			TileLoopWaterHelper(tile, _tile_loop_offs_array[i]);
 		}
 	}
-	// _current_player can be changed by TileLoopWaterHelper.. reset it back
-	//   here
+	/* _current_player can be changed by TileLoopWaterHelper.. reset it back here */
 	_current_player = OWNER_NONE;
 
-	// edges
+	/* edges */
 	if (TileX(tile) == 0 && IS_INT_INSIDE(TileY(tile), 1, MapSizeY() - 3 + 1)) { //NE
 		TileLoopWaterHelper(tile, _tile_loop_offs_array[2]);
 	}
@@ -713,11 +717,11 @@
 		default: return 0;
 	}
 	if (TileX(tile) == 0) {
-		// NE border: remove tracks that connects NE tile edge
+		/* NE border: remove tracks that connects NE tile edge */
 		ts &= ~(TRACK_BIT_X | TRACK_BIT_UPPER | TRACK_BIT_RIGHT);
 	}
 	if (TileY(tile) == 0) {
-		// NW border: remove tracks that connects NW tile edge
+		/* NW border: remove tracks that connects NW tile edge */
 		ts &= ~(TRACK_BIT_Y | TRACK_BIT_LEFT | TRACK_BIT_UPPER);
 	}
 	return ts * 0x101;
--- a/src/water_map.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/water_map.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file water_map.h */
+
 #ifndef WATER_MAP_H
 #define WATER_MAP_H
 
--- a/src/waypoint.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/waypoint.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file waypoint.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 
@@ -39,7 +41,9 @@
 
 DEFINE_OLD_POOL(Waypoint, Waypoint, WaypointPoolNewBlock, NULL)
 
-/* Create a new waypoint */
+/**
+ * Create a new waypoint
+ * @return a pointer to the newly created Waypoint */
 static Waypoint* AllocateWaypoint()
 {
 	Waypoint *wp;
@@ -63,7 +67,9 @@
 	return NULL;
 }
 
-/* Update the sign for the waypoint */
+/**
+ * Update the sign for the waypoint
+ * @param wp Waypoint to update sign */
 static void UpdateWaypointSign(Waypoint* wp)
 {
 	Point pt = RemapCoords2(TileX(wp->xy) * TILE_SIZE, TileY(wp->xy) * TILE_SIZE);
@@ -71,7 +77,9 @@
 	UpdateViewportSignPos(&wp->sign, pt.x, pt.y - 0x20, STR_WAYPOINT_VIEWPORT);
 }
 
-/* Redraw the sign of a waypoint */
+/**
+ * Redraw the sign of a waypoint
+ * @param wp Waypoint to redraw sign */
 static void RedrawWaypointSign(const Waypoint* wp)
 {
 	MarkAllViewportsDirty(
@@ -81,7 +89,9 @@
 		wp->sign.top + 48);
 }
 
-/* Update all signs */
+/**
+ * Update all signs
+ */
 void UpdateAllWaypointSigns()
 {
 	Waypoint *wp;
@@ -91,7 +101,10 @@
 	}
 }
 
-/* Internal handler to delete a waypoint */
+/**
+ * Internal handler to delete a waypoint
+ * @param wp Waypoint to delete
+ */
 void DestroyWaypoint(Waypoint *wp)
 {
 	RemoveOrderFromAllVehicles(OT_GOTO_WAYPOINT, wp->index);
@@ -101,7 +114,10 @@
 	RedrawWaypointSign(wp);
 }
 
-/* Set the default name for a waypoint */
+/**
+ * Set the default name for a waypoint
+ * @param wp Waypoint to work on
+ */
 static void MakeDefaultWaypointName(Waypoint* wp)
 {
 	Waypoint *local_wp;
@@ -127,7 +143,10 @@
 	wp->town_cn = i;
 }
 
-/* Find a deleted waypoint close to a tile. */
+/**
+ * Find a deleted waypoint close to a tile.
+ * @param tile to search from
+ */
 static Waypoint *FindDeletedWaypointCloseTo(TileIndex tile)
 {
 	Waypoint *wp, *best = NULL;
@@ -173,6 +192,7 @@
 /** Convert existing rail to waypoint. Eg build a waypoint station over
  * piece of rail
  * @param tile tile where waypoint will be built
+ * @param flags type of operation
  * @param p1 graphics for waypoint type, 0 indicates standard graphics
  * @param p2 unused
  *
@@ -233,7 +253,7 @@
 			wp->grfid = statspec->grfid;
 			wp->localidx = statspec->localidx;
 		} else {
-			// Specified custom graphics do not exist, so use default.
+			/* Specified custom graphics do not exist, so use default. */
 			wp->stat_id = 0;
 			wp->grfid = 0;
 			wp->localidx = 0;
@@ -253,7 +273,9 @@
 	return _price.build_train_depot;
 }
 
-/* Daily loop for waypoints */
+/**
+ * Daily loop for waypoints
+ */
 void WaypointsDailyLoop()
 {
 	Waypoint *wp;
@@ -264,7 +286,13 @@
 	}
 }
 
-/* Remove a waypoint */
+/**
+ * Remove a waypoint
+ * @param tile from which to remove waypoint
+ * @param flags type of operation
+ * @param justremove will indicate if it is removed from rail or if rails are removed too
+ * @return cost of operation or error
+ */
 int32 RemoveTrainWaypoint(TileIndex tile, uint32 flags, bool justremove)
 {
 	Waypoint *wp;
@@ -297,10 +325,13 @@
 	return _price.remove_train_depot;
 }
 
-/** Delete a waypoint
+/**
+ * Delete a waypoint
  * @param tile tile where waypoint is to be deleted
+ * @param flags type of operation
  * @param p1 unused
  * @param p2 unused
+ * @return cost of operation or error
  */
 int32 CmdRemoveTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
@@ -308,10 +339,13 @@
 	return RemoveTrainWaypoint(tile, flags, true);
 }
 
-/** Rename a waypoint.
+/**
+ * Rename a waypoint.
  * @param tile unused
+ * @param flags type of operation
  * @param p1 id of waypoint
  * @param p2 unused
+ * @return cost of operation or error
  */
 int32 CmdRenameWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
@@ -349,7 +383,11 @@
 	return 0;
 }
 
-/* This hacks together some dummy one-shot Station structure for a waypoint. */
+/**
+ * This hacks together some dummy one-shot Station structure for a waypoint.
+ * @param tile on which to work
+ * @return pointer to a Station
+ */
 Station *ComposeWaypointStation(TileIndex tile)
 {
 	Waypoint *wp = GetWaypointByTile(tile);
@@ -367,7 +405,13 @@
 	return &stat;
 }
 
-/* Draw a waypoint */
+/**
+ * Draw a waypoint
+ * @param x coordinate
+ * @param y coordinate
+ * @param stat_id station id
+ * @param railtype RailType to use for
+ */
 void DrawWaypointSprite(int x, int y, int stat_id, RailType railtype)
 {
 	x += 33;
@@ -378,7 +422,9 @@
 	}
 }
 
-/* Fix savegames which stored waypoints in their old format */
+/**
+ * Fix savegames which stored waypoints in their old format
+ */
 void FixOldWaypoints()
 {
 	Waypoint *wp;
--- a/src/waypoint.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/waypoint.h	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file waypoint.h */
+
 #ifndef WAYPOINT_H
 #define WAYPOINT_H
 
@@ -28,6 +30,8 @@
 
 /**
  * Check if a Waypoint really exists.
+ * @param wp Waypoint to query
+ * @return the validity of the waypoint
  */
 static inline bool IsValidWaypoint(const Waypoint *wp)
 {
--- a/src/widget.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/widget.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file widget.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "functions.h"
@@ -52,7 +54,7 @@
 
 	switch (wi->type) {
 		case WWT_SCROLLBAR: {
-			// vertical scroller
+			/* vertical scroller */
 			w->flags4 &= ~WF_HSCROLL;
 			w->flags4 &= ~WF_SCROLL2;
 			mi = wi->top;
@@ -62,7 +64,7 @@
 			break;
 		}
 		case WWT_SCROLL2BAR: {
-			// 2nd vertical scroller
+			/* 2nd vertical scroller */
 			w->flags4 &= ~WF_HSCROLL;
 			w->flags4 |= WF_SCROLL2;
 			mi = wi->top;
@@ -72,7 +74,7 @@
 			break;
 		}
 		case  WWT_HSCROLLBAR: {
-			// horizontal scroller
+			/* horizontal scroller */
 			w->flags4 &= ~WF_SCROLL2;
 			w->flags4 |= WF_HSCROLL;
 			mi = wi->left;
@@ -84,7 +86,7 @@
 		default: return; //this should never happen
 	}
 	if (pos <= mi+9) {
-		// Pressing the upper button?
+		/* Pressing the upper button? */
 		w->flags4 |= WF_SCROLL_UP;
 		if (_scroller_click_timeout == 0) {
 			_scroller_click_timeout = 6;
@@ -92,7 +94,7 @@
 		}
 		_left_button_clicked = false;
 	} else if (pos >= ma-10) {
-		// Pressing the lower button?
+		/* Pressing the lower button? */
 		w->flags4 |= WF_SCROLL_DOWN;
 
 		if (_scroller_click_timeout == 0) {
@@ -102,7 +104,6 @@
 		}
 		_left_button_clicked = false;
 	} else {
-		//
 		Point pt = HandleScrollbarHittest(sb, mi, ma);
 
 		if (pos < pt.x) {
@@ -127,7 +128,8 @@
 /** Returns the index for the widget located at the given position
  * relative to the window. It includes all widget-corner pixels as well.
  * @param *w Window to look inside
- * @param  x,y Window client coordinates
+ * @param  x
+ * @param  y Window client coordinates
  * @return A widget index, or -1 if no widget was found.
  */
 int GetWidgetFromPos(const Window *w, int x, int y)
@@ -135,8 +137,8 @@
 	uint index;
 	int found_index = -1;
 
-	// Go through the widgets and check if we find the widget that the coordinate is
-	// inside.
+	/* Go through the widgets and check if we find the widget that the coordinate is
+	 * inside. */
 	for (index = 0; index < w->widget_count; index++) {
 		const Widget *wi = &w->widget[index];
 		if (wi->type == WWT_EMPTY || wi->type == WWT_FRAME) continue;
@@ -294,14 +296,14 @@
 			goto draw_default;
 		}
 
-		// vertical scrollbar
+		/* vertical scrollbar */
 		case WWT_SCROLLBAR: {
 			Point pt;
 			int c1,c2;
 
 			assert(r.right - r.left == 11); // XXX - to ensure the same sizes are used everywhere!
 
-			// draw up/down buttons
+			/* draw up/down buttons */
 			clicked = ((w->flags4 & (WF_SCROLL_UP | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_UP);
 			DrawFrameRect(r.left, r.top, r.right, r.top + 9, wi->color, (clicked) ? FR_LOWERED : FR_NONE);
 			DoDrawString(UPARROW, r.left + 2 + clicked, r.top + clicked, 0x10);
@@ -313,11 +315,11 @@
 			c1 = _colour_gradient[wi->color&0xF][3];
 			c2 = _colour_gradient[wi->color&0xF][7];
 
-			// draw "shaded" background
+			/* draw "shaded" background */
 			GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c2);
 			GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c1 | (1 << PALETTE_MODIFIER_GREYOUT));
 
-			// draw shaded lines
+			/* draw shaded lines */
 			GfxFillRect(r.left+2, r.top+10, r.left+2, r.bottom-10, c1);
 			GfxFillRect(r.left+3, r.top+10, r.left+3, r.bottom-10, c2);
 			GfxFillRect(r.left+7, r.top+10, r.left+7, r.bottom-10, c1);
@@ -333,7 +335,7 @@
 
 			assert(r.right - r.left == 11); // XXX - to ensure the same sizes are used everywhere!
 
-			// draw up/down buttons
+			/* draw up/down buttons */
 			clicked = ((w->flags4 & (WF_SCROLL_UP | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_UP | WF_SCROLL2));
 			DrawFrameRect(r.left, r.top, r.right, r.top + 9, wi->color,  (clicked) ? FR_LOWERED : FR_NONE);
 			DoDrawString(UPARROW, r.left + 2 + clicked, r.top + clicked, 0x10);
@@ -345,11 +347,11 @@
 			c1 = _colour_gradient[wi->color&0xF][3];
 			c2 = _colour_gradient[wi->color&0xF][7];
 
-			// draw "shaded" background
+			/* draw "shaded" background */
 			GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c2);
 			GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c1 | (1 << PALETTE_MODIFIER_GREYOUT));
 
-			// draw shaded lines
+			/* draw shaded lines */
 			GfxFillRect(r.left+2, r.top+10, r.left+2, r.bottom-10, c1);
 			GfxFillRect(r.left+3, r.top+10, r.left+3, r.bottom-10, c2);
 			GfxFillRect(r.left+7, r.top+10, r.left+7, r.bottom-10, c1);
@@ -360,7 +362,7 @@
 			break;
 		}
 
-		// horizontal scrollbar
+		/* horizontal scrollbar */
 		case WWT_HSCROLLBAR: {
 			Point pt;
 			int c1,c2;
@@ -378,17 +380,17 @@
 			c1 = _colour_gradient[wi->color&0xF][3];
 			c2 = _colour_gradient[wi->color&0xF][7];
 
-			// draw "shaded" background
+			/* draw "shaded" background */
 			GfxFillRect(r.left+10, r.top, r.right-10, r.bottom, c2);
 			GfxFillRect(r.left+10, r.top, r.right-10, r.bottom, c1 | (1 << PALETTE_MODIFIER_GREYOUT));
 
-			// draw shaded lines
+			/* draw shaded lines */
 			GfxFillRect(r.left+10, r.top+2, r.right-10, r.top+2, c1);
 			GfxFillRect(r.left+10, r.top+3, r.right-10, r.top+3, c2);
 			GfxFillRect(r.left+10, r.top+7, r.right-10, r.top+7, c1);
 			GfxFillRect(r.left+10, r.top+8, r.right-10, r.top+8, c2);
 
-			// draw actual scrollbar
+			/* draw actual scrollbar */
 			pt = HandleScrollbarHittest(&w->hscroll, r.left, r.right);
 			DrawFrameRect(pt.x, r.top, pt.y, r.bottom, wi->color, (w->flags4 & (WF_SCROLL_MIDDLE | WF_HSCROLL)) == (WF_SCROLL_MIDDLE | WF_HSCROLL) ? FR_LOWERED : FR_NONE);
 
@@ -404,19 +406,19 @@
 			c1 = _colour_gradient[wi->color][3];
 			c2 = _colour_gradient[wi->color][7];
 
-			//Line from upper left corner to start of text
+			/*Line from upper left corner to start of text */
 			GfxFillRect(r.left, r.top+4, r.left+4,r.top+4, c1);
 			GfxFillRect(r.left+1, r.top+5, r.left+4,r.top+5, c2);
 
-			// Line from end of text to upper right corner
+			/* Line from end of text to upper right corner */
 			GfxFillRect(x2, r.top+4, r.right-1,r.top+4,c1);
 			GfxFillRect(x2, r.top+5, r.right-2,r.top+5,c2);
 
-			// Line from upper left corner to bottom left corner
+			/* Line from upper left corner to bottom left corner */
 			GfxFillRect(r.left, r.top+5, r.left, r.bottom-1, c1);
 			GfxFillRect(r.left+1, r.top+6, r.left+1, r.bottom-2, c2);
 
-			//Line from upper right corner to bottom right corner
+			/*Line from upper right corner to bottom right corner */
 			GfxFillRect(r.right-1, r.top+5, r.right-1, r.bottom-2, c1);
 			GfxFillRect(r.right, r.top+4, r.right, r.bottom-1, c2);
 
@@ -501,7 +503,7 @@
 	if (item >= WP(w,dropdown_d).num_items || (HASBIT(WP(w,dropdown_d).disabled_state, item) && !HASBIT(WP(w,dropdown_d).hidden_state, item)) || WP(w,dropdown_d).items[item] == 0)
 		return - 1;
 
-	// Skip hidden items -- +1 for each hidden item before the clicked item.
+	/* Skip hidden items -- +1 for each hidden item before the clicked item. */
 	for (counter = 0; item >= counter; ++counter)
 		if (HASBIT(WP(w,dropdown_d).hidden_state, counter)) item++;
 
--- a/src/win32.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/win32.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -84,7 +84,7 @@
 	MyShowCursor(true);
 	MessageBox(GetActiveWindow(), MB_TO_WIDE(buf), _T("Error!"), MB_ICONSTOP);
 
-// if exception tracker is enabled, we crash here to let the exception handler handle it.
+/* if exception tracker is enabled, we crash here to let the exception handler handle it. */
 #if defined(WIN32_EXCEPTION_TRACKER) && !defined(_DEBUG)
 	if (*buf == '!') {
 		_exception_string = buf;
@@ -747,7 +747,7 @@
 
 bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb)
 {
-	// hectonanoseconds between Windows and POSIX epoch
+	/* hectonanoseconds between Windows and POSIX epoch */
 	static const int64 posix_epoch_hns = 0x019DB1DED53E8000LL;
 	const WIN32_FIND_DATA *fd = &ent->dir->fd;
 
@@ -790,13 +790,13 @@
 	int n = 0;
 
 	do {
-		// skip whitespace
+		/* skip whitespace */
 		while (*line == ' ' || *line == '\t') line++;
 
-		// end?
+		/* end? */
 		if (*line == '\0') break;
 
-		// special handling when quoted
+		/* special handling when quoted */
 		if (*line == '"') {
 			argv[n++] = ++line;
 			while (*line != '"') {
@@ -831,13 +831,13 @@
 	coninfo.dwSize.Y = 500;
 	SetConsoleScreenBufferSize(hand, coninfo.dwSize);
 
-	// redirect unbuffered STDIN, STDOUT, STDERR to the console
+	/* redirect unbuffered STDIN, STDOUT, STDERR to the console */
 #if !defined(__CYGWIN__)
 	*stdout = *_fdopen( _open_osfhandle((intptr_t)hand, _O_TEXT), "w" );
 	*stdin = *_fdopen(_open_osfhandle((intptr_t)GetStdHandle(STD_INPUT_HANDLE), _O_TEXT), "r" );
 	*stderr = *_fdopen(_open_osfhandle((intptr_t)GetStdHandle(STD_ERROR_HANDLE), _O_TEXT), "w" );
 #else
-	// open_osfhandle is not in cygwin
+	/* open_osfhandle is not in cygwin */
 	*stdout = *fdopen(1, "w" );
 	*stdin = *fdopen(0, "r" );
 	*stderr = *fdopen(2, "w" );
@@ -946,6 +946,7 @@
 void DetermineBasePaths(const char *exe)
 {
 	_paths.personal_dir = _paths.game_data_dir = MallocT<char>(MAX_PATH);
+	_paths.second_data_dir = NULL;
 #if defined(UNICODE)
 	TCHAR path[MAX_PATH];
 	GetCurrentDirectory(MAX_PATH - 1, path);
@@ -1036,8 +1037,8 @@
 }
 
 
-// Utility function to get the current timestamp in milliseconds
-// Useful for profiling
+/** Utility function to get the current timestamp in milliseconds
+ * Useful for profiling */
 int64 GetTS()
 {
 	static double freq;
--- a/src/window.cpp	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/window.cpp	Sun Apr 08 14:46:55 2007 +0000
@@ -18,7 +18,7 @@
 #include "genworld.h"
 #include "helpers.hpp"
 
-// delta between mouse cursor and upper left corner of dragged window
+/* delta between mouse cursor and upper left corner of dragged window */
 static Point _drag_delta;
 
 static Window _windows[25];
@@ -101,7 +101,7 @@
 
 	if (w->desc_flags & WDF_DEF_WIDGET) {
 		e.we.click.widget = GetWidgetFromPos(w, x, y);
-		if (e.we.click.widget < 0) return; /* exit if clicked outside of widgets */
+		if (e.we.click.widget < 0) return; // exit if clicked outside of widgets
 
 		/* don't allow any interaction if the button has been disabled */
 		if (IsWindowWidgetDisabled(w, e.we.click.widget)) return;
@@ -157,7 +157,7 @@
 	if (w->desc_flags & WDF_STD_TOOLTIPS) {
 		e.we.click.widget = GetWidgetFromPos(w, x, y);
 		if (e.we.click.widget < 0)
-			return; /* exit if clicked outside of widgets */
+			return; // exit if clicked outside of widgets
 
 		if (w->widget[e.we.click.widget].tooltips != 0) {
 			GuiShowTooltips(w->widget[e.we.click.widget].tooltips);
@@ -596,7 +596,7 @@
 		DeleteWindow(w);
 	}
 
-	// Set up window properties
+	/* Set up window properties */
 	memset(w, 0, sizeof(*w));
 	w->window_class = cls;
 	w->flags4 = WF_WHITE_BORDER_MASK; // just opened windows have a white border
@@ -685,7 +685,7 @@
 	if (left < 0 || top < 22 || right > _screen.width || bottom > _screen.height)
 		return false;
 
-	// Make sure it is not obscured by any window.
+	/* Make sure it is not obscured by any window. */
 	FOR_ALL_WINDOWS(wz) {
 		const Window *w = *wz;
 		if (w->window_class == WC_MAIN_WINDOW) continue;
@@ -714,7 +714,7 @@
 	if (left < -(width>>2) || left > _screen.width - (width>>1)) return false;
 	if (top < 22 || top > _screen.height - (height>>2)) return false;
 
-	// Make sure it is not obscured by any window.
+	/* Make sure it is not obscured by any window. */
 	FOR_ALL_WINDOWS(wz) {
 		const Window *w = *wz;
 		if (w->window_class == WC_MAIN_WINDOW) continue;
@@ -936,7 +936,7 @@
 
 	for (wz = _last_z_window; wz != _z_windows;) {
 		w = *--wz;
-		// Unclick scrollbar buttons if they are pressed.
+		/* Unclick scrollbar buttons if they are pressed. */
 		if (w->flags4 & (WF_SCROLL_DOWN | WF_SCROLL_UP)) {
 			w->flags4 &= ~(WF_SCROLL_DOWN | WF_SCROLL_UP);
 			SetWindowDirty(w);
@@ -993,7 +993,7 @@
 	ResetObjectToPlace();
 
 	if (w != NULL) {
-		// send an event in client coordinates.
+		/* send an event in client coordinates. */
 		e.event = WE_DRAGDROP;
 		e.we.dragdrop.pt.x = _cursor.pos.x - w->left;
 		e.we.dragdrop.pt.y = _cursor.pos.y - w->top;
@@ -1038,7 +1038,7 @@
 
 	w = FindWindowFromPt(_cursor.pos.x, _cursor.pos.y);
 
-	// We changed window, put a MOUSEOVER event to the last window
+	/* We changed window, put a MOUSEOVER event to the last window */
 	if (last_w != NULL && last_w != w) {
 		e.event = WE_MOUSEOVER;
 		e.we.mouseover.pt.x = -1;
@@ -1048,7 +1048,7 @@
 	last_w = w;
 
 	if (w != NULL) {
-		// send an event in client coordinates.
+		/* send an event in client coordinates. */
 		e.event = WE_MOUSEOVER;
 		e.we.mouseover.pt.x = _cursor.pos.x - w->left;
 		e.we.mouseover.pt.y = _cursor.pos.y - w->top;
@@ -1058,7 +1058,7 @@
 		w->wndproc(w, &e);
 	}
 
-	// Mouseover never stops execution
+	/* Mouseover never stops execution */
 	return true;
 }
 
@@ -1117,10 +1117,10 @@
 static bool HandleWindowDragging()
 {
 	Window* const *wz;
-	// Get out immediately if no window is being dragged at all.
+	/* Get out immediately if no window is being dragged at all. */
 	if (!_dragging_window) return true;
 
-	// Otherwise find the window...
+	/* Otherwise find the window... */
 	FOR_ALL_WINDOWS(wz) {
 		Window *w = *wz;
 
@@ -1132,7 +1132,7 @@
 			int nx;
 			int ny;
 
-			// Stop the dragging if the left mouse button was released
+			/* Stop the dragging if the left mouse button was released */
 			if (!_left_button_down) {
 				w->flags4 &= ~WF_DRAGGING;
 				break;
@@ -1158,14 +1158,14 @@
 					if (v == w) continue; // Don't snap at yourself
 
 					if (y + w->height > v->top && y < v->top + v->height) {
-						// Your left border <-> other right border
+						/* Your left border <-> other right border */
 						delta = abs(v->left + v->width - x);
 						if (delta <= hsnap) {
 							nx = v->left + v->width;
 							hsnap = delta;
 						}
 
-						// Your right border <-> other left border
+						/* Your right border <-> other left border */
 						delta = abs(v->left - x - w->width);
 						if (delta <= hsnap) {
 							nx = v->left - w->width;
@@ -1174,14 +1174,14 @@
 					}
 
 					if (w->top + w->height >= v->top && w->top <= v->top + v->height) {
-						// Your left border <-> other left border
+						/* Your left border <-> other left border */
 						delta = abs(v->left - x);
 						if (delta <= hsnap) {
 							nx = v->left;
 							hsnap = delta;
 						}
 
-						// Your right border <-> other right border
+						/* Your right border <-> other right border */
 						delta = abs(v->left + v->width - x - w->width);
 						if (delta <= hsnap) {
 							nx = v->left + v->width - w->width;
@@ -1190,14 +1190,14 @@
 					}
 
 					if (x + w->width > v->left && x < v->left + v->width) {
-						// Your top border <-> other bottom border
+						/* Your top border <-> other bottom border */
 						delta = abs(v->top + v->height - y);
 						if (delta <= vsnap) {
 							ny = v->top + v->height;
 							vsnap = delta;
 						}
 
-						// Your bottom border <-> other top border
+						/* Your bottom border <-> other top border */
 						delta = abs(v->top - y - w->height);
 						if (delta <= vsnap) {
 							ny = v->top - w->height;
@@ -1206,14 +1206,14 @@
 					}
 
 					if (w->left + w->width >= v->left && w->left <= v->left + v->width) {
-						// Your top border <-> other top border
+						/* Your top border <-> other top border */
 						delta = abs(v->top - y);
 						if (delta <= vsnap) {
 							ny = v->top;
 							vsnap = delta;
 						}
 
-						// Your bottom border <-> other bottom border
+						/* Your bottom border <-> other bottom border */
 						delta = abs(v->top + v->height - y - w->height);
 						if (delta <= vsnap) {
 							ny = v->top + v->height - w->height;
@@ -1223,12 +1223,12 @@
 				}
 			}
 
-			// Make sure the window doesn't leave the screen
-			// 13 is the height of the title bar
+			/* Make sure the window doesn't leave the screen
+			 * 13 is the height of the title bar */
 			nx = clamp(nx, 13 - t->right, _screen.width - 13 - t->left);
 			ny = clamp(ny, 0, _screen.height - 13);
 
-			// Make sure the title bar isn't hidden by behind the main tool bar
+			/* Make sure the title bar isn't hidden by behind the main tool bar */
 			v = FindWindowById(WC_MAIN_TOOLBAR, 0);
 			if (v != NULL) {
 				int v_bottom = v->top + v->height;
@@ -1345,15 +1345,15 @@
 	int pos;
 	Scrollbar *sb;
 
-	// Get out quickly if no item is being scrolled
+	/* Get out quickly if no item is being scrolled */
 	if (!_scrolling_scrollbar) return true;
 
-	// Find the scrolling window
+	/* Find the scrolling window */
 	FOR_ALL_WINDOWS(wz) {
 		Window *w = *wz;
 
 		if (w->flags4 & WF_SCROLL_MIDDLE) {
-			// Abort if no button is clicked any more.
+			/* Abort if no button is clicked any more. */
 			if (!_left_button_down) {
 				w->flags4 &= ~WF_SCROLL_MIDDLE;
 				SetWindowDirty(w);
@@ -1371,7 +1371,7 @@
 				i = _cursor.pos.y - _cursorpos_drag_start.y;
 			}
 
-			// Find the item we want to move to and make sure it's inside bounds.
+			/* Find the item we want to move to and make sure it's inside bounds. */
 			pos = min(max(0, i + _scrollbar_start_pos) * sb->count / _scrollbar_size, max(0, sb->count - sb->cap));
 			if (pos != sb->pos) {
 				sb->pos = pos;
@@ -1482,7 +1482,7 @@
 }
 
 /** Send a message from one window to another. The receiving window is found by
- * @param w @see Window pointer pointing to the other window
+ * @param w see Window pointer pointing to the other window
  * @param msg Specifies the message to be sent
  * @param wparam Specifies additional message-specific information
  * @param lparam Specifies additional message-specific information
@@ -1500,8 +1500,8 @@
 }
 
 /** Send a message from one window to another. The receiving window is found by
- * @param wnd_class @see WindowClass class AND
- * @param wnd_num @see WindowNumber number, mostly 0
+ * @param wnd_class see WindowClass class AND
+ * @param wnd_num see WindowNumber number, mostly 0
  * @param msg Specifies the message to be sent
  * @param wparam Specifies additional message-specific information
  * @param lparam Specifies additional message-specific information
@@ -1514,7 +1514,7 @@
 
 /** Send a message from one window to another. The message will be sent
  * to ALL windows of the windowclass specified in the first parameter
- * @param wnd_class @see WindowClass class
+ * @param wnd_class see WindowClass class
  * @param msg Specifies the message to be sent
  * @param wparam Specifies additional message-specific information
  * @param lparam Specifies additional message-specific information
@@ -1551,13 +1551,13 @@
 	*/
 	if (!IsGeneratingWorld()) _current_player = _local_player;
 
-	// Setup event
+	/* Setup event */
 	e.event = WE_KEYPRESS;
 	e.we.keypress.key     = GB(key,  0, 16);
 	e.we.keypress.keycode = GB(key, 16, 16);
 	e.we.keypress.cont = true;
 
-	// check if we have a query string window open before allowing hotkeys
+	/* check if we have a query string window open before allowing hotkeys */
 	if (FindWindowById(WC_QUERY_STRING,       0) != NULL ||
 			FindWindowById(WC_SEND_NETWORK_MSG,   0) != NULL ||
 			FindWindowById(WC_GENERATE_LANDSCAPE, 0) != NULL ||
@@ -1566,11 +1566,11 @@
 		query_open = true;
 	}
 
-	// Call the event, start with the uppermost window.
+	/* Call the event, start with the uppermost window. */
 	for (wz = _last_z_window; wz != _z_windows;) {
 		Window *w = *--wz;
 
-		// if a query window is open, only call the event for certain window types
+		/* if a query window is open, only call the event for certain window types */
 		if (query_open &&
 				w->window_class != WC_QUERY_STRING &&
 				w->window_class != WC_SEND_NETWORK_MSG &&
@@ -1585,7 +1585,7 @@
 
 	if (e.we.keypress.cont) {
 		Window *w = FindWindowById(WC_MAIN_TOOLBAR, 0);
-		// When there is no toolbar w is null, check for that
+		/* When there is no toolbar w is null, check for that */
 		if (w != NULL) w->wndproc(w, &e);
 	}
 }
@@ -1616,7 +1616,7 @@
 		if (vp != NULL) {
 			x -= vp->left;
 			y -= vp->top;
-			//here allows scrolling in both x and y axis
+			/* here allows scrolling in both x and y axis */
 #define scrollspeed 3
 			if (x - 15 < 0) {
 				WP(w, vp_d).scrollpos_x += (x - 15) * scrollspeed << vp->zoom;
@@ -1685,7 +1685,7 @@
 			case 1:
 				DEBUG(misc, 2, "Cursor: 0x%X (%d)", _cursor.sprite, _cursor.sprite);
 				if (_thd.place_mode != 0 &&
-						// query button and place sign button work in pause mode
+						/* query button and place sign button work in pause mode */
 						_cursor.sprite != SPR_CURSOR_QUERY &&
 						_cursor.sprite != SPR_CURSOR_SIGN &&
 						_pause_game != 0 &&
@@ -1736,7 +1736,7 @@
 	 */
 	if (!IsGeneratingWorld()) _current_player = _local_player;
 
-	// Mouse event?
+	/* Mouse event? */
 	click = 0;
 	if (_left_button_down && !_left_button_clicked) {
 		_left_button_clicked = true;
@@ -1793,7 +1793,7 @@
 		if ((*wz)->viewport != NULL) UpdateViewportPosition(*wz);
 	}
 	DrawTextMessage();
-	// Redraw mouse cursor in case it was hidden
+	/* Redraw mouse cursor in case it was hidden */
 	DrawMouseCursor();
 }
 
--- a/src/window.h	Sat Mar 31 12:36:57 2007 +0000
+++ b/src/window.h	Sun Apr 08 14:46:55 2007 +0000
@@ -659,7 +659,7 @@
  * Sets the lowered/raised status of a widget.
  * @param w : Window on which the widget is located
  * @param widget_index : index of this widget in the window
- * @param hidden_stat : status to use ie: lowered = true, raised = false
+ * @param lowered_stat : status to use ie: lowered = true, raised = false
  */
 static inline void SetWindowWidgetLoweredState(Window *w, byte widget_index, bool lowered_stat)
 {