]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Client/src/item_tank.cpp
Se liberan los caños como GPL :-)
[z.facultad/75.42/plaqui.git] / Client / src / item_tank.cpp
index c3fcdaaa305e4fa80cc52f26b9b959fdfddf5182..daeb4e7ce9eb585c165b0a24fcb922ee3515c22b 100644 (file)
@@ -6,10 +6,26 @@ ViewTank::ViewTank(Glib::ustring _name, int orientacion):ViewItem(_name)
 {
        switch (orientacion) {
                case 0:
 {
        switch (orientacion) {
                case 0:
-                       image.set("tanque_e.png");
+                       image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/tanque_e.png");
+                       in_x = 5;
+                       in_y = 16;
+                       out_x = 64-16;
+                       out_y = 64;
+                       offset_x = 0;
+                       offset_y = 0;
+                       item_offset_x = 0;
+                       item_offset_y = 0;
                break;
                case 1:
                break;
                case 1:
-                       image.set("tanque_o.png");
+                       image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/tanque_o.png");
+                       in_x = 64-5;
+                       in_y = 16;
+                       out_x = 16;
+                       out_y = 64;
+                       offset_x = 0;
+                       offset_y = 0;
+                       item_offset_x = 0;
+                       item_offset_y = 0;
        }
        image.show();
        set_size_request();
        }
        image.show();
        set_size_request();
@@ -28,3 +44,18 @@ std::string ViewTank::get_extra()
        return s;
 }
 
        return s;
 }
 
+bool ViewTank::on_image_expose_event(GdkEventExpose *e)
+{
+       Glib::RefPtr<Gdk::Colormap> colormap = Gtk::Widget::get_default_colormap();
+       colormap->alloc_color(color);
+       gc->set_foreground(color);
+       gc->set_background(color);
+       gc->set_line_attributes(6, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER);
+       int w,h;
+       w = image.get_width();
+       h = image.get_height();
+       // TODO : hacer que dibuje arcos en el sentido del codo!
+       if (actual_flow == 0) return true;
+       image.get_window()->draw_arc(gc, 1, w/2-7, h/2-7, 14, 14, 0, 360*64);
+       return true;
+}