mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 01:43:27 +02:00
Merge pull request #15216 from howard-stearns/allow-base-url-to-be-specified-in-fst
allow baseURL to be specified in fst
This commit is contained in:
commit
44f897fbd2
1 changed files with 7 additions and 5 deletions
|
@ -120,19 +120,21 @@ void GeometryMappingResource::downloadFinished(const QByteArray& data) {
|
||||||
if (filename.isNull()) {
|
if (filename.isNull()) {
|
||||||
finishedLoading(false);
|
finishedLoading(false);
|
||||||
} else {
|
} else {
|
||||||
QUrl url = _url.resolved(filename);
|
const QString baseURL = _mapping.value("baseURL").toString();
|
||||||
|
const QUrl base = _effectiveBaseURL.resolved(baseURL);
|
||||||
|
QUrl url = base.resolved(filename);
|
||||||
|
|
||||||
QString texdir = _mapping.value(TEXDIR_FIELD).toString();
|
QString texdir = _mapping.value(TEXDIR_FIELD).toString();
|
||||||
if (!texdir.isNull()) {
|
if (!texdir.isNull()) {
|
||||||
if (!texdir.endsWith('/')) {
|
if (!texdir.endsWith('/')) {
|
||||||
texdir += '/';
|
texdir += '/';
|
||||||
}
|
}
|
||||||
_textureBaseUrl = resolveTextureBaseUrl(url, _url.resolved(texdir));
|
_textureBaseUrl = resolveTextureBaseUrl(url, base.resolved(texdir));
|
||||||
} else {
|
} else {
|
||||||
_textureBaseUrl = url.resolved(QUrl("."));
|
_textureBaseUrl = url.resolved(QUrl("."));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto scripts = FSTReader::getScripts(_url, _mapping);
|
auto scripts = FSTReader::getScripts(base, _mapping);
|
||||||
if (scripts.size() > 0) {
|
if (scripts.size() > 0) {
|
||||||
_mapping.remove(SCRIPT_FIELD);
|
_mapping.remove(SCRIPT_FIELD);
|
||||||
for (auto &scriptPath : scripts) {
|
for (auto &scriptPath : scripts) {
|
||||||
|
@ -145,7 +147,7 @@ void GeometryMappingResource::downloadFinished(const QByteArray& data) {
|
||||||
if (animGraphVariant.isValid()) {
|
if (animGraphVariant.isValid()) {
|
||||||
QUrl fstUrl(animGraphVariant.toString());
|
QUrl fstUrl(animGraphVariant.toString());
|
||||||
if (fstUrl.isValid()) {
|
if (fstUrl.isValid()) {
|
||||||
_animGraphOverrideUrl = _url.resolved(fstUrl);
|
_animGraphOverrideUrl = base.resolved(fstUrl);
|
||||||
} else {
|
} else {
|
||||||
_animGraphOverrideUrl = QUrl();
|
_animGraphOverrideUrl = QUrl();
|
||||||
}
|
}
|
||||||
|
@ -154,7 +156,7 @@ void GeometryMappingResource::downloadFinished(const QByteArray& data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto modelCache = DependencyManager::get<ModelCache>();
|
auto modelCache = DependencyManager::get<ModelCache>();
|
||||||
GeometryExtra extra { GeometryMappingPair(_url, _mapping), _textureBaseUrl, false };
|
GeometryExtra extra { GeometryMappingPair(base, _mapping), _textureBaseUrl, false };
|
||||||
|
|
||||||
// Get the raw GeometryResource
|
// Get the raw GeometryResource
|
||||||
_geometryResource = modelCache->getResource(url, QUrl(), &extra, std::hash<GeometryExtra>()(extra)).staticCast<GeometryResource>();
|
_geometryResource = modelCache->getResource(url, QUrl(), &extra, std::hash<GeometryExtra>()(extra)).staticCast<GeometryResource>();
|
||||||
|
|
Loading…
Reference in a new issue