summaryrefslogtreecommitdiffstats
path: root/games/seahaven/files
diff options
context:
space:
mode:
Diffstat (limited to 'games/seahaven/files')
-rw-r--r--games/seahaven/files/patch-README15
-rw-r--r--games/seahaven/files/patch-aa16
-rw-r--r--games/seahaven/files/patch-main.C121
3 files changed, 0 insertions, 152 deletions
diff --git a/games/seahaven/files/patch-README b/games/seahaven/files/patch-README
deleted file mode 100644
index de04317..0000000
--- a/games/seahaven/files/patch-README
+++ /dev/null
@@ -1,15 +0,0 @@
---- ../../work.orig/seahaven-1.41/README Mon Aug 5 22:51:21 2002
-+++ README Mon Aug 5 23:38:16 2002
-@@ -56,6 +56,12 @@
-
- ---
-
-+Garrett Wollman <wollman@lcs.mit.edu> modified the program startup
-+and event loop to better conform with the Inter-Client Communications
-+Conventions Manual.
-+
-+---
-+
- Card images from the "spider" game which is:
-
- Copyright (c) 1990 by David Lemke & Network Computing Devices, Inc.
diff --git a/games/seahaven/files/patch-aa b/games/seahaven/files/patch-aa
deleted file mode 100644
index fc39537..0000000
--- a/games/seahaven/files/patch-aa
+++ /dev/null
@@ -1,16 +0,0 @@
---- score.C.org Tue Dec 28 17:35:27 1999
-+++ score.C Tue Dec 28 17:37:37 1999
-@@ -82,8 +82,12 @@
- printLine("%5d game%s played", wins + losses);
- curx = GAMEWIDTH / 4;
- cury = 0;
-- printLine("Winning average: %5.2f%%", 100.0 *
-+ if (wins + losses) {
-+ printLine("Winning average: %5.2f%%", 100.0 *
- ((double) wins / (double) (wins + losses)));
-+ } else {
-+ printLine("Winning Average: N/A", 0, "");
-+ }
- curx = GAMEWIDTH / 2;
- cury = 0;
- if (streak > 0) {
diff --git a/games/seahaven/files/patch-main.C b/games/seahaven/files/patch-main.C
deleted file mode 100644
index 12867d2..0000000
--- a/games/seahaven/files/patch-main.C
+++ /dev/null
@@ -1,121 +0,0 @@
---- ../../work.orig/seahaven-1.41/main.C Mon Aug 5 22:51:21 2002
-+++ main.C Mon Aug 5 23:36:23 2002
-@@ -25,11 +25,21 @@
- exit(1);
- }
-
-+static void Quit() {
-+ XDestroyWindow(dpy, toplevel);
-+ XFlush(dpy);
-+ exit(0);
-+}
-
- main(int argc, char **argv) {
- char *displayname = NULL;
-+ char *name = NULL;
-+ XClassHint *classhint;
-+ XWMHints *wmhints;
-+ XSizeHints *sizehints;
- bool sync = false;
- int i;
-+ Atom wm_protocols, wm_delete_window;
-
- progname = argv[0];
-
-@@ -44,6 +54,10 @@
- } else if (strcmp(argv[i], "-speedup") == 0) {
- speedup = atoi(argv[++i]);
- if (speedup <= 0) Usage();
-+ } else if (strcmp(argv[i], "-name") == 0) {
-+ if (argv[++i] == NULL)
-+ Usage();
-+ name = argv[i];
- } else {
- Usage();
- }
-@@ -69,7 +83,7 @@
-
- XSetWindowAttributes attributes;
- long valuemask = CWEventMask | CWBackPixel;
-- attributes.event_mask = KeyPressMask;
-+ attributes.event_mask = KeyPressMask; /* ClientMessage is always there */
- attributes.background_pixel = backpixel;
-
- toplevel = XCreateWindow(dpy, DefaultRootWindow(dpy), 0, 0,
-@@ -78,6 +92,44 @@
- valuemask, &attributes);
- XSetIconName(dpy, toplevel, "Seahaven");
- XStoreName(dpy, toplevel, "Seahaven Towers");
-+ classhint = XAllocClassHint();
-+ if (!classhint)
-+ Punt("can't allocate memory for class hint");
-+ if (name)
-+ classhint->res_name = name;
-+ else {
-+ classhint->res_name = strrchr(progname, '/');
-+ if (!classhint->res_name)
-+ classhint->res_name = progname;
-+ }
-+ classhint->res_class = "Seahaven";
-+ XSetClassHint(dpy, toplevel, classhint);
-+ XFree(classhint);
-+
-+ /* We don't do focus management -- must tell WM to do it for us, or
-+ otherwise we might not get the focus when initially mapped. */
-+ wmhints = XAllocWMHints();
-+ if (!wmhints)
-+ Punt("can't allocate memory for window manager hints");
-+ wmhints->flags = InputHint | StateHint;
-+ wmhints->input = True;
-+ wmhints->initial_state = NormalState;
-+ XSetWMHints(dpy, toplevel, wmhints);
-+ XFree(wmhints);
-+
-+ /* Let the WM know that we can't be resized. */
-+ sizehints = XAllocSizeHints();
-+ if (!sizehints)
-+ Punt("can't allocate memory for window size hints");
-+ sizehints->flags = PMinSize | PMaxSize;
-+ sizehints->min_width = sizehints->max_width = GAMEWIDTH;
-+ sizehints->min_height = sizehints->max_height = GAMEHEIGHT;
-+ XSetWMNormalHints(dpy, toplevel, sizehints);
-+ XFree(sizehints);
-+
-+ wm_protocols = XInternAtom(dpy, "WM_PROTOCOLS", False);
-+ wm_delete_window = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
-+ XSetWMProtocols(dpy, toplevel, &wm_delete_window, 1);
-
- font = XLoadQueryFont
- (dpy, "-*-helvetica-medium-r-normal--*-120-*-*-p-*-iso8859-1");
-@@ -139,12 +191,15 @@
- case '\033': //esc
- case 'Q':
- case 'q':
-- XUnmapWindow(dpy, toplevel);
-- XFlush(dpy);
-- exit(0);
-+ Quit();
- break;
- }
- }
-+ } else if (event.type == ClientMessage
-+ && event.xclient.message_type == wm_protocols
-+ && event.xclient.format == 32
-+ && *(Atom *)&event.xclient.data == wm_delete_window) {
-+ Quit();
- } else if (event.type == ButtonPress) {
- Window w = event.xbutton.window;
- if (w == undobutton) DoUndo();
-@@ -152,11 +207,7 @@
- else if (w == restartbutton) DoRestart();
- else if (w == autobutton) DoAutoPlay();
- else if (w == newgamebutton) NewGame();
-- else if (w == quitbutton) {
-- XUnmapWindow(dpy, toplevel);
-- XFlush(dpy);
-- exit(0);
-- }
-+ else if (w == quitbutton) Quit();
- }
- }
- }
OpenPOWER on IntegriCloud