projects
/
platform
/
core
/
uifw
/
dali-demo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "Change fitting mode to match previous behaviour."
[platform/core/uifw/dali-demo.git]
/
examples
/
blocks
/
blocks-example.cpp
diff --git
a/examples/blocks/blocks-example.cpp
b/examples/blocks/blocks-example.cpp
index
03a99e6
..
dc3b208
100644
(file)
--- a/
examples/blocks/blocks-example.cpp
+++ b/
examples/blocks/blocks-example.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 201
4
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
7
Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-214,7
+214,29
@@
public:
*/
ExampleController( Application& application )
: mApplication( application ),
*/
ExampleController( Application& application )
: mApplication( application ),
- mView()
+ mView(),
+ mContentLayer(),
+ mBall(),
+ mBallStartPosition(),
+ mBallVelocity(),
+ mBallAnimation(),
+ mPaddle(),
+ mPaddleImage(),
+ mPaddleHandle(),
+ mPaddleHitMargin(),
+ mWobbleAnimation(),
+ mWobbleProperty( Property::INVALID_INDEX ),
+ mLevelContainer(),
+ mBrickImageMap(),
+ mDragAnimation(),
+ mDragActor(),
+ mRelativeDragPoint(),
+ mDestroyAnimationMap(),
+ mPaddleFullSize(),
+ mLevel( 0 ),
+ mLives( TOTAL_LIVES ),
+ mBrickCount( 0 )
+
{
// Connect to the Application's Init and orientation changed signal
mApplication.InitSignal().Connect(this, &ExampleController::Create);
{
// Connect to the Application's Init and orientation changed signal
mApplication.InitSignal().Connect(this, &ExampleController::Create);
@@
-720,7
+742,7
@@
private:
void OnHitPaddle(PropertyNotification& source)
{
Actor delegate = Actor::DownCast(source.GetTarget());
void OnHitPaddle(PropertyNotification& source)
{
Actor delegate = Actor::DownCast(source.GetTarget());
- Vector3 collisionVector = delegate.Get
Property<Vector3>(source.GetTargetProperty()
);
+ Vector3 collisionVector = delegate.Get
CurrentProperty< Vector3 >( source.GetTargetProperty()
);
Vector3 ballRelativePosition(mBall.GetCurrentPosition() - mPaddle.GetCurrentPosition());
ballRelativePosition.Normalize();
Vector3 ballRelativePosition(mBall.GetCurrentPosition() - mPaddle.GetCurrentPosition());
ballRelativePosition.Normalize();
@@
-755,7
+777,7
@@
private:
void OnHitBrick(PropertyNotification& source)
{
Actor brick = Actor::DownCast(source.GetTarget());
void OnHitBrick(PropertyNotification& source)
{
Actor brick = Actor::DownCast(source.GetTarget());
- Vector3 collisionVector = brick.Get
Property<Vector3>(source.GetTargetProperty()
);
+ Vector3 collisionVector = brick.Get
CurrentProperty< Vector3 >( source.GetTargetProperty()
);
const float normalVelocity = fabsf(mBallVelocity.Dot(collisionVector));
mBallVelocity += collisionVector * normalVelocity * 2.0f;
const float normalVelocity = fabsf(mBallVelocity.Dot(collisionVector));
mBallVelocity += collisionVector * normalVelocity * 2.0f;
@@
-840,18
+862,10
@@
private:
int mBrickCount; ///< Total bricks on screen.
};
int mBrickCount; ///< Total bricks on screen.
};
-void RunTest(Application& app)
-{
- ExampleController test(app);
-
- app.MainLoop();
-}
-
int DALI_EXPORT_API main(int argc, char **argv)
{
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
int DALI_EXPORT_API main(int argc, char **argv)
{
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
-
- RunTest(app);
-
+ ExampleController test(app);
+ app.MainLoop();
return 0;
}
return 0;
}