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
11771177
11781178 if (!_materials.isEmpty()) {
11791179 _networkTextures.resize(_materials.size());
1180+ TextureCache* textureCache = DependencyManager::get<TextureCache>();
11801181 for (int i = 0; i < _materials.size(); i++) {
11811182 const SharedObjectPointer material = _materials.at(i);
11821183 if (material) {
1183− _networkTextures[i] = DependencyManager::get<TextureCache>()->getTexture(
1184+ _networkTextures[i] = textureCache->getTexture(
11841185 static_cast<MaterialObject*>(material.data())->getDiffuse(), SPLAT_TEXTURE);
11851186 }
11861187 }
@@ -2231,10 +2232,11 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g · 1044 unmodified lines
22312232
22322233 const QVector<SharedObjectPointer>& materials = node->getMaterial()->getMaterials();
22332234 _networkTextures.resize(materials.size());
2235+ TextureCache* textureCache = DependencyManager::get<TextureCache>();
22342236 for (int i = 0; i < materials.size(); i++) {
22352237 const SharedObjectPointer& material = materials.at(i);
22362238 if (material) {
2237− _networkTextures[i] = DependencyManager::get<TextureCache>()->getTexture(
2239+ _networkTextures[i] = textureCache->getTexture(
22382240 static_cast<MaterialObject*>(material.data())->getDiffuse(), SPLAT_TEXTURE);
22392241 }
22402242 }

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