Hengband  2.2.1
データ構造 | マクロ定義 | 型定義 | 関数 | 変数
init.h ファイル

ゲームデータ初期化処理のヘッダファイル [詳解]

#include "h-basic.h"
init.h の依存先関係図:
被依存関係図:

[ソースコード]

データ構造

struct  header
 各初期データ用ヘッダ構造体 / Template file header information (see "init.c"). [詳解]
 

マクロ定義

#define FAKE_NAME_SIZE   40 * 1024L
 ゲーム情報の種別毎に用意される名前用バッファの容量 [詳解]
 
#define FAKE_TEXT_SIZE   150 * 1024L
 ゲーム情報の種別毎に用意されるテキスト用バッファの容量 [詳解]
 
#define FAKE_TAG_SIZE   10 * 1024L
 ゲーム情報の種別毎に用意されるタグ用バッファの容量 [詳解]
 
#define VER_INFO_ROW   3
 タイトル表記(行) [詳解]
 
#define MACRO_MAX   256
 マクロ登録の最大数 / Maximum number of macros (see "io.c") [詳解]
 

型定義

typedef struct header header
 
typedef errr(* parse_info_txt_func) (char *buf, header *head)
 

関数

errr init_info_txt (FILE *fp, char *buf, header *head, parse_info_txt_func parse_info_txt_line)
 パース関数に基づいてデータファイルからデータを読み取る / Initialize an "*_info" array, by parsing an ascii "template" file [詳解]
 
errr parse_z_info (char *buf, header *head)
 
errr parse_v_info (char *buf, header *head)
 Vault情報(v_info)のパース関数 / Initialize the "v_info" array, by parsing an ascii "template" file [詳解]
 
errr parse_f_info (char *buf, header *head)
 地形情報(f_info)のパース関数 / Initialize the "f_info" array, by parsing an ascii "template" file [詳解]
 
void retouch_f_info (header *head)
 地形情報の各種タグからIDへ変換して結果を収める / Retouch fake tags of f_info [詳解]
 
errr parse_k_info (char *buf, header *head)
 ベースアイテム(k_info)のパース関数 / Initialize the "k_info" array, by parsing an ascii "template" file [詳解]
 
errr parse_a_info (char *buf, header *head)
 固定アーティファクト情報(a_info)のパース関数 / Initialize the "a_info" array, by parsing an ascii "template" file [詳解]
 
errr parse_e_info (char *buf, header *head)
 アイテムエゴ情報(e_info)のパース関数 / Initialize the "e_info" array, by parsing an ascii "template" file [詳解]
 
errr parse_r_info (char *buf, header *head)
 モンスター種族情報(r_info)のパース関数 / Initialize the "r_info" array, by parsing an ascii "template" file [詳解]
 
errr parse_d_info (char *buf, header *head)
 ダンジョン情報(d_info)のパース関数 / Initialize the "d_info" array, by parsing an ascii "template" file [詳解]
 
errr parse_s_info (char *buf, header *head)
 職業技能情報(s_info)のパース関数 / Initialize the "s_info" array, by parsing an ascii "template" file [詳解]
 
errr parse_m_info (char *buf, header *head)
 職業魔法情報(m_info)のパース関数 / Initialize the "m_info" array, by parsing an ascii "template" file [詳解]
 
s16b f_tag_to_index (concptr str)
 地形タグからIDを得る / Convert a fake tag to a real feat index [詳解]
 
s16b f_tag_to_index_in_init (concptr str)
 地形タグからIDを得る / Initialize quest array [詳解]
 
void init_angband (void)
 全ゲームデータ読み込みのメインルーチン / Hack – main Angband initialization entry point [詳解]
 
concptr get_check_sum (void)
 サムチェック情報を出力 / Get check sum in string form [詳解]
 
void init_file_paths (char *path)
 各データファイルを読み取るためのパスを取得する Find the default paths to all of our important sub-directories. [詳解]
 

変数

int error_idx
 データ読み込み/初期化時に汎用的にエラーコードを保存するグローバル変数 [詳解]
 
int error_line
 データ読み込み/初期化時に汎用的にエラー行数を保存するグローバル変数 [詳解]
 
header z_head
 
header v_head
 Vault情報のヘッダ構造体 [詳解]
 
header f_head
 地形情報のヘッダ構造体 [詳解]
 
header k_head
 ペースアイテム情報のヘッダ構造体 [詳解]
 
header a_head
 固定アーティファクト情報のヘッダ構造体 [詳解]
 
header e_head
 アイテムエゴ情報のヘッダ構造体 [詳解]
 
header r_head
 モンスター種族情報のヘッダ構造体 [詳解]
 
header p_head
 
header h_head
 
header b_head
 
header g_head
 

