memset(misc_names, 0, num_misc_names*sizeof(misc_names[0]));
static void Setup_item_names (ifstream& items, ifstream& msgs) {	vector<char *> msglist;	int first_msg;			// First in exultmsg.txt.  Should					//   follow those in text.flx.	int total_msgs = 0;	items.seekg(0x54);	int flxcnt = Read4(items);	first_msg = num_item_names = flxcnt;	if (flxcnt > 0x400)		{		num_item_names = 0x400;		num_text_msgs = flxcnt - 0x400;		if (flxcnt > 0x500)			{			num_text_msgs = 0x100;			num_misc_names = flxcnt - 0x500;			}		total_msgs = num_text_msgs;		}	if (msgs.good()) {		// Exult msgs. too?		first_msg = Read_text_msg_file(msgs, msglist);		if (first_msg >= 0) {			first_msg -= 0x400;			if (first_msg < num_text_msgs) {				cerr << "Exult msg. # " << first_msg <<					" conflicts with 'text.flx'" << endl;				first_msg = num_text_msgs;			}			total_msgs = msglist.size() - 0x400;		} else			first_msg = num_text_msgs;	}	item_names = new char *[num_item_names];	text_msgs = new char *[total_msgs];	misc_names = new char *[num_misc_names];	int i;	for(i=0; i < flxcnt; i++) {		items.seekg(0x80+i*8);		int itemoffs = Read4(items);		if(!itemoffs)			continue;		int itemlen = Read4(items);		items.seekg(itemoffs);		char *& loc = i < num_item_names ? item_names[i]			: (i - num_item_names < num_text_msgs) 			? text_msgs[i - num_item_names]			: misc_names[i - num_item_names - num_text_msgs];		loc = new char[itemlen];		items.read(loc, itemlen);#if 0		cout << dec << i << " 0x" << hex << i << dec			<< "\t" << item_names[i] << endl;#endif	}	for (i = first_msg; i < total_msgs; i++)		text_msgs[i] = msglist[i + 0x400];	num_text_msgs = total_msgs;} 