History

fix hang on preference dialog box

ZappoMan committed 13 years ago

Commit 865bb751 parent 617b9051 file · +12 −3Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 1 file). Show all

Unified · Split

interface/src/VoxelSystem.cpp+12−3
@@ -150,6 +150,9 @@ VoxelSystem::~VoxelSystem() { · 149 unmodified lines
150150 }
151151
152152 void VoxelSystem::setMaxVoxels(int maxVoxels) {
153+ if (maxVoxels == _maxVoxels) {
154+ return;
155+ }
153156 pthread_mutex_lock(&_bufferWriteLock);
154157 bool wasInitialized = _initialized;
155158 if (wasInitialized) {
@@ -161,13 +164,16 @@ void VoxelSystem::setMaxVoxels(int maxVoxels) { · 5 unmodified lines
161164 init();
162165 }
163166 pthread_mutex_unlock(&_bufferWriteLock);
164−
165167 if (wasInitialized) {
166168 forceRedrawEntireTree();
167169 }
168170 }
169171
170172 void VoxelSystem::setUseVoxelShader(bool useVoxelShader) {
173+ if (_useVoxelShader == useVoxelShader) {
174+ return;
175+ }
176+
171177 pthread_mutex_lock(&_bufferWriteLock);
172178 bool wasInitialized = _initialized;
173179 if (wasInitialized) {
@@ -896,6 +902,11 @@ void VoxelSystem::updateVBOSegment(glBufferIndex segmentStart, glBufferIndex seg · 722 unmodified lines
896902 void VoxelSystem::render(bool texture) {
897903 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), "render()");
898904
905+ // If we got here and we're not initialized then bail!
906+ if (!_initialized) {
907+ return;
908+ }
909+
899910 // get the lock so that the update thread won't change anything
900911 pthread_mutex_lock(&_bufferWriteLock);
901912
@@ -1034,8 +1045,6 @@ void VoxelSystem::clearAllNodesBufferIndex() { · 132 unmodified lines
10341045 _nodeCount = 0;
10351046 _tree->recurseTreeWithOperation(clearAllNodesBufferIndexOperation);
10361047 qDebug("clearing buffer index of %d nodes\n", _nodeCount);
1037− _tree->setDirtyBit();
1038− setupNewVoxelsForDrawing();
10391048 }
10401049
10411050 bool VoxelSystem::forceRedrawEntireTreeOperation(VoxelNode* node, void* extraData) {

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