#ifndef INCLUDED_Z_TERM_H
#define INCLUDED_Z_TERM_H
-#include "h-basic.h"
-
-
-/*
- * A term_win is a "window" for a Term
- *
- * - Cursor Useless/Visible codes
- * - Cursor Location (see "Useless")
- *
- * - Array[h] -- Access to the attribute array
- * - Array[h] -- Access to the character array
- *
- * - Array[h*w] -- Attribute array
- * - Array[h*w] -- Character array
- *
- * Note that the attr/char pair at (x,y) is a[y][x]/c[y][x]
- * and that the row of attr/chars at (0,y) is a[y]/c[y]
- */
+#include "system/h-basic.h"
typedef struct term_win term_win;
-
-struct term_win
+ /*!
+ * @brief A term_win is a "window" for a Term
+ */
+ struct term_win
{
- bool cu, cv;
- byte cx, cy;
+ bool cu, cv; //!< Cursor Useless / Visible codes
+ TERM_LEN cx, cy; //!< Cursor Location (see "Useless")
- SYMBOL_COLOR **a;
- char **c;
+ TERM_COLOR **a; //!< Array[h*w] -- Attribute array
+ char **c; //!< Array[h*w] -- Character array
- byte *va;
- char *vc;
+ TERM_COLOR *va; //!< Array[h] -- Access to the attribute array
+ char *vc; //!< Array[h] -- Access to the character array
- byte **ta;
- char **tc;
+ TERM_COLOR **ta; //!< Note that the attr pair at(x, y) is a[y][x]
+ char **tc; //!< Note that the char pair at(x, y) is c[y][x]
- byte *vta;
- char *vtc;
+ TERM_COLOR *vta; //!< Note that the row of attr at(0, y) is a[y]
+ char *vtc; //!< Note that the row of chars at(0, y) is c[y]
};
vptr data; //!< Extra "data" info (used by implementation)
bool user_flag; //!< Flag "user_flag" An extra "user" flag (used by application)
- bool data_flag; //!< Flag "data_flag" An extra "data" flag(used by implementation)
+ bool data_flag; //!< Flag "data_flag" An extra "data" flag (used by implementation)
bool active_flag; //!< Flag "active_flag" This "term" is "active"
bool mapped_flag; //!< Flag "mapped_flag" This "term" is "mapped"
u16b key_xtra;
u16b key_size;
- TERM_POSITION wid; //!< Window Width(max 255)
- TERM_POSITION hgt; //!< Window Height(max 255)
+ TERM_LEN wid; //!< Window Width(max 255)
+ TERM_LEN hgt; //!< Window Height(max 255)
- byte y1; //!< Minimum modified row
- byte y2; //!< Maximum modified row
+ TERM_LEN y1; //!< Minimum modified row
+ TERM_LEN y2; //!< Maximum modified row
- byte *x1; //!< Minimum modified column(per row)
- byte *x2; //!< Maximum modified column(per row)
+ TERM_LEN *x1; //!< Minimum modified column(per row)
+ TERM_LEN *x2; //!< Maximum modified column(per row)
term_win *old; //!< Displayed screen image
term_win *scr; //!< Requested screen image
void (*nuke_hook)(term *t); //!< Hook for nuke - ing the term
errr (*user_hook)(int n); //!< ユーザ設定項目実装部 / Hook for user actions
- errr (*xtra_hook)(int n, int v); //!< Hook for extra actions
- errr (*curs_hook)(TERM_POSITION x, TERM_POSITION y); //!< Hook for placing the cursor
- errr (*bigcurs_hook)(TERM_POSITION x, TERM_POSITION y);
- errr (*wipe_hook)(TERM_POSITION x, TERM_POSITION y, int n); //!< Hook for drawing some blank spaces
- errr (*text_hook)(TERM_POSITION x, TERM_POSITION y, int n, byte a, cptr s); //!< Hook for drawing a string of chars using an attr
- void (*resize_hook)(void);
- errr (*pict_hook)(TERM_POSITION x, TERM_POSITION y, int n, const byte *ap, const char *cp, const byte *tap, const char *tcp); //!< Hook for drawing a sequence of special attr / char pairs
+ errr (*xtra_hook)(int n, int v); //!< 拡張機能実装部 / Hook for extra actions
+ errr (*curs_hook)(TERM_LEN x, TERM_LEN y); //!< カーソル描画実装部 / Hook for placing the cursor
+ errr (*bigcurs_hook)(TERM_LEN x, TERM_LEN y); //!< 大型タイル時カーソル描画実装部 / Hook for placing the cursor on bigtile mode
+ errr (*wipe_hook)(TERM_LEN x, TERM_LEN y, int n); //!< 指定座標テキスト消去実装部 / Hook for drawing some blank spaces
+ errr (*text_hook)(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s); //!< テキスト描画実装部 / Hook for drawing a string of chars using an attr
+ void (*resize_hook)(void); //!< 画面リサイズ実装部
+ errr (*pict_hook)(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap, concptr cp, const TERM_COLOR *tap, concptr tcp); //!< タイル描画実装部 / Hook for drawing a sequence of special attr / char pairs
};
#define TERM_XTRA_MUSIC_DUNGEON 15 /* Play a music(dungeon) (optional) */
#define TERM_XTRA_MUSIC_QUEST 16 /* Play a music(quest) (optional) */
#define TERM_XTRA_MUSIC_TOWN 17 /* Play a music(floor) (optional) */
-
+#define TERM_XTRA_MUSIC_MUTE 18
/**** Available Variables ****/
extern errr Term_user(int n);
extern errr Term_xtra(int n, int v);
-extern void Term_queue_char(TERM_POSITION x, TERM_POSITION y, byte a, char c, byte ta, char tc);
-extern void Term_queue_bigchar(TERM_POSITION x, TERM_POSITION y, byte a, char c, byte ta, char tc);
+extern void Term_queue_char(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c, TERM_COLOR ta, char tc);
+extern void Term_queue_bigchar(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c, TERM_COLOR ta, char tc);
-extern void Term_queue_line(TERM_POSITION x, TERM_POSITION y, int n, byte *a, char *c, byte *ta, char *tc);
+extern void Term_queue_line(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR *a, char *c, TERM_COLOR *ta, char *tc);
-extern void Term_queue_chars(TERM_POSITION x, TERM_POSITION y, int n, byte a, cptr s);
+extern void Term_queue_chars(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s);
extern errr Term_fresh(void);
extern errr Term_set_cursor(int v);
-extern errr Term_gotoxy(TERM_POSITION x, TERM_POSITION y);
-extern errr Term_draw(TERM_POSITION x, TERM_POSITION y, byte a, char c);
-extern errr Term_addch(byte a, char c);
-extern errr Term_add_bigch(byte a, char c);
-extern errr Term_addstr(int n, byte a, cptr s);
-extern errr Term_putch(TERM_POSITION x, TERM_POSITION y, byte a, char c);
-extern errr Term_putstr(TERM_POSITION x, TERM_POSITION y, int n, byte a, cptr s);
+extern errr Term_gotoxy(TERM_LEN x, TERM_LEN y);
+extern errr Term_draw(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c);
+extern errr Term_addch(TERM_COLOR a, char c);
+extern errr Term_add_bigch(TERM_COLOR a, char c);
+extern errr Term_addstr(int n, TERM_COLOR a, concptr s);
+extern errr Term_putch(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c);
+extern errr Term_putstr(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s);
#ifdef JP
-extern errr Term_putstr_v(TERM_POSITION x, TERM_POSITION y, int n, byte a, cptr s);
+extern errr Term_putstr_v(TERM_LEN x, TERM_LEN y, int n, byte a, concptr s);
#endif
-extern errr Term_erase(TERM_POSITION x, TERM_POSITION y, int n);
+extern errr Term_erase(TERM_LEN x, TERM_LEN y, int n);
extern errr Term_clear(void);
extern errr Term_redraw(void);
-extern errr Term_redraw_section(TERM_POSITION x1, TERM_POSITION y1, TERM_POSITION x2, TERM_POSITION y2);
+extern errr Term_redraw_section(TERM_LEN x1, TERM_LEN y1, TERM_LEN x2, TERM_LEN y2);
extern errr Term_get_cursor(int *v);
-extern errr Term_get_size(TERM_POSITION *w, TERM_POSITION *h);
+extern errr Term_get_size(TERM_LEN *w, TERM_LEN *h);
extern errr Term_locate(int *x, int *y);
-extern errr Term_what(TERM_POSITION x, TERM_POSITION y, byte *a, char *c);
+extern errr Term_what(TERM_LEN x, TERM_LEN y, TERM_COLOR *a, char *c);
extern errr Term_flush(void);
extern errr Term_keypress(int k);