Move the editor call out of the Function_mode loop, for later overhaul

This commit is contained in:
kreatordxx 2010-01-23 14:19:21 +00:00
parent e3ccb8e6cf
commit b6b9cc1546
4 changed files with 24 additions and 13 deletions

View file

@ -1,5 +1,9 @@
D1X-Rebirth Changelog 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 20100121
-------- --------
main/newdemo.c: Removed the new Demo Interpolating code and added the improvements to the old one main/newdemo.c: Removed the new Demo Interpolating code and added the improvements to the old one

View file

@ -754,6 +754,14 @@ void HandleGameKey(int key)
case KEY_E + KEY_DEBUGGED: case KEY_E + KEY_DEBUGGED:
network_leave_game(); network_leave_game();
Function_mode = FMODE_EDITOR; 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; break;
case KEY_C + KEY_SHIFTED + KEY_DEBUGGED: case KEY_C + KEY_SHIFTED + KEY_DEBUGGED:
if (!( Game_mode & GM_MULTI )) if (!( Game_mode & GM_MULTI ))

View file

@ -356,12 +356,6 @@ int main(int argc, char *argv[])
switch( Function_mode ) { switch( Function_mode ) {
case FMODE_MENU: case FMODE_MENU:
DoMenu(); DoMenu();
#ifdef EDITOR
if ( Function_mode == FMODE_EDITOR ) {
create_new_mine();
SetPlayerFromCurseg();
}
#endif
break; break;
case FMODE_GAME: case FMODE_GAME:
#ifdef EDITOR #ifdef EDITOR
@ -375,13 +369,7 @@ int main(int argc, char *argv[])
break; break;
#ifdef EDITOR #ifdef EDITOR
case FMODE_EDITOR: case FMODE_EDITOR:
keyd_editor_mode = 1; Int3(); // meant to be calling editor from do_option, for now
editor();
if ( Function_mode == FMODE_GAME ) {
Game_mode = GM_EDITOR;
editor_reset_stuff_on_level();
N_players = 1;
}
break; break;
#endif #endif
default: default:

View file

@ -265,6 +265,17 @@ void do_option ( int select)
case MENU_EDITOR: case MENU_EDITOR:
Function_mode = FMODE_EDITOR; Function_mode = FMODE_EDITOR;
init_cockpit(); 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; break;
#endif #endif
case MENU_VIEW_SCORES: case MENU_VIEW_SCORES: