(svn r9609) -Codechange: Move some function prototypes out of functions.h and into landscape.h, and add a few where they didn't exist.
authormaedhros
Thu, 12 Apr 2007 13:07:15 +0000
changeset 6453 226bcddeba32
parent 6452 beefb2a80325
child 6454 ad53226c2027
(svn r9609) -Codechange: Move some function prototypes out of functions.h and into landscape.h, and add a few where they didn't exist.
src/ai/default/default.cpp
src/aircraft_cmd.cpp
src/command.cpp
src/console_cmds.cpp
src/depot.cpp
src/disaster_cmd.cpp
src/economy.cpp
src/elrail.cpp
src/functions.h
src/genworld.cpp
src/landscape.h
src/misc.cpp
src/misc_gui.cpp
src/npf.cpp
src/openttd.cpp
src/pathfind.cpp
src/rail_gui.cpp
src/road_map.cpp
src/roadveh_cmd.cpp
src/ship_cmd.cpp
src/signs.cpp
src/smallmap_gui.cpp
src/sound.cpp
src/station_cmd.cpp
src/texteff.cpp
src/train_cmd.cpp
src/unmovable_cmd.cpp
src/vehicle.cpp
src/viewport.cpp
src/water_cmd.cpp
src/waypoint.cpp
src/yapf/yapf.hpp
--- a/src/ai/default/default.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/ai/default/default.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -5,6 +5,7 @@
 #include "../../aircraft.h"
 #include "../../bridge_map.h"
 #include "../../functions.h"
+#include "../../landscape.h"
 #include "../../map.h"
 #include "../../rail_map.h"
 #include "../../road_map.h"
--- a/src/aircraft_cmd.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/aircraft_cmd.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -8,6 +8,7 @@
 #include "aircraft.h"
 #include "debug.h"
 #include "functions.h"
+#include "landscape.h"
 #include "station_map.h"
 #include "table/strings.h"
 #include "map.h"
--- a/src/command.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/command.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -6,6 +6,7 @@
 #include "openttd.h"
 #include "table/strings.h"
 #include "functions.h"
+#include "landscape.h"
 #include "map.h"
 #include "gui.h"
 #include "command.h"
--- a/src/console_cmds.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/console_cmds.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -8,6 +8,7 @@
 #include "debug.h"
 #include "engine.h"
 #include "functions.h"
+#include "landscape.h"
 #include "saveload.h"
 #include "string.h"
 #include "variables.h"
--- a/src/depot.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/depot.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -6,6 +6,7 @@
 #include "openttd.h"
 #include "depot.h"
 #include "functions.h"
+#include "landscape.h"
 #include "tile.h"
 #include "map.h"
 #include "table/strings.h"
--- a/src/disaster_cmd.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/disaster_cmd.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -19,6 +19,7 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "functions.h"
+#include "landscape.h"
 #include "industry_map.h"
 #include "station_map.h"
 #include "table/strings.h"
--- a/src/economy.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/economy.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -6,6 +6,7 @@
 #include "openttd.h"
 #include "currency.h"
 #include "functions.h"
+#include "landscape.h"
 #include "strings.h" // XXX InjectDParam()
 #include "table/strings.h"
 #include "table/sprites.h"
--- a/src/elrail.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/elrail.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -52,6 +52,7 @@
 #include "viewport.h"
 #include "functions.h" /* We should REALLY get rid of this goddamn file, as it is butt-ugly */
 #include "variables.h" /* ... same here */
+#include "landscape.h"
 #include "rail.h"
 #include "debug.h"
 #include "tunnel_map.h"
--- a/src/functions.h	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/functions.h	Thu Apr 12 13:07:15 2007 +0000
@@ -7,35 +7,8 @@
 
 #include "gfx.h"
 
-void DoClearSquare(TileIndex tile);
-void RunTileLoop();
-
-uint GetPartialZ(int x, int y, Slope corners);
-uint GetSlopeZ(int x, int y);
-uint32 GetTileTrackStatus(TileIndex tile, TransportType mode);
-void GetAcceptedCargo(TileIndex tile, AcceptedCargo ac);
-void ChangeTileOwner(TileIndex tile, PlayerID old_player, PlayerID new_player);
-void AnimateTile(TileIndex tile);
-void ClickTile(TileIndex tile);
-void GetTileDesc(TileIndex tile, TileDesc *td);
 void UpdateTownMaxPass(Town *t);
 
-bool IsValidTile(TileIndex tile);
-
-static inline Point RemapCoords(int x, int y, int z)
-{
-	Point pt;
-	pt.x = (y - x) * 2;
-	pt.y = y + x - z;
-	return pt;
-}
-
-static inline Point RemapCoords2(int x, int y)
-{
-	return RemapCoords(x, y, GetSlopeZ(x, y));
-}
-
-
 /* clear_land.cpp */
 void DrawHillyLandTile(const TileInfo *ti);
 void DrawClearLandTile(const TileInfo *ti, byte set);
