Add option to make y-flipping a per-texture state instead of global

This commit is contained in:
baldurk
2019-02-04 14:42:56 +00:00
parent 2853029847
commit f20e871510
7 changed files with 77 additions and 1 deletions
+12
View File
@@ -1109,6 +1109,9 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
m_TextureSettings[m_TexDisplay.resourceId].b = ui->channelBlue->isChecked();
m_TextureSettings[m_TexDisplay.resourceId].a = ui->channelAlpha->isChecked();
// save state regardless, we just don't apply it without the setting
m_TextureSettings[m_TexDisplay.resourceId].flip_y = ui->flip_y->isChecked();
m_TextureSettings[m_TexDisplay.resourceId].displayType = qMax(0, ui->channels->currentIndex());
m_TextureSettings[m_TexDisplay.resourceId].customShader = ui->customShader->currentText();
@@ -1317,6 +1320,9 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
if(useslicesettings)
ui->sliceFace->setCurrentIndex(m_TextureSettings[tex.resourceId].slice);
if(m_Ctx.Config().TextureViewer_PerTexYFlip)
ui->flip_y->setChecked(m_TextureSettings[tex.resourceId].flip_y);
}
// handling for if we've switched to a new texture
@@ -1337,6 +1343,9 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
ui->depthDisplay->setChecked(m_TextureSettings[tex.resourceId].depth);
ui->stencilDisplay->setChecked(m_TextureSettings[tex.resourceId].stencil);
if(m_Ctx.Config().TextureViewer_PerTexYFlip)
ui->flip_y->setChecked(m_TextureSettings[tex.resourceId].flip_y);
m_NoRangePaint = true;
ui->rangeHistogram->setRange(m_TextureSettings[m_TexDisplay.resourceId].minrange,
m_TextureSettings[m_TexDisplay.resourceId].maxrange);
@@ -1357,6 +1366,9 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
ui->depthDisplay->setChecked(true);
ui->stencilDisplay->setChecked(false);
if(m_Ctx.Config().TextureViewer_PerTexYFlip)
ui->flip_y->setChecked(false);
m_NoRangePaint = true;
UI_SetHistogramRange(texptr, m_TexDisplay.typeHint);
m_NoRangePaint = false;