Commit 00526909 authored by Dirk Wilden's avatar Dirk Wilden

added hidden flag for textures which belong to a multitexture

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5728 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d8799a1c
...@@ -157,6 +157,9 @@ void TextureControlPlugin::slotMultiTextureAdded( QString _textureGroup , QStrin ...@@ -157,6 +157,9 @@ void TextureControlPlugin::slotMultiTextureAdded( QString _textureGroup , QStrin
_textureId = -1; _textureId = -1;
_textureId = texData->texture(_name).id(); _textureId = texData->texture(_name).id();
//hide the texture (its accessible through the multiTexture)
texData->texture(_name).hidden( true );
QImage textureImage; QImage textureImage;
getImage(_filename,textureImage); getImage(_filename,textureImage);
texData->texture(_name).textureImage = textureImage; texData->texture(_name).textureImage = textureImage;
...@@ -1005,6 +1008,9 @@ void TextureControlPlugin::slotUpdateContextMenu( int _objectId ) { ...@@ -1005,6 +1008,9 @@ void TextureControlPlugin::slotUpdateContextMenu( int _objectId ) {
for ( uint i = 0 ; i < texData->textures().size() ; ++i ) { for ( uint i = 0 ; i < texData->textures().size() ; ++i ) {
if ( texData->textures()[i].hidden() )
continue;
action = actionGroup->addAction( texData->textures()[i].name() ); action = actionGroup->addAction( texData->textures()[i].name() );
action->setCheckable(true); action->setCheckable(true);
......
...@@ -150,6 +150,7 @@ int TextureData::addTexture(QString _textureName, QString _filename, uint _dimen ...@@ -150,6 +150,7 @@ int TextureData::addTexture(QString _textureName, QString _filename, uint _dimen
tex.enable(); tex.enable();
tex.dirty = false; tex.dirty = false;
tex.type = VERTEXBASED; tex.type = VERTEXBASED;
tex.hidden(false);
// tex.parameters = TexParameters; // tex.parameters = TexParameters;
textures_.push_back( tex ); textures_.push_back( tex );
...@@ -189,6 +190,7 @@ bool TextureData::addMultiTexture( QString _textureName ) { ...@@ -189,6 +190,7 @@ bool TextureData::addMultiTexture( QString _textureName ) {
tex.filename("MultiTexture"); tex.filename("MultiTexture");
tex.dirty = false; tex.dirty = false;
tex.type = MULTITEXTURE; tex.type = MULTITEXTURE;
tex.hidden(false);
textures_.push_back( tex ); textures_.push_back( tex );
......
...@@ -97,6 +97,8 @@ class Texture { ...@@ -97,6 +97,8 @@ class Texture {
void enabled( bool _enabled ) { enabled_ = _enabled; }; void enabled( bool _enabled ) { enabled_ = _enabled; };
bool enabled() { return enabled_; }; bool enabled() { return enabled_; };
void hidden( bool _hidden ) { hidden_ = _hidden; };
bool hidden() { return hidden_; };
void enable(){ enabled_ = true; }; void enable(){ enabled_ = true; };
void disable(){ enabled_ = false; }; void disable(){ enabled_ = false; };
...@@ -133,6 +135,8 @@ class Texture { ...@@ -133,6 +135,8 @@ class Texture {
// Status // Status
bool enabled_; bool enabled_;
bool hidden_;
}; };
class TextureData : public PerObjectData class TextureData : public PerObjectData
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment