No description
670cf9a894
Load every file matching the pattern NavData/apt/*.dat[.gz] inside each scenery path. These files are loaded in the same order as the components of globals->get_unmangled_fg_scenery() they reside in. Inside a given component, the order is determined by pathSortPredicate() in simgear/misc/sg_dir.cxx (lexicographic order at the time of this writing). For compatibility with existing scenery, $FG_ROOT/Airports/apt.dat.gz is also loaded last. The idea is that such files will have the same precedence order as the globals->get_unmangled_fg_scenery() scenery components they come from. This commit doesn't handle this fully yet, though: it blindly loads all these files. A future commit will ensure that no airport is loaded twice due to overlapping apt.dat files. This commit however handles all the logic of navdata cache rebuilding when the list, the order of apt.dat files, or any of their timestamps changes. Although only apt.dat files receive a new treatment in this commit, the changes to NavDataCache.[ch]xx are already generic so that extension of this method to fix.dat, nav.dat, etc. will require almost no change to NavDataCache.[ch]xx (however, changes will probably be needed in the various loaders: in fixlist.[ch]xx, navdb.[ch]xx, etc.). src/Navaids/CacheSchema.h: - increment the SCHEMA_VERSION by 1. This ensures among others that if someone uses a FlightGear version posterior to this change with new-style scenery (having NavData/apt/*.dat[.gz] files inside scenery paths), then goes back to a FlightGear version anterior to this change, his NavCache is rebuilt ignoring the in-scenery-paths NavData/apt/*.dat[.gz] files, as expected with the old FlightGear version. src/Navaids/NavDataCache.cxx: - NavDataCachePrivate: replace aptDatPath (SGPath) with aptDatPaths (PathList). - NavDataCachePrivate::getDatFilesPaths(): new method that returns the list of $scenery_path/NavData/<type>/*.dat[.gz] files found inside scenery paths (where <type> is one of 'apt', 'fix', etc.), plus the historical file (e.g., $FG_ROOT/Airports/apt.dat.gz for the 'apt' type). - NavDataCachePrivate::areDatFilesModified(): new method that tells whether any of these files (for a given type) has changed since the last NavCache rebuild, or if their ordered list has changed. - NavDataCachePrivate::isCachedFileModified(): minor changes. - NavDataCache::updateListsOfDatFiles(): new method that updates the lists of dat files used for NavCache freshness checking and rebuilding, i.e. currently sets/updates d->aptDatPaths using the new method d->getDatFilesPaths(), and d->metarDatPath, d->navDatPath, d->fixDatPath, d->poiDatPath, etc. as usual. This method will be useful for instance in the built-in launcher after updating scenery paths and before calling NavDataCache::isRebuildRequired(). - NavDataCache::NavDataCache(): use NavDataCache::updateListsOfDatFiles() to initialize d->aptDatPaths, d->metarDatPath, d->navDatPath, d->fixDatPath, d->poiDatPath, etc. - NavDataCache::isRebuildRequired(): use NavDataCachePrivate::areDatFilesModified() instead of just checking $FG_ROOT/Airports/apt.dat.gz. - NavDataCache::doRebuild(): load all apt.dat files listed in d->aptDatPaths, instead of only $FG_ROOT/Airports/apt.dat.gz. Write their ordered list and timestamps in the NavCache. src/Navaids/NavDataCache.hxx: - declare the new method NavDataCache::updateListsOfDatFiles(). - NavDataCache::DatFileType: new enum with values DATFILETYPE_APT, DATFILETYPE_METAR, DATFILETYPE_AWY, DATFILETYPE_NAV, DATFILETYPE_FIX, DATFILETYPE_POI, DATFILETYPE_CARRIER and DATFILETYPE_TACAN_FREQ. Maybe some of the corresponding files won't have to be moved to scenery paths, but simply listing them in the enum doesn't change how they are dealt with. Those for which per-scenery-path locations doesn't make sense can just be removed from the enum. - NavDataCache::datTypeStr: new static string_list giving an std::string such as 'apt' for each value of the NavDataCache::DatFileType enum. - NavDataCache::defaultDatFile: new static string_list giving a path (relative to $FG_ROOT) to the historical/default file for each value of the NavDataCache::DatFileType enum. src/Airports/apt_loader.cxx and src/Airports/apt_loader.hxx: - always include a path to the apt.dat file being processed in log messages, since they can now apply to many files; - be clearer about code 99: it should normally be at the end of apt.dat files, but technically, it is not an EOF; - use the expression "row code" consistently with the apt.dat format spec (for now: only in places where there is another change to do). src/GUI/QtLauncher.cxx and src/GUI/QtLauncher_private.hxx: - turn QtLauncher::setSceneryPaths() into a static method and call it in runLauncherDialog() before instantiating NavDataCache, so that NavDataCache::updateListsOfDatFiles() (called from NavDataCache's constructor) can see all configured scenery paths. |
||
---|---|---|
3rdparty | ||
CMakeModules | ||
docs-mini | ||
examples/netfdm | ||
icons | ||
man | ||
package | ||
scripts | ||
src | ||
tests | ||
utils | ||
.gitignore | ||
AUTHORS | ||
ChangeLog | ||
CMakeLists.txt | ||
COPYING | ||
INSTALL | ||
NEWS | ||
README | ||
README.cmake | ||
README.msvc | ||
README.OpenAL | ||
README.OSG | ||
README.plib | ||
README.SimGear | ||
Thanks | ||
version |
Welcome to the FlightGear Flight Simulator project. =================================================== The primary web page for this project is: http://www.flightgear.org For basic installation instructions see the "INSTALL" file. Before you can run FlightGear you will also need to download and install the "base" package which is a collection of textures, sounds, sample scenery, and other data files needed by the sim. For additional install help for specific platforms please browse the "docs-mini/" subdirectory. More complete documentation is available from our web page as a separate distribution. Please take a look at the "Thanks" file for a list of people who have contributed to this project. If you have contributed something but don't find your name in this file. Please send a polite reminder to http://www.flightgear.org/~curt For a summary of changes/additions by version see the "NEWS" file. This project is GPL'd. For complete details on our licensing please see the "COPYING" file. For information on available mailing lists, mailing list archives, and other available source code and documenation, please visit our web site. FlightGear is a product of the collaboration of large international group of volunteers. FlightGear is a work in progress. FlightGear comes with no warrantee. We hope you enjoy FlightGear and/or find it of some value!