Allow changing pass textures in the model editor
This commit is contained in:
parent
4f51451149
commit
1e00c60516
|
@ -87,7 +87,8 @@ void CModelEditorViewport::Paint()
|
|||
CGraphics::UpdateMVPBlock();
|
||||
|
||||
mpActiveMaterial->SetCurrent(eEnableUVScroll | eEnableOccluders);
|
||||
CDrawUtil::DrawSquare();
|
||||
float Aspect = (float) width() / (float) height();
|
||||
CDrawUtil::DrawSquare(CVector2f(0,1), CVector2f(1 * Aspect, 1), CVector2f(1 * Aspect, 0), CVector2f(0,0));
|
||||
}
|
||||
|
||||
mpRenderer->EndFrame();
|
||||
|
|
|
@ -119,6 +119,7 @@ CModelEditorWindow::CModelEditorWindow(QWidget *parent) :
|
|||
connect(ui->TevKAlphaSelComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateMaterial(int)));
|
||||
connect(ui->TevRasSelComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateMaterial(int)));
|
||||
connect(ui->TexCoordSrcComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateMaterial(int)));
|
||||
connect(ui->PassTextureResSelector, SIGNAL(ResourceChanged(QString)), this, SLOT(UpdateMaterial(QString)));
|
||||
connect(ui->TevColor1ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateMaterial(int)));
|
||||
connect(ui->TevColor2ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateMaterial(int)));
|
||||
connect(ui->TevColor3ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateMaterial(int)));
|
||||
|
@ -562,6 +563,27 @@ void CModelEditorWindow::UpdateMaterial(QColor Color)
|
|||
}
|
||||
}
|
||||
|
||||
void CModelEditorWindow::UpdateMaterial(QString Value)
|
||||
{
|
||||
// This function takes input from WResourceSelectors
|
||||
if (!mpCurrentMat) return;
|
||||
if (mIgnoreSignals) return;
|
||||
|
||||
EModelEditorWidget Widget = (EModelEditorWidget) sender()->property("ModelEditorWidgetType").toInt();
|
||||
CTexture *pTex = (CTexture*) gResCache.GetResource(TO_TSTRING(Value));
|
||||
if (pTex->Type() != eTexture) pTex = nullptr;
|
||||
|
||||
switch (Widget)
|
||||
{
|
||||
case ePassTextureResSelector:
|
||||
mpCurrentPass->SetTexture(pTex);
|
||||
break;
|
||||
|
||||
case eIndTextureResSelector:
|
||||
mpCurrentMat->SetIndTexture(pTex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
void CModelEditorWindow::UpdateUI(int Value)
|
||||
{
|
||||
EModelEditorWidget Widget = (EModelEditorWidget) sender()->property("ModelEditorWidgetType").toInt();
|
||||
|
|
|
@ -47,6 +47,7 @@ public slots:
|
|||
void UpdateMaterial(double Value);
|
||||
void UpdateMaterial(bool Value);
|
||||
void UpdateMaterial(QColor eColorProperty);
|
||||
void UpdateMaterial(QString Value);
|
||||
void UpdateUI(int Value);
|
||||
void UpdateAnimParamUI(int Mode);
|
||||
|
||||
|
|
Loading…
Reference in New Issue