annotate system/system_config.h @ 40:651237260724

* Center button-type selects
author thib
date Wed, 18 Mar 2009 16:44:49 +0000
parents 5ae5533b3a9a
children 15a18fbe6f21
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
0
223b71206888 Initial import
thib
parents:
diff changeset
25 #include<string>
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 {
223b71206888 Initial import
thib
parents:
diff changeset
29 char** track;
223b71206888 Initial import
thib
parents:
diff changeset
30 int* track_num;
223b71206888 Initial import
thib
parents:
diff changeset
31 char** track_wave;
223b71206888 Initial import
thib
parents:
diff changeset
32 int* track_start;
223b71206888 Initial import
thib
parents:
diff changeset
33 int deal;
223b71206888 Initial import
thib
parents:
diff changeset
34 void Expand(void);
223b71206888 Initial import
thib
parents:
diff changeset
35 char** se_track;
223b71206888 Initial import
thib
parents:
diff changeset
36 int se_deal;
223b71206888 Initial import
thib
parents:
diff changeset
37 void ExpandSE(int num);
223b71206888 Initial import
thib
parents:
diff changeset
38 public:
223b71206888 Initial import
thib
parents:
diff changeset
39 TrackName(void);
223b71206888 Initial import
thib
parents:
diff changeset
40 ~TrackName(void);
223b71206888 Initial import
thib
parents:
diff changeset
41 void AddCDROM(char* name, int track);
223b71206888 Initial import
thib
parents:
diff changeset
42 void AddWave(char* name, char* wave, int start_pt);
223b71206888 Initial import
thib
parents:
diff changeset
43 void AddSE(int num, char* se);
223b71206888 Initial import
thib
parents:
diff changeset
44 int CDTrack(char* name);
223b71206888 Initial import
thib
parents:
diff changeset
45 int TrackStart(char* name);
223b71206888 Initial import
thib
parents:
diff changeset
46 const char* WaveTrack(char* name);
223b71206888 Initial import
thib
parents:
diff changeset
47 const char* SETrack(int num);
223b71206888 Initial import
thib
parents:
diff changeset
48 };
223b71206888 Initial import
thib
parents:
diff changeset
49 /* gameexe.ini で設定されるパラメータ */
223b71206888 Initial import
thib
parents:
diff changeset
50 /* まず初めに、設定項目を SetOrigPara* でセットする
223b71206888 Initial import
thib
parents:
diff changeset
51 ** ただし、設定名は255文字以下である必要がある。
223b71206888 Initial import
thib
parents:
diff changeset
52 **
223b71206888 Initial import
thib
parents:
diff changeset
53 ** SetPara* で設定項目は変更できる
223b71206888 Initial import
thib
parents:
diff changeset
54 ** また、GetPara* で設定項目を得られる。
223b71206888 Initial import
thib
parents:
diff changeset
55 */
223b71206888 Initial import
thib
parents:
diff changeset
56
223b71206888 Initial import
thib
parents:
diff changeset
57 class AyuSysConfig {
223b71206888 Initial import
thib
parents:
diff changeset
58 friend class Conf2; /* テスト用のクラス */
223b71206888 Initial import
thib
parents:
diff changeset
59 int change_flag;
223b71206888 Initial import
thib
parents:
diff changeset
60 int dirty_flag;
223b71206888 Initial import
thib
parents:
diff changeset
61 class AyuSysConfigString* str_config;
223b71206888 Initial import
thib
parents:
diff changeset
62 class AyuSysConfigIntlist* int_config;
223b71206888 Initial import
thib
parents:
diff changeset
63
223b71206888 Initial import
thib
parents:
diff changeset
64 public:
223b71206888 Initial import
thib
parents:
diff changeset
65 TrackName track_name;
223b71206888 Initial import
thib
parents:
diff changeset
66
223b71206888 Initial import
thib
parents:
diff changeset
67 public:
223b71206888 Initial import
thib
parents:
diff changeset
68 AyuSysConfig(void);
9
b6d6c0ffb423 Fixed some memory leaks
thib
parents: 0
diff changeset
69 ~AyuSysConfig();
0
223b71206888 Initial import
thib
parents:
diff changeset
70 bool LoadInitFile(void);
223b71206888 Initial import
thib
parents:
diff changeset
71 /* パラメータを検索する */
223b71206888 Initial import
thib
parents:
diff changeset
72 /* str なら 1, int なら 2, 見つからないなら 0 */
223b71206888 Initial import
thib
parents:
diff changeset
73 int SearchParam(const char* name) const;
223b71206888 Initial import
thib
parents:
diff changeset
74 /* パラメータを得る */
223b71206888 Initial import
thib
parents:
diff changeset
75 const char* GetParaStr(const char* name) const; /* str */
223b71206888 Initial import
thib
parents:
diff changeset
76 int GetParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */
223b71206888 Initial import
thib
parents:
diff changeset
77 int GetOriginalParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */
223b71206888 Initial import
thib
parents:
diff changeset
78 int GetParaInt(const char* name) const {
223b71206888 Initial import
thib
parents:
diff changeset
79 int n;
223b71206888 Initial import
thib
parents:
diff changeset
80 if (GetParam(name,1,&n)) return 0;
223b71206888 Initial import
thib
parents:
diff changeset
81 return n;
223b71206888 Initial import
thib
parents:
diff changeset
82 }
223b71206888 Initial import
thib
parents:
diff changeset
83 const int* GetParamArray(const char* name, int& deal) const;
223b71206888 Initial import
thib
parents:
diff changeset
84 /* パラメータを変更する */
223b71206888 Initial import
thib
parents:
diff changeset
85 void SetParaStr(const char* name, const char* var); /* str */
223b71206888 Initial import
thib
parents:
diff changeset
86 void SetParam(const char* name, int deal, ...); /* int */
223b71206888 Initial import
thib
parents:
diff changeset
87 private:
223b71206888 Initial import
thib
parents:
diff changeset
88 friend class AyuSys;
223b71206888 Initial import
thib
parents:
diff changeset
89 /* 元設定を行う */
223b71206888 Initial import
thib
parents:
diff changeset
90 /* AyuSys からのみ可能 */
223b71206888 Initial import
thib
parents:
diff changeset
91 void SetOrigParaStr(const char* name, const char* var); /* str */
223b71206888 Initial import
thib
parents:
diff changeset
92 void SetOrigParam(const char* name, int para_deal, ...); /* int */
223b71206888 Initial import
thib
parents:
diff changeset
93 void SetOrigParamArray(const char* name, int deal, int* array); /* 上とおなじ */
223b71206888 Initial import
thib
parents:
diff changeset
94 public:
223b71206888 Initial import
thib
parents:
diff changeset
95
223b71206888 Initial import
thib
parents:
diff changeset
96 /* オリジナルの設定関係
223b71206888 Initial import
thib
parents:
diff changeset
97 ** SetOriginal : 全ての設定を初めの状態に戻す
223b71206888 Initial import
thib
parents:
diff changeset
98 ** DiffOriginal : 初めの状態と現在の状態の変更分を得る
223b71206888 Initial import
thib
parents:
diff changeset
99 ** PatchOriginal: DiffOriginal で得た文字列を引数に
223b71206888 Initial import
thib
parents:
diff changeset
100 ** 渡す。DiffOriginal 呼び出し時の状態に戻す
223b71206888 Initial import
thib
parents:
diff changeset
101 */
223b71206888 Initial import
thib
parents:
diff changeset
102 void SetOriginal(void);
223b71206888 Initial import
thib
parents:
diff changeset
103 void DiffOriginal(std::string&);
223b71206888 Initial import
thib
parents:
diff changeset
104 const char* PatchOriginal(const char*);
223b71206888 Initial import
thib
parents:
diff changeset
105 /* config の内容を表示する */
223b71206888 Initial import
thib
parents:
diff changeset
106 void Dump(FILE* f) const;
223b71206888 Initial import
thib
parents:
diff changeset
107 };
223b71206888 Initial import
thib
parents:
diff changeset
108