void ViewerWindow::loadGame(const QString &path) { QDir gameDir( path ); if( gameDir.exists() && path.size() > 0 ) { gameData = new GameData( &engineLog, &work, gameDir.absolutePath().toStdString() ); gameWorld = new GameWorld( &engineLog, &work, gameData ); renderer = new GameRenderer(&engineLog, gameData ); viewerWidget->setRenderer(renderer); gameWorld->data->load(); // Initalize all the archives. gameWorld->data->loadIMG("/models/gta3"); gameWorld->data->loadIMG("/models/txd"); gameWorld->data->loadIMG("/anim/cuts"); loadedData(gameWorld); } QSettings settings("OpenRW", "rwviewer"); QStringList recent = settings.value("recentGames").toStringList(); recent.removeAll( path ); recent.prepend( path ); while(recent.size() > MaxRecentGames) recent.removeLast(); settings.setValue("recentGames", recent); updateRecentGames(); }
void crawlDirectory(const std::string &directory) { status("Crawling through game directory \"%s\"", directory.c_str()); Gob::GameDir gameDir(directory); convertADL(gameDir); convertMDY(gameDir); const std::list<std::string> &tot = gameDir.getTOT(); for (std::list<std::string>::const_iterator f = tot.begin(); f != tot.end(); ++f) { status("Loading TOT \"%s\"", f->c_str()); try { Gob::TOTFile totFile(gameDir, *f); convertTOTADL(totFile); } catch (Common::Exception &e) { Common::printException(e, "WARNING: "); } } }
void GlkInterface::addSound() { Common::FSNode gameDir(ConfMan.get("path")); SoundSubfolder::check(gameDir); SoundZip::check(gameDir, _storyId); }