summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorSarper Akdemir <q.sarperakdemir@gmail.com>2020-08-17 12:56:44 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-08-17 14:19:03 +0200
commit3bc2154ebf043da3cb2b29e30dac9fff5508a82a (patch)
tree042367fefb8383e952b950f87209bb0daa2b736d /slideshow
parentf7fe1e93da753d74485a13d46fe15fb198411932 (diff)
fix box2dtools build error for non debug builds
Removed the asserts and moved the functions out of the box2DWorld class. Change-Id: Ifa58bceb2c64c1012e5d0e65bc12646312ab1c16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100856 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/source/engine/animationfactory.cxx2
-rw-r--r--slideshow/source/engine/box2dtools.cxx6
-rw-r--r--slideshow/source/inc/box2dtools.hxx36
3 files changed, 21 insertions, 23 deletions
diff --git a/slideshow/source/engine/animationfactory.cxx b/slideshow/source/engine/animationfactory.cxx
index bc1848f68435..7f5910cfb992 100644
--- a/slideshow/source/engine/animationfactory.cxx
+++ b/slideshow/source/engine/animationfactory.cxx
@@ -434,7 +434,7 @@ namespace slideshow::internal
mbAnimationStarted = false;
// Animation have ended for this body, make it static
- mpBox2DWorld->makeBodyStatic( mpBox2DBody );
+ box2d::utils::makeBodyStatic( mpBox2DBody );
if( !(mnFlags & AnimationFactory::FLAG_NO_SPRITE) )
mpShapeManager->leaveAnimationMode( mpShape );
diff --git a/slideshow/source/engine/box2dtools.cxx b/slideshow/source/engine/box2dtools.cxx
index c188234105d7..c02a967a5f87 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -367,9 +367,8 @@ Box2DBodySharedPtr box2DWorld::makeShapeDynamic(const slideshow::internal::Shape
return makeBodyDynamic(pBox2DBody);
}
-Box2DBodySharedPtr box2DWorld::makeBodyDynamic(const Box2DBodySharedPtr& pBox2DBody)
+Box2DBodySharedPtr makeBodyDynamic(const Box2DBodySharedPtr& pBox2DBody)
{
- assert(mpBox2DWorld);
if (pBox2DBody->getType() != BOX2D_DYNAMIC_BODY)
{
pBox2DBody->setType(BOX2D_DYNAMIC_BODY);
@@ -384,9 +383,8 @@ Box2DBodySharedPtr box2DWorld::makeShapeStatic(const slideshow::internal::ShapeS
return makeBodyStatic(pBox2DBody);
}
-Box2DBodySharedPtr box2DWorld::makeBodyStatic(const Box2DBodySharedPtr& pBox2DBody)
+Box2DBodySharedPtr makeBodyStatic(const Box2DBodySharedPtr& pBox2DBody)
{
- assert(mpBox2DWorld);
if (pBox2DBody->getType() != BOX2D_STATIC_BODY)
{
pBox2DBody->setType(BOX2D_STATIC_BODY);
diff --git a/slideshow/source/inc/box2dtools.hxx b/slideshow/source/inc/box2dtools.hxx
index dacf24845b45..77543ea919e1 100644
--- a/slideshow/source/inc/box2dtools.hxx
+++ b/slideshow/source/inc/box2dtools.hxx
@@ -202,15 +202,6 @@ public:
*/
Box2DBodySharedPtr makeShapeDynamic(const slideshow::internal::ShapeSharedPtr& pShape);
- /** Make the Box2D body a dynamic one
-
- A dynamic body will be affected by other bodies and the gravity.
-
- @param pBox2DBody
- Pointer to the Box2D body
- */
- Box2DBodySharedPtr makeBodyDynamic(const Box2DBodySharedPtr& pBox2DBody);
-
/** Make the Box2D body corresponding to the given shape a static one
A static body will not be affected by other bodies and the gravity.
@@ -220,15 +211,6 @@ public:
*/
Box2DBodySharedPtr makeShapeStatic(const slideshow::internal::ShapeSharedPtr& pShape);
- /** Make the Box2D body a dynamic one
-
- A static body will not be affected by other bodies and the gravity.
-
- @param pBox2DBody
- Pointer to the Box2D body
- */
- Box2DBodySharedPtr makeBodyStatic(const Box2DBodySharedPtr& pBox2DBody);
-
/// Create a static body from the given shape's bounding box
Box2DBodySharedPtr
createStaticBodyFromBoundingBox(const slideshow::internal::ShapeSharedPtr& rShape,
@@ -322,6 +304,24 @@ public:
/// @return type of the body
box2DBodyType getType();
};
+
+/** Make the Box2D body a dynamic one
+
+ A dynamic body will be affected by other bodies and the gravity.
+
+ @param pBox2DBody
+ Pointer to the Box2D body
+ */
+Box2DBodySharedPtr makeBodyDynamic(const Box2DBodySharedPtr& pBox2DBody);
+
+/** Make the Box2D body a static one
+
+ A static body will not be affected by other bodies and the gravity.
+
+ @param pBox2DBody
+ Pointer to the Box2D body
+ */
+Box2DBodySharedPtr makeBodyStatic(const Box2DBodySharedPtr& pBox2DBody);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */