- tx=u*tile_w;
- ty=v*tile_w;
-
- drawable->draw_pixbuf(
- gc, //GC
- tile_book[index].first, //pixbuf
- 0, 0, // Source X and Y
- round_to_int(x)+tx,round_to_int(y)+ty, // Dest X and Y
- -1,-1, // Width and Height
- Gdk::RGB_DITHER_MAX, // RgbDither
- 2, 2 // Dither offset X and Y
- );
+ int index=v*width_in_tiles+u;
+ if(int(tile_book.size())>index && tile_book[index].first)
+ {
+ tx=u*tile_w;
+ ty=v*tile_w;
+
+ drawable->draw_pixbuf(
+ gc, //GC
+ tile_book[index].first, //pixbuf
+ 0, 0, // Source X and Y
+ round_to_int(x)+tx,round_to_int(y)+ty, // Dest X and Y
+ -1,-1, // Width and Height
+ Gdk::RGB_DITHER_MAX, // RgbDither
+ 2, 2 // Dither offset X and Y
+ );
+ }
+ if(tile_book[index].second!=get_refreshes())
+ needs_refresh=true;