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
+MAKE_SUBDIR = for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@ || exit 5; done
+MAKE_SUBDIR2 = for dir in $(SUBDIRS2); do $(MAKE) -C $$dir $@ || exit 5; done
default::
@$(MAKE_SUBDIR)
distdepend::
@$(MAKE) update_spec_version
@$(MAKE_SUBDIR2)
- @cd po ; $(MAKE) update-po
+ @$(MAKE) -C po update-po
TAGS:: tags
tags::
chmod -R u+w .
dmg::
- cd OSX ; $(MAKE) release dmg
+ $(MAKE) -C OSX release dmg
www::
@ \
cat $$TMP > download.html ; \
rm -f $$TMP ; \
\
- (cd ..; $(MAKE) xscreensaver/changelog.html \
- xscreensaver/screenshots/index.html ); \
+ $(MAKE) -C ../ xscreensaver/changelog.html xscreensaver/screenshots/index.html; \
cvs diff -U0 changelog.html ; \
set +x ; \
\
perl -0 -ne \
's/\\\\\\n//g; m/^RETIRED_GL_EXES\s*=\s*(.*)$$/m && print "$$1\n"' \
../hacks/glx/Makefile.in ; \
- echo xscreensaver` ; \
+ echo xscreensaver ; \
+ echo savertester` ; \
\
for f in $$SRC/*.{saver,app} $$EXTRAS ; do \
ok=yes ; \
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>5.20</string>
+ <string>5.21</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>5.20</string>
+ <string>5.21</string>
<key>LSMinimumSystemVersion</key>
<string>10.4</string>
<key>NSHumanReadableCopyright</key>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
- <string>5.20</string>
+ <string>5.21</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>5.20</string>
+ <string>5.21</string>
<key>LSMinimumSystemVersion</key>
<string>10.4</string>
<key>NSMainNibFile</key>
\readonlydoc1{\fonttbl\f0\fswiss\fcharset77 Arial-BoldMT;\f1\fswiss\fcharset77 ArialMT;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue240;}
{\info
-{\title XScreenSaver Installation Instructions}}\vieww10380\viewh13000\viewkind0
+{\title XScreenSaver Installation Instructions}}\vieww10380\viewh16740\viewkind0
\deftab360
\pard\pardeftab360\qc
+\deftab720
+\pard\pardeftab720\qc
\
\b\fs36
XScreenSaver\
by Jamie Zawinski\
and many others\
\
-version 5.20\
-06-Oct-2012\
+version 5.21\
+04-Feb-2013\
\
{\field{\*\fldinst{HYPERLINK "http://www.jwz.org/xscreensaver/"}}{\fldrslt \cf2 \ul \ulc2 http://www.jwz.org/xscreensaver/}}
\
files to the "Screen Savers" folder in your "Library" folder.
You may need to create the "Screen Savers" folder first.\
\
+If you get an error saying it \i "can't be opened because it is from an
+unidentified developer", \i0 then open \i Terminal \i0 and type this:\
+\
+\pard\li720
+xattr -r -d com.apple.quarantine ~/Library/Screen\\ Savers\
+sudo xattr -r -d com.apple.quarantine /Library/Screen\\ Savers\
+\
\pard
\b When upgrading:\
\b0\li360
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleVersion</key>
- <string>5.20</string>
+ <string>5.21</string>
<key>NSMainNibFile</key>
<string>iSaverRunner</string>
<key>CFBundlePackageType</key>
<key>UIStatusBarHidden</key>
<true/>
<key>CFBundleShortVersionString</key>
- <string>5.20</string>
+ <string>5.21</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>UIRequiredDeviceCapabilities</key>
#!/usr/bin/perl -w
-# Copyright © 2006-2012 Jamie Zawinski <jwz@jwz.org>
+# Copyright © 2006-2013 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
#use diagnostics; # Fails on some MacOS 10.5 systems
use strict;
-my $progname = $0; $progname =~ s@.*/@@g;
-my $version = q{ $Revision: 1.22 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
+my ($exec_dir, $progname) = ($0 =~ m@^(.*?)/([^/]+)$@);
+
+my $version = q{ $Revision: 1.23 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
$ENV{PATH} = "/usr/local/bin:$ENV{PATH}"; # for seticon
+my $thumbdir = $ENV{HOME} . '/www/xscreensaver/screenshots/';
+
+
my $verbose = 1;
}
+sub set_thumb($) {
+ my ($app_dir) = @_;
+
+ return unless ($app_dir =~ m@\.saver/?$@s);
+
+ my @cmd = ("$exec_dir/update-thumbnail.pl", $thumbdir, $app_dir);
+ push @cmd, "-" . ("v" x $verbose) if ($verbose);
+ print STDERR "$progname: exec: " . join(' ', @cmd) . "\n"
+ if ($verbose > 1);
+ system (@cmd);
+ my $exit = $? >> 8;
+ exit ($exit) if $exit;
+}
+
+
sub update($) {
my ($app_dir) = @_;
}
set_icon ($app_dir);
+ set_thumb ($app_dir);
}
===============================================================================
+Changes since 5.20: * Changed default text source from Twitter to Wikipedia,
+ since Twitter now requires a login to get any feeds.
+ * New version of `fireworkx'.
+ * Minor fixes to `distort', `fontglide', `xmatrix'.
+ * New MacOS crash in `bsod'.
+ * New mode in `lcdscrub'.
Changes since 5.19: * Support for iPhone 5 screen size.
* Fixed modifier key handing in Apple2.app and
Phosphor.app on MacOS.
have no idea how to redirect output to a file.
* Added `-duration' arg to most image-loading hacks,
so that they pick a new image every few minutes.
- * Added an ATM crash to BSOD.
+ * Added an ATM crash to `bsod'.
Changes since 5.04: * New hacks, `cubicgrid', `hypnowheel', and
`lcdscrub' (which isn't really a screen saver).
* Updates to `m6502' and `gears'.
wimpier video cards now.
* Various portability tweaks.
Changes since 4.09: * New hacks, `cloudlife' and `klein'.
- * Added Apple ][+, HPUX, and OS/390 sessions to BSOD.
+ * Added Apple ][+, HPUX, and OS/390 sessions to `bsod'.
* Added some Matrix Reloaded text to `xmatrix'.
* Updates to `webcollage', `eruption', `jigglypuff',
`metaballs', and `endgame'.
/* Define to 1 if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
ac_user_opts='
enable_option_checking
with_x_app_defaults
+enable_largefile
with_x
with_hackdir
enable_subdir
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-largefile omit support for large files
Screen locking options:
--enable-locking Compile in support for locking the display.
$as_echo "unknown" >&6; }
fi
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then
+ enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+ { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if test "${ac_cv_sys_largefile_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ rm -rf conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -rf conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ rm -rf conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -rf conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_sys_largefile_CC=' -n32'; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -rf conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -rf conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -rf conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_sys_file_offset_bits=no; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -rf conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -rf conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_sys_file_offset_bits=64; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_file_offset_bits=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if test "${ac_cv_sys_large_files+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -rf conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -rf conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_sys_large_files=no; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -rf conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -rf conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_sys_large_files=1; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_large_files=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ fi
+fi
+
$as_echo_n "(cached) " >&6
else
cat > conftest.$ac_ext <<EOF
-#line 17482 "configure"
+#line 17840 "configure"
#include "confdefs.h"
#include <GL/gl.h>
#ifndef MESA_MAJOR_VERSION
AC_HEADER_SYS_WAIT
AC_HEADER_DIRENT
AC_GETTIMEOFDAY_ARGS
+AC_SYS_LARGEFILE
AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv sbrk)
AC_CHECK_FUNCS(sigaction syslog realpath setrlimit)
AC_CHECK_FUNCS(setlocale)
$(UTILS_BIN)/colorbars.o: $(UTILS_SRC)/colorbars.c
$(SAVER_UTIL_OBJS):
- cd $(UTILS_BIN) ; \
- $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+ $(MAKE) -C $(UTILS_BIN) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
# How we build object files in this directory.
.c.o:
# DO NOT DELETE: updated by make distdepend
demo-Gtk-conf.o: ../config.h
+demo-Gtk-conf.o: $(srcdir)/demo-Gtk-conf.h
+demo-Gtk-conf.o: $(UTILS_SRC)/xscreensaver-intl.h
+demo-Gtk.o: XScreenSaver_ad.h
demo-Gtk.o: ../config.h
+demo-Gtk.o: $(srcdir)/demo-Gtk-conf.h
+demo-Gtk.o: $(srcdir)/demo-Gtk-support.h
+demo-Gtk.o: $(srcdir)/demo-Gtk-widgets.h
+demo-Gtk.o: $(srcdir)/prefs.h
+demo-Gtk.o: $(srcdir)/remote.h
+demo-Gtk.o: $(srcdir)/types.h
+demo-Gtk.o: $(UTILS_SRC)/resources.h
+demo-Gtk.o: $(UTILS_SRC)/usleep.h
+demo-Gtk.o: $(UTILS_SRC)/version.h
+demo-Gtk.o: $(UTILS_SRC)/visual.h
+demo-Gtk.o: $(UTILS_SRC)/xscreensaver-intl.h
demo-Gtk-support.o: ../config.h
demo-Gtk-support.o: $(srcdir)/demo-Gtk-support.h
demo-Gtk-widgets.o: ../config.h
prefs.o: $(srcdir)/prefs.h
prefs.o: $(srcdir)/types.h
prefs.o: $(UTILS_SRC)/resources.h
+prefs.o: $(UTILS_SRC)/version.h
remote.o: ../config.h
remote.o: $(srcdir)/remote.h
screens.o: ../config.h
! a screen saver and locker for the X window system
! by Jamie Zawinski
!
-! version 5.20
-! 06-Oct-2012
+! version 5.21
+! 04-Feb-2013
!
! See "man xscreensaver" for more info. The latest version is always
! available at http://www.jwz.org/xscreensaver/
*textLiteral: XScreenSaver
*textFile: @DEFAULT_TEXT_FILE@
*textProgram: fortune
-*textURL: http://twitter.com/statuses/public_timeline.atom
-!*textURL: http://www.livejournal.com/stats/latest-rss.bml
+*textURL: http://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss
*overlayTextForeground: #FFFF00
*overlayTextBackground: #000000
*passwd.uname: True
*splash.heading.label: XScreenSaver %s
-*splash.body.label: Copyright © 1991-2012 by
+*splash.body.label: Copyright © 1991-2013 by
*splash.body2.label: Jamie Zawinski <jwz@jwz.org>
*splash.demo.label: Settings
*splash.help.label: Help
"*textLiteral: XScreenSaver",
"*textFile: ",
"*textProgram: fortune",
-"*textURL: http://twitter.com/statuses/public_timeline.atom",
+"*textURL: http://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss",
"*overlayTextForeground: #FFFF00",
"*overlayTextBackground: #000000",
"*overlayStderr: True",
"*demoCommand: xscreensaver-demo",
"*prefsCommand: xscreensaver-demo -prefs",
"*helpURL: http://www.jwz.org/xscreensaver/man.html",
-"*loadURL: firefox '%s' || mozilla '%s' || netscape '%s'",
-"*manualCommand: xterm -sb -fg black -bg gray75 -T '%s manual' \
- -e /bin/sh -c 'man \"%s\" ; read foo'",
+"*loadURL: gnome-open '%s'",
+"*manualCommand: gnome-terminal --title '%s manual' \
+ --command '/bin/sh -c \"man %s; read foo\"'",
"*dateFormat: %d-%b-%y (%a); %I:%M %p",
"*installColormap: True",
"*programs: \
"*passwd.asterisks: True",
"*passwd.uname: True",
"*splash.heading.label: XScreenSaver %s",
-"*splash.body.label: Copyright © 1991-2012 by",
+"*splash.body.label: Copyright © 1991-2013 by",
"*splash.body2.label: Jamie Zawinski <jwz@jwz.org>",
"*splash.demo.label: Settings",
"*splash.help.label: Help",
/* demo-Gtk.c --- implements the interactive demo-mode and options dialogs.
- * xscreensaver, Copyright (c) 1993-2012 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1993-2013 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
{
char msg [2048];
char *vers = strdup (screensaver_id + 4);
- char *s;
+ char *s, *s2;
char copy[1024];
+ char year[5];
char *desc = _("For updates, check http://www.jwz.org/xscreensaver/");
s = strchr (vers, ',');
*s = 0;
s += 2;
+ s2 = vers;
+ s2 = strrchr (vers, '-');
+ s2++;
+ strncpy (year, s2, 4);
+ year[4] = 0;
+
/* Ole Laursen <olau@hardworking.dk> says "don't use _() here because
non-ASCII characters aren't allowed in localizable string keys."
(I don't want to just use (c) instead of © because that doesn't
look as good in the plain-old default Latin1 "C" locale.)
*/
#ifdef HAVE_GTK2
- sprintf(copy, ("Copyright \xC2\xA9 1991-2008 %s"), s);
+ sprintf(copy, ("Copyright \xC2\xA9 1991-%s %s"), year, s);
#else /* !HAVE_GTK2 */
- sprintf(copy, ("Copyright \251 1991-2008 %s"), s);
+ sprintf(copy, ("Copyright \251 1991-%s %s"), year, s);
#endif /* !HAVE_GTK2 */
sprintf (msg, "%s\n\n%s", copy, desc);
the_network_is_not_the_computer (s);
+ if (senescent_p())
+ warning_dialog (s->toplevel_widget,
+ _("Warning:\n\n"
+ "This version of xscreensaver is VERY OLD!\n"
+ "Please upgrade!\n"
+ "\n"
+ "http://www.jwz.org/xscreensaver/\n"
+ "\n"
+ "(If this is the latest version that your distro ships, then\n"
+ "your distro is doing you a disservice. Build from source.)\n"
+ ),
+ D_NONE, 7);
+
+
/* Run the Gtk event loop, and not the Xt event loop. This means that
if there were Xt timers or fds registered, they would never get serviced,
and if there were any Xt widgets, they would never have events delivered.
/* lock.c --- handling the password dialog for locking-mode.
- * xscreensaver, Copyright (c) 1993-2011 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1993-2013 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
* room for the dialog to grow without going off the edge of the screen. */
max_string_width_px *= 0.75;
+ if (!info_msg && senescent_p())
+ info_msg = ("\n"
+ "This version of XScreenSaver\n"
+ "is very old! Please upgrade!\n");
+
pw->info_label = mlstring_new(info_msg ? info_msg : pw->body_label,
pw->label_font, max_string_width_px);
/* dotfile.c --- management of the ~/.xscreensaver file.
- * xscreensaver, Copyright (c) 1998-2011 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1998-2013 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
#endif
+#include "version.h"
#include "prefs.h"
#include "resources.h"
if (p->pointer_hysteresis < 0) p->pointer_hysteresis = 0;
if (p->pointer_hysteresis > 100) p->pointer_hysteresis = 100;
}
+
+
+/* Getting very tired of bug reports of already-fixed bugs due to
+ Linux distros shipping multi-year-old versions.
+ */
+Bool
+senescent_p (void)
+{
+ time_t now = time ((time_t *) 0);
+ struct tm *tm = localtime (&now);
+ char *s, mon[4], year[5];
+ int m, y, months;
+ s = strchr (screensaver_id, '-');
+ s++;
+ strncpy (mon, s, 3);
+ s = strchr (s, '-');
+ s++;
+ strncpy (year, s, 4);
+ mon[3] = 0;
+ year[4] = 0;
+ if (!strcmp(mon, "Jan")) m = 0;
+ else if (!strcmp(mon, "Feb")) m = 1;
+ else if (!strcmp(mon, "Mar")) m = 2;
+ else if (!strcmp(mon, "Apr")) m = 3;
+ else if (!strcmp(mon, "May")) m = 4;
+ else if (!strcmp(mon, "Jun")) m = 5;
+ else if (!strcmp(mon, "Jul")) m = 6;
+ else if (!strcmp(mon, "Aug")) m = 7;
+ else if (!strcmp(mon, "Sep")) m = 8;
+ else if (!strcmp(mon, "Oct")) m = 9;
+ else if (!strcmp(mon, "Nov")) m = 10;
+ else if (!strcmp(mon, "Dec")) m = 11;
+ else abort();
+
+ y = (year[0]-'0')*1000 + (year[1]-'0')*100 + (year[2]-'0')*10 +(year[3]-'0');
+
+ months = ((((tm->tm_year + 1900) * 12) + tm->tm_mon) -
+ (y * 12 + m));
+
+ return (months > 12);
+}
-/* xscreensaver, Copyright (c) 1993-2006 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1993-2013 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
saver_preferences *, const char *version_string,
Bool verbose_p);
const char *init_file_name (void);
+extern Bool senescent_p (void);
extern screenhack *parse_screenhack (const char *line);
extern void free_screenhack (screenhack *);
-/* xscreensaver, Copyright (c) 1991-2008 Jamie Zawinski <jwz@netscape.com>
+/* xscreensaver, Copyright (c) 1991-2013 Jamie Zawinski <jwz@netscape.com>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
char *heading_label;
char *body_label;
char *body2_label;
+ char *body3_label;
+ char *body4_label;
char *demo_label;
#ifdef PREFS_BUTTON
char *prefs_label;
void
make_splash_dialog (saver_info *si)
{
+ saver_preferences *p = &si->prefs;
int x, y, bw;
XSetWindowAttributes attrs;
unsigned long attrmask = 0;
Colormap cmap;
char *f;
+ Bool whine = senescent_p ();
+
+ if (whine)
+ {
+ /* If locking is not enabled, make sure they see the message. */
+ if (!p->lock_p)
+ {
+ si->prefs.splash_p = True;
+ if (si->prefs.splash_duration < 5000)
+ si->prefs.splash_duration = 5000;
+ }
+ si->prefs.splash_duration += 3000;
+ }
+
if (si->sp_data)
return;
if (!si->prefs.splash_p ||
"splash.help.label",
"Dialog.Button.Label");
+
+
+ if (whine)
+ {
+ sp->body3_label = strdup("WARNING: This version is very old!");
+ sp->body4_label = strdup("Please upgrade!");
+ }
+
if (!sp->heading_label)
sp->heading_label = strdup("ERROR: REESOURCES NOT INSTALLED CORRECTLY");
if (!sp->body_label)
if (overall.width > sp->width) sp->width = overall.width;
sp->height += ascent + descent;
+ /* Measure the optional body3_label. */
+ if (sp->body3_label)
+ {
+ XTextExtents (sp->heading_font,
+ sp->body3_label, strlen(sp->body3_label),
+ &direction, &ascent, &descent, &overall);
+ if (overall.width > sp->width) sp->width = overall.width;
+ XTextExtents (sp->heading_font,
+ sp->body4_label, strlen(sp->body4_label),
+ &direction, &ascent, &descent, &overall);
+ if (overall.width > sp->width) sp->width = overall.width;
+ sp->height += (ascent + descent) * 5;
+ }
+
{
Dimension w2 = 0, w3 = 0, w4 = 0;
Dimension h2 = 0, h3 = 0, h4 = 0;
sp->body2_label, strlen(sp->body2_label));
y1 += sp->body_font->descent;
+ if (sp->body3_label)
+ {
+ XSetFont (si->dpy, gc1, sp->heading_font->fid);
+ y1 += sp->heading_font->ascent + sp->heading_font->descent;
+ y1 += sp->heading_font->ascent;
+ sw = string_width (sp->heading_font, sp->body3_label);
+ x2 = (x1 + ((x3 - x1 - sw) / 2));
+ XDrawString (si->dpy, si->splash_dialog, gc1, x2, y1,
+ sp->body3_label, strlen(sp->body3_label));
+ y1 += sp->heading_font->descent + sp->heading_font->ascent;
+ sw = string_width (sp->heading_font, sp->body4_label);
+ x2 = (x1 + ((x3 - x1 - sw) / 2));
+ XDrawString (si->dpy, si->splash_dialog, gc1, x2, y1,
+ sp->body4_label, strlen(sp->body4_label));
+ y1 += sp->heading_font->descent;
+ XSetFont (si->dpy, gc1, sp->body_font->fid);
+ }
+
/* The buttons
*/
XSetForeground (si->dpy, gc1, sp->button_foreground);
if (sp->heading_label) free (sp->heading_label);
if (sp->body_label) free (sp->body_label);
if (sp->body2_label) free (sp->body2_label);
+ if (sp->body3_label) free (sp->body3_label);
+ if (sp->body4_label) free (sp->body4_label);
if (sp->demo_label) free (sp->demo_label);
#ifdef PREFS_BUTTON
if (sp->prefs_label) free (sp->prefs_label);
-/* xscreensaver, Copyright (c) 1998-2011 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1998-2013 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
void resize_screensaver_window (saver_info *si) { }
void describe_monitor_layout (saver_info *si) { }
Bool update_screen_layout (saver_info *si) { return 0; }
+Bool in_signal_handler_p = 0;
const char *blurb(void) { return progname; }
Atom XA_SCREENSAVER, XA_DEMO, XA_PREFS;
si->version = (char *) malloc (5);
memcpy (si->version, screensaver_id + 17, 4);
+ si->version[4] = 0;
progname = argv[0];
{
char *s = strrchr(progname, '/');
-/* xscreensaver-command, Copyright (c) 1991-2008 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver-command, Copyright (c) 1991-2013 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
usage: %s -<option>\n\
\n\
This program provides external control of a running xscreensaver process.\n\
- Version %s, copyright (c) 1991-2008 Jamie Zawinski <jwz@jwz.org>.\n\
+ Version %s, copyright (c) 1991-%s Jamie Zawinski <jwz@jwz.org>.\n\
\n\
The xscreensaver program is a daemon that runs in the background.\n\
You control a running xscreensaver process by sending it messages\n\
*/
#define USAGE() do { \
- fprintf (stderr, usage, progname, screensaver_version); exit (1); \
+ fprintf (stderr, usage, progname, screensaver_version, year); exit (1); \
} while(0)
static int watch (Display *);
long arg = 0L;
char *s;
Atom XA_WATCH = 0; /* kludge: not really an atom */
+ char year[5];
progname = argv[0];
s = strrchr (progname, '/');
memcpy (screensaver_version, screensaver_id + 17, 4);
screensaver_version [4] = 0;
+ s = strchr (screensaver_id, '-');
+ s = strrchr (s, '-');
+ s++;
+ strncpy (year, s, 4);
+ year[4] = 0;
+
for (i = 1; i < argc; i++)
{
const char *s = argv [i];
my $progname = $0; $progname =~ s@.*/@@g;
-my $version = q{ $Revision: 1.33 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
+my $version = q{ $Revision: 1.34 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
my $verbose = 0;
}!gsexi;
}
- # Then look for <description>... with an <img href="..."> inside.
+ # Then look for <description>... with an <img src="..."> inside.
#
if (! $iurl) {
$item =~ s!(<description[^<>]*>.*?</description>)!{
"${min_image_width}x${min_image_height} are excluded.\n" .
"\n" .
" The directory may also be the URL of an RSS/Atom feed. Enclosed\n" .
- " images will be downloaded cached locally.\n" .
+ " images will be downloaded and cached locally.\n" .
"\n";
exit 1;
}
int ow = w, oh = h;
GdkPixbuf *opb = pb;
pb = gdk_pixbuf_apply_embedded_orientation (opb);
- gdk_pixbuf_unref (opb);
+ g_object_unref (opb);
w = gdk_pixbuf_get_width (pb);
h = gdk_pixbuf_get_height (pb);
if (verbose_p && (w != ow || h != oh))
GDK_INTERP_BILINEAR);
if (pb2)
{
- gdk_pixbuf_unref (pb);
+ g_object_unref (pb);
pb = pb2;
w = w2;
h = h2;
#!/usr/bin/perl -w
-# Copyright © 2005-2012 Jamie Zawinski <jwz@jwz.org>
+# Copyright © 2005-2013 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
use bytes;
my $progname = $0; $progname =~ s@.*/@@g;
-my $version = q{ $Revision: 1.27 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
+my $version = q{ $Revision: 1.29 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
my $verbose = 0;
my $http_proxy = undef;
s@<[^<>]*>?@@gs; # lose all other HTML tags
$_ = de_entify ($_); # convert HTML entities
+ # For Wikipedia: delete anything inside {{ }} and unwrap [[tags]]
+ #
+ if ($rss_p eq 'wiki') {
+ s@/\*.*?\*/@@si; # /* ... */
+ 1 while (s/{{[^{}]*}}//gs); # {{ ... }}
+ s/\[\[([^:\[\]\|]+)\|([^\[\]]+)\]\]/$2/gs; # [[link|anchor]]
+ s/\[\[([^:\[\]\|]+)\]\]/$1/gs; # [[anchor]]
+ s/\[http:[^\[\]\s]+\s+([^\[\]]+)\]/$1/gs; # [url anchor]
+# s@\s*<ref>.*?</ref>@*@gs; # <ref>url<ref> -> "*"
+ s/<[^<>]*>//gs; # <tags> -- omit.
+ }
+
+
# elide any remaining non-Latin1 binary data...
s/([\177-\377]+(\s*[\177-\377]+)[^a-z\d]*)/«...» /g;
#s/([\177-\377]+(\s*[\177-\377]+)[^a-z\d]*)/«$1» /g;
if (!defined($wrap_columns) || $wrap_columns > 0) {
$Text::Wrap::columns = ($wrap_columns || 72);
+ $Text::Wrap::break = '[\s/]'; # wrap on slashes for URLs
$_ = wrap ("", " ", $_); # wrap the lines as a paragraph
s/[ \t]+$//gm; # lose whitespace at end of line again
}
sub reformat_rss($) {
my ($body) = @_;
+ my $wiki_p = ($body =~ m@<generator>[^<>]*Wiki@si);
+
$body =~ s/(<(ITEM|ENTRY)\b)/\001\001$1/gsi;
my @items = split (/\001\001/, $body);
$title = '' if ($body1 eq $title); # Identical in Twitter's atom feed.
- reformat_html ("$title<P>$body1", 1);
+ reformat_html ("$title<P>$body1", $wiki_p ? 'wiki' : 'rss');
print "\n";
}
}
if ($wrap_columns && $wrap_columns > 0) {
print STDERR "$progname: wrapping at $wrap_columns...\n" if ($verbose > 2);
$Text::Wrap::columns = $wrap_columns;
+ $Text::Wrap::break = '[\s/]'; # wrap on slashes for URLs
$body = wrap ("", "", $body);
$body =~ s/[ \t]+$//gm;
}
-/* xscreensaver, Copyright (c) 1991-2012 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1991-2013 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
static void
do_help (saver_info *si)
{
+ char *s, year[5];
+ s = strchr (screensaver_id, '-');
+ s = strrchr (s, '-');
+ s++;
+ strncpy (year, s, 4);
+ year[4] = 0;
+
fflush (stdout);
fflush (stderr);
fprintf (stdout, "\
-xscreensaver %s, copyright (c) 1991-2008 by Jamie Zawinski <jwz@jwz.org>\n\
+xscreensaver %s, copyright (c) 1991-%s by Jamie Zawinski <jwz@jwz.org>\n\
\n\
All xscreensaver configuration is via the `~/.xscreensaver' file.\n\
Rather than editing that file by hand, just run `xscreensaver-demo':\n\
that program lets you configure the screen saver graphically,\n\
including timeouts, locking, and display modes.\n\
\n",
- si->version);
+ si->version, year);
fprintf (stdout, "\
Just getting started? Try this:\n\
\n\
{
saver_preferences *p = &si->prefs;
+ char *s, year[5];
+ s = strchr (screensaver_id, '-');
+ s = strrchr (s, '-');
+ s++;
+ strncpy (year, s, 4);
+ year[4] = 0;
+
/* This resource gets set some time before the others, so that we know
whether to print the banner (and so that the banner gets printed before
any resource-database-related error messages.)
if (p->verbose_p)
fprintf (stderr,
- "%s %s, copyright (c) 1991-2008 "
+ "%s %s, copyright (c) 1991-%s "
"by Jamie Zawinski <jwz@jwz.org>.\n",
- progname, si->version);
+ progname, si->version, year);
if (p->debug_p)
fprintf (stderr, "\n"
"\n",
blurb());
+ if (p->verbose_p && senescent_p ())
+ fprintf (stderr, "\n"
+ "*************************************"
+ "**************************************\n"
+ "%s: Warning: this version of xscreensaver is VERY OLD!\n"
+ "%s: Please upgrade! http://www.jwz.org/xscreensaver/\n"
+ "*************************************"
+ "**************************************\n"
+ "\n",
+ blurb(), blurb());
+
if (p->verbose_p)
{
if (!si->uid_message || !*si->uid_message)
apple2-main.c analogtv.c xanalogtv.c pong.c wormhole.c \
pacman.c pacman_ai.c pacman_level.c \
fuzzyflakes.c anemotaxis.c memscroller.c substrate.c \
- intermomentary.c fireworkx.c fireworkx_mmx.S fiberlamp.c \
+ intermomentary.c fireworkx.c fiberlamp.c \
boxfit.c interaggregate.c celtic.c cwaves.c m6502.c \
asm6502.c abstractile.c lcdscrub.c \
webcollage-cocoa.m webcollage-helper-cocoa.m
$(UTILS_BIN)/textclient.o: $(UTILS_SRC)/textclient.c
$(UTIL_OBJS):
- cd $(UTILS_BIN) ; \
- $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+ $(MAKE) -C $(UTILS_BIN) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
# How we build object files in this directory.
.c.o:
-/* xscreensaver, Copyright (c) 1998-2011 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1998-2013 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
# endif /* DO_XPM */
+/* 2006 Mac Mini with MacOS 10.6 failing with a bad boot drive. By jwz.
+ */
+static struct bsod_state *
+mac_diskfail (Display *dpy, Window window)
+{
+ struct bsod_state *bst = make_bsod_state (dpy, window, "macdisk", "Mac");
+ int cw = (bst->font->per_char
+ ? bst->font->per_char['n'-bst->font->min_char_or_byte2].width
+ : bst->font->min_bounds.width);
+ int h = bst->font->ascent + bst->font->descent;
+ int L = (bst->xgwa.width - (cw * 80)) / 2;
+ int T = (bst->xgwa.height - (h * 10)) / 2;
+
+ unsigned long fg = bst->fg;
+ unsigned long bg = bst->bg;
+ unsigned long bg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
+ "macx.background",
+ "Mac.Background");
+ if (L < 0) L = 0;
+ if (T < 0) T = 0;
+
+ bst->wrap_p = True;
+ bst->scroll_p = True;
+
+ BSOD_COLOR(bst, bg2, bg);
+ BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
+ BSOD_PAUSE (bst, 3000000);
+
+ BSOD_COLOR(bst, bg, fg);
+ BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
+ BSOD_COLOR(bst, fg, bg);
+
+ BSOD_MARGINS (bst, L, L);
+ BSOD_MOVETO (bst, L, T);
+
+ BSOD_TEXT (bst, LEFT,
+ "efiboot loaded from device: Acpi(PNP0A03,0)/Pci*1F|2)/Ata"
+ "(Primary,Slave)/HD(Part\n"
+ "2,Sig8997E427-064E-4FE7-8CB9-F27A784B232C)\n"
+ "boot file path: \\System\\Library\\CoreServices\\boot.efi\n"
+ ".Loading kernel cache file 'System\\Library\\Caches\\"
+ "com.apple.kext.caches\\Startup\\\n"
+ "kernelcache_i386.2A14EC2C'\n"
+ "Loading 'mach_kernel'...\n"
+ );
+ BSOD_CHAR_DELAY (bst, 7000);
+ BSOD_TEXT (bst, LEFT,
+ ".....................\n"
+ );
+ BSOD_CHAR_DELAY (bst, 0);
+ BSOD_TEXT (bst, LEFT,
+ "root device uuid is 'B62181B4-6755-3C27-BFA1-49A0E053DBD6\n"
+ "Loading drivers...\n"
+ "Loading System\\Library\\Caches\\com.apple.kext.caches\\"
+ "Startup\\Extensions.mkext....\n"
+ );
+ BSOD_CHAR_DELAY (bst, 7000);
+ BSOD_TEXT (bst, LEFT,
+ "..............................................................."
+ ".................\n"
+ "..............................................................."
+ ".................\n"
+ "..............\n"
+ );
+ BSOD_INVERT (bst);
+ BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
+ BSOD_INVERT (bst);
+
+ BSOD_MARGINS (bst, 0, 0);
+ BSOD_MOVETO (bst, 0, h);
+
+ BSOD_CHAR_DELAY (bst, 0);
+ BSOD_LINE_DELAY (bst, 5000);
+ BSOD_TEXT (bst, LEFT,
+ "npvhash=4095\n"
+ "PRE enabled\n"
+ "Darwin Kernel Version 10.8.9: Tue Jun 7 16:33:36 PDT 2011;"
+ " root:xnu-1504.15.3~1/RELEASE_I386\n"
+ "vm_page_bootstrap: 508036 free pages and 16252 wired pages\n"
+ "standard timeslicing quantum is 10000 us\n"
+ "mig_table_max_displ = 73\n"
+ "AppleACPICPU: ProcessorId=0 LocalApicId=0 Enabled\n"
+ "AppleACPICPU: ProcessorId=1 LocalApicId=1 Enabled\n"
+ "calling npo_policy_init for Quarantine\n"
+ "Security policy loaded: Quaantine policy (Quarantine)\n"
+ "calling npo_policy_init for Sandbox\n"
+ "Security policy loaded: Seatbelt sandbox policy (Sandbox)\n"
+ "calling npo_policy_init for TMSafetyNet\n"
+ "Security policy loaded: Safety net for Time Machine "
+ "(TMSafetyNet)\n"
+ "Copyright (c) 1982, 1986, 1989, 1991, 1993\n"
+ "The Regents of the University of California. All rights "
+ "reserved.\n"
+ "\n"
+ "MAC Framework successfully initialized\n"
+ "using 10485 buffer headers and 4096 cluster IO buffer headers\n"
+ "IOAPIC: Version 0x20 Vectors 64:87\n"
+ "ACPI: System State [S0 S3 S4 S5] (S3)\n"
+ "PFM64 0x10000000, 0xf0000000\n"
+ "[ PCI configuration begin ]\n"
+ "PCI configuration changed (bridge=1 device=1 cardbus=0)\n"
+ "[ PCI configuration end, bridges 4 devices 17 ]\n"
+ "nbinit: done (64 MB memory set for nbuf pool)\n"
+ "rooting via boot-uuid from /chosen: "
+ "B62181B4-6755-3C27-BFA1-49A0E053DBD6\n"
+ "Waiting on <dict ID=\"0\"><key>IOProviderClass</key>"
+ "<string ID=\"1\">IOResources</string><key>IOResourceMatch</key>"
+ "<string ID=\"2\">boot-uuid-nedia</string></dict>\n"
+ "com.apple.AppleFSCCompressionTypeZlib kmod start\n"
+ "com.apple.AppleFSCCompressionTypeZlib kmod succeeded\n"
+ "AppleIntelCPUPowerManagementClient: ready\n"
+ "FireWire (OHCI) Lucent ID 5811 built-in now active, GUID "
+ "0019e3fffe97f8b4; max speed s400.\n"
+ "Got boot device = IOService:/AppleACPIPlatformExpert/PCI000/"
+ "AppleACPIPCI/SATA@1F,2/AppleAHCI/PRI202/IOAHCIDevice@0/"
+ "AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/"
+ "IOBlockStorageDriver/ST96812AS Media/IOGUIDPartitionScheme/"
+ "Customer02\n"
+ );
+ BSOD_PAUSE (bst, 1000000);
+ BSOD_TEXT (bst, LEFT,
+ "BSD root: Disk0s, major 14, minor 2\n"
+ "[Bluetooth::CSRHIDTransition] switchtoHCIMode (legacy)\n"
+ "[Bluetooth::CSRHIDTransition] transition complete.\n"
+ "CSRUSBBluetoothHCIController::setupHardware super returned 0\n"
+ );
+ BSOD_PAUSE (bst, 3000000);
+ BSOD_TEXT (bst, LEFT,
+ "disk0s2: I/O error.\n"
+ "0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] "
+ "[ErrType IO] [ErrNo 5] [IOType Read] [PBlkNum 48424] "
+ "[LBlkNum 1362] [FSLogMsgID 2009724291] [FSLogMsgOrder First]\n"
+ "0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] "
+ "[DevNode root_device] [MountPt /] [FSLogMsgID 2009724291] "
+ "[FSLogMsgOrder Last]\n"
+ "panic(cpu 0 caller 0x47f5ad): \"Process 1 exec of /sbin/launchd"
+ " failed, errno 5\\n\"0/SourceCache/xnu/xnu-1504.15.3/bsd/kern/"
+ "kern_exec.c:3145\n"
+ "Debugger called: <panic>\n"
+ "Backtrace (CPU 0), Frame : Return Address (4 potential args "
+ "on stack)\n"
+ "0x34bf3e48 : 0x21b837 (0x5dd7fc 0x34bf3e7c 0x223ce1 0x0)\n"
+ "0x34bf3e98 : 0x47f5ad (0x5cf950 0x831c08 0x5 0x0)\n"
+ "0x34bf3ef8 : 0x4696d2 (0x4800d20 0x1fe 0x45a69a0 0x80000001)\n"
+ "0x34bf3f38 : 0x48fee5 (0x46077a8 0x84baa0 0x34bf3f88 "
+ "0x34bf3f94)\n"
+ "0x34bf3f68 : 0x219432 (0x46077a8 0xffffff7f 0x0 0x227c4b)\n"
+ "0x34bf3fa8 : 0x2aacb4 (0xffffffff 0x1 0x22f8f5 0x227c4b)\n"
+ "0x34bf3fc8 : 0x2a1976 (0x0 0x0 0x2a17ab 0x4023ef0)\n"
+ "\n"
+ "BSD process name corresponding to current thread: init\n"
+ "\n"
+ "Mac OS version:\n"
+ "Not yet set\n"
+ "\n"
+ "Kernel version:\n"
+ "Darwin Kernel version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; "
+ "root:xnu-1504.15-3~1/RELEASE_I386\n"
+ "System model name: Macmini1,1 (Mac-F4208EC0)\n"
+ "\n"
+ "System uptime in nanoseconds: 13239332027\n"
+ );
+ BSOD_CURSOR (bst, CURSOR_BLOCK, 500000, 999999);
+
+ XClearWindow (dpy, window);
+
+ return bst;
+}
+
+
+
static struct bsod_state *
macx (Display *dpy, Window window)
{
# ifdef DO_XPM
- switch (random() % 3) {
+ switch (random() % 4) {
case 0: return macx_10_0 (dpy, window); break;
case 1: return macx_10_2 (dpy, window, False); break;
case 2: return macx_10_2 (dpy, window, True); break;
+ case 3: return mac_diskfail (dpy, window); break;
default: abort();
}
# else /* !DO_XPM */
- return macx_10_0 (dpy, window);
+ switch (random() % 2) {
+ case 0: return macx_10_0 (dpy, window); break;
+ default: return mac_diskfail (dpy, window); break;
+ }
# endif /* !DO_XPM */
}
{ -1, "Soft power switch enabled, polling @ 0xf0400804.\n" },
{ -1, "pty: 256 Unix98 ptys configured\n" },
{ -1, "Generic RTC Driver v1.07\n" },
- { -1, "Serial: 8250/16550 driver $Revision: 1.97 $ 13 ports, "
+ { -1, "Serial: 8250/16550 driver $Revision: 1.98 $ 13 ports, "
"IRQ sharing disabled\n" },
{ -1, "ttyS0 at I/O 0x3f8 (irq = 0) is a 16550A\n" },
{ -1, "ttyS1 at I/O 0x2f8 (irq = 0) is a 16550A\n" },
".macx.textBackground: Black",
".macx.background: #888888",
+ ".macdisk.font: -*-courier-bold-r-*-*-*-80-*-*-m-*-*-*",
+ ".macdisk.bigFont: -*-courier-bold-r-*-*-*-100-*-*-m-*-*-*",
+
".sco.font: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
".sco.foreground: White",
".sco.background: Black",
".hvx.font: Courier-Bold 9",
".bsd.font: Courier-Bold 9",
".solaris.font: Courier-Bold 6",
+ ".macdisk.font: Courier-Bold 6",
# endif
0
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FADEPLOT.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FIBERLAMP.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FIREWORKX.C
-$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FIREWORKX_MMX.S
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FLAG.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FLAME.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FLOW.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FADEPLOT.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FIBERLAMP.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FIREWORKX.C
-$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FIREWORKX_MMX.S
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FLAG.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FLAME.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FLOW.C
a screen saver and locker for the X window system
by Jamie Zawinski
- version 5.20
- 06-Oct-2012
+ version 5.21
+ 04-Feb-2013
http://www.jwz.org/xscreensaver/
<number id="Delay" type="slider" arg="-delay %"
_label="Frame rate" _low-label="Low" _high-label="High"
- low="0" high="100000" default="20000"
+ low="0" high="100000" default="10000"
convert="invert"/>
<number id="maxlife" type="slider" arg="-maxlife %"
_label="Activity" _low-label="Dense" _high-label="Sparse"
- low="250" high="5000" default="2000"/>
+ low="0" high="100" default="32"/>
<boolean id="flash" _label="Light flash" arg-unset="-no-flash"/>
- <boolean id="glow" _label="Glowing smoke" arg-unset="-no-glow"/>
<boolean id="shoot" _label="Shells upward" arg-set="-shoot"/>
-
<boolean id="showfps" _label="Show frame rate" arg-set="-fps"/>
<_description>
<boolean id="showfps" _label="Show frame rate" arg-set="-fps"/>
</vgroup>
<vgroup>
- <boolean id="hw" _label="Horizontal white" arg-unset="-no-hw"/>
- <boolean id="vw" _label="Vertical white" arg-unset="-no-vw"/>
- <boolean id="dw" _label="Diagonal white" arg-unset="-no-dw"/>
- <boolean id="w" _label="Solid white" arg-unset="-no-w"/>
+ <boolean id="hw" _label="Horizontal white" arg-unset="-no-hw"/>
+ <boolean id="vw" _label="Vertical white" arg-unset="-no-vw"/>
+ <boolean id="dw" _label="Diagonal white" arg-unset="-no-dw"/>
+ <boolean id="w" _label="Solid white" arg-unset="-no-w"/>
+ <boolean id="rgb" _label="Primary colors" arg-unset="-no-rgb"/>
</vgroup>
<vgroup>
- <boolean id="hb" _label="Horizontal black" arg-unset="-no-hb"/>
- <boolean id="vb" _label="Vertical black" arg-unset="-no-vb"/>
- <boolean id="db" _label="Diagonal black" arg-unset="-no-db"/>
- <boolean id="b" _label="Solid black" arg-unset="-no-b"/>
+ <boolean id="hb" _label="Horizontal black" arg-unset="-no-hb"/>
+ <boolean id="vb" _label="Vertical black" arg-unset="-no-vb"/>
+ <boolean id="db" _label="Diagonal black" arg-unset="-no-db"/>
+ <boolean id="b" _label="Solid black" arg-unset="-no-b"/>
</vgroup>
</hgroup>
/* -*- mode: C; tab-width: 4 -*-
- * xscreensaver, Copyright (c) 1992-2008 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1992-2013 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
XGetWindowAttributes (st->dpy, st->window, &st->xgwa);
/* XClearWindow (dpy, window); */
/* Why doesn't this work? */
- XPutImage (st->dpy, st->window, st->gc, st->orig_map,
- 0, 0, st->orig_map->width, st->orig_map->height, 0, 0);
+ if (st->orig_map) /* created in distort_finish_loading, might be early */
+ XPutImage (st->dpy, st->window, st->gc, st->orig_map,
+ 0, 0, st->orig_map->width, st->orig_map->height, 0, 0);
}
static Bool
/*
- * Fireworkx 1.6 - pyrotechnics simulation program (XScreensaver version)
- * Copyright (c) 1999-2007 Rony B Chandran <ronybc@asia.com>
- *
- * From Kerala, INDIA
- *
- * url: http://www.ronybc.8k.com
- *
- * 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.
- *
- * Additional programming:
- * ------------------------
- * Support for different dpy color modes:
- * Jean-Pierre Demailly <Jean-Pierre.Demailly@ujf-grenoble.fr>
- *
- * Fixed array access problems by beating on it with a large hammer.
- * Nicholas Miell <nmiell@gmail.com>
- *
- * Freed 'free'ing up of memory by adding the forgotten 'XSync's
- * Renuka S <renuka@local.net>
- *
+ Fireworkx 2.2 - Pyrotechnic explosions simulation,
+ an eyecandy, live animating colorful fireworks super-blasts..!
+ Copyright (GPL) 1999-2013 Rony B Chandran <ronybc@gmail.com>
+
+ From Kerala, INDIA
+ Website: http://www.ronybc.com
+
+ 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.
+
+ 2004-OCT: ronybc: Landed on Xscreensaver..!
+ 2012-DEC: ronybc: Almost rewrite of the last version (>4 years old)
+ with SSE2 optimization, colored light flashes,
+ HSV color and many visual and speed improvements.
+
+ Additional coding:
+ ---------------------------------------------------------------------------------
+ Support for different display color modes: put_image()
+ Jean-Pierre Demailly <Jean-Pierre.Demailly@ujf-grenoble.fr>
+
+ Fixed array access problems by beating on it with a large hammer.
+ Nicholas Miell <nmiell@gmail.com>
+
+ Help 'free'ing up of memory with needed 'XSync's.
+ Renuka S <renuka@ronybc.com>
+ Rugmini R Chandran <rugmini@ronybc.com>
+\
*/
-#include <math.h>
#include "screenhack.h"
-#define FWXVERSION "1.6"
+#ifdef __SSE2__
+# include <emmintrin.h>
+#endif
-#define SHELLCOUNT 3 /* 3 ; see light() before changing this value */
-#define PIXCOUNT 500 /* 500 */
-#define POWER 5 /* 5 */
-#define FTWEAK 12 /* 12 */
+#define FWXVERSION "2.2"
-#if HAVE_X86_MMX
-void mmx_blur(char *a, int b, int c, int d);
-void mmx_glow(char *a, int b, int c, int d, char *e);
-#endif
+#define WIDTH 1024 /* 888 */
+#define HEIGHT 632 /* 548 */
+#define SHELLCOUNT 4 /* FIXED NUMBER; for SSE optimization */
+#define PIXCOUNT 500 /* 500 */
+#define SHELL_LIFE_DEFAULT 3200 /* 3200 */
+#define SHELL_LIFE_RATIO 6 /* 6 */
+#define POWDER 5.0 /* 5.0 */
+#define FTWEAK 12 /* 12 */
+#define FLASH_ZOOM 0.8 /* 1.0 */
+#define G_ACCELERATION 0.001 /* GRAVITY */
+
+typedef struct
+{
+ unsigned int burn;
+ float x, y;
+ float xv, yv;
+} firepix;
-#define rnd(x) ((x) ? (int)(random() % (x)) : 0)
-
-typedef struct {
- unsigned int burn;
- float x;
- float y;
- float xv;
- float yv;}firepix;
-
-typedef struct {
- unsigned int cx,cy;
- unsigned int life;
- unsigned int color;
- unsigned int special;
- unsigned int cshift;
- unsigned int vgn,shy;
- float air,flash;
- firepix *fpix; }fireshell;
-
-struct state {
- Display *dpy;
- Window window;
-
- fireshell *fshell, *ffshell;
- GC gc;
-
- int depth;
- int bigendian;
- Bool flash_on;
- Bool glow_on;
- Bool verbose;
- Bool shoot;
- int width;
- int height;
- int rndlife;
- int minlife;
- int delay;
- float flash_fade;
- unsigned char *palaka1;
- unsigned char *palaka2;
- XImage *xim;
- XColor *colors;
- int ncolors;
+typedef struct
+{
+ unsigned int cx, cy;
+ unsigned int seq_number, life;
+ unsigned int bicolor, flies, hshift, vshift;
+ unsigned int mortar_fired, explode_y;
+ float air_drag, vshift_phase;
+ float flash_r, flash_g, flash_b;
+ unsigned int h;
+ double s, v;
+ unsigned char r, g, b;
+ firepix *fpix;
+} fireshell;
+
+struct state
+{
+ unsigned int fps_on;
+ unsigned int flash_on;
+ unsigned int shoot;
+ unsigned int verbose;
+ unsigned int width;
+ unsigned int height;
+ unsigned int fullscreen;
+ unsigned int max_shell_life;
+ unsigned int delay;
+ float flash_fade;
+ float *light_map;
+ unsigned char *palaka1;
+ unsigned char *palaka2;
+ void *mem1;
+ void *mem2;
+ fireshell *fireshell_array;
+
+ Display *dpy;
+ Window window;
+ XImage *xim;
+ GC gc;
+ XColor *colors;
+ int depth;
+ int bigendian;
+ int ncolors;
};
-static int explode(struct state *st, fireshell *fs)
+/*
+ will return zero.. divide with care.
+*/
+static unsigned int rnd(unsigned int x)
{
- float air,adg = 0.001; /* gravity */
- unsigned int n,c;
- unsigned int h = st->height;
- unsigned int w = st->width;
- unsigned int *prgb;
- unsigned char *palaka = st->palaka1;
- firepix *fp = fs->fpix;
- if(fs->vgn){
- if(--fs->cy == fs->shy){
- fs->vgn = 0;
- fs->flash = rnd(30000)+25000;
- fs->flash = fs->flash*fs->flash; }
- else{
- fs->flash = 200000+(fs->cy - fs->shy)*(fs->cy - fs->shy)*8;
- prgb=(unsigned int *)(palaka + (fs->cy * w + fs->cx + rnd(5)-2)*4);
- *prgb=(rnd(8)+8)*0x000f0f10;
- return(1);}}
- if(fs->cshift) --fs->cshift;
- if((fs->cshift+1)%50==0) fs->color = ~fs->color;
- c = fs->color;
- air = fs->air;
- fs->flash *= st->flash_fade;
- for(n=PIXCOUNT;n;n--){
- if(fp->burn){ --fp->burn;
- if(fs->special){
- fp->x += fp->xv = fp->xv * air + (float)(rnd(200)-100)/2000;
- fp->y += fp->yv = fp->yv * air + (float)(rnd(200)-100)/2000+ adg;}
- else{
- fp->x += fp->xv = fp->xv * air + (float)(rnd(200)-100)/20000;
- fp->y += fp->yv = fp->yv * air + (float)(rnd(200)-100)/40000+ adg; }
- if(fp->y > h){
- if(rnd(5)==3) {fp->yv *= -0.24; fp->y = h;}
- else fp->burn=0;} /* touch muddy ground :) */
- if(fp->x < w && fp->x > 0 && fp->y < h && fp->y > 0){
- prgb = (unsigned int *)(palaka + ((int)fp->y * w + (int)fp->x)*4);
- *prgb = c; }
- } fp++;
- } return(--fs->life); }
-
-static void recycle(struct state *st, fireshell *fs,int x,int y)
+ return(random() % x);
+}
+
+static void fs_roll_rgb(fireshell *fs)
{
- unsigned int n,pixlife;
- firepix *fp = fs->fpix;
- fs->vgn = st->shoot;
- fs->shy = y;
- fs->cx = x;
- fs->cy = st->shoot ? st->height : y ;
- fs->color = (rnd(155)+100) <<16 |
- (rnd(155)+100) <<8 |
- rnd(255);
- fs->life = rnd(st->rndlife)+st->minlife;
- fs->air = 1-(float)(rnd(200))/10000;
- fs->flash = rnd(30000)+25000; /* million jouls... */
- fs->flash = fs->flash*fs->flash;
- fs->cshift = !rnd(5) ? 120:0;
- fs->special = !rnd(10) ? 1:0;
- if(st->verbose)
- printf("recycle(): color = %x air = %f life = %d \n",fs->color,fs->air,fs->life);
- pixlife = rnd(fs->life)+fs->life/10+1; /* ! */
- for(n=0;n<PIXCOUNT;n++){
- fp->burn = rnd(pixlife)+32;
- fp->xv = POWER*(float)(rnd(20000)-10000)/10000;
- fp->yv = sqrt(POWER*POWER - fp->xv * fp->xv) *
- (float)(rnd(20000)-10000)/10000;
- fp->x = x;
- fp->y = y;
- fp++; }}
-
-static void glow(struct state *st)
+ unsigned short r, g, b;
+ hsv_to_rgb (fs->h, fs->s, fs->v, &r, &g, &b);
+ fs->r = (unsigned char) (r >> 8);
+ fs->g = (unsigned char) (g >> 8);
+ fs->b = (unsigned char) (b >> 8);
+}
+
+static void mix_colors(fireshell *fs)
{
- unsigned int n,q;
- unsigned int w = st->width;
- unsigned int h = st->height;
- unsigned char *pa, *pb, *pm, *po;
- if (!st->xim) return;
- pm = st->palaka1;
- po = st->palaka2;
- for(n=0;n<w*4;n++)
- {pm[n]=0; po[n]=0;} /* clean first line */
- pm+=n; po+=n; h-=2;
- pa = pm-(w*4);
- pb = pm+(w*4);
- for(n=4;n<w*h*4-4;n++){
- q = pm[n-4] + (pm[n]*8) + pm[n+4] +
- pa[n-4] + pa[n] + pa[n+4] +
- pb[n-4] + pb[n] + pb[n+4];
- q -= q>8 ? 8:q;
- pm[n] = q>>4;
- q = q>>3;
- po[n] = q>255 ? 255 : q;}
- pm+=n; po+=n;
- for(n=0;n<w*4;n++)
- {pm[n]=0; po[n]=0;}} /* clean last line */
-
-static void blur(struct state *st)
+ float flash;
+ fs->h = rnd(360);
+ fs->s = frand(0.4) + 0.6;
+ fs->v = 1.0;
+ fs_roll_rgb(fs);
+
+ flash = rnd(444) + 111; /* Mega Jouls ! */
+ fs->flash_r = fs->r * flash;
+ fs->flash_g = fs->g * flash;
+ fs->flash_b = fs->b * flash;
+}
+
+static void render_light_map(struct state *st, fireshell *fs)
{
- unsigned int n,q;
- unsigned int w = st->width;
- unsigned int h = st->height;
- unsigned char *pa, *pb, *pm;
- pm = st->palaka1;
- pm += w*4; h-=2; /* line 0&h */
- pa = pm-(w*4);
- pb = pm+(w*4);
- for(n=4;n<w*h*4-4;n++){
- q = pm[n-4] + (pm[n]*8) + pm[n+4] +
- pa[n-4] + pa[n] + pa[n+4] +
- pb[n-4] + pb[n] + pb[n+4];
- q -= q>8 ? 8:q;
- pm[n] = q>>4;}
- pm += n-4; /* last line */
- for(n=0;n<w*4+4;n++) pm[n]=0;
- pm = st->palaka1; /* first line */
- for(n=0;n<w*4+4;n++) pm[n]=pm[n+w*4]; }
-
-static void light_2x2(struct state *st, fireshell *fss)
+ signed int x, y, v = 0;
+ for (y = 0, v = fs->seq_number; y < st->height; y += 2)
+ {
+ for (x = 0; x < st->width; x += 2, v += SHELLCOUNT)
+ {
+ float f;
+ f = sqrtf((fs->cx - x) * (fs->cx - x) + (fs->cy - y) * (fs->cy - y)) + 4.0;
+ f = FLASH_ZOOM / f;
+ f += pow(f,0.1) * frand(0.0001); /* dither */
+ st->light_map[v] = f;
+ }
+ }
+}
+
+static void recycle(struct state *st, fireshell *fs, unsigned int x, unsigned int y)
{
- unsigned int l,t,x,y;
- float s;
- int w = st->width;
- int h = st->height;
- unsigned char *dim = st->palaka2;
- unsigned char *sim = st->palaka1;
- int nl = w*4;
- fireshell *f;
- if(st->glow_on) sim=dim;
- for(y=0;y<h;y+=2){
- for(x=0;x<w;x+=2){
- f = fss;
-
-/* Note: The follwing loop is unrolled for speed.
- check this before changing the value of SHELLCOUNT
- s = 0;
- for(n=SHELLCOUNT;n;n--,f++){
- s += f->flash/(1+(f->cx - x)*(f->cx - x)+(f->cy - y)*(f->cy - y));} */
-
- s = f->flash/(1+(f->cx - x)*(f->cx - x)+(f->cy - y)*(f->cy - y));
- f++;
- s += f->flash/(1+(f->cx - x)*(f->cx - x)+(f->cy - y)*(f->cy - y));
- f++;
- s += f->flash/(1+(f->cx - x)*(f->cx - x)+(f->cy - y)*(f->cy - y));
-
- l = sqrtf(s);
-
- t = l + sim[0];
- dim[0] = (t > 255 ? 255 : t);
- t = l + sim[1];
- dim[1] = (t > 255 ? 255 : t);
- t = l + sim[2];
- dim[2] = (t > 255 ? 255 : t);
-
- t = l + sim[4];
- dim[4] = (t > 255 ? 255 : t);
- t = l + sim[5];
- dim[5] = (t > 255 ? 255 : t);
- t = l + sim[6];
- dim[6] = (t > 255 ? 255 : t);
-
- t = l + sim[nl+0];
- dim[nl+0] = (t > 255 ? 255 : t);
- t = l + sim[nl+1];
- dim[nl+1] = (t > 255 ? 255 : t);
- t = l + sim[nl+2];
- dim[nl+2] = (t > 255 ? 255 : t);
-
- t = l + sim[nl+4];
- dim[nl+4] = (t > 255 ? 255 : t);
- t = l + sim[nl+5];
- dim[nl+5] = (t > 255 ? 255 : t);
- t = l + sim[nl+6];
- dim[nl+6] = (t > 255 ? 255 : t);
-
- sim += 8; dim += 8; } sim += nl; dim += nl;}}
+ unsigned int n, pixlife;
+ firepix *fp = fs->fpix;
+ fs->mortar_fired = st->shoot;
+ fs->explode_y = y;
+ fs->cx = x;
+ fs->cy = st->shoot ? st->height : y ;
+ fs->life = rnd(st->max_shell_life) + (st->max_shell_life/SHELL_LIFE_RATIO);
+ fs->life += !rnd(25) ? st->max_shell_life * 5 : 0;
+ fs->air_drag = 1.0 - (float)(rnd(200)) / (10000.0 + fs->life);
+ fs->bicolor = !rnd(5) ? 120 : 0;
+ fs->flies = !rnd(10) ? 1 : 0; /* flies' motion */
+ fs->hshift = !rnd(5) ? 1 : 0; /* hue shifting */
+ fs->vshift = !rnd(10) ? 1 : 0; /* value shifting */
+ fs->vshift_phase = M_PI/2.0;
+ pixlife = rnd(fs->life) + fs->life / 10 + 1; /* ! */
+ for (n = 0; n < PIXCOUNT; n++)
+ {
+ fp->burn = rnd(pixlife) + 32;
+ fp->xv = frand(2.0) * POWDER - POWDER;
+ fp->yv = sqrt(POWDER * POWDER - fp->xv * fp->xv) * (frand(2.0) - 1.0);
+ fp->x = x;
+ fp->y = y;
+ fp++;
+ }
+ mix_colors(fs);
+ render_light_map(st, fs);
+}
-static void resize(struct state *st)
+static void recycle_oldest(struct state *st, unsigned int x, unsigned int y)
{
- XWindowAttributes xwa;
- XGetWindowAttributes (st->dpy, st->window, &xwa);
- xwa.width -= xwa.width % 2;
- xwa.height -= xwa.height % 2;
- if(xwa.height != st->height || xwa.width != st->width) {
- st->width = xwa.width;
- st->height = xwa.height;
- if (st->verbose)
- printf("sky size: %dx%d ------------------------------\n",st->width,st->height);
- if (st->xim) {
- if (st->xim->data==(char *)st->palaka2) st->xim->data=NULL;
- XDestroyImage(st->xim);
- if (st->palaka2!=st->palaka1) free(st->palaka2 - 8);
- free(st->palaka1 - 8);
- }
- st->palaka1 = NULL;
- st->palaka2 = NULL;
- st->xim = XCreateImage(st->dpy, xwa.visual, xwa.depth, ZPixmap, 0, 0,
- st->width, st->height, 8, 0);
- if (!st->xim) return;
- st->palaka1 = (unsigned char *) calloc(st->xim->height+1,st->xim->width*4) + 8;
- if(st->flash_on|st->glow_on)
- st->palaka2 = (unsigned char *) calloc(st->xim->height+1,st->xim->width*4) + 8;
- else
- st->palaka2 = st->palaka1;
- if (st->depth>=24)
- st->xim->data = (char *)st->palaka2;
- else
- st->xim->data = calloc(st->xim->height,st->xim->bytes_per_line); }}
+ unsigned int n;
+ fireshell *fs, *oldest;
+ fs = oldest = st->fireshell_array;
+ for (n = 0; n < SHELLCOUNT; n++)
+ {
+ if(fs[n].life < oldest->life) oldest = &fs[n];
+ }
+ recycle(st, oldest, x, y);
+}
-static void put_image(struct state *st)
+static void rotate_hue(fireshell *fs, int dh)
{
- int x,y,i,j;
- unsigned char r, g, b;
- if (!st->xim) return;
- i = 0;
- j = 0;
- if (st->depth==16) {
- if(st->bigendian)
- for (y=0;y<st->xim->height; y++)
- for (x=0;x<st->xim->width; x++) {
- r = st->palaka2[j++];
- g = st->palaka2[j++];
- b = st->palaka2[j++];
- j++;
- st->xim->data[i++] = (g&224)>>5 | (r&248);
- st->xim->data[i++] = (b&248)>>3 | (g&28)<<3;
- }
- else
- for (y=0;y<st->xim->height; y++)
- for (x=0;x<st->xim->width; x++) {
- r = st->palaka2[j++];
- g = st->palaka2[j++];
- b = st->palaka2[j++];
- j++;
- st->xim->data[i++] = (b&248)>>3 | (g&28)<<3;
- st->xim->data[i++] = (g&224)>>5 | (r&248);
- }
- }
- if (st->depth==15) {
- if(st->bigendian)
- for (y=0;y<st->xim->height; y++)
- for (x=0;x<st->xim->width; x++) {
- r = st->palaka2[j++];
- g = st->palaka2[j++];
- b = st->palaka2[j++];
- j++;
- st->xim->data[i++] = (g&192)>>6 | (r&248)>>1;
- st->xim->data[i++] = (b&248)>>3 | (g&56)<<2;
- }
- else
- for (y=0;y<st->xim->height; y++)
- for (x=0;x<st->xim->width; x++) {
- r = st->palaka2[j++];
- g = st->palaka2[j++];
- b = st->palaka2[j++];
- j++;
- st->xim->data[i++] = (b&248)>>3 | (g&56)<<2;
- st->xim->data[i++] = (g&192)>>6 | (r&248)>>1;
- }
- }
- if (st->depth==8) {
- for (y=0;y<st->xim->height; y++)
- for (x=0;x<st->xim->width; x++) {
- r = st->palaka2[j++];
- g = st->palaka2[j++];
- b = st->palaka2[j++];
- j++;
- st->xim->data[i++] = (((7*g)/256)*36)+(((6*r)/256)*6)+((6*b)/256);
- }
- }
- XPutImage(st->dpy,st->window,st->gc,st->xim,0,0,0,0,st->xim->width,st->xim->height); }
+ fs->h = fs->h + dh;
+ fs->s = fs->s - 0.001;
+ fs_roll_rgb(fs);
+}
+static void wave_value(fireshell *fs)
+{
+ fs->vshift_phase = fs->vshift_phase + 0.008;
+ fs->v = fabs(sin(fs->vshift_phase));
+ fs_roll_rgb(fs);
+}
-static void *
-fireworkx_init (Display *dpy, Window win)
+static int explode(struct state *st, fireshell *fs)
{
- struct state *st = (struct state *) calloc (1, sizeof(*st));
- unsigned int n;
- Visual *vi;
- Colormap cmap;
- Bool writable;
- XWindowAttributes xwa;
- XGCValues gcv;
- firepix *fpix, *ffpix;
-
- st->dpy = dpy;
- st->window = win;
-
- st->glow_on = get_boolean_resource(st->dpy, "glow" , "Boolean");
- st->flash_on = get_boolean_resource(st->dpy, "flash" , "Boolean");
- st->shoot = get_boolean_resource(st->dpy, "shoot" , "Boolean");
- st->verbose = get_boolean_resource(st->dpy, "verbose" , "Boolean");
- st->rndlife = get_integer_resource(st->dpy, "maxlife" , "Integer");
- st->delay = get_integer_resource(st->dpy, "delay" , "Integer");
- st->minlife = st->rndlife/4;
- st->flash_fade=0.98;
- if(st->rndlife < 1000) st->flash_fade=0.96;
- if(st->rndlife < 500) st->flash_fade=0.94;
- if(st->verbose){
- printf("Fireworkx %s - pyrotechnics simulation program \n", FWXVERSION);
- printf("Copyright (c) 1999-2007 Rony B Chandran <ronybc@asia.com> \n\n");
- printf("url: http://www.ronybc.8k.com \n\n");}
-
- XGetWindowAttributes(st->dpy,win,&xwa);
- st->depth = xwa.depth;
- vi = xwa.visual;
- cmap = xwa.colormap;
- st->bigendian = (ImageByteOrder(st->dpy) == MSBFirst);
-
- if(st->depth==8){
- if(st->verbose){
- printf("Pseudocolor color: use '-no-flash' for better results.\n");}
- st->colors = (XColor *) calloc(sizeof(XColor),st->ncolors+1);
- writable = False;
- make_smooth_colormap(st->dpy, vi, cmap, st->colors, &st->ncolors,
- False, &writable, True);
- }
- st->gc = XCreateGC(st->dpy, win, 0, &gcv);
-
- resize(st); /* initialize palakas */
-
- ffpix = malloc(sizeof(firepix) * PIXCOUNT * SHELLCOUNT);
- st->ffshell = malloc(sizeof(fireshell) * SHELLCOUNT);
- st->fshell = st->ffshell;
- fpix = ffpix;
- for (n=0;n<SHELLCOUNT;n++){
- st->fshell->fpix = fpix;
- recycle (st, st->fshell,rnd(st->width),rnd(st->height));
- st->fshell++;
- fpix += PIXCOUNT; }
-
- return st;
+ float air_drag;
+ unsigned int n;
+ unsigned int h = st->height;
+ unsigned int w = st->width;
+ unsigned char r, g, b;
+ unsigned char *prgba;
+ unsigned char *palaka = st->palaka1;
+ firepix *fp = fs->fpix;
+ if (fs->mortar_fired)
+ {
+ if (--fs->cy == fs->explode_y)
+ {
+ fs->mortar_fired = 0;
+ mix_colors(fs);
+ render_light_map(st, fs);
+ }
+ else
+ {
+ fs->flash_r =
+ fs->flash_g =
+ fs->flash_b = 50 + (fs->cy - fs->explode_y) * 10;
+ prgba = palaka + (fs->cy * w + fs->cx + rnd(5) - 2) * 4;
+ prgba[0] = (rnd(32) + 128);
+ prgba[1] = (rnd(32) + 128);
+ prgba[2] = (rnd(32) + 128);
+ return(1);
+ }
+ }
+ if ((fs->bicolor + 1) % 50 == 0) rotate_hue(fs, 180);
+ if (fs->bicolor) --fs->bicolor;
+ if (fs->hshift) rotate_hue(fs, rnd(8));
+ if (fs->vshift) wave_value(fs);
+ if (fs->flash_r > 1.0) fs->flash_r *= st->flash_fade;
+ if (fs->flash_g > 1.0) fs->flash_g *= st->flash_fade;
+ if (fs->flash_b > 1.0) fs->flash_b *= st->flash_fade;
+ air_drag = fs->air_drag;
+ r = fs->r;
+ g = fs->g;
+ b = fs->b;
+ for (n = 0; n < PIXCOUNT; n++, fp++)
+ {
+ if (!fp->burn) continue;
+ --fp->burn;
+ if (fs->flies)
+ {
+ fp->x += fp->xv = fp->xv * air_drag + frand(0.1) - 0.05;
+ fp->y += fp->yv = fp->yv * air_drag + frand(0.1) - 0.05 + G_ACCELERATION;
+ }
+ else
+ {
+ fp->x += fp->xv = fp->xv * air_drag + frand(0.01) - 0.005;
+ fp->y += fp->yv = fp->yv * air_drag + frand(0.005) - 0.0025 + G_ACCELERATION;
+ }
+ if (fp->y > h)
+ {
+ if (rnd(5) == 3)
+ {
+ fp->yv *= -0.24;
+ fp->y = h;
+ }
+ /* touch muddy ground :) */
+ else fp->burn = 0;
+ }
+ if (fp->x < w && fp->x > 0 && fp->y < h && fp->y > 0)
+ {
+ prgba = palaka + ((int)fp->y * w + (int)fp->x) * 4;
+ prgba[0] = b;
+ prgba[1] = g;
+ prgba[2] = r;
+ }
+ }
+ return(--fs->life);
}
+#ifdef __SSE2__
-static unsigned long
-fireworkx_draw (Display *dpy, Window win, void *closure)
+/* SSE2 optimized versions of glow_blur() and chromo_2x2_light() */
+
+static void glow_blur(struct state *st)
+{
+ unsigned int n, nn;
+ unsigned char *ps = st->palaka1;
+ unsigned char *pd = st->palaka2;
+ unsigned char *pa = st->palaka1 - (st->width * 4);
+ unsigned char *pb = st->palaka1 + (st->width * 4);
+ __m128i xmm0, xmm1, xmm2, xmm3, xmm4;
+
+ xmm0 = _mm_setzero_si128();
+ nn = st->width * st->height * 4;
+ for (n = 0; n < nn; n+=16)
+ {
+ _mm_prefetch((const void *)&ps[n+16],_MM_HINT_T0);
+ _mm_prefetch((const void *)&pa[n+16],_MM_HINT_T0);
+ _mm_prefetch((const void *)&pb[n+16],_MM_HINT_T0);
+
+ xmm1 = _mm_load_si128((const __m128i*)&ps[n]);
+ xmm2 = xmm1;
+ xmm1 = _mm_unpacklo_epi8(xmm1,xmm0);
+ xmm2 = _mm_unpackhi_epi8(xmm2,xmm0);
+ xmm3 = _mm_loadu_si128((const __m128i*)&ps[n+4]);
+ xmm4 = xmm3;
+ xmm3 = _mm_unpacklo_epi8(xmm3,xmm0);
+ xmm4 = _mm_unpackhi_epi8(xmm4,xmm0);
+ xmm3 = _mm_slli_epi16(xmm3,3);
+ xmm4 = _mm_slli_epi16(xmm4,3);
+ xmm1 = _mm_add_epi16(xmm1,xmm3);
+ xmm2 = _mm_add_epi16(xmm2,xmm4);
+ xmm3 = _mm_loadu_si128((const __m128i*)&ps[n+8]);
+ xmm4 = xmm3;
+ xmm3 = _mm_unpacklo_epi8(xmm3,xmm0);
+ xmm4 = _mm_unpackhi_epi8(xmm4,xmm0);
+ xmm1 = _mm_add_epi16(xmm1,xmm3);
+ xmm2 = _mm_add_epi16(xmm2,xmm4);
+
+ xmm3 = _mm_load_si128((const __m128i*)&pa[n]);
+ xmm4 = xmm3;
+ xmm3 = _mm_unpacklo_epi8(xmm3,xmm0);
+ xmm4 = _mm_unpackhi_epi8(xmm4,xmm0);
+ xmm1 = _mm_add_epi16(xmm1,xmm3);
+ xmm2 = _mm_add_epi16(xmm2,xmm4);
+ xmm3 = _mm_loadu_si128((const __m128i*)&pa[n+4]);
+ xmm4 = xmm3;
+ xmm3 = _mm_unpacklo_epi8(xmm3,xmm0);
+ xmm4 = _mm_unpackhi_epi8(xmm4,xmm0);
+ xmm1 = _mm_add_epi16(xmm1,xmm3);
+ xmm2 = _mm_add_epi16(xmm2,xmm4);
+ xmm3 = _mm_loadu_si128((const __m128i*)&pa[n+8]);
+ xmm4 = xmm3;
+ xmm3 = _mm_unpacklo_epi8(xmm3,xmm0);
+ xmm4 = _mm_unpackhi_epi8(xmm4,xmm0);
+ xmm1 = _mm_add_epi16(xmm1,xmm3);
+ xmm2 = _mm_add_epi16(xmm2,xmm4);
+
+ xmm3 = _mm_load_si128((const __m128i*)&pb[n]);
+ xmm4 = xmm3;
+ xmm3 = _mm_unpacklo_epi8(xmm3,xmm0);
+ xmm4 = _mm_unpackhi_epi8(xmm4,xmm0);
+ xmm1 = _mm_add_epi16(xmm1,xmm3);
+ xmm2 = _mm_add_epi16(xmm2,xmm4);
+ xmm3 = _mm_loadu_si128((const __m128i*)&pb[n+4]);
+ xmm4 = xmm3;
+ xmm3 = _mm_unpacklo_epi8(xmm3,xmm0);
+ xmm4 = _mm_unpackhi_epi8(xmm4,xmm0);
+ xmm1 = _mm_add_epi16(xmm1,xmm3);
+ xmm2 = _mm_add_epi16(xmm2,xmm4);
+ xmm3 = _mm_loadu_si128((const __m128i*)&pb[n+8]);
+ xmm4 = xmm3;
+ xmm3 = _mm_unpacklo_epi8(xmm3,xmm0);
+ xmm4 = _mm_unpackhi_epi8(xmm4,xmm0);
+ xmm1 = _mm_add_epi16(xmm1,xmm3);
+ xmm2 = _mm_add_epi16(xmm2,xmm4);
+
+ xmm3 = xmm1;
+ xmm4 = xmm2;
+ xmm1 = _mm_srli_epi16(xmm1,4);
+ xmm2 = _mm_srli_epi16(xmm2,4);
+ xmm3 = _mm_srli_epi16(xmm3,3);
+ xmm4 = _mm_srli_epi16(xmm4,3);
+ xmm1 = _mm_packus_epi16(xmm1,xmm2);
+ xmm3 = _mm_packus_epi16(xmm3,xmm4);
+
+ _mm_storeu_si128((__m128i*)&ps[n+4], xmm1);
+ _mm_storeu_si128((__m128i*)&pd[n+4], xmm3);
+ }
+}
+
+static void chromo_2x2_light(struct state *st)
{
- struct state *st = (struct state *) closure;
- int q,n;
- for(q=FTWEAK;q;q--){
- st->fshell=st->ffshell;
- for(n=SHELLCOUNT;n;n--){
- if (!explode(st, st->fshell)){
- recycle(st, st->fshell,rnd(st->width),rnd(st->height)); }
- st->fshell++; }}
-#if HAVE_X86_MMX
- if(st->glow_on) mmx_glow(st->palaka1,st->width,st->height,8,st->palaka2);
+ __m128 xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6;
+ __m128i xmi4, xmi5, xmi6, xmi7;
+
+ unsigned int x, y, v = 0;
+ unsigned int nl = st->width * 4;
+ unsigned char *mem = st->palaka2;
+ fireshell *fs = st->fireshell_array;
+
+ xmm0 = _mm_setr_ps(fs[0].flash_b, fs[0].flash_g, fs[0].flash_r, 0.0);
+ xmm1 = _mm_setr_ps(fs[1].flash_b, fs[1].flash_g, fs[1].flash_r, 0.0);
+ xmm2 = _mm_setr_ps(fs[2].flash_b, fs[2].flash_g, fs[2].flash_r, 0.0);
+ xmm3 = _mm_setr_ps(fs[3].flash_b, fs[3].flash_g, fs[3].flash_r, 0.0);
+
+ for (y = st->height/2; y; y--, mem += nl)
+ {
+ for (x = st->width/4; x; x--, v += 8, mem += 16)
+ {
+ xmm4 = _mm_set1_ps(st->light_map[v+0]);
+ xmm5 = xmm0;
+ xmm5 = _mm_mul_ps(xmm5,xmm4);
+ xmm4 = _mm_set1_ps(st->light_map[v+1]);
+ xmm4 = _mm_mul_ps(xmm4,xmm1);
+ xmm5 = _mm_add_ps(xmm5,xmm4);
+ xmm4 = _mm_set1_ps(st->light_map[v+2]);
+ xmm4 = _mm_mul_ps(xmm4,xmm2);
+ xmm5 = _mm_add_ps(xmm5,xmm4);
+ xmm4 = _mm_set1_ps(st->light_map[v+3]);
+ xmm4 = _mm_mul_ps(xmm4,xmm3);
+ xmm5 = _mm_add_ps(xmm5,xmm4);
+
+ xmm4 = _mm_set1_ps(st->light_map[v+4]);
+ xmm6 = xmm0;
+ xmm6 = _mm_mul_ps(xmm6,xmm4);
+ xmm4 = _mm_set1_ps(st->light_map[v+5]);
+ xmm4 = _mm_mul_ps(xmm4,xmm1);
+ xmm6 = _mm_add_ps(xmm6,xmm4);
+ xmm4 = _mm_set1_ps(st->light_map[v+6]);
+ xmm4 = _mm_mul_ps(xmm4,xmm2);
+ xmm6 = _mm_add_ps(xmm6,xmm4);
+ xmm4 = _mm_set1_ps(st->light_map[v+7]);
+ xmm4 = _mm_mul_ps(xmm4,xmm3);
+ xmm6 = _mm_add_ps(xmm6,xmm4);
+
+ xmi6 = _mm_cvtps_epi32(xmm5);
+ xmi7 = _mm_cvtps_epi32(xmm6);
+ xmi6 = _mm_packs_epi32(xmi6,xmi6);
+ xmi7 = _mm_packs_epi32(xmi7,xmi7);
+
+ xmi4 = _mm_load_si128((const __m128i*) mem);
+ xmi5 = _mm_unpacklo_epi8(xmi5,xmi4);
+ xmi5 = _mm_srli_epi16(xmi5,8);
+ xmi4 = _mm_unpackhi_epi8(xmi4,xmi4);
+ xmi4 = _mm_srli_epi16(xmi4,8);
+ xmi5 = _mm_add_epi16(xmi5,xmi6);
+ xmi4 = _mm_add_epi16(xmi4,xmi7);
+ xmi5 = _mm_packus_epi16(xmi5,xmi4);
+ _mm_store_si128((__m128i*) mem, xmi5);
+
+ xmi4 = _mm_load_si128((const __m128i*) &mem[nl]);
+ xmi5 = _mm_unpacklo_epi8(xmi5,xmi4);
+ xmi5 = _mm_srli_epi16(xmi5,8);
+ xmi4 = _mm_unpackhi_epi8(xmi4,xmi4);
+ xmi4 = _mm_srli_epi16(xmi4,8);
+ xmi5 = _mm_add_epi16(xmi5,xmi6);
+ xmi4 = _mm_add_epi16(xmi4,xmi7);
+ xmi5 = _mm_packus_epi16(xmi5,xmi4);
+ _mm_store_si128((__m128i*) &mem[nl], xmi5);
+ }
+ }
+}
+
#else
- if(st->glow_on) glow(st);
+
+static void glow_blur(struct state *st)
+{
+ unsigned int n, q;
+ unsigned char *pm = st->palaka1;
+ unsigned char *po = st->palaka2;
+ unsigned char *pa = pm - (st->width * 4);
+ unsigned char *pb = pm + (st->width * 4);
+ /*
+ unsigned int rgba = 0;
+ for (n = st->width*st->height*4; n; n--, pm++, pa++, pb++, po++)
+ {
+ if(++rgba > 3)
+ {
+ rgba = 0;
+ continue;
+ }
+ q = pm[0] + pm[4] * 8 + pm[8] +
+ pa[0] + pa[4] + pa[8] +
+ pb[0] + pb[4] + pb[8];
+ pm[4] = q >> 4;
+ po[4] = q > 2047 ? 255 : q >> 3;
+ }
+ --- using unrolled version ------------
+ */
+ for (n = st->width*st->height*4; n; n-=4)
+ {
+ q = pm[0] + pm[4] * 8 + pm[8] +
+ pa[0] + pa[4] + pa[8] +
+ pb[0] + pb[4] + pb[8];
+ pm[4] = q >> 4;
+ po[4] = q > 2047 ? 255 : q >> 3;
+ q = pm[1] + pm[5] * 8 + pm[9] +
+ pa[1] + pa[5] + pa[9] +
+ pb[1] + pb[5] + pb[9];
+ pm[5] = q >> 4;
+ po[5] = q > 2047 ? 255 : q >> 3;
+ q = pm[2] + pm[6] * 8 + pm[10] +
+ pa[2] + pa[6] + pa[10] +
+ pb[2] + pb[6] + pb[10];
+ pm[6] = q >> 4;
+ po[6] = q > 2047 ? 255 : q >> 3;
+
+ pm+=4, pa+=4, pb+=4, po+=4;
+ }
+}
+
+static inline unsigned char addbs(unsigned char c, unsigned int i)
+{
+ i += c;
+ return(i > 255 ? 255 : i);
+}
+
+static void chromo_2x2_light(struct state *st)
+{
+ unsigned int n, x, y, v = 0;
+ unsigned int nl = st->width * 4;
+ unsigned char *mem = st->palaka2;
+ float r, g, b;
+ float rgb[SHELLCOUNT*4];
+ fireshell *fs = st->fireshell_array;
+
+ for (n = 0, x = 0; n < SHELLCOUNT; n++, x += 4, fs++)
+ {
+ rgb[x ] = fs->flash_r;
+ rgb[x+1] = fs->flash_g;
+ rgb[x+2] = fs->flash_b;
+ }
+
+ for (y = st->height/2; y; y--)
+ {
+ for (x = st->width/2; x; x--, v += 4)
+ {
+ r = rgb[0] * st->light_map[v] + rgb[4] * st->light_map[v+1]
+ + rgb[ 8] * st->light_map[v+2] + rgb[12] * st->light_map[v+3];
+ g = rgb[1] * st->light_map[v] + rgb[5] * st->light_map[v+1]
+ + rgb[ 9] * st->light_map[v+2] + rgb[13] * st->light_map[v+3];
+ b = rgb[2] * st->light_map[v] + rgb[6] * st->light_map[v+1]
+ + rgb[10] * st->light_map[v+2] + rgb[14] * st->light_map[v+3];
+
+ mem[0] = addbs(mem[0], b);
+ mem[1] = addbs(mem[1], g);
+ mem[2] = addbs(mem[2], r);
+ mem[4] = addbs(mem[4], b);
+ mem[5] = addbs(mem[5], g);
+ mem[6] = addbs(mem[6], r);
+
+ mem += nl;
+
+ mem[0] = addbs(mem[0], b);
+ mem[1] = addbs(mem[1], g);
+ mem[2] = addbs(mem[2], r);
+ mem[4] = addbs(mem[4], b);
+ mem[5] = addbs(mem[5], g);
+ mem[6] = addbs(mem[6], r);
+
+ mem -= nl - 8;
+ }
+ mem += nl;
+ }
+}
+
#endif
- if(st->flash_on) light_2x2(st, st->ffshell);
- put_image(st);
-#if HAVE_X86_MMX
- if(!st->glow_on) mmx_blur(st->palaka1,st->width,st->height,8);
+
+static void resize(struct state *st)
+{
+ unsigned int n;
+ fireshell *fs = st->fireshell_array;
+ XWindowAttributes xwa;
+ XGetWindowAttributes (st->dpy, st->window, &xwa);
+ xwa.width -= xwa.width % 4;
+ xwa.height -= xwa.height % 2;
+ st->width = xwa.width;
+ st->height = xwa.height;
+ if (st->verbose)
+ {
+ printf("resolution: %d x %d \n",st->width,st->height);
+ }
+ XSync(st->dpy, 0);
+ if (st->xim)
+ {
+ if (st->xim->data == (char *)st->palaka2) st->xim->data = NULL;
+ XDestroyImage(st->xim);
+ XSync(st->dpy, 0);
+ free(st->mem2);
+ free(st->mem1);
+ }
+ st->xim = XCreateImage(st->dpy, xwa.visual, xwa.depth, ZPixmap, 0, 0,
+ st->width, st->height, 8, 0);
+ if (!st->xim) return;
+
+#ifdef __SSE2___ABANDONED /* causes __ERROR_use_memset_not_bzero_in_xscreensaver__ */
+ st->mem1 = _mm_malloc(((st->height + 2) * st->width + 8)*4, 16);
+ bzero(st->mem1, ((st->height + 2) * st->width + 8)*4);
+ st->mem2 = _mm_malloc(((st->height + 2) * st->width + 8)*4, 16);
+ bzero(st->mem2, ((st->height + 2) * st->width + 8)*4);
#else
- if(!st->glow_on) blur(st);
+ st->mem1 = calloc((st->height + 2) * st->width + 8, 4);
+ st->mem2 = calloc((st->height + 2) * st->width + 8, 4);
#endif
+ st->palaka1 = (unsigned char *) st->mem1 + (st->width * 4 + 16);
+ st->palaka2 = (unsigned char *) st->mem2 + (st->width * 4 + 16);
+
+ if (xwa.depth >= 24)
+ {
+ st->xim->data = (char *)st->palaka2;
+ }
+ else
+ {
+ st->xim->data = calloc(st->height, st->xim->bytes_per_line);
+ }
+
+ if (st->light_map) free(st->light_map);
+ st->light_map = calloc((st->width * st->height * SHELLCOUNT)/4, sizeof(float));
+ for (n = 0; n < SHELLCOUNT; n++, fs++)
+ {
+ render_light_map(st, fs);
+ }
+}
- return st->delay;
+static void put_image(struct state *st)
+{
+ int x,y,i,j;
+ unsigned char r, g, b;
+ if (!st->xim) return;
+ i = 0;
+ j = 0;
+ if (st->depth==16)
+ {
+ if(st->bigendian)
+ for (y=0; y<st->xim->height; y++)
+ for (x=0; x<st->xim->width; x++)
+ {
+ r = st->palaka2[j++];
+ g = st->palaka2[j++];
+ b = st->palaka2[j++];
+ j++;
+ st->xim->data[i++] = (g&224)>>5 | (r&248);
+ st->xim->data[i++] = (b&248)>>3 | (g&28)<<3;
+ }
+ else
+ for (y=0; y<st->xim->height; y++)
+ for (x=0; x<st->xim->width; x++)
+ {
+ r = st->palaka2[j++];
+ g = st->palaka2[j++];
+ b = st->palaka2[j++];
+ j++;
+ st->xim->data[i++] = (b&248)>>3 | (g&28)<<3;
+ st->xim->data[i++] = (g&224)>>5 | (r&248);
+ }
+ }
+ if (st->depth==15)
+ {
+ if(st->bigendian)
+ for (y=0; y<st->xim->height; y++)
+ for (x=0; x<st->xim->width; x++)
+ {
+ r = st->palaka2[j++];
+ g = st->palaka2[j++];
+ b = st->palaka2[j++];
+ j++;
+ st->xim->data[i++] = (g&192)>>6 | (r&248)>>1;
+ st->xim->data[i++] = (b&248)>>3 | (g&56)<<2;
+ }
+ else
+ for (y=0; y<st->xim->height; y++)
+ for (x=0; x<st->xim->width; x++)
+ {
+ r = st->palaka2[j++];
+ g = st->palaka2[j++];
+ b = st->palaka2[j++];
+ j++;
+ st->xim->data[i++] = (b&248)>>3 | (g&56)<<2;
+ st->xim->data[i++] = (g&192)>>6 | (r&248)>>1;
+ }
+ }
+ if (st->depth==8)
+ {
+ for (y=0; y<st->xim->height; y++)
+ for (x=0; x<st->xim->width; x++)
+ {
+ r = st->palaka2[j++];
+ g = st->palaka2[j++];
+ b = st->palaka2[j++];
+ j++;
+ st->xim->data[i++] = (((7*g)/256)*36)+(((6*r)/256)*6)+((6*b)/256);
+ }
+ }
+ XPutImage(st->dpy,st->window,st->gc,st->xim,0,0,0,0,st->xim->width,st->xim->height);
}
+static void *
+fireworkx_init (Display *dpy, Window win)
+{
+ struct state *st = (struct state *) calloc (1, sizeof(*st));
+ unsigned int n;
+ Visual *vi;
+ Colormap cmap;
+ Bool writable;
+ XWindowAttributes xwa;
+ XGCValues gcv;
+ firepix *fp;
+ fireshell *fs;
+
+ st->dpy = dpy;
+ st->window = win;
+ st->xim = NULL;
+ st->flash_on = 1;
+ st->shoot = 0;
+ st->width = 0;
+ st->height = 0;
+ st->max_shell_life = SHELL_LIFE_DEFAULT;
+ st->flash_fade = 0.995;
+ st->light_map = NULL;
+ st->palaka1 = NULL;
+ st->palaka2 = NULL;
+
+ st->flash_on = get_boolean_resource(st->dpy, "flash" , "Boolean");
+ st->shoot = get_boolean_resource(st->dpy, "shoot" , "Boolean");
+ st->verbose = get_boolean_resource(st->dpy, "verbose" , "Boolean");
+ st->max_shell_life = get_integer_resource(st->dpy, "maxlife" , "Integer");
+ st->delay = get_integer_resource(st->dpy, "delay" , "Integer");
+
+ st->max_shell_life = pow(10.0,(st->max_shell_life/50.0)+2.7);
+ if(st->max_shell_life < 1000) st->flash_fade = 0.998;
+
+ if(st->verbose)
+ {
+ printf("Fireworkx %s - Pyrotechnics explosions simulation \n", FWXVERSION);
+ printf("Copyright (GPL) 1999-2013 Rony B Chandran <ronybc@gmail.com> \n\n");
+ printf("url: http://www.ronybc.com \n\n");
+ printf("Life = %u\n", st->max_shell_life);
+#ifdef __SSE2__
+ printf("Using SSE2 optimization.\n");
+#endif
+ }
+
+ XGetWindowAttributes(st->dpy,win,&xwa);
+ st->depth = xwa.depth;
+ vi = xwa.visual;
+ cmap = xwa.colormap;
+ st->bigendian = (ImageByteOrder(st->dpy) == MSBFirst);
+
+ if(st->depth==8)
+ {
+ st->colors = (XColor *) calloc(sizeof(XColor),st->ncolors+1);
+ writable = False;
+ make_smooth_colormap(st->dpy, vi, cmap, st->colors, &st->ncolors,
+ False, &writable, True);
+ }
+ st->gc = XCreateGC(st->dpy, win, 0, &gcv);
+
+ fs = calloc(SHELLCOUNT, sizeof(fireshell));
+ fp = calloc(PIXCOUNT * SHELLCOUNT, sizeof(firepix));
+ st->fireshell_array = fs;
+
+ XGetWindowAttributes (st->dpy, st->window, &xwa);
+ st->depth = xwa.depth;
+
+ resize(st); /* initialize palakas */
+
+ for (n = 0; n < SHELLCOUNT; n++, fs++)
+ {
+ fs->seq_number = n;
+ fs->fpix = fp;
+ recycle (st, fs, rnd(st->width), rnd(st->height));
+ fp += PIXCOUNT;
+ }
+
+ return st;
+}
+
+static unsigned long
+fireworkx_draw (Display *dpy, Window win, void *closure)
+{
+ struct state *st = (struct state *) closure;
+ fireshell *fs;
+ unsigned int n, q;
+ for (q = FTWEAK; q; q--)
+ {
+ fs = st->fireshell_array;
+ for (n = 0; n < SHELLCOUNT; n++, fs++)
+ {
+ if (!explode(st, fs))
+ {
+ recycle(st, fs, rnd(st->width), rnd(st->height));
+ }
+ }
+ }
+
+ glow_blur(st);
+
+ if (st->flash_on)
+ {
+ chromo_2x2_light(st);
+ }
+
+ put_image(st);
+ return st->delay;
+}
static void
-fireworkx_reshape (Display *dpy, Window window, void *closure,
- unsigned int w, unsigned int h)
+fireworkx_reshape (Display *dpy, Window window, void *closure,
+ unsigned int w, unsigned int h)
{
- struct state *st = (struct state *) closure;
- resize(st);
+ struct state *st = (struct state *) closure;
+ st->width = w;
+ st->height = h;
+ resize(st);
}
static Bool
fireworkx_event (Display *dpy, Window window, void *closure, XEvent *event)
{
- struct state *st = (struct state *) closure;
- if (event->type == ButtonPress) {
- recycle(st, st->ffshell, event->xbutton.x, event->xbutton.y);
- return True;
- }
- return False;
+ struct state *st = (struct state *) closure;
+ if (event->type == ButtonPress)
+ {
+ recycle_oldest(st, event->xbutton.x, event->xbutton.y);
+ return True;
+ }
+ return False;
}
static void
fireworkx_free (Display *dpy, Window window, void *closure)
{
+ struct state *st = (struct state *) closure;
+ free(st->mem2);
+ free(st->mem1);
+ free(st->fireshell_array->fpix);
+ free(st->fireshell_array);
}
-
-static const char *fireworkx_defaults [] = {
- ".background: black",
- ".foreground: white",
- "*delay: 20000", /* never default to zero! */
- "*maxlife: 2000",
- "*flash: True",
- "*glow: True",
- "*shoot: False",
- "*verbose: False",
- 0
+static const char *fireworkx_defaults [] =
+{
+ ".background: black",
+ ".foreground: white",
+ "*delay: 10000", /* never default to zero! */
+ "*maxlife: 32",
+ "*flash: True",
+ "*shoot: False",
+ "*verbose: False",
+ 0
};
-static XrmOptionDescRec fireworkx_options [] = {
- { "-delay", ".delay", XrmoptionSepArg, 0 },
- { "-maxlife", ".maxlife", XrmoptionSepArg, 0 },
- { "-no-flash", ".flash", XrmoptionNoArg, "False" },
- { "-no-glow", ".glow", XrmoptionNoArg, "False" },
- { "-shoot", ".shoot", XrmoptionNoArg, "True" },
- { "-verbose", ".verbose", XrmoptionNoArg, "True" },
- { 0, 0, 0, 0 }
+static XrmOptionDescRec fireworkx_options [] =
+{
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { "-maxlife", ".maxlife", XrmoptionSepArg, 0 },
+ { "-no-flash", ".flash", XrmoptionNoArg, "False" },
+ { "-shoot", ".shoot", XrmoptionNoArg, "True" },
+ { "-verbose", ".verbose", XrmoptionNoArg, "True" },
+ { 0, 0, 0, 0 }
};
XSCREENSAVER_MODULE ("Fireworkx", fireworkx)
.TH XScreenSaver 1 "" "X Version 11"
.SH NAME
-fireworkx - pyrotechnics simulation eye-candy.
+fireworkx - pyrotechnic explosions eye-candy.
.SH SYNOPSIS
.B fireworkx
[\-display \fIhost:display.screen\fP]
[\-root]
[\-verbose]
[\-noflash]
-[\-noglow]
[\-shoot]
[\-delay \fInumber\fP]
[\-maxlife \fInumber\fP]
[\-fps]
.SH DESCRIPTION
-Simulates fireworks (pyrotechnics); explodes better on faster machines.
+Animates explosions.
.SH OPTIONS
.TP 8
.B \-visual \fIvisual\fP
Draw on the root window.
.TP 8
.B \-noflash
-Turn off light effect (runs faster)
-.TP 8
-.B \-noglow
-Turn off self glow (dull blasts..!)
+Turn off light flash effect. (Runs faster)
.TP 8
.B \-shoot
-Shoot the shells.
+Fire shells up using mortar.
.TP 8
.B \-delay \fInumber\fP
-Delay between frames. In microseconds. (Default: 1000)
+Delay between frames. In microseconds. (Default: 10000)
.TP 8
.B \-maxlife \fInumber\fP
-Maximum decay period for an explosion. (Default: 2000)
+Maximum decay period for an explosion. (Range: 0-100)
.TP 8
.B \-verbose
-for scientific purposes..!
+For scientific research purposes only..!
.TP 8
.B \-fps
Display the current frame rate and CPU load.
.BR X (1),
.BR xscreensaver (1)
.SH COPYRIGHT
-Copyright \(co 1999-2005 by Rony B Chandran. Permission to use, copy, modify,
+Copyright \(co 1999-2013 by Rony B Chandran. 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
.SH AUTHOR
.br
-Written by Rony B Chandran <ronybc@asia.com>
+Written by Rony B Chandran <ronybc@gmail.com>
.br
.br
-Additional programming:
+Additional programming and support:
+.br
+--------------------------------------------------------------------
.br
-------------------------
+Rugmini R Chandran <rugmini@ronybc.com>
.br
-Renuka S <renuka@local.net>
+Renuka S <renuka@ronybc.com>
.br
Jean-Pierre Demailly <Jean-Pierre.Demailly@ujf-grenoble.fr>
.br
Nicholas Miell <nmiell@gmail.com>
.SH URL
-http://www.ronybc.8k.com
+http://www.ronybc.com
+++ /dev/null
-/*
- * Fast MMX blur code for Fireworkx
- * Copyright (c) 1999-2005 Rony B Chandran <ronybc@asia.com>
- *
- * From Kerala, INDIA
- *
- * url: http://www.ronybc.8k.com
- *
- * 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.
- *
- */
-
-.data
-
-.text
-
-.align 8
-
-.global mmx_blur
-.global mmx_glow
-
-mmx_blur: /* void mmx_blur( int *palaka,
- int width,
- int height)
- int fade_lvl) */
- pushl %ebp
- pushl %edi
- pushl %esi
- pushl %ebx
-
- movl 32(%esp),%eax
- imull $0x00010001,%eax
- movd %eax,%mm0
- movq %mm0,%mm1
- psllq $32,%mm0
- por %mm0,%mm1
- movq %mm1,40(%esp)
-
- movl 20(%esp), %eax
- movl 24(%esp), %edx
- shll $2, %edx
- addl %eax, %edx
- pxor %mm0,%mm0
-.fline:
- movq %mm0,(%eax)
- addl $8,%eax
- cmp %edx,%eax
- jbe .fline
-
- movl 24(%esp),%eax
- shll $2,%eax
- movl %eax,%edi
- movl 28(%esp),%edi
- subl $2,%edi
- imull %eax,%edi
-
- movl 20(%esp),%ecx
- movl %ecx,%ebx
- addl %eax,%ebx
- addl %ebx,%eax
- xorl %esi,%esi
-.align 32
-.renuKa:
- pxor %mm7,%mm7
- movq %mm0,%mm6
- movq %mm1,%mm0
- paddw %mm1,%mm6
- movd 8(%esi,%ecx),%mm1
- punpcklbw %mm7,%mm1
- paddw %mm1,%mm6
-
- paddw %mm2,%mm6
- movq %mm3,%mm2
- movd 8(%esi,%ebx),%mm3
- punpcklbw %mm7,%mm3
- paddw %mm3,%mm6
-
- paddw %mm4,%mm6
- movq %mm5,%mm4
- paddw %mm5,%mm6
- movd 8(%esi,%eax),%mm5
- punpcklbw %mm7,%mm5
- paddw %mm5,%mm6
-
- psllw $3,%mm2
- paddw %mm2,%mm6
- psrlw $3,%mm2
- movq 40(%esp),%mm7
- psubusw %mm7,%mm6
- psrlw $4,%mm6
-
- packuswb %mm6,%mm6
- movd %mm6, 4(%esi,%ebx)
- addl $4,%esi
- cmp %edi,%esi
- jbe .renuKa
-
- addl %esi,%eax
- addl %esi,%ebx
- xorl %ecx,%ecx
-.lline:
- movl %ecx,(%ebx)
- addl $4,%ebx
- cmpl %eax,%ebx
- jbe .lline
-
- emms
- popl %ebx
- popl %esi
- popl %edi
- popl %ebp
- ret
-
-/* Add Glycerine to
- Potassium permanganite... (DANGER-FIRE) */
-
-mmx_glow: /* void mmx_glow( int *palaka1,
- int width,
- int height,
- int fade_lvl,
- int *palaka2) */
- pushl %ebp
- pushl %edi
- pushl %esi
- pushl %ebx
-
- movl 32(%esp),%eax
- imull $0x00010001,%eax
- movd %eax,%mm0
- movq %mm0,%mm1
- psllq $32,%mm0
- por %mm0,%mm1
- movq %mm1,40(%esp)
-
- movl 20(%esp), %eax
- movl 36(%esp), %ebx
- movl 24(%esp), %edx
- shll $2,%edx
- add %eax, %edx
- pxor %mm7,%mm7
-.flineGlow:
- movq %mm7,(%eax)
- movq %mm7,(%ebx)
- addl $8,%eax
- addl $8,%ebx
- cmp %edx,%eax
- jbe .flineGlow
-
- movl 24(%esp),%eax
- shll $2,%eax
- movl %eax,%edi
- movl 28(%esp),%edi
- subl $2,%edi
- imull %eax,%edi
-
- movl 20(%esp),%ecx
- movl 36(%esp),%edx
- movl %ecx,%ebx
- addl %eax,%edx
- addl %eax,%ebx
- addl %ebx,%eax
- xorl %esi,%esi
-.align 32
-.renuGa:
- pxor %mm7,%mm7
- movq %mm0,%mm6
- movq %mm1,%mm0
- paddw %mm1,%mm6
- movd 8(%esi,%ecx),%mm1
- punpcklbw %mm7,%mm1
- paddw %mm1,%mm6
-
- paddw %mm2,%mm6
- movq %mm3,%mm2
- movd 8(%esi,%ebx),%mm3
- punpcklbw %mm7,%mm3
- paddw %mm3,%mm6
-
- paddw %mm4,%mm6
- movq %mm5,%mm4
- paddw %mm5,%mm6
- movd 8(%esi,%eax),%mm5
- punpcklbw %mm7,%mm5
- paddw %mm5,%mm6
-
- psllw $3,%mm2
- paddw %mm2,%mm6
- psrlw $3,%mm2
- movq 40(%esp),%mm7
- psubusw %mm7,%mm6
- movq %mm6,%mm7
- psrlw $4,%mm6
- psrlw $3,%mm7
-
- packuswb %mm7,%mm7
- movd %mm7, 4(%esi,%edx)
- packuswb %mm6,%mm6
- movd %mm6, 4(%esi,%ebx)
- addl $4,%esi
- cmp %edi,%esi
- jbe .renuGa
-
- addl %esi,%eax
- addl %esi,%ebx
- addl %esi,%edx
- xorl %ecx,%ecx
-.llineGlow:
- movl %ecx,(%ebx)
- movl %ecx,(%edx)
- addl $4,%ebx
- addl $4,%edx
- cmpl %eax,%ebx
- jbe .llineGlow
-
- emms
- popl %ebx
- popl %esi
- popl %edi
- popl %ebp
- ret
-/* xscreensaver, Copyright (c) 2003, 2005, 2006 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 2003-2013 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
{
while (s->buf_tail < sizeof(s->buf) - 2)
{
- char c = textclient_getc (s->tc);
+ int c = textclient_getc (s->tc);
if (c > 0)
- s->buf[s->buf_tail++] = c;
+ s->buf[s->buf_tail++] = (char) c;
else
break;
}
$(UTILS_BIN)/textclient.o: $(UTILS_SRC)/textclient.c
$(UTIL_OBJS):
- cd $(UTILS_BIN) ; \
- $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+ $(MAKE) -C $(UTILS_BIN) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
$(HACK_BIN)/xlockmore.o: $(HACK_SRC)/xlockmore.c
- cd $(HACK_BIN) ; $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)"
+ $(MAKE) -C $(HACK_BIN) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)"
# How we build object files in this directory.
#ifndef HAVE_PING
sonar_sensor_data *
-init_ping (Display *dpy, char **error_ret, char **desc_ret,
- const char *subnet, int timeout,
- Bool resolve_p, Bool times_p, Bool debug_p)
+sonar_init_ping (Display *dpy, char **error_ret, char **desc_ret,
+ const char *subnet, int timeout,
+ Bool resolve_p, Bool times_p, Bool debug_p)
{
if (! (!subnet || !*subnet || !strcmp(subnet, "default")))
fprintf (stderr, "%s: not compiled with support for pinging hosts.\n",
-/* xscreensaver, Copyright (c) 2008 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 2008-2013 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
#include "screenhack.h"
+#undef countof
+#define countof(x) (sizeof((x))/sizeof((*x)))
+
struct state {
Display *dpy;
Window window;
VERT_W, VERT_B,
DIAG_W, DIAG_B,
WHITE, BLACK,
+ RGB,
END } mode;
unsigned int enabled_mask;
int count;
- GC fg, bg;
+ GC fg, bg, bg2;
+ int color_tick;
int delay;
int spread;
int cycles;
XGetWindowAttributes (st->dpy, st->window, &st->xgwa);
gcv.foreground = BlackPixelOfScreen (st->xgwa.screen);
gcv.background = WhitePixelOfScreen (st->xgwa.screen);
- st->bg = XCreateGC (st->dpy, st->window, GCForeground, &gcv);
+ st->bg = XCreateGC (st->dpy, st->window, GCForeground, &gcv);
+ st->bg2 = XCreateGC (st->dpy, st->window, GCForeground, &gcv);
gcv.foreground = WhitePixelOfScreen (st->xgwa.screen);
gcv.background = BlackPixelOfScreen (st->xgwa.screen);
st->fg = XCreateGC (st->dpy, st->window, GCForeground, &gcv);
#ifdef HAVE_COCOA
- jwxyz_XSetAntiAliasing (st->dpy, st->fg, False);
- jwxyz_XSetAntiAliasing (st->dpy, st->bg, False);
+ jwxyz_XSetAntiAliasing (st->dpy, st->fg, False);
+ jwxyz_XSetAntiAliasing (st->dpy, st->bg, False);
+ jwxyz_XSetAntiAliasing (st->dpy, st->bg2, False);
#endif
st->enabled_mask = 0;
PREF("modeDB", DIAG_B);
PREF("modeW", WHITE);
PREF("modeB", BLACK);
+ PREF("modeRGB", RGB);
# undef PREF
if (! st->enabled_mask)
{
XDrawLine (st->dpy, st->window, fg, 0, i,
st->xgwa.height, i + st->xgwa.height);
break;
+ case RGB:
+ {
+ int scale = 10 * 8; /* 8 sec */
+ static const unsigned short colors[][3] = {
+ { 0xFFFF, 0x0000, 0x0000 },
+ { 0x0000, 0xFFFF, 0x0000 },
+ { 0x0000, 0x0000, 0xFFFF },
+ { 0xFFFF, 0xFFFF, 0x0000 },
+ { 0xFFFF, 0x0000, 0xFFFF },
+ { 0x0000, 0xFFFF, 0xFFFF },
+ { 0xFFFF, 0xFFFF, 0xFFFF },
+ { 0x0000, 0x0000, 0x0000 },
+ };
+ static unsigned long last = 0;
+ XColor xc;
+ bg = st->bg2;
+ xc.red = colors[st->color_tick / scale][0];
+ xc.green = colors[st->color_tick / scale][1];
+ xc.blue = colors[st->color_tick / scale][2];
+ if (last) XFreeColors (st->dpy, st->xgwa.colormap, &last, 1, 0);
+ XAllocColor (st->dpy, st->xgwa.colormap, &xc);
+ last = xc.pixel;
+ XSetForeground (st->dpy, bg, xc.pixel);
+ st->color_tick = (st->color_tick + 1) % (countof(colors) * scale);
+ /* fall through */
+ }
case WHITE:
case BLACK:
XFillRectangle (st->dpy, st->window, bg, 0, 0,
struct state *st = (struct state *) closure;
XFreeGC (dpy, st->fg);
XFreeGC (dpy, st->bg);
+ XFreeGC (dpy, st->bg2);
free (st);
}
"*modeDB: True",
"*modeW: True",
"*modeB: True",
+ "*modeRGB: True",
0
};
{ "-no-db", ".modeDB", XrmoptionNoArg, "False" },
{ "-no-w", ".modeW", XrmoptionNoArg, "False" },
{ "-no-b", ".modeB", XrmoptionNoArg, "False" },
+ { "-no-rgb", ".modeRGB", XrmoptionNoArg, "False" },
{ 0, 0, 0, 0 }
};
-/* xscreensaver, Copyright (c) 1992-2012 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1992-2013 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
while (p < st->words + sizeof(st->words) - 1 &&
st->lines < MAXLINES)
{
- char c = textclient_getc (st->tc);
+ int c = textclient_getc (st->tc);
if (c == '\n')
st->lines++;
if (c > 0)
- *p++ = c;
+ *p++ = (char) c;
else
break;
}
-/* xscreensaver, Copyright (c) 1999-2012 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1999-2013 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
if (!s->tc)
return;
- if (loadBytes > 0){
- char c = textclient_getc (s->tc);
- n = (c > 0 ? 1 : -1);
- s->buf [s->buf_pos] = c;
- }
+ if (loadBytes > 0)
+ {
+ int c = textclient_getc (s->tc);
+ n = (c > 0 ? 1 : -1);
+ s->buf [s->buf_pos] = (char) c;
+ }
+
if (n > 0)
{
s->do_fill_buff = False;
-# Auto-generated: Sat Oct 6 13:20:08 PDT 2012
+# Auto-generated: Mon Feb 4 22:38:23 PST 2013
driver/demo-Gtk-conf.c
driver/demo-Gtk-support.c
driver/demo-Gtk-widgets.c
static const char screensaver_id[] =
- "@(#)xscreensaver 5.20 (06-Oct-2012), by Jamie Zawinski (jwz@jwz.org)";
+ "@(#)xscreensaver 5.21 (04-Feb-2013), by Jamie Zawinski (jwz@jwz.org)";
%define name xscreensaver
-%define version 5.20
+%define version 5.21
Summary: X screen saver and locker
Name: %{name}
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0450;
+ LastUpgradeCheck = 0460;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "xscreensaver" */;
compatibilityVersion = "Xcode 3.2";