summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-24 10:15:06 +0000
committerrubidium <rubidium@openttd.org>2008-05-24 10:15:06 +0000
commit6c20f77330468a954ca2abcd396ab4135ea176fd (patch)
tree72e249a3b2b47077b3e38cac1908b6058e9a94f8
parent0c47d3fc14f9e81226001a2824a14164184c7d94 (diff)
downloadopenttd-6c20f77330468a954ca2abcd396ab4135ea176fd.tar.xz
(svn r13228) -Codechange: split console.h.
-rw-r--r--projects/openttd_vs80.vcproj14
-rw-r--r--projects/openttd_vs90.vcproj14
-rw-r--r--source.list5
-rw-r--r--src/console.cpp3
-rw-r--r--src/console_cmds.cpp2
-rw-r--r--src/console_func.h31
-rw-r--r--src/console_gui.h13
-rw-r--r--src/console_internal.h (renamed from src/console.h)31
-rw-r--r--src/console_type.h14
-rw-r--r--src/debug.cpp2
-rw-r--r--src/main_gui.cpp2
-rw-r--r--src/network/network.cpp2
-rw-r--r--src/network/network_client.cpp2
-rw-r--r--src/network/network_server.cpp2
-rw-r--r--src/openttd.cpp2
-rw-r--r--src/settings.cpp2
-rw-r--r--src/texteff.cpp2
-rw-r--r--src/tgp.cpp1
-rw-r--r--src/toolbar_gui.cpp2
-rw-r--r--src/video/dedicated_v.cpp2
-rw-r--r--src/window.cpp3
21 files changed, 107 insertions, 44 deletions
diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj
index 6d2e7f75c..c5c799b15 100644
--- a/projects/openttd_vs80.vcproj
+++ b/projects/openttd_vs80.vcproj
@@ -876,7 +876,19 @@
>
</File>
<File
- RelativePath=".\..\src\console.h"
+ RelativePath=".\..\src\console_func.h"
+ >
+ </File>
+ <File
+ RelativePath=".\..\src\console_gui.h"
+ >
+ </File>
+ <File
+ RelativePath=".\..\src\console_internal.h"
+ >
+ </File>
+ <File
+ RelativePath=".\..\src\console_type.h"
>
</File>
<File
diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj
index 66057d648..6ba4ef986 100644
--- a/projects/openttd_vs90.vcproj
+++ b/projects/openttd_vs90.vcproj
@@ -873,7 +873,19 @@
>
</File>
<File
- RelativePath=".\..\src\console.h"
+ RelativePath=".\..\src\console_func.h"
+ >
+ </File>
+ <File
+ RelativePath=".\..\src\console_gui.h"
+ >
+ </File>
+ <File
+ RelativePath=".\..\src\console_internal.h"
+ >
+ </File>
+ <File
+ RelativePath=".\..\src\console_type.h"
>
</File>
<File
diff --git a/source.list b/source.list
index cb31b23f1..e3519182f 100644
--- a/source.list
+++ b/source.list
@@ -144,7 +144,10 @@ cargotype.h
cmd_helper.h
command_func.h
command_type.h
-console.h
+console_func.h
+console_gui.h
+console_internal.h
+console_type.h
cheat_func.h
cheat_type.h
currency.h
diff --git a/src/console.cpp b/src/console.cpp
index b93100825..2aeed9cc3 100644
--- a/src/console.cpp
+++ b/src/console.cpp
@@ -7,10 +7,11 @@
#include "gui.h"
#include "textbuf_gui.h"
#include "window_gui.h"
+#include "console_gui.h"
#include "variables.h"
#include <stdarg.h>
#include <string.h>
-#include "console.h"
+#include "console_internal.h"
#include "network/network.h"
#include "network/network_data.h"
#include "network/network_server.h"
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index 49e003427..2312b7370 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -4,7 +4,7 @@
#include "stdafx.h"
#include "openttd.h"
-#include "console.h"
+#include "console_internal.h"
#include "debug.h"
#include "engine_func.h"
#include "landscape.h"
diff --git a/src/console_func.h b/src/console_func.h
new file mode 100644
index 000000000..4ec762bdf
--- /dev/null
+++ b/src/console_func.h
@@ -0,0 +1,31 @@
+/* $Id$ */
+
+/** @file console_func.h Console functions used outside of the console code. */
+
+#ifndef CONSOLE_FUNC_H
+#define CONSOLE_FUNC_H
+
+#include "console_type.h"
+
+/* console colors/modes */
+extern byte _icolour_def;
+extern byte _icolour_err;
+extern byte _icolour_warn;
+extern byte _icolour_dbg;
+extern byte _icolour_cmd;
+extern IConsoleModes _iconsole_mode;
+
+/* console functions */
+void IConsoleInit();
+void IConsoleFree();
+void IConsoleClose();
+
+/* console output */
+void IConsolePrint(uint16 color_code, const char *string);
+void CDECL IConsolePrintF(uint16 color_code, const char *s, ...);
+void IConsoleDebug(const char *dbg, const char *string);
+
+/* Parser */
+void IConsoleCmdExec(const char *cmdstr);
+
+#endif /* CONSOLE_FUNC_H */
diff --git a/src/console_gui.h b/src/console_gui.h
new file mode 100644
index 000000000..7d7619fda
--- /dev/null
+++ b/src/console_gui.h
@@ -0,0 +1,13 @@
+/* $Id$ */
+
+/** @file console_gui.h GUI related functions in the console. */
+
+#ifndef CONSOLE_GUI_H
+#define CONSOLE_GUI_H
+
+#include "window_type.h"
+
+void IConsoleResize(Window *w);
+void IConsoleSwitch();
+
+#endif /* CONSOLE_GUI_H */
diff --git a/src/console.h b/src/console_internal.h
index 4c57ad532..f4884e3da 100644
--- a/src/console.h
+++ b/src/console_internal.h
@@ -1,11 +1,11 @@
/* $Id$ */
-/** @file console.h In-game console. */
+/** @file console_internal.h Internally used functions for the console. */
-#ifndef CONSOLE_H
-#define CONSOLE_H
+#ifndef CONSOLE_INTERNAL_H
+#define CONSOLE_INTERNAL_H
-#include "window_type.h"
+#include "console_func.h"
/* maximum length of a typed in command */
#define ICON_CMDLN_SIZE 255
@@ -22,12 +22,6 @@ enum IConsoleVarTypes {
ICONSOLE_VAR_STRING
};
-enum IConsoleModes {
- ICONSOLE_FULL,
- ICONSOLE_OPENED,
- ICONSOLE_CLOSED
-};
-
enum IConsoleHookTypes {
ICONSOLE_HOOK_ACCESS,
ICONSOLE_HOOK_PRE_ACTION,
@@ -107,27 +101,11 @@ extern IConsoleCmd *_iconsole_cmds; ///< list of registred commands
extern IConsoleVar *_iconsole_vars; ///< list of registred vars
extern IConsoleAlias *_iconsole_aliases; ///< list of registred aliases
-/* console colors/modes */
-extern byte _icolour_def;
-extern byte _icolour_err;
-extern byte _icolour_warn;
-extern byte _icolour_dbg;
-extern byte _icolour_cmd;
-extern IConsoleModes _iconsole_mode;
-
/* console functions */
-void IConsoleInit();
-void IConsoleFree();
void IConsoleClearBuffer();
-void IConsoleResize(Window *w);
-void IConsoleSwitch();
-void IConsoleClose();
void IConsoleOpen();
/* console output */
-void IConsolePrint(uint16 color_code, const char *string);
-void CDECL IConsolePrintF(uint16 color_code, const char *s, ...);
-void IConsoleDebug(const char *dbg, const char *string);
void IConsoleWarning(const char *string);
void IConsoleError(const char *string);
@@ -145,7 +123,6 @@ void IConsoleVarPrintGetValue(const IConsoleVar *var);
void IConsoleVarPrintSetValue(const IConsoleVar *var);
/* Parser */
-void IConsoleCmdExec(const char *cmdstr);
void IConsoleVarExec(const IConsoleVar *var, byte tokencount, char *token[]);
/* console std lib (register ingame commands/aliases/variables) */
diff --git a/src/console_type.h b/src/console_type.h
new file mode 100644
index 000000000..58b26b49b
--- /dev/null
+++ b/src/console_type.h
@@ -0,0 +1,14 @@
+/* $Id$ */
+
+/** @file console_type.h Globally used console related types. */
+
+#ifndef CONSOLE_TYPE_H
+#define CONSOLE_TYPE_H
+
+enum IConsoleModes {
+ ICONSOLE_FULL,
+ ICONSOLE_OPENED,
+ ICONSOLE_CLOSED
+};
+
+#endif /* CONSOLE_TYPE_H */
diff --git a/src/debug.cpp b/src/debug.cpp
index 9dbf2642c..eb829efed 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdarg.h>
#include "openttd.h"
-#include "console.h"
+#include "console_func.h"
#include "debug.h"
#include "string_func.h"
#include "network/core/core.h"
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 6eaab74e6..23f5169d9 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -13,7 +13,7 @@
#include "viewport_func.h"
#include "command_func.h"
#include "news_gui.h"
-#include "console.h"
+#include "console_gui.h"
#include "waypoint.h"
#include "genworld.h"
#include "transparency_gui.h"
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 30a0cc957..dfb086da0 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -23,7 +23,7 @@
#include "core/tcp.h"
#include "core/core.h"
#include "network_gui.h"
-#include "../console.h" /* IConsoleCmdExec */
+#include "../console_func.h"
#include <stdarg.h> /* va_list */
#include "../md5.h"
#include "../fileio.h"
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index 02608bc38..35b60029c 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -14,7 +14,7 @@
#include "network_gui.h"
#include "../saveload.h"
#include "../command_func.h"
-#include "../console.h"
+#include "../console_func.h"
#include "../variables.h"
#include "../ai/ai.h"
#include "../core/alloc_func.hpp"
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index e75b2b001..ec3010840 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -15,7 +15,7 @@
#include "../date_func.h"
#include "network_server.h"
#include "network_udp.h"
-#include "../console.h"
+#include "../console_func.h"
#include "../command_func.h"
#include "../saveload.h"
#include "../station_base.h"
diff --git a/src/openttd.cpp b/src/openttd.cpp
index b8ca7f312..0466f0716 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -41,7 +41,7 @@
#include "fios.h"
#include "airport.h"
#include "aircraft.h"
-#include "console.h"
+#include "console_func.h"
#include "screenshot.h"
#include "network/network.h"
#include "signs_base.h"
diff --git a/src/settings.cpp b/src/settings.cpp
index da5190314..c49fdfc0f 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -28,7 +28,7 @@
#include "network/network_internal.h"
#include "settings_internal.h"
#include "command_func.h"
-#include "console.h"
+#include "console_func.h"
#include "saveload.h"
#include "npf.h"
#include "yapf/yapf.h"
diff --git a/src/texteff.cpp b/src/texteff.cpp
index 61eabd4a1..7cadbc347 100644
--- a/src/texteff.cpp
+++ b/src/texteff.cpp
@@ -6,7 +6,7 @@
#include "openttd.h"
#include "landscape.h"
#include "gfx_func.h"
-#include "console.h"
+#include "console_func.h"
#include "variables.h"
#include "blitter/factory.hpp"
#include "texteff.hpp"
diff --git a/src/tgp.cpp b/src/tgp.cpp
index 28169b455..2dced280b 100644
--- a/src/tgp.cpp
+++ b/src/tgp.cpp
@@ -10,7 +10,6 @@
#include "variables.h"
#include "void_map.h"
#include "tgp.h"
-#include "console.h"
#include "genworld.h"
#include "core/alloc_func.hpp"
#include "core/random_func.hpp"
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 7cc462cbd..6377d4909 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -35,7 +35,7 @@
#include "signs_func.h"
#include "fios.h"
#include "functions.h"
-#include "console.h"
+#include "console_gui.h"
#include "news_gui.h"
#include "tilehighlight_func.h"
diff --git a/src/video/dedicated_v.cpp b/src/video/dedicated_v.cpp
index 523bb403d..8af223e8e 100644
--- a/src/video/dedicated_v.cpp
+++ b/src/video/dedicated_v.cpp
@@ -11,7 +11,7 @@
#include "../gfx_func.h"
#include "../network/network.h"
#include "../network/network_internal.h"
-#include "../console.h"
+#include "../console_func.h"
#include "../variables.h"
#include "../genworld.h"
#include "../fileio.h"
diff --git a/src/window.cpp b/src/window.cpp
index 0416d6a22..c5d127538 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -8,7 +8,8 @@
#include "debug.h"
#include "player_func.h"
#include "gfx_func.h"
-#include "console.h"
+#include "console_func.h"
+#include "console_gui.h"
#include "viewport_func.h"
#include "variables.h"
#include "genworld.h"