~neon/kolf/master

« back to all changes in this revision

Viewing changes to canvasitem.cpp

  • Committer: Friedrich W. H. Kossebau
  • Date: 2020-06-20 15:59:37 UTC
  • Revision ID: git-v1:445d8f08c787ef1c0ecb97e296a185178fbe3919
UseĀ moreĀ nullptr

GIT_SILENT

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
static const int ZValueStep = 100;
31
31
 
32
32
CanvasItem::CanvasItem(b2World* world)
33
 
        : game(0)
 
33
        : game(nullptr)
34
34
        , m_zBehavior(CanvasItem::FixedZValue)
35
35
        , m_zValue(0)
36
 
        , m_strut(0)
37
 
        , m_staticStrut(0)
38
 
        , m_body(0)
39
 
        , m_overlay(0)
 
36
        , m_strut(nullptr)
 
37
        , m_staticStrut(nullptr)
 
38
        , m_body(nullptr)
 
39
        , m_overlay(nullptr)
40
40
        , m_simulationType((CanvasItem::SimulationType) -1)
41
41
{
42
42
        b2BodyDef bodyDef;
51
51
        if (m_strut)
52
52
                m_strut->m_struttedItems.removeAll(this);
53
53
        foreach (CanvasItem* item, m_struttedItems)
54
 
                item->m_strut = 0;
 
54
                item->m_strut = nullptr;
55
55
        //The overlay is deleted first, because it might interact with all other parts of the object.
56
56
        delete m_overlay;
57
57
        //NOTE: Box2D objects will need to be destroyed in the following order:
86
86
        if (m_strut)
87
87
        {
88
88
                m_strut->m_struttedItems.removeAll(this);
89
 
                m_strut = 0;
 
89
                m_strut = nullptr;
90
90
        }
91
91
        //simple behavior
92
92
        if (m_zBehavior == CanvasItem::FixedZValue)
305
305
EllipticalCanvasItem::EllipticalCanvasItem(bool withEllipse, const QString& spriteKey, QGraphicsItem* parent, b2World* world)
306
306
        : Tagaro::SpriteObjectItem(Kolf::renderer(), spriteKey, parent)
307
307
        , CanvasItem(world)
308
 
        , m_ellipseItem(0)
309
 
        , m_shape(0)
 
308
        , m_ellipseItem(nullptr)
 
309
        , m_shape(nullptr)
310
310
{
311
311
        if (withEllipse)
312
312
        {