From b6b9cc1546503d1a94cf884101cb45342a35375a Mon Sep 17 00:00:00 2001 From: kreatordxx <> Date: Sat, 23 Jan 2010 14:19:21 +0000 Subject: [PATCH] Move the editor call out of the Function_mode loop, for later overhaul --- CHANGELOG.txt | 4 ++++ main/gamecntl.c | 8 ++++++++ main/inferno.c | 14 +------------- main/menu.c | 11 +++++++++++ 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2cd674c1a..4e306d620 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D1X-Rebirth Changelog +20100123 +-------- +main/gamecntl.c, main/inferno.c, main/menu.c: Move the editor call out of the Function_mode loop, for later overhaul + 20100121 -------- main/newdemo.c: Removed the new Demo Interpolating code and added the improvements to the old one diff --git a/main/gamecntl.c b/main/gamecntl.c index ae8e3e03a..5cdd9e1a9 100644 --- a/main/gamecntl.c +++ b/main/gamecntl.c @@ -754,6 +754,14 @@ void HandleGameKey(int key) case KEY_E + KEY_DEBUGGED: network_leave_game(); Function_mode = FMODE_EDITOR; + + keyd_editor_mode = 1; + editor(); + if ( Function_mode == FMODE_GAME ) { + Game_mode = GM_EDITOR; + editor_reset_stuff_on_level(); + N_players = 1; + } break; case KEY_C + KEY_SHIFTED + KEY_DEBUGGED: if (!( Game_mode & GM_MULTI )) diff --git a/main/inferno.c b/main/inferno.c index 59aae8585..e58fb8be4 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -356,12 +356,6 @@ int main(int argc, char *argv[]) switch( Function_mode ) { case FMODE_MENU: DoMenu(); -#ifdef EDITOR - if ( Function_mode == FMODE_EDITOR ) { - create_new_mine(); - SetPlayerFromCurseg(); - } -#endif break; case FMODE_GAME: #ifdef EDITOR @@ -375,13 +369,7 @@ int main(int argc, char *argv[]) break; #ifdef EDITOR case FMODE_EDITOR: - keyd_editor_mode = 1; - editor(); - if ( Function_mode == FMODE_GAME ) { - Game_mode = GM_EDITOR; - editor_reset_stuff_on_level(); - N_players = 1; - } + Int3(); // meant to be calling editor from do_option, for now break; #endif default: diff --git a/main/menu.c b/main/menu.c index d7bf5705b..b75f85469 100644 --- a/main/menu.c +++ b/main/menu.c @@ -265,6 +265,17 @@ void do_option ( int select) case MENU_EDITOR: Function_mode = FMODE_EDITOR; init_cockpit(); + + create_new_mine(); + SetPlayerFromCurseg(); + + keyd_editor_mode = 1; + editor(); + if ( Function_mode == FMODE_GAME ) { + Game_mode = GM_EDITOR; + editor_reset_stuff_on_level(); + N_players = 1; + } break; #endif case MENU_VIEW_SCORES: