/*
* Initialize sound
*/
-static bool init_sound()
+static bool init_sound(void)
{
/* Initialize once */
if (!can_use_sound)
sprintf(wav, "%s.wav", angband_sound_name[i]);
/* Access the sound */
- path_build(buf, 1024, ANGBAND_DIR_XTRA_SOUND, wav);
+ path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_SOUND, wav);
/* Save the sound filename, if it exists */
if (check_file(buf)) sound_file[i] = string_make(buf);
static errr Term_xtra_gcu_sound(int v)
{
char buf[1024];
- char *argv[4];
/* Sound disabled */
if (!use_sound) return (1);
system(buf);
return (0);
-#if 0
+#if 0
+ char *argv[4];
pid_t pid;
/* Sound disabled */
return (0);
}
+
+static void hook_quit(cptr str)
+{
+ /* Exit curses */
+ endwin();
+}
+
+
/*
* Prepare "curses" for use by the file "term.c"
*
#ifdef USE_SOUND
/* Build the "sound" path */
- path_build(path, 1024, ANGBAND_DIR_XTRA, "sound");
+ path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "sound");
/* Allocate the path */
ANGBAND_DIR_XTRA_SOUND = string_make(path);
if (initscr() == (WINDOW*)ERR) return (-1);
#endif
+ /* Activate hooks */
+ quit_aux = hook_quit;
+ core_aux = hook_quit;
+
/* Hack -- Require large screen, or Quit with message */
i = ((LINES < 24) || (COLS < 80));
if (i) quit("Angband needs an 80x24 'curses' screen");
cbreak();
noecho();
nonl();
+ raw();
/* Extract the game keymap */
keymap_game_prepare();