Commit d819bbc4 authored by Dirk Wilden's avatar Dirk Wilden
Browse files

additional changes to the textureInterface so that multiTextures can be stored to disk

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8928 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 99cf943e
...@@ -199,7 +199,27 @@ class TextureInterface { ...@@ -199,7 +199,27 @@ class TextureInterface {
* @param _image reference to the image for the texture * @param _image reference to the image for the texture
*/ */
virtual void textureGetImage( QString /*_textureName*/ , QImage& /*_image*/ ) {}; virtual void textureGetImage( QString /*_textureName*/ , QImage& /*_image*/ ) {};
/** \brief Get the texture index of a given texture
*
* @param _textureName The name of the texture which should be addressed
* @param _id Id of the object where the texture is defined on
* @param _index the index of the texture (used for multiTexturing)
*/
virtual void textureIndex( QString /*_textureName*/, int /*_id*/, int& /*_index*/) {};
/** \brief get the name of the texture with given texture index
*
* When using multiTexturing you can retrieve the texture index of a face with 'mesh->texture_index'
* This function maps the texture index to the name of the actual texture that is used to texture
* the face.
*
* @param _id Id of the object where the texture should be fetched from
* @param _textureIndex texture index of the wanted texture
* @param _textureName this returns the name of the texture
*/
virtual void textureName( int /*_id*/, int /*_textureIndex*/, QString& /*_textureName*/ ) {};
/** \brief get the name of the texture which is currently enabled /** \brief get the name of the texture which is currently enabled
* *
* @param _id Id of the object where the current texture should be fetched from * @param _id Id of the object where the current texture should be fetched from
...@@ -346,6 +366,22 @@ class TextureInterface { ...@@ -346,6 +366,22 @@ class TextureInterface {
*/ */
virtual void slotTextureGetImage( QString /*_textureName*/ , QImage& /*_image*/ ) {}; virtual void slotTextureGetImage( QString /*_textureName*/ , QImage& /*_image*/ ) {};
/** \brief Get the texture index of a given texture
*
* @param _textureName The name of the texture which should be addressed
* @param _id Id of the object where the texture is defined on
* @param _index the index of the texture (used for multiTexturing)
*/
virtual void slotTextureIndex( QString /*_textureName*/, int /*_id*/, int& /*_index*/) {};
/** \brief get the name of the texture with given texture index
*
* @param _id Id of the object where the texture should be fetched from
* @param _textureIndex texture index of the wanted texture
* @param _textureName this returns the name of the texture
*/
virtual void slotTextureName( int /*_id*/, int /*_textureIndex*/, QString& /*_textureName*/ ) {};
/** \brief fetches the name of the texture which is currently enabled /** \brief fetches the name of the texture which is currently enabled
* *
* @param _id Id of the object where the current texture should be fetched from * @param _id Id of the object where the current texture should be fetched from
......
...@@ -225,7 +225,13 @@ signals: ...@@ -225,7 +225,13 @@ signals:
///fetch texture image ///fetch texture image
void textureGetImage( QString _textureName , QImage& _image , int _id ); void textureGetImage( QString _textureName , QImage& _image , int _id );
/// get the texture index
void textureIndex( QString _textureName, int _id, int& _index);
/// get the texture name
void textureName( int _id, int _textureIndex, QString& _textureName);
///get current texture ///get current texture
void getCurrentTexture( int _id, QString& _textureName ); void getCurrentTexture( int _id, QString& _textureName );
...@@ -341,6 +347,12 @@ signals: ...@@ -341,6 +347,12 @@ signals:
///Called by plugins if texture image should be fetched ///Called by plugins if texture image should be fetched
void slotTextureGetImage( QString _textureName , QImage& _image , int _id ); void slotTextureGetImage( QString _textureName , QImage& _image , int _id );
///Called by plugins if texture index should be fetched
void slotTextureIndex( QString _textureName, int _id, int& _index);
///Called by plugins if texture name should be fetched
void slotTextureName( int _id, int _textureIndex, QString& _textureName);
///Called by plugins if current texture should be retrieved ///Called by plugins if current texture should be retrieved
void slotGetCurrentTexture( int _id, QString& _textureName ); void slotGetCurrentTexture( int _id, QString& _textureName );
......
...@@ -306,6 +306,18 @@ void Core::slotTextureGetImage( QString _textureName , QImage& _image , int _id ...@@ -306,6 +306,18 @@ void Core::slotTextureGetImage( QString _textureName , QImage& _image , int _id
emit textureGetImage( _textureName , _image , _id ); emit textureGetImage( _textureName , _image , _id );
} }
/** Called by plugins if texture index should be fetched
*/
void Core::slotTextureIndex( QString _textureName, int _id, int& _index){
emit textureIndex( _textureName, _id, _index);
}
/** Called by plugins if texture name should be fetched
*/
void Core::slotTextureName( int _id, int _textureIndex, QString& _textureName){
emit textureName( _id, _textureIndex, _textureName);
}
/** Called by plugins if current texture name should be returned /** Called by plugins if current texture name should be returned
*/ */
void Core::slotGetCurrentTexture( int _id, QString& _textureName ){ void Core::slotGetCurrentTexture( int _id, QString& _textureName ){
......
...@@ -1015,6 +1015,22 @@ void Core::loadPlugin(QString filename, bool silent, QObject* _plugin){ ...@@ -1015,6 +1015,22 @@ void Core::loadPlugin(QString filename, bool silent, QObject* _plugin){
connect(this , SIGNAL(textureGetImage(QString,QImage&)), connect(this , SIGNAL(textureGetImage(QString,QImage&)),
plugin , SLOT(slotTextureGetImage(QString,QImage&)),Qt::DirectConnection); plugin , SLOT(slotTextureGetImage(QString,QImage&)),Qt::DirectConnection);
if ( checkSignal( plugin , "textureIndex(QString,int,int&)" ) )
connect(plugin , SIGNAL(textureIndex(QString,int,int&)),
this , SLOT(slotTextureIndex(QString,int,int&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotTextureIndex(QString,int,int&)" ) )
connect(this , SIGNAL(textureIndex(QString,int,int&)),
plugin , SLOT(slotTextureIndex(QString,int,int&)),Qt::DirectConnection);
if ( checkSignal( plugin , "textureName(int,int,QString&)" ) )
connect(plugin , SIGNAL(textureName(int,int,QString&)),
this , SLOT(slotTextureName(int,int,QString&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotTextureName(int,int,QString&)" ) )
connect(this , SIGNAL(textureName(int,int,QString&)),
plugin , SLOT(slotTextureName(int,int,QString&)),Qt::DirectConnection);
if ( checkSignal( plugin , "getCurrentTexture(int,QString&)" ) ) if ( checkSignal( plugin , "getCurrentTexture(int,QString&)" ) )
connect(plugin , SIGNAL(getCurrentTexture(int,QString&)), connect(plugin , SIGNAL(getCurrentTexture(int,QString&)),
this , SLOT(slotGetCurrentTexture(int,QString&)),Qt::DirectConnection); this , SLOT(slotGetCurrentTexture(int,QString&)),Qt::DirectConnection);
......
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