@@ -170,8 +143,6 @@
 void ShowCostOrIncomeAnimation(int x, int y, int z, int32 cost);
 void ShowFeederIncomeAnimation(int x, int y, int z, int32 cost);
 
-void DrawFoundation(TileInfo *ti, uint f);
-
 bool CheckIfAuthorityAllows(TileIndex tile);
 Town *ClosestTownFromTile(TileIndex tile, uint threshold);
 void ChangeTownRating(Town *t, int add, int max);
@@ -179,7 +150,6 @@
 uint GetTownRadiusGroup(const Town* t, TileIndex tile);
 int FindFirstBit(uint32 x);
 void ShowHighscoreTable(int difficulty, int8 rank);
-TileIndex AdjustTileCoordRandomly(TileIndex a, byte rng);
 
 void AfterLoadTown();
 void UpdatePatches();
--- a/src/genworld.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/genworld.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -5,6 +5,7 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "functions.h"
+#include "landscape.h"
 #include "player.h"
 #include "table/sprites.h"
 #include "variables.h"
@@ -19,7 +20,6 @@
 #include "heightmap.h"
 #include "date.h"
 
-void GenerateLandscape(byte mode);
 void GenerateClearTile();
 void GenerateIndustries();
 void GenerateUnmovables();
@@ -32,8 +32,6 @@
 
 void InitializeGame(int mode, uint size_x, uint size_y);
 
-void ConvertGroundTilesIntoWaterTiles();
-
 /* Please only use this variable in genworld.h and genworld.c and
  *  nowhere else. For speed improvements we need it to be global, but
  *  in no way the meaning of it is to use it anywhere else besides
--- a/src/landscape.h	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/landscape.h	Thu Apr 12 13:07:15 2007 +0000
@@ -2,6 +2,9 @@
 
 /** @file landscape.h */
 