詳解

ゲームデータ初期化処理のヘッダファイル

日付
2015/01/02
著者
Copyright (c) 2000 Robert Ruehlmann

This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies.

マクロ定義詳解

◆ FAKE_NAME_SIZE

#define FAKE_NAME_SIZE   40 * 1024L

ゲーム情報の種別毎に用意される名前用バッファの容量

◆ FAKE_TAG_SIZE

#define FAKE_TAG_SIZE   10 * 1024L

ゲーム情報の種別毎に用意されるタグ用バッファの容量

◆ FAKE_TEXT_SIZE

#define FAKE_TEXT_SIZE   150 * 1024L

ゲーム情報の種別毎に用意されるテキスト用バッファの容量

◆ MACRO_MAX

#define MACRO_MAX   256

マクロ登録の最大数 / Maximum number of macros (see "io.c")

覚え書き
Default: assume at most 256 macros are used

◆ VER_INFO_ROW

#define VER_INFO_ROW   3

タイトル表記(行)

型定義詳解

◆ header

typedef struct header header

◆ parse_info_txt_func

typedef errr(* parse_info_txt_func) (char *buf, header *head)

関数詳解

◆ f_tag_to_index()

s16b f_tag_to_index ( concptr  str)

地形タグからIDを得る / Convert a fake tag to a real feat index

引数
strタグ文字列
戻り値
地形ID
呼び出し関係図:

◆ f_tag_to_index_in_init()

s16b f_tag_to_index_in_init ( concptr  str)

地形タグからIDを得る / Initialize quest array

戻り値
地形ID
呼び出し関係図:

◆ get_check_sum()

concptr get_check_sum ( void  )

サムチェック情報を出力 / Get check sum in string form

戻り値
サムチェック情報の文字列
呼び出し関係図:

◆ init_angband()

void init_angband ( void  )

全ゲームデータ読み込みのメインルーチン / Hack – main Angband initialization entry point

戻り値
なし
覚え書き
This function is "messy" because various things
may or may not be initialized, but the "plog()" and "quit()"
functions are "supposed" to work under any conditions.
Verify some files, display the "news.txt" file, create
the high score file, initialize all internal arrays, and
load the basic "user pref files".
Be very careful to keep track of the order in which things
are initialized, in particular, the only thing *known* to
be available when this function is called is the "z-term.c"
package, and that may not be fully initialized until the
end of this function, when the default "user pref files"
are loaded and "Term_xtra(TERM_XTRA_REACT,0)" is called.
Note that this function attempts to verify the "news" file,
and the game aborts (cleanly) on failure, since without the
"news" file, it is likely that the "lib" folder has not been
correctly located.  Otherwise, the news file is displayed for
the user.
Note that this function attempts to verify (or create) the
"high score" file, and the game aborts (cleanly) on failure,
since one of the most common "extraction" failures involves
failing to extract all sub-directories (even empty ones), such
as by failing to use the "-d" option of "pkunzip", or failing
to use the "save empty directories" option with "Compact Pro".
This error will often be caught by the "high score" creation
code below, since the "lib/apex" directory, being empty in the
standard distributions, is most likely to be "lost", making it
impossible to create the high score file.
Note that various things are initialized by this function,
including everything that was once done by "init_some_arrays".
This initialization involves the parsing of special files
in the "lib/data" and sometimes the "lib/edit" directories.
Note that the "template" files are initialized first, since they
often contain errors.  This means that macros and message recall
and things like that are not available until after they are done.
We load the default "user pref files" here in case any "color"
changes are needed before character creation.
Note that the "graf-xxx.prf" file must be loaded separately,
if needed, in the first (?) pass through "TERM_XTRA_REACT".
呼び出し関係図:

◆ init_file_paths()

void init_file_paths ( char *  path)

各データファイルを読み取るためのパスを取得する Find the default paths to all of our important sub-directories.

引数
pathパス保管先の文字列
戻り値
なし
The purpose of each sub-directory is described in "variable.c".
All of the sub-directories should, by default, be located inside
the main "lib" directory, whose location is very system dependant.
This function takes a writable buffer, initially containing the
"path" to the "lib" directory, for example, "/pkg/lib/angband/",
or a system dependant string, for example, ":lib:".  The buffer
must be large enough to contain at least 32 more characters.
Various command line options may allow some of the important
directories to be changed to user-specified directories, most
importantly, the "info" and "user" and "save" directories,
but this is done after this function, see "main.c".
In general, the initial path should end in the appropriate "PATH_SEP"
string.  All of the "sub-directory" paths (created below or supplied
by the user) will NOT end in the "PATH_SEP" string, see the special
"path_build()" function in "util.c" for more information.
Mega-Hack -- support fat raw files under NEXTSTEP, using special
"suffixed" directories for the "ANGBAND_DIR_DATA" directory, but
requiring the directories to be created by hand by the user.
Hack -- first we free all the strings, since this is known
to succeed even if the strings have not been allocated yet,
as long as the variables start out as "NULL".  This allows
this function to be called multiple times, for example, to
try several base "path" values until a good one is found.
呼び出し関係図:

