X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Ftrackwrap.cpp;h=45ec19c85a8c1a33ac4b0bdfb1dbaac9c8c1ffe3;hb=f8a7788cee0261babfc4c804a58515aad6dfbc3d;hp=b5070757efad2697e2ddc513934b33f172bc18d7;hpb=bf17b58ef9013147c616ee4efbd31a4973728e7f;p=r2c2.git diff --git a/source/designer/trackwrap.cpp b/source/designer/trackwrap.cpp index b507075..45ec19c 100644 --- a/source/designer/trackwrap.cpp +++ b/source/designer/trackwrap.cpp @@ -1,6 +1,6 @@ /* $Id$ -This file is part of the MSP Märklin suite +This file is part of R²C² Copyright © 2010 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ @@ -14,7 +14,7 @@ Distributed under the GPL using namespace std; using namespace Msp; -using namespace Marklin; +using namespace R2C2; TrackWrap::TrackWrap(Designer &d, Selection &s): designer(d), @@ -23,12 +23,18 @@ TrackWrap::TrackWrap(Designer &d, Selection &s): selection.signal_changed.connect(sigc::mem_fun(this, &TrackWrap::selection_changed)); } +TrackWrap::~TrackWrap() +{ + for(map::iterator i=meshes.begin(); i!=meshes.end(); ++i) + delete i->second; +} + void TrackWrap::render(const GL::Tag &) const { for(list::const_iterator i=wraps.begin(); i!=wraps.end(); ++i) { GL::PushMatrix _pushm; - const Point &pos = i->track->get_position(); + const Vector &pos = i->track->get_position(); GL::translate(pos.x, pos.y, pos.z); GL::rotate(i->track->get_rotation()*180/M_PI, 0, 0, 1); i->mesh->draw(); @@ -58,12 +64,12 @@ GL::Mesh &TrackWrap::get_mesh(const TrackType &type) float min_area = -1; float angle = 0; - Point center; + Vector center; float width = 0; float height = 0; for(float a=0; a