]> git.hungrycats.org Git - xscreensaver/commitdiff
From http://www.jwz.org/xscreensaver/xscreensaver-5.43.tar.gz
authorZygo Blaxell <zblaxell@waya.furryterror.org>
Mon, 4 Nov 2019 19:20:58 +0000 (14:20 -0500)
committerZygo Blaxell <zblaxell@waya.furryterror.org>
Mon, 4 Nov 2019 20:02:18 +0000 (15:02 -0500)
-rw-rw-r-- 1 zblaxell zblaxell 26973508 Jul  9 23:37 xscreensaver-5.43.tar.gz
7a0e24b224e1316f0a211446db301de1c22daaa0  xscreensaver-5.43.tar.gz

12 files changed:
Makefile.in
OSX/Makefile
OSX/bindist.rtf
OSX/updates.pl
OSX/updates.xml
driver/XScreenSaver.ad.in
hacks/config/README
hacks/glx/Makefile.in
hacks/glx/deepstars.c [new file with mode: 0644]
hacks/glx/deepstars.man [new file with mode: 0644]
po/POTFILES.in
utils/version.h

index a94868146bfa2996dd16ecf3ef6ff792320de598..e0795b2f52fef72cff54a2e3cf9a9c8bb900a272 100644 (file)
@@ -18,8 +18,11 @@ TARFILES     = README README.hacking README.VMS INSTALL \
 
 TAR            = tar
 
-MAKE_SUBDIR  = for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) $@) || exit 5; done
-MAKE_SUBDIR2 = for dir in $(SUBDIRS2); do (cd $$dir; $(MAKE) $@) || exit 5; done
+# Using $(MAKE) directly means the shell executes things even with "make -n"
+MAKE2 = $(MAKE)
+
+MAKE_SUBDIR  = for dir in $(SUBDIRS); do (cd $$dir; $(MAKE2) $@) || exit 5; done
+MAKE_SUBDIR2 = for dir in $(SUBDIRS2); do (cd $$dir; $(MAKE2) $@) || exit 5; done
 
 default::
        @+$(MAKE_SUBDIR)
@@ -42,9 +45,9 @@ uninstall-man::
 depend::
        @$(MAKE_SUBDIR)
 distdepend::
-       @$(MAKE) update_spec_version
+       @$(MAKE2) update_spec_version
        @$(MAKE_SUBDIR2)
-       @cd po ; $(MAKE) update-po
+       @cd po ; $(MAKE2) update-po
 
 TAGS:: tags
 tags::
@@ -64,8 +67,8 @@ tar::
        @                                                                   \
   sh config.status ;                                                       \
   rm -f configure ;                                                        \
-  $(MAKE) configure ;                                                      \
-  $(MAKE) version-date distdepend ;                                        \
+  $(MAKE2) configure ;                                                     \
+  $(MAKE2) version-date distdepend ;                                       \
   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ;  \
   NAME="xscreensaver-$$VERS" ;                                             \
   rm -rf $$NAME ; ln -s . $$NAME ;                                         \
@@ -74,7 +77,7 @@ tar::
   for subdir in $(SUBDIRS2) ; do                                           \
     d=`pwd` ;                                                              \
     cd $$subdir ;                                                          \
-    FILES="$$FILES `$(MAKE) echo_tarfiles                                  \
+    FILES="$$FILES `$(MAKE2) echo_tarfiles                                 \
       | grep -v '^.*make\['                                                \
       | sed \"s|^|$$subdir/|g;s| | $$subdir/|g\"                           \
       ` ";                                                                 \
@@ -231,9 +234,9 @@ rpm::
   ls -lFG xscreensaver*-$$VERS-*.rpm
 
 dmg::
-       $(MAKE) -C OSX release dmg
+       $(MAKE2) -C OSX release dmg
 apk::
-       $(MAKE) -C android apk
+       $(MAKE2) -C android apk
 
 www::
        @                                                                   \
@@ -256,7 +259,7 @@ www::
     exit 1 ;                                                               \
   fi ;                                                                     \
                                                                            \
-  $(MAKE) -C OSX updates.xml ;                                             \
+  $(MAKE2) -C OSX updates.xml ;                                                    \
                                                                            \
   if [ ! -f $$NAME ]; then                                                 \
     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;        \
@@ -331,7 +334,7 @@ www::
                                                                            \
   git add $$BNAME $$BNAME2 $$BNAME3 ;                                      \
                                                                            \
