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_event.cxx,1.34,1.35 edi


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/editor editor_event.cxx,1.34,1.35 editor_event.hxx,1.15,1.16 object_manager.cxx,1.29,1.30 object_manager.hxx,1.18,1.19 object_selector.cxx,1.17,1.18
Date: 15 Sep 2002 15:30:23 -0000

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

Modified Files:
        editor_event.cxx editor_event.hxx object_manager.cxx 
        object_manager.hxx object_selector.cxx 
Log Message:
some prefab framework

Index: editor_event.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor_event.cxx,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- editor_event.cxx    15 Sep 2002 00:19:19 -0000      1.34
+++ editor_event.cxx    15 Sep 2002 15:30:21 -0000      1.35
@@ -130,12 +130,12 @@
          editor_vertical_flip_current_selection ();
          break;
 
-       case CL_KEY_I: // import meta-object
-         editor_import_object_group ();
+       case CL_KEY_I: // import prefab (shouldn't be here, its handled in the 
object selector already)
+         editor_import_prefab ();
          break;
 
-       case CL_KEY_X: // export meta-object
-         editor_export_object_group_from_selection ();
+       case CL_KEY_X: // export prefab 
+         editor_export_prefab_from_selection ();
          break;
 
        case CL_KEY_F3:
@@ -759,7 +759,7 @@
 }
 
 void
-EditorEvent::editor_export_object_group_from_selection ()
+EditorEvent::editor_export_prefab_from_selection ()
 {
   std::cout << "EditorEvent:editor_export_object_group_from_selection ()" << 
std::endl;
   
@@ -774,9 +774,9 @@
 }
 
 void
-EditorEvent::editor_import_object_group ()
+EditorEvent::editor_import_prefab ()
 {
-  editor->object_manager->add_object_group_from_file ("/tmp/metaobj.xml");
+  editor->object_manager->add_prefab_from_file ("/tmp/metaobj.xml");
 }
 
 void 

Index: editor_event.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor_event.hxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- editor_event.hxx    13 Sep 2002 18:28:26 -0000      1.15
+++ editor_event.hxx    15 Sep 2002 15:30:21 -0000      1.16
@@ -81,8 +81,8 @@
   void editor_display_help();
   
   // Export the current selection to a meta-obj
-  void editor_export_object_group_from_selection ();
-  void editor_import_object_group ();
+  void editor_export_prefab_from_selection ();
+  void editor_import_prefab ();
 
   /** Display the configuration window for the actions */
   void editor_show_actions_window ();

Index: object_manager.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/object_manager.cxx,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- object_manager.cxx  14 Sep 2002 23:31:12 -0000      1.29
+++ object_manager.cxx  15 Sep 2002 15:30:21 -0000      1.30
@@ -334,23 +334,8 @@
 }
 
 void
-ObjectManager::add_object_group_from_file (const std::string& filename)
+ObjectManager::add_prefab_from_file (const std::string& filename)
 {
-  std::cout << "ObjectManager::add_object_group_from_file(" << filename << ")" 
<< std::endl;
-  xmlDocPtr doc = xmlParseFile(filename.c_str ());
-
-  if (doc)
-    {
-      xmlNodePtr cur = doc->ROOT;
-      WorldObjGroupData* group = new WorldObjGroupData (doc, cur);
-      const EditorObjLst& temp = group->create_EditorObj ();
-      editor_objs.insert(editor_objs.end(),temp.begin(), temp.end());
-      delete group;
-    }
-  else
-    {
-      std::cout << "ObjectManager::add_object_group_from_file: read error: " 
<< filename << std::endl;
-    }
 }
 
 std::vector<ActionData>*

Index: object_manager.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/object_manager.hxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- object_manager.hxx  14 Sep 2002 23:31:12 -0000      1.18
+++ object_manager.hxx  15 Sep 2002 15:30:21 -0000      1.19
@@ -81,7 +81,7 @@
 
   void delete_all_objs();
 
-  void add_object_group_from_file (const std::string& filename);
+  void add_prefab_from_file (const std::string& filename);
 
   std::vector<EditorObj*> rect_get_objs(int x1, int y1, int x2, int y2);
 

Index: object_selector.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/object_selector.cxx,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- object_selector.cxx 15 Sep 2002 09:54:33 -0000      1.17
+++ object_selector.cxx 15 Sep 2002 15:30:21 -0000      1.18
@@ -472,7 +472,7 @@
  
   for (std::vector<std::string>::size_type i = 0; i < dir_lst.size (); ++i)
     {
-      font->print_left(20, 60 + i * 30, to_string(i) + " - " + dir_lst[i]); 
+      font->print_left(20, 60 + i * 30, to_string(i + 1) + " - " + 
dir_lst[i]); 
     }
 
   Display::flip_display();
@@ -483,11 +483,19 @@
     {
       switch (read_key()) 
        {
+       case CL_KEY_1:
+         {
+           std::string prefab_filename = path_manager.complete ("prefabs/") + 
dir_lst[0];
+           std::cout << "prefab_filename: " << prefab_filename << std::endl;
+         }
+         break;
+
        case CL_KEY_ESCAPE: 
          exit_loop = true;
          break;
        }
     }
+
   return EditorObjLst();
 }
 





reply via email to

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