summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-12-10 13:54:10 +0000
committerrubidium <rubidium@openttd.org>2011-12-10 13:54:10 +0000
commit58423b26d1d9daa996e151fb3dc3e30dad49b722 (patch)
tree5367a286f073cbaec260306fc36ef6365149d5c7
parent8315b00b32aa838769e016d46d84048e152941d2 (diff)
downloadopenttd-58423b26d1d9daa996e151fb3dc3e30dad49b722.tar.xz
(svn r23474) -Codechange: move the declaration error related functions to error.h
-rw-r--r--projects/openttd_vs100.vcxproj1
-rw-r--r--projects/openttd_vs100.vcxproj.filters3
-rw-r--r--projects/openttd_vs80.vcproj4
-rw-r--r--projects/openttd_vs90.vcproj4
-rw-r--r--source.list1
-rw-r--r--src/ai/ai_gui.cpp1
-rw-r--r--src/ai/ai_instance.cpp2
-rw-r--r--src/bridge_gui.cpp2
-rw-r--r--src/command.cpp1
-rw-r--r--src/company_gui.cpp1
-rw-r--r--src/error.h27
-rw-r--r--src/error_gui.cpp2
-rw-r--r--src/fios_gui.cpp1
-rw-r--r--src/gui.h10
-rw-r--r--src/heightmap.cpp2
-rw-r--r--src/industry_gui.cpp1
-rw-r--r--src/intro_gui.cpp1
-rw-r--r--src/misc_gui.cpp1
-rw-r--r--src/music_gui.cpp2
-rw-r--r--src/network/network_client.cpp2
-rw-r--r--src/network/network_content.cpp2
-rw-r--r--src/network/network_content_gui.cpp2
-rw-r--r--src/newgrf.cpp2
-rw-r--r--src/newgrf_commons.cpp2
-rw-r--r--src/newgrf_gui.cpp1
-rw-r--r--src/newgrf_industries.cpp2
-rw-r--r--src/openttd.cpp1
-rw-r--r--src/saveload/saveload.cpp2
-rw-r--r--src/screenshot.cpp2
-rw-r--r--src/settings.cpp2
-rw-r--r--src/settings_gui.cpp1
-rw-r--r--src/spriteloader/grf.cpp2
-rw-r--r--src/strings.cpp2
-rw-r--r--src/town_cmd.cpp2
-rw-r--r--src/town_gui.cpp1
-rw-r--r--src/train_cmd.cpp2
-rw-r--r--src/vehicle.cpp2
37 files changed, 70 insertions, 29 deletions
diff --git a/projects/openttd_vs100.vcxproj b/projects/openttd_vs100.vcxproj
index 940b809c8..783bf2ee7 100644
--- a/projects/openttd_vs100.vcxproj
+++ b/projects/openttd_vs100.vcxproj
@@ -428,6 +428,7 @@
<ClInclude Include="..\src\engine_func.h" />
<ClInclude Include="..\src\engine_gui.h" />
<ClInclude Include="..\src\engine_type.h" />
+ <ClInclude Include="..\src\error.h" />
<ClInclude Include="..\src\fileio_func.h" />
<ClInclude Include="..\src\fileio_type.h" />
<ClInclude Include="..\src\fios.h" />
diff --git a/projects/openttd_vs100.vcxproj.filters b/projects/openttd_vs100.vcxproj.filters
index 9c5ebfcf2..0ccd7e758 100644
--- a/projects/openttd_vs100.vcxproj.filters
+++ b/projects/openttd_vs100.vcxproj.filters
@@ -507,6 +507,9 @@
<ClInclude Include="..\src\engine_type.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\src\error.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
<ClInclude Include="..\src\fileio_func.h">
<Filter>Header Files</Filter>
</ClInclude>
diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj
index e117f901c..5e183e883 100644
--- a/projects/openttd_vs80.vcproj
+++ b/projects/openttd_vs80.vcproj
@@ -987,6 +987,10 @@
>
</File>
<File
+ RelativePath=".\..\src\error.h"
+ >
+ </File>
+ <File
RelativePath=".\..\src\fileio_func.h"
>
</File>
diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj
index 2898eb756..f5a055842 100644
--- a/projects/openttd_vs90.vcproj
+++ b/projects/openttd_vs90.vcproj
@@ -984,6 +984,10 @@
>
</File>
<File
+ RelativePath=".\..\src\error.h"
+ >
+ </File>
+ <File
RelativePath=".\..\src\fileio_func.h"
>
</File>
diff --git a/source.list b/source.list
index 185859af8..628153da4 100644
--- a/source.list
+++ b/source.list
@@ -161,6 +161,7 @@ engine_base.h
engine_func.h
engine_gui.h
engine_type.h
+error.h
fileio_func.h
fileio_type.h
fios.h
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index a71e018e9..7d7ca7d57 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -11,6 +11,7 @@
#include "../stdafx.h"
#include "../table/sprites.h"
+#include "../error.h"
#include "../gui.h"
#include "../querystring_gui.h"
#include "../company_func.h"
diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp
index a3131b45b..df2aef9bc 100644
--- a/src/ai/ai_instance.cpp
+++ b/src/ai/ai_instance.cpp
@@ -12,7 +12,7 @@
#include "../stdafx.h"
#include "../debug.h"
#include "../saveload/saveload.h"
-#include "../gui.h"
+#include "../error.h"
#include "../script/squirrel_class.hpp"
diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp
index 9971951ca..0a0d788d4 100644
--- a/src/bridge_gui.cpp
+++ b/src/bridge_gui.cpp
@@ -10,7 +10,7 @@
/** @file bridge_gui.cpp Graphical user interface for bridge construction */
#include "stdafx.h"
-#include "gui.h"
+#include "error.h"
#include "command_func.h"
#include "rail.h"
#include "strings_func.h"
diff --git a/src/command.cpp b/src/command.cpp
index d521cda0e..31c4843f0 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -11,6 +11,7 @@
#include "stdafx.h"
#include "landscape.h"
+#include "error.h"
#include "gui.h"
#include "command_func.h"
#include "network/network_type.h"
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index 4a6bab0a3..4e364f74e 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -10,6 +10,7 @@
/** @file company_gui.cpp Company related GUIs. */
#include "stdafx.h"
+#include "error.h"
#include "gui.h"
#include "window_gui.h"
#include "textbuf_gui.h"
diff --git a/src/error.h b/src/error.h
new file mode 100644
index 000000000..75efb75b8
--- /dev/null
+++ b/src/error.h
@@ -0,0 +1,27 @@
+/* $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 error.h Functions related to errors. */
+
+#ifndef ERROR_H
+#define ERROR_H
+
+#include "strings_type.h"
+
+/** Message severity/type */
+enum WarningLevel {
+ WL_INFO, ///< Used for DoCommand-like (and some nonfatal AI GUI) errors/information
+ WL_WARNING, ///< Other information
+ WL_ERROR, ///< Errors (eg. saving/loading failed)
+ WL_CRITICAL, ///< Critical errors, the MessageBox is shown in all cases
+};
+
+void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel wl, int x = 0, int y = 0, uint textref_stack_size = 0, const uint32 *textref_stack = NULL);
+
+#endif /* ERROR_H */
diff --git a/src/error_gui.cpp b/src/error_gui.cpp
index a487f0f2a..d02ebc15c 100644
--- a/src/error_gui.cpp
+++ b/src/error_gui.cpp
@@ -12,7 +12,7 @@
#include "stdafx.h"
#include "landscape.h"
#include "newgrf_text.h"
-#include "gui.h"
+#include "error.h"
#include "viewport_func.h"
#include "gfx_func.h"
#include "string_func.h"
diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp
index 5370cfd29..4a56d2ce6 100644
--- a/src/fios_gui.cpp
+++ b/src/fios_gui.cpp
@@ -11,6 +11,7 @@
#include "stdafx.h"
#include "saveload/saveload.h"
+#include "error.h"
#include "gui.h"
#include "gfx_func.h"
#include "command_func.h"
diff --git a/src/gui.h b/src/gui.h
index 823423575..4859fe79e 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -55,16 +55,6 @@ void ShowSubsidiesList();
void ShowEstimatedCostOrIncome(Money cost, int x, int y);
-/** Message severity/type */
-enum WarningLevel {
- WL_INFO, ///< Used for DoCommand-like (and some nonfatal AI GUI) errors/information
- WL_WARNING, ///< Other information
- WL_ERROR, ///< Errors (eg. saving/loading failed)
- WL_CRITICAL, ///< Critical errors, the MessageBox is shown in all cases
-};
-
-void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel wl, int x = 0, int y = 0, uint textref_stack_size = 0, const uint32 *textref_stack = NULL);
-
void ShowExtraViewPortWindow(TileIndex tile = INVALID_TILE);
void ShowExtraViewPortWindowForTileUnderCursor();
diff --git a/src/heightmap.cpp b/src/heightmap.cpp
index c05e7365c..1e6531fb0 100644
--- a/src/heightmap.cpp
+++ b/src/heightmap.cpp
@@ -13,7 +13,7 @@
#include "heightmap.h"
#include "clear_map.h"
#include "void_map.h"
-#include "gui.h"
+#include "error.h"
#include "saveload/saveload.h"
#include "bmp.h"
#include "gfx_func.h"
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 9c2e825f6..7a5a58863 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -10,6 +10,7 @@
/** @file industry_gui.cpp GUIs related to industries. */
#include "stdafx.h"
+#include "error.h"
#include "gui.h"
#include "sound_func.h"
#include "window_func.h"
diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp
index 894f54dc4..388587fb2 100644
--- a/src/intro_gui.cpp
+++ b/src/intro_gui.cpp
@@ -10,6 +10,7 @@
/** @file intro_gui.cpp The main menu GUI. */
#include "stdafx.h"
+#include "error.h"
#include "gui.h"
#include "window_gui.h"
#include "textbuf_gui.h"
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 5e16f1185..3ea9dff0f 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -12,6 +12,7 @@
#include "stdafx.h"
#include "debug.h"
#include "landscape.h"
+#include "error.h"
#include "gui.h"
#include "viewport_func.h"
#include "gfx_func.h"
diff --git a/src/music_gui.cpp b/src/music_gui.cpp
index 846c2bcb6..d4c3057de 100644
--- a/src/music_gui.cpp
+++ b/src/music_gui.cpp
@@ -19,7 +19,7 @@
#include "sound_func.h"
#include "gfx_func.h"
#include "core/random_func.hpp"
-#include "gui.h"
+#include "error.h"
#include "core/geometry_func.hpp"
#include "string_func.h"
#include "settings_type.h"
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index 5e03e638a..cc6c79e8e 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -26,7 +26,7 @@
#include "../core/random_func.hpp"
#include "../date_func.h"
#include "../gfx_func.h"
-#include "../gui.h"
+#include "../error.h"
#include "../rev.h"
#include "network.h"
#include "network_base.h"
diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp
index 98c9f171b..179603768 100644
--- a/src/network/network_content.cpp
+++ b/src/network/network_content.cpp
@@ -15,7 +15,7 @@
#include "../rev.h"
#include "../ai/ai.hpp"
#include "../window_func.h"
-#include "../gui.h"
+#include "../error.h"
#include "../base_media_base.h"
#include "../settings_type.h"
#include "network_content.h"
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 3b008832d..fa16238b2 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -14,7 +14,7 @@
#include "../strings_func.h"
#include "../gfx_func.h"
#include "../window_func.h"
-#include "../gui.h"
+#include "../error.h"
#include "../ai/ai.hpp"
#include "../base_media_base.h"
#include "../sortlist_type.h"
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 49e8cf3eb..52de2703c 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -45,7 +45,7 @@
#include <map>
#include "smallmap_gui.h"
#include "genworld.h"
-#include "gui.h"
+#include "error.h"
#include "vehicle_func.h"
#include "language.h"
#include "vehicle_base.h"
diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp
index 0e28ce768..d25e3245e 100644
--- a/src/newgrf_commons.cpp
+++ b/src/newgrf_commons.cpp
@@ -29,7 +29,7 @@
#include "newgrf_text.h"
#include "livery.h"
#include "company_base.h"
-#include "gui.h"
+#include "error.h"
#include "strings_func.h"
#include "table/strings.h"
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 7b3604157..64e4df7f6 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -10,6 +10,7 @@
/** @file newgrf_gui.cpp GUI to change NewGRF settings. */
#include "stdafx.h"
+#include "error.h"
#include "gui.h"
#include "newgrf.h"
#include "strings_func.h"
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp
index 38daaa09b..184784520 100644
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -21,7 +21,7 @@
#include "town.h"
#include "company_base.h"
#include "command_func.h"
-#include "gui.h"
+#include "error.h"
#include "strings_func.h"
#include "core/random_func.hpp"
diff --git a/src/openttd.cpp b/src/openttd.cpp
index dd93ffc68..464330581 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -17,6 +17,7 @@
#include "video/video_driver.hpp"
#include "fontcache.h"
+#include "error.h"
#include "gui.h"
#include "sound_func.h"
#include "window_func.h"
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index c603f5843..5efc187a8 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -41,7 +41,7 @@
#include "../string_func.h"
#include "../engine_base.h"
#include "../fios.h"
-#include "../gui.h"
+#include "../error.h"
#include "table/strings.h"
diff --git a/src/screenshot.cpp b/src/screenshot.cpp
index 5e8bf5971..9f8174208 100644
--- a/src/screenshot.cpp
+++ b/src/screenshot.cpp
@@ -20,7 +20,7 @@
#include "saveload/saveload.h"
#include "company_func.h"
#include "strings_func.h"
-#include "gui.h"
+#include "error.h"
#include "window_gui.h"
#include "window_func.h"
#include "tile_map.h"
diff --git a/src/settings.cpp b/src/settings.cpp
index d8067574b..e9d4a17de 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -45,7 +45,7 @@
#include "textbuf_gui.h"
#include "rail_gui.h"
#include "elrail_func.h"
-#include "gui.h"
+#include "error.h"
#include "town.h"
#include "video/video_driver.hpp"
#include "sound/sound_driver.hpp"
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 4a4282ea7..6ea6f0b22 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -11,6 +11,7 @@
#include "stdafx.h"
#include "currency.h"
+#include "error.h"
#include "gui.h"
#include "textbuf_gui.h"
#include "command_func.h"
diff --git a/src/spriteloader/grf.cpp b/src/spriteloader/grf.cpp
index b4533ae94..a4de26244 100644
--- a/src/spriteloader/grf.cpp
+++ b/src/spriteloader/grf.cpp
@@ -15,7 +15,7 @@
#include "../debug.h"
#include "../strings_func.h"
#include "table/strings.h"
-#include "../gui.h"
+#include "../error.h"
#include "../core/math_func.hpp"
#include "grf.hpp"
diff --git a/src/strings.cpp b/src/strings.cpp
index e15d30e00..d34d053fa 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -23,7 +23,7 @@
#include "signs_base.h"
#include "cargotype.h"
#include "fontcache.h"
-#include "gui.h"
+#include "error.h"
#include "strings_func.h"
#include "rev.h"
#include "core/alloc_type.hpp"
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 60bb58e09..4413092d3 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -20,7 +20,7 @@
#include "station_base.h"
#include "company_base.h"
#include "news_func.h"
-#include "gui.h"
+#include "error.h"
#include "object.h"
#include "genworld.h"
#include "newgrf_debug.h"
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index f5c6747bf..50ecce2de 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -12,6 +12,7 @@
#include "stdafx.h"
#include "town.h"
#include "viewport_func.h"
+#include "error.h"
#include "gui.h"
#include "command_func.h"
#include "company_func.h"
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 440ff9bdb..8af59b741 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -10,7 +10,7 @@
/** @file train_cmd.cpp Handling of trains. */
#include "stdafx.h"
-#include "gui.h"
+#include "error.h"
#include "articulated_vehicles.h"
#include "command_func.h"
#include "pathfinder/npf/npf_func.h"
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index aa0319466..d58441865 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -10,7 +10,7 @@
/** @file vehicle.cpp Base implementations of all vehicles. */
#include "stdafx.h"
-#include "gui.h"
+#include "error.h"
#include "roadveh.h"
#include "ship.h"
#include "spritecache.h"