-  $(MAKE) -C ../ xscreensaver/changelog.html xscreensaver/screenshots/index.html; \
+  $(MAKE2) -C ../ xscreensaver/changelog.html xscreensaver/screenshots/index.html; \
   git diff changelog.html ;                                                \
   set +x ;                                                                 \
                                                                            \
index bf1f6c615c13d90bcff2fd7b9da4207fbde481a7..4f2312b3c959985e4dd45a7f65be5f4a39953321 100644 (file)
@@ -228,7 +228,7 @@ update_plist_version:
 
 updates.xml::
        ./updates.pl xscreensaver ../README ../archive ~/www/xscreensaver
-       @$(MAKE) test_sig
+       @$(MAKE) $(MAKEFLAGS) test_sig
 
 test_sig::
        @                                                                   \
@@ -243,6 +243,9 @@ test_sig::
   SIGB=/tmp/$$NN.sig ;                                                     \
   HASH=/tmp/$$NN.hash ;                                                            \
   rm -f "$$SIGB" "$$HASH" ;                                                \
+  if ( echo "$$SIG" | grep -qi ERROR ); then                               \
+    echo "No signature in updates.xml" >&2 ; exit 1 ;                      \
+  fi ;                                                                     \
   echo "$$SIG " | base64 -D  > "$$SIGB" ;                                  \
   set -e ;                                                                 \
   for OPENSSL in /usr/bin/openssl /opt/local/bin/openssl ; do              \
@@ -375,6 +378,8 @@ _dmg::
                                                                              \
   hdiutil makehybrid -quiet -ov -hfs -hfs-volume-name "$$VOLNAME"            \
     -hfs-openfolder "$$STAGE" "$$STAGE" -o "$$TMPDMG" ;                              \
+  echo "Chowning back and deleting..." ;                                     \
+  sudo chown -R `whoami` "$$STAGE/"* ;                                       \
   rm -rf "$$STAGE" ;                                                         \
                                                                              \
   hdiutil convert -quiet -ov -format UDBZ -imagekey zlib-level=9             \
@@ -386,7 +391,7 @@ _dmg::
   spctl --assess --type install "$$DMG" ;                                    \
                                                                              \
   ls -ldhgF "$$DMG" ;                                                        \
-  $(MAKE) notarize ;                                                         \
+  $(MAKE) $(MAKEFLAGS) notarize ;                                            \
 
 
 # To set up notarization:
@@ -420,12 +425,16 @@ notarize::
     --file "$$DMG" $(NOTARGS) ;                                                      \
   echo "" ;                                                                  \
   sleep 3 ;                                                                  \
-  $(MAKE) notarize_wait staple updates.xml
+  $(MAKE) $(MAKEFLAGS) notarize_wait staple updates.xml
 
 notarize_wait::
