Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 21, 2016, 1:59:04 PM (9 years ago)
Author:
muemart
Message:

Fix some clang-tidy warnings.
Also, Serialise.h was doing some C-style casts that ended up being const casts. I moved those const casts as close to the source as possible and changed the loadAndIncrease functions to not do that.

Location:
code/trunk/src/modules/towerdefense
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/towerdefense/TDCoordinate.cc

    r10629 r11083  
    6666        float tileScale = 100;
    6767
    68         Vector3 *coord = new Vector3();
    69         coord->x= (_x-8) * tileScale;
    70         coord->y= (_y-8) * tileScale;
    71         coord->z=0;
     68        Vector3 coord;
     69        coord.x= (_x-8) * tileScale;
     70        coord.y= (_y-8) * tileScale;
     71        coord.z=0;
    7272
    73         return *coord;
     73        return coord;
    7474    }
    7575}
  • code/trunk/src/modules/towerdefense/TowerDefense.cc

    r11071 r11083  
    377377    {       
    378378        TowerDefenseField* thisField = fields_[thisCoord->GetX()][thisCoord->GetY()];
    379         TDCoordinate* nextCoord = new TDCoordinate(0,0);
    380379
    381380        if (thisField->getType() != TowerDefenseFieldType::STREET && thisField->getType() != TowerDefenseFieldType::START)
     
    384383        }
    385384
     385        TDCoordinate* nextCoord = new TDCoordinate(0, 0);
     386
    386387        if (thisField->getAngle() == 0)
    387388        {
     
    406407        }
    407408
     409        delete nextCoord;
    408410        return nullptr;
    409411    }
Note: See TracChangeset for help on using the changeset viewer.