Showing the changes to interface/src/renderer/GeometryCache.cpp (1 of 3 files). Show all
Unified · Split
| @@ -613,6 +613,24 @@ void NetworkGeometry::clearLoadPriority(const QPointer<QObject>& owner) { · 612 unmodified lines | |||
| 613 | } | 613 | } |
| 614 | } | 614 | } |
| 615 | 615 | ||
| 616 | void NetworkGeometry::setTextureWithNameToURL(const QString& name, const QUrl& url) { | ||
| 617 | for (int i = 0; i < _meshes.size(); i++) { | ||
| 618 | NetworkMesh& mesh = _meshes[i]; | ||
| 619 | for (int j = 0; j < mesh.parts.size(); j++) { | ||
| 620 | NetworkMeshPart& part = mesh.parts[j]; | ||
| 621 | |||
| 622 | QSharedPointer<NetworkTexture> matchingTexture = QSharedPointer<NetworkTexture>(); | ||
| 623 | if (part.diffuseTexture->getName() == name) { | ||
| 624 | part.diffuseTexture = | ||
| 625 | Application::getInstance()->getTextureCache()->getTexture(url, DEFAULT_TEXTURE, | ||
| 626 | _geometry.meshes[i].isEye, QByteArray()); | ||
| 627 | part.diffuseTexture->setName(name); | ||
| 628 | part.diffuseTexture->setLoadPriorities(_loadPriorities); | ||
| 629 | } | ||
| 630 | } | ||
| 631 | } | ||
| 632 | } | ||
| 633 | |||
| 616 | /// Reads geometry in a worker thread. | 634 | /// Reads geometry in a worker thread. |
| 617 | class GeometryReader : public QRunnable { | 635 | class GeometryReader : public QRunnable { |
| 618 | public: | 636 | public: |