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 selection.cxx,NONE,1.1 selecti


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src/editor selection.cxx,NONE,1.1 selection.hxx,NONE,1.1 editor.cxx,1.13,1.14 editor.hxx,1.6,1.7 editor_event.cxx,1.16,1.17 editor_event.hxx,1.9,1.10 object_manager.cxx,1.12,1.13 object_manager.hxx,1.6,1.7 status_line.cxx,1.3,1.4 status_line.hxx,1.2,1.3
Date: 1 Jul 2002 16:10:32 -0000

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

Modified Files:
        editor.cxx editor.hxx editor_event.cxx editor_event.hxx 
        object_manager.cxx object_manager.hxx status_line.cxx 
        status_line.hxx 
Added Files:
        selection.cxx selection.hxx 
Log Message:
moved object_manager current_obj into its own class


--- NEW FILE: selection.cxx ---
//  $Id: selection.cxx,v 1.1 2002/07/01 16:10:29 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 2000 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#include <ClanLib/Core/Math/cl_vector.h>
#include <ClanLib/Display/Input/keyboard.h>
#include <ClanLib/Display/Input/key.h>
#include "selection.hxx"
#include "../math.hxx"

using namespace Pingus;

void EditorSelection::move(float x, float y) {

  for (list<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++)
    (*it)->set_position_offset(pos);
}

void EditorSelection::drag() {

  for (list<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++)
    (*it)->drop();
}

void EditorSelection::add(EditorObj* obj) {

  obj_list.push_back(obj);
}

void EditorSelection::add(list<EditorObj*> objs) {

  obj_list.insert(obj_list.end(), objs.begin(), objs.end());
}

void EditorSelection::remove(EditorObj* obj) {

  obj_list.erase(std::find(obj_list.begin(), obj_list.end(), obj));
}

void EditorSelection::raise() {

  for (list<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++)
    object_manager->lower_obj(boost::shared_ptr<EditorObj>(*it));
}

void EditorSelection::select_rect(float x1_, float y1_, float x2_, float y2_) {

  int x1, x2, y1, y2;
  
  if (!CL_Keyboard::get_keycode(CL_KEY_LSHIFT)
      && !CL_Keyboard::get_keycode(CL_KEY_RSHIFT))
    clear();
    
  x1 = static_cast<int> (Math::min(x1_, x2_));
  x2 = static_cast<int> (Math::max(x1_, x2_));
  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);
  
  obj_list.insert(obj_list.end(), erg.begin(), erg.end());
}

bool EditorSelection::object_selected(EditorObj* obj) {

  return std::find(obj_list.begin(), obj_list.end(), obj) != obj_list.end();
}

EditorObj* EditorSelection::get_current_obj() {

  if (obj_list.size() == 1)
    return *obj_list.begin();
  else
    return 0;
}

void EditorSelection::horizontal_flip() {
  for (list<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++)
    (*it)->vertical_flip();
}

void EditorSelection::rotate_90() {

  for (list<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++)
    (*it)->rotate_270();
}

/* EOF */

--- NEW FILE: selection.hxx ---
//  $Id: selection.hxx,v 1.1 2002/07/01 16:10:29 torangan Exp $
// 
//  Pingus - A free Lemmings clone
//  Copyright (C) 2000 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
// 
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef HEADER_PINGUS_EDITOR_SELECTION_HXX
#define HEADER_PINGUS_EDITOR_SELECTION_HXX

#include <list>
#include "editorobj.hxx"
#include "object_manager.hxx"

class CL_Vector;

class EditorSelection 
{
  private:
  
    std::list<EditorObj*> obj_list;
    ObjectManager*        object_manager;
    
  public:
  
    EditorSelection(ObjectManager* mng) : object_manager(mng) { }
    ~EditorSelection() { }
    
    void clear() { obj_list.clear(); }
    
    void move(float x, float y);
    void move(const CL_Vector& pos);
    void drag();
    void drop();
    
    void add(EditorObj* obj);
    void add(list<EditorObj*> objs);
    
    void remove(EditorObj* obj);
    
    void raise();
    void lower();
    
