From 28039ec65a1a8eb7517efb43f4ad870bb191fde6 Mon Sep 17 00:00:00 2001 From: David Steele Date: Wed, 25 Feb 2015 19:07:35 +0000 Subject: [PATCH] Removed model loading from example code Change-Id: Ie3cd0acb8a80f1768d7334fc6965e8fb007d54f4 Signed-off-by: David Steele --- examples/new-window/new-window-example.cpp | 60 ------------------------------ 1 file changed, 60 deletions(-) diff --git a/examples/new-window/new-window-example.cpp b/examples/new-window/new-window-example.cpp index a6f98c0..465727b 100644 --- a/examples/new-window/new-window-example.cpp +++ b/examples/new-window/new-window-example.cpp @@ -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); -- 2.7.4