aboutsummaryrefslogtreecommitdiff
path: root/src/aoapplication.cpp
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2021-06-05 14:58:40 -0500
committeroldmud0 <oldmud0@users.noreply.github.com>2021-06-05 14:58:40 -0500
commitd27501313cae78b838c1e738ebfaeae4740a23b4 (patch)
tree207740d8a42b84a851303b8f2583c523f1624caa /src/aoapplication.cpp
parenta023657348051cbc7c8ea29e3b37f3e2e3fd16d8 (diff)
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.
Diffstat (limited to 'src/aoapplication.cpp')
-rw-r--r--src/aoapplication.cpp1
1 files changed, 1 insertions, 0 deletions
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()