Merge "Fix various Klocwork errors" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / bubble-effect / bubble-emitter-impl.cpp
index 9fed7cc..8b248ce 100644 (file)
@@ -32,16 +32,19 @@ namespace
 {
 struct Vertex
 {
-  float index;
-  Dali::Vector2 position;
-  Dali::Vector2 textureCoord;
-
   Vertex()
-  {}
+  : index( 0.0f ), position(), textureCoord()
+  {
+  }
 
   Vertex( float index, const Dali::Vector2& position, const Dali::Vector2& textureCoord )
   : index( index ), position( position ), textureCoord( textureCoord )
-  {}
+  {
+  }
+
+  float index;
+  Dali::Vector2 position;
+  Dali::Vector2 textureCoord;
 };
 
 /**
@@ -132,16 +135,14 @@ void BubbleEmitter::OnInitialize()
   // Prepare the frame buffer to store the color adjusted background image
   mEffectImage = FrameBufferImage::New( mMovementArea.width/4.f, mMovementArea.height/4.f, Pixel::RGBA8888, Dali::Image::UNUSED );
 
-  // Generate the samplers and geometry, which is used by all bubbleActors
-  mSamplerBackground = Sampler::New( mEffectImage, "sBackground" );
-  mSamplerBubbleShape = Sampler::New( mShapeImage, "sBubbleShape" );
+  // Generate the geometry, which is used by all bubbleActors
   mMeshGeometry =  CreateGeometry( mNumBubblePerActor*mDensity );
 
   Shader bubbleShader = CreateBubbleShader (mNumBubblePerActor );
 
   mMaterial = Material::New( bubbleShader );
-  mMaterial.AddSampler( mSamplerBackground );
-  mMaterial.AddSampler( mSamplerBubbleShape );
+  mMaterial.AddTexture( mEffectImage, "sBackground" );
+  mMaterial.AddTexture( mShapeImage,  "sBubbleShape" );
 
   mBubbleActors.resize( mNumActor );
 
@@ -195,7 +196,7 @@ void BubbleEmitter::SetBackground( Image bgImage, const Vector3& hsvDelta )
 
 void BubbleEmitter::SetShapeImage( Image shapeImage )
 {
-  mSamplerBubbleShape.SetImage( shapeImage );
+  mMaterial.SetTextureImage( 1, shapeImage );
 }
 
 void BubbleEmitter::SetBubbleScale( float scale )