annotate system/system_config.h @ 52:15a18fbe6f21

* Known bugs added to the README * Code cleaning (0 -> NULL when needed, indentation, spaces, ...)
author thib
date Sat, 18 Apr 2009 18:35:39 +0000
parents 5ae5533b3a9a
children ddbcbd000206
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 {
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
60 private:
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
61 int change_flag;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
62 int dirty_flag;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
63 class AyuSysConfigString* str_config;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
64 class AyuSysConfigIntlist* int_config;
0
223b71206888 Initial import
thib
parents:
diff changeset
65
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
66 public:
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
67 TrackName track_name;
0
223b71206888 Initial import
thib
parents:
diff changeset
68
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
69 public:
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
70 AyuSysConfig(void);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
71 ~AyuSysConfig();
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
72 bool LoadInitFile(void);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
73 /* パラメータを検索する */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
74 /* str なら 1, int なら 2, 見つからないなら 0 */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
75 int SearchParam(const char* name) const;
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 char* GetParaStr(const char* name) const; /* str */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
78 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
79 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
80 int GetParaInt(const char* name) const {
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
81 int n;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
82 if (GetParam(name,1,&n)) return 0;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
83 return n;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
84 }
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
85 const int* GetParamArray(const char* name, int& deal) const;
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
86 /* パラメータを変更する */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
87 void SetParaStr(const char* name, const char* var); /* str */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
88 void SetParam(const char* name, int deal, ...); /* int */
0
223b71206888 Initial import
thib
parents:
diff changeset
89
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
90 private:
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
91 /* 元設定を行う */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
92 /* AyuSys からのみ可能 */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
93 void SetOrigParaStr(const char* name, const char* var); /* str */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
94 void SetOrigParam(const char* name, int para_deal, ...); /* int */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
95 void SetOrigParamArray(const char* name, int deal, int* array); /* 上とおなじ */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
96
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
97 public:
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
98 /* オリジナルの設定関係
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
99 ** SetOriginal : 全ての設定を初めの状態に戻す
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
100 ** DiffOriginal : 初めの状態と現在の状態の変更分を得る
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
101 ** PatchOriginal: DiffOriginal で得た文字列を引数に
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
102 ** 渡す。DiffOriginal 呼び出し時の状態に戻す
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
103 */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
104 void SetOriginal(void);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
105 void DiffOriginal(std::string&);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
106 const char* PatchOriginal(const char*);
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
107 /* config の内容を表示する */
15a18fbe6f21 * Known bugs added to the README
thib
parents: 31
diff changeset
108 void Dump(FILE* f) const;
0
223b71206888 Initial import
thib
parents:
diff changeset
109 };
223b71206888 Initial import
thib
parents:
diff changeset
110