The attached patch is work in progress, addition of image capture
support to COW on Linux.  Contributions welcome.

At the moment, all it does is take a snapshot of the whole screen and
write it to a PNG file.  It does this on a coup request.  ;-)

Possible future enhancements:

- take a snapshot of only the main window, (working on that),

- take a snapshot of only the tactical window,

- write to files named after frame number of recording or game,

- generate a frame for every frame of a game recording,

- generate multiple layers for animated playback,

- generate RSS XML for notable events like last few seconds of an LPS,
  with the feed containing the animated playback, for netrek.org,

- operate against a virtual frame buffer under automated control after
  being triggered by the INL robot for end of game condition.

-- 
James Cameron    mailto:quozl at us.netrek.org     http://quozl.netrek.org/
-------------- next part --------------
Index: input.c
===================================================================
RCS file: /cvsroot/netrek/client/cow/input.c,v
retrieving revision 1.12
diff -u -u -r1.12 input.c
--- input.c	16 May 2006 06:25:25 -0000	1.12
+++ input.c	16 May 2006 09:41:57 -0000
@@ -1981,6 +1981,7 @@
 Key67(void)
 {
   sendCoupReq();
+  camera_snap();
 }
 
 Key68(void)
Index: system.mk.in
===================================================================
RCS file: /cvsroot/netrek/client/cow/system.mk.in,v
retrieving revision 1.7
diff -u -u -r1.7 system.mk.in
--- system.mk.in	31 Jan 2006 18:34:06 -0000	1.7
+++ system.mk.in	16 May 2006 09:41:58 -0000
@@ -72,7 +72,7 @@
 	          netstat.o netstatopt.o spopt.o dashboard.o dashboard3.o \
 	          short.o distress.o senddist.o defwin.o tools.o sound.o\
 		  docwin.o cflags.o beeplite.o feature.o\
-		  string_util.o local.o censor.o cowmain.o
+		  string_util.o local.o censor.o cowmain.o camera.o
 
 RSRC 		= check.c colors.c data.c death.c defaults.c dmessage.c\
 	          enter.c findslot.c getname.c getship.c helpwin.c inform.c\
@@ -83,7 +83,7 @@
                   lagmeter.c netstat.c netstatopt.c spopt.c dashboard.c dashboard3.c \
 		  short.c distress.c senddist.c defwin.c tools.c sound.c\
 		  docwin.c cflags.c beeplite.c feature.c reserved.c\
-		  string_util.c local.c censor.c cowmain.c
+		  string_util.c local.c censor.c cowmain.c camera.c
 
 
 INCLUDES 	= struct.h packets.h defs.h copyright.h bitmaps.h data.h\
@@ -113,7 +113,7 @@
 
 netrek: $(RSAOBJ) $(PMAKE) null $(ROBJ) $(MAINOBJ) $(INPUTOBJ) $(X11OBJ) $(WIN32OBJ)  $(RANDOMOBJ) cflags.c randomize
 	$(CC) $(LFLAGS) -o netrek `./randomize $(ROBJ) $(RSAOBJ) $(INPUTOBJ) \
-	$(MAINOBJ) $(X11OBJ) $(WIN32OBJ) $(RANDOMOBJ)` $(LIBRARIES)
+	$(MAINOBJ) $(X11OBJ) $(WIN32OBJ) $(RANDOMOBJ)` $(LIBRARIES) -lgiblib
 
 netrek.shared: done.libcow $(MAINOBJ) $(COWAPI)
 	$(CC) $(LFLAGS) $(MAINOBJ) -L. -lcow $(LIBS) -o netrek.shared
Index: x11window.c
===================================================================
RCS file: /cvsroot/netrek/client/cow/x11window.c,v
retrieving revision 1.7
diff -u -u -r1.7 x11window.c
--- x11window.c	16 May 2006 06:25:25 -0000	1.7
+++ x11window.c	16 May 2006 09:42:06 -0000
@@ -456,6 +456,7 @@
   /* tmp */
   /* XSynchronize(W_Display, True); */
   /* XSetErrorHandler(_myerror); */
+  camera_set_display(W_Display);
 
   W_Root = DefaultRootWindow(W_Display);
 
@@ -1006,6 +1007,9 @@
 			    CWBorderPixel,
 			    &attrs),
 		      WIN_GRAPH);
+  if (strcmp(name, "netrek") == 0) {
+    camera_set_window(newwin, width, height);
+  }
   /* top window */
   sz_hints = XAllocSizeHints();
   if (strcmp(name, "netrek") == 0 || strcmp(name, "wait") == 0 ||
-------------- next part --------------
A non-text attachment was scrubbed...
Name: camera.c
Type: text/x-csrc
Size: 1821 bytes
Desc: not available
Url : http://mailman.us.netrek.org/pipermail/netrek-dev/attachments/20060516/f68d2528/attachment.c 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.us.netrek.org/pipermail/netrek-dev/attachments/20060516/f68d2528/attachment.pgp