[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/editor editor_event.cxx,1.19,1.20 edi
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/editor editor_event.cxx,1.19,1.20 editor_groundpiece_obj.cxx,1.7,1.8 editor_groundpiece_obj.hxx,1.6,1.7 editorobj.hxx,1.8,1.9 editorobj_group.cxx,1.3,1.4 editorobj_group.hxx,1.6,1.7 object_manager.cxx,1.16,1.17 object_manager.hxx,1.9,1.10 plfobj.cxx,1.4,1.5 plfobj.hxx,1.5,1.6 selection.cxx,1.4,1.5 selection.hxx,1.4,1.5 start_pos.cxx,1.3,1.4 start_pos.hxx,1.3,1.4 weather_obj.cxx,1.3,1.4 weather_obj.hxx,1.3,1.4 |
Date: |
1 Jul 2002 18:36:43 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/editor
In directory dark:/tmp/cvs-serv24111/src/editor
Modified Files:
editor_event.cxx editor_groundpiece_obj.cxx
editor_groundpiece_obj.hxx editorobj.hxx editorobj_group.cxx
editorobj_group.hxx object_manager.cxx object_manager.hxx
plfobj.cxx plfobj.hxx selection.cxx selection.hxx
start_pos.cxx start_pos.hxx weather_obj.cxx weather_obj.hxx
Log Message:
- removed a few shared_ptr's
- fixed a level
- some std::list and std::vector replacements
Index: editor_event.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor_event.cxx,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- editor_event.cxx 1 Jul 2002 16:47:30 -0000 1.19
+++ editor_event.cxx 1 Jul 2002 18:36:39 -0000 1.20
@@ -391,21 +391,28 @@
if (group)
{
- std::list<boost::shared_ptr<EditorObj> >* objs = group->get_objs();
+ std::vector<EditorObj*>* objs = group->get_objs();
object_manager->editor_objs.erase(std::find(object_manager->editor_objs.begin(),
object_manager->editor_objs.end(),
obj));
selection->clear();
-
- for(std::list<boost::shared_ptr<EditorObj> >::iterator i =
objs->begin();
+ for(std::vector<EditorObj*>::iterator i = objs->begin();
i != objs->end();
i++)
{
- object_manager->editor_objs.push_back(*i);
- selection->add((*i).get());
+ EditorObj* obj = (*i)->duplicate ();
+ if (obj)
+ {
+ object_manager->add (obj);
+ selection->add(obj);
+ }
+ else
+ {
+ std::cout <<
"EditorEvent::editor_convert_group_to_selection(): duplicate not implemented"
<< std::endl;
+ }
}
- objs->clear();
+ object_manager->erase(group);
}
else
{
@@ -425,7 +432,7 @@
{
EditorObjGroup* group = new EditorObjGroup();
boost::shared_ptr<EditorObj> group_obj(group);
- std::vector<std::list<boost::shared_ptr<EditorObj> >::iterator> to_erase;
+ std::vector<EditorObj*> to_erase;
// We need to collect the objects out of the editor_objs list to keep
the correct sorting
for (ObjectManager::EditorObjIter j =
object_manager->editor_objs.begin();
@@ -438,17 +445,16 @@
{
if ((*j).get() == *i)
{
- group->add (boost::shared_ptr<EditorObj>(*i));
-
to_erase.push_back(std::find(object_manager->editor_objs.begin(),
object_manager->editor_objs.end(),
-
boost::shared_ptr<EditorObj>(*i)));
+ group->add (*i);
+ to_erase.push_back(*i);
}
}
}
- for(std::vector<std::list<boost::shared_ptr<EditorObj>
>::iterator>::iterator i = to_erase.begin();
+ for(std::vector<EditorObj*>::iterator i = to_erase.begin();
i != to_erase.end();
i++)
- object_manager->editor_objs.erase(*i);
+ object_manager->erase(*i);
object_manager->editor_objs.push_back(group_obj);
selection->clear();
@@ -495,16 +501,8 @@
void
EditorEvent::editor_delete_selected_objects()
{
- editor->save_tmp_level ();
-
- for (std::vector<EditorObj*>::const_iterator i =
selection->get_objects().begin();
- i != selection->get_objects().end();
- i++)
- {
-
object_manager->editor_objs.erase(std::find(object_manager->editor_objs.begin(),
object_manager->editor_objs.end(),
-
boost::shared_ptr<EditorObj>(*i)));
- }
-
+ editor->save_tmp_level ();
+ object_manager->erase (selection->get_objects());
selection->clear();
}
@@ -627,18 +625,20 @@
i != selection->get_objects().end();
i++)
{
- ObjectManager::EditorObjIter iter =
std::find(object_manager->editor_objs.begin(),
+ /*ObjectManager::EditorObjIter iter =
std::find(object_manager->editor_objs.begin(),
object_manager->editor_objs.end(),
-
boost::shared_ptr<EditorObj>(*i));
+ *i);*/
- boost::shared_ptr<EditorObj> obj = (*i)->duplicate();
-
- if (obj.get ())
+ EditorObj* obj = (*i)->duplicate();
+ if (obj)
{
+ // Apply object offset (not really needed, but makes it
+ // easier to see that the object got duplicated)
obj->set_position_offset (CL_Vector(8, 8));
- object_manager->editor_objs.insert(iter, obj);
- new_objs.push_back(obj.get());
+ // FIXME: We don't take the object position into account!
+ object_manager->add (obj); // ObjectManager will take care of the
deletion
+ new_objs.push_back(obj);
}
}
@@ -764,10 +764,10 @@
{
std::cout << "EditorEvent:editor_export_object_group_from_selection ()" <<
std::endl;
- std::list<boost::shared_ptr<EditorObj> > temp;
+ std::vector<EditorObj*> temp;
for (std::vector<EditorObj*>::const_iterator it =
selection->get_objects().begin();
it != selection->get_objects().end(); ++it)
- temp.push_back(boost::shared_ptr<EditorObj>(*it));
+ temp.push_back(*it);
EditorObjGroup group (temp);
std::ofstream xml ("/tmp/metaobj.xml");
Index: editor_groundpiece_obj.cxx
===================================================================
RCS file:
/usr/local/cvsroot/Games/Pingus/src/editor/editor_groundpiece_obj.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- editor_groundpiece_obj.cxx 1 Jul 2002 09:09:31 -0000 1.7
+++ editor_groundpiece_obj.cxx 1 Jul 2002 18:36:39 -0000 1.8
@@ -31,11 +31,10 @@
{
}
-boost::shared_ptr<EditorObj>
+EditorObj*
EditorGroundpieceObj::duplicate()
{
- return boost::shared_ptr<EditorObj>(new EditorGroundpieceObj
- (static_cast<GroundpieceData>(*this)));
+ return new EditorGroundpieceObj (static_cast<GroundpieceData>(*this));
}
std::string
Index: editor_groundpiece_obj.hxx
===================================================================
RCS file:
/usr/local/cvsroot/Games/Pingus/src/editor/editor_groundpiece_obj.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- editor_groundpiece_obj.hxx 1 Jul 2002 09:09:31 -0000 1.6
+++ editor_groundpiece_obj.hxx 1 Jul 2002 18:36:39 -0000 1.7
@@ -43,7 +43,7 @@
void rotate_270 ();
void write_xml(std::ostream& xml) { GroundpieceData::write_xml (xml); }
- boost::shared_ptr<EditorObj> duplicate();
+ EditorObj* duplicate();
std::string status_line();
Pingus::Editor::PropertyFrame* get_gui_dialog(CL_Component* parent);
Index: editorobj.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editorobj.hxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- editorobj.hxx 1 Jul 2002 16:40:30 -0000 1.8
+++ editorobj.hxx 1 Jul 2002 18:36:39 -0000 1.9
@@ -113,7 +113,7 @@
/** Duplicate the given editor object and return a the copied
object */
- virtual boost::shared_ptr<EditorObj> duplicate() =0;
+ virtual EditorObj* duplicate() =0;
/** Return a pointer to a CL_Component which can be used to
manipulate the properties of this gameobject. The caller is
Index: editorobj_group.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editorobj_group.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- editorobj_group.cxx 25 Jun 2002 12:20:33 -0000 1.3
+++ editorobj_group.cxx 1 Jul 2002 18:36:40 -0000 1.4
@@ -28,9 +28,18 @@
{
}
-EditorObjGroup::EditorObjGroup(const std::list<boost::shared_ptr<EditorObj> >&
arg_objs)
- : objs (arg_objs)
+EditorObjGroup::EditorObjGroup(const std::vector<EditorObj*>& arg_objs)
{
+ for(std::vector<EditorObj*>::const_iterator i = arg_objs.begin(); i !=
arg_objs.end (); ++i)
+ {
+ EditorObj* new_obj = (*i)->duplicate ();
+ if (new_obj)
+ objs.push_back (new_obj);
+ else
+ {
+ std::cout << "EditorObjGroup: Duplicate not implemented" << std::endl;
+ }
+ }
}
EditorObjGroup::~EditorObjGroup()
@@ -41,7 +50,7 @@
EditorObjGroup::set_position_offset(const CL_Vector& offset)
{
upper_left_corner += offset;
- for(std::list<boost::shared_ptr<EditorObj> >::iterator i = objs.begin();
+ for(std::vector<EditorObj*>::iterator i = objs.begin();
i != objs.end();
i++)
{
@@ -53,9 +62,7 @@
void
EditorObjGroup::draw (EditorView * view)
{
- for(std::list<boost::shared_ptr<EditorObj> >::iterator i = objs.begin();
- i != objs.end();
- ++i)
+ for(std::vector<EditorObj*>::iterator i = objs.begin(); i != objs.end(); ++i)
{
(*i)->draw (view);
}
@@ -64,7 +71,7 @@
float
EditorObjGroup::get_z_pos()
{
- /*for(std::list<boost::shared_ptr<EditorObj> >::iterator i = objs.begin();
+ /*for(std::vector<boost::shared_ptr<EditorObj> >::iterator i = objs.begin();
i != objs.end();
++i)
{
@@ -77,7 +84,7 @@
void
EditorObjGroup::draw_mark (EditorView * view)
{
- for(std::list<boost::shared_ptr<EditorObj> >::iterator i = objs.begin();
+ for(std::vector<EditorObj*>::iterator i = objs.begin();
i != objs.end();
++i)
{
@@ -86,7 +93,7 @@
}
void
-EditorObjGroup::add (boost::shared_ptr<EditorObj> obj)
+EditorObjGroup::add (EditorObj* obj)
{
// Updating the width/height and x_pos/y_pos of the object group
/*
@@ -110,10 +117,13 @@
height = obj->get_height ();
}
*/
- objs.push_back(obj);
+
+ EditorObj* new_obj = obj->duplicate ();
+ if (new_obj)
+ objs.push_back(new_obj);
}
-std::list<boost::shared_ptr<EditorObj> >*
+std::vector<EditorObj*>*
EditorObjGroup::get_objs()
{
return &objs;
@@ -125,7 +135,7 @@
{
xml << "<group>\n";
- for(std::list<boost::shared_ptr<EditorObj> >::iterator i = objs.begin();
+ for(std::vector<EditorObj*>::iterator i = objs.begin();
i != objs.end();
i++)
{
@@ -134,26 +144,26 @@
xml << "</group>\n" << std::endl;
}
-boost::shared_ptr<EditorObj>
+EditorObj*
EditorObjGroup::duplicate()
{
EditorObjGroup* editor_obj = new EditorObjGroup();
- for(std::list<boost::shared_ptr<EditorObj> >::iterator i = objs.begin();
+ for(std::vector<EditorObj*>::iterator i = objs.begin();
i != objs.end();
++i)
{
- boost::shared_ptr<EditorObj> obj = (*i)->duplicate();
- if (obj.get())
+ EditorObj* obj = (*i)->duplicate();
+ if (obj)
editor_obj->objs.push_back(obj);
}
- return boost::shared_ptr<EditorObj> (editor_obj);
+ return editor_obj;
}
bool
EditorObjGroup::is_over(const CL_Vector& pos)
{
- for(std::list<boost::shared_ptr<EditorObj> >::iterator i = objs.begin();
+ for(std::vector<EditorObj*>::iterator i = objs.begin();
i != objs.end();
++i)
{
@@ -166,7 +176,7 @@
bool
EditorObjGroup::is_in_rect(const CL_Rect& rect)
{
- for(std::list<boost::shared_ptr<EditorObj> >::iterator i = objs.begin();
+ for(std::vector<EditorObj*>::iterator i = objs.begin();
i != objs.end();
++i)
{
Index: editorobj_group.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editorobj_group.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- editorobj_group.hxx 25 Jun 2002 12:20:33 -0000 1.6
+++ editorobj_group.hxx 1 Jul 2002 18:36:40 -0000 1.7
@@ -23,19 +23,19 @@
#include <ClanLib/Core/Math/cl_vector.h>
#include "../boost/smart_ptr.hpp"
#include "editorobj.hxx"
-#include <list>
+#include <vector>
class EditorObjGroup : public EditorObj
{
private:
- std::list<boost::shared_ptr<EditorObj> > objs;
+ std::vector<EditorObj*> objs;
CL_Vector upper_left_corner;
//int width, height;
//bool init;
public:
EditorObjGroup();
- EditorObjGroup(const std::list<boost::shared_ptr<EditorObj> >& arg_objs);
+ EditorObjGroup(const std::vector<EditorObj*>& arg_objs);
virtual ~EditorObjGroup();
float get_z_pos();
@@ -44,16 +44,17 @@
void draw(EditorView *);
void draw_mark (EditorView * view);
- /** Add an object to the group */
- void add (boost::shared_ptr<EditorObj>);
+ /** Add an object to the group, the object will get duplicated and
+ stay untouched */
+ void add (EditorObj*);
///
- std::list<boost::shared_ptr<EditorObj> >* get_objs();
+ std::vector<EditorObj*>* get_objs();
bool is_over(const CL_Vector &);
bool is_in_rect(const CL_Rect &);
void write_xml(std::ostream& xml);
- boost::shared_ptr<EditorObj> duplicate();
+ EditorObj* duplicate();
unsigned int size () { return objs.size (); }
};
Index: object_manager.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/object_manager.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- object_manager.cxx 1 Jul 2002 16:47:30 -0000 1.16
+++ object_manager.cxx 1 Jul 2002 18:36:40 -0000 1.17
@@ -48,6 +48,20 @@
return a->get_z_pos () < b->get_z_pos ();
}
+class EditorObj_finder
+{
+private:
+ EditorObj* object;
+public:
+ EditorObj_finder (EditorObj* obj)
+ : object (obj)
+ {}
+
+ bool operator() (boost::shared_ptr<EditorObj> a) {
+ return (a.get() == object);
+ }
+};
+
#ifdef WIN32
//FIXME: ingo: This is a workaround around the std::list::sort()
//FIXME: problem under MSVC6. This is copy&paste from an usenet
@@ -179,7 +193,7 @@
// Alpha notes that this does NOT work.
// world_obj.sort(std::greater<CWorldObjPtr>());
#else
- editor_objs.sort(EditorObj_z_pos_sorter);
+ std::sort(editor_objs.begin (), editor_objs.end (), EditorObj_z_pos_sorter);
#endif
std::cout << "Reading props" << std::endl;
@@ -354,12 +368,12 @@
*/
bool
-ObjectManager::lower_obj(boost::shared_ptr<EditorObj> obj)
+ObjectManager::lower_obj(EditorObj* obj)
{
EditorObjIter current;
EditorObjIter prev;
- current = find(editor_objs.begin(), editor_objs.end(), obj);
+ current = std::find_if(editor_objs.begin(), editor_objs.end(),
EditorObj_finder(obj));
if (current == editor_objs.begin())
{
@@ -380,12 +394,12 @@
}
bool
-ObjectManager::raise_obj(boost::shared_ptr<EditorObj> obj)
+ObjectManager::raise_obj(EditorObj* obj)
{
EditorObjIter current;
EditorObjIter next;
- current = find(editor_objs.begin(), editor_objs.end(), obj);
+ current = std::find_if (editor_objs.begin(), editor_objs.end(),
EditorObj_finder(obj));
next = current;
next++;
@@ -436,6 +450,24 @@
retval.push_back(it->get ());
return retval;
+}
+
+void
+ObjectManager::add (EditorObj*)
+{
+ std::cout << "ObjectManager::add (EditorObj*)" << std::endl;
+}
+
+void
+ObjectManager::erase (EditorObj*)
+{
+ std::cout << "ObjectManager::erase (EditorObj*): Not implemented" <<
std::endl;
+}
+
+void
+ObjectManager::erase (std::vector<EditorObj*> obj)
+{
+ std::cout << "ObjectManager::erase (std::vector<EditorObj*> obj): Not
implemented" << std::endl;
}
/*
Index: object_manager.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/object_manager.hxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- object_manager.hxx 1 Jul 2002 16:47:30 -0000 1.9
+++ object_manager.hxx 1 Jul 2002 18:36:40 -0000 1.10
@@ -60,11 +60,11 @@
std::string comment;
/** All objects which are visible in the editor */
- std::list<boost::shared_ptr<EditorObj> > editor_objs;
+ std::vector<boost::shared_ptr<EditorObj> > editor_objs;
/** This list contains all objects, which are in the current
selection */
- //std::list<boost::shared_ptr<EditorObj> > current_objs;
+ //std::vector<boost::shared_ptr<EditorObj> > current_objs;
int move_offset;
@@ -72,9 +72,9 @@
PLF* plf;
public:
- typedef std::list<boost::shared_ptr<EditorObj> >::iterator EditorObjIter;
- typedef std::list<boost::shared_ptr<EditorObj> >::reverse_iterator
EditorObjRIter;
- typedef std::list<boost::shared_ptr<EditorObj> >::iterator CurrentObjIter;
+ typedef std::vector<boost::shared_ptr<EditorObj> >::iterator EditorObjIter;
+ typedef std::vector<boost::shared_ptr<EditorObj> >::reverse_iterator
EditorObjRIter;
+ typedef std::vector<boost::shared_ptr<EditorObj> >::iterator CurrentObjIter;
ObjectManager();
~ObjectManager();
@@ -113,11 +113,22 @@
//void drop_current_objs ();
//void add_to_selection(boost::shared_ptr<EditorObj> obj);
- //void add_to_selection(std::list<boost::shared_ptr<EditorObj> > objs);
+ //void add_to_selection(std::vector<boost::shared_ptr<EditorObj> > objs);
- bool raise_obj(boost::shared_ptr<EditorObj> obj);
+ bool raise_obj(EditorObj* obj);
//void raise_current_objs();
- bool lower_obj(boost::shared_ptr<EditorObj> obj);
+ bool lower_obj(EditorObj* obj);
+
+ /** Add a new object to the ObjectManager. The ObjectManager will
+ take controll over the object and delele it, if its no longer
+ needed! */
+ void add (EditorObj*);
+
+ /** Erase the object from the ObjectManager and delete it */
+ void erase (EditorObj*);
+
+ /** Erase objects from the ObjectManager and delete them */
+ void erase (std::vector<EditorObj*>);
//void lower_current_objs();
Index: plfobj.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/plfobj.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- plfobj.cxx 1 Jul 2002 09:09:31 -0000 1.4
+++ plfobj.cxx 1 Jul 2002 18:36:40 -0000 1.5
@@ -57,12 +57,11 @@
}
}
-boost::shared_ptr<EditorObj>
+EditorObj*
EntranceObj::duplicate()
{
std::cout << "EntranceObj::duplicate()" << std::endl;
- boost::shared_ptr<EditorObj> entrance (new
EntranceObj(static_cast<EntranceData>(*this)));
- return entrance;
+ return new EntranceObj(static_cast<EntranceData>(*this));
}
std::string
@@ -112,11 +111,11 @@
}
}
-boost::shared_ptr<EditorObj>
+EditorObj*
ExitObj::duplicate()
{
// FIXME: The static_cast<> looks ugly..
- return boost::shared_ptr<EditorObj>(new
ExitObj(static_cast<ExitData>(*this)));
+ return new ExitObj(static_cast<ExitData>(*this));
}
std::string
@@ -171,10 +170,10 @@
}
}
-boost::shared_ptr<EditorObj>
+EditorObj*
TrapObj::duplicate()
{
- return boost::shared_ptr<EditorObj>(new
TrapObj(static_cast<TrapData>(*this)));
+ return new TrapObj(static_cast<TrapData>(*this));
}
void
@@ -202,10 +201,10 @@
}
}
-boost::shared_ptr<EditorObj>
+EditorObj*
LiquidObj::duplicate()
{
- return boost::shared_ptr<EditorObj>(new
LiquidObj(static_cast<LiquidData>(*this)));
+ return new LiquidObj(static_cast<LiquidData>(*this));
}
void
Index: plfobj.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/plfobj.hxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- plfobj.hxx 1 Jul 2002 16:40:30 -0000 1.5
+++ plfobj.hxx 1 Jul 2002 18:36:40 -0000 1.6
@@ -34,7 +34,7 @@
public:
EntranceObj(const EntranceData&);
- boost::shared_ptr<EditorObj> duplicate();
+ EditorObj* duplicate();
void write_xml(std::ostream& xml) { EntranceData::write_xml (xml); }
std::string status_line();
Pingus::Editor::PropertyFrame* get_gui_dialog (CL_Component* parent);
@@ -48,7 +48,7 @@
public:
ExitObj(const ExitData&);
- boost::shared_ptr<EditorObj> duplicate();
+ EditorObj* duplicate();
void write_xml(std::ostream& xml) { ExitData::write_xml (xml); }
std::string status_line();
};
@@ -63,7 +63,7 @@
public:
TrapObj(const TrapData&);
- boost::shared_ptr<EditorObj> duplicate();
+ EditorObj* duplicate();
void write_xml(std::ostream& xml) { TrapData::write_xml (xml); }
void draw (EditorView * view);
std::string status_line();
@@ -77,7 +77,7 @@
public:
LiquidObj(const LiquidData& data);
- boost::shared_ptr<EditorObj> duplicate();
+ EditorObj* duplicate();
void draw (EditorView * view);
void draw_mark (EditorView * view);
void save(std::ostream& plf, std::ofstream* psm);
Index: selection.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/selection.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- selection.cxx 1 Jul 2002 16:47:30 -0000 1.4
+++ selection.cxx 1 Jul 2002 18:36:40 -0000 1.5
@@ -68,13 +68,13 @@
void EditorSelection::raise() {
for (vector<EditorObj*>::iterator it = obj_list.begin(); it !=
obj_list.end(); it++)
- object_manager->raise_obj(boost::shared_ptr<EditorObj>(*it));
+ object_manager->raise_obj(*it);
}
void EditorSelection::lower() {
for (vector<EditorObj*>::iterator it = obj_list.begin(); it !=
obj_list.end(); it++)
- object_manager->lower_obj(boost::shared_ptr<EditorObj>(*it));
+ object_manager->lower_obj(*it);
}
void
Index: selection.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/selection.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- selection.hxx 1 Jul 2002 16:47:30 -0000 1.4
+++ selection.hxx 1 Jul 2002 18:36:40 -0000 1.5
@@ -46,9 +46,11 @@
void drag();
void drop();
+ /** Add the given object to the selection */
void add(EditorObj* obj);
void add(std::vector<EditorObj*> objs);
+ /** Remove the given object from the selection */
void remove(EditorObj* obj);
void raise();
Index: start_pos.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/start_pos.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- start_pos.cxx 25 Jun 2002 12:20:33 -0000 1.3
+++ start_pos.cxx 1 Jul 2002 18:36:40 -0000 1.4
@@ -38,11 +38,11 @@
xml << " </start-position>\n" << std::endl;
}
-boost::shared_ptr<EditorObj>
+EditorObj*
StartPos::duplicate()
{
std::cout << "StartPos: The start position can't be duplicated" << std::endl;
- return boost::shared_ptr<EditorObj>();
+ return 0;
}
/* EOF */
Index: start_pos.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/start_pos.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- start_pos.hxx 25 Jun 2002 12:20:33 -0000 1.3
+++ start_pos.hxx 1 Jul 2002 18:36:40 -0000 1.4
@@ -31,7 +31,7 @@
StartPos(int arg_x_pos, int arg_y_pos);
virtual void write_xml(std::ostream& xml);
- virtual boost::shared_ptr<EditorObj> duplicate();
+ virtual EditorObj* duplicate();
};
#endif
Index: weather_obj.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/weather_obj.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- weather_obj.cxx 25 Jun 2002 12:20:33 -0000 1.3
+++ weather_obj.cxx 1 Jul 2002 18:36:40 -0000 1.4
@@ -83,10 +83,10 @@
<< std::endl;
}
-boost::shared_ptr<EditorObj>
+EditorObj*
WeatherObj::duplicate()
{
- return boost::shared_ptr<EditorObj>(new WeatherObj(*this));
+ return new WeatherObj(*this);
}
void
Index: weather_obj.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/weather_obj.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- weather_obj.hxx 25 Jun 2002 12:20:33 -0000 1.3
+++ weather_obj.hxx 1 Jul 2002 18:36:40 -0000 1.4
@@ -39,7 +39,7 @@
virtual void draw (EditorView * view);
virtual void write_xml(std::ostream& xml);
- virtual boost::shared_ptr<EditorObj> duplicate();
+ virtual EditorObj* duplicate();
};
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/editor editor_event.cxx,1.19,1.20 editor_groundpiece_obj.cxx,1.7,1.8 editor_groundpiece_obj.hxx,1.6,1.7 editorobj.hxx,1.8,1.9 editorobj_group.cxx,1.3,1.4 editorobj_group.hxx,1.6,1.7 object_manager.cxx,1.16,1.17 object_manager.hxx,1.9,1.10 plfobj.cxx,1.4,1.5 plfobj.hxx,1.5,1.6 selection.cxx,1.4,1.5 selection.hxx,1.4,1.5 start_pos.cxx,1.3,1.4 start_pos.hxx,1.3,1.4 weather_obj.cxx,1.3,1.4 weather_obj.hxx,1.3,1.4,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/worldobjs conveyor_belt.cxx,1.3,1.4 conveyor_belt.hxx,1.3,1.4 ice_block.cxx,1.5,1.6 ice_block.hxx,1.3,1.4 info_box.cxx,1.2,1.3 info_box.hxx,1.4,1.5 switch_door.cxx,1.3,1.4 switch_door.hxx,1.4,1.5 teleporter.cxx,1.2,1.3 teleporter.hxx,1.4,1.5
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/editor selection.cxx,1.5,1.6
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/worldobjs conveyor_belt.cxx,1.3,1.4 conveyor_belt.hxx,1.3,1.4 ice_block.cxx,1.5,1.6 ice_block.hxx,1.3,1.4 info_box.cxx,1.2,1.3 info_box.hxx,1.4,1.5 switch_door.cxx,1.3,1.4 switch_door.hxx,1.4,1.5 teleporter.cxx,1.2,1.3 teleporter.hxx,1.4,1.5
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/editor selection.cxx,1.5,1.6
- Index(es):