Make draw handle for board globally available
[xboard.git] / draw.c
diff --git a/draw.c b/draw.c
index 7571850..668e4a5 100644 (file)
--- a/draw.c
+++ b/draw.c
@@ -111,7 +111,7 @@ extern char *getenv();
 #define OUTLINE 1
 Boolean cairoAnimate;
 Option *currBoard;
-static cairo_surface_t *csBoardWindow;
+cairo_surface_t *csBoardWindow;
 static cairo_surface_t *pngPieceImages[2][(int)BlackPawn+4];   // png 256 x 256 images
 static cairo_surface_t *pngPieceBitmaps[2][(int)BlackPawn];    // scaled pieces as used
 static cairo_surface_t *pngPieceBitmaps2[2][(int)BlackPawn+4]; // scaled pieces in store
@@ -429,11 +429,15 @@ void DrawSeekDot(int x, int y, int colorNr)
     cairo_destroy (cr);
 }
 
+void
+InitDrawingHandle (Option *opt)
+{
+    csBoardWindow = DRAWABLE(opt);
+}
+
 void
 DrawSeekOpen ()
 {
-    csBoardWindow = (cairo_surface_t *) mainOptions[W_BOARD].choice;
-    currBoard = &mainOptions[W_BOARD];
 }
 
 void