History

reduce calls to DependencyManager::get<> where possible

ZappoMan committed 11 years ago

Commit 3bc13211 parent 90c11325 files · +38 −28Browse files

Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 5 files). Show all

Unified · Split

interface/src/MetavoxelSystem.cpp+4−2
@@ -1177,10 +1177,11 @@ void VoxelBuffer::render(bool cursor) { · 1176 unmodified lines
1177 1177
1178 if (!_materials.isEmpty()) {1178 if (!_materials.isEmpty()) {
1179 _networkTextures.resize(_materials.size());1179 _networkTextures.resize(_materials.size());
1180 TextureCache* textureCache = DependencyManager::get<TextureCache>();
1180 for (int i = 0; i < _materials.size(); i++) {1181 for (int i = 0; i < _materials.size(); i++) {
1181 const SharedObjectPointer material = _materials.at(i);1182 const SharedObjectPointer material = _materials.at(i);
1182 if (material) {1183 if (material) {
1183 _networkTextures[i] = DependencyManager::get<TextureCache>()->getTexture(1184 _networkTextures[i] = textureCache->getTexture(
1184 static_cast<MaterialObject*>(material.data())->getDiffuse(), SPLAT_TEXTURE);1185 static_cast<MaterialObject*>(material.data())->getDiffuse(), SPLAT_TEXTURE);
1185 }1186 }
1186 }1187 }
@@ -2231,10 +2232,11 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g · 1044 unmodified lines
2231 2232
2232 const QVector<SharedObjectPointer>& materials = node->getMaterial()->getMaterials();2233 const QVector<SharedObjectPointer>& materials = node->getMaterial()->getMaterials();
2233 _networkTextures.resize(materials.size());2234 _networkTextures.resize(materials.size());
2235 TextureCache* textureCache = DependencyManager::get<TextureCache>();
2234 for (int i = 0; i < materials.size(); i++) {2236 for (int i = 0; i < materials.size(); i++) {
2235 const SharedObjectPointer& material = materials.at(i);2237 const SharedObjectPointer& material = materials.at(i);
2236 if (material) {2238 if (material) {
2237 _networkTextures[i] = DependencyManager::get<TextureCache>()->getTexture(2239 _networkTextures[i] = textureCache->getTexture(
2238 static_cast<MaterialObject*>(material.data())->getDiffuse(), SPLAT_TEXTURE);2240 static_cast<MaterialObject*>(material.data())->getDiffuse(), SPLAT_TEXTURE);
2239 }2241 }
2240 }2242 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t