annotate system/system_config.h @ 55:f1a27ee7e03c

* started the same changes on scn2k_text.cc * handle opcodes childObj*. In fact, it was handled (in a strange way, but it worked) before the previous changeset
author thib
date Wed, 22 Apr 2009 15:01:42 +0000
parents ddbcbd000206
children c7bcc0ec2267
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
1 /* system_config.h
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
2 * gameexe.ini ファイルの読み込み
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
3 */
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
4
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
5 /*
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
6 *
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
7 * Copyright (C) 2000- Kazunori Ueno(JAGARL) <jagarl@creator.club.ne.jp>
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
8 *
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
9 * This program is free software; you can redistribute it and/or modify
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
10 * it under the terms of the GNU General Public License as published by
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
12 * (at your option) any later version.
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
13 *
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
14 * This program is distributed in the hope that it will be useful,
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
17 * GNU General Public License for more details.
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
18 *
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
19 * You should have received a copy of the GNU General Public License along
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
20 * with this program; if not, write to the Free Software Foundation, Inc.,
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
22 *
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
23 */
5ae5533b3a9a * Added some license headers
thib
parents: 9
diff changeset
24
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
25 #include <string>
0
223b71206888 Initial import
thib
parents:
diff changeset
26
223b71206888 Initial import
thib
parents:
diff changeset
27 /* CD Track 名 <-> Track 番号の変換を行う */
223b71206888 Initial import
thib
parents:
diff changeset
28 class TrackName {
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
29 private:
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
30 char** track;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
31 int* track_num;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
32 char** track_wave;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
33 int* track_start;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
34 int deal;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
35 void Expand(void);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
36 char** se_track;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
37 int se_deal;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
38 void ExpandSE(int num);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
39
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
40 public:
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
41 TrackName(void);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
42 ~TrackName(void);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
43 void AddCDROM(char* name, int track);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
44 void AddWave(char* name, char* wave, int start_pt);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
45 void AddSE(int num, char* se);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
46 int CDTrack(char* name);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
47 int TrackStart(char* name);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
48 const char* WaveTrack(char* name);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
49 const char* SETrack(int num);
0
223b71206888 Initial import
thib
parents:
diff changeset
50 };
223b71206888 Initial import
thib
parents:
diff changeset
51 /* gameexe.ini で設定されるパラメータ */
223b71206888 Initial import
thib
parents:
diff changeset
52 /* まず初めに、設定項目を SetOrigPara* でセットする
223b71206888 Initial import
thib
parents:
diff changeset
53 ** ただし、設定名は255文字以下である必要がある。
223b71206888 Initial import
thib
parents:
diff changeset
54 **
223b71206888 Initial import
thib
parents:
diff changeset
55 ** SetPara* で設定項目は変更できる
223b71206888 Initial import
thib
parents:
diff changeset
56 ** また、GetPara* で設定項目を得られる。
223b71206888 Initial import
thib
parents:
diff changeset
57 */
223b71206888 Initial import
thib
parents:
diff changeset
58
223b71206888 Initial import
thib
parents:
diff changeset
59 class AyuSysConfig {
53
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
60 public:
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
61 static AyuSysConfig* GetInstance(void);
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
62 static void Quit(void);
0
223b71206888 Initial import
thib
parents:
diff changeset
63
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
64 bool LoadInitFile(void);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
65 /* パラメータを検索する */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
66 /* str なら 1, int なら 2, 見つからないなら 0 */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
67 int SearchParam(const char* name) const;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
68 /* パラメータを得る */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
69 const char* GetParaStr(const char* name) const; /* str */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
70 int GetParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
71 int GetOriginalParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
72 int GetParaInt(const char* name) const {
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
73 int n;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
74 if (GetParam(name,1,&n)) return 0;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
75 return n;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
76 }
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
77 const int* GetParamArray(const char* name, int& deal) const;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
78 /* パラメータを変更する */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
79 void SetParaStr(const char* name, const char* var); /* str */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
80 void SetParam(const char* name, int deal, ...); /* int */
0
223b71206888 Initial import
thib
parents:
diff changeset
81
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
82 /* オリジナルの設定関係
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
83 ** SetOriginal : 全ての設定を初めの状態に戻す
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
84 ** DiffOriginal : 初めの状態と現在の状態の変更分を得る
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
85 ** PatchOriginal: DiffOriginal で得た文字列を引数に
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
86 ** 渡す。DiffOriginal 呼び出し時の状態に戻す
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
87 */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
88 void SetOriginal(void);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
89 void DiffOriginal(std::string&);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
90 const char* PatchOriginal(const char*);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
91 /* config の内容を表示する */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
92 void Dump(FILE* f) const;
53
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
93
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
94 private:
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
95 /* 元設定を行う */
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
96 /* AyuSys からのみ可能 */
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
97 void SetOrigParaStr(const char* name, const char* var); /* str */
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
98 void SetOrigParam(const char* name, int para_deal, ...); /* int */
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
99 void SetOrigParamArray(const char* name, int deal, int* array); /* 上とおなじ */
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
100 AyuSysConfig(void);
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
101 ~AyuSysConfig();
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
102
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
103 public:
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
104 TrackName track_name;
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
105
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
106 private:
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
107 int change_flag;
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
108 int dirty_flag;
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
109 class AyuSysConfigString* str_config;
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
110 class AyuSysConfigIntlist* int_config;
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
111 static AyuSysConfig* _singleton;
0
223b71206888 Initial import
thib
parents:
diff changeset
112 };
223b71206888 Initial import
thib
parents:
diff changeset
113