Commit 27698100 authored by Jan Möbius's avatar Jan Möbius

Extension for textureinterface for using multitexturing

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5709 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 40cba56e
......@@ -64,7 +64,7 @@ class TextureInterface {
* Emit this signal if a texture for a specific object has been added
*
* @param _name Name of the property which contains the tex coords (double or vec2d)
* @param _filename Filename of the texture ( "./Textures/<name>")
* @param _filename Filename of the texture (either local in OpenFlippers texture dir or global ( "./Textures/<name>")
* @param _dimension 1D texture ( currenty only supports 1 )
* @param _id id of an object
*/
......@@ -75,11 +75,26 @@ class TextureInterface {
* Emit this signal if a global texture has been added
*
* @param _name Name of the property which contains the tex coords (double or vec2d)
* @param _filename Filename of the texture ( "./Textures/<name>")
* @param _filename Filename of the texture (either local in OpenFlippers texture dir or global ( "./Textures/<name>")
* @param _dimension 1D texture ( currenty only supports 1 )
*/
virtual void addTexture( QString /*_name*/ , QString /*_filename*/ , uint /*_dimension*/ ) {};
/** \brief Emit this Signal if you want to add a texture for a multitexturing mode
*
* Emit this signal if a texture should be added to a multitexturing mode.
* The first parameter defines a texturegroup which collects all textures
* that should be painted in the multitexturing mode.
* The second parameter defines the single textures name.
*
* @param _textureGroup Multitexturing group using this texture
* @param _name Name of the property which contains the tex coords (double or vec2d)
* @param _filename Filename of the texture (either local in OpenFlippers texture dir or global ( "./Textures/<name>")
* @param _id Id of the object which should use that texture
* @param _textureId The new id of the texture( This id is object related!!)
*/
virtual void addMultiTexture( QString /*_textureGroup*/ , QString /*_name*/ , QString /*_filename*/ , int /*_id*/ , int& /*_textureId*/ ) {};
/** \brief Tell Plugins to update the given texture for the given identifier
*/
virtual void updateTexture( QString /*_textureName*/ , int /*_identifier*/) {};
......@@ -167,6 +182,18 @@ class TextureInterface {
*/
virtual void slotTextureAdded( QString /*_textureName*/ , QString /*_filename*/ , uint /*dimension*/ ) {};
/** \brief A multiTexture has been added by a plugin.
*
* This slot is called when a Multi Texture has been added by a plugin.
*
* @param _name Name of the Added texture (has to be equal to the property name)
* @param _filename Filename of the Texture Image to be used
* @param _id Id of the object which should use the texture
* @param _textureId The new id of the texture( This id is object related!!)
*/
virtual void slotMultiTextureAdded( QString /*_textureGroup*/ , QString /*_name*/ ,
QString /*_filename*/ , int /*_id*/ , int& /*_textureId*/ ) {};
/** \brief A texture has been updated
*
* A plugin has updated a Texture
......
......@@ -158,6 +158,9 @@ signals:
/// The texture with the given name and filename has been added
void addTexture( QString, QString , uint );
/// The texture with the given name and filename has been added
void addMultiTexture( QString _textureGroup , QString _name , QString _filename , int _id , int& _textureId );
/// Tell the plugins to update the given texture
void updateTexture( QString , int );
......@@ -249,6 +252,9 @@ signals:
/// Called by a plugin if it creates a texture
void slotAddTexture( QString _textureName , QString _filename , uint _dimension );
/// Called by a plugin if it creates a multitexture
void slotMultiTextureAdded( QString _textureGroup , QString _name , QString _filename , int _id , int& _textureId );
/// Tell the plugins to update the given texture
void slotUpdateTexture( QString _name , int _identifier);
......
......@@ -184,6 +184,11 @@ void Core::slotUpdateTexture( QString _name , int _identifier){
emit updateTexture(_name, _identifier);
}
void Core::slotMultiTextureAdded( QString _textureGroup , QString _name , QString _filename , int _id , int& _textureId ) {
emit addMultiTexture( _textureGroup , _name , _filename , _id , _textureId );
}
/** Called by a plugin if all textures should be updated. The information is passed to all plugins. All plugins providing textures should react on this event.\n
* See in the documentation of the texture plugin interfaces for further detail.
*/
......
......@@ -850,6 +850,15 @@ void Core::loadPlugin(QString filename, bool silent){
if ( checkSlot( plugin , "slotSwitchTexture(QString)" ) )
connect(this , SIGNAL(switchTexture(QString )),
plugin , SLOT(slotSwitchTexture(QString )),Qt::DirectConnection);
if ( checkSignal( plugin , "addMultiTexture(QString,QString,QString,int,int&)" ) )
connect(plugin , SIGNAL(addMultiTexture(QString,QString,QString,int,int&) ),
this , SLOT(slotMultiTextureAdded(QString,QString,QString,int,int&) ),Qt::DirectConnection);
if ( checkSlot( plugin , "slotMultiTextureAdded( QString,QString,QString,int,int&)" ) )
connect(this , SIGNAL(addMultiTexture(QString,QString,QString,int,int&) ),
plugin , SLOT(slotMultiTextureAdded( QString,QString,QString,int,int&) ),Qt::DirectConnection);
}
//Check if the plugin supports Backup-Interface
......
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