Added the stock shader names to the material editor, so it will now be able to select them when loading a shape.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 11 years ago
parent 1d71a540ba
commit a9a1d17c4f

@ -21,6 +21,19 @@
namespace MaterialEditor namespace MaterialEditor
{ {
const char *stockShaders[ 10 ] =
{
"Normal",
"Bump",
"UserColor",
"LightMap",
"Specular",
"Caustics",
"PerPixelLighting",
"PerPixelLightingNoSpec",
"Cloud",
"Water"
};
MaterialWidget::MaterialWidget( QWidget *parent ) : MaterialWidget::MaterialWidget( QWidget *parent ) :
QWidget( parent ) QWidget( parent )
@ -29,6 +42,7 @@ namespace MaterialEditor
shaderEditorWidget = new ShaderEditorWidget(); shaderEditorWidget = new ShaderEditorWidget();
matPropWidget = new MatPropWidget(); matPropWidget = new MatPropWidget();
setNel3DIface( NULL ); setNel3DIface( NULL );
addStockShaders();
setupConnections(); setupConnections();
} }
@ -179,6 +193,13 @@ namespace MaterialEditor
pass = passCB->currentText(); pass = passCB->currentText();
} }
void MaterialWidget::addStockShaders()
{
for( int i = 0; i < 10; i++ )
shaderCB->addItem( QString( stockShaders[ i ] ) );
}
void MaterialWidget::setupConnections() void MaterialWidget::setupConnections()
{ {
connect( passButton, SIGNAL( clicked( bool ) ), this, SLOT( onPassEditClicked() ) ); connect( passButton, SIGNAL( clicked( bool ) ), this, SLOT( onPassEditClicked() ) );

@ -57,6 +57,7 @@ namespace MaterialEditor
void subMatChanged( int i ); void subMatChanged( int i );
private: private:
void addStockShaders();
void setupConnections(); void setupConnections();
ShaderEditorWidget *shaderEditorWidget; ShaderEditorWidget *shaderEditorWidget;
MatPropWidget *matPropWidget; MatPropWidget *matPropWidget;

Loading…
Cancel
Save