History

add gettable feature which lists texture names

ZappoMan committed 12 years ago

Commit c48d79a1 parent 786c08f7 files · +46 −0Browse files

Showing the changes to interface/src/renderer/GeometryCache.cpp (1 of 7 files). Show all

Unified · Split

interface/src/renderer/GeometryCache.cpp+23−0
@@ -734,6 +734,29 @@ void NetworkGeometry::setTextureWithNameToURL(const QString& name, const QUrl& u · 733 unmodified lines
734 }734 }
735}735}
736 736
737QStringList NetworkGeometry::getTextureNames() const {
738 QStringList result;
739 for (int i = 0; i < _meshes.size(); i++) {
740 const NetworkMesh& mesh = _meshes[i];
741 for (int j = 0; j < mesh.parts.size(); j++) {
742 const NetworkMeshPart& part = mesh.parts[j];
743
744 if (!part.diffuseTextureName.isEmpty()) {
745 result << part.diffuseTextureName;
746 }
747
748 if (!part.normalTextureName.isEmpty()) {
749 result << part.normalTextureName;
750 }
751
752 if (!part.specularTextureName.isEmpty()) {
753 result << part.specularTextureName;
754 }
755 }
756 }
757 return result;
758}
759
737/// Reads geometry in a worker thread.760/// Reads geometry in a worker thread.
738class GeometryReader : public QRunnable {761class GeometryReader : public QRunnable {
739public:762public: