Mercurial > otakunoraifu
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 |
rev | line source |
---|---|
31 | 1 /* system_config.h |
2 * gameexe.ini ファイルの読み込み | |
3 */ | |
4 | |
5 /* | |
6 * | |
7 * Copyright (C) 2000- Kazunori Ueno(JAGARL) <jagarl@creator.club.ne.jp> | |
8 * | |
9 * This program is free software; you can redistribute it and/or modify | |
10 * it under the terms of the GNU General Public License as published by | |
11 * the Free Software Foundation; either version 2 of the License, or | |
12 * (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License along | |
20 * with this program; if not, write to the Free Software Foundation, Inc., | |
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
22 * | |
23 */ | |
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 | 28 #include <string> |
0 | 29 |
30 /* CD Track 名 <-> Track 番号の変換を行う */ | |
31 class TrackName { | |
52 | 32 private: |
33 char** track; | |
34 int* track_num; | |
35 char** track_wave; | |
36 int* track_start; | |
37 int deal; | |
38 void Expand(void); | |
39 char** se_track; | |
40 int se_deal; | |
41 void ExpandSE(int num); | |
42 | |
43 public: | |
44 TrackName(void); | |
45 ~TrackName(void); | |
46 void AddCDROM(char* name, int track); | |
47 void AddWave(char* name, char* wave, int start_pt); | |
48 void AddSE(int num, char* se); | |
49 int CDTrack(char* name); | |
50 int TrackStart(char* name); | |
51 const char* WaveTrack(char* name); | |
52 const char* SETrack(int num); | |
0 | 53 }; |
54 /* gameexe.ini で設定されるパラメータ */ | |
55 /* まず初めに、設定項目を SetOrigPara* でセットする | |
56 ** ただし、設定名は255文字以下である必要がある。 | |
57 ** | |
58 ** SetPara* で設定項目は変更できる | |
59 ** また、GetPara* で設定項目を得られる。 | |
60 */ | |
61 | |
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 | 66 |
52 | 67 bool LoadInitFile(void); |
68 /* パラメータを検索する */ | |
69 /* str なら 1, int なら 2, 見つからないなら 0 */ | |
70 int SearchParam(const char* name) const; | |
71 /* パラメータを得る */ | |
72 const char* GetParaStr(const char* name) const; /* str */ | |
73 int GetParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */ | |
74 int GetOriginalParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */ | |
75 int GetParaInt(const char* name) const { | |
76 int n; | |
77 if (GetParam(name,1,&n)) return 0; | |
78 return n; | |
79 } | |
80 const int* GetParamArray(const char* name, int& deal) const; | |
81 /* パラメータを変更する */ | |
82 void SetParaStr(const char* name, const char* var); /* str */ | |
83 void SetParam(const char* name, int deal, ...); /* int */ | |
0 | 84 |
52 | 85 /* オリジナルの設定関係 |
86 ** SetOriginal : 全ての設定を初めの状態に戻す | |
87 ** DiffOriginal : 初めの状態と現在の状態の変更分を得る | |
88 ** PatchOriginal: DiffOriginal で得た文字列を引数に | |
89 ** 渡す。DiffOriginal 呼び出し時の状態に戻す | |
90 */ | |
91 void SetOriginal(void); | |
92 void DiffOriginal(std::string&); | |
93 const char* PatchOriginal(const char*); | |
94 /* config の内容を表示する */ | |
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 | 115 }; |
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 |