Removed model loading from example code 99/35899/2
authorDavid Steele <david.steele@partner.samsung.com>
Wed, 25 Feb 2015 19:07:35 +0000 (19:07 +0000)
committerDavid Steele <david.steele@partner.samsung.com>
Thu, 26 Feb 2015 15:44:39 +0000 (07:44 -0800)
Change-Id: Ie3cd0acb8a80f1768d7334fc6965e8fb007d54f4
Signed-off-by: David Steele <david.steele@partner.samsung.com>
examples/new-window/new-window-example.cpp

index a6f98c0..465727b 100644 (file)
@@ -26,7 +26,6 @@ class NewWindowController;
 
 namespace
 {
-const char * gModelFile = DALI_MODEL_DIR "AlbumCute.dali-bin";
 const char * const BACKGROUND_IMAGE( DALI_IMAGE_DIR "background-2.jpg" );
 const char * const TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" );
 const char * const LOSE_CONTEXT_IMAGE( DALI_IMAGE_DIR "icon-cluster-wobble.png" );
@@ -70,8 +69,6 @@ public:
   void CreateBubbles(Vector2 stageSize);
   void CreateBlending();
   void CreateText();
-  void CreateModel();
-  void OnModelLoaded(Model model);
   bool OnTrackTimerTick();
   bool OnExplodeTimerTick();
   void SetUpAnimation( Vector2 emitPosition, Vector2 direction );
@@ -82,18 +79,14 @@ public:
 
 private:
   Application                mApplication;
-  Animation                  mModelAnimation;
-  Actor                      mModelActor;
   Actor                      mCastingLight;
   TextActor                  mTextActor;
   ImageActor                 mImageActor;
   ImageActor                 mBlendActor;
   Image                      mEffectImage;
   Image                      mBaseImage;
-  LightActor                 mKeyLightActor;
   MeshActor                  mMeshActor;
   MeshActor                  mAnimatedMeshActor;
-  Model                      mModel;
 
   Toolkit::View              mView;                              ///< The View instance.
   Toolkit::ToolBar           mToolBar;                           ///< The View's Toolbar.
@@ -176,7 +169,6 @@ void NewWindowController::Create( Application& app )
   CreateMeshActor();
   CreateBlending();
   CreateText();
-  CreateModel();
 
   stage.ContextLostSignal().Connect(this, &NewWindowController::OnContextLost);
   stage.ContextRegainedSignal().Connect(this, &NewWindowController::OnContextRegained);
@@ -423,58 +415,6 @@ Mesh NewWindowController::CreateMesh(bool hasColor, Material material)
   return mesh;
 }
 
-void NewWindowController::CreateModel()
-{
-  mModel = Model::New(gModelFile);
-  mModel.LoadingFinishedSignal().Connect(this, &NewWindowController::OnModelLoaded);
-
-  //Create a Key light
-  Light keylight = Light::New("KeyLight");
-  keylight.SetFallOff(Vector2(10000.0f, 10000.0f));
-
-  mCastingLight = Actor::New();
-  mCastingLight.SetParentOrigin(ParentOrigin::CENTER);
-  mCastingLight.SetAnchorPoint(AnchorPoint::CENTER);
-  mCastingLight.SetPosition( Vector3( 0.0f, 0.0f, 800.0f ) );
-  mContentLayer.Add( mCastingLight );
-
-  mKeyLightActor = LightActor::New();
-  mKeyLightActor.SetParentOrigin(ParentOrigin::CENTER);
-  mKeyLightActor.SetName(keylight.GetName());
-
-  //Add all the actors to the stage
-  mCastingLight.Add(mKeyLightActor);
-  mKeyLightActor.SetLight(keylight);
-}
-
-void NewWindowController::OnModelLoaded( Model model )
-{
-  if( model.GetLoadingState() == ResourceLoadingSucceeded )
-  {
-    std::cout << "Succeeded loading model" << std::endl;
-    mModelActor = ModelActorFactory::BuildActorTree(mModel, "");  // Gets root actor
-    mModelActor.SetSize(250.0f, 250.0f);
-    mModelActor.SetPosition(0.0f, 200.0f, 70.0f);
-    mModelActor.SetScale(0.5f);
-    mModelActor.SetRotation(Radian(Math::PI*0.25f), Vector3(1.0, 0.7, 0.0));
-
-    mContentLayer.Add( mModelActor );
-
-    if (mModel.NumberOfAnimations())
-    {
-      mModelAnimation = ModelActorFactory::BuildAnimation(mModel, mModelActor, 0);
-      mModelAnimation.SetDuration(4.0f);
-      mModelAnimation.SetLooping(true);
-      mModelAnimation.Play();
-    }
-  }
-  else
-  {
-    std::cout << "Failed loading model" << std::endl;
-    mApplication.Quit();
-  }
-}
-
 void NewWindowController::NewWindow(void)
 {
   PositionSize posSize(0, 0, 720, 1280);