Index: gfx.c
--- gfx.c.orig
+++ gfx.c
@@ -16,6 +16,8 @@
#include "defs.h"
#include "globals.h"
+#include <stdlib.h>
+
#ifdef ROUND_CARDS
#include <X11/Xmu/Drawing.h>
@@ -25,8 +27,41 @@
Bool round_cards = True;
#endif
-static GC cardgc; /* gc in use when drawing cards */
+/* definitions of global variables */
+Display *dpy;
+int screen;
+Window table;
+#ifdef KITLESS
+Window message_win;
+XFontStruct *message_font;
+#endif /* KITLESS */
+Pixmap greenmap;
+Pixmap redmap;
+Pixmap logomap;
+
+unsigned long blackpixel;
+unsigned long whitepixel;
+unsigned long borderpixel;
+unsigned long greenpixel;
+
+Bool is_color;
+
+CardList deck;
+CardList stack[NUM_STACKS]; /* tableau */
+CardList piles[NUM_PILES]; /* full suits */
+
+int table_height;
+int table_width;
+
+int draw_count;
+
+Bool restart;
+int deal_number;
+
+
+GC cardgc; /* gc in use when drawing cards */
+
#ifdef KITLESS
static int message_y;
static GC textgc;
@@ -111,6 +146,12 @@ static GC backgc;
static int back_delta_x, back_delta_y; /* how much to modify the TS origin by */
+/* all ints because of K&R promotion rules */
+void draw_did(int suit, int x, int y);
+void draw_center_pip(int suit, int x, int y);
+void draw_six_pips(int suit, int x, int y);
+void draw_eight_pips(int suit, int x, int y);
+
#ifndef SMALL_CARDS
static Bool card_is_clipped; /* optimizer for card drawing */
#endif
@@ -166,7 +207,7 @@ unsigned long redpixel;
gcflags |= GCFont;
textgc = XCreateGC(dpy, RootWindow(dpy, screen), gcflags, &gcv);
-#endif KITLESS
+#endif
tmpmap = XCreateBitmapFromData(dpy, RootWindow(dpy, screen),
logo_bits, logo_width, logo_height);
@@ -566,6 +607,7 @@ force_redraw()
*
* REMIND -- spread the deck a bit to show that there's more
*/
+void
redraw_deck(x, y, w, h)
int x, y, w, h;
{
@@ -599,6 +641,7 @@ CardPtr tmp;
}
+void
redraw_card_piles(x, y, w, h)
int x, y, w, h;
{
@@ -641,6 +684,7 @@ CardPtr tmp;
}
+void
redraw_card_stacks(x, y, w, h)
int x, y, w, h;
{
@@ -1011,6 +1055,7 @@ int w, h;
*
* location is for center of pip
*/
+void
draw_did(suit, x, y)
Suit suit;
int x,y;
@@ -1051,6 +1096,7 @@ int w, h;
/*
* draws big center pip
*/
+void
draw_center_pip(suit, x, y)
Suit suit;
int x,y;
@@ -1110,6 +1156,7 @@ int x,y;
draw_did(suit, x + CARD_COL3_X, y + CARD_ROW5_Y);
}
+void
draw_six_pips(suit, x, y)
Suit suit;
int x, y;
@@ -1129,6 +1176,7 @@ int x, y;
draw_did(suit, x + CARD_COL3_X, y + CARD_ROW5_Y);
}
+void
draw_eight_pips(suit, x, y)
Suit suit;
int x,y;