annotate system/system_config.h @ 16:92765a5661f7

added "new" label on last savegame and corrected StatSaveFile
author thib
date Mon, 11 Aug 2008 16:23:17 +0000
parents b6d6c0ffb423
children 5ae5533b3a9a
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);
9
b6d6c0ffb423 Fixed some memory leaks
thib
parents: 0
diff changeset
45 ~AyuSysConfig();
0
223b71206888 Initial import
thib
parents:
diff changeset
46 bool LoadInitFile(void);
223b71206888 Initial import
thib
parents:
diff changeset
47 /* パラメータを検索する */
223b71206888 Initial import
thib
parents:
diff changeset
48 /* str なら 1, int なら 2, 見つからないなら 0 */
223b71206888 Initial import
thib
parents:
diff changeset
49 int SearchParam(const char* name) const;
223b71206888 Initial import
thib
parents:
diff changeset
50 /* パラメータを得る */
223b71206888 Initial import
thib
parents:
diff changeset
51 const char* GetParaStr(const char* name) const; /* str */
223b71206888 Initial import
thib
parents:
diff changeset
52 int GetParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */
223b71206888 Initial import
thib
parents:
diff changeset
53 int GetOriginalParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */
223b71206888 Initial import
thib
parents:
diff changeset
54 int GetParaInt(const char* name) const {
223b71206888 Initial import
thib
parents:
diff changeset
55 int n;
223b71206888 Initial import
thib
parents:
diff changeset
56 if (GetParam(name,1,&n)) return 0;
223b71206888 Initial import
thib
parents:
diff changeset
57 return n;
223b71206888 Initial import
thib
parents:
diff changeset
58 }
223b71206888 Initial import
thib
parents:
diff changeset
59 const int* GetParamArray(const char* name, int& deal) const;
223b71206888 Initial import
thib
parents:
diff changeset
60 /* パラメータを変更する */
223b71206888 Initial import
thib
parents:
diff changeset
61 void SetParaStr(const char* name, const char* var); /* str */
223b71206888 Initial import
thib
parents:
diff changeset
62 void SetParam(const char* name, int deal, ...); /* int */
223b71206888 Initial import
thib
parents:
diff changeset
63 private:
223b71206888 Initial import
thib
parents:
diff changeset
64 friend class AyuSys;
223b71206888 Initial import
thib
parents:
diff changeset
65 /* 元設定を行う */
223b71206888 Initial import
thib
parents:
diff changeset
66 /* AyuSys からのみ可能 */
223b71206888 Initial import
thib
parents:
diff changeset
67 void SetOrigParaStr(const char* name, const char* var); /* str */
223b71206888 Initial import
thib
parents:
diff changeset
68 void SetOrigParam(const char* name, int para_deal, ...); /* int */
223b71206888 Initial import
thib
parents:
diff changeset
69 void SetOrigParamArray(const char* name, int deal, int* array); /* 上とおなじ */
223b71206888 Initial import
thib
parents:
diff changeset
70 public:
223b71206888 Initial import
thib
parents:
diff changeset
71
223b71206888 Initial import
thib
parents:
diff changeset
72 /* オリジナルの設定関係
223b71206888 Initial import
thib
parents:
diff changeset
73 ** SetOriginal : 全ての設定を初めの状態に戻す
223b71206888 Initial import
thib
parents:
diff changeset
74 ** DiffOriginal : 初めの状態と現在の状態の変更分を得る
223b71206888 Initial import
thib
parents:
diff changeset
75 ** PatchOriginal: DiffOriginal で得た文字列を引数に
223b71206888 Initial import
thib
parents:
diff changeset
76 ** 渡す。DiffOriginal 呼び出し時の状態に戻す
223b71206888 Initial import
thib
parents:
diff changeset
77 */
223b71206888 Initial import
thib
parents:
diff changeset
78 void SetOriginal(void);
223b71206888 Initial import
thib
parents:
diff changeset
79 void DiffOriginal(std::string&);
223b71206888 Initial import
thib
parents:
diff changeset
80 const char* PatchOriginal(const char*);
223b71206888 Initial import
thib
parents:
diff changeset
81 /* config の内容を表示する */
223b71206888 Initial import
thib
parents:
diff changeset
82 void Dump(FILE* f) const;
223b71206888 Initial import
thib
parents:
diff changeset
83 };
223b71206888 Initial import
thib
parents:
diff changeset
84