diff scn2k/scn2k_text.cc @ 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 f1a27ee7e03c
line wrap: on
line diff
--- a/scn2k/scn2k_text.cc
+++ b/scn2k/scn2k_text.cc
@@ -93,7 +93,7 @@ struct TextWindow {
 	PicContainer* name_container;
 	PicBase* face;
 	PicBase* face_pics[8];
-	TextWindow(PicContainer& parent, Event::Container& event, int window_no, const AyuSysConfig& config, void* callback);
+	TextWindow(PicContainer& parent, Event::Container& event, int window_no, void* callback);
 	~TextWindow() {
 		if (name_container != NULL) {
 			delete name_container;
@@ -111,8 +111,8 @@ struct TextWindow {
 			wid = NULL;
 		}
 	}
-	Rect WakuSize(PicContainer& pic, int waku_no, const AyuSysConfig& config);
-	void MakeWaku(PicContainer& pic, Event::Container& event, int waku_no,int window_no, bool* use_btn, const AyuSysConfig& config, void* callback);
+	Rect WakuSize(PicContainer& pic, int waku_no);
+	void MakeWaku(PicContainer& pic, Event::Container& event, int waku_no,int window_no, bool* use_btn, void* callback);
 	void show(void) {
 		wid->show();
 		if (name_container && name_visible) name_container->show();
@@ -205,7 +205,7 @@ class TextImpl {
 	public:
 		PicContainer& parent;
 		Event::Container& event;
-		AyuSysConfig& config;
+		AyuSysConfig *config;
 	private:
 		TextWindow* widgets[32];
 		WidTimeCursor* kcursor;
@@ -229,7 +229,7 @@ class TextImpl {
 		static bool PressFunc(int x, int y, void* pointer);
 
 	public:
-		TextImpl(Event::Container& _event, PicContainer& _parent, AyuSysConfig& config, vector<BacklogItem>& parent_backlog, BacklogItem& parent_backlog_item);
+		TextImpl(Event::Container& _event, PicContainer& _parent, vector<BacklogItem>& parent_backlog, BacklogItem& parent_backlog_item);
 		~TextImpl();
 		void InitWindow(void);
 		void SetWindowColor(int r, int g, int b, int a, bool is_transparent);
@@ -252,11 +252,12 @@ class TextImpl {
 **
 **	TextImpl(implementation)
 */
-TextImpl::TextImpl(Event::Container& _event, PicContainer& _parent, AyuSysConfig& _config, vector<BacklogItem>& parent_backlog, BacklogItem& parent_backlog_item) :
+TextImpl::TextImpl(Event::Container& _event, PicContainer& _parent, vector<BacklogItem>& parent_backlog, BacklogItem& parent_backlog_item) :
 	text(0),status(TextImpl::NORMAL), status_saved(TextImpl::NORMAL), status_mask(TextImpl::NORMAL), ruby_text_flag(false),
 	old_time(0), base_time(0), text_window_number(0), text_parsing(false), skip_mode(SKIP_NO), save_selectcount(0), sel_widget(0),
-	backlog_widget(0), backlog(parent_backlog), backlog_item(parent_backlog_item), parent(_parent), event(_event), config(_config),
+	backlog_widget(0), backlog(parent_backlog), backlog_item(parent_backlog_item), parent(_parent), event(_event),
 	kcursor(0), sel_bg1(0), sel_bg2(0), sel_bg_rect(0,0,0,0) {
+	config = AyuSysConfig::GetInstance();
 	int i;
 	for (i=0; i<32; i++) {
 		widgets[i] = 0;
@@ -623,7 +624,7 @@ void TextImpl::show(int num) {
 		int kx, ky, d;
 		char key[1024];
 		sprintf(key, "#WINDOW.%03d.KEYCUR_MOD", text_window_number);
-		config.GetParam(key, 3, &d, &kx, &ky);
+		config->GetParam(key, 3, &d, &kx, &ky);
 		// 正しくない気がする
 		kx += text->wid->Pic()->PosX();
 		ky += text->wid->Pic()->PosY();
@@ -657,8 +658,8 @@ void TextImpl::DrawBacklog(BacklogItem& 
 void TextImpl::CreateSelBG(void) {
 	if (sel_bg1 != NULL || sel_bg2 != NULL) return;
 
-	const char* btnfile1 = config.GetParaStr("#SELBTN.000.NAME");
-	const char* btnfile2 = config.GetParaStr("#SELBTN.000.BACK");
+	const char* btnfile1 = config->GetParaStr("#SELBTN.000.NAME");
+	const char* btnfile2 = config->GetParaStr("#SELBTN.000.BACK");
 	char path[1024];
 	strcpy(path, btnfile1);
 	sel_bg1 = parent.Root().NewSurface(path);
@@ -681,7 +682,7 @@ void TextImpl::CreateSelect(Cmd& cmd) {
 	char key[1024];
 	sprintf(key, "#WINDOW.%03d.SELCOM_USE",text_window_number);
 	int sel_type = 0;
-	if (cmd.cmd3 == 1) config.GetParam(key, 1, &sel_type);
+	if (cmd.cmd3 == 1) config->GetParam(key, 1, &sel_type);
 	else if (cmd.cmd3 == 3) sel_type = 0;
 
 	int sel_size = cmd.args.size() / 2;
@@ -708,19 +709,19 @@ External_select:
 		hide(); // なので、テキストウィンドウは消去
 		int baseposx, baseposy, repposx, repposy, centerx, centery;
 		int mojisize, col1, col2;
-		config.GetParam("#SELBTN.000.CENTERING", 2, &centerx, &centery);
-		config.GetParam("#SELBTN.000.BASEPOS", 2, &baseposx, &baseposy);
-		config.GetParam("#SELBTN.000.REPPOS", 2, &repposx, &repposy);
-		config.GetParam("#SELBTN.000.MOJISIZE", 1, &mojisize);
-		config.GetParam("#SELBTN.000.MOJIDEFAULTCOL", 1, &col1);
-		config.GetParam("#SELBTN.000.MOJISELECTCOL", 1, &col2);
+		config->GetParam("#SELBTN.000.CENTERING", 2, &centerx, &centery);
+		config->GetParam("#SELBTN.000.BASEPOS", 2, &baseposx, &baseposy);
+		config->GetParam("#SELBTN.000.REPPOS", 2, &repposx, &repposy);
+		config->GetParam("#SELBTN.000.MOJISIZE", 1, &mojisize);
+		config->GetParam("#SELBTN.000.MOJIDEFAULTCOL", 1, &col1);
+		config->GetParam("#SELBTN.000.MOJISELECTCOL", 1, &col2);
 		if (col1 == col2) col2 = 1; // CLANNAD でとりあえず。
 		int r, g, b;
 		sprintf(key, "#COLOR_TABLE.%03d", col1);
-		config.GetParam(key, 3, &r, &g, &b);
+		config->GetParam(key, 3, &r, &g, &b);
 		Color fore(r,g,b);
 		sprintf(key, "#COLOR_TABLE.%03d", col2);
-		config.GetParam(key, 3, &r, &g, &b);
+		config->GetParam(key, 3, &r, &g, &b);
 		Color seled(r,g,b);
 
 		/* ウィジット作成 */
@@ -763,7 +764,7 @@ External_select:
 		status = WAIT_SELECT_OUTBOX;
 	} else { // CLANNAD: テキストウィンドウ内に選択肢表示
 		int mojisize;
-		config.GetParam("#SELBTN.000.MOJISIZE", 1, &mojisize);
+		config->GetParam("#SELBTN.000.MOJISIZE", 1, &mojisize);
 		Color fore(0xff,0xff,0xff);
 		Color seled(0xff,0xff,0xff);
 
@@ -1227,9 +1228,9 @@ if (cmd.args.size() != 7)
 			// テキストウィンドウの色設定
 			int r, g, b, a, flag;
 			if (cmd.cmd3 == 0xa39) { // 元設定を取り出す
-				config.GetOriginalParam("#WINDOW_ATTR", 5, &r, &g, &b, &a, &flag);
+				config->GetOriginalParam("#WINDOW_ATTR", 5, &r, &g, &b, &a, &flag);
 			} else {
-				config.GetParam("#WINDOW_ATTR", 5, &r, &g, &b, &a, &flag);
+				config->GetParam("#WINDOW_ATTR", 5, &r, &g, &b, &a, &flag);
 			}
 			if (cmd.cmd3 == 0xa39 || cmd.cmd3 == 0x93f) { // 設定を変数に取り出す
 				if (cmd.args.size() != 5) {
@@ -1257,24 +1258,24 @@ if (cmd.args.size() != 7)
 					flag = cmd.args[4].value;
 					break;
 				}
-				config.SetParam("#WINDOW_ATTR", 5, r, g, b, a, flag);
+				config->SetParam("#WINDOW_ATTR", 5, r, g, b, a, flag);
 				SetWindowColor(r, g, b, a, flag);
 				cmd.clear();
 			}
 		} else if (cmd.cmd3 == 0xa28 || cmd.cmd3 == 0xa29 || cmd.cmd3 == 0xa2c || cmd.cmd3 == 0xa2d || cmd.cmd3 == 0xa2e) {
 			int v = 0;
 			switch(cmd.cmd3) {
-			case 0xa28: case 0xa2d: config.GetOriginalParam("#INIT_MESSAGE_SPEED", 1, &v); break;
-			case 0xa29: config.GetOriginalParam("#INIT_MESSAGE_SPEED_MOD", 1, &v); break;
-			case 0xa2c: config.GetOriginalParam("#MESSAGE_KEY_WAIT_USE", 1, &v); break;
-			case 0xa2e: config.GetOriginalParam("#MESSAGE_KEY_WAIT_TIME", 1, &v); break;
+			case 0xa28: case 0xa2d: config->GetOriginalParam("#INIT_MESSAGE_SPEED", 1, &v); break;
+			case 0xa29: config->GetOriginalParam("#INIT_MESSAGE_SPEED_MOD", 1, &v); break;
+			case 0xa2c: config->GetOriginalParam("#MESSAGE_KEY_WAIT_USE", 1, &v); break;
+			case 0xa2e: config->GetOriginalParam("#MESSAGE_KEY_WAIT_TIME", 1, &v); break;
 			}
 			cmd.SetSysvar(v);
 		} else if (cmd.cmd3 == 0x913 || cmd.cmd3 == 0x914 || cmd.cmd3 == 0x92f || cmd.cmd3 == 0x8af || cmd.cmd3 == 0x8b0 || cmd.cmd3 == 0x8cb) {
 			// テキスト表示速度関連
 			int m, speed;
-			config.GetParam("#INIT_MESSAGE_SPEED", 1, &speed);
-			config.GetParam("#INIT_MESSAGE_SPEED_MOD", 1, &m);
+			config->GetParam("#INIT_MESSAGE_SPEED", 1, &speed);
+			config->GetParam("#INIT_MESSAGE_SPEED_MOD", 1, &m);
 if (cmd.cmd3 == 0x913 || cmd.cmd3 == 0x92f) fprintf(stderr,"TEXT speed %d\n",speed);
 else if (cmd.cmd3 == 0x914) fprintf(stderr,"TEXT mode %d\n",m);
 else if (cmd.cmd3 == 0x8af || cmd.cmd3 == 0x8cb) fprintf(stderr,"TEXT %d, %d <- speed %d\n",m,speed,cmd.args[0].value);
@@ -1286,8 +1287,8 @@ else fprintf(stderr,"TEXT %d, %d <- mode
 				else m = cmd.args[0].value;
 				if (speed < 10) speed = 10;
 				else if (speed > 1000) speed = 1000;
-				config.SetParam("#INIT_MESSAGE_SPEED", 1, speed);
-				config.SetParam("#INIT_MESSAGE_SPEED_MOD", 1, m);
+				config->SetParam("#INIT_MESSAGE_SPEED", 1, speed);
+				config->SetParam("#INIT_MESSAGE_SPEED_MOD", 1, m);
 				if (m) speed = -1;
 				SetTextSpeed(speed);
 				cmd.clear();
@@ -1295,8 +1296,8 @@ else fprintf(stderr,"TEXT %d, %d <- mode
 		} else if (cmd.cmd3 == 0x92e || cmd.cmd3 == 0x930 || cmd.cmd3 == 0x8ca || cmd.cmd3 == 0x8cc) {
 			// テキストオートモード関連
 			int m, wait;
-			config.GetParam("#MESSAGE_KEY_WAIT_USE", 1, &m);
-			config.GetParam("#MESSAGE_KEY_WAIT_TIME", 1, &wait);
+			config->GetParam("#MESSAGE_KEY_WAIT_USE", 1, &m);
+			config->GetParam("#MESSAGE_KEY_WAIT_TIME", 1, &wait);
 if (cmd.cmd3 == 0x92e) fprintf(stderr,"AUTO mode %d\n",m);
 else if (cmd.cmd3 == 0x930) fprintf(stderr,"AUTO wait %d\n",wait);
 else if (cmd.cmd3 == 0x8ca) fprintf(stderr,"AUTO %d,%d <- mode %d\n",m,wait,cmd.args[0].value);
@@ -1309,8 +1310,8 @@ else fprintf(stderr,"AUTO %d,%d <- wait 
 				else wait = cmd.args[1].value;
 				if (wait < 0) wait = 0;
 				else if (wait > 60000) wait = 60000;
-				config.SetParam("#MESSAGE_KEY_WAIT_USE", 1, m);
-				config.SetParam("#MESSAGE_KEY_WAIT_TIME", 1, wait);
+				config->SetParam("#MESSAGE_KEY_WAIT_USE", 1, m);
+				config->SetParam("#MESSAGE_KEY_WAIT_TIME", 1, wait);
 				if (m) SetTextWait(wait);
 				else SetTextWait(-1);
 				cmd.clear();
@@ -1617,7 +1618,7 @@ void TextImpl::SetWindowColor(int r, int
 	for (w=0; w<32; w++) {
 		if (widgets[w] == NULL) continue;
 		sprintf(key, "#WAKU.%03d.000.BACK", w);
-		const char* back = config.GetParaStr(key);
+		const char* back = config->GetParaStr(key);
 		if (back == NULL || back[0] == 0) continue;
 		sprintf(key, "%s.g00", back);
 		Surface* back_s = parent.Root().NewSurface(key);
@@ -1637,16 +1638,16 @@ void TextImpl::SetWindowColor(int r, int
 void TextImpl::SetCursor(int cursor_no) {
 	char key[1024];
 	sprintf(key, "#CURSOR.%03d.NAME", cursor_no);
-	string path = config.GetParaStr(key);
+	string path = config->GetParaStr(key);
 	if (path.length() == 0) return; // 名前なし
 	path += ".pdt";
 	int w,h,cont,speed;
 	sprintf(key, "#CURSOR.%03d.SIZE", cursor_no);
-	config.GetParam(key, 2, &w, &h);
+	config->GetParam(key, 2, &w, &h);
 	sprintf(key, "#CURSOR.%03d.CONT", cursor_no);
-	config.GetParam(key, 1, &cont);
+	config->GetParam(key, 1, &cont);
 	sprintf(key, "#CURSOR.%03d.SPEED", cursor_no);
-	config.GetParam(key, 1, &speed);
+	config->GetParam(key, 1, &speed);
 
 	// speed で1周、cont 回変化
 	if (kcursor != NULL) delete kcursor;
@@ -1741,8 +1742,8 @@ string kconv_rev(const string& s) {
 **
 **	Text
 */
-Text::Text(Event::Container& _event, PicContainer& _parent, AyuSysConfig& config) {
-	pimpl = new TextImpl(_event, _parent, config, backlog, backlog_item);
+Text::Text(Event::Container& _event, PicContainer& _parent) {
+	pimpl = new TextImpl(_event, _parent, backlog, backlog_item);
 }
 
 Text::~Text() {
@@ -1838,10 +1839,10 @@ void BacklogItem::SetSavepos(int p) {
 	pos = p;
 }
 
-Rect TextWindow::WakuSize(PicContainer& pic, int waku_no, const AyuSysConfig& config) {
+Rect TextWindow::WakuSize(PicContainer& pic, int waku_no) {
 	char key[1024];
 	sprintf(key, "#WAKU.%03d.000.NAME", waku_no);
-	const char* name = config.GetParaStr(key);
+	const char* name = AyuSysConfig::GetInstance()->GetParaStr(key);
 	if (name == NULL) return Rect(0,0,0,0);
 	std::string str = name; str += ".g00";
 	Surface* s = pic.Root().NewSurface(str.c_str());
@@ -1851,18 +1852,19 @@ Rect TextWindow::WakuSize(PicContainer& 
 	return r;
 }
 
-void TextWindow::MakeWaku(PicContainer& pic, Event::Container& event, int waku_no, int window_no, bool* use_btn, const AyuSysConfig& config, void* callback) {
+void TextWindow::MakeWaku(PicContainer& pic, Event::Container& event, int waku_no, int window_no, bool* use_btn, void* callback) {
+	AyuSysConfig *config = AyuSysConfig::GetInstance();
 	char key[1024];
 	std::string str;
 	/* 枠を作成 */
 	sprintf(key, "#WAKU.%03d.000.NAME", waku_no);
-	const char* name = config.GetParaStr(key);
+	const char* name = config->GetParaStr(key);
 	if (name != NULL && name[0] == 0) name = NULL;
 	sprintf(key, "#WAKU.%03d.000.BACK", waku_no);
-	const char* back = config.GetParaStr(key);
+	const char* back = config->GetParaStr(key);
 	if (back != NULL && back[0] == 0) back = NULL;
 	sprintf(key, "#WAKU.%03d.000.BTN", waku_no);
-	const char* btn = config.GetParaStr(key);
+	const char* btn = config->GetParaStr(key);
 	if (btn != NULL && btn[0] == 0) btn = NULL;
 
 	if (name == NULL && back == NULL && btn == NULL) return;
@@ -1873,8 +1875,8 @@ void TextWindow::MakeWaku(PicContainer& 
 		int rc, gc, bc, ac, flag;
 		char key[1024];
 		sprintf(key, "#WINDOW.%03d.ATTR", window_no);
-		if (config.GetParam(key, 5, &rc, &gc, &bc, &ac, &flag) == -1) {
-			config.GetParam("#WINDOW_ATTR", 5, &rc, &gc, &bc, &ac, &flag);
+		if (config->GetParam(key, 5, &rc, &gc, &bc, &ac, &flag) == -1) {
+			config->GetParam("#WINDOW_ATTR", 5, &rc, &gc, &bc, &ac, &flag);
 		}
 		Surface* back_s = pic.Root().NewSurface(str.c_str());
 		if (back_s != NULL) {
@@ -1908,7 +1910,7 @@ void TextWindow::MakeWaku(PicContainer& 
 
 	/* ボタンの位置情報を求める */
 	str = btn; str += ".g00";
-	ARCINFO* info = file_searcher.Find(FILESEARCH::PDT, str.c_str(), "g00");
+	ARCINFO* info = FileSearcher::GetInstance()->Find(FileSearcher::PDT, str.c_str(), "g00");
 	if (info == NULL) return; // cannot find file
 	const char* data = info->Read();
 	/* g00 ファイルのヘッダ部分に位置情報は入っている */
@@ -1926,7 +1928,7 @@ void TextWindow::MakeWaku(PicContainer& 
 		}
 		int x, y, w, h;
 		sprintf(key, "#WAKU.%03d.000.%s_BOX", waku_no, btnname[i]);
-		if (config.GetParam(key, 5, 0, &x, &y, &w, &h) == -1) continue;
+		if (config->GetParam(key, 5, 0, &x, &y, &w, &h) == -1) continue;
 		int sx, sy, sdx, sdy, cnt;
 		const char* d = data + 9 + btnpos[i]*24*8;
 		sx = read_little_endian_int(d);
@@ -1942,26 +1944,30 @@ void TextWindow::MakeWaku(PicContainer& 
 	delete info;
 }
 
-TextWindow::TextWindow(PicContainer& parent, Event::Container& event, int win_no, const AyuSysConfig& config, void* callback) :
-	wid(0), name_visible(true),name(0),name_container(0), face(0) {
-	int i; for (i=0; i<8; i++) face_pics[i]=0;
+TextWindow::TextWindow(PicContainer& parent, Event::Container& event, int win_no, void* callback) :
+	wid(0), name_visible(true),name(0),name_container(0), face(0)
+{
+	AyuSysConfig *config = AyuSysConfig::GetInstance();
+	int i;
+	for (i=0; i<8; i++)
+		face_pics[i]=0;
 	char key[1024];
 	bool use_btn[BTNCNT];
 	int size, rep1, rep2, cntw, cnth, mposx, mposy, posd, posx, posy, minx, miny, waku_no, ruby;
-	sprintf(key, "#WINDOW.%03d.MOJI_SIZE", win_no); if (config.GetParam(key, 1, &size) == -1) return;
-	sprintf(key, "#WINDOW.%03d.MOJI_REP", win_no);  if (config.GetParam(key, 2, &rep1, &rep2) == -1) return;
-	sprintf(key, "#WINDOW.%03d.MOJI_CNT", win_no);  if (config.GetParam(key, 2, &cntw, &cnth) == -1) return;
-	sprintf(key, "#WINDOW.%03d.POS", win_no);       if (config.GetParam(key, 3, &posd, &posx, &posy) == -1) return;
-	sprintf(key, "#WINDOW.%03d.MOJI_POS", win_no);  if (config.GetParam(key, 4, &mposy, NULL, &mposx, NULL) == -1) return;
-	sprintf(key, "#WINDOW.%03d.MOJI_MIN", win_no);  if (config.GetParam(key, 2, &minx, &miny) == -1) return;
-	sprintf(key, "#WINDOW.%03d.WAKU_SETNO", win_no);if (config.GetParam(key, 1, &waku_no) == -1) return;
-	sprintf(key, "#WINDOW.%03d.LUBY_SIZE", win_no); if (config.GetParam(key, 1, &ruby) == -1) return;
+	sprintf(key, "#WINDOW.%03d.MOJI_SIZE", win_no); if (config->GetParam(key, 1, &size) == -1) return;
+	sprintf(key, "#WINDOW.%03d.MOJI_REP", win_no);  if (config->GetParam(key, 2, &rep1, &rep2) == -1) return;
+	sprintf(key, "#WINDOW.%03d.MOJI_CNT", win_no);  if (config->GetParam(key, 2, &cntw, &cnth) == -1) return;
+	sprintf(key, "#WINDOW.%03d.POS", win_no);       if (config->GetParam(key, 3, &posd, &posx, &posy) == -1) return;
+	sprintf(key, "#WINDOW.%03d.MOJI_POS", win_no);  if (config->GetParam(key, 4, &mposy, NULL, &mposx, NULL) == -1) return;
+	sprintf(key, "#WINDOW.%03d.MOJI_MIN", win_no);  if (config->GetParam(key, 2, &minx, &miny) == -1) return;
+	sprintf(key, "#WINDOW.%03d.WAKU_SETNO", win_no);if (config->GetParam(key, 1, &waku_no) == -1) return;
+	sprintf(key, "#WINDOW.%03d.LUBY_SIZE", win_no); if (config->GetParam(key, 1, &ruby) == -1) return;
 
 	/* テキストウィジット:画面の右下一杯まで使用 */
 	/* posd == 2 なら画面下にひっつくように配置 */
 	Rect r(0,0);
 	if (posd == 2) {
-		r = WakuSize(parent, waku_no, config);
+		r = WakuSize(parent, waku_no);
 		r = Rect(0, parent.Height()-r.height(), r.width(), parent.Height());
 		posx = 0;
 		posy = parent.Height()-r.height();
@@ -1976,7 +1982,7 @@ TextWindow::TextWindow(PicContainer& par
 	for (i=0; i<8; i++) {
 		int x,y;
 		sprintf(key, "#WINDOW.%03d.FACE.%03d", win_no, i);
-		if (config.GetParam(key, 2, &x, &y) == -1) continue;
+		if (config->GetParam(key, 2, &x, &y) == -1) continue;
 		/* 顔ウィンドウを作成する */
 		if (x >= 0 && y >= 0) {
 			face_pics[i] = wid->PicNode()->create_leaf(Rect(x,y), PicBase::FIT_SURFACE);
@@ -1990,18 +1996,18 @@ TextWindow::TextWindow(PicContainer& par
 	for (i=0; i<BTNCNT; i++) {
 		int num;
 		sprintf(key, "#WINDOW.%03d.%s_USE", win_no, btnname[i]);
-		config.GetParam(key, 1, &num);
+		config->GetParam(key, 1, &num);
 		use_btn[i] = (num==0) ? false : true;
 	}
 	// make name window
 	int shadow, name_mod, name_size, name_min, name_center, name_posx, name_posy, name_mposx, name_mposy;
-	sprintf(key, "#WINDOW.%03d.MOJI_SHADOW", win_no);  config.GetParam(key, 1, &shadow);
-	sprintf(key, "#WINDOW.%03d.NAME_MOD", win_no);  config.GetParam(key, 1, &name_mod);
-	sprintf(key, "#WINDOW.%03d.NAME_MOJI_SIZE", win_no);  config.GetParam(key, 1, &name_size);
-	sprintf(key, "#WINDOW.%03d.NAME_MOJI_MIN", win_no);  config.GetParam(key, 1, &name_min);
-	sprintf(key, "#WINDOW.%03d.NAME_MOJI_POS", win_no);  config.GetParam(key, 2, &name_mposx, &name_mposy);
-	sprintf(key, "#WINDOW.%03d.NAME_CENTERING", win_no);  config.GetParam(key, 1, &name_center);
-	sprintf(key, "#WINDOW.%03d.NAME_POS", win_no);  config.GetParam(key, 2, &name_posx, &name_posy);
+	sprintf(key, "#WINDOW.%03d.MOJI_SHADOW", win_no);  config->GetParam(key, 1, &shadow);
+	sprintf(key, "#WINDOW.%03d.NAME_MOD", win_no);  config->GetParam(key, 1, &name_mod);
+	sprintf(key, "#WINDOW.%03d.NAME_MOJI_SIZE", win_no);  config->GetParam(key, 1, &name_size);
+	sprintf(key, "#WINDOW.%03d.NAME_MOJI_MIN", win_no);  config->GetParam(key, 1, &name_min);
+	sprintf(key, "#WINDOW.%03d.NAME_MOJI_POS", win_no);  config->GetParam(key, 2, &name_mposx, &name_mposy);
+	sprintf(key, "#WINDOW.%03d.NAME_CENTERING", win_no);  config->GetParam(key, 1, &name_center);
+	sprintf(key, "#WINDOW.%03d.NAME_POS", win_no);  config->GetParam(key, 2, &name_posx, &name_posy);
 	// if name_mode==0 name is in the text window
 	// if name_mode == 1 open name window
 	// if name_mode == 2 name is not used
@@ -2010,12 +2016,12 @@ TextWindow::TextWindow(PicContainer& par
 			int w = name_size*name_min; int h = name_size;
 			int name_waku;
 			sprintf(key, "#WINDOW.%03d.NAME_WAKU_SETNO", win_no);
-			if (config.GetParam(key, 1, &name_waku) != -1 && name_waku != -1) {
-				Rect waku_r = WakuSize(parent, name_waku, config);
+			if (config->GetParam(key, 1, &name_waku) != -1 && name_waku != -1) {
+				Rect waku_r = WakuSize(parent, name_waku);
 				waku_r.rmove(r.lx, r.ty); // テキストウィンドウ位置に動かす
 				waku_r.rmove(name_posx, name_posy-waku_r.height()); // NAME_POS へ位置補正
 				name_container = parent.create_node(waku_r, 0);
-				MakeWaku(*name_container, event, name_waku, win_no, 0, config, callback);
+				MakeWaku(*name_container, event, name_waku, win_no, 0, callback);
 				Rect name_r(0,0,w,h);
 				name_r.rmove(name_mposx, name_mposy);
 				name = new WidLabel(name_container, name_r, true, 0, name_size);
@@ -2033,7 +2039,7 @@ TextWindow::TextWindow(PicContainer& par
 			name_container = parent.create_node( Rect(0, 0, 1, 1), 0);
 		}
 	}
-	MakeWaku(*wid->PicNode(), event,waku_no, win_no, use_btn, config, callback);
+	MakeWaku(*wid->PicNode(), event,waku_no, win_no, use_btn, callback);
 }
 
 void TextImpl::InitWindow(void) {
@@ -2042,7 +2048,7 @@ void TextImpl::InitWindow(void) {
 	std::string str;
 
 	for (w=0; w<32; w++) {
-		widgets[w] = new TextWindow(parent, event, w, config, (void*)this);
+		widgets[w] = new TextWindow(parent, event, w, (void*)this);
 		if (widgets[w]->wid == 0) {
 			delete widgets[w];
 			widgets[w] = NULL;
@@ -2052,7 +2058,7 @@ void TextImpl::InitWindow(void) {
 	for (i=0; i<26; i++) {
 		char buf[1024];
 		sprintf(buf, "#NAME.%c", i+'A');
-		const char* s = config.GetParaStr(buf);
+		const char* s = config->GetParaStr(buf);
 		if (s != NULL) replace_name[i] = s;
 	}
 	// replace_name2 : 初期設定
@@ -2065,10 +2071,10 @@ void TextImpl::InitWindow(void) {
 	text = NULL;
 	/* テキスト速度の設定 */
 	int speed, mod, wait, auto_mod;
-	config.GetParam("#INIT_MESSAGE_SPEED", 1, &speed);
-	config.GetParam("#INIT_MESSAGE_SPEED_MOD", 1, &mod);
-	config.GetParam("#MESSAGE_KEY_WAIT_USE", 1, &auto_mod);
-	config.GetParam("#MESSAGE_KEY_WAIT_TIME", 1, &wait);
+	config->GetParam("#INIT_MESSAGE_SPEED", 1, &speed);
+	config->GetParam("#INIT_MESSAGE_SPEED_MOD", 1, &mod);
+	config->GetParam("#MESSAGE_KEY_WAIT_USE", 1, &auto_mod);
+	config->GetParam("#MESSAGE_KEY_WAIT_TIME", 1, &wait);
 	if (mod) speed = -1;
 	if (!auto_mod) wait = -1;
 	SetTextSpeed(speed);