//------------------------------------------------- // load_data_info //------------------------------------------------- void datfile_manager::load_data_info(const game_driver *drv, std::string &buffer, int type) { dataindex const *index_idx = nullptr; drvindex const *driver_idx = nullptr; std::string const *tag; std::string filename; switch (type) { case UI_HISTORY_LOAD: filename = "history.dat"; tag = &TAG_BIO; index_idx = &m_histidx; break; case UI_MAMEINFO_LOAD: filename = "mameinfo.dat"; tag = &TAG_MAME; index_idx = &m_mameidx; driver_idx = &m_drvidx; break; case UI_SYSINFO_LOAD: filename = "sysinfo.dat"; tag = &TAG_BIO; index_idx = &m_sysidx; break; case UI_MESSINFO_LOAD: filename = "messinfo.dat"; tag = &TAG_MAME; index_idx = &m_messidx; driver_idx = &m_messdrvidx; break; case UI_STORY_LOAD: filename = "story.dat"; tag = &TAG_STORY; index_idx = &m_storyidx; break; case UI_GINIT_LOAD: filename = "gameinit.dat"; tag = &TAG_MAME; index_idx = &m_ginitidx; break; default: assert(false); return; } fileptr const datfile = parseopen(filename.c_str()); if (datfile) { load_data_text(datfile.get(), drv, buffer, *index_idx, *tag); // load driver info if (driver_idx && !driver_idx->empty()) load_driver_text(datfile.get(), drv, buffer, *driver_idx, TAG_DRIVER); // cleanup mameinfo and sysinfo double line spacing if (((*tag == TAG_MAME) && (type != UI_GINIT_LOAD)) || (type == UI_SYSINFO_LOAD)) strreplace(buffer, "\n\n", "\n"); } }
//------------------------------------------------- // load_data_info //------------------------------------------------- void datfile_manager::load_data_info(const game_driver *drv, std::string &buffer, int type) { dataindex index_idx; drvindex driver_idx; std::string tag; std::string filename; switch (type) { case UI_HISTORY_LOAD: filename = "history.dat"; tag = TAG_BIO; index_idx = m_histidx; break; case UI_MAMEINFO_LOAD: filename = "mameinfo.dat"; tag = TAG_MAME; index_idx = m_mameidx; driver_idx = m_drvidx; break; case UI_SYSINFO_LOAD: filename = "sysinfo.dat"; tag = TAG_BIO; index_idx = m_sysidx; break; case UI_MESSINFO_LOAD: filename = "messinfo.dat"; tag = TAG_MAME; index_idx = m_messidx; driver_idx = m_messdrvidx; break; case UI_STORY_LOAD: filename = "story.dat"; tag = TAG_STORY; index_idx = m_storyidx; break; } if (parseopen(filename.c_str())) { load_data_text(drv, buffer, index_idx, tag); // load driver info if (!driver_idx.empty()) load_driver_text(drv, buffer, driver_idx, TAG_DRIVER); // cleanup mameinfo and sysinfo double line spacing if (tag == TAG_MAME || type == UI_SYSINFO_LOAD) strreplace(buffer, "\n\n", "\n"); parseclose(); } }