OSDN Git Service

キャラクター生成中やオプション設定中に'?'を押すとヘルプファイルの中の
[hengbandforosx/hengbandosx.git] / src / main-gcu.c
index 905d3ed..565ee7c 100644 (file)
@@ -496,9 +496,6 @@ static void keymap_game_prepare(void)
    game_termios.c_cc[VMIN] = 1;
    game_termios.c_cc[VTIME] = 0;
 
-   /* Turn off flow control */
-   game_termios.c_iflag &= ~IXON;
-
 #endif
 
 #ifdef USE_TERMIO
@@ -537,9 +534,6 @@ static void keymap_game_prepare(void)
    game_termio.c_cc[VMIN] = 1;
    game_termio.c_cc[VTIME] = 0;
 
-   /* Turn off flow control */
-   game_termio.c_iflag &= ~IXON;
-   
 #endif
 
 #ifdef USE_TCHARS
@@ -571,9 +565,7 @@ static void keymap_game_prepare(void)
    game_tchars.t_quitc = (char)-1;
    game_tchars.t_eofc = (char)-1;
    game_tchars.t_brkc = (char)-1;
-   
-   /* XXX XXX XXX  Should maybe turn off flow control too.  How? */
-   
+
 #endif
 
 }
@@ -659,7 +651,7 @@ static bool check_file(cptr s)
 /*
  * Initialize sound
  */
-static bool init_sound()
+static bool init_sound(void)
 {
    /* Initialize once */
    if (!can_use_sound)
@@ -676,7 +668,7 @@ static bool init_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);
@@ -1182,6 +1174,14 @@ static errr term_data_init(term_data *td, int rows, int cols, int y, int x)
    return (0);
 }
 
+
+static void hook_quit(cptr str)
+{
+       /* Exit curses */
+       endwin();
+}
+
+
 /*
  * Prepare "curses" for use by the file "term.c"
  *
@@ -1200,7 +1200,7 @@ errr init_gcu(int argc, char *argv[])
 #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);
@@ -1218,6 +1218,10 @@ errr init_gcu(int argc, char *argv[])
    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");
@@ -1343,6 +1347,7 @@ errr init_gcu(int argc, char *argv[])
    cbreak();
    noecho();
    nonl();
+   raw();
 
    /* Extract the game keymap */
    keymap_game_prepare();