argv@island.uu.net (Dan Heller) (11/30/89)
Submitted-by: uunet!kddlab!isl.yamaha.co.jp!shutoh (Kazuhiko Shutoh) Posting-number: Volume 5, Issue 34 Archive-name: xpclock/patch1 Patch-To: xpclock: Volume 5, Issue 25 The following shell archive contains new files and patch for xpclock. This patch makes more realistic movement pendulum. Many thanks to Sjaak Schilperoort(JW_Schilperoort@pttrnl.nl). Kazuhiko Shutoh shutoh%isl.yamaha.co.jp%kddlab@uunet.uu.net ----- CUT HERE ----- CUT HERE ----- CUT HERE ----- CUT HERE ----- CUT HERE -- #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of shell archive." # Contents: README.patch1 patchlevel.h xpclock.patch1 # Wrapped by shutoh@shako on Wed Nov 29 15:17:11 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'README.patch1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'README.patch1'\" else echo shar: Extracting \"'README.patch1'\" \(274 characters\) sed "s/^X//" >'README.patch1' <<'END_OF_FILE' XSCCS ID : @(#)README.patch1 1.1 11/29/89 X X X xpclock official patch #1 X X XThis patch was proposal by Sjaak Schilperoort.(JW_Schilperoort@pttrnl.nl). XSuppose apply this patch, more realistic movement pendulum. X XMany, many thanks to Sjaak. X X Kazuhiko Shutoh X X X END_OF_FILE if test 274 -ne `wc -c <'README.patch1'`; then echo shar: \"'README.patch1'\" unpacked with wrong size! fi # end of 'README.patch1' fi if test -f 'patchlevel.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'patchlevel.h'\" else echo shar: Extracting \"'patchlevel.h'\" \(628 characters\) sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE' X/* X* SCCS ID : @(#)patchlevel.h 1.1 11/29/89 X* X* patchlevel.h - Patch level maintenance header X* X* Author: Kazuhiko Shutoh, 1989. X* X* Permission to use, copy, modify and distribute without charge this X* software, documentation, images, etc. is granted, provided that this X* comment and the author's name is retained. The author assumes no X* responsibility for lost sleep as a consequence of use of this software. X* X* Send any comments, bug reports, etc. to: shutoh@isl.yamaha.co.jp or, X* for oversea: shutoh%isl.yamaha.co.jp%kddlab@uunet.uu.net X* X*/ X X#define PATCHLEVEL 1 END_OF_FILE if test 628 -ne `wc -c <'patchlevel.h'`; then echo shar: \"'patchlevel.h'\" unpacked with wrong size! fi # end of 'patchlevel.h' fi if test -f 'xpclock.patch1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xpclock.patch1'\" else echo shar: Extracting \"'xpclock.patch1'\" \(2217 characters\) sed "s/^X//" >'xpclock.patch1' <<'END_OF_FILE' Xdiff -c ../old/Imakefile ./Imakefile X*** ../old/Imakefile Wed Nov 29 14:32:24 1989 X--- ./Imakefile Wed Nov 29 14:33:02 1989 X*************** X*** 1,4 **** X! # SCCS ID : @(#)Imakefile 1.5 11/11/89 X # X # Imakefile - Imakefile for xpclock X # X--- 1,4 ---- X! # SCCS ID : @(#)Imakefile 1.6 11/29/89 X # X # Imakefile - Imakefile for xpclock X # X*************** X*** 24,30 **** X #CC = gcc X CC = cc X X! #DEBUGFLAGS = -g X CDEBUGFLAGS = -O X X ComplexProgramTarget(xpclock) X--- 24,30 ---- X #CC = gcc X CC = cc X X! #CDEBUGFLAGS = -g X CDEBUGFLAGS = -O X X ComplexProgramTarget(xpclock) XOnly in .: README.patch1 XOnly in .: patchlevel.h Xdiff -c ../old/xpclock.c ./xpclock.c X*** ../old/xpclock.c Wed Nov 29 14:32:26 1989 X--- ./xpclock.c Wed Nov 29 14:33:32 1989 X*************** X*** 1,4 **** X! static char sccsid[] = "@(#)xpclock.c 1.7 11/1/89"; X /* X * xpclock.c - Pendulum Clock for X11 X * X--- 1,4 ---- X! static char sccsid[] = "@(#)xpclock.c 1.8 11/29/89"; X /* X * xpclock.c - Pendulum Clock for X11 X * X*************** X*** 27,32 **** X--- 27,33 ---- X X #include "xpclock.h" X #include "xpclock.icon" X+ #include "patchlevel.h" X X XtTimerCallbackProc MovePendulum(); X XtCallbackProc RedrawPendulum(); X*************** X*** 159,164 **** X--- 160,166 ---- X static double old_pendulum_theta; X static int old_pendulum_x = 0; X static int old_pendulum_y = 0; X+ static int pendulum_moment_count = 0; X X if ((pendulum_x != 0) && (pendulum_y != 0)) { X old_pendulum_theta = pendulum_theta; X*************** X*** 165,175 **** X old_pendulum_x = pendulum_x; X old_pendulum_y = pendulum_y; X } X- if ((pendulum_theta + pendulum_vector < 0) || X- (pendulum_theta + pendulum_vector > 45)) X- pendulum_vector = -pendulum_vector; X X! pendulum_theta += (double) pendulum_vector; X X XtSetArg(args[0], XtNheight, 0); X XtSetArg(args[1], XtNwidth, 0); X--- 167,176 ---- X old_pendulum_x = pendulum_x; X old_pendulum_y = pendulum_y; X } X X! pendulum_theta = (22.5 * sin((double)pendulum_moment_count * 2 X! * PI / 45) + 22.5); X! pendulum_moment_count++; X X XtSetArg(args[0], XtNheight, 0); X XtSetArg(args[1], XtNwidth, 0); XOnly in .: xpclock.patch1 END_OF_FILE if test 2217 -ne `wc -c <'xpclock.patch1'`; then echo shar: \"'xpclock.patch1'\" unpacked with wrong size! fi # end of 'xpclock.patch1' fi echo shar: End of shell archive. exit 0