    void select_rect(float x1_, float y1_, float x2_, float y2_);
    
    bool object_selected(EditorObj* obj);
    
    EditorObj* get_current_obj();
    const list<EditorObj*> & get_current_objs() { return obj_list; }
    
    void horizontal_flip();
    void vertical_flip();
    void rotate_90();
    void rotate_270();
    
};

#endif

/* EOF */

Index: editor.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- editor.cxx  1 Jul 2002 12:46:22 -0000       1.13
+++ editor.cxx  1 Jul 2002 16:10:29 -0000       1.14
@@ -45,6 +45,7 @@
 #include "status_line.hxx"
 #include "object_selector.hxx"
 #include "object_manager.hxx"
+#include "selection.hxx"
 #include "action_window.hxx"
 #include "property_window.hxx"
 #include "level_property_window.hxx"
@@ -71,6 +72,7 @@
   panel      = new Panel;
   scroll_map = new ScrollMap;
   object_manager  = new ObjectManager;
+  selection       = new EditorSelection(object_manager);
   status_line     = new StatusLine;
   object_selector = new ObjectSelector;
 
@@ -90,7 +92,7 @@
   
   font = PingusResource::load_font("Fonts/courier_small", "fonts");
   panel->init();
-  status_line->set_current_objs(&object_manager->current_objs);
+  status_line->set_current_objs(&selection->get_current_objs());
   panel->set_editor(this);
   scroll_map->editor_event = event;
 }

Index: editor.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- editor.hxx  1 Jul 2002 12:46:22 -0000       1.6
+++ editor.hxx  1 Jul 2002 16:10:29 -0000       1.7
@@ -31,6 +31,7 @@
 class Panel;
 class ScrollMap;
 class ObjectManager;
+class EditorSelection;
 class ObjectSelector;
 class StatusLine;
 class ActionWindow;
@@ -73,6 +74,7 @@
   Panel*  panel;
   ScrollMap* scroll_map;
   ObjectManager* object_manager;
+  EditorSelection* selection;
   EditorView* view; 
   StatusLine* status_line;
   ObjectSelector* object_selector;

Index: editor_event.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor_event.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- editor_event.cxx    1 Jul 2002 12:46:22 -0000       1.16
+++ editor_event.cxx    1 Jul 2002 16:10:29 -0000       1.17
@@ -36,6 +36,7 @@
 #include "../loading.hxx"
 #include "../my_gettext.hxx"
 #include "object_manager.hxx"
+#include "selection.hxx"
 #include "editorobj_group.hxx"
 #include "string_reader.hxx"
 #include "editor_event.hxx"
@@ -73,6 +74,7 @@
   editor = e;
   editor->last_level = System::get_statdir() + "levels/";
   object_manager = editor->object_manager;
+  selection = editor->selection;
 }
 
 void
@@ -219,59 +221,39 @@
          break;
 
        case CL_KEY_HOME:
-         if (object_manager->get_current_obj().get())
-           object_manager->get_current_obj()->make_larger ();
+         if (selection->get_current_obj())
+           selection->get_current_obj()->make_larger ();
          break;
 
        case CL_KEY_END:
-         if (object_manager->get_current_obj().get())
-           object_manager->get_current_obj()->make_smaller ();
+         if (selection->get_current_obj())
+           selection->get_current_obj()->make_smaller ();
          break;
 
          // Lower all object in the current selection
        case CL_KEY_PAGEDOWN:
-         object_manager->lower_current_objs();
+         selection->lower();
        
          if (CL_Keyboard::get_keycode(CL_KEY_RSHIFT)) 
            {
-             for (ObjectManager::CurrentObjIter i = 
object_manager->current_objs.begin(); 
-                  i != object_manager->current_objs.end(); 
-                  ++i)
-               {
-                 (*i)->set_position_offset(CL_Vector(0, 0, -50));
-               }
+             selection->move(CL_Vector(0, 0, -50));
            }
          else if (CL_Keyboard::get_keycode(CL_KEY_RCTRL))
            {
-             for (ObjectManager::CurrentObjIter i = 
object_manager->current_objs.begin(); 
-                  i != object_manager->current_objs.end(); 
-                  ++i)
-               {
-                 (*i)->set_position_offset(CL_Vector(0, 0, -1));
-               }
+             selection->move(CL_Vector(0, 0, -1));
            }
          break;
     
          // Raise all objects in the current selection.
        case CL_KEY_PAGEUP:
