Hengband
2.2.1
|
ゲームデータ初期化処理のヘッダファイル [詳解]
#include "h-basic.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 |
ゲームデータ初期化処理のヘッダファイル
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.
#define FAKE_NAME_SIZE 40 * 1024L |
ゲーム情報の種別毎に用意される名前用バッファの容量
#define FAKE_TAG_SIZE 10 * 1024L |
ゲーム情報の種別毎に用意されるタグ用バッファの容量
#define FAKE_TEXT_SIZE 150 * 1024L |
ゲーム情報の種別毎に用意されるテキスト用バッファの容量
#define MACRO_MAX 256 |
マクロ登録の最大数 / Maximum number of macros (see "io.c")
#define VER_INFO_ROW 3 |
タイトル表記(行)
地形タグからIDを得る / Convert a fake tag to a real feat index
str | タグ文字列 |
concptr get_check_sum | ( | void | ) |
サムチェック情報を出力 / Get check sum in string form
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".
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.
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 | パース関数 |
固定アーティファクト情報(a_info)のパース関数 / Initialize the "a_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
ダンジョン情報(d_info)のパース関数 / Initialize the "d_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
アイテムエゴ情報(e_info)のパース関数 / Initialize the "e_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
地形情報(f_info)のパース関数 / Initialize the "f_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
ベースアイテム(k_info)のパース関数 / Initialize the "k_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
職業魔法情報(m_info)のパース関数 / Initialize the "m_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
モンスター種族情報(r_info)のパース関数 / Initialize the "r_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
職業技能情報(s_info)のパース関数 / Initialize the "s_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
Vault情報(v_info)のパース関数 / Initialize the "v_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
void retouch_f_info | ( | header * | head | ) |
地形情報の各種タグからIDへ変換して結果を収める / Retouch fake tags of f_info
head | ヘッダ構造体 |
header a_head |
固定アーティファクト情報のヘッダ構造体
header b_head |
header e_head |
アイテムエゴ情報のヘッダ構造体
int error_idx |
データ読み込み/初期化時に汎用的にエラーコードを保存するグローバル変数
int error_line |
データ読み込み/初期化時に汎用的にエラー行数を保存するグローバル変数
header f_head |
地形情報のヘッダ構造体
header g_head |
header h_head |
header k_head |
ペースアイテム情報のヘッダ構造体
header p_head |
header r_head |
モンスター種族情報のヘッダ構造体
header v_head |
Vault情報のヘッダ構造体
header z_head |