pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src/editor editor.cxx,1.15,1.16 editor_ev


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/editor editor.cxx,1.15,1.16 editor_event.cxx,1.18,1.19 object_manager.cxx,1.15,1.16 object_manager.hxx,1.8,1.9 selection.cxx,1.3,1.4 selection.hxx,1.3,1.4 status_line.cxx,1.4,1.5 status_line.hxx,1.4,1.5
Date: 1 Jul 2002 16:47:33 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/editor
In directory dark:/tmp/cvs-serv17273/editor

Modified Files:
        editor.cxx editor_event.cxx object_manager.cxx 
        object_manager.hxx selection.cxx selection.hxx status_line.cxx 
        status_line.hxx 
Log Message:
- replaced std::list with std::vector, editor crashes on object deletion

Index: editor.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- editor.cxx  1 Jul 2002 16:31:40 -0000       1.15
+++ editor.cxx  1 Jul 2002 16:47:30 -0000       1.16
@@ -160,7 +160,7 @@
 
   register_event_handler();
 
-  std::list<EditorObj*> tmp_selection;
+  std::vector<EditorObj*> tmp_selection;
 
   while (!quit) 
     {

Index: editor_event.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor_event.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- editor_event.cxx    1 Jul 2002 16:31:40 -0000       1.18
+++ editor_event.cxx    1 Jul 2002 16:47:30 -0000       1.19
@@ -432,7 +432,7 @@
           j != object_manager->editor_objs.end();
           j++)
        {
-         for (list<EditorObj*>::const_iterator i = 
selection->get_objects().begin();
+         for (vector<EditorObj*>::const_iterator i = 
selection->get_objects().begin();
               i != selection->get_objects().end();
               i++)
            { 
@@ -497,7 +497,7 @@
 {
   editor->save_tmp_level ();
       
-  for (std::list<EditorObj*>::const_iterator i = 
selection->get_objects().begin();
+  for (std::vector<EditorObj*>::const_iterator i = 
selection->get_objects().begin();
        i != selection->get_objects().end();
        i++)
     { 
@@ -621,9 +621,9 @@
 void
 EditorEvent::editor_duplicate_current_selection()
 {
-  std::list<EditorObj*> new_objs;
+  std::vector<EditorObj*> new_objs;
   
-  for (std::list<EditorObj*>::const_iterator i = 
selection->get_objects().begin(); 
+  for (std::vector<EditorObj*>::const_iterator i = 
selection->get_objects().begin(); 
        i != selection->get_objects().end();
        i++)
     {
@@ -765,7 +765,7 @@
   std::cout << "EditorEvent:editor_export_object_group_from_selection ()" << 
std::endl;
   
   std::list<boost::shared_ptr<EditorObj> > temp;
-  for (std::list<EditorObj*>::const_iterator it  = 
selection->get_objects().begin();
+  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));
   

Index: object_manager.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/object_manager.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- object_manager.cxx  1 Jul 2002 16:40:30 -0000       1.15
+++ object_manager.cxx  1 Jul 2002 16:47:30 -0000       1.16
@@ -426,10 +426,10 @@
 }
 */
 
-list<EditorObj*>
+vector<EditorObj*>
 ObjectManager::rect_get_objs(int x1, int y1, int x2, int y2)
 {
-  list<EditorObj*> retval;
+  vector<EditorObj*> retval;
 
   for (EditorObjIter it = editor_objs.begin(); it != editor_objs.end(); it++)
     if ((*it)->is_in_rect(CL_Rect(x1, y1, x2, y2)))

Index: object_manager.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/object_manager.hxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- object_manager.hxx  1 Jul 2002 16:40:30 -0000       1.8
+++ object_manager.hxx  1 Jul 2002 16:47:30 -0000       1.9
@@ -99,7 +99,7 @@
   void add_object_group_from_file (const std::string& filename);
 
   //void rect_get_current_objs(float x1, float y1, float x2, float y2);
-  std::list<EditorObj*> rect_get_objs(int x1, int y1, int x2, int y2);
+  std::vector<EditorObj*> rect_get_objs(int x1, int y1, int x2, int y2);
 
   int get_width() { return width; }
   int get_height() { return height; }

Index: selection.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/selection.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- selection.cxx       1 Jul 2002 16:40:30 -0000       1.3
+++ selection.cxx       1 Jul 2002 16:47:30 -0000       1.4
@@ -28,25 +28,25 @@
 
 void EditorSelection::move(float x, float y) {
 
-  for (list<EditorObj*>::iterator it = obj_list.begin(); it != obj_list.end(); 
it++)
+  for (vector<EditorObj*>::iterator it = obj_list.begin(); it != 
obj_list.end(); it++)
     (*it)->set_position_offset(CL_Vector(x, y));
 }
 
 void EditorSelection::move(const CL_Vector& pos) {
 
-  for (list<EditorObj*>::iterator it = obj_list.begin(); it != obj_list.end(); 
it++)
+  for (vector<EditorObj*>::iterator it = obj_list.begin(); it != 
obj_list.end(); it++)
     (*it)->set_position_offset(pos);
 }
 
 void EditorSelection::drag() {
 
-  for (list<EditorObj*>::iterator it = obj_list.begin(); it != obj_list.end(); 
it++)
+  for (vector<EditorObj*>::iterator it = obj_list.begin(); it != 
obj_list.end(); it++)
     (*it)->drag();
 }
 
 void EditorSelection::drop() {
 
-  for (list<EditorObj*>::iterator it = obj_list.begin(); it != obj_list.end(); 
it++)
+  for (vector<EditorObj*>::iterator it = obj_list.begin(); it != 
obj_list.end(); it++)
     (*it)->drop();
 }
 
@@ -55,7 +55,7 @@
   obj_list.push_back(obj);
 }
 
-void EditorSelection::add(list<EditorObj*> objs) {
+void EditorSelection::add(vector<EditorObj*> objs) {
 
   obj_list.insert(obj_list.end(), objs.begin(), objs.end());
 }
@@ -67,13 +67,13 @@
 
 void EditorSelection::raise() {
 
-  for (list<EditorObj*>::iterator it = obj_list.begin(); it != obj_list.end(); 
it++)
+  for (vector<EditorObj*>::iterator it = obj_list.begin(); it != 
obj_list.end(); it++)
     object_manager->raise_obj(boost::shared_ptr<EditorObj>(*it));
 }
 
 void EditorSelection::lower() {
 
-  for (list<EditorObj*>::iterator it = obj_list.begin(); it != obj_list.end(); 
it++)
+  for (vector<EditorObj*>::iterator it = obj_list.begin(); it != 
obj_list.end(); it++)
     object_manager->lower_obj(boost::shared_ptr<EditorObj>(*it));
 }
 
@@ -91,7 +91,7 @@
   y1 = static_cast<int> (Math::min(y1_, y2_));
   y2 = static_cast<int> (Math::max(y1_, y2_));
   
-  const list<EditorObj*> & erg = object_manager->rect_get_objs(x1, x2, y1, y2);
+  const vector<EditorObj*> & erg = object_manager->rect_get_objs(x1, x2, y1, 
y2);
   
   obj_list.insert(obj_list.end(), erg.begin(), erg.end());
 }
@@ -114,35 +114,35 @@
 void
 EditorSelection::horizontal_flip() 
 {
-  for (list<EditorObj*>::iterator it = obj_list.begin(); it != obj_list.end(); 
it++)
+  for (vector<EditorObj*>::iterator it = obj_list.begin(); it != 
obj_list.end(); it++)
     (*it)->horizontal_flip();
 }
 
 void
 EditorSelection::vertical_flip() 
 {
-  for (list<EditorObj*>::iterator it = obj_list.begin(); it != obj_list.end(); 
it++)
+  for (vector<EditorObj*>::iterator it = obj_list.begin(); it != 
obj_list.end(); it++)
     (*it)->vertical_flip();
 }
 
 void
 EditorSelection::rotate_90() 
 {
-  for (list<EditorObj*>::iterator it = obj_list.begin(); it != obj_list.end(); 
it++)
+  for (vector<EditorObj*>::iterator it = obj_list.begin(); it != 
obj_list.end(); it++)
     (*it)->rotate_90();
 }
 
 void
 EditorSelection::rotate_270()
 {
-  for (list<EditorObj*>::iterator it = obj_list.begin(); it != obj_list.end(); 
it++)
+  for (vector<EditorObj*>::iterator it = obj_list.begin(); it != 
obj_list.end(); it++)
     (*it)->rotate_270();
 }
 
 void
 EditorSelection::draw(EditorView * view)
 {
-  for (list<EditorObj*>::iterator i = obj_list.begin(); i != obj_list.end(); 
++i) 
+  for (vector<EditorObj*>::iterator i = obj_list.begin(); i != obj_list.end(); 
++i) 
     {
       (*i)->draw_mark(view);
     }

Index: selection.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/selection.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- selection.hxx       1 Jul 2002 16:40:30 -0000       1.3
+++ selection.hxx       1 Jul 2002 16:47:30 -0000       1.4
@@ -31,7 +31,7 @@
 {
 private:
   
-  std::list<EditorObj*> obj_list;
+  std::vector<EditorObj*> obj_list;
   ObjectManager*        object_manager;
     
 public:
@@ -47,7 +47,7 @@
   void drop();
     
   void add(EditorObj* obj);
-  void add(std::list<EditorObj*> objs);
+  void add(std::vector<EditorObj*> objs);
     
   void remove(EditorObj* obj);
     
@@ -59,7 +59,7 @@
   bool object_selected(EditorObj* obj);
     
   EditorObj* get_current_obj();
-  const std::list<EditorObj*> & get_objects() { return obj_list; }
+  const std::vector<EditorObj*> & get_objects() { return obj_list; }
 
   int size () { return obj_list.size (); }
     

Index: status_line.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/status_line.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- status_line.cxx     1 Jul 2002 16:10:29 -0000       1.4
+++ status_line.cxx     1 Jul 2002 16:47:31 -0000       1.5
@@ -69,7 +69,7 @@
 }
 
 void
-StatusLine::set_current_objs(const std::list<EditorObj*>* c_objs)
+StatusLine::set_current_objs(const std::vector<EditorObj*>* c_objs)
 {
   current_objs = c_objs;
 }

Index: status_line.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/status_line.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- status_line.hxx     1 Jul 2002 16:31:40 -0000       1.4
+++ status_line.hxx     1 Jul 2002 16:47:31 -0000       1.5
@@ -31,12 +31,12 @@
 {
 private:
   CL_Font* font;
-  const std::list<EditorObj*>* current_objs;
+  const std::vector<EditorObj*>* current_objs;
 public:
   StatusLine();
   ~StatusLine();
   
-  void set_current_objs(const std::list<EditorObj*>* c_objs);
+  void set_current_objs(const std::vector<EditorObj*>* c_objs);
   void draw(EditorView * view);
 };
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]