OSDN Git Service

[Version] 2.2.1.6.
[hengband/hengband.git] / src / z-term.c
index 36de556..f8c8c50 100644 (file)
@@ -444,7 +444,6 @@ static errr Term_curs_hack(TERM_LEN x, TERM_LEN y)
        (void)x;
        (void)y;
 
-       /* Oops */
        return (-1);
 }
 
@@ -466,7 +465,6 @@ static errr Term_wipe_hack(TERM_LEN x, TERM_LEN y, int n)
        (void)y;
        (void)n;
 
-       /* Oops */
        return (-1);
 }
 
@@ -482,7 +480,6 @@ static errr Term_text_hack(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, cptr cp)
        (void)a;
        (void)cp;
 
-       /* Oops */
        return (-1);
 }
 
@@ -500,7 +497,6 @@ static errr Term_pict_hack(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap,
        (void)tap;
        (void)tcp;
 
-       /* Oops */
        return (-1);
 }
 
@@ -1472,7 +1468,7 @@ static void Term_fresh_row_text(TERM_LEN y, TERM_LEN x1, TERM_LEN x2)
  * On systems with a "soft" cursor, we must explicitly erase the cursor
  * before flushing the output, if needed, to prevent a "jumpy" refresh.
  * The actual method for this is horrible, but there is very little that
- * we can do to simplify it efficiently.  XXX XXX XXX
+ * we can do to simplify it efficiently.  
  *
  * On systems with a "hard" cursor, we will "hide" the cursor before
  * flushing the output, if needed, to avoid a "flickery" refresh.  It
@@ -2064,10 +2060,10 @@ errr Term_erase(TERM_LEN x, TERM_LEN y, int n)
        int na = Term->attr_blank;
        int nc = Term->char_blank;
 
-       byte *scr_aa;
+       TERM_COLOR *scr_aa;
        char *scr_cc;
 
-       byte *scr_taa;
+       TERM_COLOR *scr_taa;
        char *scr_tcc;
 
        /* Place cursor */
@@ -2329,7 +2325,7 @@ errr Term_get_size(TERM_LEN *w, TERM_LEN *h)
 /*
  * Extract the current cursor location
  */
-errr Term_locate(int *x, int *y)
+errr Term_locate(TERM_LEN *x, TERM_LEN *y)
 {
        /* Access the cursor */
        (*x) = Term->scr->cx;
@@ -2431,11 +2427,6 @@ errr Term_key_push(int k)
        /* Success (unless overflow) */
        if (Term->key_head != Term->key_tail) return (0);
 
-#if 0
-       /* Hack -- Forget the oldest key */
-       if (++Term->key_tail == Term->key_size) Term->key_tail = 0;
-#endif
-
        /* Problem */
        return (1);
 }
@@ -2517,8 +2508,8 @@ errr Term_inkey(char *ch, bool wait, bool take)
  */
 errr Term_save(void)
 {
-       int w = Term->wid;
-       int h = Term->hgt;
+       TERM_LEN w = Term->wid;
+       TERM_LEN h = Term->hgt;
 
        /* Create */
        if (!Term->mem)
@@ -2587,8 +2578,8 @@ errr Term_exchange(void)
 {
        TERM_LEN y;
 
-       int w = Term->wid;
-       int h = Term->hgt;
+       TERM_LEN w = Term->wid;
+       TERM_LEN h = Term->hgt;
 
        term_win *exchanger;
 
@@ -2629,14 +2620,14 @@ errr Term_exchange(void)
 /*
  * React to a new physical window size.
  */
-errr Term_resize(int w, int h)
+errr Term_resize(TERM_LEN w, TERM_LEN h)
 {
        int i;
 
-       int wid, hgt;
+       TERM_LEN wid, hgt;
 
-       byte *hold_x1;
-       byte *hold_x2;
+       TERM_LEN *hold_x1;
+       TERM_LEN *hold_x2;
 
        term_win *hold_old;
        term_win *hold_scr;
@@ -2677,8 +2668,8 @@ errr Term_resize(int w, int h)
        hold_tmp = Term->tmp;
 
        /* Create new scanners */
-       C_MAKE(Term->x1, h, byte);
-       C_MAKE(Term->x2, h, byte);
+       C_MAKE(Term->x1, h, TERM_LEN);
+       C_MAKE(Term->x2, h, TERM_LEN);
 
        /* Create new window */
        MAKE(Term->old, term_win);
@@ -2725,8 +2716,8 @@ errr Term_resize(int w, int h)
        }
 
        /* Free some arrays */
-       C_KILL(hold_x1, Term->hgt, byte);
-       C_KILL(hold_x2, Term->hgt, byte);
+       C_KILL(hold_x1, Term->hgt, TERM_LEN);
+       C_KILL(hold_x2, Term->hgt, TERM_LEN);
 
        /* Nuke */
        term_win_nuke(hold_old, Term->wid, Term->hgt);
@@ -2777,8 +2768,8 @@ errr Term_resize(int w, int h)
        }
 
        /* Save new size */
-       Term->wid = (byte_hack)w;
-       Term->hgt = (byte_hack)h;
+       Term->wid = w;
+       Term->hgt = h;
 
        /* Force "total erase" */
        Term->total_erase = TRUE;
@@ -2854,8 +2845,8 @@ errr Term_activate(term *t)
  */
 errr term_nuke(term *t)
 {
-       int w = t->wid;
-       int h = t->hgt;
+       TERM_LEN w = t->wid;
+       TERM_LEN h = t->hgt;
 
 
        /* Hack -- Call the special "nuke" hook */
@@ -2905,8 +2896,8 @@ errr term_nuke(term *t)
        }
 
        /* Free some arrays */
-       C_KILL(t->x1, h, byte);
-       C_KILL(t->x2, h, byte);
+       C_KILL(t->x1, h, TERM_LEN);
+       C_KILL(t->x2, h, TERM_LEN);
 
        /* Free the input queue */
        C_KILL(t->key_queue, t->key_size, char);
@@ -2922,7 +2913,7 @@ errr term_nuke(term *t)
  * By default, the cursor starts out "invisible"
  * By default, we "erase" using "black spaces"
  */
-errr term_init(term *t, int w, int h, int k)
+errr term_init(term *t, TERM_LEN w, TERM_LEN h, int k)
 {
        TERM_LEN y;
 
@@ -2942,12 +2933,12 @@ errr term_init(term *t, int w, int h, int k)
 
 
        /* Save the size */
-       t->wid = (byte_hack)w;
-       t->hgt = (byte_hack)h;
+       t->wid = w;
+       t->hgt = h;
 
        /* Allocate change arrays */
-       C_MAKE(t->x1, h, byte);
-       C_MAKE(t->x2, h, byte);
+       C_MAKE(t->x1, h, TERM_LEN);
+       C_MAKE(t->x2, h, TERM_LEN);
 
 
        /* Allocate "displayed" */