Author: esr
Date: Sun Oct 12 04:44:32 2008
New Revision: 30070

URL: http://svn.gna.org/viewcvs/wesnoth?rev=30070&view=rev
Log:
trackplacer: we've got map rendering, but the colors are wrong.

Modified:
    trunk/data/tools/trackplacer

Modified: trunk/data/tools/trackplacer
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/trackplacer?rev=30070&r1=30069&r2=30070&view=diff
==============================================================================
--- trunk/data/tools/trackplacer (original)
+++ trunk/data/tools/trackplacer Sun Oct 12 04:44:32 2008
@@ -129,6 +129,9 @@
         self.log("about to read map %s" % self.journey.filename)
         try:
             self.map = gtk.gdk.pixbuf_new_from_file(self.journey.filename)
+            self.map_width = self.map.get_width()
+            self.map_height = self.map.get_height()
+            self.map = self.map.render_pixmap_and_mask()[0]
         except gtk.Gerror:
             self.fatal_error("Error while reading background map %s" % 
self.journey.filename)
         # Now get the icons we'll need for scribbling on the map with.
@@ -153,7 +156,7 @@
 
         # Create the drawing area
         self.drawing_area = gtk.DrawingArea()
-        self.drawing_area.set_size_request(self.map.get_width(), 
self.map.get_height())
+        self.drawing_area.set_size_request(self.map_width, self.map_height)
         vbox.pack_start(self.drawing_area, True, True, 0)
 
         self.drawing_area.show()
@@ -188,18 +191,16 @@
     def refresh_map(self, x=0, y=0, xs=-1, ys=-1):
         "Refresh part of the drawing area with the apprpriate map rectangle."
         if xs == -1:
-            xs = self.map.get_width() - x
+            xs = self.map_width - x
         if ys == -1:
-            ys = self.map.get_height() - y
-        #self.map.copy_area(x, y, xs, ys, self.pixmap, x, y)
+            ys = self.map_height - y
+        self.map.copy_area(x, y, xs, ys, self.pixmap, x, y)
 
     # Create a new backing pixmap of the appropriate size
     def configure_event(self, widget, event):
         x, y, width, height = widget.get_allocation()
         self.pixmap = gtk.gdk.Pixmap(widget.window, width, height)
-        self.pixmap.draw_rectangle(widget.get_style().white_gc,
-                                   True, 0, 0, width, height)
-        #self.refresh_map()
+        self.refresh_map()
         return True
 
     # Redraw the screen from the backing pixmap


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to