| 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 | |
|---|
| 25 | #ifndef __SYSTEM_CONFIG_H__ |
|---|
| 26 | #define __SYSTEM_CONFIG_H__ |
|---|
| 27 | |
|---|
| 28 | #include <string> |
|---|
| 29 | |
|---|
| 30 | /* CD Track å <-> Track çªå·ã®å€æãè¡ã */ |
|---|
| 31 | class TrackName { |
|---|
| 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); |
|---|
| 53 | }; |
|---|
| 54 | /* gameexe.ini ã§èšå®ããããã©ã¡ãŒã¿ */ |
|---|
| 55 | /* ãŸãåãã«ãèšå®é
ç®ã SetOrigPara* ã§ã»ãããã |
|---|
| 56 | ** ãã ããèšå®åã¯255æå以äžã§ããå¿
èŠãããã |
|---|
| 57 | ** |
|---|
| 58 | ** SetPara* ã§èšå®é
ç®ã¯å€æŽã§ãã |
|---|
| 59 | ** ãŸããGetPara* ã§èšå®é
ç®ãåŸãããã |
|---|
| 60 | */ |
|---|
| 61 | |
|---|
| 62 | class AyuSysConfig { |
|---|
| 63 | public: |
|---|
| 64 | static AyuSysConfig* GetInstance(void); |
|---|
| 65 | static void Quit(void); |
|---|
| 66 | |
|---|
| 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 */ |
|---|
| 84 | |
|---|
| 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; |
|---|
| 96 | |
|---|
| 97 | private: |
|---|
| 98 | /* å
èšå®ãè¡ã */ |
|---|
| 99 | /* AyuSys ããã®ã¿å¯èœ */ |
|---|
| 100 | void SetOrigParaStr(const char* name, const char* var); /* str */ |
|---|
| 101 | void SetOrigParam(const char* name, int para_deal, ...); /* int */ |
|---|
| 102 | void SetOrigParamArray(const char* name, int deal, int* array); /* äžãšããªã */ |
|---|
| 103 | AyuSysConfig(void); |
|---|
| 104 | ~AyuSysConfig(); |
|---|
| 105 | |
|---|
| 106 | public: |
|---|
| 107 | TrackName track_name; |
|---|
| 108 | |
|---|
| 109 | private: |
|---|
| 110 | int change_flag; |
|---|
| 111 | int dirty_flag; |
|---|
| 112 | class AyuSysConfigString* str_config; |
|---|
| 113 | class AyuSysConfigIntlist* int_config; |
|---|
| 114 | static AyuSysConfig* _singleton; |
|---|
| 115 | }; |
|---|
| 116 | |
|---|
| 117 | #endif |
|---|
| 118 | |
|---|