annotate system/system_config.h @ 60:e16e13d8cd68

Replaced SATURATE -> ADD, implemented objComposite, corrected minor things
author Thibaut GIRKA <thib@sitedethib.com>
date Fri, 18 Dec 2009 20:41:38 +0100
parents c7bcc0ec2267
children 4416cfac86ae
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
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents: 53
diff changeset
25 #ifndef __SYSTEM_CONFIG_H__
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents: 53
diff changeset
26 #define __SYSTEM_CONFIG_H__
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents: 53
diff changeset
27
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
28 #include <string>
0
223b71206888 Initial import
thib
parents:
diff changeset
29
223b71206888 Initial import
thib
parents:
diff changeset
30 /* CD Track 名 <-> Track 番号の変換を行う */
223b71206888 Initial import
thib
parents:
diff changeset
31 class TrackName {
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
32 private:
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
33 char** track;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
34 int* track_num;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
35 char** track_wave;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
36 int* track_start;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
37 int deal;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
38 void Expand(void);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
39 char** se_track;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
40 int se_deal;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
41 void ExpandSE(int num);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
42
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
43 public:
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
44 TrackName(void);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
45 ~TrackName(void);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
46 void AddCDROM(char* name, int track);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
47 void AddWave(char* name, char* wave, int start_pt);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
48 void AddSE(int num, char* se);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
49 int CDTrack(char* name);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
50 int TrackStart(char* name);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
51 const char* WaveTrack(char* name);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
52 const char* SETrack(int num);
0
223b71206888 Initial import
thib
parents:
diff changeset
53 };
223b71206888 Initial import
thib
parents:
diff changeset
54 /* gameexe.ini で設定されるパラメータ */
223b71206888 Initial import
thib
parents:
diff changeset
55 /* まず初めに、設定項目を SetOrigPara* でセットする
223b71206888 Initial import
thib
parents:
diff changeset
56 ** ただし、設定名は255文字以下である必要がある。
223b71206888 Initial import
thib
parents:
diff changeset
57 **
223b71206888 Initial import
thib
parents:
diff changeset
58 ** SetPara* で設定項目は変更できる
223b71206888 Initial import
thib
parents:
diff changeset
59 ** また、GetPara* で設定項目を得られる。
223b71206888 Initial import
thib
parents:
diff changeset
60 */
223b71206888 Initial import
thib
parents:
diff changeset
61
223b71206888 Initial import
thib
parents:
diff changeset
62 class AyuSysConfig {
53
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
63 public:
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
64 static AyuSysConfig* GetInstance(void);
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
65 static void Quit(void);
0
223b71206888 Initial import
thib
parents:
diff changeset
66
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
67 bool LoadInitFile(void);
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 /* str なら 1, int なら 2, 見つからないなら 0 */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
70 int SearchParam(const char* name) const;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
71 /* パラメータを得る */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
72 const char* GetParaStr(const char* name) const; /* str */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
73 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
74 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
75 int GetParaInt(const char* name) const {
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
76 int n;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
77 if (GetParam(name,1,&n)) return 0;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
78 return n;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
79 }
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
80 const int* GetParamArray(const char* name, int& deal) const;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
81 /* パラメータを変更する */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
82 void SetParaStr(const char* name, const char* var); /* str */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
83 void SetParam(const char* name, int deal, ...); /* int */
0
223b71206888 Initial import
thib
parents:
diff changeset
84
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
85 /* オリジナルの設定関係
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
86 ** SetOriginal : 全ての設定を初めの状態に戻す
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
87 ** DiffOriginal : 初めの状態と現在の状態の変更分を得る
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
88 ** PatchOriginal: DiffOriginal で得た文字列を引数に
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
89 ** 渡す。DiffOriginal 呼び出し時の状態に戻す
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
90 */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
91 void SetOriginal(void);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
92 void DiffOriginal(std::string&);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
93 const char* PatchOriginal(const char*);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
94 /* config の内容を表示する */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
95 void Dump(FILE* f) const;
53
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
96
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
97 private:
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
98 /* 元設定を行う */
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
99 /* AyuSys からのみ可能 */
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
100 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
101 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
102 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
103 AyuSysConfig(void);
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
104 ~AyuSysConfig();
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 public:
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
107 TrackName track_name;
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
108
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
109 private:
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
110 int change_flag;
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
111 int dirty_flag;
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
112 class AyuSysConfigString* str_config;
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
113 class AyuSysConfigIntlist* int_config;
ddbcbd000206 * MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
thib
parents: 52
diff changeset
114 static AyuSysConfig* _singleton;
0
223b71206888 Initial import
thib
parents:
diff changeset
115 };
223b71206888 Initial import
thib
parents:
diff changeset
116
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents: 53
diff changeset
117 #endif
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents: 53
diff changeset
118