summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--projects/openttd_vs80.vcproj4
-rw-r--r--projects/openttd_vs90.vcproj4
-rw-r--r--source.list1
-rw-r--r--src/station_type.h42
-rw-r--r--src/tilearea_type.h58
5 files changed, 68 insertions, 41 deletions
diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj
index 8e4934153..66856f087 100644
--- a/projects/openttd_vs80.vcproj
+++ b/projects/openttd_vs80.vcproj
@@ -1468,6 +1468,10 @@
>
</File>
<File
+ RelativePath=".\..\src\tilearea_type.h"
+ >
+ </File>
+ <File
RelativePath=".\..\src\tile_cmd.h"
>
</File>
diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj
index a4e6376a9..4906cc351 100644
--- a/projects/openttd_vs90.vcproj
+++ b/projects/openttd_vs90.vcproj
@@ -1465,6 +1465,10 @@
>
</File>
<File
+ RelativePath=".\..\src\tilearea_type.h"
+ >
+ </File>
+ <File
RelativePath=".\..\src\tile_cmd.h"
>
</File>
diff --git a/source.list b/source.list
index 4c0153e0b..40482108a 100644
--- a/source.list
+++ b/source.list
@@ -276,6 +276,7 @@ terraform_gui.h
textbuf_gui.h
texteff.hpp
tgp.h
+tilearea_type.h
tile_cmd.h
tile_type.h
tilehighlight_func.h
diff --git a/src/station_type.h b/src/station_type.h
index 769455d20..141e6dc61 100644
--- a/src/station_type.h
+++ b/src/station_type.h
@@ -15,6 +15,7 @@
#include "core/enum_type.hpp"
#include "core/smallvec_type.hpp"
#include "tile_type.h"
+#include "tilearea_type.h"
typedef uint16 StationID;
typedef uint16 RoadStopID;
@@ -91,47 +92,6 @@ enum {
MAX_LENGTH_STATION_NAME_PIXELS = 180, ///< The maximum length of a station name in pixels
};
-/** Represents the covered area of e.g. a rail station */
-struct TileArea {
- /** Just construct this tile area */
- TileArea() {}
-
- /**
- * Construct this tile area with some set values
- * @param tile the base tile
- * @param w the width
- * @param h the height
- */
- TileArea(TileIndex tile, uint8 w, uint8 h) : tile(tile), w(w), h(h) {}
-
- /**
- * Construct this tile area based on two points.
- * @param start the start of the area
- * @param end the end of the area
- */
- TileArea(TileIndex start, TileIndex end);
-
- TileIndex tile; ///< The base tile of the area
- uint8 w; ///< The width of the area
- uint8 h; ///< The height of the area
-
- /**
- * Add a single tile to a tile area; enlarge if needed.
- * @param to_add The tile to add
- */
- void Add(TileIndex to_add);
-
- /**
- * Clears the 'tile area', i.e. make the tile invalid.
- */
- void Clear()
- {
- this->tile = INVALID_TILE;
- this->w = 0;
- this->h = 0;
- }
-};
-
/** List of stations */
typedef SmallVector<Station *, 2> StationList;
diff --git a/src/tilearea_type.h b/src/tilearea_type.h
new file mode 100644
index 000000000..8bac2fbbf
--- /dev/null
+++ b/src/tilearea_type.h
@@ -0,0 +1,58 @@
+/* $Id$ */
+
+/*
+ * This file is part of OpenTTD.
+ * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
+ * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/** @file tilearea_type.h Type for storing the 'area' of something uses on the map. */
+
+#ifndef TILEAREA_TYPE_H
+#define TILEAREA_TYPE_H
+
+#include "tile_type.h"
+
+/** Represents the covered area of e.g. a rail station */
+struct TileArea {
+ /** Just construct this tile area */
+ TileArea() {}
+
+ /**
+ * Construct this tile area with some set values
+ * @param tile the base tile
+ * @param w the width
+ * @param h the height
+ */
+ TileArea(TileIndex tile, uint8 w, uint8 h) : tile(tile), w(w), h(h) {}
+
+ /**
+ * Construct this tile area based on two points.
+ * @param start the start of the area
+ * @param end the end of the area
+ */
+ TileArea(TileIndex start, TileIndex end);
+
+ TileIndex tile; ///< The base tile of the area
+ uint8 w; ///< The width of the area
+ uint8 h; ///< The height of the area
+
+ /**
+ * Add a single tile to a tile area; enlarge if needed.
+ * @param to_add The tile to add
+ */
+ void Add(TileIndex to_add);
+
+ /**
+ * Clears the 'tile area', i.e. make the tile invalid.
+ */
+ void Clear()
+ {
+ this->tile = INVALID_TILE;
+ this->w = 0;
+ this->h = 0;
+ }
+};
+
+#endif /* TILEAREA_TYPE_H */