OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement. (BASE_STATUS / A_MAX)
[hengband/hengband.git] / src / main-gcu.c
index 0afe8df..541c624 100644 (file)
@@ -1,4 +1,4 @@
-/* File: main-gcu.c */
+/* File: main-gcu.c */
 
 /*
  * Copyright (c) 1997 Ben Harrison, and others
@@ -254,6 +254,9 @@ static term_data data[MAX_TERM_DATA];
 #endif
 
 
+#include <locale.h>
+
+
 /*
  * XXX XXX Hack -- POSIX uses "O_NONBLOCK" instead of "O_NDELAY"
  *
@@ -281,7 +284,7 @@ static term_data data[MAX_TERM_DATA];
 
 #ifdef USE_SOUND
 
-static cptr ANGBAND_DIR_XTRA_SOUND;
+static concptr ANGBAND_DIR_XTRA_SOUND;
 
 /*
  * Flag set once "sound" has been initialized
@@ -291,7 +294,7 @@ static bool can_use_sound = FALSE;
 /*
  * An array of sound file names
  */
-static cptr sound_file[SOUND_MAX];
+static concptr sound_file[SOUND_MAX];
 
 #endif /* USE_SOUND */
 
@@ -600,7 +603,7 @@ static errr Term_xtra_gcu_alive(int v)
       mvcur(curscr->cury, curscr->curx, LINES - 1, 0);
 #else
       /* this moves curses to bottom right corner */
-      mvcur(curscr->_cury, curscr->_curx, LINES - 1, 0);
+      mvcur(getcury(curscr), getcurx(curscr), LINES - 1, 0);
 #endif
 
       /* Exit curses */
@@ -633,7 +636,7 @@ static errr Term_xtra_gcu_alive(int v)
 /*
  * Check for existance of a file
  */
-static bool check_file(cptr s)
+static bool check_file(concptr s)
 {
    FILE *fff;
 
@@ -736,7 +739,7 @@ static void Term_nuke_gcu(term *t)
    mvcur(curscr->cury, curscr->curx, LINES - 1, 0);
 #else
    /* This moves curses to bottom right corner */
-   mvcur(curscr->_cury, curscr->_curx, LINES - 1, 0);
+   mvcur(getcury(curscr), getcurx(curscr), LINES - 1, 0);
 #endif
 
    /* Flush the curses buffer */
@@ -873,9 +876,8 @@ static errr Term_xtra_gcu_sound(int v)
    if (!sound_file[v]) return (1);
 
    sprintf(buf,"./gcusound.sh %s\n", sound_file[v]);
-   system(buf);
    
-   return (0);
+   return (system(buf) < 0);
 
 #if 0
    char *argv[4];
@@ -958,8 +960,7 @@ static errr Term_xtra_gcu(int n, int v)
 
       /* Make a noise */
       case TERM_XTRA_NOISE:
-      (void)write(1, "\007", 1);
-      return (0);
+      return write(1, "\007", 1) != 1;
 
 #ifdef USE_SOUND
       /* Make a special sound */
@@ -1063,7 +1064,7 @@ static errr Term_wipe_gcu(int x, int y, int n)
  * think hard about how map_info() in cave.c should handle the color
  * of something that we here draw in reverse. It's not so simple, alas.
  */
-static void Term_acs_text_gcu(int x, int y, int n, byte a, cptr s)
+static void Term_acs_text_gcu(int x, int y, int n, byte a, concptr s)
 {
    term_data *td = (term_data *)(Term->data);
    int i;
@@ -1088,7 +1089,7 @@ static void Term_acs_text_gcu(int x, int y, int n, byte a, cptr s)
 /*
  * Place some text on the screen using an attribute
  */
-static errr Term_text_gcu(int x, int y, int n, byte a, cptr s)
+static errr Term_text_gcu(int x, int y, int n, byte a, concptr s)
 {
    term_data *td = (term_data *)(Term->data);
 
@@ -1175,7 +1176,7 @@ static errr term_data_init(term_data *td, int rows, int cols, int y, int x)
 }
 
 
-static void hook_quit(cptr str)
+static void hook_quit(concptr str)
 {
        /* Unused */
        (void)str;
@@ -1205,6 +1206,8 @@ errr init_gcu(int argc, char *argv[])
    (void)argv;
 
 
+   setlocale(LC_ALL, "");
+
 #ifdef USE_SOUND
 
    /* Build the "sound" path */
@@ -1293,15 +1296,15 @@ errr init_gcu(int argc, char *argv[])
                colortable[3] = (COLOR_PAIR(1) | A_BRIGHT);     /* Orange XXX */
                colortable[4] = (COLOR_PAIR(1) | A_NORMAL);     /* Red */
                colortable[5] = (COLOR_PAIR(2) | A_NORMAL);     /* Green */
-               colortable[6] = (COLOR_PAIR(4) | A_NORMAL);     /* Blue */
+               colortable[6] = (COLOR_PAIR(4) | A_BRIGHT);     /* Blue */
                colortable[7] = (COLOR_PAIR(3) | A_NORMAL);     /* Umber */
                colortable[8] = (COLOR_PAIR(7) | A_BRIGHT);     /* Dark-grey XXX */
                colortable[9] = (COLOR_PAIR(0) | A_NORMAL);     /* Light-grey XXX */
-               colortable[10] = (COLOR_PAIR(5) | A_NORMAL);    /* Purple */
+               colortable[10] = (COLOR_PAIR(5) | A_BRIGHT);    /* Purple */
                colortable[11] = (COLOR_PAIR(3) | A_BRIGHT);    /* Yellow */
-               colortable[12] = (COLOR_PAIR(5) | A_BRIGHT);    /* Light Red XXX */
+               colortable[12] = (COLOR_PAIR(5) | A_NORMAL);    /* Light Red XXX */
                colortable[13] = (COLOR_PAIR(2) | A_BRIGHT);    /* Light Green */
-               colortable[14] = (COLOR_PAIR(4) | A_BRIGHT);    /* Light Blue */
+               colortable[14] = (COLOR_PAIR(6) | A_BRIGHT);    /* Light Blue */
                colortable[15] = (COLOR_PAIR(3) | A_NORMAL);    /* Light Umber XXX */
 
    }