-       @while ( xcrun altool --notarization-history 0 $(NOTARGS) |           \
+       @TODAY=`date +%Y-%m-%d` ;                                             \
+        while ( xcrun altool --notarization-history 0 $(NOTARGS) |           \
+                grep "$$TODAY" |                                             \
                 grep -q 'in progress' ); do                                  \
          echo `date +%I:%M:` "waiting for notarization..." ;                 \
+         xcrun altool --notarization-history 0 $(NOTARGS) |                  \
+                grep "$$TODAY" ;                                             \
          sleep 15 ;                                                          \
        done ;                                                                \
        echo '' ;                                                             \
index f6191e141c9e69d02fd15cfe1b0ab10bcaeed30b..5977055638708c08b6f6077b1e4ec6c2fdf7ec4b 100644 (file)
@@ -17,7 +17,7 @@
 and many others\
 \
 version 5.43\
-01-Jul-2019\
+09-Jul-2019\
 \
 {\field{\*\fldinst{HYPERLINK "https://www.jwz.org/xscreensaver/"}}{\fldrslt \cf2 \ul \ulc2 https://www.jwz.org/xscreensaver/}}\
 \pard\pardeftab720
index 9249154930e61b0931bc29fcf682d7df0c0204df..21ead069c25d81bd659868bf873970e1afc0fb4b 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# Copyright © 2013-2018 Jamie Zawinski <jwz@jwz.org>
+# Copyright © 2013-2019 Jamie Zawinski <jwz@jwz.org>
 #
 # Permission to use, copy, modify, distribute, and sell this software and its
 # documentation for any purpose is hereby granted without fee, provided that
@@ -21,7 +21,7 @@ use open ":encoding(utf8)";
 use POSIX;
 
 my $progname = $0; $progname =~ s@.*/@@g;
-my ($version) = ('$Revision: 1.5 $' =~ m/\s(\d[.\d]+)\s/s);
+my ($version) = ('$Revision: 1.6 $' =~ m/\s(\d[.\d]+)\s/s);
 
 my $verbose = 0;
 my $debug_p = 0;
@@ -54,6 +54,8 @@ sub generate_xml($$$$) {
       my ($sig2) = ($item =~ m/edSignature="(.*?)"/si);
       my ($date) = ($item =~ m/<pubDate>(.*?)</si);
       next unless $v;
+      $sig1 = '' if ($sig1 eq 'ERROR');
+      $sig2 = '' if ($sig2 eq 'ERROR');
       $sig1s{$v}  = $sig1 if $sig1;
       $sig2s{$v}  = $sig2 if $sig2;
       $dates{$v} = $date if $date;
@@ -129,14 +131,20 @@ sub generate_xml($$$$) {
     if (!$sig1 && $zip) {      # Old-style sigs
       local %ENV = %ENV;
       $ENV{PATH} = "/usr/bin:$ENV{PATH}";
-      $sig1 = `$dsa_sign_update "$archive_dir/$zip" "$dsa_priv_key_file"`;
+      my $cmd = ("$dsa_sign_update" .
+                 " \"$archive_dir/$zip\"" .
+                 " \"$dsa_priv_key_file\"");
+      print STDERR "$progname: exec: $cmd\n" if ($verbose > 1);
+      $sig1 = `$cmd`;
       $sig1 =~ s/\s+//gs;
     }
 
     if (!$sig2 && $zip) {      # New-style sigs
       local %ENV = %ENV;
       $ENV{PATH} = "/usr/bin:$ENV{PATH}";
-      my $xml = `$edddsa_sign_update "$archive_dir/$zip"`;
+      my $cmd = "$edddsa_sign_update \"$archive_dir/$zip\"";
+      print STDERR "$progname: exec: $cmd\n" if ($verbose > 1);
+      my $xml = `$cmd`;
       ($sig2) = ($xml =~ m/sparkle:edSignature=\"([^\"<>\s]+)\"/si);
       error ("unparsable: $edddsa_sign_update: $xml") unless $sig2;
     }
index e782f72662c43fc87ec9a8e485f5f2845f0ed30c..2948b6c6e084e4e1af442935321129b4381e1737 100644 (file)
@@ -7,6 +7,18 @@
   <link>https://www.jwz.org/xscreensaver/updates.xml</link>
   <description>Updates to xscreensaver.</description>
   <language>en</language>
+  <item>
+   <title>Version 5.43</title>
+   <link>https://www.jwz.org/xscreensaver/xscreensaver-5.43.dmg</link>
+   <description><![CDATA[&bull; New hacks, `GravityWell', `DeepStars'. <BR>&bull; GLPlanet now supports the Mercator projection. <BR>&bull; Bouncing Cow has mathematically ideal cows (spherical, frictionless). <BR>&bull; Foggy toasters. <BR>&bull; Unknown Pleasures can now use an image file as a clip mask. <BR>&bull; Updated `webcollage' for recent changes. <BR>&bull; macOS: Fixed BSOD fonts on UWQHD+ displays. <BR>&bull; X11: Added some sample unlock dialog color schemes to the .ad file. <BR>&bull; X11: On systemd systems, closing your laptop lid might actually lock your screen now, maybe. <BR>&bull; X11: 'sonar' can ping without being setuid by using setcap.]]></description>
+   <pubDate>Mon, 01 Jul 2019 15:58:08 -0700</pubDate>
+   <enclosure url="https://www.jwz.org/xscreensaver/xscreensaver-5.43.dmg"
+    sparkle:version="5.43"
+    sparkle:dsaSignature="MC0CFQCT0sgF8wB8e/BuCnVkuJh7ZQe/CgIUeioy2Yx5Y8fytHXHNCaKKaNoP/Y="
+    sparkle:edSignature="ndnq1ocmiPR+UPdgr/pwc2rYo+hWFUJ+v0RCcAHzqONhpUx2V4hlvpUbaIHx9fEAMIbnUj9xVh6xtEFBSd95CQ=="
+    length="37345218"
+    type="application/octet-stream" />
+  </item>
   <item>
    <title>Version 5.42</title>
    <link>https://www.jwz.org/xscreensaver/xscreensaver-5.42.dmg</link>
index 14f3e96f5cbd5ae40db1008a54cf2d611ef0e36b..5deb3344b06b85872164680d5b249c4216c2e7c8 100644 (file)
@@ -5,7 +5,7 @@
 !                            by Jamie Zawinski
 !
 !                              version 5.43
-!                              01-Jul-2019
+!                              09-Jul-2019
 !
 ! See "man xscreensaver" for more info.  The latest version is always
 ! available at https://www.jwz.org/xscreensaver/
index 061b11096916928e67c9a42f1196d6c6e4fe0d54..58c41953ea650c76feee361eb216bb9236b06d9f 100644 (file)
@@ -5,7 +5,7 @@
                             by Jamie Zawinski
 
                               version 5.43
-                               01-Jul-2019
+                               09-Jul-2019
 
                      https://www.jwz.org/xscreensaver/
 
index 3c5abac5f53109389453e5a45a0fa347d401dd95..482bed3dae17f163c0d2128658eab58df1f3ae0a 100644 (file)
@@ -137,7 +137,7 @@ SRCS                = xscreensaver-gl-helper.c normals.c erase-gl.c fps-gl.c \
                  raverhoop.c hydrostat.c discoball.c cubetwist.c cubestack.c \
                  splodesic.c hexstrut.c vigilance.c seccam.c esper.c \
                  razzledazzle.c ships.c peepers.c crumbler.c quickhull.c \
-                 maze3d.c handsy.c handsy_model.c gravitywell.c
+                 maze3d.c handsy.c handsy_model.c gravitywell.c deepstars.c
 
 OBJS           = xscreensaver-gl-helper.o normals.o erase-gl.o fps-gl.o \
                  atlantis.o b_draw.o b_lockglue.o b_sphere.o bubble3d.o \
@@ -184,7 +184,7 @@ OBJS                = xscreensaver-gl-helper.o normals.o erase-gl.o fps-gl.o \
                  raverhoop.o hydrostat.o discoball.o cubetwist.o cubestack.o \
                  splodesic.o hexstrut.o vigilance.o seccam.o esper.o \
                  razzledazzle.o ships.o peepers.o crumbler.o quickhull.o \
-                 maze3d.o handsy.o handsy_model.o gravitywell.o
+                 maze3d.o handsy.o handsy_model.o gravitywell.o deepstars.o
 
 GL_EXES                = cage gears moebius pipes sproingies stairs superquadrics \
                  morph3d rubik atlantis lament bubble3d glplanet pulsar \
@@ -205,7 +205,7 @@ GL_EXES             = cage gears moebius pipes sproingies stairs superquadrics \
                  splitflap dymaxionmap unicrud energystream raverhoop \
                  hydrostat discoball cubetwist cubestack splodesic \
                  hexstrut vigilance esper razzledazzle peepers crumbler \
-                 maze3d handsy gravitywell
+                 maze3d handsy gravitywell deepstars
 GLE_EXES       = extrusion
 SUID_EXES      = sonar
 SETCAP_EXES    = sonar
@@ -273,7 +273,7 @@ GL_MEN              = atlantis.man boxed.man bubble3d.man cage.man circuit.man \
                  discoball.man cubetwist.man cubestack.man splodesic.man \
                  hexstrut.man vigilance.man esper.man razzledazzle.man \
                  peepers.man crumbler.man maze3d.man handsy.man \
-                 gravitywell.man
+                 gravitywell.man deepstars.man
 MEN            = @GL_MEN@
 RETIRED_MEN    = glforestfire.man
 EXTRAS         = README Makefile.in dxf2gl.pl vrml2gl.pl wfront2gl.pl \
@@ -1030,6 +1030,9 @@ handsy_dxf::
 gravitywell:   gravitywell.o   $(HACK_TRACK_OBJS)
        $(CC_HACK) -o $@ $@.o   $(HACK_TRACK_OBJS) $(HACK_LIBS)
 
+deepstars:     deepstars.o     $(HACK_TRACK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(HACK_TRACK_OBJS) $(HACK_LIBS)
+
 ##############################################################################
 #
 # DO NOT DELETE: updated by make distdepend
@@ -1541,6 +1544,23 @@ dangerball.o: $(UTILS_SRC)/visual.h
 dangerball.o: $(UTILS_SRC)/yarandom.h
 dangerball.o: $(HACK_SRC)/xlockmoreI.h
 dangerball.o: $(HACK_SRC)/xlockmore.h
+deepstars.o: ../../config.h
+deepstars.o: $(HACK_SRC)/fps.h
+deepstars.o: $(srcdir)/gltrackball.h
+deepstars.o: $(HACK_SRC)/recanim.h
+deepstars.o: $(HACK_SRC)/screenhackI.h
+deepstars.o: $(srcdir)/sphere.h
+deepstars.o: $(UTILS_SRC)/colors.h
+deepstars.o: $(UTILS_SRC)/erase.h
+deepstars.o: $(UTILS_SRC)/font-retry.h
+deepstars.o: $(UTILS_SRC)/grabscreen.h
+deepstars.o: $(UTILS_SRC)/hsv.h
+deepstars.o: $(UTILS_SRC)/resources.h
+deepstars.o: $(UTILS_SRC)/usleep.h
+deepstars.o: $(UTILS_SRC)/visual.h
+deepstars.o: $(UTILS_SRC)/yarandom.h
+deepstars.o: $(HACK_SRC)/xlockmoreI.h
+deepstars.o: $(HACK_SRC)/xlockmore.h
 discoball.o: ../../config.h
 discoball.o: $(HACK_SRC)/fps.h
 discoball.o: $(srcdir)/gltrackball.h
diff --git a/hacks/glx/deepstars.c b/hacks/glx/deepstars.c
new file mode 100644 (file)
index 0000000..b477e00
--- /dev/null
@@ -0,0 +1,387 @@
+/* xscreensaver, Copyright (c) 2019 Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or 
+ * implied warranty.
+ */
+
+#ifdef STANDALONE
+#define DEFAULTS       "*delay:                        30000   \n"     \
+                                       "*showFPS:                      False   \n" \
+                                       "*suppressRotationAnimation: True\n" \
+
+# define release_deepstars 0
+# include "xlockmore.h"                                /* from the xscreensaver distribution */
+#else  /* !STANDALONE */
+# include "xlock.h"                                    /* from the xlockmore distribution */
+#endif /* !STANDALONE */
+
+#ifdef USE_GL /* whole file */
+
+#include "sphere.h"
+#include "gltrackball.h"
+
+#define DEF_SPEED "1.0"
+#define DEF_SMEAR "1.0"
+#define SMEAR_BASE 400
+#define SPEED_BASE 0.02
+
+#undef countof
+#define countof(x) (sizeof((x))/sizeof((*x)))
+
+#undef BELLRAND
+#define BELLRAND(n) ((frand((n)) + frand((n)) + frand((n))) / 3)
+
+static GLfloat speed_arg, smear_arg;
+
+static XrmOptionDescRec opts[] = {
+  {"-speed",  ".speed",  XrmoptionSepArg, 0 },
+  {"-smear",  ".smear",  XrmoptionSepArg, 0 },
+};
+
+static argtype vars[] = {
+  {&speed_arg, "speed" ,"Speed", DEF_SPEED, t_Float},
+  {&smear_arg, "smear" ,"Smear", DEF_SMEAR, t_Float},
+};
+
+ENTRYPOINT ModeSpecOpt deepstars_opts = {countof(opts), opts, countof(vars), vars, NULL};
+
+#ifdef USE_MODULES
+ModStruct   deepstars_description =
+{"deepstars", "init_deepstars", "draw_deepstars", NULL,
+ "draw_deepstars", "init_deepstars", "free_deepstars", &deepstars_opts,
+ 1000, 1, 2, 1, 4, 1.0, "",
+ "Animates texture mapped sphere (deepstars)", 0, NULL};
+#endif
+
+typedef struct {
+  GLfloat *colors;
+  GLuint starlist, groundlist;
+  int ncolors, starcount, groundcount;
+  GLXContext *glx_context;
+  GLfloat z, latitude, facing;
+  int smear, dsmear;
+  trackball_state *trackball;
+  Bool button_down_p;
+} starstruct;
+
+static starstruct *deepstarss = NULL;
+
+
+ENTRYPOINT void
+reshape_deepstars (ModeInfo *mi, int width, int height)
+{
+  starstruct *gp = &deepstarss[MI_SCREEN(mi)];
+  GLfloat h = (GLfloat) height / (GLfloat) width;
+
+  glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *gp->glx_context);
+
+  glViewport(0, 0, (GLint) width, (GLint) height);
+  glMatrixMode(GL_PROJECTION);
+  glLoadIdentity();
+  glFrustum(-1.0, 1.0, -h, h, 5.0, 200.0);
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+  glTranslatef(0.0, 0.0, -40);
+
+  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+}
+
+
+ENTRYPOINT Bool
+deepstars_handle_event (ModeInfo *mi, XEvent *event)
+{
+  starstruct *gp = &deepstarss[MI_SCREEN(mi)];
+
+  /* Neutralize any horizontal motion, and flip Y */
+  GLfloat rot = current_device_rotation();
+  Bool rotp = ((rot >  45 && rot <  135) ||
+               (rot < -45 && rot > -135));
+
+  if (event->xany.type == ButtonPress ||
+      event->xany.type == ButtonRelease)
+    {
+      if (rotp)
+        {
+          event->xbutton.y = MI_HEIGHT(mi) / 2;
+          event->xbutton.x = MI_WIDTH(mi) - event->xbutton.x;
+        }
+      else
+        {
+          event->xbutton.x = MI_WIDTH(mi) / 2;
+          event->xbutton.y = MI_HEIGHT(mi) - event->xbutton.y;
+        }
+    }
+  else if (event->xany.type == MotionNotify)
+    {
+      if (rotp)
+        {
+          event->xmotion.y = MI_HEIGHT(mi) / 2;
+          event->xmotion.x = MI_WIDTH(mi) - event->xmotion.x;
+        }
+      else
+        {
+          event->xmotion.x = MI_WIDTH(mi) / 2;
+          event->xmotion.y = MI_HEIGHT(mi) - event->xmotion.y;
+        }
+    }
+
+  if (gltrackball_event_handler (event, gp->trackball,
+                                 MI_WIDTH (mi), MI_HEIGHT (mi),
+                                 &gp->button_down_p))
+    return True;
+  else if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event))
+    {
+      if (gp->smear <= 1)
+        gp->dsmear = 1;
+      else
+        gp->dsmear = gp->smear = 0;
+      return True;
+    }
+
+  return False;
+}
+
+
+ENTRYPOINT void
+init_deepstars (ModeInfo * mi)
+{
+  starstruct *gp;
+  int screen = MI_SCREEN(mi);
+
+  int i, j, k;
+  int width  = MI_WIDTH(mi);
+  int height = MI_HEIGHT(mi);
+  int size = (width > height ? width : height);
+  int nstars = size * size / 80;
+  int max_size = 3;
+  GLfloat inc = 0.5;
+  int sizes = max_size / inc;
+  GLfloat scale = 1;
+
+  MI_INIT (mi, deepstarss);
+  gp = &deepstarss[screen];
+
+  if ((gp->glx_context = init_GL(mi)) != NULL) {
+       reshape_deepstars(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+  }
+
+# ifdef HAVE_MOBILE
+  scale *= 3;
+  nstars /= 3;
+# else /* !HAVE_MOBILE */
+  if (MI_WIDTH(mi) > 2560) {  /* Retina displays */
+    scale *= 2;
+    nstars /= 2;
+  }
+# endif /* !HAVE_MOBILE */
+
+
+  gp->trackball = gltrackball_init (True);
+
+  gp->latitude = 10 + frand(70);
+  gp->facing = 10 * (frand(1.0)-0.5);
+
+  /* Only need a small number of distinct star colors, and we have one
+     display list for each color, so we can modify the alpha. 
+   */
+  gp->ncolors = 16;
+  gp->colors = (GLfloat *) malloc (4 * gp->ncolors * sizeof(*gp->colors));
+
+  for (i = 0; i < gp->ncolors; i++)
+    {
+      GLfloat d = 0.1;
+      GLfloat r = 0.15 + frand(0.3);
+      GLfloat g = r + frand(d) - d;
+      GLfloat b = r + frand(d) - d;
+      gp->colors[i*4+0] = r;
+      gp->colors[i*4+1] = g;
+      gp->colors[i*4+2] = b;
+      gp->colors[i*4+3] = 1;
+    }
+
+  gp->starcount = nstars / gp->ncolors;
+  gp->starlist = glGenLists(gp->ncolors);
+  for (i = 0; i < gp->ncolors; i++)
+    {
+      glNewList (gp->starlist + i, GL_COMPILE);
+      for (j = 1; j <= sizes; j++)
+        {
+          glPointSize (inc * j * scale);
+          glBegin (GL_POINTS);
+          for (k = 0; k < gp->starcount / sizes; k++)
+            {
+              GLfloat x = frand(1)-0.5;
+              GLfloat y = frand(1)-0.5;
+              GLfloat z = ((random() & 1)
+                           ? frand(1)-0.5
+                           : (BELLRAND(1)-0.5)/20);   /* milky way */
+              GLfloat d = sqrt (x*x + y*y + z*z);
+              x /= d;
+              y /= d;
+              z /= d;
+              glVertex3f (x, y, z);
+            }
+          glEnd();
+        }
+      glEndList();
+    }
+
+  glDisable (GL_BLEND);
+  gp->groundlist = glGenLists(1);
+  glNewList(gp->groundlist, GL_COMPILE);
+  {
+    GLfloat inc = 0.5;
+    glColor3f (0.02, 0.02, 0.05);
+    glBegin (GL_QUAD_STRIP);
+    gp->groundcount = 50;
+    for (i = 0; i <= gp->groundcount; i++)
+      {
+        glVertex3f (i / (GLfloat) gp->groundcount, 0, 0);
+        glVertex3f (i / (GLfloat) gp->groundcount, inc, 0);
+        inc += 0.1 * (frand(1.0) - 0.5);
+      }
+    glEnd();
+  }
+  glEndList();
+}
+
+
+ENTRYPOINT void
+draw_deepstars (ModeInfo * mi)
+{
+  starstruct *gp = &deepstarss[MI_SCREEN(mi)];
+  Display *dpy = MI_DISPLAY(mi);
+  Window window = MI_WINDOW(mi);
+  int smear_change = 800;
+  int sky_scale = 60;
+  int i, j;
+
+  if (!gp->glx_context)
+       return;
+
+  glDrawBuffer(GL_BACK);
+  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+  glXMakeCurrent (dpy, window, *gp->glx_context);
+
+  mi->polygon_count = 0;
+
+  glEnable (GL_LINE_SMOOTH);
+  glEnable (GL_POINT_SMOOTH);
+  glDisable (GL_DEPTH_TEST);
+  glDisable (GL_CULL_FACE);
+
+  glPushMatrix();
+
+  gltrackball_rotate (gp->trackball);
+
+  /* At the equator, Polaris is on the horizon. In the Arctic, overhead. */
+  glRotatef (180 - gp->latitude, 1, 0, 0);
+  glRotatef (gp->facing, 0, 1, 0);
+
+  if (gp->dsmear == 0 && !(random() % smear_change))
+    gp->dsmear = 1;
+  else if (gp->smear == SMEAR_BASE * smear_arg && !(random() % smear_change))
+    gp->dsmear = -1;
+
+  if (! gp->button_down_p)
+    gp->smear += gp->dsmear;
+  if (gp->smear < 1) gp->smear = 1;
+  else if (gp->smear > SMEAR_BASE * smear_arg)
+    gp->smear = SMEAR_BASE * smear_arg;
+
+  if (!gp->button_down_p)
+    gp->z -= SPEED_BASE * speed_arg;
+
+  glEnable (GL_BLEND);
+  glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+  for (i = 0; i < gp->smear; i++)
+    {
+      GLfloat alpha = 1 - (i / (GLfloat) gp->smear);
+
+      glPushMatrix();
+
+      glRotatef (gp->z - (-i * SPEED_BASE * speed_arg), 0, 0, 1);
+
+# if 0
+      if (i == 0)
+        {
+          glBegin(GL_LINES);
+          glVertex3f(0,0,0); glVertex3f(0,0,-3);
+          glVertex3f(0,-1,0); glVertex3f(0,1,0);
+          glVertex3f(-1,0,0); glVertex3f(1,0,0);
+          glEnd();
+
+          glPushMatrix();
+          glRotatef (90, 1, 0, 0);
+          glScalef (sky_scale, sky_scale, sky_scale);
+          mi->polygon_count += unit_sphere (12, 24, 1);
+          glPopMatrix();
+        }
+# endif
+
+      glRotatef (50, 1, 0, 0);  /* Tilt milky way */
+      glScalef (sky_scale, sky_scale, sky_scale);
+
+      for (j = 0; j < gp->ncolors; j++)
+        {
+          gp->colors[j*4+3] = alpha;
+          glColor4fv (&gp->colors[j*4]);
+          glCallList (gp->starlist + j);
+          mi->polygon_count += gp->starcount;
+        }
+      glPopMatrix();
+    }
+
+  glPopMatrix();
+
+  glMatrixMode(GL_PROJECTION);
+  glPushMatrix();
+  {
+    glLoadIdentity();
+
+    glMatrixMode(GL_MODELVIEW);
+    glPushMatrix();
+    {
+      glLoadIdentity();
+      glTranslatef (-1, -1, 0);
+      glScalef (2, 0.7, 1);
+      glCallList (gp->groundlist);
+      mi->polygon_count += gp->groundcount;
+    }
+    glPopMatrix();
+  }
+  glMatrixMode(GL_PROJECTION);
+  glPopMatrix();
+
+  glMatrixMode(GL_MODELVIEW);
+
+  if (mi->fps_p) do_fps (mi);
+  glFinish();
+  glXSwapBuffers(dpy, window);
+}
+
+
+ENTRYPOINT void
+free_deepstars (ModeInfo * mi)
+{
+  starstruct *gp = &deepstarss[MI_SCREEN(mi)];
+
+  if (!gp->glx_context) return;
+  glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *gp->glx_context);
+  if (gp->colors) free (gp->colors);
+  if (glIsList(gp->groundlist))  glDeleteLists(gp->groundlist, 1);
+  if (glIsList(gp->starlist))    glDeleteLists(gp->starlist, gp->ncolors);
+  if (gp->trackball) gltrackball_free (gp->trackball);
+}
+
+
+XSCREENSAVER_MODULE ("DeepStars", deepstars)
+
+#endif
diff --git a/hacks/glx/deepstars.man b/hacks/glx/deepstars.man
new file mode 100644 (file)
index 0000000..bd4a65a
--- /dev/null
@@ -0,0 +1,57 @@
+.TH XScreenSaver 1 "" "X Version 11"
+.SH NAME
+deepstars - screen saver.
+.SH SYNOPSIS
+.B deepstars
+[\-display \fIhost:display.screen\fP]
+[\-visual \fIvisual\fP]
+[\-window]
+[\-root]
+[\-delay \fInumber\fP]
+[\-speed \fInumber\fP]
+[\-smear \fInumber\fP]
+.SH DESCRIPTION
+A long exposure of the night sky, showing star paths as vapor trails.
+.SH OPTIONS
+.TP 8
+.B \-visual \fIvisual\fP
+Specify which visual to use.  Legal values are the name of a visual class,
+or the id number (decimal or hex) of a specific visual.
+.TP 8
+.B \-window
+Draw on a newly-created window.  This is the default.
+.TP 8
+.B \-root
+Draw on the root window.
+.TP 8
+.B \-delay \fInumber\fP
+Per-frame delay, in microseconds.  Default: 30000 (0.03 seconds).
+.TP 8
+.B \-speed \fInumber\fP
+Animation speed.  2.0 means twice as fast, 0.5 means half as fast.
+.TP 8
+.B \-smear \fInumber\fP
+How long the vapor trails should be.
+2.0 means twice as long, 0.5 means half as long.
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+to get the default host and display number.
+.TP 8
+.B XENVIRONMENT
+to get the name of a resource file that overrides the global resources
+stored in the RESOURCE_MANAGER property.
+.SH SEE ALSO
+.BR X (1),
+.BR xscreensaver (1)
+.SH COPYRIGHT
+Copyright \(co 2019 by Jamie Zawinski.  Permission to use, copy, modify, 
+distribute, and sell this software and its documentation for any purpose is 
+hereby granted without fee, provided that the above copyright notice appear 
+in all copies and that both that copyright notice and this permission notice
+appear in supporting documentation.  No representations are made about the 
+suitability of this software for any purpose.  It is provided "as is" without
+express or implied warranty.
+.SH AUTHOR
+Jamie Zawinski.
index cd9cf4ac301c85419ceecec5aec923947d94f0a3..38a89efc387f0307f8e15b87fff8348000a4d00b 100644 (file)
@@ -1,4 +1,4 @@
-# Auto-generated: Mon Jul  1 14:17:56 PDT 2019
+# Auto-generated: Tue Jul  9 20:31:29 PDT 2019
 driver/demo-Gtk-conf.c
 driver/demo-Gtk.c
 driver/screensaver-properties.desktop.in
index 19a6ca35793647cd07428b41955c423a1e0777e7..b01396c2ec6f6e5651dfa3dded8005088187427e 100644 (file)
@@ -1,2 +1,2 @@
 static const char screensaver_id[] =
-       "@(#)xscreensaver 5.43 (01-Jul-2019), by Jamie Zawinski (jwz@jwz.org)";
+       "@(#)xscreensaver 5.43 (09-Jul-2019), by Jamie Zawinski (jwz@jwz.org)";