view system/system_config.h @ 47:5f548e5957a8

* get rid of the "deprecated conversion from string constant to ‘char*’" warnings
author thib
date Wed, 15 Apr 2009 20:26:32 +0000
parents 5ae5533b3a9a
children 15a18fbe6f21
line wrap: on
line source

/*  system_config.h
 *      gameexe.ini ¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß
 */

/*
 *
 *  Copyright (C) 2000-   Kazunori Ueno(JAGARL) <jagarl@creator.club.ne.jp>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
*/

#include<string>

/* CD Track ̾ <-> Track ÈÖ¹æ¤ÎÊÑ´¹¤ò¹Ô¤¦ */
class TrackName {
	char** track;
	int* track_num;
	char** track_wave;
	int* track_start;
	int deal;
	void Expand(void);
	char** se_track;
	int se_deal;
	void ExpandSE(int num);
public:
	TrackName(void);
	~TrackName(void);
	void AddCDROM(char* name, int track);
	void AddWave(char* name, char* wave, int start_pt);
	void AddSE(int num, char* se);
	int CDTrack(char* name);
	int TrackStart(char* name);
	const char* WaveTrack(char* name);
	const char* SETrack(int num);
};
/* gameexe.ini ¤ÇÀßÄꤵ¤ì¤ë¥Ñ¥é¥á¡¼¥¿ */
/* ¤Þ¤º½é¤á¤Ë¡¢ÀßÄê¹àÌܤò SetOrigPara* ¤Ç¥»¥Ã¥È¤¹¤ë
** ¤¿¤À¤·¡¢ÀßÄê̾¤Ï255ʸ»ú°Ê²¼¤Ç¤¢¤ëɬÍפ¬¤¢¤ë¡£
**
** SetPara* ¤ÇÀßÄê¹àÌܤÏÊѹ¹¤Ç¤­¤ë
** ¤Þ¤¿¡¢GetPara* ¤ÇÀßÄê¹àÌܤòÆÀ¤é¤ì¤ë¡£
*/

class AyuSysConfig {
	friend class Conf2; /* ¥Æ¥¹¥ÈÍѤΥ¯¥é¥¹ */
	int change_flag;
	int dirty_flag;
	class AyuSysConfigString* str_config;
	class AyuSysConfigIntlist* int_config;

public:
	TrackName track_name;

public:
	AyuSysConfig(void);
	~AyuSysConfig();
	bool LoadInitFile(void);
	/* ¥Ñ¥é¥á¡¼¥¿¤ò¸¡º÷¤¹¤ë */
	/* str ¤Ê¤é 1, int ¤Ê¤é 2, ¸«¤Ä¤«¤é¤Ê¤¤¤Ê¤é 0 */
	int SearchParam(const char* name) const;
	/* ¥Ñ¥é¥á¡¼¥¿¤òÆÀ¤ë */
	const char* GetParaStr(const char* name) const; /* str */
	int GetParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */
	int GetOriginalParam(const char* name, int deal, ...) const; /* int, error -> return -1, no error -> return 0 */
	int GetParaInt(const char* name) const {
		int n;
		if (GetParam(name,1,&n)) return 0;
		return n;
	}
	const int* GetParamArray(const char* name, int& deal) const;
	/* ¥Ñ¥é¥á¡¼¥¿¤òÊѹ¹¤¹¤ë */
	void SetParaStr(const char* name, const char* var); /* str */
	void SetParam(const char* name, int deal, ...); /* int */
private:
	friend class AyuSys;
	/* ¸µÀßÄê¤ò¹Ô¤¦ */
	/* AyuSys ¤«¤é¤Î¤ß²Äǽ */
	void SetOrigParaStr(const char* name, const char* var); /* str */
	void SetOrigParam(const char* name, int para_deal, ...); /* int */
	void SetOrigParamArray(const char* name, int deal, int* array); /* ¾å¤È¤ª¤Ê¤¸ */
public:

	/* ¥ª¥ê¥¸¥Ê¥ë¤ÎÀßÄê´Ø·¸
	** SetOriginal : Á´¤Æ¤ÎÀßÄê¤ò½é¤á¤Î¾õÂÖ¤ËÌ᤹
	** DiffOriginal : ½é¤á¤Î¾õÂ֤ȸ½ºß¤Î¾õÂÖ¤ÎÊѹ¹Ê¬¤òÆÀ¤ë
	** PatchOriginal: DiffOriginal ¤ÇÆÀ¤¿Ê¸»úÎó¤ò°ú¿ô¤Ë
	**   ÅϤ¹¡£DiffOriginal ¸Æ¤Ó½Ð¤·»þ¤Î¾õÂÖ¤ËÌ᤹
	*/
	void SetOriginal(void);
	void DiffOriginal(std::string&);
	const char* PatchOriginal(const char*);
	/* config ¤ÎÆâÍƤòɽ¼¨¤¹¤ë */
	void Dump(FILE* f) const;
};