OSDN Git Service

[Refactor] monster_idxと0との比較を関数化する
[hengbandforosx/hengbandosx.git] / src / main-cap.cpp
index e2166ee..aae411a 100644 (file)
@@ -1,9 +1,10 @@
-/* File: main-cap.c */
+/* File: main-cap.c */
 
 /* Purpose: Support for "term.c" using "termcap" calls */
 
 #include "io/exit-panic.h"
 #include "system/angband.h"
+#include "term/gameterm.h"
 #include "term/z-form.h"
 
 #ifdef USE_CAP
@@ -332,10 +333,10 @@ errr init_cap_aux(void)
 
     /* Get the (initial) columns and rows, or default */
     if ((cols = tgetnum("co")) == -1) {
-        cols = 80;
+        cols = TERM_DEFAULT_COLS;
     }
     if ((rows = tgetnum("li")) == -1) {
-        rows = 24;
+        rows = TERM_DEFAULT_ROWS;
     }
 
     /* Find out how to move the cursor to a given location */
@@ -399,8 +400,8 @@ errr init_cap_aux(void)
 #ifdef USE_HARDCODE
 
     /* Assume some defualt information */
-    rows = 24;
-    cols = 80;
+    rows = TERM_DEFAULT_ROWS;
+    cols = TERM_DEFAULT_COLS;
 
     /* Clear screen */
     cl = "\033[2J\033[H"; /* --]--]-- */
@@ -801,7 +802,7 @@ static errr game_term_wipe_cap(int x, int y, int n)
     game_term_curs_cap(x, y);
 
     /* Wipe to end of line */
-    if (x + n >= 80) {
+    if (x + n >= MAIN_TERM_MIN_COLS) {
         do_ce();
     }
 
@@ -960,7 +961,7 @@ errr init_cap(void)
     }
 
     /* Hack -- Require large screen, or Quit with message */
-    if ((rows < 24) || (cols < 80)) {
+    if ((rows < MAIN_TERM_MIN_ROWS) || (cols < MAIN_TERM_MIN_COLS)) {
         quit("Screen too small!");
     }
 
@@ -981,7 +982,7 @@ errr init_cap(void)
     /*** Now prepare the term ***/
 
     /* Initialize the term */
-    term_init(t, 80, 24, 256);
+    term_init(t, TERM_DEFAULT_COLS, TERM_DEFAULT_ROWS, 256);
 
     /* Avoid the bottom right corner */
     t->icky_corner = true;