◆ init_info_txt()

errr init_info_txt ( FILE *  fp,
char *  buf,
header head,
parse_info_txt_func  parse_info_txt_line 
)

パース関数に基づいてデータファイルからデータを読み取る / Initialize an "*_info" array, by parsing an ascii "template" file

引数
fp読み取りに使うファイルポインタ
buf読み取りに使うバッファ領域
headヘッダ構造体
parse_info_txt_lineパース関数
戻り値
エラーコード
呼び出し関係図:

◆ parse_a_info()

errr parse_a_info ( char *  buf,
header head 
)

固定アーティファクト情報(a_info)のパース関数 / Initialize the "a_info" array, by parsing an ascii "template" file

引数
bufテキスト列
headヘッダ構造体
戻り値
エラーコード
呼び出し関係図:

◆ parse_d_info()

errr parse_d_info ( char *  buf,
header head 
)

ダンジョン情報(d_info)のパース関数 / Initialize the "d_info" array, by parsing an ascii "template" file

引数
bufテキスト列
headヘッダ構造体
戻り値
エラーコード
呼び出し関係図:

◆ parse_e_info()

errr parse_e_info ( char *  buf,
header head 
)

アイテムエゴ情報(e_info)のパース関数 / Initialize the "e_info" array, by parsing an ascii "template" file

引数
bufテキスト列
headヘッダ構造体
戻り値
エラーコード
呼び出し関係図:

◆ parse_f_info()

errr parse_f_info ( char *  buf,
header head 
)

地形情報(f_info)のパース関数 / Initialize the "f_info" array, by parsing an ascii "template" file

引数
bufテキスト列
headヘッダ構造体
戻り値
エラーコード
呼び出し関係図:

◆ parse_k_info()

errr parse_k_info ( char *  buf,
header head 
)

ベースアイテム(k_info)のパース関数 / Initialize the "k_info" array, by parsing an ascii "template" file

引数
bufテキスト列
headヘッダ構造体
戻り値
エラーコード
呼び出し関係図:

◆ parse_m_info()

errr parse_m_info ( char *  buf,
header head 
)

職業魔法情報(m_info)のパース関数 / Initialize the "m_info" array, by parsing an ascii "template" file

引数
bufテキスト列
headヘッダ構造体
戻り値
エラーコード
呼び出し関係図:

◆ parse_r_info()

errr parse_r_info ( char *  buf,
header head 
)

モンスター種族情報(r_info)のパース関数 / Initialize the "r_info" array, by parsing an ascii "template" file

引数
bufテキスト列
headヘッダ構造体
戻り値
エラーコード
呼び出し関係図:

◆ parse_s_info()

errr parse_s_info ( char *  buf,
header head 
)

職業技能情報(s_info)のパース関数 / Initialize the "s_info" array, by parsing an ascii "template" file

引数
bufテキスト列
headヘッダ構造体
戻り値
エラーコード

◆ parse_v_info()

errr parse_v_info ( char *  buf,
header head 
)

Vault情報(v_info)のパース関数 / Initialize the "v_info" array, by parsing an ascii "template" file

引数
bufテキスト列
headヘッダ構造体
戻り値
エラーコード
呼び出し関係図:

◆ parse_z_info()

errr parse_z_info ( char *  buf,
header head 
)

◆ retouch_f_info()

void retouch_f_info ( header head)

地形情報の各種タグからIDへ変換して結果を収める / Retouch fake tags of f_info

引数
headヘッダ構造体
戻り値
なし
呼び出し関係図:

変数詳解

◆ a_head

header a_head

固定アーティファクト情報のヘッダ構造体

◆ b_head

header b_head

◆ e_head

header e_head

アイテムエゴ情報のヘッダ構造体

◆ error_idx

int error_idx

データ読み込み/初期化時に汎用的にエラーコードを保存するグローバル変数

◆ error_line

int error_line

データ読み込み/初期化時に汎用的にエラー行数を保存するグローバル変数

◆ f_head

header f_head

地形情報のヘッダ構造体

◆ g_head

header g_head

◆ h_head

header h_head

◆ k_head

header k_head

ペースアイテム情報のヘッダ構造体

◆ p_head

header p_head

◆ r_head

header r_head

モンスター種族情報のヘッダ構造体

◆ v_head

header v_head

Vault情報のヘッダ構造体

◆ z_head

header z_head