pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r2585 - trunk/src/editor


From: jave27
Subject: [Pingus-CVS] r2585 - trunk/src/editor
Date: Mon, 9 Jan 2006 22:28:50 +0100

Author: jave27
Date: 2006-01-09 22:28:30 +0100 (Mon, 09 Jan 2006)
New Revision: 2585

Modified:
   trunk/src/editor/context_menu.cxx
   trunk/src/editor/context_menu.hxx
   trunk/src/editor/level_objs.cxx
Log:
Added (very) basic z position changes to editor.

Modified: trunk/src/editor/context_menu.cxx
===================================================================
--- trunk/src/editor/context_menu.cxx   2006-01-09 18:17:45 UTC (rev 2584)
+++ trunk/src/editor/context_menu.cxx   2006-01-09 21:28:30 UTC (rev 2585)
@@ -131,6 +131,11 @@
                                case (SET_DIRECTION) :
                                        
objs[i]->set_direction(actions[selected_action_offset].parameter);
                                        break;
+                               case (SET_Z_POS) :
+                                       
objs[i]->set_pos(Vector(objs[i]->get_pos().x, objs[i]->get_pos().y, 
+                                               
CL_String::to_int(actions[selected_action_offset].parameter)));
+                                       
objs[i]->set_orig_pos(objs[i]->get_pos());
+                                       break;
                                default :
                                        break;
                                }
@@ -191,6 +196,15 @@
                        menu->add_action(ContextItem("Misc.", "misc", 
SET_DIRECTION, 0));
                        add_action(ContextItem("Direction >", "", 
SET_DIRECTION, menu));
                }
+               menu = new ContextMenu(objs, Vector(pos.x + width, pos.y), 
viewport, false);
+               viewport->get_screen()->get_gui_manager()->add(menu);
+               menu->add_action(ContextItem("-50", "-50", SET_Z_POS, 0));
+               menu->add_action(ContextItem("-25", "-25", SET_Z_POS, 0));
+               menu->add_action(ContextItem("0", "0", SET_Z_POS, 0));
+               menu->add_action(ContextItem("25", "25", SET_Z_POS, 0));
+               menu->add_action(ContextItem("50", "50", SET_Z_POS, 0));
+               add_action(ContextItem("Set Z Pos. >", "", SET_Z_POS, menu));
+               
                // TODO - Add more menu options here
        }
 

Modified: trunk/src/editor/context_menu.hxx
===================================================================
--- trunk/src/editor/context_menu.hxx   2006-01-09 18:17:45 UTC (rev 2584)
+++ trunk/src/editor/context_menu.hxx   2006-01-09 21:28:30 UTC (rev 2585)
@@ -32,7 +32,8 @@
        class EditorViewport;
        class ContextMenu;
 
-       typedef enum ItemModifier { REMOVE, ROTATE, SET_OWNER, SET_DIRECTION, 
STRETCH };
+       typedef enum ItemModifier { REMOVE, ROTATE, SET_OWNER, SET_DIRECTION, 
+               STRETCH, SET_Z_POS };
 
        class ContextItem {
        public:

Modified: trunk/src/editor/level_objs.cxx
===================================================================
--- trunk/src/editor/level_objs.cxx     2006-01-09 18:17:45 UTC (rev 2584)
+++ trunk/src/editor/level_objs.cxx     2006-01-09 21:28:30 UTC (rev 2585)
@@ -75,14 +75,14 @@
                if (attribs & HAS_WIDTH)
                {
                        for(int x = static_cast<int>(pos.x); x < pos.x + width; 
x += sprite.get_width())
-                               gc.draw(sprite, Vector(static_cast<float>(x), 
pos.y));
+                               gc.draw(sprite, Vector(static_cast<float>(x), 
pos.y, pos.z));
                }
                else if(attribs & HAS_STRETCH)
                {
                        // Surface Background - tile it
                        for (int x = 0; x < level->size.width; x += 
sprite.get_width())
                                for (int y = 0; y < level->size.height; y += 
sprite.get_height())
-                                       gc.draw(sprite, Vector((float)x, 
(float)y));
+                                       gc.draw(sprite, Vector((float)x, 
(float)y, pos.z));
                }
                else
                        gc.draw(sprite, pos);
@@ -192,7 +192,7 @@
                const unsigned attribs = get_attributes(section_name);
 
                // Write information about the main sprite
-               if (attribs & HAS_SURFACE && !(attribs & HAS_SURFACE_FAKE))
+               if (attribs & HAS_SURFACE)
                {
                        xml.begin_section("surface");
                        xml.write_string("image", desc.res_name);





reply via email to

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