Disable change events of mipLevel and sliceFace when switching textures

Otherwise, bad texture queries may occur, which refer to mip and slice
values of the previous texture.
This commit is contained in:
Janos Pantos
2017-11-02 18:20:29 +01:00
committed by Baldur Karlsson
parent ad026925a6
commit 1fbcab67a0
+8
View File
@@ -1127,6 +1127,10 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
UI_UpdateStatusText();
// block signals for mipLevel and sliceFace comboboxes while editing them
ui->mipLevel->blockSignals(true);
ui->sliceFace->blockSignals(true);
ui->mipLevel->clear();
m_TexDisplay.mip = 0;
@@ -1239,6 +1243,10 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
m_PrevFirstArraySlice = firstArraySlice;
}
// enable signals for mipLevel and sliceFace
ui->mipLevel->blockSignals(false);
ui->sliceFace->blockSignals(false);
// because slice and mip are specially set above, we restore any per-tex settings to apply
// even if we don't switch to a new texture.
// Note that if the slice or mip was changed because that slice or mip is the selected one