From d27501313cae78b838c1e738ebfaeae4740a23b4 Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Sat, 5 Jun 2021 14:58:40 -0500 Subject: Finish mounting feature To pull this one off, a new class called VPath was created that denotes "virtual" paths that can exist anywhere among the list of mount points. It is functionally identical to QString, except that implicit conversion between QString and VPath is not allowed. This makes it easy to spot errors in path resolution at compile time, since get_real_path must be called to resolve a VPath into an absolute path that can be passed into a Qt function as a QString. Other functions, such as the get_*_suffix functions, also return an absolute path QString for convenience. As for the rest of the functions that return a VPath, you will need to call get_real_path yourself. Finally, a path resolution cache was added to try to avoid blowing up what is already a massive lookup cost for assets. The cache is invalidated when the mount path list is changed. Currently, this cache isn't bounded. Might need to write an LRU cache if issues arise. --- src/aoapplication.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/aoapplication.cpp') diff --git a/src/aoapplication.cpp b/src/aoapplication.cpp index dd75b0a7..355db037 100644 --- a/src/aoapplication.cpp +++ b/src/aoapplication.cpp @@ -19,6 +19,7 @@ AOApplication::AOApplication(int &argc, char **argv) : QApplication(argc, argv) QObject::connect(net_manager, SIGNAL(ms_connect_finished(bool, bool)), SLOT(ms_connect_finished(bool, bool))); // qApp->setStyleSheet("QFrame {background-color:transparent;} QAbstractItemView {background-color: transparent; color: black;}; QLineEdit {background-color:transparent;}"); + asset_lookup_cache.reserve(2048); } AOApplication::~AOApplication() -- cgit