-         object_manager->raise_current_objs();    
+         selection->raise();
          if (CL_Keyboard::get_keycode(CL_KEY_RSHIFT)) 
            {
-             for (ObjectManager::CurrentObjIter i = 
object_manager->current_objs.begin();
-                  i != object_manager->current_objs.end(); 
-                  ++i) 
-               {
-                 (*i)->set_position_offset(CL_Vector(0, 0, 50));
-               }
+             selection->move(CL_Vector(0, 0, 50));
            }
          else if (CL_Keyboard::get_keycode(CL_KEY_RCTRL)) 
            {
-             for (ObjectManager::CurrentObjIter i = 
object_manager->current_objs.begin(); 
-                  i != object_manager->current_objs.end(); 
-                  ++i)
-               {
-                 (*i)->set_position_offset(CL_Vector(0, 0, 1));
-               }
+             selection->move(CL_Vector(0, 0, 1));
            }
          break;
 
@@ -401,9 +383,9 @@
 void
 EditorEvent::editor_convert_group_to_selection()
 {
-  if (object_manager->current_objs.size() == 1)
+  if (selection->get_current_obj())
     {
-      boost::shared_ptr<EditorObj> obj = 
*(object_manager->current_objs.begin());
+      boost::shared_ptr<EditorObj> obj(selection->get_current_obj());
       EditorObjGroup* group = dynamic_cast<EditorObjGroup*>(obj.get());
 
       if (group)
@@ -412,14 +394,14 @@
          
object_manager->editor_objs.erase(std::find(object_manager->editor_objs.begin(),
 
                                                      
object_manager->editor_objs.end(),
                                                      obj));
-         object_manager->delete_selection();
+         selection->clear();
 
          for(std::list<boost::shared_ptr<EditorObj> >::iterator i = 
objs->begin();
              i != objs->end();
              i++)
            {
              object_manager->editor_objs.push_back(*i);
-             object_manager->current_objs.push_back(*i);
+             selection->add((*i).get());
            }
 
          objs->clear();
@@ -438,7 +420,7 @@
 void
 EditorEvent::editor_convert_selection_to_group()
 {
-  if (object_manager->current_objs.size() > 1)
+  if (selection->get_current_objs().size() > 1)
     {
       EditorObjGroup* group = new EditorObjGroup();
       boost::shared_ptr<EditorObj> group_obj(group);
@@ -449,14 +431,15 @@
           j != object_manager->editor_objs.end();
           j++)
        {
-         for (ObjectManager::CurrentObjIter i = 
object_manager->current_objs.begin();
-              i != object_manager->current_objs.end();
+         for (list<EditorObj*>::const_iterator i = 
selection->get_current_objs().begin();
+              i != selection->get_current_objs().end();
               i++)
            { 
-             if (*j == *i)
+             if ((*j).get() == *i)
                {
-                 group->add (*i);
-                 
to_erase.push_back(std::find(object_manager->editor_objs.begin(), 
object_manager->editor_objs.end(), *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)));
                }
            }
        }
@@ -467,8 +450,8 @@
        object_manager->editor_objs.erase(*i);
 
       object_manager->editor_objs.push_back(group_obj);
-      object_manager->delete_selection();
-      object_manager->add_to_selection(group_obj);
+      selection->clear();
+      selection->add(group_obj.get());
     }
   else
     {
@@ -479,13 +462,13 @@
 void
 EditorEvent::editor_mark_all_objects()
 {
-  object_manager->delete_selection();
+  selection->clear();
   
   for(ObjectManager::EditorObjIter i = object_manager->editor_objs.begin(); 
       i != object_manager->editor_objs.end(); 
       ++i) 
     {
-      object_manager->current_objs.push_back(*i);
+      selection->add((*i).get());
     }
 }
 
@@ -513,14 +496,15 @@
 {
   editor->save_tmp_level ();
       
-  for (ObjectManager::CurrentObjIter i = object_manager->current_objs.begin();
-       i != object_manager->current_objs.end();
+  for (std::list<EditorObj*>::const_iterator i = 
selection->get_current_objs().begin();
+       i != selection->get_current_objs().end();
        i++)
     { 
-      
object_manager->editor_objs.erase(std::find(object_manager->editor_objs.begin(),
 object_manager->editor_objs.end(), *i));
+      
object_manager->editor_objs.erase(std::find(object_manager->editor_objs.begin(),
 object_manager->editor_objs.end(), 
+                                                  
boost::shared_ptr<EditorObj>(*i)));
     }
   
-  object_manager->delete_selection();
+  selection->clear();
 }
 
 void
@@ -635,15 +619,15 @@
 void
 EditorEvent::editor_duplicate_current_selection()
 {
-  std::list<boost::shared_ptr<EditorObj> > new_objs;
+  std::list<EditorObj*> new_objs;
   
-  for (ObjectManager::CurrentObjIter i = object_manager->current_objs.begin(); 
-       i != object_manager->current_objs.end();
+  for (std::list<EditorObj*>::const_iterator i = 
selection->get_current_objs().begin(); 
+       i != selection->get_current_objs().end();
        i++)
     {
       ObjectManager::EditorObjIter iter = 
std::find(object_manager->editor_objs.begin(), 
                                                    
object_manager->editor_objs.end(), 
-                                                   *i);
+                                                   
boost::shared_ptr<EditorObj>(*i));
       
       boost::shared_ptr<EditorObj> obj = (*i)->duplicate();
 
@@ -652,12 +636,12 @@
          obj->set_position_offset (CL_Vector(8, 8));
 
          object_manager->editor_objs.insert(iter, obj);
-         new_objs.push_back(obj);
+         new_objs.push_back(obj.get());
        }
     }
 
-  object_manager->delete_selection();
-  object_manager->add_to_selection(new_objs);
+  selection->clear();
+  selection->add(new_objs);
 }
 
 void
@@ -714,26 +698,26 @@
     return;
 
   boost::shared_ptr<EditorObj> obj 
-    = object_manager->select_object(editor->view->screen_to_world 
(CL_Vector(CL_Mouse::get_x(), 
+    = object_manager->find_object(editor->view->screen_to_world 
(CL_Vector(CL_Mouse::get_x(), 
                                                                             
CL_Mouse::get_y())));
   
   if (obj.get())
     {
-      if (object_manager->object_selected(obj))
+      if (selection->object_selected(obj.get()))
        {
          editor->interactive_move_object();
        }
       else
        {
          if (!CL_Keyboard::get_keycode(CL_KEY_LSHIFT))
-           object_manager->delete_selection();
+           selection->clear();
          
-         object_manager->add_to_selection(obj);
+         selection->add(obj.get());
        }
     }
   else
     {
-      object_manager->delete_selection();
+      selection->clear();
     }
 }
 
@@ -777,7 +761,13 @@
 EditorEvent::editor_export_object_group_from_selection ()
 {
   std::cout << "EditorEvent:editor_export_object_group_from_selection ()" << 
std::endl;
-  EditorObjGroup group (editor->object_manager->current_objs);
+  
+  std::list<boost::shared_ptr<EditorObj> > temp;
+  for (std::list<EditorObj*>::const_iterator it  = 
selection->get_current_objs().begin();
+                                             it != 
selection->get_current_objs().end(); it++)
+    temp.push_back(boost::shared_ptr<EditorObj>(*it));
+  
+  EditorObjGroup group (temp);
   std::ofstream xml ("/tmp/metaobj.xml");
   group.write_xml (xml);
 }
@@ -791,45 +781,25 @@
 void 
 EditorEvent::editor_horizontal_flip_current_selection()
 {
-  for (ObjectManager::CurrentObjIter i = object_manager->current_objs.begin(); 
-       i != object_manager->current_objs.end();
-       i++)
-    {
-      (*i)->horizontal_flip ();
-    } 
+  selection->horizontal_flip ();
 }
 
 void
 EditorEvent::editor_vertical_flip_current_selection()
 {
-  for (ObjectManager::CurrentObjIter i = object_manager->current_objs.begin(); 
-       i != object_manager->current_objs.end();
-       i++)
-    {
-      (*i)->vertical_flip ();
-    } 
+  selection->vertical_flip ();
 }
 
 void
 EditorEvent::editor_rotate_90_current_selection()
 {
-  for (ObjectManager::CurrentObjIter i = object_manager->current_objs.begin(); 
-       i != object_manager->current_objs.end();
-       i++)
-    {
-      (*i)->rotate_90 ();
-    }
+  selection->rotate_90 ();
 }
 
 void
 EditorEvent::editor_rotate_270_current_selection()
 {
-  for (ObjectManager::CurrentObjIter i = object_manager->current_objs.begin(); 
-       i != object_manager->current_objs.end();
-       i++)
-    {
-      (*i)->rotate_270 ();
-    } 
+  selection->rotate_270 ();
 }
 
 void

Index: editor_event.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor_event.hxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- editor_event.hxx    1 Jul 2002 12:46:22 -0000       1.9
+++ editor_event.hxx    1 Jul 2002 16:10:29 -0000       1.10
@@ -27,6 +27,7 @@
 class CL_InputDevice;
 class Editor;
 class ObjectManager;
+class EditorSelection;
 
 class EditorEvent //: public CL_Event_ButtonPress, public 
CL_Event_ButtonRelease
 {
@@ -42,6 +43,7 @@
 
   Editor* editor;
   ObjectManager* object_manager;
+  EditorSelection* selection;
   
   virtual void on_button_press(CL_InputDevice *device, const CL_Key &key);
   virtual void on_button_release(CL_InputDevice *device, const CL_Key &key);

Index: object_manager.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/object_manager.cxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- object_manager.cxx  29 Jun 2002 14:01:32 -0000      1.12
+++ object_manager.cxx  1 Jul 2002 16:10:29 -0000       1.13
@@ -321,12 +321,15 @@
   xml << "</pingus-level>\n" << std::endl;
 }
 
+/*
 void
 ObjectManager::delete_selection()
 {
   current_objs.erase(current_objs.begin(), current_objs.end());  
 }
+*/
 
+/*
 void
 ObjectManager::unselect_object(boost::shared_ptr<EditorObj> c_obj)
 {
@@ -334,6 +337,7 @@
                               c_obj));
 }
 
+
 void
 ObjectManager::raise_current_objs()
 {
@@ -351,6 +355,7 @@
       lower_obj(*i);
     }
 }
+*/
 
 bool
 ObjectManager::lower_obj(boost::shared_ptr<EditorObj> obj)
@@ -402,8 +407,7 @@
      */
   return true;
 }
-
-
+/*
 void
 ObjectManager::rect_get_current_objs(float x_1, float y_1, float x_2, float 
y_2)
 {
@@ -424,7 +428,21 @@
        current_objs.push_back(*i);
     }
 }
+*/
+
+list<EditorObj*>
+ObjectManager::rect_get_objs(int x1, int y1, int x2, int y2)
+{
+  list<EditorObj*> retval;
+
+  for (EditorObjIter it = editor_objs.begin(); it != editor_objs.end(); it++)
+    if ((*it)->is_in_rect(CL_Rect(x1, y1, x2, y2)))
+      retval.push_back(*it.get());
+      
+  return retval;
+}
 
+/*
 bool
 ObjectManager::object_selected(boost::shared_ptr<EditorObj> c_obj)
 {
@@ -435,9 +453,10 @@
     }
   return false;
 }
+*/
 
 boost::shared_ptr<EditorObj>
-ObjectManager::select_object(const CL_Vector & pos)
+ObjectManager::find_object(const CL_Vector & pos)
 {
   for(EditorObjRIter i = editor_objs.rbegin(); i != editor_objs.rend(); ++i) 
     {
@@ -450,6 +469,7 @@
   return boost::shared_ptr<EditorObj>();
 }
 
+/*
 void
 ObjectManager::move_current_objs(float x, float y)
 {
@@ -495,7 +515,7 @@
   else
     return boost::shared_ptr<EditorObj>();
 }
-
+*/
 void
 ObjectManager::add_object_group_from_file (const std::string& filename)
 {

Index: object_manager.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/object_manager.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- object_manager.hxx  1 Jul 2002 12:46:22 -0000       1.6
+++ object_manager.hxx  1 Jul 2002 16:10:29 -0000       1.7
@@ -64,7 +64,7 @@
 
   /** This list contains all objects, which are in the current
       selection */
-  std::list<boost::shared_ptr<EditorObj> > current_objs;
+  //std::list<boost::shared_ptr<EditorObj> > current_objs;
 
   int move_offset;
 
@@ -90,41 +90,42 @@
   void draw(EditorView * view);
   void draw_scroll_map(int x_pos, int y_pos, int arg_width, int arg_height);
 
-  bool object_selected(boost::shared_ptr<EditorObj> c_obj);
-  void move_obj();
+  //bool object_selected(boost::shared_ptr<EditorObj> c_obj);
+  //void move_obj();
 
-  void delete_selection();
+  //void delete_selection();
   void delete_all_objs();
 
   void add_object_group_from_file (const std::string& filename);
 
-  void rect_get_current_objs(float x1, float y1, float x2, float y2);
+  //void rect_get_current_objs(float x1, float y1, float x2, float y2);
+  list<EditorObj*> rect_get_objs(int x1, int y1, int x2, int y2);
 
   int get_width() { return width; }
   int get_height() { return height; }
 
   /** Return the currently selected object, if none is selected or
       multiple objects are selected return 0 */
-  boost::shared_ptr<EditorObj> get_current_obj();
+  //boost::shared_ptr<EditorObj> get_current_obj();
   
-  void move_current_objs(float x, float y);
-  void drag_current_objs ();
-  void drop_current_objs ();
+  //void move_current_objs(float x, float y);
+  //void drag_current_objs ();
+  //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(boost::shared_ptr<EditorObj> obj);
+  //void add_to_selection(std::list<boost::shared_ptr<EditorObj> > objs);
 
   bool raise_obj(boost::shared_ptr<EditorObj> obj);
-  void raise_current_objs();
+  //void raise_current_objs();
   bool lower_obj(boost::shared_ptr<EditorObj> obj);
 
-  void lower_current_objs();
+  //void lower_current_objs();
 
   /** Remove an object from the current selection */
-  void unselect_object(boost::shared_ptr<EditorObj> c_obj);
+  //void unselect_object(boost::shared_ptr<EditorObj> c_obj);
 
   /** Add the object at the given position to the selection */
-  boost::shared_ptr<EditorObj> select_object(const CL_Vector & pos);
+  boost::shared_ptr<EditorObj> find_object(const CL_Vector & pos);
 
   std::vector<ActionData>* get_actions ();
 };

Index: status_line.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/status_line.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- status_line.cxx     20 Jun 2002 11:11:28 -0000      1.3
+++ status_line.cxx     1 Jul 2002 16:10:29 -0000       1.4
@@ -69,7 +69,7 @@
 }
 
 void
-StatusLine::set_current_objs(std::list<boost::shared_ptr<EditorObj> >* c_objs)
+StatusLine::set_current_objs(const std::list<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.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- status_line.hxx     24 Jun 2002 22:52:58 -0000      1.2
+++ status_line.hxx     1 Jul 2002 16:10:29 -0000       1.3
@@ -33,7 +33,7 @@
   ///
   CL_Font* font;
   ///
-  std::list<boost::shared_ptr<EditorObj> >* current_objs;
+  std::list<EditorObj*>* current_objs;
 public:
   ///
   StatusLine();
@@ -41,7 +41,7 @@
   ~StatusLine();
   
   ///
-  void set_current_objs(std::list<boost::shared_ptr<EditorObj> >* c_objs);
+  void set_current_objs(const std::list<EditorObj*>* c_objs);
   ///
   void draw(EditorView * view);
 };




reply via email to

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