Mercurial > otakunoraifu
annotate system/system_config.h @ 53:ddbcbd000206
* MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
* ParseMoji moved to TextStream
* Some cleaning (0 -> NULL when needed, removal of useless returns, ...)
author | thib |
---|---|
date | Sun, 19 Apr 2009 11:44:05 +0000 |
parents | 15a18fbe6f21 |
children | c7bcc0ec2267 |
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 | |
52 | 25 #include <string> |
0 | 26 |
27 /* CD Track 名 <-> Track 番号の変換を行う */ | |
28 class TrackName { | |
52 | 29 private: |
30 char** track; | |
31 int* track_num; | |
32 char** track_wave; | |
33 int* track_start; | |
34 int deal; | |
35 void Expand(void); | |
36 char** se_track; | |
37 int se_deal; | |
38 void ExpandSE(int num); | |
39 | |
40 public: | |
41 TrackName(void); | |
42 ~TrackName(void); | |
43 void AddCDROM(char* name, int track); | |
44 void AddWave(char* name, char* wave, int start_pt); | |
45 void AddSE(int num, char* se); | |
46 int CDTrack(char* name); | |
47 int TrackStart(char* name); | |
48 const char* WaveTrack(char* name); | |
49 const char* SETrack(int num); | |
0 | 50 }; |
51 /* gameexe.ini で設定されるパラメータ */ | |
52 /* まず初めに、設定項目を SetOrigPara* でセットする | |
53 ** ただし、設定名は255文字以下である必要がある。 | |
54 ** | |
55 ** SetPara* で設定項目は変更できる | |
56 ** また、GetPara* で設定項目を得られる。 | |
57 */ | |
58 | |
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 | 63 |
52 | 64 bool LoadInitFile(void); |
65 /* パラメータを検索する */ | |
66 /* str なら 1, int なら 2, 見つからないなら 0 */ | |
67 int SearchParam(const char* name) const; | |
68 /* パラメータを得る */ | |
69 const char* GetParaStr(const char* name) const; /* str */ | |
70 int GetParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */ | |
71 int GetOriginalParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */ | |
72 int GetParaInt(const char* name) const { | |
73 int n; | |
74 if (GetParam(name,1,&n)) return 0; | |
75 return n; | |
76 } | |
77 const int* GetParamArray(const char* name, int& deal) const; | |
78 /* パラメータを変更する */ | |
79 void SetParaStr(const char* name, const char* var); /* str */ | |
80 void SetParam(const char* name, int deal, ...); /* int */ | |
0 | 81 |
52 | 82 /* オリジナルの設定関係 |
83 ** SetOriginal : 全ての設定を初めの状態に戻す | |
84 ** DiffOriginal : 初めの状態と現在の状態の変更分を得る | |
85 ** PatchOriginal: DiffOriginal で得た文字列を引数に | |
86 ** 渡す。DiffOriginal 呼び出し時の状態に戻す | |
87 */ | |
88 void SetOriginal(void); | |
89 void DiffOriginal(std::string&); | |
90 const char* PatchOriginal(const char*); | |
91 /* config の内容を表示する */ | |
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 | 112 }; |
113 |