pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r2572 - in trunk/src: . editor


From: jave27
Subject: [Pingus-CVS] r2572 - in trunk/src: . editor
Date: Tue, 3 Jan 2006 18:19:32 +0100

Author: jave27
Date: 2006-01-03 18:19:28 +0100 (Tue, 03 Jan 2006)
New Revision: 2572

Modified:
   trunk/src/blitter_impl.hxx
   trunk/src/editor/level_objs.cxx
   trunk/src/editor/level_objs.hxx
Log:
Minor cleanup and added restriction to rotate-able objects.

Modified: trunk/src/blitter_impl.hxx
===================================================================
--- trunk/src/blitter_impl.hxx  2005-12-29 22:10:36 UTC (rev 2571)
+++ trunk/src/blitter_impl.hxx  2006-01-03 17:19:28 UTC (rev 2572)
@@ -223,8 +223,8 @@
       int pwidth  = prov.get_width();
       int pheight = prov.get_height();
       
-      for (int y = 0; y < prov.get_height (); ++y)
-        for (int x = 0; x < prov.get_width (); ++x)
+      for (int y = 0; y < pheight; ++y)
+        for (int x = 0; x < pwidth; ++x)
           {
             CL_Color color = prov.get_pixel(x, y);
             canvas.draw_pixel(TransF::get_x(pwidth, pheight, x, y),

Modified: trunk/src/editor/level_objs.cxx
===================================================================
--- trunk/src/editor/level_objs.cxx     2005-12-29 22:10:36 UTC (rev 2571)
+++ trunk/src/editor/level_objs.cxx     2006-01-03 17:19:28 UTC (rev 2572)
@@ -58,7 +58,7 @@
 LevelObj::set_res_desc(const ResDescriptor d)
 {
        desc = d;
-       sprite = Resource::load_sprite(desc);
+       refresh_sprite();
 }
 
 // Draw the sprite
@@ -70,7 +70,7 @@
                // If selected, draw a highlighted box around it
                if (selected)
                        gc.draw_rect(pos.x, pos.y, pos.x + sprite.get_width(), 
-                               pos.y + sprite.get_height(), 
CL_Color(255,255,255,150));
+                               pos.y + sprite.get_height(), 
CL_Color(255,255,255,150), 5000);
                if (attribs & HAS_WIDTH)
                {
                        for(int x = static_cast<int>(pos.x); x < pos.x + width; 
x += sprite.get_width())
@@ -99,18 +99,6 @@
                return false;
 }
 
-void 
-LevelObj::on_primary_button_click (int x, int y)
-{
-       UNUSED_ARG(x);
-       UNUSED_ARG(y);
-       pos.x += 10;
-       // FIXME: Remove debugging stuff.
-       std::cout << "New pos.x: " << pos.x << ", y: " << pos.y 
-               << ", end spot: x: " << pos.x + sprite.get_width() << ", y: "
-               << pos.y + sprite.get_height() << std::endl;
-}
-
 void
 LevelObj::set_stretch_x(const bool s)
 { 
@@ -179,7 +167,8 @@
 LevelObj::set_modifier(const std::string m)
 {
        // Set modifier
-       desc.modifier = ResourceModifierNS::rs_from_string(m);
+       if (attribs & CAN_ROTATE)
+               desc.modifier = ResourceModifierNS::rs_from_string(m);
        refresh_sprite();
 }
 

Modified: trunk/src/editor/level_objs.hxx
===================================================================
--- trunk/src/editor/level_objs.hxx     2005-12-29 22:10:36 UTC (rev 2571)
+++ trunk/src/editor/level_objs.hxx     2006-01-03 17:19:28 UTC (rev 2572)
@@ -44,15 +44,16 @@
        const unsigned HAS_DIRECTION = 512;
        const unsigned HAS_RELEASE_RATE = 1024;
        const unsigned HAS_SURFACE = 2048;
+       const unsigned CAN_ROTATE = 4096;
 
        /** Returns a number representing which attributes this object 
possesses */
        inline unsigned int get_attributes(std::string obj_type)
        {
                unsigned val;
                if (obj_type == "groundpiece")
-                       val = HAS_TYPE | HAS_SURFACE;
+                       val = HAS_TYPE | HAS_SURFACE | CAN_ROTATE;
                else if (obj_type == "hotspot")
-                       val = HAS_SPEED | HAS_PARALLAX | HAS_SURFACE;
+                       val = HAS_SPEED | HAS_PARALLAX | HAS_SURFACE | 
CAN_ROTATE;
                else if (obj_type == "liquid")
                        val = HAS_SPEED | HAS_WIDTH | HAS_SURFACE;
                else if (obj_type == "surface-background")
@@ -294,10 +295,6 @@
        /** Returns true if the mouse is hovering over this object */
   virtual bool is_at (int x, int y);
 
-       /** Action taken when the primary mouse button is clicked */
-       virtual void on_primary_button_click (int x, int y);
-
-
        /** Default Constructor */
        LevelObj(const std::string obj_name, LevelImpl* level_);
 





reply via email to

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