annotate system/system_config.h @ 0:223b71206888

Initial import
author thib
date Fri, 01 Aug 2008 16:32:45 +0000
parents
children b6d6c0ffb423
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
223b71206888 Initial import
thib
parents:
diff changeset
1 #include<string>
223b71206888 Initial import
thib
parents:
diff changeset
2
223b71206888 Initial import
thib
parents:
diff changeset
3 /* CD Track 名 <-> Track 番号の変換を行う */
223b71206888 Initial import
thib
parents:
diff changeset
4 class TrackName {
223b71206888 Initial import
thib
parents:
diff changeset
5 char** track;
223b71206888 Initial import
thib
parents:
diff changeset
6 int* track_num;
223b71206888 Initial import
thib
parents:
diff changeset
7 char** track_wave;
223b71206888 Initial import
thib
parents:
diff changeset
8 int* track_start;
223b71206888 Initial import
thib
parents:
diff changeset
9 int deal;
223b71206888 Initial import
thib
parents:
diff changeset
10 void Expand(void);
223b71206888 Initial import
thib
parents:
diff changeset
11 char** se_track;
223b71206888 Initial import
thib
parents:
diff changeset
12 int se_deal;
223b71206888 Initial import
thib
parents:
diff changeset
13 void ExpandSE(int num);
223b71206888 Initial import
thib
parents:
diff changeset
14 public:
223b71206888 Initial import
thib
parents:
diff changeset
15 TrackName(void);
223b71206888 Initial import
thib
parents:
diff changeset
16 ~TrackName(void);
223b71206888 Initial import
thib
parents:
diff changeset
17 void AddCDROM(char* name, int track);
223b71206888 Initial import
thib
parents:
diff changeset
18 void AddWave(char* name, char* wave, int start_pt);
223b71206888 Initial import
thib
parents:
diff changeset
19 void AddSE(int num, char* se);
223b71206888 Initial import
thib
parents:
diff changeset
20 int CDTrack(char* name);
223b71206888 Initial import
thib
parents:
diff changeset
21 int TrackStart(char* name);
223b71206888 Initial import
thib
parents:
diff changeset
22 const char* WaveTrack(char* name);
223b71206888 Initial import
thib
parents:
diff changeset
23 const char* SETrack(int num);
223b71206888 Initial import
thib
parents:
diff changeset
24 };
223b71206888 Initial import
thib
parents:
diff changeset
25 /* gameexe.ini で設定されるパラメータ */
223b71206888 Initial import
thib
parents:
diff changeset
26 /* まず初めに、設定項目を SetOrigPara* でセットする
223b71206888 Initial import
thib
parents:
diff changeset
27 ** ただし、設定名は255文字以下である必要がある。
223b71206888 Initial import
thib
parents:
diff changeset
28 **
223b71206888 Initial import
thib
parents:
diff changeset
29 ** SetPara* で設定項目は変更できる
223b71206888 Initial import
thib
parents:
diff changeset
30 ** また、GetPara* で設定項目を得られる。
223b71206888 Initial import
thib
parents:
diff changeset
31 */
223b71206888 Initial import
thib
parents:
diff changeset
32
223b71206888 Initial import
thib
parents:
diff changeset
33 class AyuSysConfig {
223b71206888 Initial import
thib
parents:
diff changeset
34 friend class Conf2; /* テスト用のクラス */
223b71206888 Initial import
thib
parents:
diff changeset
35 int change_flag;
223b71206888 Initial import
thib
parents:
diff changeset
36 int dirty_flag;
223b71206888 Initial import
thib
parents:
diff changeset
37 class AyuSysConfigString* str_config;
223b71206888 Initial import
thib
parents:
diff changeset
38 class AyuSysConfigIntlist* int_config;
223b71206888 Initial import
thib
parents:
diff changeset
39
223b71206888 Initial import
thib
parents:
diff changeset
40 public:
223b71206888 Initial import
thib
parents:
diff changeset
41 TrackName track_name;
223b71206888 Initial import
thib
parents:
diff changeset
42
223b71206888 Initial import
thib
parents:
diff changeset
43 public:
223b71206888 Initial import
thib
parents:
diff changeset
44 AyuSysConfig(void);
223b71206888 Initial import
thib
parents:
diff changeset
45 bool LoadInitFile(void);
223b71206888 Initial import
thib
parents:
diff changeset
46 /* パラメータを検索する */
223b71206888 Initial import
thib
parents:
diff changeset
47 /* str なら 1, int なら 2, 見つからないなら 0 */
223b71206888 Initial import
thib
parents:
diff changeset
48 int SearchParam(const char* name) const;
223b71206888 Initial import
thib
parents:
diff changeset
49 /* パラメータを得る */
223b71206888 Initial import
thib
parents:
diff changeset
50 const char* GetParaStr(const char* name) const; /* str */
223b71206888 Initial import
thib
parents:
diff changeset
51 int GetParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */
223b71206888 Initial import
thib
parents:
diff changeset
52 int GetOriginalParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */
223b71206888 Initial import
thib
parents:
diff changeset
53 int GetParaInt(const char* name) const {
223b71206888 Initial import
thib
parents:
diff changeset
54 int n;
223b71206888 Initial import
thib
parents:
diff changeset
55 if (GetParam(name,1,&n)) return 0;
223b71206888 Initial import
thib
parents:
diff changeset
56 return n;
223b71206888 Initial import
thib
parents:
diff changeset
57 }
223b71206888 Initial import
thib
parents:
diff changeset
58 const int* GetParamArray(const char* name, int& deal) const;
223b71206888 Initial import
thib
parents:
diff changeset
59 /* パラメータを変更する */
223b71206888 Initial import
thib
parents:
diff changeset
60 void SetParaStr(const char* name, const char* var); /* str */
223b71206888 Initial import
thib
parents:
diff changeset
61 void SetParam(const char* name, int deal, ...); /* int */
223b71206888 Initial import
thib
parents:
diff changeset
62 private:
223b71206888 Initial import
thib
parents:
diff changeset
63 friend class AyuSys;
223b71206888 Initial import
thib
parents:
diff changeset
64 /* 元設定を行う */
223b71206888 Initial import
thib
parents:
diff changeset
65 /* AyuSys からのみ可能 */
223b71206888 Initial import
thib
parents:
diff changeset
66 void SetOrigParaStr(const char* name, const char* var); /* str */
223b71206888 Initial import
thib
parents:
diff changeset
67 void SetOrigParam(const char* name, int para_deal, ...); /* int */
223b71206888 Initial import
thib
parents:
diff changeset
68 void SetOrigParamArray(const char* name, int deal, int* array); /* 上とおなじ */
223b71206888 Initial import
thib
parents:
diff changeset
69 public:
223b71206888 Initial import
thib
parents:
diff changeset
70
223b71206888 Initial import
thib
parents:
diff changeset
71 /* オリジナルの設定関係
223b71206888 Initial import
thib
parents:
diff changeset
72 ** SetOriginal : 全ての設定を初めの状態に戻す
223b71206888 Initial import
thib
parents:
diff changeset
73 ** DiffOriginal : 初めの状態と現在の状態の変更分を得る
223b71206888 Initial import
thib
parents:
diff changeset
74 ** PatchOriginal: DiffOriginal で得た文字列を引数に
223b71206888 Initial import
thib
parents:
diff changeset
75 ** 渡す。DiffOriginal 呼び出し時の状態に戻す
223b71206888 Initial import
thib
parents:
diff changeset
76 */
223b71206888 Initial import
thib
parents:
diff changeset
77 void SetOriginal(void);
223b71206888 Initial import
thib
parents:
diff changeset
78 void DiffOriginal(std::string&);
223b71206888 Initial import
thib
parents:
diff changeset
79 const char* PatchOriginal(const char*);
223b71206888 Initial import
thib
parents:
diff changeset
80 /* config の内容を表示する */
223b71206888 Initial import
thib
parents:
diff changeset
81 void Dump(FILE* f) const;
223b71206888 Initial import
thib
parents:
diff changeset
82 };
223b71206888 Initial import
thib
parents:
diff changeset
83