summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-05-06 20:38:18 +0000
committerDarkvater <darkvater@openttd.org>2005-05-06 20:38:18 +0000
commit81474c262348ce5877d4f0d79bf15b1744b35260 (patch)
tree679be33cbf3843b3c5ddf01487a1bb53f39d7180
parent18bc5ae77eda221c2cf697297085a73571a235d5 (diff)
downloadopenttd-81474c262348ce5877d4f0d79bf15b1744b35260.tar.xz
(svn r2276) - CodeChange: remove DebugProc() and make the ALT+0...4 codes only available in debug mode
-rw-r--r--main_gui.c40
-rw-r--r--ttd.c19
2 files changed, 22 insertions, 37 deletions
diff --git a/main_gui.c b/main_gui.c
index 99864a5fb..c7b30a5e3 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -2292,7 +2292,7 @@ static WindowDesc _main_status_desc = {
StatusBarWndProc
};
-extern void DebugProc(int i);
+extern void UpdateAllStationVirtCoord(void);
static void MainWindowWndProc(Window *w, WindowEvent *e) {
int off_x;
@@ -2339,8 +2339,7 @@ static void MainWindowWndProc(Window *w, WindowEvent *e) {
break;
}
- if (_game_mode == GM_MENU)
- break;
+ if (_game_mode == GM_MENU) break;
switch (e->keypress.keycode) {
case 'C': case 'Z': {
@@ -2356,18 +2355,26 @@ static void MainWindowWndProc(Window *w, WindowEvent *e) {
case WKC_ESC: ResetObjectToPlace(); break;
case WKC_DELETE: DeleteNonVitalWindows(); break;
case WKC_DELETE | WKC_SHIFT: DeleteAllNonVitalWindows(); break;
- case 'Q' | WKC_CTRL: AskExitGame(); break;
- case 'Q' | WKC_META: AskExitGame(); break; // this enables command + Q on mac
+ case 'Q' | WKC_CTRL: case 'Q' | WKC_META: AskExitGame(); break; // this enables command + Q on mac
case 'R' | WKC_CTRL: MarkWholeScreenDirty(); break;
- case '0' | WKC_ALT:
- case '1' | WKC_ALT:
- case '2' | WKC_ALT:
+#if defined(_DEBUG)
+ case '0' | WKC_ALT: /* Crash the game */
+ *(byte*)0 = 0;
+ break;
+ case '1' | WKC_ALT: /* Gimme money */
+ /* Server can not cheat in advertise mode either! */
+ #ifdef ENABLE_NETWORK
+ if (!_networking || !_network_server || !_network_advertise)
+ #endif
+ DoCommandP(0, -10000000, 0, NULL, CMD_MONEY_CHEAT);
+ break;
+ case '2' | WKC_ALT: /* Update the coordinates of all station signs */
+ UpdateAllStationVirtCoord();
+ break;
case '3' | WKC_ALT:
case '4' | WKC_ALT:
-#if defined(_DEBUG)
- DebugProc(e->keypress.keycode - ('0' | WKC_ALT));
-#endif
break;
+#endif
case 'X':
_display_opt ^= DO_TRANS_BUILDINGS;
@@ -2375,15 +2382,12 @@ static void MainWindowWndProc(Window *w, WindowEvent *e) {
break;
#ifdef ENABLE_NETWORK
- case WKC_RETURN:
- case 'T' | WKC_SHIFT:
- if (_networking)
- ShowNetworkChatQueryWindow(DESTTYPE_BROADCAST, 0);
+ case WKC_RETURN: case 'T' | WKC_SHIFT:
+ if (_networking) ShowNetworkChatQueryWindow(DESTTYPE_BROADCAST, 0);
break;
-#endif /* ENABLE_NETWORK */
+#endif
- default:
- return;
+ default: return;
}
e->keypress.cont = false;
break;
diff --git a/ttd.c b/ttd.c
index 6d7ce950a..92470e6ec 100644
--- a/ttd.c
+++ b/ttd.c
@@ -1413,22 +1413,3 @@ bool AfterLoadGame(uint version)
return true;
}
-
-void DebugProc(int i)
-{
- switch(i) {
- case 0:
- *(byte*)0 = 0;
- break;
- case 1:
- /* Server can not cheat in advertise mode either! */
-#ifdef ENABLE_NETWORK
- if (!_networking || !_network_server || !_network_advertise)
-#endif /* ENABLE_NETWORK */
- DoCommandP(0, -10000000, 0, NULL, CMD_MONEY_CHEAT);
- break;
- case 2:
- UpdateAllStationVirtCoord();
- break;
- }
-}