diff --git a/doc/window.txt b/doc/window.txt index 5fb0ce26b..b2ae5c304 100644 --- a/doc/window.txt +++ b/doc/window.txt @@ -1025,11 +1025,11 @@ initoptions() /* read the resource file */ init_nhwindows() /* initialize the window system */ process_options(argc, argv) /* process command line options or equiv */ if(save file is present) { - display_gamewindows() /* create & display the game windows */ + init_sound_and_display_gamewindows() /* init sound, create & display */ dorestore() /* restore old game; pline()s are OK */ } else { player_selection() /* select a player type using a window */ - display_gamewindows() /* create & display the game windows */ + init_sound_and_display_gamewindows() /* init sound, create & display */ } pline("Hello, welcome..."); @@ -1044,9 +1044,10 @@ ini_routines have side effects that need to be undone, the old ini_routine (if any) will be called with an argument of WININIT_UNDO before the new ini_routine (if any) is called (with WININIT). -Display_gamewindows() is a common routine that displays the two standard -game windows (WIN_MESSAGE, WIN_MAP), and the status display. It is normally -called just before the "Hello, welcome" message. +Init_sound_and_display_gamewindows() is a common routine that initializes +the soundlib, then displays the standard game windows (WIN_MESSAGE, WIN_MAP, +etc.), and the status display. It is normally called just before the +"Hello, welcome" message. Process_options() is currently still unique to each port. There may be need in the future to make it possible to replace this on a per window-port basis. diff --git a/include/extern.h b/include/extern.h index b954e4662..6e7e44fd2 100644 --- a/include/extern.h +++ b/include/extern.h @@ -22,7 +22,7 @@ extern void early_init(void); extern void moveloop_core(void); extern void moveloop(boolean); extern void stop_occupation(void); -extern void display_gamewindows(void); +extern void init_sound_and_display_gamewindows(void); extern void newgame(void); extern void welcome(boolean); extern int argcheck(int, char **, enum earlyarg); diff --git a/outdated/sys/amiga/winami.c b/outdated/sys/amiga/winami.c index e2a0b1bad..7945ae316 100644 --- a/outdated/sys/amiga/winami.c +++ b/outdated/sys/amiga/winami.c @@ -426,7 +426,8 @@ struct NewScreen NewHackScreen = { 0, 0, WIDTH, SCREENHEIGHT, 3, 0, * plname is filled either by an option (-u Player or -uPlayer) or * explicitly (by being the wizard) or by askname. * It may still contain a suffix denoting pl_character. - * Always called after init_nhwindows() and before display_gamewindows(). + * Always called after init_nhwindows() and before + * init_sound_and_display_gamewindows(). */ void amii_askname() diff --git a/outdated/sys/be/bemain.c b/outdated/sys/be/bemain.c index f08ababf6..0cc921a9d 100644 --- a/outdated/sys/be/bemain.c +++ b/outdated/sys/be/bemain.c @@ -64,7 +64,7 @@ MAIN(int argc, char **argv) */ vision_init(); - display_gamewindows(); + init_sound_and_display_gamewindows(); /* * First, try to find and restore a save file for specified character. diff --git a/outdated/sys/mac/macmain.c b/outdated/sys/mac/macmain.c index 91b677df5..55a8d2e8a 100644 --- a/outdated/sys/mac/macmain.c +++ b/outdated/sys/mac/macmain.c @@ -65,7 +65,7 @@ main(void) */ vision_init(); - display_gamewindows(); + init_sound_and_display_gamewindows(); set_playmode(); /* sets plname to "wizard" for wizard mode */ /* strip role,race,&c suffix; calls askname() if plname[] is empty diff --git a/outdated/sys/msdos/SCHEMA35.MSC b/outdated/sys/msdos/SCHEMA35.MSC index 9f9c37d31..7afb12661 100644 --- a/outdated/sys/msdos/SCHEMA35.MSC +++ b/outdated/sys/msdos/SCHEMA35.MSC @@ -74,7 +74,7 @@ functions:49 _delete_levelfile _delete_savefile _delfloortrap _deliver_by_pline functions:50 _demonpet _destroy_arm _destroy_drawbridge _destroy_item _destroy_mitem _dev_name _dig functions:51 _dig_check _dig_corridor _dig_point _dig_typ _digactualhole _dighole _digit _dipfountain functions:52 _disable_ctrlP _disarm_landmine _disarm_shooting_trap _disarm_squeaky_board _discard_minvent _disclose _discover_object -functions:53 _diseasemu _display_binventory _display_cinventory _display_gamewindows _display_inventory _display_minventory +functions:53 _diseasemu _display_binventory _display_cinventory _init_sound_and_display_gamewindows _display_inventory _display_minventory functions:54 _distant_name _distfleeck _disturb _djinni_from_bottle _dlb_cleanup _dlb_fclose functions:55 _dlb_fgets _dlb_fopen _dlb_fread _dlb_fseek _dlb_ftell _dlb_init _dlord _dmgtype functions:56 _dmgval _dmonsfree _dmore _dname_to_dnum _do_break_wand _do_clear_area _do_comp _do_dknown_of diff --git a/outdated/sys/msdos/schema3.MSC b/outdated/sys/msdos/schema3.MSC index 33ad97bff..0b56c1232 100644 --- a/outdated/sys/msdos/schema3.MSC +++ b/outdated/sys/msdos/schema3.MSC @@ -74,7 +74,7 @@ functions:49 _delete_levelfile _delete_savefile _delfloortrap _deliver_by_pline functions:50 _demonpet _destroy_arm _destroy_drawbridge _destroy_item _destroy_mitem _dev_name _dig functions:51 _dig_check _dig_corridor _dig_point _dig_typ _digactualhole _dighole _digit _dipfountain functions:52 _disable_ctrlP _disarm_landmine _disarm_shooting_trap _disarm_squeaky_board _discard_minvent _disclose _discover_object -functions:53 _diseasemu _display_binventory _display_cinventory _display_gamewindows _display_inventory _display_minventory +functions:53 _diseasemu _display_binventory _display_cinventory _init_sound_and_display_gamewindows _display_inventory _display_minventory functions:54 _distant_name _distfleeck _disturb _djinni_from_bottle _dlb_cleanup _dlb_fclose functions:55 _dlb_fgets _dlb_fopen _dlb_fread _dlb_fseek _dlb_ftell _dlb_init _dlord _dmgtype functions:56 _dmgval _dmonsfree _dmore _dname_to_dnum _do_break_wand _do_clear_area _do_comp _do_dknown_of diff --git a/outdated/win/gem/wingem.c b/outdated/win/gem/wingem.c index a6dcb3b29..12b0ffe71 100644 --- a/outdated/win/gem/wingem.c +++ b/outdated/win/gem/wingem.c @@ -495,7 +495,7 @@ Gem_player_selection() * plname is filled either by an option (-u Player or -uPlayer) or * explicitly (by being the wizard) or by askname. * It may still contain a suffix denoting pl_character. - * Always called after init_nhwindows() and before display_gamewindows(). + * Always called after init_nhwindows() and before init_sound_and_display_gamewindows(). */ void diff --git a/src/allmain.c b/src/allmain.c index 58e673073..3dfc63a7d 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -58,8 +58,6 @@ moveloop_preamble(boolean resuming) change_luck(-1); } - activate_chosen_soundlib(); - if (!resuming) { /* new game */ gc.context.rndencode = rnd(9000); set_wear((struct obj *) 0); /* for side-effects of starting gear */ @@ -622,10 +620,12 @@ stop_occupation(void) } void -display_gamewindows(void) +init_sound_and_display_gamewindows(void) { int menu_behavior = MENU_BEHAVE_STANDARD; + activate_chosen_soundlib(); + WIN_MESSAGE = create_nhwindow(NHW_MESSAGE); if (VIA_WINDOWPORT()) { status_initialize(0); @@ -646,8 +646,8 @@ display_gamewindows(void) #ifdef MAC /* This _is_ the right place for this - maybe we will - * have to split display_gamewindows into create_gamewindows - * and show_gamewindows to get rid of this ifdef... + * have to split init_sound_and_display_gamewindows into + * create_gamewindows and show_gamewindows to get rid of this ifdef... */ if (!strcmp(windowprocs.name, "mac")) SanePositions(); diff --git a/sys/libnh/libnhmain.c b/sys/libnh/libnhmain.c index c3a8bfe35..ddfdf9074 100644 --- a/sys/libnh/libnhmain.c +++ b/sys/libnh/libnhmain.c @@ -247,7 +247,7 @@ nhmain(int argc, char *argv[]) */ vision_init(); - display_gamewindows(); + init_sound_and_display_gamewindows(); /* * First, try to find and restore a save file for specified character. diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 2a7464755..196af1996 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -448,7 +448,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ */ vision_init(); - display_gamewindows(); + init_sound_and_display_gamewindows(); /* * First, try to find and restore a save file for specified character. * We'll return here if new game player_selection() renames the hero. diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index 3c1bd66d6..cbbc249a1 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -216,7 +216,7 @@ main(int argc, char *argv[]) */ vision_init(); - display_gamewindows(); + init_sound_and_display_gamewindows(); /* * First, try to find and restore a save file for specified character. diff --git a/sys/vms/vmsmain.c b/sys/vms/vmsmain.c index a043c0149..a7c7c2ccd 100644 --- a/sys/vms/vmsmain.c +++ b/sys/vms/vmsmain.c @@ -183,7 +183,7 @@ main(int argc, char *argv[]) */ vision_init(); - display_gamewindows(); + init_sound_and_display_gamewindows(); /* * First, try to find and restore a save file for specified character. diff --git a/sys/windows/windmain.c b/sys/windows/windmain.c index 6361ca11d..23ec924ef 100644 --- a/sys/windows/windmain.c +++ b/sys/windows/windmain.c @@ -678,7 +678,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ * new game or before a level restore on a saved game. */ vision_init(); - display_gamewindows(); + init_sound_and_display_gamewindows(); /* * First, try to find and restore a save file for specified character. * We'll return here if new game player_selection() renames the hero. diff --git a/win/tty/wintty.c b/win/tty/wintty.c index aa83f5b8f..605170711 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -586,7 +586,8 @@ tty_player_selection(void) * gp.plname is filled either by an option (-u Player or -uPlayer) or * explicitly (by being the wizard) or by askname. * It may still contain a suffix denoting the role, etc. - * Always called after init_nhwindows() and before display_gamewindows(). + * Always called after init_nhwindows() and before + * init_sound_and_display_gamewindows(). */ void tty_askname(void)