+#ifndef LANDSCAPE_H
+#define LANDSCAPE_H
+
 enum {
 	SNOW_LINE_MONTHS = 12,
 	SNOW_LINE_DAYS   = 32,
@@ -17,3 +20,42 @@
 byte GetSnowLine(void);
 byte HighestSnowLine(void);
 void ClearSnowLine(void);
+
+bool IsValidTile(TileIndex tile);
+
+uint GetPartialZ(int x, int y, Slope corners);
+uint GetSlopeZ(int x, int y);
+
+static inline Point RemapCoords(int x, int y, int z)
+{
+	Point pt;
+	pt.x = (y - x) * 2;
+	pt.y = y + x - z;
+	return pt;
+}
+
+static inline Point RemapCoords2(int x, int y)
+{
+	return RemapCoords(x, y, GetSlopeZ(x, y));
+}
+
+void DrawFoundation(TileInfo *ti, uint f);
+
+void DoClearSquare(TileIndex tile);
+void RunTileLoop();
+
+uint32 GetTileTrackStatus(TileIndex tile, TransportType mode);
+void GetAcceptedCargo(TileIndex tile, AcceptedCargo ac);
+void ChangeTileOwner(TileIndex tile, PlayerID old_player, PlayerID new_player);
+void AnimateTile(TileIndex tile);
+void ClickTile(TileIndex tile);
+void GetTileDesc(TileIndex tile, TileDesc *td);
+
+void InitializeLandscape();
+void GenerateLandscape(byte mode);
+
+void ConvertGroundTilesIntoWaterTiles();
+
+TileIndex AdjustTileCoordRandomly(TileIndex a, byte rng);
+
+#endif /* LANDSCAPE_H */
--- a/src/misc.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/misc.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -6,6 +6,7 @@
 #include "openttd.h"
 #include "currency.h"
 #include "functions.h"
+#include "landscape.h"
 #include "news.h"
 #include "player.h"
 #include "string.h"
@@ -87,7 +88,6 @@
 void InitializeDockGui();
 void InitializeIndustries();
 void InitializeMainGui();
-void InitializeLandscape();
 void InitializeTowns();
 void InitializeTrees();
 void InitializeSigns();
--- a/src/misc_gui.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/misc_gui.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -8,6 +8,7 @@
 #include "heightmap.h"
 #include "debug.h"
 #include "functions.h"
+#include "landscape.h"
 #include "newgrf.h"
 #include "saveload.h"
 #include "strings.h"
@@ -40,8 +41,6 @@
 FiosItem *_fios_list;
 int _saveload_mode;
 
-extern void GenerateLandscape(byte mode);
-extern void SwitchMode(int new_mode);
 
 static bool _fios_path_changed;
 static bool _savegame_sort_dirty;
--- a/src/npf.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/npf.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -7,6 +7,7 @@
 #include "bridge_map.h"
 #include "debug.h"
 #include "functions.h"
+#include "landscape.h"
 #include "npf.h"
 #include "aystar.h"
 #include "macros.h"
--- a/src/openttd.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/openttd.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -24,6 +24,7 @@
 #include "gfx.h"
 #include "gfxinit.h"
 #include "gui.h"
+#include "landscape.h"
 #include "station.h"
 #include "station_map.h"
 #include "town_map.h"
--- a/src/pathfind.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/pathfind.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -8,6 +8,7 @@
 #include "station_map.h"
 #include "depot.h"
 #include "functions.h"
+#include "landscape.h"
 #include "map.h"
 #include "tile.h"
 #include "pathfind.h"
--- a/src/rail_gui.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/rail_gui.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -7,6 +7,7 @@
 #include "table/sprites.h"
 #include "table/strings.h"
 #include "functions.h"
+#include "landscape.h"
 #include "date.h"
 #include "map.h"
 #include "tile.h"
--- a/src/road_map.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/road_map.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -6,6 +6,7 @@
 #include "openttd.h"
 #include "bridge_map.h"
 #include "functions.h"
+#include "landscape.h"
 #include "road_map.h"
 #include "station.h"
 #include "tunnel_map.h"
--- a/src/roadveh_cmd.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/roadveh_cmd.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -6,6 +6,7 @@
 #include "openttd.h"
 #include "debug.h"
 #include "functions.h"
+#include "landscape.h"
 #include "road_map.h"
 #include "roadveh.h"
 #include "station_map.h"
--- a/src/ship_cmd.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/ship_cmd.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -7,6 +7,7 @@
 #include "ship.h"
 #include "table/strings.h"
 #include "functions.h"
+#include "landscape.h"
 #include "map.h"
 #include "tile.h"
 #include "vehicle.h"
--- a/src/signs.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/signs.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -6,6 +6,7 @@
 #include "openttd.h"
 #include "table/strings.h"
 #include "functions.h"
+#include "landscape.h"
 #include "player.h"
 #include "signs.h"
 #include "saveload.h"
--- a/src/smallmap_gui.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/smallmap_gui.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -11,6 +11,7 @@
 #include "station_map.h"
 #include "table/strings.h"
 #include "table/sprites.h"
+#include "landscape.h"
 #include "map.h"
 #include "tile.h"
 #include "gui.h"
--- a/src/sound.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/sound.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -5,6 +5,7 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "functions.h"
+#include "landscape.h"
 #include "map.h"
 #include "mixer.h"
 #include "sound.h"
--- a/src/station_cmd.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/station_cmd.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -9,6 +9,7 @@
 #include "cmd_helper.h"
 #include "debug.h"
 #include "functions.h"
+#include "landscape.h"
 #include "station_map.h"
 #include "table/sprites.h"
 #include "table/strings.h"
--- a/src/texteff.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/texteff.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -8,6 +8,7 @@
 #include "macros.h"
 #include "strings.h"
 #include "gfx.h"
+#include "landscape.h"
 #include "viewport.h"
 #include "saveload.h"
 #include "hal.h"
--- a/src/train_cmd.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/train_cmd.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -7,6 +7,7 @@
 #include "bridge_map.h"
 #include "debug.h"
 #include "functions.h"
+#include "landscape.h"
 #include "gui.h"
 #include "station_map.h"
 #include "table/strings.h"
--- a/src/unmovable_cmd.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/unmovable_cmd.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -7,6 +7,7 @@
 #include "table/strings.h"
 #include "table/sprites.h"
 #include "functions.h"
+#include "landscape.h"
 #include "map.h"
 #include "tile.h"
 #include "command.h"
--- a/src/vehicle.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/vehicle.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -11,6 +11,7 @@
 #include "table/sprites.h"
 #include "table/strings.h"
 #include "functions.h"
+#include "landscape.h"
 #include "map.h"
 #include "tile.h"
 #include "vehicle.h"
--- a/src/viewport.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/viewport.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -11,6 +11,7 @@
 #include "strings.h"
 #include "table/sprites.h"
 #include "table/strings.h"
+#include "landscape.h"
 #include "map.h"
 #include "viewport.h"
 #include "window.h"
--- a/src/water_cmd.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/water_cmd.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -11,6 +11,7 @@
 #include "table/sprites.h"
 #include "table/strings.h"
 #include "functions.h"
+#include "landscape.h"
 #include "map.h"
 #include "tile.h"
 #include "vehicle.h"
--- a/src/waypoint.cpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/waypoint.cpp	Thu Apr 12 13:07:15 2007 +0000
@@ -8,6 +8,7 @@
 #include "command.h"
 #include "functions.h"
 #include "gfx.h"
+#include "landscape.h"
 #include "map.h"
 #include "order.h"
 #include "rail_map.h"
--- a/src/yapf/yapf.hpp	Thu Apr 12 06:16:46 2007 +0000
+++ b/src/yapf/yapf.hpp	Thu Apr 12 13:07:15 2007 +0000
@@ -17,6 +17,7 @@
 #include "../vehicle.h"
 #include "../date.h"
 #include "../functions.h"
+#include "../landscape.h"
 #include "yapf.h"
 #include "../pathfind.h"
 #include "../waypoint.h"