mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into equip-via-thumb
This commit is contained in:
commit
7a509447cf
5 changed files with 14 additions and 10 deletions
|
@ -66,7 +66,7 @@ void GeometryMappingResource::downloadFinished(const QByteArray& data) {
|
||||||
GeometryExtra extra{ mapping, textureBaseUrl };
|
GeometryExtra extra{ mapping, textureBaseUrl };
|
||||||
|
|
||||||
// Get the raw GeometryResource, not the wrapped NetworkGeometry
|
// Get the raw GeometryResource, not the wrapped NetworkGeometry
|
||||||
_geometryResource = modelCache->getResource(url, QUrl(), true, &extra).staticCast<GeometryResource>();
|
_geometryResource = modelCache->getResource(url, QUrl(), false, &extra).staticCast<GeometryResource>();
|
||||||
|
|
||||||
if (_geometryResource->isLoaded()) {
|
if (_geometryResource->isLoaded()) {
|
||||||
onGeometryMappingLoaded(!_geometryResource->getURL().isEmpty());
|
onGeometryMappingLoaded(!_geometryResource->getURL().isEmpty());
|
||||||
|
@ -226,7 +226,7 @@ QSharedPointer<Resource> ModelCache::createResource(const QUrl& url, const QShar
|
||||||
std::shared_ptr<NetworkGeometry> ModelCache::getGeometry(const QUrl& url, const QVariantHash& mapping, const QUrl& textureBaseUrl) {
|
std::shared_ptr<NetworkGeometry> ModelCache::getGeometry(const QUrl& url, const QVariantHash& mapping, const QUrl& textureBaseUrl) {
|
||||||
GeometryExtra geometryExtra = { mapping, textureBaseUrl };
|
GeometryExtra geometryExtra = { mapping, textureBaseUrl };
|
||||||
GeometryResource::Pointer resource = getResource(url, QUrl(), true, &geometryExtra).staticCast<GeometryResource>();
|
GeometryResource::Pointer resource = getResource(url, QUrl(), true, &geometryExtra).staticCast<GeometryResource>();
|
||||||
return std::make_shared<NetworkGeometry>(resource);
|
return resource ? std::make_shared<NetworkGeometry>(resource) : NetworkGeometry::Pointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QVariantMap Geometry::getTextures() const {
|
const QVariantMap Geometry::getTextures() const {
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <NetworkAccessManager.h>
|
#include <NetworkAccessManager.h>
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
#include "ResourceManager.h"
|
#include "ResourceManager.h"
|
||||||
|
#include "ScriptEngines.h"
|
||||||
|
|
||||||
BatchLoader::BatchLoader(const QList<QUrl>& urls)
|
BatchLoader::BatchLoader(const QList<QUrl>& urls)
|
||||||
: QObject(),
|
: QObject(),
|
||||||
|
@ -34,8 +35,9 @@ void BatchLoader::start() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_started = true;
|
_started = true;
|
||||||
|
|
||||||
for (const auto& url : _urls) {
|
for (const auto& rawURL : _urls) {
|
||||||
|
QUrl url = expandScriptUrl(normalizeScriptURL(rawURL));
|
||||||
auto request = ResourceManager::createResourceRequest(this, url);
|
auto request = ResourceManager::createResourceRequest(this, url);
|
||||||
if (!request) {
|
if (!request) {
|
||||||
_data.insert(url, QString());
|
_data.insert(url, QString());
|
||||||
|
|
|
@ -220,11 +220,10 @@ void ScriptEngine::loadURL(const QUrl& scriptURL, bool reload) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_fileNameString = scriptURL.toString();
|
QUrl url = expandScriptUrl(normalizeScriptURL(scriptURL));
|
||||||
|
_fileNameString = url.toString();
|
||||||
_isReloading = reload;
|
_isReloading = reload;
|
||||||
|
|
||||||
QUrl url(scriptURL);
|
|
||||||
|
|
||||||
bool isPending;
|
bool isPending;
|
||||||
auto scriptCache = DependencyManager::get<ScriptCache>();
|
auto scriptCache = DependencyManager::get<ScriptCache>();
|
||||||
scriptCache->getScript(url, this, isPending, reload);
|
scriptCache->getScript(url, this, isPending, reload);
|
||||||
|
@ -848,7 +847,7 @@ QUrl ScriptEngine::resolvePath(const QString& include) const {
|
||||||
QUrl url(include);
|
QUrl url(include);
|
||||||
// first lets check to see if it's already a full URL
|
// first lets check to see if it's already a full URL
|
||||||
if (!url.scheme().isEmpty()) {
|
if (!url.scheme().isEmpty()) {
|
||||||
return url;
|
return expandScriptUrl(normalizeScriptURL(url));
|
||||||
}
|
}
|
||||||
|
|
||||||
// we apparently weren't a fully qualified url, so, let's assume we're relative
|
// we apparently weren't a fully qualified url, so, let's assume we're relative
|
||||||
|
@ -865,7 +864,7 @@ QUrl ScriptEngine::resolvePath(const QString& include) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// at this point we should have a legitimate fully qualified URL for our parent
|
// at this point we should have a legitimate fully qualified URL for our parent
|
||||||
url = parentURL.resolved(url);
|
url = expandScriptUrl(normalizeScriptURL(parentURL.resolved(url)));
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -429,7 +429,7 @@ ScriptEngine* ScriptEngines::loadScript(const QUrl& scriptFilename, bool isUserL
|
||||||
connect(scriptEngine, &ScriptEngine::errorLoadingScript, this, &ScriptEngines::onScriptEngineError);
|
connect(scriptEngine, &ScriptEngine::errorLoadingScript, this, &ScriptEngines::onScriptEngineError);
|
||||||
|
|
||||||
// get the script engine object to load the script at the designated script URL
|
// get the script engine object to load the script at the designated script URL
|
||||||
scriptEngine->loadURL(QUrl(expandScriptUrl(scriptUrl.toString())), reload);
|
scriptEngine->loadURL(scriptUrl, reload);
|
||||||
}
|
}
|
||||||
|
|
||||||
return scriptEngine;
|
return scriptEngine;
|
||||||
|
|
|
@ -309,6 +309,9 @@ void ScriptsModel::rebuildTree() {
|
||||||
QString hash;
|
QString hash;
|
||||||
QStringList pathList = script->getLocalPath().split(tr("/"));
|
QStringList pathList = script->getLocalPath().split(tr("/"));
|
||||||
pathList.removeLast();
|
pathList.removeLast();
|
||||||
|
if (pathList.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
QStringList::const_iterator pathIterator;
|
QStringList::const_iterator pathIterator;
|
||||||
for (pathIterator = pathList.constBegin(); pathIterator != pathList.constEnd(); ++pathIterator) {
|
for (pathIterator = pathList.constBegin(); pathIterator != pathList.constEnd(); ++pathIterator) {
|
||||||
hash.append(*pathIterator + "/");
|
hash.append(*pathIterator + "/");
|
||||||
|
|
Loading…
Reference in a new issue