aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in24
-rw-r--r--addons/screensaver.rsxs.euphoria/addon.xml123
-rw-r--r--addons/screensaver.rsxs.euphoria/icon.pngbin9424 -> 0 bytes
-rw-r--r--addons/screensaver.rsxs.plasma/addon.xml125
-rw-r--r--addons/screensaver.rsxs.plasma/icon.pngbin5657 -> 0 bytes
-rw-r--r--addons/screensaver.rsxs.solarwinds/addon.xml123
-rw-r--r--addons/screensaver.rsxs.solarwinds/icon.pngbin14774 -> 0 bytes
-rw-r--r--bootstrap.mk1
-rw-r--r--configure.ac71
-rw-r--r--xbmc/screensavers/rsxs-0.9/AUTHORS7
-rw-r--r--xbmc/screensavers/rsxs-0.9/COPYING340
-rw-r--r--xbmc/screensavers/rsxs-0.9/ChangeLog48
-rw-r--r--xbmc/screensavers/rsxs-0.9/Makefile.am49
-rw-r--r--xbmc/screensavers/rsxs-0.9/NEWS1
-rw-r--r--xbmc/screensavers/rsxs-0.9/README131
-rw-r--r--xbmc/screensavers/rsxs-0.9/README.xbmc10
-rw-r--r--xbmc/screensavers/rsxs-0.9/THANKS12
-rw-r--r--xbmc/screensavers/rsxs-0.9/acinclude.m4783
-rw-r--r--xbmc/screensavers/rsxs-0.9/config/Makefile.am16
-rw-r--r--xbmc/screensavers/rsxs-0.9/config/rs-cyclone.xml79
-rw-r--r--xbmc/screensavers/rsxs-0.9/config/rs-euphoria.xml117
-rw-r--r--xbmc/screensavers/rsxs-0.9/config/rs-fieldlines.xml77
-rw-r--r--xbmc/screensavers/rsxs-0.9/config/rs-flocks.xml90
-rw-r--r--xbmc/screensavers/rsxs-0.9/config/rs-flux.xml140
-rw-r--r--xbmc/screensavers/rsxs-0.9/config/rs-helios.xml99
-rw-r--r--xbmc/screensavers/rsxs-0.9/config/rs-hyperspace.xml77
-rw-r--r--xbmc/screensavers/rsxs-0.9/config/rs-lattice.xml145
-rw-r--r--xbmc/screensavers/rsxs-0.9/config/rs-plasma.xml53
-rw-r--r--xbmc/screensavers/rsxs-0.9/config/rs-skyrocket.xml123
-rw-r--r--xbmc/screensavers/rsxs-0.9/config/rs-solarwinds.xml96
-rw-r--r--xbmc/screensavers/rsxs-0.9/configure.ac313
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/Makefile.am233
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/alloca.c491
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/alloca_.h54
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argp-ba.c25
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argp-eexst.c31
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argp-fmtstream.c435
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argp-fmtstream.h301
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argp-fs-xinl.c43
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argp-help.c1930
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argp-namefrob.h177
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argp-parse.c943
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argp-pin.c28
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argp-pv.c24
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argp-pvh.c31
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argp-xinl.c43
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argp.h601
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argz.c226
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/argz_.h57
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/asnprintf.c37
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/basename.c131
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/dirname.c87
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/dirname.h70
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/error.c304
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/error.h66
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/exit.h32
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/exitfail.c27
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/exitfail.h20
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/getopt.c1191
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/getopt1.c174
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/getopt_.h225
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/getopt_int.h131
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/gettext.h78
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/gettimeofday.c123
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/mbchar.c38
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/mbchar.h354
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/mbuiter.h203
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/memchr.c201
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/mempcpy.c29
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/mempcpy.h36
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/minmax.h60
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/printf-args.c137
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/printf-args.h136
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/printf-parse.c536
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/printf-parse.h74
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/size_max.h31
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/stdbool_.h54
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/strcase.h48
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/strcasecmp.c105
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/strchrnul.c30
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/strchrnul.h28
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/stripslash.c47
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/strncasecmp.c65
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/strndup.c66
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/strndup.h30
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/strnlen.c33
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/strnlen.h32
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/strnlen1.c39
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/strnlen1.h41
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/sysexit_.h41
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/vasnprintf.c903
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/vasnprintf.h77
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/vsnprintf.c58
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/vsnprintf.h31
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/wcwidth.h70
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/xalloc-die.c44
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/xalloc.h79
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/xmalloc.c241
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/xsize.h108
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/xstrndup.c39
-rw-r--r--xbmc/screensavers/rsxs-0.9/lib/xstrndup.h24
-rw-r--r--xbmc/screensavers/rsxs-0.9/libltdl/Makefile.am6
-rw-r--r--xbmc/screensavers/rsxs-0.9/libltdl/ltdl.c4521
-rw-r--r--xbmc/screensavers/rsxs-0.9/libltdl/ltdl.h366
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/alloca.m442
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/argp.m461
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/argz.m434
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/dirname.m417
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/dos.m471
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/double-slash-root.m443
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/eoverflow.m464
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/error.m422
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/exitfail.m414
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/extensions.m442
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/getopt.m483
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/gettimeofday.m480
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/gnulib-comp.m4177
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/intmax_t.m461
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/inttypes_h.m426
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/longdouble.m431
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/longlong.m444
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/mbchar.m420
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/mbiter.m417
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/mbrtowc.m431
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/memchr.m418
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/mempcpy.m423
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/minmax.m441
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/onceonly_2_57.m486
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/restrict.m438
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/signed.m417
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/size_max.m460
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/stdbool.m4115
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/stdint_h.m426
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/strcase.m439
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/strchrnul.m419
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/strndup.m454
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/strnlen.m429
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/sysexits.m413
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/unistd_h.m418
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/vasnprintf.m458
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/vsnprintf.m415
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/wchar_t.m420
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/wcwidth.m426
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/wint_t.m420
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/xalloc.m425
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/xsize.m413
-rw-r--r--xbmc/screensavers/rsxs-0.9/m4/xstrndup.m415
-rw-r--r--xbmc/screensavers/rsxs-0.9/rsxs.spec.in162
-rw-r--r--xbmc/screensavers/rsxs-0.9/scripts/install.awk87
-rw-r--r--xbmc/screensavers/rsxs-0.9/scripts/uninstall.awk85
-rw-r--r--xbmc/screensavers/rsxs-0.9/scripts/verify.awk86
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/Makefile.am35
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/Makefile.common31
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/color.cc219
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/color.hh158
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/common.cc622
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/common.hh374
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/cyclone/Makefile.am9
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/cyclone/blend.cc38
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/cyclone/blend.hh42
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/cyclone/cyclone.cc520
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/cyclone/cyclone.hh76
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/cyclone/particle.cc84
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/cyclone/particle.hh67
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/dlopen.hh73
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/euphoria/Makefile.am19
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/euphoria/euphoria.cc475
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/euphoria/euphoria.hh41
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/euphoria/lines.pngbin44780 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/euphoria/plasma.pngbin47604 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/euphoria/stringy.pngbin40846 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/euphoria/wisp.cc277
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/euphoria/wisp.hh54
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/fieldlines/Makefile.am9
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/fieldlines/fieldlines.cc373
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/fieldlines/fieldlines.hh41
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/fieldlines/ion.hh72
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/flocks/Makefile.am9
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/flocks/bug.cc240
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/flocks/bug.hh73
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/flocks/flocks.cc286
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/flocks/flocks.hh41
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/flux/Makefile.am8
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/flux/flux.cc403
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/flux/flux.hh66
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/flux/trail.cc263
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/flux/trail.hh68
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hack.hh51
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/helios/Makefile.am19
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/helios/helios.cc770
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/helios/helios.hh41
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/helios/particle.cc67
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/helios/particle.hh187
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/helios/sphere.hh58
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/helios/spheremap.pngbin75838 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/Makefile.am19
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/caustic.cc311
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/caustic.hh63
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/cubemaps.cc183
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/cubemaps.hh40
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/extensions.cc83
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/extensions.hh51
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/flares.cc282
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/flares.hh37
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/goo.cc169
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/goo.hh34
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/hyperspace.cc448
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/hyperspace.hh47
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/nebula.cc74
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/nebula.hh82
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/nebula.pngbin96027 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/particle.cc126
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/particle.hh56
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/shaders.cc198
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/shaders.hh34
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/spline.cc155
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/spline.hh72
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/starburst.cc167
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/starburst.hh38
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/tunnel.cc174
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/hyperspace/tunnel.hh34
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/implicit.cc486
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/implicit.hh128
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/Makefile.am20
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/brass.pngbin63025 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/camera.hh60
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/chrome.pngbin113847 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/circuits.pngbin18816 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/crystal.pngbin99923 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/doughnuts.pngbin108591 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/ghostly.pngbin16376 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/industrial1.pngbin117900 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/industrial2.pngbin121270 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/lattice.cc868
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/lattice.hh59
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/resources.cc318
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/resources.hh36
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/lattice/shiny.pngbin147330 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/oggsound.cc170
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/oggsound.hh50
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/plasma/Makefile.am8
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/plasma/plasma.cc397
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/plasma/plasma.hh35
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/pngimage.cc206
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/pngimage.hh67
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/resource.hh213
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/Makefile.am30
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/bee.cc105
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/bee.hh59
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/bigmama.cc138
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/bigmama.hh43
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/bomb.cc81
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/bomb.hh58
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/boom1.oggbin12353 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/boom2.oggbin13040 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/boom3.oggbin12175 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/boom4.oggbin21365 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/cloud.pngbin304297 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/earth-far.pngbin713531 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/earth-light.pngbin421738 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/earth-near.pngbin152720 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/explosion.cc608
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/explosion.hh90
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/flares.cc202
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/flares.hh35
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/fountain.cc89
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/fountain.hh61
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/launch1.oggbin15118 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/launch2.oggbin14470 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/meteor.cc91
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/meteor.hh51
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/moon.pngbin7134 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/nuke.oggbin44364 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/overlay.cc90
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/overlay.hh37
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/particle.hh130
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/popper.oggbin52410 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/resources.cc800
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/resources.hh76
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/rocket.cc217
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/rocket.hh57
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/shockwave.cc214
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/shockwave.hh51
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/skyrocket.cc925
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/skyrocket.hh208
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke.cc97
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke.hh72
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke1.pngbin4091 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke2.pngbin3947 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke3.pngbin4410 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke4.pngbin4437 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke5.pngbin4540 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/spinner.cc101
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/spinner.hh72
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/star.cc92
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/star.hh57
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/streamer.cc93
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/streamer.hh51
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/stretcher.cc148
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/stretcher.hh44
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/suck.oggbin38420 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/sucker.cc155
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/sucker.hh44
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/whistle.oggbin36280 -> 0 bytes
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/world.cc201
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/skyrocket/world.hh40
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/solarwinds/Makefile.am9
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/solarwinds/Makefile.xbmc4
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/solarwinds/solarwinds.cc331
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/solarwinds/solarwinds.hh46
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/solarwinds/wind.cc232
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/solarwinds/wind.hh55
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/sound.cc272
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/sound.hh98
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/vector.hh797
-rw-r--r--xbmc/screensavers/rsxs-0.9/src/vroot.hh160
-rw-r--r--xbmc/screensavers/rsxs-0.9/xbmc/Makefile.in58
317 files changed, 5 insertions, 43218 deletions
diff --git a/Makefile.in b/Makefile.in
index 6b4f2dd61e..ace04cb14b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -193,13 +193,6 @@ LIB_DIRS=\
lib/cpluff \
lib/xbmc-dll-symbols
-SS_DIRS=
-ifneq (@DISABLE_RSXS@,1)
- SS_DIRS+= xbmc/screensavers/rsxs-0.9/xbmc
-else
- INSTALL_FILTER+= .*screensaver\.rsxs.*
-endif
-
ifneq (@DISABLE_SPECTRUM@,1)
VIS_DIRS+= xbmc/visualizations/OpenGLSpectrum
else
@@ -321,7 +314,7 @@ all : $(FINAL_TARGETS)
include Makefile.include
-.PHONY : dllloader exports visualizations screensavers eventclients \
+.PHONY : dllloader exports visualizations eventclients \
dvdpcodecs dvdpextcodecs imagelib codecs externals force skins libaddon check \
testframework testsuite
@@ -374,13 +367,8 @@ endif
$(VIS_DIRS): force exports $(EGLHELPERS)
$(MAKE) -C $@
-$(SS_DIRS): force exports
- $(MAKE) -C $@
-
visualizations: $(VIS_DIRS)
-screensavers: $(SS_DIRS)
-
libaddon: exports
$(MAKE) -C lib/addons/library.xbmc.addon
$(MAKE) -C lib/addons/library.kodi.adsp
@@ -415,10 +403,10 @@ codecs: dvdpcodecs dvdpextcodecs
libs: $(LIBSSE4) imagelib libexif system/libcpluff-@ARCH@.so
-externals: codecs libs visualizations screensavers libaddon
+externals: codecs libs visualizations libaddon
xcode_depends: \
- codecs libs visualizations screensavers eventclients skins libaddon
+ codecs libs visualizations eventclients skins libaddon
DYNOBJSXBMC= \
xbmc/linux/linux.a \
@@ -464,7 +452,7 @@ OBJSXBMC:=$(filter-out $(DYNOBJSXBMC), $(OBJSXBMC))
BIN_DIRS = $(dir $(DIRECTORY_ARCHIVES)) $(dir $(NWAOBJSXBMC)) $(dir $(MAINOBJS))
DIRS= $(BIN_DIRS) $(EC_DIRS) $(DVDPCODECS_DIRS) \
- $(LIB_DIRS) $(SS_DIRS) $(VIS_DIRS) $(LIBADDON_DIRS) $(SKIN_DIRS) xbmc/main
+ $(LIB_DIRS) $(VIS_DIRS) $(LIBADDON_DIRS) $(SKIN_DIRS) xbmc/main
$(NWAOBJSXBMC) $(DIRECTORY_ARCHIVES) $(MAINOBJS): force
@$(MAKE) $(if $(V),,-s) -C $(@D)
@@ -645,8 +633,6 @@ clean-dvdpcodecs:
for d in $(DVDPCODECS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
clean-libs:
for d in $(LIB_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
-clean-screensavers:
- for d in $(SS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
clean-visualisations:
for d in $(VIS_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
clean-libaddons:
@@ -655,7 +641,7 @@ clean-libaddons:
clean-codecs: clean-dvdpcodecs
clean-externals: clean-codecs clean-eventclients clean-libs \
- clean-screensavers clean-visualisations clean-libaddons
+ clean-visualisations clean-libaddons
ifeq (1,@GTEST_CONFIGURED@)
check: testsuite
diff --git a/addons/screensaver.rsxs.euphoria/addon.xml b/addons/screensaver.rsxs.euphoria/addon.xml
deleted file mode 100644
index 67f3c8e1ab..0000000000
--- a/addons/screensaver.rsxs.euphoria/addon.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<addon
- id="screensaver.rsxs.euphoria"
- version="1.0.26"
- name="Euphoria"
- provider-name="mogumbo, Team-Kodi">
- <requires>
- <c-pluff version="0.1"/>
- </requires>
- <extension
- point="xbmc.ui.screensaver"
- library_linux="Euphoria.xbs"
- library_osx="Euphoria.xbs"/>
- <extension point="xbmc.addon.metadata">
- <summary lang="af_ZA">Omtrent so psigedelies soos sluimerskerm kan kom</summary>
- <summary lang="ar_SA">حول الحصول على مهدء كشاشة التوقف</summary>
- <summary lang="be_BY">Падобны на псіхадэлічны ахоўнік экрану</summary>
- <summary lang="bg_BG">Колкото халюциногенен може да бъде един скрийнсейвър</summary>
- <summary lang="ca_ES">Quant al més psicodèlic dels estalvis de pantalla</summary>
- <summary lang="cs_CZ">Nejdivočejší šetřič obrazovky všech dob</summary>
- <summary lang="cy_GB">Mor seicadelig ag y mae modd bod</summary>
- <summary lang="da_DK">Omtrent så psykedelisk som en pauseskærm kan blive.</summary>
- <summary lang="de_DE">So psychedelisch wie ein Bildschirmschoner nur sein kann</summary>
- <summary lang="el_GR">Όσο πιο ψυχεδελική μπορεί να είναι μία προφύλαξη οθόνης</summary>
- <summary lang="en_AU">About as psychedelic as screensavers get</summary>
- <summary lang="en_GB">About as psychedelic as screensavers get</summary>
- <summary lang="en_NZ">About as psychedelic as screensavers get</summary>
- <summary lang="en_US">About as psychedelic as screensavers get</summary>
- <summary lang="es_AR">Tan psicodélico como un protector de pantalla pueda serlo</summary>
- <summary lang="es_ES">El más psicodélico de los salvapantallas</summary>
- <summary lang="es_MX">Tan psicodélico como cualquier protector de pantalla debería</summary>
- <summary lang="et_EE">Nii psühhedeelne kui üks ekraanisäästja olla saab</summary>
- <summary lang="eu_ES">Pantaila-babesleetatik psikodelikoena</summary>
- <summary lang="fa_IR">نهایت توهم زایی یک محافظ صفحه نمایش</summary>
- <summary lang="fi_FI">Mahdollisesti kaikkein psykedeelisin näytönsäästäjä</summary>
- <summary lang="fr_CA">Il y a pas d'économiseur d'écran plus psychédélique</summary>
- <summary lang="fr_FR">Difficilement plus psychédélique comme économiseur d'écran</summary>
- <summary lang="gl_ES">Máis ou menos tan psicodélico como o pode ser un protector de pantalla</summary>
- <summary lang="he_IL">זהו שומר המסך הפסיכדלי ביותר שיכול להיות</summary>
- <summary lang="hr_HR">Psihodeličan koliko čuvar zaslona može biti </summary>
- <summary lang="hu_HU">A legpszihedelikusabb képernyővédő</summary>
- <summary lang="id_ID">Sepsikedelik mungkin dari sebuah screensaver</summary>
- <summary lang="is_IS">Eins geggjuð og skjáhvíla getur orðið</summary>
- <summary lang="it_IT">Quanto di più psichedelico possa essere un salvaschermo</summary>
- <summary lang="ja_JP">スクリーンセーバーはここまでサイケになれる</summary>
- <summary lang="ko_KR">싸이키델릭 화면 보호기</summary>
- <summary lang="lt_LT">Psihodelinė užsklanda nunešanti stoga</summary>
- <summary lang="lv_LV">Cik nu vien psihodēlisks ekrānsaudzētājs var būt</summary>
- <summary lang="mk_MK">Најпсиходелична заштита на екран</summary>
- <summary lang="ms_MY">Perihal as psychedelic as screensavers get</summary>
- <summary lang="nb_NO">Så psykadelisk som en skjermsparer kan bli</summary>
- <summary lang="nl_NL">Een meer psychedelische schermbeveiliging vindt u niet</summary>
- <summary lang="pl_PL">Tak psychodeliczny jak tylko się da</summary>
- <summary lang="pt_BR">Protetor de Tela Psicodélico</summary>
- <summary lang="pt_PT">Um protector de ecrã mais psicadélico do que este? Impossível.</summary>
- <summary lang="ro_RO">Un protector ecran cât se poate de năucitor</summary>
- <summary lang="ru_RU">Самая психоделическая в мире заставка</summary>
- <summary lang="sk_SK">Tak psychodelický ako to len ide</summary>
- <summary lang="sl_SI">Najbolj psihadelični ohranjevalnik zaslona</summary>
- <summary lang="sr_RS">Психоделичан колико то један чувар екрана може да буде.</summary>
- <summary lang="sv_SE">Ungefär så psykedelisk som en skärmsläckare kan bli</summary>
- <summary lang="tg_TJ">Дар тамоми ҷаҳон ин пардаи экран аз ҳама беҳтарин аст</summary>
- <summary lang="tr_TR">İnsanı hayallere sürükleyen bir ekran koruyucu</summary>
- <summary lang="uk_UA">Настільки психоделічна наскільки можливо для заставки</summary>
- <summary lang="vi_VN">Tạo ra ảo giác mạnh nhất mà trình bảo vệ màn hình có thể có được</summary>
- <summary lang="zh_CN">最具迷幻效果的屏幕保护程序</summary>
- <summary lang="zh_TW">最具夢幻效果的螢幕保護程式</summary>
- <description lang="af_ZA">Die is omtrent so psigedelies soos sluimerskerm kan kom. mogumbo het gedink sy Plasma beskermer was heel voor in die koor, maar die een sal jou maag selfs meer laat draai. Jy beter een van daardie vlug siekte sakke kry voor jy te lank na hierdie een staar.</description>
- <description lang="ar_SA">هذا حول الحصول على مهدء كشاشة التوقف. اعتقد موغمبو أن شاشة توقف البلازمة خاصته في قمة الجدول, لكن هذا مقرف أكثر. الأفضل أن تجد أحد أكياس الغثيان قبل أن تنظر لهذا لوقت طويل.</description>
- <description lang="be_BY">This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long.</description>
- <description lang="bg_BG">Точно колкото може един скрийнсейвър. mogumbo смяташе, че неговият "Plasma saver" е върхът, но този е по-смущаващ. Препоръчвам Ви да вземете една торбичка/леген, преди да зазяпате в скрийнсейвъра по-дълго отколкото трябва.</description>
- <description lang="ca_ES">Aquest és probablement el més psicodèlic dels estalvis de pantalla. mogumbo va pensar que el seu estalvi Plasma estava al capdamunt, però aquest és més nauseabund. Serà millor que agafis una bossa per als marejos si has d'estar molta estona mirant-lo.</description>
- <description lang="cs_CZ">Asi nejdivočejší šetřič obrazovky všech dob. Použití plazmového šetřiče bývalo vrcholem, ale tento spořič je ještě více zneklidňující. Připravte si pytlíky na zvracení pokud se jej rozhodnete sledovat příliš dlouho.</description>
- <description lang="cy_GB">Mor seicadelig ag y mae modd bod. Roedd mogumbo'n meddwl fod ei arbedwr Plasma ar frig y rhestr, ond mae hwn hyd yn oed yn fwy troëdig. Gwell dod o hyd i fag salwch cyn edrych ar hwn yn rhy hir.</description>
- <description lang="da_DK">Dette er omtrent så psykedelisk som en pauseskærm kan blive. Mogumbo troede hans Plasma-pauseskærm var i toppen af skalaen, men denne er endnu mere kvalmende. Du må hellere finde en papirpose, inden du kigger alt for længe på denne.</description>
- <description lang="de_DE">In etwa so ​​psychedelisch wie ein Bildschirmschoner nur sein kann. mogumbo dachte, sein Plasma-Bildschirmschoner wäre bereits abstoßend, aber dieser hier ist noch verabscheuenswürdiger. Kram' besser schon mal eine Kotztüte hervor, bevor Du diesen Bildschirmschoner zu lange anstarrst.</description>
- <description lang="el_GR">Αυτή είναι η πιο ψυχεδελική προφύλαξη οθόνης που υπάρχει. Ο mogumbo νόμιζε ότι η Plasma προφ. οθόνης του ήταν η κορυφαία, αλλά αυτή είναι ακόμα πιο μπερδεμένη. Καλύτερα να βρείτε μία από εκείνες τις σακούλες για τη ναυτία προτού την κοιτάξετε για πολλή ώρα.</description>
- <description lang="en_AU">This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long.</description>
- <description lang="en_GB">This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long.</description>
- <description lang="en_NZ">This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long.</description>
- <description lang="en_US">This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long.</description>
- <description lang="es_AR">Este es probablemente el más psicodélico de los protectores de pantalla. mogumbo pensó que su protector de Plasma estaba en lo mas alto, pero éste es más repugnante. Será mejor que busques una bolsa para los mareos si vas a estar mucho tiempo viéndolo.</description>
- <description lang="es_ES">Este es probablemente el más psicodélico de los salvapantallas. Mogumbo -el autor- pensó que su protector 'Plasma' estaba en lo más alto, pero éste es más repugnante. Será mejor que cojas una bolsa para los mareos si vas a estar mucho tiempo viéndolo.</description>
- <description lang="es_MX">Esto es tan psicodélico como un protector de pantalla debe ser, mogumbo pensó que su protector Plasma estaba en la cima del mundo, pero éste es aún más nauseabundo. Deberías conseguir una bolsa para mareos antes de quedarte observando por mucho tiempo.</description>
- <description lang="et_EE">See on nii psühhedeelne kui üks ekraanisäästja olla saab. mogumbo arvas, et tema Plasma säästja oli tippude tipp, aga see on isegi rohkem iiveldama ajav. Parem otsi endale üks neist lennuki oksekottidest enne kui liiga kauaks seda siin vaatama jääd.</description>
- <description lang="eu_ES">Hau ziurrenik inoiz sortu den pantaila-babesle psikodelikoena da. Mogunbo sortzaileak bere Plasma babeslea garaiena zuela uste zuen baina hau oraindik nazkagarriago da. Ikusten denbora asko egon behar bazara hobe zorabiorako poltsa bat edukitzea.</description>
- <description lang="fa_IR">این محافظ تقریبا از نهایت توهم زایی یک محافظ صفحه نمایش برخوردار است. ماگومبو فکر می کرد محافظ پلاسمایی او نهایت کار است، اما این یکی از آن هم تهوع آور تر است. بهتر است قبل از آنکه مدت طولانی به این محافظ خیره شوید یکی از آن پاکت های مخصوص حالت تهوع هواپیماها را تهیه کنید.</description>
- <description lang="fi_FI">Tämä on mahdollisesti niin psykedeelinen kuin vain näytönsäästäjä voi olla. mogumbo luuli, että hänen Plasma-näytönäästäjänsä oli asteikon huipulla, mutta tämä ohittaa senkin. Oksennuspussin hakeminen on suositeltavaa ennen pitkäaikaista tuijottamista.</description>
- <description lang="fr_CA">On fait difficilement plus psychédélique comme économiseur d'écran. mogumbo pensait que son économiseur Plasma était tout en haut de l'échelle mais, celui-ci donne encore plus la nausée. Vous devriez trouver un de ces sacs pour le mal de l'air avant de le fixer trop longtemps.</description>
- <description lang="fr_FR">En terme d'économiseur, on fait difficilement plus psychédélique. Mogumbo pensait son économiseur Plasma tout en haut de l'échelle mais, celui-ci donne encore plus la nausée. Mieux vaut se munir d'un de ces sachets pour le mal de l'air avant de le regarder trop longtemps.</description>
- <description lang="gl_ES">Este é máis ou menos tan psicodélico como pode selo un protector de pantalla. mogumbo pensou que o seu protector de pantalla Plasma era do mello, pero este é aínda máis mareante. Será mellor que colla unha bolsa contra o mareo antes de quedar pampo mirando para el.</description>
- <description lang="he_IL">זהו שומר מסך הכי פסיכדלי שניתן להיות. mogumbo חשב ששומר מסך הפלזמה שלו הגיע לראש הטבלה, אך שומר זה יגרום לתחושת סחרחורת גדולה יותר. מוטב להצטייד במספר שקיות הקאה בטרם בהיה ממושכת.</description>
- <description lang="hr_HR">Psihodeličan koliko čuvar zaslona može biti. Mogumbo kroz svoj plazma čuvar zaslona je bio vrh, ali od ovog vam je još više loše. Bilo bi vam bolje da pronađete jednu od onih vrećica za mučninu što dijele u avionima prije nego počnete zuriti u ovaj.</description>
- <description lang="hu_HU">Ez a legpszihedelikusabb képernyővédő. mogumbo úgy gondolta, hogy a Plasma képernyővédő van a lista tetején,de ez még inkább kábító. Jobb ha keresel egy légibetegség zacskót mielőtt túl sokáig néznéd a képernyőt.</description>
- <description lang="id_ID">Ini adalah sepsikedelik mungkin dari sebuah screensaver. mogumbo mengira Plasma savernya berada di puncak, Tapi ini bahkan lebih memabukkan. Anda sebaiknya mencari kantung mabuk terlebih dahulu sebelum menatapnya terlalu lama.</description>
- <description lang="is_IS">Þetta er líklega eins geggjað og skjáhvílur geta orðið. mogumbo hélt að Plasma skjáhvílan væri á toppnum, en þessi gerir þig meira flökurt. Best fyrir þig að redda þér ælupoka áður en þú starir á þetta í einhvern tíma. </description>
- <description lang="it_IT">Questo è quanto di più psichedelico possa essere un salvaschermo. mogumbo pensava che il suo salvaschermo 'Plasma' fosse al massimo della psichedelicità, ma questo è anche più nauseante. Faresti meglio a cercare uno di quei sacchetti per il mal d'aria prima di fissarlo troppo a lungo.</description>
- <description lang="ja_JP">This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long.</description>
- <description lang="ko_KR">싸이키델릭한 화면보호기입니다. 거의 토나올 정도의 화면보호기로 오래 쳐다보려면 봉투를 준비하는것이 좋을겁니다.</description>
- <description lang="lt_LT">Tai stogą nunešanti psichodelinė užsklanda. Mogumbo galvojo, kad jo Plasma užsklandos niekas neperšoks, tačiau ši užsklanda tai kažkas tokio. Geriau susiraskite vieną iš tų lėktuvo maišelių, jei supykintų, prieš spoksant į tai per ilgai..</description>
- <description lang="lv_LV">Ekrānsaudzētājs nevarētu būt vēl vairāk psihodēlisks. mogumbo domāja, ka viņa "Plasma saver" bija saraksta augšgalā, bet šis ir vēl šķebinošāks. Labāk apsēdies un sameklē kādu maisņu nelabai dūšai pirms skaties šo pārāk ilgi.</description>
- <description lang="mk_MK">This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long.</description>
- <description lang="ms_MY">Ia mengenai as psychedelic as screensavers get. mogumbo berpendapat penyelamat Plasmanya adlaah yang terbaik, tetapi yang ini adalah lebih meloyakan. Oleh itu anda perlu cari beg muntah sebelum anda melihatnya dengan lebih lama.</description>
- <description lang="nb_NO">Dette er så psykadelisk som en skjermsparer kan bli. Mogumbo trodde hans Plasma skjermsparer var på toppen av skalaen, men denne er enda mer kvalmende. Du bør skaffe deg en sånn spypose som de deler ut på fly før du stirrer på denne for lenge.</description>
- <description lang="nl_NL">Ongetwijfeld de meest psychedelische screensaver. mogumbo dacht dat zijn Plasmascreensaver al bovenaan deze lijst stond, maar deze is nóg meer misselijkmakend. Houd uw braakzakje bij de hand, mocht u hier te lang naar staren.</description>
- <description lang="pl_PL">Tak psychodeliczny wygaszacz jak tylko się da. Lepiej zaopatrz się w worki na chorobę lokomocyjną.</description>
- <description lang="pt_BR">Esta é provavelmente a proteção de tela mais psicodélica de todos os tempos. O mogumbo, pensou que a sua proteção de tela 'Plasma' estava no topo da escala de proteções nauseantes mas esta parece ainda pior. Procure um saco de enjoo e sente-se, se vai ficar muito tempo a olhar para a tela.</description>
- <description lang="pt_PT">Provavelmente o protector de ecrã mais psicadélico de sempre. O autor, mogumbo, julgava que a sua proteção 'Plasma' estava no topo da escala, mas este é ainda mais repugnante. É melhor encontrar um desses sacos de enjoo antes de ficar pregado nele durante muito tempo.</description>
- <description lang="ro_RO">Acesta este un protector ecran cât se poate de năucitor. mogumbo credea că screensaverul creat de el, Plasma este pe primul loc, dar acest screensaver este și mai amețitor. Ar trebui să căutați o pungă să nu vi se facă rău înainte de a vă uita la acesta prea mult.</description>
- <description lang="ru_RU">Самая психоделическая в мире заставка. mogumbo считал, что никто не сможет достичь эффекта его заставки Plasma, но от этой заставки укачивает ещё сильнее. Если будете смотреть на эту заставку слишком долго, вам очень скоро понадобится гигиенический пакет.</description>
- <description lang="sk_SK">Tento šetrič je tak psychodelický ako to len ide. Mogumbo myslel, že Plasma šetrič je na vrchole rebríčka, ale tento je ešte viac zvrátený. Radšej si nájdite hygienické vrecko skôr než naň budete civieť pridlho.</description>
- <description lang="sl_SI">Težko bi si zamislili bolj psihadeličen ohranjevalnik zaslona. mogumbo je menil, da je njegov ohranjevalnik Plasma na vrhu, to da ta še bolj vzbuja slabost. Bolje, da najdete eno izmed tistih vrečk za bruhanje, preden predolgo strmite vanj.</description>
- <description lang="sr_RS">Психоделичан колико то један чувар екрана може да буде. Mogumbo је мислио да је његов Plasma чувар екрана на врху скале, али од овога ће вам бити још лошије. Боље да пронађете једну од оних кесица за мучнину које деле у авионима пре него што почнете да зурите у овај превише дуго.</description>
- <description lang="sv_SE">Detta är ungefär så psykedelisk som en skärmsläckare kan bli. mogumbo trodde att hans Plasma Saver var toppen på skalan, men denna gör dig ännu mer illamående. Det är nog bäst att du letar upp en påse för flygsjuka innan du sätter dig ned och stirrar på denna för länge.</description>
- <description lang="tg_TJ">Дар тамоми ҷаҳон ин пардаи экран аз ҳама беҳтарин буда дар рейтинги пардаҳои экран ҷои якумро бо пардаи плазмаи худ гирифт. Вақте ки истифодаи ин пардаи экранро сар мекунед, аз истифодаи он ҳеҷ гоҳ рад намекунед.</description>
- <description lang="tr_TR">Bu, insanı hayallere sürükleyen bir ekran koruyucudur. mogumbo kendisine ait bu Plazma ekran koruyucunun skalanın en üstünde olduğunu düşünüyor, ancak daha ziyade insanın içini kaldırıyor. Bu ekran koruyucuyu uzun süre seyretmeden önce mide bulantınız için gerekli önlemleri almanız iyi olur.</description>
- <description lang="uk_UA">Сама психоделічна в світі заставка. mogumbo вважав, що ніхто не зможе досягти ефекту його заставки плазми, але від цієї заставки заколисує ще сильніше. Якщо будете дивитися на цю заставку занадто довго, вам дуже скоро знадобиться гігієнічний пакет.</description>
- <description lang="vi_VN">Chú trọng để tạo ra ảo giác mạnh nhất mà trình bảo vệ màn hình có thể có được. Mogumbo từng nghĩ trình bảo vệ Plasma của mình đã đỉnh, nhưng trình này còn kinh khủng hơn. Tốt hơn hết là bạn nên chuẩn bị một túi chống nôn cho mình trước khi bắt đầu nhìn vào nó quá lâu</description>
- <description lang="zh_CN">这大概是最具迷幻效果的屏幕保护程序了。mogumbo 以为他的 Plasma 屏保已经是数一数二了,但这个更令人犯晕。如果你要长时间盯视它最好先准备一个晕机袋。</description>
- <description lang="zh_TW">這大概是最具夢幻效果的屏幕保護程序了。 mogumbo以為他的電漿螢幕保護程式已經是數一數二了,但這個更令人頭昏腦脹。如果你要長時間盯視它最好先準備一個夠用的暈機嘔吐袋。</description>
- <platform>linux osx</platform>
- </extension>
-</addon>
diff --git a/addons/screensaver.rsxs.euphoria/icon.png b/addons/screensaver.rsxs.euphoria/icon.png
deleted file mode 100644
index cc2beea958..0000000000
--- a/addons/screensaver.rsxs.euphoria/icon.png
+++ /dev/null
Binary files differ
diff --git a/addons/screensaver.rsxs.plasma/addon.xml b/addons/screensaver.rsxs.plasma/addon.xml
deleted file mode 100644
index b454f77955..0000000000
--- a/addons/screensaver.rsxs.plasma/addon.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<addon
- id="screensaver.rsxs.plasma"
- version="1.0.26"
- name="Plasma"
- provider-name="mogumbo, Team-Kodi">
- <requires>
- <c-pluff version="0.1"/>
- </requires>
- <extension
- point="xbmc.ui.screensaver"
- library_linux="Plasma.xbs"
- library_osx="Plasma.xbs"/>
- <extension point="xbmc.addon.metadata">
- <summary lang="af_ZA">Seker die tweede mees psigedeliese sluimerskerm ooit</summary>
- <summary lang="ar_SA">ربما شاشة التوقف الثانية الأكثر هدوء على الإطلاق</summary>
- <summary lang="be_BY">Напэўна, другі найбольш псіхадэлічны ахоўнік экрану</summary>
- <summary lang="bg_BG">Вероятно вторият най-халюциногенен скрийнсейвър</summary>
- <summary lang="ca_ES">Probablement el segon estalvi de pantalla més psicodèlic mai creat</summary>
- <summary lang="cs_CZ">Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob</summary>
- <summary lang="cy_GB">Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig</summary>
- <summary lang="da_DK">Formodentlig den anden mest psykedeliske pauseskærm nogensinde</summary>
- <summary lang="de_DE">Wahrscheinlich der zweit-psychodelischste Bildschirmschoner überhaupt</summary>
- <summary lang="el_GR">Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που έγινε ποτέ</summary>
- <summary lang="en_AU">Probably the second most psychedelic screensaver ever</summary>
- <summary lang="en_GB">Probably the second most psychedelic screensaver ever</summary>
- <summary lang="en_NZ">Probably the second most psychedelic screensaver ever</summary>
- <summary lang="en_US">Probably the second most psychedelic screensaver ever</summary>
- <summary lang="es_AR">Probablemente el segundo protector de pantalla más psicodélico jamás creado</summary>
- <summary lang="es_ES">Probablemente el segundo salvapantallas más psicodélico jamás creado</summary>
- <summary lang="es_MX">Probablemente el segundo protector de pantalla más psicodélico</summary>
- <summary lang="et_EE">Arvatavasti teine kõige psühhedeelsem ekraanisäästja, mis iial tehtud</summary>
- <summary lang="eu_ES">Ziurrenik inoizko bigarren pantaila-babesle psikodelikoena</summary>
- <summary lang="fa_IR">این محافظ صفحه نمایش احتمالا مقام دوم را در توهم زایی دارد</summary>
- <summary lang="fi_FI">Todennäköisesti toiseksi psykedeelisin näytönsäästäjä koskaan</summary>
- <summary lang="fr_CA">Probablement le deuxième économiseur d'écran le plus psychédélique</summary>
- <summary lang="fr_FR">Probablement le deuxième économiseur d'écran le plus psychédélique jamais créé</summary>
- <summary lang="gl_ES">Probabelmente o segundo protector de pantalla máis psicodélico.</summary>
- <summary lang="he_IL">כנראה שומר המסך השני בדירוג הפסיכדליות</summary>
- <summary lang="hr_HR">Vjerojatno drugi najveći psihodelični čuvar zaslona ikad</summary>
- <summary lang="hu_HU">A második legpszihedelikusabb képernyővédő</summary>
- <summary lang="id_ID">Mungkin screensaver paling psikedelik nomor dua yang pernah ada</summary>
- <summary lang="is_IS">Líklega í öðru sæti yfir klikkuðustu skjáhvíluna</summary>
- <summary lang="it_IT">Probabilmente il secondo salvaschermo più psichedelico di sempre</summary>
- <summary lang="ja_JP">世界で2番目にサイケなスクリーンセーバー</summary>
- <summary lang="ko_KR">아마도 지금까지 두번째로 가장 환상적인 화면 보호기</summary>
- <summary lang="lt_LT">Tikriausiai antra labiausiai psichodelinė ekrano užsklanda pasaulyje.</summary>
- <summary lang="lv_LV">Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē</summary>
- <summary lang="mk_MK">Можеби втора нај психоделична заштита на екран</summary>
- <summary lang="ms_MY">Berkemungkinan penyelamat skrin kedua yang paling psikedelik</summary>
- <summary lang="nb_NO">Helt sikkert den nest mest psykedeliske skjermspareren som finnes</summary>
- <summary lang="nl_NL">Waarschijnlijk de op één na meest psychedelische schermbeveiliging ooit</summary>
- <summary lang="pl_PL">Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie</summary>
- <summary lang="pt_BR">Provavelmente a segunda mais psicodélica proteção de tela já vista</summary>
- <summary lang="pt_PT">Este é provavelmente o segundo melhor protector de ecrã psicadélico de sempre</summary>
- <summary lang="ro_RO">Probabil al doilea cel mai năucitor protector ecran care a existat vreodată</summary>
- <summary lang="ru_RU">Наверное, вторая из самых психоделических заставок в мире</summary>
- <summary lang="si_LK">පෙනෙන විදියට සදා දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු</summary>
- <summary lang="sk_SK">Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky vôbec</summary>
- <summary lang="sl_SI">Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu</summary>
- <summary lang="sr_RS">Вероватно други нај психоделичнији чувар екрана икада</summary>
- <summary lang="sv_SE">Troligen den näst mest psykedeliska skärmsläckaren någonsin.</summary>
- <summary lang="tg_TJ">Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад</summary>
- <summary lang="tr_TR">Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu</summary>
- <summary lang="uk_UA">Напевно, друга серед найбільш психоделічних заставок</summary>
- <summary lang="vi_VN">Xứng đáng làm trình bảo vệ màn hình gây ảo giác mạnh thứ hai</summary>
- <summary lang="zh_CN">或许是排名第二的迷幻效果屏幕保护程序</summary>
- <summary lang="zh_TW">可能是有史以來第二最夢幻的螢幕保護程式保護程式</summary>
- <description lang="af_ZA">Seker die tweede mees psigedeliese sluimerskerm wat bestaan. Verbeel jou net al daai kleure wat rond beweeg.</description>
- <description lang="ar_SA">ربما شاشة التوقف الثانية الأكثر هدوء في الوجود. فقط حاول تصوير هذه الألوان المتحركة .</description>
- <description lang="be_BY">Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around.</description>
- <description lang="bg_BG">Вероятно вторият по сила халюциногенен скрийнсейвър създаван някога. Просто се опитайте да съзрете всички тези цветове.</description>
- <description lang="ca_ES">Probablement el segon estalvi de pantalla més psicodèlic que existeix. Intenta imaginar tots aquests colors movent-se.</description>
- <description lang="cs_CZ">Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob. Zkuste si představit všechny ty poletující barvy.</description>
- <description lang="cy_GB">Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig sy'n bod. Ceisiwch ddychmygu'r holl liwiau na'n symud o gwmpas.</description>
- <description lang="da_DK">Formodentlig den anden mest psykedeliske pauseskærm, der eksisterer. Forestil dig alle de farver, der bevæger sig omkring.</description>
- <description lang="de_DE">Wahrscheinlich der zweit-psychodelischste Bildschirmschoner, den es gibt. Versuche doch alle diese Farben, die sich umher bewegen, festzuhalten.</description>
- <description lang="el_GR">Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που υπάρχει. Απλά προσπαθήστε να φανταστείτε όλα αυτά τα χρώματα σε κίνηση.</description>
- <description lang="en_AU">Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around.</description>
- <description lang="en_GB">Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around.</description>
- <description lang="en_NZ">Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around.</description>
- <description lang="en_US">Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around.</description>
- <description lang="es_AR">Probablemente el segundo protector de pantalla más psicodélico que existe. Solo intente imaginarse todos esos colores moviéndose.</description>
- <description lang="es_ES">Probablemente el segundo salvapantallas más psicodélico que existe. Intente imaginarse todos esos colores moviéndose.</description>
- <description lang="es_MX">Probablemente el segundo protector de pantallas más psicodélico. Solo trate de captar todos los colores moviéndose alrededor.</description>
- <description lang="et_EE">Arvatavasti ajaloo teine kõige psühhedeelsem ekraanisäästja. Püüa lihtsalt kujutleda kõiki neid värve, mis ringi liiguvad.</description>
- <description lang="eu_ES">Ziurrenik existitzen den bigarren pantaila-babesle psikodelikoena. Saiatu kolore guzti horiek mugitzen irudikatzen.</description>
- <description lang="fa_IR">این محافظ احتمالا در میان تمام محافظ های موجود مقام دوم را در توهم زایی دارد. سعی کنید همه این رنگ هایی را که در حال حرکت هستند، نگه دارید.</description>
- <description lang="fi_FI">Todennäköisesti toiseksi psykedeelisin olemassa oleva näytönsäästäjä. Kuvittelepa vain kaikki nuo värit lentelemässä ympäriinsä.</description>
- <description lang="fr_CA">Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement.</description>
- <description lang="fr_FR">Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement.</description>
- <description lang="gl_ES">Probabelmente o segundo protector de pantalla máis psicodélico do mundo. Tan só probe a imaxinarse todas esas cores movéndose ó redor.</description>
- <description lang="he_IL">כנראה שומר המסך השני בדירוג הפסיכדליות שקיים כיום. פשוט נסו לדמיין את כל הצבעים האלו נעים ממקום למקום.</description>
- <description lang="hr_HR">Vjerojatno drugi najveći psihodelični čuvar zaslona koji postoji. Samo pokušajte zamisliti sve te boje koje se gibaju okolo.</description>
- <description lang="hu_HU">Valószínüleg a második legpszihedelikusabb képernyővédő ami létezik. Csak képzeld el mindezt a színkavalkádot mozogni.</description>
- <description lang="id_ID">Mungkin screensaver paling psikedelik nomor dua yang pernah ada. Coba bayangkan warna-warni itu bergerak ke sana kemari.</description>
- <description lang="is_IS">Líklega í öðru sæti yfir klikkuðustu skjáhvíluna sem til er. Reyndi bara að ímynda þér alla þessa liti á hreyfingu.</description>
- <description lang="it_IT">Probabilmente il secondo salvaschermo più psichedelico di sempre. Prova semplicemente a guardare tutti quei colori che si muovono.</description>
- <description lang="ja_JP">Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around.</description>
- <description lang="ko_KR">아마도 존재하는 두번째로 가장 환상적인 화면 보호기. 모든 색깔들이 움직이는 것을 상상해보세요.</description>
- <description lang="lt_LT">Turbūt antra labiausiai psichodelinė ekrano užsklanda pasaulyje. Išbandykite ją ir pamatysite judančių spalvų šventę.</description>
- <description lang="lv_LV">Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē. Pamēģiniet, lai gūtu priekšstatu par krāsu kustību un plūsmu visapkārt.</description>
- <description lang="mk_MK">Можеби втора нај психоделична заштита на екран. Само обидете се да ги согледате сите тие бои кои се движат.</description>
- <description lang="ms_MY">Berkemungkinan penyelamat skrin kedua yang paling psikedelik yang ada. Hanya cuba gambarkan semua warna yang bergerak disekitar.</description>
- <description lang="nb_NO">Helt sikkert den nest mest psykadeliske skjermsparern i verden. Bare prøv å se for deg alle de fargene som beveger seg rundt.</description>
- <description lang="nl_NL">Waarschlijnlijk de op één na meest psychedelische schermbeveliging ooit. Probeer u het voor te stellen: al die kleuren die door elkaar lopen.</description>
- <description lang="pl_PL">Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie. Spróbuj i zobacz ferie poruszających się barw.</description>
- <description lang="pt_BR">Provavelmente a segundo mais psicodélica proteção de tela existente. Experimente ver todas essas cores se movimentando ao redor da tela.</description>
- <description lang="pt_PT">Provavelmente, o segundo melhor protector de ecrã psicadélico de sempre. Experimente visualizar todas as cores a moverem-se.</description>
- <description lang="ro_RO">Probabil al doilea cel mai năucitor protector ecran care a existat vreodată. Doar încercați să vă imaginați toate acele culori mișcându-se.</description>
- <description lang="ru_RU">Просто попробуйте представить себе все цвета в движении.</description>
- <description lang="si_LK">පෙනෙන විදියට සදා පවතින දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු.වටේ තිබෙන එම සියළු වර්ණ ඡායාරූප කිරීමට උත්සාහ කිරීම පමණයි. </description>
- <description lang="sk_SK">Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky aký vôbec existuje. Iba si skúste predstaviť všetky tie farby pohybujúc sa okolo.</description>
- <description lang="sl_SI">Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu. Samo predstavljajte si vse te barve, ki letijo naokrog.</description>
- <description lang="sr_RS">Вероватно други нај психоделичнији чувар екрана који је икада постојао. Само пробајте да замислите све те боје како шетају наоколо.</description>
- <description lang="sv_SE">Troligen den näst mest psykedeliska skärmsläckaren som existerar. Bara tänk dig alla färgerna som rör på sig.</description>
- <description lang="tg_TJ">Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад. Танҳо тасаввур кунед, ки чӣ қадар зебо ҳамаи рангҳояш бозӣ мекунанд.</description>
- <description lang="tr_TR">Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu. Ekranda dolaşan tüm renkleri seyretmeye çalışın.</description>
- <description lang="uk_UA">Напевно, друга серед найбільш психоделічних заставок. Лише уявіть усі ці переливи кольорів.</description>
- <description lang="vi_VN">Đây có thể là trình bảo vệ màn hình gây ảo giác mạnh thứ hai tại thời điểm này. Hãy thử xem các hình ảnh tạo nên từ các màu sắc di chuyển khắp nơi</description>
- <description lang="zh_CN">或许是排名第二的迷幻效果屏幕保护程序。你将看到所有颜色满处乱飞。</description>
- <description lang="zh_TW">可能是現存第二最夢幻的螢幕保護程式。快來嘗試想像一下所有移動中的色彩變化。</description>
- <platform>linux osx</platform>
- </extension>
-</addon>
diff --git a/addons/screensaver.rsxs.plasma/icon.png b/addons/screensaver.rsxs.plasma/icon.png
deleted file mode 100644
index a6784afc53..0000000000
--- a/addons/screensaver.rsxs.plasma/icon.png
+++ /dev/null
Binary files differ
diff --git a/addons/screensaver.rsxs.solarwinds/addon.xml b/addons/screensaver.rsxs.solarwinds/addon.xml
deleted file mode 100644
index d421a2687f..0000000000
--- a/addons/screensaver.rsxs.solarwinds/addon.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<addon
- id="screensaver.rsxs.solarwinds"
- version="1.0.26"
- name="Solarwinds"
- provider-name="mogumbo, Team-Kodi">
- <requires>
- <c-pluff version="0.1"/>
- </requires>
- <extension
- point="xbmc.ui.screensaver"
- library_linux="Solarwinds.xbs"
- library_osx="Solarwinds.xbs"/>
- <extension point="xbmc.addon.metadata">
- <summary lang="af_ZA">'n Betoverende deeltjie effek sluimerskerm</summary>
- <summary lang="ar_SA">أداة ساحرة تؤثر بشاشة التوقف</summary>
- <summary lang="be_BY">Ахоўнік экрану з зачаравальнымі эфэктамі часьціцаў</summary>
- <summary lang="bg_BG">Скрийнсейвър от частици, които очароват</summary>
- <summary lang="ca_ES">Un estalvi de pantalla amb uns efectes de partícula fascinants</summary>
- <summary lang="cs_CZ">Spořič obrazovky s fascinujícími částicovými efekty</summary>
- <summary lang="cy_GB">Arbedwr sgrin effeithiau gronynnau llesmeiriol</summary>
- <summary lang="da_DK">En tryllebindende pauseskærm med partikeleffekter</summary>
- <summary lang="de_DE">Ein faszinierender Bildschirmschoner mit Partikeleffekten</summary>
- <summary lang="el_GR">Μία μαγευτική σωματιδιακή προφύλαξη οθόνης</summary>
- <summary lang="en_AU">A mesmerising particle effects screensaver</summary>
- <summary lang="en_GB">A mesmerising particle effects screensaver</summary>
- <summary lang="en_NZ">A mesmerising particle effects screensaver</summary>
- <summary lang="en_US">A mesmerizing particle effects screensaver</summary>
- <summary lang="es_AR">Un protector de pantalla con unos efectos de partículas hipnotizantes</summary>
- <summary lang="es_ES">Un salvapantallas con unos efectos de partículas hipnotizantes</summary>
- <summary lang="es_MX">Un sorprendente protector de pantalla de partículas</summary>
- <summary lang="et_EE">Hüpnotiseeriv osakeste efektiga ekraanisäästja</summary>
- <summary lang="fa_IR">یک محافظ جذاب صفحه نمایش با جلوه های ذرات</summary>
- <summary lang="fi_FI">Lumoava partikkelitehostenäytönsäästäjä</summary>
- <summary lang="fr_CA">Un économiseur d'écran hypnotisant à effets de particules</summary>
- <summary lang="fr_FR">Un économiseur envoûtant à effets de particules</summary>
- <summary lang="gl_ES">Un hipnotizante protector de pantalla con efectos de partículas</summary>
- <summary lang="he_IL">שומר מסך עם אפקט חלקיקים מהפנט</summary>
- <summary lang="hr_HR">Čuvar zaslona - Očaravajuće kretanje čestica.</summary>
- <summary lang="hu_HU">Egy igéző részecske-effektus képernyővédő</summary>
- <summary lang="id_ID">Penyelamat layar dengan efek partikel yang mencuri perhatian</summary>
- <summary lang="is_IS">Dáleiðandi skjáhvíla með brellum með agnir</summary>
- <summary lang="it_IT">Un salvaschermo con effetti particellari ipnotizzanti</summary>
- <summary lang="ja_JP">幻想的な粒子エフェクトのスクリーンセーバー</summary>
- <summary lang="ko_KR">매혹적인 파티클 이펙트 화면 보호기</summary>
- <summary lang="lt_LT">Įtaigaus dalelių poveikio ekrano užsklanda</summary>
- <summary lang="lv_LV">Hipnotizējošs daļiņu efekta ekrānsaudzētājs</summary>
- <summary lang="mk_MK">Заштита на екран со смирувачки честички</summary>
- <summary lang="ms_MY">Penyelamat kesan zarah yang memukau</summary>
- <summary lang="nb_NO">En hypnotiserende skjermsparer med partikkeleffekter</summary>
- <summary lang="nl_NL">Een hypnotiserende schermbeveiliging met partikeleffecten</summary>
- <summary lang="pl_PL">Wygaszacz hipnotyzujący efektami cząsteczek</summary>
- <summary lang="pt_BR">Um protetor de tela hipnotizante com efeitos de partículas</summary>
- <summary lang="pt_PT">Protector de ecrã com um impressionante efeito de partículas</summary>
- <summary lang="ro_RO">Un protector ecran cu efecte de particule fascinant</summary>
- <summary lang="ru_RU">Завораживающая заставка с эффектами частиц</summary>
- <summary lang="si_LK">මෝහනය කිරීම් තිරමෙහෙයුම් වෙත ප්‍රයෝගිකව බලපෑම </summary>
- <summary lang="sk_SK">Fascinujúci šetrič s efektom častíc</summary>
- <summary lang="sl_SI">Ohranjevalnik zaslona z dih jemajočimi delčki</summary>
- <summary lang="sr_RS">Чувар екрана са очаравајућим ефектом честица</summary>
- <summary lang="sv_SE">En hypnotiserande partikeleffektskärmsläckare</summary>
- <summary lang="tg_TJ">Пардаи экрани аҷоиб бо таъсири зарраҳо</summary>
- <summary lang="tr_TR">Büyüleyici bir parçacık efektli ekran koruyucu</summary>
- <summary lang="uk_UA">Заставка із частинок, що має гіпнотизуючий ефект</summary>
- <summary lang="vi_VN">Một trình bảo vệ màn hình với hiệu ứng thôi miên tạo từ các hạt</summary>
- <summary lang="zh_CN">一个迷人的粒子效果屏幕保护程序</summary>
- <summary lang="zh_TW">一個令人著迷的粒子效果的螢幕保護程式</summary>
- <description lang="af_ZA">Hierdie is 'n uiters betoverende deeltjie effek sluimerskerm. Jy sal vind dat jy 'n ongelooflike aantal verskillende patrone kan bewerkstellig.</description>
- <description lang="ar_SA">أداة ساحرة جدا تؤثر بشاشة التوقف. ستجد أنك تستطيع أن تحقق عدد مذهل من الأنماط المختلفة.</description>
- <description lang="be_BY">This is a very mesmerizing particle effects screensaver. You'll find that you can achieve an amazing number of different patterns.</description>
- <description lang="bg_BG">Това е скрийнсейвър, който очарова с частиците си. Ще откриете, че можете да създадете изключително голям брой различни модели.</description>
- <description lang="ca_ES">Aquest és un estalvi de pantalla amb uns efectes de partícules fascinants. Veuràs que pot obtenir un nombre increïble de patrons diferents.</description>
- <description lang="cs_CZ">Spořič obrazovky s velmi fascinujícími částicovými efekty. Zjistíte, že můžete dosáhnout úžasného množství různých vzorů.</description>
- <description lang="cy_GB">Mae hwn yn arbedwr sgrin effeithiau gronynnau hynod lesmeiriol. Mae modd cynhyrchu nifer anferthol o batrymau gwahanol.</description>
- <description lang="da_DK">Dette er en meget tryllebindende pauseskærm med partikeleffekter. Du vil opdage, at man kan opnå et forbløffende antal af forskellige mønstre.</description>
- <description lang="de_DE">Dies ist ein faszinierender Bildschirmschoner mit Partikeleffekten. Du kannst eine verblüffend große Anzahl an verschiedenen Animationen einstellen.</description>
- <description lang="el_GR">Αυτή είναι μία μαγευτική σωματιδιακή προφύλαξη οθόνης. Θα διαπιστώσετε ότι μπορείτε να επιτύχετε έναν απίστευτο αριθμό διαφορετικών σχεδίων.</description>
- <description lang="en_AU">This is a very mesmerising particle effects screensaver. You'll find that you can achieve an amazing number of different patterns.</description>
- <description lang="en_GB">This is a very mesmerising particle effects screensaver. You'll find that you can achieve an amazing number of different patterns.</description>
- <description lang="en_NZ">This is a very mesmerising particle effects screensaver. You'll find that you can achieve an amazing number of different patterns.</description>
- <description lang="en_US">This is a very mesmerizing particle effects screensaver. You'll find that you can achieve an amazing number of different patterns.</description>
- <description lang="es_AR">Este es un protector de pantalla con unos efectos de partículas hipnotizantes. Descubrirás que puedes obtener un número increíble de patrones diferentes.</description>
- <description lang="es_ES">Este es un salvapantallas con unos efectos de partículas hipnotizantes. Descubrirás que puedes obtener un número increíble de patrones diferentes.</description>
- <description lang="es_MX">Éste es un sorprendente protector de pantalla de partículas. Encontrará que puede obtener un gran número de patrones diferentes.</description>
- <description lang="et_EE">See on väga hüpnotiseeriv osakeste efektiga ekraanisäästja. Võimalik on koostada tohutul hulgal erinevaid mustreid.</description>
- <description lang="fa_IR">این یک محافظ جذاب صفحه نمایش با جلوه های ذرات است. تعداد پویانماهایی که با این محافظ می توان ساخت بطرز شگفت آوری زیاد است.</description>
- <description lang="fi_FI">Erittäin lumoava partikkelitehostenäytönsäästäjä. Tulet huomaamaan uskomattoman määrän erilaisia kuvioita.</description>
- <description lang="fr_CA">C'est un économiseur d'écran à effets de particules particulièrement hypnotisant. Il vous permettra d'obtenir un nombre incroyable de modèles différents.</description>
- <description lang="fr_FR">Voici un économiseur d'écran à effets de particules particulièrement envoûtant. Vous trouverez qu'il permet d'obtenir un nombre incroyable de modèles et d'effets différents.</description>
- <description lang="gl_ES">Este é un protector de pantalla con efectos de partículas moi hipnotizante. Atopará que pode acadar un incrible número de patróns diferentes.</description>
- <description lang="he_IL">זהו שומר מסך עם אפקט חלקיקים מהפנט ביותר. מספר מפתיע של צורות שונות ומרהיבות יתקבלו.</description>
- <description lang="hr_HR">Ovo je zaista očaravajuči čuvar zaslona. Moguće je ostvariti zapanjujući broj različitih uzoraka.</description>
- <description lang="hu_HU">Ez egy lebilincselő hatású részecske-effektus képernyővédő. Hihetetlen mennyiségű különböző minta képes benne kialakulni.</description>
- <description lang="id_ID">Ini adalah penyelamat layar dengan efek partikel yang sangat mencuri perhatian. Anda akan lihat bahwa Anda bisa mendapat sejumlah yang mengagumkan dari pola yang berbeda.</description>
- <description lang="is_IS">Þetta er mjög dáleiðandi skjáhvíla með brellum með ögnum. Þú munt komast að því að þú getur fengið ótrúlegan fjölda af mismunandi mynstri.</description>
- <description lang="it_IT">Questo è un salvaschermo con effetti particellari è veramente ipnotizzante. E' inoltre possibile ottenere un incredibile numero di differenti schemi.</description>
- <description lang="ja_JP">非常に幻想的な粒子エフェクトのスクリーンセーバーです。驚くほどの様々なパターンを知ることになるでしょう。</description>
- <description lang="ko_KR">매혹적인 파티클 이펙트 화면보호기입니다. 아주 다양한 패턴의 보여줍니다.</description>
- <description lang="lt_LT">Tai labai įtaigaus dalelių poveikio ekrano užsklanda. Atrasite, kad galite sukurti neįtikėtina skaičių skirtingų šablonų. </description>
- <description lang="lv_LV">Šis ir ļoti valdzinošs daļiņu efekta ekrānsaudzētājs. Jūs redzēsit, ka tas spēj izveidot neticamu skaitu dažādu musturu.</description>
- <description lang="mk_MK">Ова е заштита на екран со смирувачки честички. Ќе откриете дека можете да постигнете зачудувачки шеми.</description>
- <description lang="ms_MY">Ia merupakan penyelamat skrin kesan zarah yang sangat memukau. Anda dapati ia boleh dihasilkan beberapa corak yang sangat mempersonakan.</description>
- <description lang="nb_NO">Dette er en veldig hypnotiserende skjermsparer med partikkeleffekter. Du vil finne ut av at du kan oppnå en utrolig mengde forskjellige mønstre.</description>
- <description lang="nl_NL">Dit is een erg hypnotiserende screensaver. Je kunt ongelooflijk veel verschillende patronen maken.</description>
- <description lang="pl_PL">Bardzo hipnotyzujący wygaszacz. Przekonaj się, ile niespotykanch wzorów da się osiągnąć.</description>
- <description lang="pt_BR">Este é um protetor de tela com efeitos de partícula bem hipnotizante. Você verá que pode alcançar um incrível número de diferentes padrões.</description>
- <description lang="pt_PT">Um fantástico protector de ecrã com um impressionante efeito de partículas. Experimente e verá que pode obter um número quase infinito de padrões.</description>
- <description lang="ro_RO">Acesta este un protector ecran cu efecte de particule foarte fascinant. O să vedeți că veți putea obține un număr uimitor de modele diferite.</description>
- <description lang="ru_RU">Завораживающая заставка с эффектами частиц. Для этой заставки на выбор доступно огромное количество вариаций эффектов.</description>
- <description lang="si_LK">මෙම මෝහනය කිරීම් තිරමෙහෙයුම් වෙත ප්‍රයෝගිකව මහත් බලපෑම සහිතයි. පුදුම සහගත විවිධ මෝස්‌තර ප්‍රමාණයක් ඔබට ලබා ගැනීමට හැකි බව ඔබ සොයගනිවී</description>
- <description lang="sk_SK">Toto je veľmi fascinujúci šetrič s efektom častíc. Zistíte, že môžete dosiahnuť neskutočné číslo rôznych vzorov.</description>
- <description lang="sl_SI">To je ohranjevalnik zaslona z dih jemajočimi delčki. Odkrili boste, da lahko dosežejo neverjetno število različnih vzorcev.</description>
- <description lang="sr_RS">Ово је чувар екрана са веома очаравајућим ефектом честица. Можете остварити невероватан број различитих образаца.</description>
- <description lang="sv_SE">Detta är en väldigt hypnotiserande partikeleffektskärmsläckare. Du kommer att upptäcka att du kan åstadkomma ett häpnadsväckande antal olika mönster.</description>
- <description lang="tg_TJ">Ин пардаи экран бо таъсири зарраҳо аҷоиб мебошад. Барои ин парда шумо бисёр таъсирҳои аҷиби нотакрорро пайдо мекунед.</description>
- <description lang="tr_TR">Son derece büyüleyici bir parçacık efektli ekran koruyucu. Birçok değişik şekle ulaşabildiğinizi farkedeceksiniz.</description>
- <description lang="uk_UA">Це дуже гіпнотизуюча заставка із різноманітних ефектів частинок. Ви побачите надзвичайно велику кількість різноманітних візерунків.</description>
- <description lang="vi_VN">Đây là trình bảo vệ có hiệu ứng thôi miên cục kỳ lợi hại. Bạn sẽ thấy sự sáng tạo từ những kiểu kết hợp có thể là không giới hạn</description>
- <description lang="zh_CN">这是一个非常迷人的粒子效果屏幕保护程序。你会发现你能看到惊人数量的不同图案。</description>
- <description lang="zh_TW">這是一個非常令人著迷的粒子效果螢幕保護程式。您會發現可以達到一個另人驚豔的圖形數。</description>
- <platform>linux osx</platform>
- </extension>
-</addon>
diff --git a/addons/screensaver.rsxs.solarwinds/icon.png b/addons/screensaver.rsxs.solarwinds/icon.png
deleted file mode 100644
index 1f58003607..0000000000
--- a/addons/screensaver.rsxs.solarwinds/icon.png
+++ /dev/null
Binary files differ
diff --git a/bootstrap.mk b/bootstrap.mk
index 56488b82da..7bb79c5cce 100644
--- a/bootstrap.mk
+++ b/bootstrap.mk
@@ -1,5 +1,4 @@
BOOTSTRAP_SUBDIRS += configure.ac
-BOOTSTRAP_SUBDIRS += xbmc/screensavers/rsxs-0.9/configure.ac
BOOTSTRAP_SUBDIRS += xbmc/visualizations/Goom/goom2k4-0/configure.ac
BOOTSTRAP_SUBDIRS += lib/cpluff/configure.ac
BOOTSTRAP_SUBDIRS += lib/gtest/configure.ac
diff --git a/configure.ac b/configure.ac
index c694e8ae31..6470cd8f24 100644
--- a/configure.ac
+++ b/configure.ac
@@ -178,8 +178,6 @@ goom_enabled="== GOOM enabled. =="
goom_disabled="== GOOM disabled. =="
alsa_disabled="== ALSA support disabled. =="
dbus_disabled="== DBUS support disabled. =="
-rsxs_enabled="== RSXS enabled. =="
-rsxs_disabled="== RSXS disabled. =="
fishbmc_enabled="== FishBMC enabled. =="
fishbmc_disabled="== FishBMC disabled. =="
projectm_enabled="== ProjectM enabled. =="
@@ -334,12 +332,6 @@ AC_ARG_ENABLE([goom],
[use_goom=$enableval],
[use_goom=no])
-AC_ARG_ENABLE([rsxs],
- [AS_HELP_STRING([--enable-rsxs],
- [enable really slick X screensavers (default is yes)])],
- [use_rsxs=$enableval],
- [use_rsxs=yes])
-
AC_ARG_ENABLE([fishbmc],
[AS_HELP_STRING([--enable-fishbmc],
[enable FishBMC visualisation (default is yes)])],
@@ -1473,24 +1465,6 @@ else
DISABLE_GOOM=1
fi
-# RSXS
-if test "$use_rsxs" = "no" || test "$use_gl" = "no"; then
- AC_MSG_NOTICE($rsxs_disabled)
- DISABLE_RSXS=1
-else
- AC_MSG_NOTICE($rsxs_enabled)
- DISABLE_RSXS=0
- # darwin osx can do rsxs but does not use x11, so do not pkg-config check for them
- if test "$host_vendor" != "apple" ; then
- PKG_CHECK_MODULES([XT], [xt],
- [INCLUDES="$INCLUDES $XT_CFLAGS"; LIBS="$LIBS $XT_LIBS"],
- AC_MSG_ERROR($missing_library))
- PKG_CHECK_MODULES([XMU], [xmu],
- [INCLUDES="$INCLUDES $XMU_CFLAGS"; LIBS="$LIBS $XMU_LIBS"],
- AC_MSG_ERROR($missing_library))
- fi
-fi
-
# FISHBMC
if test "$use_fishbmc" = "no" || test "$use_gl" = "no"; then
AC_MSG_NOTICE($fishbmc_disabled)
@@ -2154,12 +2128,6 @@ else
final_message="$final_message\n GOOM:\t\tNo"
fi
-if test "$use_rsxs" = "yes"; then
- final_message="$final_message\n RSXS:\t\tYes"
-else
- final_message="$final_message\n RSXS:\t\tNo"
-fi
-
if test "$use_fishbmc" = "yes"; then
final_message="$final_message\n FishBMC:\tYes"
else
@@ -2515,7 +2483,6 @@ OUTPUT_FILES="Makefile \
xbmc/freebsd/Makefile \
xbmc/linux/Makefile \
xbmc/filesystem/Makefile \
- xbmc/screensavers/rsxs-0.9/xbmc/Makefile \
xbmc/visualizations/XBMCProjectM/Makefile \
xbmc/visualizations/Goom/Makefile \
xbmc/visualizations/OpenGLSpectrum/Makefile \
@@ -2626,7 +2593,6 @@ AC_SUBST(BUILD_DVDCSS)
AC_SUBST(DISABLE_WAVEFORM)
AC_SUBST(DISABLE_SPECTRUM)
AC_SUBST(DISABLE_GOOM)
-AC_SUBST(DISABLE_RSXS)
AC_SUBST(DISABLE_FISHBMC)
AC_SUBST(DISABLE_PROJECTM)
AC_SUBST(FFMPEG_LIBDIR)
@@ -2809,43 +2775,6 @@ XB_CONFIG_MODULE([xbmc/visualizations/Goom/goom2k4-0],[
--with-pic
], [$DISABLE_GOOM])
-XB_CONFIG_MODULE([xbmc/screensavers/rsxs-0.9/], [
- if test "$host_vendor" = "apple"; then
- # clang treats inlines different
- case $CC in
- *clang*)
- TEMPCFLAGS="$CFLAGS";;
- *)
- TEMPCFLAGS="${CFLAGS} -fgnu89-inline";;
- esac
- else
- TEMPCFLAGS="$CFLAGS";
- fi
- ./configure \
- CC="$CC" \
- CXX="$CXX" \
- CFLAGS="$TEMPCFLAGS" \
- CXXFLAGS="$CXXFLAGS" \
- `if test "$host_vendor" = "apple"; then echo --with-png=${prefix} --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib; fi` \
- --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
- --host=$host_alias \
- --build=$build_alias \
- --target=$target_alias \
- --without-xscreensaver \
- --disable-sound \
- --disable-cyclone \
- --disable-fieldlines \
- --disable-flocks \
- --disable-flux \
- --disable-helios \
- --disable-hyperspace \
- --disable-lattice \
- --disable-skyrocket
- if echo "$ARCH" | grep -q freebsd ; then
- sed -i.back "s;\(STDBOOL_H = \)stdbool.h;\1;" lib/Makefile
- fi
-], [$DISABLE_RSXS])
-
XB_CONFIG_MODULE([lib/cpluff], [
./configure --disable-nls \
--prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
diff --git a/xbmc/screensavers/rsxs-0.9/AUTHORS b/xbmc/screensavers/rsxs-0.9/AUTHORS
deleted file mode 100644
index 07051e3eef..0000000000
--- a/xbmc/screensavers/rsxs-0.9/AUTHORS
+++ /dev/null
@@ -1,7 +0,0 @@
-Original (Windows) Version
---------------------------
-Terry Welsh -- http://www.reallyslick.com/
-
-XScreenSaver Port
------------------
-Michael Chapman <foonly@users.sourceforge.net>
diff --git a/xbmc/screensavers/rsxs-0.9/COPYING b/xbmc/screensavers/rsxs-0.9/COPYING
deleted file mode 100644
index d60c31a97a..0000000000
--- a/xbmc/screensavers/rsxs-0.9/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/xbmc/screensavers/rsxs-0.9/ChangeLog b/xbmc/screensavers/rsxs-0.9/ChangeLog
deleted file mode 100644
index d004396275..0000000000
--- a/xbmc/screensavers/rsxs-0.9/ChangeLog
+++ /dev/null
@@ -1,48 +0,0 @@
-* Sat Jul 15 2005 Michael Chapman <foonly@users.sourceforge.net> 0.9-1
-- fixed skyrocket memory allocation
-- fixed xscreensaver config files
-- added hyperspace screensaver
-- package overhaul; it now actually builds on modern OSs!
-- added libltdl so sound can be dynamically loaded; this simplifies
- the RPM packaging considerably
-
-* Fri Jul 11 2003 Michael Chapman <foonly@users.sourceforge.net> 0.8-1
-- major package restructure
-- added skyrocket screensaver
-
-* Wed Dec 11 2002 Michael Chapman <foonly@users.sourceforge.net> 0.7-1
-- added flocks screensaver
-- added flux screensaver
-- added solarwinds screensaver
-- cleaned up command-line argument handling
-- added support for pre-4.0 versions of xscreensaver
-
-* Sat Dec 07 2002 Michael Chapman <foonly@users.sourceforge.net> 0.6-1
-- added lattice screensaver
-- converted textures to PNG format
-- small Makefile fix to build correctly on Gentoo
-
-* Tue Nov 28 2002 Michael Chapman <foonly@users.sourceforge.net> 0.5-1
-- added euphoria screensaver
-- fixed bug in timing delay
-- removed unnecessary #include <ios>
-
-* Tue Nov 27 2002 Michael Chapman <foonly@users.sourceforge.net> 0.4-2
-- fixed uninstall script -- should upgrade properly now
-- fixed bug in timing delay
-
-* Tue Nov 26 2002 Michael Chapman <mchapman@student.usyd.edu.au> 0.4-1
-- added helios screensaver
-- expanded screensaver descriptions
-- removed unnecessary labels
-
-* Mon Nov 19 2002 Michael Chapman <mchapman@student.usyd.edu.au> 0.3-1
-- added fieldlines screensaver
-- fixed bug in this changelog (!)
-- fixed bug in uninstall and verify scripts
-
-* Mon Nov 18 2002 Michael Chapman <mchapman@student.usyd.edu.au> 0.2-1
-- added cyclone screensaver
-
-* Tue Nov 12 2002 Michael Chapman <mchapman@student.usyd.edu.au> 0.1-1
-- initial version
diff --git a/xbmc/screensavers/rsxs-0.9/Makefile.am b/xbmc/screensavers/rsxs-0.9/Makefile.am
deleted file mode 100644
index ace21698f5..0000000000
--- a/xbmc/screensavers/rsxs-0.9/Makefile.am
+++ /dev/null
@@ -1,49 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-SUBDIRS = lib libltdl src config
-EXTRA_DIST = scripts THANKS
-DISTCHECK_CONFIGURE_FLAGS = --without-xscreensaver
-ACLOCAL_AMFLAGS = -I m4
-
-AM_ETAGSFLAGS = --extra=fq
-
-dist_noinst_DATA = rsxs.spec
-rsxs.spec: ChangeLog scripts/install.awk scripts/install.awk scripts/verify.awk
-
-rpm: dist
- rpmbuild -ta $(PACKAGE)-$(VERSION).tar.gz
-
-mock: dist
- TOPDIR="`rpm -E %_topdir`" || exit 1 && \
- rpmbuild --define='fedora 4' --define='dist .fc4' --nodeps -ts $(PACKAGE)-$(VERSION).tar.gz && \
- mockbuild -r fedora-4-i386-core.cfg --debug "$$TOPDIR/SRPMS/$(PACKAGE)-$(VERSION)-$(RELEASE).fc4.src.rpm" && \
- rpmbuild --define='fedora 5' --define='dist .fc5' --nodeps -ts $(PACKAGE)-$(VERSION).tar.gz && \
- mockbuild -r fedora-5-i386-core.cfg --debug "$$TOPDIR/SRPMS/$(PACKAGE)-$(VERSION)-$(RELEASE).fc5.src.rpm"
-
-if HACKMODE
-install-data-hook:
- @$(NORMAL_INSTALL)
- if test -f $(defaultdir)/XScreenSaver; then \
- TMPFILE=`mktemp /tmp/$$$$.XXXXXX` || exit 1 && \
- trap "rm -f $$TMPFILE" 0 && \
- $(AWK) -v 'skip=@DISABLED_HACKS@' -f $(srcdir)/scripts/install.awk < $(defaultdir)/XScreenSaver > $$TMPFILE && \
- $(mkinstalldirs) $(DESTDIR)$(defaultdir) && \
- $(SHELL) $(install_sh_DATA) $$TMPFILE $(DESTDIR)$(defaultdir)/XScreenSaver; \
- fi
-
-uninstall-hook:
- @$(NORMAL_UNINSTALL)
- if test -f $(defaultdir)/XScreenSaver; then \
- TMPFILE=`mktemp /tmp/$$$$.XXXXXX` || exit 1 && \
- trap "rm -f $$TMPFILE" 0 && \
- $(AWK) -v 'skip=@DISABLED_HACKS@' -f $(srcdir)/scripts/uninstall.awk < $(defaultdir)/XScreenSaver > $$TMPFILE && \
- $(mkinstalldirs) $(DESTDIR)$(defaultdir) && \
- $(SHELL) $(install_sh_DATA) $$TMPFILE $(defaultdir)/XScreenSaver; \
- fi
-
-else !HACKMODE
-install-data-hook:
-
-uninstall-hook:
-
-endif !HACKMODE
diff --git a/xbmc/screensavers/rsxs-0.9/NEWS b/xbmc/screensavers/rsxs-0.9/NEWS
deleted file mode 100644
index dd1ca8c91f..0000000000
--- a/xbmc/screensavers/rsxs-0.9/NEWS
+++ /dev/null
@@ -1 +0,0 @@
-Please see the ChangeLog file for more information.
diff --git a/xbmc/screensavers/rsxs-0.9/README b/xbmc/screensavers/rsxs-0.9/README
deleted file mode 100644
index 8c9beaf16e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/README
+++ /dev/null
@@ -1,131 +0,0 @@
-Really Slick XScreenSavers
-==========================
-
-1. Description
---------------
-
-Really Slick XScreenSavers (rsxs) is an X11 port of the Really Slick
-Screensavers collection by Terry Welsh (http://www.reallyslick.com/).
-
-This collection of screensavers is designed to integrate with Jamie Zawinski's
-XScreenSaver package. Alternatively, the screensavers can be run as
-stand-alone applications.
-
-rsxs contains the following eye-candy:
-
-* rs-cyclone: Tornadoes on your monitor.
-* rs-euphoria: Don't look at this if you suffer from motion sickness!
-* rs-fieldlines: A simulation of the electric field lines between charged
- particles.
-* rs-flocks: 3D swarms of colorful bugs.
-* rs-flux: A particle system based on strange attractor equations.
-* rs-helios: Exploding particles and smooth Helion surfaces.
-* rs-hyperspace: Soar through wormholes in liquid spacetime.
-* rs-lattice: Fly through an infinite lattice of interlocking rings.
-* rs-plasma: Psychadelic gooey plasma goodness.
-* rs-skyrocket: The mother of all fireworks screensavers.
-* rs-solarwinds: A mesmerising color and movement particle effect.
-
-2. Requirements
----------------
-
-To build rsxs you will need:
-
-* A C++ compiler and standard C++ library (including STL).
-
-* An accelerated graphics card.
-
-* An X server with GLX extensions. To test for this, run `xdpyinfo' and look
- for GLX in the list of extensions.
-
- You will also want direct rendering enabled, otherwise the screensavers will
- run _extremely_ slowly. To find out if this is enabled, use `glxinfo' (it
- should say "direct rendering: Yes".)
-
-* X development headers and libraries. If you've got them, `configure' should
- find them.
-
-* OpenGL development headers and libraries. The names of these vary from
- system to system. If `configure' doesn't find them, please email me with your
- system type and the correct names via the bug-reporting address below.
-
-rsxs also has the following _optional_ requirements:
-
-* XScreenSaver -- preferably version 4, though it should work fine on earlier
- versions. `configure' will try to determine the correct paths to install
- files. If XScreenSaver isn't found, the screensavers will simply be installed
- in the standard binary directory (usually /usr/local/bin), just like any
- other program.
-
-* libpng development headers and libraries. `configure' should have no trouble
- finding these if you've got them, as the filenames are standardised.
-
- If you do not have libpng (or choose to disable it through a `configure'
- option), the screensavers that load textures at run-time will not be built
- or installed.
-
-* OpenAL development headers and libraries. Only one screensaver (rs-skyrocket)
- has a dependency on these; if they are missing then sound will be disabled.
- OpenAL can be obtained from http://www.openal.org.
-
-* libvorbisfile development headers and libraries. The rs-skyrocket
- screensaver, when built with OpenAL sound support, requires this to load
- OGG audio files. Again, if these are not available then sound will be
- disabled.
-
- libvorbisfile is part of the OGG Vorbis libraries, available at
- http://www.xiph.org.
-
-3. Installation
----------------
-
-In general, the standard
-
-$ ./configure
-$ make
- <switch to root>
-# make install
-
-will do what you want. To get any currently running xscreensaver daemon to
-see the new screensavers you will need to restart it:
-
-$ xscreensaver-command -restart
-
-The configure script accepts a large range of command-line options. These are
-described in the accompanying INSTALL document -- please read this if you wish
-to disable specific screensavers or disable one of the optional packages
-described above.
-
-4. Usage
---------
-
-Each of the rs-* screensavers can be run independently. Providing no arguments
-will run them with default parameters in a window. Each screensaver can also
-accept the following arguments:
-
- --root Draw on the root window
- --geometry GEOM Draw on a window of the specified geometry
- (WxH+X+Y)
- --fullscreen Draw on a maximized window
-
-For more information on the parameters an rsxs screensaver takes, run it with
-the --help option.
-
-5. Bugs
--------
-
-Probably. Please mail reports to <foonly@users.sourceforge.net> and include:
-
-* What the bug does
-* What you did to make the bug appear
-* Whether it is reproducable or not
-
-If the program dumped a core file, please also include a backtrace.
-
-6. Legal Stuff
---------------
-
-rsxs is released under the terms and conditions of the GNU General Public
-License version 2. Please read the COPYING file carefully.
-
--- Michael Chapman <foonly@users.sourceforge.net>
diff --git a/xbmc/screensavers/rsxs-0.9/README.xbmc b/xbmc/screensavers/rsxs-0.9/README.xbmc
deleted file mode 100644
index 6ced1693ce..0000000000
--- a/xbmc/screensavers/rsxs-0.9/README.xbmc
+++ /dev/null
@@ -1,10 +0,0 @@
-Run configure:
-
-1. compile the stuff
-sudo apt-get install libxt-dev libxmu-dev
-./configure --without-xscreensaver --disable-sound
-make
-
-2. create the shared library for each screensaver. for example to create plasma:
-cd src/plasma
-make -f Makefile.xbmc
diff --git a/xbmc/screensavers/rsxs-0.9/THANKS b/xbmc/screensavers/rsxs-0.9/THANKS
deleted file mode 100644
index 16adf2ca94..0000000000
--- a/xbmc/screensavers/rsxs-0.9/THANKS
+++ /dev/null
@@ -1,12 +0,0 @@
-Many thanks to (in no special order):
-
-* Terry Welsh, for writing the screensavers in the first place. And releasing
- the source!
-* Jeff Gibson, for pointing out an incompatibility with older versions of g++.
-* Bret Towe, for a useful Makefile patch.
-* Ari Pollak, for packaging rsxs for Debian.
-* Phillip Pi, for suggesting the configure script should let the user choose
- the screensavers to install.
-* Florian Thiel, for testing with g++ 2.95 and finding some bugs.
-
-... and to everyone that's downloaded and tried this package out!
diff --git a/xbmc/screensavers/rsxs-0.9/acinclude.m4 b/xbmc/screensavers/rsxs-0.9/acinclude.m4
deleted file mode 100644
index 013ac77b93..0000000000
--- a/xbmc/screensavers/rsxs-0.9/acinclude.m4
+++ /dev/null
@@ -1,783 +0,0 @@
-AC_DEFUN([_MAC_SAVE], [
- for mac_i in [$1]; do
- eval "mac_save_$mac_i=\$$mac_i"
- done
-$2
- for mac_i in $1; do
- eval "$mac_i=\$mac_save_$mac_i"
- done
-])
-
-dnl Based on AC_CXX_BOOL ver 1.2 by Todd Veldhuizen and Luc Maisonobe
-AC_DEFUN([MAC_CXX_BOOL], [
- AC_CACHE_CHECK(
- [whether the compiler recognizes bool as a built-in type],
- mac_cv_cxx_bool, [
- AC_LANG_PUSH(C++)dnl
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-int f(int x){return 1;}
-int f(char x){return 1;}
-int f(bool x){return 1;}
- ], [
-bool b = true; return f(b);
- ])], [mac_cv_cxx_bool=yes], [mac_cv_cxx_bool=no])
- AC_LANG_POP(C++)dnl
- ]
- )
- HAVE_CXX_BOOL=$mac_cv_cxx_bool
- if test "$HAVE_CXX_BOOL" = yes; then
- AC_DEFINE(HAVE_CXX_BOOL, 1, [Define to 1 if bool is a built-in type.])dnl
- fi
-])
-
-dnl Based on AC_CXX_NEW_FOR_SCOPING ver 1.2 by Todd Veldhuizen and Luc Maisonobe
-AC_DEFUN([MAC_CXX_NEW_FOR_SCOPING], [
- AC_CACHE_CHECK([whether the compiler accepts the new for scoping rules],
- mac_cv_cxx_new_for_scoping, [
- AC_LANG_PUSH(C++)dnl
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
-int z = 0;
-for (int i = 0; i < 10; ++i)
- z = z + i;
-for (int i = 0; i < 10; ++i)
- z = z - i;
-return z;
- ])], [mac_cv_cxx_new_for_scoping=yes], [mac_cv_cxx_new_for_scoping=no])
- AC_LANG_POP(C++)dnl
- ]
- )
- HAVE_CXX_NEW_FOR_SCOPING=$mac_cv_cxx_new_for_scoping
- if test "$HAVE_CXX_NEW_FOR_SCOPING" = yes; then
- AC_DEFINE(HAVE_CXX_NEW_FOR_SCOPING, 1,
- [Define to 1 if the compiler accepts the new for scoping rules.])dnl
- fi
-])
-
-dnl Based on AC_CXX_NAMESPACES ver 1.2 by Todd Veldhuizen and Luc Maisonobe
-AC_DEFUN([MAC_CXX_NAMESPACES], [
- AC_CACHE_CHECK([whether the compiler implements namespaces],
- mac_cv_cxx_namespaces, [
- AC_LANG_PUSH(C++)dnl
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-namespace Outer { namespace Inner { int i = 0; }}
- ], [
-using namespace Outer::Inner; return i;
- ])], [mac_cv_cxx_namespaces=yes], [mac_cv_cxx_namespaces=no])
- AC_LANG_POP(C++)dnl
- ]
- )
- HAVE_CXX_NAMESPACES=$mac_cv_cxx_namespaces
- if test "$HAVE_CXX_NAMESPACES" = yes; then
- AC_DEFINE(HAVE_CXX_NAMESPACES, 1,
- [Define to 1 if the compiler implements namespaces.])dnl
- fi
-])
-
-dnl Based on AC_CXX_HAVE_STD ver 1.2 by Todd Veldhuizen and Luc Maisonobe
-AC_DEFUN([MAC_CXX_STD], [
- AC_REQUIRE([MAC_CXX_NAMESPACES])dnl
- AC_CACHE_CHECK([whether the compiler supports ISO C++ standard library],
- mac_cv_cxx_std, [
- AC_LANG_PUSH(C++)dnl
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-@%:@include <iostream>
-@%:@include <map>
-@%:@include <iomanip>
-@%:@include <cmath>
-@%:@ifdef HAVE_CXX_NAMESPACES
-using namespace std;
-@%:@endif
- ], [return 0;])], [mac_cv_cxx_std=yes], [mac_cv_cxx_std=no])
- AC_LANG_POP(C++)dnl
- ]
- )
- HAVE_CXX_STD=$mac_cv_cxx_std
- if test "$HAVE_CXX_STD" = yes; then
- AC_DEFINE(HAVE_CXX_STD, 1,
- [Define to 1 if the compiler supports ISO C++ standard library.])dnl
- fi
-])
-
-AC_DEFUN([MAC_CXX_SSTREAM], [
- AC_REQUIRE([MAC_CXX_STD])dnl
- AC_CACHE_CHECK([whether the C++ standard library uses stringstream or strstream],
- mac_cv_cxx_sstream, [
- AC_LANG_PUSH(C++)dnl
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-@%:@include <sstream>
-@%:@ifdef HAVE_CXX_NAMESPACES
-using namespace std;
-@%:@endif
- ], [
-istringstream iss("");
-ostringstream oss();
-stringstream ss();
- ])], [mac_cv_cxx_sstream=stringstream], [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-@%:@include <strstream>
-@%:@ifdef HAVE_CXX_NAMESPACES
-using namespace std;
-@%:@endif
- ], [
-istrstream iss("");
-ostrstream oss();
-strstream ss();
- ])], [mac_cv_cxx_sstream=strstream], [
- mac_cv_cxx_sstream=unknown
- ])
- ])
- AC_LANG_POP(C++)dnl
- ]
- )
- case "$mac_cv_cxx_sstream" in
- stringstream)
- AC_DEFINE(HAVE_CXX_STRINGSTREAM, 1,
- [Define to 1 if the C++ standard library uses stringstream.])dnl
- ;;
- strstream)
- AC_DEFINE(HAVE_CXX_STRSTREAM, 1,
- [Define to 1 if the C++ standard library uses strstream.])dnl
- ;;
- *)
- AC_MSG_ERROR([can't compile without either stringstream or strstream])
- ;;
- esac
-])
-
-AC_DEFUN([MAC_PKG_X], [
- AC_REQUIRE([AC_PATH_XTRA])dnl
- if test "$no_x" = yes; then
- AC_MSG_ERROR([can't compile without X])
- fi
- AC_CHECK_LIB(Xmu, XmuLookupStandardColormap, [
- X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXmu $X_EXTRA_LIBS"
- ], [
- X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
- ], [$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS])dnl
- X_CPPFLAGS="$X_CFLAGS"
- X_CFLAGS=
- _MAC_SAVE([CPPFLAGS], [
- CPPFLAGS="$CPPFLAGS $X_CPPFLAGS"
- AC_CHECK_HEADERS([X11/Xlib.h], , , [#])
- ])
-])
-
-AC_DEFUN([MAC_PKG_XSCREENSAVER], [
- AC_REQUIRE([MAC_PKG_X])dnl
-
- PKG_XSCREENSAVER_SYMLINKS=yes
-
- AC_ARG_WITH(xscreensaver,
- AC_HELP_STRING([--without-xscreensaver], [do not integrate with XScreenSaver]))dnl
- case "$with_xscreensaver" in
- nosymlinks)
- with_xscreensaver=
- PKG_XSCREENSAVER_SYMLINKS=no
- ;;
- yes)
- with_xscreensaver=force
- ;;
- no)
- ;;
- *)
- with_xscreensaver=yes
- ;;
- esac
-
- HAVE_PKG_XSCREENSAVER=no
- HAVE_PKG_XSCREENSAVER_4=no
- if test "$with_xscreensaver" != no; then
- PKG_XSCREENSAVER_DEFAULTDIR=
- AC_ARG_WITH(defaultdir,
- AC_HELP_STRING([--with-defaultdir],
- [where application defaults files are stored [[guessed]]]))dnl
- case "$with_defaultdir" in
- no)
- AC_MSG_ERROR([can't install as XScreenSaver hacks without a defaultdir])
- ;;
- yes | "")
- ;;
- *)
- PKG_XSCREENSAVER_DEFAULTDIR="$with_defaultdir"
- ;;
- esac
-
- PKG_XSCREENSAVER_HACKDIR=
- AC_ARG_WITH(hackdir,
- AC_HELP_STRING([--with-hackdir],
- [where XScreenSaver hacks are installed [[guessed]]]))dnl
- case "$with_hackdir" in
- no)
- AC_MSG_ERROR([can't install as XScreenSaver hacks without a hackdir])
- ;;
- yes | "")
- ;;
- *)
- PKG_XSCREENSAVER_HACKDIR="$with_hackdir"
- ;;
- esac
-
- PKG_XSCREENSAVER_CONFIGDIR=
- mac_xss_use_configdir=yes
- AC_ARG_WITH(configdir,
- AC_HELP_STRING([--with-configdir],
- [where XScreensaver config files are installed [[guessed]]]))dnl
- case "$with_configdir" in
- no)
- mac_xss_use_configdir=no
- ;;
- no | yes | "")
- ;;
- *)
- PKG_XSCREENSAVER_CONFIGDIR="$with_configdir"
- ;;
- esac
- fi
-
- if test "$with_xscreensaver" != no; then
- AC_MSG_CHECKING([for X11 application defaults directory])
- if test -z "$PKG_XSCREENSAVER_DEFAULTDIR"; then
- AC_CACHE_VAL(mac_cv_xss_defaultdir, [
- if test -d "$x_libraries/X11/app-defaults"; then
- mac_cv_xss_defaultdir="$x_libraries/X11/app-defaults"
- elif test -d /usr/share/X11/app-defaults; then
- mac_cv_xss_defaultdir=/usr/share/X11/app-defaults
- else
- mac_cv_xss_defaultdir=
- fi
- ])
- if test -z "$mac_cv_xss_defaultdir"; then
- AC_MSG_RESULT([not found])
- if test "$with_xscreensaver" = force; then
- AC_MSG_WARN([*** XScreenSaver support will be disabled ***])
- AC_MSG_WARN([*** (try using the --with-defaultdir=DIR option) ***])
- with_xscreensaver=no
- else
- AC_MSG_ERROR([try using the --with-defaultdir=DIR option])
- fi
- else
- PKG_XSCREENSAVER_DEFAULTDIR="$mac_cv_xss_defaultdir"
- AC_MSG_RESULT($PKG_XSCREENSAVER_DEFAULTDIR)
- fi
- else
- AC_MSG_RESULT($PKG_XSCREENSAVER_DEFAULTDIR)
- fi
- fi
-
- if test "$with_xscreensaver" != no; then
- AC_MSG_CHECKING([for XScreenSaver hacks directory])
- if test -z "$PKG_XSCREENSAVER_HACKDIR"; then
- AC_CACHE_VAL(mac_cv_xss_hackdir, [
- if test -d "$x_libraries/xscreensaver"; then
- mac_cv_xss_hackdir="$x_libraries/xscreensaver"
- elif test -d /usr/libexec/xscreensaver; then
- mac_cv_xss_hackdir=/usr/libexec/xscreensaver
- else
- mac_cv_xss_hackdir=
- fi
- ])dnl
- if test -z "$mac_cv_xss_hackdir"; then
- AC_MSG_RESULT([not found])
- if test "$with_xscreensaver" = force; then
- AC_MSG_WARN([*** XScreenSaver support will be disabled ***])
- AC_MSG_WARN([*** (try using the --with-hackdir=DIR option) ***])
- with_xscreensaver=no
- else
- AC_MSG_ERROR([try using the --with-hackdir=DIR option])
- fi
- else
- PKG_XSCREENSAVER_HACKDIR="$mac_cv_xss_hackdir"
- AC_MSG_RESULT($PKG_XSCREENSAVER_HACKDIR)
- fi
- else
- AC_MSG_RESULT($PKG_XSCREENSAVER_HACKDIR)
- fi
- fi
-
- if test "$with_xscreensaver" != no; then
- AC_MSG_CHECKING([for XScreenSaver config directory])
- if test -z "$PKG_XSCREENSAVER_CONFIGDIR"; then
- if test "$mac_xss_use_configdir" = yes; then
- AC_CACHE_VAL(mac_cv_xss_configdir, [
- if test -d "$PKG_XSCREENSAVER_HACKDIR/config"; then
- mac_cv_xss_configdir="$PKG_XSCREENSAVER_HACKDIR/config"
- elif test -d /usr/share/control-center/screensavers; then
- mac_cv_xss_configdir=/usr/share/control-center/screensavers
- elif test -d /usr/share/xscreensaver/config; then
- mac_cv_xss_configdir=/usr/share/xscreensaver/config
- else
- mac_cv_xss_configdir=
- fi
- ])
- if test -z "$mac_cv_xss_configdir"; then
- AC_MSG_RESULT([not found])
- AC_MSG_NOTICE([*** assuming pre-4.0 version of XScreenSaver ***])
- AC_MSG_NOTICE([*** (if this is wrong, try using the --with-configdir=DIR option) ***])
- mac_xss_use_configdir=no
- else
- AC_MSG_RESULT($mac_cv_xss_configdir)
- fi
- PKG_XSCREENSAVER_CONFIGDIR="$mac_cv_xss_configdir"
- else
- AC_MSG_RESULT(disabled)
- fi
- else
- AC_MSG_RESULT($PKG_XSCREENSAVER_CONFIGDIR)
- fi
- fi
-
- if test "$with_xscreensaver" != no; then
- if test "$mac_xss_use_configdir" = yes; then
- HAVE_PKG_XSCREENSAVER_4=yes
- fi
- HAVE_PKG_XSCREENSAVER=yes
- else
- PKG_XSCREENSAVER_DEFAULTDIR=
- PKG_XSCREENSAVER_HACKDIR="$bindir"
- PKG_XSCREENSAVER_CONFIGDIR=
- PKG_XSCREENSAVER_SYMLINKS=no
- fi
-])
-
-AC_DEFUN([MAC_PKG_OPENGL], [
- AC_REQUIRE([MAC_PKG_X])
-
- _MAC_SAVE([LIBS], [
- HAVE_PKG_OPENGL=yes
- AC_SEARCH_LIBS(glXChooseVisual, [MesaGL GL GLX],
- [], [HAVE_PKG_OPENGL=no], [[$X_LIBS]])dnl
- AC_SEARCH_LIBS(gluErrorString, [MesaGLU GL GLU],
- [], [HAVE_PKG_OPENGL=no], [[$X_LIBS]])dnl
- OPENGL_LIBS="$LIBS"
- _MAC_SAVE([CPPFLAGS], [
- CPPFLAGS="$CPPFLAGS $X_CPPFLAGS"
- AC_CHECK_HEADERS([GL/gl.h], , , [#])
- AC_CHECK_HEADERS([GL/glext.h GL/glu.h GL/glx.h], , , [
-@%:@if HAVE_GL_GL_H
-@%:@include <GL/gl.h>
-@%:@endif
- ])
- ])
- ])
-])
-
-AC_DEFUN([MAC_PKG_OPENAL], [
- AC_ARG_WITH(openal,
- AC_HELP_STRING([--with-openal=OPREFIX], [prefix to libopenal [[guessed]]]))dnl
- AC_ARG_WITH(openal-includes,
- AC_HELP_STRING([--with-openal-includes=DIR], [libopenal headers directory [[OPREFIX/include]]]))dnl
- AC_ARG_WITH(openal-libraries,
- AC_HELP_STRING([--with-openal-libraries=DIR], [libopenal libraries directory [[OPREFIX/lib]]]))dnl
-
- HAVE_PKG_OPENAL=no
- if test "$with_openal" != no; then
- OPENAL_CPPFLAGS=
- if test x"$with_openal_includes" != x; then
- OPENAL_CPPFLAGS="-I$with_openal_includes"
- elif test x"$with_openal" != x; then
- OPENAL_CPPFLAGS="-I$with_openal/include"
- fi
-
- OPENAL_LDFLAGS=
- if test x"$with_openal_libraries" != x; then
- OPENAL_LDFLAGS="-L$with_openal_libraries"
- elif test x"$with_openal" != x; then
- OPENAL_LDFLAGS="-L$with_openal/lib"
- fi
-
- OPENAL_LIBS=
- _MAC_SAVE([LIBS], [
- AC_SEARCH_LIBS(alcOpenDevice, [openal AL openAL],
- [HAVE_PKG_OPENAL=yes])dnl
- OPENAL_LIBS="$LIBS"
- ])
- fi
-])
-
-AC_DEFUN([MAC_PKG_VORBISFILE], [
- AC_ARG_WITH(vorbisfile,
- AC_HELP_STRING([--with-vorbisfile=VPREFIX], [prefix to libvorbisfile [[guessed]]]))dnl
- AC_ARG_WITH(vorbisfile-includes,
- AC_HELP_STRING([--with-vorbisfile-includes=DIR], [libvorbisfile headers directory [[VPREFIX/include]]]))dnl
- AC_ARG_WITH(vorbisfile-libraries,
- AC_HELP_STRING([--with-vorbisfile-libraries=DIR], [libvorbisfile libraries directory [[VPREFIX/lib]]]))dnl
-
- HAVE_PKG_VORBISFILE=no
- if test "$with_vorbisfile" != no; then
- VORBISFILE_CPPFLAGS=
- if test x"$with_vorbisfile_includes" != x; then
- VORBISFILE_CPPFLAGS="-I$with_vorbisfile_includes"
- elif test x"$with_vorbisfile" != x; then
- VORBISFILE_CPPFLAGS="-I$with_vorbisfile/include"
- fi
-
- VORBISFILE_LDFLAGS=
- if test x"$with_vorbisfile_libraries" != x; then
- VORBISFILE_LDFLAGS="-I$with_vorbisfile_libraries"
- elif test x"$with_vorbisfile" != x; then
- VORBISFILE_LDFLAGS="-I$with_vorbisfile/lib"
- fi
-
- VORBISFILE_LIBS=
- _MAC_SAVE([CPPFLAGS LDFLAGS LIBS], [
- CPPFLAGS="$CPPFLAGS $VORBISFILE_CPPFLAGS"
- LDFLAGS="$LDFLAGS $VORBISFILE_LDFLAGS"
- LIBS=
- AC_CHECK_LIB(vorbisfile, ov_open, [
- VORBISFILE_LIBS="-lvorbisfile"
- HAVE_PKG_VORBISFILE=yes
- ])dnl
- ])
- fi
-])
-
-AC_DEFUN([MAC_PKG_PNG], [
- AC_ARG_WITH(png,
- AC_HELP_STRING([--with-png=PPREFIX], [prefix to libpng [[guessed]]]))dnl
- AC_ARG_WITH(png-includes,
- AC_HELP_STRING([--with-png-includes=DIR], [libpng headers directory [[PPREFIX/include]]]))dnl
- AC_ARG_WITH(png-libraries,
- AC_HELP_STRING([--with-png-libraries=DIR], [libpng libraries directory [[PPREFIX/lib]]]))dnl
-
- HAVE_PKG_PNG=no
- LIBPNG_SUPPORTS_SETJMP=no
- if test "$with_png" != no; then
- PNG_CPPFLAGS=
- if test x"$with_png_includes" != x; then
- PNG_CPPFLAGS="-I$with_png_includes"
- elif test x"$with_png" != x; then
- PNG_CPPFLAGS="-I$with_png/include"
- fi
-
- PNG_LDFLAGS=
- if test x"$with_png_libraries" != x; then
- PNG_LDFLAGS="-L$with_png_libraries"
- elif test x"$with_png" != x; then
- PNG_LDFLAGS="-L$with_png/lib"
- fi
-
- PNG_LIBS=
-
- mac_libpng_config=libpng-config
- if test x"$with_png" != x; then
- mac_libpng_config="$with_png/bin/libpng-config"
- fi
- AC_CACHE_CHECK([for libpng-config], mac_cv_pkg_png, [
- AC_TRY_COMMAND([$mac_libpng_config --version >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD])
- mac_cv_pkg_png="not found"
- if test "$ac_status" = 0; then
- mac_cv_pkg_png="$mac_libpng_config"
- fi
- ])
- if test "$mac_cv_pkg_png" != "not found"; then
- AC_CACHE_CHECK([for libpng preprocessor flags], mac_cv_pkg_cppflags, [
- mac_cv_pkg_cppflags=`"$mac_libpng_config" --I_opts --cppflags 2>&AS_MESSAGE_LOG_FD`
- mac_cv_pkg_cppflags=`echo $mac_cv_pkg_cppflags`
- ])
- PNG_CPPFLAGS="$mac_cv_pkg_cppflags"
- AC_CACHE_CHECK([for libpng compiler flags], mac_cv_pkg_cxxflags, [
- mac_cv_pkg_cxxflags=`"$mac_libpng_config" --ccopts 2>&AS_MESSAGE_LOG_FD`
- mac_cv_pkg_cxxflags=`echo $mac_cv_pkg_cxxflags`
- ])
- PNG_CXXFLAGS="$mac_cv_pkg_cxxflags"
- AC_CACHE_CHECK([for libpng linker flags], mac_cv_pkg_ldflags, [
- mac_cv_pkg_ldflags=`"$mac_libpng_config" --L_opts --R_opts 2>&AS_MESSAGE_LOG_FD`
- mac_cv_pkg_ldflags=`echo $mac_cv_pkg_ldflags`
- ])
- PNG_LDFLAGS="$mac_cv_pkg_ldflags"
- AC_CACHE_CHECK([for libpng libraries], mac_cv_pkg_libs, [
- mac_cv_pkg_libs=`"$mac_libpng_config" --libs 2>&AS_MESSAGE_LOG_FD`
- mac_cv_pkg_libs=`echo $mac_cv_pkg_libs`
- ])
- PNG_LIBS="$mac_cv_pkg_libs"
- HAVE_PKG_PNG=yes
- fi
-
- if test "$HAVE_PKG_PNG" = no; then
- _MAC_SAVE([CPPFLAGS CXXFLAGS LDFLAGS LIBS], [
- CPPFLAGS="$CPPFLAGS $PNG_CPPFLAGS"
- CXXFLAGS="$CXXFLAGS $PNG_CXXFLAGS"
- LDFLAGS="$LDFLAGS $PNG_LDFLAGS"
- LIBS=
- AC_CHECK_LIB(png, png_access_version_number, [
- PNG_LIBS="-lpng"
- HAVE_PKG_PNG=yes
- ])dnl
- ])
- fi
-
- if test "$HAVE_PKG_PNG" = yes; then
- _MAC_SAVE([CPPFLAGS CXXFLAGS LDFLAGS LIBS], [
- CPPFLAGS="$CPPFLAGS $PNG_CPPFLAGS"
- CXXFLAGS="$CXXFLAGS $PNG_CXXFLAGS"
- LDFLAGS="$LDFLAGS $PNG_LDFLAGS"
- LIBS="$PNG_LIBS"
- AC_CHECK_HEADERS([png.h], [
- AC_CACHE_CHECK(
- [whether libpng supports setjmp],
- mac_cv_libpng_supports_setjmp, [
- AC_COMPILE_IFELSE([
-@%:@include <png.h>
-@%:@if !defined PNG_SETJMP_SUPPORTED
-@%:@error PNG_SETJMP_SUPPORTED not defined
-@%:@endif
- ], [mac_cv_libpng_supports_setjmp=yes], [mac_cv_libpng_supports_setjmp=no]
- )
- ]
- )
- ], [mac_cv_libpng_supports_setjmp=unknown], [#])
- LIBPNG_SUPPORTS_SETJMP=$mac_cv_libpng_supports_setjmp
- ])
- fi
- fi
-])
-
-AC_DEFUN([_MAC_HACK_ENABLE], [
- AC_ARG_ENABLE([$1],
- AS_HELP_STRING(--disable-[$1],do not build [$2] screensaver))dnl
- enable_hack=no
- if test "$enable_[$1]" != no; then
- enable_hack=yes
- enable_[$1]=yes
- [$3]
- fi
- AM_CONDITIONAL(BUILD_$4, test "$enable_hack" = yes)
- if test "$enable_hack" = yes; then
- ENABLED_HACKS="$ENABLED_HACKS [$1]"
- ENABLED_BINARIES="$ENABLED_BINARIES rs-[$1]$EXEEXT"
- ENABLED_CONFIGS="$ENABLED_CONFIGS rs-[$1].xml"
- else
- DISABLED_HACKS="$DISABLED_HACKS [$1]"
- fi
-])
-AC_DEFUN([MAC_HACK_ENABLE], [_MAC_HACK_ENABLE([$1],[$2],[$3],AS_TR_CPP([$1]))])
-
-dnl @synopsis adl_NORMALIZE_PATH(VARNAME, [REFERENCE_STRING])
-dnl
-dnl Perform some cleanups on the value of $VARNAME (interpreted as a path):
-dnl - empty paths are changed to '.'
-dnl - trailing slashes are removed
-dnl - repeated slashes are squeezed except a leading doubled slash '//'
-dnl (which might indicate a networked disk on some OS).
-dnl
-dnl REFERENCE_STRING is used to turn '/' into '\' and vice-versa:
-dnl if REFERENCE_STRING contains some backslashes, all slashes and backslashes
-dnl are turned into backslashes, otherwise they are all turned into slashes.
-dnl
-dnl This makes processing of DOS filenames quite easier, because you
-dnl can turn a filename to the Unix notation, make your processing, and
-dnl turn it back to original notation.
-dnl
-dnl filename='A:\FOO\\BAR\'
-dnl old_filename="$filename"
-dnl # Switch to the unix notation
-dnl adl_NORMALIZE_PATH([filename], ["/"])
-dnl # now we have $filename = 'A:/FOO/BAR' and we can process it as if
-dnl # it was a Unix path. For instance let's say that you want
-dnl # to append '/subpath':
-dnl filename="$filename/subpath"
-dnl # finally switch back to the original notation
-dnl adl_NORMALIZE_PATH([filename], ["$old_filename"])
-dnl # now $filename equals to 'A:\FOO\BAR\subpath'
-dnl
-dnl One good reason to make all path processing with the unix convention
-dnl is that backslashes have a special meaning in many cases. For instance
-dnl
-dnl expr 'A:\FOO' : 'A:\Foo'
-dnl
-dnl will return 0 because the second argument is a regex in which
-dnl backslashes have to be backslashed. In other words, to have the
-dnl two strings to match you should write this instead:
-dnl
-dnl expr 'A:\Foo' : 'A:\\Foo'
-dnl
-dnl Such behavior makes DOS filenames extremely unpleasant to work with.
-dnl So temporary turn your paths to the Unix notation, and revert
-dnl them to the original notation after the processing. See the
-dnl macro adl_COMPUTE_RELATIVE_PATHS for a concrete example of this.
-dnl
-dnl REFERENCE_STRING defaults to $VARIABLE, this means that slashes
-dnl will be converted to backslashes if $VARIABLE already contains
-dnl some backslashes (see $thirddir below).
-dnl
-dnl firstdir='/usr/local//share'
-dnl seconddir='C:\Program Files\\'
-dnl thirddir='C:\home/usr/'
-dnl adl_NORMALIZE_PATH([firstdir])
-dnl adl_NORMALIZE_PATH([seconddir])
-dnl adl_NORMALIZE_PATH([thirddir])
-dnl # $firstdir = '/usr/local/share'
-dnl # $seconddir = 'C:\Program Files'
-dnl # $thirddir = 'C:\home\usr'
-dnl
-dnl @author Alexandre Duret-Lutz <duret_g@epita.fr>
-dnl @version $Id: normpath.m4,v 1.1 2001/07/26 01:12 ac-archive-0.5.37 $
-AC_DEFUN([adl_NORMALIZE_PATH],
-[case ":[$]$1:" in
-# change empty paths to '.'
- ::) $1='.' ;;
-# strip trailing slashes
- :*[[\\/]]:) $1=`echo "[$]$1" | sed 's,[[\\/]]*[$],,'` ;;
- :*:) ;;
-esac
-# squeze repeated slashes
-case ifelse($2,,"[$]$1",$2) in
-# if the path contains any backslashes, turn slashes into backslashes
- *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
-# if the path contains slashes, also turn backslashes into slashes
- *) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1/,g'` ;;
-esac])
-
-dnl @synopsis adl_COMPUTE_RELATIVE_PATHS(PATH_LIST)
-dnl
-dnl PATH_LIST is a space-separated list of colon-separated
-dnl triplets of the form 'FROM:TO:RESULT'. This function
-dnl iterates over these triplets and set $RESULT to the
-dnl relative path from $FROM to $TO. Note that $FROM
-dnl and $TO needs to be absolute filenames for this macro
-dnl to success.
-dnl
-dnl For instance,
-dnl
-dnl first=/usr/local/bin
-dnl second=/usr/local/share
-dnl adl_COMPUTE_RELATIVE_PATHS([first:second:fs second:first:sf])
-dnl # $fs is set to ../share
-dnl # $sf is set to ../bin
-dnl
-dnl $FROM and $TO are both eval'ed recursively and normalized,
-dnl this means that you can call this macro with autoconf's dirnames
-dnl like `prefix' or `datadir'. For example:
-dnl
-dnl adl_COMPUTE_RELATIVE_PATHS([bindir:datadir:bin_to_data])
-dnl
-dnl adl_COMPUTE_RELATIVE_PATHS should also works with DOS filenames.
-dnl
-dnl You may want to use this macro in order to make your package
-dnl relocatable. Instead of hardcoding $datadir into your programs
-dnl just encode $bin_to_data and try to determine $bindir at run-time.
-dnl
-dnl This macro requires adl_NORMALIZE_PATH.
-dnl
-dnl @author Alexandre Duret-Lutz <duret_g@epita.fr>
-dnl @version $Id: relpaths.m4,v 1.1 2001/07/26 01:12 ac-archive-0.5.37 $
-AC_DEFUN([adl_COMPUTE_RELATIVE_PATHS],
-[for _lcl_i in $1; do
- _lcl_from=\[$]`echo "[$]_lcl_i" | sed 's,:.*$,,'`
- _lcl_to=\[$]`echo "[$]_lcl_i" | sed 's,^[[^:]]*:,,' | sed 's,:[[^:]]*$,,'`
- _lcl_result_var=`echo "[$]_lcl_i" | sed 's,^.*:,,'`
- adl_RECURSIVE_EVAL([[$]_lcl_from], [_lcl_from])
- adl_RECURSIVE_EVAL([[$]_lcl_to], [_lcl_to])
- _lcl_notation="$_lcl_from$_lcl_to"
- adl_NORMALIZE_PATH([_lcl_from],['/'])
- adl_NORMALIZE_PATH([_lcl_to],['/'])
- adl_COMPUTE_RELATIVE_PATH([_lcl_from], [_lcl_to], [_lcl_result_tmp])
- adl_NORMALIZE_PATH([_lcl_result_tmp],["[$]_lcl_notation"])
- eval $_lcl_result_var='[$]_lcl_result_tmp'
-done])
-
-## Note:
-## *****
-## The following helper macros are too fragile to be used out
-## of adl_COMPUTE_RELATIVE_PATHS (mainly because they assume that
-## paths are normalized), that's why I'm keeping them in the same file.
-## Still, some of them maybe worth to reuse.
-
-dnl adl_COMPUTE_RELATIVE_PATH(FROM, TO, RESULT)
-dnl ===========================================
-dnl Compute the relative path to go from $FROM to $TO and set the value
-dnl of $RESULT to that value. This function work on raw filenames
-dnl (for instead it will considerate /usr//local and /usr/local as
-dnl two distinct paths), you should really use adl_COMPUTE_REALTIVE_PATHS
-dnl instead to have the paths sanitized automatically.
-dnl
-dnl For instance:
-dnl first_dir=/somewhere/on/my/disk/bin
-dnl second_dir=/somewhere/on/another/disk/share
-dnl adl_COMPUTE_RELATIVE_PATH(first_dir, second_dir, first_to_second)
-dnl will set $first_to_second to '../../../another/disk/share'.
-AC_DEFUN([adl_COMPUTE_RELATIVE_PATH],
-[adl_COMPUTE_COMMON_PATH([$1], [$2], [_lcl_common_prefix])
-adl_COMPUTE_BACK_PATH([$1], [_lcl_common_prefix], [_lcl_first_rel])
-adl_COMPUTE_SUFFIX_PATH([$2], [_lcl_common_prefix], [_lcl_second_suffix])
-$3="[$]_lcl_first_rel[$]_lcl_second_suffix"])
-
-dnl adl_COMPUTE_COMMON_PATH(LEFT, RIGHT, RESULT)
-dnl ============================================
-dnl Compute the common path to $LEFT and $RIGHT and set the result to $RESULT.
-dnl
-dnl For instance:
-dnl first_path=/somewhere/on/my/disk/bin
-dnl second_path=/somewhere/on/another/disk/share
-dnl adl_COMPUTE_COMMON_PATH(first_path, second_path, common_path)
-dnl will set $common_path to '/somewhere/on'.
-AC_DEFUN([adl_COMPUTE_COMMON_PATH],
-[$3=''
-_lcl_second_prefix_match=''
-while test "[$]_lcl_second_prefix_match" != 0; do
- _lcl_first_prefix=`expr "x[$]$1" : "x\([$]$3/*[[^/]]*\)"`
- _lcl_second_prefix_match=`expr "x[$]$2" : "x[$]_lcl_first_prefix"`
- if test "[$]_lcl_second_prefix_match" != 0; then
- if test "[$]_lcl_first_prefix" != "[$]$3"; then
- $3="[$]_lcl_first_prefix"
- else
- _lcl_second_prefix_match=0
- fi
- fi
-done])
-
-dnl adl_COMPUTE_SUFFIX_PATH(PATH, SUBPATH, RESULT)
-dnl ==============================================
-dnl Substrack $SUBPATH from $PATH, and set the resulting suffix
-dnl (or the empty string if $SUBPATH is not a subpath of $PATH)
-dnl to $RESULT.
-dnl
-dnl For instace:
-dnl first_path=/somewhere/on/my/disk/bin
-dnl second_path=/somewhere/on
-dnl adl_COMPUTE_SUFFIX_PATH(first_path, second_path, common_path)
-dnl will set $common_path to '/my/disk/bin'.
-AC_DEFUN([adl_COMPUTE_SUFFIX_PATH],
-[$3=`expr "x[$]$1" : "x[$]$2/*\(.*\)"`])
-
-dnl adl_COMPUTE_BACK_PATH(PATH, SUBPATH, RESULT)
-dnl ============================================
-dnl Compute the relative path to go from $PATH to $SUBPATH, knowing that
-dnl $SUBPATH is a subpath of $PATH (any other words, only repeated '../'
-dnl should be needed to move from $PATH to $SUBPATH) and set the value
-dnl of $RESULT to that value. If $SUBPATH is not a subpath of PATH,
-dnl set $RESULT to the empty string.
-dnl
-dnl For instance:
-dnl first_path=/somewhere/on/my/disk/bin
-dnl second_path=/somewhere/on
-dnl adl_COMPUTE_BACK_PATH(first_path, second_path, back_path)
-dnl will set $back_path to '../../../'.
-AC_DEFUN([adl_COMPUTE_BACK_PATH],
-[adl_COMPUTE_SUFFIX_PATH([$1], [$2], [_lcl_first_suffix])
-$3=''
-_lcl_tmp='xxx'
-while test "[$]_lcl_tmp" != ''; do
- _lcl_tmp=`expr "x[$]_lcl_first_suffix" : "x[[^/]]*/*\(.*\)"`
- if test "[$]_lcl_first_suffix" != ''; then
- _lcl_first_suffix="[$]_lcl_tmp"
- $3="../[$]$3"
- fi
-done])
-
-
-dnl adl_RECURSIVE_EVAL(VALUE, RESULT)
-dnl =================================
-dnl Interpolate the VALUE in loop until it doesn't change,
-dnl and set the result to $RESULT.
-dnl WARNING: It's easy to get an infinite loop with some unsane input.
-AC_DEFUN([adl_RECURSIVE_EVAL],
-[_lcl_receval="$1"
-$2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
- test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
- _lcl_receval_old=''
- while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do
- _lcl_receval_old="[$]_lcl_receval"
- eval _lcl_receval="\"[$]_lcl_receval\""
- done
- echo "[$]_lcl_receval")`])
diff --git a/xbmc/screensavers/rsxs-0.9/config/Makefile.am b/xbmc/screensavers/rsxs-0.9/config/Makefile.am
deleted file mode 100644
index 7554078557..0000000000
--- a/xbmc/screensavers/rsxs-0.9/config/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-XML = @ENABLED_CONFIGS@
-EXTRA_DIST = rs-plasma.xml rs-cyclone.xml rs-fieldlines.xml rs-helios.xml \
- rs-euphoria.xml rs-lattice.xml rs-flocks.xml rs-flux.xml \
- rs-solarwinds.xml rs-hyperspace.xml
-
-if HACKMODE
-if XSCREENSAVER4
-dist_config_DATA = $(XML)
-else !XSCREENSAVER4
-dist_noinst_DATA = $(XML)
-endif !XSCREENSAVER4
-else !HACKMODE
-dist_noinst_DATA = $(XML)
-endif !HACKMODE
diff --git a/xbmc/screensavers/rsxs-0.9/config/rs-cyclone.xml b/xbmc/screensavers/rsxs-0.9/config/rs-cyclone.xml
deleted file mode 100644
index 3c16cbced0..0000000000
--- a/xbmc/screensavers/rsxs-0.9/config/rs-cyclone.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<screensaver name="rs-cyclone" _label="Really Slick Cyclones">
- <command arg="-root" />
-
- <hgroup>
- <number id="cyclones"
- type="spinbutton"
- arg="-cyclones %"
- _label="Cyclones"
- low="1"
- high="10"
- default="1"
- />
- <number id="particles"
- type="spinbutton"
- arg="-particles %"
- _label="Particles"
- low="1"
- high="10000"
- default="200"
- />
- </hgroup>
- <number id="size"
- type="slider"
- arg="-size %"
- _label="Particle size"
- _low-label="Tiny"
- _high-label="Huge"
- low="1.0"
- high="100.0"
- default="7.0"
- />
- <boolean id="stretch"
- _label="Stretch particles"
- arg-unset="-no-stretch"
- />
- <number id="complexity"
- type="slider"
- arg="-complexity %"
- _label="Motion"
- _low-label="Straight"
- _high-label="Curvy"
- low="1"
- high="10"
- default="3"
- />
- <number id="speed"
- type="slider"
- arg="-speed %"
- _low-label="Slow"
- _high-label="Fast"
- low="1.0"
- high="100.0"
- default="10.0"
- />
- <boolean id="curves"
- _label="Show curves"
- arg-set="-curves"
- />
- <select id="hemisphere">
- <option id="south"
- _label="Southern Hemisphere"
- arg-set="-south"
- />
- <option id="north"
- _label="Northern Hemisphere"
- />
- </select>
-
- <_description>
-This screen saver is dedicated to my storm chasing partner Andy. We like to go
-out on the road and get pummeled by Mother Nature. This saver brings a little
-of her action to your screen.
- -- Terry Welsh, Really Slick Screensavers (http://www.reallyslick.com/)
-
-This version by Michael Chapman &lt;foonly@users.sourceforge.net&gt;.
- </_description>
-</screensaver>
diff --git a/xbmc/screensavers/rsxs-0.9/config/rs-euphoria.xml b/xbmc/screensavers/rsxs-0.9/config/rs-euphoria.xml
deleted file mode 100644
index 28aec2fd84..0000000000
--- a/xbmc/screensavers/rsxs-0.9/config/rs-euphoria.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<screensaver name="rs-euphoria" _label="Really Slick Euphoria">
- <command arg="-root" />
-
- <number id="wisps"
- type="slider"
- arg="-wisps %"
- _label="Wisps"
- _low-label="Few"
- _high-label="Lots"
- low="0"
- high="100"
- default="5"
- />
- <number id="layers"
- type="slider"
- arg="-background %"
- _label="Background layers"
- _low-label="Few"
- _high-label="Lots"
- low="0"
- high="100"
- default="0"
- />
- <number id="density"
- type="slider"
- arg="-density %"
- _label="Mesh"
- _low-label="Dense"
- _high-label="Sparse"
- low="2"
- high="100"
- default="25"
- />
- <number id="visibility"
- type="slider"
- arg="-visibility %"
- _label="Visibility"
- _low-label="Faint"
- _high-label="Bright"
- low="1.0"
- high="100.0"
- default="35.0"
- />
- <number id="speed"
- type="slider"
- arg="-speed %"
- _low-label="Slow"
- _high-label="Fast"
- low="1.0"
- high="100.0"
- default="15.0"
- />
- <number id="feedback"
- type="slider"
- arg="-feedback %"
- _label="Feedback"
- _low-label="None"
- _high-label="Noisy"
- low="0.0"
- high="100.0"
- default="0.0"
- />
- <number id="feedbackspeed"
- type="slider"
- arg="-feedbackspeed %"
- _low-label="Slow"
- _high-label="Fast"
- low="1.0"
- high="100.0"
- default="1.0"
- />
- <number id="feedbacksize"
- type="slider"
- arg="-feedbacksize %"
- _low-label="Small"
- _high-label="Large"
- low="1"
- high="10"
- default="3"
- />
- <boolean id="wireframe"
- _label="Wireframe"
- arg-set="-wireframe"
- />
-
- <select id="texture">
- <option id="none"
- _label="No texture"
- />
- <option id="plasma"
- _label="Plasma texture"
- arg-set="-plasma"
- />
- <option id="stringy"
- _label="Stringy texture"
- arg-set="-stringy"
- />
- <option id="lines"
- _label="Lines texture"
- arg-set="-lines"
- />
- <option id="random"
- _label="Random texture"
- arg-set="-random"
- />
- </select>
- <_description>
-If psychedelic is what you're looking for, you've come to the right place. This
-saver is another fine example of what you can do with a few good equations and
-a whole lot of geometry. I hope you don't get nauseous looking at it.
- -- Terry Welsh, Really Slick Screensavers (http://www.reallyslick.com/)
-
-This version by Michael Chapman &lt;foonly@users.sourceforge.net&gt;.
- </_description>
-</screensaver>
diff --git a/xbmc/screensavers/rsxs-0.9/config/rs-fieldlines.xml b/xbmc/screensavers/rsxs-0.9/config/rs-fieldlines.xml
deleted file mode 100644
index e1e0d260b0..0000000000
--- a/xbmc/screensavers/rsxs-0.9/config/rs-fieldlines.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<screensaver name="rs-fieldlines" _label="Really Slick Fieldlines">
- <command arg="-root" />
-
- <number id="ions"
- type="spinbutton"
- arg="-ions %"
- _label="Ions"
- low="1"
- high="10"
- default="4"
- />
- <number id="speed"
- type="slider"
- arg="-speed %"
- _low-label="Slow"
- _high-label="Fast"
- low="1.0"
- high="100.0"
- default="10.0"
- />
- <number id="width"
- type="slider"
- arg="-width %"
- _label="Lines"
- _low-label="Thin"
- _high-label="Thick"
- low="1.0"
- high="100.0"
- default="30.0"
- />
- <hgroup>
- <boolean id="constant"
- _label="Constant-width"
- arg-set="-constant"
- />
- <select id="electric">
- <option id="fieldlines"
- _label="Fieldlines"
- />
- <option id="electricsparks"
- _label="Electric sparks"
- arg-set="-electric"
- />
- </select>
- </hgroup>
- <number id="segsize"
- type="slider"
- arg="-segsize %"
- _label="Line segments"
- _low-label="Short"
- _high-label="Long"
- low="1.0"
- high="100.0"
- default="15.0"
- />
- <number id="maxsegs"
- type="slider"
- arg="-maxsegs %"
- _low-label="Few"
- _high-label="Lots"
- low="1"
- high="1000"
- default="100"
- />
-
- <_description>
-Field Lines is a good example of the beauty of physics. It is an accurate
-representation of the field lines between positively and negatively charged
-particles. The only real artistic license that I took was in my choice of
-colors for the lines.
- -- Terry Welsh, Really Slick Screensavers (http://www.reallyslick.com/)
-
-This version by Michael Chapman &lt;foonly@users.sourceforge.net&gt;.
- </_description>
-</screensaver>
diff --git a/xbmc/screensavers/rsxs-0.9/config/rs-flocks.xml b/xbmc/screensavers/rsxs-0.9/config/rs-flocks.xml
deleted file mode 100644
index d8d67e30b0..0000000000
--- a/xbmc/screensavers/rsxs-0.9/config/rs-flocks.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<screensaver name="rs-flocks" _label="Really Slick Flocks">
- <command arg="-root" />
-
- <hgroup>
- <number id="leaders"
- type="spinbutton"
- arg="-leaders %"
- _label="Leaders"
- low="1"
- high="100"
- default="4"
- />
- <number id="followers"
- type="spinbutton"
- arg="-followers %"
- _label="Followers"
- low="0"
- high="10000"
- default="400"
- />
- </hgroup>
- <number id="size"
- type="slider"
- arg="-size %"
- _label="Bugs"
- _low-label="Tiny"
- _high-label="Huge"
- low="1.0"
- high="100.0"
- default="10.0"
- />
- <number id="speed"
- type="slider"
- arg="-speed %"
- _low-label="Slow"
- _high-label="Fast"
- low="1.0"
- high="100.0"
- default="15.0"
- />
- <number id="stretch"
- type="slider"
- arg="-stretch %"
- _low-label="Rigid"
- _high-label="Stretchy"
- low="0.0"
- high="100.0"
- default="20.0"
- />
- <number id="complexity"
- type="slider"
- arg="-complexity %"
- _label="Bug complexity"
- _low-label="Lines"
- _high-label="Blobs"
- low="0"
- high="10"
- default="1"
- />
- <number id="colorspeed"
- type="slider"
- arg="-colorspeed %"
- _label="Color fade speed"
- _low-label="Slow"
- _high-label="Fast"
- low="0.0"
- high="100.0"
- default="15.0"
- />
- <boolean id="chromadepth"
- _label="ChromaDepth mode"
- arg-set="-chromadepth"
- />
- <boolean id="connections"
- _label="Draw connection lines"
- arg-set="-connections"
- />
-
- <_description>
-There are plenty of screen savers out there with swarms of little bugs, but
-I hadn't found a good 3D version. So here it is! For a really nice 3D
-effect, you can turn on the ChromaDepth option and try using some of the
-ChromaDepth glasses from Chromatek.
- -- Terry Welsh, Really Slick Screensavers (http://www.reallyslick.com/)
-
-This version by Michael Chapman &lt;foonly@users.sourceforge.net&gt;.
- </_description>
-</screensaver>
diff --git a/xbmc/screensavers/rsxs-0.9/config/rs-flux.xml b/xbmc/screensavers/rsxs-0.9/config/rs-flux.xml
deleted file mode 100644
index 8d8e71bf59..0000000000
--- a/xbmc/screensavers/rsxs-0.9/config/rs-flux.xml
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<screensaver name="rs-flux" _label="Really Slick Flux">
- <command arg="-root" />
-
- <hgroup>
- <number id="fluxes"
- type="spinbutton"
- arg="-fluxes %"
- _label="Fluxes"
- low="1"
- high="100"
- default="1"
- />
- <number id="particles"
- type="spinbutton"
- arg="-particles %"
- _label="Particles"
- low="1"
- high="1000"
- default="20"
- />
- </hgroup>
- <number id="size"
- type="slider"
- arg="-size %"
- _label="Particles"
- _low-label="Tiny"
- _high-label="Huge"
- low="1.0"
- high="100.0"
- default="15.0"
- />
- <number id="length"
- type="slider"
- arg="-length %"
- _label="Particle trails"
- _low-label="Short"
- _high-label="Long"
- low="3"
- high="10000"
- default="40"
- />
- <select id="geometry">
- <option id="points"
- _label="Points"
- arg-set="-points"
- />
- <option id="spheres"
- _label="Spheres"
- arg-set="-spheres"
- />
- <option id="lights"
- _label="Lights"
- />
- </select>
- <number id="complexity"
- type="slider"
- arg="-complexity %"
- _label="Sphere Complexity"
- _low-label="Simple"
- _high-label="Complex"
- low="1"
- high="10"
- default="3"
- />
- <number id="speed"
- type="slider"
- arg="-speed %"
- _label="Speed"
- _low-label="Slow"
- _high-label="Fast"
- low="0.0"
- high="100.0"
- default="40.0"
- />
- <number id="randomness"
- type="slider"
- arg="-randomness %"
- _label="Randomization frequency"
- _low-label="Never"
- _high-label="Often"
- low="0"
- high="100"
- default="0"
- />
- <number id="rotation"
- type="slider"
- arg="-rotation %"
- _label="Rotation rate"
- _low-label="Slow"
- _high-label="Fast"
- low="0.0"
- high="100.0"
- default="30.0"
- />
- <number id="wind"
- type="slider"
- arg="-wind %"
- _label="Crosswind speed"
- _low-label="Slow"
- _high-label="Fast"
- low="0.0"
- high="100.0"
- default="20.0"
- />
- <number id="rotation"
- type="slider"
- arg="-instability %"
- _label="Instability"
- _low-label="Stable"
- _high-label="Instable"
- low="1.0"
- high="100.0"
- default="20.0"
- />
- <number id="blur"
- type="slider"
- arg="-blur %"
- _label="Motion blur"
- _low-label="Sharp"
- _high-label="Blurry"
- low="0.0"
- high="100.0"
- default="0.0"
- />
-
- <_description>
-This screen saver started as an experiment with strange attractors. After
-playing with some simple strange attractor equations, it became clear that
-they could be much more beautiful if the constants could be varied over time.
-
-This required the introduction of some limiting terms into the equations that
-prevented the values from flying off to infinity. So these aren't genuine
-strange attractors anymore, but they look much better.
- -- Terry Welsh, Really Slick Screensavers (http://www.reallyslick.com/)
-
-This version by Michael Chapman &lt;foonly@users.sourceforge.net&gt;.
- </_description>
-</screensaver>
diff --git a/xbmc/screensavers/rsxs-0.9/config/rs-helios.xml b/xbmc/screensavers/rsxs-0.9/config/rs-helios.xml
deleted file mode 100644
index 8833eed947..0000000000
--- a/xbmc/screensavers/rsxs-0.9/config/rs-helios.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<screensaver name="rs-helios" _label="Really Slick Helios">
- <command arg="-root" />
-
- <number id="ions"
- type="slider"
- arg="-ions %"
- _label="Ions"
- _low-label="Few"
- _high-label="Lots"
- low="1"
- high="30000"
- default="1500"
- />
- <number id="size"
- type="slider"
- arg="-size %"
- _low-label="Small"
- _high-label="Large"
- low="1.0"
- high="100.0"
- default="10.0"
- />
- <number id="speed"
- type="slider"
- arg="-speed %"
- _low-label="Slow"
- _high-label="Fast"
- low="1.0"
- high="100.0"
- default="10.0"
- />
- <number id="emitters"
- type="slider"
- arg="-emitters %"
- _label="Emitters"
- _low-label="Few"
- _high-label="Lots"
- low="1"
- high="10"
- default="3"
- />
- <number id="attractors"
- type="slider"
- arg="-attractors %"
- _label="Attractors"
- _low-label="Few"
- _high-label="Lots"
- low="1"
- high="10"
- default="3"
- />
- <number id="cameraspeed"
- type="slider"
- arg="-cameraspeed %"
- _label="Motion"
- _low-label="Slow"
- _high-label="Fast"
- low="0.0"
- high="100.0"
- default="10.0"
- />
- <number id="blur"
- type="slider"
- arg="-blur %"
- _low-label="Sharp"
- _high-label="Blurry"
- low="0.0"
- high="100.0"
- default="30.0"
- />
- <select id="surface">
- <option id="none"
- _label="No surfaces"
- arg-set="-no-surface"
- />
- <option id="wireframe"
- _label="Wireframe iso-surface"
- arg-set="-wireframe"
- />
- <option id="texture"
- _label="Textured iso-surface"
- />
- </select>
- <file id="surfaceimage"
- _label="Iso-surface PNG image"
- arg="-surfaceimage %"
- />
-
- <_description>
-Beneath its shiny exterior, Helios's particles are powered by some basic
-attraction/repulsion math. The Helion surfaces, on the other hand, are much
-more complicated.
- -- Terry Welsh, Really Slick Screensavers (http://www.reallyslick.com/)
-
-This version by Michael Chapman &lt;foonly@users.sourceforge.net&gt;.
- </_description>
-</screensaver>
diff --git a/xbmc/screensavers/rsxs-0.9/config/rs-hyperspace.xml b/xbmc/screensavers/rsxs-0.9/config/rs-hyperspace.xml
deleted file mode 100644
index 07dde04d84..0000000000
--- a/xbmc/screensavers/rsxs-0.9/config/rs-hyperspace.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<screensaver name="hyperspace" _label="Really Slick Hyperspace">
- <command arg="-root" />
-
- <number id="stars"
- type="spinbutton"
- arg="-stars %"
- _label="Stars"
- low="0"
- high="10000"
- default="1000"
- />
- <number id="starsize"
- type="slider"
- arg="-starsize %"
- _label="Star size"
- _low-label="Tiny"
- _high-label="Huge"
- low="1.0"
- high="100.0"
- default="10.0"
- />
- <number id="speed"
- type="slider"
- arg="-speed %"
- _label="Speed"
- _low-label="Slow"
- _high-label="Fast"
- low="1.0"
- high="100.0"
- default="10.0"
- />
- <number id="resolution"
- type="slider"
- arg="-resolution %"
- _label="Resolution"
- _low-label="Low"
- _high-label="High"
- low="4"
- high="20"
- default="10"
- />
- <number id="depth"
- type="slider"
- arg="-depth %"
- _low-label="Shallow"
- _high-label="Deep"
- low="1"
- high="10"
- default="5"
- />
- <number id="fov"
- type="slider"
- arg="-fov %"
- _label="Camera"
- _low-label="Zoomed"
- _high-label="Wide-angle"
- low="10.0"
- high="150.0"
- default="90.0"
- />
- <boolean id="shaders"
- _label="GL shaders"
- arg-unset="-no-shaders"
- />
-
- <_description>
-This is a real number cruncher of a screensaver. Computers are getting much
-more powerful these days, and my old savers don't bring them to their knees
-like they use to. This one does. Of course, you can still turn the settings way
-down if you have a pathetic, old computer.
- -- Terry Welsh, Really Slick Screensavers (http://www.reallyslick.com/)
-
-This version by Michael Chapman &lt;foonly@users.sourceforge.net&gt;.
- </_description>
-</screensaver>
diff --git a/xbmc/screensavers/rsxs-0.9/config/rs-lattice.xml b/xbmc/screensavers/rsxs-0.9/config/rs-lattice.xml
deleted file mode 100644
index 6122e93773..0000000000
--- a/xbmc/screensavers/rsxs-0.9/config/rs-lattice.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<screensaver name="rs-lattice" _label="Really Slick Lattice">
- <command arg="-root" />
-
- <number id="latitude"
- type="slider"
- arg="-latitude %"
- _label="Latitudinal divisions"
- _low-label="Few"
- _high-label="Lots"
- low="2"
- high="100"
- default="8"
- />
- <number id="longitude"
- type="slider"
- arg="-longitude %"
- _label="Longitudinal divisions"
- _low-label="Few"
- _high-label="Lots"
- low="4"
- high="100"
- default="16"
- />
- <number id="thickness"
- type="slider"
- arg="-thickness %"
- _label="Thickness"
- _low-label="Thin"
- _high-label="Thick"
- low="1.0"
- high="100.0"
- default="50.0"
- />
- <number id="density"
- type="slider"
- arg="-density %"
- _label="Lattice"
- _low-label="Dense"
- _high-label="Sparse"
- low="1"
- high="100"
- default="50"
- />
- <number id="depth"
- type="slider"
- arg="-depth %"
- _low-label="Shallow"
- _high-label="Deep"
- low="1"
- high="8"
- default="4"
- />
- <number id="fov"
- type="slider"
- arg="-fov %"
- _label="Camera"
- _low-label="Zoomed"
- _high-label="Wide-angle"
- low="10.0"
- high="150.0"
- default="90.0"
- />
- <number id="randomness"
- type="slider"
- arg="-randomness %"
- _low-label="Straight"
- _high-label="Twisty"
- low="1"
- high="10"
- default="7"
- />
- <number id="speed"
- type="slider"
- arg="-speed %"
- _low-label="Slow"
- _high-label="Fast"
- low="1.0"
- high="100.0"
- default="10.0"
- />
- <boolean id="smooth"
- _label="Smooth"
- arg-set="-smooth"
- />
- <boolean id="fog"
- _label="Fogging"
- arg-unset="-no-fog"
- />
- <boolean id="widescreen"
- _label="Widescreen"
- arg-set="-widescreen"
- />
-
- <select id="texture">
- <option id="none"
- _label="No texture"
- />
- <option id="industrial"
- _label="Industrial texture"
- arg-set="-industrial"
- />
- <option id="crystal"
- _label="Crystal texture"
- arg-set="-crystal"
- />
- <option id="chrome"
- _label="Chrome texture"
- arg-set="-chrome"
- />
- <option id="brass"
- _label="Brass texture"
- arg-set="-brass"
- />
- <option id="shiny"
- _label="Shiny texture"
- arg-set="-shiny"
- />
- <option id="ghostly"
- _label="Ghostly texture"
- arg-set="-ghostly"
- />
- <option id="circuits"
- _label="Circuits texture"
- arg-set="-circuits"
- />
- <option id="donuts"
- _label="Donuts texture"
- arg-set="-donuts"
- />
- <option id="random"
- _label="Random texture"
- arg-set="-random"
- />
- </select>
- <_description>
-No screensaver collection would be complete without some kind of flight
-through an endless field of geometry, right? A special thanks goes to Kevin
-for his "doughnut" idea.
- -- Terry Welsh, Really Slick Screensavers (http://www.reallyslick.com/)
-
-This version by Michael Chapman &lt;foonly@users.sourceforge.net&gt;.
- </_description>
-</screensaver>
diff --git a/xbmc/screensavers/rsxs-0.9/config/rs-plasma.xml b/xbmc/screensavers/rsxs-0.9/config/rs-plasma.xml
deleted file mode 100644
index 306954b1ad..0000000000
--- a/xbmc/screensavers/rsxs-0.9/config/rs-plasma.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<screensaver name="rs-plasma" _label="Really Slick Plasma">
- <command arg="-root" />
-
- <number id="focus"
- type="slider"
- arg="-focus %"
- _label="Plasma"
- _low-label="Blurry"
- _high-label="Sharp"
- low="1.0"
- high="100.0"
- default="30.0"
- />
- <number id="speed"
- type="slider"
- arg="-speed %"
- _low-label="Slow"
- _high-label="Fast"
- low="1.0"
- high="100.0"
- default="20.0"
- />
- <number id="zoom"
- type="slider"
- arg="-zoom %"
- _label="Zoom"
- _low-label="Far"
- _high-label="Near"
- low="1.0"
- high="100.0"
- default="10.0"
- />
- <number id="resolution"
- type="slider"
- arg="-resolution %"
- _label="Resolution"
- _low-label="Low"
- _high-label="High"
- low="1.0"
- high="100.0"
- default="20.0"
- />
-
- <_description>
-There are probably too many plasma savers out there already. So this
-screensaver is pointless, but I made it anyway. Enjoy.
- -- Terry Welsh, Really Slick Screensavers (http://www.reallyslick.com/)
-
-This version by Michael Chapman &lt;foonly@users.sourceforge.net&gt;.
- </_description>
-</screensaver>
diff --git a/xbmc/screensavers/rsxs-0.9/config/rs-skyrocket.xml b/xbmc/screensavers/rsxs-0.9/config/rs-skyrocket.xml
deleted file mode 100644
index 485a664245..0000000000
--- a/xbmc/screensavers/rsxs-0.9/config/rs-skyrocket.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<screensaver name="rs-skyrocket" _label="Really Slick Skyrocket">
- <command arg="-root" />
-
- <number id="rockets"
- type="spinbutton"
- arg="-rockets %"
- _label="Rockets"
- low="1"
- high="100"
- default="8"
- />
- <number id="smoke"
- type="slider"
- arg="-smoke %"
- _label="Smoke lifetime"
- _low-label="Short"
- _high-label="Long"
- low="0.0"
- high="60.0"
- default="5.0"
- />
- <number id="explosionsmoke"
- type="slider"
- arg="-explosionsmoke %"
- _label="Explosion smoke"
- _low-label="None"
- _high-label="Lots"
- low="0"
- high="100"
- default="0"
- />
- <number id="stars"
- type="slider"
- arg="-stars %"
- _label="Star field"
- _low-label="Sparse"
- _high-label="Dense"
- low="0.0"
- high="100.0"
- default="20.0"
- />
- <boolean id="moon"
- _label="Draw moon"
- arg-unset="-no-moon"
- />
- <number id="halo"
- type="slider"
- arg="-halo %"
- _label="Moon halo"
- _low-label="Dark"
- _high-label="Light"
- low="0.0"
- high="100.0"
- default="20.0"
- />
- <number id="ambient"
- type="slider"
- arg="-ambient %"
- _label="Ambient lighting"
- _low-label="Dim"
- _high-label="Bright"
- low="0.0"
- high="50.0"
- default="10.0"
- />
- <boolean id="earth"
- _label="Draw earth"
- arg-unset="-no-earth"
- />
- <boolean id="clouds"
- _label="Draw clouds"
- arg-unset="-no-clouds"
- />
- <boolean id="glow"
- _label="Explosions illuminate smoke and clouds"
- arg-unset="-no-glow"
- />
- <number id="wind"
- type="slider"
- arg="-wind %"
- _label="Wind speed"
- _low-label="Slow"
- _high-label="Fast"
- low="0.0"
- high="100.0"
- default="20.0"
- />
- <number id="flares"
- type="slider"
- arg="-flares %"
- _label="Lens flare"
- _low-label="Dim"
- _high-label="Bright"
- low="0.0"
- high="100.0"
- default="20.0"
- />
- <number id="volume"
- type="slider"
- arg="-volume %"
- _label="Audio volume (if enabled)"
- _low-label="Silent"
- _high-label="Loud"
- low="0.0"
- high="100.0"
- default="100.0"
- />
-
- <_description>
-This is my little contribution to the myriad of fireworks savers in the world.
-There are way too many of them, which is why I tried to make mine really really
-good.
-
-Underneath all the eye candy, I tried to keep the physics of the fireworks as
-realistic as possible. It seemed like the best way to produce a believable
-effect.
- -- Terry Welsh, Really Slick Screensavers (http://www.reallyslick.com/)
-
-This version by Michael Chapman &lt;foonly@users.sourceforge.net&gt;.
- </_description>
-</screensaver>
diff --git a/xbmc/screensavers/rsxs-0.9/config/rs-solarwinds.xml b/xbmc/screensavers/rsxs-0.9/config/rs-solarwinds.xml
deleted file mode 100644
index eb6bc7bb04..0000000000
--- a/xbmc/screensavers/rsxs-0.9/config/rs-solarwinds.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<screensaver name="rs-solarwinds" _label="Really Slick Solar Winds">
- <command arg="-root" />
-
- <hgroup>
- <number id="winds"
- type="spinbutton"
- arg="-winds %"
- _label="Winds"
- low="1"
- high="10"
- default="1"
- />
- <number id="emitters"
- type="spinbutton"
- arg="-emitters %"
- _label="Emitters"
- low="1"
- high="1000"
- default="30"
- />
- <number id="particles"
- type="spinbutton"
- arg="-particles %"
- _label="Particles"
- low="1"
- high="10000"
- default="2000"
- />
- </hgroup>
- <number id="windspeed"
- type="slider"
- arg="-windspeed %"
- _label="Wind speed"
- _low-label="Slow"
- _high-label="Fast"
- low="1.0"
- high="100.0"
- default="20.0"
- />
- <number id="size"
- type="slider"
- arg="-size %"
- _label="Particles"
- _low-label="Small"
- _high-label="Large"
- low="1.0"
- high="100.0"
- default="50.0"
- />
- <number id="speed"
- type="slider"
- arg="-speed %"
- _low-label="Slow"
- _high-label="Fast"
- low="1.0"
- high="100.0"
- default="10.0"
- />
- <select id="geometry">
- <option id="lights"
- _label="Lights"
- />
- <option id="points"
- _label="Points"
- arg-set="-points"
- />
- <option id="lines"
- _label="Lines"
- arg-set="-lines"
- />
- </select>
- <number id="emitterspeed"
- type="slider"
- arg="-emitterspeed %"
- _label="Emitter speed"
- _low-label="Slow"
- _high-label="Fast"
- low="1.0"
- high="100.0"
- default="15.0"
- />
-
- <_description>
-My savers seem to be all about color and movement. This one is certainly no
-exception. It just shows that a little random math can go a long way.
-
-Solar Winds started out as a simple particle effects saver, but once I saw
-that the particles usually stayed in continuous lines I gave them some
-connectivity and threw in the "lines" option.
- -- Terry Welsh, Really Slick Screensavers (http://www.reallyslick.com/)
-
-This version by Michael Chapman &lt;foonly@users.sourceforge.net&gt;.
- </_description>
-</screensaver>
diff --git a/xbmc/screensavers/rsxs-0.9/configure.ac b/xbmc/screensavers/rsxs-0.9/configure.ac
deleted file mode 100644
index d60238cb9f..0000000000
--- a/xbmc/screensavers/rsxs-0.9/configure.ac
+++ /dev/null
@@ -1,313 +0,0 @@
-## Process this file with autoconf to produce a configure script.
-
-AC_INIT([Really Slick XScreenSavers],[0.9],[foonly@users.sourceforge.net],[rsxs])
-AC_PREREQ(2.59)
-AC_CONFIG_SRCDIR([src/hack.hh])
-AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([1.7 subdir-objects std-options])
-AC_SUBST(RELEASE, 1)
-
-AC_CONFIG_MACRO_DIR(m4)
-AC_CONFIG_LIBOBJ_DIR(lib)
-
-AC_GNU_SOURCE
-
-# Checks for programs.
-LT_AC_PROG_SED
-AC_LANG(C++)
-AC_PROG_CXX
-#CXXFLAGS=`echo $CXXFLAGS | sed -e s,-O2,-O3,`
-AC_PROG_CXXCPP
-
-#if test x"$GXX" = x"yes"; then
-# CXXFLAGS=`echo $CXXFLAGS -Wall`
-#fi
-
-AC_PROG_CC
-AM_PROG_CC_C_O
-gl_EARLY
-AC_PROG_RANLIB
-
-# Cut-down version of AC_LIB_LTDL. We don't want the option to install
-# libltdl, or to use dlpreopen (we don't want libtool at all).
-# Also, we can use gnulib's *_ONCE macros.
-AC_DEFUN([MAC_LIB_LTDL], [
- # Some of the below macros have dependencies that are m4_require'd.
- # aclocal doesn't resolve those automatically, so we need to call
- # LT_PATH_LD and LTSUGAR_VERSION to pull in libtool.m4 and ltsugar.m4
- # where the required dependencies are m4_defun'd.
- AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
- AC_REQUIRE([LT_PATH_LD])dnl
- AC_REQUIRE([LTSUGAR_VERSION])dnl
- AC_REQUIRE([AC_PROG_CC])dnl
- AC_REQUIRE([AC_HEADER_STDC])dnl
- AC_REQUIRE([AC_HEADER_DIRENT])dnl
- AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
- AC_REQUIRE([AC_LTDL_SHLIBEXT])dnl
- AC_REQUIRE([AC_LTDL_SHLIBPATH])dnl
- AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])dnl
- AC_REQUIRE([AC_LTDL_OBJDIR])dnl
- AC_REQUIRE([AC_LTDL_DLLIB])dnl
- AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
- AC_REQUIRE([AC_LTDL_DLSYM_USCORE])dnl
- AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS])dnl
-
- AC_CHECK_HEADERS_ONCE([assert.h ctype.h errno.h malloc.h memory.h stdlib.h stdio.h unistd.h])
- AC_CHECK_HEADERS_ONCE([dl.h sys/dl.h dld.h mach-o/dyld.h])
- AC_CHECK_HEADERS_ONCE([string.h strings.h], [break])
- AC_CHECK_FUNCS_ONCE([strchr index], [break])
- AC_CHECK_FUNCS_ONCE([strrchr rindex], [break])
- AC_CHECK_FUNCS_ONCE([memcpy bcopy], [break])
- AC_CHECK_FUNCS_ONCE([memmove strcmp])
- AC_CHECK_FUNCS_ONCE([closedir opendir readdir])
-])dnl
-MAC_LIB_LTDL
-
-MAC_CXX_BOOL
-MAC_CXX_NEW_FOR_SCOPING
-MAC_CXX_NAMESPACES
-if test "$HAVE_CXX_NAMESPACES" != yes; then
- AC_MSG_ERROR([$CXX does not correctly support namespaces])
-fi
-MAC_CXX_STD
-if test "$HAVE_CXX_STD" != yes; then
- AC_MSG_ERROR([the C++ Standard Template Library is unavailable or non-ISO])
-fi
-MAC_CXX_SSTREAM
-
-AC_PROG_INSTALL
-AC_PROG_LN_S
-
-# Checks for libraries.
-gl_INIT
-MAC_PKG_X
-AC_SUBST(X_CPPFLAGS)
-AC_SUBST(X_LIBS)
-MAC_PKG_XSCREENSAVER
-AM_CONDITIONAL(HACKMODE, test $HAVE_PKG_XSCREENSAVER = yes)
-AM_CONDITIONAL(XSCREENSAVER4, test $HAVE_PKG_XSCREENSAVER_4 = yes)
-AM_CONDITIONAL(SYMLINKS, test $PKG_XSCREENSAVER_SYMLINKS = yes)
-AC_SUBST(xscreensaver, $HAVE_PKG_XSCREENSAVER)
-AC_SUBST(defaultdir, $PKG_XSCREENSAVER_DEFAULTDIR)
-AC_SUBST(hackdir, $PKG_XSCREENSAVER_HACKDIR)
-AC_SUBST(configdir, $PKG_XSCREENSAVER_CONFIGDIR)
-
-MAC_PKG_OPENGL
-if test "$HAVE_PKG_OPENGL" != yes; then
- AC_MSG_ERROR([can't compile without OpenGL support])
-fi
-AC_SUBST(OPENGL_LIBS)
-
-HAVE_SOUND=no
-USE_DLOPEN=no
-SOUND_CPPFLAGS=
-SOUND_CXXFLAGS=
-SOUND_LDFLAGS=
-SOUND_LIBS=
-AC_ARG_ENABLE(sound,
- AS_HELP_STRING(--disable-sound,disable OGG sound file support))
-m4_divert_once([HELP_ENABLE],
- AS_HELP_STRING(--enable-sound=dlopen,use OGG sound file support at runtime))dnl
-if test "$enable_sound" != "no"; then
- MAC_PKG_OPENAL
- if test "$HAVE_PKG_OPENAL" = yes; then
- MAC_PKG_VORBISFILE
- if test "$HAVE_PKG_VORBISFILE" = yes; then
- HAVE_SOUND=yes
- SOUND_CPPFLAGS="$OPENAL_CPPFLAGS $VORBISFILE_CPPFLAGS"
- SOUND_CPPFLAGS="$OPENAL_CXXFLAGS $VORBISFILE_CXXFLAGS"
- if test "$enable_sound" = "dlopen"; then
- AC_DEFINE(USE_DLOPEN, 1, [Define to 1 if run-time dynamic linking should be used.])
- USE_DLOPEN=yes
- else
- SOUND_LDFLAGS="$OPENAL_LDFLAGS $VORBISFILE_LDFLAGS"
- SOUND_LIBS="$OPENAL_LIBS $VORBISFILE_LIBS"
- fi
- AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if OGG sound support is available.])
- fi
- fi
-fi
-AC_SUBST(HAVE_SOUND)
-AC_SUBST(SOUND_CPPFLAGS)
-AC_SUBST(SOUND_CXXFLAGS)
-AC_SUBST(SOUND_LDFLAGS)
-AC_SUBST(SOUND_LIBS)
-AM_CONDITIONAL(SOUND, test "$HAVE_SOUND" = yes)
-AM_CONDITIONAL(DLOPEN, test "$USE_DLOPEN" = yes)
-
-HAVE_IMAGE=no
-IMAGE_CPPFLAGS=
-IMAGE_CXXFLAGS=
-IMAGE_LDFLAGS=
-IMAGE_LIBS=
-AC_ARG_ENABLE(image,
- AS_HELP_STRING(--disable-image,disable PNG image file support))
-if test "$enable_image" != "no"; then
- MAC_PKG_PNG
- if test "$HAVE_PKG_PNG" = yes; then
- case "$LIBPNG_SUPPORTS_SETJMP" in
- no)
- AC_MSG_ERROR([need a version of libpng with setjmp support])
- ;;
- unknown)
- AC_MSG_WARN([assuming libpng has setjmp support])
- ;;
- esac
- HAVE_IMAGE=yes
- IMAGE_CPPFLAGS="$PNG_CPPFLAGS"
- IMAGE_CXXFLAGS="$PNG_CXXFLAGS"
- IMAGE_LDFLAGS="$PNG_LDFLAGS"
- IMAGE_LIBS="$PNG_LIBS"
- AC_DEFINE(HAVE_IMAGE, 1, [Define to 1 if PNG image support is available.])
- fi
-fi
-AC_SUBST(HAVE_IMAGE)
-AC_SUBST(IMAGE_CPPFLAGS)
-AC_SUBST(IMAGE_CXXFLAGS)
-AC_SUBST(IMAGE_LDFLAGS)
-AC_SUBST(IMAGE_LIBS)
-AM_CONDITIONAL(IMAGE, test "$HAVE_IMAGE" = yes)
-
-# Create a hackdir that is relative to bindir
-adl_COMPUTE_RELATIVE_PATHS([bindir:hackdir:hackreldir])
-AC_SUBST(hackreldir)
-
-# Checks for header files.
-AC_CHECK_HEADERS_ONCE([setjmp.h sys/types.h sys/select.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-
-# Checks for library functions.
-AC_CHECK_FUNCS_ONCE([setjmp select], [], [
- AC_MSG_ERROR([your environment is missing a necessary library function])
-])
-
-AC_ARG_ENABLE(debug,
- AS_HELP_STRING(--enable-debug, [include debug code]))
-case "$enable_debug" in
-no|"")
- AC_DEFINE(NDEBUG, 1, [Define to 1 if debugging is disabled])
- ;;
-*)
- ;;
-esac
-
-AC_ARG_ENABLE(profile,
- AS_HELP_STRING(--enable-profile, [enable profiling]))
-case "$enable_profile" in
-no|"")
- ;;
-*)
- if test "$GCC" != "yes"; then
- AC_MSG_ERROR([I can only use profiling on GCC])
- fi
- CFLAGS=`echo $CXXFLAGS -pg -fprofile-arcs -ftest-coverage | sed -e s,-O2,-O0,`
- LDFLAGS="$LDFLAGS -pg -fprofile-arcs -ftest-coverage"
- ;;
-esac
-
-ENABLED_HACKS=
-ENABLED_BINARIES=
-ENABLED_CONFIGS=
-DISABLED_HACKS=
-
-MAC_HACK_ENABLE(cyclone, [Cyclone])
-MAC_HACK_ENABLE(euphoria, [Euphoria], [
- if test "$HAVE_IMAGE" != yes; then
- enable_euphoria="no (requires PNG image support)"
- enable_hack=no
- fi
-])
-MAC_HACK_ENABLE(fieldlines, [Field Lines])
-MAC_HACK_ENABLE(flocks, [Flocks])
-MAC_HACK_ENABLE(flux, [Flux])
-MAC_HACK_ENABLE(helios, [Helios], [
- if test "$HAVE_IMAGE" != yes; then
- enable_helios="no (requires PNG image support)"
- enable_hack=no
- fi
-])
-MAC_HACK_ENABLE(hyperspace, [Hyperspace], [
- if test "$HAVE_IMAGE" != yes; then
- enable_hyperspace="no (requires PNG image support)"
- enable_hack=no
- fi
-])
-MAC_HACK_ENABLE(lattice, [Lattice], [
- if test "$HAVE_IMAGE" != yes; then
- enable_lattice="no (requires PNG image support)"
- enable_hack=no
- fi
-])
-MAC_HACK_ENABLE(plasma, [Plasma])
-MAC_HACK_ENABLE(skyrocket, [Skyrocket], [
- if test "$HAVE_IMAGE" != yes; then
- enable_skyrocket="no (requires PNG image support)"
- enable_hack=no
- else
- if test "$HAVE_SOUND" != yes; then
- enable_skyrocket="yes (but without sound)"
- elif test "$USE_DLOPEN" = yes; then
- enable_skyrocket="yes (if available at run-time)"
- fi
- fi
-])
-MAC_HACK_ENABLE(solarwinds, [Solar Winds])
-
-AC_SUBST(ENABLED_HACKS)
-AC_SUBST(ENABLED_BINARIES)
-AC_SUBST(ENABLED_CONFIGS)
-AC_SUBST(DISABLED_HACKS)
-
-# Embed stuff in the RPM spec
-INSTALL_AWK=scripts/install.awk
-UNINSTALL_AWK=scripts/uninstall.awk
-VERIFY_AWK=scripts/verify.awk
-CHANGELOG=ChangeLog
-AC_SUBST_FILE(INSTALL_AWK)
-AC_SUBST_FILE(UNINSTALL_AWK)
-AC_SUBST_FILE(VERIFY_AWK)
-AC_SUBST_FILE(CHANGELOG)
-
-AC_CONFIG_FILES([
- Makefile
- config/Makefile
- lib/Makefile
- libltdl/Makefile
- src/Makefile
- src/cyclone/Makefile
- src/euphoria/Makefile
- src/fieldlines/Makefile
- src/flocks/Makefile
- src/flux/Makefile
- src/helios/Makefile
- src/hyperspace/Makefile
- src/lattice/Makefile
- src/plasma/Makefile
- src/skyrocket/Makefile
- src/solarwinds/Makefile
- rsxs.spec
-])
-AC_OUTPUT
-
-# Print a pretty summary
-echo >&2
-echo "====================================" >&2
-echo " XScreenSaver support : $HAVE_PKG_XSCREENSAVER" >&2
-echo " PNG image support : $HAVE_IMAGE" >&2
-echo " OGG Vorbis sound support : $HAVE_SOUND" >&2
-echo "------------------------------------" >&2
-echo " Enabled screensavers:" >&2
-echo " - Cyclone : $enable_cyclone" >&2
-echo " - Euphoria : $enable_euphoria" >&2
-echo " - Field Lines : $enable_fieldlines" >&2
-echo " - Flocks : $enable_flocks" >&2
-echo " - Flux : $enable_flux" >&2
-echo " - Helios : $enable_helios" >&2
-echo " - Hyperspace : $enable_hyperspace" >&2
-echo " - Lattice : $enable_lattice" >&2
-echo " - Plasma : $enable_plasma" >&2
-echo " - Skyrocket : $enable_skyrocket" >&2
-echo " - Solar Winds : $enable_solarwinds" >&2
-echo "====================================" >&2
-echo >&2
diff --git a/xbmc/screensavers/rsxs-0.9/lib/Makefile.am b/xbmc/screensavers/rsxs-0.9/lib/Makefile.am
deleted file mode 100644
index 4335323ef2..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/Makefile.am
+++ /dev/null
@@ -1,233 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2004-2006 Free Software Foundation, Inc.
-#
-# This file is free software, distributed under the terms of the GNU
-# General Public License. As a special exception to the GNU General
-# Public License, this file may be distributed as part of a program
-# that contains a configuration script generated by Autoconf, under
-# the same distribution terms as the rest of that program.
-#
-# Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libmisc --source-base=lib --m4-base=m4 --aux-dir=. --macro-prefix=gl argp argz gettimeofday unistd
-
-AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies
-
-noinst_LIBRARIES = libmisc.a
-
-libmisc_a_SOURCES =
-libmisc_a_LIBADD = @LIBOBJS@
-noinst_HEADERS =
-EXTRA_DIST =
-BUILT_SOURCES =
-SUFFIXES =
-MOSTLYCLEANFILES =
-MOSTLYCLEANDIRS =
-CLEANFILES =
-DISTCLEANFILES =
-MAINTAINERCLEANFILES =
-
-AM_CPPFLAGS =
-
-## begin gnulib module alloca
-
-
-libmisc_a_LIBADD += @ALLOCA@
-## end gnulib module alloca
-
-## begin gnulib module alloca-opt
-
-BUILT_SOURCES += $(ALLOCA_H)
-EXTRA_DIST += alloca_.h
-
-# We need the following in order to create <alloca.h> when the system
-# doesn't have one that works with the given compiler.
-alloca.h: alloca_.h
- cp $(srcdir)/alloca_.h $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += alloca.h alloca.h-t
-
-## end gnulib module alloca-opt
-
-## begin gnulib module argp
-
-libmisc_a_SOURCES += argp.h argp-ba.c argp-eexst.c \
- argp-fmtstream.c argp-fmtstream.h argp-fs-xinl.c argp-help.c \
- argp-namefrob.h argp-parse.c argp-pin.c argp-pv.c argp-pvh.c \
- argp-xinl.c
-
-## end gnulib module argp
-
-## begin gnulib module argz
-
-BUILT_SOURCES += $(ARGZ_H)
-EXTRA_DIST += argz_.h
-
-# We need the following in order to create <argz.h> when the system
-# doesn't have one that works with the given compiler.
-argz.h: argz_.h
- cp $(srcdir)/argz_.h $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += argz.h argz.h-t
-
-## end gnulib module argz
-
-## begin gnulib module dirname
-
-libmisc_a_SOURCES += basename.c stripslash.c
-
-## end gnulib module dirname
-
-## begin gnulib module exit
-
-libmisc_a_SOURCES += exit.h
-
-## end gnulib module exit
-
-## begin gnulib module getopt
-
-BUILT_SOURCES += $(GETOPT_H)
-EXTRA_DIST += getopt_.h getopt_int.h
-
-# We need the following in order to create <getopt.h> when the system
-# doesn't have one that works with the given compiler.
-getopt.h: getopt_.h
- cp $(srcdir)/getopt_.h $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += getopt.h getopt.h-t
-
-## end gnulib module getopt
-
-## begin gnulib module gettext-h
-
-libmisc_a_SOURCES += gettext.h
-
-## end gnulib module gettext-h
-
-## begin gnulib module mbchar
-
-libmisc_a_SOURCES += mbchar.h
-
-## end gnulib module mbchar
-
-## begin gnulib module mbuiter
-
-libmisc_a_SOURCES += mbuiter.h
-
-## end gnulib module mbuiter
-
-## begin gnulib module minmax
-
-libmisc_a_SOURCES += minmax.h
-
-## end gnulib module minmax
-
-## begin gnulib module size_max
-
-libmisc_a_SOURCES += size_max.h
-
-## end gnulib module size_max
-
-## begin gnulib module stdbool
-
-BUILT_SOURCES += $(STDBOOL_H)
-EXTRA_DIST += stdbool_.h
-
-# We need the following in order to create <stdbool.h> when the system
-# doesn't have one that works.
-stdbool.h: stdbool_.h
- sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += stdbool.h stdbool.h-t
-
-## end gnulib module stdbool
-
-## begin gnulib module strcase
-
-libmisc_a_SOURCES += strcase.h
-
-## end gnulib module strcase
-
-## begin gnulib module strchrnul
-
-libmisc_a_SOURCES += strchrnul.h
-
-## end gnulib module strchrnul
-
-## begin gnulib module strnlen1
-
-libmisc_a_SOURCES += strnlen1.h strnlen1.c
-
-## end gnulib module strnlen1
-
-## begin gnulib module sysexits
-
-BUILT_SOURCES += $(SYSEXITS_H)
-EXTRA_DIST += sysexit_.h
-
-# We need the following in order to create <sysexits.h> when the system
-# doesn't have one that works with the given compiler.
-sysexits.h: sysexit_.h
- cp $(srcdir)/sysexit_.h sysexits.h-t
- mv sysexits.h-t sysexits.h
-MOSTLYCLEANFILES += sysexits.h sysexits.h-t
-
-## end gnulib module sysexits
-
-## begin gnulib module unistd
-
-BUILT_SOURCES += $(UNISTD_H)
-
-# We need the following in order to create an empty placeholder for
-# <unistd.h> when the system doesn't have one.
-unistd.h:
- echo '/* Empty placeholder for $@. */' >$@
-MOSTLYCLEANFILES += unistd.h
-
-## end gnulib module unistd
-
-## begin gnulib module vasnprintf
-
-libmisc_a_SOURCES += printf-args.h printf-parse.h vasnprintf.h
-
-## end gnulib module vasnprintf
-
-## begin gnulib module vsnprintf
-
-libmisc_a_SOURCES += vsnprintf.h
-
-## end gnulib module vsnprintf
-
-## begin gnulib module wcwidth
-
-libmisc_a_SOURCES += wcwidth.h
-
-## end gnulib module wcwidth
-
-## begin gnulib module xalloc-die
-
-libmisc_a_SOURCES += xalloc-die.c
-
-## end gnulib module xalloc-die
-
-## begin gnulib module xsize
-
-libmisc_a_SOURCES += xsize.h
-
-## end gnulib module xsize
-
-## begin gnulib module xstrndup
-
-libmisc_a_SOURCES += xstrndup.h xstrndup.c
-
-## end gnulib module xstrndup
-
-
-mostlyclean-local:
- @test -z "$(MOSTLYCLEANDIRS)" || \
- for dir in $(MOSTLYCLEANDIRS); do \
- if test -d $$dir; then \
- echo "rmdir $$dir"; rmdir $$dir; \
- fi; \
- done
-
-# Makefile.am ends here
diff --git a/xbmc/screensavers/rsxs-0.9/lib/alloca.c b/xbmc/screensavers/rsxs-0.9/lib/alloca.c
deleted file mode 100644
index d1d54475bb..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/alloca.c
+++ /dev/null
@@ -1,491 +0,0 @@
-/* alloca.c -- allocate automatically reclaimed memory
- (Mostly) portable public-domain implementation -- D A Gwyn
-
- This implementation of the PWB library alloca function,
- which is used to allocate space off the run-time stack so
- that it is automatically reclaimed upon procedure exit,
- was inspired by discussions with J. Q. Johnson of Cornell.
- J.Otto Tennant <jot@cray.com> contributed the Cray support.
-
- There are some preprocessor constants that can
- be defined when compiling for your specific system, for
- improved efficiency; however, the defaults should be okay.
-
- The general concept of this implementation is to keep
- track of all alloca-allocated blocks, and reclaim any
- that are found to be deeper in the stack than the current
- invocation. This heuristic does not reclaim storage as
- soon as it becomes invalid, but it will do so eventually.
-
- As a special case, alloca(0) reclaims storage without
- allocating any. It is a good idea to use alloca(0) in
- your main control loop, etc. to force garbage collection. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <alloca.h>
-
-#include <string.h>
-#include <stdlib.h>
-
-#ifdef emacs
-# include "lisp.h"
-# include "blockinput.h"
-# ifdef EMACS_FREE
-# undef free
-# define free EMACS_FREE
-# endif
-#else
-# define memory_full() abort ()
-#endif
-
-/* If compiling with GCC 2, this file's not needed. */
-#if !defined (__GNUC__) || __GNUC__ < 2
-
-/* If someone has defined alloca as a macro,
- there must be some other way alloca is supposed to work. */
-# ifndef alloca
-
-# ifdef emacs
-# ifdef static
-/* actually, only want this if static is defined as ""
- -- this is for usg, in which emacs must undefine static
- in order to make unexec workable
- */
-# ifndef STACK_DIRECTION
-you
-lose
--- must know STACK_DIRECTION at compile-time
-/* Using #error here is not wise since this file should work for
- old and obscure compilers. */
-# endif /* STACK_DIRECTION undefined */
-# endif /* static */
-# endif /* emacs */
-
-/* If your stack is a linked list of frames, you have to
- provide an "address metric" ADDRESS_FUNCTION macro. */
-
-# if defined (CRAY) && defined (CRAY_STACKSEG_END)
-long i00afunc ();
-# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
-# else
-# define ADDRESS_FUNCTION(arg) &(arg)
-# endif
-
-/* Define STACK_DIRECTION if you know the direction of stack
- growth for your system; otherwise it will be automatically
- deduced at run-time.
-
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-
-# ifndef STACK_DIRECTION
-# define STACK_DIRECTION 0 /* Direction unknown. */
-# endif
-
-# if STACK_DIRECTION != 0
-
-# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
-
-# else /* STACK_DIRECTION == 0; need run-time code. */
-
-static int stack_dir; /* 1 or -1 once known. */
-# define STACK_DIR stack_dir
-
-static void
-find_stack_direction (void)
-{
- static char *addr = NULL; /* Address of first `dummy', once known. */
- auto char dummy; /* To get stack address. */
-
- if (addr == NULL)
- { /* Initial entry. */
- addr = ADDRESS_FUNCTION (dummy);
-
- find_stack_direction (); /* Recurse once. */
- }
- else
- {
- /* Second entry. */
- if (ADDRESS_FUNCTION (dummy) > addr)
- stack_dir = 1; /* Stack grew upward. */
- else
- stack_dir = -1; /* Stack grew downward. */
- }
-}
-
-# endif /* STACK_DIRECTION == 0 */
-
-/* An "alloca header" is used to:
- (a) chain together all alloca'ed blocks;
- (b) keep track of stack depth.
-
- It is very important that sizeof(header) agree with malloc
- alignment chunk size. The following default should work okay. */
-
-# ifndef ALIGN_SIZE
-# define ALIGN_SIZE sizeof(double)
-# endif
-
-typedef union hdr
-{
- char align[ALIGN_SIZE]; /* To force sizeof(header). */
- struct
- {
- union hdr *next; /* For chaining headers. */
- char *deep; /* For stack depth measure. */
- } h;
-} header;
-
-static header *last_alloca_header = NULL; /* -> last alloca header. */
-
-/* Return a pointer to at least SIZE bytes of storage,
- which will be automatically reclaimed upon exit from
- the procedure that called alloca. Originally, this space
- was supposed to be taken from the current stack frame of the
- caller, but that method cannot be made to work for some
- implementations of C, for example under Gould's UTX/32. */
-
-void *
-alloca (size_t size)
-{
- auto char probe; /* Probes stack depth: */
- register char *depth = ADDRESS_FUNCTION (probe);
-
-# if STACK_DIRECTION == 0
- if (STACK_DIR == 0) /* Unknown growth direction. */
- find_stack_direction ();
-# endif
-
- /* Reclaim garbage, defined as all alloca'd storage that
- was allocated from deeper in the stack than currently. */
-
- {
- register header *hp; /* Traverses linked list. */
-
-# ifdef emacs
- BLOCK_INPUT;
-# endif
-
- for (hp = last_alloca_header; hp != NULL;)
- if ((STACK_DIR > 0 && hp->h.deep > depth)
- || (STACK_DIR < 0 && hp->h.deep < depth))
- {
- register header *np = hp->h.next;
-
- free (hp); /* Collect garbage. */
-
- hp = np; /* -> next header. */
- }
- else
- break; /* Rest are not deeper. */
-
- last_alloca_header = hp; /* -> last valid storage. */
-
-# ifdef emacs
- UNBLOCK_INPUT;
-# endif
- }
-
- if (size == 0)
- return NULL; /* No allocation required. */
-
- /* Allocate combined header + user data storage. */
-
- {
- /* Address of header. */
- register header *new;
-
- size_t combined_size = sizeof (header) + size;
- if (combined_size < sizeof (header))
- memory_full ();
-
- new = malloc (combined_size);
-
- if (! new)
- memory_full ();
-
- new->h.next = last_alloca_header;
- new->h.deep = depth;
-
- last_alloca_header = new;
-
- /* User storage begins just after header. */
-
- return (void *) (new + 1);
- }
-}
-
-# if defined (CRAY) && defined (CRAY_STACKSEG_END)
-
-# ifdef DEBUG_I00AFUNC
-# include <stdio.h>
-# endif
-
-# ifndef CRAY_STACK
-# define CRAY_STACK
-# ifndef CRAY2
-/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
-struct stack_control_header
- {
- long shgrow:32; /* Number of times stack has grown. */
- long shaseg:32; /* Size of increments to stack. */
- long shhwm:32; /* High water mark of stack. */
- long shsize:32; /* Current size of stack (all segments). */
- };
-
-/* The stack segment linkage control information occurs at
- the high-address end of a stack segment. (The stack
- grows from low addresses to high addresses.) The initial
- part of the stack segment linkage control information is
- 0200 (octal) words. This provides for register storage
- for the routine which overflows the stack. */
-
-struct stack_segment_linkage
- {
- long ss[0200]; /* 0200 overflow words. */
- long sssize:32; /* Number of words in this segment. */
- long ssbase:32; /* Offset to stack base. */
- long:32;
- long sspseg:32; /* Offset to linkage control of previous
- segment of stack. */
- long:32;
- long sstcpt:32; /* Pointer to task common address block. */
- long sscsnm; /* Private control structure number for
- microtasking. */
- long ssusr1; /* Reserved for user. */
- long ssusr2; /* Reserved for user. */
- long sstpid; /* Process ID for pid based multi-tasking. */
- long ssgvup; /* Pointer to multitasking thread giveup. */
- long sscray[7]; /* Reserved for Cray Research. */
- long ssa0;
- long ssa1;
- long ssa2;
- long ssa3;
- long ssa4;
- long ssa5;
- long ssa6;
- long ssa7;
- long sss0;
- long sss1;
- long sss2;
- long sss3;
- long sss4;
- long sss5;
- long sss6;
- long sss7;
- };
-
-# else /* CRAY2 */
-/* The following structure defines the vector of words
- returned by the STKSTAT library routine. */
-struct stk_stat
- {
- long now; /* Current total stack size. */
- long maxc; /* Amount of contiguous space which would
- be required to satisfy the maximum
- stack demand to date. */
- long high_water; /* Stack high-water mark. */
- long overflows; /* Number of stack overflow ($STKOFEN) calls. */
- long hits; /* Number of internal buffer hits. */
- long extends; /* Number of block extensions. */
- long stko_mallocs; /* Block allocations by $STKOFEN. */
- long underflows; /* Number of stack underflow calls ($STKRETN). */
- long stko_free; /* Number of deallocations by $STKRETN. */
- long stkm_free; /* Number of deallocations by $STKMRET. */
- long segments; /* Current number of stack segments. */
- long maxs; /* Maximum number of stack segments so far. */
- long pad_size; /* Stack pad size. */
- long current_address; /* Current stack segment address. */
- long current_size; /* Current stack segment size. This
- number is actually corrupted by STKSTAT to
- include the fifteen word trailer area. */
- long initial_address; /* Address of initial segment. */
- long initial_size; /* Size of initial segment. */
- };
-
-/* The following structure describes the data structure which trails
- any stack segment. I think that the description in 'asdef' is
- out of date. I only describe the parts that I am sure about. */
-
-struct stk_trailer
- {
- long this_address; /* Address of this block. */
- long this_size; /* Size of this block (does not include
- this trailer). */
- long unknown2;
- long unknown3;
- long link; /* Address of trailer block of previous
- segment. */
- long unknown5;
- long unknown6;
- long unknown7;
- long unknown8;
- long unknown9;
- long unknown10;
- long unknown11;
- long unknown12;
- long unknown13;
- long unknown14;
- };
-
-# endif /* CRAY2 */
-# endif /* not CRAY_STACK */
-
-# ifdef CRAY2
-/* Determine a "stack measure" for an arbitrary ADDRESS.
- I doubt that "lint" will like this much. */
-
-static long
-i00afunc (long *address)
-{
- struct stk_stat status;
- struct stk_trailer *trailer;
- long *block, size;
- long result = 0;
-
- /* We want to iterate through all of the segments. The first
- step is to get the stack status structure. We could do this
- more quickly and more directly, perhaps, by referencing the
- $LM00 common block, but I know that this works. */
-
- STKSTAT (&status);
-
- /* Set up the iteration. */
-
- trailer = (struct stk_trailer *) (status.current_address
- + status.current_size
- - 15);
-
- /* There must be at least one stack segment. Therefore it is
- a fatal error if "trailer" is null. */
-
- if (trailer == 0)
- abort ();
-
- /* Discard segments that do not contain our argument address. */
-
- while (trailer != 0)
- {
- block = (long *) trailer->this_address;
- size = trailer->this_size;
- if (block == 0 || size == 0)
- abort ();
- trailer = (struct stk_trailer *) trailer->link;
- if ((block <= address) && (address < (block + size)))
- break;
- }
-
- /* Set the result to the offset in this segment and add the sizes
- of all predecessor segments. */
-
- result = address - block;
-
- if (trailer == 0)
- {
- return result;
- }
-
- do
- {
- if (trailer->this_size <= 0)
- abort ();
- result += trailer->this_size;
- trailer = (struct stk_trailer *) trailer->link;
- }
- while (trailer != 0);
-
- /* We are done. Note that if you present a bogus address (one
- not in any segment), you will get a different number back, formed
- from subtracting the address of the first block. This is probably
- not what you want. */
-
- return (result);
-}
-
-# else /* not CRAY2 */
-/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
- Determine the number of the cell within the stack,
- given the address of the cell. The purpose of this
- routine is to linearize, in some sense, stack addresses
- for alloca. */
-
-static long
-i00afunc (long address)
-{
- long stkl = 0;
-
- long size, pseg, this_segment, stack;
- long result = 0;
-
- struct stack_segment_linkage *ssptr;
-
- /* Register B67 contains the address of the end of the
- current stack segment. If you (as a subprogram) store
- your registers on the stack and find that you are past
- the contents of B67, you have overflowed the segment.
-
- B67 also points to the stack segment linkage control
- area, which is what we are really interested in. */
-
- stkl = CRAY_STACKSEG_END ();
- ssptr = (struct stack_segment_linkage *) stkl;
-
- /* If one subtracts 'size' from the end of the segment,
- one has the address of the first word of the segment.
-
- If this is not the first segment, 'pseg' will be
- nonzero. */
-
- pseg = ssptr->sspseg;
- size = ssptr->sssize;
-
- this_segment = stkl - size;
-
- /* It is possible that calling this routine itself caused
- a stack overflow. Discard stack segments which do not
- contain the target address. */
-
- while (!(this_segment <= address && address <= stkl))
- {
-# ifdef DEBUG_I00AFUNC
- fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
-# endif
- if (pseg == 0)
- break;
- stkl = stkl - pseg;
- ssptr = (struct stack_segment_linkage *) stkl;
- size = ssptr->sssize;
- pseg = ssptr->sspseg;
- this_segment = stkl - size;
- }
-
- result = address - this_segment;
-
- /* If you subtract pseg from the current end of the stack,
- you get the address of the previous stack segment's end.
- This seems a little convoluted to me, but I'll bet you save
- a cycle somewhere. */
-
- while (pseg != 0)
- {
-# ifdef DEBUG_I00AFUNC
- fprintf (stderr, "%011o %011o\n", pseg, size);
-# endif
- stkl = stkl - pseg;
- ssptr = (struct stack_segment_linkage *) stkl;
- size = ssptr->sssize;
- pseg = ssptr->sspseg;
- result += size;
- }
- return (result);
-}
-
-# endif /* not CRAY2 */
-# endif /* CRAY */
-
-# endif /* no alloca */
-#endif /* not GCC version 2 */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/alloca_.h b/xbmc/screensavers/rsxs-0.9/lib/alloca_.h
deleted file mode 100644
index dd0b3e98f5..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/alloca_.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Memory allocation on the stack.
-
- Copyright (C) 1995, 1999, 2001, 2002, 2003, 2004, 2006 Free Software
- Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public
- License along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA. */
-
-/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
- means there is a real alloca function. */
-#ifndef _GNULIB_ALLOCA_H
-# define _GNULIB_ALLOCA_H
-
-/* alloca (N) returns a pointer to N bytes of memory
- allocated on the stack, which will last until the function returns.
- Use of alloca should be avoided:
- - inside arguments of function calls - undefined behaviour,
- - in inline functions - the allocation may actually last until the
- calling function returns,
- - for huge N (say, N >= 65536) - you never know how large (or small)
- the stack is, and when the stack cannot fulfill the memory allocation
- request, the program just crashes.
- */
-
-#ifndef alloca
-# ifdef __GNUC__
-# define alloca __builtin_alloca
-# elif defined _AIX
-# define alloca __alloca
-# elif defined _MSC_VER
-# include <malloc.h>
-# define alloca _alloca
-# else
-# include <stddef.h>
-# ifdef __cplusplus
-extern "C"
-# endif
-void *alloca (size_t);
-# endif
-#endif
-
-#endif /* _GNULIB_ALLOCA_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argp-ba.c b/xbmc/screensavers/rsxs-0.9/lib/argp-ba.c
deleted file mode 100644
index 8bb7309fde..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argp-ba.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Default definition for ARGP_PROGRAM_BUG_ADDRESS.
- Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* If set by the user program, it should point to string that is the
- bug-reporting address for the program. It will be printed by argp_help if
- the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help
- messages), embedded in a sentence that says something like `Report bugs to
- ADDR.'. */
-const char *argp_program_bug_address;
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argp-eexst.c b/xbmc/screensavers/rsxs-0.9/lib/argp-eexst.c
deleted file mode 100644
index bcab1c0c17..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argp-eexst.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Default definition for ARGP_ERR_EXIT_STATUS
- Copyright (C) 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <sysexits.h>
-
-#include "argp.h"
-
-/* The exit status that argp will use when exiting due to a parsing error.
- If not defined or set by the user program, this defaults to EX_USAGE from
- <sysexits.h>. */
-error_t argp_err_exit_status = EX_USAGE;
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argp-fmtstream.c b/xbmc/screensavers/rsxs-0.9/lib/argp-fmtstream.c
deleted file mode 100644
index 0dd9256f57..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argp-fmtstream.c
+++ /dev/null
@@ -1,435 +0,0 @@
-/* Word-wrapping and line-truncating streams
- Copyright (C) 1997-1999,2001,2002,2003,2005 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* This package emulates glibc `line_wrap_stream' semantics for systems that
- don't have that. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <ctype.h>
-
-#include "argp-fmtstream.h"
-#include "argp-namefrob.h"
-
-#ifndef ARGP_FMTSTREAM_USE_LINEWRAP
-
-#ifndef isblank
-#define isblank(ch) ((ch)==' ' || (ch)=='\t')
-#endif
-
-#if defined _LIBC && defined USE_IN_LIBIO
-# include <wchar.h>
-# include <libio/libioP.h>
-# define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
-#endif
-
-#define INIT_BUF_SIZE 200
-#define PRINTF_SIZE_GUESS 150
-
-/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
- written on it with LMARGIN spaces and limits them to RMARGIN columns
- total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
- replacing the whitespace before them with a newline and WMARGIN spaces.
- Otherwise, chars beyond RMARGIN are simply dropped until a newline.
- Returns NULL if there was an error. */
-argp_fmtstream_t
-__argp_make_fmtstream (FILE *stream,
- size_t lmargin, size_t rmargin, ssize_t wmargin)
-{
- argp_fmtstream_t fs;
-
- fs = (struct argp_fmtstream *) malloc (sizeof (struct argp_fmtstream));
- if (fs != NULL)
- {
- fs->stream = stream;
-
- fs->lmargin = lmargin;
- fs->rmargin = rmargin;
- fs->wmargin = wmargin;
- fs->point_col = 0;
- fs->point_offs = 0;
-
- fs->buf = (char *) malloc (INIT_BUF_SIZE);
- if (! fs->buf)
- {
- free (fs);
- fs = 0;
- }
- else
- {
- fs->p = fs->buf;
- fs->end = fs->buf + INIT_BUF_SIZE;
- }
- }
-
- return fs;
-}
-#if 0
-/* Not exported. */
-#ifdef weak_alias
-weak_alias (__argp_make_fmtstream, argp_make_fmtstream)
-#endif
-#endif
-
-/* Flush FS to its stream, and free it (but don't close the stream). */
-void
-__argp_fmtstream_free (argp_fmtstream_t fs)
-{
- __argp_fmtstream_update (fs);
- if (fs->p > fs->buf)
- {
-#ifdef USE_IN_LIBIO
- __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
-#else
- fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
-#endif
- }
- free (fs->buf);
- free (fs);
-}
-#if 0
-/* Not exported. */
-#ifdef weak_alias
-weak_alias (__argp_fmtstream_free, argp_fmtstream_free)
-#endif
-#endif
-
-/* Process FS's buffer so that line wrapping is done from POINT_OFFS to the
- end of its buffer. This code is mostly from glibc stdio/linewrap.c. */
-void
-__argp_fmtstream_update (argp_fmtstream_t fs)
-{
- char *buf, *nl;
- size_t len;
-
- /* Scan the buffer for newlines. */
- buf = fs->buf + fs->point_offs;
- while (buf < fs->p)
- {
- size_t r;
-
- if (fs->point_col == 0 && fs->lmargin != 0)
- {
- /* We are starting a new line. Print spaces to the left margin. */
- const size_t pad = fs->lmargin;
- if (fs->p + pad < fs->end)
- {
- /* We can fit in them in the buffer by moving the
- buffer text up and filling in the beginning. */
- memmove (buf + pad, buf, fs->p - buf);
- fs->p += pad; /* Compensate for bigger buffer. */
- memset (buf, ' ', pad); /* Fill in the spaces. */
- buf += pad; /* Don't bother searching them. */
- }
- else
- {
- /* No buffer space for spaces. Must flush. */
- size_t i;
- for (i = 0; i < pad; i++)
- {
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (fs->stream, 0) > 0)
- putwc_unlocked (L' ', fs->stream);
- else
-#endif
- putc_unlocked (' ', fs->stream);
- }
- }
- fs->point_col = pad;
- }
-
- len = fs->p - buf;
- nl = memchr (buf, '\n', len);
-
- if (fs->point_col < 0)
- fs->point_col = 0;
-
- if (!nl)
- {
- /* The buffer ends in a partial line. */
-
- if (fs->point_col + len < fs->rmargin)
- {
- /* The remaining buffer text is a partial line and fits
- within the maximum line width. Advance point for the
- characters to be written and stop scanning. */
- fs->point_col += len;
- break;
- }
- else
- /* Set the end-of-line pointer for the code below to
- the end of the buffer. */
- nl = fs->p;
- }
- else if (fs->point_col + (nl - buf) < (ssize_t) fs->rmargin)
- {
- /* The buffer contains a full line that fits within the maximum
- line width. Reset point and scan the next line. */
- fs->point_col = 0;
- buf = nl + 1;
- continue;
- }
-
- /* This line is too long. */
- r = fs->rmargin - 1;
-
- if (fs->wmargin < 0)
- {
- /* Truncate the line by overwriting the excess with the
- newline and anything after it in the buffer. */
- if (nl < fs->p)
- {
- memmove (buf + (r - fs->point_col), nl, fs->p - nl);
- fs->p -= buf + (r - fs->point_col) - nl;
- /* Reset point for the next line and start scanning it. */
- fs->point_col = 0;
- buf += r + 1; /* Skip full line plus \n. */
- }
- else
- {
- /* The buffer ends with a partial line that is beyond the
- maximum line width. Advance point for the characters
- written, and discard those past the max from the buffer. */
- fs->point_col += len;
- fs->p -= fs->point_col - r;
- break;
- }
- }
- else
- {
- /* Do word wrap. Go to the column just past the maximum line
- width and scan back for the beginning of the word there.
- Then insert a line break. */
-
- char *p, *nextline;
- int i;
-
- p = buf + (r + 1 - fs->point_col);
- while (p >= buf && !isblank (*p))
- --p;
- nextline = p + 1; /* This will begin the next line. */
-
- if (nextline > buf)
- {
- /* Swallow separating blanks. */
- if (p >= buf)
- do
- --p;
- while (p >= buf && isblank (*p));
- nl = p + 1; /* The newline will replace the first blank. */
- }
- else
- {
- /* A single word that is greater than the maximum line width.
- Oh well. Put it on an overlong line by itself. */
- p = buf + (r + 1 - fs->point_col);
- /* Find the end of the long word. */
- if (p < nl)
- do
- ++p;
- while (p < nl && !isblank (*p));
- if (p == nl)
- {
- /* It already ends a line. No fussing required. */
- fs->point_col = 0;
- buf = nl + 1;
- continue;
- }
- /* We will move the newline to replace the first blank. */
- nl = p;
- /* Swallow separating blanks. */
- do
- ++p;
- while (isblank (*p));
- /* The next line will start here. */
- nextline = p;
- }
-
- /* Note: There are a bunch of tests below for
- NEXTLINE == BUF + LEN + 1; this case is where NL happens to fall
- at the end of the buffer, and NEXTLINE is in fact empty (and so
- we need not be careful to maintain its contents). */
-
- if ((nextline == buf + len + 1
- ? fs->end - nl < fs->wmargin + 1
- : nextline - (nl + 1) < fs->wmargin)
- && fs->p > nextline)
- {
- /* The margin needs more blanks than we removed. */
- if (fs->end - fs->p > fs->wmargin + 1)
- /* Make some space for them. */
- {
- size_t mv = fs->p - nextline;
- memmove (nl + 1 + fs->wmargin, nextline, mv);
- nextline = nl + 1 + fs->wmargin;
- len = nextline + mv - buf;
- *nl++ = '\n';
- }
- else
- /* Output the first line so we can use the space. */
- {
-#ifdef _LIBC
- __fxprintf (fs->stream, "%.*s\n",
- (int) (nl - fs->buf), fs->buf);
-#else
- if (nl > fs->buf)
- fwrite_unlocked (fs->buf, 1, nl - fs->buf, fs->stream);
- putc_unlocked ('\n', fs->stream);
-#endif
-
- len += buf - fs->buf;
- nl = buf = fs->buf;
- }
- }
- else
- /* We can fit the newline and blanks in before
- the next word. */
- *nl++ = '\n';
-
- if (nextline - nl >= fs->wmargin
- || (nextline == buf + len + 1 && fs->end - nextline >= fs->wmargin))
- /* Add blanks up to the wrap margin column. */
- for (i = 0; i < fs->wmargin; ++i)
- *nl++ = ' ';
- else
- for (i = 0; i < fs->wmargin; ++i)
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (fs->stream, 0) > 0)
- putwc_unlocked (L' ', fs->stream);
- else
-#endif
- putc_unlocked (' ', fs->stream);
-
- /* Copy the tail of the original buffer into the current buffer
- position. */
- if (nl < nextline)
- memmove (nl, nextline, buf + len - nextline);
- len -= nextline - buf;
-
- /* Continue the scan on the remaining lines in the buffer. */
- buf = nl;
-
- /* Restore bufp to include all the remaining text. */
- fs->p = nl + len;
-
- /* Reset the counter of what has been output this line. If wmargin
- is 0, we want to avoid the lmargin getting added, so we set
- point_col to a magic value of -1 in that case. */
- fs->point_col = fs->wmargin ? fs->wmargin : -1;
- }
- }
-
- /* Remember that we've scanned as far as the end of the buffer. */
- fs->point_offs = fs->p - fs->buf;
-}
-
-/* Ensure that FS has space for AMOUNT more bytes in its buffer, either by
- growing the buffer, or by flushing it. True is returned iff we succeed. */
-int
-__argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount)
-{
- if ((size_t) (fs->end - fs->p) < amount)
- {
- ssize_t wrote;
-
- /* Flush FS's buffer. */
- __argp_fmtstream_update (fs);
-
-#ifdef _LIBC
- __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
- wrote = fs->p - fs->buf;
-#else
- wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
-#endif
- if (wrote == fs->p - fs->buf)
- {
- fs->p = fs->buf;
- fs->point_offs = 0;
- }
- else
- {
- fs->p -= wrote;
- fs->point_offs -= wrote;
- memmove (fs->buf, fs->buf + wrote, fs->p - fs->buf);
- return 0;
- }
-
- if ((size_t) (fs->end - fs->buf) < amount)
- /* Gotta grow the buffer. */
- {
- size_t old_size = fs->end - fs->buf;
- size_t new_size = old_size + amount;
- char *new_buf;
-
- if (new_size < old_size || ! (new_buf = realloc (fs->buf, new_size)))
- {
- __set_errno (ENOMEM);
- return 0;
- }
-
- fs->buf = new_buf;
- fs->end = new_buf + new_size;
- fs->p = fs->buf;
- }
- }
-
- return 1;
-}
-
-ssize_t
-__argp_fmtstream_printf (struct argp_fmtstream *fs, const char *fmt, ...)
-{
- int out;
- size_t avail;
- size_t size_guess = PRINTF_SIZE_GUESS; /* How much space to reserve. */
-
- do
- {
- va_list args;
-
- if (! __argp_fmtstream_ensure (fs, size_guess))
- return -1;
-
- va_start (args, fmt);
- avail = fs->end - fs->p;
- out = __vsnprintf (fs->p, avail, fmt, args);
- va_end (args);
- if ((size_t) out >= avail)
- size_guess = out + 1;
- }
- while ((size_t) out >= avail);
-
- fs->p += out;
-
- return out;
-}
-#if 0
-/* Not exported. */
-#ifdef weak_alias
-weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf)
-#endif
-#endif
-
-#endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argp-fmtstream.h b/xbmc/screensavers/rsxs-0.9/lib/argp-fmtstream.h
deleted file mode 100644
index 92eda3bc87..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argp-fmtstream.h
+++ /dev/null
@@ -1,301 +0,0 @@
-/* Word-wrapping and line-truncating streams.
- Copyright (C) 1997, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* This package emulates glibc `line_wrap_stream' semantics for systems that
- don't have that. If the system does have it, it is just a wrapper for
- that. This header file is only used internally while compiling argp, and
- shouldn't be installed. */
-
-#ifndef _ARGP_FMTSTREAM_H
-#define _ARGP_FMTSTREAM_H
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
-# define __attribute__(Spec) /* empty */
-# endif
-/* The __-protected variants of `format' and `printf' attributes
- are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || __STRICT_ANSI__
-# define __format__ format
-# define __printf__ printf
-# endif
-#endif
-
-#if (_LIBC - 0 && !defined (USE_IN_LIBIO)) \
- || (defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H))
-/* line_wrap_stream is available, so use that. */
-#define ARGP_FMTSTREAM_USE_LINEWRAP
-#endif
-
-#ifdef ARGP_FMTSTREAM_USE_LINEWRAP
-/* Just be a simple wrapper for line_wrap_stream; the semantics are
- *slightly* different, as line_wrap_stream doesn't actually make a new
- object, it just modifies the given stream (reversibly) to do
- line-wrapping. Since we control who uses this code, it doesn't matter. */
-
-#include <linewrap.h>
-
-typedef FILE *argp_fmtstream_t;
-
-#define argp_make_fmtstream line_wrap_stream
-#define __argp_make_fmtstream line_wrap_stream
-#define argp_fmtstream_free line_unwrap_stream
-#define __argp_fmtstream_free line_unwrap_stream
-
-#define __argp_fmtstream_putc(fs,ch) putc(ch,fs)
-#define argp_fmtstream_putc(fs,ch) putc(ch,fs)
-#define __argp_fmtstream_puts(fs,str) fputs(str,fs)
-#define argp_fmtstream_puts(fs,str) fputs(str,fs)
-#define __argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs)
-#define argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs)
-#define __argp_fmtstream_printf fprintf
-#define argp_fmtstream_printf fprintf
-
-#define __argp_fmtstream_lmargin line_wrap_lmargin
-#define argp_fmtstream_lmargin line_wrap_lmargin
-#define __argp_fmtstream_set_lmargin line_wrap_set_lmargin
-#define argp_fmtstream_set_lmargin line_wrap_set_lmargin
-#define __argp_fmtstream_rmargin line_wrap_rmargin
-#define argp_fmtstream_rmargin line_wrap_rmargin
-#define __argp_fmtstream_set_rmargin line_wrap_set_rmargin
-#define argp_fmtstream_set_rmargin line_wrap_set_rmargin
-#define __argp_fmtstream_wmargin line_wrap_wmargin
-#define argp_fmtstream_wmargin line_wrap_wmargin
-#define __argp_fmtstream_set_wmargin line_wrap_set_wmargin
-#define argp_fmtstream_set_wmargin line_wrap_set_wmargin
-#define __argp_fmtstream_point line_wrap_point
-#define argp_fmtstream_point line_wrap_point
-
-#else /* !ARGP_FMTSTREAM_USE_LINEWRAP */
-/* Guess we have to define our own version. */
-
-struct argp_fmtstream
-{
- FILE *stream; /* The stream we're outputting to. */
-
- size_t lmargin, rmargin; /* Left and right margins. */
- ssize_t wmargin; /* Margin to wrap to, or -1 to truncate. */
-
- /* Point in buffer to which we've processed for wrapping, but not output. */
- size_t point_offs;
- /* Output column at POINT_OFFS, or -1 meaning 0 but don't add lmargin. */
- ssize_t point_col;
-
- char *buf; /* Output buffer. */
- char *p; /* Current end of text in BUF. */
- char *end; /* Absolute end of BUF. */
-};
-
-typedef struct argp_fmtstream *argp_fmtstream_t;
-
-/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
- written on it with LMARGIN spaces and limits them to RMARGIN columns
- total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
- replacing the whitespace before them with a newline and WMARGIN spaces.
- Otherwise, chars beyond RMARGIN are simply dropped until a newline.
- Returns NULL if there was an error. */
-extern argp_fmtstream_t __argp_make_fmtstream (FILE *__stream,
- size_t __lmargin,
- size_t __rmargin,
- ssize_t __wmargin);
-extern argp_fmtstream_t argp_make_fmtstream (FILE *__stream,
- size_t __lmargin,
- size_t __rmargin,
- ssize_t __wmargin);
-
-/* Flush __FS to its stream, and free it (but don't close the stream). */
-extern void __argp_fmtstream_free (argp_fmtstream_t __fs);
-extern void argp_fmtstream_free (argp_fmtstream_t __fs);
-
-extern ssize_t __argp_fmtstream_printf (argp_fmtstream_t __fs,
- const char *__fmt, ...)
- __attribute__ ((__format__ (printf, 2, 3)));
-extern ssize_t argp_fmtstream_printf (argp_fmtstream_t __fs,
- const char *__fmt, ...)
- __attribute__ ((__format__ (printf, 2, 3)));
-
-extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
-extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
-
-extern int __argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str);
-extern int argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str);
-
-extern size_t __argp_fmtstream_write (argp_fmtstream_t __fs,
- const char *__str, size_t __len);
-extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
- const char *__str, size_t __len);
-
-/* Access macros for various bits of state. */
-#define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin)
-#define argp_fmtstream_rmargin(__fs) ((__fs)->rmargin)
-#define argp_fmtstream_wmargin(__fs) ((__fs)->wmargin)
-#define __argp_fmtstream_lmargin argp_fmtstream_lmargin
-#define __argp_fmtstream_rmargin argp_fmtstream_rmargin
-#define __argp_fmtstream_wmargin argp_fmtstream_wmargin
-
-/* Set __FS's left margin to LMARGIN and return the old value. */
-extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
- size_t __lmargin);
-extern size_t __argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
- size_t __lmargin);
-
-/* Set __FS's right margin to __RMARGIN and return the old value. */
-extern size_t argp_fmtstream_set_rmargin (argp_fmtstream_t __fs,
- size_t __rmargin);
-extern size_t __argp_fmtstream_set_rmargin (argp_fmtstream_t __fs,
- size_t __rmargin);
-
-/* Set __FS's wrap margin to __WMARGIN and return the old value. */
-extern size_t argp_fmtstream_set_wmargin (argp_fmtstream_t __fs,
- size_t __wmargin);
-extern size_t __argp_fmtstream_set_wmargin (argp_fmtstream_t __fs,
- size_t __wmargin);
-
-/* Return the column number of the current output point in __FS. */
-extern size_t argp_fmtstream_point (argp_fmtstream_t __fs);
-extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs);
-
-/* Internal routines. */
-extern void _argp_fmtstream_update (argp_fmtstream_t __fs);
-extern void __argp_fmtstream_update (argp_fmtstream_t __fs);
-extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
-extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
-
-#ifdef __OPTIMIZE__
-/* Inline versions of above routines. */
-
-#if !_LIBC
-#define __argp_fmtstream_putc argp_fmtstream_putc
-#define __argp_fmtstream_puts argp_fmtstream_puts
-#define __argp_fmtstream_write argp_fmtstream_write
-#define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin
-#define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin
-#define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin
-#define __argp_fmtstream_point argp_fmtstream_point
-#define __argp_fmtstream_update _argp_fmtstream_update
-#define __argp_fmtstream_ensure _argp_fmtstream_ensure
-#endif
-
-#ifndef ARGP_FS_EI
-#define ARGP_FS_EI extern inline __attribute__ ((__gnu_inline__))
-#endif
-
-ARGP_FS_EI size_t
-__argp_fmtstream_write (argp_fmtstream_t __fs,
- const char *__str, size_t __len)
-{
- if (__fs->p + __len <= __fs->end || __argp_fmtstream_ensure (__fs, __len))
- {
- memcpy (__fs->p, __str, __len);
- __fs->p += __len;
- return __len;
- }
- else
- return 0;
-}
-
-ARGP_FS_EI int
-__argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str)
-{
- size_t __len = strlen (__str);
- if (__len)
- {
- size_t __wrote = __argp_fmtstream_write (__fs, __str, __len);
- return __wrote == __len ? 0 : -1;
- }
- else
- return 0;
-}
-
-ARGP_FS_EI int
-__argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch)
-{
- if (__fs->p < __fs->end || __argp_fmtstream_ensure (__fs, 1))
- return *__fs->p++ = __ch;
- else
- return EOF;
-}
-
-/* Set __FS's left margin to __LMARGIN and return the old value. */
-ARGP_FS_EI size_t
-__argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, size_t __lmargin)
-{
- size_t __old;
- if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
- __argp_fmtstream_update (__fs);
- __old = __fs->lmargin;
- __fs->lmargin = __lmargin;
- return __old;
-}
-
-/* Set __FS's right margin to __RMARGIN and return the old value. */
-ARGP_FS_EI size_t
-__argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, size_t __rmargin)
-{
- size_t __old;
- if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
- __argp_fmtstream_update (__fs);
- __old = __fs->rmargin;
- __fs->rmargin = __rmargin;
- return __old;
-}
-
-/* Set FS's wrap margin to __WMARGIN and return the old value. */
-ARGP_FS_EI size_t
-__argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, size_t __wmargin)
-{
- size_t __old;
- if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
- __argp_fmtstream_update (__fs);
- __old = __fs->wmargin;
- __fs->wmargin = __wmargin;
- return __old;
-}
-
-/* Return the column number of the current output point in __FS. */
-ARGP_FS_EI size_t
-__argp_fmtstream_point (argp_fmtstream_t __fs)
-{
- if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
- __argp_fmtstream_update (__fs);
- return __fs->point_col >= 0 ? __fs->point_col : 0;
-}
-
-#if !_LIBC
-#undef __argp_fmtstream_putc
-#undef __argp_fmtstream_puts
-#undef __argp_fmtstream_write
-#undef __argp_fmtstream_set_lmargin
-#undef __argp_fmtstream_set_rmargin
-#undef __argp_fmtstream_set_wmargin
-#undef __argp_fmtstream_point
-#undef __argp_fmtstream_update
-#undef __argp_fmtstream_ensure
-#endif
-
-#endif /* __OPTIMIZE__ */
-
-#endif /* ARGP_FMTSTREAM_USE_LINEWRAP */
-
-#endif /* argp-fmtstream.h */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argp-fs-xinl.c b/xbmc/screensavers/rsxs-0.9/lib/argp-fs-xinl.c
deleted file mode 100644
index 3b4c917e02..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argp-fs-xinl.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Real definitions for extern inline functions in argp-fmtstream.h
- Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#define ARGP_FS_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
-#include "argp-fmtstream.h"
-
-#if 0
-/* Not exported. */
-/* Add weak aliases. */
-#if _LIBC - 0 && !defined (ARGP_FMTSTREAM_USE_LINEWRAP) && defined (weak_alias)
-
-weak_alias (__argp_fmtstream_putc, argp_fmtstream_putc)
-weak_alias (__argp_fmtstream_puts, argp_fmtstream_puts)
-weak_alias (__argp_fmtstream_write, argp_fmtstream_write)
-weak_alias (__argp_fmtstream_set_lmargin, argp_fmtstream_set_lmargin)
-weak_alias (__argp_fmtstream_set_rmargin, argp_fmtstream_set_rmargin)
-weak_alias (__argp_fmtstream_set_wmargin, argp_fmtstream_set_wmargin)
-weak_alias (__argp_fmtstream_point, argp_fmtstream_point)
-
-#endif
-#endif
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argp-help.c b/xbmc/screensavers/rsxs-0.9/lib/argp-help.c
deleted file mode 100644
index 0dce126c66..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argp-help.c
+++ /dev/null
@@ -1,1930 +0,0 @@
-/* Hierarchial argument parsing help output
- Copyright (C) 1995-2003, 2004, 2005 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <alloca.h>
-#include <errno.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <limits.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
-
-#ifdef _LIBC
-# include <libintl.h>
-# undef dgettext
-# define dgettext(domain, msgid) \
- INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
-#else
-# include "gettext.h"
-#endif
-
-#include "argp.h"
-#include "argp-fmtstream.h"
-#include "argp-namefrob.h"
-
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
-#endif
-
-/* User-selectable (using an environment variable) formatting parameters.
-
- These may be specified in an environment variable called `ARGP_HELP_FMT',
- with a contents like: VAR1=VAL1,VAR2=VAL2,BOOLVAR2,no-BOOLVAR2
- Where VALn must be a positive integer. The list of variables is in the
- UPARAM_NAMES vector, below. */
-
-/* Default parameters. */
-#define DUP_ARGS 0 /* True if option argument can be duplicated. */
-#define DUP_ARGS_NOTE 1 /* True to print a note about duplicate args. */
-#define SHORT_OPT_COL 2 /* column in which short options start */
-#define LONG_OPT_COL 6 /* column in which long options start */
-#define DOC_OPT_COL 2 /* column in which doc options start */
-#define OPT_DOC_COL 29 /* column in which option text starts */
-#define HEADER_COL 1 /* column in which group headers are printed */
-#define USAGE_INDENT 12 /* indentation of wrapped usage lines */
-#define RMARGIN 79 /* right margin used for wrapping */
-
-/* User-selectable (using an environment variable) formatting parameters.
- They must all be of type `int' for the parsing code to work. */
-struct uparams
-{
- /* If true, arguments for an option are shown with both short and long
- options, even when a given option has both, e.g. `-x ARG, --longx=ARG'.
- If false, then if an option has both, the argument is only shown with
- the long one, e.g., `-x, --longx=ARG', and a message indicating that
- this really means both is printed below the options. */
- int dup_args;
-
- /* This is true if when DUP_ARGS is false, and some duplicate arguments have
- been suppressed, an explanatory message should be printed. */
- int dup_args_note;
-
- /* Various output columns. */
- int short_opt_col; /* column in which short options start */
- int long_opt_col; /* column in which long options start */
- int doc_opt_col; /* column in which doc options start */
- int opt_doc_col; /* column in which option text starts */
- int header_col; /* column in which group headers are printed */
- int usage_indent; /* indentation of wrapped usage lines */
- int rmargin; /* right margin used for wrapping */
-
- int valid; /* True when the values in here are valid. */
-};
-
-/* This is a global variable, as user options are only ever read once. */
-static struct uparams uparams = {
- DUP_ARGS, DUP_ARGS_NOTE,
- SHORT_OPT_COL, LONG_OPT_COL, DOC_OPT_COL, OPT_DOC_COL, HEADER_COL,
- USAGE_INDENT, RMARGIN,
- 0
-};
-
-/* A particular uparam, and what the user name is. */
-struct uparam_name
-{
- const char *name; /* User name. */
- int is_bool; /* Whether it's `boolean'. */
- size_t uparams_offs; /* Location of the (int) field in UPARAMS. */
-};
-
-/* The name-field mappings we know about. */
-static const struct uparam_name uparam_names[] =
-{
- { "dup-args", 1, offsetof (struct uparams, dup_args) },
- { "dup-args-note", 1, offsetof (struct uparams, dup_args_note) },
- { "short-opt-col", 0, offsetof (struct uparams, short_opt_col) },
- { "long-opt-col", 0, offsetof (struct uparams, long_opt_col) },
- { "doc-opt-col", 0, offsetof (struct uparams, doc_opt_col) },
- { "opt-doc-col", 0, offsetof (struct uparams, opt_doc_col) },
- { "header-col", 0, offsetof (struct uparams, header_col) },
- { "usage-indent", 0, offsetof (struct uparams, usage_indent) },
- { "rmargin", 0, offsetof (struct uparams, rmargin) },
- { 0 }
-};
-
-static void
-validate_uparams (const struct argp_state *state, struct uparams *upptr)
-{
- const struct uparam_name *up;
-
- for (up = uparam_names; up->name; up++)
- {
- if (up->is_bool
- || up->uparams_offs == offsetof (struct uparams, rmargin))
- continue;
- if (*(int *)((char *)upptr + up->uparams_offs) >= upptr->rmargin)
- {
- __argp_failure (state, 0, 0,
- dgettext (state->root_argp->argp_domain,
- "\
-ARGP_HELP_FMT: %s value is less than or equal to %s"),
- "rmargin", up->name);
- return;
- }
- }
- uparams = *upptr;
- uparams.valid = 1;
-}
-
-/* Read user options from the environment, and fill in UPARAMS appropiately. */
-static void
-fill_in_uparams (const struct argp_state *state)
-{
- const char *var = getenv ("ARGP_HELP_FMT");
- struct uparams new_params = uparams;
-
-#define SKIPWS(p) do { while (isspace (*p)) p++; } while (0);
-
- if (var)
- {
- /* Parse var. */
- while (*var)
- {
- SKIPWS (var);
-
- if (isalpha (*var))
- {
- size_t var_len;
- const struct uparam_name *un;
- int unspec = 0, val = 0;
- const char *arg = var;
-
- while (isalnum (*arg) || *arg == '-' || *arg == '_')
- arg++;
- var_len = arg - var;
-
- SKIPWS (arg);
-
- if (*arg == '\0' || *arg == ',')
- unspec = 1;
- else if (*arg == '=')
- {
- arg++;
- SKIPWS (arg);
- }
-
- if (unspec)
- {
- if (var[0] == 'n' && var[1] == 'o' && var[2] == '-')
- {
- val = 0;
- var += 3;
- var_len -= 3;
- }
- else
- val = 1;
- }
- else if (isdigit (*arg))
- {
- val = atoi (arg);
- while (isdigit (*arg))
- arg++;
- SKIPWS (arg);
- }
-
- for (un = uparam_names; un->name; un++)
- if (strlen (un->name) == var_len
- && strncmp (var, un->name, var_len) == 0)
- {
- if (unspec && !un->is_bool)
- __argp_failure (state, 0, 0,
- dgettext (state->root_argp->argp_domain,
- "\
-%.*s: ARGP_HELP_FMT parameter requires a value"),
- (int) var_len, var);
- else if (val < 0)
- __argp_failure (state, 0, 0,
- dgettext (state->root_argp->argp_domain,
- "\
-%.*s: ARGP_HELP_FMT parameter must be positive"),
- (int) var_len, var);
- else
- *(int *)((char *)&new_params + un->uparams_offs) = val;
- break;
- }
- if (! un->name)
- __argp_failure (state, 0, 0,
- dgettext (state->root_argp->argp_domain, "\
-%.*s: Unknown ARGP_HELP_FMT parameter"),
- (int) var_len, var);
-
- var = arg;
- if (*var == ',')
- var++;
- }
- else if (*var)
- {
- __argp_failure (state, 0, 0,
- dgettext (state->root_argp->argp_domain,
- "Garbage in ARGP_HELP_FMT: %s"), var);
- break;
- }
- }
- validate_uparams (state, &new_params);
- }
-}
-
-/* Returns true if OPT hasn't been marked invisible. Visibility only affects
- whether OPT is displayed or used in sorting, not option shadowing. */
-#define ovisible(opt) (! ((opt)->flags & OPTION_HIDDEN))
-
-/* Returns true if OPT is an alias for an earlier option. */
-#define oalias(opt) ((opt)->flags & OPTION_ALIAS)
-
-/* Returns true if OPT is an documentation-only entry. */
-#define odoc(opt) ((opt)->flags & OPTION_DOC)
-
-/* Returns true if OPT should not be translated */
-#define onotrans(opt) ((opt)->flags & OPTION_NO_TRANS)
-
-/* Returns true if OPT is the end-of-list marker for a list of options. */
-#define oend(opt) __option_is_end (opt)
-
-/* Returns true if OPT has a short option. */
-#define oshort(opt) __option_is_short (opt)
-
-/*
- The help format for a particular option is like:
-
- -xARG, -yARG, --long1=ARG, --long2=ARG Documentation...
-
- Where ARG will be omitted if there's no argument, for this option, or
- will be surrounded by "[" and "]" appropiately if the argument is
- optional. The documentation string is word-wrapped appropiately, and if
- the list of options is long enough, it will be started on a separate line.
- If there are no short options for a given option, the first long option is
- indented slighly in a way that's supposed to make most long options appear
- to be in a separate column.
-
- For example, the following output (from ps):
-
- -p PID, --pid=PID List the process PID
- --pgrp=PGRP List processes in the process group PGRP
- -P, -x, --no-parent Include processes without parents
- -Q, --all-fields Don't elide unusable fields (normally if there's
- some reason ps can't print a field for any
- process, it's removed from the output entirely)
- -r, --reverse, --gratuitously-long-reverse-option
- Reverse the order of any sort
- --session[=SID] Add the processes from the session SID (which
- defaults to the sid of the current process)
-
- Here are some more options:
- -f ZOT, --foonly=ZOT Glork a foonly
- -z, --zaza Snit a zar
-
- -?, --help Give this help list
- --usage Give a short usage message
- -V, --version Print program version
-
- The struct argp_option array for the above could look like:
-
- {
- {"pid", 'p', "PID", 0, "List the process PID"},
- {"pgrp", OPT_PGRP, "PGRP", 0, "List processes in the process group PGRP"},
- {"no-parent", 'P', 0, 0, "Include processes without parents"},
- {0, 'x', 0, OPTION_ALIAS},
- {"all-fields",'Q', 0, 0, "Don't elide unusable fields (normally"
- " if there's some reason ps can't"
- " print a field for any process, it's"
- " removed from the output entirely)" },
- {"reverse", 'r', 0, 0, "Reverse the order of any sort"},
- {"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS},
- {"session", OPT_SESS, "SID", OPTION_ARG_OPTIONAL,
- "Add the processes from the session"
- " SID (which defaults to the sid of"
- " the current process)" },
-
- {0,0,0,0, "Here are some more options:"},
- {"foonly", 'f', "ZOT", 0, "Glork a foonly"},
- {"zaza", 'z', 0, 0, "Snit a zar"},
-
- {0}
- }
-
- Note that the last three options are automatically supplied by argp_parse,
- unless you tell it not to with ARGP_NO_HELP.
-
-*/
-
-/* Returns true if CH occurs between BEG and END. */
-static int
-find_char (char ch, char *beg, char *end)
-{
- while (beg < end)
- if (*beg == ch)
- return 1;
- else
- beg++;
- return 0;
-}
-
-struct hol_cluster; /* fwd decl */
-
-struct hol_entry
-{
- /* First option. */
- const struct argp_option *opt;
- /* Number of options (including aliases). */
- unsigned num;
-
- /* A pointers into the HOL's short_options field, to the first short option
- letter for this entry. The order of the characters following this point
- corresponds to the order of options pointed to by OPT, and there are at
- most NUM. A short option recorded in a option following OPT is only
- valid if it occurs in the right place in SHORT_OPTIONS (otherwise it's
- probably been shadowed by some other entry). */
- char *short_options;
-
- /* Entries are sorted by their group first, in the order:
- 1, 2, ..., n, 0, -m, ..., -2, -1
- and then alphabetically within each group. The default is 0. */
- int group;
-
- /* The cluster of options this entry belongs to, or 0 if none. */
- struct hol_cluster *cluster;
-
- /* The argp from which this option came. */
- const struct argp *argp;
-};
-
-/* A cluster of entries to reflect the argp tree structure. */
-struct hol_cluster
-{
- /* A descriptive header printed before options in this cluster. */
- const char *header;
-
- /* Used to order clusters within the same group with the same parent,
- according to the order in which they occurred in the parent argp's child
- list. */
- int index;
-
- /* How to sort this cluster with respect to options and other clusters at the
- same depth (clusters always follow options in the same group). */
- int group;
-
- /* The cluster to which this cluster belongs, or 0 if it's at the base
- level. */
- struct hol_cluster *parent;
-
- /* The argp from which this cluster is (eventually) derived. */
- const struct argp *argp;
-
- /* The distance this cluster is from the root. */
- int depth;
-
- /* Clusters in a given hol are kept in a linked list, to make freeing them
- possible. */
- struct hol_cluster *next;
-};
-
-/* A list of options for help. */
-struct hol
-{
- /* An array of hol_entry's. */
- struct hol_entry *entries;
- /* The number of entries in this hol. If this field is zero, the others
- are undefined. */
- unsigned num_entries;
-
- /* A string containing all short options in this HOL. Each entry contains
- pointers into this string, so the order can't be messed with blindly. */
- char *short_options;
-
- /* Clusters of entries in this hol. */
- struct hol_cluster *clusters;
-};
-
-/* Create a struct hol from the options in ARGP. CLUSTER is the
- hol_cluster in which these entries occur, or 0, if at the root. */
-static struct hol *
-make_hol (const struct argp *argp, struct hol_cluster *cluster)
-{
- char *so;
- const struct argp_option *o;
- const struct argp_option *opts = argp->options;
- struct hol_entry *entry;
- unsigned num_short_options = 0;
- struct hol *hol = malloc (sizeof (struct hol));
-
- assert (hol);
-
- hol->num_entries = 0;
- hol->clusters = 0;
-
- if (opts)
- {
- int cur_group = 0;
-
- /* The first option must not be an alias. */
- assert (! oalias (opts));
-
- /* Calculate the space needed. */
- for (o = opts; ! oend (o); o++)
- {
- if (! oalias (o))
- hol->num_entries++;
- if (oshort (o))
- num_short_options++; /* This is an upper bound. */
- }
-
- hol->entries = malloc (sizeof (struct hol_entry) * hol->num_entries);
- hol->short_options = malloc (num_short_options + 1);
-
- assert (hol->entries && hol->short_options);
- if (SIZE_MAX <= UINT_MAX)
- assert (hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry));
-
- /* Fill in the entries. */
- so = hol->short_options;
- for (o = opts, entry = hol->entries; ! oend (o); entry++)
- {
- entry->opt = o;
- entry->num = 0;
- entry->short_options = so;
- entry->group = cur_group =
- o->group
- ? o->group
- : ((!o->name && !o->key)
- ? cur_group + 1
- : cur_group);
- entry->cluster = cluster;
- entry->argp = argp;
-
- do
- {
- entry->num++;
- if (oshort (o) && ! find_char (o->key, hol->short_options, so))
- /* O has a valid short option which hasn't already been used.*/
- *so++ = o->key;
- o++;
- }
- while (! oend (o) && oalias (o));
- }
- *so = '\0'; /* null terminated so we can find the length */
- }
-
- return hol;
-}
-
-/* Add a new cluster to HOL, with the given GROUP and HEADER (taken from the
- associated argp child list entry), INDEX, and PARENT, and return a pointer
- to it. ARGP is the argp that this cluster results from. */
-static struct hol_cluster *
-hol_add_cluster (struct hol *hol, int group, const char *header, int index,
- struct hol_cluster *parent, const struct argp *argp)
-{
- struct hol_cluster *cl = malloc (sizeof (struct hol_cluster));
- if (cl)
- {
- cl->group = group;
- cl->header = header;
-
- cl->index = index;
- cl->parent = parent;
- cl->argp = argp;
- cl->depth = parent ? parent->depth + 1 : 0;
-
- cl->next = hol->clusters;
- hol->clusters = cl;
- }
- return cl;
-}
-
-/* Free HOL and any resources it uses. */
-static void
-hol_free (struct hol *hol)
-{
- struct hol_cluster *cl = hol->clusters;
-
- while (cl)
- {
- struct hol_cluster *next = cl->next;
- free (cl);
- cl = next;
- }
-
- if (hol->num_entries > 0)
- {
- free (hol->entries);
- free (hol->short_options);
- }
-
- free (hol);
-}
-
-static int
-hol_entry_short_iterate (const struct hol_entry *entry,
- int (*func)(const struct argp_option *opt,
- const struct argp_option *real,
- const char *domain, void *cookie),
- const char *domain, void *cookie)
-{
- unsigned nopts;
- int val = 0;
- const struct argp_option *opt, *real = entry->opt;
- char *so = entry->short_options;
-
- for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--)
- if (oshort (opt) && *so == opt->key)
- {
- if (!oalias (opt))
- real = opt;
- if (ovisible (opt))
- val = (*func)(opt, real, domain, cookie);
- so++;
- }
-
- return val;
-}
-
-static inline int
-__attribute__ ((always_inline))
-hol_entry_long_iterate (const struct hol_entry *entry,
- int (*func)(const struct argp_option *opt,
- const struct argp_option *real,
- const char *domain, void *cookie),
- const char *domain, void *cookie)
-{
- unsigned nopts;
- int val = 0;
- const struct argp_option *opt, *real = entry->opt;
-
- for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--)
- if (opt->name)
- {
- if (!oalias (opt))
- real = opt;
- if (ovisible (opt))
- val = (*func)(opt, real, domain, cookie);
- }
-
- return val;
-}
-
-/* Iterator that returns true for the first short option. */
-static inline int
-until_short (const struct argp_option *opt, const struct argp_option *real,
- const char *domain, void *cookie)
-{
- return oshort (opt) ? opt->key : 0;
-}
-
-/* Returns the first valid short option in ENTRY, or 0 if there is none. */
-static char
-hol_entry_first_short (const struct hol_entry *entry)
-{
- return hol_entry_short_iterate (entry, until_short,
- entry->argp->argp_domain, 0);
-}
-
-/* Returns the first valid long option in ENTRY, or 0 if there is none. */
-static const char *
-hol_entry_first_long (const struct hol_entry *entry)
-{
- const struct argp_option *opt;
- unsigned num;
- for (opt = entry->opt, num = entry->num; num > 0; opt++, num--)
- if (opt->name && ovisible (opt))
- return opt->name;
- return 0;
-}
-
-/* Returns the entry in HOL with the long option name NAME, or 0 if there is
- none. */
-static struct hol_entry *
-hol_find_entry (struct hol *hol, const char *name)
-{
- struct hol_entry *entry = hol->entries;
- unsigned num_entries = hol->num_entries;
-
- while (num_entries-- > 0)
- {
- const struct argp_option *opt = entry->opt;
- unsigned num_opts = entry->num;
-
- while (num_opts-- > 0)
- if (opt->name && ovisible (opt) && strcmp (opt->name, name) == 0)
- return entry;
- else
- opt++;
-
- entry++;
- }
-
- return 0;
-}
-
-/* If an entry with the long option NAME occurs in HOL, set it's special
- sort position to GROUP. */
-static void
-hol_set_group (struct hol *hol, const char *name, int group)
-{
- struct hol_entry *entry = hol_find_entry (hol, name);
- if (entry)
- entry->group = group;
-}
-
-/* Order by group: 0, 1, 2, ..., n, -m, ..., -2, -1.
- EQ is what to return if GROUP1 and GROUP2 are the same. */
-static int
-group_cmp (int group1, int group2, int eq)
-{
- if (group1 == group2)
- return eq;
- else if ((group1 < 0 && group2 < 0) || (group1 >= 0 && group2 >= 0))
- return group1 - group2;
- else
- return group2 - group1;
-}
-
-/* Compare clusters CL1 & CL2 by the order that they should appear in
- output. */
-static int
-hol_cluster_cmp (const struct hol_cluster *cl1, const struct hol_cluster *cl2)
-{
- /* If one cluster is deeper than the other, use its ancestor at the same
- level, so that finding the common ancestor is straightforward. */
- while (cl1->depth < cl2->depth)
- cl1 = cl1->parent;
- while (cl2->depth < cl1->depth)
- cl2 = cl2->parent;
-
- /* Now reduce both clusters to their ancestors at the point where both have
- a common parent; these can be directly compared. */
- while (cl1->parent != cl2->parent)
- cl1 = cl1->parent, cl2 = cl2->parent;
-
- return group_cmp (cl1->group, cl2->group, cl2->index - cl1->index);
-}
-
-/* Return the ancestor of CL that's just below the root (i.e., has a parent
- of 0). */
-static struct hol_cluster *
-hol_cluster_base (struct hol_cluster *cl)
-{
- while (cl->parent)
- cl = cl->parent;
- return cl;
-}
-
-/* Return true if CL1 is a child of CL2. */
-static int
-hol_cluster_is_child (const struct hol_cluster *cl1,
- const struct hol_cluster *cl2)
-{
- while (cl1 && cl1 != cl2)
- cl1 = cl1->parent;
- return cl1 == cl2;
-}
-
-/* Given the name of a OPTION_DOC option, modifies NAME to start at the tail
- that should be used for comparisons, and returns true iff it should be
- treated as a non-option. */
-static int
-canon_doc_option (const char **name)
-{
- int non_opt;
-
- if (!*name)
- non_opt = 1;
- else
- {
- /* Skip initial whitespace. */
- while (isspace (**name))
- (*name)++;
- /* Decide whether this looks like an option (leading `-') or not. */
- non_opt = (**name != '-');
- /* Skip until part of name used for sorting. */
- while (**name && !isalnum (**name))
- (*name)++;
- }
- return non_opt;
-}
-
-/* Order ENTRY1 & ENTRY2 by the order which they should appear in a help
- listing. */
-static int
-hol_entry_cmp (const struct hol_entry *entry1,
- const struct hol_entry *entry2)
-{
- /* The group numbers by which the entries should be ordered; if either is
- in a cluster, then this is just the group within the cluster. */
- int group1 = entry1->group, group2 = entry2->group;
-
- if (entry1->cluster != entry2->cluster)
- {
- /* The entries are not within the same cluster, so we can't compare them
- directly, we have to use the appropiate clustering level too. */
- if (! entry1->cluster)
- /* ENTRY1 is at the `base level', not in a cluster, so we have to
- compare it's group number with that of the base cluster in which
- ENTRY2 resides. Note that if they're in the same group, the
- clustered option always comes laster. */
- return group_cmp (group1, hol_cluster_base (entry2->cluster)->group, -1);
- else if (! entry2->cluster)
- /* Likewise, but ENTRY2's not in a cluster. */
- return group_cmp (hol_cluster_base (entry1->cluster)->group, group2, 1);
- else
- /* Both entries are in clusters, we can just compare the clusters. */
- return hol_cluster_cmp (entry1->cluster, entry2->cluster);
- }
- else if (group1 == group2)
- /* The entries are both in the same cluster and group, so compare them
- alphabetically. */
- {
- int short1 = hol_entry_first_short (entry1);
- int short2 = hol_entry_first_short (entry2);
- int doc1 = odoc (entry1->opt);
- int doc2 = odoc (entry2->opt);
- const char *long1 = hol_entry_first_long (entry1);
- const char *long2 = hol_entry_first_long (entry2);
-
- if (doc1)
- doc1 = canon_doc_option (&long1);
- if (doc2)
- doc2 = canon_doc_option (&long2);
-
- if (doc1 != doc2)
- /* `documentation' options always follow normal options (or
- documentation options that *look* like normal options). */
- return doc1 - doc2;
- else if (!short1 && !short2 && long1 && long2)
- /* Only long options. */
- return __strcasecmp (long1, long2);
- else
- /* Compare short/short, long/short, short/long, using the first
- character of long options. Entries without *any* valid
- options (such as options with OPTION_HIDDEN set) will be put
- first, but as they're not displayed, it doesn't matter where
- they are. */
- {
- char first1 = short1 ? short1 : long1 ? *long1 : 0;
- char first2 = short2 ? short2 : long2 ? *long2 : 0;
-#ifdef _tolower
- int lower_cmp = _tolower (first1) - _tolower (first2);
-#else
- int lower_cmp = tolower (first1) - tolower (first2);
-#endif
- /* Compare ignoring case, except when the options are both the
- same letter, in which case lower-case always comes first. */
- return lower_cmp ? lower_cmp : first2 - first1;
- }
- }
- else
- /* Within the same cluster, but not the same group, so just compare
- groups. */
- return group_cmp (group1, group2, 0);
-}
-
-/* Version of hol_entry_cmp with correct signature for qsort. */
-static int
-hol_entry_qcmp (const void *entry1_v, const void *entry2_v)
-{
- return hol_entry_cmp (entry1_v, entry2_v);
-}
-
-/* Sort HOL by group and alphabetically by option name (with short options
- taking precedence over long). Since the sorting is for display purposes
- only, the shadowing of options isn't effected. */
-static void
-hol_sort (struct hol *hol)
-{
- if (hol->num_entries > 0)
- qsort (hol->entries, hol->num_entries, sizeof (struct hol_entry),
- hol_entry_qcmp);
-}
-
-/* Append MORE to HOL, destroying MORE in the process. Options in HOL shadow
- any in MORE with the same name. */
-static void
-hol_append (struct hol *hol, struct hol *more)
-{
- struct hol_cluster **cl_end = &hol->clusters;
-
- /* Steal MORE's cluster list, and add it to the end of HOL's. */
- while (*cl_end)
- cl_end = &(*cl_end)->next;
- *cl_end = more->clusters;
- more->clusters = 0;
-
- /* Merge entries. */
- if (more->num_entries > 0)
- {
- if (hol->num_entries == 0)
- {
- hol->num_entries = more->num_entries;
- hol->entries = more->entries;
- hol->short_options = more->short_options;
- more->num_entries = 0; /* Mark MORE's fields as invalid. */
- }
- else
- /* Append the entries in MORE to those in HOL, taking care to only add
- non-shadowed SHORT_OPTIONS values. */
- {
- unsigned left;
- char *so, *more_so;
- struct hol_entry *e;
- unsigned num_entries = hol->num_entries + more->num_entries;
- struct hol_entry *entries =
- malloc (num_entries * sizeof (struct hol_entry));
- unsigned hol_so_len = strlen (hol->short_options);
- char *short_options =
- malloc (hol_so_len + strlen (more->short_options) + 1);
-
- assert (entries && short_options);
- if (SIZE_MAX <= UINT_MAX)
- assert (num_entries <= SIZE_MAX / sizeof (struct hol_entry));
-
- __mempcpy (__mempcpy (entries, hol->entries,
- hol->num_entries * sizeof (struct hol_entry)),
- more->entries,
- more->num_entries * sizeof (struct hol_entry));
-
- __mempcpy (short_options, hol->short_options, hol_so_len);
-
- /* Fix up the short options pointers from HOL. */
- for (e = entries, left = hol->num_entries; left > 0; e++, left--)
- e->short_options += (short_options - hol->short_options);
-
- /* Now add the short options from MORE, fixing up its entries
- too. */
- so = short_options + hol_so_len;
- more_so = more->short_options;
- for (left = more->num_entries; left > 0; e++, left--)
- {
- int opts_left;
- const struct argp_option *opt;
-
- e->short_options = so;
-
- for (opts_left = e->num, opt = e->opt; opts_left; opt++, opts_left--)
- {
- int ch = *more_so;
- if (oshort (opt) && ch == opt->key)
- /* The next short option in MORE_SO, CH, is from OPT. */
- {
- if (! find_char (ch, short_options,
- short_options + hol_so_len))
- /* The short option CH isn't shadowed by HOL's options,
- so add it to the sum. */
- *so++ = ch;
- more_so++;
- }
- }
- }
-
- *so = '\0';
-
- free (hol->entries);
- free (hol->short_options);
-
- hol->entries = entries;
- hol->num_entries = num_entries;
- hol->short_options = short_options;
- }
- }
-
- hol_free (more);
-}
-
-/* Inserts enough spaces to make sure STREAM is at column COL. */
-static void
-indent_to (argp_fmtstream_t stream, unsigned col)
-{
- int needed = col - __argp_fmtstream_point (stream);
- while (needed-- > 0)
- __argp_fmtstream_putc (stream, ' ');
-}
-
-/* Output to STREAM either a space, or a newline if there isn't room for at
- least ENSURE characters before the right margin. */
-static void
-space (argp_fmtstream_t stream, size_t ensure)
-{
- if (__argp_fmtstream_point (stream) + ensure
- >= __argp_fmtstream_rmargin (stream))
- __argp_fmtstream_putc (stream, '\n');
- else
- __argp_fmtstream_putc (stream, ' ');
-}
-
-/* If the option REAL has an argument, we print it in using the printf
- format REQ_FMT or OPT_FMT depending on whether it's a required or
- optional argument. */
-static void
-arg (const struct argp_option *real, const char *req_fmt, const char *opt_fmt,
- const char *domain, argp_fmtstream_t stream)
-{
- if (real->arg)
- {
- if (real->flags & OPTION_ARG_OPTIONAL)
- __argp_fmtstream_printf (stream, opt_fmt,
- dgettext (domain, real->arg));
- else
- __argp_fmtstream_printf (stream, req_fmt,
- dgettext (domain, real->arg));
- }
-}
-
-/* Helper functions for hol_entry_help. */
-
-/* State used during the execution of hol_help. */
-struct hol_help_state
-{
- /* PREV_ENTRY should contain the previous entry printed, or 0. */
- struct hol_entry *prev_entry;
-
- /* If an entry is in a different group from the previous one, and SEP_GROUPS
- is true, then a blank line will be printed before any output. */
- int sep_groups;
-
- /* True if a duplicate option argument was suppressed (only ever set if
- UPARAMS.dup_args is false). */
- int suppressed_dup_arg;
-};
-
-/* Some state used while printing a help entry (used to communicate with
- helper functions). See the doc for hol_entry_help for more info, as most
- of the fields are copied from its arguments. */
-struct pentry_state
-{
- const struct hol_entry *entry;
- argp_fmtstream_t stream;
- struct hol_help_state *hhstate;
-
- /* True if nothing's been printed so far. */
- int first;
-
- /* If non-zero, the state that was used to print this help. */
- const struct argp_state *state;
-};
-
-/* If a user doc filter should be applied to DOC, do so. */
-static const char *
-filter_doc (const char *doc, int key, const struct argp *argp,
- const struct argp_state *state)
-{
- if (argp->help_filter)
- /* We must apply a user filter to this output. */
- {
- void *input = __argp_input (argp, state);
- return (*argp->help_filter) (key, doc, input);
- }
- else
- /* No filter. */
- return doc;
-}
-
-/* Prints STR as a header line, with the margin lines set appropiately, and
- notes the fact that groups should be separated with a blank line. ARGP is
- the argp that should dictate any user doc filtering to take place. Note
- that the previous wrap margin isn't restored, but the left margin is reset
- to 0. */
-static void
-print_header (const char *str, const struct argp *argp,
- struct pentry_state *pest)
-{
- const char *tstr = dgettext (argp->argp_domain, str);
- const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_HEADER, argp, pest->state);
-
- if (fstr)
- {
- if (*fstr)
- {
- if (pest->hhstate->prev_entry)
- /* Precede with a blank line. */
- __argp_fmtstream_putc (pest->stream, '\n');
- indent_to (pest->stream, uparams.header_col);
- __argp_fmtstream_set_lmargin (pest->stream, uparams.header_col);
- __argp_fmtstream_set_wmargin (pest->stream, uparams.header_col);
- __argp_fmtstream_puts (pest->stream, fstr);
- __argp_fmtstream_set_lmargin (pest->stream, 0);
- __argp_fmtstream_putc (pest->stream, '\n');
- }
-
- pest->hhstate->sep_groups = 1; /* Separate subsequent groups. */
- }
-
- if (fstr != tstr)
- free ((char *) fstr);
-}
-
-/* Inserts a comma if this isn't the first item on the line, and then makes
- sure we're at least to column COL. If this *is* the first item on a line,
- prints any pending whitespace/headers that should precede this line. Also
- clears FIRST. */
-static void
-comma (unsigned col, struct pentry_state *pest)
-{
- if (pest->first)
- {
- const struct hol_entry *pe = pest->hhstate->prev_entry;
- const struct hol_cluster *cl = pest->entry->cluster;
-
- if (pest->hhstate->sep_groups && pe && pest->entry->group != pe->group)
- __argp_fmtstream_putc (pest->stream, '\n');
-
- if (cl && cl->header && *cl->header
- && (!pe
- || (pe->cluster != cl
- && !hol_cluster_is_child (pe->cluster, cl))))
- /* If we're changing clusters, then this must be the start of the
- ENTRY's cluster unless that is an ancestor of the previous one
- (in which case we had just popped into a sub-cluster for a bit).
- If so, then print the cluster's header line. */
- {
- int old_wm = __argp_fmtstream_wmargin (pest->stream);
- print_header (cl->header, cl->argp, pest);
- __argp_fmtstream_set_wmargin (pest->stream, old_wm);
- }
-
- pest->first = 0;
- }
- else
- __argp_fmtstream_puts (pest->stream, ", ");
-
- indent_to (pest->stream, col);
-}
-
-/* Print help for ENTRY to STREAM. */
-static void
-hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
- argp_fmtstream_t stream, struct hol_help_state *hhstate)
-{
- unsigned num;
- const struct argp_option *real = entry->opt, *opt;
- char *so = entry->short_options;
- int have_long_opt = 0; /* We have any long options. */
- /* Saved margins. */
- int old_lm = __argp_fmtstream_set_lmargin (stream, 0);
- int old_wm = __argp_fmtstream_wmargin (stream);
- /* PEST is a state block holding some of our variables that we'd like to
- share with helper functions. */
- struct pentry_state pest;
-
- pest.entry = entry;
- pest.stream = stream;
- pest.hhstate = hhstate;
- pest.first = 1;
- pest.state = state;
-
- if (! odoc (real))
- for (opt = real, num = entry->num; num > 0; opt++, num--)
- if (opt->name && ovisible (opt))
- {
- have_long_opt = 1;
- break;
- }
-
- /* First emit short options. */
- __argp_fmtstream_set_wmargin (stream, uparams.short_opt_col); /* For truly bizarre cases. */
- for (opt = real, num = entry->num; num > 0; opt++, num--)
- if (oshort (opt) && opt->key == *so)
- /* OPT has a valid (non shadowed) short option. */
- {
- if (ovisible (opt))
- {
- comma (uparams.short_opt_col, &pest);
- __argp_fmtstream_putc (stream, '-');
- __argp_fmtstream_putc (stream, *so);
- if (!have_long_opt || uparams.dup_args)
- arg (real, " %s", "[%s]", state->root_argp->argp_domain, stream);
- else if (real->arg)
- hhstate->suppressed_dup_arg = 1;
- }
- so++;
- }
-
- /* Now, long options. */
- if (odoc (real))
- /* A `documentation' option. */
- {
- __argp_fmtstream_set_wmargin (stream, uparams.doc_opt_col);
- for (opt = real, num = entry->num; num > 0; opt++, num--)
- if (opt->name && *opt->name && ovisible (opt))
- {
- comma (uparams.doc_opt_col, &pest);
- /* Calling dgettext here isn't quite right, since sorting will
- have been done on the original; but documentation options
- should be pretty rare anyway... */
- __argp_fmtstream_puts (stream,
- onotrans (opt) ?
- opt->name :
- dgettext (state->root_argp->argp_domain,
- opt->name));
- }
- }
- else
- /* A real long option. */
- {
- int first_long_opt = 1;
-
- __argp_fmtstream_set_wmargin (stream, uparams.long_opt_col);
- for (opt = real, num = entry->num; num > 0; opt++, num--)
- if (opt->name && ovisible (opt))
- {
- comma (uparams.long_opt_col, &pest);
- __argp_fmtstream_printf (stream, "--%s", opt->name);
- if (first_long_opt || uparams.dup_args)
- arg (real, "=%s", "[=%s]", state->root_argp->argp_domain,
- stream);
- else if (real->arg)
- hhstate->suppressed_dup_arg = 1;
- }
- }
-
- /* Next, documentation strings. */
- __argp_fmtstream_set_lmargin (stream, 0);
-
- if (pest.first)
- {
- /* Didn't print any switches, what's up? */
- if (!oshort (real) && !real->name)
- /* This is a group header, print it nicely. */
- print_header (real->doc, entry->argp, &pest);
- else
- /* Just a totally shadowed option or null header; print nothing. */
- goto cleanup; /* Just return, after cleaning up. */
- }
- else
- {
- const char *tstr = real->doc ? dgettext (state->root_argp->argp_domain,
- real->doc) : 0;
- const char *fstr = filter_doc (tstr, real->key, entry->argp, state);
- if (fstr && *fstr)
- {
- unsigned int col = __argp_fmtstream_point (stream);
-
- __argp_fmtstream_set_lmargin (stream, uparams.opt_doc_col);
- __argp_fmtstream_set_wmargin (stream, uparams.opt_doc_col);
-
- if (col > (unsigned int) (uparams.opt_doc_col + 3))
- __argp_fmtstream_putc (stream, '\n');
- else if (col >= (unsigned int) uparams.opt_doc_col)
- __argp_fmtstream_puts (stream, " ");
- else
- indent_to (stream, uparams.opt_doc_col);
-
- __argp_fmtstream_puts (stream, fstr);
- }
- if (fstr && fstr != tstr)
- free ((char *) fstr);
-
- /* Reset the left margin. */
- __argp_fmtstream_set_lmargin (stream, 0);
- __argp_fmtstream_putc (stream, '\n');
- }
-
- hhstate->prev_entry = entry;
-
-cleanup:
- __argp_fmtstream_set_lmargin (stream, old_lm);
- __argp_fmtstream_set_wmargin (stream, old_wm);
-}
-
-/* Output a long help message about the options in HOL to STREAM. */
-static void
-hol_help (struct hol *hol, const struct argp_state *state,
- argp_fmtstream_t stream)
-{
- unsigned num;
- struct hol_entry *entry;
- struct hol_help_state hhstate = { 0, 0, 0 };
-
- for (entry = hol->entries, num = hol->num_entries; num > 0; entry++, num--)
- hol_entry_help (entry, state, stream, &hhstate);
-
- if (hhstate.suppressed_dup_arg && uparams.dup_args_note)
- {
- const char *tstr = dgettext (state->root_argp->argp_domain, "\
-Mandatory or optional arguments to long options are also mandatory or \
-optional for any corresponding short options.");
- const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_DUP_ARGS_NOTE,
- state ? state->root_argp : 0, state);
- if (fstr && *fstr)
- {
- __argp_fmtstream_putc (stream, '\n');
- __argp_fmtstream_puts (stream, fstr);
- __argp_fmtstream_putc (stream, '\n');
- }
- if (fstr && fstr != tstr)
- free ((char *) fstr);
- }
-}
-
-/* Helper functions for hol_usage. */
-
-/* If OPT is a short option without an arg, append its key to the string
- pointer pointer to by COOKIE, and advance the pointer. */
-static int
-add_argless_short_opt (const struct argp_option *opt,
- const struct argp_option *real,
- const char *domain, void *cookie)
-{
- char **snao_end = cookie;
- if (!(opt->arg || real->arg)
- && !((opt->flags | real->flags) & OPTION_NO_USAGE))
- *(*snao_end)++ = opt->key;
- return 0;
-}
-
-/* If OPT is a short option with an arg, output a usage entry for it to the
- stream pointed at by COOKIE. */
-static int
-usage_argful_short_opt (const struct argp_option *opt,
- const struct argp_option *real,
- const char *domain, void *cookie)
-{
- argp_fmtstream_t stream = cookie;
- const char *arg = opt->arg;
- int flags = opt->flags | real->flags;
-
- if (! arg)
- arg = real->arg;
-
- if (arg && !(flags & OPTION_NO_USAGE))
- {
- arg = dgettext (domain, arg);
-
- if (flags & OPTION_ARG_OPTIONAL)
- __argp_fmtstream_printf (stream, " [-%c[%s]]", opt->key, arg);
- else
- {
- /* Manually do line wrapping so that it (probably) won't
- get wrapped at the embedded space. */
- space (stream, 6 + strlen (arg));
- __argp_fmtstream_printf (stream, "[-%c %s]", opt->key, arg);
- }
- }
-
- return 0;
-}
-
-/* Output a usage entry for the long option opt to the stream pointed at by
- COOKIE. */
-static int
-usage_long_opt (const struct argp_option *opt,
- const struct argp_option *real,
- const char *domain, void *cookie)
-{
- argp_fmtstream_t stream = cookie;
- const char *arg = opt->arg;
- int flags = opt->flags | real->flags;
-
- if (! arg)
- arg = real->arg;
-
- if (! (flags & OPTION_NO_USAGE) && !odoc (opt))
- {
- if (arg)
- {
- arg = dgettext (domain, arg);
- if (flags & OPTION_ARG_OPTIONAL)
- __argp_fmtstream_printf (stream, " [--%s[=%s]]", opt->name, arg);
- else
- __argp_fmtstream_printf (stream, " [--%s=%s]", opt->name, arg);
- }
- else
- __argp_fmtstream_printf (stream, " [--%s]", opt->name);
- }
-
- return 0;
-}
-
-/* Print a short usage description for the arguments in HOL to STREAM. */
-static void
-hol_usage (struct hol *hol, argp_fmtstream_t stream)
-{
- if (hol->num_entries > 0)
- {
- unsigned nentries;
- struct hol_entry *entry;
- char *short_no_arg_opts = alloca (strlen (hol->short_options) + 1);
- char *snao_end = short_no_arg_opts;
-
- /* First we put a list of short options without arguments. */
- for (entry = hol->entries, nentries = hol->num_entries
- ; nentries > 0
- ; entry++, nentries--)
- hol_entry_short_iterate (entry, add_argless_short_opt,
- entry->argp->argp_domain, &snao_end);
- if (snao_end > short_no_arg_opts)
- {
- *snao_end++ = 0;
- __argp_fmtstream_printf (stream, " [-%s]", short_no_arg_opts);
- }
-
- /* Now a list of short options *with* arguments. */
- for (entry = hol->entries, nentries = hol->num_entries
- ; nentries > 0
- ; entry++, nentries--)
- hol_entry_short_iterate (entry, usage_argful_short_opt,
- entry->argp->argp_domain, stream);
-
- /* Finally, a list of long options (whew!). */
- for (entry = hol->entries, nentries = hol->num_entries
- ; nentries > 0
- ; entry++, nentries--)
- hol_entry_long_iterate (entry, usage_long_opt,
- entry->argp->argp_domain, stream);
- }
-}
-
-/* Make a HOL containing all levels of options in ARGP. CLUSTER is the
- cluster in which ARGP's entries should be clustered, or 0. */
-static struct hol *
-argp_hol (const struct argp *argp, struct hol_cluster *cluster)
-{
- const struct argp_child *child = argp->children;
- struct hol *hol = make_hol (argp, cluster);
- if (child)
- while (child->argp)
- {
- struct hol_cluster *child_cluster =
- ((child->group || child->header)
- /* Put CHILD->argp within its own cluster. */
- ? hol_add_cluster (hol, child->group, child->header,
- child - argp->children, cluster, argp)
- /* Just merge it into the parent's cluster. */
- : cluster);
- hol_append (hol, argp_hol (child->argp, child_cluster)) ;
- child++;
- }
- return hol;
-}
-
-/* Calculate how many different levels with alternative args strings exist in
- ARGP. */
-static size_t
-argp_args_levels (const struct argp *argp)
-{
- size_t levels = 0;
- const struct argp_child *child = argp->children;
-
- if (argp->args_doc && strchr (argp->args_doc, '\n'))
- levels++;
-
- if (child)
- while (child->argp)
- levels += argp_args_levels ((child++)->argp);
-
- return levels;
-}
-
-/* Print all the non-option args documented in ARGP to STREAM. Any output is
- preceded by a space. LEVELS is a pointer to a byte vector the length
- returned by argp_args_levels; it should be initialized to zero, and
- updated by this routine for the next call if ADVANCE is true. True is
- returned as long as there are more patterns to output. */
-static int
-argp_args_usage (const struct argp *argp, const struct argp_state *state,
- char **levels, int advance, argp_fmtstream_t stream)
-{
- char *our_level = *levels;
- int multiple = 0;
- const struct argp_child *child = argp->children;
- const char *tdoc = dgettext (argp->argp_domain, argp->args_doc), *nl = 0;
- const char *fdoc = filter_doc (tdoc, ARGP_KEY_HELP_ARGS_DOC, argp, state);
-
- if (fdoc)
- {
- const char *cp = fdoc;
- nl = __strchrnul (cp, '\n');
- if (*nl != '\0')
- /* This is a `multi-level' args doc; advance to the correct position
- as determined by our state in LEVELS, and update LEVELS. */
- {
- int i;
- multiple = 1;
- for (i = 0; i < *our_level; i++)
- cp = nl + 1, nl = __strchrnul (cp, '\n');
- (*levels)++;
- }
-
- /* Manually do line wrapping so that it (probably) won't get wrapped at
- any embedded spaces. */
- space (stream, 1 + nl - cp);
-
- __argp_fmtstream_write (stream, cp, nl - cp);
- }
- if (fdoc && fdoc != tdoc)
- free ((char *)fdoc); /* Free user's modified doc string. */
-
- if (child)
- while (child->argp)
- advance = !argp_args_usage ((child++)->argp, state, levels, advance, stream);
-
- if (advance && multiple)
- {
- /* Need to increment our level. */
- if (*nl)
- /* There's more we can do here. */
- {
- (*our_level)++;
- advance = 0; /* Our parent shouldn't advance also. */
- }
- else if (*our_level > 0)
- /* We had multiple levels, but used them up; reset to zero. */
- *our_level = 0;
- }
-
- return !advance;
-}
-
-/* Print the documentation for ARGP to STREAM; if POST is false, then
- everything preceeding a `\v' character in the documentation strings (or
- the whole string, for those with none) is printed, otherwise, everything
- following the `\v' character (nothing for strings without). Each separate
- bit of documentation is separated a blank line, and if PRE_BLANK is true,
- then the first is as well. If FIRST_ONLY is true, only the first
- occurrence is output. Returns true if anything was output. */
-static int
-argp_doc (const struct argp *argp, const struct argp_state *state,
- int post, int pre_blank, int first_only,
- argp_fmtstream_t stream)
-{
- const char *text;
- const char *inp_text;
- void *input = 0;
- int anything = 0;
- size_t inp_text_limit = 0;
- const char *doc = dgettext (argp->argp_domain, argp->doc);
- const struct argp_child *child = argp->children;
-
- if (doc)
- {
- char *vt = strchr (doc, '\v');
- inp_text = post ? (vt ? vt + 1 : 0) : doc;
- inp_text_limit = (!post && vt) ? (vt - doc) : 0;
- }
- else
- inp_text = 0;
-
- if (argp->help_filter)
- /* We have to filter the doc strings. */
- {
- if (inp_text_limit)
- /* Copy INP_TEXT so that it's nul-terminated. */
- inp_text = __strndup (inp_text, inp_text_limit);
- input = __argp_input (argp, state);
- text =
- (*argp->help_filter) (post
- ? ARGP_KEY_HELP_POST_DOC
- : ARGP_KEY_HELP_PRE_DOC,
- inp_text, input);
- }
- else
- text = (const char *) inp_text;
-
- if (text)
- {
- if (pre_blank)
- __argp_fmtstream_putc (stream, '\n');
-
- if (text == inp_text && inp_text_limit)
- __argp_fmtstream_write (stream, inp_text, inp_text_limit);
- else
- __argp_fmtstream_puts (stream, text);
-
- if (__argp_fmtstream_point (stream) > __argp_fmtstream_lmargin (stream))
- __argp_fmtstream_putc (stream, '\n');
-
- anything = 1;
- }
-
- if (text && text != inp_text)
- free ((char *) text); /* Free TEXT returned from the help filter. */
- if (inp_text && inp_text_limit && argp->help_filter)
- free ((char *) inp_text); /* We copied INP_TEXT, so free it now. */
-
- if (post && argp->help_filter)
- /* Now see if we have to output a ARGP_KEY_HELP_EXTRA text. */
- {
- text = (*argp->help_filter) (ARGP_KEY_HELP_EXTRA, 0, input);
- if (text)
- {
- if (anything || pre_blank)
- __argp_fmtstream_putc (stream, '\n');
- __argp_fmtstream_puts (stream, text);
- free ((char *) text);
- if (__argp_fmtstream_point (stream)
- > __argp_fmtstream_lmargin (stream))
- __argp_fmtstream_putc (stream, '\n');
- anything = 1;
- }
- }
-
- if (child)
- while (child->argp && !(first_only && anything))
- anything |=
- argp_doc ((child++)->argp, state,
- post, anything || pre_blank, first_only,
- stream);
-
- return anything;
-}
-
-/* Output a usage message for ARGP to STREAM. If called from
- argp_state_help, STATE is the relevent parsing state. FLAGS are from the
- set ARGP_HELP_*. NAME is what to use wherever a `program name' is
- needed. */
-static void
-_help (const struct argp *argp, const struct argp_state *state, FILE *stream,
- unsigned flags, char *name)
-{
- int anything = 0; /* Whether we've output anything. */
- struct hol *hol = 0;
- argp_fmtstream_t fs;
-
- if (! stream)
- return;
-
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __flockfile (stream);
-#endif
-
- if (! uparams.valid)
- fill_in_uparams (state);
-
- fs = __argp_make_fmtstream (stream, 0, uparams.rmargin, 0);
- if (! fs)
- {
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __funlockfile (stream);
-#endif
- return;
- }
-
- if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG))
- {
- hol = argp_hol (argp, 0);
-
- /* If present, these options always come last. */
- hol_set_group (hol, "help", -1);
- hol_set_group (hol, "version", -1);
-
- hol_sort (hol);
- }
-
- if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE))
- /* Print a short `Usage:' message. */
- {
- int first_pattern = 1, more_patterns;
- size_t num_pattern_levels = argp_args_levels (argp);
- char *pattern_levels = alloca (num_pattern_levels);
-
- memset (pattern_levels, 0, num_pattern_levels);
-
- do
- {
- int old_lm;
- int old_wm = __argp_fmtstream_set_wmargin (fs, uparams.usage_indent);
- char *levels = pattern_levels;
-
- if (first_pattern)
- __argp_fmtstream_printf (fs, "%s %s",
- dgettext (argp->argp_domain, "Usage:"),
- name);
- else
- __argp_fmtstream_printf (fs, "%s %s",
- dgettext (argp->argp_domain, " or: "),
- name);
-
- /* We set the lmargin as well as the wmargin, because hol_usage
- manually wraps options with newline to avoid annoying breaks. */
- old_lm = __argp_fmtstream_set_lmargin (fs, uparams.usage_indent);
-
- if (flags & ARGP_HELP_SHORT_USAGE)
- /* Just show where the options go. */
- {
- if (hol->num_entries > 0)
- __argp_fmtstream_puts (fs, dgettext (argp->argp_domain,
- " [OPTION...]"));
- }
- else
- /* Actually print the options. */
- {
- hol_usage (hol, fs);
- flags |= ARGP_HELP_SHORT_USAGE; /* But only do so once. */
- }
-
- more_patterns = argp_args_usage (argp, state, &levels, 1, fs);
-
- __argp_fmtstream_set_wmargin (fs, old_wm);
- __argp_fmtstream_set_lmargin (fs, old_lm);
-
- __argp_fmtstream_putc (fs, '\n');
- anything = 1;
-
- first_pattern = 0;
- }
- while (more_patterns);
- }
-
- if (flags & ARGP_HELP_PRE_DOC)
- anything |= argp_doc (argp, state, 0, 0, 1, fs);
-
- if (flags & ARGP_HELP_SEE)
- {
- __argp_fmtstream_printf (fs, dgettext (argp->argp_domain, "\
-Try `%s --help' or `%s --usage' for more information.\n"),
- name, name);
- anything = 1;
- }
-
- if (flags & ARGP_HELP_LONG)
- /* Print a long, detailed help message. */
- {
- /* Print info about all the options. */
- if (hol->num_entries > 0)
- {
- if (anything)
- __argp_fmtstream_putc (fs, '\n');
- hol_help (hol, state, fs);
- anything = 1;
- }
- }
-
- if (flags & ARGP_HELP_POST_DOC)
- /* Print any documentation strings at the end. */
- anything |= argp_doc (argp, state, 1, anything, 0, fs);
-
- if ((flags & ARGP_HELP_BUG_ADDR) && argp_program_bug_address)
- {
- if (anything)
- __argp_fmtstream_putc (fs, '\n');
- __argp_fmtstream_printf (fs, dgettext (argp->argp_domain,
- "Report bugs to %s.\n"),
- argp_program_bug_address);
- anything = 1;
- }
-
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __funlockfile (stream);
-#endif
-
- if (hol)
- hol_free (hol);
-
- __argp_fmtstream_free (fs);
-}
-
-/* Output a usage message for ARGP to STREAM. FLAGS are from the set
- ARGP_HELP_*. NAME is what to use wherever a `program name' is needed. */
-void __argp_help (const struct argp *argp, FILE *stream,
- unsigned flags, char *name)
-{
- struct argp_state state;
- memset (&state, 0, sizeof state);
- state.root_argp = argp;
- _help (argp, &state, stream, flags, name);
-}
-#ifdef weak_alias
-weak_alias (__argp_help, argp_help)
-#endif
-
-#if ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME)
-char *
-__argp_short_program_name (void)
-{
-# if HAVE_DECL_PROGRAM_INVOCATION_NAME
- return __argp_base_name (program_invocation_name);
-# else
- /* FIXME: What now? Miles suggests that it is better to use NULL,
- but currently the value is passed on directly to fputs_unlocked,
- so that requires more changes. */
-# if __GNUC__
-# warning No reasonable value to return
-# endif /* __GNUC__ */
- return "";
-# endif
-}
-#endif
-
-/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
- from the set ARGP_HELP_*. */
-void
-__argp_state_help (const struct argp_state *state, FILE *stream, unsigned flags)
-{
- if ((!state || ! (state->flags & ARGP_NO_ERRS)) && stream)
- {
- if (state && (state->flags & ARGP_LONG_ONLY))
- flags |= ARGP_HELP_LONG_ONLY;
-
- _help (state ? state->root_argp : 0, state, stream, flags,
- state ? state->name : __argp_short_program_name ());
-
- if (!state || ! (state->flags & ARGP_NO_EXIT))
- {
- if (flags & ARGP_HELP_EXIT_ERR)
- exit (argp_err_exit_status);
- if (flags & ARGP_HELP_EXIT_OK)
- exit (0);
- }
- }
-}
-#ifdef weak_alias
-weak_alias (__argp_state_help, argp_state_help)
-#endif
-
-/* If appropriate, print the printf string FMT and following args, preceded
- by the program name and `:', to stderr, and followed by a `Try ... --help'
- message, then exit (1). */
-void
-__argp_error (const struct argp_state *state, const char *fmt, ...)
-{
- if (!state || !(state->flags & ARGP_NO_ERRS))
- {
- FILE *stream = state ? state->err_stream : stderr;
-
- if (stream)
- {
- va_list ap;
-
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __flockfile (stream);
-#endif
-
- va_start (ap, fmt);
-
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (stream, 0) > 0)
- {
- char *buf;
-
- if (__asprintf (&buf, fmt, ap) < 0)
- buf = NULL;
-
- __fwprintf (stream, L"%s: %s\n",
- state ? state->name : __argp_short_program_name (),
- buf);
-
- free (buf);
- }
- else
-#endif
- {
- fputs_unlocked (state
- ? state->name : __argp_short_program_name (),
- stream);
- putc_unlocked (':', stream);
- putc_unlocked (' ', stream);
-
- vfprintf (stream, fmt, ap);
-
- putc_unlocked ('\n', stream);
- }
-
- __argp_state_help (state, stream, ARGP_HELP_STD_ERR);
-
- va_end (ap);
-
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __funlockfile (stream);
-#endif
- }
- }
-}
-#ifdef weak_alias
-weak_alias (__argp_error, argp_error)
-#endif
-
-/* Similar to the standard gnu error-reporting function error(), but will
- respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
- to STATE->err_stream. This is useful for argument parsing code that is
- shared between program startup (when exiting is desired) and runtime
- option parsing (when typically an error code is returned instead). The
- difference between this function and argp_error is that the latter is for
- *parsing errors*, and the former is for other problems that occur during
- parsing but don't reflect a (syntactic) problem with the input. */
-void
-__argp_failure (const struct argp_state *state, int status, int errnum,
- const char *fmt, ...)
-{
- if (!state || !(state->flags & ARGP_NO_ERRS))
- {
- FILE *stream = state ? state->err_stream : stderr;
-
- if (stream)
- {
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __flockfile (stream);
-#endif
-
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (stream, 0) > 0)
- __fwprintf (stream, L"%s",
- state ? state->name : __argp_short_program_name ());
- else
-#endif
- fputs_unlocked (state
- ? state->name : __argp_short_program_name (),
- stream);
-
- if (fmt)
- {
- va_list ap;
-
- va_start (ap, fmt);
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (stream, 0) > 0)
- {
- char *buf;
-
- if (__asprintf (&buf, fmt, ap) < 0)
- buf = NULL;
-
- __fwprintf (stream, L": %s", buf);
-
- free (buf);
- }
- else
-#endif
- {
- putc_unlocked (':', stream);
- putc_unlocked (' ', stream);
-
- vfprintf (stream, fmt, ap);
- }
-
- va_end (ap);
- }
-
- if (errnum)
- {
- char buf[200];
-
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (stream, 0) > 0)
- __fwprintf (stream, L": %s",
- __strerror_r (errnum, buf, sizeof (buf)));
- else
-#endif
- {
- char const *s = NULL;
- putc_unlocked (':', stream);
- putc_unlocked (' ', stream);
-#if _LIBC || (HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P)
- s = __strerror_r (errnum, buf, sizeof buf);
-#elif HAVE_DECL_STRERROR_R
- if (__strerror_r (errnum, buf, sizeof buf) == 0)
- s = buf;
-#endif
-#if !_LIBC
- if (! s && ! (s = strerror (errnum)))
- s = dgettext (state->root_argp->argp_domain,
- "Unknown system error");
-#endif
- fputs (s, stream);
- }
- }
-
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (stream, 0) > 0)
- putwc_unlocked (L'\n', stream);
- else
-#endif
- putc_unlocked ('\n', stream);
-
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __funlockfile (stream);
-#endif
-
- if (status && (!state || !(state->flags & ARGP_NO_EXIT)))
- exit (status);
- }
- }
-}
-#ifdef weak_alias
-weak_alias (__argp_failure, argp_failure)
-#endif
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argp-namefrob.h b/xbmc/screensavers/rsxs-0.9/lib/argp-namefrob.h
deleted file mode 100644
index ea3086455e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argp-namefrob.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/* Name frobnication for compiling argp outside of glibc
- Copyright (C) 1997, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#if !_LIBC
-/* This code is written for inclusion in gnu-libc, and uses names in the
- namespace reserved for libc. If we're not compiling in libc, define those
- names to be the normal ones instead. */
-
-/* argp-parse functions */
-#undef __argp_parse
-#define __argp_parse argp_parse
-#undef __option_is_end
-#define __option_is_end _option_is_end
-#undef __option_is_short
-#define __option_is_short _option_is_short
-#undef __argp_input
-#define __argp_input _argp_input
-
-/* argp-help functions */
-#undef __argp_help
-#define __argp_help argp_help
-#undef __argp_error
-#define __argp_error argp_error
-#undef __argp_failure
-#define __argp_failure argp_failure
-#undef __argp_state_help
-#define __argp_state_help argp_state_help
-#undef __argp_usage
-#define __argp_usage argp_usage
-
-/* argp-fmtstream functions */
-#undef __argp_make_fmtstream
-#define __argp_make_fmtstream argp_make_fmtstream
-#undef __argp_fmtstream_free
-#define __argp_fmtstream_free argp_fmtstream_free
-#undef __argp_fmtstream_putc
-#define __argp_fmtstream_putc argp_fmtstream_putc
-#undef __argp_fmtstream_puts
-#define __argp_fmtstream_puts argp_fmtstream_puts
-#undef __argp_fmtstream_write
-#define __argp_fmtstream_write argp_fmtstream_write
-#undef __argp_fmtstream_printf
-#define __argp_fmtstream_printf argp_fmtstream_printf
-#undef __argp_fmtstream_set_lmargin
-#define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin
-#undef __argp_fmtstream_set_rmargin
-#define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin
-#undef __argp_fmtstream_set_wmargin
-#define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin
-#undef __argp_fmtstream_point
-#define __argp_fmtstream_point argp_fmtstream_point
-#undef __argp_fmtstream_update
-#define __argp_fmtstream_update _argp_fmtstream_update
-#undef __argp_fmtstream_ensure
-#define __argp_fmtstream_ensure _argp_fmtstream_ensure
-#undef __argp_fmtstream_lmargin
-#define __argp_fmtstream_lmargin argp_fmtstream_lmargin
-#undef __argp_fmtstream_rmargin
-#define __argp_fmtstream_rmargin argp_fmtstream_rmargin
-#undef __argp_fmtstream_wmargin
-#define __argp_fmtstream_wmargin argp_fmtstream_wmargin
-
-#include "mempcpy.h"
-#include "strcase.h"
-#include "strchrnul.h"
-#include "strndup.h"
-
-/* normal libc functions we call */
-#undef __flockfile
-#define __flockfile flockfile
-#undef __funlockfile
-#define __funlockfile funlockfile
-#undef __mempcpy
-#define __mempcpy mempcpy
-#undef __sleep
-#define __sleep sleep
-#undef __strcasecmp
-#define __strcasecmp strcasecmp
-#undef __strchrnul
-#define __strchrnul strchrnul
-#undef __strerror_r
-#define __strerror_r strerror_r
-#undef __strndup
-#define __strndup strndup
-#undef __vsnprintf
-#define __vsnprintf vsnprintf
-
-#if defined(HAVE_DECL_CLEARERR_UNLOCKED) && !HAVE_DECL_CLEARERR_UNLOCKED
-# define clearerr_unlocked(x) clearerr (x)
-#endif
-#if defined(HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED
-# define feof_unlocked(x) feof (x)
-# endif
-#if defined(HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED
-# define ferror_unlocked(x) ferror (x)
-# endif
-#if defined(HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED
-# define fflush_unlocked(x) fflush (x)
-# endif
-#if defined(HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED
-# define fgets_unlocked(x,y,z) fgets (x,y,z)
-# endif
-#if defined(HAVE_DECL_FPUTC_UNLOCKED) && !HAVE_DECL_FPUTC_UNLOCKED
-# define fputc_unlocked(x,y) fputc (x,y)
-# endif
-#if defined(HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED
-# define fputs_unlocked(x,y) fputs (x,y)
-# endif
-#if defined(HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED
-# define fread_unlocked(w,x,y,z) fread (w,x,y,z)
-# endif
-#if defined(HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED
-# define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
-# endif
-#if defined(HAVE_DECL_GETC_UNLOCKED) && !HAVE_DECL_GETC_UNLOCKED
-# define getc_unlocked(x) getc (x)
-# endif
-#if defined(HAVE_DECL_GETCHAR_UNLOCKED) && !HAVE_DECL_GETCHAR_UNLOCKED
-# define getchar_unlocked() getchar ()
-# endif
-#if defined(HAVE_DECL_PUTC_UNLOCKED) && !HAVE_DECL_PUTC_UNLOCKED
-# define putc_unlocked(x,y) putc (x,y)
-# endif
-#if defined(HAVE_DECL_PUTCHAR_UNLOCKED) && !HAVE_DECL_PUTCHAR_UNLOCKED
-# define putchar_unlocked(x) putchar (x)
-# endif
-
-/* GNULIB makes sure both program_invocation_name and
- program_invocation_short_name are available */
-#ifdef GNULIB_PROGRAM_INVOCATION_NAME
-extern char *program_invocation_name;
-# undef HAVE_DECL_PROGRAM_INVOCATION_NAME
-# define HAVE_DECL_PROGRAM_INVOCATION_NAME 1
-#endif
-
-#ifdef GNULIB_PROGRAM_INVOCATION_SHORT_NAME
-extern char *program_invocation_short_name;
-# undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
-# define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 1
-#endif
-
-#endif /* !_LIBC */
-
-#ifndef __set_errno
-#define __set_errno(e) (errno = (e))
-#endif
-
-#if defined GNULIB_ARGP_DISABLE_DIRNAME
-# define __argp_base_name(arg) arg
-#elif defined GNULIB_ARGP_EXTERN_BASENAME
-extern char *__argp_base_name(const char *arg);
-#else
-# include "dirname.h"
-# define __argp_base_name base_name
-#endif
-
-#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
-# define __argp_short_program_name() (program_invocation_short_name)
-#else
-extern char *__argp_short_program_name (void);
-#endif
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argp-parse.c b/xbmc/screensavers/rsxs-0.9/lib/argp-parse.c
deleted file mode 100644
index 2d3241ee6e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argp-parse.c
+++ /dev/null
@@ -1,943 +0,0 @@
-/* Hierarchial argument parsing, layered over getopt
- Copyright (C) 1995-2000, 2002, 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <alloca.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <limits.h>
-#include <getopt.h>
-#include <getopt_int.h>
-
-#ifdef _LIBC
-# include <libintl.h>
-# undef dgettext
-# define dgettext(domain, msgid) \
- INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
-#else
-# include "gettext.h"
-#endif
-#define N_(msgid) msgid
-
-#include "argp.h"
-#include "argp-namefrob.h"
-#ifdef __APPLE__
- const char *argp_program_version;
- const char *argp_program_bug_address;
-#endif
-
-#define alignof(type) offsetof (struct { char c; type x; }, x)
-#define alignto(n, d) ((((n) + (d) - 1) / (d)) * (d))
-
-/* Getopt return values. */
-#define KEY_END (-1) /* The end of the options. */
-#define KEY_ARG 1 /* A non-option argument. */
-#define KEY_ERR '?' /* An error parsing the options. */
-
-/* The meta-argument used to prevent any further arguments being interpreted
- as options. */
-#define QUOTE "--"
-
-/* The number of bits we steal in a long-option value for our own use. */
-#define GROUP_BITS CHAR_BIT
-
-/* The number of bits available for the user value. */
-#define USER_BITS ((sizeof ((struct option *)0)->val * CHAR_BIT) - GROUP_BITS)
-#define USER_MASK ((1 << USER_BITS) - 1)
-
-/* EZ alias for ARGP_ERR_UNKNOWN. */
-#define EBADKEY ARGP_ERR_UNKNOWN
-
-/* Default options. */
-
-/* When argp is given the --HANG switch, _ARGP_HANG is set and argp will sleep
- for one second intervals, decrementing _ARGP_HANG until it's zero. Thus
- you can force the program to continue by attaching a debugger and setting
- it to 0 yourself. */
-static volatile int _argp_hang;
-
-#define OPT_PROGNAME -2
-#define OPT_USAGE -3
-#define OPT_HANG -4
-
-static const struct argp_option argp_default_options[] =
-{
- {"help", '?', 0, 0, N_("give this help list"), -1},
- {"usage", OPT_USAGE, 0, 0, N_("give a short usage message"), 0},
- {"program-name",OPT_PROGNAME,N_("NAME"), OPTION_HIDDEN, N_("set the program name"), 0},
- {"HANG", OPT_HANG, N_("SECS"), OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
- N_("hang for SECS seconds (default 3600)"), 0},
- {NULL, 0, 0, 0, NULL, 0}
-};
-
-static error_t
-argp_default_parser (int key, char *arg, struct argp_state *state)
-{
- switch (key)
- {
- case '?':
- __argp_state_help (state, state->out_stream, ARGP_HELP_STD_HELP);
- break;
- case OPT_USAGE:
- __argp_state_help (state, state->out_stream,
- ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK);
- break;
-
- case OPT_PROGNAME: /* Set the program name. */
-#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_NAME
- program_invocation_name = arg;
-#endif
- /* [Note that some systems only have PROGRAM_INVOCATION_SHORT_NAME (aka
- __PROGNAME), in which case, PROGRAM_INVOCATION_NAME is just defined
- to be that, so we have to be a bit careful here.] */
-
- /* Update what we use for messages. */
- state->name = __argp_base_name (arg);
-
-#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
- program_invocation_short_name = state->name;
-#endif
-
- if ((state->flags & (ARGP_PARSE_ARGV0 | ARGP_NO_ERRS))
- == ARGP_PARSE_ARGV0)
- /* Update what getopt uses too. */
- state->argv[0] = arg;
-
- break;
-
- case OPT_HANG:
- _argp_hang = atoi (arg ? arg : "3600");
- while (_argp_hang-- > 0)
- __sleep (1);
- break;
-
- default:
- return EBADKEY;
- }
- return 0;
-}
-
-static const struct argp argp_default_argp =
- {argp_default_options, &argp_default_parser, NULL, NULL, NULL, NULL, "libc"};
-
-
-static const struct argp_option argp_version_options[] =
-{
- {"version", 'V', 0, 0, N_("print program version"), -1},
- {NULL, 0, 0, 0, NULL, 0}
-};
-
-static error_t
-argp_version_parser (int key, char *arg, struct argp_state *state)
-{
- switch (key)
- {
- case 'V':
- if (argp_program_version_hook)
- (*argp_program_version_hook) (state->out_stream, state);
- else if (argp_program_version)
- fprintf (state->out_stream, "%s\n", argp_program_version);
- else
- __argp_error (state, dgettext (state->root_argp->argp_domain,
- "(PROGRAM ERROR) No version known!?"));
- if (! (state->flags & ARGP_NO_EXIT))
- exit (0);
- break;
- default:
- return EBADKEY;
- }
- return 0;
-}
-
-static const struct argp argp_version_argp =
- {argp_version_options, &argp_version_parser, NULL, NULL, NULL, NULL, "libc"};
-
-/* Returns the offset into the getopt long options array LONG_OPTIONS of a
- long option with called NAME, or -1 if none is found. Passing NULL as
- NAME will return the number of options. */
-static int
-find_long_option (struct option *long_options, const char *name)
-{
- struct option *l = long_options;
- while (l->name != NULL)
- if (name != NULL && strcmp (l->name, name) == 0)
- return l - long_options;
- else
- l++;
- if (name == NULL)
- return l - long_options;
- else
- return -1;
-}
-
-
-/* The state of a `group' during parsing. Each group corresponds to a
- particular argp structure from the tree of such descending from the top
- level argp passed to argp_parse. */
-struct group
-{
- /* This group's parsing function. */
- argp_parser_t parser;
-
- /* Which argp this group is from. */
- const struct argp *argp;
-
- /* Points to the point in SHORT_OPTS corresponding to the end of the short
- options for this group. We use it to determine from which group a
- particular short options is from. */
- char *short_end;
-
- /* The number of non-option args sucessfully handled by this parser. */
- unsigned args_processed;
-
- /* This group's parser's parent's group. */
- struct group *parent;
- unsigned parent_index; /* And the our position in the parent. */
-
- /* These fields are swapped into and out of the state structure when
- calling this group's parser. */
- void *input, **child_inputs;
- void *hook;
-};
-
-/* Call GROUP's parser with KEY and ARG, swapping any group-specific info
- from STATE before calling, and back into state afterwards. If GROUP has
- no parser, EBADKEY is returned. */
-static error_t
-group_parse (struct group *group, struct argp_state *state, int key, char *arg)
-{
- if (group->parser)
- {
- error_t err;
- state->hook = group->hook;
- state->input = group->input;
- state->child_inputs = group->child_inputs;
- state->arg_num = group->args_processed;
- err = (*group->parser)(key, arg, state);
- group->hook = state->hook;
- return err;
- }
- else
- return EBADKEY;
-}
-
-struct parser
-{
- const struct argp *argp;
-
- /* SHORT_OPTS is the getopt short options string for the union of all the
- groups of options. */
- char *short_opts;
- /* LONG_OPTS is the array of getop long option structures for the union of
- all the groups of options. */
- struct option *long_opts;
- /* OPT_DATA is the getopt data used for the re-entrant getopt. */
- struct _getopt_data opt_data;
-
- /* States of the various parsing groups. */
- struct group *groups;
- /* The end of the GROUPS array. */
- struct group *egroup;
- /* An vector containing storage for the CHILD_INPUTS field in all groups. */
- void **child_inputs;
-
- /* True if we think using getopt is still useful; if false, then
- remaining arguments are just passed verbatim with ARGP_KEY_ARG. This is
- cleared whenever getopt returns KEY_END, but may be set again if the user
- moves the next argument pointer backwards. */
- int try_getopt;
-
- /* State block supplied to parsing routines. */
- struct argp_state state;
-
- /* Memory used by this parser. */
- void *storage;
-};
-
-/* The next usable entries in the various parser tables being filled in by
- convert_options. */
-struct parser_convert_state
-{
- struct parser *parser;
- char *short_end;
- struct option *long_end;
- void **child_inputs_end;
-};
-
-/* Converts all options in ARGP (which is put in GROUP) and ancestors
- into getopt options stored in SHORT_OPTS and LONG_OPTS; SHORT_END and
- CVT->LONG_END are the points at which new options are added. Returns the
- next unused group entry. CVT holds state used during the conversion. */
-static struct group *
-convert_options (const struct argp *argp,
- struct group *parent, unsigned parent_index,
- struct group *group, struct parser_convert_state *cvt)
-{
- /* REAL is the most recent non-alias value of OPT. */
- const struct argp_option *real = argp->options;
- const struct argp_child *children = argp->children;
-
- if (real || argp->parser)
- {
- const struct argp_option *opt;
-
- if (real)
- for (opt = real; !__option_is_end (opt); opt++)
- {
- if (! (opt->flags & OPTION_ALIAS))
- /* OPT isn't an alias, so we can use values from it. */
- real = opt;
-
- if (! (real->flags & OPTION_DOC))
- /* A real option (not just documentation). */
- {
- if (__option_is_short (opt))
- /* OPT can be used as a short option. */
- {
- *cvt->short_end++ = opt->key;
- if (real->arg)
- {
- *cvt->short_end++ = ':';
- if (real->flags & OPTION_ARG_OPTIONAL)
- *cvt->short_end++ = ':';
- }
- *cvt->short_end = '\0'; /* keep 0 terminated */
- }
-
- if (opt->name
- && find_long_option (cvt->parser->long_opts, opt->name) < 0)
- /* OPT can be used as a long option. */
- {
- cvt->long_end->name = opt->name;
- cvt->long_end->has_arg =
- (real->arg
- ? (real->flags & OPTION_ARG_OPTIONAL
- ? optional_argument
- : required_argument)
- : no_argument);
- cvt->long_end->flag = 0;
- /* we add a disambiguating code to all the user's
- values (which is removed before we actually call
- the function to parse the value); this means that
- the user loses use of the high 8 bits in all his
- values (the sign of the lower bits is preserved
- however)... */
- cvt->long_end->val =
- ((opt->key | real->key) & USER_MASK)
- + (((group - cvt->parser->groups) + 1) << USER_BITS);
-
- /* Keep the LONG_OPTS list terminated. */
- (++cvt->long_end)->name = NULL;
- }
- }
- }
-
- group->parser = argp->parser;
- group->argp = argp;
- group->short_end = cvt->short_end;
- group->args_processed = 0;
- group->parent = parent;
- group->parent_index = parent_index;
- group->input = 0;
- group->hook = 0;
- group->child_inputs = 0;
-
- if (children)
- /* Assign GROUP's CHILD_INPUTS field some space from
- CVT->child_inputs_end.*/
- {
- unsigned num_children = 0;
- while (children[num_children].argp)
- num_children++;
- group->child_inputs = cvt->child_inputs_end;
- cvt->child_inputs_end += num_children;
- }
-
- parent = group++;
- }
- else
- parent = 0;
-
- if (children)
- {
- unsigned index = 0;
- while (children->argp)
- group =
- convert_options (children++->argp, parent, index++, group, cvt);
- }
-
- return group;
-}
-
-/* Find the merged set of getopt options, with keys appropiately prefixed. */
-static void
-parser_convert (struct parser *parser, const struct argp *argp, int flags)
-{
- struct parser_convert_state cvt;
-
- cvt.parser = parser;
- cvt.short_end = parser->short_opts;
- cvt.long_end = parser->long_opts;
- cvt.child_inputs_end = parser->child_inputs;
-
- if (flags & ARGP_IN_ORDER)
- *cvt.short_end++ = '-';
- else if (flags & ARGP_NO_ARGS)
- *cvt.short_end++ = '+';
- *cvt.short_end = '\0';
-
- cvt.long_end->name = NULL;
-
- parser->argp = argp;
-
- if (argp)
- parser->egroup = convert_options (argp, 0, 0, parser->groups, &cvt);
- else
- parser->egroup = parser->groups; /* No parsers at all! */
-}
-
-/* Lengths of various parser fields which we will allocated. */
-struct parser_sizes
-{
- size_t short_len; /* Getopt short options string. */
- size_t long_len; /* Getopt long options vector. */
- size_t num_groups; /* Group structures we allocate. */
- size_t num_child_inputs; /* Child input slots. */
-};
-
-/* For ARGP, increments the NUM_GROUPS field in SZS by the total number of
- argp structures descended from it, and the SHORT_LEN & LONG_LEN fields by
- the maximum lengths of the resulting merged getopt short options string and
- long-options array, respectively. */
-static void
-calc_sizes (const struct argp *argp, struct parser_sizes *szs)
-{
- const struct argp_child *child = argp->children;
- const struct argp_option *opt = argp->options;
-
- if (opt || argp->parser)
- {
- szs->num_groups++;
- if (opt)
- {
- int num_opts = 0;
- while (!__option_is_end (opt++))
- num_opts++;
- szs->short_len += num_opts * 3; /* opt + up to 2 `:'s */
- szs->long_len += num_opts;
- }
- }
-
- if (child)
- while (child->argp)
- {
- calc_sizes ((child++)->argp, szs);
- szs->num_child_inputs++;
- }
-}
-
-/* Initializes PARSER to parse ARGP in a manner described by FLAGS. */
-static error_t
-parser_init (struct parser *parser, const struct argp *argp,
- int argc, char **argv, int flags, void *input)
-{
- error_t err = 0;
- struct group *group;
- struct parser_sizes szs;
- struct _getopt_data opt_data = _GETOPT_DATA_INITIALIZER;
- char *storage;
- size_t glen, gsum;
- size_t clen, csum;
- size_t llen, lsum;
- size_t slen, ssum;
-
- szs.short_len = (flags & ARGP_NO_ARGS) ? 0 : 1;
- szs.long_len = 0;
- szs.num_groups = 0;
- szs.num_child_inputs = 0;
-
- if (argp)
- calc_sizes (argp, &szs);
-
- /* Lengths of the various bits of storage used by PARSER. */
- glen = (szs.num_groups + 1) * sizeof (struct group);
- clen = szs.num_child_inputs * sizeof (void *);
- llen = (szs.long_len + 1) * sizeof (struct option);
- slen = szs.short_len + 1;
-
- /* Sums of previous lengths, properly aligned. There's no need to
- align gsum, since struct group is aligned at least as strictly as
- void * (since it contains a void * member). And there's no need
- to align lsum, since struct option is aligned at least as
- strictly as char. */
- gsum = glen;
- csum = alignto (gsum + clen, alignof (struct option));
- lsum = csum + llen;
- ssum = lsum + slen;
-
- parser->storage = malloc (ssum);
- if (! parser->storage)
- return ENOMEM;
-
- storage = parser->storage;
- parser->groups = parser->storage;
- parser->child_inputs = (void **) (storage + gsum);
- parser->long_opts = (struct option *) (storage + csum);
- parser->short_opts = storage + lsum;
- parser->opt_data = opt_data;
-
- memset (parser->child_inputs, 0, clen);
- parser_convert (parser, argp, flags);
-
- memset (&parser->state, 0, sizeof (struct argp_state));
- parser->state.root_argp = parser->argp;
- parser->state.argc = argc;
- parser->state.argv = argv;
- parser->state.flags = flags;
- parser->state.err_stream = stderr;
- parser->state.out_stream = stdout;
- parser->state.next = 0; /* Tell getopt to initialize. */
- parser->state.pstate = parser;
-
- parser->try_getopt = 1;
-
- /* Call each parser for the first time, giving it a chance to propagate
- values to child parsers. */
- if (parser->groups < parser->egroup)
- parser->groups->input = input;
- for (group = parser->groups;
- group < parser->egroup && (!err || err == EBADKEY);
- group++)
- {
- if (group->parent)
- /* If a child parser, get the initial input value from the parent. */
- group->input = group->parent->child_inputs[group->parent_index];
-
- if (!group->parser
- && group->argp->children && group->argp->children->argp)
- /* For the special case where no parsing function is supplied for an
- argp, propagate its input to its first child, if any (this just
- makes very simple wrapper argps more convenient). */
- group->child_inputs[0] = group->input;
-
- err = group_parse (group, &parser->state, ARGP_KEY_INIT, 0);
- }
- if (err == EBADKEY)
- err = 0; /* Some parser didn't understand. */
-
- if (err)
- return err;
-
- if (parser->state.flags & ARGP_NO_ERRS)
- {
- parser->opt_data.opterr = 0;
- if (parser->state.flags & ARGP_PARSE_ARGV0)
- /* getopt always skips ARGV[0], so we have to fake it out. As long
- as OPTERR is 0, then it shouldn't actually try to access it. */
- parser->state.argv--, parser->state.argc++;
- }
- else
- parser->opt_data.opterr = 1; /* Print error messages. */
-
- if (parser->state.argv == argv && argv[0])
- /* There's an argv[0]; use it for messages. */
- parser->state.name = __argp_base_name (argv[0]);
- else
- parser->state.name = __argp_short_program_name ();
-
- return 0;
-}
-
-/* Free any storage consumed by PARSER (but not PARSER itself). */
-static error_t
-parser_finalize (struct parser *parser,
- error_t err, int arg_ebadkey, int *end_index)
-{
- struct group *group;
-
- if (err == EBADKEY && arg_ebadkey)
- /* Suppress errors generated by unparsed arguments. */
- err = 0;
-
- if (! err)
- {
- if (parser->state.next == parser->state.argc)
- /* We successfully parsed all arguments! Call all the parsers again,
- just a few more times... */
- {
- for (group = parser->groups;
- group < parser->egroup && (!err || err==EBADKEY);
- group++)
- if (group->args_processed == 0)
- err = group_parse (group, &parser->state, ARGP_KEY_NO_ARGS, 0);
- for (group = parser->egroup - 1;
- group >= parser->groups && (!err || err==EBADKEY);
- group--)
- err = group_parse (group, &parser->state, ARGP_KEY_END, 0);
-
- if (err == EBADKEY)
- err = 0; /* Some parser didn't understand. */
-
- /* Tell the user that all arguments are parsed. */
- if (end_index)
- *end_index = parser->state.next;
- }
- else if (end_index)
- /* Return any remaining arguments to the user. */
- *end_index = parser->state.next;
- else
- /* No way to return the remaining arguments, they must be bogus. */
- {
- if (!(parser->state.flags & ARGP_NO_ERRS)
- && parser->state.err_stream)
- fprintf (parser->state.err_stream,
- dgettext (parser->argp->argp_domain,
- "%s: Too many arguments\n"),
- parser->state.name);
- err = EBADKEY;
- }
- }
-
- /* Okay, we're all done, with either an error or success; call the parsers
- to indicate which one. */
-
- if (err)
- {
- /* Maybe print an error message. */
- if (err == EBADKEY)
- /* An appropriate message describing what the error was should have
- been printed earlier. */
- __argp_state_help (&parser->state, parser->state.err_stream,
- ARGP_HELP_STD_ERR);
-
- /* Since we didn't exit, give each parser an error indication. */
- for (group = parser->groups; group < parser->egroup; group++)
- group_parse (group, &parser->state, ARGP_KEY_ERROR, 0);
- }
- else
- /* Notify parsers of success, and propagate back values from parsers. */
- {
- /* We pass over the groups in reverse order so that child groups are
- given a chance to do there processing before passing back a value to
- the parent. */
- for (group = parser->egroup - 1
- ; group >= parser->groups && (!err || err == EBADKEY)
- ; group--)
- err = group_parse (group, &parser->state, ARGP_KEY_SUCCESS, 0);
- if (err == EBADKEY)
- err = 0; /* Some parser didn't understand. */
- }
-
- /* Call parsers once more, to do any final cleanup. Errors are ignored. */
- for (group = parser->egroup - 1; group >= parser->groups; group--)
- group_parse (group, &parser->state, ARGP_KEY_FINI, 0);
-
- if (err == EBADKEY)
- err = EINVAL;
-
- free (parser->storage);
-
- return err;
-}
-
-/* Call the user parsers to parse the non-option argument VAL, at the current
- position, returning any error. The state NEXT pointer is assumed to have
- been adjusted (by getopt) to point after this argument; this function will
- adjust it correctly to reflect however many args actually end up being
- consumed. */
-static error_t
-parser_parse_arg (struct parser *parser, char *val)
-{
- /* Save the starting value of NEXT, first adjusting it so that the arg
- we're parsing is again the front of the arg vector. */
- int index = --parser->state.next;
- error_t err = EBADKEY;
- struct group *group;
- int key = 0; /* Which of ARGP_KEY_ARG[S] we used. */
-
- /* Try to parse the argument in each parser. */
- for (group = parser->groups
- ; group < parser->egroup && err == EBADKEY
- ; group++)
- {
- parser->state.next++; /* For ARGP_KEY_ARG, consume the arg. */
- key = ARGP_KEY_ARG;
- err = group_parse (group, &parser->state, key, val);
-
- if (err == EBADKEY)
- /* This parser doesn't like ARGP_KEY_ARG; try ARGP_KEY_ARGS instead. */
- {
- parser->state.next--; /* For ARGP_KEY_ARGS, put back the arg. */
- key = ARGP_KEY_ARGS;
- err = group_parse (group, &parser->state, key, 0);
- }
- }
-
- if (! err)
- {
- if (key == ARGP_KEY_ARGS)
- /* The default for ARGP_KEY_ARGS is to assume that if NEXT isn't
- changed by the user, *all* arguments should be considered
- consumed. */
- parser->state.next = parser->state.argc;
-
- if (parser->state.next > index)
- /* Remember that we successfully processed a non-option
- argument -- but only if the user hasn't gotten tricky and set
- the clock back. */
- (--group)->args_processed += (parser->state.next - index);
- else
- /* The user wants to reparse some args, give getopt another try. */
- parser->try_getopt = 1;
- }
-
- return err;
-}
-
-/* Call the user parsers to parse the option OPT, with argument VAL, at the
- current position, returning any error. */
-static error_t
-parser_parse_opt (struct parser *parser, int opt, char *val)
-{
- /* The group key encoded in the high bits; 0 for short opts or
- group_number + 1 for long opts. */
- int group_key = opt >> USER_BITS;
- error_t err = EBADKEY;
-
- if (group_key == 0)
- /* A short option. By comparing OPT's position in SHORT_OPTS to the
- various starting positions in each group's SHORT_END field, we can
- determine which group OPT came from. */
- {
- struct group *group;
- char *short_index = strchr (parser->short_opts, opt);
-
- if (short_index)
- for (group = parser->groups; group < parser->egroup; group++)
- if (group->short_end > short_index)
- {
- err = group_parse (group, &parser->state, opt,
- parser->opt_data.optarg);
- break;
- }
- }
- else
- /* A long option. We use shifts instead of masking for extracting
- the user value in order to preserve the sign. */
- err =
- group_parse (&parser->groups[group_key - 1], &parser->state,
- (opt << GROUP_BITS) >> GROUP_BITS,
- parser->opt_data.optarg);
-
- if (err == EBADKEY)
- /* At least currently, an option not recognized is an error in the
- parser, because we pre-compute which parser is supposed to deal
- with each option. */
- {
- static const char bad_key_err[] =
- N_("(PROGRAM ERROR) Option should have been recognized!?");
- if (group_key == 0)
- __argp_error (&parser->state, "-%c: %s", opt,
- dgettext (parser->argp->argp_domain, bad_key_err));
- else
- {
- struct option *long_opt = parser->long_opts;
- while (long_opt->val != opt && long_opt->name)
- long_opt++;
- __argp_error (&parser->state, "--%s: %s",
- long_opt->name ? long_opt->name : "???",
- dgettext (parser->argp->argp_domain, bad_key_err));
- }
- }
-
- return err;
-}
-
-/* Parse the next argument in PARSER (as indicated by PARSER->state.next).
- Any error from the parsers is returned, and *ARGP_EBADKEY indicates
- whether a value of EBADKEY is due to an unrecognized argument (which is
- generally not fatal). */
-static error_t
-parser_parse_next (struct parser *parser, int *arg_ebadkey)
-{
- int opt;
- error_t err = 0;
-
- if (parser->state.quoted && parser->state.next < parser->state.quoted)
- /* The next argument pointer has been moved to before the quoted
- region, so pretend we never saw the quoting `--', and give getopt
- another chance. If the user hasn't removed it, getopt will just
- process it again. */
- parser->state.quoted = 0;
-
- if (parser->try_getopt && !parser->state.quoted)
- /* Give getopt a chance to parse this. */
- {
- /* Put it back in OPTIND for getopt. */
- parser->opt_data.optind = parser->state.next;
- /* Distinguish KEY_ERR from a real option. */
- parser->opt_data.optopt = KEY_END;
- if (parser->state.flags & ARGP_LONG_ONLY)
- opt = _getopt_long_only_r (parser->state.argc, parser->state.argv,
- parser->short_opts, parser->long_opts, 0,
- &parser->opt_data);
- else
- opt = _getopt_long_r (parser->state.argc, parser->state.argv,
- parser->short_opts, parser->long_opts, 0,
- &parser->opt_data);
- /* And see what getopt did. */
- parser->state.next = parser->opt_data.optind;
-
- if (opt == KEY_END)
- /* Getopt says there are no more options, so stop using
- getopt; we'll continue if necessary on our own. */
- {
- parser->try_getopt = 0;
- if (parser->state.next > 1
- && strcmp (parser->state.argv[parser->state.next - 1], QUOTE)
- == 0)
- /* Not only is this the end of the options, but it's a
- `quoted' region, which may have args that *look* like
- options, so we definitely shouldn't try to use getopt past
- here, whatever happens. */
- parser->state.quoted = parser->state.next;
- }
- else if (opt == KEY_ERR && parser->opt_data.optopt != KEY_END)
- /* KEY_ERR can have the same value as a valid user short
- option, but in the case of a real error, getopt sets OPTOPT
- to the offending character, which can never be KEY_END. */
- {
- *arg_ebadkey = 0;
- return EBADKEY;
- }
- }
- else
- opt = KEY_END;
-
- if (opt == KEY_END)
- {
- /* We're past what getopt considers the options. */
- if (parser->state.next >= parser->state.argc
- || (parser->state.flags & ARGP_NO_ARGS))
- /* Indicate that we're done. */
- {
- *arg_ebadkey = 1;
- return EBADKEY;
- }
- else
- /* A non-option arg; simulate what getopt might have done. */
- {
- opt = KEY_ARG;
- parser->opt_data.optarg = parser->state.argv[parser->state.next++];
- }
- }
-
- if (opt == KEY_ARG)
- /* A non-option argument; try each parser in turn. */
- err = parser_parse_arg (parser, parser->opt_data.optarg);
- else
- err = parser_parse_opt (parser, opt, parser->opt_data.optarg);
-
- if (err == EBADKEY)
- *arg_ebadkey = (opt == KEY_END || opt == KEY_ARG);
-
- return err;
-}
-
-/* Parse the options strings in ARGC & ARGV according to the argp in ARGP.
- FLAGS is one of the ARGP_ flags above. If END_INDEX is non-NULL, the
- index in ARGV of the first unparsed option is returned in it. If an
- unknown option is present, EINVAL is returned; if some parser routine
- returned a non-zero value, it is returned; otherwise 0 is returned. */
-error_t
-__argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags,
- int *end_index, void *input)
-{
- error_t err;
- struct parser parser;
-
- /* If true, then err == EBADKEY is a result of a non-option argument failing
- to be parsed (which in some cases isn't actually an error). */
- int arg_ebadkey = 0;
-
- if (! (flags & ARGP_NO_HELP))
- /* Add our own options. */
- {
- struct argp_child *child = alloca (4 * sizeof (struct argp_child));
- struct argp *top_argp = alloca (sizeof (struct argp));
-
- /* TOP_ARGP has no options, it just serves to group the user & default
- argps. */
- memset (top_argp, 0, sizeof (*top_argp));
- top_argp->children = child;
-
- memset (child, 0, 4 * sizeof (struct argp_child));
-
- if (argp)
- (child++)->argp = argp;
- (child++)->argp = &argp_default_argp;
- if (argp_program_version || argp_program_version_hook)
- (child++)->argp = &argp_version_argp;
- child->argp = 0;
-
- argp = top_argp;
- }
-
- /* Construct a parser for these arguments. */
- err = parser_init (&parser, argp, argc, argv, flags, input);
-
- if (! err)
- /* Parse! */
- {
- while (! err)
- err = parser_parse_next (&parser, &arg_ebadkey);
- err = parser_finalize (&parser, err, arg_ebadkey, end_index);
- }
-
- return err;
-}
-#ifdef weak_alias
-weak_alias (__argp_parse, argp_parse)
-#endif
-
-/* Return the input field for ARGP in the parser corresponding to STATE; used
- by the help routines. */
-void *
-__argp_input (const struct argp *argp, const struct argp_state *state)
-{
- if (state)
- {
- struct group *group;
- struct parser *parser = state->pstate;
-
- for (group = parser->groups; group < parser->egroup; group++)
- if (group->argp == argp)
- return group->input;
- }
-
- return 0;
-}
-#ifdef weak_alias
-weak_alias (__argp_input, _argp_input)
-#endif
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argp-pin.c b/xbmc/screensavers/rsxs-0.9/lib/argp-pin.c
deleted file mode 100644
index 852c6d6d93..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argp-pin.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Full and short program names for argp module
- Copyright (C) 2005 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
-char *program_invocation_short_name = 0;
-#endif
-#ifndef HAVE_PROGRAM_INVOCATION_NAME
-char *program_invocation_name = 0;
-#endif
-
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argp-pv.c b/xbmc/screensavers/rsxs-0.9/lib/argp-pv.c
deleted file mode 100644
index a11298bfab..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argp-pv.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Default definition for ARGP_PROGRAM_VERSION.
- Copyright (C) 1996, 1997, 1999, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* If set by the user program to a non-zero value, then a default option
- --version is added (unless the ARGP_NO_HELP flag is used), which will
- print this string followed by a newline and exit (unless the
- ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
-const char *argp_program_version;
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argp-pvh.c b/xbmc/screensavers/rsxs-0.9/lib/argp-pvh.c
deleted file mode 100644
index 6bf7c49b81..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argp-pvh.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Default definition for ARGP_PROGRAM_VERSION_HOOK.
- Copyright (C) 1996, 1997, 1999, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "argp.h"
-
-/* If set by the user program to a non-zero value, then a default option
- --version is added (unless the ARGP_NO_HELP flag is used), which calls
- this function with a stream to print the version to and a pointer to the
- current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
- used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
-void (*argp_program_version_hook) (FILE *stream, struct argp_state *state) = NULL;
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argp-xinl.c b/xbmc/screensavers/rsxs-0.9/lib/argp-xinl.c
deleted file mode 100644
index a6afb1f739..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argp-xinl.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Real definitions for extern inline functions in argp.h
- Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if defined _LIBC || defined HAVE_FEATURES_H
-# include <features.h>
-#endif
-
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#define ARGP_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
-#include "argp.h"
-
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
-weak_alias (__argp_usage, argp_usage)
-weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-
-#endif
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argp.h b/xbmc/screensavers/rsxs-0.9/lib/argp.h
deleted file mode 100644
index c83c75e2bf..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argp.h
+++ /dev/null
@@ -1,601 +0,0 @@
-/* Hierarchial argument parsing, layered over getopt.
- Copyright (C) 1995-1999,2003-2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _ARGP_H
-#define _ARGP_H
-
-#include <stdio.h>
-#include <ctype.h>
-#include <getopt.h>
-#include <limits.h>
-
-#define __need_error_t
-#include <errno.h>
-
-#ifndef __THROW
-# define __THROW
-#endif
-#ifndef __NTH
-# define __NTH(fct) fct __THROW
-#endif
-
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
-# define __attribute__(Spec) /* empty */
-# endif
-/* The __-protected variants of `format' and `printf' attributes
- are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || __STRICT_ANSI__
-# define __format__ format
-# define __printf__ printf
-# endif
-#endif
-
-/* GCC 2.95 and later have "__restrict"; C99 compilers have
- "restrict", and "configure" may have defined "restrict". */
-#ifndef __restrict
-# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
-# if defined restrict || 199901L <= __STDC_VERSION__
-# define __restrict restrict
-# else
-# define __restrict
-# endif
-# endif
-#endif
-
-#ifndef __error_t_defined
-typedef int error_t;
-# define __error_t_defined
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* A description of a particular option. A pointer to an array of
- these is passed in the OPTIONS field of an argp structure. Each option
- entry can correspond to one long option and/or one short option; more
- names for the same option can be added by following an entry in an option
- array with options having the OPTION_ALIAS flag set. */
-struct argp_option
-{
- /* The long option name. For more than one name for the same option, you
- can use following options with the OPTION_ALIAS flag set. */
- const char *name;
-
- /* What key is returned for this option. If > 0 and printable, then it's
- also accepted as a short option. */
- int key;
-
- /* If non-NULL, this is the name of the argument associated with this
- option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */
- const char *arg;
-
- /* OPTION_ flags. */
- int flags;
-
- /* The doc string for this option. If both NAME and KEY are 0, This string
- will be printed outdented from the normal option column, making it
- useful as a group header (it will be the first thing printed in its
- group); in this usage, it's conventional to end the string with a `:'. */
- const char *doc;
-
- /* The group this option is in. In a long help message, options are sorted
- alphabetically within each group, and the groups presented in the order
- 0, 1, 2, ..., n, -m, ..., -2, -1. Every entry in an options array with
- if this field 0 will inherit the group number of the previous entry, or
- zero if it's the first one, unless its a group header (NAME and KEY both
- 0), in which case, the previous entry + 1 is the default. Automagic
- options such as --help are put into group -1. */
- int group;
-};
-
-/* The argument associated with this option is optional. */
-#define OPTION_ARG_OPTIONAL 0x1
-
-/* This option isn't displayed in any help messages. */
-#define OPTION_HIDDEN 0x2
-
-/* This option is an alias for the closest previous non-alias option. This
- means that it will be displayed in the same help entry, and will inherit
- fields other than NAME and KEY from the aliased option. */
-#define OPTION_ALIAS 0x4
-
-/* This option isn't actually an option (and so should be ignored by the
- actual option parser), but rather an arbitrary piece of documentation that
- should be displayed in much the same manner as the options. If this flag
- is set, then the option NAME field is displayed unmodified (e.g., no `--'
- prefix is added) at the left-margin (where a *short* option would normally
- be displayed), and the documentation string in the normal place. The NAME
- field will be translated using gettext, unless OPTION_NO_TRANS is set (see
- below). For purposes of sorting, any leading whitespace and punctuation is
- ignored, except that if the first non-whitespace character is not `-', this
- entry is displayed after all options (and OPTION_DOC entries with a leading
- `-') in the same group. */
-#define OPTION_DOC 0x8
-
-/* This option shouldn't be included in `long' usage messages (but is still
- included in help messages). This is mainly intended for options that are
- completely documented in an argp's ARGS_DOC field, in which case including
- the option in the generic usage list would be redundant. For instance,
- if ARGS_DOC is "FOO BAR\n-x BLAH", and the `-x' option's purpose is to
- distinguish these two cases, -x should probably be marked
- OPTION_NO_USAGE. */
-#define OPTION_NO_USAGE 0x10
-
-/* Valid only in conjunction with OPTION_DOC. This option disables translation
- of option name. */
-#define OPTION_NO_TRANS 0x20
-
-
-struct argp; /* fwd declare this type */
-struct argp_state; /* " */
-struct argp_child; /* " */
-
-/* The type of a pointer to an argp parsing function. */
-typedef error_t (*argp_parser_t) (int key, char *arg,
- struct argp_state *state);
-
-/* What to return for unrecognized keys. For special ARGP_KEY_ keys, such
- returns will simply be ignored. For user keys, this error will be turned
- into EINVAL (if the call to argp_parse is such that errors are propagated
- back to the user instead of exiting); returning EINVAL itself would result
- in an immediate stop to parsing in *all* cases. */
-#define ARGP_ERR_UNKNOWN E2BIG /* Hurd should never need E2BIG. XXX */
-
-/* Special values for the KEY argument to an argument parsing function.
- ARGP_ERR_UNKNOWN should be returned if they aren't understood.
-
- The sequence of keys to a parsing function is either (where each
- uppercased word should be prefixed by `ARGP_KEY_' and opt is a user key):
-
- INIT opt... NO_ARGS END SUCCESS -- No non-option arguments at all
- or INIT (opt | ARG)... END SUCCESS -- All non-option args parsed
- or INIT (opt | ARG)... SUCCESS -- Some non-option arg unrecognized
-
- The third case is where every parser returned ARGP_KEY_UNKNOWN for an
- argument, in which case parsing stops at that argument (returning the
- unparsed arguments to the caller of argp_parse if requested, or stopping
- with an error message if not).
-
- If an error occurs (either detected by argp, or because the parsing
- function returned an error value), then the parser is called with
- ARGP_KEY_ERROR, and no further calls are made. */
-
-/* This is not an option at all, but rather a command line argument. If a
- parser receiving this key returns success, the fact is recorded, and the
- ARGP_KEY_NO_ARGS case won't be used. HOWEVER, if while processing the
- argument, a parser function decrements the NEXT field of the state it's
- passed, the option won't be considered processed; this is to allow you to
- actually modify the argument (perhaps into an option), and have it
- processed again. */
-#define ARGP_KEY_ARG 0
-/* There are remaining arguments not parsed by any parser, which may be found
- starting at (STATE->argv + STATE->next). If success is returned, but
- STATE->next left untouched, it's assumed that all arguments were consume,
- otherwise, the parser should adjust STATE->next to reflect any arguments
- consumed. */
-#define ARGP_KEY_ARGS 0x1000006
-/* There are no more command line arguments at all. */
-#define ARGP_KEY_END 0x1000001
-/* Because it's common to want to do some special processing if there aren't
- any non-option args, user parsers are called with this key if they didn't
- successfully process any non-option arguments. Called just before
- ARGP_KEY_END (where more general validity checks on previously parsed
- arguments can take place). */
-#define ARGP_KEY_NO_ARGS 0x1000002
-/* Passed in before any parsing is done. Afterwards, the values of each
- element of the CHILD_INPUT field, if any, in the state structure is
- copied to each child's state to be the initial value of the INPUT field. */
-#define ARGP_KEY_INIT 0x1000003
-/* Use after all other keys, including SUCCESS & END. */
-#define ARGP_KEY_FINI 0x1000007
-/* Passed in when parsing has successfully been completed (even if there are
- still arguments remaining). */
-#define ARGP_KEY_SUCCESS 0x1000004
-/* Passed in if an error occurs. */
-#define ARGP_KEY_ERROR 0x1000005
-
-/* An argp structure contains a set of options declarations, a function to
- deal with parsing one, documentation string, a possible vector of child
- argp's, and perhaps a function to filter help output. When actually
- parsing options, getopt is called with the union of all the argp
- structures chained together through their CHILD pointers, with conflicts
- being resolved in favor of the first occurrence in the chain. */
-struct argp
-{
- /* An array of argp_option structures, terminated by an entry with both
- NAME and KEY having a value of 0. */
- const struct argp_option *options;
-
- /* What to do with an option from this structure. KEY is the key
- associated with the option, and ARG is any associated argument (NULL if
- none was supplied). If KEY isn't understood, ARGP_ERR_UNKNOWN should be
- returned. If a non-zero, non-ARGP_ERR_UNKNOWN value is returned, then
- parsing is stopped immediately, and that value is returned from
- argp_parse(). For special (non-user-supplied) values of KEY, see the
- ARGP_KEY_ definitions below. */
- argp_parser_t parser;
-
- /* A string describing what other arguments are wanted by this program. It
- is only used by argp_usage to print the `Usage:' message. If it
- contains newlines, the strings separated by them are considered
- alternative usage patterns, and printed on separate lines (lines after
- the first are prefix by ` or: ' instead of `Usage:'). */
- const char *args_doc;
-
- /* If non-NULL, a string containing extra text to be printed before and
- after the options in a long help message (separated by a vertical tab
- `\v' character). */
- const char *doc;
-
- /* A vector of argp_children structures, terminated by a member with a 0
- argp field, pointing to child argps should be parsed with this one. Any
- conflicts are resolved in favor of this argp, or early argps in the
- CHILDREN list. This field is useful if you use libraries that supply
- their own argp structure, which you want to use in conjunction with your
- own. */
- const struct argp_child *children;
-
- /* If non-zero, this should be a function to filter the output of help
- messages. KEY is either a key from an option, in which case TEXT is
- that option's help text, or a special key from the ARGP_KEY_HELP_
- defines, below, describing which other help text TEXT is. The function
- should return either TEXT, if it should be used as-is, a replacement
- string, which should be malloced, and will be freed by argp, or NULL,
- meaning `print nothing'. The value for TEXT is *after* any translation
- has been done, so if any of the replacement text also needs translation,
- that should be done by the filter function. INPUT is either the input
- supplied to argp_parse, or NULL, if argp_help was called directly. */
- char *(*help_filter) (int __key, const char *__text, void *__input);
-
- /* If non-zero the strings used in the argp library are translated using
- the domain described by this string. Otherwise the currently installed
- default domain is used. */
- const char *argp_domain;
-};
-
-/* Possible KEY arguments to a help filter function. */
-#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceeding options. */
-#define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */
-#define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */
-#define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation;
- TEXT is NULL for this key. */
-/* Explanatory note emitted when duplicate option arguments have been
- suppressed. */
-#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
-#define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */
-
-/* When an argp has a non-zero CHILDREN field, it should point to a vector of
- argp_child structures, each of which describes a subsidiary argp. */
-struct argp_child
-{
- /* The child parser. */
- const struct argp *argp;
-
- /* Flags for this child. */
- int flags;
-
- /* If non-zero, an optional header to be printed in help output before the
- child options. As a side-effect, a non-zero value forces the child
- options to be grouped together; to achieve this effect without actually
- printing a header string, use a value of "". */
- const char *header;
-
- /* Where to group the child options relative to the other (`consolidated')
- options in the parent argp; the values are the same as the GROUP field
- in argp_option structs, but all child-groupings follow parent options at
- a particular group level. If both this field and HEADER are zero, then
- they aren't grouped at all, but rather merged with the parent options
- (merging the child's grouping levels with the parents). */
- int group;
-};
-
-/* Parsing state. This is provided to parsing functions called by argp,
- which may examine and, as noted, modify fields. */
-struct argp_state
-{
- /* The top level ARGP being parsed. */
- const struct argp *root_argp;
-
- /* The argument vector being parsed. May be modified. */
- int argc;
- char **argv;
-
- /* The index in ARGV of the next arg that to be parsed. May be modified. */
- int next;
-
- /* The flags supplied to argp_parse. May be modified. */
- unsigned flags;
-
- /* While calling a parsing function with a key of ARGP_KEY_ARG, this is the
- number of the current arg, starting at zero, and incremented after each
- such call returns. At all other times, this is the number of such
- arguments that have been processed. */
- unsigned arg_num;
-
- /* If non-zero, the index in ARGV of the first argument following a special
- `--' argument (which prevents anything following being interpreted as an
- option). Only set once argument parsing has proceeded past this point. */
- int quoted;
-
- /* An arbitrary pointer passed in from the user. */
- void *input;
- /* Values to pass to child parsers. This vector will be the same length as
- the number of children for the current parser. */
- void **child_inputs;
-
- /* For the parser's use. Initialized to 0. */
- void *hook;
-
- /* The name used when printing messages. This is initialized to ARGV[0],
- or PROGRAM_INVOCATION_NAME if that is unavailable. */
- char *name;
-
- /* Streams used when argp prints something. */
- FILE *err_stream; /* For errors; initialized to stderr. */
- FILE *out_stream; /* For information; initialized to stdout. */
-
- void *pstate; /* Private, for use by argp. */
-};
-
-/* Flags for argp_parse (note that the defaults are those that are
- convenient for program command line parsing): */
-
-/* Don't ignore the first element of ARGV. Normally (and always unless
- ARGP_NO_ERRS is set) the first element of the argument vector is
- skipped for option parsing purposes, as it corresponds to the program name
- in a command line. */
-#define ARGP_PARSE_ARGV0 0x01
-
-/* Don't print error messages for unknown options to stderr; unless this flag
- is set, ARGP_PARSE_ARGV0 is ignored, as ARGV[0] is used as the program
- name in the error messages. This flag implies ARGP_NO_EXIT (on the
- assumption that silent exiting upon errors is bad behaviour). */
-#define ARGP_NO_ERRS 0x02
-
-/* Don't parse any non-option args. Normally non-option args are parsed by
- calling the parse functions with a key of ARGP_KEY_ARG, and the actual arg
- as the value. Since it's impossible to know which parse function wants to
- handle it, each one is called in turn, until one returns 0 or an error
- other than ARGP_ERR_UNKNOWN; if an argument is handled by no one, the
- argp_parse returns prematurely (but with a return value of 0). If all
- args have been parsed without error, all parsing functions are called one
- last time with a key of ARGP_KEY_END. This flag needn't normally be set,
- as the normal behavior is to stop parsing as soon as some argument can't
- be handled. */
-#define ARGP_NO_ARGS 0x04
-
-/* Parse options and arguments in the same order they occur on the command
- line -- normally they're rearranged so that all options come first. */
-#define ARGP_IN_ORDER 0x08
-
-/* Don't provide the standard long option --help, which causes usage and
- option help information to be output to stdout, and exit (0) called. */
-#define ARGP_NO_HELP 0x10
-
-/* Don't exit on errors (they may still result in error messages). */
-#define ARGP_NO_EXIT 0x20
-
-/* Use the gnu getopt `long-only' rules for parsing arguments. */
-#define ARGP_LONG_ONLY 0x40
-
-/* Turns off any message-printing/exiting options. */
-#define ARGP_SILENT (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP)
-
-/* Parse the options strings in ARGC & ARGV according to the options in ARGP.
- FLAGS is one of the ARGP_ flags above. If ARG_INDEX is non-NULL, the
- index in ARGV of the first unparsed option is returned in it. If an
- unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser
- routine returned a non-zero value, it is returned; otherwise 0 is
- returned. This function may also call exit unless the ARGP_NO_HELP flag
- is set. INPUT is a pointer to a value to be passed in to the parser. */
-extern error_t argp_parse (const struct argp *__restrict __argp,
- int __argc, char **__restrict __argv,
- unsigned __flags, int *__restrict __arg_index,
- void *__restrict __input);
-extern error_t __argp_parse (const struct argp *__restrict __argp,
- int __argc, char **__restrict __argv,
- unsigned __flags, int *__restrict __arg_index,
- void *__restrict __input);
-
-/* Global variables. */
-
-/* If defined or set by the user program to a non-zero value, then a default
- option --version is added (unless the ARGP_NO_HELP flag is used), which
- will print this string followed by a newline and exit (unless the
- ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
-extern const char *argp_program_version;
-
-/* If defined or set by the user program to a non-zero value, then a default
- option --version is added (unless the ARGP_NO_HELP flag is used), which
- calls this function with a stream to print the version to and a pointer to
- the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
- used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
-extern void (*argp_program_version_hook) (FILE *__restrict __stream,
- struct argp_state *__restrict
- __state);
-
-/* If defined or set by the user program, it should point to string that is
- the bug-reporting address for the program. It will be printed by
- argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various
- standard help messages), embedded in a sentence that says something like
- `Report bugs to ADDR.'. */
-extern const char *argp_program_bug_address;
-
-/* The exit status that argp will use when exiting due to a parsing error.
- If not defined or set by the user program, this defaults to EX_USAGE from
- <sysexits.h>. */
-extern error_t argp_err_exit_status;
-
-/* Flags for argp_help. */
-#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */
-#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */
-#define ARGP_HELP_SEE 0x04 /* a `Try ... for more help' message. */
-#define ARGP_HELP_LONG 0x08 /* a long help message. */
-#define ARGP_HELP_PRE_DOC 0x10 /* doc string preceding long help. */
-#define ARGP_HELP_POST_DOC 0x20 /* doc string following long help. */
-#define ARGP_HELP_DOC (ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC)
-#define ARGP_HELP_BUG_ADDR 0x40 /* bug report address */
-#define ARGP_HELP_LONG_ONLY 0x80 /* modify output appropriately to
- reflect ARGP_LONG_ONLY mode. */
-
-/* These ARGP_HELP flags are only understood by argp_state_help. */
-#define ARGP_HELP_EXIT_ERR 0x100 /* Call exit(1) instead of returning. */
-#define ARGP_HELP_EXIT_OK 0x200 /* Call exit(0) instead of returning. */
-
-/* The standard thing to do after a program command line parsing error, if an
- error message has already been printed. */
-#define ARGP_HELP_STD_ERR \
- (ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
-/* The standard thing to do after a program command line parsing error, if no
- more specific error message has been printed. */
-#define ARGP_HELP_STD_USAGE \
- (ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
-/* The standard thing to do in response to a --help option. */
-#define ARGP_HELP_STD_HELP \
- (ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \
- | ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR)
-
-/* Output a usage message for ARGP to STREAM. FLAGS are from the set
- ARGP_HELP_*. */
-extern void argp_help (const struct argp *__restrict __argp,
- FILE *__restrict __stream,
- unsigned __flags, char *__restrict __name);
-extern void __argp_help (const struct argp *__restrict __argp,
- FILE *__restrict __stream, unsigned __flags,
- char *__name);
-
-/* The following routines are intended to be called from within an argp
- parsing routine (thus taking an argp_state structure as the first
- argument). They may or may not print an error message and exit, depending
- on the flags in STATE -- in any case, the caller should be prepared for
- them *not* to exit, and should return an appropiate error after calling
- them. [argp_usage & argp_error should probably be called argp_state_...,
- but they're used often enough that they should be short] */
-
-/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
- from the set ARGP_HELP_*. */
-extern void argp_state_help (const struct argp_state *__restrict __state,
- FILE *__restrict __stream,
- unsigned int __flags);
-extern void __argp_state_help (const struct argp_state *__restrict __state,
- FILE *__restrict __stream,
- unsigned int __flags);
-
-/* Possibly output the standard usage message for ARGP to stderr and exit. */
-extern void argp_usage (const struct argp_state *__state);
-extern void __argp_usage (const struct argp_state *__state);
-
-/* If appropriate, print the printf string FMT and following args, preceded
- by the program name and `:', to stderr, and followed by a `Try ... --help'
- message, then exit (1). */
-extern void argp_error (const struct argp_state *__restrict __state,
- const char *__restrict __fmt, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
-extern void __argp_error (const struct argp_state *__restrict __state,
- const char *__restrict __fmt, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
-
-/* Similar to the standard gnu error-reporting function error(), but will
- respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
- to STATE->err_stream. This is useful for argument parsing code that is
- shared between program startup (when exiting is desired) and runtime
- option parsing (when typically an error code is returned instead). The
- difference between this function and argp_error is that the latter is for
- *parsing errors*, and the former is for other problems that occur during
- parsing but don't reflect a (syntactic) problem with the input. */
-extern void argp_failure (const struct argp_state *__restrict __state,
- int __status, int __errnum,
- const char *__restrict __fmt, ...)
- __attribute__ ((__format__ (__printf__, 4, 5)));
-extern void __argp_failure (const struct argp_state *__restrict __state,
- int __status, int __errnum,
- const char *__restrict __fmt, ...)
- __attribute__ ((__format__ (__printf__, 4, 5)));
-
-/* Returns true if the option OPT is a valid short option. */
-extern int _option_is_short (const struct argp_option *__opt) __THROW;
-extern int __option_is_short (const struct argp_option *__opt) __THROW;
-
-/* Returns true if the option OPT is in fact the last (unused) entry in an
- options array. */
-extern int _option_is_end (const struct argp_option *__opt) __THROW;
-extern int __option_is_end (const struct argp_option *__opt) __THROW;
-
-/* Return the input field for ARGP in the parser corresponding to STATE; used
- by the help routines. */
-extern void *_argp_input (const struct argp *__restrict __argp,
- const struct argp_state *__restrict __state)
- __THROW;
-extern void *__argp_input (const struct argp *__restrict __argp,
- const struct argp_state *__restrict __state)
- __THROW;
-
-#ifdef __USE_EXTERN_INLINES
-
-# if !_LIBC
-# define __argp_usage argp_usage
-# define __argp_state_help argp_state_help
-# define __option_is_short _option_is_short
-# define __option_is_end _option_is_end
-# endif
-
-# ifndef ARGP_EI
-# define ARGP_EI extern __inline__ __attribute__ ((gnu_inline))
-# endif
-
-ARGP_EI void
-__argp_usage (const struct argp_state *__state)
-{
- __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
-}
-
-ARGP_EI int
-__NTH (__option_is_short (const struct argp_option *__opt))
-{
- if (__opt->flags & OPTION_DOC)
- return 0;
- else
- {
- int __key = __opt->key;
- return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
- }
-}
-
-ARGP_EI int
-__NTH (__option_is_end (const struct argp_option *__opt))
-{
- return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
-}
-
-# if !_LIBC
-# undef __argp_usage
-# undef __argp_state_help
-# undef __option_is_short
-# undef __option_is_end
-# endif
-#endif /* Use extern inlines. */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* argp.h */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argz.c b/xbmc/screensavers/rsxs-0.9/lib/argz.c
deleted file mode 100644
index 316579a781..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argz.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/* argz.c -- argz implementation for non-glibc systems
- Copyright (C) 2004 Free Software Foundation, Inc.
- Originally by Gary V. Vaughan <gary@gnu.org>
-
- NOTE: The canonical source of this file is maintained with the
- GNU Libtool package. Report bugs to bug-libtool@gnu.org.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#if defined(HAVE_CONFIG_H)
-# if defined(LTDL) && defined LT_CONFIG_H
-# include LT_CONFIG_H
-# else
-# include <config.h>
-# endif
-#endif
-
-#include <argz.h>
-
-#include <assert.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <errno.h>
-
-#if defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#endif
-#if defined(HAVE_MEMORY_H)
-# include <memory.h>
-#endif
-
-#define EOS_CHAR '\0'
-
-error_t
-argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len)
-{
- size_t argz_len;
- char *argz;
-
- assert (pargz);
- assert (pargz_len);
- assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len));
-
- /* If nothing needs to be appended, no more work is required. */
- if (buf_len == 0)
- return 0;
-
- /* Ensure there is enough room to append BUF_LEN. */
- argz_len = *pargz_len + buf_len;
- argz = (char *) realloc (*pargz, argz_len);
- if (!argz)
- return ENOMEM;
-
- /* Copy characters from BUF after terminating '\0' in ARGZ. */
- memcpy (argz + *pargz_len, buf, buf_len);
-
- /* Assign new values. */
- *pargz = argz;
- *pargz_len = argz_len;
-
- return 0;
-}
-
-
-error_t
-argz_create_sep (const char *str, int delim, char **pargz, size_t *pargz_len)
-{
- size_t argz_len;
- char *argz = 0;
-
- assert (str);
- assert (pargz);
- assert (pargz_len);
-
- /* Make a copy of STR, but replacing each occurrence of
- DELIM with '\0'. */
- argz_len = 1+ strlen (str);
- if (argz_len)
- {
- const char *p;
- char *q;
-
- argz = (char *) malloc (argz_len);
- if (!argz)
- return ENOMEM;
-
- for (p = str, q = argz; *p != EOS_CHAR; ++p)
- {
- if (*p == delim)
- {
- /* Ignore leading delimiters, and fold consecutive
- delimiters in STR into a single '\0' in ARGZ. */
- if ((q > argz) && (q[-1] != EOS_CHAR))
- *q++ = EOS_CHAR;
- else
- --argz_len;
- }
- else
- *q++ = *p;
- }
- /* Copy terminating EOS_CHAR. */
- *q = *p;
- }
-
- /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */
- if (!argz_len)
- argz = (free (argz), (char *) 0);
-
- /* Assign new values. */
- *pargz = argz;
- *pargz_len = argz_len;
-
- return 0;
-}
-
-
-error_t
-argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry)
-{
- assert (pargz);
- assert (pargz_len);
- assert (entry && *entry);
-
- /* No BEFORE address indicates ENTRY should be inserted after the
- current last element. */
- if (!before)
- return argz_append (pargz, pargz_len, entry, 1+ strlen (entry));
-
- /* This probably indicates a programmer error, but to preserve
- semantics, scan back to the start of an entry if BEFORE points
- into the middle of it. */
- while ((before > *pargz) && (before[-1] != EOS_CHAR))
- --before;
-
- {
- size_t entry_len = 1+ strlen (entry);
- size_t argz_len = *pargz_len + entry_len;
- size_t offset = before - *pargz;
- char *argz = (char *) realloc (*pargz, argz_len);
-
- if (!argz)
- return ENOMEM;
-
- /* Make BEFORE point to the equivalent offset in ARGZ that it
- used to have in *PARGZ incase realloc() moved the block. */
- before = argz + offset;
-
- /* Move the ARGZ entries starting at BEFORE up into the new
- space at the end -- making room to copy ENTRY into the
- resulting gap. */
- memmove (before + entry_len, before, *pargz_len - offset);
- memcpy (before, entry, entry_len);
-
- /* Assign new values. */
- *pargz = argz;
- *pargz_len = argz_len;
- }
-
- return 0;
-}
-
-
-char *
-argz_next (char *argz, size_t argz_len, const char *entry)
-{
- assert ((argz && argz_len) || (!argz && !argz_len));
-
- if (entry)
- {
- /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address
- within the ARGZ vector. */
- assert ((!argz && !argz_len)
- || ((argz <= entry) && (entry < (argz + argz_len))));
-
- /* Move to the char immediately after the terminating
- '\0' of ENTRY. */
- entry = 1+ strchr (entry, EOS_CHAR);
-
- /* Return either the new ENTRY, or else NULL if ARGZ is
- exhausted. */
- return (entry >= argz + argz_len) ? 0 : (char *) entry;
- }
- else
- {
- /* This should probably be flagged as a programmer error,
- since starting an argz_next loop with the iterator set
- to ARGZ is safer. To preserve semantics, handle the NULL
- case by returning the start of ARGZ (if any). */
- if (argz_len > 0)
- return argz;
- else
- return 0;
- }
-}
-
-
-void
-argz_stringify (char *argz, size_t argz_len, int sep)
-{
- assert ((argz && argz_len) || (!argz && !argz_len));
-
- if (sep)
- {
- --argz_len; /* don't stringify the terminating EOS */
- while (--argz_len > 0)
- {
- if (argz[argz_len] == EOS_CHAR)
- argz[argz_len] = sep;
- }
- }
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/argz_.h b/xbmc/screensavers/rsxs-0.9/lib/argz_.h
deleted file mode 100644
index 39e7c4e8fe..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/argz_.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* lt__argz.h -- internal argz interface for non-glibc systems
- Copyright (C) 2004 Free Software Foundation, Inc.
- Originally by Gary V. Vaughan <gary@gnu.org>
-
- NOTE: The canonical source of this file is maintained with the
- GNU Libtool package. Report bugs to bug-libtool@gnu.org.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#if !defined(LT__ARGZ_H)
-#define LT__ARGZ_H 1
-
-#include <stdlib.h>
-#include <sys/types.h>
-
-#if defined(LTDL)
-# include "lt__glibc.h"
-# include "lt_system.h"
-#else
-# define LT_SCOPE
-#endif
-
-#if defined(_cplusplus)
-extern "C" {
-#endif
-
-LT_SCOPE error_t argz_append (char **pargz, size_t *pargz_len,
- const char *buf, size_t buf_len);
-LT_SCOPE error_t argz_create_sep(const char *str, int delim,
- char **pargz, size_t *pargz_len);
-LT_SCOPE error_t argz_insert (char **pargz, size_t *pargz_len,
- char *before, const char *entry);
-LT_SCOPE char * argz_next (char *argz, size_t argz_len,
- const char *entry);
-LT_SCOPE void argz_stringify (char *argz, size_t argz_len, int sep);
-
-#if defined(_cplusplus)
-}
-#endif
-
-#if !defined(LTDL)
-# undef LT_SCOPE
-#endif
-
-#endif /*!defined(LT__ARGZ_H)*/
diff --git a/xbmc/screensavers/rsxs-0.9/lib/asnprintf.c b/xbmc/screensavers/rsxs-0.9/lib/asnprintf.c
deleted file mode 100644
index 1b7f4ba396..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/asnprintf.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Formatted output to strings.
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification. */
-#include "vasnprintf.h"
-
-#include <stdarg.h>
-
-char *
-asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
-{
- va_list args;
- char *result;
-
- va_start (args, format);
- result = vasnprintf (resultbuf, lengthp, format, args);
- va_end (args);
- return result;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/basename.c b/xbmc/screensavers/rsxs-0.9/lib/basename.c
deleted file mode 100644
index 8c3dbece7b..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/basename.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/* basename.c -- return the last element in a file name
-
- Copyright (C) 1990, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 Free
- Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "dirname.h"
-
-#include <string.h>
-#include "xalloc.h"
-#include "xstrndup.h"
-
-/* Return the address of the last file name component of NAME. If
- NAME has no relative file name components because it is a file
- system root, return the empty string. */
-
-char *
-last_component (char const *name)
-{
- char const *base = name + FILE_SYSTEM_PREFIX_LEN (name);
- char const *p;
- bool saw_slash = false;
-
- while (ISSLASH (*base))
- base++;
-
- for (p = base; *p; p++)
- {
- if (ISSLASH (*p))
- saw_slash = true;
- else if (saw_slash)
- {
- base = p;
- saw_slash = false;
- }
- }
-
- return (char *) base;
-}
-
-
-/* In general, we can't use the builtin `basename' function if available,
- since it has different meanings in different environments.
- In some environments the builtin `basename' modifies its argument.
-
- Return the last file name component of NAME, allocated with
- xmalloc. On systems with drive letters, a leading "./"
- distinguishes relative names that would otherwise look like a drive
- letter. Unlike POSIX basename(), NAME cannot be NULL,
- base_name("") returns "", and the first trailing slash is not
- stripped.
-
- If lstat (NAME) would succeed, then { chdir (dir_name (NAME));
- lstat (base_name (NAME)); } will access the same file. Likewise,
- if the sequence { chdir (dir_name (NAME));
- rename (base_name (NAME), "foo"); } succeeds, you have renamed NAME
- to "foo" in the same directory NAME was in. */
-
-char *
-base_name (char const *name)
-{
- char const *base = last_component (name);
- size_t length;
-
- /* If there is no last component, then name is a file system root or the
- empty string. */
- if (! *base)
- return xstrndup (name, base_len (name));
-
- /* Collapse a sequence of trailing slashes into one. */
- length = base_len (base);
- if (ISSLASH (base[length]))
- length++;
-
- /* On systems with drive letters, `a/b:c' must return `./b:c' rather
- than `b:c' to avoid confusion with a drive letter. On systems
- with pure POSIX semantics, this is not an issue. */
- if (FILE_SYSTEM_PREFIX_LEN (base))
- {
- char *p = xmalloc (length + 3);
- p[0] = '.';
- p[1] = '/';
- memcpy (p + 2, base, length);
- p[length + 2] = '\0';
- return p;
- }
-
- /* Finally, copy the basename. */
- return xstrndup (base, length);
-}
-
-/* Return the length of the basename NAME. Typically NAME is the
- value returned by base_name or last_component. Act like strlen
- (NAME), except omit all trailing slashes. */
-
-size_t
-base_len (char const *name)
-{
- size_t len;
- size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
-
- for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--)
- continue;
-
- if (DOUBLE_SLASH_IS_DISTINCT_ROOT && len == 1
- && ISSLASH (name[0]) && ISSLASH (name[1]) && ! name[2])
- return 2;
-
- if (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && prefix_len
- && len == prefix_len && ISSLASH (name[prefix_len]))
- return prefix_len + 1;
-
- return len;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/dirname.c b/xbmc/screensavers/rsxs-0.9/lib/dirname.c
deleted file mode 100644
index e3c762c7df..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/dirname.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* dirname.c -- return all but the last element in a file name
-
- Copyright (C) 1990, 1998, 2000, 2001, 2003, 2004, 2005, 2006 Free Software
- Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "dirname.h"
-
-#include <string.h>
-#include "xalloc.h"
-
-/* Return the length of the prefix of FILE that will be used by
- dir_name. If FILE is in the working directory, this returns zero
- even though `dir_name (FILE)' will return ".". Works properly even
- if there are trailing slashes (by effectively ignoring them). */
-
-size_t
-dir_len (char const *file)
-{
- size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file);
- size_t length;
-
- /* Advance prefix_length beyond important leading slashes. */
- prefix_length += (prefix_length != 0
- ? (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
- && ISSLASH (file[prefix_length]))
- : (ISSLASH (file[0])
- ? ((DOUBLE_SLASH_IS_DISTINCT_ROOT
- && ISSLASH (file[1]) && ! ISSLASH (file[2])
- ? 2 : 1))
- : 0));
-
- /* Strip the basename and any redundant slashes before it. */
- for (length = last_component (file) - file;
- prefix_length < length; length--)
- if (! ISSLASH (file[length - 1]))
- break;
- return length;
-}
-
-
-/* In general, we can't use the builtin `dirname' function if available,
- since it has different meanings in different environments.
- In some environments the builtin `dirname' modifies its argument.
-
- Return the leading directories part of FILE, allocated with xmalloc.
- Works properly even if there are trailing slashes (by effectively
- ignoring them). Unlike POSIX dirname(), FILE cannot be NULL.
-
- If lstat (FILE) would succeed, then { chdir (dir_name (FILE));
- lstat (base_name (FILE)); } will access the same file. Likewise,
- if the sequence { chdir (dir_name (FILE));
- rename (base_name (FILE), "foo"); } succeeds, you have renamed FILE
- to "foo" in the same directory FILE was in. */
-
-char *
-dir_name (char const *file)
-{
- size_t length = dir_len (file);
- bool append_dot = (length == 0
- || (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
- && length == FILE_SYSTEM_PREFIX_LEN (file)
- && file[2] != '\0' && ! ISSLASH (file[2])));
- char *dir = xmalloc (length + append_dot + 1);
- memcpy (dir, file, length);
- if (append_dot)
- dir[length++] = '.';
- dir[length] = '\0';
- return dir;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/dirname.h b/xbmc/screensavers/rsxs-0.9/lib/dirname.h
deleted file mode 100644
index f9189c356e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/dirname.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Take file names apart into directory and base names.
-
- Copyright (C) 1998, 2001, 2003-2006 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef DIRNAME_H_
-# define DIRNAME_H_ 1
-
-# include <stdbool.h>
-# include <stddef.h>
-
-# ifndef DIRECTORY_SEPARATOR
-# define DIRECTORY_SEPARATOR '/'
-# endif
-
-# ifndef ISSLASH
-# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
-# endif
-
-# ifndef FILE_SYSTEM_PREFIX_LEN
-# if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
- /* This internal macro assumes ASCII, but all hosts that support drive
- letters use ASCII. */
-# define _IS_DRIVE_LETTER(c) (((unsigned int) (c) | ('a' - 'A')) - 'a' \
- <= 'z' - 'a')
-# define FILE_SYSTEM_PREFIX_LEN(Filename) \
- (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
-# else
-# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
-# endif
-# endif
-
-# ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
-# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
-# endif
-
-# ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
-# define DOUBLE_SLASH_IS_DISTINCT_ROOT 1
-# endif
-
-# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
-# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
-# else
-# define IS_ABSOLUTE_FILE_NAME(F) \
- (ISSLASH ((F)[0]) || 0 < FILE_SYSTEM_PREFIX_LEN (F))
-# endif
-# define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
-
-char *base_name (char const *file);
-char *dir_name (char const *file);
-size_t base_len (char const *file);
-size_t dir_len (char const *file);
-char *last_component (char const *file);
-
-bool strip_trailing_slashes (char *file);
-
-#endif /* not DIRNAME_H_ */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/error.c b/xbmc/screensavers/rsxs-0.9/lib/error.c
deleted file mode 100644
index 45698be8da..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/error.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/* Error handler for noninteractive utilities
- Copyright (C) 1990-1998, 2000-2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "error.h"
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#if !_LIBC && ENABLE_NLS
-# include "gettext.h"
-#endif
-
-#ifdef _LIBC
-# include <wchar.h>
-# define mbsrtowcs __mbsrtowcs
-#endif
-
-#if USE_UNLOCKED_IO
-# include "unlocked-io.h"
-#endif
-
-#ifndef _
-# define _(String) String
-#endif
-
-/* If NULL, error will flush stdout, then print on stderr the program
- name, a colon and a space. Otherwise, error will call this
- function without parameters instead. */
-void (*error_print_progname) (void);
-
-/* This variable is incremented each time `error' is called. */
-unsigned int error_message_count;
-
-#ifdef _LIBC
-/* In the GNU C library, there is a predefined variable for this. */
-
-# define program_name program_invocation_name
-# include <errno.h>
-# include <libio/libioP.h>
-
-/* In GNU libc we want do not want to use the common name `error' directly.
- Instead make it a weak alias. */
-extern void __error (int status, int errnum, const char *message, ...)
- __attribute__ ((__format__ (__printf__, 3, 4)));
-extern void __error_at_line (int status, int errnum, const char *file_name,
- unsigned int line_number, const char *message,
- ...)
- __attribute__ ((__format__ (__printf__, 5, 6)));;
-# define error __error
-# define error_at_line __error_at_line
-
-# include <libio/iolibio.h>
-# define fflush(s) INTUSE(_IO_fflush) (s)
-# undef putc
-# define putc(c, fp) INTUSE(_IO_putc) (c, fp)
-
-# include <bits/libc-lock.h>
-
-#else /* not _LIBC */
-
-# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
-# ifndef HAVE_DECL_STRERROR_R
-"this configure-time declaration test was not run"
-# endif
-char *strerror_r ();
-# endif
-
-# ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
-# endif
-
-/* The calling program should define program_name and set it to the
- name of the executing program. */
-extern char *program_name;
-
-# if HAVE_STRERROR_R || defined strerror_r
-# define __strerror_r strerror_r
-# endif
-#endif /* not _LIBC */
-
-static void
-print_errno_message (int errnum)
-{
- char const *s = NULL;
-
-#if defined HAVE_STRERROR_R || _LIBC
- char errbuf[1024];
-# if STRERROR_R_CHAR_P || _LIBC
- s = __strerror_r (errnum, errbuf, sizeof errbuf);
-# else
- if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
- s = errbuf;
-# endif
-#endif
-
-#if !_LIBC
- if (! s && ! (s = strerror (errnum)))
- s = _("Unknown system error");
-#endif
-
-#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
- {
- __fwprintf (stderr, L": %s", s);
- return;
- }
-#endif
-
- fprintf (stderr, ": %s", s);
-}
-
-static void
-error_tail (int status, int errnum, const char *message, va_list args)
-{
-#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
- {
-# define ALLOCA_LIMIT 2000
- size_t len = strlen (message) + 1;
- const wchar_t *wmessage = L"out of memory";
- wchar_t *wbuf = (len < ALLOCA_LIMIT
- ? alloca (len * sizeof *wbuf)
- : len <= SIZE_MAX / sizeof *wbuf
- ? malloc (len * sizeof *wbuf)
- : NULL);
-
- if (wbuf)
- {
- size_t res;
- mbstate_t st;
- const char *tmp = message;
- memset (&st, '\0', sizeof (st));
- res = mbsrtowcs (wbuf, &tmp, len, &st);
- wmessage = res == (size_t) -1 ? L"???" : wbuf;
- }
-
- __vfwprintf (stderr, wmessage, args);
- if (! (len < ALLOCA_LIMIT))
- free (wbuf);
- }
- else
-#endif
- vfprintf (stderr, message, args);
- va_end (args);
-
- ++error_message_count;
- if (errnum)
- print_errno_message (errnum);
-#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
- putwc (L'\n', stderr);
- else
-#endif
- putc ('\n', stderr);
- fflush (stderr);
- if (status)
- exit (status);
-}
-
-
-/* Print the program name and error message MESSAGE, which is a printf-style
- format string with optional args.
- If ERRNUM is nonzero, print its corresponding system error message.
- Exit with status STATUS if it is nonzero. */
-void
-error (int status, int errnum, const char *message, ...)
-{
- va_list args;
-
-#if defined _LIBC && defined __libc_ptf_call
- /* We do not want this call to be cut short by a thread
- cancellation. Therefore disable cancellation for now. */
- int state = PTHREAD_CANCEL_ENABLE;
- __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
- 0);
-#endif
-
- fflush (stdout);
-#ifdef _LIBC
- _IO_flockfile (stderr);
-#endif
- if (error_print_progname)
- (*error_print_progname) ();
- else
- {
-#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s: ", program_name);
- else
-#endif
- fprintf (stderr, "%s: ", program_name);
- }
-
- va_start (args, message);
- error_tail (status, errnum, message, args);
-
-#ifdef _LIBC
- _IO_funlockfile (stderr);
-# ifdef __libc_ptf_call
- __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
-# endif
-#endif
-}
-
-/* Sometimes we want to have at most one error per line. This
- variable controls whether this mode is selected or not. */
-int error_one_per_line;
-
-void
-error_at_line (int status, int errnum, const char *file_name,
- unsigned int line_number, const char *message, ...)
-{
- va_list args;
-
- if (error_one_per_line)
- {
- static const char *old_file_name;
- static unsigned int old_line_number;
-
- if (old_line_number == line_number
- && (file_name == old_file_name
- || strcmp (old_file_name, file_name) == 0))
- /* Simply return and print nothing. */
- return;
-
- old_file_name = file_name;
- old_line_number = line_number;
- }
-
-#if defined _LIBC && defined __libc_ptf_call
- /* We do not want this call to be cut short by a thread
- cancellation. Therefore disable cancellation for now. */
- int state = PTHREAD_CANCEL_ENABLE;
- __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
- 0);
-#endif
-
- fflush (stdout);
-#ifdef _LIBC
- _IO_flockfile (stderr);
-#endif
- if (error_print_progname)
- (*error_print_progname) ();
- else
- {
-#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s: ", program_name);
- else
-#endif
- fprintf (stderr, "%s:", program_name);
- }
-
- if (file_name != NULL)
- {
-#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s:%d: ", file_name, line_number);
- else
-#endif
- fprintf (stderr, "%s:%d: ", file_name, line_number);
- }
-
- va_start (args, message);
- error_tail (status, errnum, message, args);
-
-#ifdef _LIBC
- _IO_funlockfile (stderr);
-# ifdef __libc_ptf_call
- __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
-# endif
-#endif
-}
-
-#ifdef _LIBC
-/* Make the weak alias. */
-# undef error
-# undef error_at_line
-weak_alias (__error, error)
-weak_alias (__error_at_line, error_at_line)
-#endif
diff --git a/xbmc/screensavers/rsxs-0.9/lib/error.h b/xbmc/screensavers/rsxs-0.9/lib/error.h
deleted file mode 100644
index e5220a2f13..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/error.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Declaration for error-reporting function
- Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _ERROR_H
-#define _ERROR_H 1
-
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
-# define __attribute__(Spec) /* empty */
-# endif
-/* The __-protected variants of `format' and `printf' attributes
- are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-# define __format__ format
-# define __printf__ printf
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Print a message with `fprintf (stderr, FORMAT, ...)';
- if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
- If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
-
-extern void error (int __status, int __errnum, const char *__format, ...)
- __attribute__ ((__format__ (__printf__, 3, 4)));
-
-extern void error_at_line (int __status, int __errnum, const char *__fname,
- unsigned int __lineno, const char *__format, ...)
- __attribute__ ((__format__ (__printf__, 5, 6)));
-
-/* If NULL, error will flush stdout, then print on stderr the program
- name, a colon and a space. Otherwise, error will call this
- function without parameters instead. */
-extern void (*error_print_progname) (void);
-
-/* This variable is incremented each time `error' is called. */
-extern unsigned int error_message_count;
-
-/* Sometimes we want to have at most one error per line. This
- variable controls whether this mode is selected or not. */
-extern int error_one_per_line;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* error.h */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/exit.h b/xbmc/screensavers/rsxs-0.9/lib/exit.h
deleted file mode 100644
index e8f7738838..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/exit.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* exit() function.
- Copyright (C) 1995, 2001 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _EXIT_H
-#define _EXIT_H
-
-/* Get exit() declaration. */
-#include <stdlib.h>
-
-/* Some systems do not define EXIT_*, despite otherwise supporting C89. */
-#ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-#endif
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
-#endif /* _EXIT_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/exitfail.c b/xbmc/screensavers/rsxs-0.9/lib/exitfail.c
deleted file mode 100644
index 27d38c32a4..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/exitfail.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Failure exit status
-
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; see the file COPYING.
- If not, write to the Free Software Foundation,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "exitfail.h"
-#include "exit.h"
-
-int volatile exit_failure = EXIT_FAILURE;
diff --git a/xbmc/screensavers/rsxs-0.9/lib/exitfail.h b/xbmc/screensavers/rsxs-0.9/lib/exitfail.h
deleted file mode 100644
index e46cf9c166..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/exitfail.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Failure exit status
-
- Copyright (C) 2002 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; see the file COPYING.
- If not, write to the Free Software Foundation,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-extern int volatile exit_failure;
diff --git a/xbmc/screensavers/rsxs-0.9/lib/getopt.c b/xbmc/screensavers/rsxs-0.9/lib/getopt.c
deleted file mode 100644
index f37a837bcf..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/getopt.c
+++ /dev/null
@@ -1,1191 +0,0 @@
-/* Getopt for GNU.
- NOTE: getopt is now part of the C library, so if you don't know what
- "Keep this file name-space clean" means, talk to drepper@gnu.org
- before changing it!
- Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006
- Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "getopt.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#ifdef __VMS
-# include <unixlib.h>
-#endif
-
-#ifdef _LIBC
-# include <libintl.h>
-#else
-# include "gettext.h"
-# define _(msgid) gettext (msgid)
-#endif
-
-#if defined _LIBC && defined USE_IN_LIBIO
-# include <wchar.h>
-#endif
-
-#ifndef attribute_hidden
-# define attribute_hidden
-#endif
-
-/* Unlike standard Unix `getopt', functions like `getopt_long'
- let the user intersperse the options with the other arguments.
-
- As `getopt_long' works, it permutes the elements of ARGV so that,
- when it is done, all the options precede everything else. Thus
- all application programs are extended to handle flexible argument order.
-
- Using `getopt' or setting the environment variable POSIXLY_CORRECT
- disables permutation.
- Then the application's behavior is completely standard.
-
- GNU application programs can use a third alternative mode in which
- they can distinguish the relative order of options and other arguments. */
-
-#include "getopt_int.h"
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-/* 1003.2 says this must be 1 before any call. */
-int optind = 1;
-
-/* Callers store zero here to inhibit the error message
- for unrecognized options. */
-
-int opterr = 1;
-
-/* Set to an option character which was unrecognized.
- This must be initialized on some systems to avoid linking in the
- system's own getopt implementation. */
-
-int optopt = '?';
-
-/* Keep a global copy of all internal members of getopt_data. */
-
-static struct _getopt_data getopt_data;
-
-
-#if defined HAVE_DECL_GETENV && !HAVE_DECL_GETENV
-extern char *getenv ();
-#endif
-
-#ifdef _LIBC
-/* Stored original parameters.
- XXX This is no good solution. We should rather copy the args so
- that we can compare them later. But we must not use malloc(3). */
-extern int __libc_argc;
-extern char **__libc_argv;
-
-/* Bash 2.0 gives us an environment variable containing flags
- indicating ARGV elements that should not be considered arguments. */
-
-# ifdef USE_NONOPTION_FLAGS
-/* Defined in getopt_init.c */
-extern char *__getopt_nonoption_flags;
-# endif
-
-# ifdef USE_NONOPTION_FLAGS
-# define SWAP_FLAGS(ch1, ch2) \
- if (d->__nonoption_flags_len > 0) \
- { \
- char __tmp = __getopt_nonoption_flags[ch1]; \
- __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
- __getopt_nonoption_flags[ch2] = __tmp; \
- }
-# else
-# define SWAP_FLAGS(ch1, ch2)
-# endif
-#else /* !_LIBC */
-# define SWAP_FLAGS(ch1, ch2)
-#endif /* _LIBC */
-
-/* Exchange two adjacent subsequences of ARGV.
- One subsequence is elements [first_nonopt,last_nonopt)
- which contains all the non-options that have been skipped so far.
- The other is elements [last_nonopt,optind), which contains all
- the options processed since those non-options were skipped.
-
- `first_nonopt' and `last_nonopt' are relocated so that they describe
- the new indices of the non-options in ARGV after they are moved. */
-
-static void
-exchange (char **argv, struct _getopt_data *d)
-{
- int bottom = d->__first_nonopt;
- int middle = d->__last_nonopt;
- int top = d->optind;
- char *tem;
-
- /* Exchange the shorter segment with the far end of the longer segment.
- That puts the shorter segment into the right place.
- It leaves the longer segment in the right place overall,
- but it consists of two parts that need to be swapped next. */
-
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
- /* First make sure the handling of the `__getopt_nonoption_flags'
- string can work normally. Our top argument must be in the range
- of the string. */
- if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len)
- {
- /* We must extend the array. The user plays games with us and
- presents new arguments. */
- char *new_str = malloc (top + 1);
- if (new_str == NULL)
- d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0;
- else
- {
- memset (__mempcpy (new_str, __getopt_nonoption_flags,
- d->__nonoption_flags_max_len),
- '\0', top + 1 - d->__nonoption_flags_max_len);
- d->__nonoption_flags_max_len = top + 1;
- __getopt_nonoption_flags = new_str;
- }
- }
-#endif
-
- while (top > middle && middle > bottom)
- {
- if (top - middle > middle - bottom)
- {
- /* Bottom segment is the short one. */
- int len = middle - bottom;
- register int i;
-
- /* Swap it with the top part of the top segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[top - (middle - bottom) + i];
- argv[top - (middle - bottom) + i] = tem;
- SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
- }
- /* Exclude the moved bottom segment from further swapping. */
- top -= len;
- }
- else
- {
- /* Top segment is the short one. */
- int len = top - middle;
- register int i;
-
- /* Swap it with the bottom part of the bottom segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[middle + i];
- argv[middle + i] = tem;
- SWAP_FLAGS (bottom + i, middle + i);
- }
- /* Exclude the moved top segment from further swapping. */
- bottom += len;
- }
- }
-
- /* Update records for the slots the non-options now occupy. */
-
- d->__first_nonopt += (d->optind - d->__last_nonopt);
- d->__last_nonopt = d->optind;
-}
-
-/* Initialize the internal data when the first call is made. */
-
-static const char *
-_getopt_initialize (int argc, char **argv, const char *optstring,
- int posixly_correct, struct _getopt_data *d)
-{
- /* Start processing options with ARGV-element 1 (since ARGV-element 0
- is the program name); the sequence of previously skipped
- non-option ARGV-elements is empty. */
-
- d->__first_nonopt = d->__last_nonopt = d->optind;
-
- d->__nextchar = NULL;
-
- d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT");
-
- /* Determine how to handle the ordering of options and nonoptions. */
-
- if (optstring[0] == '-')
- {
- d->__ordering = RETURN_IN_ORDER;
- ++optstring;
- }
- else if (optstring[0] == '+')
- {
- d->__ordering = REQUIRE_ORDER;
- ++optstring;
- }
- else if (d->__posixly_correct)
- d->__ordering = REQUIRE_ORDER;
- else
- d->__ordering = PERMUTE;
-
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
- if (!d->__posixly_correct
- && argc == __libc_argc && argv == __libc_argv)
- {
- if (d->__nonoption_flags_max_len == 0)
- {
- if (__getopt_nonoption_flags == NULL
- || __getopt_nonoption_flags[0] == '\0')
- d->__nonoption_flags_max_len = -1;
- else
- {
- const char *orig_str = __getopt_nonoption_flags;
- int len = d->__nonoption_flags_max_len = strlen (orig_str);
- if (d->__nonoption_flags_max_len < argc)
- d->__nonoption_flags_max_len = argc;
- __getopt_nonoption_flags =
- (char *) malloc (d->__nonoption_flags_max_len);
- if (__getopt_nonoption_flags == NULL)
- d->__nonoption_flags_max_len = -1;
- else
- memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
- '\0', d->__nonoption_flags_max_len - len);
- }
- }
- d->__nonoption_flags_len = d->__nonoption_flags_max_len;
- }
- else
- d->__nonoption_flags_len = 0;
-#endif
-
- return optstring;
-}
-
-/* Scan elements of ARGV (whose length is ARGC) for option characters
- given in OPTSTRING.
-
- If an element of ARGV starts with '-', and is not exactly "-" or "--",
- then it is an option element. The characters of this element
- (aside from the initial '-') are option characters. If `getopt'
- is called repeatedly, it returns successively each of the option characters
- from each of the option elements.
-
- If `getopt' finds another option character, it returns that character,
- updating `optind' and `nextchar' so that the next call to `getopt' can
- resume the scan with the following option character or ARGV-element.
-
- If there are no more option characters, `getopt' returns -1.
- Then `optind' is the index in ARGV of the first ARGV-element
- that is not an option. (The ARGV-elements have been permuted
- so that those that are not options now come last.)
-
- OPTSTRING is a string containing the legitimate option characters.
- If an option character is seen that is not listed in OPTSTRING,
- return '?' after printing an error message. If you set `opterr' to
- zero, the error message is suppressed but we still return '?'.
-
- If a char in OPTSTRING is followed by a colon, that means it wants an arg,
- so the following text in the same ARGV-element, or the text of the following
- ARGV-element, is returned in `optarg'. Two colons mean an option that
- wants an optional arg; if there is text in the current ARGV-element,
- it is returned in `optarg', otherwise `optarg' is set to zero.
-
- If OPTSTRING starts with `-' or `+', it requests different methods of
- handling the non-option ARGV-elements.
- See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
-
- Long-named options begin with `--' instead of `-'.
- Their names may be abbreviated as long as the abbreviation is unique
- or is an exact match for some defined option. If they have an
- argument, it follows the option name in the same ARGV-element, separated
- from the option name by a `=', or else the in next ARGV-element.
- When `getopt' finds a long-named option, it returns 0 if that option's
- `flag' field is nonzero, the value of the option's `val' field
- if the `flag' field is zero.
-
- LONGOPTS is a vector of `struct option' terminated by an
- element containing a name which is zero.
-
- LONGIND returns the index in LONGOPT of the long-named option found.
- It is only valid when a long-named option has been found by the most
- recent call.
-
- If LONG_ONLY is nonzero, '-' as well as '--' can introduce
- long-named options.
-
- If POSIXLY_CORRECT is nonzero, behave as if the POSIXLY_CORRECT
- environment variable were set. */
-
-int
-_getopt_internal_r (int argc, char **argv, const char *optstring,
- const struct option *longopts, int *longind,
- int long_only, int posixly_correct, struct _getopt_data *d)
-{
- int print_errors = d->opterr;
- if (optstring[0] == ':')
- print_errors = 0;
-
- if (argc < 1)
- return -1;
-
- d->optarg = NULL;
-
- if (d->optind == 0 || !d->__initialized)
- {
- if (d->optind == 0)
- d->optind = 1; /* Don't scan ARGV[0], the program name. */
- optstring = _getopt_initialize (argc, argv, optstring,
- posixly_correct, d);
- d->__initialized = 1;
- }
-
- /* Test whether ARGV[optind] points to a non-option argument.
- Either it does not have option syntax, or there is an environment flag
- from the shell indicating it is not an option. The later information
- is only used when the used in the GNU libc. */
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
-# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \
- || (d->optind < d->__nonoption_flags_len \
- && __getopt_nonoption_flags[d->optind] == '1'))
-#else
-# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')
-#endif
-
- if (d->__nextchar == NULL || *d->__nextchar == '\0')
- {
- /* Advance to the next ARGV-element. */
-
- /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
- moved back by the user (who may also have changed the arguments). */
- if (d->__last_nonopt > d->optind)
- d->__last_nonopt = d->optind;
- if (d->__first_nonopt > d->optind)
- d->__first_nonopt = d->optind;
-
- if (d->__ordering == PERMUTE)
- {
- /* If we have just processed some options following some non-options,
- exchange them so that the options come first. */
-
- if (d->__first_nonopt != d->__last_nonopt
- && d->__last_nonopt != d->optind)
- exchange ((char **) argv, d);
- else if (d->__last_nonopt != d->optind)
- d->__first_nonopt = d->optind;
-
- /* Skip any additional non-options
- and extend the range of non-options previously skipped. */
-
- while (d->optind < argc && NONOPTION_P)
- d->optind++;
- d->__last_nonopt = d->optind;
- }
-
- /* The special ARGV-element `--' means premature end of options.
- Skip it like a null option,
- then exchange with previous non-options as if it were an option,
- then skip everything else like a non-option. */
-
- if (d->optind != argc && !strcmp (argv[d->optind], "--"))
- {
- d->optind++;
-
- if (d->__first_nonopt != d->__last_nonopt
- && d->__last_nonopt != d->optind)
- exchange ((char **) argv, d);
- else if (d->__first_nonopt == d->__last_nonopt)
- d->__first_nonopt = d->optind;
- d->__last_nonopt = argc;
-
- d->optind = argc;
- }
-
- /* If we have done all the ARGV-elements, stop the scan
- and back over any non-options that we skipped and permuted. */
-
- if (d->optind == argc)
- {
- /* Set the next-arg-index to point at the non-options
- that we previously skipped, so the caller will digest them. */
- if (d->__first_nonopt != d->__last_nonopt)
- d->optind = d->__first_nonopt;
- return -1;
- }
-
- /* If we have come to a non-option and did not permute it,
- either stop the scan or describe it to the caller and pass it by. */
-
- if (NONOPTION_P)
- {
- if (d->__ordering == REQUIRE_ORDER)
- return -1;
- d->optarg = argv[d->optind++];
- return 1;
- }
-
- /* We have found another option-ARGV-element.
- Skip the initial punctuation. */
-
- d->__nextchar = (argv[d->optind] + 1
- + (longopts != NULL && argv[d->optind][1] == '-'));
- }
-
- /* Decode the current option-ARGV-element. */
-
- /* Check whether the ARGV-element is a long option.
-
- If long_only and the ARGV-element has the form "-f", where f is
- a valid short option, don't consider it an abbreviated form of
- a long option that starts with f. Otherwise there would be no
- way to give the -f short option.
-
- On the other hand, if there's a long option "fubar" and
- the ARGV-element is "-fu", do consider that an abbreviation of
- the long option, just like "--fu", and not "-f" with arg "u".
-
- This distinction seems to be the most useful approach. */
-
- if (longopts != NULL
- && (argv[d->optind][1] == '-'
- || (long_only && (argv[d->optind][2]
- || !strchr (optstring, argv[d->optind][1])))))
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = -1;
- int option_index;
-
- for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
- {
- if ((unsigned int) (nameend - d->__nextchar)
- == (unsigned int) strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else if (long_only
- || pfound->has_arg != p->has_arg
- || pfound->flag != p->flag
- || pfound->val != p->val)
- /* Second or later nonexact match found. */
- ambig = 1;
- }
-
- if (ambig && !exact)
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
-
- if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"),
- argv[0], argv[d->optind]) >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#else
- fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
- argv[0], argv[d->optind]);
-#endif
- }
- d->__nextchar += strlen (d->__nextchar);
- d->optind++;
- d->optopt = 0;
- return '?';
- }
-
- if (pfound != NULL)
- {
- option_index = indfound;
- d->optind++;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- d->optarg = nameend + 1;
- else
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
- int n;
-#endif
-
- if (argv[d->optind - 1][1] == '-')
- {
- /* --option */
-#if defined _LIBC && defined USE_IN_LIBIO
- n = __asprintf (&buf, _("\
-%s: option `--%s' doesn't allow an argument\n"),
- argv[0], pfound->name);
-#else
- fprintf (stderr, _("\
-%s: option `--%s' doesn't allow an argument\n"),
- argv[0], pfound->name);
-#endif
- }
- else
- {
- /* +option or -option */
-#if defined _LIBC && defined USE_IN_LIBIO
- n = __asprintf (&buf, _("\
-%s: option `%c%s' doesn't allow an argument\n"),
- argv[0], argv[d->optind - 1][0],
- pfound->name);
-#else
- fprintf (stderr, _("\
-%s: option `%c%s' doesn't allow an argument\n"),
- argv[0], argv[d->optind - 1][0],
- pfound->name);
-#endif
- }
-
-#if defined _LIBC && defined USE_IN_LIBIO
- if (n >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2
- |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#endif
- }
-
- d->__nextchar += strlen (d->__nextchar);
-
- d->optopt = pfound->val;
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (d->optind < argc)
- d->optarg = argv[d->optind++];
- else
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
-
- if (__asprintf (&buf, _("\
-%s: option `%s' requires an argument\n"),
- argv[0], argv[d->optind - 1]) >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2
- |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#else
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[d->optind - 1]);
-#endif
- }
- d->__nextchar += strlen (d->__nextchar);
- d->optopt = pfound->val;
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- d->__nextchar += strlen (d->__nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
-
- /* Can't find it as a long option. If this is not getopt_long_only,
- or the option starts with '--' or is not a valid short
- option, then it's an error.
- Otherwise interpret it as a short option. */
- if (!long_only || argv[d->optind][1] == '-'
- || strchr (optstring, *d->__nextchar) == NULL)
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
- int n;
-#endif
-
- if (argv[d->optind][1] == '-')
- {
- /* --option */
-#if defined _LIBC && defined USE_IN_LIBIO
- n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"),
- argv[0], d->__nextchar);
-#else
- fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
- argv[0], d->__nextchar);
-#endif
- }
- else
- {
- /* +option or -option */
-#if defined _LIBC && defined USE_IN_LIBIO
- n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"),
- argv[0], argv[d->optind][0], d->__nextchar);
-#else
- fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
- argv[0], argv[d->optind][0], d->__nextchar);
-#endif
- }
-
-#if defined _LIBC && defined USE_IN_LIBIO
- if (n >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#endif
- }
- d->__nextchar = (char *) "";
- d->optind++;
- d->optopt = 0;
- return '?';
- }
- }
-
- /* Look at and handle the next short option-character. */
-
- {
- char c = *d->__nextchar++;
- char *temp = strchr (optstring, c);
-
- /* Increment `optind' when we start to process its last character. */
- if (*d->__nextchar == '\0')
- ++d->optind;
-
- if (temp == NULL || c == ':')
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
- int n;
-#endif
-
- if (d->__posixly_correct)
- {
- /* 1003.2 specifies the format of this message. */
-#if defined _LIBC && defined USE_IN_LIBIO
- n = __asprintf (&buf, _("%s: illegal option -- %c\n"),
- argv[0], c);
-#else
- fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c);
-#endif
- }
- else
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- n = __asprintf (&buf, _("%s: invalid option -- %c\n"),
- argv[0], c);
-#else
- fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c);
-#endif
- }
-
-#if defined _LIBC && defined USE_IN_LIBIO
- if (n >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#endif
- }
- d->optopt = c;
- return '?';
- }
- /* Convenience. Treat POSIX -W foo same as long option --foo */
- if (temp[0] == 'W' && temp[1] == ';')
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = 0;
- int option_index;
-
- /* This is an option that requires an argument. */
- if (*d->__nextchar != '\0')
- {
- d->optarg = d->__nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- d->optind++;
- }
- else if (d->optind == argc)
- {
- if (print_errors)
- {
- /* 1003.2 specifies the format of this message. */
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
-
- if (__asprintf (&buf,
- _("%s: option requires an argument -- %c\n"),
- argv[0], c) >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#else
- fprintf (stderr, _("%s: option requires an argument -- %c\n"),
- argv[0], c);
-#endif
- }
- d->optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- return c;
- }
- else
- /* We already incremented `d->optind' once;
- increment it again when taking next ARGV-elt as argument. */
- d->optarg = argv[d->optind++];
-
- /* optarg is now the argument, see if it's in the
- table of longopts. */
-
- for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '=';
- nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
- {
- if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else
- /* Second or later nonexact match found. */
- ambig = 1;
- }
- if (ambig && !exact)
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
-
- if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"),
- argv[0], argv[d->optind]) >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#else
- fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
- argv[0], argv[d->optind]);
-#endif
- }
- d->__nextchar += strlen (d->__nextchar);
- d->optind++;
- return '?';
- }
- if (pfound != NULL)
- {
- option_index = indfound;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- d->optarg = nameend + 1;
- else
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
-
- if (__asprintf (&buf, _("\
-%s: option `-W %s' doesn't allow an argument\n"),
- argv[0], pfound->name) >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2
- |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#else
- fprintf (stderr, _("\
-%s: option `-W %s' doesn't allow an argument\n"),
- argv[0], pfound->name);
-#endif
- }
-
- d->__nextchar += strlen (d->__nextchar);
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (d->optind < argc)
- d->optarg = argv[d->optind++];
- else
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
-
- if (__asprintf (&buf, _("\
-%s: option `%s' requires an argument\n"),
- argv[0], argv[d->optind - 1]) >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2
- |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#else
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[d->optind - 1]);
-#endif
- }
- d->__nextchar += strlen (d->__nextchar);
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- d->__nextchar += strlen (d->__nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
- d->__nextchar = NULL;
- return 'W'; /* Let the application handle it. */
- }
- if (temp[1] == ':')
- {
- if (temp[2] == ':')
- {
- /* This is an option that accepts an argument optionally. */
- if (*d->__nextchar != '\0')
- {
- d->optarg = d->__nextchar;
- d->optind++;
- }
- else
- d->optarg = NULL;
- d->__nextchar = NULL;
- }
- else
- {
- /* This is an option that requires an argument. */
- if (*d->__nextchar != '\0')
- {
- d->optarg = d->__nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- d->optind++;
- }
- else if (d->optind == argc)
- {
- if (print_errors)
- {
- /* 1003.2 specifies the format of this message. */
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
-
- if (__asprintf (&buf, _("\
-%s: option requires an argument -- %c\n"),
- argv[0], c) >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#else
- fprintf (stderr,
- _("%s: option requires an argument -- %c\n"),
- argv[0], c);
-#endif
- }
- d->optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- d->optarg = argv[d->optind++];
- d->__nextchar = NULL;
- }
- }
- return c;
- }
-}
-
-int
-_getopt_internal (int argc, char **argv, const char *optstring,
- const struct option *longopts, int *longind,
- int long_only, int posixly_correct)
-{
- int result;
-
- getopt_data.optind = optind;
- getopt_data.opterr = opterr;
-
- result = _getopt_internal_r (argc, argv, optstring, longopts, longind,
- long_only, posixly_correct, &getopt_data);
-
- optind = getopt_data.optind;
- optarg = getopt_data.optarg;
- optopt = getopt_data.optopt;
-
- return result;
-}
-
-/* glibc gets a LSB-compliant getopt.
- Standalone applications get a POSIX-compliant getopt. */
-#if _LIBC
-enum { POSIXLY_CORRECT = 0 };
-#else
-enum { POSIXLY_CORRECT = 1 };
-#endif
-
-int
-getopt (int argc, char *const *argv, const char *optstring)
-{
- return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0,
- POSIXLY_CORRECT);
-}
-
-
-#ifdef TEST
-
-/* Compile with -DTEST to make an executable for use in testing
- the above definition of `getopt'. */
-
-int
-main (int argc, char **argv)
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
-
- c = getopt (argc, argv, "abc:d:0123456789");
- if (c == -1)
- break;
-
- switch (c)
- {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/getopt1.c b/xbmc/screensavers/rsxs-0.9/lib/getopt1.c
deleted file mode 100644
index 25d792650f..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/getopt1.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004
- Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifdef _LIBC
-# include <getopt.h>
-#else
-# include "getopt.h"
-#endif
-#include "getopt_int.h"
-
-#include <stdio.h>
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-#include <stdlib.h>
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-int
-getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
- const struct option *long_options, int *opt_index)
-{
- return _getopt_internal (argc, (char **) argv, options, long_options,
- opt_index, 0, 0);
-}
-
-int
-_getopt_long_r (int argc, char **argv, const char *options,
- const struct option *long_options, int *opt_index,
- struct _getopt_data *d)
-{
- return _getopt_internal_r (argc, argv, options, long_options, opt_index,
- 0, 0, d);
-}
-
-/* Like getopt_long, but '-' as well as '--' can indicate a long option.
- If an option that starts with '-' (not '--') doesn't match a long option,
- but does match a short option, it is parsed as a short option
- instead. */
-
-int
-getopt_long_only (int argc, char *__getopt_argv_const *argv,
- const char *options,
- const struct option *long_options, int *opt_index)
-{
- return _getopt_internal (argc, (char **) argv, options, long_options,
- opt_index, 1, 0);
-}
-
-int
-_getopt_long_only_r (int argc, char **argv, const char *options,
- const struct option *long_options, int *opt_index,
- struct _getopt_data *d)
-{
- return _getopt_internal_r (argc, argv, options, long_options, opt_index,
- 1, 0, d);
-}
-
-
-#ifdef TEST
-
-#include <stdio.h>
-
-int
-main (int argc, char **argv)
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
- int option_index = 0;
- static struct option long_options[] =
- {
- {"add", 1, 0, 0},
- {"append", 0, 0, 0},
- {"delete", 1, 0, 0},
- {"verbose", 0, 0, 0},
- {"create", 0, 0, 0},
- {"file", 1, 0, 0},
- {0, 0, 0, 0}
- };
-
- c = getopt_long (argc, argv, "abc:d:0123456789",
- long_options, &option_index);
- if (c == -1)
- break;
-
- switch (c)
- {
- case 0:
- printf ("option %s", long_options[option_index].name);
- if (optarg)
- printf (" with arg %s", optarg);
- printf ("\n");
- break;
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", optarg);
- break;
-
- case 'd':
- printf ("option d with value `%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/getopt_.h b/xbmc/screensavers/rsxs-0.9/lib/getopt_.h
deleted file mode 100644
index 3c406e53dc..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/getopt_.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/* Declarations for getopt.
- Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005
- Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _GETOPT_H
-
-#ifndef __need_getopt
-# define _GETOPT_H 1
-#endif
-
-/* Standalone applications should #define __GETOPT_PREFIX to an
- identifier that prefixes the external functions and variables
- defined in this header. When this happens, include the
- headers that might declare getopt so that they will not cause
- confusion if included after this file. Then systematically rename
- identifiers so that they do not collide with the system functions
- and variables. Renaming avoids problems with some compilers and
- linkers. */
-#if defined __GETOPT_PREFIX && !defined __need_getopt
-# include <stdlib.h>
-# include <stdio.h>
-# include <unistd.h>
-# undef __need_getopt
-# undef getopt
-# undef getopt_long
-# undef getopt_long_only
-# undef optarg
-# undef opterr
-# undef optind
-# undef optopt
-# define __GETOPT_CONCAT(x, y) x ## y
-# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
-# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
-# define getopt __GETOPT_ID (getopt)
-# define getopt_long __GETOPT_ID (getopt_long)
-# define getopt_long_only __GETOPT_ID (getopt_long_only)
-# define optarg __GETOPT_ID (optarg)
-# define opterr __GETOPT_ID (opterr)
-# define optind __GETOPT_ID (optind)
-# define optopt __GETOPT_ID (optopt)
-#endif
-
-/* Standalone applications get correct prototypes for getopt_long and
- getopt_long_only; they declare "char **argv". libc uses prototypes
- with "char *const *argv" that are incorrect because getopt_long and
- getopt_long_only can permute argv; this is required for backward
- compatibility (e.g., for LSB 2.0.1).
-
- This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt',
- but it caused redefinition warnings if both unistd.h and getopt.h were
- included, since unistd.h includes getopt.h having previously defined
- __need_getopt.
-
- The only place where __getopt_argv_const is used is in definitions
- of getopt_long and getopt_long_only below, but these are visible
- only if __need_getopt is not defined, so it is quite safe to rewrite
- the conditional as follows:
-*/
-#if !defined __need_getopt
-# if defined __GETOPT_PREFIX
-# define __getopt_argv_const /* empty */
-# else
-# define __getopt_argv_const const
-# endif
-#endif
-
-/* If __GNU_LIBRARY__ is not already defined, either we are being used
- standalone, or this is the first header included in the source file.
- If we are being used with glibc, we need to include <features.h>, but
- that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
- not defined, include <ctype.h>, which will pull in <features.h> for us
- if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
- doesn't flood the namespace with stuff the way some other headers do.) */
-#if !defined __GNU_LIBRARY__
-# include <ctype.h>
-#endif
-
-#ifndef __THROW
-# ifndef __GNUC_PREREQ
-# define __GNUC_PREREQ(maj, min) (0)
-# endif
-# if defined __cplusplus && __GNUC_PREREQ (2,8)
-# define __THROW throw ()
-# else
-# define __THROW
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message `getopt' prints
- for unrecognized options. */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized. */
-
-extern int optopt;
-
-#ifndef __need_getopt
-/* Describe the long-named options requested by the application.
- The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
- of `struct option' terminated by an element containing a name which is
- zero.
-
- The field `has_arg' is:
- no_argument (or 0) if the option does not take an argument,
- required_argument (or 1) if the option requires an argument,
- optional_argument (or 2) if the option takes an optional argument.
-
- If the field `flag' is not NULL, it points to a variable that is set
- to the value given in the field `val' when the option is found, but
- left unchanged if the option is not found.
-
- To have a long-named option do something other than set an `int' to
- a compiled-in constant, such as set a value from `optarg', set the
- option's `flag' field to zero and its `val' field to a nonzero
- value (the equivalent single-letter option character, if there is
- one). For long options that have a zero `flag' field, `getopt'
- returns the contents of the `val' field. */
-
-struct option
-{
- const char *name;
- /* has_arg can't be an enum because some compilers complain about
- type mismatches in all the code that assumes it is an int. */
- int has_arg;
- int *flag;
- int val;
-};
-
-/* Names for the values of the `has_arg' field of `struct option'. */
-
-# define no_argument 0
-# define required_argument 1
-# define optional_argument 2
-#endif /* need getopt */
-
-
-/* Get definitions and prototypes for functions to process the
- arguments in ARGV (ARGC of them, minus the program name) for
- options given in OPTS.
-
- Return the option character from OPTS just read. Return -1 when
- there are no more options. For unrecognized options, or options
- missing arguments, `optopt' is set to the option letter, and '?' is
- returned.
-
- The OPTS string is a list of characters which are recognized option
- letters, optionally followed by colons, specifying that that letter
- takes an argument, to be placed in `optarg'.
-
- If a letter in OPTS is followed by two colons, its argument is
- optional. This behavior is specific to the GNU `getopt'.
-
- The argument `--' causes premature termination of argument
- scanning, explicitly telling `getopt' that there are no more
- options.
-
- If OPTS begins with `--', then non-option arguments are treated as
- arguments to the option '\0'. This behavior is specific to the GNU
- `getopt'. */
-
-extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
- __THROW;
-
-#ifndef __need_getopt
-extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind)
- __THROW;
-extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind)
- __THROW;
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/* Make sure we later can get all the definitions and declarations. */
-#undef __need_getopt
-
-#endif /* getopt.h */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/getopt_int.h b/xbmc/screensavers/rsxs-0.9/lib/getopt_int.h
deleted file mode 100644
index 401579fd28..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/getopt_int.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Internal declarations for getopt.
- Copyright (C) 1989-1994,1996-1999,2001,2003,2004
- Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _GETOPT_INT_H
-#define _GETOPT_INT_H 1
-
-extern int _getopt_internal (int ___argc, char **___argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind,
- int __long_only, int __posixly_correct);
-
-
-/* Reentrant versions which can handle parsing multiple argument
- vectors at the same time. */
-
-/* Data type for reentrant functions. */
-struct _getopt_data
-{
- /* These have exactly the same meaning as the corresponding global
- variables, except that they are used for the reentrant
- versions of getopt. */
- int optind;
- int opterr;
- int optopt;
- char *optarg;
-
- /* Internal members. */
-
- /* True if the internal members have been initialized. */
- int __initialized;
-
- /* The next char to be scanned in the option-element
- in which the last option character we returned was found.
- This allows us to pick up the scan where we left off.
-
- If this is zero, or a null string, it means resume the scan
- by advancing to the next ARGV-element. */
- char *__nextchar;
-
- /* Describe how to deal with options that follow non-option ARGV-elements.
-
- If the caller did not specify anything,
- the default is REQUIRE_ORDER if the environment variable
- POSIXLY_CORRECT is defined, PERMUTE otherwise.
-
- REQUIRE_ORDER means don't recognize them as options;
- stop option processing when the first non-option is seen.
- This is what Unix does.
- This mode of operation is selected by either setting the environment
- variable POSIXLY_CORRECT, or using `+' as the first character
- of the list of option characters, or by calling getopt.
-
- PERMUTE is the default. We permute the contents of ARGV as we
- scan, so that eventually all the non-options are at the end.
- This allows options to be given in any order, even with programs
- that were not written to expect this.
-
- RETURN_IN_ORDER is an option available to programs that were
- written to expect options and other ARGV-elements in any order
- and that care about the ordering of the two. We describe each
- non-option ARGV-element as if it were the argument of an option
- with character code 1. Using `-' as the first character of the
- list of option characters selects this mode of operation.
-
- The special argument `--' forces an end of option-scanning regardless
- of the value of `ordering'. In the case of RETURN_IN_ORDER, only
- `--' can cause `getopt' to return -1 with `optind' != ARGC. */
-
- enum
- {
- REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
- } __ordering;
-
- /* If the POSIXLY_CORRECT environment variable is set
- or getopt was called. */
- int __posixly_correct;
-
-
- /* Handle permutation of arguments. */
-
- /* Describe the part of ARGV that contains non-options that have
- been skipped. `first_nonopt' is the index in ARGV of the first
- of them; `last_nonopt' is the index after the last of them. */
-
- int __first_nonopt;
- int __last_nonopt;
-
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
- int __nonoption_flags_max_len;
- int __nonoption_flags_len;
-# endif
-};
-
-/* The initializer is necessary to set OPTIND and OPTERR to their
- default values and to clear the initialization flag. */
-#define _GETOPT_DATA_INITIALIZER { 1, 1 }
-
-extern int _getopt_internal_r (int ___argc, char **___argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind,
- int __long_only, int __posixly_correct,
- struct _getopt_data *__data);
-
-extern int _getopt_long_r (int ___argc, char **___argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind,
- struct _getopt_data *__data);
-
-extern int _getopt_long_only_r (int ___argc, char **___argv,
- const char *__shortopts,
- const struct option *__longopts,
- int *__longind,
- struct _getopt_data *__data);
-
-#endif /* getopt_int.h */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/gettext.h b/xbmc/screensavers/rsxs-0.9/lib/gettext.h
deleted file mode 100644
index 285cb314ce..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/gettext.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Convenience header for conditional use of GNU <libintl.h>.
- Copyright (C) 1995-1998, 2000-2002, 2004 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _LIBGETTEXT_H
-#define _LIBGETTEXT_H 1
-
-/* NLS can be disabled through the configure --disable-nls option. */
-#if ENABLE_NLS
-
-/* Get declarations of GNU message catalog functions. */
-# include <libintl.h>
-
-#else
-
-/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
- chokes if dcgettext is defined as a macro. So include it now, to make
- later inclusions of <locale.h> a NOP. We don't include <libintl.h>
- as well because people using "gettext.h" will not include <libintl.h>,
- and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
- is OK. */
-#if defined(__sun)
-# include <locale.h>
-#endif
-
-/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
- <libintl.h>, which chokes if dcgettext is defined as a macro. So include
- it now, to make later inclusions of <libintl.h> a NOP. */
-#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
-# include <cstdlib>
-# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
-# include <libintl.h>
-# endif
-#endif
-
-/* Disabled NLS.
- The casts to 'const char *' serve the purpose of producing warnings
- for invalid uses of the value returned from these functions.
- On pre-ANSI systems without 'const', the config.h file is supposed to
- contain "#define const". */
-# define gettext(Msgid) ((const char *) (Msgid))
-# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
-# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
-# define ngettext(Msgid1, Msgid2, N) \
- ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
-# define dngettext(Domainname, Msgid1, Msgid2, N) \
- ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
-# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
- ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
-# define textdomain(Domainname) ((const char *) (Domainname))
-# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
-# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
-
-#endif
-
-/* A pseudo function call that serves as a marker for the automated
- extraction of messages, but does not call gettext(). The run-time
- translation is done at a different place in the code.
- The argument, String, should be a literal string. Concatenated strings
- and other string expressions won't work.
- The macro's expansion is not parenthesized, so that it is suitable as
- initializer for static 'char[]' or 'const char[]' variables. */
-#define gettext_noop(String) String
-
-#endif /* _LIBGETTEXT_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/gettimeofday.c b/xbmc/screensavers/rsxs-0.9/lib/gettimeofday.c
deleted file mode 100644
index eb6de94f1e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/gettimeofday.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* Work around the bug in some systems whereby gettimeofday clobbers the
- static buffer that localtime uses for it's return value. The gettimeofday
- function from Mac OS X 10.0.4, i.e. Darwin 1.3.7 has this problem.
- The tzset replacement is necessary for at least Solaris 2.5, 2.5.1, and 2.6.
- Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* written by Jim Meyering */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Disable the definitions of these functions (from config.h)
- so we can use the library versions here. */
-#undef gettimeofday
-#undef gmtime
-#undef localtime
-#undef tzset
-
-#include <sys/types.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-#include <stdlib.h>
-
-static struct tm *localtime_buffer_addr;
-
-/* This is a wrapper for localtime. It is used only on systems for which
- gettimeofday clobbers the static buffer used for localtime's result.
-
- On the first call, record the address of the static buffer that
- localtime uses for its result. */
-
-struct tm *
-rpl_localtime (const time_t *timep)
-{
- struct tm *tm = localtime (timep);
-
- if (! localtime_buffer_addr)
- localtime_buffer_addr = tm;
-
- return tm;
-}
-
-/* Same as above, since gmtime and localtime use the same buffer. */
-struct tm *
-rpl_gmtime (const time_t *timep)
-{
- struct tm *tm = gmtime (timep);
-
- if (! localtime_buffer_addr)
- localtime_buffer_addr = tm;
-
- return tm;
-}
-
-/* This is a wrapper for gettimeofday. It is used only on systems for which
- gettimeofday clobbers the static buffer used for localtime's result.
-
- Save and restore the contents of the buffer used for localtime's result
- around the call to gettimeofday. */
-
-int
-rpl_gettimeofday (struct timeval *tv, struct timezone *tz)
-{
- struct tm save;
- int result;
-
- if (! localtime_buffer_addr)
- {
- time_t t = 0;
- localtime_buffer_addr = localtime (&t);
- }
-
- save = *localtime_buffer_addr;
- result = gettimeofday (tv, tz);
- *localtime_buffer_addr = save;
-
- return result;
-}
-
-/* This is a wrapper for tzset. It is used only on systems for which
- tzset may clobber the static buffer used for localtime's result.
- Save and restore the contents of the buffer used for localtime's
- result around the call to tzset. */
-void
-rpl_tzset (void)
-{
- struct tm save;
-
- if (! localtime_buffer_addr)
- {
- time_t t = 0;
- localtime_buffer_addr = localtime (&t);
- }
-
- save = *localtime_buffer_addr;
- tzset ();
- *localtime_buffer_addr = save;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/mbchar.c b/xbmc/screensavers/rsxs-0.9/lib/mbchar.c
deleted file mode 100644
index 6facc14926..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/mbchar.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <limits.h>
-
-#include "mbchar.h"
-
-#if IS_BASIC_ASCII
-
-/* Bit table of characters in the ISO C "basic character set". */
-unsigned int is_basic_table [UCHAR_MAX / 32 + 1] =
-{
- 0x00001a00, /* '\t' '\v' '\f' */
- 0xffffffef, /* ' '...'#' '%'...'?' */
- 0xfffffffe, /* 'A'...'Z' '[' '\\' ']' '^' '_' */
- 0x7ffffffe /* 'a'...'z' '{' '|' '}' '~' */
- /* The remaining bits are 0. */
-};
-
-#endif /* IS_BASIC_ASCII */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/mbchar.h b/xbmc/screensavers/rsxs-0.9/lib/mbchar.h
deleted file mode 100644
index 738efd948a..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/mbchar.h
+++ /dev/null
@@ -1,354 +0,0 @@
-/* Multibyte character data type.
- Copyright (C) 2001, 2005-2006 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* Written by Bruno Haible <bruno@clisp.org>. */
-
-/* A multibyte character is a short subsequence of a char* string,
- representing a single wide character.
-
- We use multibyte characters instead of wide characters because of
- the following goals:
- 1) correct multibyte handling, i.e. operate according to the LC_CTYPE
- locale,
- 2) ease of maintenance, i.e. the maintainer needs not know all details
- of the ISO C 99 standard,
- 3) don't fail grossly if the input is not in the encoding set by the
- locale, because often different encodings are in use in the same
- countries (ISO-8859-1/UTF-8, EUC-JP/Shift_JIS, ...),
- 4) fast in the case of ASCII characters,
- 5) portability, i.e. don't make unportable assumptions about wchar_t.
-
- Multibyte characters are only accessed through the mb* macros.
-
- mb_ptr (mbc)
- return a pointer to the beginning of the multibyte sequence.
-
- mb_len (mbc)
- returns the number of bytes occupied by the multibyte sequence.
- Always > 0.
-
- mb_iseq (mbc, sc)
- returns true if mbc is the standard ASCII character sc.
-
- mb_isnul (mbc)
- returns true if mbc is the nul character.
-
- mb_cmp (mbc1, mbc2)
- returns a positive, zero, or negative value depending on whether mbc1
- sorts after, same or before mbc2.
-
- mb_casecmp (mbc1, mbc2)
- returns a positive, zero, or negative value depending on whether mbc1
- sorts after, same or before mbc2, modulo upper/lowercase conversion.
-
- mb_equal (mbc1, mbc2)
- returns true if mbc1 and mbc2 are equal.
-
- mb_caseequal (mbc1, mbc2)
- returns true if mbc1 and mbc2 are equal modulo upper/lowercase conversion.
-
- mb_isalnum (mbc)
- returns true if mbc is alphanumeric.
-
- mb_isalpha (mbc)
- returns true if mbc is alphabetic.
-
- mb_isascii(mbc)
- returns true if mbc is plain ASCII.
-
- mb_isblank (mbc)
- returns true if mbc is a blank.
-
- mb_iscntrl (mbc)
- returns true if mbc is a control character.
-
- mb_isdigit (mbc)
- returns true if mbc is a decimal digit.
-
- mb_isgraph (mbc)
- returns true if mbc is a graphic character.
-
- mb_islower (mbc)
- returns true if mbc is lowercase.
-
- mb_isprint (mbc)
- returns true if mbc is a printable character.
-
- mb_ispunct (mbc)
- returns true if mbc is a punctuation character.
-
- mb_isspace (mbc)
- returns true if mbc is a space character.
-
- mb_isupper (mbc)
- returns true if mbc is uppercase.
-
- mb_isxdigit (mbc)
- returns true if mbc is a hexadecimal digit.
-
- mb_width (mbc)
- returns the number of columns on the output device occupied by mbc.
- Always >= 0.
-
- mb_putc (mbc, stream)
- outputs mbc on stream, a byte oriented FILE stream opened for output.
-
- mb_setascii (&mbc, sc)
- assigns the standard ASCII character sc to mbc.
-
- mb_copy (&destmbc, &srcmbc)
- copies srcmbc to destmbc.
-
- Here are the function prototypes of the macros.
-
- extern const char * mb_ptr (const mbchar_t mbc);
- extern size_t mb_len (const mbchar_t mbc);
- extern bool mb_iseq (const mbchar_t mbc, char sc);
- extern bool mb_isnul (const mbchar_t mbc);
- extern int mb_cmp (const mbchar_t mbc1, const mbchar_t mbc2);
- extern int mb_casecmp (const mbchar_t mbc1, const mbchar_t mbc2);
- extern bool mb_equal (const mbchar_t mbc1, const mbchar_t mbc2);
- extern bool mb_caseequal (const mbchar_t mbc1, const mbchar_t mbc2);
- extern bool mb_isalnum (const mbchar_t mbc);
- extern bool mb_isalpha (const mbchar_t mbc);
- extern bool mb_isascii (const mbchar_t mbc);
- extern bool mb_isblank (const mbchar_t mbc);
- extern bool mb_iscntrl (const mbchar_t mbc);
- extern bool mb_isdigit (const mbchar_t mbc);
- extern bool mb_isgraph (const mbchar_t mbc);
- extern bool mb_islower (const mbchar_t mbc);
- extern bool mb_isprint (const mbchar_t mbc);
- extern bool mb_ispunct (const mbchar_t mbc);
- extern bool mb_isspace (const mbchar_t mbc);
- extern bool mb_isupper (const mbchar_t mbc);
- extern bool mb_isxdigit (const mbchar_t mbc);
- extern int mb_width (const mbchar_t mbc);
- extern void mb_putc (const mbchar_t mbc, FILE *stream);
- extern void mb_setascii (mbchar_t *new, char sc);
- extern void mb_copy (mbchar_t *new, const mbchar_t *old);
- */
-
-#ifndef _MBCHAR_H
-#define _MBCHAR_H 1
-
-#include <stdbool.h>
-#include <string.h>
-
-/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
- <wchar.h>.
- BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
- <wchar.h>. */
-#include <stdio.h>
-#include <time.h>
-#include <wchar.h>
-
-#include <wctype.h>
-
-#include "wcwidth.h"
-
-#define MBCHAR_BUF_SIZE 24
-
-struct mbchar
-{
- const char *ptr; /* pointer to current character */
- size_t bytes; /* number of bytes of current character, > 0 */
- bool wc_valid; /* true if wc is a valid wide character */
- wchar_t wc; /* if wc_valid: the current character */
- char buf[MBCHAR_BUF_SIZE]; /* room for the bytes, used for file input only */
-};
-
-/* EOF (not a real character) is represented with bytes = 0 and
- wc_valid = false. */
-
-typedef struct mbchar mbchar_t;
-
-/* Access the current character. */
-#define mb_ptr(mbc) ((mbc).ptr)
-#define mb_len(mbc) ((mbc).bytes)
-
-/* Comparison of characters. */
-#define mb_iseq(mbc, sc) ((mbc).wc_valid && (mbc).wc == (sc))
-#define mb_isnul(mbc) ((mbc).wc_valid && (mbc).wc == 0)
-#define mb_cmp(mbc1, mbc2) \
- ((mbc1).wc_valid \
- ? ((mbc2).wc_valid \
- ? (int) (mbc1).wc - (int) (mbc2).wc \
- : -1) \
- : ((mbc2).wc_valid \
- ? 1 \
- : (mbc1).bytes == (mbc2).bytes \
- ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) \
- : (mbc1).bytes < (mbc2).bytes \
- ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \
- : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1)))
-#define mb_casecmp(mbc1, mbc2) \
- ((mbc1).wc_valid \
- ? ((mbc2).wc_valid \
- ? (int) towlower ((mbc1).wc) - (int) towlower ((mbc2).wc) \
- : -1) \
- : ((mbc2).wc_valid \
- ? 1 \
- : (mbc1).bytes == (mbc2).bytes \
- ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) \
- : (mbc1).bytes < (mbc2).bytes \
- ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \
- : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1)))
-#define mb_equal(mbc1, mbc2) \
- ((mbc1).wc_valid && (mbc2).wc_valid \
- ? (mbc1).wc == (mbc2).wc \
- : (mbc1).bytes == (mbc2).bytes \
- && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0)
-#define mb_caseequal(mbc1, mbc2) \
- ((mbc1).wc_valid && (mbc2).wc_valid \
- ? towlower ((mbc1).wc) == towlower ((mbc2).wc) \
- : (mbc1).bytes == (mbc2).bytes \
- && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0)
-
-/* <ctype.h>, <wctype.h> classification. */
-#define mb_isascii(mbc) \
- ((mbc).wc_valid && (mbc).wc >= 0 && (mbc).wc <= 127)
-#define mb_isalnum(mbc) ((mbc).wc_valid && iswalnum ((mbc).wc))
-#define mb_isalpha(mbc) ((mbc).wc_valid && iswalpha ((mbc).wc))
-#define mb_isblank(mbc) ((mbc).wc_valid && iswblank ((mbc).wc))
-#define mb_iscntrl(mbc) ((mbc).wc_valid && iswcntrl ((mbc).wc))
-#define mb_isdigit(mbc) ((mbc).wc_valid && iswdigit ((mbc).wc))
-#define mb_isgraph(mbc) ((mbc).wc_valid && iswgraph ((mbc).wc))
-#define mb_islower(mbc) ((mbc).wc_valid && iswlower ((mbc).wc))
-#define mb_isprint(mbc) ((mbc).wc_valid && iswprint ((mbc).wc))
-#define mb_ispunct(mbc) ((mbc).wc_valid && iswpunct ((mbc).wc))
-#define mb_isspace(mbc) ((mbc).wc_valid && iswspace ((mbc).wc))
-#define mb_isupper(mbc) ((mbc).wc_valid && iswupper ((mbc).wc))
-#define mb_isxdigit(mbc) ((mbc).wc_valid && iswxdigit ((mbc).wc))
-
-/* Extra <wchar.h> function. */
-
-/* Unprintable characters appear as a small box of width 1. */
-#define MB_UNPRINTABLE_WIDTH 1
-
-static inline int
-mb_width_aux (wint_t wc)
-{
- int w = wcwidth (wc);
- /* For unprintable characters, arbitrarily return 0 for control characters
- and MB_UNPRINTABLE_WIDTH otherwise. */
- return (w >= 0 ? w : iswcntrl (wc) ? 0 : MB_UNPRINTABLE_WIDTH);
-}
-
-#define mb_width(mbc) \
- ((mbc).wc_valid ? mb_width_aux ((mbc).wc) : MB_UNPRINTABLE_WIDTH)
-
-/* Output. */
-#define mb_putc(mbc, stream) fwrite ((mbc).ptr, 1, (mbc).bytes, (stream))
-
-/* Assignment. */
-#define mb_setascii(mbc, sc) \
- ((mbc)->ptr = (mbc)->buf, (mbc)->bytes = 1, (mbc)->wc_valid = 1, \
- (mbc)->wc = (mbc)->buf[0] = (sc))
-
-/* Copying a character. */
-static inline void
-mb_copy (mbchar_t *new, const mbchar_t *old)
-{
- if (old->ptr == &old->buf[0])
- {
- memcpy (&new->buf[0], &old->buf[0], old->bytes);
- new->ptr = &new->buf[0];
- }
- else
- new->ptr = old->ptr;
- new->bytes = old->bytes;
- if ((new->wc_valid = old->wc_valid))
- new->wc = old->wc;
-}
-
-
-/* is_basic(c) tests whether the single-byte character c is in the
- ISO C "basic character set".
- This is a convenience function, and is in this file only to share code
- between mbiter_multi.h and mbfile_multi.h. */
-#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
- && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
- && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
- && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
- && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
- && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
- && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
- && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
- && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
- && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
- && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
- && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
- && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
- && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
- && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
- && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
- && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
- && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
- && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
- && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
- && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
- && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
- && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)
-/* The character set is ISO-646, not EBCDIC. */
-# define IS_BASIC_ASCII 1
-
-extern unsigned int is_basic_table[];
-
-static inline bool
-is_basic (char c)
-{
- return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31))
- & 1;
-}
-
-#else
-
-static inline bool
-is_basic (char c)
-{
- switch (c)
- {
- case '\t': case '\v': case '\f':
- case ' ': case '!': case '"': case '#': case '%':
- case '&': case '\'': case '(': case ')': case '*':
- case '+': case ',': case '-': case '.': case '/':
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- case ':': case ';': case '<': case '=': case '>':
- case '?':
- case 'A': case 'B': case 'C': case 'D': case 'E':
- case 'F': case 'G': case 'H': case 'I': case 'J':
- case 'K': case 'L': case 'M': case 'N': case 'O':
- case 'P': case 'Q': case 'R': case 'S': case 'T':
- case 'U': case 'V': case 'W': case 'X': case 'Y':
- case 'Z':
- case '[': case '\\': case ']': case '^': case '_':
- case 'a': case 'b': case 'c': case 'd': case 'e':
- case 'f': case 'g': case 'h': case 'i': case 'j':
- case 'k': case 'l': case 'm': case 'n': case 'o':
- case 'p': case 'q': case 'r': case 's': case 't':
- case 'u': case 'v': case 'w': case 'x': case 'y':
- case 'z': case '{': case '|': case '}': case '~':
- return 1;
- default:
- return 0;
- }
-}
-
-#endif
-
-#endif /* _MBCHAR_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/mbuiter.h b/xbmc/screensavers/rsxs-0.9/lib/mbuiter.h
deleted file mode 100644
index 9da3a6c79c..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/mbuiter.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/* Iterating through multibyte strings: macros for multi-byte encodings.
- Copyright (C) 2001, 2005 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* Written by Bruno Haible <bruno@clisp.org>. */
-
-/* The macros in this file implement forward iteration through a
- multi-byte string, without knowing its length a-priori.
-
- With these macros, an iteration loop that looks like
-
- char *iter;
- for (iter = buf; *iter != '\0'; iter++)
- {
- do_something (*iter);
- }
-
- becomes
-
- mbui_iterator_t iter;
- for (mbui_init (iter, buf); mbui_avail (iter); mbui_advance (iter))
- {
- do_something (mbui_cur_ptr (iter), mb_len (mbui_cur (iter)));
- }
-
- The benefit of these macros over plain use of mbrtowc is:
- - Handling of invalid multibyte sequences is possible without
- making the code more complicated, while still preserving the
- invalid multibyte sequences.
-
- Compared to mbiter.h, the macros here don't need to know the string's
- length a-priori. The downside is that at each step, the look-ahead
- that guards against overrunning the terminating '\0' is more expensive.
- The mbui_* macros are therefore suitable when there is a high probability
- that only the first few multibyte characters need to be inspected.
- Whereas the mbi_* macros are better if usually the iteration runs
- through the entire string.
-
- mbui_iterator_t
- is a type usable for variable declarations.
-
- mbui_init (iter, startptr)
- initializes the iterator, starting at startptr.
-
- mbui_avail (iter)
- returns true if there are more multibyte chracters available before
- the end of string is reached. In this case, mbui_cur (iter) is
- initialized to the next multibyte chracter.
-
- mbui_advance (iter)
- advances the iterator by one multibyte character.
-
- mbui_cur (iter)
- returns the current multibyte character, of type mbchar_t. All the
- macros defined in mbchar.h can be used on it.
-
- mbui_cur_ptr (iter)
- return a pointer to the beginning of the current multibyte character.
-
- mbui_reloc (iter, ptrdiff)
- relocates iterator when the string is moved by ptrdiff bytes.
-
- Here are the function prototypes of the macros.
-
- extern void mbui_init (mbui_iterator_t iter, const char *startptr);
- extern bool mbui_avail (mbui_iterator_t iter);
- extern void mbui_advance (mbui_iterator_t iter);
- extern mbchar_t mbui_cur (mbui_iterator_t iter);
- extern const char * mbui_cur_ptr (mbui_iterator_t iter);
- extern void mbui_reloc (mbui_iterator_t iter, ptrdiff_t ptrdiff);
- */
-
-#ifndef _MBUITER_H
-#define _MBUITER_H 1
-
-#include <assert.h>
-#include <stdbool.h>
-#include <stdlib.h>
-
-/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
- <wchar.h>.
- BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
- <wchar.h>. */
-#include <stdio.h>
-#include <time.h>
-#include <wchar.h>
-
-#include "mbchar.h"
-#include "strnlen1.h"
-
-struct mbuiter_multi
-{
- bool in_shift; /* true if next byte may not be interpreted as ASCII */
- mbstate_t state; /* if in_shift: current shift state */
- bool next_done; /* true if mbui_avail has already filled the following */
- struct mbchar cur; /* the current character:
- const char *cur.ptr pointer to current character
- The following are only valid after mbui_avail.
- size_t cur.bytes number of bytes of current character
- bool cur.wc_valid true if wc is a valid wide character
- wchar_t cur.wc if wc_valid: the current character
- */
-};
-
-static inline void
-mbuiter_multi_next (struct mbuiter_multi *iter)
-{
- if (iter->next_done)
- return;
- if (iter->in_shift)
- goto with_shift;
- /* Handle most ASCII characters quickly, without calling mbrtowc(). */
- if (is_basic (*iter->cur.ptr))
- {
- /* These characters are part of the basic character set. ISO C 99
- guarantees that their wide character code is identical to their
- char code. */
- iter->cur.bytes = 1;
- iter->cur.wc = *iter->cur.ptr;
- iter->cur.wc_valid = true;
- }
- else
- {
- assert (mbsinit (&iter->state));
- iter->in_shift = true;
- with_shift:
- iter->cur.bytes = mbrtowc (&iter->cur.wc, iter->cur.ptr,
- strnlen1 (iter->cur.ptr, MB_CUR_MAX),
- &iter->state);
- if (iter->cur.bytes == (size_t) -1)
- {
- /* An invalid multibyte sequence was encountered. */
- iter->cur.bytes = 1;
- iter->cur.wc_valid = false;
- /* Whether to set iter->in_shift = false and reset iter->state
- or not is not very important; the string is bogus anyway. */
- }
- else if (iter->cur.bytes == (size_t) -2)
- {
- /* An incomplete multibyte character at the end. */
- iter->cur.bytes = strlen (iter->cur.ptr);
- iter->cur.wc_valid = false;
- /* Whether to set iter->in_shift = false and reset iter->state
- or not is not important; the string end is reached anyway. */
- }
- else
- {
- if (iter->cur.bytes == 0)
- {
- /* A null wide character was encountered. */
- iter->cur.bytes = 1;
- assert (*iter->cur.ptr == '\0');
- assert (iter->cur.wc == 0);
- }
- iter->cur.wc_valid = true;
-
- /* When in the initial state, we can go back treating ASCII
- characters more quickly. */
- if (mbsinit (&iter->state))
- iter->in_shift = false;
- }
- }
- iter->next_done = true;
-}
-
-static inline void
-mbuiter_multi_reloc (struct mbuiter_multi *iter, ptrdiff_t ptrdiff)
-{
- iter->cur.ptr += ptrdiff;
-}
-
-/* Iteration macros. */
-typedef struct mbuiter_multi mbui_iterator_t;
-#define mbui_init(iter, startptr) \
- ((iter).cur.ptr = (startptr), \
- (iter).in_shift = false, memset (&(iter).state, '\0', sizeof (mbstate_t)), \
- (iter).next_done = false)
-#define mbui_avail(iter) \
- (mbuiter_multi_next (&(iter)), !mb_isnul ((iter).cur))
-#define mbui_advance(iter) \
- ((iter).cur.ptr += (iter).cur.bytes, (iter).next_done = false)
-
-/* Access to the current character. */
-#define mbui_cur(iter) (iter).cur
-#define mbui_cur_ptr(iter) (iter).cur.ptr
-
-/* Relocation. */
-#define mbui_reloc(iter, ptrdiff) mbuiter_multi_reloc (&iter, ptrdiff)
-
-#endif /* _MBUITER_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/memchr.c b/xbmc/screensavers/rsxs-0.9/lib/memchr.c
deleted file mode 100644
index 3c5ecfd0e1..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/memchr.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/* Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004 Free
- Software Foundation, Inc.
-
- Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
- with help from Dan Sahlin (dan@sics.se) and
- commentary by Jim Blandy (jimb@ai.mit.edu);
- adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
- and implemented by Roland McGrath (roland@ai.mit.edu).
-
-NOTE: The canonical source of this file is maintained with the GNU C Library.
-Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software Foundation,
-Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <string.h>
-
-#include <stddef.h>
-
-#if defined _LIBC
-# include <memcopy.h>
-#else
-# define reg_char char
-#endif
-
-#include <limits.h>
-
-#if HAVE_BP_SYM_H || defined _LIBC
-# include <bp-sym.h>
-#else
-# define BP_SYM(sym) sym
-#endif
-
-#undef memchr
-#undef __memchr
-
-/* Search no more than N bytes of S for C. */
-void *
-__memchr (void const *s, int c_in, size_t n)
-{
- const unsigned char *char_ptr;
- const unsigned long int *longword_ptr;
- unsigned long int longword, magic_bits, charmask;
- unsigned reg_char c;
- int i;
-
- c = (unsigned char) c_in;
-
- /* Handle the first few characters by reading one character at a time.
- Do this until CHAR_PTR is aligned on a longword boundary. */
- for (char_ptr = (const unsigned char *) s;
- n > 0 && (size_t) char_ptr % sizeof longword != 0;
- --n, ++char_ptr)
- if (*char_ptr == c)
- return (void *) char_ptr;
-
- /* All these elucidatory comments refer to 4-byte longwords,
- but the theory applies equally well to any size longwords. */
-
- longword_ptr = (const unsigned long int *) char_ptr;
-
- /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits
- the "holes." Note that there is a hole just to the left of
- each byte, with an extra at the end:
-
- bits: 01111110 11111110 11111110 11111111
- bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
-
- The 1-bits make sure that carries propagate to the next 0-bit.
- The 0-bits provide holes for carries to fall into. */
-
- /* Set MAGIC_BITS to be this pattern of 1 and 0 bits.
- Set CHARMASK to be a longword, each of whose bytes is C. */
-
- magic_bits = 0xfefefefe;
- charmask = c | (c << 8);
- charmask |= charmask << 16;
-#if 0xffffffffU < ULONG_MAX
- magic_bits |= magic_bits << 32;
- charmask |= charmask << 32;
- if (8 < sizeof longword)
- for (i = 64; i < sizeof longword * 8; i *= 2)
- {
- magic_bits |= magic_bits << i;
- charmask |= charmask << i;
- }
-#endif
- magic_bits = (ULONG_MAX >> 1) & (magic_bits | 1);
-
- /* Instead of the traditional loop which tests each character,
- we will test a longword at a time. The tricky part is testing
- if *any of the four* bytes in the longword in question are zero. */
- while (n >= sizeof longword)
- {
- /* We tentatively exit the loop if adding MAGIC_BITS to
- LONGWORD fails to change any of the hole bits of LONGWORD.
-
- 1) Is this safe? Will it catch all the zero bytes?
- Suppose there is a byte with all zeros. Any carry bits
- propagating from its left will fall into the hole at its
- least significant bit and stop. Since there will be no
- carry from its most significant bit, the LSB of the
- byte to the left will be unchanged, and the zero will be
- detected.
-
- 2) Is this worthwhile? Will it ignore everything except
- zero bytes? Suppose every byte of LONGWORD has a bit set
- somewhere. There will be a carry into bit 8. If bit 8
- is set, this will carry into bit 16. If bit 8 is clear,
- one of bits 9-15 must be set, so there will be a carry
- into bit 16. Similarly, there will be a carry into bit
- 24. If one of bits 24-30 is set, there will be a carry
- into bit 31, so all of the hole bits will be changed.
-
- The one misfire occurs when bits 24-30 are clear and bit
- 31 is set; in this case, the hole at bit 31 is not
- changed. If we had access to the processor carry flag,
- we could close this loophole by putting the fourth hole
- at bit 32!
-
- So it ignores everything except 128's, when they're aligned
- properly.
-
- 3) But wait! Aren't we looking for C, not zero?
- Good point. So what we do is XOR LONGWORD with a longword,
- each of whose bytes is C. This turns each byte that is C
- into a zero. */
-
- longword = *longword_ptr++ ^ charmask;
-
- /* Add MAGIC_BITS to LONGWORD. */
- if ((((longword + magic_bits)
-
- /* Set those bits that were unchanged by the addition. */
- ^ ~longword)
-
- /* Look at only the hole bits. If any of the hole bits
- are unchanged, most likely one of the bytes was a
- zero. */
- & ~magic_bits) != 0)
- {
- /* Which of the bytes was C? If none of them were, it was
- a misfire; continue the search. */
-
- const unsigned char *cp = (const unsigned char *) (longword_ptr - 1);
-
- if (cp[0] == c)
- return (void *) cp;
- if (cp[1] == c)
- return (void *) &cp[1];
- if (cp[2] == c)
- return (void *) &cp[2];
- if (cp[3] == c)
- return (void *) &cp[3];
- if (4 < sizeof longword && cp[4] == c)
- return (void *) &cp[4];
- if (5 < sizeof longword && cp[5] == c)
- return (void *) &cp[5];
- if (6 < sizeof longword && cp[6] == c)
- return (void *) &cp[6];
- if (7 < sizeof longword && cp[7] == c)
- return (void *) &cp[7];
- if (8 < sizeof longword)
- for (i = 8; i < sizeof longword; i++)
- if (cp[i] == c)
- return (void *) &cp[i];
- }
-
- n -= sizeof longword;
- }
-
- char_ptr = (const unsigned char *) longword_ptr;
-
- while (n-- > 0)
- {
- if (*char_ptr == c)
- return (void *) char_ptr;
- else
- ++char_ptr;
- }
-
- return 0;
-}
-#ifdef weak_alias
-weak_alias (__memchr, BP_SYM (memchr))
-#endif
diff --git a/xbmc/screensavers/rsxs-0.9/lib/mempcpy.c b/xbmc/screensavers/rsxs-0.9/lib/mempcpy.c
deleted file mode 100644
index 3502da2441..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/mempcpy.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copy memory area and return pointer after last written byte.
- Copyright (C) 2003 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Specification. */
-#include "mempcpy.h"
-
-#include <string.h>
-
-/* Copy N bytes of SRC to DEST, return pointer to bytes after the
- last written byte. */
-void *
-mempcpy (void *dest, const void *src, size_t n)
-{
- return (char *) memcpy (dest, src, n) + n;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/mempcpy.h b/xbmc/screensavers/rsxs-0.9/lib/mempcpy.h
deleted file mode 100644
index fa2032107a..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/mempcpy.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copy memory area and return pointer after last written byte.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef mempcpy
-
-# if HAVE_MEMPCPY
-
-/* Get mempcpy() declaration. */
-# include <string.h>
-
-# else
-
-/* Get size_t */
-# include <stddef.h>
-
-/* Copy N bytes of SRC to DEST, return pointer to bytes after the
- last written byte. */
-extern void *mempcpy (void *dest, const void *src, size_t n);
-
-# endif
-
-#endif
diff --git a/xbmc/screensavers/rsxs-0.9/lib/minmax.h b/xbmc/screensavers/rsxs-0.9/lib/minmax.h
deleted file mode 100644
index 975ea76d13..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/minmax.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* MIN, MAX macros.
- Copyright (C) 1995, 1998, 2001, 2003, 2005 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _MINMAX_H
-#define _MINMAX_H
-
-/* Note: MIN, MAX are also defined in <sys/param.h> on some systems
- (glibc, IRIX, HP-UX, OSF/1). Therefore you might get warnings about
- MIN, MAX macro redefinitions on some systems; the workaround is to
- #include this file as the last one among the #include list. */
-
-/* Before we define the following symbols we get the <limits.h> file
- since otherwise we get redefinitions on some systems if <limits.h> is
- included after this file. Likewise for <sys/param.h>.
- If more than one of these system headers define MIN and MAX, pick just
- one of the headers (because the definitions most likely are the same). */
-#if HAVE_MINMAX_IN_LIMITS_H
-# include <limits.h>
-#elif HAVE_MINMAX_IN_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-
-/* Note: MIN and MAX should be used with two arguments of the
- same type. They might not return the minimum and maximum of their two
- arguments, if the arguments have different types or have unusual
- floating-point values. For example, on a typical host with 32-bit 'int',
- 64-bit 'long long', and 64-bit IEEE 754 'double' types:
-
- MAX (-1, 2147483648) returns 4294967295.
- MAX (9007199254740992.0, 9007199254740993) returns 9007199254740992.0.
- MAX (NaN, 0.0) returns 0.0.
- MAX (+0.0, -0.0) returns -0.0.
-
- and in each case the answer is in some sense bogus. */
-
-/* MAX(a,b) returns the maximum of A and B. */
-#ifndef MAX
-# define MAX(a,b) ((a) > (b) ? (a) : (b))
-#endif
-
-/* MIN(a,b) returns the minimum of A and B. */
-#ifndef MIN
-# define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
-
-#endif /* _MINMAX_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/printf-args.c b/xbmc/screensavers/rsxs-0.9/lib/printf-args.c
deleted file mode 100644
index 615858c4e6..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/printf-args.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2006 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification. */
-#include "printf-args.h"
-
-#ifdef STATIC
-STATIC
-#endif
-int
-printf_fetchargs (va_list args, arguments *a)
-{
- size_t i;
- argument *ap;
-
- for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
- switch (ap->type)
- {
- case TYPE_SCHAR:
- ap->a.a_schar = va_arg (args, /*signed char*/ int);
- break;
- case TYPE_UCHAR:
- ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
- break;
- case TYPE_SHORT:
- ap->a.a_short = va_arg (args, /*short*/ int);
- break;
- case TYPE_USHORT:
- ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
- break;
- case TYPE_INT:
- ap->a.a_int = va_arg (args, int);
- break;
- case TYPE_UINT:
- ap->a.a_uint = va_arg (args, unsigned int);
- break;
- case TYPE_LONGINT:
- ap->a.a_longint = va_arg (args, long int);
- break;
- case TYPE_ULONGINT:
- ap->a.a_ulongint = va_arg (args, unsigned long int);
- break;
-#ifdef HAVE_LONG_LONG
- case TYPE_LONGLONGINT:
- ap->a.a_longlongint = va_arg (args, long long int);
- break;
- case TYPE_ULONGLONGINT:
- ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
- break;
-#endif
- case TYPE_DOUBLE:
- ap->a.a_double = va_arg (args, double);
- break;
-#ifdef HAVE_LONG_DOUBLE
- case TYPE_LONGDOUBLE:
- ap->a.a_longdouble = va_arg (args, long double);
- break;
-#endif
- case TYPE_CHAR:
- ap->a.a_char = va_arg (args, int);
- break;
-#ifdef HAVE_WINT_T
- case TYPE_WIDE_CHAR:
- ap->a.a_wide_char = va_arg (args, wint_t);
- break;
-#endif
- case TYPE_STRING:
- ap->a.a_string = va_arg (args, const char *);
- /* A null pointer is an invalid argument for "%s", but in practice
- it occurs quite frequently in printf statements that produce
- debug output. Use a fallback in this case. */
- if (ap->a.a_string == NULL)
- ap->a.a_string = "(NULL)";
- break;
-#ifdef HAVE_WCHAR_T
- case TYPE_WIDE_STRING:
- ap->a.a_wide_string = va_arg (args, const wchar_t *);
- /* A null pointer is an invalid argument for "%ls", but in practice
- it occurs quite frequently in printf statements that produce
- debug output. Use a fallback in this case. */
- if (ap->a.a_wide_string == NULL)
- {
- static const wchar_t wide_null_string[] =
- {
- (wchar_t)'(',
- (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
- (wchar_t)')',
- (wchar_t)0
- };
- ap->a.a_wide_string = wide_null_string;
- }
- break;
-#endif
- case TYPE_POINTER:
- ap->a.a_pointer = va_arg (args, void *);
- break;
- case TYPE_COUNT_SCHAR_POINTER:
- ap->a.a_count_schar_pointer = va_arg (args, signed char *);
- break;
- case TYPE_COUNT_SHORT_POINTER:
- ap->a.a_count_short_pointer = va_arg (args, short *);
- break;
- case TYPE_COUNT_INT_POINTER:
- ap->a.a_count_int_pointer = va_arg (args, int *);
- break;
- case TYPE_COUNT_LONGINT_POINTER:
- ap->a.a_count_longint_pointer = va_arg (args, long int *);
- break;
-#ifdef HAVE_LONG_LONG
- case TYPE_COUNT_LONGLONGINT_POINTER:
- ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
- break;
-#endif
- default:
- /* Unknown type. */
- return -1;
- }
- return 0;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/printf-args.h b/xbmc/screensavers/rsxs-0.9/lib/printf-args.h
deleted file mode 100644
index cec1cc6c2a..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/printf-args.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _PRINTF_ARGS_H
-#define _PRINTF_ARGS_H
-
-/* Get size_t. */
-#include <stddef.h>
-
-/* Get wchar_t. */
-#ifdef HAVE_WCHAR_T
-# include <stddef.h>
-#endif
-
-/* Get wint_t. */
-#ifdef HAVE_WINT_T
-# include <wchar.h>
-#endif
-
-/* Get va_list. */
-#include <stdarg.h>
-
-
-/* Argument types */
-typedef enum
-{
- TYPE_NONE,
- TYPE_SCHAR,
- TYPE_UCHAR,
- TYPE_SHORT,
- TYPE_USHORT,
- TYPE_INT,
- TYPE_UINT,
- TYPE_LONGINT,
- TYPE_ULONGINT,
-#ifdef HAVE_LONG_LONG
- TYPE_LONGLONGINT,
- TYPE_ULONGLONGINT,
-#endif
- TYPE_DOUBLE,
-#ifdef HAVE_LONG_DOUBLE
- TYPE_LONGDOUBLE,
-#endif
- TYPE_CHAR,
-#ifdef HAVE_WINT_T
- TYPE_WIDE_CHAR,
-#endif
- TYPE_STRING,
-#ifdef HAVE_WCHAR_T
- TYPE_WIDE_STRING,
-#endif
- TYPE_POINTER,
- TYPE_COUNT_SCHAR_POINTER,
- TYPE_COUNT_SHORT_POINTER,
- TYPE_COUNT_INT_POINTER,
- TYPE_COUNT_LONGINT_POINTER
-#ifdef HAVE_LONG_LONG
-, TYPE_COUNT_LONGLONGINT_POINTER
-#endif
-} arg_type;
-
-/* Polymorphic argument */
-typedef struct
-{
- arg_type type;
- union
- {
- signed char a_schar;
- unsigned char a_uchar;
- short a_short;
- unsigned short a_ushort;
- int a_int;
- unsigned int a_uint;
- long int a_longint;
- unsigned long int a_ulongint;
-#ifdef HAVE_LONG_LONG
- long long int a_longlongint;
- unsigned long long int a_ulonglongint;
-#endif
- float a_float;
- double a_double;
-#ifdef HAVE_LONG_DOUBLE
- long double a_longdouble;
-#endif
- int a_char;
-#ifdef HAVE_WINT_T
- wint_t a_wide_char;
-#endif
- const char* a_string;
-#ifdef HAVE_WCHAR_T
- const wchar_t* a_wide_string;
-#endif
- void* a_pointer;
- signed char * a_count_schar_pointer;
- short * a_count_short_pointer;
- int * a_count_int_pointer;
- long int * a_count_longint_pointer;
-#ifdef HAVE_LONG_LONG
- long long int * a_count_longlongint_pointer;
-#endif
- }
- a;
-}
-argument;
-
-typedef struct
-{
- size_t count;
- argument *arg;
-}
-arguments;
-
-
-/* Fetch the arguments, putting them into a. */
-#ifdef STATIC
-STATIC
-#else
-extern
-#endif
-int printf_fetchargs (va_list args, arguments *a);
-
-#endif /* _PRINTF_ARGS_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/printf-parse.c b/xbmc/screensavers/rsxs-0.9/lib/printf-parse.c
deleted file mode 100644
index 3d2fb175f2..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/printf-parse.c
+++ /dev/null
@@ -1,536 +0,0 @@
-/* Formatted output to strings.
- Copyright (C) 1999-2000, 2002-2003 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification. */
-#if WIDE_CHAR_VERSION
-# include "wprintf-parse.h"
-#else
-# include "printf-parse.h"
-#endif
-
-/* Get size_t, NULL. */
-#include <stddef.h>
-
-/* Get intmax_t. */
-#if HAVE_STDINT_H_WITH_UINTMAX
-# include <stdint.h>
-#endif
-#if HAVE_INTTYPES_H_WITH_UINTMAX
-# include <inttypes.h>
-#endif
-
-/* malloc(), realloc(), free(). */
-#include <stdlib.h>
-
-/* Checked size_t computations. */
-#include "xsize.h"
-
-#if WIDE_CHAR_VERSION
-# define PRINTF_PARSE wprintf_parse
-# define CHAR_T wchar_t
-# define DIRECTIVE wchar_t_directive
-# define DIRECTIVES wchar_t_directives
-#else
-# define PRINTF_PARSE printf_parse
-# define CHAR_T char
-# define DIRECTIVE char_directive
-# define DIRECTIVES char_directives
-#endif
-
-#ifdef STATIC
-STATIC
-#endif
-int
-PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
-{
- const CHAR_T *cp = format; /* pointer into format */
- size_t arg_posn = 0; /* number of regular arguments consumed */
- size_t d_allocated; /* allocated elements of d->dir */
- size_t a_allocated; /* allocated elements of a->arg */
- size_t max_width_length = 0;
- size_t max_precision_length = 0;
-
- d->count = 0;
- d_allocated = 1;
- d->dir = malloc (d_allocated * sizeof (DIRECTIVE));
- if (d->dir == NULL)
- /* Out of memory. */
- return -1;
-
- a->count = 0;
- a_allocated = 0;
- a->arg = NULL;
-
-#define REGISTER_ARG(_index_,_type_) \
- { \
- size_t n = (_index_); \
- if (n >= a_allocated) \
- { \
- size_t memory_size; \
- argument *memory; \
- \
- a_allocated = xtimes (a_allocated, 2); \
- if (a_allocated <= n) \
- a_allocated = xsum (n, 1); \
- memory_size = xtimes (a_allocated, sizeof (argument)); \
- if (size_overflow_p (memory_size)) \
- /* Overflow, would lead to out of memory. */ \
- goto error; \
- memory = (a->arg \
- ? realloc (a->arg, memory_size) \
- : malloc (memory_size)); \
- if (memory == NULL) \
- /* Out of memory. */ \
- goto error; \
- a->arg = memory; \
- } \
- while (a->count <= n) \
- a->arg[a->count++].type = TYPE_NONE; \
- if (a->arg[n].type == TYPE_NONE) \
- a->arg[n].type = (_type_); \
- else if (a->arg[n].type != (_type_)) \
- /* Ambiguous type for positional argument. */ \
- goto error; \
- }
-
- while (*cp != '\0')
- {
- CHAR_T c = *cp++;
- if (c == '%')
- {
- size_t arg_index = ARG_NONE;
- DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */
-
- /* Initialize the next directive. */
- dp->dir_start = cp - 1;
- dp->flags = 0;
- dp->width_start = NULL;
- dp->width_end = NULL;
- dp->width_arg_index = ARG_NONE;
- dp->precision_start = NULL;
- dp->precision_end = NULL;
- dp->precision_arg_index = ARG_NONE;
- dp->arg_index = ARG_NONE;
-
- /* Test for positional argument. */
- if (*cp >= '0' && *cp <= '9')
- {
- const CHAR_T *np;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- ;
- if (*np == '$')
- {
- size_t n = 0;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- n = xsum (xtimes (n, 10), *np - '0');
- if (n == 0)
- /* Positional argument 0. */
- goto error;
- if (size_overflow_p (n))
- /* n too large, would lead to out of memory later. */
- goto error;
- arg_index = n - 1;
- cp = np + 1;
- }
- }
-
- /* Read the flags. */
- for (;;)
- {
- if (*cp == '\'')
- {
- dp->flags |= FLAG_GROUP;
- cp++;
- }
- else if (*cp == '-')
- {
- dp->flags |= FLAG_LEFT;
- cp++;
- }
- else if (*cp == '+')
- {
- dp->flags |= FLAG_SHOWSIGN;
- cp++;
- }
- else if (*cp == ' ')
- {
- dp->flags |= FLAG_SPACE;
- cp++;
- }
- else if (*cp == '#')
- {
- dp->flags |= FLAG_ALT;
- cp++;
- }
- else if (*cp == '0')
- {
- dp->flags |= FLAG_ZERO;
- cp++;
- }
- else
- break;
- }
-
- /* Parse the field width. */
- if (*cp == '*')
- {
- dp->width_start = cp;
- cp++;
- dp->width_end = cp;
- if (max_width_length < 1)
- max_width_length = 1;
-
- /* Test for positional argument. */
- if (*cp >= '0' && *cp <= '9')
- {
- const CHAR_T *np;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- ;
- if (*np == '$')
- {
- size_t n = 0;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- n = xsum (xtimes (n, 10), *np - '0');
- if (n == 0)
- /* Positional argument 0. */
- goto error;
- if (size_overflow_p (n))
- /* n too large, would lead to out of memory later. */
- goto error;
- dp->width_arg_index = n - 1;
- cp = np + 1;
- }
- }
- if (dp->width_arg_index == ARG_NONE)
- {
- dp->width_arg_index = arg_posn++;
- if (dp->width_arg_index == ARG_NONE)
- /* arg_posn wrapped around. */
- goto error;
- }
- REGISTER_ARG (dp->width_arg_index, TYPE_INT);
- }
- else if (*cp >= '0' && *cp <= '9')
- {
- size_t width_length;
-
- dp->width_start = cp;
- for (; *cp >= '0' && *cp <= '9'; cp++)
- ;
- dp->width_end = cp;
- width_length = dp->width_end - dp->width_start;
- if (max_width_length < width_length)
- max_width_length = width_length;
- }
-
- /* Parse the precision. */
- if (*cp == '.')
- {
- cp++;
- if (*cp == '*')
- {
- dp->precision_start = cp - 1;
- cp++;
- dp->precision_end = cp;
- if (max_precision_length < 2)
- max_precision_length = 2;
-
- /* Test for positional argument. */
- if (*cp >= '0' && *cp <= '9')
- {
- const CHAR_T *np;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- ;
- if (*np == '$')
- {
- size_t n = 0;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- n = xsum (xtimes (n, 10), *np - '0');
- if (n == 0)
- /* Positional argument 0. */
- goto error;
- if (size_overflow_p (n))
- /* n too large, would lead to out of memory
- later. */
- goto error;
- dp->precision_arg_index = n - 1;
- cp = np + 1;
- }
- }
- if (dp->precision_arg_index == ARG_NONE)
- {
- dp->precision_arg_index = arg_posn++;
- if (dp->precision_arg_index == ARG_NONE)
- /* arg_posn wrapped around. */
- goto error;
- }
- REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
- }
- else
- {
- size_t precision_length;
-
- dp->precision_start = cp - 1;
- for (; *cp >= '0' && *cp <= '9'; cp++)
- ;
- dp->precision_end = cp;
- precision_length = dp->precision_end - dp->precision_start;
- if (max_precision_length < precision_length)
- max_precision_length = precision_length;
- }
- }
-
- {
- arg_type type;
-
- /* Parse argument type/size specifiers. */
- {
- int flags = 0;
-
- for (;;)
- {
- if (*cp == 'h')
- {
- flags |= (1 << (flags & 1));
- cp++;
- }
- else if (*cp == 'L')
- {
- flags |= 4;
- cp++;
- }
- else if (*cp == 'l')
- {
- flags += 8;
- cp++;
- }
-#ifdef HAVE_INTMAX_T
- else if (*cp == 'j')
- {
- if (sizeof (intmax_t) > sizeof (long))
- {
- /* intmax_t = long long */
- flags += 16;
- }
- else if (sizeof (intmax_t) > sizeof (int))
- {
- /* intmax_t = long */
- flags += 8;
- }
- cp++;
- }
-#endif
- else if (*cp == 'z' || *cp == 'Z')
- {
- /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
- because the warning facility in gcc-2.95.2 understands
- only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
- if (sizeof (size_t) > sizeof (long))
- {
- /* size_t = long long */
- flags += 16;
- }
- else if (sizeof (size_t) > sizeof (int))
- {
- /* size_t = long */
- flags += 8;
- }
- cp++;
- }
- else if (*cp == 't')
- {
- if (sizeof (ptrdiff_t) > sizeof (long))
- {
- /* ptrdiff_t = long long */
- flags += 16;
- }
- else if (sizeof (ptrdiff_t) > sizeof (int))
- {
- /* ptrdiff_t = long */
- flags += 8;
- }
- cp++;
- }
- else
- break;
- }
-
- /* Read the conversion character. */
- c = *cp++;
- switch (c)
- {
- case 'd': case 'i':
-#ifdef HAVE_LONG_LONG
- if (flags >= 16 || (flags & 4))
- type = TYPE_LONGLONGINT;
- else
-#endif
- if (flags >= 8)
- type = TYPE_LONGINT;
- else if (flags & 2)
- type = TYPE_SCHAR;
- else if (flags & 1)
- type = TYPE_SHORT;
- else
- type = TYPE_INT;
- break;
- case 'o': case 'u': case 'x': case 'X':
-#ifdef HAVE_LONG_LONG
- if (flags >= 16 || (flags & 4))
- type = TYPE_ULONGLONGINT;
- else
-#endif
- if (flags >= 8)
- type = TYPE_ULONGINT;
- else if (flags & 2)
- type = TYPE_UCHAR;
- else if (flags & 1)
- type = TYPE_USHORT;
- else
- type = TYPE_UINT;
- break;
- case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
- case 'a': case 'A':
-#ifdef HAVE_LONG_DOUBLE
- if (flags >= 16 || (flags & 4))
- type = TYPE_LONGDOUBLE;
- else
-#endif
- type = TYPE_DOUBLE;
- break;
- case 'c':
- if (flags >= 8)
-#ifdef HAVE_WINT_T
- type = TYPE_WIDE_CHAR;
-#else
- goto error;
-#endif
- else
- type = TYPE_CHAR;
- break;
-#ifdef HAVE_WINT_T
- case 'C':
- type = TYPE_WIDE_CHAR;
- c = 'c';
- break;
-#endif
- case 's':
- if (flags >= 8)
-#ifdef HAVE_WCHAR_T
- type = TYPE_WIDE_STRING;
-#else
- goto error;
-#endif
- else
- type = TYPE_STRING;
- break;
-#ifdef HAVE_WCHAR_T
- case 'S':
- type = TYPE_WIDE_STRING;
- c = 's';
- break;
-#endif
- case 'p':
- type = TYPE_POINTER;
- break;
- case 'n':
-#ifdef HAVE_LONG_LONG
- if (flags >= 16 || (flags & 4))
- type = TYPE_COUNT_LONGLONGINT_POINTER;
- else
-#endif
- if (flags >= 8)
- type = TYPE_COUNT_LONGINT_POINTER;
- else if (flags & 2)
- type = TYPE_COUNT_SCHAR_POINTER;
- else if (flags & 1)
- type = TYPE_COUNT_SHORT_POINTER;
- else
- type = TYPE_COUNT_INT_POINTER;
- break;
- case '%':
- type = TYPE_NONE;
- break;
- default:
- /* Unknown conversion character. */
- goto error;
- }
- }
-
- if (type != TYPE_NONE)
- {
- dp->arg_index = arg_index;
- if (dp->arg_index == ARG_NONE)
- {
- dp->arg_index = arg_posn++;
- if (dp->arg_index == ARG_NONE)
- /* arg_posn wrapped around. */
- goto error;
- }
- REGISTER_ARG (dp->arg_index, type);
- }
- dp->conversion = c;
- dp->dir_end = cp;
- }
-
- d->count++;
- if (d->count >= d_allocated)
- {
- size_t memory_size;
- DIRECTIVE *memory;
-
- d_allocated = xtimes (d_allocated, 2);
- memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
- if (size_overflow_p (memory_size))
- /* Overflow, would lead to out of memory. */
- goto error;
- memory = realloc (d->dir, memory_size);
- if (memory == NULL)
- /* Out of memory. */
- goto error;
- d->dir = memory;
- }
- }
- }
- d->dir[d->count].dir_start = cp;
-
- d->max_width_length = max_width_length;
- d->max_precision_length = max_precision_length;
- return 0;
-
-error:
- if (a->arg)
- free (a->arg);
- if (d->dir)
- free (d->dir);
- return -1;
-}
-
-#undef DIRECTIVES
-#undef DIRECTIVE
-#undef CHAR_T
-#undef PRINTF_PARSE
diff --git a/xbmc/screensavers/rsxs-0.9/lib/printf-parse.h b/xbmc/screensavers/rsxs-0.9/lib/printf-parse.h
deleted file mode 100644
index 82a0d37cd7..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/printf-parse.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Parse printf format string.
- Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _PRINTF_PARSE_H
-#define _PRINTF_PARSE_H
-
-#include "printf-args.h"
-
-
-/* Flags */
-#define FLAG_GROUP 1 /* ' flag */
-#define FLAG_LEFT 2 /* - flag */
-#define FLAG_SHOWSIGN 4 /* + flag */
-#define FLAG_SPACE 8 /* space flag */
-#define FLAG_ALT 16 /* # flag */
-#define FLAG_ZERO 32
-
-/* arg_index value indicating that no argument is consumed. */
-#define ARG_NONE (~(size_t)0)
-
-/* A parsed directive. */
-typedef struct
-{
- const char* dir_start;
- const char* dir_end;
- int flags;
- const char* width_start;
- const char* width_end;
- size_t width_arg_index;
- const char* precision_start;
- const char* precision_end;
- size_t precision_arg_index;
- char conversion; /* d i o u x X f e E g G c s p n U % but not C S */
- size_t arg_index;
-}
-char_directive;
-
-/* A parsed format string. */
-typedef struct
-{
- size_t count;
- char_directive *dir;
- size_t max_width_length;
- size_t max_precision_length;
-}
-char_directives;
-
-
-/* Parses the format string. Fills in the number N of directives, and fills
- in directives[0], ..., directives[N-1], and sets directives[N].dir_start
- to the end of the format string. Also fills in the arg_type fields of the
- arguments and the needed count of arguments. */
-#ifdef STATIC
-STATIC
-#else
-extern
-#endif
-int printf_parse (const char *format, char_directives *d, arguments *a);
-
-#endif /* _PRINTF_PARSE_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/size_max.h b/xbmc/screensavers/rsxs-0.9/lib/size_max.h
deleted file mode 100644
index ed0bc13771..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/size_max.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* size_max.h -- declare SIZE_MAX through system headers
- Copyright (C) 2005-2006 Free Software Foundation, Inc.
- Written by Simon Josefsson.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef GNULIB_SIZE_MAX_H
-#define GNULIB_SIZE_MAX_H
-
-/* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */
-# include <limits.h>
-/* Get SIZE_MAX declaration on systems like glibc 2. */
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
-/* On systems where these include files don't define it, SIZE_MAX is defined
- in config.h. */
-
-#endif /* GNULIB_SIZE_MAX_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/stdbool_.h b/xbmc/screensavers/rsxs-0.9/lib/stdbool_.h
deleted file mode 100644
index a95151028b..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/stdbool_.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (C) 1998-2015 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-/*
- * ISO C Standard: 7.16 Boolean type and values <stdbool.h>
- */
-
-#ifndef _STDBOOL_H
-#define _STDBOOL_H
-
-#ifndef __cplusplus
-
-#define bool _Bool
-#define true 1
-#define false 0
-
-#else /* __cplusplus */
-
-/* Supporting _Bool in C++ is a GCC extension. */
-#define _Bool bool
-
-#if __cplusplus < 201103L
-/* Defining these macros in C++98 is a GCC extension. */
-#define bool bool
-#define false false
-#define true true
-#endif
-
-#endif /* __cplusplus */
-
-/* Signal that all the definitions are present. */
-#define __bool_true_false_are_defined 1
-
-#endif /* stdbool.h */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/strcase.h b/xbmc/screensavers/rsxs-0.9/lib/strcase.h
deleted file mode 100644
index e420798058..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/strcase.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Case-insensitive string comparison functions.
- Copyright (C) 1995-1996, 2001, 2003, 2005 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _STRCASE_H
-#define _STRCASE_H
-
-#include <stddef.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
- greater than zero if S1 is lexicographically less than, equal to or greater
- than S2.
- Note: This function may, in multibyte locales, return 0 for strings of
- different lengths! */
-extern int strcasecmp (const char *s1, const char *s2);
-
-/* Compare no more than N characters of strings S1 and S2, ignoring case,
- returning less than, equal to or greater than zero if S1 is
- lexicographically less than, equal to or greater than S2.
- Note: This function can not work correctly in multibyte locales. */
-extern int strncasecmp (const char *s1, const char *s2, size_t n);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* _STRCASE_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/strcasecmp.c b/xbmc/screensavers/rsxs-0.9/lib/strcasecmp.c
deleted file mode 100644
index c1bac0a5af..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/strcasecmp.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Case-insensitive string comparison function.
- Copyright (C) 1998, 1999, 2005 Free Software Foundation, Inc.
- Written by Bruno Haible <bruno@clisp.org>, 2005,
- based on earlier glibc code.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification. */
-#include "strcase.h"
-
-#include <ctype.h>
-#include <limits.h>
-
-#if HAVE_MBRTOWC
-# include "mbuiter.h"
-#endif
-
-#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
-
-/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
- greater than zero if S1 is lexicographically less than, equal to or greater
- than S2.
- Note: This function may, in multibyte locales, return 0 for strings of
- different lengths! */
-int
-strcasecmp (const char *s1, const char *s2)
-{
- if (s1 == s2)
- return 0;
-
- /* Be careful not to look at the entire extent of s1 or s2 until needed.
- This is useful because when two strings differ, the difference is
- most often already in the very few first characters. */
-#if HAVE_MBRTOWC
- if (MB_CUR_MAX > 1)
- {
- mbui_iterator_t iter1;
- mbui_iterator_t iter2;
-
- mbui_init (iter1, s1);
- mbui_init (iter2, s2);
-
- while (mbui_avail (iter1) && mbui_avail (iter2))
- {
- int cmp = mb_casecmp (mbui_cur (iter1), mbui_cur (iter2));
-
- if (cmp != 0)
- return cmp;
-
- mbui_advance (iter1);
- mbui_advance (iter2);
- }
- if (mbui_avail (iter1))
- /* s2 terminated before s1. */
- return 1;
- if (mbui_avail (iter2))
- /* s1 terminated before s2. */
- return -1;
- return 0;
- }
- else
-#endif
- {
- const unsigned char *p1 = (const unsigned char *) s1;
- const unsigned char *p2 = (const unsigned char *) s2;
- unsigned char c1, c2;
-
- do
- {
- c1 = TOLOWER (*p1);
- c2 = TOLOWER (*p2);
-
- if (c1 == '\0')
- break;
-
- ++p1;
- ++p2;
- }
- while (c1 == c2);
-
- if (UCHAR_MAX <= INT_MAX)
- return c1 - c2;
- else
- /* On machines where 'char' and 'int' are types of the same size, the
- difference of two 'unsigned char' values - including the sign bit -
- doesn't fit in an 'int'. */
- return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
- }
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/strchrnul.c b/xbmc/screensavers/rsxs-0.9/lib/strchrnul.c
deleted file mode 100644
index 8d17f15909..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/strchrnul.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Searching in a string.
- Copyright (C) 2003 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Specification. */
-#include "strchrnul.h"
-
-/* Find the first occurrence of C in S or the final NUL byte. */
-char *
-strchrnul (const char *s, int c_in)
-{
- char c = c_in;
- while (*s && (*s != c))
- s++;
-
- return (char *) s;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/strchrnul.h b/xbmc/screensavers/rsxs-0.9/lib/strchrnul.h
deleted file mode 100644
index 5a31b96757..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/strchrnul.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Searching in a string.
- Copyright (C) 2003 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#if HAVE_STRCHRNUL
-
-/* Get strchrnul() declaration. */
-#include <string.h>
-
-#else
-
-/* Find the first occurrence of C in S or the final NUL byte. */
-extern char *strchrnul (const char *s, int c_in);
-
-#endif
diff --git a/xbmc/screensavers/rsxs-0.9/lib/stripslash.c b/xbmc/screensavers/rsxs-0.9/lib/stripslash.c
deleted file mode 100644
index 4ba5dadbe8..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/stripslash.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* stripslash.c -- remove redundant trailing slashes from a file name
-
- Copyright (C) 1990, 2001, 2003-2006 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "dirname.h"
-
-/* Remove trailing slashes from FILE. Return true if a trailing slash
- was removed. This is useful when using file name completion from a
- shell that adds a "/" after directory names (such as tcsh and
- bash), because on symlinks to directories, several system calls
- have different semantics according to whether a trailing slash is
- present. */
-
-bool
-strip_trailing_slashes (char *file)
-{
- char *base = last_component (file);
- char *base_lim;
- bool had_slash;
-
- /* last_component returns "" for file system roots, but we need to turn
- `///' into `/'. */
- if (! *base)
- base = file;
- base_lim = base + base_len (base);
- had_slash = (*base_lim != '\0');
- *base_lim = '\0';
- return had_slash;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/strncasecmp.c b/xbmc/screensavers/rsxs-0.9/lib/strncasecmp.c
deleted file mode 100644
index 0209c39ea0..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/strncasecmp.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* strncasecmp.c -- case insensitive string comparator
- Copyright (C) 1998, 1999, 2005 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification. */
-#include "strcase.h"
-
-#include <ctype.h>
-#include <limits.h>
-
-#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
-
-/* Compare no more than N bytes of strings S1 and S2,
- ignoring case, returning less than, equal to or
- greater than zero if S1 is lexicographically less
- than, equal to or greater than S2. */
-
-int
-strncasecmp (const char *s1, const char *s2, size_t n)
-{
- register const unsigned char *p1 = (const unsigned char *) s1;
- register const unsigned char *p2 = (const unsigned char *) s2;
- unsigned char c1, c2;
-
- if (p1 == p2 || n == 0)
- return 0;
-
- do
- {
- c1 = TOLOWER (*p1);
- c2 = TOLOWER (*p2);
-
- if (--n == 0 || c1 == '\0')
- break;
-
- ++p1;
- ++p2;
- }
- while (c1 == c2);
-
- if (UCHAR_MAX <= INT_MAX)
- return c1 - c2;
- else
- /* On machines where 'char' and 'int' are types of the same size, the
- difference of two 'unsigned char' values - including the sign bit -
- doesn't fit in an 'int'. */
- return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/strndup.c b/xbmc/screensavers/rsxs-0.9/lib/strndup.c
deleted file mode 100644
index 2626373f26..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/strndup.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2005, 2006 Free
- Software Foundation, Inc.
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-#if !_LIBC
-# include "strndup.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#if !_LIBC
-# include "strnlen.h"
-# ifndef __strnlen
-# define __strnlen strnlen
-# endif
-#endif
-
-#undef __strndup
-#if _LIBC
-# undef strndup
-#endif
-
-#ifndef weak_alias
-# define __strndup strndup
-#endif
-
-char *
-__strndup (s, n)
- const char *s;
- size_t n;
-{
- size_t len = __strnlen (s, n);
- char *new = malloc (len + 1);
-
- if (new == NULL)
- return NULL;
-
- new[len] = '\0';
- return memcpy (new, s, len);
-}
-#ifdef libc_hidden_def
-libc_hidden_def (__strndup)
-#endif
-#ifdef weak_alias
-weak_alias (__strndup, strndup)
-#endif
diff --git a/xbmc/screensavers/rsxs-0.9/lib/strndup.h b/xbmc/screensavers/rsxs-0.9/lib/strndup.h
deleted file mode 100644
index 8eae493adc..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/strndup.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Duplicate a size-bounded string.
- Copyright (C) 2003 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#if HAVE_STRNDUP
-
-/* Get strndup() declaration. */
-#include <string.h>
-
-#else
-
-#include <stddef.h>
-
-/* Return a newly allocated copy of at most N bytes of STRING. */
-extern char *strndup (const char *string, size_t n);
-
-#endif
diff --git a/xbmc/screensavers/rsxs-0.9/lib/strnlen.c b/xbmc/screensavers/rsxs-0.9/lib/strnlen.c
deleted file mode 100644
index 09ba788ab0..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/strnlen.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Find the length of STRING, but scan at most MAXLEN characters.
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
- Written by Simon Josefsson.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "strnlen.h"
-
-/* Find the length of STRING, but scan at most MAXLEN characters.
- If no '\0' terminator is found in that many characters, return MAXLEN. */
-
-size_t
-strnlen (const char *string, size_t maxlen)
-{
- const char *end = memchr (string, '\0', maxlen);
- return end ? (size_t) (end - string) : maxlen;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/strnlen.h b/xbmc/screensavers/rsxs-0.9/lib/strnlen.h
deleted file mode 100644
index ba74dba7b2..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/strnlen.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Find the length of STRING, but scan at most MAXLEN characters.
- Copyright (C) 2005 Free Software Foundation, Inc.
- Written by Simon Josefsson.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef STRNLEN_H
-#define STRNLEN_H
-
-/* Get strnlen declaration, if available. */
-#include <string.h>
-
-#if defined HAVE_DECL_STRNLEN && !HAVE_DECL_STRNLEN
-/* Find the length (number of bytes) of STRING, but scan at most
- MAXLEN bytes. If no '\0' terminator is found in that many bytes,
- return MAXLEN. */
-extern size_t strnlen(const char *string, size_t maxlen);
-#endif
-
-#endif /* STRNLEN_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/strnlen1.c b/xbmc/screensavers/rsxs-0.9/lib/strnlen1.c
deleted file mode 100644
index f3338e7cf4..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/strnlen1.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
- Copyright (C) 2005 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU Library General Public License as published
- by the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification. */
-#include "strnlen1.h"
-
-#include <string.h>
-
-/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
- If no '\0' terminator is found in that many characters, return MAXLEN. */
-/* This is the same as strnlen (string, maxlen - 1) + 1. */
-size_t
-strnlen1 (const char *string, size_t maxlen)
-{
- const char *end = memchr (string, '\0', maxlen);
- if (end != NULL)
- return end - string + 1;
- else
- return maxlen;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/strnlen1.h b/xbmc/screensavers/rsxs-0.9/lib/strnlen1.h
deleted file mode 100644
index 4f913ffe8f..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/strnlen1.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
- Copyright (C) 2005 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU Library General Public License as published
- by the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA. */
-
-#ifndef _STRNLEN1_H
-#define _STRNLEN1_H
-
-#include <stddef.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
- If no '\0' terminator is found in that many characters, return MAXLEN. */
-/* This is the same as strnlen (string, maxlen - 1) + 1. */
-extern size_t strnlen1 (const char *string, size_t maxlen);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* _STRNLEN1_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/sysexit_.h b/xbmc/screensavers/rsxs-0.9/lib/sysexit_.h
deleted file mode 100644
index e5195155b7..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/sysexit_.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* exit() exit codes for some BSD system programs.
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Written by Simon Josefsson based on sysexits(3) man page */
-
-#ifndef _SYSEXITS_H
-#define _SYSEXITS_H
-
-#define EX_OK 0 /* same value as EXIT_SUCCESS */
-
-#define EX_USAGE 64
-#define EX_DATAERR 65
-#define EX_NOINPUT 66
-#define EX_NOUSER 67
-#define EX_NOHOST 68
-#define EX_UNAVAILABLE 69
-#define EX_SOFTWARE 70
-#define EX_OSERR 71
-#define EX_OSFILE 72
-#define EX_CANTCREAT 73
-#define EX_IOERR 74
-#define EX_TEMPFAIL 75
-#define EX_PROTOCOL 76
-#define EX_NOPERM 77
-#define EX_CONFIG 78
-
-#endif /* _SYSEXITS_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/vasnprintf.c b/xbmc/screensavers/rsxs-0.9/lib/vasnprintf.c
deleted file mode 100644
index 3b496d2539..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/vasnprintf.c
+++ /dev/null
@@ -1,903 +0,0 @@
-/* vsprintf with automatic memory allocation.
- Copyright (C) 1999, 2002-2006 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
- This must come before <config.h> because <config.h> may include
- <features.h>, and once <features.h> has been included, it's too late. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-#ifndef IN_LIBINTL
-# include <alloca.h>
-#endif
-
-/* Specification. */
-#if WIDE_CHAR_VERSION
-# include "vasnwprintf.h"
-#else
-# include "vasnprintf.h"
-#endif
-
-#include <stdio.h> /* snprintf(), sprintf() */
-#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
-#include <string.h> /* memcpy(), strlen() */
-#include <errno.h> /* errno */
-#include <limits.h> /* CHAR_BIT, INT_MAX */
-#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
-#if WIDE_CHAR_VERSION
-# include "wprintf-parse.h"
-#else
-# include "printf-parse.h"
-#endif
-
-/* Checked size_t computations. */
-#include "xsize.h"
-
-/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
-#ifndef EOVERFLOW
-# define EOVERFLOW E2BIG
-#endif
-
-#ifdef HAVE_WCHAR_T
-# ifdef HAVE_WCSLEN
-# define local_wcslen wcslen
-# else
- /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
- a dependency towards this library, here is a local substitute.
- Define this substitute only once, even if this file is included
- twice in the same compilation unit. */
-# ifndef local_wcslen_defined
-# define local_wcslen_defined 1
-static size_t
-local_wcslen (const wchar_t *s)
-{
- const wchar_t *ptr;
-
- for (ptr = s; *ptr != (wchar_t) 0; ptr++)
- ;
- return ptr - s;
-}
-# endif
-# endif
-#endif
-
-#if WIDE_CHAR_VERSION
-# define VASNPRINTF vasnwprintf
-# define CHAR_T wchar_t
-# define DIRECTIVE wchar_t_directive
-# define DIRECTIVES wchar_t_directives
-# define PRINTF_PARSE wprintf_parse
-# define USE_SNPRINTF 1
-# if HAVE_DECL__SNWPRINTF
- /* On Windows, the function swprintf() has a different signature than
- on Unix; we use the _snwprintf() function instead. */
-# define SNPRINTF _snwprintf
-# else
- /* Unix. */
-# define SNPRINTF swprintf
-# endif
-#else
-# define VASNPRINTF vasnprintf
-# define CHAR_T char
-# define DIRECTIVE char_directive
-# define DIRECTIVES char_directives
-# define PRINTF_PARSE printf_parse
-# define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF)
-# if HAVE_DECL__SNPRINTF
- /* Windows. */
-# define SNPRINTF _snprintf
-# else
- /* Unix. */
-# define SNPRINTF snprintf
-# endif
-#endif
-
-CHAR_T *
-VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args)
-{
- DIRECTIVES d;
- arguments a;
-
- if (PRINTF_PARSE (format, &d, &a) < 0)
- {
- errno = EINVAL;
- return NULL;
- }
-
-#define CLEANUP() \
- free (d.dir); \
- if (a.arg) \
- free (a.arg);
-
- if (printf_fetchargs (args, &a) < 0)
- {
- CLEANUP ();
- errno = EINVAL;
- return NULL;
- }
-
- {
- size_t buf_neededlength;
- CHAR_T *buf;
- CHAR_T *buf_malloced;
- const CHAR_T *cp;
- size_t i;
- DIRECTIVE *dp;
- /* Output string accumulator. */
- CHAR_T *result;
- size_t allocated;
- size_t length;
-
- /* Allocate a small buffer that will hold a directive passed to
- sprintf or snprintf. */
- buf_neededlength =
- xsum4 (7, d.max_width_length, d.max_precision_length, 6);
-#if HAVE_ALLOCA
- if (buf_neededlength < 4000 / sizeof (CHAR_T))
- {
- buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T));
- buf_malloced = NULL;
- }
- else
-#endif
- {
- size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T));
- if (size_overflow_p (buf_memsize))
- goto out_of_memory_1;
- buf = (CHAR_T *) malloc (buf_memsize);
- if (buf == NULL)
- goto out_of_memory_1;
- buf_malloced = buf;
- }
-
- if (resultbuf != NULL)
- {
- result = resultbuf;
- allocated = *lengthp;
- }
- else
- {
- result = NULL;
- allocated = 0;
- }
- length = 0;
- /* Invariants:
- result is either == resultbuf or == NULL or malloc-allocated.
- If length > 0, then result != NULL. */
-
- /* Ensures that allocated >= needed. Aborts through a jump to
- out_of_memory if needed is SIZE_MAX or otherwise too big. */
-#define ENSURE_ALLOCATION(needed) \
- if ((needed) > allocated) \
- { \
- size_t memory_size; \
- CHAR_T *memory; \
- \
- allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \
- if ((needed) > allocated) \
- allocated = (needed); \
- memory_size = xtimes (allocated, sizeof (CHAR_T)); \
- if (size_overflow_p (memory_size)) \
- goto out_of_memory; \
- if (result == resultbuf || result == NULL) \
- memory = (CHAR_T *) malloc (memory_size); \
- else \
- memory = (CHAR_T *) realloc (result, memory_size); \
- if (memory == NULL) \
- goto out_of_memory; \
- if (result == resultbuf && length > 0) \
- memcpy (memory, result, length * sizeof (CHAR_T)); \
- result = memory; \
- }
-
- for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
- {
- if (cp != dp->dir_start)
- {
- size_t n = dp->dir_start - cp;
- size_t augmented_length = xsum (length, n);
-
- ENSURE_ALLOCATION (augmented_length);
- memcpy (result + length, cp, n * sizeof (CHAR_T));
- length = augmented_length;
- }
- if (i == d.count)
- break;
-
- /* Execute a single directive. */
- if (dp->conversion == '%')
- {
- size_t augmented_length;
-
- if (!(dp->arg_index == ARG_NONE))
- abort ();
- augmented_length = xsum (length, 1);
- ENSURE_ALLOCATION (augmented_length);
- result[length] = '%';
- length = augmented_length;
- }
- else
- {
- if (!(dp->arg_index != ARG_NONE))
- abort ();
-
- if (dp->conversion == 'n')
- {
- switch (a.arg[dp->arg_index].type)
- {
- case TYPE_COUNT_SCHAR_POINTER:
- *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
- break;
- case TYPE_COUNT_SHORT_POINTER:
- *a.arg[dp->arg_index].a.a_count_short_pointer = length;
- break;
- case TYPE_COUNT_INT_POINTER:
- *a.arg[dp->arg_index].a.a_count_int_pointer = length;
- break;
- case TYPE_COUNT_LONGINT_POINTER:
- *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
- break;
-#ifdef HAVE_LONG_LONG
- case TYPE_COUNT_LONGLONGINT_POINTER:
- *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
- break;
-#endif
- default:
- abort ();
- }
- }
- else
- {
- arg_type type = a.arg[dp->arg_index].type;
- CHAR_T *p;
- unsigned int prefix_count;
- int prefixes[2];
-#if !USE_SNPRINTF
- size_t tmp_length;
- CHAR_T tmpbuf[700];
- CHAR_T *tmp;
-
- /* Allocate a temporary buffer of sufficient size for calling
- sprintf. */
- {
- size_t width;
- size_t precision;
-
- width = 0;
- if (dp->width_start != dp->width_end)
- {
- if (dp->width_arg_index != ARG_NONE)
- {
- int arg;
-
- if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
- abort ();
- arg = a.arg[dp->width_arg_index].a.a_int;
- width = (arg < 0 ? (unsigned int) (-arg) : arg);
- }
- else
- {
- const CHAR_T *digitp = dp->width_start;
-
- do
- width = xsum (xtimes (width, 10), *digitp++ - '0');
- while (digitp != dp->width_end);
- }
- }
-
- precision = 6;
- if (dp->precision_start != dp->precision_end)
- {
- if (dp->precision_arg_index != ARG_NONE)
- {
- int arg;
-
- if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
- abort ();
- arg = a.arg[dp->precision_arg_index].a.a_int;
- precision = (arg < 0 ? 0 : arg);
- }
- else
- {
- const CHAR_T *digitp = dp->precision_start + 1;
-
- precision = 0;
- while (digitp != dp->precision_end)
- precision = xsum (xtimes (precision, 10), *digitp++ - '0');
- }
- }
-
- switch (dp->conversion)
- {
-
- case 'd': case 'i': case 'u':
-# ifdef HAVE_LONG_LONG
- if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
- * 0.30103 /* binary -> decimal */
- )
- + 1; /* turn floor into ceil */
- else
-# endif
- if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long) * CHAR_BIT
- * 0.30103 /* binary -> decimal */
- )
- + 1; /* turn floor into ceil */
- else
- tmp_length =
- (unsigned int) (sizeof (unsigned int) * CHAR_BIT
- * 0.30103 /* binary -> decimal */
- )
- + 1; /* turn floor into ceil */
- if (tmp_length < precision)
- tmp_length = precision;
- /* Multiply by 2, as an estimate for FLAG_GROUP. */
- tmp_length = xsum (tmp_length, tmp_length);
- /* Add 1, to account for a leading sign. */
- tmp_length = xsum (tmp_length, 1);
- break;
-
- case 'o':
-# ifdef HAVE_LONG_LONG
- if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
- * 0.333334 /* binary -> octal */
- )
- + 1; /* turn floor into ceil */
- else
-# endif
- if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long) * CHAR_BIT
- * 0.333334 /* binary -> octal */
- )
- + 1; /* turn floor into ceil */
- else
- tmp_length =
- (unsigned int) (sizeof (unsigned int) * CHAR_BIT
- * 0.333334 /* binary -> octal */
- )
- + 1; /* turn floor into ceil */
- if (tmp_length < precision)
- tmp_length = precision;
- /* Add 1, to account for a leading sign. */
- tmp_length = xsum (tmp_length, 1);
- break;
-
- case 'x': case 'X':
-# ifdef HAVE_LONG_LONG
- if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
- * 0.25 /* binary -> hexadecimal */
- )
- + 1; /* turn floor into ceil */
- else
-# endif
- if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long) * CHAR_BIT
- * 0.25 /* binary -> hexadecimal */
- )
- + 1; /* turn floor into ceil */
- else
- tmp_length =
- (unsigned int) (sizeof (unsigned int) * CHAR_BIT
- * 0.25 /* binary -> hexadecimal */
- )
- + 1; /* turn floor into ceil */
- if (tmp_length < precision)
- tmp_length = precision;
- /* Add 2, to account for a leading sign or alternate form. */
- tmp_length = xsum (tmp_length, 2);
- break;
-
- case 'f': case 'F':
-# ifdef HAVE_LONG_DOUBLE
- if (type == TYPE_LONGDOUBLE)
- tmp_length =
- (unsigned int) (LDBL_MAX_EXP
- * 0.30103 /* binary -> decimal */
- * 2 /* estimate for FLAG_GROUP */
- )
- + 1 /* turn floor into ceil */
- + 10; /* sign, decimal point etc. */
- else
-# endif
- tmp_length =
- (unsigned int) (DBL_MAX_EXP
- * 0.30103 /* binary -> decimal */
- * 2 /* estimate for FLAG_GROUP */
- )
- + 1 /* turn floor into ceil */
- + 10; /* sign, decimal point etc. */
- tmp_length = xsum (tmp_length, precision);
- break;
-
- case 'e': case 'E': case 'g': case 'G':
- case 'a': case 'A':
- tmp_length =
- 12; /* sign, decimal point, exponent etc. */
- tmp_length = xsum (tmp_length, precision);
- break;
-
- case 'c':
-# if defined HAVE_WINT_T && !WIDE_CHAR_VERSION
- if (type == TYPE_WIDE_CHAR)
- tmp_length = MB_CUR_MAX;
- else
-# endif
- tmp_length = 1;
- break;
-
- case 's':
-# ifdef HAVE_WCHAR_T
- if (type == TYPE_WIDE_STRING)
- {
- tmp_length =
- local_wcslen (a.arg[dp->arg_index].a.a_wide_string);
-
-# if !WIDE_CHAR_VERSION
- tmp_length = xtimes (tmp_length, MB_CUR_MAX);
-# endif
- }
- else
-# endif
- tmp_length = strlen (a.arg[dp->arg_index].a.a_string);
- break;
-
- case 'p':
- tmp_length =
- (unsigned int) (sizeof (void *) * CHAR_BIT
- * 0.25 /* binary -> hexadecimal */
- )
- + 1 /* turn floor into ceil */
- + 2; /* account for leading 0x */
- break;
-
- default:
- abort ();
- }
-
- if (tmp_length < width)
- tmp_length = width;
-
- tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
- }
-
- if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T))
- tmp = tmpbuf;
- else
- {
- size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T));
-
- if (size_overflow_p (tmp_memsize))
- /* Overflow, would lead to out of memory. */
- goto out_of_memory;
- tmp = (CHAR_T *) malloc (tmp_memsize);
- if (tmp == NULL)
- /* Out of memory. */
- goto out_of_memory;
- }
-#endif
-
- /* Construct the format string for calling snprintf or
- sprintf. */
- p = buf;
- *p++ = '%';
- if (dp->flags & FLAG_GROUP)
- *p++ = '\'';
- if (dp->flags & FLAG_LEFT)
- *p++ = '-';
- if (dp->flags & FLAG_SHOWSIGN)
- *p++ = '+';
- if (dp->flags & FLAG_SPACE)
- *p++ = ' ';
- if (dp->flags & FLAG_ALT)
- *p++ = '#';
- if (dp->flags & FLAG_ZERO)
- *p++ = '0';
- if (dp->width_start != dp->width_end)
- {
- size_t n = dp->width_end - dp->width_start;
- memcpy (p, dp->width_start, n * sizeof (CHAR_T));
- p += n;
- }
- if (dp->precision_start != dp->precision_end)
- {
- size_t n = dp->precision_end - dp->precision_start;
- memcpy (p, dp->precision_start, n * sizeof (CHAR_T));
- p += n;
- }
-
- switch (type)
- {
-#ifdef HAVE_LONG_LONG
- case TYPE_LONGLONGINT:
- case TYPE_ULONGLONGINT:
- *p++ = 'l';
- /*FALLTHROUGH*/
-#endif
- case TYPE_LONGINT:
- case TYPE_ULONGINT:
-#ifdef HAVE_WINT_T
- case TYPE_WIDE_CHAR:
-#endif
-#ifdef HAVE_WCHAR_T
- case TYPE_WIDE_STRING:
-#endif
- *p++ = 'l';
- break;
-#ifdef HAVE_LONG_DOUBLE
- case TYPE_LONGDOUBLE:
- *p++ = 'L';
- break;
-#endif
- default:
- break;
- }
- *p = dp->conversion;
-#if USE_SNPRINTF
- p[1] = '%';
- p[2] = 'n';
- p[3] = '\0';
-#else
- p[1] = '\0';
-#endif
-
- /* Construct the arguments for calling snprintf or sprintf. */
- prefix_count = 0;
- if (dp->width_arg_index != ARG_NONE)
- {
- if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
- abort ();
- prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
- }
- if (dp->precision_arg_index != ARG_NONE)
- {
- if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
- abort ();
- prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
- }
-
-#if USE_SNPRINTF
- /* Prepare checking whether snprintf returns the count
- via %n. */
- ENSURE_ALLOCATION (xsum (length, 1));
- result[length] = '\0';
-#endif
-
- for (;;)
- {
- size_t maxlen;
- int count;
- int retcount;
-
- maxlen = allocated - length;
- count = -1;
- retcount = 0;
-
-#if USE_SNPRINTF
-# define SNPRINTF_BUF(arg) \
- switch (prefix_count) \
- { \
- case 0: \
- retcount = SNPRINTF (result + length, maxlen, buf, \
- arg, &count); \
- break; \
- case 1: \
- retcount = SNPRINTF (result + length, maxlen, buf, \
- prefixes[0], arg, &count); \
- break; \
- case 2: \
- retcount = SNPRINTF (result + length, maxlen, buf, \
- prefixes[0], prefixes[1], arg, \
- &count); \
- break; \
- default: \
- abort (); \
- }
-#else
-# define SNPRINTF_BUF(arg) \
- switch (prefix_count) \
- { \
- case 0: \
- count = sprintf (tmp, buf, arg); \
- break; \
- case 1: \
- count = sprintf (tmp, buf, prefixes[0], arg); \
- break; \
- case 2: \
- count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
- arg); \
- break; \
- default: \
- abort (); \
- }
-#endif
-
- switch (type)
- {
- case TYPE_SCHAR:
- {
- int arg = a.arg[dp->arg_index].a.a_schar;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_UCHAR:
- {
- unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_SHORT:
- {
- int arg = a.arg[dp->arg_index].a.a_short;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_USHORT:
- {
- unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_INT:
- {
- int arg = a.arg[dp->arg_index].a.a_int;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_UINT:
- {
- unsigned int arg = a.arg[dp->arg_index].a.a_uint;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_LONGINT:
- {
- long int arg = a.arg[dp->arg_index].a.a_longint;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_ULONGINT:
- {
- unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
- SNPRINTF_BUF (arg);
- }
- break;
-#ifdef HAVE_LONG_LONG
- case TYPE_LONGLONGINT:
- {
- long long int arg = a.arg[dp->arg_index].a.a_longlongint;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_ULONGLONGINT:
- {
- unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
- SNPRINTF_BUF (arg);
- }
- break;
-#endif
- case TYPE_DOUBLE:
- {
- double arg = a.arg[dp->arg_index].a.a_double;
- SNPRINTF_BUF (arg);
- }
- break;
-#ifdef HAVE_LONG_DOUBLE
- case TYPE_LONGDOUBLE:
- {
- long double arg = a.arg[dp->arg_index].a.a_longdouble;
- SNPRINTF_BUF (arg);
- }
- break;
-#endif
- case TYPE_CHAR:
- {
- int arg = a.arg[dp->arg_index].a.a_char;
- SNPRINTF_BUF (arg);
- }
- break;
-#ifdef HAVE_WINT_T
- case TYPE_WIDE_CHAR:
- {
- wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
- SNPRINTF_BUF (arg);
- }
- break;
-#endif
- case TYPE_STRING:
- {
- const char *arg = a.arg[dp->arg_index].a.a_string;
- SNPRINTF_BUF (arg);
- }
- break;
-#ifdef HAVE_WCHAR_T
- case TYPE_WIDE_STRING:
- {
- const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
- SNPRINTF_BUF (arg);
- }
- break;
-#endif
- case TYPE_POINTER:
- {
- void *arg = a.arg[dp->arg_index].a.a_pointer;
- SNPRINTF_BUF (arg);
- }
- break;
- default:
- abort ();
- }
-
-#if USE_SNPRINTF
- /* Portability: Not all implementations of snprintf()
- are ISO C 99 compliant. Determine the number of
- bytes that snprintf() has produced or would have
- produced. */
- if (count >= 0)
- {
- /* Verify that snprintf() has NUL-terminated its
- result. */
- if (count < maxlen && result[length + count] != '\0')
- abort ();
- /* Portability hack. */
- if (retcount > count)
- count = retcount;
- }
- else
- {
- /* snprintf() doesn't understand the '%n'
- directive. */
- if (p[1] != '\0')
- {
- /* Don't use the '%n' directive; instead, look
- at the snprintf() return value. */
- p[1] = '\0';
- continue;
- }
- else
- {
- /* Look at the snprintf() return value. */
- if (retcount < 0)
- {
- /* HP-UX 10.20 snprintf() is doubly deficient:
- It doesn't understand the '%n' directive,
- *and* it returns -1 (rather than the length
- that would have been required) when the
- buffer is too small. */
- size_t bigger_need =
- xsum (xtimes (allocated, 2), 12);
- ENSURE_ALLOCATION (bigger_need);
- continue;
- }
- else
- count = retcount;
- }
- }
-#endif
-
- /* Attempt to handle failure. */
- if (count < 0)
- {
- if (!(result == resultbuf || result == NULL))
- free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
- CLEANUP ();
- errno = EINVAL;
- return NULL;
- }
-
-#if !USE_SNPRINTF
- if (count >= tmp_length)
- /* tmp_length was incorrectly calculated - fix the
- code above! */
- abort ();
-#endif
-
- /* Make room for the result. */
- if (count >= maxlen)
- {
- /* Need at least count bytes. But allocate
- proportionally, to avoid looping eternally if
- snprintf() reports a too small count. */
- size_t n =
- xmax (xsum (length, count), xtimes (allocated, 2));
-
- ENSURE_ALLOCATION (n);
-#if USE_SNPRINTF
- continue;
-#endif
- }
-
-#if USE_SNPRINTF
- /* The snprintf() result did fit. */
-#else
- /* Append the sprintf() result. */
- memcpy (result + length, tmp, count * sizeof (CHAR_T));
- if (tmp != tmpbuf)
- free (tmp);
-#endif
-
- length += count;
- break;
- }
- }
- }
- }
-
- /* Add the final NUL. */
- ENSURE_ALLOCATION (xsum (length, 1));
- result[length] = '\0';
-
- if (result != resultbuf && length + 1 < allocated)
- {
- /* Shrink the allocated memory if possible. */
- CHAR_T *memory;
-
- memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T));
- if (memory != NULL)
- result = memory;
- }
-
- if (buf_malloced != NULL)
- free (buf_malloced);
- CLEANUP ();
- *lengthp = length;
- if (length > INT_MAX)
- goto length_overflow;
- return result;
-
- length_overflow:
- /* We could produce such a big string, but its length doesn't fit into
- an 'int'. POSIX says that snprintf() fails with errno = EOVERFLOW in
- this case. */
- if (result != resultbuf)
- free (result);
- errno = EOVERFLOW;
- return NULL;
-
- out_of_memory:
- if (!(result == resultbuf || result == NULL))
- free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
- out_of_memory_1:
- CLEANUP ();
- errno = ENOMEM;
- return NULL;
- }
-}
-
-#undef SNPRINTF
-#undef USE_SNPRINTF
-#undef PRINTF_PARSE
-#undef DIRECTIVES
-#undef DIRECTIVE
-#undef CHAR_T
-#undef VASNPRINTF
diff --git a/xbmc/screensavers/rsxs-0.9/lib/vasnprintf.h b/xbmc/screensavers/rsxs-0.9/lib/vasnprintf.h
deleted file mode 100644
index 894008caec..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/vasnprintf.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* vsprintf with automatic memory allocation.
- Copyright (C) 2002-2004 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _VASNPRINTF_H
-#define _VASNPRINTF_H
-
-/* Get va_list. */
-#include <stdarg.h>
-
-/* Get size_t. */
-#include <stddef.h>
-
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
-# define __attribute__(Spec) /* empty */
-# endif
-/* The __-protected variants of `format' and `printf' attributes
- are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-# define __format__ format
-# define __printf__ printf
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Write formatted output to a string dynamically allocated with malloc().
- You can pass a preallocated buffer for the result in RESULTBUF and its
- size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
- If successful, return the address of the string (this may be = RESULTBUF
- if no dynamic memory allocation was necessary) and set *LENGTHP to the
- number of resulting bytes, excluding the trailing NUL. Upon error, set
- errno and return NULL.
-
- When dynamic memory allocation occurs, the preallocated buffer is left
- alone (with possibly modified contents). This makes it possible to use
- a statically allocated or stack-allocated buffer, like this:
-
- char buf[100];
- size_t len = sizeof (buf);
- char *output = vasnprintf (buf, &len, format, args);
- if (output == NULL)
- ... error handling ...;
- else
- {
- ... use the output string ...;
- if (output != buf)
- free (output);
- }
- */
-extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 3, 4)));
-extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 3, 0)));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _VASNPRINTF_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/vsnprintf.c b/xbmc/screensavers/rsxs-0.9/lib/vsnprintf.c
deleted file mode 100644
index 827397bff5..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/vsnprintf.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Formatted output to strings.
- Copyright (C) 2004 Free Software Foundation, Inc.
- Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification. */
-#include "vsnprintf.h"
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "vasnprintf.h"
-
-/* Print formatted output to string STR. Similar to vsprintf, but
- additional length SIZE limit how much is written into STR. Returns
- string length of formatted string (which may be larger than SIZE).
- STR may be NULL, in which case nothing will be written. On error,
- return a negative value. */
-int
-vsnprintf (char *str, size_t size, const char *format, va_list args)
-{
- char *output;
- size_t len;
-
- len = size;
- output = vasnprintf (str, &len, format, args);
-
- if (!output)
- return -1;
-
- if (str != NULL)
- if (len > size - 1) /* equivalent to: (size > 0 && len >= size) */
- str[size - 1] = '\0';
-
- if (output != str)
- free (output);
-
- return len;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/vsnprintf.h b/xbmc/screensavers/rsxs-0.9/lib/vsnprintf.h
deleted file mode 100644
index f80c77a95b..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/vsnprintf.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Formatted output to strings.
- Copyright (C) 2004 Free Software Foundation, Inc.
- Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef VSNPRINTF_H
-#define VSNPRINTF_H
-
-#include <stdarg.h>
-
-/* Get vsnprintf declaration, if available. */
-#include <stdio.h>
-
-#if defined HAVE_DECL_VSNPRINTF && !HAVE_DECL_VSNPRINTF
-int vsnprintf (char *str, size_t size, const char *format, va_list args);
-#endif
-
-#endif /* VSNPRINTF_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/wcwidth.h b/xbmc/screensavers/rsxs-0.9/lib/wcwidth.h
deleted file mode 100644
index 9af75e0a77..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/wcwidth.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Determine the number of screen columns needed for a character.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _gl_WCWIDTH_H
-#define _gl_WCWIDTH_H
-
-#if HAVE_WCHAR_T
-
-/* Get wcwidth if available, along with wchar_t. */
-# if HAVE_WCHAR_H
-/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
- <wchar.h>.
- BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
- <wchar.h>. */
-# include <stdio.h>
-# include <time.h>
-# include <wchar.h>
-# endif
-
-/* Get iswprint. */
-# if HAVE_WCTYPE_H
-# include <wctype.h>
-# endif
-# if !defined iswprint && !HAVE_ISWPRINT
-# define iswprint(wc) 1
-# endif
-
-# ifndef HAVE_DECL_WCWIDTH
-"this configure-time declaration test was not run"
-# endif
-# ifndef wcwidth
-# if !HAVE_WCWIDTH
-
-/* wcwidth doesn't exist, so assume all printable characters have
- width 1. */
-static inline int
-wcwidth (wchar_t wc)
-{
- return wc == 0 ? 0 : iswprint (wc) ? 1 : -1;
-}
-
-# elif !HAVE_DECL_WCWIDTH
-
-/* wcwidth exists but is not declared. */
-extern
-# ifdef __cplusplus
-"C"
-# endif
-int wcwidth (int /* actually wchar_t */);
-
-# endif
-# endif
-
-#endif /* HAVE_WCHAR_H */
-
-#endif /* _gl_WCWIDTH_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/xalloc-die.c b/xbmc/screensavers/rsxs-0.9/lib/xalloc-die.c
deleted file mode 100644
index 9b4a76c6ba..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/xalloc-die.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Report a memory allocation failure and exit.
-
- Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2006 Free
- Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "xalloc.h"
-
-#include <stdlib.h>
-
-#include "error.h"
-#include "exitfail.h"
-
-#include "gettext.h"
-#define _(msgid) gettext (msgid)
-
-void
-xalloc_die (void)
-{
- error (exit_failure, 0, "%s", _("memory exhausted"));
-
- /* The `noreturn' cannot be given to error, since it may return if
- its first argument is 0. To help compilers understand the
- xalloc_die does not return, call abort. Also, the abort is a
- safety feature if exit_failure is 0 (which shouldn't happen). */
- abort ();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/xalloc.h b/xbmc/screensavers/rsxs-0.9/lib/xalloc.h
deleted file mode 100644
index f80977e309..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/xalloc.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* xalloc.h -- malloc with out-of-memory checking
-
- Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef XALLOC_H_
-# define XALLOC_H_
-
-# include <stddef.h>
-
-
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-
-# ifndef __attribute__
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
-# define __attribute__(x)
-# endif
-# endif
-
-# ifndef ATTRIBUTE_NORETURN
-# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-# endif
-
-/* This function is always triggered when memory is exhausted.
- It must be defined by the application, either explicitly
- or by using gnulib's xalloc-die module. This is the
- function to call when one wants the program to die because of a
- memory allocation failure. */
-extern void xalloc_die (void) ATTRIBUTE_NORETURN;
-
-void *xmalloc (size_t s);
-void *xnmalloc (size_t n, size_t s);
-void *xzalloc (size_t s);
-void *xcalloc (size_t n, size_t s);
-void *xrealloc (void *p, size_t s);
-void *xnrealloc (void *p, size_t n, size_t s);
-void *x2realloc (void *p, size_t *pn);
-void *x2nrealloc (void *p, size_t *pn, size_t s);
-void *xmemdup (void const *p, size_t s);
-char *xstrdup (char const *str);
-
-/* Return 1 if an array of N objects, each of size S, cannot exist due
- to size arithmetic overflow. S must be positive and N must be
- nonnegative. This is a macro, not an inline function, so that it
- works correctly even when SIZE_MAX < N.
-
- By gnulib convention, SIZE_MAX represents overflow in size
- calculations, so the conservative dividend to use here is
- SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value.
- However, malloc (SIZE_MAX) fails on all known hosts where
- sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for
- exactly-SIZE_MAX allocations on such hosts; this avoids a test and
- branch when S is known to be 1. */
-# define xalloc_oversized(n, s) \
- ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n))
-
-# ifdef __cplusplus
-}
-# endif
-
-
-#endif /* !XALLOC_H_ */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/xmalloc.c b/xbmc/screensavers/rsxs-0.9/lib/xmalloc.c
deleted file mode 100644
index 687633c250..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/xmalloc.c
+++ /dev/null
@@ -1,241 +0,0 @@
-/* xmalloc.c -- malloc with out of memory checking
-
- Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "xalloc.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
-#endif
-
-/* 1 if calloc is known to be compatible with GNU calloc. This
- matters if we are not also using the calloc module, which defines
- HAVE_CALLOC and supports the GNU API even on non-GNU platforms. */
-#if defined HAVE_CALLOC || defined __GLIBC__
-enum { HAVE_GNU_CALLOC = 1 };
-#else
-enum { HAVE_GNU_CALLOC = 0 };
-#endif
-
-/* Allocate an array of N objects, each with S bytes of memory,
- dynamically, with error checking. S must be nonzero. */
-
-static inline void *
-xnmalloc_inline (size_t n, size_t s)
-{
- void *p;
- if (xalloc_oversized (n, s) || (! (p = malloc (n * s)) && n != 0))
- xalloc_die ();
- return p;
-}
-
-void *
-xnmalloc (size_t n, size_t s)
-{
- return xnmalloc_inline (n, s);
-}
-
-/* Allocate N bytes of memory dynamically, with error checking. */
-
-void *
-xmalloc (size_t n)
-{
- return xnmalloc_inline (n, 1);
-}
-
-/* Change the size of an allocated block of memory P to an array of N
- objects each of S bytes, with error checking. S must be nonzero. */
-
-static inline void *
-xnrealloc_inline (void *p, size_t n, size_t s)
-{
- if (xalloc_oversized (n, s) || (! (p = realloc (p, n * s)) && n != 0))
- xalloc_die ();
- return p;
-}
-
-void *
-xnrealloc (void *p, size_t n, size_t s)
-{
- return xnrealloc_inline (p, n, s);
-}
-
-/* Change the size of an allocated block of memory P to N bytes,
- with error checking. */
-
-void *
-xrealloc (void *p, size_t n)
-{
- return xnrealloc_inline (p, n, 1);
-}
-
-
-/* If P is null, allocate a block of at least *PN such objects;
- otherwise, reallocate P so that it contains more than *PN objects
- each of S bytes. *PN must be nonzero unless P is null, and S must
- be nonzero. Set *PN to the new number of objects, and return the
- pointer to the new block. *PN is never set to zero, and the
- returned pointer is never null.
-
- Repeated reallocations are guaranteed to make progress, either by
- allocating an initial block with a nonzero size, or by allocating a
- larger block.
-
- In the following implementation, nonzero sizes are doubled so that
- repeated reallocations have O(N log N) overall cost rather than
- O(N**2) cost, but the specification for this function does not
- guarantee that sizes are doubled.
-
- Here is an example of use:
-
- int *p = NULL;
- size_t used = 0;
- size_t allocated = 0;
-
- void
- append_int (int value)
- {
- if (used == allocated)
- p = x2nrealloc (p, &allocated, sizeof *p);
- p[used++] = value;
- }
-
- This causes x2nrealloc to allocate a block of some nonzero size the
- first time it is called.
-
- To have finer-grained control over the initial size, set *PN to a
- nonzero value before calling this function with P == NULL. For
- example:
-
- int *p = NULL;
- size_t used = 0;
- size_t allocated = 0;
- size_t allocated1 = 1000;
-
- void
- append_int (int value)
- {
- if (used == allocated)
- {
- p = x2nrealloc (p, &allocated1, sizeof *p);
- allocated = allocated1;
- }
- p[used++] = value;
- }
-
- */
-
-static inline void *
-x2nrealloc_inline (void *p, size_t *pn, size_t s)
-{
- size_t n = *pn;
-
- if (! p)
- {
- if (! n)
- {
- /* The approximate size to use for initial small allocation
- requests, when the invoking code specifies an old size of
- zero. 64 bytes is the largest "small" request for the
- GNU C library malloc. */
- enum { DEFAULT_MXFAST = 64 };
-
- n = DEFAULT_MXFAST / s;
- n += !n;
- }
- }
- else
- {
- if (SIZE_MAX / 2 / s < n)
- xalloc_die ();
- n *= 2;
- }
-
- *pn = n;
- return xrealloc (p, n * s);
-}
-
-void *
-x2nrealloc (void *p, size_t *pn, size_t s)
-{
- return x2nrealloc_inline (p, pn, s);
-}
-
-/* If P is null, allocate a block of at least *PN bytes; otherwise,
- reallocate P so that it contains more than *PN bytes. *PN must be
- nonzero unless P is null. Set *PN to the new block's size, and
- return the pointer to the new block. *PN is never set to zero, and
- the returned pointer is never null. */
-
-void *
-x2realloc (void *p, size_t *pn)
-{
- return x2nrealloc_inline (p, pn, 1);
-}
-
-/* Allocate S bytes of zeroed memory dynamically, with error checking.
- There's no need for xnzalloc (N, S), since it would be equivalent
- to xcalloc (N, S). */
-
-void *
-xzalloc (size_t s)
-{
- return memset (xmalloc (s), 0, s);
-}
-
-/* Allocate zeroed memory for N elements of S bytes, with error
- checking. S must be nonzero. */
-
-void *
-xcalloc (size_t n, size_t s)
-{
- void *p;
- /* Test for overflow, since some calloc implementations don't have
- proper overflow checks. But omit overflow and size-zero tests if
- HAVE_GNU_CALLOC, since GNU calloc catches overflow and never
- returns NULL if successful. */
- if ((! HAVE_GNU_CALLOC && xalloc_oversized (n, s))
- || (! (p = calloc (n, s)) && (HAVE_GNU_CALLOC || n != 0)))
- xalloc_die ();
- return p;
-}
-
-/* Clone an object P of size S, with error checking. There's no need
- for xnmemdup (P, N, S), since xmemdup (P, N * S) works without any
- need for an arithmetic overflow check. */
-
-void *
-xmemdup (void const *p, size_t s)
-{
- return memcpy (xmalloc (s), p, s);
-}
-
-/* Clone STRING. */
-
-char *
-xstrdup (char const *string)
-{
- return xmemdup (string, strlen (string) + 1);
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/xsize.h b/xbmc/screensavers/rsxs-0.9/lib/xsize.h
deleted file mode 100644
index 341fb16ca7..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/xsize.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* xsize.h -- Checked size_t computations.
-
- Copyright (C) 2003 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _XSIZE_H
-#define _XSIZE_H
-
-/* Get size_t. */
-#include <stddef.h>
-
-/* Get SIZE_MAX. */
-#include <limits.h>
-#if HAVE_STDINT_H
-# include <stdint.h>
-#endif
-
-/* The size of memory objects is often computed through expressions of
- type size_t. Example:
- void* p = malloc (header_size + n * element_size).
- These computations can lead to overflow. When this happens, malloc()
- returns a piece of memory that is way too small, and the program then
- crashes while attempting to fill the memory.
- To avoid this, the functions and macros in this file check for overflow.
- The convention is that SIZE_MAX represents overflow.
- malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
- implementation that uses mmap --, it's recommended to use size_overflow_p()
- or size_in_bounds_p() before invoking malloc().
- The example thus becomes:
- size_t size = xsum (header_size, xtimes (n, element_size));
- void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
-*/
-
-/* Convert an arbitrary value >= 0 to type size_t. */
-#define xcast_size_t(N) \
- ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
-
-/* Sum of two sizes, with overflow check. */
-static inline size_t
-#if __GNUC__ >= 3
-__attribute__ ((__pure__))
-#endif
-xsum (size_t size1, size_t size2)
-{
- size_t sum = size1 + size2;
- return (sum >= size1 ? sum : SIZE_MAX);
-}
-
-/* Sum of three sizes, with overflow check. */
-static inline size_t
-#if __GNUC__ >= 3
-__attribute__ ((__pure__))
-#endif
-xsum3 (size_t size1, size_t size2, size_t size3)
-{
- return xsum (xsum (size1, size2), size3);
-}
-
-/* Sum of four sizes, with overflow check. */
-static inline size_t
-#if __GNUC__ >= 3
-__attribute__ ((__pure__))
-#endif
-xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
-{
- return xsum (xsum (xsum (size1, size2), size3), size4);
-}
-
-/* Maximum of two sizes, with overflow check. */
-static inline size_t
-#if __GNUC__ >= 3
-__attribute__ ((__pure__))
-#endif
-xmax (size_t size1, size_t size2)
-{
- /* No explicit check is needed here, because for any n:
- max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */
- return (size1 >= size2 ? size1 : size2);
-}
-
-/* Multiplication of a count with an element size, with overflow check.
- The count must be >= 0 and the element size must be > 0.
- This is a macro, not an inline function, so that it works correctly even
- when N is of a wider tupe and N > SIZE_MAX. */
-#define xtimes(N, ELSIZE) \
- ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
-
-/* Check for overflow. */
-#define size_overflow_p(SIZE) \
- ((SIZE) == SIZE_MAX)
-/* Check against overflow. */
-#define size_in_bounds_p(SIZE) \
- ((SIZE) != SIZE_MAX)
-
-#endif /* _XSIZE_H */
diff --git a/xbmc/screensavers/rsxs-0.9/lib/xstrndup.c b/xbmc/screensavers/rsxs-0.9/lib/xstrndup.c
deleted file mode 100644
index a62d4bd695..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/xstrndup.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Duplicate a bounded initial segment of a string, with out-of-memory
- checking.
- Copyright (C) 2003 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification. */
-#include "xstrndup.h"
-
-#include "strndup.h"
-#include "xalloc.h"
-
-/* Return a newly allocated copy of at most N bytes of STRING.
- In other words, return a copy of the initial segment of length N of
- STRING. */
-char *
-xstrndup (const char *string, size_t n)
-{
- char *s = strndup (string, n);
- if (! s)
- xalloc_die ();
- return s;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/lib/xstrndup.h b/xbmc/screensavers/rsxs-0.9/lib/xstrndup.h
deleted file mode 100644
index 88354cfd43..0000000000
--- a/xbmc/screensavers/rsxs-0.9/lib/xstrndup.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Duplicate a bounded initial segment of a string, with out-of-memory
- checking.
- Copyright (C) 2003 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#include <stddef.h>
-
-/* Return a newly allocated copy of at most N bytes of STRING.
- In other words, return a copy of the initial segment of length N of
- STRING. */
-extern char *xstrndup (const char *string, size_t n);
diff --git a/xbmc/screensavers/rsxs-0.9/libltdl/Makefile.am b/xbmc/screensavers/rsxs-0.9/libltdl/Makefile.am
deleted file mode 100644
index f07996d93c..0000000000
--- a/xbmc/screensavers/rsxs-0.9/libltdl/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-if DLOPEN
-noinst_LIBRARIES = libltdl.a
-libltdl_a_SOURCES = ltdl.c ltdl.h
-endif DLOPEN
diff --git a/xbmc/screensavers/rsxs-0.9/libltdl/ltdl.c b/xbmc/screensavers/rsxs-0.9/libltdl/ltdl.c
deleted file mode 100644
index 3da37c85c6..0000000000
--- a/xbmc/screensavers/rsxs-0.9/libltdl/ltdl.c
+++ /dev/null
@@ -1,4521 +0,0 @@
-/* ltdl.c -- system independent dlopen wrapper
- Copyright (C) 1998, 1999, 2000, 2004, 2005 Free Software Foundation, Inc.
- Originally by Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-As a special exception to the GNU Lesser General Public License,
-if you distribute this file as part of a program or library that
-is built using GNU libtool, you may include it under the same
-distribution terms that you use for the rest of that program.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA
-
-*/
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#if HAVE_STDIO_H
-# include <stdio.h>
-#endif
-
-/* Include the header defining malloc. On K&R C compilers,
- that's <malloc.h>, on ANSI C and ISO C compilers, that's <stdlib.h>. */
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-# if HAVE_MALLOC_H
-# include <malloc.h>
-# endif
-#endif
-
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# if HAVE_STRINGS_H
-# include <strings.h>
-# endif
-#endif
-
-#if HAVE_CTYPE_H
-# include <ctype.h>
-#endif
-
-#if HAVE_MEMORY_H
-# include <memory.h>
-#endif
-
-#if HAVE_ERRNO_H
-# include <errno.h>
-#endif
-
-
-#ifndef __WINDOWS__
-# ifdef __WIN32__
-# define __WINDOWS__
-# endif
-#endif
-
-
-#undef LT_USE_POSIX_DIRENT
-#ifdef HAVE_CLOSEDIR
-# ifdef HAVE_OPENDIR
-# ifdef HAVE_READDIR
-# ifdef HAVE_DIRENT_H
-# define LT_USE_POSIX_DIRENT
-# endif /* HAVE_DIRENT_H */
-# endif /* HAVE_READDIR */
-# endif /* HAVE_OPENDIR */
-#endif /* HAVE_CLOSEDIR */
-
-
-#undef LT_USE_WINDOWS_DIRENT_EMULATION
-#ifndef LT_USE_POSIX_DIRENT
-# ifdef __WINDOWS__
-# define LT_USE_WINDOWS_DIRENT_EMULATION
-# endif /* __WINDOWS__ */
-#endif /* LT_USE_POSIX_DIRENT */
-
-
-#ifdef LT_USE_POSIX_DIRENT
-# include <dirent.h>
-# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name))
-#else
-# ifdef LT_USE_WINDOWS_DIRENT_EMULATION
-# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name))
-# else
-# define dirent direct
-# define LT_D_NAMLEN(dirent) ((dirent)->d_namlen)
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif
-# endif
-#endif
-
-#if HAVE_ARGZ_H
-# include <argz.h>
-#endif
-
-#if HAVE_ASSERT_H
-# include <assert.h>
-#else
-# define assert(arg) ((void) 0)
-#endif
-
-#include "ltdl.h"
-
-#if WITH_DMALLOC
-# include <dmalloc.h>
-#endif
-
-
-
-
-/* --- WINDOWS SUPPORT --- */
-
-
-#ifdef DLL_EXPORT
-# define LT_GLOBAL_DATA __declspec(dllexport)
-#else
-# define LT_GLOBAL_DATA
-#endif
-
-/* fopen() mode flags for reading a text file */
-#undef LT_READTEXT_MODE
-#ifdef __WINDOWS__
-# define LT_READTEXT_MODE "rt"
-#else
-# define LT_READTEXT_MODE "r"
-#endif
-
-#ifdef LT_USE_WINDOWS_DIRENT_EMULATION
-
-#include <windows.h>
-
-#define dirent lt_dirent
-#define DIR lt_DIR
-
-struct dirent
-{
- char d_name[2048];
- int d_namlen;
-};
-
-typedef struct _DIR
-{
- HANDLE hSearch;
- WIN32_FIND_DATA Win32FindData;
- BOOL firsttime;
- struct dirent file_info;
-} DIR;
-
-#endif /* LT_USE_WINDOWS_DIRENT_EMULATION */
-
-
-/* --- MANIFEST CONSTANTS --- */
-
-
-/* Standard libltdl search path environment variable name */
-#undef LTDL_SEARCHPATH_VAR
-#define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH"
-
-/* Standard libtool archive file extension. */
-#undef LTDL_ARCHIVE_EXT
-#define LTDL_ARCHIVE_EXT ".la"
-
-/* max. filename length */
-#ifndef LT_FILENAME_MAX
-# define LT_FILENAME_MAX 1024
-#endif
-
-/* This is the maximum symbol size that won't require malloc/free */
-#undef LT_SYMBOL_LENGTH
-#define LT_SYMBOL_LENGTH 128
-
-/* This accounts for the _LTX_ separator */
-#undef LT_SYMBOL_OVERHEAD
-#define LT_SYMBOL_OVERHEAD 5
-
-
-
-
-/* --- MEMORY HANDLING --- */
-
-
-/* These are the functions used internally. In addition to making
- use of the associated function pointers above, they also perform
- error handling. */
-static char *lt_estrdup LT_PARAMS((const char *str));
-static lt_ptr lt_emalloc LT_PARAMS((size_t size));
-static lt_ptr lt_erealloc LT_PARAMS((lt_ptr addr, size_t size));
-
-/* static lt_ptr rpl_realloc LT_PARAMS((lt_ptr ptr, size_t size)); */
-#define rpl_realloc realloc
-
-/* These are the pointers that can be changed by the caller: */
-LT_GLOBAL_DATA lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size))
- = (lt_ptr (*) LT_PARAMS((size_t))) malloc;
-LT_GLOBAL_DATA lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size))
- = (lt_ptr (*) LT_PARAMS((lt_ptr, size_t))) rpl_realloc;
-LT_GLOBAL_DATA void (*lt_dlfree) LT_PARAMS((lt_ptr ptr))
- = (void (*) LT_PARAMS((lt_ptr))) free;
-
-/* The following macros reduce the amount of typing needed to cast
- assigned memory. */
-#if WITH_DMALLOC
-
-#define LT_DLMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp)))
-#define LT_DLREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp)))
-#define LT_DLFREE(p) \
- LT_STMT_START { if (p) (p) = (xfree (p), (lt_ptr) 0); } LT_STMT_END
-
-#define LT_EMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp)))
-#define LT_EREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp)))
-
-#else
-
-#define LT_DLMALLOC(tp, n) ((tp *) lt_dlmalloc ((n) * sizeof(tp)))
-#define LT_DLREALLOC(tp, p, n) ((tp *) lt_dlrealloc ((p), (n) * sizeof(tp)))
-#define LT_DLFREE(p) \
- LT_STMT_START { if (p) (p) = (lt_dlfree (p), (lt_ptr) 0); } LT_STMT_END
-
-#define LT_EMALLOC(tp, n) ((tp *) lt_emalloc ((n) * sizeof(tp)))
-#define LT_EREALLOC(tp, p, n) ((tp *) lt_erealloc ((p), (n) * sizeof(tp)))
-
-#endif
-
-#define LT_DLMEM_REASSIGN(p, q) LT_STMT_START { \
- if ((p) != (q)) { if (p) lt_dlfree (p); (p) = (q); (q) = 0; } \
- } LT_STMT_END
-
-
-/* --- REPLACEMENT FUNCTIONS --- */
-
-
-#undef strdup
-#define strdup rpl_strdup
-
-static char *strdup LT_PARAMS((const char *str));
-
-static char *
-strdup(str)
- const char *str;
-{
- char *tmp = 0;
-
- if (str)
- {
- tmp = LT_DLMALLOC (char, 1+ strlen (str));
- if (tmp)
- {
- strcpy(tmp, str);
- }
- }
-
- return tmp;
-}
-
-
-#if ! HAVE_STRCMP
-
-#undef strcmp
-#define strcmp rpl_strcmp
-
-static int strcmp LT_PARAMS((const char *str1, const char *str2));
-
-static int
-strcmp (str1, str2)
- const char *str1;
- const char *str2;
-{
- if (str1 == str2)
- return 0;
- if (str1 == 0)
- return -1;
- if (str2 == 0)
- return 1;
-
- for (;*str1 && *str2; ++str1, ++str2)
- {
- if (*str1 != *str2)
- break;
- }
-
- return (int)(*str1 - *str2);
-}
-#endif
-
-
-#if ! HAVE_STRCHR
-
-# if HAVE_INDEX
-# define strchr index
-# else
-# define strchr rpl_strchr
-
-static const char *strchr LT_PARAMS((const char *str, int ch));
-
-static const char*
-strchr(str, ch)
- const char *str;
- int ch;
-{
- const char *p;
-
- for (p = str; *p != (char)ch && *p != LT_EOS_CHAR; ++p)
- /*NOWORK*/;
-
- return (*p == (char)ch) ? p : 0;
-}
-
-# endif
-#endif /* !HAVE_STRCHR */
-
-
-#if ! HAVE_STRRCHR
-
-# if HAVE_RINDEX
-# define strrchr rindex
-# else
-# define strrchr rpl_strrchr
-
-static const char *strrchr LT_PARAMS((const char *str, int ch));
-
-static const char*
-strrchr(str, ch)
- const char *str;
- int ch;
-{
- const char *p, *q = 0;
-
- for (p = str; *p != LT_EOS_CHAR; ++p)
- {
- if (*p == (char) ch)
- {
- q = p;
- }
- }
-
- return q;
-}
-
-# endif
-#endif
-
-/* NOTE: Neither bcopy nor the memcpy implementation below can
- reliably handle copying in overlapping areas of memory. Use
- memmove (for which there is a fallback implmentation below)
- if you need that behaviour. */
-#if ! HAVE_MEMCPY
-
-# if HAVE_BCOPY
-# define memcpy(dest, src, size) bcopy (src, dest, size)
-# else
-# define memcpy rpl_memcpy
-
-static lt_ptr memcpy LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size));
-
-static lt_ptr
-memcpy (dest, src, size)
- lt_ptr dest;
- const lt_ptr src;
- size_t size;
-{
- const char * s = src;
- char * d = dest;
- size_t i = 0;
-
- for (i = 0; i < size; ++i)
- {
- d[i] = s[i];
- }
-
- return dest;
-}
-
-# endif /* !HAVE_BCOPY */
-#endif /* !HAVE_MEMCPY */
-
-#if ! HAVE_MEMMOVE
-# define memmove rpl_memmove
-
-static lt_ptr memmove LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size));
-
-static lt_ptr
-memmove (dest, src, size)
- lt_ptr dest;
- const lt_ptr src;
- size_t size;
-{
- const char * s = src;
- char * d = dest;
- size_t i;
-
- if (d < s)
- for (i = 0; i < size; ++i)
- {
- d[i] = s[i];
- }
- else if (d > s && size > 0)
- for (i = size -1; ; --i)
- {
- d[i] = s[i];
- if (i == 0)
- break;
- }
-
- return dest;
-}
-
-#endif /* !HAVE_MEMMOVE */
-
-#ifdef LT_USE_WINDOWS_DIRENT_EMULATION
-
-static void closedir LT_PARAMS((DIR *entry));
-
-static void
-closedir(entry)
- DIR *entry;
-{
- assert(entry != (DIR *) NULL);
- FindClose(entry->hSearch);
- lt_dlfree((lt_ptr)entry);
-}
-
-
-static DIR * opendir LT_PARAMS((const char *path));
-
-static DIR*
-opendir (path)
- const char *path;
-{
- char file_specification[LT_FILENAME_MAX];
- DIR *entry;
-
- assert(path != (char *) NULL);
- /* allow space for: path + '\\' '\\' '*' '.' '*' + '\0' */
- (void) strncpy (file_specification, path, LT_FILENAME_MAX-6);
- file_specification[LT_FILENAME_MAX-6] = LT_EOS_CHAR;
- (void) strcat(file_specification,"\\");
- entry = LT_DLMALLOC (DIR,sizeof(DIR));
- if (entry != (DIR *) 0)
- {
- entry->firsttime = TRUE;
- entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData);
- }
- if (entry->hSearch == INVALID_HANDLE_VALUE)
- {
- (void) strcat(file_specification,"\\*.*");
- entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData);
- if (entry->hSearch == INVALID_HANDLE_VALUE)
- {
- LT_DLFREE (entry);
- return (DIR *) 0;
- }
- }
- return(entry);
-}
-
-
-static struct dirent *readdir LT_PARAMS((DIR *entry));
-
-static struct dirent *readdir(entry)
- DIR *entry;
-{
- int
- status;
-
- if (entry == (DIR *) 0)
- return((struct dirent *) 0);
- if (!entry->firsttime)
- {
- status = FindNextFile(entry->hSearch,&entry->Win32FindData);
- if (status == 0)
- return((struct dirent *) 0);
- }
- entry->firsttime = FALSE;
- (void) strncpy(entry->file_info.d_name,entry->Win32FindData.cFileName,
- LT_FILENAME_MAX-1);
- entry->file_info.d_name[LT_FILENAME_MAX - 1] = LT_EOS_CHAR;
- entry->file_info.d_namlen = strlen(entry->file_info.d_name);
- return(&entry->file_info);
-}
-
-#endif /* LT_USE_WINDOWS_DIRENT_EMULATION */
-
-/* According to Alexandre Oliva <oliva@lsd.ic.unicamp.br>,
- ``realloc is not entirely portable''
- In any case we want to use the allocator supplied by the user without
- burdening them with an lt_dlrealloc function pointer to maintain.
- Instead implement our own version (with known boundary conditions)
- using lt_dlmalloc and lt_dlfree. */
-
-/* #undef realloc
- #define realloc rpl_realloc
-*/
-#if 0
- /* You can't (re)define realloc unless you also (re)define malloc.
- Right now, this code uses the size of the *destination* to decide
- how much to copy. That's not right, but you can't know the size
- of the source unless you know enough about, or wrote malloc. So
- this code is disabled... */
-
-static lt_ptr
-realloc (ptr, size)
- lt_ptr ptr;
- size_t size;
-{
- if (size == 0)
- {
- /* For zero or less bytes, free the original memory */
- if (ptr != 0)
- {
- lt_dlfree (ptr);
- }
-
- return (lt_ptr) 0;
- }
- else if (ptr == 0)
- {
- /* Allow reallocation of a NULL pointer. */
- return lt_dlmalloc (size);
- }
- else
- {
- /* Allocate a new block, copy and free the old block. */
- lt_ptr mem = lt_dlmalloc (size);
-
- if (mem)
- {
- memcpy (mem, ptr, size);
- lt_dlfree (ptr);
- }
-
- /* Note that the contents of PTR are not damaged if there is
- insufficient memory to realloc. */
- return mem;
- }
-}
-#endif
-
-
-#if ! HAVE_ARGZ_APPEND
-# define argz_append rpl_argz_append
-
-static error_t argz_append LT_PARAMS((char **pargz, size_t *pargz_len,
- const char *buf, size_t buf_len));
-
-static error_t
-argz_append (pargz, pargz_len, buf, buf_len)
- char **pargz;
- size_t *pargz_len;
- const char *buf;
- size_t buf_len;
-{
- size_t argz_len;
- char *argz;
-
- assert (pargz);
- assert (pargz_len);
- assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len));
-
- /* If nothing needs to be appended, no more work is required. */
- if (buf_len == 0)
- return 0;
-
- /* Ensure there is enough room to append BUF_LEN. */
- argz_len = *pargz_len + buf_len;
- argz = LT_DLREALLOC (char, *pargz, argz_len);
- if (!argz)
- return ENOMEM;
-
- /* Copy characters from BUF after terminating '\0' in ARGZ. */
- memcpy (argz + *pargz_len, buf, buf_len);
-
- /* Assign new values. */
- *pargz = argz;
- *pargz_len = argz_len;
-
- return 0;
-}
-#endif /* !HAVE_ARGZ_APPEND */
-
-
-#if ! HAVE_ARGZ_CREATE_SEP
-# define argz_create_sep rpl_argz_create_sep
-
-static error_t argz_create_sep LT_PARAMS((const char *str, int delim,
- char **pargz, size_t *pargz_len));
-
-static error_t
-argz_create_sep (str, delim, pargz, pargz_len)
- const char *str;
- int delim;
- char **pargz;
- size_t *pargz_len;
-{
- size_t argz_len;
- char *argz = 0;
-
- assert (str);
- assert (pargz);
- assert (pargz_len);
-
- /* Make a copy of STR, but replacing each occurrence of
- DELIM with '\0'. */
- argz_len = 1+ LT_STRLEN (str);
- if (argz_len)
- {
- const char *p;
- char *q;
-
- argz = LT_DLMALLOC (char, argz_len);
- if (!argz)
- return ENOMEM;
-
- for (p = str, q = argz; *p != LT_EOS_CHAR; ++p)
- {
- if (*p == delim)
- {
- /* Ignore leading delimiters, and fold consecutive
- delimiters in STR into a single '\0' in ARGZ. */
- if ((q > argz) && (q[-1] != LT_EOS_CHAR))
- *q++ = LT_EOS_CHAR;
- else
- --argz_len;
- }
- else
- *q++ = *p;
- }
- /* Copy terminating LT_EOS_CHAR. */
- *q = *p;
- }
-
- /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */
- if (!argz_len)
- LT_DLFREE (argz);
-
- /* Assign new values. */
- *pargz = argz;
- *pargz_len = argz_len;
-
- return 0;
-}
-#endif /* !HAVE_ARGZ_CREATE_SEP */
-
-
-#if ! HAVE_ARGZ_INSERT
-# define argz_insert rpl_argz_insert
-
-static error_t argz_insert LT_PARAMS((char **pargz, size_t *pargz_len,
- char *before, const char *entry));
-
-static error_t
-argz_insert (pargz, pargz_len, before, entry)
- char **pargz;
- size_t *pargz_len;
- char *before;
- const char *entry;
-{
- assert (pargz);
- assert (pargz_len);
- assert (entry && *entry);
-
- /* No BEFORE address indicates ENTRY should be inserted after the
- current last element. */
- if (!before)
- return argz_append (pargz, pargz_len, entry, 1+ LT_STRLEN (entry));
-
- /* This probably indicates a programmer error, but to preserve
- semantics, scan back to the start of an entry if BEFORE points
- into the middle of it. */
- while ((before > *pargz) && (before[-1] != LT_EOS_CHAR))
- --before;
-
- {
- size_t entry_len = 1+ LT_STRLEN (entry);
- size_t argz_len = *pargz_len + entry_len;
- size_t offset = before - *pargz;
- char *argz = LT_DLREALLOC (char, *pargz, argz_len);
-
- if (!argz)
- return ENOMEM;
-
- /* Make BEFORE point to the equivalent offset in ARGZ that it
- used to have in *PARGZ incase realloc() moved the block. */
- before = argz + offset;
-
- /* Move the ARGZ entries starting at BEFORE up into the new
- space at the end -- making room to copy ENTRY into the
- resulting gap. */
- memmove (before + entry_len, before, *pargz_len - offset);
- memcpy (before, entry, entry_len);
-
- /* Assign new values. */
- *pargz = argz;
- *pargz_len = argz_len;
- }
-
- return 0;
-}
-#endif /* !HAVE_ARGZ_INSERT */
-
-
-#if ! HAVE_ARGZ_NEXT
-# define argz_next rpl_argz_next
-
-static char *argz_next LT_PARAMS((char *argz, size_t argz_len,
- const char *entry));
-
-static char *
-argz_next (argz, argz_len, entry)
- char *argz;
- size_t argz_len;
- const char *entry;
-{
- assert ((argz && argz_len) || (!argz && !argz_len));
-
- if (entry)
- {
- /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address
- within the ARGZ vector. */
- assert ((!argz && !argz_len)
- || ((argz <= entry) && (entry < (argz + argz_len))));
-
- /* Move to the char immediately after the terminating
- '\0' of ENTRY. */
- entry = 1+ strchr (entry, LT_EOS_CHAR);
-
- /* Return either the new ENTRY, or else NULL if ARGZ is
- exhausted. */
- return (entry >= argz + argz_len) ? 0 : (char *) entry;
- }
- else
- {
- /* This should probably be flagged as a programmer error,
- since starting an argz_next loop with the iterator set
- to ARGZ is safer. To preserve semantics, handle the NULL
- case by returning the start of ARGZ (if any). */
- if (argz_len > 0)
- return argz;
- else
- return 0;
- }
-}
-#endif /* !HAVE_ARGZ_NEXT */
-
-
-
-#if ! HAVE_ARGZ_STRINGIFY
-# define argz_stringify rpl_argz_stringify
-
-static void argz_stringify LT_PARAMS((char *argz, size_t argz_len,
- int sep));
-
-static void
-argz_stringify (argz, argz_len, sep)
- char *argz;
- size_t argz_len;
- int sep;
-{
- assert ((argz && argz_len) || (!argz && !argz_len));
-
- if (sep)
- {
- --argz_len; /* don't stringify the terminating EOS */
- while (--argz_len > 0)
- {
- if (argz[argz_len] == LT_EOS_CHAR)
- argz[argz_len] = sep;
- }
- }
-}
-#endif /* !HAVE_ARGZ_STRINGIFY */
-
-
-
-
-/* --- TYPE DEFINITIONS -- */
-
-
-/* This type is used for the array of caller data sets in each handler. */
-typedef struct {
- lt_dlcaller_id key;
- lt_ptr data;
-} lt_caller_data;
-
-
-
-
-/* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */
-
-
-/* Extract the diagnostic strings from the error table macro in the same
- order as the enumerated indices in ltdl.h. */
-
-static const char *lt_dlerror_strings[] =
- {
-#define LT_ERROR(name, diagnostic) (diagnostic),
- lt_dlerror_table
-#undef LT_ERROR
-
- 0
- };
-
-/* This structure is used for the list of registered loaders. */
-struct lt_dlloader {
- struct lt_dlloader *next;
- const char *loader_name; /* identifying name for each loader */
- const char *sym_prefix; /* prefix for symbols */
- lt_module_open *module_open;
- lt_module_close *module_close;
- lt_find_sym *find_sym;
- lt_dlloader_exit *dlloader_exit;
- lt_user_data dlloader_data;
-};
-
-struct lt_dlhandle_struct {
- struct lt_dlhandle_struct *next;
- lt_dlloader *loader; /* dlopening interface */
- lt_dlinfo info;
- int depcount; /* number of dependencies */
- lt_dlhandle *deplibs; /* dependencies */
- lt_module module; /* system module handle */
- lt_ptr system; /* system specific data */
- lt_caller_data *caller_data; /* per caller associated data */
- int flags; /* various boolean stats */
-};
-
-/* Various boolean flags can be stored in the flags field of an
- lt_dlhandle_struct... */
-#define LT_DLGET_FLAG(handle, flag) (((handle)->flags & (flag)) == (flag))
-#define LT_DLSET_FLAG(handle, flag) ((handle)->flags |= (flag))
-
-#define LT_DLRESIDENT_FLAG (0x01 << 0)
-/* ...add more flags here... */
-
-#define LT_DLIS_RESIDENT(handle) LT_DLGET_FLAG(handle, LT_DLRESIDENT_FLAG)
-
-
-#define LT_DLSTRERROR(name) lt_dlerror_strings[LT_CONC(LT_ERROR_,name)]
-
-static const char objdir[] = LTDL_OBJDIR;
-static const char archive_ext[] = LTDL_ARCHIVE_EXT;
-#ifdef LTDL_SHLIB_EXT
-static const char shlib_ext[] = LTDL_SHLIB_EXT;
-#endif
-#ifdef LTDL_SYSSEARCHPATH
-static const char sys_search_path[] = LTDL_SYSSEARCHPATH;
-#endif
-
-
-
-
-/* --- MUTEX LOCKING --- */
-
-
-/* Macros to make it easier to run the lock functions only if they have
- been registered. The reason for the complicated lock macro is to
- ensure that the stored error message from the last error is not
- accidentally erased if the current function doesn't generate an
- error of its own. */
-#define LT_DLMUTEX_LOCK() LT_STMT_START { \
- if (lt_dlmutex_lock_func) (*lt_dlmutex_lock_func)(); \
- } LT_STMT_END
-#define LT_DLMUTEX_UNLOCK() LT_STMT_START { \
- if (lt_dlmutex_unlock_func) (*lt_dlmutex_unlock_func)();\
- } LT_STMT_END
-#define LT_DLMUTEX_SETERROR(errormsg) LT_STMT_START { \
- if (lt_dlmutex_seterror_func) \
- (*lt_dlmutex_seterror_func) (errormsg); \
- else lt_dllast_error = (errormsg); } LT_STMT_END
-#define LT_DLMUTEX_GETERROR(errormsg) LT_STMT_START { \
- if (lt_dlmutex_seterror_func) \
- (errormsg) = (*lt_dlmutex_geterror_func) (); \
- else (errormsg) = lt_dllast_error; } LT_STMT_END
-
-/* The mutex functions stored here are global, and are necessarily the
- same for all threads that wish to share access to libltdl. */
-static lt_dlmutex_lock *lt_dlmutex_lock_func = 0;
-static lt_dlmutex_unlock *lt_dlmutex_unlock_func = 0;
-static lt_dlmutex_seterror *lt_dlmutex_seterror_func = 0;
-static lt_dlmutex_geterror *lt_dlmutex_geterror_func = 0;
-static const char *lt_dllast_error = 0;
-
-
-/* Either set or reset the mutex functions. Either all the arguments must
- be valid functions, or else all can be NULL to turn off locking entirely.
- The registered functions should be manipulating a static global lock
- from the lock() and unlock() callbacks, which needs to be reentrant. */
-int
-lt_dlmutex_register (lock, unlock, seterror, geterror)
- lt_dlmutex_lock *lock;
- lt_dlmutex_unlock *unlock;
- lt_dlmutex_seterror *seterror;
- lt_dlmutex_geterror *geterror;
-{
- lt_dlmutex_unlock *old_unlock = unlock;
- int errors = 0;
-
- /* Lock using the old lock() callback, if any. */
- LT_DLMUTEX_LOCK ();
-
- if ((lock && unlock && seterror && geterror)
- || !(lock || unlock || seterror || geterror))
- {
- lt_dlmutex_lock_func = lock;
- lt_dlmutex_unlock_func = unlock;
- lt_dlmutex_geterror_func = geterror;
- }
- else
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_MUTEX_ARGS));
- ++errors;
- }
-
- /* Use the old unlock() callback we saved earlier, if any. Otherwise
- record any errors using internal storage. */
- if (old_unlock)
- (*old_unlock) ();
-
- /* Return the number of errors encountered during the execution of
- this function. */
- return errors;
-}
-
-
-
-
-/* --- ERROR HANDLING --- */
-
-
-static const char **user_error_strings = 0;
-static int errorcount = LT_ERROR_MAX;
-
-int
-lt_dladderror (diagnostic)
- const char *diagnostic;
-{
- int errindex = 0;
- int result = -1;
- const char **temp = (const char **) 0;
-
- assert (diagnostic);
-
- LT_DLMUTEX_LOCK ();
-
- errindex = errorcount - LT_ERROR_MAX;
- temp = LT_EREALLOC (const char *, user_error_strings, 1 + errindex);
- if (temp)
- {
- user_error_strings = temp;
- user_error_strings[errindex] = diagnostic;
- result = errorcount++;
- }
-
- LT_DLMUTEX_UNLOCK ();
-
- return result;
-}
-
-int
-lt_dlseterror (errindex)
- int errindex;
-{
- int errors = 0;
-
- LT_DLMUTEX_LOCK ();
-
- if (errindex >= errorcount || errindex < 0)
- {
- /* Ack! Error setting the error message! */
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_ERRORCODE));
- ++errors;
- }
- else if (errindex < LT_ERROR_MAX)
- {
- /* No error setting the error message! */
- LT_DLMUTEX_SETERROR (lt_dlerror_strings[errindex]);
- }
- else
- {
- /* No error setting the error message! */
- LT_DLMUTEX_SETERROR (user_error_strings[errindex - LT_ERROR_MAX]);
- }
-
- LT_DLMUTEX_UNLOCK ();
-
- return errors;
-}
-
-static lt_ptr
-lt_emalloc (size)
- size_t size;
-{
- lt_ptr mem = lt_dlmalloc (size);
- if (size && !mem)
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));
- return mem;
-}
-
-static lt_ptr
-lt_erealloc (addr, size)
- lt_ptr addr;
- size_t size;
-{
- lt_ptr mem = lt_dlrealloc (addr, size);
- if (size && !mem)
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));
- return mem;
-}
-
-static char *
-lt_estrdup (str)
- const char *str;
-{
- char *copy = strdup (str);
- if (LT_STRLEN (str) && !copy)
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));
- return copy;
-}
-
-
-
-
-/* --- DLOPEN() INTERFACE LOADER --- */
-
-
-#if HAVE_LIBDL
-
-/* dynamic linking with dlopen/dlsym */
-
-#if HAVE_DLFCN_H
-# include <dlfcn.h>
-#endif
-
-#if HAVE_SYS_DL_H
-# include <sys/dl.h>
-#endif
-
-#ifdef RTLD_GLOBAL
-# define LT_GLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_GLOBAL DL_GLOBAL
-# endif
-#endif /* !RTLD_GLOBAL */
-#ifndef LT_GLOBAL
-# define LT_GLOBAL 0
-#endif /* !LT_GLOBAL */
-
-/* We may have to define LT_LAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_LAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_LAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_LAZY_OR_NOW DL_LAZY
-# endif
-# endif /* !RTLD_LAZY */
-#endif
-#ifndef LT_LAZY_OR_NOW
-# ifdef RTLD_NOW
-# define LT_LAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_LAZY_OR_NOW DL_NOW
-# endif
-# endif /* !RTLD_NOW */
-#endif
-#ifndef LT_LAZY_OR_NOW
-# define LT_LAZY_OR_NOW 0
-#endif /* !LT_LAZY_OR_NOW */
-
-#if HAVE_DLERROR
-# define DLERROR(arg) dlerror ()
-#else
-# define DLERROR(arg) LT_DLSTRERROR (arg)
-#endif
-
-static lt_module
-sys_dl_open (loader_data, filename)
- lt_user_data loader_data;
- const char *filename;
-{
- lt_module module = dlopen (filename, LT_GLOBAL | LT_LAZY_OR_NOW);
-
- if (!module)
- {
- LT_DLMUTEX_SETERROR (DLERROR (CANNOT_OPEN));
- }
-
- return module;
-}
-
-static int
-sys_dl_close (loader_data, module)
- lt_user_data loader_data;
- lt_module module;
-{
- int errors = 0;
-
- if (dlclose (module) != 0)
- {
- LT_DLMUTEX_SETERROR (DLERROR (CANNOT_CLOSE));
- ++errors;
- }
-
- return errors;
-}
-
-static lt_ptr
-sys_dl_sym (loader_data, module, symbol)
- lt_user_data loader_data;
- lt_module module;
- const char *symbol;
-{
- lt_ptr address = dlsym (module, symbol);
-
- if (!address)
- {
- LT_DLMUTEX_SETERROR (DLERROR (SYMBOL_NOT_FOUND));
- }
-
- return address;
-}
-
-static struct lt_user_dlloader sys_dl =
- {
-# ifdef NEED_USCORE
- "_",
-# else
- 0,
-# endif
- sys_dl_open, sys_dl_close, sys_dl_sym, 0, 0 };
-
-
-#endif /* HAVE_LIBDL */
-
-
-
-/* --- SHL_LOAD() INTERFACE LOADER --- */
-
-#if HAVE_SHL_LOAD
-
-/* dynamic linking with shl_load (HP-UX) (comments from gmodule) */
-
-#ifdef HAVE_DL_H
-# include <dl.h>
-#endif
-
-/* some flags are missing on some systems, so we provide
- * harmless defaults.
- *
- * Mandatory:
- * BIND_IMMEDIATE - Resolve symbol references when the library is loaded.
- * BIND_DEFERRED - Delay code symbol resolution until actual reference.
- *
- * Optionally:
- * BIND_FIRST - Place the library at the head of the symbol search
- * order.
- * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all
- * unsatisfied symbols as fatal. This flag allows
- * binding of unsatisfied code symbols to be deferred
- * until use.
- * [Perl: For certain libraries, like DCE, deferred
- * binding often causes run time problems. Adding
- * BIND_NONFATAL to BIND_IMMEDIATE still allows
- * unresolved references in situations like this.]
- * BIND_NOSTART - Do not call the initializer for the shared library
- * when the library is loaded, nor on a future call to
- * shl_unload().
- * BIND_VERBOSE - Print verbose messages concerning possible
- * unsatisfied symbols.
- *
- * hp9000s700/hp9000s800:
- * BIND_RESTRICTED - Restrict symbols visible by the library to those
- * present at library load time.
- * DYNAMIC_PATH - Allow the loader to dynamically search for the
- * library specified by the path argument.
- */
-
-#ifndef DYNAMIC_PATH
-# define DYNAMIC_PATH 0
-#endif
-#ifndef BIND_RESTRICTED
-# define BIND_RESTRICTED 0
-#endif
-
-#define LT_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH)
-
-static lt_module
-sys_shl_open (loader_data, filename)
- lt_user_data loader_data;
- const char *filename;
-{
- static shl_t self = (shl_t) 0;
- lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L);
-
- /* Since searching for a symbol against a NULL module handle will also
- look in everything else that was already loaded and exported with
- the -E compiler flag, we always cache a handle saved before any
- modules are loaded. */
- if (!self)
- {
- lt_ptr address;
- shl_findsym (&self, "main", TYPE_UNDEFINED, &address);
- }
-
- if (!filename)
- {
- module = self;
- }
- else
- {
- module = shl_load (filename, LT_BIND_FLAGS, 0L);
-
- if (!module)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN));
- }
- }
-
- return module;
-}
-
-static int
-sys_shl_close (loader_data, module)
- lt_user_data loader_data;
- lt_module module;
-{
- int errors = 0;
-
- if (module && (shl_unload ((shl_t) (module)) != 0))
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE));
- ++errors;
- }
-
- return errors;
-}
-
-static lt_ptr
-sys_shl_sym (loader_data, module, symbol)
- lt_user_data loader_data;
- lt_module module;
- const char *symbol;
-{
- lt_ptr address = 0;
-
- /* sys_shl_open should never return a NULL module handle */
- if (module == (lt_module) 0)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
- }
- else if (!shl_findsym((shl_t*) &module, symbol, TYPE_UNDEFINED, &address))
- {
- if (!address)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
- }
- }
-
- return address;
-}
-
-static struct lt_user_dlloader sys_shl = {
- 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0, 0
-};
-
-#endif /* HAVE_SHL_LOAD */
-
-
-
-
-/* --- LOADLIBRARY() INTERFACE LOADER --- */
-
-#ifdef __WINDOWS__
-
-/* dynamic linking for Win32 */
-
-#include <windows.h>
-
-/* Forward declaration; required to implement handle search below. */
-static lt_dlhandle handles;
-
-static lt_module
-sys_wll_open (loader_data, filename)
- lt_user_data loader_data;
- const char *filename;
-{
- lt_dlhandle cur;
- lt_module module = 0;
- const char *errormsg = 0;
- char *searchname = 0;
- char *ext;
- char self_name_buf[MAX_PATH];
-
- if (!filename)
- {
- /* Get the name of main module */
- *self_name_buf = 0;
- GetModuleFileName (NULL, self_name_buf, sizeof (self_name_buf));
- filename = ext = self_name_buf;
- }
- else
- {
- ext = strrchr (filename, '.');
- }
-
- if (ext)
- {
- /* FILENAME already has an extension. */
- searchname = lt_estrdup (filename);
- }
- else
- {
- /* Append a `.' to stop Windows from adding an
- implicit `.dll' extension. */
- searchname = LT_EMALLOC (char, 2+ LT_STRLEN (filename));
- if (searchname)
- sprintf (searchname, "%s.", filename);
- }
- if (!searchname)
- return 0;
-
- {
- /* Silence dialog from LoadLibrary on some failures.
- No way to get the error mode, but to set it,
- so set it twice to preserve any previous flags. */
- UINT errormode = SetErrorMode(SEM_FAILCRITICALERRORS);
- SetErrorMode(errormode | SEM_FAILCRITICALERRORS);
-
-#if defined(__CYGWIN__)
- {
- char wpath[MAX_PATH];
- cygwin_conv_to_full_win32_path (searchname, wpath);
- module = LoadLibrary (wpath);
- }
-#else
- module = LoadLibrary (searchname);
-#endif
-
- /* Restore the error mode. */
- SetErrorMode(errormode);
- }
-
- LT_DLFREE (searchname);
-
- /* libltdl expects this function to fail if it is unable
- to physically load the library. Sadly, LoadLibrary
- will search the loaded libraries for a match and return
- one of them if the path search load fails.
-
- We check whether LoadLibrary is returning a handle to
- an already loaded module, and simulate failure if we
- find one. */
- LT_DLMUTEX_LOCK ();
- cur = handles;
- while (cur)
- {
- if (!cur->module)
- {
- cur = 0;
- break;
- }
-
- if (cur->module == module)
- {
- break;
- }
-
- cur = cur->next;
- }
- LT_DLMUTEX_UNLOCK ();
-
- if (cur || !module)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN));
- module = 0;
- }
-
- return module;
-}
-
-static int
-sys_wll_close (loader_data, module)
- lt_user_data loader_data;
- lt_module module;
-{
- int errors = 0;
-
- if (FreeLibrary(module) == 0)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE));
- ++errors;
- }
-
- return errors;
-}
-
-static lt_ptr
-sys_wll_sym (loader_data, module, symbol)
- lt_user_data loader_data;
- lt_module module;
- const char *symbol;
-{
- lt_ptr address = GetProcAddress (module, symbol);
-
- if (!address)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
- }
-
- return address;
-}
-
-static struct lt_user_dlloader sys_wll = {
- 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0, 0
-};
-
-#endif /* __WINDOWS__ */
-
-
-
-
-/* --- LOAD_ADD_ON() INTERFACE LOADER --- */
-
-
-#ifdef __BEOS__
-
-/* dynamic linking for BeOS */
-
-#include <kernel/image.h>
-
-static lt_module
-sys_bedl_open (loader_data, filename)
- lt_user_data loader_data;
- const char *filename;
-{
- image_id image = 0;
-
- if (filename)
- {
- image = load_add_on (filename);
- }
- else
- {
- image_info info;
- int32 cookie = 0;
- if (get_next_image_info (0, &cookie, &info) == B_OK)
- image = load_add_on (info.name);
- }
-
- if (image <= 0)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN));
- image = 0;
- }
-
- return (lt_module) image;
-}
-
-static int
-sys_bedl_close (loader_data, module)
- lt_user_data loader_data;
- lt_module module;
-{
- int errors = 0;
-
- if (unload_add_on ((image_id) module) != B_OK)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE));
- ++errors;
- }
-
- return errors;
-}
-
-static lt_ptr
-sys_bedl_sym (loader_data, module, symbol)
- lt_user_data loader_data;
- lt_module module;
- const char *symbol;
-{
- lt_ptr address = 0;
- image_id image = (image_id) module;
-
- if (get_image_symbol (image, symbol, B_SYMBOL_TYPE_ANY, address) != B_OK)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
- address = 0;
- }
-
- return address;
-}
-
-static struct lt_user_dlloader sys_bedl = {
- 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0, 0
-};
-
-#endif /* __BEOS__ */
-
-
-
-
-/* --- DLD_LINK() INTERFACE LOADER --- */
-
-
-#if HAVE_DLD
-
-/* dynamic linking with dld */
-
-#if HAVE_DLD_H
-#include <dld.h>
-#endif
-
-static lt_module
-sys_dld_open (loader_data, filename)
- lt_user_data loader_data;
- const char *filename;
-{
- lt_module module = strdup (filename);
-
- if (dld_link (filename) != 0)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN));
- LT_DLFREE (module);
- module = 0;
- }
-
- return module;
-}
-
-static int
-sys_dld_close (loader_data, module)
- lt_user_data loader_data;
- lt_module module;
-{
- int errors = 0;
-
- if (dld_unlink_by_file ((char*)(module), 1) != 0)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE));
- ++errors;
- }
- else
- {
- LT_DLFREE (module);
- }
-
- return errors;
-}
-
-static lt_ptr
-sys_dld_sym (loader_data, module, symbol)
- lt_user_data loader_data;
- lt_module module;
- const char *symbol;
-{
- lt_ptr address = dld_get_func (symbol);
-
- if (!address)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
- }
-
- return address;
-}
-
-static struct lt_user_dlloader sys_dld = {
- 0, sys_dld_open, sys_dld_close, sys_dld_sym, 0, 0
-};
-
-#endif /* HAVE_DLD */
-
-/* --- DYLD() MACOSX/DARWIN INTERFACE LOADER --- */
-#if HAVE_DYLD
-
-
-#if HAVE_MACH_O_DYLD_H
-#if !defined(__APPLE_CC__) && !defined(__MWERKS__) && !defined(__private_extern__)
-/* Is this correct? Does it still function properly? */
-#define __private_extern__ extern
-#endif
-# include <mach-o/dyld.h>
-#endif
-#include <mach-o/getsect.h>
-
-/* We have to put some stuff here that isn't in older dyld.h files */
-#ifndef ENUM_DYLD_BOOL
-# define ENUM_DYLD_BOOL
-# undef FALSE
-# undef TRUE
- enum DYLD_BOOL {
- FALSE,
- TRUE
- };
-#endif
-#ifndef LC_REQ_DYLD
-# define LC_REQ_DYLD 0x80000000
-#endif
-#ifndef LC_LOAD_WEAK_DYLIB
-# define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD)
-#endif
-static const struct mach_header * (*ltdl_NSAddImage)(const char *image_name, unsigned long options) = 0;
-static NSSymbol (*ltdl_NSLookupSymbolInImage)(const struct mach_header *image,const char *symbolName, unsigned long options) = 0;
-static enum DYLD_BOOL (*ltdl_NSIsSymbolNameDefinedInImage)(const struct mach_header *image, const char *symbolName) = 0;
-static enum DYLD_BOOL (*ltdl_NSMakePrivateModulePublic)(NSModule module) = 0;
-
-#ifndef NSADDIMAGE_OPTION_NONE
-#define NSADDIMAGE_OPTION_NONE 0x0
-#endif
-#ifndef NSADDIMAGE_OPTION_RETURN_ON_ERROR
-#define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1
-#endif
-#ifndef NSADDIMAGE_OPTION_WITH_SEARCHING
-#define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2
-#endif
-#ifndef NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED
-#define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4
-#endif
-#ifndef NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME
-#define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8
-#endif
-#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND
-#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0
-#endif
-#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW
-#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1
-#endif
-#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY
-#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2
-#endif
-#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR
-#define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4
-#endif
-
-
-static const char *
-lt_int_dyld_error(othererror)
- char* othererror;
-{
-/* return the dyld error string, or the passed in error string if none */
- NSLinkEditErrors ler;
- int lerno;
- const char *errstr;
- const char *file;
- NSLinkEditError(&ler,&lerno,&file,&errstr);
- if (!errstr || !strlen(errstr)) errstr = othererror;
- return errstr;
-}
-
-static const struct mach_header *
-lt_int_dyld_get_mach_header_from_nsmodule(module)
- NSModule module;
-{
-/* There should probably be an apple dyld api for this */
- int i=_dyld_image_count();
- int j;
- const char *modname=NSNameOfModule(module);
- const struct mach_header *mh=NULL;
- if (!modname) return NULL;
- for (j = 0; j < i; j++)
- {
- if (!strcmp(_dyld_get_image_name(j),modname))
- {
- mh=_dyld_get_image_header(j);
- break;
- }
- }
- return mh;
-}
-
-static const char* lt_int_dyld_lib_install_name(mh)
- const struct mach_header *mh;
-{
-/* NSAddImage is also used to get the loaded image, but it only works if the lib
- is installed, for uninstalled libs we need to check the install_names against
- each other. Note that this is still broken if DYLD_IMAGE_SUFFIX is set and a
- different lib was loaded as a result
-*/
- int j;
- struct load_command *lc;
- unsigned long offset = sizeof(struct mach_header);
- const char* retStr=NULL;
- for (j = 0; j < mh->ncmds; j++)
- {
- lc = (struct load_command*)(((unsigned long)mh) + offset);
- if (LC_ID_DYLIB == lc->cmd)
- {
- retStr=(char*)(((struct dylib_command*)lc)->dylib.name.offset +
- (unsigned long)lc);
- }
- offset += lc->cmdsize;
- }
- return retStr;
-}
-
-static const struct mach_header *
-lt_int_dyld_match_loaded_lib_by_install_name(const char *name)
-{
- int i=_dyld_image_count();
- int j;
- const struct mach_header *mh=NULL;
- const char *id=NULL;
- for (j = 0; j < i; j++)
- {
- id=lt_int_dyld_lib_install_name(_dyld_get_image_header(j));
- if ((id) && (!strcmp(id,name)))
- {
- mh=_dyld_get_image_header(j);
- break;
- }
- }
- return mh;
-}
-
-static NSSymbol
-lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh)
- const char *symbol;
- const struct mach_header *mh;
-{
- /* Safe to assume our mh is good */
- int j;
- struct load_command *lc;
- unsigned long offset = sizeof(struct mach_header);
- NSSymbol retSym = 0;
- const struct mach_header *mh1;
- if ((ltdl_NSLookupSymbolInImage) && NSIsSymbolNameDefined(symbol) )
- {
- for (j = 0; j < mh->ncmds; j++)
- {
- lc = (struct load_command*)(((unsigned long)mh) + offset);
- if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd))
- {
- mh1=lt_int_dyld_match_loaded_lib_by_install_name((char*)(((struct dylib_command*)lc)->dylib.name.offset +
- (unsigned long)lc));
- if (!mh1)
- {
- /* Maybe NSAddImage can find it */
- mh1=ltdl_NSAddImage((char*)(((struct dylib_command*)lc)->dylib.name.offset +
- (unsigned long)lc),
- NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED +
- NSADDIMAGE_OPTION_WITH_SEARCHING +
- NSADDIMAGE_OPTION_RETURN_ON_ERROR );
- }
- if (mh1)
- {
- retSym = ltdl_NSLookupSymbolInImage(mh1,
- symbol,
- NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW
- | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR
- );
- if (retSym) break;
- }
- }
- offset += lc->cmdsize;
- }
- }
- return retSym;
-}
-
-static int
-sys_dyld_init()
-{
- int retCode = 0;
- int err = 0;
- if (!_dyld_present()) {
- retCode=1;
- }
- else {
- err = _dyld_func_lookup("__dyld_NSAddImage",(unsigned long*)&ltdl_NSAddImage);
- err = _dyld_func_lookup("__dyld_NSLookupSymbolInImage",(unsigned long*)&ltdl_NSLookupSymbolInImage);
- err = _dyld_func_lookup("__dyld_NSIsSymbolNameDefinedInImage",(unsigned long*)&ltdl_NSIsSymbolNameDefinedInImage);
- err = _dyld_func_lookup("__dyld_NSMakePrivateModulePublic",(unsigned long*)&ltdl_NSMakePrivateModulePublic);
- }
- return retCode;
-}
-
-static lt_module
-sys_dyld_open (loader_data, filename)
- lt_user_data loader_data;
- const char *filename;
-{
- lt_module module = 0;
- NSObjectFileImage ofi = 0;
- NSObjectFileImageReturnCode ofirc;
-
- if (!filename)
- return (lt_module)-1;
- ofirc = NSCreateObjectFileImageFromFile(filename, &ofi);
- switch (ofirc)
- {
- case NSObjectFileImageSuccess:
- module = NSLinkModule(ofi, filename,
- NSLINKMODULE_OPTION_RETURN_ON_ERROR
- | NSLINKMODULE_OPTION_PRIVATE
- | NSLINKMODULE_OPTION_BINDNOW);
- NSDestroyObjectFileImage(ofi);
- if (module)
- ltdl_NSMakePrivateModulePublic(module);
- break;
- case NSObjectFileImageInappropriateFile:
- if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage)
- {
- module = (lt_module)ltdl_NSAddImage(filename, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
- break;
- }
- default:
- LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_OPEN)));
- return 0;
- }
- if (!module) LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_OPEN)));
- return module;
-}
-
-static int
-sys_dyld_close (loader_data, module)
- lt_user_data loader_data;
- lt_module module;
-{
- int retCode = 0;
- int flags = 0;
- if (module == (lt_module)-1) return 0;
-#ifdef __BIG_ENDIAN__
- if (((struct mach_header *)module)->magic == MH_MAGIC)
-#else
- if (((struct mach_header *)module)->magic == MH_CIGAM)
-#endif
- {
- LT_DLMUTEX_SETERROR("Can not close a dylib");
- retCode = 1;
- }
- else
- {
-#if 1
-/* Currently, if a module contains c++ static destructors and it is unloaded, we
- get a segfault in atexit(), due to compiler and dynamic loader differences of
- opinion, this works around that.
-*/
- if ((const struct section *)NULL !=
- getsectbynamefromheader(lt_int_dyld_get_mach_header_from_nsmodule(module),
- "__DATA","__mod_term_func"))
- {
- flags += NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED;
- }
-#endif
-#ifdef __ppc__
- flags += NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES;
-#endif
- if (!NSUnLinkModule(module,flags))
- {
- retCode=1;
- LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_CLOSE)));
- }
- }
-
- return retCode;
-}
-
-static lt_ptr
-sys_dyld_sym (loader_data, module, symbol)
- lt_user_data loader_data;
- lt_module module;
- const char *symbol;
-{
- lt_ptr address = 0;
- NSSymbol *nssym = 0;
- void *unused;
- const struct mach_header *mh=NULL;
- char saveError[256] = "Symbol not found";
- if (module == (lt_module)-1)
- {
- _dyld_lookup_and_bind(symbol,(unsigned long*)&address,&unused);
- return address;
- }
-#ifdef __BIG_ENDIAN__
- if (((struct mach_header *)module)->magic == MH_MAGIC)
-#else
- if (((struct mach_header *)module)->magic == MH_CIGAM)
-#endif
- {
- if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage)
- {
- mh=module;
- if (ltdl_NSIsSymbolNameDefinedInImage((struct mach_header*)module,symbol))
- {
- nssym = ltdl_NSLookupSymbolInImage((struct mach_header*)module,
- symbol,
- NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW
- | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR
- );
- }
- }
-
- }
- else {
- nssym = NSLookupSymbolInModule(module, symbol);
- }
- if (!nssym)
- {
- strncpy(saveError, lt_int_dyld_error(LT_DLSTRERROR(SYMBOL_NOT_FOUND)), 255);
- saveError[255] = 0;
- if (!mh) mh=lt_int_dyld_get_mach_header_from_nsmodule(module);
- nssym = lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh);
- }
- if (!nssym)
- {
- LT_DLMUTEX_SETERROR (saveError);
- return NULL;
- }
- return NSAddressOfSymbol(nssym);
-}
-
-static struct lt_user_dlloader sys_dyld =
- { "_", sys_dyld_open, sys_dyld_close, sys_dyld_sym, 0, 0 };
-
-
-#endif /* HAVE_DYLD */
-
-
-/* --- DLPREOPEN() INTERFACE LOADER --- */
-
-
-/* emulate dynamic linking using preloaded_symbols */
-
-typedef struct lt_dlsymlists_t
-{
- struct lt_dlsymlists_t *next;
- const lt_dlsymlist *syms;
-} lt_dlsymlists_t;
-
-static const lt_dlsymlist *default_preloaded_symbols = 0;
-static lt_dlsymlists_t *preloaded_symbols = 0;
-
-static int
-presym_init (loader_data)
- lt_user_data loader_data;
-{
- int errors = 0;
-
- LT_DLMUTEX_LOCK ();
-
- preloaded_symbols = 0;
- if (default_preloaded_symbols)
- {
- errors = lt_dlpreload (default_preloaded_symbols);
- }
-
- LT_DLMUTEX_UNLOCK ();
-
- return errors;
-}
-
-static int
-presym_free_symlists ()
-{
- lt_dlsymlists_t *lists;
-
- LT_DLMUTEX_LOCK ();
-
- lists = preloaded_symbols;
- while (lists)
- {
- lt_dlsymlists_t *tmp = lists;
-
- lists = lists->next;
- LT_DLFREE (tmp);
- }
- preloaded_symbols = 0;
-
- LT_DLMUTEX_UNLOCK ();
-
- return 0;
-}
-
-static int
-presym_exit (loader_data)
- lt_user_data loader_data;
-{
- presym_free_symlists ();
- return 0;
-}
-
-static int
-presym_add_symlist (preloaded)
- const lt_dlsymlist *preloaded;
-{
- lt_dlsymlists_t *tmp;
- lt_dlsymlists_t *lists;
- int errors = 0;
-
- LT_DLMUTEX_LOCK ();
-
- lists = preloaded_symbols;
- while (lists)
- {
- if (lists->syms == preloaded)
- {
- goto done;
- }
- lists = lists->next;
- }
-
- tmp = LT_EMALLOC (lt_dlsymlists_t, 1);
- if (tmp)
- {
- memset (tmp, 0, sizeof(lt_dlsymlists_t));
- tmp->syms = preloaded;
- tmp->next = preloaded_symbols;
- preloaded_symbols = tmp;
- }
- else
- {
- ++errors;
- }
-
- done:
- LT_DLMUTEX_UNLOCK ();
- return errors;
-}
-
-static lt_module
-presym_open (loader_data, filename)
- lt_user_data loader_data;
- const char *filename;
-{
- lt_dlsymlists_t *lists;
- lt_module module = (lt_module) 0;
-
- LT_DLMUTEX_LOCK ();
- lists = preloaded_symbols;
-
- if (!lists)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_SYMBOLS));
- goto done;
- }
-
- /* Can't use NULL as the reflective symbol header, as NULL is
- used to mark the end of the entire symbol list. Self-dlpreopened
- symbols follow this magic number, chosen to be an unlikely
- clash with a real module name. */
- if (!filename)
- {
- filename = "@PROGRAM@";
- }
-
- while (lists)
- {
- const lt_dlsymlist *syms = lists->syms;
-
- while (syms->name)
- {
- if (!syms->address && strcmp(syms->name, filename) == 0)
- {
- module = (lt_module) syms;
- goto done;
- }
- ++syms;
- }
-
- lists = lists->next;
- }
-
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND));
-
- done:
- LT_DLMUTEX_UNLOCK ();
- return module;
-}
-
-static int
-presym_close (loader_data, module)
- lt_user_data loader_data;
- lt_module module;
-{
- /* Just to silence gcc -Wall */
- module = 0;
- return 0;
-}
-
-static lt_ptr
-presym_sym (loader_data, module, symbol)
- lt_user_data loader_data;
- lt_module module;
- const char *symbol;
-{
- lt_dlsymlist *syms = (lt_dlsymlist*) module;
-
- ++syms;
- while (syms->address)
- {
- if (strcmp(syms->name, symbol) == 0)
- {
- return syms->address;
- }
-
- ++syms;
- }
-
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
-
- return 0;
-}
-
-static struct lt_user_dlloader presym = {
- 0, presym_open, presym_close, presym_sym, presym_exit, 0
-};
-
-
-
-
-
-/* --- DYNAMIC MODULE LOADING --- */
-
-
-/* The type of a function used at each iteration of foreach_dirinpath(). */
-typedef int foreach_callback_func LT_PARAMS((char *filename, lt_ptr data1,
- lt_ptr data2));
-
-static int foreach_dirinpath LT_PARAMS((const char *search_path,
- const char *base_name,
- foreach_callback_func *func,
- lt_ptr data1, lt_ptr data2));
-
-static int find_file_callback LT_PARAMS((char *filename, lt_ptr data,
- lt_ptr ignored));
-static int find_handle_callback LT_PARAMS((char *filename, lt_ptr data,
- lt_ptr ignored));
-static int foreachfile_callback LT_PARAMS((char *filename, lt_ptr data1,
- lt_ptr data2));
-
-
-static int canonicalize_path LT_PARAMS((const char *path,
- char **pcanonical));
-static int argzize_path LT_PARAMS((const char *path,
- char **pargz,
- size_t *pargz_len));
-static FILE *find_file LT_PARAMS((const char *search_path,
- const char *base_name,
- char **pdir));
-static lt_dlhandle *find_handle LT_PARAMS((const char *search_path,
- const char *base_name,
- lt_dlhandle *handle));
-static int find_module LT_PARAMS((lt_dlhandle *handle,
- const char *dir,
- const char *libdir,
- const char *dlname,
- const char *old_name,
- int installed));
-static int free_vars LT_PARAMS((char *dlname, char *oldname,
- char *libdir, char *deplibs));
-static int load_deplibs LT_PARAMS((lt_dlhandle handle,
- char *deplibs));
-static int trim LT_PARAMS((char **dest,
- const char *str));
-static int try_dlopen LT_PARAMS((lt_dlhandle *handle,
- const char *filename));
-static int tryall_dlopen LT_PARAMS((lt_dlhandle *handle,
- const char *filename));
-static int unload_deplibs LT_PARAMS((lt_dlhandle handle));
-static int lt_argz_insert LT_PARAMS((char **pargz,
- size_t *pargz_len,
- char *before,
- const char *entry));
-static int lt_argz_insertinorder LT_PARAMS((char **pargz,
- size_t *pargz_len,
- const char *entry));
-static int lt_argz_insertdir LT_PARAMS((char **pargz,
- size_t *pargz_len,
- const char *dirnam,
- struct dirent *dp));
-static int lt_dlpath_insertdir LT_PARAMS((char **ppath,
- char *before,
- const char *dir));
-static int list_files_by_dir LT_PARAMS((const char *dirnam,
- char **pargz,
- size_t *pargz_len));
-static int file_not_found LT_PARAMS((void));
-
-static char *user_search_path= 0;
-static lt_dlloader *loaders = 0;
-static lt_dlhandle handles = 0;
-static int initialized = 0;
-
-/* Initialize libltdl. */
-int
-lt_dlinit ()
-{
- int errors = 0;
-
- LT_DLMUTEX_LOCK ();
-
- /* Initialize only at first call. */
- if (++initialized == 1)
- {
- handles = 0;
- user_search_path = 0; /* empty search path */
-
-#if HAVE_LIBDL
- errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen");
-#endif
-#if HAVE_SHL_LOAD
- errors += lt_dlloader_add (lt_dlloader_next (0), &sys_shl, "dlopen");
-#endif
-#ifdef __WINDOWS__
- errors += lt_dlloader_add (lt_dlloader_next (0), &sys_wll, "dlopen");
-#endif
-#ifdef __BEOS__
- errors += lt_dlloader_add (lt_dlloader_next (0), &sys_bedl, "dlopen");
-#endif
-#if HAVE_DLD
- errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dld, "dld");
-#endif
-#if HAVE_DYLD
- errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dyld, "dyld");
- errors += sys_dyld_init();
-#endif
- errors += lt_dlloader_add (lt_dlloader_next (0), &presym, "dlpreload");
-
- if (presym_init (presym.dlloader_data))
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INIT_LOADER));
- ++errors;
- }
- else if (errors != 0)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (DLOPEN_NOT_SUPPORTED));
- ++errors;
- }
- }
-
- LT_DLMUTEX_UNLOCK ();
-
- return errors;
-}
-
-int
-lt_dlpreload (preloaded)
- const lt_dlsymlist *preloaded;
-{
- int errors = 0;
-
- if (preloaded)
- {
- errors = presym_add_symlist (preloaded);
- }
- else
- {
- presym_free_symlists();
-
- LT_DLMUTEX_LOCK ();
- if (default_preloaded_symbols)
- {
- errors = lt_dlpreload (default_preloaded_symbols);
- }
- LT_DLMUTEX_UNLOCK ();
- }
-
- return errors;
-}
-
-int
-lt_dlpreload_default (preloaded)
- const lt_dlsymlist *preloaded;
-{
- LT_DLMUTEX_LOCK ();
- default_preloaded_symbols = preloaded;
- LT_DLMUTEX_UNLOCK ();
- return 0;
-}
-
-int
-lt_dlexit ()
-{
- /* shut down libltdl */
- lt_dlloader *loader;
- int errors = 0;
-
- LT_DLMUTEX_LOCK ();
- loader = loaders;
-
- if (!initialized)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SHUTDOWN));
- ++errors;
- goto done;
- }
-
- /* shut down only at last call. */
- if (--initialized == 0)
- {
- int level;
-
- while (handles && LT_DLIS_RESIDENT (handles))
- {
- handles = handles->next;
- }
-
- /* close all modules */
- for (level = 1; handles; ++level)
- {
- lt_dlhandle cur = handles;
- int saw_nonresident = 0;
-
- while (cur)
- {
- lt_dlhandle tmp = cur;
- cur = cur->next;
- if (!LT_DLIS_RESIDENT (tmp))
- saw_nonresident = 1;
- if (!LT_DLIS_RESIDENT (tmp) && tmp->info.ref_count <= level)
- {
- if (lt_dlclose (tmp))
- {
- ++errors;
- }
- }
- }
- /* done if only resident modules are left */
- if (!saw_nonresident)
- break;
- }
-
- /* close all loaders */
- while (loader)
- {
- lt_dlloader *next = loader->next;
- lt_user_data data = loader->dlloader_data;
- if (loader->dlloader_exit && loader->dlloader_exit (data))
- {
- ++errors;
- }
-
- LT_DLMEM_REASSIGN (loader, next);
- }
- loaders = 0;
- }
-
- done:
- LT_DLMUTEX_UNLOCK ();
- return errors;
-}
-
-static int
-tryall_dlopen (handle, filename)
- lt_dlhandle *handle;
- const char *filename;
-{
- lt_dlhandle cur;
- lt_dlloader *loader;
- const char *saved_error;
- int errors = 0;
-
- LT_DLMUTEX_GETERROR (saved_error);
- LT_DLMUTEX_LOCK ();
-
- cur = handles;
- loader = loaders;
-
- /* check whether the module was already opened */
- while (cur)
- {
- /* try to dlopen the program itself? */
- if (!cur->info.filename && !filename)
- {
- break;
- }
-
- if (cur->info.filename && filename
- && strcmp (cur->info.filename, filename) == 0)
- {
- break;
- }
-
- cur = cur->next;
- }
-
- if (cur)
- {
- ++cur->info.ref_count;
- *handle = cur;
- goto done;
- }
-
- cur = *handle;
- if (filename)
- {
- /* Comment out the check of file permissions using access.
- This call seems to always return -1 with error EACCES.
- */
- /* We need to catch missing file errors early so that
- file_not_found() can detect what happened.
- if (access (filename, R_OK) != 0)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND));
- ++errors;
- goto done;
- } */
-
- cur->info.filename = lt_estrdup (filename);
- if (!cur->info.filename)
- {
- ++errors;
- goto done;
- }
- }
- else
- {
- cur->info.filename = 0;
- }
-
- while (loader)
- {
- lt_user_data data = loader->dlloader_data;
-
- cur->module = loader->module_open (data, filename);
-
- if (cur->module != 0)
- {
- break;
- }
- loader = loader->next;
- }
-
- if (!loader)
- {
- LT_DLFREE (cur->info.filename);
- ++errors;
- goto done;
- }
-
- cur->loader = loader;
- LT_DLMUTEX_SETERROR (saved_error);
-
- done:
- LT_DLMUTEX_UNLOCK ();
-
- return errors;
-}
-
-static int
-tryall_dlopen_module (handle, prefix, dirname, dlname)
- lt_dlhandle *handle;
- const char *prefix;
- const char *dirname;
- const char *dlname;
-{
- int error = 0;
- char *filename = 0;
- size_t filename_len = 0;
- size_t dirname_len = LT_STRLEN (dirname);
-
- assert (handle);
- assert (dirname);
- assert (dlname);
-#ifdef LT_DIRSEP_CHAR
- /* Only canonicalized names (i.e. with DIRSEP chars already converted)
- should make it into this function: */
- assert (strchr (dirname, LT_DIRSEP_CHAR) == 0);
-#endif
-
- if (dirname_len > 0)
- if (dirname[dirname_len -1] == '/')
- --dirname_len;
- filename_len = dirname_len + 1 + LT_STRLEN (dlname);
-
- /* Allocate memory, and combine DIRNAME and MODULENAME into it.
- The PREFIX (if any) is handled below. */
- filename = LT_EMALLOC (char, dirname_len + 1 + filename_len + 1);
- if (!filename)
- return 1;
-
- sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname);
-
- /* Now that we have combined DIRNAME and MODULENAME, if there is
- also a PREFIX to contend with, simply recurse with the arguments
- shuffled. Otherwise, attempt to open FILENAME as a module. */
- if (prefix)
- {
- error += tryall_dlopen_module (handle,
- (const char *) 0, prefix, filename);
- }
- else if (tryall_dlopen (handle, filename) != 0)
- {
- ++error;
- }
-
- LT_DLFREE (filename);
- return error;
-}
-
-static int
-find_module (handle, dir, libdir, dlname, old_name, installed)
- lt_dlhandle *handle;
- const char *dir;
- const char *libdir;
- const char *dlname;
- const char *old_name;
- int installed;
-{
- /* Try to open the old library first; if it was dlpreopened,
- we want the preopened version of it, even if a dlopenable
- module is available. */
- if (old_name && tryall_dlopen (handle, old_name) == 0)
- {
- return 0;
- }
-
- /* Try to open the dynamic library. */
- if (dlname)
- {
- /* try to open the installed module */
- if (installed && libdir)
- {
- if (tryall_dlopen_module (handle,
- (const char *) 0, libdir, dlname) == 0)
- return 0;
- }
-
- /* try to open the not-installed module */
- if (!installed)
- {
- if (tryall_dlopen_module (handle, dir, objdir, dlname) == 0)
- return 0;
- }
-
- /* maybe it was moved to another directory */
- {
- if (dir && (tryall_dlopen_module (handle,
- (const char *) 0, dir, dlname) == 0))
- return 0;
- }
- }
-
- return 1;
-}
-
-
-static int
-canonicalize_path (path, pcanonical)
- const char *path;
- char **pcanonical;
-{
- char *canonical = 0;
-
- assert (path && *path);
- assert (pcanonical);
-
- canonical = LT_EMALLOC (char, 1+ LT_STRLEN (path));
- if (!canonical)
- return 1;
-
- {
- size_t dest = 0;
- size_t src;
- for (src = 0; path[src] != LT_EOS_CHAR; ++src)
- {
- /* Path separators are not copied to the beginning or end of
- the destination, or if another separator would follow
- immediately. */
- if (path[src] == LT_PATHSEP_CHAR)
- {
- if ((dest == 0)
- || (path[1+ src] == LT_PATHSEP_CHAR)
- || (path[1+ src] == LT_EOS_CHAR))
- continue;
- }
-
- /* Anything other than a directory separator is copied verbatim. */
- if ((path[src] != '/')
-#ifdef LT_DIRSEP_CHAR
- && (path[src] != LT_DIRSEP_CHAR)
-#endif
- )
- {
- canonical[dest++] = path[src];
- }
- /* Directory separators are converted and copied only if they are
- not at the end of a path -- i.e. before a path separator or
- NULL terminator. */
- else if ((path[1+ src] != LT_PATHSEP_CHAR)
- && (path[1+ src] != LT_EOS_CHAR)
-#ifdef LT_DIRSEP_CHAR
- && (path[1+ src] != LT_DIRSEP_CHAR)
-#endif
- && (path[1+ src] != '/'))
- {
- canonical[dest++] = '/';
- }
- }
-
- /* Add an end-of-string marker at the end. */
- canonical[dest] = LT_EOS_CHAR;
- }
-
- /* Assign new value. */
- *pcanonical = canonical;
-
- return 0;
-}
-
-static int
-argzize_path (path, pargz, pargz_len)
- const char *path;
- char **pargz;
- size_t *pargz_len;
-{
- error_t error;
-
- assert (path);
- assert (pargz);
- assert (pargz_len);
-
- if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len)))
- {
- switch (error)
- {
- case ENOMEM:
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));
- break;
- default:
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN));
- break;
- }
-
- return 1;
- }
-
- return 0;
-}
-
-/* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element
- of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns
- non-zero or all elements are exhausted. If BASE_NAME is non-NULL,
- it is appended to each SEARCH_PATH element before FUNC is called. */
-static int
-foreach_dirinpath (search_path, base_name, func, data1, data2)
- const char *search_path;
- const char *base_name;
- foreach_callback_func *func;
- lt_ptr data1;
- lt_ptr data2;
-{
- int result = 0;
- int filenamesize = 0;
- size_t lenbase = LT_STRLEN (base_name);
- size_t argz_len = 0;
- char *argz = 0;
- char *filename = 0;
- char *canonical = 0;
-
- LT_DLMUTEX_LOCK ();
-
- if (!search_path || !*search_path)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND));
- goto cleanup;
- }
-
- if (canonicalize_path (search_path, &canonical) != 0)
- goto cleanup;
-
- if (argzize_path (canonical, &argz, &argz_len) != 0)
- goto cleanup;
-
- {
- char *dir_name = 0;
- while ((dir_name = argz_next (argz, argz_len, dir_name)))
- {
- size_t lendir = LT_STRLEN (dir_name);
-
- if (lendir +1 +lenbase >= filenamesize)
- {
- LT_DLFREE (filename);
- filenamesize = lendir +1 +lenbase +1; /* "/d" + '/' + "f" + '\0' */
- filename = LT_EMALLOC (char, filenamesize);
- if (!filename)
- goto cleanup;
- }
-
- assert (filenamesize > lendir);
- strcpy (filename, dir_name);
-
- if (base_name && *base_name)
- {
- if (filename[lendir -1] != '/')
- filename[lendir++] = '/';
- strcpy (filename +lendir, base_name);
- }
-
- if ((result = (*func) (filename, data1, data2)))
- {
- break;
- }
- }
- }
-
- cleanup:
- LT_DLFREE (argz);
- LT_DLFREE (canonical);
- LT_DLFREE (filename);
-
- LT_DLMUTEX_UNLOCK ();
-
- return result;
-}
-
-/* If FILEPATH can be opened, store the name of the directory component
- in DATA1, and the opened FILE* structure address in DATA2. Otherwise
- DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */
-static int
-find_file_callback (filename, data1, data2)
- char *filename;
- lt_ptr data1;
- lt_ptr data2;
-{
- char **pdir = (char **) data1;
- FILE **pfile = (FILE **) data2;
- int is_done = 0;
-
- assert (filename && *filename);
- assert (pdir);
- assert (pfile);
-
- if ((*pfile = fopen (filename, LT_READTEXT_MODE)))
- {
- char *dirend = strrchr (filename, '/');
-
- if (dirend > filename)
- *dirend = LT_EOS_CHAR;
-
- LT_DLFREE (*pdir);
- *pdir = lt_estrdup (filename);
- is_done = (*pdir == 0) ? -1 : 1;
- }
-
- return is_done;
-}
-
-static FILE *
-find_file (search_path, base_name, pdir)
- const char *search_path;
- const char *base_name;
- char **pdir;
-{
- FILE *file = 0;
-
- foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file);
-
- return file;
-}
-
-static int
-find_handle_callback (filename, data, ignored)
- char *filename;
- lt_ptr data;
- lt_ptr ignored;
-{
- lt_dlhandle *handle = (lt_dlhandle *) data;
- int notfound = access (filename, R_OK);
-
- /* Bail out if file cannot be read... */
- if (notfound)
- return 0;
-
- /* Try to dlopen the file, but do not continue searching in any
- case. */
- if (tryall_dlopen (handle, filename) != 0)
- *handle = 0;
-
- return 1;
-}
-
-/* If HANDLE was found return it, otherwise return 0. If HANDLE was
- found but could not be opened, *HANDLE will be set to 0. */
-static lt_dlhandle *
-find_handle (search_path, base_name, handle)
- const char *search_path;
- const char *base_name;
- lt_dlhandle *handle;
-{
- if (!search_path)
- return 0;
-
- if (!foreach_dirinpath (search_path, base_name, find_handle_callback,
- handle, 0))
- return 0;
-
- return handle;
-}
-
-static int
-load_deplibs (handle, deplibs)
- lt_dlhandle handle;
- char *deplibs;
-{
-#if LTDL_DLOPEN_DEPLIBS
- char *p, *save_search_path = 0;
- int depcount = 0;
- int i;
- char **names = 0;
-#endif
- int errors = 0;
-
- handle->depcount = 0;
-
-#if LTDL_DLOPEN_DEPLIBS
- if (!deplibs)
- {
- return errors;
- }
- ++errors;
-
- LT_DLMUTEX_LOCK ();
- if (user_search_path)
- {
- save_search_path = lt_estrdup (user_search_path);
- if (!save_search_path)
- goto cleanup;
- }
-
- /* extract search paths and count deplibs */
- p = deplibs;
- while (*p)
- {
- if (!isspace ((int) *p))
- {
- char *end = p+1;
- while (*end && !isspace((int) *end))
- {
- ++end;
- }
-
- if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0)
- {
- char save = *end;
- *end = 0; /* set a temporary string terminator */
- if (lt_dladdsearchdir(p+2))
- {
- goto cleanup;
- }
- *end = save;
- }
- else
- {
- ++depcount;
- }
-
- p = end;
- }
- else
- {
- ++p;
- }
- }
-
- if (!depcount)
- {
- errors = 0;
- goto cleanup;
- }
-
- names = LT_EMALLOC (char *, depcount * sizeof (char*));
- if (!names)
- goto cleanup;
-
- /* now only extract the actual deplibs */
- depcount = 0;
- p = deplibs;
- while (*p)
- {
- if (isspace ((int) *p))
- {
- ++p;
- }
- else
- {
- char *end = p+1;
- while (*end && !isspace ((int) *end))
- {
- ++end;
- }
-
- if (strncmp(p, "-L", 2) != 0 && strncmp(p, "-R", 2) != 0)
- {
- char *name;
- char save = *end;
- *end = 0; /* set a temporary string terminator */
- if (strncmp(p, "-l", 2) == 0)
- {
- size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2);
- name = LT_EMALLOC (char, 1+ name_len);
- if (name)
- sprintf (name, "lib%s", p+2);
- }
- else
- name = lt_estrdup(p);
-
- if (!name)
- goto cleanup_names;
-
- names[depcount++] = name;
- *end = save;
- }
- p = end;
- }
- }
-
- /* load the deplibs (in reverse order)
- At this stage, don't worry if the deplibs do not load correctly,
- they may already be statically linked into the loading application
- for instance. There will be a more enlightening error message
- later on if the loaded module cannot resolve all of its symbols. */
- if (depcount)
- {
- int j = 0;
-
- handle->deplibs = (lt_dlhandle*) LT_EMALLOC (lt_dlhandle *, depcount);
- if (!handle->deplibs)
- goto cleanup;
-
- for (i = 0; i < depcount; ++i)
- {
- handle->deplibs[j] = lt_dlopenext(names[depcount-1-i]);
- if (handle->deplibs[j])
- {
- ++j;
- }
- }
-
- handle->depcount = j; /* Number of successfully loaded deplibs */
- errors = 0;
- }
-
- cleanup_names:
- for (i = 0; i < depcount; ++i)
- {
- LT_DLFREE (names[i]);
- }
-
- cleanup:
- LT_DLFREE (names);
- /* restore the old search path */
- if (user_search_path) {
- LT_DLFREE (user_search_path);
- user_search_path = save_search_path;
- }
- LT_DLMUTEX_UNLOCK ();
-
-#endif
-
- return errors;
-}
-
-static int
-unload_deplibs (handle)
- lt_dlhandle handle;
-{
- int i;
- int errors = 0;
-
- if (handle->depcount)
- {
- for (i = 0; i < handle->depcount; ++i)
- {
- if (!LT_DLIS_RESIDENT (handle->deplibs[i]))
- {
- errors += lt_dlclose (handle->deplibs[i]);
- }
- }
- }
-
- return errors;
-}
-
-static int
-trim (dest, str)
- char **dest;
- const char *str;
-{
- /* remove the leading and trailing "'" from str
- and store the result in dest */
- const char *end = strrchr (str, '\'');
- size_t len = LT_STRLEN (str);
- char *tmp;
-
- LT_DLFREE (*dest);
-
- if (!end)
- return 1;
-
- if (len > 3 && str[0] == '\'')
- {
- tmp = LT_EMALLOC (char, end - str);
- if (!tmp)
- return 1;
-
- strncpy(tmp, &str[1], (end - str) - 1);
- tmp[len-3] = LT_EOS_CHAR;
- *dest = tmp;
- }
- else
- {
- *dest = 0;
- }
-
- return 0;
-}
-
-static int
-free_vars (dlname, oldname, libdir, deplibs)
- char *dlname;
- char *oldname;
- char *libdir;
- char *deplibs;
-{
- LT_DLFREE (dlname);
- LT_DLFREE (oldname);
- LT_DLFREE (libdir);
- LT_DLFREE (deplibs);
-
- return 0;
-}
-
-static int
-try_dlopen (phandle, filename)
- lt_dlhandle *phandle;
- const char *filename;
-{
- const char * ext = 0;
- const char * saved_error = 0;
- char * canonical = 0;
- char * base_name = 0;
- char * dir = 0;
- char * name = 0;
- int errors = 0;
- lt_dlhandle newhandle;
-
- assert (phandle);
- assert (*phandle == 0);
-
- LT_DLMUTEX_GETERROR (saved_error);
-
- /* dlopen self? */
- if (!filename)
- {
- *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1);
- if (*phandle == 0)
- return 1;
-
- memset (*phandle, 0, sizeof(struct lt_dlhandle_struct));
- newhandle = *phandle;
-
- /* lt_dlclose()ing yourself is very bad! Disallow it. */
- LT_DLSET_FLAG (*phandle, LT_DLRESIDENT_FLAG);
-
- if (tryall_dlopen (&newhandle, 0) != 0)
- {
- LT_DLFREE (*phandle);
- return 1;
- }
-
- goto register_handle;
- }
-
- assert (filename && *filename);
-
- /* Doing this immediately allows internal functions to safely
- assume only canonicalized paths are passed. */
- if (canonicalize_path (filename, &canonical) != 0)
- {
- ++errors;
- goto cleanup;
- }
-
- /* If the canonical module name is a path (relative or absolute)
- then split it into a directory part and a name part. */
- base_name = strrchr (canonical, '/');
- if (base_name)
- {
- size_t dirlen = (1+ base_name) - canonical;
-
- dir = LT_EMALLOC (char, 1+ dirlen);
- if (!dir)
- {
- ++errors;
- goto cleanup;
- }
-
- strncpy (dir, canonical, dirlen);
- dir[dirlen] = LT_EOS_CHAR;
-
- ++base_name;
- }
- else
- base_name = canonical;
-
- assert (base_name && *base_name);
-
- /* Check whether we are opening a libtool module (.la extension). */
- ext = strrchr (base_name, '.');
- if (ext && strcmp (ext, archive_ext) == 0)
- {
- /* this seems to be a libtool module */
- FILE * file = 0;
- char * dlname = 0;
- char * old_name = 0;
- char * libdir = 0;
- char * deplibs = 0;
- char * line = 0;
- size_t line_len;
-
- /* if we can't find the installed flag, it is probably an
- installed libtool archive, produced with an old version
- of libtool */
- int installed = 1;
-
- /* extract the module name from the file name */
- name = LT_EMALLOC (char, ext - base_name + 1);
- if (!name)
- {
- ++errors;
- goto cleanup;
- }
-
- /* canonicalize the module name */
- {
- size_t i;
- for (i = 0; i < ext - base_name; ++i)
- {
- if (isalnum ((int)(base_name[i])))
- {
- name[i] = base_name[i];
- }
- else
- {
- name[i] = '_';
- }
- }
- name[ext - base_name] = LT_EOS_CHAR;
- }
-
- /* Now try to open the .la file. If there is no directory name
- component, try to find it first in user_search_path and then other
- prescribed paths. Otherwise (or in any case if the module was not
- yet found) try opening just the module name as passed. */
- if (!dir)
- {
- const char *search_path;
-
- LT_DLMUTEX_LOCK ();
- search_path = user_search_path;
- if (search_path)
- file = find_file (user_search_path, base_name, &dir);
- LT_DLMUTEX_UNLOCK ();
-
- if (!file)
- {
- search_path = getenv (LTDL_SEARCHPATH_VAR);
- if (search_path)
- file = find_file (search_path, base_name, &dir);
- }
-
-#ifdef LTDL_SHLIBPATH_VAR
- if (!file)
- {
- search_path = getenv (LTDL_SHLIBPATH_VAR);
- if (search_path)
- file = find_file (search_path, base_name, &dir);
- }
-#endif
-#ifdef LTDL_SYSSEARCHPATH
- if (!file && sys_search_path)
- {
- file = find_file (sys_search_path, base_name, &dir);
- }
-#endif
- }
- if (!file)
- {
- file = fopen (filename, LT_READTEXT_MODE);
- }
-
- /* If we didn't find the file by now, it really isn't there. Set
- the status flag, and bail out. */
- if (!file)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND));
- ++errors;
- goto cleanup;
- }
-
- line_len = LT_FILENAME_MAX;
- line = LT_EMALLOC (char, line_len);
- if (!line)
- {
- fclose (file);
- ++errors;
- goto cleanup;
- }
-
- /* read the .la file */
- while (!feof (file))
- {
- if (!fgets (line, (int) line_len, file))
- {
- break;
- }
-
- /* Handle the case where we occasionally need to read a line
- that is longer than the initial buffer size. */
- while ((line[LT_STRLEN(line) -1] != '\n') && (!feof (file)))
- {
- line = LT_DLREALLOC (char, line, line_len *2);
- if (!fgets (&line[line_len -1], (int) line_len +1, file))
- {
- break;
- }
- line_len *= 2;
- }
-
- if (line[0] == '\n' || line[0] == '#')
- {
- continue;
- }
-
-#undef STR_DLNAME
-#define STR_DLNAME "dlname="
- if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0)
- {
- errors += trim (&dlname, &line[sizeof (STR_DLNAME) - 1]);
- }
-
-#undef STR_OLD_LIBRARY
-#define STR_OLD_LIBRARY "old_library="
- else if (strncmp (line, STR_OLD_LIBRARY,
- sizeof (STR_OLD_LIBRARY) - 1) == 0)
- {
- errors += trim (&old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]);
- }
-#undef STR_LIBDIR
-#define STR_LIBDIR "libdir="
- else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0)
- {
- errors += trim (&libdir, &line[sizeof(STR_LIBDIR) - 1]);
- }
-
-#undef STR_DL_DEPLIBS
-#define STR_DL_DEPLIBS "dependency_libs="
- else if (strncmp (line, STR_DL_DEPLIBS,
- sizeof (STR_DL_DEPLIBS) - 1) == 0)
- {
- errors += trim (&deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]);
- }
- else if (strcmp (line, "installed=yes\n") == 0)
- {
- installed = 1;
- }
- else if (strcmp (line, "installed=no\n") == 0)
- {
- installed = 0;
- }
-
-#undef STR_LIBRARY_NAMES
-#define STR_LIBRARY_NAMES "library_names="
- else if (! dlname && strncmp (line, STR_LIBRARY_NAMES,
- sizeof (STR_LIBRARY_NAMES) - 1) == 0)
- {
- char *last_libname;
- errors += trim (&dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]);
- if (!errors
- && dlname
- && (last_libname = strrchr (dlname, ' ')) != 0)
- {
- last_libname = lt_estrdup (last_libname + 1);
- if (!last_libname)
- {
- ++errors;
- goto cleanup;
- }
- LT_DLMEM_REASSIGN (dlname, last_libname);
- }
- }
-
- if (errors)
- break;
- }
-
- fclose (file);
- LT_DLFREE (line);
-
- /* allocate the handle */
- *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1);
- if (*phandle == 0)
- ++errors;
-
- if (errors)
- {
- free_vars (dlname, old_name, libdir, deplibs);
- LT_DLFREE (*phandle);
- goto cleanup;
- }
-
- assert (*phandle);
-
- memset (*phandle, 0, sizeof(struct lt_dlhandle_struct));
- if (load_deplibs (*phandle, deplibs) == 0)
- {
- newhandle = *phandle;
- /* find_module may replace newhandle */
- if (find_module (&newhandle, dir, libdir, dlname, old_name, installed))
- {
- unload_deplibs (*phandle);
- ++errors;
- }
- }
- else
- {
- ++errors;
- }
-
- free_vars (dlname, old_name, libdir, deplibs);
- if (errors)
- {
- LT_DLFREE (*phandle);
- goto cleanup;
- }
-
- if (*phandle != newhandle)
- {
- unload_deplibs (*phandle);
- }
- }
- else
- {
- /* not a libtool module */
- *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1);
- if (*phandle == 0)
- {
- ++errors;
- goto cleanup;
- }
-
- memset (*phandle, 0, sizeof (struct lt_dlhandle_struct));
- newhandle = *phandle;
-
- /* If the module has no directory name component, try to find it
- first in user_search_path and then other prescribed paths.
- Otherwise (or in any case if the module was not yet found) try
- opening just the module name as passed. */
- if ((dir || (!find_handle (user_search_path, base_name, &newhandle)
- && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name,
- &newhandle)
-#ifdef LTDL_SHLIBPATH_VAR
- && !find_handle (getenv (LTDL_SHLIBPATH_VAR), base_name,
- &newhandle)
-#endif
-#ifdef LTDL_SYSSEARCHPATH
- && !find_handle (sys_search_path, base_name, &newhandle)
-#endif
- )))
- {
- if (tryall_dlopen (&newhandle, filename) != 0)
- {
- newhandle = NULL;
- }
- }
-
- if (!newhandle)
- {
- LT_DLFREE (*phandle);
- ++errors;
- goto cleanup;
- }
- }
-
- register_handle:
- LT_DLMEM_REASSIGN (*phandle, newhandle);
-
- if ((*phandle)->info.ref_count == 0)
- {
- (*phandle)->info.ref_count = 1;
- LT_DLMEM_REASSIGN ((*phandle)->info.name, name);
-
- LT_DLMUTEX_LOCK ();
- (*phandle)->next = handles;
- handles = *phandle;
- LT_DLMUTEX_UNLOCK ();
- }
-
- LT_DLMUTEX_SETERROR (saved_error);
-
- cleanup:
- LT_DLFREE (dir);
- LT_DLFREE (name);
- LT_DLFREE (canonical);
-
- return errors;
-}
-
-lt_dlhandle
-lt_dlopen (filename)
- const char *filename;
-{
- lt_dlhandle handle = 0;
-
- /* Just incase we missed a code path in try_dlopen() that reports
- an error, but forgets to reset handle... */
- if (try_dlopen (&handle, filename) != 0)
- return 0;
-
- return handle;
-}
-
-/* If the last error messge store was `FILE_NOT_FOUND', then return
- non-zero. */
-static int
-file_not_found ()
-{
- const char *error = 0;
-
- LT_DLMUTEX_GETERROR (error);
- if (error == LT_DLSTRERROR (FILE_NOT_FOUND))
- return 1;
-
- return 0;
-}
-
-/* If FILENAME has an ARCHIVE_EXT or SHLIB_EXT extension, try to
- open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT,
- and if a file is still not found try again with SHLIB_EXT appended
- instead. */
-lt_dlhandle
-lt_dlopenext (filename)
- const char *filename;
-{
- lt_dlhandle handle = 0;
- char * tmp = 0;
- char * ext = 0;
- size_t len;
- int errors = 0;
-
- if (!filename)
- {
- return lt_dlopen (filename);
- }
-
- assert (filename);
-
- len = LT_STRLEN (filename);
- ext = strrchr (filename, '.');
-
- /* If FILENAME already bears a suitable extension, there is no need
- to try appending additional extensions. */
- if (ext && ((strcmp (ext, archive_ext) == 0)
-#ifdef LTDL_SHLIB_EXT
- || (strcmp (ext, shlib_ext) == 0)
-#endif
- ))
- {
- return lt_dlopen (filename);
- }
-
- /* First try appending ARCHIVE_EXT. */
- tmp = LT_EMALLOC (char, len + LT_STRLEN (archive_ext) + 1);
- if (!tmp)
- return 0;
-
- strcpy (tmp, filename);
- strcat (tmp, archive_ext);
- errors = try_dlopen (&handle, tmp);
-
- /* If we found FILENAME, stop searching -- whether we were able to
- load the file as a module or not. If the file exists but loading
- failed, it is better to return an error message here than to
- report FILE_NOT_FOUND when the alternatives (foo.so etc) are not
- in the module search path. */
- if (handle || ((errors > 0) && !file_not_found ()))
- {
- LT_DLFREE (tmp);
- return handle;
- }
-
-#ifdef LTDL_SHLIB_EXT
- /* Try appending SHLIB_EXT. */
- if (LT_STRLEN (shlib_ext) > LT_STRLEN (archive_ext))
- {
- LT_DLFREE (tmp);
- tmp = LT_EMALLOC (char, len + LT_STRLEN (shlib_ext) + 1);
- if (!tmp)
- return 0;
-
- strcpy (tmp, filename);
- }
- else
- {
- tmp[len] = LT_EOS_CHAR;
- }
-
- strcat(tmp, shlib_ext);
- errors = try_dlopen (&handle, tmp);
-
- /* As before, if the file was found but loading failed, return now
- with the current error message. */
- if (handle || ((errors > 0) && !file_not_found ()))
- {
- LT_DLFREE (tmp);
- return handle;
- }
-#endif
-
- /* Still here? Then we really did fail to locate any of the file
- names we tried. */
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND));
- LT_DLFREE (tmp);
- return 0;
-}
-
-
-static int
-lt_argz_insert (pargz, pargz_len, before, entry)
- char **pargz;
- size_t *pargz_len;
- char *before;
- const char *entry;
-{
- error_t error;
-
- /* Prior to Sep 8, 2005, newlib had a bug where argz_insert(pargz,
- pargz_len, NULL, entry) failed with EINVAL. */
- if (before)
- error = argz_insert (pargz, pargz_len, before, entry);
- else
- error = argz_append (pargz, pargz_len, entry, 1 + LT_STRLEN (entry));
-
- if (error)
- {
- switch (error)
- {
- case ENOMEM:
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));
- break;
- default:
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN));
- break;
- }
- return 1;
- }
-
- return 0;
-}
-
-static int
-lt_argz_insertinorder (pargz, pargz_len, entry)
- char **pargz;
- size_t *pargz_len;
- const char *entry;
-{
- char *before = 0;
-
- assert (pargz);
- assert (pargz_len);
- assert (entry && *entry);
-
- if (*pargz)
- while ((before = argz_next (*pargz, *pargz_len, before)))
- {
- int cmp = strcmp (entry, before);
-
- if (cmp < 0) break;
- if (cmp == 0) return 0; /* No duplicates! */
- }
-
- return lt_argz_insert (pargz, pargz_len, before, entry);
-}
-
-static int
-lt_argz_insertdir (pargz, pargz_len, dirnam, dp)
- char **pargz;
- size_t *pargz_len;
- const char *dirnam;
- struct dirent *dp;
-{
- char *buf = 0;
- size_t buf_len = 0;
- char *end = 0;
- size_t end_offset = 0;
- size_t dir_len = 0;
- int errors = 0;
-
- assert (pargz);
- assert (pargz_len);
- assert (dp);
-
- dir_len = LT_STRLEN (dirnam);
- end = dp->d_name + LT_D_NAMLEN(dp);
-
- /* Ignore version numbers. */
- {
- char *p;
- for (p = end; p -1 > dp->d_name; --p)
- if (strchr (".0123456789", p[-1]) == 0)
- break;
-
- if (*p == '.')
- end = p;
- }
-
- /* Ignore filename extension. */
- {
- char *p;
- for (p = end -1; p > dp->d_name; --p)
- if (*p == '.')
- {
- end = p;
- break;
- }
- }
-
- /* Prepend the directory name. */
- end_offset = end - dp->d_name;
- buf_len = dir_len + 1+ end_offset;
- buf = LT_EMALLOC (char, 1+ buf_len);
- if (!buf)
- return ++errors;
-
- assert (buf);
-
- strcpy (buf, dirnam);
- strcat (buf, "/");
- strncat (buf, dp->d_name, end_offset);
- buf[buf_len] = LT_EOS_CHAR;
-
- /* Try to insert (in order) into ARGZ/ARGZ_LEN. */
- if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0)
- ++errors;
-
- LT_DLFREE (buf);
-
- return errors;
-}
-
-static int
-list_files_by_dir (dirnam, pargz, pargz_len)
- const char *dirnam;
- char **pargz;
- size_t *pargz_len;
-{
- DIR *dirp = 0;
- int errors = 0;
-
- assert (dirnam && *dirnam);
- assert (pargz);
- assert (pargz_len);
- assert (dirnam[LT_STRLEN(dirnam) -1] != '/');
-
- dirp = opendir (dirnam);
- if (dirp)
- {
- struct dirent *dp = 0;
-
- while ((dp = readdir (dirp)))
- if (dp->d_name[0] != '.')
- if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp))
- {
- ++errors;
- break;
- }
-
- closedir (dirp);
- }
- else
- ++errors;
-
- return errors;
-}
-
-
-/* If there are any files in DIRNAME, call the function passed in
- DATA1 (with the name of each file and DATA2 as arguments). */
-static int
-foreachfile_callback (dirname, data1, data2)
- char *dirname;
- lt_ptr data1;
- lt_ptr data2;
-{
- int (*func) LT_PARAMS((const char *filename, lt_ptr data))
- = (int (*) LT_PARAMS((const char *filename, lt_ptr data))) data1;
-
- int is_done = 0;
- char *argz = 0;
- size_t argz_len = 0;
-
- if (list_files_by_dir (dirname, &argz, &argz_len) != 0)
- goto cleanup;
- if (!argz)
- goto cleanup;
-
- {
- char *filename = 0;
- while ((filename = argz_next (argz, argz_len, filename)))
- if ((is_done = (*func) (filename, data2)))
- break;
- }
-
- cleanup:
- LT_DLFREE (argz);
-
- return is_done;
-}
-
-
-/* Call FUNC for each unique extensionless file in SEARCH_PATH, along
- with DATA. The filenames passed to FUNC would be suitable for
- passing to lt_dlopenext. The extensions are stripped so that
- individual modules do not generate several entries (e.g. libfoo.la,
- libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL,
- then the same directories that lt_dlopen would search are examined. */
-int
-lt_dlforeachfile (search_path, func, data)
- const char *search_path;
- int (*func) LT_PARAMS ((const char *filename, lt_ptr data));
- lt_ptr data;
-{
- int is_done = 0;
-
- if (search_path)
- {
- /* If a specific path was passed, search only the directories
- listed in it. */
- is_done = foreach_dirinpath (search_path, 0,
- foreachfile_callback, func, data);
- }
- else
- {
- /* Otherwise search the default paths. */
- is_done = foreach_dirinpath (user_search_path, 0,
- foreachfile_callback, func, data);
- if (!is_done)
- {
- is_done = foreach_dirinpath (getenv("LTDL_LIBRARY_PATH"), 0,
- foreachfile_callback, func, data);
- }
-
-#ifdef LTDL_SHLIBPATH_VAR
- if (!is_done)
- {
- is_done = foreach_dirinpath (getenv(LTDL_SHLIBPATH_VAR), 0,
- foreachfile_callback, func, data);
- }
-#endif
-#ifdef LTDL_SYSSEARCHPATH
- if (!is_done)
- {
- is_done = foreach_dirinpath (getenv(LTDL_SYSSEARCHPATH), 0,
- foreachfile_callback, func, data);
- }
-#endif
- }
-
- return is_done;
-}
-
-int
-lt_dlclose (handle)
- lt_dlhandle handle;
-{
- lt_dlhandle cur, last;
- int errors = 0;
-
- LT_DLMUTEX_LOCK ();
-
- /* check whether the handle is valid */
- last = cur = handles;
- while (cur && handle != cur)
- {
- last = cur;
- cur = cur->next;
- }
-
- if (!cur)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
- ++errors;
- goto done;
- }
-
- handle->info.ref_count--;
-
- /* Note that even with resident modules, we must track the ref_count
- correctly incase the user decides to reset the residency flag
- later (even though the API makes no provision for that at the
- moment). */
- if (handle->info.ref_count <= 0 && !LT_DLIS_RESIDENT (handle))
- {
- lt_user_data data = handle->loader->dlloader_data;
-
- if (handle != handles)
- {
- last->next = handle->next;
- }
- else
- {
- handles = handle->next;
- }
-
- errors += handle->loader->module_close (data, handle->module);
- errors += unload_deplibs(handle);
-
- /* It is up to the callers to free the data itself. */
- LT_DLFREE (handle->caller_data);
-
- LT_DLFREE (handle->info.filename);
- LT_DLFREE (handle->info.name);
- LT_DLFREE (handle);
-
- goto done;
- }
-
- if (LT_DLIS_RESIDENT (handle))
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CLOSE_RESIDENT_MODULE));
- ++errors;
- }
-
- done:
- LT_DLMUTEX_UNLOCK ();
-
- return errors;
-}
-
-lt_ptr
-lt_dlsym (handle, symbol)
- lt_dlhandle handle;
- const char *symbol;
-{
- size_t lensym;
- char lsym[LT_SYMBOL_LENGTH];
- char *sym;
- lt_ptr address;
- lt_user_data data;
-
- if (!handle)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
- return 0;
- }
-
- if (!symbol)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
- return 0;
- }
-
- lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->loader->sym_prefix)
- + LT_STRLEN (handle->info.name);
-
- if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH)
- {
- sym = lsym;
- }
- else
- {
- sym = LT_EMALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1);
- if (!sym)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (BUFFER_OVERFLOW));
- return 0;
- }
- }
-
- data = handle->loader->dlloader_data;
- if (handle->info.name)
- {
- const char *saved_error;
-
- LT_DLMUTEX_GETERROR (saved_error);
-
- /* this is a libtool module */
- if (handle->loader->sym_prefix)
- {
- strcpy(sym, handle->loader->sym_prefix);
- strcat(sym, handle->info.name);
- }
- else
- {
- strcpy(sym, handle->info.name);
- }
-
- strcat(sym, "_LTX_");
- strcat(sym, symbol);
-
- /* try "modulename_LTX_symbol" */
- address = handle->loader->find_sym (data, handle->module, sym);
- if (address)
- {
- if (sym != lsym)
- {
- LT_DLFREE (sym);
- }
- return address;
- }
- LT_DLMUTEX_SETERROR (saved_error);
- }
-
- /* otherwise try "symbol" */
- if (handle->loader->sym_prefix)
- {
- strcpy(sym, handle->loader->sym_prefix);
- strcat(sym, symbol);
- }
- else
- {
- strcpy(sym, symbol);
- }
-
- address = handle->loader->find_sym (data, handle->module, sym);
- if (sym != lsym)
- {
- LT_DLFREE (sym);
- }
-
- return address;
-}
-
-const char *
-lt_dlerror ()
-{
- const char *error;
-
- LT_DLMUTEX_GETERROR (error);
- LT_DLMUTEX_SETERROR (0);
-
- return error ? error : NULL;
-}
-
-static int
-lt_dlpath_insertdir (ppath, before, dir)
- char **ppath;
- char *before;
- const char *dir;
-{
- int errors = 0;
- char *canonical = 0;
- char *argz = 0;
- size_t argz_len = 0;
-
- assert (ppath);
- assert (dir && *dir);
-
- if (canonicalize_path (dir, &canonical) != 0)
- {
- ++errors;
- goto cleanup;
- }
-
- assert (canonical && *canonical);
-
- /* If *PPATH is empty, set it to DIR. */
- if (*ppath == 0)
- {
- assert (!before); /* BEFORE cannot be set without PPATH. */
- assert (dir); /* Without DIR, don't call this function! */
-
- *ppath = lt_estrdup (dir);
- if (*ppath == 0)
- ++errors;
-
- return errors;
- }
-
- assert (ppath && *ppath);
-
- if (argzize_path (*ppath, &argz, &argz_len) != 0)
- {
- ++errors;
- goto cleanup;
- }
-
- /* Convert BEFORE into an equivalent offset into ARGZ. This only works
- if *PPATH is already canonicalized, and hence does not change length
- with respect to ARGZ. We canonicalize each entry as it is added to
- the search path, and don't call this function with (uncanonicalized)
- user paths, so this is a fair assumption. */
- if (before)
- {
- assert (*ppath <= before);
- assert (before - *ppath <= strlen (*ppath));
-
- before = before - *ppath + argz;
- }
-
- if (lt_argz_insert (&argz, &argz_len, before, dir) != 0)
- {
- ++errors;
- goto cleanup;
- }
-
- argz_stringify (argz, argz_len, LT_PATHSEP_CHAR);
- LT_DLMEM_REASSIGN (*ppath, argz);
-
- cleanup:
- LT_DLFREE (canonical);
- LT_DLFREE (argz);
-
- return errors;
-}
-
-int
-lt_dladdsearchdir (search_dir)
- const char *search_dir;
-{
- int errors = 0;
-
- if (search_dir && *search_dir)
- {
- LT_DLMUTEX_LOCK ();
- if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0)
- ++errors;
- LT_DLMUTEX_UNLOCK ();
- }
-
- return errors;
-}
-
-int
-lt_dlinsertsearchdir (before, search_dir)
- const char *before;
- const char *search_dir;
-{
- int errors = 0;
-
- if (before)
- {
- LT_DLMUTEX_LOCK ();
- if ((before < user_search_path)
- || (before >= user_search_path + LT_STRLEN (user_search_path)))
- {
- LT_DLMUTEX_UNLOCK ();
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_POSITION));
- return 1;
- }
- LT_DLMUTEX_UNLOCK ();
- }
-
- if (search_dir && *search_dir)
- {
- LT_DLMUTEX_LOCK ();
- if (lt_dlpath_insertdir (&user_search_path,
- (char *) before, search_dir) != 0)
- {
- ++errors;
- }
- LT_DLMUTEX_UNLOCK ();
- }
-
- return errors;
-}
-
-int
-lt_dlsetsearchpath (search_path)
- const char *search_path;
-{
- int errors = 0;
-
- LT_DLMUTEX_LOCK ();
- LT_DLFREE (user_search_path);
- LT_DLMUTEX_UNLOCK ();
-
- if (!search_path || !LT_STRLEN (search_path))
- {
- return errors;
- }
-
- LT_DLMUTEX_LOCK ();
- if (canonicalize_path (search_path, &user_search_path) != 0)
- ++errors;
- LT_DLMUTEX_UNLOCK ();
-
- return errors;
-}
-
-const char *
-lt_dlgetsearchpath ()
-{
- const char *saved_path;
-
- LT_DLMUTEX_LOCK ();
- saved_path = user_search_path;
- LT_DLMUTEX_UNLOCK ();
-
- return saved_path;
-}
-
-int
-lt_dlmakeresident (handle)
- lt_dlhandle handle;
-{
- int errors = 0;
-
- if (!handle)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
- ++errors;
- }
- else
- {
- LT_DLSET_FLAG (handle, LT_DLRESIDENT_FLAG);
- }
-
- return errors;
-}
-
-int
-lt_dlisresident (handle)
- lt_dlhandle handle;
-{
- if (!handle)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
- return -1;
- }
-
- return LT_DLIS_RESIDENT (handle);
-}
-
-
-
-
-/* --- MODULE INFORMATION --- */
-
-const lt_dlinfo *
-lt_dlgetinfo (handle)
- lt_dlhandle handle;
-{
- if (!handle)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
- return 0;
- }
-
- return &(handle->info);
-}
-
-lt_dlhandle
-lt_dlhandle_next (place)
- lt_dlhandle place;
-{
- return place ? place->next : handles;
-}
-
-int
-lt_dlforeach (func, data)
- int (*func) LT_PARAMS((lt_dlhandle handle, lt_ptr data));
- lt_ptr data;
-{
- int errors = 0;
- lt_dlhandle cur;
-
- LT_DLMUTEX_LOCK ();
-
- cur = handles;
- while (cur)
- {
- lt_dlhandle tmp = cur;
-
- cur = cur->next;
- if ((*func) (tmp, data))
- {
- ++errors;
- break;
- }
- }
-
- LT_DLMUTEX_UNLOCK ();
-
- return errors;
-}
-
-lt_dlcaller_id
-lt_dlcaller_register ()
-{
- static lt_dlcaller_id last_caller_id = 0;
- int result;
-
- LT_DLMUTEX_LOCK ();
- result = ++last_caller_id;
- LT_DLMUTEX_UNLOCK ();
-
- return result;
-}
-
-lt_ptr
-lt_dlcaller_set_data (key, handle, data)
- lt_dlcaller_id key;
- lt_dlhandle handle;
- lt_ptr data;
-{
- int n_elements = 0;
- lt_ptr stale = (lt_ptr) 0;
- int i;
-
- /* This needs to be locked so that the caller data can be updated
- simultaneously by different threads. */
- LT_DLMUTEX_LOCK ();
-
- if (handle->caller_data)
- while (handle->caller_data[n_elements].key)
- ++n_elements;
-
- for (i = 0; i < n_elements; ++i)
- {
- if (handle->caller_data[i].key == key)
- {
- stale = handle->caller_data[i].data;
- break;
- }
- }
-
- /* Ensure that there is enough room in this handle's caller_data
- array to accept a new element (and an empty end marker). */
- if (i == n_elements)
- {
- lt_caller_data *temp
- = LT_DLREALLOC (lt_caller_data, handle->caller_data, 2+ n_elements);
-
- if (!temp)
- {
- stale = 0;
- goto done;
- }
-
- handle->caller_data = temp;
-
- /* We only need this if we needed to allocate a new caller_data. */
- handle->caller_data[i].key = key;
- handle->caller_data[1+ i].key = 0;
- }
-
- handle->caller_data[i].data = data;
-
- done:
- LT_DLMUTEX_UNLOCK ();
-
- return stale;
-}
-
-lt_ptr
-lt_dlcaller_get_data (key, handle)
- lt_dlcaller_id key;
- lt_dlhandle handle;
-{
- lt_ptr result = (lt_ptr) 0;
-
- /* This needs to be locked so that the caller data isn't updated by
- another thread part way through this function. */
- LT_DLMUTEX_LOCK ();
-
- /* Locate the index of the element with a matching KEY. */
- {
- int i;
- for (i = 0; handle->caller_data[i].key; ++i)
- {
- if (handle->caller_data[i].key == key)
- {
- result = handle->caller_data[i].data;
- break;
- }
- }
- }
-
- LT_DLMUTEX_UNLOCK ();
-
- return result;
-}
-
-
-
-/* --- USER MODULE LOADER API --- */
-
-
-int
-lt_dlloader_add (place, dlloader, loader_name)
- lt_dlloader *place;
- const struct lt_user_dlloader *dlloader;
- const char *loader_name;
-{
- int errors = 0;
- lt_dlloader *node = 0, *ptr = 0;
-
- if ((dlloader == 0) /* diagnose null parameters */
- || (dlloader->module_open == 0)
- || (dlloader->module_close == 0)
- || (dlloader->find_sym == 0))
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER));
- return 1;
- }
-
- /* Create a new dlloader node with copies of the user callbacks. */
- node = LT_EMALLOC (lt_dlloader, 1);
- if (!node)
- return 1;
-
- node->next = 0;
- node->loader_name = loader_name;
- node->sym_prefix = dlloader->sym_prefix;
- node->dlloader_exit = dlloader->dlloader_exit;
- node->module_open = dlloader->module_open;
- node->module_close = dlloader->module_close;
- node->find_sym = dlloader->find_sym;
- node->dlloader_data = dlloader->dlloader_data;
-
- LT_DLMUTEX_LOCK ();
- if (!loaders)
- {
- /* If there are no loaders, NODE becomes the list! */
- loaders = node;
- }
- else if (!place)
- {
- /* If PLACE is not set, add NODE to the end of the
- LOADERS list. */
- for (ptr = loaders; ptr->next; ptr = ptr->next)
- {
- /*NOWORK*/;
- }
-
- ptr->next = node;
- }
- else if (loaders == place)
- {
- /* If PLACE is the first loader, NODE goes first. */
- node->next = place;
- loaders = node;
- }
- else
- {
- /* Find the node immediately preceding PLACE. */
- for (ptr = loaders; ptr->next != place; ptr = ptr->next)
- {
- /*NOWORK*/;
- }
-
- if (ptr->next != place)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER));
- ++errors;
- }
- else
- {
- /* Insert NODE between PTR and PLACE. */
- node->next = place;
- ptr->next = node;
- }
- }
-
- LT_DLMUTEX_UNLOCK ();
-
- return errors;
-}
-
-int
-lt_dlloader_remove (loader_name)
- const char *loader_name;
-{
- lt_dlloader *place = lt_dlloader_find (loader_name);
- lt_dlhandle handle;
- int errors = 0;
-
- if (!place)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER));
- return 1;
- }
-
- LT_DLMUTEX_LOCK ();
-
- /* Fail if there are any open modules which use this loader. */
- for (handle = handles; handle; handle = handle->next)
- {
- if (handle->loader == place)
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (REMOVE_LOADER));
- ++errors;
- goto done;
- }
- }
-
- if (place == loaders)
- {
- /* PLACE is the first loader in the list. */
- loaders = loaders->next;
- }
- else
- {
- /* Find the loader before the one being removed. */
- lt_dlloader *prev;
- for (prev = loaders; prev->next; prev = prev->next)
- {
- if (!strcmp (prev->next->loader_name, loader_name))
- {
- break;
- }
- }
-
- place = prev->next;
- prev->next = prev->next->next;
- }
-
- if (place->dlloader_exit)
- {
- errors = place->dlloader_exit (place->dlloader_data);
- }
-
- LT_DLFREE (place);
-
- done:
- LT_DLMUTEX_UNLOCK ();
-
- return errors;
-}
-
-lt_dlloader *
-lt_dlloader_next (place)
- lt_dlloader *place;
-{
- lt_dlloader *next;
-
- LT_DLMUTEX_LOCK ();
- next = place ? place->next : loaders;
- LT_DLMUTEX_UNLOCK ();
-
- return next;
-}
-
-const char *
-lt_dlloader_name (place)
- lt_dlloader *place;
-{
- const char *name = 0;
-
- if (place)
- {
- LT_DLMUTEX_LOCK ();
- name = place ? place->loader_name : 0;
- LT_DLMUTEX_UNLOCK ();
- }
- else
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER));
- }
-
- return name;
-}
-
-lt_user_data *
-lt_dlloader_data (place)
- lt_dlloader *place;
-{
- lt_user_data *data = 0;
-
- if (place)
- {
- LT_DLMUTEX_LOCK ();
- data = place ? &(place->dlloader_data) : 0;
- LT_DLMUTEX_UNLOCK ();
- }
- else
- {
- LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER));
- }
-
- return data;
-}
-
-lt_dlloader *
-lt_dlloader_find (loader_name)
- const char *loader_name;
-{
- lt_dlloader *place = 0;
-
- LT_DLMUTEX_LOCK ();
- for (place = loaders; place; place = place->next)
- {
- if (strcmp (place->loader_name, loader_name) == 0)
- {
- break;
- }
- }
- LT_DLMUTEX_UNLOCK ();
-
- return place;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/libltdl/ltdl.h b/xbmc/screensavers/rsxs-0.9/libltdl/ltdl.h
deleted file mode 100644
index 8aaf3429ad..0000000000
--- a/xbmc/screensavers/rsxs-0.9/libltdl/ltdl.h
+++ /dev/null
@@ -1,366 +0,0 @@
-/* ltdl.h -- generic dlopen functions
- Copyright (C) 1998-2000 Free Software Foundation, Inc.
- Originally by Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-As a special exception to the GNU Lesser General Public License,
-if you distribute this file as part of a program or library that
-is built using GNU libtool, you may include it under the same
-distribution terms that you use for the rest of that program.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free
-Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA
-*/
-
-/* Only include this header file once. */
-#ifndef LTDL_H
-#define LTDL_H 1
-
-#include <sys/types.h> /* for size_t declaration */
-
-
-/* --- MACROS FOR PORTABILITY --- */
-
-
-/* Saves on those hard to debug '\0' typos.... */
-#define LT_EOS_CHAR '\0'
-
-/* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations,
- so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at
- the end of C declarations. */
-#ifdef __cplusplus
-# define LT_BEGIN_C_DECLS extern "C" {
-# define LT_END_C_DECLS }
-#else
-# define LT_BEGIN_C_DECLS /* empty */
-# define LT_END_C_DECLS /* empty */
-#endif
-
-LT_BEGIN_C_DECLS
-
-
-/* LT_PARAMS is a macro used to wrap function prototypes, so that compilers
- that don't understand ANSI C prototypes still work, and ANSI C
- compilers can issue warnings about type mismatches. */
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
-# define LT_PARAMS(protos) protos
-# define lt_ptr void*
-#else
-# define LT_PARAMS(protos) ()
-# define lt_ptr char*
-#endif
-
-/* LT_STMT_START/END are used to create macros which expand to a
- a single compound statement in a portable way. */
-#if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus)
-# define LT_STMT_START (void)(
-# define LT_STMT_END )
-#else
-# if (defined (sun) || defined (__sun__))
-# define LT_STMT_START if (1)
-# define LT_STMT_END else (void)0
-# else
-# define LT_STMT_START do
-# define LT_STMT_END while (0)
-# endif
-#endif
-
-/* LT_CONC creates a new concatenated symbol for the compiler
- in a portable way. */
-#if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER)
-# define LT_CONC(s,t) s##t
-#else
-# define LT_CONC(s,t) s/**/t
-#endif
-
-/* LT_STRLEN can be used safely on NULL pointers. */
-#define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0)
-
-
-
-/* --- WINDOWS SUPPORT --- */
-
-
-/* Canonicalise Windows and Cygwin recognition macros. */
-#ifdef __CYGWIN32__
-# ifndef __CYGWIN__
-# define __CYGWIN__ __CYGWIN32__
-# endif
-#endif
-#if defined(_WIN32) || defined(WIN32)
-# ifndef __WINDOWS__
-# ifdef _WIN32
-# define __WINDOWS__ _WIN32
-# else
-# ifdef WIN32
-# define __WINDOWS__ WIN32
-# endif
-# endif
-# endif
-#endif
-
-
-#ifdef __WINDOWS__
-# ifndef __CYGWIN__
-/* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory
- separator when it is set. */
-# define LT_DIRSEP_CHAR '\\'
-# define LT_PATHSEP_CHAR ';'
-# endif
-#endif
-#ifndef LT_PATHSEP_CHAR
-# define LT_PATHSEP_CHAR ':'
-#endif
-
-/* DLL building support on win32 hosts; mostly to workaround their
- ridiculous implementation of data symbol exporting. */
-#ifndef LT_SCOPE
-# ifdef __WINDOWS__
-# ifdef DLL_EXPORT /* defined by libtool (if required) */
-# define LT_SCOPE __declspec(dllexport)
-# endif
-# ifdef LIBLTDL_DLL_IMPORT /* define if linking with this dll */
-# define LT_SCOPE extern __declspec(dllimport)
-# endif
-# endif
-# ifndef LT_SCOPE /* static linking or !__WINDOWS__ */
-# define LT_SCOPE extern
-# endif
-#endif
-
-
-#if defined(_MSC_VER) /* Visual Studio */
-# define R_OK 4
-#endif
-
-
-
-/* --- DYNAMIC MODULE LOADING API --- */
-
-
-typedef struct lt_dlhandle_struct *lt_dlhandle; /* A loaded module. */
-
-/* Initialisation and finalisation functions for libltdl. */
-LT_SCOPE int lt_dlinit LT_PARAMS((void));
-LT_SCOPE int lt_dlexit LT_PARAMS((void));
-
-/* Module search path manipulation. */
-LT_SCOPE int lt_dladdsearchdir LT_PARAMS((const char *search_dir));
-LT_SCOPE int lt_dlinsertsearchdir LT_PARAMS((const char *before,
- const char *search_dir));
-LT_SCOPE int lt_dlsetsearchpath LT_PARAMS((const char *search_path));
-LT_SCOPE const char *lt_dlgetsearchpath LT_PARAMS((void));
-LT_SCOPE int lt_dlforeachfile LT_PARAMS((
- const char *search_path,
- int (*func) (const char *filename, lt_ptr data),
- lt_ptr data));
-
-/* Portable libltdl versions of the system dlopen() API. */
-LT_SCOPE lt_dlhandle lt_dlopen LT_PARAMS((const char *filename));
-LT_SCOPE lt_dlhandle lt_dlopenext LT_PARAMS((const char *filename));
-LT_SCOPE lt_ptr lt_dlsym LT_PARAMS((lt_dlhandle handle,
- const char *name));
-LT_SCOPE const char *lt_dlerror LT_PARAMS((void));
-LT_SCOPE int lt_dlclose LT_PARAMS((lt_dlhandle handle));
-
-/* Module residency management. */
-LT_SCOPE int lt_dlmakeresident LT_PARAMS((lt_dlhandle handle));
-LT_SCOPE int lt_dlisresident LT_PARAMS((lt_dlhandle handle));
-
-
-
-
-/* --- MUTEX LOCKING --- */
-
-
-typedef void lt_dlmutex_lock LT_PARAMS((void));
-typedef void lt_dlmutex_unlock LT_PARAMS((void));
-typedef void lt_dlmutex_seterror LT_PARAMS((const char *errmsg));
-typedef const char *lt_dlmutex_geterror LT_PARAMS((void));
-
-LT_SCOPE int lt_dlmutex_register LT_PARAMS((lt_dlmutex_lock *lock,
- lt_dlmutex_unlock *unlock,
- lt_dlmutex_seterror *seterror,
- lt_dlmutex_geterror *geterror));
-
-
-
-
-/* --- MEMORY HANDLING --- */
-
-
-/* By default, the realloc function pointer is set to our internal
- realloc implementation which iself uses lt_dlmalloc and lt_dlfree.
- libltdl relies on a featureful realloc, but if you are sure yours
- has the right semantics then you can assign it directly. Generally,
- it is safe to assign just a malloc() and a free() function. */
-LT_SCOPE lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size));
-LT_SCOPE lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size));
-LT_SCOPE void (*lt_dlfree) LT_PARAMS((lt_ptr ptr));
-
-
-
-
-/* --- PRELOADED MODULE SUPPORT --- */
-
-
-/* A preopened symbol. Arrays of this type comprise the exported
- symbols for a dlpreopened module. */
-typedef struct {
- const char *name;
- lt_ptr address;
-} lt_dlsymlist;
-
-LT_SCOPE int lt_dlpreload LT_PARAMS((const lt_dlsymlist *preloaded));
-LT_SCOPE int lt_dlpreload_default
- LT_PARAMS((const lt_dlsymlist *preloaded));
-
-#define LTDL_SET_PRELOADED_SYMBOLS() LT_STMT_START{ \
- extern const lt_dlsymlist lt_preloaded_symbols[]; \
- lt_dlpreload_default(lt_preloaded_symbols); \
- }LT_STMT_END
-
-
-
-
-/* --- MODULE INFORMATION --- */
-
-
-/* Read only information pertaining to a loaded module. */
-typedef struct {
- char *filename; /* file name */
- char *name; /* module name */
- int ref_count; /* number of times lt_dlopened minus
- number of times lt_dlclosed. */
-} lt_dlinfo;
-
-LT_SCOPE const lt_dlinfo *lt_dlgetinfo LT_PARAMS((lt_dlhandle handle));
-LT_SCOPE lt_dlhandle lt_dlhandle_next LT_PARAMS((lt_dlhandle place));
-LT_SCOPE int lt_dlforeach LT_PARAMS((
- int (*func) (lt_dlhandle handle, lt_ptr data),
- lt_ptr data));
-
-/* Associating user data with loaded modules. */
-typedef unsigned lt_dlcaller_id;
-
-LT_SCOPE lt_dlcaller_id lt_dlcaller_register LT_PARAMS((void));
-LT_SCOPE lt_ptr lt_dlcaller_set_data LT_PARAMS((lt_dlcaller_id key,
- lt_dlhandle handle,
- lt_ptr data));
-LT_SCOPE lt_ptr lt_dlcaller_get_data LT_PARAMS((lt_dlcaller_id key,
- lt_dlhandle handle));
-
-
-
-/* --- USER MODULE LOADER API --- */
-
-
-typedef struct lt_dlloader lt_dlloader;
-typedef lt_ptr lt_user_data;
-typedef lt_ptr lt_module;
-
-/* Function pointer types for creating user defined module loaders. */
-typedef lt_module lt_module_open LT_PARAMS((lt_user_data loader_data,
- const char *filename));
-typedef int lt_module_close LT_PARAMS((lt_user_data loader_data,
- lt_module handle));
-typedef lt_ptr lt_find_sym LT_PARAMS((lt_user_data loader_data,
- lt_module handle,
- const char *symbol));
-typedef int lt_dlloader_exit LT_PARAMS((lt_user_data loader_data));
-
-struct lt_user_dlloader {
- const char *sym_prefix;
- lt_module_open *module_open;
- lt_module_close *module_close;
- lt_find_sym *find_sym;
- lt_dlloader_exit *dlloader_exit;
- lt_user_data dlloader_data;
-};
-
-LT_SCOPE lt_dlloader *lt_dlloader_next LT_PARAMS((lt_dlloader *place));
-LT_SCOPE lt_dlloader *lt_dlloader_find LT_PARAMS((
- const char *loader_name));
-LT_SCOPE const char *lt_dlloader_name LT_PARAMS((lt_dlloader *place));
-LT_SCOPE lt_user_data *lt_dlloader_data LT_PARAMS((lt_dlloader *place));
-LT_SCOPE int lt_dlloader_add LT_PARAMS((lt_dlloader *place,
- const struct lt_user_dlloader *dlloader,
- const char *loader_name));
-LT_SCOPE int lt_dlloader_remove LT_PARAMS((
- const char *loader_name));
-
-
-
-/* --- ERROR MESSAGE HANDLING --- */
-
-
-/* Defining error strings alongside their symbolic names in a macro in
- this way allows us to expand the macro in different contexts with
- confidence that the enumeration of symbolic names will map correctly
- onto the table of error strings. */
-#define lt_dlerror_table \
- LT_ERROR(UNKNOWN, "unknown error") \
- LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available") \
- LT_ERROR(INVALID_LOADER, "invalid loader") \
- LT_ERROR(INIT_LOADER, "loader initialization failed") \
- LT_ERROR(REMOVE_LOADER, "loader removal failed") \
- LT_ERROR(FILE_NOT_FOUND, "file not found") \
- LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found") \
- LT_ERROR(NO_SYMBOLS, "no symbols defined") \
- LT_ERROR(CANNOT_OPEN, "can't open the module") \
- LT_ERROR(CANNOT_CLOSE, "can't close the module") \
- LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found") \
- LT_ERROR(NO_MEMORY, "not enough memory") \
- LT_ERROR(INVALID_HANDLE, "invalid module handle") \
- LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow") \
- LT_ERROR(INVALID_ERRORCODE, "invalid errorcode") \
- LT_ERROR(SHUTDOWN, "library already shutdown") \
- LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module") \
- LT_ERROR(INVALID_MUTEX_ARGS, "invalid mutex handler registration") \
- LT_ERROR(INVALID_POSITION, "invalid search path insert position")
-
-/* Enumerate the symbolic error names. */
-enum {
-#define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name),
- lt_dlerror_table
-#undef LT_ERROR
-
- LT_ERROR_MAX
-};
-
-/* These functions are only useful from inside custom module loaders. */
-LT_SCOPE int lt_dladderror LT_PARAMS((const char *diagnostic));
-LT_SCOPE int lt_dlseterror LT_PARAMS((int errorcode));
-
-
-
-
-/* --- SOURCE COMPATIBILITY WITH OLD LIBLTDL --- */
-
-
-#ifdef LT_NON_POSIX_NAMESPACE
-# define lt_ptr_t lt_ptr
-# define lt_module_t lt_module
-# define lt_module_open_t lt_module_open
-# define lt_module_close_t lt_module_close
-# define lt_find_sym_t lt_find_sym
-# define lt_dlloader_exit_t lt_dlloader_exit
-# define lt_dlloader_t lt_dlloader
-# define lt_dlloader_data_t lt_user_data
-#endif
-
-LT_END_C_DECLS
-
-#endif /* !LTDL_H */
diff --git a/xbmc/screensavers/rsxs-0.9/m4/alloca.m4 b/xbmc/screensavers/rsxs-0.9/m4/alloca.m4
deleted file mode 100644
index a9e3f452c9..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/alloca.m4
+++ /dev/null
@@ -1,42 +0,0 @@
-# alloca.m4 serial 5
-dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_ALLOCA],
-[
- dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
- AC_REQUIRE([AC_PROG_CPP])
- AC_REQUIRE([AC_PROG_EGREP])
-
- AC_REQUIRE([AC_FUNC_ALLOCA])
- if test $ac_cv_func_alloca_works = no; then
- gl_PREREQ_ALLOCA
- fi
-
- # Define an additional variable used in the Makefile substitution.
- if test $ac_cv_working_alloca_h = yes; then
- AC_EGREP_CPP([Need own alloca], [
-#if defined __GNUC__ || defined _AIX || defined _MSC_VER
- Need own alloca
-#endif
- ],
- [AC_DEFINE(HAVE_ALLOCA, 1,
- [Define to 1 if you have `alloca' after including <alloca.h>,
- a header that may be supplied by this distribution.])
- ALLOCA_H=alloca.h],
- [ALLOCA_H=])
- else
- ALLOCA_H=alloca.h
- fi
- AC_SUBST([ALLOCA_H])
-
- AC_DEFINE(HAVE_ALLOCA_H, 1,
- [Define HAVE_ALLOCA_H for backward compatibility with older code
- that includes <alloca.h> only if HAVE_ALLOCA_H is defined.])
-])
-
-# Prerequisites of lib/alloca.c.
-# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
-AC_DEFUN([gl_PREREQ_ALLOCA], [:])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/argp.m4 b/xbmc/screensavers/rsxs-0.9/m4/argp.m4
deleted file mode 100644
index 7d761ae979..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/argp.m4
+++ /dev/null
@@ -1,61 +0,0 @@
-# argp.m4 serial 6
-dnl Copyright (C) 2003-2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_ARGP],
-[
- AC_REQUIRE([AC_C_INLINE])
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_REQUIRE([gl_GETOPT_SUBSTITUTE])
-
- AC_CHECK_DECL([program_invocation_name],
- [AC_DEFINE(HAVE_DECL_PROGRAM_INVOCATION_NAME, 1,
- [Define if program_invocation_name is declared])],
- [AC_DEFINE(GNULIB_PROGRAM_INVOCATION_NAME, 1,
- [Define to 1 to add extern declaration of program_invocation_name to argp-namefrob.h])],
- [#include <errno.h>])
- AC_CHECK_DECL([program_invocation_short_name],
- [AC_DEFINE(HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME, 1,
- [Define if program_invocation_short_name is declared])],
- [AC_DEFINE(GNULIB_PROGRAM_INVOCATION_SHORT_NAME, 1,
- [Define to 1 to add extern declaration of program_invocation_short_name to argp-namefrob.h])],
- [#include <errno.h>])
-
- # Check if program_invocation_name and program_invocation_short_name
- # are defined elsewhere. It is improbable that only one of them will
- # be defined and other not, I prefer to stay on the safe side and to
- # test each one separately.
- AC_MSG_CHECKING(whether program_invocation_name is defined)
- AC_TRY_COMPILE([#include <argp.h>],
- [ program_invocation_name = "test"; ],
- [ AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME,1,
- [Define if program_invocation_name is defined])
- AC_MSG_RESULT(yes)],
- [ AC_MSG_RESULT(no)] )
-
- AC_MSG_CHECKING(whether program_invocation_short_name is defined)
- AC_TRY_COMPILE([#include <argp.h>],
- [ program_invocation_short_name = "test"; ],
- [ AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME,1,
- [Define if program_invocation_short_name is defined])
- AC_MSG_RESULT(yes)],
- [ AC_MSG_RESULT(no)] )
-
- AC_CHECK_DECLS_ONCE([clearerr_unlocked])
- AC_CHECK_DECLS_ONCE([feof_unlocked])
- AC_CHECK_DECLS_ONCE([ferror_unlocked])
- AC_CHECK_DECLS_ONCE([fflush_unlocked])
- AC_CHECK_DECLS_ONCE([fgets_unlocked])
- AC_CHECK_DECLS_ONCE([fputc_unlocked])
- AC_CHECK_DECLS_ONCE([fputs_unlocked])
- AC_CHECK_DECLS_ONCE([fread_unlocked])
- AC_CHECK_DECLS_ONCE([fwrite_unlocked])
- AC_CHECK_DECLS_ONCE([getc_unlocked])
- AC_CHECK_DECLS_ONCE([getchar_unlocked])
- AC_CHECK_DECLS_ONCE([putc_unlocked])
- AC_CHECK_DECLS_ONCE([putchar_unlocked])
- AC_CHECK_FUNCS_ONCE([flockfile funlockfile])
- AC_CHECK_HEADERS_ONCE([features.h linewrap.h])
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/argz.m4 b/xbmc/screensavers/rsxs-0.9/m4/argz.m4
deleted file mode 100644
index 40e836b82c..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/argz.m4
+++ /dev/null
@@ -1,34 +0,0 @@
-# Portability macros for glibc argz. -*- Autoconf -*-
-# Written by Gary V. Vaughan <gary@gnu.org>
-
-# Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
-
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 4 argz.m4
-
-AC_DEFUN([gl_FUNC_ARGZ],
-[gl_PREREQ_ARGZ
-
-AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT])
-
-AC_CHECK_TYPES([error_t],
- [],
- [AC_DEFINE([error_t], [int],
- [Define to a type to use for `error_t' if it is not otherwise available.])
- AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h
- does not typedef error_t.])],
- [#if defined(HAVE_ARGZ_H)
-# include <argz.h>
-#endif])
-
-ARGZ_H=
-AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next \
- argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])])
-AC_SUBST([ARGZ_H])
-])
-
-# Prerequisites of lib/argz.c.
-AC_DEFUN([gl_PREREQ_ARGZ], [:])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/dirname.m4 b/xbmc/screensavers/rsxs-0.9/m4/dirname.m4
deleted file mode 100644
index f3412ad080..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/dirname.m4
+++ /dev/null
@@ -1,17 +0,0 @@
-#serial 6 -*- autoconf -*-
-dnl Copyright (C) 2002-2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_DIRNAME],
-[
- AC_LIBSOURCES([dirname.c, dirname.h])
- AC_LIBOBJ([dirname])
-
- dnl Prerequisites of lib/dirname.h.
- AC_REQUIRE([gl_AC_DOS])
- AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
-
- dnl No prerequisites of lib/basename.c, lib/dirname.c, lib/stripslash.c.
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/dos.m4 b/xbmc/screensavers/rsxs-0.9/m4/dos.m4
deleted file mode 100644
index dd59571c0b..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/dos.m4
+++ /dev/null
@@ -1,71 +0,0 @@
-#serial 10 -*- autoconf -*-
-
-# Define some macros required for proper operation of code in lib/*.c
-# on MSDOS/Windows systems.
-
-# Copyright (C) 2000, 2001, 2004, 2005, 2006 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# From Jim Meyering.
-
-AC_DEFUN([gl_AC_DOS],
- [
- AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
- [
- AC_TRY_COMPILE([],
- [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__
-neither MSDOS nor Windows
-#endif],
- [ac_cv_win_or_dos=yes],
- [ac_cv_win_or_dos=no])
- ])
-
- if test x"$ac_cv_win_or_dos" = xyes; then
- ac_fs_accepts_drive_letter_prefix=1
- ac_fs_backslash_is_file_name_separator=1
- AC_CACHE_CHECK([whether drive letter can start relative path],
- [ac_cv_drive_letter_can_be_relative],
- [
- AC_TRY_COMPILE([],
- [#if defined __CYGWIN__
-drive letters are always absolute
-#endif],
- [ac_cv_drive_letter_can_be_relative=yes],
- [ac_cv_drive_letter_can_be_relative=no])
- ])
- if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then
- ac_fs_drive_letter_can_be_relative=1
- else
- ac_fs_drive_letter_can_be_relative=0
- fi
- else
- ac_fs_accepts_drive_letter_prefix=0
- ac_fs_backslash_is_file_name_separator=0
- ac_fs_drive_letter_can_be_relative=0
- fi
-
- AC_DEFINE_UNQUOTED([FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
- $ac_fs_accepts_drive_letter_prefix,
- [Define on systems for which file names may have a so-called
- `drive letter' prefix, define this to compute the length of that
- prefix, including the colon.])
-
- AH_VERBATIM(ISSLASH,
- [#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-#else
-# define ISSLASH(C) ((C) == '/')
-#endif])
-
- AC_DEFINE_UNQUOTED([FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
- $ac_fs_backslash_is_file_name_separator,
- [Define if the backslash character may also serve as a file name
- component separator.])
-
- AC_DEFINE_UNQUOTED([FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE],
- $ac_fs_drive_letter_can_be_relative,
- [Define if a drive letter prefix denotes a relative path if it is
- not followed by a file name component separator.])
- ])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/double-slash-root.m4 b/xbmc/screensavers/rsxs-0.9/m4/double-slash-root.m4
deleted file mode 100644
index f8cbd54f30..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/double-slash-root.m4
+++ /dev/null
@@ -1,43 +0,0 @@
-#serial 1 -*- autoconf -*-
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_DOUBLE_SLASH_ROOT],
-[
- AC_REQUIRE([AC_CANONICAL_HOST])
- AC_CACHE_CHECK([whether // is distinct from /], [ac_cv_double_slash_root],
- [ if test x"$cross_compiling" = xyes ; then
- # When cross-compiling, there is no way to tell whether // is special
- # short of a list of hosts. However, the only known hosts to date
- # that have a distinct // are Apollo DomainOS (too old to port to)
- # and Cygwin. If anyone knows of another system for which // has
- # special semantics and is distinct from /, please report it to
- # <bug-coreutils@gnu.org>.
- case $host in
- *-cygwin)
- ac_cv_double_slash_root=yes ;;
- *)
- # Be optimistic and assume that / and // are the same when we
- # don't know.
- ac_cv_double_slash_root='unknown, assuming no' ;;
- esac
- else
- set x `ls -di / //`
- if test $[2] = $[4]; then
- ac_cv_double_slash_root=no
- else
- ac_cv_double_slash_root=yes
- fi
- fi])
- if test x"$ac_cv_double_slash_root" = xyes; then
- ac_double_slash_root=1
- else
- ac_double_slash_root=0
- fi
-
- AC_DEFINE_UNQUOTED([DOUBLE_SLASH_IS_DISTINCT_ROOT],
- $ac_double_slash_root,
- [Define to 1 if // is a file system root distinct from /.])
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/eoverflow.m4 b/xbmc/screensavers/rsxs-0.9/m4/eoverflow.m4
deleted file mode 100644
index 8c28ca3056..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/eoverflow.m4
+++ /dev/null
@@ -1,64 +0,0 @@
-# eoverflow.m4 serial 1
-dnl Copyright (C) 2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
-# POSIX. But some systems (like AIX 3) don't define it, and some systems
-# (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
-
-# Define EOVERFLOW as a C macro and as a substituted macro in such a way that
-# 1. on all systems, after inclusion of <errno.h>, EOVERFLOW is usable,
-# 2. on systems where EOVERFLOW is defined elsewhere, we use the same numeric
-# value.
-
-AC_DEFUN([gl_EOVERFLOW],
-[
- AC_REQUIRE([AC_PROG_CC])dnl
-
- AC_CACHE_CHECK([for EOVERFLOW], ac_cv_decl_EOVERFLOW, [
- AC_EGREP_CPP(yes,[
-#include <errno.h>
-#ifdef EOVERFLOW
-yes
-#endif
- ], have_eoverflow=1)
- if test -n "$have_eoverflow"; then
- dnl EOVERFLOW exists in <errno.h>. Don't need to define EOVERFLOW ourselves.
- ac_cv_decl_EOVERFLOW=yes
- else
- AC_EGREP_CPP(yes,[
-#define _XOPEN_SOURCE_EXTENDED 1
-#include <errno.h>
-#ifdef EOVERFLOW
-yes
-#endif
- ], have_eoverflow=1)
- if test -n "$have_eoverflow"; then
- dnl EOVERFLOW exists but is hidden.
- dnl Define it to the same value.
- _AC_COMPUTE_INT([EOVERFLOW], ac_cv_decl_EOVERFLOW, [
-#define _XOPEN_SOURCE_EXTENDED 1
-#include <errno.h>
-/* The following two lines are a workaround against an autoconf-2.52 bug. */
-#include <stdio.h>
-#include <stdlib.h>
-])
- else
- dnl EOVERFLOW isn't defined by the system. Define EOVERFLOW ourselves, but
- dnl don't define it as EINVAL, because snprintf() callers want to
- dnl distinguish EINVAL and EOVERFLOW.
- ac_cv_decl_EOVERFLOW=E2BIG
- fi
- fi
- ])
- if test "$ac_cv_decl_EOVERFLOW" != yes; then
- AC_DEFINE_UNQUOTED([EOVERFLOW], [$ac_cv_decl_EOVERFLOW],
- [Define as good substitute value for EOVERFLOW.])
- EOVERFLOW="$ac_cv_decl_EOVERFLOW"
- AC_SUBST(EOVERFLOW)
- fi
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/error.m4 b/xbmc/screensavers/rsxs-0.9/m4/error.m4
deleted file mode 100644
index 7c7746e2cc..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/error.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-#serial 11
-
-# Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2004 Free Software
-# Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_ERROR],
-[
- AC_FUNC_ERROR_AT_LINE
- dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]).
- gl_PREREQ_ERROR
-])
-
-# Prerequisites of lib/error.c.
-AC_DEFUN([gl_PREREQ_ERROR],
-[
- AC_REQUIRE([AC_FUNC_STRERROR_R])
- :
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/exitfail.m4 b/xbmc/screensavers/rsxs-0.9/m4/exitfail.m4
deleted file mode 100644
index 5523676f1d..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/exitfail.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-# exitfail.m4 serial 5
-dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_EXITFAIL],
-[
- AC_LIBSOURCES([exitfail.c, exitfail.h])
- AC_LIBOBJ([exitfail])
-
- dnl No prerequisites of lib/exitfail.c.
- :
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/extensions.m4 b/xbmc/screensavers/rsxs-0.9/m4/extensions.m4
deleted file mode 100644
index 4976079186..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/extensions.m4
+++ /dev/null
@@ -1,42 +0,0 @@
-# Enable extensions on systems that normally disable them.
-
-# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This file is only needed in autoconf <= 2.59. Newer versions of autoconf
-# have a macro AC_USE_SYSTEM_EXTENSIONS with identical semantics.
-
-# gl_USE_SYSTEM_EXTENSIONS
-# ------------------------
-# Enable extensions on systems that normally disable them,
-# typically due to standards-conformance issues.
-AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], [
- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
- AC_BEFORE([$0], [AC_RUN_IFELSE])
-
- AC_REQUIRE([AC_GNU_SOURCE])
- AC_REQUIRE([AC_AIX])
- AC_REQUIRE([AC_MINIX])
-
- AH_VERBATIM([__EXTENSIONS__],
-[/* Enable extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif])
- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
- [ac_cv_safe_to_define___extensions__],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([
- #define __EXTENSIONS__ 1
- AC_INCLUDES_DEFAULT])],
- [ac_cv_safe_to_define___extensions__=yes],
- [ac_cv_safe_to_define___extensions__=no])])
- test $ac_cv_safe_to_define___extensions__ = yes &&
- AC_DEFINE([__EXTENSIONS__])
- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/getopt.m4 b/xbmc/screensavers/rsxs-0.9/m4/getopt.m4
deleted file mode 100644
index c0a73b2cb8..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/getopt.m4
+++ /dev/null
@@ -1,83 +0,0 @@
-# getopt.m4 serial 13
-dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# The getopt module assume you want GNU getopt, with getopt_long etc,
-# rather than vanilla POSIX getopt. This means your code should
-# always include <getopt.h> for the getopt prototypes.
-
-AC_DEFUN([gl_GETOPT_SUBSTITUTE],
-[
- AC_LIBOBJ([getopt])
- AC_LIBOBJ([getopt1])
- gl_GETOPT_SUBSTITUTE_HEADER
- gl_PREREQ_GETOPT
-])
-
-AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
-[
- GETOPT_H=getopt.h
- AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
- [Define to rpl_ if the getopt replacement functions and variables
- should be used.])
- AC_SUBST([GETOPT_H])
-])
-
-AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
-[
- if test -z "$GETOPT_H"; then
- AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
- fi
-
- if test -z "$GETOPT_H"; then
- AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
- fi
-
- dnl BSD getopt_long uses an incompatible method to reset option processing,
- dnl and (as of 2004-10-15) mishandles optional option-arguments.
- if test -z "$GETOPT_H"; then
- AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
- fi
-
- dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
- dnl option string (as of 2005-05-05).
- if test -z "$GETOPT_H"; then
- AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM([#include <getopt.h>],
- [[
- char *myargv[3];
- myargv[0] = "conftest";
- myargv[1] = "-+";
- myargv[2] = 0;
- return getopt (2, myargv, "+a") != '?';
- ]])],
- [gl_cv_func_gnu_getopt=yes],
- [gl_cv_func_gnu_getopt=no],
- [dnl cross compiling - pessimistically guess based on decls
- dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
- dnl option string (as of 2005-05-05).
- AC_CHECK_DECL([getopt_clip],
- [gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes],
- [#include <getopt.h>])])])
- if test "$gl_cv_func_gnu_getopt" = "no"; then
- GETOPT_H=getopt.h
- fi
- fi
-])
-
-AC_DEFUN([gl_GETOPT_IFELSE],
-[
- AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
- AS_IF([test -n "$GETOPT_H"], [$1], [$2])
-])
-
-AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])])
-
-# Prerequisites of lib/getopt*.
-AC_DEFUN([gl_PREREQ_GETOPT],
-[
- AC_CHECK_DECLS_ONCE([getenv])
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/gettimeofday.m4 b/xbmc/screensavers/rsxs-0.9/m4/gettimeofday.m4
deleted file mode 100644
index 2fdc531cb5..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/gettimeofday.m4
+++ /dev/null
@@ -1,80 +0,0 @@
-#serial 7
-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-dnl From Jim Meyering.
-dnl
-dnl See if gettimeofday clobbers the static buffer that localtime uses
-dnl for its return value. The gettimeofday function from Mac OS X 10.0.4
-dnl (i.e., Darwin 1.3.7) has this problem.
-dnl
-dnl If it does, then arrange to use gettimeofday and localtime only via
-dnl the wrapper functions that work around the problem.
-
-AC_DEFUN([AC_FUNC_GETTIMEOFDAY_CLOBBER],
-[
- AC_REQUIRE([AC_HEADER_TIME])
- AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
- jm_cv_func_gettimeofday_clobber,
- [AC_TRY_RUN([
-#include <stdio.h>
-#include <string.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-#include <stdlib.h>
-
-int
-main ()
-{
- time_t t = 0;
- struct tm *lt;
- struct tm saved_lt;
- struct timeval tv;
- lt = localtime (&t);
- saved_lt = *lt;
- gettimeofday (&tv, NULL);
- if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0)
- exit (1);
-
- exit (0);
-}
- ],
- jm_cv_func_gettimeofday_clobber=no,
- jm_cv_func_gettimeofday_clobber=yes,
- dnl When crosscompiling, assume it is broken.
- jm_cv_func_gettimeofday_clobber=yes)
- ])
- if test $jm_cv_func_gettimeofday_clobber = yes; then
- gl_GETTIMEOFDAY_REPLACE_LOCALTIME
-
- AC_DEFINE(gettimeofday, rpl_gettimeofday,
- [Define to rpl_gettimeofday if the replacement function should be used.])
- gl_PREREQ_GETTIMEOFDAY
- fi
-])
-
-AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [
- AC_LIBOBJ(gettimeofday)
- AC_DEFINE(gmtime, rpl_gmtime,
- [Define to rpl_gmtime if the replacement function should be used.])
- AC_DEFINE(localtime, rpl_localtime,
- [Define to rpl_localtime if the replacement function should be used.])
-])
-
-# Prerequisites of lib/gettimeofday.c.
-AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [
- AC_REQUIRE([AC_HEADER_TIME])
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/gnulib-comp.m4 b/xbmc/screensavers/rsxs-0.9/m4/gnulib-comp.m4
deleted file mode 100644
index 4cc853d159..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/gnulib-comp.m4
+++ /dev/null
@@ -1,177 +0,0 @@
-# Copyright (C) 2004-2006 Free Software Foundation, Inc.
-#
-# This file is free software, distributed under the terms of the GNU
-# General Public License. As a special exception to the GNU General
-# Public License, this file may be distributed as part of a program
-# that contains a configuration script generated by Autoconf, under
-# the same distribution terms as the rest of that program.
-#
-# Generated by gnulib-tool.
-#
-# This file represents the compiled summary of the specification in
-# gnulib-cache.m4. It lists the computed macro invocations that need
-# to be invoked from configure.ac.
-# In projects using CVS, this file can be treated like other built files.
-
-
-# This macro should be invoked from ./configure.ac, in the section
-# "Checks for programs", right after AC_PROG_CC, and certainly before
-# any checks for libraries, header files, types and library functions.
-AC_DEFUN([gl_EARLY],
-[
- AC_REQUIRE([AC_PROG_RANLIB])
- AC_REQUIRE([AC_GNU_SOURCE])
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-])
-
-# This macro should be invoked from ./configure.ac, in the section
-# "Check for header files, types and library functions".
-AC_DEFUN([gl_INIT],
-[
- AM_CONDITIONAL([GL_COND_LIBTOOL], [false])
- gl_FUNC_ALLOCA
- gl_ARGP
- gl_FUNC_ARGZ
- gl_DIRNAME
- gl_ERROR
- gl_EXITFAIL
- dnl gl_USE_SYSTEM_EXTENSIONS must be added quite early to configure.ac.
- gl_GETOPT
- AC_FUNC_GETTIMEOFDAY_CLOBBER
- gl_MBCHAR
- gl_MBITER
- gl_FUNC_MEMCHR
- gl_FUNC_MEMPCPY
- gl_MINMAX
- gl_C_RESTRICT
- gl_SIZE_MAX
- AM_STDBOOL_H
- gl_STRCASE
- gl_FUNC_STRCHRNUL
- gl_FUNC_STRNDUP
- gl_FUNC_STRNLEN
- gl_SYSEXITS
- gl_HEADER_UNISTD
- gl_FUNC_VASNPRINTF
- gl_FUNC_VSNPRINTF
- gl_FUNC_WCWIDTH
- gl_XALLOC
- gl_XSIZE
- gl_XSTRNDUP
-])
-
-# This macro records the list of files which have been installed by
-# gnulib-tool and may be removed by future gnulib-tool invocations.
-AC_DEFUN([gl_FILE_LIST], [
- lib/alloca.c
- lib/alloca_.h
- lib/argp-ba.c
- lib/argp-eexst.c
- lib/argp-fmtstream.c
- lib/argp-fmtstream.h
- lib/argp-fs-xinl.c
- lib/argp-help.c
- lib/argp-namefrob.h
- lib/argp-parse.c
- lib/argp-pin.c
- lib/argp-pv.c
- lib/argp-pvh.c
- lib/argp-xinl.c
- lib/argp.h
- lib/argz.c
- lib/argz_.h
- lib/asnprintf.c
- lib/basename.c
- lib/dirname.c
- lib/dirname.h
- lib/error.c
- lib/error.h
- lib/exit.h
- lib/exitfail.c
- lib/exitfail.h
- lib/getopt.c
- lib/getopt1.c
- lib/getopt_.h
- lib/getopt_int.h
- lib/gettext.h
- lib/gettimeofday.c
- lib/mbchar.c
- lib/mbchar.h
- lib/mbuiter.h
- lib/memchr.c
- lib/mempcpy.c
- lib/mempcpy.h
- lib/minmax.h
- lib/printf-args.c
- lib/printf-args.h
- lib/printf-parse.c
- lib/printf-parse.h
- lib/size_max.h
- lib/stdbool_.h
- lib/strcase.h
- lib/strcasecmp.c
- lib/strchrnul.c
- lib/strchrnul.h
- lib/stripslash.c
- lib/strncasecmp.c
- lib/strndup.c
- lib/strndup.h
- lib/strnlen.c
- lib/strnlen.h
- lib/strnlen1.c
- lib/strnlen1.h
- lib/sysexit_.h
- lib/vasnprintf.c
- lib/vasnprintf.h
- lib/vsnprintf.c
- lib/vsnprintf.h
- lib/wcwidth.h
- lib/xalloc-die.c
- lib/xalloc.h
- lib/xmalloc.c
- lib/xsize.h
- lib/xstrndup.c
- lib/xstrndup.h
- m4/alloca.m4
- m4/argp.m4
- m4/argz.m4
- m4/dirname.m4
- m4/dos.m4
- m4/double-slash-root.m4
- m4/eoverflow.m4
- m4/error.m4
- m4/exitfail.m4
- m4/extensions.m4
- m4/getopt.m4
- m4/gettimeofday.m4
- m4/intmax_t.m4
- m4/inttypes_h.m4
- m4/longdouble.m4
- m4/longlong.m4
- m4/mbchar.m4
- m4/mbiter.m4
- m4/mbrtowc.m4
- m4/memchr.m4
- m4/mempcpy.m4
- m4/minmax.m4
- m4/restrict.m4
- m4/signed.m4
- m4/size_max.m4
- m4/stdbool.m4
- m4/stdint_h.m4
- m4/strcase.m4
- m4/strchrnul.m4
- m4/strerror_r.m4
- m4/strndup.m4
- m4/strnlen.m4
- m4/sysexits.m4
- m4/unistd_h.m4
- m4/vasnprintf.m4
- m4/vsnprintf.m4
- m4/wchar_t.m4
- m4/wcwidth.m4
- m4/wint_t.m4
- m4/xalloc.m4
- m4/xsize.m4
- m4/xstrndup.m4
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/intmax_t.m4 b/xbmc/screensavers/rsxs-0.9/m4/intmax_t.m4
deleted file mode 100644
index 44b16523cc..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/intmax_t.m4
+++ /dev/null
@@ -1,61 +0,0 @@
-# intmax_t.m4 serial 4
-dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Paul Eggert.
-
-AC_PREREQ(2.13)
-
-# Define intmax_t to 'long' or 'long long'
-# if it is not already defined in <stdint.h> or <inttypes.h>.
-
-AC_DEFUN([gl_AC_TYPE_INTMAX_T],
-[
- dnl For simplicity, we assume that a header file defines 'intmax_t' if and
- dnl only if it defines 'uintmax_t'.
- AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
- AC_REQUIRE([gl_AC_HEADER_STDINT_H])
- if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
- AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
- test $ac_cv_type_long_long = yes \
- && ac_type='long long' \
- || ac_type='long'
- AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
- [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
- else
- AC_DEFINE(HAVE_INTMAX_T, 1,
- [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
- fi
-])
-
-dnl An alternative would be to explicitly test for 'intmax_t'.
-
-AC_DEFUN([gt_AC_TYPE_INTMAX_T],
-[
- AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
- AC_REQUIRE([gl_AC_HEADER_STDINT_H])
- AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
- [AC_TRY_COMPILE([
-#include <stddef.h>
-#include <stdlib.h>
-#if HAVE_STDINT_H_WITH_UINTMAX
-#include <stdint.h>
-#endif
-#if HAVE_INTTYPES_H_WITH_UINTMAX
-#include <inttypes.h>
-#endif
-], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
- if test $gt_cv_c_intmax_t = yes; then
- AC_DEFINE(HAVE_INTMAX_T, 1,
- [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
- else
- AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
- test $ac_cv_type_long_long = yes \
- && ac_type='long long' \
- || ac_type='long'
- AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
- [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
- fi
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/inttypes_h.m4 b/xbmc/screensavers/rsxs-0.9/m4/inttypes_h.m4
deleted file mode 100644
index a5d075d968..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/inttypes_h.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-# inttypes_h.m4 serial 6
-dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Paul Eggert.
-
-# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
-# doesn't clash with <sys/types.h>, and declares uintmax_t.
-
-AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
-[
- AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
- [AC_TRY_COMPILE(
- [#include <sys/types.h>
-#include <inttypes.h>],
- [uintmax_t i = (uintmax_t) -1;],
- gl_cv_header_inttypes_h=yes,
- gl_cv_header_inttypes_h=no)])
- if test $gl_cv_header_inttypes_h = yes; then
- AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
- [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
- and declares uintmax_t. ])
- fi
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/longdouble.m4 b/xbmc/screensavers/rsxs-0.9/m4/longdouble.m4
deleted file mode 100644
index 25590f4704..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/longdouble.m4
+++ /dev/null
@@ -1,31 +0,0 @@
-# longdouble.m4 serial 2 (gettext-0.15)
-dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-dnl Test whether the compiler supports the 'long double' type.
-dnl Prerequisite: AC_PROG_CC
-
-dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf
-dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics.
-
-AC_DEFUN([gt_TYPE_LONGDOUBLE],
-[
- AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
- [if test "$GCC" = yes; then
- gt_cv_c_long_double=yes
- else
- AC_TRY_COMPILE([
- /* The Stardent Vistra knows sizeof(long double), but does not support it. */
- long double foo = 0.0;
- /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
- int array [2*(sizeof(long double) >= sizeof(double)) - 1];
- ], ,
- gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
- fi])
- if test $gt_cv_c_long_double = yes; then
- AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
- fi
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/longlong.m4 b/xbmc/screensavers/rsxs-0.9/m4/longlong.m4
deleted file mode 100644
index ea7c485c36..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/longlong.m4
+++ /dev/null
@@ -1,44 +0,0 @@
-# longlong.m4 serial 6
-dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Paul Eggert.
-
-# Define HAVE_LONG_LONG_INT if 'long long int' works.
-# This fixes a bug in Autoconf 2.60, but can be removed once we
-# assume 2.61 everywhere.
-
-AC_DEFUN([AC_TYPE_LONG_LONG_INT],
-[
- AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[long long int ll = 9223372036854775807ll;
- long long int nll = -9223372036854775807LL;
- typedef int a[((-9223372036854775807LL < 0
- && 0 < 9223372036854775807ll)
- ? 1 : -1)];
- int i = 63;]],
- [[long long int llmax = 9223372036854775807ll;
- return (ll << 63 | ll >> 63 | ll < i | ll > i
- | llmax / ll | llmax % ll);]])],
- [ac_cv_type_long_long_int=yes],
- [ac_cv_type_long_long_int=no])])
- if test $ac_cv_type_long_long_int = yes; then
- AC_DEFINE([HAVE_LONG_LONG_INT], 1,
- [Define to 1 if the system has the type `long long int'.])
- fi
-])
-
-# This macro is obsolescent and should go away soon.
-AC_DEFUN([gl_AC_TYPE_LONG_LONG],
-[
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
- ac_cv_type_long_long=$ac_cv_type_long_long_int
- if test $ac_cv_type_long_long = yes; then
- AC_DEFINE(HAVE_LONG_LONG, 1,
- [Define if you have the 'long long' type.])
- fi
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/mbchar.m4 b/xbmc/screensavers/rsxs-0.9/m4/mbchar.m4
deleted file mode 100644
index df351a6eb2..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/mbchar.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-# mbchar.m4 serial 2
-dnl Copyright (C) 2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl autoconf tests required for use of mbchar.m4
-dnl From Bruno Haible.
-
-AC_DEFUN([gl_MBCHAR],
-[
- AC_REQUIRE([AC_GNU_SOURCE])
- dnl The following line is that so the user can test
- dnl HAVE_WCHAR_H && HAVE_WCTYPE_H before #include "mbchar.h".
- AC_CHECK_HEADERS_ONCE(wchar.h wctype.h)
- dnl Compile mbchar.c only if HAVE_WCHAR_H && HAVE_WCTYPE_H.
- if test $ac_cv_header_wchar_h = yes && test $ac_cv_header_wctype_h = yes; then
- AC_LIBOBJ([mbchar])
- fi
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/mbiter.m4 b/xbmc/screensavers/rsxs-0.9/m4/mbiter.m4
deleted file mode 100644
index 7d51af10dc..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/mbiter.m4
+++ /dev/null
@@ -1,17 +0,0 @@
-# mbiter.m4 serial 2
-dnl Copyright (C) 2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl autoconf tests required for use of mbiter.h
-dnl From Bruno Haible.
-
-AC_DEFUN([gl_MBITER],
-[
- AC_REQUIRE([AC_TYPE_MBSTATE_T])
- dnl The following line is that so the user can test HAVE_MBRTOWC before
- dnl #include "mbiter.h" or "mbuiter.h".
- AC_REQUIRE([gl_FUNC_MBRTOWC])
- :
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/mbrtowc.m4 b/xbmc/screensavers/rsxs-0.9/m4/mbrtowc.m4
deleted file mode 100644
index a3bd9114c3..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/mbrtowc.m4
+++ /dev/null
@@ -1,31 +0,0 @@
-# mbrtowc.m4 serial 8
-dnl Copyright (C) 2001-2002, 2004-2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Paul Eggert
-
-dnl This file can be removed, and gl_FUNC_MBRTOWC replaced with
-dnl AC_FUNC_MBRTOWC, when autoconf 2.60 can be assumed everywhere.
-
-AC_DEFUN([gl_FUNC_MBRTOWC],
-[
- dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
- AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
- gl_cv_func_mbrtowc,
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <wchar.h>]],
- [[wchar_t wc;
- char const s[] = "";
- size_t n = 1;
- mbstate_t state;
- return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
- gl_cv_func_mbrtowc=yes,
- gl_cv_func_mbrtowc=no)])
- if test $gl_cv_func_mbrtowc = yes; then
- AC_DEFINE([HAVE_MBRTOWC], 1,
- [Define to 1 if mbrtowc and mbstate_t are properly declared.])
- fi
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/memchr.m4 b/xbmc/screensavers/rsxs-0.9/m4/memchr.m4
deleted file mode 100644
index 91b8636eb8..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/memchr.m4
+++ /dev/null
@@ -1,18 +0,0 @@
-# memchr.m4 serial 4
-dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_MEMCHR],
-[
- AC_REPLACE_FUNCS(memchr)
- if test $ac_cv_func_memchr = no; then
- gl_PREREQ_MEMCHR
- fi
-])
-
-# Prerequisites of lib/memchr.c.
-AC_DEFUN([gl_PREREQ_MEMCHR], [
- AC_CHECK_HEADERS(bp-sym.h)
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/mempcpy.m4 b/xbmc/screensavers/rsxs-0.9/m4/mempcpy.m4
deleted file mode 100644
index a96168d88e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/mempcpy.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-# mempcpy.m4 serial 3
-dnl Copyright (C) 2003, 2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_MEMPCPY],
-[
- AC_LIBSOURCES([mempcpy.c, mempcpy.h])
-
- dnl Persuade glibc <string.h> to declare mempcpy().
- AC_REQUIRE([AC_GNU_SOURCE])
-
- AC_REPLACE_FUNCS(mempcpy)
- if test $ac_cv_func_mempcpy = no; then
- gl_PREREQ_MEMPCPY
- fi
-])
-
-# Prerequisites of lib/mempcpy.c.
-AC_DEFUN([gl_PREREQ_MEMPCPY], [
- :
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/minmax.m4 b/xbmc/screensavers/rsxs-0.9/m4/minmax.m4
deleted file mode 100644
index bbd1ba0b84..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/minmax.m4
+++ /dev/null
@@ -1,41 +0,0 @@
-# minmax.m4 serial 2
-dnl Copyright (C) 2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_PREREQ(2.52)
-
-AC_DEFUN([gl_MINMAX],
-[
- AC_REQUIRE([gl_PREREQ_MINMAX])
-])
-
-# Prerequisites of lib/minmax.h.
-AC_DEFUN([gl_PREREQ_MINMAX],
-[
- gl_MINMAX_IN_HEADER([limits.h])
- gl_MINMAX_IN_HEADER([sys/param.h])
-])
-
-dnl gl_MINMAX_IN_HEADER(HEADER)
-dnl The parameter has to be a literal header name; it cannot be macro,
-dnl nor a shell variable. (Because autoheader collects only AC_DEFINE
-dnl invocations with a literal macro name.)
-AC_DEFUN([gl_MINMAX_IN_HEADER],
-[
- m4_pushdef([header], AS_TR_SH([$1]))
- m4_pushdef([HEADER], AS_TR_CPP([$1]))
- AC_CACHE_CHECK([whether <$1> defines MIN and MAX],
- [gl_cv_minmax_in_]header,
- [AC_TRY_COMPILE([#include <$1>
-int x = MIN (42, 17);], [],
- [gl_cv_minmax_in_]header[=yes],
- [gl_cv_minmax_in_]header[=no])])
- if test $gl_cv_minmax_in_[]header = yes; then
- AC_DEFINE([HAVE_MINMAX_IN_]HEADER, 1,
- [Define to 1 if <$1> defines the MIN and MAX macros.])
- fi
- m4_popdef([HEADER])
- m4_popdef([header])
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/onceonly_2_57.m4 b/xbmc/screensavers/rsxs-0.9/m4/onceonly_2_57.m4
deleted file mode 100644
index 15884b3ea3..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/onceonly_2_57.m4
+++ /dev/null
@@ -1,86 +0,0 @@
-# onceonly_2_57.m4 serial 4
-dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License. As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl This file defines some "once only" variants of standard autoconf macros.
-dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
-dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
-dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
-dnl AC_REQUIRE([AC_FUNC_STRCOLL]) like AC_FUNC_STRCOLL
-dnl The advantage is that the check for each of the headers/functions/decls
-dnl will be put only once into the 'configure' file. It keeps the size of
-dnl the 'configure' file down, and avoids redundant output when 'configure'
-dnl is run.
-dnl The drawback is that the checks cannot be conditionalized. If you write
-dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
-dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
-dnl empty, and the check will be inserted before the body of the AC_DEFUNed
-dnl function.
-
-dnl This is like onceonly.m4, except that it uses diversions to named sections
-dnl DEFAULTS and INIT_PREPARE in order to check all requested headers at once,
-dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The
-dnl size reduction is ca. 9%.
-
-dnl Autoconf version 2.57 or newer is recommended.
-AC_PREREQ(2.57)
-
-# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
-# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
-AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
- :
- AC_FOREACH([gl_HEADER_NAME], [$1], [
- AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
- [./-], [___])), [
- m4_divert_text([INIT_PREPARE],
- [gl_header_list="$gl_header_list gl_HEADER_NAME"])
- gl_HEADERS_EXPANSION
- AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])),
- [Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.])
- ])
- AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
- [./-], [___])))
- ])
-])
-m4_define([gl_HEADERS_EXPANSION], [
- m4_divert_text([DEFAULTS], [gl_header_list=])
- AC_CHECK_HEADERS([$gl_header_list])
- m4_define([gl_HEADERS_EXPANSION], [])
-])
-
-# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
-# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
-AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
- :
- AC_FOREACH([gl_FUNC_NAME], [$1], [
- AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
- m4_divert_text([INIT_PREPARE],
- [gl_func_list="$gl_func_list gl_FUNC_NAME"])
- gl_FUNCS_EXPANSION
- AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])),
- [Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.])
- ])
- AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
- ])
-])
-m4_define([gl_FUNCS_EXPANSION], [
- m4_divert_text([DEFAULTS], [gl_func_list=])
- AC_CHECK_FUNCS([$gl_func_list])
- m4_define([gl_FUNCS_EXPANSION], [])
-])
-
-# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
-# AC_CHECK_DECLS(DECL1, DECL2, ...).
-AC_DEFUN([AC_CHECK_DECLS_ONCE], [
- :
- AC_FOREACH([gl_DECL_NAME], [$1], [
- AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
- AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
- ])
- AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
- ])
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/restrict.m4 b/xbmc/screensavers/rsxs-0.9/m4/restrict.m4
deleted file mode 100644
index 1f3bbb92c4..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/restrict.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-#serial 1003
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# This macro can be removed once we can rely on Autoconf 2.57a or later,
-# since we can then use its AC_C_RESTRICT.
-
-# gl_C_RESTRICT
-# --------------
-# Determine whether the C/C++ compiler supports the "restrict" keyword
-# introduced in ANSI C99, or an equivalent. Do nothing if the compiler
-# accepts it. Otherwise, if the compiler supports an equivalent,
-# define "restrict" to be that. Here are some variants:
-# - GCC supports both __restrict and __restrict__
-# - older DEC Alpha C compilers support only __restrict
-# - _Restrict is the only spelling accepted by Sun WorkShop 6 update 2 C
-# Otherwise, define "restrict" to be empty.
-AC_DEFUN([gl_C_RESTRICT],
-[AC_CACHE_CHECK([for C/C++ restrict keyword], gl_cv_c_restrict,
- [gl_cv_c_restrict=no
- # Try the official restrict keyword, then gcc's __restrict, and
- # the less common variants.
- for ac_kw in restrict __restrict __restrict__ _Restrict; do
- AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [float * $ac_kw x;])],
- [gl_cv_c_restrict=$ac_kw; break])
- done
- ])
- case $gl_cv_c_restrict in
- restrict) ;;
- no) AC_DEFINE(restrict,,
- [Define to equivalent of C99 restrict keyword, or to nothing if this
- is not supported. Do not define if restrict is supported directly.]) ;;
- *) AC_DEFINE_UNQUOTED(restrict, $gl_cv_c_restrict) ;;
- esac
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/signed.m4 b/xbmc/screensavers/rsxs-0.9/m4/signed.m4
deleted file mode 100644
index 048f593698..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/signed.m4
+++ /dev/null
@@ -1,17 +0,0 @@
-# signed.m4 serial 1 (gettext-0.10.40)
-dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-AC_DEFUN([bh_C_SIGNED],
-[
- AC_CACHE_CHECK([for signed], bh_cv_c_signed,
- [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
- if test $bh_cv_c_signed = no; then
- AC_DEFINE(signed, ,
- [Define to empty if the C compiler doesn't support this keyword.])
- fi
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/size_max.m4 b/xbmc/screensavers/rsxs-0.9/m4/size_max.m4
deleted file mode 100644
index 029e471950..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/size_max.m4
+++ /dev/null
@@ -1,60 +0,0 @@
-# size_max.m4 serial 4
-dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-AC_DEFUN([gl_SIZE_MAX],
-[
- AC_CHECK_HEADERS(stdint.h)
- dnl First test whether the system already has SIZE_MAX.
- AC_MSG_CHECKING([for SIZE_MAX])
- result=
- AC_EGREP_CPP([Found it], [
-#include <limits.h>
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#ifdef SIZE_MAX
-Found it
-#endif
-], result=yes)
- if test -z "$result"; then
- dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
- dnl than the type 'unsigned long'. Try hard to find a definition that can
- dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
- _AC_COMPUTE_INT([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1,
- [#include <stddef.h>
-#include <limits.h>], size_t_bits_minus_1=)
- _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
- [#include <stddef.h>], fits_in_uint=)
- if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
- if test $fits_in_uint = 1; then
- dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
- dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
- AC_TRY_COMPILE([#include <stddef.h>
- extern size_t foo;
- extern unsigned long foo;
- ], [], fits_in_uint=0)
- fi
- dnl We cannot use 'expr' to simplify this expression, because 'expr'
- dnl works only with 'long' integers in the host environment, while we
- dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
- if test $fits_in_uint = 1; then
- result="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
- else
- result="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
- fi
- else
- dnl Shouldn't happen, but who knows...
- result='((size_t)~(size_t)0)'
- fi
- fi
- AC_MSG_RESULT([$result])
- if test "$result" != yes; then
- AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
- [Define as the maximum value of type 'size_t', if the system doesn't define it.])
- fi
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/stdbool.m4 b/xbmc/screensavers/rsxs-0.9/m4/stdbool.m4
deleted file mode 100644
index 2204ecd984..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/stdbool.m4
+++ /dev/null
@@ -1,115 +0,0 @@
-# Check for stdbool.h that conforms to C99.
-
-dnl Copyright (C) 2002-2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# Prepare for substituting <stdbool.h> if it is not supported.
-
-AC_DEFUN([AM_STDBOOL_H],
-[
- AC_REQUIRE([AC_HEADER_STDBOOL])
-
- # Define two additional variables used in the Makefile substitution.
-
- if test "$ac_cv_header_stdbool_h" = yes; then
- STDBOOL_H=''
- else
- STDBOOL_H='stdbool.h'
- fi
- AC_SUBST([STDBOOL_H])
-
- if test "$ac_cv_type__Bool" = yes; then
- HAVE__BOOL=1
- else
- HAVE__BOOL=0
- fi
- AC_SUBST([HAVE__BOOL])
-])
-
-# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
-AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
-
-# This macro is only needed in autoconf <= 2.59. Newer versions of autoconf
-# have this macro built-in.
-
-AC_DEFUN([AC_HEADER_STDBOOL],
- [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
- [ac_cv_header_stdbool_h],
- [AC_TRY_COMPILE(
- [
- #include <stdbool.h>
- #ifndef bool
- "error: bool is not defined"
- #endif
- #ifndef false
- "error: false is not defined"
- #endif
- #if false
- "error: false is not 0"
- #endif
- #ifndef true
- "error: true is not defined"
- #endif
- #if true != 1
- "error: true is not 1"
- #endif
- #ifndef __bool_true_false_are_defined
- "error: __bool_true_false_are_defined is not defined"
- #endif
-
- struct s { _Bool s: 1; _Bool t; } s;
-
- char a[true == 1 ? 1 : -1];
- char b[false == 0 ? 1 : -1];
- char c[__bool_true_false_are_defined == 1 ? 1 : -1];
- char d[(bool) 0.5 == true ? 1 : -1];
- bool e = &s;
- char f[(_Bool) 0.0 == false ? 1 : -1];
- char g[true];
- char h[sizeof (_Bool)];
- char i[sizeof s.t];
- enum { j = false, k = true, l = false * true, m = true * 256 };
- _Bool n[m];
- char o[sizeof n == m * sizeof n[0] ? 1 : -1];
- char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
- #if defined __xlc__ || defined __GNUC__
- /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
- reported by James Lemley on 2005-10-05; see
- http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
- This test is not quite right, since xlc is allowed to
- reject this program, as the initializer for xlcbug is
- not one of the forms that C requires support for.
- However, doing the test right would require a run-time
- test, and that would make cross-compilation harder.
- Let us hope that IBM fixes the xlc bug, and also adds
- support for this kind of constant expression. In the
- meantime, this test will reject xlc, which is OK, since
- our stdbool.h substitute should suffice. We also test
- this with GCC, where it should work, to detect more
- quickly whether someone messes up the test in the
- future. */
- char digs[] = "0123456789";
- int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
- #endif
- /* Catch a bug in an HP-UX C compiler. See
- http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
- http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
- */
- _Bool q = true;
- _Bool *pq = &q;
- ],
- [
- *pq |= q;
- *pq |= ! q;
- /* Refer to every declared value, to avoid compiler optimizations. */
- return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
- + !m + !n + !o + !p + !q + !pq);
- ],
- [ac_cv_header_stdbool_h=yes],
- [ac_cv_header_stdbool_h=no])])
- AC_CHECK_TYPES([_Bool])
- if test $ac_cv_header_stdbool_h = yes; then
- AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
- fi])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/stdint_h.m4 b/xbmc/screensavers/rsxs-0.9/m4/stdint_h.m4
deleted file mode 100644
index 3355f35aa3..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/stdint_h.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-# stdint_h.m4 serial 5
-dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Paul Eggert.
-
-# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
-# doesn't clash with <sys/types.h>, and declares uintmax_t.
-
-AC_DEFUN([gl_AC_HEADER_STDINT_H],
-[
- AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h,
- [AC_TRY_COMPILE(
- [#include <sys/types.h>
-#include <stdint.h>],
- [uintmax_t i = (uintmax_t) -1;],
- gl_cv_header_stdint_h=yes,
- gl_cv_header_stdint_h=no)])
- if test $gl_cv_header_stdint_h = yes; then
- AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
- [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
- and declares uintmax_t. ])
- fi
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/strcase.m4 b/xbmc/screensavers/rsxs-0.9/m4/strcase.m4
deleted file mode 100644
index 6db401bb1b..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/strcase.m4
+++ /dev/null
@@ -1,39 +0,0 @@
-# strcase.m4 serial 3
-dnl Copyright (C) 2002, 2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_STRCASE],
-[
- gl_FUNC_STRCASECMP
- gl_FUNC_STRNCASECMP
-])
-
-AC_DEFUN([gl_FUNC_STRCASECMP],
-[
- dnl No known system has a strcasecmp() function that works correctly in
- dnl multibyte locales. Therefore we use our version always.
- AC_LIBOBJ(strcasecmp)
- AC_DEFINE(strcasecmp, rpl_strcasecmp, [Define to rpl_strcasecmp always.])
- gl_PREREQ_STRCASECMP
-])
-
-AC_DEFUN([gl_FUNC_STRNCASECMP],
-[
- AC_REPLACE_FUNCS(strncasecmp)
- if test $ac_cv_func_strncasecmp = no; then
- gl_PREREQ_STRNCASECMP
- fi
-])
-
-# Prerequisites of lib/strcasecmp.c.
-AC_DEFUN([gl_PREREQ_STRCASECMP], [
- AC_REQUIRE([gl_FUNC_MBRTOWC])
- :
-])
-
-# Prerequisites of lib/strncasecmp.c.
-AC_DEFUN([gl_PREREQ_STRNCASECMP], [
- :
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/strchrnul.m4 b/xbmc/screensavers/rsxs-0.9/m4/strchrnul.m4
deleted file mode 100644
index 8492b9f174..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/strchrnul.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-# strchrnul.m4 serial 3
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_STRCHRNUL],
-[
- dnl Persuade glibc <string.h> to declare strchrnul().
- AC_REQUIRE([AC_GNU_SOURCE])
-
- AC_REPLACE_FUNCS(strchrnul)
- if test $ac_cv_func_strchrnul = no; then
- gl_PREREQ_STRCHRNUL
- fi
-])
-
-# Prerequisites of lib/strchrnul.c.
-AC_DEFUN([gl_PREREQ_STRCHRNUL], [:])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/strndup.m4 b/xbmc/screensavers/rsxs-0.9/m4/strndup.m4
deleted file mode 100644
index 617db4c884..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/strndup.m4
+++ /dev/null
@@ -1,54 +0,0 @@
-# strndup.m4 serial 7
-dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_STRNDUP],
-[
- AC_LIBSOURCES([strndup.c, strndup.h])
-
- dnl Persuade glibc <string.h> to declare strndup().
- AC_REQUIRE([AC_GNU_SOURCE])
-
- AC_CHECK_DECLS_ONCE([strndup])
-
- # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'.
- AC_CACHE_CHECK([for working strndup], gl_cv_func_strndup,
- [AC_RUN_IFELSE([
- AC_LANG_PROGRAM([
-#include <stdlib.h>
-#include <string.h>
- ], [[
-#ifndef HAVE_DECL_STRNDUP
- extern char *strndup (const char *, size_t);
-#endif
- char *s;
- s = strndup ("some longer string", 15);
- free (s);
- s = strndup ("shorter string", 13);
- return s[13] != '\0';]])],
- [gl_cv_func_strndup=yes],
- [gl_cv_func_strndup=no],
- [AC_CHECK_FUNC([strndup],
- [AC_EGREP_CPP([too risky], [
-#ifdef _AIX
- too risky
-#endif
- ],
- [gl_cv_func_strndup=no],
- [gl_cv_func_strndup=yes])],
- [gl_cv_func_strndup=no])])])
- if test $gl_cv_func_strndup = yes; then
- AC_DEFINE([HAVE_STRNDUP], 1,
- [Define if you have the strndup() function and it works.])
- else
- AC_LIBOBJ([strndup])
- AC_DEFINE(strndup, rpl_strndup,
- [Define to rpl_strndup if the replacement function should be used,])
- gl_PREREQ_STRNDUP
- fi
-])
-
-# Prerequisites of lib/strndup.c.
-AC_DEFUN([gl_PREREQ_STRNDUP], [:])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/strnlen.m4 b/xbmc/screensavers/rsxs-0.9/m4/strnlen.m4
deleted file mode 100644
index 67964c8d7d..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/strnlen.m4
+++ /dev/null
@@ -1,29 +0,0 @@
-# strnlen.m4 serial 5
-dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_STRNLEN],
-[
- AC_LIBSOURCES([strnlen.c, strnlen.h])
-
- dnl Persuade glibc <string.h> to declare strnlen().
- AC_REQUIRE([AC_GNU_SOURCE])
-
- AC_FUNC_STRNLEN
- if test $ac_cv_func_strnlen_working = no; then
- # This is necessary because automake-1.6.1 doens't understand
- # that the above use of AC_FUNC_STRNLEN means we may have to use
- # lib/strnlen.c.
- #AC_LIBOBJ(strnlen)
- AC_DEFINE(strnlen, rpl_strnlen,
- [Define to rpl_strnlen if the replacement function should be used.])
- gl_PREREQ_STRNLEN
- fi
-])
-
-# Prerequisites of lib/strnlen.c.
-AC_DEFUN([gl_PREREQ_STRNLEN], [
- AC_CHECK_DECLS_ONCE(strnlen)
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/sysexits.m4 b/xbmc/screensavers/rsxs-0.9/m4/sysexits.m4
deleted file mode 100644
index 69d20917be..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/sysexits.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-# sysexits.m4 serial 2
-dnl Copyright (C) 2003,2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_SYSEXITS],
-[
- AC_CHECK_HEADERS(sysexits.h,
- [SYSEXITS_H=],
- [SYSEXITS_H=sysexits.h])
- AC_SUBST([SYSEXITS_H])
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/unistd_h.m4 b/xbmc/screensavers/rsxs-0.9/m4/unistd_h.m4
deleted file mode 100644
index 9c77f9bd0d..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/unistd_h.m4
+++ /dev/null
@@ -1,18 +0,0 @@
-# unistd_h.m4 serial 2
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Written by Simon Josefsson
-
-AC_DEFUN([gl_HEADER_UNISTD],
-[
- dnl Prerequisites of lib/unistd.h.
- AC_CHECK_HEADERS([unistd.h], [
- UNISTD_H=''
- ], [
- UNISTD_H='unistd.h'
- ])
- AC_SUBST(UNISTD_H)
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/vasnprintf.m4 b/xbmc/screensavers/rsxs-0.9/m4/vasnprintf.m4
deleted file mode 100644
index 7ff3430350..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/vasnprintf.m4
+++ /dev/null
@@ -1,58 +0,0 @@
-# vasnprintf.m4 serial 5
-dnl Copyright (C) 2002-2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_VASNPRINTF],
-[
- AC_REQUIRE([gl_EOVERFLOW])
- AC_REPLACE_FUNCS(vasnprintf)
- if test $ac_cv_func_vasnprintf = no; then
- AC_LIBOBJ(printf-args)
- AC_LIBOBJ(printf-parse)
- AC_LIBOBJ(asnprintf)
- gl_PREREQ_PRINTF_ARGS
- gl_PREREQ_PRINTF_PARSE
- gl_PREREQ_VASNPRINTF
- gl_PREREQ_ASNPRINTF
- fi
-])
-
-# Prequisites of lib/printf-args.h, lib/printf-args.c.
-AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
-[
- AC_REQUIRE([bh_C_SIGNED])
- AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
- AC_REQUIRE([gt_TYPE_LONGDOUBLE])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
-])
-
-# Prequisites of lib/printf-parse.h, lib/printf-parse.c.
-AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
-[
- AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
- AC_REQUIRE([gt_TYPE_LONGDOUBLE])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
- AC_REQUIRE([AC_TYPE_SIZE_T])
- AC_CHECK_TYPES(ptrdiff_t)
- AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
-])
-
-# Prerequisites of lib/vasnprintf.c.
-AC_DEFUN([gl_PREREQ_VASNPRINTF],
-[
- AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
- AC_REQUIRE([gt_TYPE_LONGDOUBLE])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
- AC_CHECK_FUNCS(snprintf wcslen)
-])
-
-# Prerequisites of lib/asnprintf.c.
-AC_DEFUN([gl_PREREQ_ASNPRINTF],
-[
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/vsnprintf.m4 b/xbmc/screensavers/rsxs-0.9/m4/vsnprintf.m4
deleted file mode 100644
index cb8a9b18da..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/vsnprintf.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-# vsnprintf.m4 serial 2
-dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_VSNPRINTF],
-[
- AC_REPLACE_FUNCS(vsnprintf)
- AC_CHECK_DECLS_ONCE(vsnprintf)
- gl_PREREQ_VSNPRINTF
-])
-
-# Prerequisites of lib/vsnprintf.c.
-AC_DEFUN([gl_PREREQ_VSNPRINTF], [:])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/wchar_t.m4 b/xbmc/screensavers/rsxs-0.9/m4/wchar_t.m4
deleted file mode 100644
index cde2129a97..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/wchar_t.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-# wchar_t.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-dnl Test whether <stddef.h> has the 'wchar_t' type.
-dnl Prerequisite: AC_PROG_CC
-
-AC_DEFUN([gt_TYPE_WCHAR_T],
-[
- AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
- [AC_TRY_COMPILE([#include <stddef.h>
- wchar_t foo = (wchar_t)'\0';], ,
- gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
- if test $gt_cv_c_wchar_t = yes; then
- AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
- fi
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/wcwidth.m4 b/xbmc/screensavers/rsxs-0.9/m4/wcwidth.m4
deleted file mode 100644
index 09cf55a0ef..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/wcwidth.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-# wcwidth.m4 serial 3
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_WCWIDTH],
-[
- dnl Persuade glibc <wchar.h> to declare wcwidth().
- AC_REQUIRE([AC_GNU_SOURCE])
-
- AC_REQUIRE([AC_C_INLINE])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
-
- AC_CHECK_HEADERS_ONCE([wchar.h wctype.h])
- AC_CHECK_FUNCS_ONCE([iswprint wcwidth])
-
- AC_CHECK_DECLS([wcwidth], [], [], [
-/* AIX 3.2.5 declares wcwidth in <string.h>. */
-#if HAVE_STRING_H
-# include <string.h>
-#endif
-#if HAVE_WCHAR_H
-# include <wchar.h>
-#endif
-])])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/wint_t.m4 b/xbmc/screensavers/rsxs-0.9/m4/wint_t.m4
deleted file mode 100644
index b8fff9c86f..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/wint_t.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-# wint_t.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-dnl Test whether <wchar.h> has the 'wint_t' type.
-dnl Prerequisite: AC_PROG_CC
-
-AC_DEFUN([gt_TYPE_WINT_T],
-[
- AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
- [AC_TRY_COMPILE([#include <wchar.h>
- wint_t foo = (wchar_t)'\0';], ,
- gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
- if test $gt_cv_c_wint_t = yes; then
- AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
- fi
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/xalloc.m4 b/xbmc/screensavers/rsxs-0.9/m4/xalloc.m4
deleted file mode 100644
index c0847dd37e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/xalloc.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-# xalloc.m4 serial 12
-dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_XALLOC],
-[
- AC_LIBSOURCES([xmalloc.c, xalloc.h])
- AC_LIBOBJ([xmalloc])
-
- gl_PREREQ_XALLOC
- gl_PREREQ_XMALLOC
-])
-
-# Prerequisites of lib/xalloc.h.
-AC_DEFUN([gl_PREREQ_XALLOC], [
- :
-])
-
-# Prerequisites of lib/xmalloc.c.
-AC_DEFUN([gl_PREREQ_XMALLOC], [
- AC_REQUIRE([AC_C_INLINE])
- :
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/xsize.m4 b/xbmc/screensavers/rsxs-0.9/m4/xsize.m4
deleted file mode 100644
index 85bb721e43..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/xsize.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-# xsize.m4 serial 3
-dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_XSIZE],
-[
- dnl Prerequisites of lib/xsize.h.
- AC_REQUIRE([gl_SIZE_MAX])
- AC_REQUIRE([AC_C_INLINE])
- AC_CHECK_HEADERS(stdint.h)
-])
diff --git a/xbmc/screensavers/rsxs-0.9/m4/xstrndup.m4 b/xbmc/screensavers/rsxs-0.9/m4/xstrndup.m4
deleted file mode 100644
index 8a30ab158d..0000000000
--- a/xbmc/screensavers/rsxs-0.9/m4/xstrndup.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-# xstrndup.m4 serial 2
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_XSTRNDUP],
-[
- gl_PREREQ_XSTRNDUP
-])
-
-# Prerequisites of lib/xstrndup.c.
-AC_DEFUN([gl_PREREQ_XSTRNDUP], [
- :
-])
diff --git a/xbmc/screensavers/rsxs-0.9/rsxs.spec.in b/xbmc/screensavers/rsxs-0.9/rsxs.spec.in
deleted file mode 100644
index 0cd8f12764..0000000000
--- a/xbmc/screensavers/rsxs-0.9/rsxs.spec.in
+++ /dev/null
@@ -1,162 +0,0 @@
-# Default options: --with sound --with dlopen --with xscreensaver
-#
-# --without sound: disables all sound support.
-# --without dlopen: links with OpenAL and libvorbisfile at compile-time,
-# rather than deferring it to run-time.
-# --without xscreensaver:
-# produce stand-alone programs only.
-
-%{?_with_sound: %{?_without_sound:%{error:both '--with sound' and '--without sound' specified}}}
-%{?_with_dlopen:%{?_without_sound:%{error:both '--with dlopen' and '--without dlopen' specified}}}
-%{?_with_xscreensaver: %{?_without_xscreensaver:%{error:both '--with xscreensaver' and '--without xscreensaver' specified}}}
-
-%{?_without_sound: %define _configure_sound --disable-sound}
-%{!?_without_sound:%define _configure_sound --enable-sound%{!?_without_dlopen:=dlopen}}
-
-# Expand hackdir -- configure leaves this unexpanded so that
-# one could do "make install exec_prefix=..."
-%define _hackdir %(exec_prefix="%{_exec_prefix}"; echo "@hackdir@")
-
-# Sanity check: don't allow --with xscreensaver if xscreensaver wasn't
-# around when rsxs.spec was generated by configure, because we really don't
-# know where files are supposed to go...
-%if "@xscreensaver@" == "yes" && 0%{!?_without_xscreensaver:1}
-
- %define _defaultdir @defaultdir@
- %define _configdir @configdir@
- %define __xscreensaver_command /usr/bin/xscreensaver-command
-
- %define _configure_xscreensaver --with-xscreensaver --with-defaultdir=%{_defaultdir} --with-hackdir=%{_hackdir} --with-configdir=%{_configdir}
- %define _use_xscreensaver 1
-
-%else
-
- %define _configure_xscreensaver --without-xscreensaver
-
-%endif
-
-%define _configure_opts %{_configure_sound} %{_configure_xscreensaver} --enable-image
-
-# %{dist} and %{fedora} are reliable, and they're used in mock.
-# But if we don't have %{fedora}, try to determine it programmatically...
-%if "0%{?fedora}" == "0"
-%define fedora %(awk '{print $4}' /etc/fedora-release 2>/dev/null || echo 0)
-%endif
-
-Name: @PACKAGE_TARNAME@
-Version: @PACKAGE_VERSION@
-Release: @RELEASE@%{?dist}
-License: GPL
-Source0: @PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.gz
-URL: http://rsxs.sourceforge.net/
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
-%if "%{fedora}" >= "5"
-BuildRequires: libSM-devel, libICE-devel, libXmu-devel, libXt-devel
-%else
-BuildRequires: XFree86-devel
-%endif
-BuildRequires: libGL-devel, libGLU-devel, libpng-devel
-%{!?_without_sound:BuildRequires: openal-devel, libvorbis-devel}
-Summary: @PACKAGE_NAME@
-Group: Amusements/Graphics
-Requires: mktemp%{?_use_xscreensaver:, xscreensaver}
-Obsoletes: @PACKAGE_TARNAME@-nosound
-Provides: @PACKAGE_TARNAME@-nosound
-
-%description
-The @PACKAGE_NAME@ package is an X11/GLX port of the
-Really Slick Screensavers collection, by Terry Welsh
-(http://www.reallyslick.com).
-
-%prep
-%setup -q -n @PACKAGE_TARNAME@-@PACKAGE_VERSION@
-
-%build
-%{configure} %{_configure_opts}
-%{__make}
-
-%install
-if test "$RPM_BUILD_ROOT" != "/"; then
- %{__rm} -rf $RPM_BUILD_ROOT
-fi
-%{makeinstall} \
- %{?_defaultdir:defaultdir=$RPM_BUILD_ROOT%{_defaultdir}} \
- hackdir=$RPM_BUILD_ROOT%{_hackdir} \
- %{?_configdir:configdir=$RPM_BUILD_ROOT%{_configdir}}
-
-%clean
-if test "$RPM_BUILD_ROOT" != "/"; then
- %{__rm} -rf $RPM_BUILD_ROOT
-fi
-
-%if 0%{?_use_xscreensaver}
-
-%post
-echo "Installing screensavers into %{_defaultdir}/XScreenSaver"
-TMPFILE1=`mktemp %{_tmppath}/$$.XXXXXX` || exit 1;
-TMPFILE2=`mktemp %{_tmppath}/$$.XXXXXX` || exit 1;
-trap "%{__rm} -f $TMPFILE1 $TMPFILE2" 0
-%{__cat} <<"EOF" > $TMPFILE1
-@INSTALL_AWK@
-EOF
-%{__awk} -f $TMPFILE1 < %{_defaultdir}/XScreenSaver > $TMPFILE2
-%{__chmod} a+r $TMPFILE2
-%{__mv} -f $TMPFILE2 %{_defaultdir}/XScreenSaver
-# Can't just use return code from xscreensaver-command due to
-# "xscreensaver window unexpectedly deleted" quirk
-if %{__xscreensaver_command} -version &> /dev/null; then
- echo "Restarting XScreenSaver"
- %{__xscreensaver_command} --restart &> /dev/null || :
-fi
-
-%preun
-if test $1 -eq 0; then
- echo "Removing screensavers from %{_defaultdir}/XScreenSaver"
- TMPFILE1=`mktemp %{_tmppath}/$$.XXXXXX` || exit 1;
- TMPFILE2=`mktemp %{_tmppath}/$$.XXXXXX` || exit 1;
- trap "%{__rm} -f $TMPFILE1 $TMPFILE2" 0
- %{__cat} <<"EOF" > $TMPFILE1
-@UNINSTALL_AWK@
-EOF
- %{__awk} -f $TMPFILE1 < %{_defaultdir}/XScreenSaver > $TMPFILE2
- %{__chmod} a+r $TMPFILE2
- %{__mv} -f $TMPFILE2 %{_defaultdir}/XScreenSaver
- # Can't just use return code from xscreensaver-command due to
- # "xscreensaver window unexpectedly deleted" quirk
- if %{__xscreensaver_command} -version &> /dev/null; then
- echo "Restarting XScreenSaver"
- %{__xscreensaver_command} --restart &> /dev/null || :
- fi
-fi
-
-%verifyscript
-echo "Checking screensavers are in %{_defaultdir}/XScreenSaver"
-TMPFILE1=`mktemp %{_tmppath}/$$.XXXXXX` || exit 1;
-TMPFILE2=`mktemp %{_tmppath}/$$.XXXXXX` || exit 1;
-trap "%{__rm} -f $TMPFILE1 $TMPFILE2" 0
-%{__cat} <<"EOF" > $TMPFILE1
-@VERIFY_AWK@
-EOF
-%{__awk} -f $TMPFILE1 < %{_defaultdir}/XScreenSaver > $TMPFILE2
-if test $? -eq 0; then
- echo "All screensavers correctly installed"
-else
- echo "Some screensavers not correctly installed"
- echo "%{_defaultdir}/XScreenSaver does not have the following screensavers:"
- %{__cat} $TMPFILE2
-fi
-
-%endif
-
-%files
-%defattr(-,root,root)
-%doc AUTHORS COPYING ChangeLog INSTALL README THANKS
-%if 0%{?_use_xscreensaver}
-%{_hackdir}/rs-*
-%{_configdir}/rs-*
-%endif
-%{_bindir}/rs-*
-%{_datadir}/@PACKAGE_TARNAME@
-
-%changelog
-@CHANGELOG@
diff --git a/xbmc/screensavers/rsxs-0.9/scripts/install.awk b/xbmc/screensavers/rsxs-0.9/scripts/install.awk
deleted file mode 100644
index 8946a743fb..0000000000
--- a/xbmc/screensavers/rsxs-0.9/scripts/install.awk
+++ /dev/null
@@ -1,87 +0,0 @@
-BEGIN {
- if (skip !~ /cyclone/)
- add["rs-cyclone"] = " GL: \"Really Slick Cyclones\" rs-cyclone -root \\n\\"
-
- if (skip !~ /euphoria/) {
- add["\\(regular\\)\" rs-euphoria"] = " GL: \"Really Slick Euphoria (regular)\" rs-euphoria -stringy -root \\n\\"
- add["\\(grid\\)\" rs-euphoria"] = " GL: \"Really Slick Euphoria (grid)\" rs-euphoria -wisps 4 -background 1 -density 25 -visibility 70 -speed 15 -wireframe -root \\n\\"
- add["\\(cubism\\)\" rs-euphoria"] = " GL: \"Really Slick Euphoria (cubism)\" rs-euphoria -wisps 15 -background 0 -density 4 -visibility 15 -speed 10 -root \\n\\"
- add["\\(bad math\\)\" rs-euphoria"] = " GL: \"Really Slick Euphoria (bad math)\" rs-euphoria -wisps 2 -background 2 -density 20 -visibility 35 -speed 30 -feedback 40 -feedbacksize 5 -feedbacksize 8 -wireframe -lines -root \\n\\"
- add["\\(M-theory\\)\" rs-euphoria"] = " GL: \"Really Slick Euphoria (M-theory)\" rs-euphoria -wisps 3 -background 0 -density 25 -visibility 35 -speed 20 -feedback 40 -feedbackspeed 20 -feedbacksize 8 -root \\n\\"
- add["\\(UHF TEM\\)\" rs-euphoria"] = " GL: \"Really Slick Euphoria (UHF TEM)\" rs-euphoria -wisps 0 -background 3 -density 35 -visibility 5 -speed 50 -root \\n\\"
- add["\\(nowhere\\)\" rs-euphoria"] = " GL: \"Really Slick Euphoria (nowhere)\" rs-euphoria -wisps 0 -background 3 -density 30 -visibility 40 -speed 20 -feedback 80 -feedbackspeed 10 -feedbacksize 8 -wireframe -random -root \\n\\"
- add["\\(echo\\)\" rs-euphoria"] = " GL: \"Really Slick Euphoria (echo)\" rs-euphoria -wisps 3 -background 0 -density 25 -visibility 30 -speed 20 -feedback 85 -feedbackspeed 30 -feedbacksize 8 -plasma -root \\n\\"
- add["\\(kaleidoscope\\)\" rs-euphoria"] = " GL: \"Really Slick Euphoria (kaleidoscope)\" rs-euphoria -wisps 3 -background 0 -density 25 -visibility 40 -speed 15 -feedback 90 -feedbackspeed 3 -feedbacksize 8 -root \\n\\"
- }
-
- if (skip !~ /fieldlines/)
- add["rs-fieldlines"] = " GL: \"Really Slick Fieldlines\" rs-fieldlines -root \\n\\"
-
- if (skip !~ /flocks/)
- add["rs-flocks"] = " GL: \"Really Slick Flocks\" rs-flocks -root \\n\\"
-
- if (skip !~ /flux/) {
- add["\\(regular\\)\" rs-flux"] = " GL: \"Really Slick Flux (regular)\" rs-flux -root \\n\\"
- add["\\(hypnotic\\)\" rs-flux"] = " GL: \"Really Slick Flux (hypnotic)\" rs-flux -fluxes 2 -particles 10 -length 40 -lights -size 15 -randomness 80 -speed 20 -rotation 0 -wind 40 -instability 10 -blur 30 -root \\n\\"
- add["\\(insane\\)\" rs-flux"] = " GL: \"Really Slick Flux (insane)\" rs-flux -fluxes 4 -particles 30 -length 8 -lights -size 25 -randomness 0 -speed 80 -rotation 60 -wind 40 -instability 100 -blur 10 -root \\n\\"
- add["\\(sparklers\\)\" rs-flux"] = " GL: \"Really Slick Flux (sparklers)\" rs-flux -fluxes 3 -particles 20 -length 6 -spheres -size 20 -randomness 85 -speed 60 -rotation 30 -wind 20 -instability 30 -blur 0 -root \\n\\"
- add["\\(paradigm\\)\" rs-flux"] = " GL: \"Really Slick Flux (paradigm)\" rs-flux -fluxes 1 -particles 40 -length 40 -lights -size 5 -randomness 90 -speed 30 -rotation 20 -wind 10 -instability 5 -blur 10 -root \\n\\"
- add["\\(fusion\\)\" rs-flux"] = " GL: \"Really Slick Flux (fusion)\" rs-flux -fluxes 10 -particles 3 -length 10 -lights -size 100 -randomness 0 -speed 50 -rotation 30 -wind 40 -instability 35 -blur 50 -root \\n\\"
- }
-
- if (skip !~ /helios/)
- add["rs-helios"] = " GL: \"Really Slick Helios\" rs-helios -root \\n\\"
-
- if (skip !~ /hyperspace/)
- add["rs-hyperspace"] = " GL: \"Really Slick Hyperspace\" rs-hyperspace -root \\n\\"
-
- if (skip !~ /lattice/) {
- add["\\(regular\\)\" rs-lattice"] = " GL: \"Really Slick Lattice (regular)\" rs-lattice -root \\n\\"
- add["\\(chainmail\\)\" rs-lattice"] = " GL: \"Really Slick Lattice (chainmail)\" rs-lattice -longitude 24 -latitude 12 -thickness 50 -density 80 -depth 3 -chrome -smooth -root \\n\\"
- add["\\(brass mesh\\)\" rs-lattice"] = " GL: \"Really Slick Lattice (brass mesh)\" rs-lattice -longitude 4 -latitude 4 -thickness 40 -density 50 -depth 4 -brass -no-smooth -root \\n\\"
- add["\\(computer\\)\" rs-lattice"] = " GL: \"Really Slick Lattice (computer)\" rs-lattice -longitude 4 -latitude 6 -thickness 70 -density 90 -depth 4 -circuits -no-smooth -root \\n\\"
- add["\\(slick\\)\" rs-lattice"] = " GL: \"Really Slick Lattice (slick)\" rs-lattice -longitude 24 -latitude 12 -thickness 100 -density 30 -depth 4 -shiny -smooth -root \\n\\"
- add["\\(tasty\\)\" rs-lattice"] = " GL: \"Really Slick Lattice (tasty)\" rs-lattice -longitude 24 -latitude 12 -thickness 100 -density 25 -depth 4 -donuts -smooth -root \\n\\"
- }
-
- if (skip !~ /plasma/)
- add["rs-plasma"] = " GL: \"Really Slick Plasma\" rs-plasma -root \\n\\"
-
- if (skip !~ /skyrocket/)
- add["rs-skyrocket"] = " GL: \"Really Slick Skyrocket\" rs-skyrocket -volume 0 -root \\n\\"
-
- if (skip !~ /solarwinds/) {
- add["\\(regular\\)\" rs-solarwinds"] = " GL: \"Really Slick Solar Winds (regular)\" rs-solarwinds -root \\n\\"
- add["\\(cosmic strings\\)\" rs-solarwinds"] = " GL: \"Really Slick Solar Winds (cosmic strings)\" rs-solarwinds -winds 1 -emitters 50 -particles 3000 -lines -size 20 -windspeed 10 -emitterspeed 10 -speed 10 -blur 10 -root \\n\\"
- add["\\(cold pricklies\\)\" rs-solarwinds"] = " GL: \"Really Slick Solar Winds (cold pricklies)\" rs-solarwinds -winds 1 -emitters 300 -particles 3000 -lines -size 5 -windspeed 20 -emitterspeed 100 -speed 15 -blur 70 -root \\n\\"
- add["\\(space fur\\)\" rs-solarwinds"] = " GL: \"Really Slick Solar Winds (space fur)\" rs-solarwinds -winds 2 -emitters 400 -particles 1600 -lines -size 15 -windspeed 20 -emitterspeed 15 -speed 10 -blur 0 -root \\n\\"
- add["\\(jiggly\\)\" rs-solarwinds"] = " GL: \"Really Slick Solar Winds (jiggly)\" rs-solarwinds -winds 1 -emitters 40 -particles 1200 -points -size 20 -windspeed 100 -emitterspeed 20 -speed 4 -blur 50 -root \\n\\"
- add["\\(undertow\\)\" rs-solarwinds"] = " GL: \"Really Slick Solar Winds (undertow)\" rs-solarwinds -winds 1 -emitters 400 -particles 1200 -lights -size 40 -windspeed 20 -emitterspeed 1 -speed 100 -blur 50 -root \\n\\"
- }
-}
-
-/^[ \t]*\*programs:/ {
- print
- output = ""
- do {
- getline
- output = output $0 ORS
- x = 0
- for (name in add)
- if ($0 ~ name)
- remove[++x] = name
- for (; x > 0; --x)
- delete add[remove[x]]
- } while ($0 ~ /\\$/)
- for (name in add) {
- print add[name]
- }
- ORS=""
- print output
- next
-}
-
-! /^[ \t]*\*programs:/ {
- ORS="\n"
- print
-}
diff --git a/xbmc/screensavers/rsxs-0.9/scripts/uninstall.awk b/xbmc/screensavers/rsxs-0.9/scripts/uninstall.awk
deleted file mode 100644
index 8de96d74c3..0000000000
--- a/xbmc/screensavers/rsxs-0.9/scripts/uninstall.awk
+++ /dev/null
@@ -1,85 +0,0 @@
-BEGIN {
- if (skip !~ /cyclone/)
- remove["rs-cyclone"] = 1
-
- if (skip !~ /euphoria/) {
- remove["\\(regular\\)\" rs-euphoria"] = 1
- remove["\\(grid\\)\" rs-euphoria"] = 1
- remove["\\(cubism\\)\" rs-euphoria"] = 1
- remove["\\(bad math\\)\" rs-euphoria"] = 1
- remove["\\(M-theory\\)\" rs-euphoria"] = 1
- remove["\\(UHF TEM\\)\" rs-euphoria"] = 1
- remove["\\(nowhere\\)\" rs-euphoria"] = 1
- remove["\\(echo\\)\" rs-euphoria"] = 1
- remove["\\(kaleidoscope\\)\" rs-euphoria"] = 1
- }
-
- if (skip !~ /fieldlines/)
- remove["rs-fieldlines"] = 1
-
- if (skip !~ /flocks/)
- remove["rs-flocks"] = 1
-
- if (skip !~ /flux/) {
- remove["\\(regular\\)\" rs-flux"] = 1
- remove["\\(hypnotic\\)\" rs-flux"] = 1
- remove["\\(insane\\)\" rs-flux"] = 1
- remove["\\(sparklers\\)\" rs-flux"] = 1
- remove["\\(paradigm\\)\" rs-flux"] = 1
- remove["\\(fusion\\)\" rs-flux"] = 1
- }
-
- if (skip !~ /helios/)
- remove["rs-helios"] = 1
-
- if (skip !~ /hyperspace/)
- remove["rs-hyperspace"] = 1
-
- if (skip !~ /lattice/) {
- remove["\\(regular\\)\" rs-lattice"] = 1
- remove["\\(chainmail\\)\" rs-lattice"] = 1
- remove["\\(brass mesh\\)\" rs-lattice"] = 1
- remove["\\(computer\\)\" rs-lattice"] = 1
- remove["\\(slick\\)\" rs-lattice"] = 1
- remove["\\(tasty\\)\" rs-lattice"] = 1
- }
-
- if (skip !~ /plasma/)
- remove["rs-plasma"] = 1
-
- if (skip !~ /skyrocket/)
- remove["rs-skyrocket"] = 1
-
- if (skip !~ /solarwinds/) {
- remove["\\(regular\\)\" rs-solarwinds"] = 1
- remove["\\(cosmic strings\\)\" rs-solarwinds"] = 1
- remove["\\(cold pricklies\\)\" rs-solarwinds"] = 1
- remove["\\(space fur\\)\" rs-solarwinds"] = 1
- remove["\\(jiggly\\)\" rs-solarwinds"] = 1
- remove["\\(undertow\\)\" rs-solarwinds"] = 1
- }
-}
-
-/^[ \t]*\*programs:/ {
- print
- output = ""
- do {
- getline
- doRemove = ""
- for (name in remove)
- if ($0 ~ name)
- doRemove = name
- if (doRemove)
- delete remove[doRemove]
- else
- output = output $0 ORS
- } while ($0 ~ /\\$/)
- ORS=""
- print output
- next
-}
-
-! /^[ \t]*\*programs:/ {
- ORS="\n"
- print
-}
diff --git a/xbmc/screensavers/rsxs-0.9/scripts/verify.awk b/xbmc/screensavers/rsxs-0.9/scripts/verify.awk
deleted file mode 100644
index bf9cc5adff..0000000000
--- a/xbmc/screensavers/rsxs-0.9/scripts/verify.awk
+++ /dev/null
@@ -1,86 +0,0 @@
-BEGIN {
- if (skip !~ /cyclone/)
- verify["rs-cyclone"] = 1
-
- if (skip !~ /euphoria/) {
- verify["\\(regular\\)\" rs-euphoria"] = 1
- verify["\\(grid\\)\" rs-euphoria"] = 1
- verify["\\(cubism\\)\" rs-euphoria"] = 1
- verify["\\(bad math\\)\" rs-euphoria"] = 1
- verify["\\(M-theory\\)\" rs-euphoria"] = 1
- verify["\\(UHF TEM\\)\" rs-euphoria"] = 1
- verify["\\(nowhere\\)\" rs-euphoria"] = 1
- verify["\\(echo\\)\" rs-euphoria"] = 1
- verify["\\(kaleidoscope\\)\" rs-euphoria"] = 1
- }
-
- if (skip !~ /fieldlines/)
- verify["rs-fieldlines"] = 1
-
- if (skip !~ /flocks/)
- verify["rs-flocks"] = 1
-
- if (skip !~ /flux/) {
- verify["\\(regular\\)\" rs-flux"] = 1
- verify["\\(hypnotic\\)\" rs-flux"] = 1
- verify["\\(insane\\)\" rs-flux"] = 1
- verify["\\(sparklers\\)\" rs-flux"] = 1
- verify["\\(paradigm\\)\" rs-flux"] = 1
- verify["\\(fusion\\)\" rs-flux"] = 1
- }
-
- if (skip !~ /helios/)
- verify["rs-helios"] = 1
-
- if (skip !~ /hyperspace/)
- verify["rs-helios"] = 1
-
- if (skip !~ /lattice/) {
- verify["\\(regular\\)\" rs-lattice"] = 1
- verify["\\(chainmail\\)\" rs-lattice"] = 1
- verify["\\(brass mesh\\)\" rs-lattice"] = 1
- verify["\\(computer\\)\" rs-lattice"] = 1
- verify["\\(slick\\)\" rs-lattice"] = 1
- verify["\\(tasty\\)\" rs-lattice"] = 1
- }
-
- if (skip !~ /plasma/)
- verify["rs-plasma"] = 1
-
- if (skip !~ /skyrocket/)
- verify["rs-skyrocket"] = 1
-
- if (skip !~ /solarwinds/) {
- verify["\\(regular\\)\" rs-solarwinds"] = 1
- verify["\\(cosmic strings\\)\" rs-solarwinds"] = 1
- verify["\\(cold pricklies\\)\" rs-solarwinds"] = 1
- verify["\\(space fur\\)\" rs-solarwinds"] = 1
- verify["\\(jiggly\\)\" rs-solarwinds"] = 1
- verify["\\(undertow\\)\" rs-solarwinds"] = 1
- }
-}
-
-/^[ \t]*\*programs:/ {
- output = ""
- do {
- getline
- doRemove = ""
- for (name in verify)
- if ($0 ~ name)
- doVerify = name
- if (doVerify)
- delete verify[doVerify]
- output = output $0 ORS
- } while ($0 ~ /\\$/)
- next
-}
-
-END {
- ORS="\n"
- count = 0
- for (name in verify) {
- ++count
- print name
- }
- exit count
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/Makefile.am b/xbmc/screensavers/rsxs-0.9/src/Makefile.am
deleted file mode 100644
index e0e68b602d..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/Makefile.am
+++ /dev/null
@@ -1,35 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-SUBDIRS = $(ENABLED_HACKS)
-DIST_SUBDIRS = \
- cyclone euphoria fieldlines flocks flux helios hyperspace lattice \
- plasma skyrocket solarwinds
-
-AM_ETAGSFLAGS = --extra=fq
-
-if HACKMODE
-if SYMLINKS
-install-exec-hook:
- ${mkinstalldirs} $(bindir)
- for i in $(ENABLED_BINARIES); do \
- $(LN_S) -f $(hackreldir)/$$i $(DESTDIR)$(bindir)/$$i; \
- done
-endif SYMLINKS
-
-uninstall-hook:
- for i in $(ENABLED_BINARIES); do rm -f $(bindir)/$$i; done
- -rmdir $(pkgdatadir)
-
-else !HACKMODE
-install-exec-hook:
-uninstall-hook:
-endif !HACKMODE
-
-# Workaround for Exuberant ctags failure when no filenames are specified.
-ETAGS = echo | etags
-ETAGS_ARGS = -L -
-
-# See Makefile.common for why this is here.
-distclean: distclean-recursive
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
diff --git a/xbmc/screensavers/rsxs-0.9/src/Makefile.common b/xbmc/screensavers/rsxs-0.9/src/Makefile.common
deleted file mode 100644
index b8ff562e95..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/Makefile.common
+++ /dev/null
@@ -1,31 +0,0 @@
-## This file contains common variables for making each of the hacks
-
-COLOR = ../color.cc ../color.hh
-COMMON = ../common.cc ../common.hh ../hack.hh ../pngimage.hh ../resource.hh \
- ../vroot.hh ../../config.h
-VECTOR = ../vector.hh
-IMPLICIT = ../implicit.cc ../implicit.hh
-
-IMAGE = ../pngimage.cc
-SOUND = ../sound.hh ../sound.cc ../oggsound.hh ../oggsound.cc
-DLOPEN = ../dlopen.hh
-
-LIBMISC = $(top_builddir)/lib/libmisc.a
-if DLOPEN
-LIBLTDL = $(top_builddir)/libltdl/libltdl.a
-LIBLTDL_CPPFLAGS = -I$(top_builddir)/libltdl
-endif DLOPEN
-
-AM_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" -I$(srcdir)/.. -I$(top_srcdir)/lib $(X_CPPFLAGS) -D_LINUX -DXBMC
-AM_LDFLAGS =
-AM_CXXFLAGS =
-
-AM_ETAGSFLAGS = --extra=fq
-
-# Normally automake will remove both ../$(DEPDIR) and ./$(DEPDIR) in each of
-# the src subdirectories. We only remove ./$(DEPDIR) in the src subdirectories
-# (and remove ./$(DEPDIR) in the src directory itself), so that
-# 'make distclean' doesn't fail.
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
diff --git a/xbmc/screensavers/rsxs-0.9/src/color.cc b/xbmc/screensavers/rsxs-0.9/src/color.cc
deleted file mode 100644
index 24641b667c..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/color.cc
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-
-/*
- * This library converts between colors defined with RGB values and HSL
- * values. It also finds in-between colors by moving linearly through
- * HSL space.
- * All functions take values for r, g, b, h, s, and l between 0.0 and 1.0
- * (RGB = red, green, blue; HSL = hue, saturation, luminosity)
- */
-
-/*
- * For the 'tween functions, a tween value of 0.0 will output the first
- * color while a tween value of 1.0 will output the second color.
- * A value of false for direction indicates a positive progression around
- * the color wheel (i.e. red -> yellow -> green -> cyan...). A value of
- * true does the opposite.
- */
-
-RGBColor::operator HSLColor() const {
- unsigned int huezone = 0;
- float rr, gg, bb, h, s, l;
-
- // find huezone
- if (_v[0] >= _v[1]) {
- huezone = 0;
- if (_v[2] > _v[0])
- huezone = 4;
- else {
- if (_v[2] > _v[1])
- huezone = 5;
- }
- } else {
- huezone = 1;
- if (_v[2] > _v[1])
- huezone = 2;
- else {
- if (_v[2] > _v[0])
- huezone = 3;
- }
- }
-
- // luminosity
- switch (huezone) {
- case 0:
- case 5:
- l = _v[0];
- rr = 1.0f;
- gg = _v[1] / l;
- bb = _v[2] / l;
- break;
- case 1:
- case 2:
- l = _v[1];
- gg = 1.0f;
- rr = _v[0] / l;
- bb = _v[2] / l;
- break;
- default:
- l = _v[2];
- bb = 1.0f;
- rr = _v[0] / l;
- gg = _v[1] / l;
- }
-
- if (l == 0.0)
- return HSLColor(0, 1, 0);
-
- // saturation
- switch (huezone) {
- case 0:
- case 1:
- s = 1.0f - _v[2];
- bb = 0.0f;
- rr = 1.0f - ((1.0f - rr) / s);
- gg = 1.0f - ((1.0f - gg) / s);
- break;
- case 2:
- case 3:
- s = 1.0f - _v[0];
- rr = 0.0f;
- gg = 1.0f - ((1.0f - gg) / s);
- bb = 1.0f - ((1.0f - bb) / s);
- break;
- default:
- s = 1.0f - _v[1];
- gg = 0.0f;
- rr = 1.0f - ((1.0f - rr) / s);
- bb = 1.0f - ((1.0f - bb) / s);
- }
-
- // hue
- switch (huezone) {
- case 0:
- h = _v[1] / 6.0f;
- break;
- case 1:
- h = ((1.0f - _v[0]) / 6.0f) + 0.166667f;
- break;
- case 2:
- h = (_v[2] / 6.0f) + 0.333333f;
- break;
- case 3:
- h = ((1.0f - _v[1]) / 6.0f) + 0.5f;
- break;
- case 4:
- h = (_v[0] / 6.0f) + 0.666667f;
- break;
- default:
- h = ((1.0f - _v[2]) / 6.0f) + 0.833333f;
- }
-
- return HSLColor(h, s, l);
-}
-
-RGBColor RGBColor::tween(const RGBColor& a, const RGBColor& b,
- float tween, bool direction) {
- return HSLColor::tween(HSLColor(a), HSLColor(b), tween, direction);
-}
-
-HSLColor::operator RGBColor() const {
- float r, g, b;
-
- // hue influence
- if (_v[0] < 0.166667) { // full red, some green
- r = 1.0;
- g = _v[0] * 6.0f;
- b = 0.0;
- } else {
- if (_v[0] < 0.5) { // full green
- g = 1.0;
- if (_v[0] < 0.333333) { // some red
- r = 1.0f - ((_v[0] - 0.166667f) * 6.0f);
- b = 0.0;
- } else { // some blue
- b = (_v[0] - 0.333333f) * 6.0f;
- r = 0.0;
- }
- } else {
- if (_v[0] < 0.833333) { // full blue
- b = 1.0;
- if (_v[0] < 0.666667) { // some green
- g = 1.0f - ((_v[0] - 0.5f) * 6.0f);
- r = 0.0;
- } else { // some red
- r = (_v[0] - 0.666667f) * 6.0f;
- g = 0.0;
- }
- } else { // full red, some blue
- r = 1.0;
- b = 1.0f - ((_v[0] - 0.833333f) * 6.0f);
- g = 0.0;
- }
- }
- }
-
- // saturation influence
- r = 1.0f - (_v[1] * (1.0f - r));
- g = 1.0f - (_v[1] * (1.0f - g));
- b = 1.0f - (_v[1] * (1.0f - b));
-
- // luminosity influence
- return RGBColor(r * _v[2], g * _v[2], b * _v[2]);
-}
-
-HSLColor HSLColor::tween(const HSLColor& a, const HSLColor& b,
- float tween, bool direction) {
- float h, s, l;
-
- // hue
- if (!direction) { // forward around color wheel
- if (b.h() >= a.h())
- h = a.h() + (tween * (b.h() - a.h()));
- else {
- h = a.h() + (tween * (1.0f - (a.h() - b.h())));
- if (h > 1.0)
- h -= 1.0;
- }
- } else { // backward around color wheel
- if (a.h() >= b.h())
- h = a.h() - (tween * (a.h() - b.h()));
- else {
- h = a.h() - (tween * (1.0f - (b.h() - a.h())));
- if (h < 0.0)
- h += 1.0;
- }
- }
-
- // saturation
- s = a.s() + (tween * (b.s() - a.s()));
-
- // luminosity
- l = a.l() + (tween * (b.l() - a.l()));
-
- return HSLColor(h, s, l);
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/color.hh b/xbmc/screensavers/rsxs-0.9/src/color.hh
deleted file mode 100644
index a3b921e24b..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/color.hh
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _COLOR_HH
-#define _COLOR_HH
-
-#include <common.hh>
-
-#include <vector.hh>
-
-class HSLColor;
-
-class RGBColor : protected Vector {
-public:
- RGBColor(const float*& v) : Vector(v) {}
- RGBColor(
- float r = 0.0f, float g = 0.0f, float b = 0.0f
- ) : Vector(r, g, b) {}
-
- operator HSLColor() const;
-
- using Vector::set;
- using Vector::get;
-
- RGBColor operator+(const RGBColor& v) const {
- return RGBColor(
- _v[0] + v._v[0], _v[1] + v._v[1], _v[2] + v._v[2]
- );
- }
-
- RGBColor operator-(const RGBColor& v) const {
- return RGBColor(
- _v[0] - v._v[0], _v[1] - v._v[1], _v[2] - v._v[2]
- );
- }
-
- RGBColor operator*(float f) const {
- return RGBColor(_v[0] * f, _v[1] * f, _v[2] * f);
- }
-
- RGBColor operator/(float f) const {
- return RGBColor(_v[0] / f, _v[1] / f, _v[2] / f);
- }
-
- RGBColor& operator+=(const RGBColor& v) {
- _v[0] += v._v[0];
- _v[1] += v._v[1];
- _v[2] += v._v[2];
- return *this;
- }
-
- RGBColor& operator*=(float f) {
- _v[0] *= f;
- _v[1] *= f;
- _v[2] *= f;
- return *this;
- }
-
- RGBColor& operator/=(float f) {
- _v[0] /= f;
- _v[1] /= f;
- _v[2] /= f;
- return *this;
- }
-
- const float& r() const { return x(); }
- float& r() { return x(); }
- const float& g() const { return y(); }
- float& g() { return y(); }
- const float& b() const { return z(); }
- float& b() { return z(); }
-
- void clamp() {
- if (_v[0] > 1)
- _v[0] = 1;
- if (_v[0] < 0)
- _v[0] = 0;
- if (_v[1] > 1)
- _v[1] = 1;
- if (_v[1] < 0)
- _v[1] = 0;
- if (_v[2] > 1)
- _v[2] = 1;
- if (_v[2] < 0)
- _v[2] = 0;
- }
-
- static RGBColor tween(
- const RGBColor&, const RGBColor&, float tween, bool direction
- );
-};
-
-class HSLColor : protected Vector {
-public:
- HSLColor(const float*& v) : Vector(v) {}
- HSLColor(
- float h = 0.0f, float s = 0.0f, float l = 0.0f
- ) : Vector(h, s, l) {}
-
- operator RGBColor() const;
-
- using Vector::set;
- using Vector::get;
- using Vector::operator+;
- using Vector::operator-;
- using Vector::operator*;
- using Vector::operator/;
- using Vector::operator+=;
- using Vector::operator*=;
- using Vector::operator/=;
-
- const float& h() const { return x(); }
- float& h() { return x(); }
- const float& s() const { return y(); }
- float& s() { return y(); }
- const float& l() const { return z(); }
- float& l() { return z(); }
-
- void clamp() {
- while (_v[0] >= 1)
- _v[0] -= 1;
- while (_v[0] < 0)
- _v[0] += 1;
- if (_v[1] > 1)
- _v[1] = 1;
- if (_v[1] < 0)
- _v[1] = 0;
- if (_v[2] > 1)
- _v[2] = 1;
- if (_v[2] < 0)
- _v[2] = 0;
- }
-
- static HSLColor tween(
- const HSLColor&, const HSLColor&, float tween, bool direction
- );
-};
-
-#endif // _COLOR_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/common.cc b/xbmc/screensavers/rsxs-0.9/src/common.cc
deleted file mode 100644
index be38cb8af5..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/common.cc
+++ /dev/null
@@ -1,622 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#if HAVE_SYS_TYPES_H
- #include <sys/types.h>
-#endif
-#if HAVE_SYS_SELECT_H
- #include <sys/select.h>
-#endif
-#include <sys/time.h>
-
-#include <GL/gl.h>
-#include <GL/glx.h>
-#include <hack.hh>
-#include <resource.hh>
-#include <X11/X.h>
-#include <X11/Xatom.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Intrinsic.h>
-#include <X11/StringDefs.h>
-#include <X11/Shell.h>
-#if defined(__vms)
-#include <X11/StdCmap.h> /* for XmuLookupStandardColormap */
-#else
-#include <X11/Xmu/StdCmap.h> /* for XmuLookupStandardColormap */
-#endif
-#include <vroot.hh>
-#include <ctime>
-
-#define MAX_DELAY 10000
-#define MIN_DELAY 1000
-
-namespace Common {
- std::string program;
- Display* display;
- unsigned int screen;
- XVisualInfo *visualInfo;
- Window window;
- GLXContext context;
- std::string resourceDir;
-
- unsigned int width, height, depth;
- unsigned int centerX, centerY;
- float aspectRatio;
- Colormap colormap;
- bool doubleBuffered;
-
- bool running;
- unsigned int elapsedMicros;
- float elapsedSecs;
- float speed;
- float elapsedTime;
-
- ResourceManager* resources;
-
- error_t parse(int, char*, struct argp_state*);
- void init(int argc, char** argv);
- void run();
- void fini();
-};
-
-namespace Common {
- char* _displayName;
- Window _windowID;
- int _x, _y, _w, _h;
- bool _reverseX, _reverseY;
- bool _useOffset;
- bool _fullScreen;
- bool _onRoot;
-#ifndef NDEBUG
- bool _showFPS;
-#endif // !NDEBUG
-
- enum Arguments {
- ARG_ROOT = 1,
-#ifndef NDEBUG
- ARG_FPS,
-#endif // !NDEBUG
- ARG_GEOMETRY,
- ARG_FULLSCREEN,
- ARG_WINDOWID,
- ARG_RESOURCE_DIR,
- };
-
- struct HasCurrentVisualID;
-
- Colormap getColormap();
- Window createWindow(int, char**);
- void updateAttributes();
- void dumpErrors(const std::string&);
-};
-
-error_t Common::parse(int key, char* arg, struct argp_state* state) {
- switch (key) {
- case ARGP_KEY_INIT:
- visualInfo = NULL;
- window = None;
- context = None;
- running = false;
- resourceDir = std::string(PKGDATADIR "/") + Hack::getShortName();
- _displayName = NULL;
- _onRoot = false;
- _windowID = 0;
- _x = _y = 0;
- _reverseX = _reverseY = false;
- _w = 640;
- _h = 480;
- _useOffset = _fullScreen = false;
- return 0;
- case ARG_ROOT:
- _onRoot = true;
- return 0;
- case ARG_GEOMETRY:
- if (std::sscanf(arg, "%dx%d+%d+%d", &_w, &_h, &_x, &_y) == 4)
- _useOffset = true;
- else if (std::sscanf(arg, "%dx%d-%d+%d", &_w, &_h, &_x, &_y) == 4) {
- _useOffset = true; _reverseX = true;
- } else if (std::sscanf(arg, "%dx%d+%d-%d", &_w, &_h, &_x, &_y) == 4) {
- _useOffset = true; _reverseY = true;
- } else if (std::sscanf(arg, "%dx%d-%d-%d", &_w, &_h, &_x, &_y) == 4) {
- _useOffset = true; _reverseX = true; _reverseY = true;
- } else if (std::sscanf(arg, "%dx%d", &_w, &_h) == 2)
- ;
- else if (std::sscanf(arg, "%d%d", &_x, &_y) == 2)
- _useOffset = true;
- else {
- argp_error(state, "could not parse geometry `%s'", arg);
- return ARGP_ERR_UNKNOWN;
- }
- return 0;
- case ARG_FULLSCREEN:
- _fullScreen = true;
- return 0;
- case ARG_WINDOWID:
- if ((_windowID = std::strtol(arg, NULL, 0)) == 0) {
- argp_error(state, "invalid window ID `%s'", arg);
- return ARGP_ERR_UNKNOWN;
- }
- return 0;
- case ARG_RESOURCE_DIR:
- resourceDir = arg;
- return 0;
-#ifndef NDEBUG
- case ARG_FPS:
- _showFPS = true;
- return 0;
-#endif // !NDEBUG
- default:
- return ARGP_ERR_UNKNOWN;
- }
-}
-
-static struct timeval now;
-static struct timeval then;
-
-void Common::init(int argc, char** argv) {
-#ifdef NOXBMC
- display = XOpenDisplay(_displayName);
- if (!display) {
- if (_displayName != "")
- throw Exception(stdx::oss() << "Could not open display " << _displayName);
- else
- throw Exception("Could not open default display (DISPLAY variable not set?)");
- }
- screen = DefaultScreen(display);
- _displayName = XDisplayString(display);
-
- window = createWindow(argc, argv);
- if (!window) return;
-
- updateAttributes();
- XMapRaised(display, window);
-#endif
- running = true;
- speed = 1.0f;
-
- resources = new ResourceManager;
-
- gettimeofday(&now, NULL);
-}
-
-
-void Common::run() {
-#ifdef NOXBMC
- Hack::start();
-
-#ifndef NDEBUG
- dumpErrors("start");
-#endif // !NDEBUG
-
- while (running) {
- Hack::tick();
-#ifndef NDEBUG
- dumpErrors("tick");
-#endif // !NDEBUG
- while (XPending(display)) {
- XEvent event;
- XNextEvent(display, &event);
- switch (event.type) {
- case ConfigureNotify:
- updateAttributes();
- TRACE("Reshaping window");
- Hack::reshape();
- break;
- case MappingNotify:
- TRACE("Key mapping changed");
- XRefreshKeyboardMapping(&event.xmapping);
- break;
- case KeyPress:
- {
- char c;
- KeySym keysym;
- XLookupString(&event.xkey, &c, 1, &keysym, 0);
- TRACE("Key pressed: " << c);
- Hack::keyPress(c, keysym);
- }
- break;
- case KeyRelease:
- {
- char c;
- KeySym keysym;
- XLookupString(&event.xkey, &c, 1, &keysym, 0);
- TRACE("Key released: " << c);
- Hack::keyRelease(c, keysym);
- }
- break;
- case ButtonPress:
- {
- unsigned int button = event.xbutton.button;
- TRACE("Button pressed: " << button << " (" << event.xbutton.x <<
- ',' << event.xbutton.y << ')');
- Hack::buttonPress(button);
- }
- break;
- case ButtonRelease:
- {
- unsigned int button = event.xbutton.button;
- TRACE("Button released: " << button << " (" << event.xbutton.x <<
- ',' << event.xbutton.y << ')');
- Hack::buttonRelease(button);
- }
- break;
- case MotionNotify:
- {
- int x = event.xmotion.x;
- int y = event.xmotion.y;
- Hack::pointerMotion(x, y);
- }
- break;
- case EnterNotify:
- if (event.xcrossing.state & (
- Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask
- ))
- TRACE("Ignoring pointer entering window");
- else {
- TRACE("Pointer entered window");
- Hack::pointerEnter();
- }
- break;
- case LeaveNotify:
- if (event.xcrossing.state & (
- Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask
- ))
- TRACE("Ignoring pointer leaving window");
- else {
- TRACE("Pointer exited window");
- Hack::pointerLeave();
- }
- break;
- }
- }
-#endif
-
- then = now;
- gettimeofday(&now, NULL);
-
-#ifndef NDEBUG
- if (_showFPS) {
- elapsedMicros = 1000000 * (now.tv_sec - then.tv_sec) +
- now.tv_usec - then.tv_usec;
- elapsedSecs = float(elapsedMicros) / 1000000.0f;
-
- static float secsSinceUpdate = 0.0f;
- static unsigned int frames = 0;
- secsSinceUpdate += elapsedSecs;
- ++frames;
- if (secsSinceUpdate >= 5.0f) {
- float fps = float(frames) / secsSinceUpdate;
- std::cerr << frames << " frames in " << secsSinceUpdate <<
- " seconds = " << fps << " FPS" << std::endl;
- secsSinceUpdate = 0.0f;
- frames = 0;
- }
- } else {
-#endif // !NDEBUG
- elapsedMicros *= 4;
- elapsedMicros += 1000000 * (now.tv_sec - then.tv_sec) +
- now.tv_usec - then.tv_usec;
- elapsedMicros /= 5;
- elapsedSecs = float(elapsedMicros) / 1000000.0f;
-
- unsigned int remainingMicros =
- (elapsedMicros > MAX_DELAY - MIN_DELAY) ?
- MIN_DELAY : MAX_DELAY - elapsedMicros;
-
- struct timeval tv;
- tv.tv_sec = remainingMicros / 1000000L;
- tv.tv_usec = remainingMicros % 1000000L;
- select(0, 0, 0, 0, &tv);
-#ifndef NDEBUG
- }
-#endif // !NDEBUG
- elapsedTime = speed * elapsedSecs;
-#ifdef NOXBMC
- }
- Hack::stop();
-#ifndef NDEBUG
- dumpErrors("stop");
-#endif // !NDEBUG
-#endif
-}
-
-void Common::fini() {
- delete resources;
- if (context) glXDestroyContext(display, context);
- if (visualInfo) XFree(visualInfo);
- if (window) XDestroyWindow(display, window);
- if (display) XCloseDisplay(display);
-}
-
-/* See http://www.mesa3d.org/brianp/sig97/glxport.htm */
-Colormap Common::getColormap() {
- if (visualInfo->visual == DefaultVisual(display, screen))
- return DefaultColormap(display, screen);
-
- std::string serverString(glXQueryServerString(display, screen, GLX_VERSION));
- bool mesa = serverString.find("Mesa") != std::string::npos;
-
- if (mesa) {
- Atom atom = XInternAtom(display, "_HP_RGB_SMOOTH_MAP_LIST", True);
- if (
- atom &&
- visualInfo->visual->c_class == TrueColor &&
- depth == 8
- ) {
- XStandardColormap *colormaps;
- int numColormaps;
- Colormap result = None;
- if (
- XGetRGBColormaps(display, RootWindow(display, screen),
- &colormaps, &numColormaps, atom)
- ) {
- for (int i = 0; i < numColormaps; ++i)
- if (colormaps[i].visualid == Common::visualInfo->visualid)
- result = colormaps[i].colormap;
- XFree(colormaps);
- }
- if (result) return result;
- }
- }
-
-#ifndef SOLARIS_BUG
- if (XmuLookupStandardColormap(
- display, screen, visualInfo->visualid, depth,
- XA_RGB_DEFAULT_MAP, False, True
- )) {
- XStandardColormap* colormaps;
- int numColormaps;
- Colormap result = None;
- if (XGetRGBColormaps(
- display, RootWindow(display, screen),
- &colormaps, &numColormaps, XA_RGB_DEFAULT_MAP
- )) {
- for (int i = 0; i < numColormaps; ++i)
- if (colormaps[i].visualid == Common::visualInfo->visualid)
- result = colormaps[i].colormap;
- XFree(colormaps);
- }
- if (result) return result;
- }
-#endif
-
- return XCreateColormap(display, RootWindow(display, screen),
- visualInfo->visual, AllocNone);
-}
-
-Window Common::createWindow(int argc, char** argv) {
- Window window = 0;
-
- if (_onRoot || _windowID) {
- window = _windowID ? _windowID : RootWindow(display, screen);
- TRACE("Drawing on window: " << window);
-
- XWindowAttributes gwa;
- XGetWindowAttributes(display, window, &gwa);
- Visual* visual = gwa.visual;
- _w = gwa.width;
- _h = gwa.height;
-
- XVisualInfo templ;
- templ.screen = screen;
- templ.visualid = XVisualIDFromVisual(visual);
-
- int outCount;
- visualInfo = XGetVisualInfo(display, VisualScreenMask | VisualIDMask,
- &templ, &outCount);
-
- if (!visualInfo) {
- std::cerr << program << ": could not retrieve visual information for "
- "root window" << std::endl;
- return 0;
- }
- } else {
-# define R GLX_RED_SIZE
-# define G GLX_GREEN_SIZE
-# define B GLX_BLUE_SIZE
-# define D GLX_DEPTH_SIZE
-# define I GLX_BUFFER_SIZE
-# define DB GLX_DOUBLEBUFFER
-
- static int attributeLists[][20] = {
- { GLX_RGBA, R, 8, G, 8, B, 8, D, 8, DB, None }, // rgb double
- { GLX_RGBA, R, 4, G, 4, B, 4, D, 4, DB, None },
- { GLX_RGBA, R, 2, G, 2, B, 2, D, 2, DB, None },
- { GLX_RGBA, R, 8, G, 8, B, 8, D, 8, None }, // rgb single
- { GLX_RGBA, R, 4, G, 4, B, 4, D, 4, None },
- { GLX_RGBA, R, 2, G, 2, B, 2, D, 2, None },
- { I, 8, D, 8, DB, None }, // cmap double
- { I, 4, D, 4, DB, None },
- { I, 8, D, 8, None }, // cmap single
- { I, 4, D, 4, None },
- { GLX_RGBA, R, 1, G, 1, B, 1, D, 1, None } // monochrome
- };
- int fullWidth = WidthOfScreen(DefaultScreenOfDisplay(display));
- int fullHeight = HeightOfScreen(DefaultScreenOfDisplay(display));
-
- if (_fullScreen) {
- _w = fullWidth;
- _h = fullHeight;
- _x = _y = 0;
- _useOffset = true;
- } else if (_useOffset) {
- if (_reverseX)
- _x = fullWidth - _w - _x;
- if (_reverseY)
- _y = fullHeight - _h - _y;
- }
-
- for (
- unsigned int i = 0;
- i < sizeof(attributeLists) / sizeof(*attributeLists);
- ++i
- ) {
- visualInfo = glXChooseVisual(display, screen, attributeLists[i]);
- if (visualInfo) break;
- }
-
- if (!visualInfo) {
- std::cerr << program <<
- ": could not find a GL-capable visual on display " <<
- _displayName << std::endl;
- return 0;
- }
- depth = visualInfo->depth;
-
- XSetWindowAttributes swa;
- swa.colormap = getColormap();
- swa.border_pixel = swa.background_pixel = swa.backing_pixel =
- BlackPixel(display, screen);
- swa.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask |
- ButtonReleaseMask | PointerMotionMask | EnterWindowMask |
- LeaveWindowMask | StructureNotifyMask;
-
- window = XCreateWindow(display, RootWindow(display, screen),
- _x, _y, _w, _h, 0, visualInfo->depth, InputOutput, visualInfo->visual,
- CWBorderPixel | CWBackPixel | CWBackingPixel | CWColormap | CWEventMask,
- &swa);
- TRACE("Created window: 0x" << std::hex << window << std::dec);
-
- XSizeHints hints;
- hints.flags = USSize;
- hints.width = _w;
- hints.height = _h;
- if (_useOffset) {
- hints.flags |= USPosition;
- hints.x = _x;
- hints.y = _y;
- }
- XWMHints wmHints;
- wmHints.flags = InputHint;
- wmHints.input = True;
-
- XmbSetWMProperties(display, window, Hack::getName().c_str(),
- Hack::getName().c_str(), argv, argc, &hints, &wmHints, NULL);
- }
-
- int temp;
- if (glXGetConfig(display, visualInfo, GLX_DOUBLEBUFFER, &temp)) {
- std::cerr << program <<
- ": could not get GLX_DOUBLEBUFFER attribute from visual 0x" <<
- std::hex << visualInfo->visualid << std::dec << std::endl;
- return 0;
- }
- doubleBuffered = (temp != False);
-
- context = glXCreateContext(display, visualInfo, NULL, True);
- if (!context) {
- std::cerr << program << ": could not create rendering context" << std::endl;
- return 0;
- }
-
- if (!glXMakeCurrent(display, window, context)) {
- std::cerr << program << ": could not activate rendering context" <<
- std::endl;
- return 0;
- }
-
- return window;
-}
-
-void Common::updateAttributes() {
- XWindowAttributes attributes;
- XGetWindowAttributes(display, window, &attributes);
- width = attributes.width;
- height = attributes.height;
- depth = attributes.depth;
- centerX = width >> 1;
- centerY = height >> 1;
- aspectRatio = float(width) / float(height);
- colormap = attributes.colormap;
-}
-
-#ifndef NDEBUG
-void Common::dumpErrors(const std::string& func) {
- GLenum error;
- while ( (error = glGetError()) )
- WARN(func << ": " << gluErrorString(error));
-
- GLint i;
- glGetIntegerv(GL_ATTRIB_STACK_DEPTH, &i);
- if (i > 1) WARN(func << ": GL_ATTRIB_STACK_DEPTH == " << i);
- glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, &i);
- if (i > 1) WARN(func << ": GL_MODELVIEW_STACK_DEPTH == " << i);
- glGetIntegerv(GL_NAME_STACK_DEPTH, &i);
- if (i > 1) WARN(func << ": GL_NAME_STACK_DEPTH == " << i);
- glGetIntegerv(GL_PROJECTION_STACK_DEPTH, &i);
- if (i > 1) WARN(func << ": GL_PROJECTION_STACK_DEPTH == " << i);
- glGetIntegerv(GL_TEXTURE_STACK_DEPTH, &i);
- if (i > 1) WARN(func << ": GL_TEXTURE_STACK_DEPTH == " << i);
-}
-#endif // !NDEBUG
-
-const char * program_name;
-
-int main(int argc, char** argv) {
- int exit_code = EXIT_FAILURE;
-
- Common::program = argv[0];
- program_name = Hack::getShortName().c_str();
- argp_program_version = PACKAGE_STRING;
- argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
- struct argp_option options[] = {
- { NULL, 0, NULL, 0, "Help options:", -1 },
- { NULL, 0, NULL, 0, "Common options:" },
- { "root", Common::ARG_ROOT, NULL, 0, "Draw on the root window" },
- { "geometry", Common::ARG_GEOMETRY, "GEOM", 0,
- "Draw on a window of the specified geometry (WxH+X+Y)" },
- { "fullscreen", Common::ARG_FULLSCREEN, NULL, 0,
- "Draw on a maximized window" },
- { "window-id", Common::ARG_WINDOWID, "ID", OPTION_HIDDEN },
- { "resource-dir", Common::ARG_RESOURCE_DIR, "DIR", OPTION_HIDDEN },
-#ifndef NDEBUG
- { "fps", Common::ARG_FPS, NULL, OPTION_HIDDEN },
-#endif // !NDEBUG
- {}
- };
- struct argp_child child[] = {
- { Hack::getParser(), 0, "" },
- {}
- };
- struct argp parser =
- { options, Common::parse, NULL, NULL, child };
-
- std::srand((unsigned int)std::time(NULL));
-
- // Use ARGP_LONG_ONLY to follow XScreenSaver tradition
- if (argp_parse(&parser, argc, argv, ARGP_LONG_ONLY, NULL, NULL))
- return EXIT_FAILURE;
-
- try {
- Common::init(argc, argv);
- Common::run();
- exit_code = EXIT_SUCCESS;
- } catch (Common::Exception e) {
- WARN(e);
- }
- Common::fini();
-
- return exit_code;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/common.hh b/xbmc/screensavers/rsxs-0.9/src/common.hh
deleted file mode 100644
index 8e7b4e5fbb..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/common.hh
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _COMMON_HH
-#define _COMMON_HH
-
-#if HAVE_CONFIG_H
- #include <config.h>
-#endif
-
-#if ! HAVE_CXX_BOOL
- enum _boolType { false, true };
- typedef enum _boolType bool;
-#endif
-
-#if ! HAVE_CXX_NEW_FOR_SCOPING
-# define for if (0) {} else for
-#endif
-
-#define GLX_GLXEXT_PROTOTYPES 1
-
-#include <algorithm>
-#include <argp.h>
-#include <cmath>
-#include <functional>
-#include <iostream>
-#include <list>
-#if HAVE_CXX_STRINGSTREAM
- #include <sstream>
-#endif
-#if HAVE_CXX_STRSTREAM
- #include <strstream>
-#endif
-#include <string>
-#include <utility>
-#include <vector>
-
-#if HAVE_GL_GL_H
- #include <GL/gl.h>
-#endif
-#if HAVE_GL_GLEXT_H
- #include <GL/glext.h>
-#endif
-#if HAVE_GL_GLU_H
- #include <GL/glu.h>
-#endif
-#if HAVE_GL_GLX_H
- #include <GL/glx.h>
-#endif
-#if HAVE_X11_XLIB_H
- #include <X11/Xlib.h>
-#endif
-
-namespace std {
-#if HAVE_CXX_STRSTREAM && !HAVE_CXX_STRINGSTREAM
- typedef istrstream istringstream;
- typedef ostrstream ostringstream;
- typedef strstream stringstream;
-#endif
-};
-
-class ResourceManager;
-
-namespace Common {
- typedef std::string Exception;
-
- extern std::string program;
- extern Display* display;
- extern XVisualInfo* visualInfo;
- extern unsigned int screen;
- extern Window window;
- extern GLXContext context;
- extern std::string resourceDir;
-
- extern unsigned int width, height, depth;
- extern unsigned int centerX, centerY;
- extern float aspectRatio;
- extern Colormap colormap;
- extern bool doubleBuffered;
-
- extern bool running;
- extern unsigned int elapsedMicros;
- extern float elapsedSecs;
- extern float speed;
- extern float elapsedTime;
-
- extern ResourceManager* resources;
-
-#ifndef NOXBMC
- void init(int argc, char** argv);
- void run();
-#endif
-
- static inline int randomInt(int x) {
- return std::rand() % x;
- }
-
- static inline float randomFloat(float x) {
- return float(std::rand()) * x / float(RAND_MAX);
- }
-
- static inline void flush(bool swap = doubleBuffered) {
- if (swap)
- glXSwapBuffers(display, window);
- else
- glFlush();
- }
-
- template <typename T>
- static inline const T& clamp(
- const T& v, const T& min, const T& max
- ) {
- return std::max(std::min(v, max), min);
- }
-
- template <typename T>
- static inline bool parseArg(
- const char* arg, T& item, const T& min, const T& max
- ) {
- return
- !(std::istringstream(arg) >> item) ||
- item < min || item > max;
- }
-
- template <typename T>
- static inline bool parseArg(
- const char* arg, T& item, const T& min, const T& max, const T& extra
- ) {
- return
- !(std::istringstream(arg) >> item) ||
- (item != extra && (item < min || item > max));
- }
-};
-
-#ifdef NDEBUG
- #define TRACE(x) do {} while (0)
-#else
- #define TRACE(x) do { \
- std::cerr << "[" << __PRETTY_FUNCTION__ << " @ " << __FILE__ << \
- ":" << __LINE__ << "]" << std::endl << " " << x << std::endl; \
- } while (0)
-#endif
-
-#define WARN(x) do { \
- std::cerr << Common::program << ": " << x << std::endl; \
-} while (0)
-
-namespace stdx {
- class oss {
- private:
- std::ostringstream _oss;
- public:
- operator std::string() const { return _oss.str(); }
- template <typename T>
- oss& operator<<(const T& t) {
- _oss << t;
- return *this;
- }
- };
-
- template <typename In, typename MFunc>
- static inline void call_each(In p, In q, MFunc f) {
- for ( ; p != q; ++p)
- ((*p).*f)();
- }
-
- template <typename In, typename MFunc, typename Arg>
- static inline void call_each(In p, In q, MFunc f, const Arg& a) {
- for ( ; p != q; ++p)
- ((*p).*f)(a);
- }
-
- template <typename Con, typename MFunc>
- static inline void call_all(Con& c, MFunc f) {
- call_each(c.begin(), c.end(), f);
- }
-
- template <typename Con, typename MFunc, typename Arg>
- static inline void call_all(Con& c, MFunc f, const Arg& a) {
- call_each(c.begin(), c.end(), f, a);
- }
-
- template <typename In, typename Out, typename UFunc>
- static inline void map_each(In p, In q, Out o, UFunc f) {
- for ( ; p != q; ++p)
- *o++ = ((*p).*f)();
- }
-
- template <typename Con1, typename Con2, typename UFunc>
- static inline void map_all(const Con1& in, Con2& out, UFunc f) {
- map_each(in.begin(), in.end(), out.begin(), f);
- }
-
- template <typename In, typename MFuncPtr>
- static inline void call_each_ptr(In p, In q, MFuncPtr f) {
- for ( ; p != q; ++p)
- ((*p)->*f)();
- }
-
- template <typename In, typename MFuncPtr, typename Arg>
- static inline void call_each_ptr(
- In p, In q, MFuncPtr f, const Arg& a
- ) {
- for ( ; p != q; ++p)
- ((*p)->*f)(a);
- }
-
- template <typename Con, typename MFuncPtr>
- static inline void call_all_ptr(Con& c, MFuncPtr f) {
- call_each_ptr(c.begin(), c.end(), f);
- }
-
- template <typename Con, typename MFuncPtr, typename Arg>
- static inline void call_all_ptr(Con& c, MFuncPtr f, const Arg& a) {
- call_each_ptr(c.begin(), c.end(), f, a);
- }
-
- template <typename In, typename Out, typename UFunc>
- static inline void map_each_ptr(In p, In q, Out o, UFunc f) {
- for ( ; p != q; ++p)
- *o++ = ((*p)->*f)();
- }
-
- template <typename Con1, typename Con2, typename UFunc>
- static inline void map_all_ptr(const Con1& in, Con2& out, UFunc f) {
- map_each_ptr(in.begin(), in.end(), out.begin(), f);
- }
-
- template <typename In>
- static inline void destroy_each_ptr(In p, const In& q) {
- for ( ; p != q; ++p)
- delete *p;
- }
-
- template <typename Con>
- static inline void destroy_all_ptr(Con& c) {
- destroy_each_ptr(c.begin(), c.end());
- }
-
- template <typename T>
- class constructor_t {
- public:
- inline T operator()() { return T(); }
- };
-
- template <typename T, typename Arg>
- class constructor1_t {
- private:
- const Arg& _x;
- public:
- constructor1_t(const Arg& x) : _x(x) {}
- inline T operator()() { return T(_x); }
- };
-
- template <typename T>
- static inline constructor_t<T> construct() {
- return constructor_t<T>();
- }
-
- template <typename T, typename Arg>
- static inline constructor1_t<T, Arg> construct(const Arg& a) {
- return constructor1_t<T, Arg>(a);
- }
-
- template <typename Con>
- static inline void construct_n(Con& c, typename Con::size_type n) {
- c.reserve(c.size() + n);
- while (n--) c.push_back(typename Con::value_type());
- }
-
- template <typename Con, typename Arg>
- static inline void construct_n(
- Con& c, typename Con::size_type n, const Arg& a
- ) {
- c.reserve(c.size() + n);
- while (n--) c.push_back(typename Con::value_type(a));
- }
-
- template <typename T, typename std::vector<int>::size_type I = 0>
- class dim2 : public std::vector<T> {
- public:
- typedef typename std::vector<T>::reference reference;
- typedef typename std::vector<T>::const_reference const_reference;
- typedef typename std::vector<T>::size_type size_type;
- private:
- size_type _i;
- public:
- dim2(size_type i = 0, size_type j = 0) : std::vector<T>() {
- resize(i, j);
- }
-
- void resize(size_type i = 0, size_type j = 0) {
- if (I)
- std::vector<T>::resize(I * i);
- else {
- _i = i;
- std::vector<T>::resize(i * j);
- }
- }
-
- reference
- operator()(size_type i, size_type j) {
- return (*this)[i * (I ? I : _i) + j];
- }
- const_reference
- operator()(size_type i, size_type j) const {
- return (*this)[i * (I ? I : _i) + j];
- }
- };
-
- template <
- typename T,
- typename std::vector<int>::size_type J = 0,
- typename std::vector<int>::size_type I = 0
- > class dim3 : public std::vector<T> {
- public:
- typedef typename std::vector<T>::reference reference;
- typedef typename std::vector<T>::const_reference const_reference;
- typedef typename std::vector<T>::size_type size_type;
- private:
- size_type _j, _i;
- public:
- dim3(size_type i = 0, size_type j = 0, size_type k = 0)
- : std::vector<T>()
- {
- resize(i, j, k);
- }
-
- void resize(size_type i = 0, size_type j = 0, size_type k = 0) {
- if (I && J)
- std::vector<T>::resize(I * J * i);
- else if (J) {
- _i = i;
- std::vector<T>::resize(i * J * j);
- } else {
- _i = i;
- _j = j;
- std::vector<T>::resize(i * j * k);
- }
- }
-
- reference
- operator()(size_type i, size_type j, size_type k) {
- return (*this)[(i * (I ? I : _i) + j) * (J ? J : _j) + k];
- }
- const_reference
- operator()(size_type i, size_type j, size_type k) const {
- return (*this)[(i * (I ? I : _i) + j) * (J ? J : _j) + k];
- }
- };
-};
-
-#include <resource.hh>
-
-#endif // _COMMON_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/cyclone/Makefile.am b/xbmc/screensavers/rsxs-0.9/src/cyclone/Makefile.am
deleted file mode 100644
index c12ee89972..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/cyclone/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-include $(srcdir)/../Makefile.common
-
-rs_cyclone_SOURCES = $(COMMON) $(COLOR) $(VECTOR) blend.cc blend.hh cyclone.cc \
- cyclone.hh particle.cc particle.hh
-rs_cyclone_LDADD = $(LIBMISC) $(X_LIBS) $(OPENGL_LIBS)
-
-hack_PROGRAMS = rs-cyclone
diff --git a/xbmc/screensavers/rsxs-0.9/src/cyclone/blend.cc b/xbmc/screensavers/rsxs-0.9/src/cyclone/blend.cc
deleted file mode 100644
index 9e67484645..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/cyclone/blend.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <blend.hh>
-
-namespace Blend {
- float _fact[13];
-};
-
-void Blend::init() {
- unsigned int temp = 1;
- _fact[0] = 1.0f;
- for (unsigned int i = 1; i < 13; ++i) {
- temp *= i;
- _fact[i] = float(temp);
- }
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/cyclone/blend.hh b/xbmc/screensavers/rsxs-0.9/src/cyclone/blend.hh
deleted file mode 100644
index d58a3e8362..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/cyclone/blend.hh
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _BLEND_HH
-#define _BLEND_HH
-
-#include <common.hh>
-
-#include <cyclone.hh>
-
-namespace Blend {
- extern float _fact[13];
-
- void init();
-
- static inline float blend(unsigned int i, float step) {
- return _fact[Hack::complexity + 2] / (_fact[i]
- * _fact[Hack::complexity + 2 - i]) * std::pow(step, float(i))
- * std::pow(1.0f - step, float(Hack::complexity + 2 - i));
- }
-};
-
-#endif // _BLEND_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/cyclone/cyclone.cc b/xbmc/screensavers/rsxs-0.9/src/cyclone/cyclone.cc
deleted file mode 100644
index 8f98d9c69c..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/cyclone/cyclone.cc
+++ /dev/null
@@ -1,520 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <blend.hh>
-#include <color.hh>
-#include <hack.hh>
-#include <particle.hh>
-#include <vector.hh>
-
-#define WIDE 200.0f
-#define HIGH 200.0f
-
-namespace Hack {
- unsigned int numCyclones = 1;
- unsigned int numParticles = 200;
- float size = 7.0f;
- unsigned int complexity = 3;
- float speed = 10.0f;
- bool stretch = true;
- bool showCurves = false;
- bool southern = false;
-};
-
-namespace Hack {
- enum Arguments {
- ARG_CYCLONES = 1,
- ARG_PARTICLES,
- ARG_SIZE,
- ARG_COMPLEXITY,
- ARG_SPEED,
- ARG_STRETCH = 0x100, ARG_NO_STRETCH,
- ARG_CURVES = 0x200, ARG_NO_CURVES,
- ARG_SOUTH = 0x300, ARG_NORTH
- };
-
- std::vector<Cyclone> _cyclones;
- std::vector<Particle> _particles;
-
- error_t parse(int, char*, struct argp_state*);
-};
-
-error_t Hack::parse(int key, char* arg, struct argp_state* state) {
- switch (key) {
- case ARG_CYCLONES:
- if (Common::parseArg(arg, numCyclones, 1u, MAX_COMPLEXITY))
- argp_failure(state, EXIT_FAILURE, 0,
- "number of cyclones must be between 1 and %d", MAX_COMPLEXITY);
- return 0;
- case ARG_PARTICLES:
- if (Common::parseArg(arg, numParticles, 1u, 10000u))
- argp_failure(state, EXIT_FAILURE, 0,
- "particles per cyclones must be between 1 and 10000");
- return 0;
- case ARG_SIZE:
- if (Common::parseArg(arg, size, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "particle size must be between 1 and 100");
- return 0;
- case ARG_COMPLEXITY:
- if (Common::parseArg(arg, complexity, 1u, 10u))
- argp_failure(state, EXIT_FAILURE, 0,
- "cyclone complexity must be between 1 and 10");
- return 0;
- case ARG_SPEED:
- if (Common::parseArg(arg, speed, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "particle speed must be between 1 and 100");
- return 0;
- case ARG_STRETCH:
- stretch = true;
- return 0;
- case ARG_NO_STRETCH:
- stretch = false;
- return 0;
- case ARG_CURVES:
- showCurves = true;
- return 0;
- case ARG_NO_CURVES:
- showCurves = false;
- return 0;
- case ARG_SOUTH:
- southern = true;
- return 0;
- case ARG_NORTH:
- southern = false;
- return 0;
- default:
- return ARGP_ERR_UNKNOWN;
- }
-}
-
-const struct argp* Hack::getParser() {
- static struct argp_option options[] = {
- { NULL, 0, NULL, 0, "Cyclone options:" },
- { "cyclones", ARG_CYCLONES, "NUM", 0,
- "Number of cyclones (1-10, default = 1)" },
- { "complexity", ARG_COMPLEXITY, "NUM", 0,
- "Cyclone complexity (1-10, default = 3)" },
- { "particles", ARG_PARTICLES, "NUM", 0,
- "Particles per cyclone (1-10000, default = 200)" },
- { "curves", ARG_CURVES, NULL, 0,
- "Enable cyclone curves"},
- { "no-curves", ARG_NO_CURVES, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { "south", ARG_SOUTH, NULL, 0,
- "Use southern/northern hemisphere cyclones (default = north)" },
- { "north", ARG_NORTH, NULL, OPTION_ALIAS },
- { NULL, 0, NULL, 0, "Particle options:" },
- { "size", ARG_SIZE, "NUM", 0,
- "Particle size (1-100, default = 7)" },
- { "speed", ARG_SPEED, "NUM", 0,
- "Particle speed (1-100, default = 10)" },
- { "stretch", ARG_STRETCH, NULL, OPTION_HIDDEN,
- "Disable particle stretching" },
- { "no-stretch", ARG_NO_STRETCH, NULL, OPTION_ALIAS },
- {}
- };
- static struct argp parser =
- { options, parse, NULL, "Simulates tornadoes on your computer screen." };
- return &parser;
-}
-
-std::string Hack::getShortName() { return "cyclone"; }
-std::string Hack::getName() { return "Cyclone"; }
-
-void Hack::start() {
- glViewport(0, 0, Common::width, Common::height);
-
- glEnable(GL_DEPTH_TEST);
- glFrontFace(GL_CCW);
- glEnable(GL_CULL_FACE);
- glClearColor(0.0, 0.0, 0.0, 1.0);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(80.0, Common::aspectRatio, 50, 3000);
- if (Common::randomInt(500) == 0) {
- TRACE("Easter egg view!");
- glRotatef(90, 1, 0, 0);
- glTranslatef(0.0f, WIDE * -2.0f, 0.0f);
- } else
- glTranslatef(0.0f, 0.0f, WIDE * -2.0f);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- Particle::init();
-
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- float ambient[4] = {0.25f, 0.25f, 0.25f, 0.0f};
- float diffuse[4] = {1.0f, 1.0f, 1.0f, 0.0f};
- float specular[4] = {1.0f, 1.0f, 1.0f, 0.0f};
- float position[4] = {WIDE * 2.0f, -HIGH, WIDE * 2.0f, 0.0f};
- glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
- glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
- glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
- glLightfv(GL_LIGHT0, GL_POSITION, position);
- glEnable(GL_COLOR_MATERIAL);
- glMaterialf(GL_FRONT, GL_SHININESS, 20.0f);
- glColorMaterial(GL_FRONT, GL_SPECULAR);
- glColor3f(0.7f, 0.7f, 0.7f);
- glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
-
- // Initialize cyclones and their particles
- Blend::init();
- stdx::construct_n(_cyclones, numCyclones);
- _particles.reserve(numCyclones * numParticles);
- for (
- std::vector<Cyclone>::const_iterator c = _cyclones.begin();
- c != _cyclones.end();
- ++c
- ) stdx::construct_n(_particles, numParticles, c);
-}
-
-void Hack::tick() {
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- stdx::call_all(_cyclones, &Cyclone::update);
- stdx::call_all(_particles, &Particle::update);
-
- //Common::flush();
-}
-
-void Hack::reshape() {
- glViewport(0, 0, Common::width, Common::height);
-}
-
-void Hack::stop() {}
-
-Cyclone::Cyclone() {
- // Initialize position stuff
- _V[Hack::complexity + 2].set(
- Common::randomFloat(WIDE * 2.0f - WIDE),
- HIGH,
- Common::randomFloat(WIDE * 2.0f - WIDE)
- );
- _V[Hack::complexity + 1].set(
- _V[Hack::complexity + 2].x(),
- Common::randomFloat(HIGH / 3.0f) + HIGH / 4.0f,
- _V[Hack::complexity + 2].z()
- );
- for (unsigned int i = Hack::complexity; i > 1; --i)
- _V[i].set(
- _V[i + 1].x() + Common::randomFloat(WIDE) - WIDE / 2.0f,
- Common::randomFloat(HIGH * 2.0f) - HIGH,
- _V[i + 1].z() + Common::randomFloat(WIDE) - WIDE / 2.0f
- );
- _V[1].set(
- _V[2].x() + Common::randomFloat(WIDE / 2.0f) - WIDE / 4.0f,
- -Common::randomFloat(HIGH / 2.0f) - HIGH / 4.0f,
- _V[2].z() + Common::randomFloat(WIDE / 2.0f) - WIDE / 4.0f
- );
- _V[0].set(
- _V[1].x() + Common::randomFloat(WIDE / 8.0f) - WIDE / 16.0f,
- -HIGH,
- _V[1].z() + Common::randomFloat(WIDE / 8.0f) - WIDE / 16.0f
- );
-
- // Initialize width stuff
- _width[Hack::complexity + 2] = Common::randomFloat(175.0f) + 75.0f;
- _width[Hack::complexity + 1] = Common::randomFloat(60.0f) + 15.0f;
- for (unsigned int i = Hack::complexity; i > 1; --i)
- _width[i] = Common::randomFloat(25.0f) + 15.0f;
- _width[1] = Common::randomFloat(25.0f) + 5.0f;
- _width[0] = Common::randomFloat(15.0f) + 5.0f;
-
- // Initialize transition stuff
- for (unsigned int i = 0; i < Hack::complexity + 3; ++i) {
- _VChange[i].first = _VChange[i].second = 0;
- _widthChange[i].first = _widthChange[i].second = 0;
- }
-
- // Initialize color stuff
- _oldHSL.set(
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f),
- 0.0f
- );
- _targetHSL.set(
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f),
- 1.0f
- );
- _HSLChange.first = 0;
- _HSLChange.second = 300;
-}
-
-void Cyclone::update() {
- static int speed10000 = int(10000 / Hack::speed);
- static int speed7000 = int(7000 / Hack::speed);
- static int speed5000 = int(5000 / Hack::speed);
- static int speed4000 = int(4000 / Hack::speed);
- static int speed3000 = int(3000 / Hack::speed);
- static int speed2000 = int(2000 / Hack::speed);
- static int speed1500 = int(1500 / Hack::speed);
-
- // update cyclone's path
- unsigned int temp = Hack::complexity + 2;
- if (_VChange[temp].first == _VChange[temp].second) {
- _oldV[temp] = _V[temp];
- _targetV[temp].set(
- Common::randomFloat(WIDE * 2.0f) - WIDE,
- HIGH,
- Common::randomFloat(WIDE * 2.0f) - WIDE
- );
- _VChange[temp].first = 0;
- _VChange[temp].second = Common::randomInt(speed10000) + speed5000;
- }
-
- temp = Hack::complexity + 1;
- if (_VChange[temp].first == _VChange[temp].second) {
- _oldV[temp] = _V[temp];
- _targetV[temp].set(
- _V[temp + 1].x(),
- Common::randomFloat(HIGH / 3.0f) + HIGH / 4.0f,
- _V[temp + 1].z()
- );
- _VChange[temp].first = 0;
- _VChange[temp].second = Common::randomInt(speed7000) + speed5000;
- }
-
- for (unsigned int i = Hack::complexity; i > 1; --i) {
- if (_VChange[i].first == _VChange[i].second) {
- _oldV[i] = _V[i];
- _targetV[i].set(
- _targetV[i + 1].x() +
- (_targetV[i + 1].x() - _targetV[i + 2].x()) / 2.0f +
- Common::randomFloat(WIDE / 2.0f) - WIDE / 4.0f,
- (_targetV[i + 1].y() + _targetV[i - 1].y()) / 2.0f +
- Common::randomFloat(HIGH / 8.0f) - HIGH / 16.0f,
- _targetV[i + 1].z() +
- (_targetV[i + 1].z() - _targetV[i + 2].z()) / 2.0f +
- Common::randomFloat(WIDE / 2.0f) - WIDE / 4.0f
- );
- _targetV[i].y() = Common::clamp(_targetV[i].y(), -HIGH, HIGH);
- _VChange[i].first = 0;
- _VChange[i].second = Common::randomInt(speed5000) + speed3000;
- }
- }
- if (_VChange[1].first == _VChange[1].second) {
- _oldV[1] = _V[1];
- _targetV[1].set(
- _targetV[2].x() + Common::randomFloat(WIDE / 2.0f) - WIDE / 4.0f,
- -Common::randomFloat(HIGH / 2.0f) - HIGH / 4.0f,
- _targetV[2].z() + Common::randomFloat(WIDE / 2.0f) - WIDE / 4.0f
- );
- _VChange[1].first = 0;
- _VChange[1].second = Common::randomInt(speed4000) + speed2000;
- }
- if (_VChange[0].first == _VChange[0].second) {
- _oldV[0] = _V[0];
- // XXX Should the following be _targetV not _V ?
- _targetV[0].set(
- _V[1].x() + Common::randomFloat(WIDE / 8.0f) - WIDE / 16.0f,
- -HIGH,
- _V[1].z() + Common::randomFloat(WIDE / 8.0f) - WIDE / 16.0f
- );
- _VChange[0].first = 0;
- _VChange[0].second = Common::randomInt(speed3000) + speed1500;
- }
- for (unsigned int i = 0; i < Hack::complexity + 3; ++i) {
- float between = float(_VChange[i].first) / float(_VChange[i].second) * M_PI * 2.0f;
- between = (1.0f - std::cos(between)) / 2.0f;
- _V[i].set(
- ((_targetV[i].x() - _oldV[i].x()) * between) + _oldV[i].x(),
- ((_targetV[i].y() - _oldV[i].y()) * between) + _oldV[i].y(),
- ((_targetV[i].z() - _oldV[i].z()) * between) + _oldV[i].z()
- );
- ++_VChange[i].first;
- }
-
- // Update cyclone's widths
- temp = Hack::complexity + 2;
- if (_widthChange[temp].first == _widthChange[temp].second) {
- _oldWidth[temp] = _width[temp];
- _targetWidth[temp] = Common::randomFloat(225.0f) + 75.0f;
- _widthChange[temp].first = 0;
- _widthChange[temp].second = Common::randomInt(speed5000) + speed5000;
- }
- temp = Hack::complexity + 1;
- if (_widthChange[temp].first == _widthChange[temp].second) {
- _oldWidth[temp] = _width[temp];
- _targetWidth[temp] = Common::randomFloat(80.0f) + 15.0f;
- _widthChange[temp].first = 0;
- _widthChange[temp].second = Common::randomInt(speed5000) + speed5000;
- }
- for (unsigned int i = Hack::complexity; i > 1; --i) {
- if (_widthChange[i].first == _widthChange[i].second) {
- _oldWidth[i] = _width[i];
- _targetWidth[i] = Common::randomFloat(25.0f) + 15.0f;
- _widthChange[i].first = 0;
- _widthChange[i].second = Common::randomInt(speed5000) + speed4000;
- }
- }
- if (_widthChange[1].first == _widthChange[1].second) {
- _oldWidth[1] = _width[1];
- _targetWidth[1] = Common::randomFloat(25.0f) + 5.0f;
- _widthChange[1].first = 0;
- _widthChange[1].second = Common::randomInt(speed5000) + speed3000;
- }
- if (_widthChange[0].first == _widthChange[0].second) {
- _oldWidth[0] = _width[0];
- _targetWidth[0] = Common::randomFloat(15.0f) + 5.0f;
- _widthChange[0].first = 0;
- _widthChange[0].second = Common::randomInt(speed5000) + speed2000;
- }
- for (unsigned int i = 0; i < Hack::complexity + 3; ++i) {
- float between = float(_widthChange[i].first) / float(_widthChange[i].second);
- _width[i] = ((_targetWidth[i] - _oldWidth[i]) * between) + _oldWidth[i];
- ++_widthChange[i].first;
- }
-
- // Update cyclones color
- if (_HSLChange.first == _HSLChange.second) {
- _oldHSL = _HSL;
- _targetHSL.set(
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f) + 0.5f
- );
- _targetHSL.clamp();
- _HSLChange.first = 0;
- _HSLChange.second = Common::randomInt(1900) + 100;
- }
- float between = float(_HSLChange.first) / float(_HSLChange.second);
- float diff = _targetHSL.h() - _oldHSL.h();
- bool direction = (
- (_targetHSL.h() > _oldHSL.h() && diff > 0.5f) ||
- (_targetHSL.h() < _oldHSL.h() && diff < -0.5f)
- ) && (diff > 0.5f);
- _HSL = HSLColor::tween(_oldHSL, _targetHSL, between, direction);
- ++_HSLChange.first;
-
- if (Hack::showCurves) {
- glDisable(GL_LIGHTING);
- glColor3f(0.0f, 1.0f, 0.0f);
- glBegin(GL_LINE_STRIP);
- for (float step = 0.0; step < 1.0; step += 0.02f) {
- Vector point;
- for (unsigned int i = 0; i < Hack::complexity + 3; ++i)
- point += _V[i] * Blend::blend(i, step);
- glVertex3fv(point.get());
- }
- glEnd();
- glColor3f(1.0f, 0.0f, 0.0f);
- glBegin(GL_LINE_STRIP);
- for (unsigned int i = 0; i < Hack::complexity + 3; ++i)
- glVertex3fv(_V[i].get());
- glEnd();
- glEnable(GL_LIGHTING);
- }
-}
-
-void Hack::keyPress(char c, const KeySym&) {
- switch (c) {
- case 3: case 27:
- case 'q': case 'Q':
- Common::running = false;
- break;
- }
-}
-
-void Hack::keyRelease(char, const KeySym&) {}
-void Hack::pointerMotion(int, int) {}
-void Hack::buttonPress(unsigned int) {}
-void Hack::buttonRelease(unsigned int) {}
-void Hack::pointerEnter() {}
-void Hack::pointerLeave() {}
-
-#define _LINUX
-#include "../../../addons/include/xbmc_scr_dll.h"
-
-extern "C" {
-
-ADDON_STATUS Create(void* hdl, void* props)
-{
- if (!props)
- return STATUS_UNKNOWN;
-
- SCR_PROPS* scrprops = (SCR_PROPS*)props;
-
- Common::width = scrprops->width;
- Common::height = scrprops->height;
- Common::aspectRatio = float(Common::width) / float(Common::height);
-
- return STATUS_OK;
-}
-
-void Start()
-{
- Hack::start();
-}
-
-void Render()
-{
- Hack::tick();
-}
-
-void Stop()
-{
- Hack::stop();
-}
-
-void Destroy()
-{
-}
-
-ADDON_STATUS GetStatus()
-{
- return STATUS_OK;
-}
-
-bool HasSettings()
-{
- return false;
-}
-
-unsigned int GetSettings(StructSetting ***sSet)
-{
- return 0;
-}
-
-ADDON_STATUS SetSetting(const char *settingName, const void *settingValue)
-{
- return STATUS_OK;
-}
-
-void FreeSettings()
-{
-}
-
-void GetInfo(SCR_INFO *info)
-{
-}
-
-void Remove()
-{
-}
-
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/cyclone/cyclone.hh b/xbmc/screensavers/rsxs-0.9/src/cyclone/cyclone.hh
deleted file mode 100644
index cea1b96c51..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/cyclone/cyclone.hh
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _CYCLONE_HH
-#define _CYCLONE_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <vector.hh>
-
-#define MAX_COMPLEXITY 10u
-
-namespace Hack {
- extern unsigned int numCyclones;
- extern unsigned int numParticles;
- extern float size;
- extern unsigned int complexity;
- extern float speed;
- extern bool stretch;
- extern bool showCurves;
- extern bool southern;
-};
-
-class Cyclone {
-private:
- Vector _targetV[MAX_COMPLEXITY + 3];
- Vector _V[MAX_COMPLEXITY + 3];
- Vector _oldV[MAX_COMPLEXITY + 3];
- float _targetWidth[MAX_COMPLEXITY + 3];
- float _width[MAX_COMPLEXITY + 3];
- float _oldWidth[MAX_COMPLEXITY + 3];
- HSLColor _targetHSL;
- HSLColor _HSL;
- HSLColor _oldHSL;
- std::pair<int, int> _VChange[MAX_COMPLEXITY + 3];
- std::pair<int, int> _widthChange[MAX_COMPLEXITY + 3];
- std::pair<int, int> _HSLChange;
-public:
- Cyclone();
-
- const HSLColor& color() const {
- return _HSL;
- }
-
- const Vector& v(unsigned int i) const {
- return _V[i];
- }
-
- float width(unsigned int i) const {
- return _width[i];
- }
-
- void update();
-};
-
-#endif // _CYCLONE_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/cyclone/particle.cc b/xbmc/screensavers/rsxs-0.9/src/cyclone/particle.cc
deleted file mode 100644
index cd44833809..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/cyclone/particle.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <blend.hh>
-#include <cyclone.hh>
-#include <particle.hh>
-#include <vector.hh>
-
-GLuint Particle::_list;
-
-void Particle::update() {
- _lastV = _V;
- if (_step > 1.0f)
- setup();
-
- // Take local copy for optimizability
- unsigned int complexity = Hack::complexity;
-
- _V.set(0, 0, 0);
- for (unsigned int i = 0; i < complexity + 3; ++i)
- _V += _cy->v(i) * Blend::blend(i, _step);
-
- Vector dir;
- Vector up(0.0f, 1.0f, 0.0f);
-
- for (unsigned int i = 0; i < complexity + 3; ++i)
- dir += _cy->v(i) * Blend::blend(i, _step - 0.01f);
- dir = _V - dir;
- dir.normalize();
- Vector crossVec(Vector::cross(dir, up));
-
- float tiltAngle = -std::acos(Vector::dot(dir, up)) * R2D;
- unsigned int i = (unsigned int)(_step * (float(Hack::complexity) + 2.0f));
- if (i >= Hack::complexity + 2)
- i = Hack::complexity + 1;
- float between = (
- _step -
- (float(i) / float(Hack::complexity + 2))
- ) * float(Hack::complexity + 2);
- float cyWidth = _cy->width(i) * (1.0f - between) +
- _cy->width(i + 1) * between;
- float newStep = (0.005f * Hack::speed) / (_width * _width * cyWidth);
- _step += newStep;
- float newSpinAngle = (40.0f * Hack::speed) / (_width * cyWidth);
- _spinAngle += Hack::southern ? -newSpinAngle : newSpinAngle;
-
- float scale = 1.0f;
- if (Hack::stretch)
- scale = Common::clamp(
- _width * cyWidth * newSpinAngle * 0.02f,
- 1.0f, cyWidth * 2.0f / Hack::size
- );
- glColor3fv(_RGB.get());
- glPushMatrix();
- glLoadIdentity();
- glTranslatef(_V.x(), _V.y(), _V.z());
- glRotatef(tiltAngle, crossVec.x(), crossVec.y(), crossVec.z());
- glRotatef(_spinAngle, 0, 1, 0);
- glTranslatef(_width * cyWidth, 0, 0);
- glScalef(1.0f, 1.0f, scale);
- glCallList(_list);
- glPopMatrix();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/cyclone/particle.hh b/xbmc/screensavers/rsxs-0.9/src/cyclone/particle.hh
deleted file mode 100644
index 604ee87c2c..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/cyclone/particle.hh
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _PARTICLE_HH
-#define _PARTICLE_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <cyclone.hh>
-#include <vector.hh>
-
-class Particle {
-private:
- static GLuint _list;
-
- std::vector<Cyclone>::const_iterator _cy;
-
- RGBColor _RGB;
- Vector _V, _lastV;
- float _width;
- float _step;
- float _spinAngle;
-public:
- static void init() {
- _list = Common::resources->genLists(1);
- glNewList(_list, GL_COMPILE);
- GLUquadricObj* qobj = gluNewQuadric();
- gluSphere(qobj, Hack::size / 4.0f, 3, 2);
- gluDeleteQuadric(qobj);
- glEndList();
- }
-
- Particle(const std::vector<Cyclone>::const_iterator& cy) : _cy(cy) {
- setup();
- }
-
- void setup() {
- _width = Common::randomFloat(0.8f) + 0.2f;
- _step = 0.0f;
- _spinAngle = Common::randomFloat(360);
- _RGB = _cy->color();
- }
-
- void update();
-};
-
-#endif // _PARTICLE_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/dlopen.hh b/xbmc/screensavers/rsxs-0.9/src/dlopen.hh
deleted file mode 100644
index 0e765dc7b5..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/dlopen.hh
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _DLOPEN_HH
-#define _DLOPEN_HH
-
-#include <common.hh>
-
-#if USE_DLOPEN
-
-#include <ltdl.h>
-
-class Loader : public ResourceManager::Resource<void> {
-public:
- typedef std::string Exception;
-public:
- Loader() {
- if (lt_dlinit())
- throw Exception(lt_dlerror());
- }
- ~Loader() { lt_dlexit(); }
- void operator()() const {}
-};
-
-class Library;
-class Library : public ResourceManager::Resource<const Library*> {
-public:
- typedef std::string Exception;
-private:
- lt_dlhandle _handle;
-public:
- Library(const std::string& library) {
- static bool inited = false;
- if (!inited) {
- Common::resources->manage(new Loader);
- inited = true;
- }
- _handle = lt_dlopenext(library.c_str());
- if (!_handle)
- throw Exception(lt_dlerror());
- }
- ~Library() { lt_dlclose(_handle); }
- const Library* operator()() const { return this; }
- lt_ptr operator()(const std::string& function) const {
- lt_ptr ptr = lt_dlsym(_handle, function.c_str());
- if (!ptr)
- throw Exception(lt_dlerror());
- return ptr;
- }
-};
-
-#endif // USE_DLOPEN
-
-#endif // _DLOPEN_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/euphoria/Makefile.am b/xbmc/screensavers/rsxs-0.9/src/euphoria/Makefile.am
deleted file mode 100644
index 3030b82070..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/euphoria/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-include $(srcdir)/../Makefile.common
-
-rs_euphoria_SOURCES = $(COMMON) $(COLOR) $(VECTOR) $(IMAGE) euphoria.cc \
- euphoria.hh wisp.cc wisp.hh
-
-AM_CPPFLAGS += $(IMAGE_CPPFLAGS)
-AM_CXXFLAGS += $(IMAGE_CXXFLAGS)
-AM_LDFLAGS += $(IMAGE_LDFLAGS)
-rs_euphoria_LDADD = $(LIBMISC) $(X_LIBS) $(OPENGL_LIBS) $(IMAGE_LIBS)
-
-hack_PROGRAMS = rs-euphoria
-
-euphoriadatadir = $(pkgdatadir)/euphoria
-dist_euphoriadata_DATA = lines.png plasma.png stringy.png
-
-uninstall-hook:
- -rmdir $(euphoriadatadir)
diff --git a/xbmc/screensavers/rsxs-0.9/src/euphoria/euphoria.cc b/xbmc/screensavers/rsxs-0.9/src/euphoria/euphoria.cc
deleted file mode 100644
index bee53917ce..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/euphoria/euphoria.cc
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <euphoria.hh>
-#include <hack.hh>
-#include <pngimage.hh>
-#include <wisp.hh>
-
-namespace Hack {
- unsigned int numWisps = 5;
- unsigned int numBackWisps = 0;
- unsigned int density = 25;
- float visibility = 35.0f;
- float speed = 15.0f;
- float feedback = 0.0f;
- float feedbackSpeed = 1.0f;
- unsigned int feedbackSize = 8;
- std::string texture;
- bool wireframe = false;
-};
-
-namespace Hack {
- enum Arguments {
- ARG_WISPS = 1,
- ARG_BACKWISPS,
- ARG_DENSITY,
- ARG_VISIBILITY,
- ARG_SPEED,
- ARG_FEEDBACK,
- ARG_FEEDBACKSPEED,
- ARG_FEEDBACKSIZE,
- ARG_TEXTURE,
- ARG_WIREFRAME = 0x100, ARG_NO_WIREFRAME,
- ARG_NO_TEXTURE = 0x200, ARG_PLASMA_TEXTURE, ARG_STRINGY_TEXTURE,
- ARG_LINES_TEXTURE, ARG_RANDOM_TEXTURE
- };
-
- float _fr[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
- float _fv[4];
- float _f[4];
-
- float _lr[3] = { 0.0f, 0.0f, 0.0f };
- float _lv[3];
- float _l[3];
-
- GLuint _tex;
- GLuint _feedbackTex;
- unsigned int _feedbackTexSize;
- stdx::dim3<GLubyte, 3> _feedbackMap;
-
- std::vector<Wisp> _backWisps;
- std::vector<Wisp> _wisps;
-
- error_t parse(int, char*, struct argp_state*);
-};
-
-error_t Hack::parse(int key, char* arg, struct argp_state* state) {
-retry:
- switch (key) {
- case ARG_WISPS:
- if (Common::parseArg(arg, numWisps, 0u, 100u))
- argp_failure(state, EXIT_FAILURE, 0,
- "number of wisps must be between 0 and 100");
- return 0;
- case ARG_BACKWISPS:
- if (Common::parseArg(arg, numBackWisps, 0u, 100u))
- argp_failure(state, EXIT_FAILURE, 0,
- "number of background layers must be between 0 and 100");
- return 0;
- case ARG_DENSITY:
- if (Common::parseArg(arg, density, 2u, 100u))
- argp_failure(state, EXIT_FAILURE, 0,
- "mesh density must be between 2 and 100");
- return 0;
- case ARG_VISIBILITY:
- if (Common::parseArg(arg, visibility, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "mesh visibility must be between 1 and 100");
- return 0;
- case ARG_SPEED:
- if (Common::parseArg(arg, speed, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "motion speed must be between 1 and 100");
- return 0;
- case ARG_FEEDBACK:
- if (Common::parseArg(arg, feedback, 0.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "feedback intensity must be between 0 and 100");
- return 0;
- case ARG_FEEDBACKSPEED:
- if (Common::parseArg(arg, feedbackSpeed, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "feedback speed must be between 1 and 100");
- return 0;
- case ARG_FEEDBACKSIZE:
- if (Common::parseArg(arg, feedbackSize, 1u, 10u))
- argp_failure(state, EXIT_FAILURE, 0,
- "feedback speed must be between 1 and 10");
- return 0;
- case ARG_WIREFRAME:
- wireframe = true;
- return 0;
- case ARG_NO_WIREFRAME:
- wireframe = false;
- return 0;
- case ARG_TEXTURE:
- texture = arg;
- return 0;
- case ARG_NO_TEXTURE:
- texture = "";
- return 0;
- case ARG_PLASMA_TEXTURE:
- texture = "plasma.png";
- return 0;
- case ARG_STRINGY_TEXTURE:
- texture = "stringy.png";
- return 0;
- case ARG_LINES_TEXTURE:
- texture = "lines.png";
- return 0;
- case ARG_RANDOM_TEXTURE:
- key = Common::randomInt(3) + ARG_PLASMA_TEXTURE;
- goto retry;
- default:
- return ARGP_ERR_UNKNOWN;
- }
-}
-
-const struct argp* Hack::getParser() {
- static struct argp_option options[] = {
- { NULL, 0, NULL, 0, "Global options:" },
- { "wisps", ARG_WISPS, "NUM", 0, "Number of wisps (0-100, default = 5)" },
- { "background", ARG_BACKWISPS, "NUM", 0,
- "Number of background layers (0-100, default = 0)" },
- { NULL, 0, NULL, 0, "Wisp mesh options:" },
- { "density", ARG_DENSITY, "NUM", 0,
- "Mesh density (2-100, default = 25)" },
- { "speed", ARG_SPEED, "NUM", 0,
- "Motion speed (1-100, default = 15)" },
- { "visibility", ARG_VISIBILITY, "NUM", 0,
- "Mesh visibility (1-100, default = 35)" },
- { "wireframe", ARG_WIREFRAME, NULL, 0,
- "Enable wireframe mesh" },
- { "no-wireframe", ARG_NO_WIREFRAME, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { "texture", ARG_TEXTURE, "FILE", 0,
- "Wisp texture (default = no texture)" },
- { NULL, 0, NULL, 0, "Predefined textures:" },
- { "plain", ARG_NO_TEXTURE, NULL, 0 },
- { "plasma", ARG_PLASMA_TEXTURE, NULL, 0 },
- { "stringy", ARG_STRINGY_TEXTURE, NULL, 0 },
- { "lines", ARG_LINES_TEXTURE, NULL, 0 },
- { "random", ARG_RANDOM_TEXTURE, NULL, 0 },
- { NULL, 0, NULL, 0, "Feedback options:" },
- { "feedback", ARG_FEEDBACK, "NUM", 0,
- "Feedback intensity (0-100, default = 0)" },
- { "feedbackspeed", ARG_FEEDBACKSPEED, "NUM", 0,
- "Feedback speed (1-100, default = 1)" },
- { "feedbacksize", ARG_FEEDBACKSIZE, "NUM", 0,
- "Feedback size (1-10, default = 3)" },
- {}
- };
- static struct argp parser = {
- options, parse, NULL,
- "Draws patterned wisps, with optional psychadelic feedback."
- };
- return &parser;
-}
-
-std::string Hack::getShortName() { return "euphoria"; }
-std::string Hack::getName() { return "Euphoria"; }
-
-void Hack::start() {
- glViewport(0, 0, Common::width, Common::height);
-
- _tex = 0;
- if (texture.length()) {
- glEnable(GL_TEXTURE_2D);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- _tex = Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- PNG(texture)
- );
- }
-
- if (feedback > 0.0f) {
- _feedbackTexSize = 1 << feedbackSize;
- while (
- (_feedbackTexSize > Common::width) ||
- (_feedbackTexSize > Common::height)
- )
- _feedbackTexSize >>= 1;
-
- // feedback texture setup
- glEnable(GL_TEXTURE_2D);
- _feedbackMap.resize(_feedbackTexSize, _feedbackTexSize);
- _feedbackTex = Common::resources->genTexture(
- GL_LINEAR, GL_LINEAR, GL_CLAMP, GL_CLAMP,
- 3, _feedbackTexSize, _feedbackTexSize,
- GL_RGB, GL_UNSIGNED_BYTE, &_feedbackMap.front(), false
- );
-
- // feedback velocity variable setup
- _fv[0] = feedbackSpeed * (Common::randomFloat(0.025f) + 0.025f);
- _fv[1] = feedbackSpeed * (Common::randomFloat(0.05f) + 0.05f);
- _fv[2] = feedbackSpeed * (Common::randomFloat(0.05f) + 0.05f);
- _fv[3] = feedbackSpeed * (Common::randomFloat(0.1f) + 0.1f);
- _lv[0] = feedbackSpeed * (Common::randomFloat(0.0025f) + 0.0025f);
- _lv[1] = feedbackSpeed * (Common::randomFloat(0.0025f) + 0.0025f);
- _lv[2] = feedbackSpeed * (Common::randomFloat(0.0025f) + 0.0025f);
- }
-
- // Initialize wisps
- stdx::construct_n(_wisps, numWisps);
- stdx::construct_n(_backWisps, numBackWisps);
-}
-
-void Hack::tick() {
-
-Common::run();
-
- // setup regular drawing area just in case feedback isn't used
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- gluPerspective(20.0, Common::aspectRatio, 0.01, 20);
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -5.0);
-
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT);
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE);
- glLineWidth(2.0f);
- glEnable(GL_LINE_SMOOTH);
- glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
-
- // Update wisps
- stdx::call_all(_wisps, &Wisp::update);
- stdx::call_all(_backWisps, &Wisp::update);
-
- if (feedback > 0.0f) {
- static float feedbackIntensity = feedback / 101.0f;
-
- // update feedback variables
- for (unsigned int i = 0; i < 4; ++i) {
- _fr[i] += Common::elapsedSecs * _fv[i];
- if (_fr[i] > M_PI * 2.0f)
- _fr[i] -= M_PI * 2.0f;
- }
- _f[0] = 30.0f * std::cos(_fr[0]);
- _f[1] = 0.2f * std::cos(_fr[1]);
- _f[2] = 0.2f * std::cos(_fr[2]);
- _f[3] = 0.8f * std::cos(_fr[3]);
- for (unsigned int i = 0; i < 3; ++i) {
- _lr[i] += Common::elapsedSecs * _lv[i];
- if (_lr[i] > M_PI * 2.0f)
- _lr[i] -= M_PI * 2.0f;
- _l[i] = std::cos(_lr[i]);
- _l[i] = _l[i] * _l[i];
- }
-
- // Create drawing area for feedback texture
- glViewport(0, 0, _feedbackTexSize, _feedbackTexSize);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(30.0, Common::aspectRatio, 0.01f, 20.0f);
- glMatrixMode(GL_MODELVIEW);
-
- // Draw
- glClear(GL_COLOR_BUFFER_BIT);
- glColor3f(feedbackIntensity, feedbackIntensity, feedbackIntensity);
- glBindTexture(GL_TEXTURE_2D, _feedbackTex);
- glPushMatrix();
- glTranslatef(_f[1] * _l[1], _f[2] * _l[1], _f[3] * _l[2]);
- glRotatef(_f[0] * _l[0], 0, 0, 1);
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(-0.5f, -0.5f);
- glVertex3f(-Common::aspectRatio * 2.0f, -2.0f, 1.25f);
- glTexCoord2f(1.5f, -0.5f);
- glVertex3f(Common::aspectRatio * 2.0f, -2.0f, 1.25f);
- glTexCoord2f(-0.5f, 1.5f);
- glVertex3f(-Common::aspectRatio * 2.0f, 2.0f, 1.25f);
- glTexCoord2f(1.5f, 1.5f);
- glVertex3f(Common::aspectRatio * 2.0f, 2.0f, 1.25f);
- glEnd();
- glPopMatrix();
- glBindTexture(GL_TEXTURE_2D, _tex);
- stdx::call_all(_backWisps, &Wisp::drawAsBackground);
- stdx::call_all(_wisps, &Wisp::draw);
-
- // readback feedback texture
- glReadBuffer(GL_BACK);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, _feedbackTexSize);
- glBindTexture(GL_TEXTURE_2D, _feedbackTex);
- glReadPixels(0, 0, _feedbackTexSize, _feedbackTexSize, GL_RGB,
- GL_UNSIGNED_BYTE, &_feedbackMap.front());
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _feedbackTexSize, _feedbackTexSize,
- GL_RGB, GL_UNSIGNED_BYTE, &_feedbackMap.front());
-
- // create regular drawing area
- glViewport(0, 0, Common::width, Common::height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(20.0, Common::aspectRatio, 0.01f, 20.0f);
- glMatrixMode(GL_MODELVIEW);
-
- // Draw again
- glClear(GL_COLOR_BUFFER_BIT);
- glColor3f(feedbackIntensity, feedbackIntensity, feedbackIntensity);
- glPushMatrix();
- glTranslatef(_f[1] * _l[1], _f[2] * _l[1], _f[3] * _l[2]);
- glRotatef(_f[0] * _l[0], 0, 0, 1);
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(-0.5f, -0.5f);
- glVertex3f(-Common::aspectRatio * 2.0f, -2.0f, 1.25f);
- glTexCoord2f(1.5f, -0.5f);
- glVertex3f(Common::aspectRatio * 2.0f, -2.0f, 1.25f);
- glTexCoord2f(-0.5f, 1.5f);
- glVertex3f(-Common::aspectRatio * 2.0f, 2.0f, 1.25f);
- glTexCoord2f(1.5f, 1.5f);
- glVertex3f(Common::aspectRatio * 2.0f, 2.0f, 1.25f);
- glEnd();
- glPopMatrix();
-
- glBindTexture(GL_TEXTURE_2D, _tex);
- } else
- glClear(GL_COLOR_BUFFER_BIT);
-
- stdx::call_all(_backWisps, &Wisp::drawAsBackground);
- stdx::call_all(_wisps, &Wisp::draw);
-
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
-
- //Common::flush();
-
- // Clear the error flag
- glGetError();
-}
-
-void Hack::reshape() {
- glViewport(0, 0, Common::width, Common::height);
-
- // setup regular drawing area just in case feedback isn't used
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(20.0, Common::aspectRatio, 0.01, 20);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -5.0);
-}
-
-void Hack::stop() {
- _wisps.clear();
- _backWisps.clear();
- _feedbackMap.clear();
-}
-
-void Hack::keyPress(char c, const KeySym&) {
- switch (c) {
- case 3: case 27:
- case 'q': case 'Q':
- Common::running = false;
- break;
- }
-}
-
-void Hack::keyRelease(char, const KeySym&) {}
-void Hack::pointerMotion(int, int) {}
-void Hack::buttonPress(unsigned int) {}
-void Hack::buttonRelease(unsigned int) {}
-void Hack::pointerEnter() {}
-void Hack::pointerLeave() {}
-
-#define _LINUX
-#include "../../../addons/include/xbmc_scr_dll.h"
-
-extern "C" {
-
-ADDON_STATUS ADDON_Create(void* hdl, void* props)
-{
- if (!props)
- return ADDON_STATUS_UNKNOWN;
-
- SCR_PROPS* scrprops = (SCR_PROPS*)props;
-
- Common::width = scrprops->width;
- Common::height = scrprops->height;
- Common::aspectRatio = float(Common::width) / float(Common::height);
- Common::init(0, NULL);
- return ADDON_STATUS_OK;
-}
-
-void Start()
-{
- Hack::start();
-}
-
-void Render()
-{
- Hack::tick();
-}
-
-void ADDON_Stop()
-{
- Hack::stop();
-}
-
-void ADDON_Destroy()
-{
-}
-
-ADDON_STATUS ADDON_GetStatus()
-{
- return ADDON_STATUS_OK;
-}
-
-bool ADDON_HasSettings()
-{
- return false;
-}
-
-unsigned int ADDON_GetSettings(ADDON_StructSetting ***sSet)
-{
- return 0;
-}
-
-ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue)
-{
- return ADDON_STATUS_OK;
-}
-
-void ADDON_FreeSettings()
-{
-}
-
-void ADDON_Announce(const char *flag, const char *sender, const char *message, const void *data)
-{
-}
-
-void GetInfo(SCR_INFO *info)
-{
-}
-
-void Remove()
-{
-}
-
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/euphoria/euphoria.hh b/xbmc/screensavers/rsxs-0.9/src/euphoria/euphoria.hh
deleted file mode 100644
index 3f03edd3b5..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/euphoria/euphoria.hh
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _EUPHORIA_HH
-#define _EUPHORIA_HH
-
-#include <common.hh>
-
-namespace Hack {
- extern unsigned int numWisps;
- extern unsigned int numBackWisps;
- extern unsigned int density;
- extern float visibility;
- extern float speed;
- extern float feedback;
- extern float feedbackSpeed;
- extern unsigned int feedbackSize;
- extern std::string texture;
- extern bool wireframe;
-};
-
-#endif // _EUPHORIA_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/euphoria/lines.png b/xbmc/screensavers/rsxs-0.9/src/euphoria/lines.png
deleted file mode 100644
index a67c9cadf1..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/euphoria/lines.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/euphoria/plasma.png b/xbmc/screensavers/rsxs-0.9/src/euphoria/plasma.png
deleted file mode 100644
index fe8297ce63..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/euphoria/plasma.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/euphoria/stringy.png b/xbmc/screensavers/rsxs-0.9/src/euphoria/stringy.png
deleted file mode 100644
index 66aba35a6b..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/euphoria/stringy.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/euphoria/wisp.cc b/xbmc/screensavers/rsxs-0.9/src/euphoria/wisp.cc
deleted file mode 100644
index 6417f17836..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/euphoria/wisp.cc
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <euphoria.hh>
-#include <wisp.hh>
-
-Wisp::Wisp() {
- float recHalfDens = 1.0f / (float(Hack::density) * 0.5f);
-
- _vertex.resize( Hack::density + 1, Hack::density + 1);
- _intensity.resize(Hack::density + 1, Hack::density + 1);
- _gridPos.resize( Hack::density + 1, Hack::density + 1);
-
- for (unsigned int i = 0; i <= Hack::density; ++i)
- for (unsigned int j = 0; j <= Hack::density; ++j) {
- Vector v(
- float(i) * recHalfDens - 1.0f,
- float(j) * recHalfDens - 1.0f,
- 0.0f
- );
- v.z() = v.lengthSquared();
- _gridPos(i, j) = v;
- }
-
- // initialize constants
- for (unsigned int i = 0; i < NUMCONSTS; ++i) {
- _c[i] = Common::randomFloat(2.0f) - 1.0f;
- _cr[i] = Common::randomFloat(M_PI * 2.0f);
- _cv[i] = Common::randomFloat(Hack::speed * 0.03f) +
- (Hack::speed * 0.001f);
- }
-
- // pick color
- _HSL.set(
- Common::randomFloat(1.0f),
- 0.1f + Common::randomFloat(0.9f),
- 1.0f
- );
- _hueSpeed = Common::randomFloat(0.1f) - 0.05f;
- _saturationSpeed = Common::randomFloat(0.04f) + 0.001f;
-}
-
-void Wisp::update() {
- // visibility constants
- static float viscon1 = Hack::visibility * 0.01f;
- static float viscon2 = 1.0f / viscon1;
-
- // update constants
- for (unsigned int i = 0; i < NUMCONSTS; ++i) {
- _cr[i] += _cv[i] * Common::elapsedSecs;
- if (_cr[i] > M_PI * 2.0f)
- _cr[i] -= M_PI * 2.0f;
- _c[i] = std::cos(_cr[i]);
- }
-
- // update vertex positions
- for (unsigned int i = 0; i <= Hack::density; ++i)
- for (unsigned int j = 0; j <= Hack::density; ++j)
- _vertex(i, j).set(
- _gridPos(i, j).x() * _gridPos(i, j).x() *
- _gridPos(i, j).y() * _c[0] +
- _gridPos(i, j).z() * _c[1] + 0.5f * _c[2],
- _gridPos(i, j).y() * _gridPos(i, j).y() *
- _gridPos(i, j).z() * _c[3] +
- _gridPos(i, j).x() * _c[4] + 0.5f * _c[5],
- _gridPos(i, j).z() * _gridPos(i, j).z() *
- _gridPos(i, j).x() * _c[6] +
- _gridPos(i, j).y() * _c[7] + _c[8]
- );
-
- // update vertex normals for most of mesh
- for (unsigned int i = 1; i < Hack::density; ++i)
- for (unsigned int j = 1; j < Hack::density; ++j) {
- Vector up(_vertex(i, j + 1) - _vertex(i, j - 1));
- Vector right(_vertex(i + 1, j) - _vertex(i - 1, j));
- up.normalize();
- right.normalize();
- Vector crossVec(Vector::cross(right, up));
- // Use depth component of normal to compute intensity
- // This way only edges of wisp are bright
- _intensity(i, j) = Common::clamp(
- viscon2 * (viscon1 - std::abs(crossVec.z())),
- 0.0f, 1.0f
- );
- }
-
- // update color
- float h = _HSL.h() + _hueSpeed * Common::elapsedSecs;
- if (h < 0.0f) h += 1.0f;
- if (h > 1.0f) h -= 1.0f;
- float s = _HSL.s() + _saturationSpeed * Common::elapsedSecs;
- if (s <= 0.1f) {
- s = 0.1f;
- _saturationSpeed = -_saturationSpeed;
- }
- if (s >= 1.0f) {
- s = 1.0f;
- _saturationSpeed = -_saturationSpeed;
- }
- _HSL.h() = h;
- _HSL.s() = s;
- _RGB = _HSL;
-}
-
-void Wisp::draw() const {
- glPushMatrix();
-
- if (Hack::wireframe) {
- for (unsigned int i = 1; i < Hack::density; ++i) {
- glBegin(GL_LINE_STRIP);
- for (unsigned int j = 0; j <= Hack::density; ++j) {
- glColor3f(
- _RGB.r() + _intensity(i, j) - 1.0f,
- _RGB.g() + _intensity(i, j) - 1.0f,
- _RGB.b() + _intensity(i, j) - 1.0f
- );
- glTexCoord2d(
- _gridPos(i, j).x() - _vertex(i, j).x(),
- _gridPos(i, j).y() - _vertex(i, j).y()
- );
- glVertex3fv(_vertex(i, j).get());
- }
- glEnd();
- }
- for (unsigned int j = 1; j < Hack::density; ++j) {
- glBegin(GL_LINE_STRIP);
- for (unsigned int i = 0; i <= Hack::density; ++i) {
- glColor3f(
- _RGB.r() + _intensity(i, j) - 1.0f,
- _RGB.g() + _intensity(i, j) - 1.0f,
- _RGB.b() + _intensity(i, j) - 1.0f
- );
- glTexCoord2d(
- _gridPos(i, j).x() - _vertex(i, j).x(),
- _gridPos(i, j).y() - _vertex(i, j).y()
- );
- glVertex3fv(_vertex(i, j).get());
- }
- glEnd();
- }
- } else {
- for (unsigned int i = 0; i < Hack::density; ++i) {
- glBegin(GL_TRIANGLE_STRIP);
- for (unsigned int j = 0; j <= Hack::density; ++j) {
- glColor3f(
- _RGB.r() + _intensity(i + 1, j) - 1.0f,
- _RGB.g() + _intensity(i + 1, j) - 1.0f,
- _RGB.b() + _intensity(i + 1, j) - 1.0f
- );
- glTexCoord2d(
- _gridPos(i + 1, j).x() - _vertex(i + 1, j).x(),
- _gridPos(i + 1, j).y() - _vertex(i + 1, j).y()
- );
- glVertex3fv(_vertex(i + 1, j).get());
- glColor3f(
- _RGB.r() + _intensity(i, j) - 1.0f,
- _RGB.g() + _intensity(i, j) - 1.0f,
- _RGB.b() + _intensity(i, j) - 1.0f
- );
- glTexCoord2d(
- _gridPos(i, j).x() - _vertex(i, j).x(),
- _gridPos(i, j).y() - _vertex(i, j).y()
- );
- glVertex3fv(_vertex(i, j).get());
- }
- glEnd();
- }
- }
-
- glPopMatrix();
-}
-
-void Wisp::drawAsBackground() const {
- glPushMatrix();
- glTranslatef(_c[0] * 0.2f, _c[1] * 0.2f, 1.6f);
-
- if (Hack::wireframe) {
- for (unsigned int i = 1; i < Hack::density; ++i) {
- glBegin(GL_LINE_STRIP);
- for (unsigned int j = 0; j <= Hack::density; ++j) {
- glColor3f(
- _RGB.r() + _intensity(i, j) - 1.0f,
- _RGB.g() + _intensity(i, j) - 1.0f,
- _RGB.b() + _intensity(i, j) - 1.0f
- );
- glTexCoord2d(
- _gridPos(i, j).x() - _vertex(i, j).x(),
- _gridPos(i, j).y() - _vertex(i, j).y()
- );
- glVertex3f(
- _gridPos(i, j).x(),
- _gridPos(i, j).y(),
- _intensity(i, j)
- );
- }
- glEnd();
- }
- for (unsigned int j = 1; j < Hack::density; ++j) {
- glBegin(GL_LINE_STRIP);
- for (unsigned int i = 0; i <= Hack::density; ++i) {
- glColor3f(
- _RGB.r() + _intensity(i, j) - 1.0f,
- _RGB.g() + _intensity(i, j) - 1.0f,
- _RGB.b() + _intensity(i, j) - 1.0f
- );
- glTexCoord2d(
- _gridPos(i, j).x() - _vertex(i, j).x(),
- _gridPos(i, j).y() - _vertex(i, j).y()
- );
- glVertex3f(
- _gridPos(i, j).x(),
- _gridPos(i, j).y(),
- _intensity(i, j)
- );
- }
- glEnd();
- }
- } else {
- for (unsigned int i = 0; i < Hack::density; ++i) {
- glBegin(GL_TRIANGLE_STRIP);
- for (unsigned int j = 0; j <= Hack::density; ++j) {
- glColor3f(
- _RGB.r() + _intensity(i + 1, j) - 1.0f,
- _RGB.g() + _intensity(i + 1, j) - 1.0f,
- _RGB.b() + _intensity(i + 1, j) - 1.0f
- );
- glTexCoord2d(
- _gridPos(i + 1, j).x() - _vertex(i + 1, j).x(),
- _gridPos(i + 1, j).y() - _vertex(i + 1, j).y()
- );
- glVertex3f(
- _gridPos(i + 1, j).x(),
- _gridPos(i + 1, j).y(),
- _intensity(i + 1, j)
- );
- glColor3f(
- _RGB.r() + _intensity(i, j) - 1.0f,
- _RGB.g() + _intensity(i, j) - 1.0f,
- _RGB.b() + _intensity(i, j) - 1.0f
- );
- glTexCoord2d(
- _gridPos(i, j).x() - _vertex(i, j).x(),
- _gridPos(i, j).y() - _vertex(i, j).y()
- );
- glVertex3f(
- _gridPos(i, j).x(),
- _gridPos(i, j).y(),
- _intensity(i, j)
- );
- }
- glEnd();
- }
- }
-
- glPopMatrix();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/euphoria/wisp.hh b/xbmc/screensavers/rsxs-0.9/src/euphoria/wisp.hh
deleted file mode 100644
index 6be394ab35..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/euphoria/wisp.hh
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _WISP_HH
-#define _WISP_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <vector.hh>
-
-#define NUMCONSTS 9
-
-class Wisp {
-private:
- stdx::dim2<Vector> _vertex;
- stdx::dim2<Vector> _gridPos;
- stdx::dim2<float> _intensity;
-
- float _c[NUMCONSTS]; // constants
- float _cr[NUMCONSTS]; // constants' radial position
- float _cv[NUMCONSTS]; // constants' change velocities
- HSLColor _HSL;
- RGBColor _RGB;
- float _hueSpeed;
- float _saturationSpeed;
-public:
- Wisp();
-
- void update();
- void draw() const;
- void drawAsBackground() const;
-};
-
-#endif // _WISP_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/fieldlines/Makefile.am b/xbmc/screensavers/rsxs-0.9/src/fieldlines/Makefile.am
deleted file mode 100644
index e961948ade..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/fieldlines/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-include $(srcdir)/../Makefile.common
-
-rs_fieldlines_SOURCES = $(COMMON) $(COLOR) $(VECTOR) fieldlines.cc \
- fieldlines.hh ion.hh
-rs_fieldlines_LDADD = $(LIBMISC) $(X_LIBS) $(OPENGL_LIBS)
-
-hack_PROGRAMS = rs-fieldlines
diff --git a/xbmc/screensavers/rsxs-0.9/src/fieldlines/fieldlines.cc b/xbmc/screensavers/rsxs-0.9/src/fieldlines/fieldlines.cc
deleted file mode 100644
index 74102be091..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/fieldlines/fieldlines.cc
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <fieldlines.hh>
-#include <hack.hh>
-#include <ion.hh>
-#include <vector.hh>
-
-namespace Hack {
- unsigned int numIons = 4;
- float stepSize = 15.0f;
- unsigned int maxSteps = 100;
- float width = 30.0f;
- float speed = 10.0f;
- bool constWidth = false;
- bool electric = false;
-};
-
-namespace Hack {
- enum Arguments {
- ARG_IONS = 1,
- ARG_SEGSIZE,
- ARG_MAXSEGS,
- ARG_SPEED,
- ARG_WIDTH,
- ARG_CONSTANT = 0x100, ARG_NO_CONSTANT,
- ARG_ELECTRIC = 0x200, ARG_NO_ELECTRIC
- };
-
- std::vector<Ion> _ions;
-
- static void drawFieldLine(const Ion&, float, float, float);
-
- error_t parse(int, char*, struct argp_state*);
-};
-
-static void Hack::drawFieldLine(const Ion& ion, float x, float y, float z) {
- static float brightness = 10000.0f;
-
- int charge = ion.getCharge();
- Vector lastV(ion.getV());
- Vector dir(x, y, z);
-
- // Do the first segment
- RGBColor RGB(
- std::abs(dir.z()) * brightness,
- std::abs(dir.x()) * brightness,
- std::abs(dir.y()) * brightness
- );
- RGB.clamp();
- RGBColor lastRGB(RGB);
- glColor3fv(RGB.get());
-
- Vector V(lastV + dir);
- if (electric)
- V += Vector(
- Common::randomFloat(stepSize * 0.3f) - (stepSize * 0.15f),
- Common::randomFloat(stepSize * 0.3f) - (stepSize * 0.15f),
- Common::randomFloat(stepSize * 0.3f) - (stepSize * 0.15f)
- );
-
- if (!constWidth)
- glLineWidth((V.z() + 300.0f) * 0.000333f * width);
-
- glBegin(GL_LINE_STRIP);
- glColor3fv(lastRGB.get());
- glVertex3fv(lastV.get());
- glColor3fv(RGB.get());
- glVertex3fv(V.get());
-
- Vector end;
- unsigned int i;
- for (i = 0; i < maxSteps; ++i) {
- dir.set(0.0f, 0.0f, 0.0f);
- for (std::vector<Ion>::const_iterator j = _ions.begin(); j != _ions.end(); ++j) {
- int repulsion = charge * j->getCharge();
- Vector temp(V - j->getV());
- float distSquared = temp.lengthSquared();
- float dist = std::sqrt(distSquared);
- if (dist < stepSize && i > 2) {
- end = j->getV();
- i = 10000;
- }
- temp /= dist;
- if (distSquared < 1.0f)
- distSquared = 1.0f;
- dir += temp * (repulsion / distSquared);
- }
-
- lastRGB = RGB;
- RGB.set(
- std::abs(dir.z()) * brightness,
- std::abs(dir.x()) * brightness,
- std::abs(dir.y()) * brightness
- );
- if (electric) {
- RGB *= 10.0f;
- if (RGB.r() > RGB.g() * 0.5f)
- RGB.r() = RGB.g() * 0.5f;
- if (RGB.g() > RGB.b() * 0.3f)
- RGB.g() = RGB.b() * 0.3f;
- }
- RGB.clamp();
-
- float distSquared = dir.lengthSquared();
- float distRec = stepSize / std::sqrt(distSquared);
- dir *= distRec;
- if (electric)
- dir += Vector(
- Common::randomFloat(stepSize) - (stepSize * 0.5f),
- Common::randomFloat(stepSize) - (stepSize * 0.5f),
- Common::randomFloat(stepSize) - (stepSize * 0.5f)
- );
-
- lastV = V;
- V += dir;
-
- if (!constWidth) {
- glEnd();
- float lineWidth = (V.z() + 300.0f) * 0.000333f * width;
- glLineWidth(lineWidth < 0.01f ? 0.01f : lineWidth);
- glBegin(GL_LINE_STRIP);
- }
-
- glColor3fv(lastRGB.get());
- glVertex3fv(lastV.get());
-
- if (i != 10000) {
- if (i == (maxSteps - 1))
- glColor3f(0.0f, 0.0f, 0.0f);
- else
- glColor3fv(RGB.get());
- glVertex3fv(V.get());
- }
- }
-
- if (i == 10001) {
- glColor3fv(RGB.get());
- glVertex3fv(end.get());
- }
-
- glEnd();
-}
-
-error_t Hack::parse(int key, char* arg, struct argp_state* state) {
- switch (key) {
- case ARG_IONS:
- if (Common::parseArg(arg, numIons, 1u, 10u))
- argp_failure(state, EXIT_FAILURE, 0,
- "number of ions must be between 1 and 10");
- return 0;
- case ARG_SEGSIZE:
- if (Common::parseArg(arg, stepSize, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "fieldline segment length must be between 1 and 100");
- return 0;
- case ARG_MAXSEGS:
- if (Common::parseArg(arg, maxSteps, 1u, 1000u))
- argp_failure(state, EXIT_FAILURE, 0,
- "maximum number of fieldline segments must be between 1 and 1000");
- return 0;
- case ARG_SPEED:
- if (Common::parseArg(arg, speed, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "motion speed must be between 1 and 100");
- return 0;
- case ARG_WIDTH:
- if (Common::parseArg(arg, width, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "fieldline width factor must be between 1 and 100");
- return 0;
- case ARG_CONSTANT:
- constWidth = true;
- return 0;
- case ARG_NO_CONSTANT:
- constWidth = false;
- return 0;
- case ARG_ELECTRIC:
- electric = true;
- return 0;
- case ARG_NO_ELECTRIC:
- electric = false;
- return 0;
- default:
- return ARGP_ERR_UNKNOWN;
- }
-}
-
-const struct argp* Hack::getParser() {
- static struct argp_option options[] = {
- { NULL, 0, NULL, 0, "Ion options:" },
- { "ions", ARG_IONS, "NUM", 0, "Number of ions (1-10, default = 4)" },
- { "speed", ARG_SPEED, "NUM", 0, "Motion speed (1-100, default = 10)" },
- { NULL, 0, NULL, 0, "Fieldline options:" },
- { "segsize", ARG_SEGSIZE, "NUM", 0,
- "Length of each fieldline segment (1-100, default = 15)" },
- { "maxsegs", ARG_MAXSEGS, "NUM", 0,
- "Maximum number of segments per fieldline (1-1000, default = 100)" },
- { "width", ARG_WIDTH, "NUM", 0,
- "Fieldline width factor (1-100, default = 30)" },
- { "constant", ARG_CONSTANT, NULL, 0, "Enable constant-width fieldlines" },
- { "no-constant", ARG_NO_CONSTANT, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { "electric", ARG_ELECTRIC, NULL, 0, "Enable electric mode" },
- { "no-electric", ARG_NO_ELECTRIC, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- {}
- };
- static struct argp parser = {
- options, parse, NULL,
- "Simulates field lines between charged particles."
- };
- return &parser;
-}
-
-std::string Hack::getShortName() { return "fieldlines"; }
-std::string Hack::getName() { return "Field Lines"; }
-
-void Hack::start() {
- glViewport(0, 0, Common::width, Common::height);
-
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_LINE_SMOOTH);
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(80.0, Common::aspectRatio, 50, 3000);
- glTranslatef(0.0, 0.0, -(WIDE * 2));
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- if (constWidth)
- glLineWidth(width * 0.1f);
-
- stdx::construct_n(_ions, numIons);
-}
-
-void Hack::tick() {
- static float s = std::sqrt(stepSize * stepSize * 0.333f);
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- stdx::call_all(_ions, &Ion::update);
-
- for (std::vector<Ion>::const_iterator i = _ions.begin(); i != _ions.end(); ++i) {
- drawFieldLine(*i, s, s, s);
- drawFieldLine(*i, s, s, -s);
- drawFieldLine(*i, s, -s, s);
- drawFieldLine(*i, s, -s, -s);
- drawFieldLine(*i, -s, s, s);
- drawFieldLine(*i, -s, s, -s);
- drawFieldLine(*i, -s, -s, s);
- drawFieldLine(*i, -s, -s, -s);
- }
-
-// Common::flush();
-}
-
-void Hack::reshape() {
- glViewport(0, 0, Common::width, Common::height);
-}
-
-void Hack::stop() {}
-
-void Hack::keyPress(char c, const KeySym&) {
- switch (c) {
- case 3: case 27:
- case 'q': case 'Q':
- Common::running = false;
- break;
- }
-}
-
-void Hack::keyRelease(char, const KeySym&) {}
-void Hack::pointerMotion(int, int) {}
-void Hack::buttonPress(unsigned int) {}
-void Hack::buttonRelease(unsigned int) {}
-void Hack::pointerEnter() {}
-void Hack::pointerLeave() {}
-
-#define _LINUX
-#include "../../../addons/include/xbmc_scr_dll.h"
-
-extern "C" {
-
-ADDON_STATUS Create(void* hdl, void* props)
-{
- if (!props)
- return STATUS_UNKNOWN;
-
- SCR_PROPS* scrprops = (SCR_PROPS*)props;
-
- Common::width = scrprops->width;
- Common::height = scrprops->height;
- Common::aspectRatio = float(Common::width) / float(Common::height);
-
- return STATUS_OK;
-}
-
-void Start()
-{
- Hack::start();
-}
-
-void Render()
-{
- Hack::tick();
-}
-
-void Stop()
-{
- Hack::stop();
-}
-
-void Destroy()
-{
-}
-
-ADDON_STATUS GetStatus()
-{
- return STATUS_OK;
-}
-
-bool HasSettings()
-{
- return false;
-}
-
-unsigned int GetSettings(StructSetting ***sSet)
-{
- return 0;
-}
-
-ADDON_STATUS SetSetting(const char *settingName, const void *settingValue)
-{
- return STATUS_OK;
-}
-
-void FreeSettings()
-{
-}
-
-void GetInfo(SCR_INFO *info)
-{
-}
-
-void Remove()
-{
-}
-
-}
-
diff --git a/xbmc/screensavers/rsxs-0.9/src/fieldlines/fieldlines.hh b/xbmc/screensavers/rsxs-0.9/src/fieldlines/fieldlines.hh
deleted file mode 100644
index 95923e80e6..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/fieldlines/fieldlines.hh
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _FIELDLINES_HH
-#define _FIELDLINES_HH
-
-#include <common.hh>
-
-#define WIDE 200
-#define HIGH 150
-
-namespace Hack {
- extern unsigned int numIons;
- extern float stepSize;
- extern unsigned int maxSteps;
- extern float width;
- extern float speed;
- extern bool constWidth;
- extern bool electric;
-};
-
-#endif // _FIELDLINES_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/fieldlines/ion.hh b/xbmc/screensavers/rsxs-0.9/src/fieldlines/ion.hh
deleted file mode 100644
index 875b15afa0..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/fieldlines/ion.hh
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _ION_HH
-#define _ION_HH
-
-#include <common.hh>
-
-#include <fieldlines.hh>
-#include <vector.hh>
-
-class Ion {
-private:
- int _charge;
- Vector _V;
- Vector _vel;
-public:
- Ion() : _charge(Common::randomInt(2) ? 1 : -1), _V(
- Common::randomFloat(2.0f * WIDE) - WIDE,
- Common::randomFloat(2.0f * HIGH) - HIGH,
- Common::randomFloat(2.0f * WIDE) - WIDE
- ), _vel(
- Common::randomFloat(Hack::speed * 0.1f) - (Hack::speed * 0.05f),
- Common::randomFloat(Hack::speed * 0.1f) - (Hack::speed * 0.05f),
- Common::randomFloat(Hack::speed * 0.1f) - (Hack::speed * 0.05f)
- ) {}
-
- int getCharge() const {
- return _charge;
- }
-
- const Vector& getV() const {
- return _V;
- }
-
- void update() {
- _V += _vel;
- if (_V.x() > WIDE)
- _vel.x() = _vel.x() - 0.001f * Hack::speed;
- if (_V.x() < -WIDE)
- _vel.x() = _vel.x() + 0.001f * Hack::speed;
- if (_V.y() > HIGH)
- _vel.y() = _vel.y() - 0.001f * Hack::speed;
- if (_V.y() < -HIGH)
- _vel.y() = _vel.y() + 0.001f * Hack::speed;
- if (_V.z() > WIDE)
- _vel.z() = _vel.z() - 0.001f * Hack::speed;
- if (_V.z() < -WIDE)
- _vel.z() = _vel.z() + 0.001f * Hack::speed;
- }
-};
-
-#endif // _ION_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/flocks/Makefile.am b/xbmc/screensavers/rsxs-0.9/src/flocks/Makefile.am
deleted file mode 100644
index 32cbb22391..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/flocks/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-include $(srcdir)/../Makefile.common
-
-rs_flocks_SOURCES = $(COMMON) $(COLOR) $(VECTOR) bug.cc bug.hh flocks.cc \
- flocks.hh
-rs_flocks_LDADD = $(LIBMISC) $(X_LIBS) $(OPENGL_LIBS)
-
-hack_PROGRAMS = rs-flocks
diff --git a/xbmc/screensavers/rsxs-0.9/src/flocks/bug.cc b/xbmc/screensavers/rsxs-0.9/src/flocks/bug.cc
deleted file mode 100644
index 9a1c29f9c5..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/flocks/bug.cc
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <bug.hh>
-#include <color.hh>
-#include <flocks.hh>
-#include <resource.hh>
-#include <vector.hh>
-
-float Bug::_wide, Bug::_high, Bug::_deep;
-GLuint Bug::_list;
-
-void Bug::init() {
- if (Hack::blobs) {
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- float ambient[4] = { 0.25f, 0.25f, 0.25f, 0.0f };
- float diffuse[4] = { 1.0f, 1.0f, 1.0f, 0.0f };
- float specular[4] = { 1.0f, 1.0f, 1.0f, 0.0f };
- float position[4] = { 500.0f, 500.0f, 500.0f, 0.0f };
- glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
- glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
- glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
- glLightfv(GL_LIGHT0, GL_POSITION, position);
- glEnable(GL_COLOR_MATERIAL);
- glMaterialf(GL_FRONT, GL_SHININESS, 10.0f);
- glColorMaterial(GL_FRONT, GL_SPECULAR);
- glColor3f(0.7f, 0.7f, 0.7f);
- glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
-
- _list = Common::resources->genLists(1);
- glNewList(_list, GL_COMPILE);
- GLUquadricObj* qObj = gluNewQuadric();
- gluSphere(qObj, Hack::size * 0.5f, Hack::complexity + 2,
- Hack::complexity + 1);
- gluDeleteQuadric(qObj);
- glEndList();
- }
-}
-
-void Bug::initBoundaries() {
- if (Common::aspectRatio > 1.0f) {
- _high = _deep = 160.0f;
- _wide = _high * Common::aspectRatio;
- glTranslatef(0.0f, 0.0f, -_wide * 2.0f);
- } else {
- _wide = _deep = 160.0f;
- _high = _wide * Common::aspectRatio;
- glTranslatef(0.0f, 0.0f, -_high * 2.0f);
- }
-}
-
-Bug::Bug(const Vector& XYZ, bool dir, float maxSpeed, float accel) :
- _HSL(Common::randomFloat(1.0f), 1.0f, 1.0f), _XYZ(XYZ), _right(dir),
- _up(dir), _forward(dir), _maxSpeed(maxSpeed), _accel(accel) {}
-
-void Bug::update() {
- _speed.x() = Common::clamp(_speed.x(), -_maxSpeed, _maxSpeed);
- _speed.y() = Common::clamp(_speed.y(), -_maxSpeed, _maxSpeed);
- _speed.z() = Common::clamp(_speed.z(), -_maxSpeed, _maxSpeed);
-
- _XYZ += _speed * Common::elapsedSecs;
-
- RGBColor RGB(_HSL);
- _halfRGB = RGB * 0.5f;
-
- glColor3fv(RGB.get());
- if (Hack::blobs) {
- glPushMatrix();
- glTranslatef(_XYZ.x(), _XYZ.y(), _XYZ.z());
- if (Hack::stretch > 0.0f) {
- float scale = _speed.length() * Hack::stretch * 0.002;
- if (scale < 1.0f) scale = 1.0f;
- Vector rotator(_speed);
- rotator.normalize();
- glRotatef(
- float(std::atan2(-rotator.x(), -rotator.z())) * R2D,
- 0.0f, 1.0f, 0.0f
- );
- glRotatef(
- float(std::asin(rotator.y())) * R2D,
- 1.0f, 0.0f, 0.0f
- );
- glScalef(1.0f, 1.0f, scale);
- }
- glCallList(_list);
- glPopMatrix();
- } else {
- if (Hack::stretch) {
- glLineWidth(Hack::size * float(700 - _XYZ.z()) * 0.0002f);
- Vector scaler(_speed);
- scaler.normalize();
- scaler *= Hack::stretch;
- glBegin(GL_LINES);
- glVertex3fv((_XYZ - scaler).get());
- glVertex3fv((_XYZ + scaler).get());
- glEnd();
- } else {
- glPointSize(Hack::size * float(700 - _XYZ.z()) * 0.001f);
- glBegin(GL_POINTS);
- glVertex3fv(_XYZ.get());
- glEnd();
- }
- }
-}
-
-Leader::Leader() : Bug(
- Vector(
- Common::randomFloat(_wide * 2.0f) - _wide,
- Common::randomFloat(_high * 2.0f) - _high,
- Common::randomFloat(_deep * 2.0f) + _deep * 2.0f
- ), true, 8.0f * Hack::speed, 13.0f * Hack::speed),
- _craziness(Common::randomFloat(4.0f) + 0.05f), _nextChange(1.0f) {}
-
-void Leader::update() {
- _nextChange -= Common::elapsedSecs;
- if (_nextChange <= 0.0f) {
- if (Common::randomInt(2))
- _right = !_right;
- if (Common::randomInt(2))
- _up = !_up;
- if (Common::randomInt(2))
- _forward = !_forward;
- _nextChange = Common::randomFloat(_craziness);
- }
- _speed += Vector(
- _right ? _accel : -_accel,
- _up ? _accel : -_accel,
- _forward ? -_accel : _accel
- ) * Common::elapsedSecs;
- if (_XYZ.x() < -_wide) _right = true;
- if (_XYZ.x() > _wide) _right = false;
- if (_XYZ.y() < -_high) _up = true;
- if (_XYZ.y() > _high) _up = false;
- if (_XYZ.z() < -_deep) _forward = false;
- if (_XYZ.z() > _deep) _forward = true;
- if (Hack::chromatek) {
- float h = Common::clamp(
- 0.666667f * ((_wide - _XYZ.z()) / (2.0f * _wide)),
- 0.0f, 0.666667f
- );
- _HSL.h() = h;
- }
-
- Bug::update();
-}
-
-Follower::Follower(const std::vector<Leader>::const_iterator& leader) : Bug(
- Vector(
- Common::randomFloat(_wide * 2.0f) - _wide,
- Common::randomFloat(_high * 2.0f) - _high,
- Common::randomFloat(_deep * 5.0f) + _deep * 2.5f
- ), false, (Common::randomFloat(6.0f) + 4.0f) * Hack::speed,
- (Common::randomFloat(4.0f) + 9.0f) * Hack::speed),
- _leader(leader) {}
-
-void Follower::update(const std::vector<Leader>& leaders) {
- if (!Common::randomInt(10)) {
- float oldDistance = 10000000.0f;
- for (
- std::vector<Leader>::const_iterator l = leaders.begin();
- l != leaders.end();
- ++l
- ) {
- float newDistance = (l->_XYZ - _XYZ).lengthSquared();
- if (newDistance < oldDistance) {
- oldDistance = newDistance;
- _leader = l;
- }
- }
- }
- _speed += Vector(
- (_leader->_XYZ.x() - _XYZ.x()) > 0.0f ?
- _accel : -_accel,
- (_leader->_XYZ.y() - _XYZ.y()) > 0.0f ?
- _accel : -_accel,
- (_leader->_XYZ.z() - _XYZ.z()) > 0.0f ?
- _accel : -_accel
- ) * Common::elapsedSecs;
- if (Hack::chromatek) {
- _HSL.h() = Common::clamp(
- 0.666667f * ((_wide - _XYZ.z()) / (2.0f * _wide)),
- 0.0f, 0.666667f
- );
- } else {
- float h = _HSL.h();
- float leaderH = _leader->_HSL.h();
- if (std::abs(h - leaderH) < (Hack::colorFadeSpeed * Common::elapsedSecs)) {
- _HSL.h() = leaderH;
- } else {
- if (std::abs(h - leaderH) < 0.5f) {
- if (h > leaderH)
- h -= Hack::colorFadeSpeed * Common::elapsedSecs;
- else
- h += Hack::colorFadeSpeed * Common::elapsedSecs;
- } else {
- if (h > leaderH)
- h += Hack::colorFadeSpeed * Common::elapsedSecs;
- else
- h -= Hack::colorFadeSpeed * Common::elapsedSecs;
- if (h > 1.0f) h -= 1.0f;
- if (h < 0.0f) h += 1.0f;
- }
- _HSL.h() = h;
- }
- }
-
- Bug::update();
-
- if (Hack::connections) {
- glLineWidth(1.0f);
- glBegin(GL_LINES);
- glColor3fv(_halfRGB.get());
- glVertex3fv(_XYZ.get());
- glColor3fv(_leader->_halfRGB.get());
- glVertex3fv(_leader->_XYZ.get());
- glEnd();
- }
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/flocks/bug.hh b/xbmc/screensavers/rsxs-0.9/src/flocks/bug.hh
deleted file mode 100644
index fb0fe7f90c..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/flocks/bug.hh
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _BUG_HH
-#define _BUG_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <vector.hh>
-
-class Bug {
-protected:
- static float _wide, _high, _deep;
- static GLuint _list;
-
- HSLColor _HSL;
- RGBColor _halfRGB;
- Vector _XYZ;
- Vector _speed;
- bool _right, _up, _forward;
- float _maxSpeed;
- float _accel;
-
- void update();
- Bug(const Vector&, bool, float, float);
-public:
- static void init();
- static void fini();
- static void initBoundaries();
-};
-
-class Follower;
-
-class Leader : public Bug {
-private:
- float _craziness; // How prone to switching direction is this leader
- float _nextChange; // Time until this leader's next direction change
-
- friend class Follower;
-public:
- Leader();
- void update();
-};
-
-class Follower : public Bug {
-private:
- std::vector<Leader>::const_iterator _leader;
-public:
- Follower(const std::vector<Leader>::const_iterator&);
- void update(const std::vector<Leader>&);
-};
-
-#endif // _BUG_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/flocks/flocks.cc b/xbmc/screensavers/rsxs-0.9/src/flocks/flocks.cc
deleted file mode 100644
index 9db8856b8f..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/flocks/flocks.cc
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <bug.hh>
-#include <color.hh>
-#include <flocks.hh>
-#include <hack.hh>
-#include <vector.hh>
-
-namespace Hack {
- unsigned int numLeaders = 4;
- unsigned int numFollowers = 400;
- bool blobs = true;
- float size = 10.0f;
- unsigned int complexity = 1;
- float speed = 15.0f;
- float stretch = 20.0f;
- float colorFadeSpeed = 15.0f;
- bool chromatek = false;
- bool connections = false;
-};
-
-namespace Hack {
- enum Arguments {
- ARG_LEADERS = 1,
- ARG_FOLLOWERS,
- ARG_SIZE,
- ARG_STRETCH,
- ARG_SPEED,
- ARG_COMPLEXITY,
- ARG_COLORSPEED,
- ARG_CHROMATEK = 0x100, ARG_NO_CHROMATEK,
- ARG_CONNECTIONS = 0x200, ARG_NO_CONNECTIONS
- };
-
- std::vector<Leader> _leaders;
- std::vector<Follower> _followers;
-
- error_t parse(int, char*, struct argp_state*);
-};
-
-error_t Hack::parse(int key, char* arg, struct argp_state* state) {
- switch (key) {
- case ARG_LEADERS:
- if (Common::parseArg(arg, numLeaders, 1u, 100u))
- argp_failure(state, EXIT_FAILURE, 0,
- "number of leaders must be between 1 and 100");
- return 0;
- case ARG_FOLLOWERS:
- if (Common::parseArg(arg, numFollowers, 0u, 10000u))
- argp_failure(state, EXIT_FAILURE, 0,
- "number of followers must be between 0 and 10000");
- return 0;
- case ARG_SIZE:
- if (Common::parseArg(arg, size, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "bug size must be between 1 and 100");
- return 0;
- case ARG_STRETCH:
- if (Common::parseArg(arg, stretch, 0.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "bug stretchability must be between 0 and 100");
- return 0;
- case ARG_SPEED:
- if (Common::parseArg(arg, speed, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "bug speed must be between 1 and 100");
- return 0;
- case ARG_COMPLEXITY:
- if (Common::parseArg(arg, complexity, 0u, 10u))
- argp_failure(state, EXIT_FAILURE, 0,
- "camera speed must be between 0 and 10");
- blobs = complexity != 0;
- return 0;
- case ARG_COLORSPEED:
- if (Common::parseArg(arg, colorFadeSpeed, 0.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "color fade speed must be between 0 and 100");
- return 0;
- case ARG_CHROMATEK:
- chromatek = true;
- return 0;
- case ARG_NO_CHROMATEK:
- chromatek = false;
- return 0;
- case ARG_CONNECTIONS:
- connections = true;
- return 0;
- case ARG_NO_CONNECTIONS:
- connections = false;
- return 0;
- default:
- return ARGP_ERR_UNKNOWN;
- }
-}
-
-const struct argp* Hack::getParser() {
- static struct argp_option options[] = {
- { NULL, 0, NULL, 0, "Flock options:" },
- { "leaders", ARG_LEADERS, "NUM", 0,
- "Number of leaders (1-100, default = 4)" },
- { "followers", ARG_FOLLOWERS, "NUM", 0,
- "Number of followers (0-10000, default = 400)" },
- { NULL, 0, NULL, 0, "Bug options:" },
- { "size", ARG_SIZE, "NUM", 0, "Bug size (1-100, default = 10)" },
- { "stretch", ARG_STRETCH, "NUM", 0,
- "Bug stretchability (0-100, default = 20)" },
- { "speed", ARG_SPEED, "NUM", 0, "Bug speed (1-100, default = 15)" },
- { "complexity", ARG_COMPLEXITY, "NUM", 0,
- "Bug complexity (1-10, 0 for lines, default = 1)" },
- { "colorspeed", ARG_COLORSPEED, "NUM", 0,
- "Color fade speed (0-100, default = 15)" },
- { NULL, 0, NULL, 0, "Other options:" },
- { "chromadepth", ARG_CHROMATEK, NULL, 0, "Enable ChromaDepth mode" },
- { "no-chromadepth", ARG_NO_CHROMATEK, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { "connections", ARG_CONNECTIONS, NULL, 0, "Draw connection lines" },
- { "no-connections", ARG_NO_CONNECTIONS, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- {}
- };
- static struct argp parser =
- { options, parse, NULL, "Draws 3D swarms of little bugs." };
- return &parser;
-}
-
-std::string Hack::getShortName() { return "flocks"; }
-std::string Hack::getName() { return "Flocks"; }
-
-void Hack::start() {
- glEnable(GL_DEPTH_TEST);
- glFrontFace(GL_CCW);
- glEnable(GL_CULL_FACE);
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
- glEnable(GL_LINE_SMOOTH);
- glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
-
- glViewport(0, 0, Common::width, Common::height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(80.0, Common::aspectRatio, 50, 2000);
-
- Bug::initBoundaries();
-
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- Bug::init();
-
- stdx::construct_n(_leaders, numLeaders);
- stdx::construct_n(_followers, numFollowers, _leaders.begin());
-
- colorFadeSpeed *= 0.01f;
-}
-
-void Hack::tick() {
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- stdx::call_all(_leaders, &Leader::update);
- stdx::call_all(_followers, &Follower::update, _leaders);
-
- Common::flush();
-}
-
-void Hack::reshape() {
- glViewport(0, 0, Common::width, Common::height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(80.0, Common::aspectRatio, 50, 2000);
-
- Bug::initBoundaries();
-
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-}
-
-void Hack::stop() {}
-
-void Hack::keyPress(char c, const KeySym&) {
- switch (c) {
- case 3: case 27:
- case 'q': case 'Q':
- Common::running = false;
- break;
- }
-}
-
-void Hack::keyRelease(char, const KeySym&) {}
-void Hack::pointerMotion(int, int) {}
-void Hack::buttonPress(unsigned int) {}
-void Hack::buttonRelease(unsigned int) {}
-void Hack::pointerEnter() {}
-void Hack::pointerLeave() {}
-
-#define _LINUX
-#include "../../../addons/include/xbmc_scr_dll.h"
-
-extern "C" {
-
-ADDON_STATUS Create(void* hdl, void* props)
-{
- if (!props)
- return STATUS_UNKNOWN;
-
- SCR_PROPS* scrprops = (SCR_PROPS*)props;
-
- Common::width = scrprops->width;
- Common::height = scrprops->height;
- Common::aspectRatio = float(Common::width) / float(Common::height);
-
- return STATUS_OK;
-}
-
-void Start()
-{
- Hack::start();
-}
-
-void Render()
-{
- Hack::tick();
-}
-
-void Stop()
-{
- Hack::stop();
-}
-
-void Destroy()
-{
-}
-
-ADDON_STATUS GetStatus()
-{
- return STATUS_OK;
-}
-
-bool HasSettings()
-{
- return false;
-}
-
-unsigned int GetSettings(StructSetting ***sSet)
-{
- return 0;
-}
-
-ADDON_STATUS SetSetting(const char *settingName, const void *settingValue)
-{
- return STATUS_OK;
-}
-
-void FreeSettings()
-{
-}
-
-void GetInfo(SCR_INFO *info)
-{
-}
-
-void Remove()
-{
-}
-
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/flocks/flocks.hh b/xbmc/screensavers/rsxs-0.9/src/flocks/flocks.hh
deleted file mode 100644
index 7baccca9ba..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/flocks/flocks.hh
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _FLOCKS_HH
-#define _FLOCKS_HH
-
-#include <common.hh>
-
-namespace Hack {
- extern unsigned int numLeaders;
- extern unsigned int numFollowers;
- extern bool blobs;
- extern float size;
- extern unsigned int complexity;
- extern float speed;
- extern float stretch;
- extern float colorFadeSpeed;
- extern bool chromatek;
- extern bool connections;
-};
-
-#endif // _FLOCKS_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/flux/Makefile.am b/xbmc/screensavers/rsxs-0.9/src/flux/Makefile.am
deleted file mode 100644
index 6796ba11b0..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/flux/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-include $(srcdir)/../Makefile.common
-
-rs_flux_SOURCES = $(COMMON) $(COLOR) $(VECTOR) flux.cc flux.hh trail.cc trail.hh
-rs_flux_LDADD = $(LIBMISC) $(X_LIBS) $(OPENGL_LIBS)
-
-hack_PROGRAMS = rs-flux
diff --git a/xbmc/screensavers/rsxs-0.9/src/flux/flux.cc b/xbmc/screensavers/rsxs-0.9/src/flux/flux.cc
deleted file mode 100644
index 268cc08e71..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/flux/flux.cc
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <flux.hh>
-#include <hack.hh>
-#include <trail.hh>
-#include <vector.hh>
-
-namespace Hack {
- unsigned int numFluxes = 1;
- unsigned int numTrails = 20;
- unsigned int trailLength = 40;
- GeometryType geometry = LIGHTS_GEOMETRY;
- float size = 15.0f;
- unsigned int complexity = 3;
- unsigned int randomize = 0;
- float expansion = 40.0f;
- float rotation = 30.0f;
- float wind = 20.0f;
- float instability = 20.0f;
- float blur = 0.0f;
-};
-
-namespace Hack {
- enum Arguments {
- ARG_FLUXES = 1,
- ARG_TRAILS,
- ARG_LENGTH,
- ARG_SIZE,
- ARG_COMPLEXITY,
- ARG_SPEED,
- ARG_RANDOMIZATION,
- ARG_ROTATION,
- ARG_CROSSWIND,
- ARG_INSTABILITY,
- ARG_BLUR,
- ARG_POINTS_GEOMETRY = 0x100, ARG_SPHERES_GEOMETRY, ARG_LIGHTS_GEOMETRY
- };
-
- std::vector<Flux> _fluxes;
-
- error_t parse(int, char*, struct argp_state*);
-};
-
-Flux::Flux() {
- stdx::construct_n(_trails, Hack::numTrails);
- _randomize = 1;
-
- for (unsigned int i = 0; i < NUMCONSTS; ++i) {
- _c[i] = Common::randomFloat(2.0f) - 1.0f;
- _cv[i] = Common::randomFloat(0.000005f *
- Hack::instability * Hack::instability) +
- 0.000001f * Hack::instability * Hack::instability;
- }
-
- _oldDistance = 0.0f;
-}
-
-void Flux::update(float cosCameraAngle, float sinCameraAngle) {
- // randomize constants
- if (Hack::randomize) {
- if (!--_randomize) {
- for (unsigned int i = 0; i < NUMCONSTS; ++i)
- _c[i] = Common::randomFloat(2.0f) - 1.0f;
- unsigned int temp = 101 - Hack::randomize;
- temp = temp * temp;
- _randomize = temp + Common::randomInt(temp);
- }
- }
-
- // update constants
- for (unsigned int i = 0; i < NUMCONSTS; ++i) {
- _c[i] += _cv[i];
- if (_c[i] >= 1.0f) {
- _c[i] = 1.0f;
- _cv[i] = -_cv[i];
- }
- if (_c[i] <= -1.0f) {
- _c[i] = -1.0f;
- _cv[i] = -_cv[i];
- }
- }
-
- // update all particles in this flux field
- std::vector<Trail>::iterator j = _trails.end();
- for (std::vector<Trail>::iterator i = _trails.begin(); i != j; ++i)
- i->update(_c, cosCameraAngle, sinCameraAngle);
-}
-
-error_t Hack::parse(int key, char* arg, struct argp_state* state) {
- switch (key) {
- case ARG_FLUXES:
- if (Common::parseArg(arg, numFluxes, 1u, 100u))
- argp_failure(state, EXIT_FAILURE, 0,
- "number of flux fields must be between 1 and 100");
- return 0;
- case ARG_TRAILS:
- if (Common::parseArg(arg, numTrails, 1u, 1000u))
- argp_failure(state, EXIT_FAILURE, 0,
- "particles per flux field must be between 1 and 1000");
- return 0;
- case ARG_LENGTH:
- if (Common::parseArg(arg, trailLength, 3u, 10000u))
- argp_failure(state, EXIT_FAILURE, 0,
- "particle trail length must be between 3 and 10000");
- return 0;
- case ARG_SIZE:
- if (Common::parseArg(arg, size, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "particle size must be between 1 and 100");
- return 0;
- case ARG_POINTS_GEOMETRY:
- geometry = POINTS_GEOMETRY;
- return 0;
- case ARG_SPHERES_GEOMETRY:
- geometry = SPHERES_GEOMETRY;
- return 0;
- case ARG_LIGHTS_GEOMETRY:
- geometry = LIGHTS_GEOMETRY;
- return 0;
- case ARG_COMPLEXITY:
- if (Common::parseArg(arg, complexity, 1u, 10u))
- argp_failure(state, EXIT_FAILURE, 0,
- "sphere complexity must be between 1 and 10");
- return 0;
- case ARG_SPEED:
- if (Common::parseArg(arg, expansion, 0.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "expansion rate must be between 0 and 100");
- return 0;
- case ARG_RANDOMIZATION:
- if (Common::parseArg(arg, randomize, 0u, 100u))
- argp_failure(state, EXIT_FAILURE, 0,
- "randomization frequency must be between 0 and 100");
- return 0;
- case ARG_ROTATION:
- if (Common::parseArg(arg, rotation, 0.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "rotation rate must be between 0 and 100");
- return 0;
- case ARG_CROSSWIND:
- if (Common::parseArg(arg, wind, 0.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "crosswind speed must be between 0 and 100");
- return 0;
- case ARG_INSTABILITY:
- if (Common::parseArg(arg, instability, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "instability must be between 1 and 100");
- return 0;
- case ARG_BLUR:
- if (Common::parseArg(arg, blur, 0.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "motion blur must be between 0 and 100");
- return 0;
- default:
- return ARGP_ERR_UNKNOWN;
- }
-}
-
-const struct argp* Hack::getParser() {
- static struct argp_option options[] = {
- { NULL, 0, NULL, 0, "Flux options:" },
- { "fluxes", ARG_FLUXES, "NUM", 0,
- "Number of flux fields (1-100, default = 1)" },
- { "particles", ARG_TRAILS, "NUM", 0,
- "Particles per flux field (1-1000, default = 20)" },
- { NULL, 0, NULL, 0, "Particle options:" },
- { "length", ARG_LENGTH, "NUM", 0,
- "Particle trail length (3-10000, default = 40)" },
- { "size", ARG_SIZE, "NUM", 0, "Particle size (1-100, default = 15)" },
- { NULL, 0, NULL, 0, "Geometry options:" },
- { "points", ARG_POINTS_GEOMETRY, NULL, 0,
- "Particle geometry (default = lights)" },
- { "spheres", ARG_SPHERES_GEOMETRY, NULL, OPTION_ALIAS },
- { "lights", ARG_LIGHTS_GEOMETRY, NULL, OPTION_ALIAS },
- { "complexity", ARG_COMPLEXITY, "NUM", 0,
- "Sphere complexity (1-10, default = 3)" },
- { NULL, 0, NULL, 0, "Other options:" },
- { "speed", ARG_SPEED, "NUM", 0, "Expansion rate (0-100, default = 40)" },
- { "randomness", ARG_RANDOMIZATION, "NUM", 0,
- "Randomization frequency (0-100, default = 0)" },
- { "rotation", ARG_ROTATION, "NUM", 0, "Rotation rate (0-100, default = 30)" },
- { "wind", ARG_CROSSWIND, "NUM", 0,
- "Crosswind speed (0-100, default = 20)" },
- { "instability", ARG_INSTABILITY, "NUM", 0,
- "Instability (1-100, default = 20)" },
- { "blur", ARG_BLUR, "NUM", 0, "Motion blur (0-100, default = 0)" },
- {}
- };
- static struct argp parser = {
- options, parse, NULL,
- "Draws a particle system based on strange attractor equations."
- };
- return &parser;
-}
-
-std::string Hack::getShortName() { return "flux"; }
-std::string Hack::getName() { return "Flux"; }
-
-void Hack::start() {
- glViewport(0, 0, Common::width, Common::height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(100.0, Common::aspectRatio, 0.01, 200);
- glTranslatef(0.0, 0.0, -2.5);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- if (geometry == POINTS_GEOMETRY)
- glEnable(GL_POINT_SMOOTH);
-
- glFrontFace(GL_CCW);
- glEnable(GL_CULL_FACE);
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- Trail::init();
-
- // Initialize flux fields
- stdx::construct_n(_fluxes, numFluxes);
-}
-
-void Hack::tick() {
- // clear the screen
- glLoadIdentity();
- if (blur) { // partially
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
- glDisable(GL_DEPTH_TEST);
- glColor4f(0.0f, 0.0f, 0.0f, 0.5f -
- float(std::sqrt(std::sqrt(blur))) * 0.15495f);
- glBegin(GL_TRIANGLE_STRIP);
- glVertex3f(-5.0f, -4.0f, 0.0f);
- glVertex3f(5.0f, -4.0f, 0.0f);
- glVertex3f(-5.0f, 4.0f, 0.0f);
- glVertex3f(5.0f, 4.0f, 0.0f);
- glEnd();
- } else // completely
- glClear(GL_COLOR_BUFFER_BIT);
-
- static float cameraAngle = 0.0f;
-
- cameraAngle += 0.01f * rotation;
- if (cameraAngle >= 360.0f)
- cameraAngle -= 360.0f;
-
- float cosCameraAngle = 0.0f, sinCameraAngle = 0.0f;
- // set up blend modes for rendering particles
- switch (geometry) {
- case POINTS_GEOMETRY:
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
- glEnable(GL_BLEND);
- glEnable(GL_POINT_SMOOTH);
- glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
- cosCameraAngle = std::cos(cameraAngle * D2R);
- sinCameraAngle = std::sin(cameraAngle * D2R);
- break;
- case SPHERES_GEOMETRY:
- glRotatef(cameraAngle, 0.0f, 1.0f, 0.0f);
- glDisable(GL_BLEND);
- glEnable(GL_DEPTH_TEST);
- glClear(GL_DEPTH_BUFFER_BIT);
- break;
- case LIGHTS_GEOMETRY:
- glBlendFunc(GL_ONE, GL_ONE);
- glEnable(GL_BLEND);
- cosCameraAngle = std::cos(cameraAngle * D2R);
- sinCameraAngle = std::sin(cameraAngle * D2R);
- break;
- }
-
- // Update particles
- std::vector<Flux>::iterator j = _fluxes.end();
- for (std::vector<Flux>::iterator i = _fluxes.begin(); i != j; ++i)
- i->update(cosCameraAngle, sinCameraAngle);
-
- Common::flush();
-}
-
-void Hack::reshape() {
- glViewport(0, 0, Common::width, Common::height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(100.0, Common::aspectRatio, 0.01, 200);
- glTranslatef(0.0, 0.0, -2.5);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-}
-
-void Hack::stop() {}
-
-void Hack::keyPress(char c, const KeySym&) {
- switch (c) {
- case 3: case 27:
- case 'q': case 'Q':
- Common::running = false;
- break;
- }
-}
-
-void Hack::keyRelease(char, const KeySym&) {}
-void Hack::pointerMotion(int, int) {}
-void Hack::buttonPress(unsigned int) {}
-void Hack::buttonRelease(unsigned int) {}
-void Hack::pointerEnter() {}
-void Hack::pointerLeave() {}
-
-#define _LINUX
-#include "../../../addons/include/xbmc_scr_dll.h"
-
-extern "C" {
-
-ADDON_STATUS Create(void* hdl, void* props)
-{
- if (!props)
- return STATUS_UNKNOWN;
-
- SCR_PROPS* scrprops = (SCR_PROPS*)props;
-
- Common::width = scrprops->width;
- Common::height = scrprops->height;
- Common::aspectRatio = float(Common::width) / float(Common::height);
-
- return STATUS_OK;
-}
-
-void Start()
-{
- Hack::start();
-}
-
-void Render()
-{
- Hack::tick();
-}
-
-void Stop()
-{
- Hack::stop();
-}
-
-void Destroy()
-{
-}
-
-ADDON_STATUS GetStatus()
-{
- return STATUS_OK;
-}
-
-bool HasSettings()
-{
- return false;
-}
-
-unsigned int GetSettings(StructSetting ***sSet)
-{
- return 0;
-}
-
-ADDON_STATUS SetSetting(const char *settingName, const void *settingValue)
-{
- return STATUS_OK;
-}
-
-void FreeSettings()
-{
-}
-
-void GetInfo(SCR_INFO *info)
-{
-}
-
-void Remove()
-{
-}
-
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/flux/flux.hh b/xbmc/screensavers/rsxs-0.9/src/flux/flux.hh
deleted file mode 100644
index a9f1099e51..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/flux/flux.hh
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _FLUX_HH
-#define _FLUX_HH
-
-#include <common.hh>
-
-#define NUMCONSTS 8
-
-namespace Hack {
- enum GeometryType {
- POINTS_GEOMETRY,
- SPHERES_GEOMETRY,
- LIGHTS_GEOMETRY
- };
-
- extern unsigned int numFluxes;
- extern unsigned int numTrails;
- extern unsigned int trailLength;
- extern GeometryType geometry;
- extern float size;
- extern unsigned int complexity;
- extern unsigned int randomize;
- extern float expansion;
- extern float rotation;
- extern float wind;
- extern float instability;
- extern float blur;
-};
-
-class Trail;
-
-class Flux {
-private:
- std::vector<Trail> _trails;
- unsigned int _randomize;
- float _c[NUMCONSTS]; // constants
- float _cv[NUMCONSTS]; // constants' change velocities
- float _oldDistance;
-public:
- Flux();
-
- void update(float, float);
-};
-
-#endif // _FLUX_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/flux/trail.cc b/xbmc/screensavers/rsxs-0.9/src/flux/trail.cc
deleted file mode 100644
index ca18445c94..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/flux/trail.cc
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <flux.hh>
-#include <resource.hh>
-#include <trail.hh>
-
-#define LIGHTSIZE 64
-
-GLuint Trail::_list;
-GLuint Trail::_lightTexture;
-
-void Trail::init() {
- switch (Hack::geometry) {
- case Hack::SPHERES_GEOMETRY:
- {
- _list = Common::resources->genLists(1);
- glNewList(_list, GL_COMPILE);
- GLUquadricObj* qObj = gluNewQuadric();
- gluSphere(qObj, 0.005f * Hack::size, Hack::complexity + 2,
- Hack::complexity + 1);
- gluDeleteQuadric(qObj);
- glEndList();
-
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- float ambient[4] = {0.0f, 0.0f, 0.0f, 0.0f};
- float diffuse[4] = {1.0f, 1.0f, 1.0f, 0.0f};
- float specular[4] = {1.0f, 1.0f, 1.0f, 0.0f};
- float position[4] = {500.0f, 500.0f, 500.0f, 0.0f};
- glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
- glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
- glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
- glLightfv(GL_LIGHT0, GL_POSITION, position);
- glEnable(GL_COLOR_MATERIAL);
- glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
- }
- break;
- case Hack::LIGHTS_GEOMETRY:
- {
- GLubyte light[LIGHTSIZE][LIGHTSIZE];
- for (int i = 0; i < LIGHTSIZE; ++i) {
- for (int j = 0; j < LIGHTSIZE; ++j) {
- float x = float(i - LIGHTSIZE / 2) / float(LIGHTSIZE / 2);
- float y = float(j - LIGHTSIZE / 2) / float(LIGHTSIZE / 2);
- float temp = Common::clamp(
- 1.0f - float(std::sqrt((x * x) + (y * y))),
- 0.0f, 1.0f
- );
- light[i][j] = GLubyte(255.0f * temp * temp);
- }
- }
- _lightTexture = Common::resources->genTexture(
- GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- 1, LIGHTSIZE, LIGHTSIZE,
- GL_LUMINANCE, GL_UNSIGNED_BYTE, light, false
- );
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glEnable(GL_TEXTURE_2D);
-
- float temp = Hack::size * 0.005f;
- _list = Common::resources->genLists(1);
- glNewList(_list, GL_COMPILE);
- glBindTexture(GL_TEXTURE_2D, _lightTexture);
- glBegin(GL_TRIANGLES);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-temp, -temp, 0.0f);
- glTexCoord2f(1.0f, 0.0f);
- glVertex3f(temp, -temp, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(temp, temp, 0.0f);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-temp, -temp, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(temp, temp, 0.0f);
- glTexCoord2f(0.0f, 1.0f);
- glVertex3f(-temp, temp, 0.0f);
- glEnd();
- glEndList();
- }
- break;
- default:
- break;
- }
-}
-
-void Trail::update(const float* c, float cosCameraAngle, float sinCameraAngle) {
- unsigned int oldCounter = _counter;
-
- ++_counter;
- if (_counter >= Hack::trailLength)
- _counter = 0;
-
- // Here's the iterative math for calculating new vertex positions
- // first calculate limiting terms which keep vertices from constantly
- // flying off to infinity
- float cx = _vertices[oldCounter].x() *
- (1.0f - 1.0f / (_vertices[oldCounter].x() *
- _vertices[oldCounter].x() + 1.0f));
- float cy = _vertices[oldCounter].y() *
- (1.0f - 1.0f / (_vertices[oldCounter].y() *
- _vertices[oldCounter].y() + 1.0f));
- float cz = _vertices[oldCounter].z() *
- (1.0f - 1.0f / (_vertices[oldCounter].z() *
- _vertices[oldCounter].z() + 1.0f));
- // then calculate new positions
- _vertices[_counter].set(
- _vertices[oldCounter].x() + c[6] * _offset.x() - cx
- + c[2] * _vertices[oldCounter].y()
- + c[5] * _vertices[oldCounter].z(),
- _vertices[oldCounter].y() + c[6] * _offset.y() - cy
- + c[1] * _vertices[oldCounter].z()
- + c[4] * _vertices[oldCounter].x(),
- _vertices[oldCounter].z() + c[6] * _offset.z() - cz
- + c[0] * _vertices[oldCounter].x()
- + c[3] * _vertices[oldCounter].y()
- );
-
- // Pick a hue
- _hues[_counter] = cx * cx + cy * cy + cz * cz;
- if (_hues[_counter] > 1.0f) _hues[_counter] = 1.0f;
- _hues[_counter] += c[7];
- // Limit the hue (0 - 1)
- if (_hues[_counter] > 1.0f) _hues[_counter] -= 1.0f;
- if (_hues[_counter] < 0.0f) _hues[_counter] += 1.0f;
- // Pick a saturation
- _sats[_counter] = c[0] + _hues[_counter];
- // Limit the saturation (0 - 1)
- if (_sats[_counter] < 0.0f) _sats[_counter] = -_sats[_counter];
- _sats[_counter] -= float(int(_sats[_counter]));
- _sats[_counter] = 1.0f - (_sats[_counter] * _sats[_counter]);
-
- // Bring particles back if they escape
- if (!_counter) {
- if (
- (_vertices[0].x() > 10000.0f) ||
- (_vertices[0].x() < -10000.0f) ||
- (_vertices[0].y() > 10000.0f) ||
- (_vertices[0].y() < -10000.0f) ||
- (_vertices[2].z() > 10000.0f) ||
- (_vertices[0].z() < -10000.0f)
- ) {
- _vertices[0].set(
- Common::randomFloat(2.0f) - 1.0f,
- Common::randomFloat(2.0f) - 1.0f,
- Common::randomFloat(2.0f) - 1.0f
- );
- }
- }
-
- // Draw every vertex in particle trail
- unsigned int p = _counter;
- unsigned int growth = 0;
- static float lumDiff = 1.0f / float(Hack::trailLength);
- float luminosity = lumDiff;
- for (unsigned int i = 0; i < Hack::trailLength; ++i) {
- ++p;
- if (p >= Hack::trailLength) p = 0;
- ++growth;
-
- // assign color to particle
- glColor3fv(RGBColor(HSLColor(_hues[p], _sats[p], luminosity)).get());
-
- float depth = 0.0f;
- glPushMatrix();
- if (Hack::geometry == Hack::SPHERES_GEOMETRY)
- glTranslatef(
- _vertices[p].x(),
- _vertices[p].y(),
- _vertices[p].z()
- );
- else { // Points or lights
- depth =
- cosCameraAngle * _vertices[p].z() -
- sinCameraAngle * _vertices[p].x();
- glTranslatef(
- cosCameraAngle * _vertices[p].x() +
- sinCameraAngle * _vertices[p].z(),
- _vertices[p].y(),
- depth
- );
- }
- if (Hack::geometry != Hack::POINTS_GEOMETRY) {
- switch (Hack::trailLength - growth) {
- case 0:
- glScalef(0.259f, 0.259f, 0.259f);
- break;
- case 1:
- glScalef(0.5f, 0.5f, 0.5f);
- break;
- case 2:
- glScalef(0.707f, 0.707f, 0.707f);
- break;
- case 3:
- glScalef(0.866f, 0.866f, 0.866f);
- break;
- case 4:
- glScalef(0.966f, 0.966f, 0.966f);
- break;
- }
- }
- switch (Hack::geometry) {
- case Hack::POINTS_GEOMETRY:
- switch (Hack::trailLength - growth) {
- case 0:
- glPointSize(float(Hack::size * (depth + 200.0f) * 0.001036f));
- break;
- case 1:
- glPointSize(float(Hack::size * (depth + 200.0f) * 0.002f));
- break;
- case 2:
- glPointSize(float(Hack::size * (depth + 200.0f) * 0.002828f));
- break;
- case 3:
- glPointSize(float(Hack::size * (depth + 200.0f) * 0.003464f));
- break;
- case 4:
- glPointSize(float(Hack::size * (depth + 200.0f) * 0.003864f));
- break;
- default:
- glPointSize(float(Hack::size * (depth + 200.0f) * 0.004f));
- break;
- }
- glBegin(GL_POINTS);
- glVertex3f(0.0f, 0.0f, 0.0f);
- glEnd();
- break;
- case Hack::SPHERES_GEOMETRY:
- case Hack::LIGHTS_GEOMETRY:
- glCallList(_list);
- }
- glPopMatrix();
-
- static float expander = 1.0f + 0.0005f * Hack::expansion;
- static float blower = 0.001f * Hack::wind;
-
- _vertices[p] *= expander;
- _vertices[p].z() += blower;
- luminosity += lumDiff;
- }
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/flux/trail.hh b/xbmc/screensavers/rsxs-0.9/src/flux/trail.hh
deleted file mode 100644
index 0c8108f9f5..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/flux/trail.hh
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _TRAIL_HH
-#define _TRAIL_HH
-
-#include <common.hh>
-#include <flux.hh>
-#include <vector.hh>
-
-class Trail {
-private:
- static GLuint _list;
- static GLuint _lightTexture;
-
- std::vector<Vector> _vertices;
- std::vector<float> _hues;
- std::vector<float> _sats;
- unsigned int _counter;
- Vector _offset;
-public:
- static void init();
-
- Trail() {
- static unsigned int whichTrail = 0;
-
- // Offsets are somewhat like default positions for the head of each
- // particle trail. Offsets spread out the particle trails and keep
- // them from all overlapping.
- _offset.set(
- std::cos(M_PI * 2.0f * float(whichTrail) / float(Hack::numTrails)),
- float(whichTrail) / float(Hack::numTrails) - 0.5f,
- std::sin(M_PI * 2.0f * float(whichTrail) / float(Hack::numTrails))
- );
- ++whichTrail;
-
- // Initialize memory and set initial positions out of view of the
- // camera
- _vertices.resize(Hack::trailLength, Vector(0.0f, 3.0f, 0.0f));
- _hues.resize(Hack::trailLength);
- _sats.resize(Hack::trailLength);
-
- _counter = 0;
- }
-
- void update(const float*, float, float);
-};
-
-#endif // _TRAIL_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/hack.hh b/xbmc/screensavers/rsxs-0.9/src/hack.hh
deleted file mode 100644
index 8edacebadb..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hack.hh
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _HACK_HH
-#define _HACK_HH
-
-#include <common.hh>
-
-#include <argp.h>
-
-namespace Hack {
- typedef Common::Exception Exception;
-
- std::string getShortName();
- std::string getName();
-
- const struct argp* getParser();
- void start();
- void reshape();
- void tick();
- void stop();
-
- void keyPress(char, const KeySym&);
- void keyRelease(char, const KeySym&);
- void buttonPress(unsigned int);
- void buttonRelease(unsigned int);
- void pointerMotion(int, int);
- void pointerEnter();
- void pointerLeave();
-};
-
-#endif // _HACK_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/helios/Makefile.am b/xbmc/screensavers/rsxs-0.9/src/helios/Makefile.am
deleted file mode 100644
index 53eb6247f0..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/helios/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-include $(srcdir)/../Makefile.common
-
-rs_helios_SOURCES = $(COMMON) $(COLOR) $(VECTOR) $(IMAGE) $(IMPLICIT) \
- helios.cc helios.hh particle.cc particle.hh sphere.hh
-
-AM_CPPFLAGS += $(IMAGE_CPPFLAGS)
-AM_CXXFLAGS += $(IMAGE_CXXFLAGS)
-AM_LDFLAGS += $(IMAGE_LDFLAGS)
-rs_helios_LDADD = $(LIBMISC) $(X_LIBS) $(OPENGL_LIBS) $(IMAGE_LIBS)
-
-hack_PROGRAMS = rs-helios
-
-heliosdatadir = $(pkgdatadir)/helios
-dist_heliosdata_DATA = spheremap.png
-
-uninstall-hook:
- -rmdir $(heliosdatadir)
diff --git a/xbmc/screensavers/rsxs-0.9/src/helios/helios.cc b/xbmc/screensavers/rsxs-0.9/src/helios/helios.cc
deleted file mode 100644
index 07f8c1c56e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/helios/helios.cc
+++ /dev/null
@@ -1,770 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <hack.hh>
-#include <helios.hh>
-#include <implicit.hh>
-#include <particle.hh>
-#include <pngimage.hh>
-#include <sphere.hh>
-#include <resource.hh>
-#include <vector.hh>
-
-namespace Hack {
- unsigned int numIons = 1500;
- float size = 10.0f;
- unsigned int numEmitters = 3;
- unsigned int numAttractors = 3;
- float speed = 10.0f;
- float cameraSpeed = 10.0f;
- bool surface = true;
- bool wireframe = false;
- float blur = 30.0f;
- std::string texture("spheremap.png");
-};
-
-namespace Hack {
- enum Arguments {
- ARG_IONS = 1,
- ARG_EMITTERS,
- ARG_ATTRACTORS,
- ARG_SIZE,
- ARG_SPEED,
- ARG_CAMERASPEED,
- ARG_BLUR,
- ARG_TEXTURE,
- ARG_SURFACE = 0x100, ARG_NO_SURFACE,
- ARG_WIREFRAME = 0x200, ARG_NO_WIREFRAME
- };
-
- std::vector<Node> _eList;
- std::vector<Node> _aList;
- std::vector<Ion> _iList;
- std::vector<Sphere> _spheres;
-
- GLuint _texture;
- Implicit* _surface;
-
- void setTargets(unsigned int);
- float surfaceFunction(const Vector&);
-
- error_t parse(int, char*, struct argp_state*);
-};
-
-error_t Hack::parse(int key, char* arg, struct argp_state* state) {
- switch (key) {
- case ARG_IONS:
- if (Common::parseArg(arg, numIons, 1u, 30000u))
- argp_failure(state, EXIT_FAILURE, 0,
- "number of ions must be between 1 and 30000");
- return 0;
- case ARG_EMITTERS:
- if (Common::parseArg(arg, numEmitters, 1u, 10u))
- argp_failure(state, EXIT_FAILURE, 0,
- "number of ion emitters must be between 1 and 10");
- return 0;
- case ARG_ATTRACTORS:
- if (Common::parseArg(arg, numAttractors, 1u, 10u))
- argp_failure(state, EXIT_FAILURE, 0,
- "number of ion attractors must be between 1 and 10");
- return 0;
- case ARG_SIZE:
- if (Common::parseArg(arg, size, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "ion size must be between 1 and 100");
- return 0;
- case ARG_SPEED:
- if (Common::parseArg(arg, speed, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "ion speed must be between 1 and 100");
- return 0;
- case ARG_CAMERASPEED:
- if (Common::parseArg(arg, cameraSpeed, 0.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "camera speed must be between 0 and 100");
- return 0;
- case ARG_BLUR:
- if (Common::parseArg(arg, blur, 0.0f, 30.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "motion blur must be between 0 and 30");
- return 0;
- case ARG_SURFACE:
- surface = true;
- return 0;
- case ARG_NO_SURFACE:
- surface = false;
- return 0;
- case ARG_WIREFRAME:
- wireframe = true;
- return 0;
- case ARG_NO_WIREFRAME:
- wireframe = false;
- return 0;
- case ARG_TEXTURE:
- texture = arg;
- return 0;
- default:
- return ARGP_ERR_UNKNOWN;
- }
-}
-
-const struct argp* Hack::getParser() {
- static struct argp_option options[] = {
- { NULL, 0, NULL, 0, "Ion options:" },
- { "ions", ARG_IONS, "NUM", 0, "Number of ions (1-30000, default = 1500)" },
- { "emitters", ARG_EMITTERS, "NUM", 0,
- "Number of ion emitters (1-10, default = 3)" },
- { "attractors", ARG_ATTRACTORS, "NUM", 0,
- "Number of ion attractors (1-10, default = 3)" },
- { "size", ARG_SIZE, "NUM", 0, "Ion size (1-100, default = 10)" },
- { "speed", ARG_SPEED, "NUM", 0, "Ion speed (1-100, default = 10)" },
- { NULL, 0, NULL, 0, "Surface options:" },
- { "surface", ARG_SURFACE, NULL, OPTION_HIDDEN, "Disable iso-surface" },
- { "no-surface", ARG_NO_SURFACE, NULL, OPTION_ALIAS },
- { "wireframe", ARG_WIREFRAME, NULL, 0, "Draw iso-surface using wireframe" },
- { "no-wireframe", ARG_NO_WIREFRAME, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { "texture", ARG_TEXTURE, "FILE", 0, "Surface image PNG file" },
- { "surfaceimage", ARG_TEXTURE, "FILE", OPTION_ALIAS | OPTION_HIDDEN },
- { NULL, 0, NULL, 0, "View options:" },
- { "cameraspeed", ARG_CAMERASPEED, "NUM", 0,
- "Camera speed (0-100, default = 10)" },
- { "blur", ARG_BLUR, "NUM", 0, "Motion blur (0-100, default = 30)" },
- {}
- };
- static struct argp parser = {
- options, parse, NULL,
- "Draws exploding ion systems and smooth helion surfaces."
- };
- return &parser;
-}
-
-std::string Hack::getShortName() { return "helios"; }
-std::string Hack::getName() { return "Helios"; }
-
-void Hack::setTargets(unsigned int whichTarget) {
- switch (whichTarget) {
- case 0: // random
- for (unsigned int i = 0; i < numEmitters; ++i)
- _eList[i].setTargetPos(Vector(
- Common::randomFloat(1000.0f) - 500.0f,
- Common::randomFloat(1000.0f) - 500.0f,
- Common::randomFloat(1000.0f) - 500.0f
- ));
- for (unsigned int i = 0; i < numAttractors; ++i)
- _aList[i].setTargetPos(Vector(
- Common::randomFloat(1000.0f) - 500.0f,
- Common::randomFloat(1000.0f) - 500.0f,
- Common::randomFloat(1000.0f) - 500.0f
- ));
- break;
- case 1: // line (all emitters on one side, all attracters on the other)
- {
- float position = -500.0f, change = 1000.0f /
- (numEmitters + numAttractors - 1);
- for (unsigned int i = 0; i < numEmitters; ++i) {
- _eList[i].setTargetPos(Vector(
- position,
- position * 0.5f,
- 0.0f
- ));
- position += change;
- }
- for (unsigned int i = 0; i < numAttractors; ++i) {
- _aList[i].setTargetPos(Vector(
- position,
- position * 0.5f,
- 0.0f
- ));
- position += change;
- }
- }
- break;
- case 2: // line (emitters and attracters staggered)
- {
- float change = (numEmitters > numAttractors)
- ? 1000.0f / (numEmitters * 2 - 1)
- : 1000.0f / (numAttractors * 2 - 1);
- float position = -500.0f;
- for (unsigned int i = 0; i < numEmitters; ++i) {
- _eList[i].setTargetPos(Vector(
- position,
- position * 0.5f,
- 0.0f
- ));
- position += change * 2.0f;
- }
- position = -500.0f + change;
- for (unsigned int i = 0; i < numAttractors; ++i) {
- _aList[i].setTargetPos(Vector(
- position,
- position * 0.5f,
- 0.0f
- ));
- position += change * 2.0f;
- }
- }
- break;
- case 3: // 2 lines (parallel)
- {
- float change = 1000.0f / (numEmitters * 2 - 1);
- float position = -500.0f;
- float height = -525.0f + (numEmitters * 25);
- for (unsigned int i = 0; i < numEmitters; ++i) {
- _eList[i].setTargetPos(Vector(
- position,
- height,
- -50.0f
- ));
- position += change * 2.0f;
- }
- change = 1000.0f / (numAttractors * 2 - 1);
- position = -500.0f;
- height = 525.0f - (numAttractors * 25);
- for (unsigned int i = 0; i < numAttractors; ++i) {
- _aList[i].setTargetPos(Vector(
- position,
- height,
- 50.0f
- ));
- position += change * 2.0f;
- }
- }
- break;
- case 4: // 2 lines (skewed)
- {
- float change = 1000.0f / (numEmitters * 2 - 1);
- float position = -500.0f;
- float height = -525.0f + (numEmitters * 25);
- for (unsigned int i = 0; i < numEmitters; ++i) {
- _eList[i].setTargetPos(Vector(
- position,
- height,
- 0.0f
- ));
- position += change * 2.0f;
- }
- change = 1000.0f / (numAttractors * 2 - 1);
- position = -500.0f;
- height = 525.0f - (numAttractors * 25);
- for (unsigned int i = 0; i < numAttractors; ++i) {
- _aList[i].setTargetPos(Vector(
- 10.0f,
- height,
- position
- ));
- position += change * 2.0f;
- }
- }
- break;
- case 5: // random distribution across a plane
- for (unsigned int i = 0; i < numEmitters; ++i)
- _eList[i].setTargetPos(Vector(
- Common::randomFloat(1000.0f) - 500.0f,
- 0.0f,
- Common::randomFloat(1000.0f) - 500.0f
- ));
- for (unsigned int i = 0; i < numAttractors; ++i)
- _aList[i].setTargetPos(Vector(
- Common::randomFloat(1000.0f) - 500.0f,
- 0.0f,
- Common::randomFloat(1000.0f) - 500.0f
- ));
- break;
- case 6: // random distribution across 2 planes
- {
- float height = -525.0f + (numEmitters * 25);
- for (unsigned int i = 0; i < numEmitters; ++i)
- _eList[i].setTargetPos(Vector(
- Common::randomFloat(1000.0f) - 500.0f,
- height,
- Common::randomFloat(1000.0f) - 500.0f
- ));
- height = 525.0f - (numAttractors * 25);
- for (unsigned int i = 0; i < numAttractors; i++)
- _aList[i].setTargetPos(Vector(
- Common::randomFloat(1000.0f) - 500.0f,
- height,
- Common::randomFloat(1000.0f) - 500.0f
- ));
- }
- break;
- case 7: // 2 rings (1 inside and 1 outside)
- {
- float angle = 0.5f, cosangle, sinangle;
- float change = M_PI * 2.0f / numEmitters;
- for (unsigned int i = 0; i < numEmitters; ++i) {
- angle += change;
- cosangle = std::cos(angle) * 200.0f;
- sinangle = std::sin(angle) * 200.0f;
- _eList[i].setTargetPos(Vector(
- cosangle,
- sinangle,
- 0.0f
- ));
- }
- angle = 1.5f;
- change = M_PI * 2.0f / numAttractors;
- for (unsigned int i = 0; i < numAttractors; ++i) {
- angle += change;
- cosangle = std::cos(angle) * 500.0f;
- sinangle = std::sin(angle) * 500.0f;
- _aList[i].setTargetPos(Vector(
- cosangle,
- sinangle,
- 0.0f
- ));
- }
- }
- break;
- case 8: // ring (all emitters on one side, all attracters on the other)
- {
- float angle = 0.5f, cosangle, sinangle;
- float change = M_PI * 2.0f / (numEmitters + numAttractors);
- for (unsigned int i = 0; i < numEmitters; ++i) {
- angle += change;
- cosangle = std::cos(angle) * 500.0f;
- sinangle = std::sin(angle) * 500.0f;
- _eList[i].setTargetPos(Vector(
- cosangle,
- sinangle,
- 0.0f
- ));
- }
- for (unsigned int i = 0; i < numAttractors; ++i) {
- angle += change;
- cosangle = std::cos(angle) * 500.0f;
- sinangle = std::sin(angle) * 500.0f;
- _aList[i].setTargetPos(Vector(
- cosangle,
- sinangle,
- 0.0f
- ));
- }
- }
- break;
- case 9: // ring (emitters and attracters staggered)
- {
- float change = (numEmitters > numAttractors)
- ? M_PI * 2.0f / (numEmitters * 2)
- : M_PI * 2.0f / (numAttractors * 2);
- float angle = 0.5f, cosangle, sinangle;
- for (unsigned int i = 0; i < numEmitters; ++i) {
- cosangle = std::cos(angle) * 500.0f;
- sinangle = std::sin(angle) * 500.0f;
- _eList[i].setTargetPos(Vector(
- cosangle,
- sinangle,
- 0.0f
- ));
- angle += change * 2.0f;
- }
- angle = 0.5f + change;
- for (unsigned int i = 0; i < numAttractors; ++i) {
- cosangle = std::cos(angle) * 500.0f;
- sinangle = std::sin(angle) * 500.0f;
- _aList[i].setTargetPos(Vector(
- cosangle,
- sinangle,
- 0.0f
- ));
- angle += change * 2.0f;
- }
- }
- break;
- case 10: // 2 points
- for (unsigned int i = 0; i < numEmitters; ++i)
- _eList[i].setTargetPos(Vector(500.0f, 100.0f, 50.0f));
- for (unsigned int i = 0; i < numAttractors; ++i)
- _aList[i].setTargetPos(Vector(-500.0f, -100.0f, -50.0f));
- break;
- }
-}
-
-float Hack::surfaceFunction(const Vector& XYZ) {
- static unsigned int points = numEmitters + numAttractors;
-
- float value = 0.0f;
- for (unsigned int i = 0; i < points; ++i)
- value += _spheres[i].value(XYZ);
-
- return value;
-}
-
-void Hack::start() {
- glViewport(0, 0, Common::width, Common::height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(60.0, Common::aspectRatio, 0.1, 10000.0f);
- glMatrixMode(GL_MODELVIEW);
-
- glDisable(GL_DEPTH_TEST);
- glEnable(GL_BLEND);
- glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
- glEnable(GL_TEXTURE_2D);
-
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT);
-
- // Initialize surface
- if (surface) {
- _texture = Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- PNG(texture)
- );
-
- Implicit::init(70, 70, 70, 25.0f);
- _surface = new Implicit(surfaceFunction);
- Common::resources->manage(_surface);
- _spheres = std::vector<Sphere>(numEmitters + numAttractors);
- float sphereScaleFactor = 1.0f /
- std::sqrt(float(2 * numEmitters + numAttractors));
- stdx::call_each(_spheres.begin(), _spheres.begin() + numEmitters,
- &Sphere::setScale, 400.0f * sphereScaleFactor);
- stdx::call_each(_spheres.begin() + numEmitters, _spheres.begin() + numEmitters + numAttractors,
- &Sphere::setScale, 200.0f * sphereScaleFactor);
- }
-
- Ion::init();
-
- // Initialize particles
- stdx::construct_n(_eList, numEmitters);
- stdx::construct_n(_aList, numAttractors);
- stdx::construct_n(_iList, numIons);
-
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
- glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
-}
-
-void Hack::tick() {
- // Camera movements
- // first do translation (distance from center)
- static float targetCameraDistance = -1000.0f;
- static float preCameraInterp = M_PI;
- static float oldCameraDistance;
-
- preCameraInterp += cameraSpeed * Common::elapsedSecs / 100.0f;
- float cameraInterp = 0.5f - (0.5f * std::cos(preCameraInterp));
- float cameraDistance = (1.0f - cameraInterp) * oldCameraDistance
- + cameraInterp * targetCameraDistance;
- if (preCameraInterp >= M_PI) {
- oldCameraDistance = targetCameraDistance;
- targetCameraDistance = -Common::randomFloat(1300.0f) - 200.0f;
- preCameraInterp = 0.0f;
- }
- glLoadIdentity();
- glTranslatef(0.0, 0.0, cameraDistance);
-
- // then do rotation
- static Vector radialVel(0.0f, 0.0f, 0.0f);
- static Vector targetRadialVel = radialVel;
- static UnitQuat rotQuat;
-
- Vector radialVelDiff(targetRadialVel - radialVel);
- float changeRemaining = radialVelDiff.normalize();
- float change = cameraSpeed * 0.0002f * Common::elapsedSecs;
- if (changeRemaining > change) {
- radialVelDiff *= change;
- radialVel += radialVelDiff;
- } else {
- radialVel = targetRadialVel;
- if (Common::randomInt(2)) {
- targetRadialVel.set(
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f)
- );
- targetRadialVel.normalize();
- targetRadialVel *= cameraSpeed * Common::randomFloat(0.002f);
- } else
- targetRadialVel.set(0.0f, 0.0f, 0.0f);
- }
- Vector tempRadialVel(radialVel);
- float angle = tempRadialVel.normalize();
- UnitQuat radialQuat(angle, tempRadialVel);
- rotQuat.multiplyBy(radialQuat);
- RotationMatrix billboardMat(rotQuat);
-
- // Calculate new color
- static HSLColor oldHSL;
- static HSLColor newHSL(
- Common::randomFloat(1.0f),
- 1.0f,
- 1.0f
- );
- static HSLColor targetHSL;
- static float colorInterp = 1.0f;
- static float colorChange;
- static RGBColor RGB;
- colorInterp += Common::elapsedSecs * colorChange;
- if (colorInterp >= 1.0f) {
- if (!Common::randomInt(3) && numIons >= 100) // change color suddenly
- newHSL.set(
- Common::randomFloat(1.0f),
- 1.0f - (Common::randomFloat(1.0f) * Common::randomFloat(1.0f)),
- 1.0f
- );
- oldHSL = newHSL;
- targetHSL.set(
- Common::randomFloat(1.0f),
- 1.0f - (Common::randomFloat(1.0f) * Common::randomFloat(1.0f)),
- 1.0f
- );
- colorInterp = 0.0f;
- // amount by which to change colorInterp each second
- colorChange = Common::randomFloat(0.005f * speed) + (0.002f * speed);
- } else {
- float diff = targetHSL.h() - oldHSL.h();
- if (diff < -0.5f || (diff > 0.0f && diff < 0.5f))
- newHSL.h() = oldHSL.h() + colorInterp * diff;
- else
- newHSL.h() = oldHSL.h() - colorInterp * diff;
- diff = targetHSL.s() - oldHSL.s();
- newHSL.s() = oldHSL.s() + colorInterp * diff;
- newHSL.clamp();
- RGB = newHSL;
- }
-
- // Release ions
- static unsigned int ionsReleased = 0;
- static int releaseMicros = 0;
- if (ionsReleased < numIons) {
- releaseMicros -= Common::elapsedMicros;
- while (ionsReleased < numIons && releaseMicros <= 0) {
- _iList[ionsReleased].start(
- _eList[Common::randomInt(numEmitters)].getPos(), RGB
- );
- ++ionsReleased;
- // all ions released after 2 minutes
- releaseMicros += 120000000 / numIons;
- }
- }
-
- // Set interpolation value for emitters and attracters
- static int wait = 0;
- static float preInterp = M_PI, interp;
- static float interpConst = 0.001f;
- wait -= Common::elapsedMicros;
- if (wait <= 0) {
- preInterp += Common::elapsedSecs * speed * interpConst;
- interp = 0.5f - (0.5f * std::cos(preInterp));
- }
- if (preInterp >= M_PI) {
- // select new target points (not the same pattern twice in a row)
- static int newTarget = 0, lastTarget;
- lastTarget = newTarget;
- newTarget = Common::randomInt(10);
- if (newTarget == lastTarget) {
- ++newTarget;
- newTarget %= 10;
- }
- setTargets(newTarget);
- preInterp = 0.0f;
- interp = 0.0f;
- wait = 10000000; // pause after forming each new pattern
- // interpolate really fast sometimes
- interpConst = Common::randomInt(4) ? 0.001f : 0.1f;
- }
-
- // Update particles
- stdx::call_all(_eList, &Node::update, interp);
- stdx::call_all(_aList, &Node::update, interp);
- for (
- std::vector<Ion>::iterator i = _iList.begin(), j = i + ionsReleased;
- i != j;
- ++i
- )
- i->update(_eList, _aList, RGB);
-
- if (surface) {
- for (unsigned int i = 0; i < numEmitters; ++i)
- _spheres[i].setCenter(_eList[i].getPos());
- for (unsigned int i = 0; i < numAttractors; ++i)
- _spheres[numEmitters + i].setCenter(_aList[i].getPos());
- std::list<Vector> crawlPointList;
- stdx::map_each(
- _spheres.begin(), _spheres.end(),
- std::back_inserter(crawlPointList),
- &Sphere::getCenter
- );
- static float valueTrig = 0.0f;
- valueTrig += Common::elapsedSecs;
- _surface->update(0.45f + 0.05f * std::cos(valueTrig), crawlPointList);
- }
-
- // Draw
- // clear the screen
- if (blur) { // partially
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glColor4f(0.0f, 0.0f, 0.0f, 0.5f - (std::sqrt(std::sqrt(blur)) * 0.15495f));
- glBindTexture(GL_TEXTURE_2D, 0);
- glPushMatrix();
- glLoadIdentity();
- glBegin(GL_TRIANGLE_STRIP);
- glVertex3f(-5.0f, -4.0f, -3.0f);
- glVertex3f(5.0f, -4.0f, -3.0f);
- glVertex3f(-5.0f, 4.0f, -3.0f);
- glVertex3f(5.0f, 4.0f, -3.0f);
- glEnd();
- glPopMatrix();
- } else // completely
- glClear(GL_COLOR_BUFFER_BIT);
-
- // Draw ions
- glBlendFunc(GL_ONE, GL_ONE);
- stdx::call_each(_iList.begin(), _iList.begin() + ionsReleased,
- &Ion::draw, billboardMat);
-
- RGBColor surfaceColor;
- if (surface) {
- if (numIons >= 100) {
- float brightFactor = wireframe
- ? 2.0f / ((blur + 30) * (blur + 30))
- : 4.0f / ((blur + 30) * (blur + 30));
- for (unsigned int i = 0; i < 100; ++i)
- surfaceColor += _iList[i].getRGB() * brightFactor;
- } else {
- float brightFactor = wireframe
- ? 200.0f / ((blur + 30) * (blur + 30))
- : 400.0f / ((blur + 30) * (blur + 30));
- surfaceColor = RGB * brightFactor;
- }
- glPushMatrix(); glPushAttrib(GL_ENABLE_BIT);
- glBindTexture(GL_TEXTURE_2D, _texture);
- glEnable(GL_TEXTURE_GEN_S);
- glEnable(GL_TEXTURE_GEN_T);
- glColor3fv(surfaceColor.get());
- glMultMatrixf(billboardMat.get());
- GLenum mode = GL_TRIANGLE_STRIP;
- if (Hack::wireframe) {
- glDisable(GL_TEXTURE_2D);
- mode = GL_LINE_STRIP;
- }
- _surface->draw(mode);
- glPopAttrib(); glPopMatrix();
- }
-
- Common::flush();
-}
-
-void Hack::reshape() {
- glViewport(0, 0, Common::width, Common::height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(60.0, Common::aspectRatio, 0.1, 10000.0f);
- glMatrixMode(GL_MODELVIEW);
-}
-
-void Hack::stop() {}
-
-void Hack::keyPress(char c, const KeySym&) {
- switch (c) {
- case 3: case 27:
- case 'q': case 'Q':
- Common::running = false;
- break;
- }
-}
-
-void Hack::keyRelease(char, const KeySym&) {}
-void Hack::pointerMotion(int, int) {}
-void Hack::buttonPress(unsigned int) {}
-void Hack::buttonRelease(unsigned int) {}
-void Hack::pointerEnter() {}
-void Hack::pointerLeave() {}
-
-#define _LINUX
-#include "../../../addons/include/xbmc_scr_dll.h"
-
-extern "C" {
-
-ADDON_STATUS Create(void* hdl, void* props)
-{
- if (!props)
- return STATUS_UNKNOWN;
-
- SCR_PROPS* scrprops = (SCR_PROPS*)props;
-
- Common::width = scrprops->width;
- Common::height = scrprops->height;
- Common::aspectRatio = float(Common::width) / float(Common::height);
-
- return STATUS_OK;
-}
-
-void Start()
-{
- Hack::start();
-}
-
-void Render()
-{
- Hack::tick();
-}
-
-void Stop()
-{
- Hack::stop();
-}
-
-void Destroy()
-{
-}
-
-ADDON_STATUS GetStatus()
-{
- return STATUS_OK;
-}
-
-bool HasSettings()
-{
- return false;
-}
-
-unsigned int GetSettings(StructSetting ***sSet)
-{
- return 0;
-}
-
-ADDON_STATUS SetSetting(const char *settingName, const void *settingValue)
-{
- return STATUS_OK;
-}
-
-void FreeSettings()
-{
-}
-
-void GetInfo(SCR_INFO *info)
-{
-}
-
-void Remove()
-{
-}
-
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/helios/helios.hh b/xbmc/screensavers/rsxs-0.9/src/helios/helios.hh
deleted file mode 100644
index bc301185d8..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/helios/helios.hh
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _HELIOS_HH
-#define _HELIOS_HH
-
-#include <common.hh>
-
-namespace Hack {
- extern unsigned int numIons;
- extern float size;
- extern unsigned int numEmitters;
- extern unsigned int numAttractors;
- extern float speed;
- extern float cameraSpeed;
- extern bool surface;
- extern bool wireframe;
- extern float blur;
- extern std::string texture;
-};
-
-#endif // _HELIOS_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/helios/particle.cc b/xbmc/screensavers/rsxs-0.9/src/helios/particle.cc
deleted file mode 100644
index eb32269d78..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/helios/particle.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <particle.hh>
-#include <resource.hh>
-
-GLuint Ion::_texture;
-GLuint Ion::_list;
-
-void Ion::init() {
- GLubyte light[LIGHTSIZE][LIGHTSIZE];
- for (int i = 0; i < LIGHTSIZE; ++i) {
- for (int j = 0; j < LIGHTSIZE; ++j) {
- float x = float(i - LIGHTSIZE / 2) / float(LIGHTSIZE / 2);
- float y = float(j - LIGHTSIZE / 2) / float(LIGHTSIZE / 2);
- float temp = Common::clamp(
- 1.0f - float(std::sqrt((x * x) + (y * y))),
- 0.0f, 1.0f
- );
- light[i][j] = GLubyte(255.0f * temp * temp);
- }
- }
- _texture = Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- 1, LIGHTSIZE, LIGHTSIZE, GL_LUMINANCE, GL_UNSIGNED_BYTE, light
- );
-
- _list = Common::resources->genLists(1);
- glNewList(_list, GL_COMPILE);
- glBindTexture(GL_TEXTURE_2D, _texture);
- glBegin(GL_TRIANGLES);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-0.5f, -0.5f, 0.0f);
- glTexCoord2f(1.0f, 0.0f);
- glVertex3f(0.5f, -0.5f, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(0.5f, 0.5f, 0.0f);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-0.5f, -0.5f, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(0.5f, 0.5f, 0.0f);
- glTexCoord2f(0.0f, 1.0f);
- glVertex3f(-0.5f, 0.5f, 0.0f);
- glEnd();
- glEndList();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/helios/particle.hh b/xbmc/screensavers/rsxs-0.9/src/helios/particle.hh
deleted file mode 100644
index 57b745bc17..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/helios/particle.hh
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _PARTICLE_HH
-#define _PARTICLE_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <helios.hh>
-#include <vector.hh>
-
-#define LIGHTSIZE 64
-
-class Node {
-private:
- Vector _pos;
- Vector _oldPos;
- Vector _targetPos;
-public:
- Node() : _pos(Vector(
- Common::randomFloat(1000.0f) - 500.0f,
- Common::randomFloat(1000.0f) - 500.0f,
- Common::randomFloat(1000.0f) - 500.0f
- )), _oldPos(_pos), _targetPos(_pos) {}
-
- const Vector& getPos() const {
- return _pos;
- }
-
- void setTargetPos(const Vector& target) {
- _oldPos = _pos;
- _targetPos = target;
- }
-
- void update(float n) {
- _pos = _oldPos * (1.0f - n) + _targetPos * n;
- }
-};
-
-class Ion {
-private:
- static GLuint _texture;
- static GLuint _list;
-
- Vector _pos;
- float _size;
- float _speed;
- RGBColor _RGB;
-public:
- static void init();
-
- Ion() {
- float temp = Common::randomFloat(2.0f) + 0.4f;
- _size = Hack::size * temp;
- _speed = Hack::speed * 12.0f / temp;
- }
-
- const RGBColor& getRGB() const {
- return _RGB;
- }
-
- void start(const Vector& pos, const RGBColor& RGB) {
- _pos = pos;
-
- float offset = Common::elapsedSecs * _speed;
- switch (Common::randomInt(14)) {
- case 0:
- _pos += Vector(offset, 0, 0);
- break;
- case 1:
- _pos += Vector(-offset, 0, 0);
- break;
- case 2:
- _pos += Vector(0, offset, 0);
- break;
- case 3:
- _pos += Vector(0, -offset, 0);
- break;
- case 4:
- _pos += Vector(0, 0, offset);
- break;
- case 5:
- _pos += Vector(0, 0, -offset);
- break;
- case 6:
- _pos += Vector(offset, offset, offset);
- break;
- case 7:
- _pos += Vector(-offset, offset, offset);
- break;
- case 8:
- _pos += Vector(offset, -offset, offset);
- break;
- case 9:
- _pos += Vector(-offset, -offset, offset);
- break;
- case 10:
- _pos += Vector(offset, offset, -offset);
- break;
- case 11:
- _pos += Vector(-offset, offset, -offset);
- break;
- case 12:
- _pos += Vector(offset, -offset, -offset);
- break;
- case 13:
- _pos += Vector(-offset, -offset, -offset);
- break;
- }
-
- _RGB = RGB;
- }
-
- void update(
- const std::vector<Node> eList, const std::vector<Node> aList,
- const RGBColor& RGB
- ) {
- Vector force(0.0f, 0.0f, 0.0f);
-
- bool startOver = false;
- for (
- std::vector<Node>::const_iterator i = eList.begin();
- i != eList.end();
- ++i
- ) {
- Vector temp(_pos - i->getPos());
- float length = temp.normalize();
- startOver = startOver || (length > 11000.0f);
- if (length > 1.0f) temp /= length;
- force += temp;
- }
-
- float startOverDistance = Common::elapsedSecs * _speed;
- for (
- std::vector<Node>::const_iterator i = aList.begin();
- i != aList.end();
- ++i
- ) {
- Vector temp(i->getPos() - _pos);
- float length = temp.normalize();
- startOver = startOver || (length < startOverDistance);
- if (length > 1.0f) temp /= length;
- force += temp;
- }
-
- // Start this ion at an emitter if it gets too close to an attracter
- // or too far from an emitter
- if (startOver)
- start(eList[Common::randomInt(Hack::numEmitters)].getPos(), RGB);
- else {
- force.normalize();
- _pos += force * Common::elapsedSecs * _speed;
- }
- }
-
- void draw(const RotationMatrix& billboardMat) const {
- glColor3fv(_RGB.get());
- glPushMatrix();
- Vector transformed(billboardMat.transform(_pos));
- glTranslatef(transformed.x(), transformed.y(), transformed.z());
- glScalef(_size, _size, _size);
- glCallList(_list);
- glPopMatrix();
- }
-};
-
-#endif // _PARTICLE_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/helios/sphere.hh b/xbmc/screensavers/rsxs-0.9/src/helios/sphere.hh
deleted file mode 100644
index c5bdfd67f6..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/helios/sphere.hh
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _SPHERE_HH
-#define _SPHERE_HH
-
-#include <common.hh>
-
-#include <vector.hh>
-
-class Sphere {
-private:
- Vector _center;
- float _scale;
- float _scaleSquared;
-public:
- void setCenter(const Vector& center) {
- _center = center;
- }
-
- const Vector& getCenter() const {
- return _center;
- }
-
- void setScale(float scale) {
- _scale = scale;
- _scaleSquared = scale * scale;
- }
-
- float getScale() const {
- return _scale;
- }
-
- float value(const Vector& XYZ) {
- return _scaleSquared / (XYZ - _center).lengthSquared();
- }
-};
-
-#endif // _SPHERE_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/helios/spheremap.png b/xbmc/screensavers/rsxs-0.9/src/helios/spheremap.png
deleted file mode 100644
index e3f3e5f410..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/helios/spheremap.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/Makefile.am b/xbmc/screensavers/rsxs-0.9/src/hyperspace/Makefile.am
deleted file mode 100644
index 78bcb9f88c..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-include $(srcdir)/../Makefile.common
-
-rs_hyperspace_SOURCES = $(COMMON) $(COLOR) $(VECTOR) $(IMPLICIT) $(IMAGE) \
- caustic.cc caustic.hh cubemaps.cc cubemaps.hh extensions.cc extensions.hh \
- flares.cc flares.hh goo.cc goo.hh hyperspace.cc hyperspace.hh nebula.cc \
- nebula.hh particle.cc particle.hh starburst.cc starburst.hh shaders.cc \
- shaders.hh spline.cc spline.hh tunnel.cc tunnel.hh
-
-AM_CPPFLAGS += $(IMAGE_CPPFLAGS)
-AM_CXXFLAGS += $(IMAGE_CXXFLAGS)
-AM_LDFLAGS += $(IMAGE_LDFLAGS)
-rs_hyperspace_LDADD = $(LIBMISC) $(X_LIBS) $(OPENGL_LIBS) $(IMAGE_LIBS)
-
-hack_PROGRAMS = rs-hyperspace
-
-hyperspacedatadir = $(pkgdatadir)/hyperspace
-dist_hyperspacedata_DATA = nebula.png
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/caustic.cc b/xbmc/screensavers/rsxs-0.9/src/hyperspace/caustic.cc
deleted file mode 100644
index f6b0387b7d..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/caustic.cc
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software FoundAT2on.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * FoundAT2on, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <caustic.hh>
-#include <hyperspace.hh>
-
-#define CAUSTIC_RESOLUTION 100
-#define CAUSTIC_SIZE 256
-#define CAUSTIC_DEPTH 1.0f
-#define CAUSTIC_AMPLITUDE 0.01f
-#define CAUSTIC_REFRACTION 20.0f
-
-namespace CausticTextures {
- std::vector<GLuint> _textures;
-
- void draw(
- const stdx::dim2<float, CAUSTIC_RESOLUTION + 1>&,
- const float*, const float*,
- const stdx::dim2<std::pair<float, float>, CAUSTIC_RESOLUTION + 1>&,
- unsigned int, unsigned int, unsigned int, unsigned int
- );
-};
-
-void CausticTextures::init() {
- unsigned int size = CAUSTIC_SIZE;
- if (Common::width < size) size = Common::width;
- if (Common::height < size) size = Common::height;
-
- float x[CAUSTIC_RESOLUTION + 1];
- float z[CAUSTIC_RESOLUTION + 1];
-
- stdx::dim2<float, CAUSTIC_RESOLUTION> y[Hack::frames];
- for (unsigned int i = 0; i < Hack::frames; ++i)
- y[i].resize(CAUSTIC_RESOLUTION);
- stdx::dim2<std::pair<float, float>, CAUSTIC_RESOLUTION + 1> xz(CAUSTIC_RESOLUTION + 1);
- stdx::dim2<float, CAUSTIC_RESOLUTION + 1> intensity(CAUSTIC_RESOLUTION + 1);
-
- // set x and z geometry positions
- for (unsigned int i = 0; i <= CAUSTIC_RESOLUTION; ++i) {
- x[i] = z[i] = float(i) / float(CAUSTIC_RESOLUTION);
- }
-
- // set y geometry positions (altitudes)
- for (unsigned int k = 0; k < Hack::frames; ++k) {
- float offset = M_PI * 2.0f * float(k) / float(Hack::frames);
- for (unsigned int i = 0; i < CAUSTIC_RESOLUTION; ++i) {
- float xx = M_PI * 2.0f * float(i) / float(CAUSTIC_RESOLUTION);
- for (unsigned int j = 0; j < CAUSTIC_RESOLUTION; ++j) {
- float zz = M_PI * 2.0f * float(j) / float(CAUSTIC_RESOLUTION);
- y[k](i, j) = CAUSTIC_AMPLITUDE * (
- 0.08f * std::cos(xx * 2.0f + offset)
- + 0.06f * std::cos(-1.0f * xx + 2.0f * zz + offset)
- + 0.04f * std::cos(-2.0f * xx - 3.0f * zz + offset)
- + 0.01f * std::cos(xx - 7.0f * zz - 2.0f * offset)
- + 0.01f * std::cos(3.0f * xx + 5.0f * zz + offset)
- + 0.01f * std::cos(9.0f * xx + zz - offset)
- + 0.005f * std::cos(11.0f * xx + 7.0f * zz - offset)
- + 0.005f * std::cos(4.0f * xx - 13.0f * zz + offset)
- + 0.003f * std::cos(19.0f * xx - 9.0f * zz - offset)
- );
- }
- }
- }
-
- // prepare to draw textures
- Common::flush();
- glXWaitX();
- glPushAttrib(GL_ALL_ATTRIB_BITS);
-
- glDisable(GL_FOG);
-
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
- glRotatef(-90.0f, 1, 0, 0);
-
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
-
- glReadBuffer(GL_BACK);
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
-
- glDisable(GL_TEXTURE_2D);
- glEnable(GL_BLEND);
-
- std::vector<unsigned char> bitmap(size * size * 3);
-
- // project vertices and create textures
-
- // reciprocal of vertical component of light ray
- float recvert = float(CAUSTIC_RESOLUTION) * 0.5f;
- for (unsigned int k = 0; k < Hack::frames; ++k) {
- // compute projected offsets
- // (this uses surface normals, not actual refractions, but it's faster this way)
- for (unsigned int i = 0; i < CAUSTIC_RESOLUTION; ++i) {
- for (unsigned int j = 0; j < CAUSTIC_RESOLUTION; ++j) {
- unsigned int minus, plus;
-
- minus = (i == 0 ? CAUSTIC_RESOLUTION - 1 : i - 1);
- plus = (i == CAUSTIC_RESOLUTION - 1 ? 0 : i + 1);
- xz(i, j).first = (y[k](plus, j) - y[k](minus, j)) * recvert * (CAUSTIC_DEPTH + y[k](i, j));
-
- minus = (j == 0 ? CAUSTIC_RESOLUTION - 1 : j - 1);
- plus = (j == CAUSTIC_RESOLUTION - 1 ? 0 : j + 1);
- xz(i, j).second = (y[k](i, plus) - y[k](i, minus)) * recvert * (CAUSTIC_DEPTH + y[k](i, j));
- }
- }
-
- // copy offsets to edges of xz array
- for (unsigned int i = 0; i < CAUSTIC_RESOLUTION; ++i)
- xz(i, CAUSTIC_RESOLUTION) = xz(i, 0);
- for (unsigned int j = 0; j <= CAUSTIC_RESOLUTION; ++j)
- xz(CAUSTIC_RESOLUTION, j) = xz(0, j);
-
- // compute light intensities
- float space = 1.0f / float(CAUSTIC_RESOLUTION);
- for (unsigned int i = 0; i < CAUSTIC_RESOLUTION; ++i) {
- for (unsigned int j = 0; j < CAUSTIC_RESOLUTION; ++j) {
- unsigned int xminus = (i == 0 ? CAUSTIC_RESOLUTION - 1 : i - 1);
- unsigned int xplus = (i == CAUSTIC_RESOLUTION - 1 ? 0 : i + 1);
- unsigned int zminus = (j == 0 ? CAUSTIC_RESOLUTION - 1 : j - 1);
- unsigned int zplus = (j == CAUSTIC_RESOLUTION - 1 ? 0 : j + 1);
- // this assumes nominal light intensity is 0.25
- intensity(i, j) = (1.0f / (float(CAUSTIC_RESOLUTION) * float(CAUSTIC_RESOLUTION)))
- / ((std::abs(xz(xplus, j).first - xz(i, j).first + space)
- + std::abs(xz(i, j).first - xz(xminus, j).first + space))
- * (std::abs(xz(i, zplus).second - xz(i, j).second + space)
- + std::abs(xz(i, j).second - xz(i, zminus).second + space)))
- - 0.125f;
- if (intensity(i, j) > 1.0f)
- intensity(i, j) = 1.0f;
- }
- }
-
- // copy intensities to edges of intensity array
- for (unsigned int i = 0; i < CAUSTIC_RESOLUTION; ++i)
- intensity(i, CAUSTIC_RESOLUTION) = intensity(i, 0);
- for (unsigned int j = 0; j <= CAUSTIC_RESOLUTION; ++j)
- intensity(CAUSTIC_RESOLUTION, j) = intensity(0, j);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(0.0f, 1.0f, 0.0f, 1.0f, -0.5f, 0.5f);
- glViewport(
- (Common::width - size) >> 1,
- (Common::height - size) >> 1,
- size, size
- );
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
-
- // draw texture
- glClear(GL_COLOR_BUFFER_BIT);
- // draw most of texture
- draw(intensity, x, z, xz, 0, CAUSTIC_RESOLUTION, 0, CAUSTIC_RESOLUTION);
- // draw edges of texture that wrap around from opposite sides
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glTranslatef(-1.0f, 0.0f, 0.0f);
- draw(intensity, x, z, xz, CAUSTIC_RESOLUTION * 9 / 10, CAUSTIC_RESOLUTION, 0, CAUSTIC_RESOLUTION);
- glPopMatrix();
- glPushMatrix();
- glTranslatef(1.0f, 0.0f, 0.0f);
- draw(intensity, x, z, xz, 0, CAUSTIC_RESOLUTION / 10, 0, CAUSTIC_RESOLUTION);
- glPopMatrix();
- glPushMatrix();
- glTranslatef(0.0f, 0.0f, -1.0f);
- draw(intensity, x, z, xz, 0, CAUSTIC_RESOLUTION, CAUSTIC_RESOLUTION * 9 / 10, CAUSTIC_RESOLUTION);
- glPopMatrix();
- glPushMatrix();
- glTranslatef(0.0f, 0.0f, 1.0f);
- draw(intensity, x, z, xz, 0, CAUSTIC_RESOLUTION, 0, CAUSTIC_RESOLUTION / 10);
- glPopMatrix();
- // draw corners too
- glPushMatrix();
- glTranslatef(-1.0f, 0.0f, -1.0f);
- draw(intensity, x, z, xz, CAUSTIC_RESOLUTION * 9 / 10, CAUSTIC_RESOLUTION, CAUSTIC_RESOLUTION * 9 / 10, CAUSTIC_RESOLUTION);
- glPopMatrix();
- glPushMatrix();
- glTranslatef(1.0f, 0.0f, -1.0f);
- draw(intensity, x, z, xz, 0, CAUSTIC_RESOLUTION / 10, CAUSTIC_RESOLUTION * 9 / 10, CAUSTIC_RESOLUTION);
- glPopMatrix();
- glPushMatrix();
- glTranslatef(-1.0f, 0.0f, 1.0f);
- draw(intensity, x, z, xz, CAUSTIC_RESOLUTION * 9 / 10, CAUSTIC_RESOLUTION, 0, CAUSTIC_RESOLUTION / 10);
- glPopMatrix();
- glPushMatrix();
- glTranslatef(1.0f, 0.0f, 1.0f);
- draw(intensity, x, z, xz, 0, CAUSTIC_RESOLUTION / 10, 0, CAUSTIC_RESOLUTION / 10);
- glPopMatrix();
-
- // read back texture
- glReadPixels(
- (Common::width - size) >> 1,
- (Common::height - size) >> 1,
- size, size,
- GL_RGB, GL_UNSIGNED_BYTE, &bitmap.front()
- );
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(0.0f, Common::width, 0.0f, Common::height, -0.5f, 0.5f);
- glViewport(0, 0, Common::width, Common::height);
-
- unsigned int left = ((Common::width - size) >> 1) - 5;
- unsigned int right = left + size + 10;
- unsigned int bottom = ((Common::height - size) >> 1) - 5;
- unsigned int top = bottom + size + 10;
- unsigned int barBottom = bottom - 10;
- unsigned int barTop = barBottom - 20;
-
- glBlendFunc(GL_ONE, GL_ZERO);
- glLineWidth(2.0f);
- glBegin(GL_LINE_STRIP);
- glColor3f(0.0f, 0.4f, 0.0f);
- glVertex3f(left, 0.0f, bottom);
- glVertex3f(right, 0.0f, bottom);
- glVertex3f(right, 0.0f, top);
- glVertex3f(left, 0.0f, top);
- glVertex3f(left, 0.0f, bottom);
- glEnd();
- glBegin(GL_QUADS);
- glColor3f(0.0f, 0.2f, 0.0f);
- glVertex3f(left, 0.0f, barBottom);
- glVertex3f(left + (k + 1) * float(right - left) / float(Hack::frames), 0.0f, barBottom);
- glVertex3f(left + (k + 1) * float(right - left) / float(Hack::frames), 0.0f, barTop);
- glVertex3f(left, 0.0f, barTop);
- glEnd();
- glBegin(GL_LINE_STRIP);
- glColor3f(0.0f, 0.4f, 0.0f);
- glVertex3f(left, 0.0f, barBottom);
- glVertex3f(right, 0.0f, barBottom);
- glVertex3f(right, 0.0f, barTop);
- glVertex3f(left, 0.0f, barTop);
- glVertex3f(left, 0.0f, barBottom);
- glEnd();
-
- Common::flush();
-
- // create texture object
- _textures.push_back(Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- 3, size, size, GL_RGB, GL_UNSIGNED_BYTE, &bitmap.front()
- ));
- }
-
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
- glPopAttrib();
-}
-
-void CausticTextures::draw(
- const stdx::dim2<float, CAUSTIC_RESOLUTION + 1>& intensity,
- const float* x, const float* z,
- const stdx::dim2<std::pair<float, float>, CAUSTIC_RESOLUTION + 1>& xz,
- unsigned int xLo, unsigned int xHi, unsigned int zLo, unsigned int zHi
-) {
- for (unsigned int j = zLo; j < zHi; ++j) {
- // red
- float mult = 1.0f - CAUSTIC_REFRACTION / float(CAUSTIC_RESOLUTION);
- glBegin(GL_TRIANGLE_STRIP);
- for (unsigned int i = xLo; i <= xHi; ++i) {
- glColor3f(intensity(i, j + 1), 0.0f, 0.0f);
- glVertex3f(x[i] + xz(i, j + 1).first * mult, 0.0f, z[j + 1] + xz(i, j + 1).second * mult);
- glColor3f(intensity(i, j), 0.0f, 0.0f);
- glVertex3f(x[i] + xz(i, j).first * mult, 0.0f, z[j] + xz(i, j).second * mult);
- }
- glEnd();
- // green
- glBegin(GL_TRIANGLE_STRIP);
- for(unsigned int i = xLo; i <= xHi; ++i) {
- glColor3f(0.0f, intensity(i, j + 1), 0.0f);
- glVertex3f(x[i] + xz(i, j + 1).first, 0.0f, z[j + 1] + xz(i, j + 1).second);
- glColor3f(0.0f, intensity(i, j), 0.0f);
- glVertex3f(x[i] + xz(i, j).first, 0.0f, z[j] + xz(i, j).second);
- }
- glEnd();
- // blue
- mult = 1.0f + CAUSTIC_REFRACTION / float(CAUSTIC_RESOLUTION);
- glBegin(GL_TRIANGLE_STRIP);
- for(unsigned int i = xLo; i <= xHi; ++i) {
- glColor3f(0.0f, 0.0f, intensity(i, j + 1));
- glVertex3f(x[i] + xz(i, j + 1).first * mult, 0.0f, z[j + 1] + xz(i, j + 1).second * mult);
- glColor3f(0.0f, 0.0f, intensity(i, j));
- glVertex3f(x[i] + xz(i, j).first * mult, 0.0f, z[j] + xz(i, j).second * mult);
- }
- glEnd();
- }
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/caustic.hh b/xbmc/screensavers/rsxs-0.9/src/hyperspace/caustic.hh
deleted file mode 100644
index e3e9bde68f..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/caustic.hh
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _CAUSTIC_HH
-#define _CAUSTIC_HH
-
-#include <common.hh>
-
-#include <extensions.hh>
-#include <hyperspace.hh>
-#include <shaders.hh>
-#include <common.hh>
-
-namespace CausticTextures {
- void init();
-
- extern std::vector<GLuint> _textures;
-
- inline void use() {
-#if USE_GL_EXTENSIONS
- if (Hack::shaders) {
- Extensions::glActiveTextureARB(GL_TEXTURE1_ARB);
- glBindTexture(
- GL_TEXTURE_2D, _textures[(Hack::current + 1) % Hack::frames]
- );
- Extensions::glActiveTextureARB(GL_TEXTURE0_ARB);
- glBindTexture(
- GL_TEXTURE_2D, _textures[Hack::current]
- );
- Extensions::glBindProgramARB(
- GL_VERTEX_PROGRAM_ARB, Shaders::tunnelVP
- );
- glEnable(GL_VERTEX_PROGRAM_ARB);
- Extensions::glBindProgramARB(
- GL_FRAGMENT_PROGRAM_ARB, Shaders::tunnelFP
- );
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
- } else
-#endif // USE_GL_EXTENSIONS
- glBindTexture(GL_TEXTURE_2D, _textures[Hack::current]);
- }
-};
-
-#endif // _CAUSTIC_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/cubemaps.cc b/xbmc/screensavers/rsxs-0.9/src/hyperspace/cubemaps.cc
deleted file mode 100644
index b8a4ffd1a0..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/cubemaps.cc
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <cubemaps.hh>
-#include <hyperspace.hh>
-#include <vector.hh>
-
-#define CUBEMAPS_SIZE 128
-
-#if USE_GL_EXTENSIONS
-
-namespace WavyNormalCubeMaps {
- std::vector<GLuint> textures;
-};
-
-namespace WavyNormalCubeMaps {
- inline UnitVector wavyFunc(const Vector&, float);
-};
-
-void WavyNormalCubeMaps::init() {
- stdx::dim3<GLubyte, 3, CUBEMAPS_SIZE> map(CUBEMAPS_SIZE);
-
- // calculate normal cube maps
- Vector vec;
- Vector norm;
- float offset = -0.5f * float(CUBEMAPS_SIZE) + 0.5f;
- for (unsigned int g = 0; g < Hack::frames; ++g) {
- textures.push_back(Common::resources->genCubeMapTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE
- ));
-
- float phase = M_PI * 2.0f * float(g) / float(Hack::frames);
-
- // left
- for (unsigned int i = 0; i < CUBEMAPS_SIZE; ++i) {
- for (unsigned int j = 0; j < CUBEMAPS_SIZE; ++j) {
- vec.set(
- -0.5f,
- -(float(j) + offset) / float(CUBEMAPS_SIZE),
- (float(i) + offset) / float(CUBEMAPS_SIZE)
- );
- vec.normalize();
- norm = wavyFunc(vec, phase);
- map(j, i, 0) = GLubyte(norm.x() * 127.999f + 128.0f);
- map(j, i, 1) = GLubyte(norm.y() * 127.999f + 128.0f);
- map(j, i, 2) = GLubyte(norm.z() * -127.999f + 128.0f);
- }
- }
- gluBuild2DMipmaps(GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, 3, CUBEMAPS_SIZE, CUBEMAPS_SIZE,
- GL_RGB, GL_UNSIGNED_BYTE, &map.front());
-
- // right
- for (unsigned int i = 0; i < CUBEMAPS_SIZE; ++i) {
- for (unsigned int j = 0; j < CUBEMAPS_SIZE; ++j) {
- vec.set(
- 0.5f,
- -(float(j) + offset) / float(CUBEMAPS_SIZE),
- -(float(i) + offset) / float(CUBEMAPS_SIZE)
- );
- vec.normalize();
- norm = wavyFunc(vec, phase);
- map(j, i, 0) = GLubyte(norm.x() * 127.999f + 128.0f);
- map(j, i, 1) = GLubyte(norm.y() * 127.999f + 128.0f);
- map(j, i, 2) = GLubyte(norm.z() * -127.999f + 128.0f);
- }
- }
- gluBuild2DMipmaps(GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, 3, CUBEMAPS_SIZE, CUBEMAPS_SIZE,
- GL_RGB, GL_UNSIGNED_BYTE, &map.front());
-
- // back
- for (unsigned int i = 0; i < CUBEMAPS_SIZE; ++i) {
- for (unsigned int j = 0; j < CUBEMAPS_SIZE; ++j) {
- vec.set(
- -(float(i) + offset) / float(CUBEMAPS_SIZE),
- -(float(j) + offset) / float(CUBEMAPS_SIZE),
- -0.5f
- );
- vec.normalize();
- norm = wavyFunc(vec, phase);
- map(j, i, 0) = GLubyte(norm.x() * 127.999f + 128.0f);
- map(j, i, 1) = GLubyte(norm.y() * 127.999f + 128.0f);
- map(j, i, 2) = GLubyte(norm.z() * -127.999f + 128.0f);
- }
- }
- gluBuild2DMipmaps(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, 3, CUBEMAPS_SIZE, CUBEMAPS_SIZE,
- GL_RGB, GL_UNSIGNED_BYTE, &map.front());
-
- // front
- for (unsigned int i = 0; i < CUBEMAPS_SIZE; ++i) {
- for (unsigned int j = 0; j < CUBEMAPS_SIZE; ++j) {
- vec.set(
- (float(i) + offset) / float(CUBEMAPS_SIZE),
- -(float(j) + offset) / float(CUBEMAPS_SIZE),
- 0.5f
- );
- vec.normalize();
- norm = wavyFunc(vec, phase);
- map(j, i, 0) = GLubyte(norm.x() * 127.999f + 128.0f);
- map(j, i, 1) = GLubyte(norm.y() * 127.999f + 128.0f);
- map(j, i, 2) = GLubyte(norm.z() * -127.999f + 128.0f);
- }
- }
- gluBuild2DMipmaps(GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, 3, CUBEMAPS_SIZE, CUBEMAPS_SIZE,
- GL_RGB, GL_UNSIGNED_BYTE, &map.front());
-
- // bottom
- for (unsigned int i = 0; i < CUBEMAPS_SIZE; ++i) {
- for (unsigned int j = 0; j < CUBEMAPS_SIZE; ++j) {
- vec.set(
- (float(i) + offset) / float(CUBEMAPS_SIZE),
- -0.5f,
- -(float(j) + offset) / float(CUBEMAPS_SIZE)
- );
- vec.normalize();
- norm = wavyFunc(vec, phase);
- map(j, i, 0) = GLubyte(norm.x() * 127.999f + 128.0f);
- map(j, i, 1) = GLubyte(norm.y() * 127.999f + 128.0f);
- map(j, i, 2) = GLubyte(norm.z() * -127.999f + 128.0f);
- }
- }
- gluBuild2DMipmaps(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, 3, CUBEMAPS_SIZE, CUBEMAPS_SIZE,
- GL_RGB, GL_UNSIGNED_BYTE, &map.front());
-
- // top
- for (unsigned int i = 0; i < CUBEMAPS_SIZE; ++i) {
- for (unsigned int j = 0; j < CUBEMAPS_SIZE; ++j) {
- vec.set(
- (float(i) + offset) / float(CUBEMAPS_SIZE),
- 0.5f,
- (float(j) + offset) / float(CUBEMAPS_SIZE)
- );
- vec.normalize();
- norm = wavyFunc(vec, phase);
- map(j, i, 0) = GLubyte(norm.x() * 127.999f + 128.0f);
- map(j, i, 1) = GLubyte(norm.y() * 127.999f + 128.0f);
- map(j, i, 2) = GLubyte(norm.z() * -127.999f + 128.0f);
- }
- }
- gluBuild2DMipmaps(GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, 3, CUBEMAPS_SIZE, CUBEMAPS_SIZE,
- GL_RGB, GL_UNSIGNED_BYTE, &map.front());
- }
-}
-
-inline UnitVector WavyNormalCubeMaps::wavyFunc(const Vector& vec, float phase) {
- Vector normal(
- vec.x() + (
- 0.3f * std::cos((1.0f * vec.x() + 4.0f * vec.y()) * M_PI + phase)
- + 0.15f * std::cos((3.0f * vec.y() + 13.0f * vec.z()) * M_PI - phase)
- ),
- vec.y() + (
- 0.3f * std::cos((2.0f * vec.y() - 5.0f * vec.z()) * M_PI + phase)
- + 0.15f * std::cos((2.0f * vec.z() + 12.0f * vec.x()) * M_PI - phase)
- ),
- vec.z() + (
- 0.3f * std::cos((1.0f * vec.z() + 6.0f * vec.x()) * M_PI + phase)
- + 0.15f * std::cos((1.0f * vec.x() - 11.0f * vec.y()) * M_PI - phase)
- )
- );
- return UnitVector(normal);
-}
-
-#endif // USE_GL_EXTENSIONS
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/cubemaps.hh b/xbmc/screensavers/rsxs-0.9/src/hyperspace/cubemaps.hh
deleted file mode 100644
index f103820f08..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/cubemaps.hh
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _CUBEMAPS_HH
-#define _CUBEMAPS_HH
-
-#include <common.hh>
-
-#include <extensions.hh>
-
-#if USE_GL_EXTENSIONS
-
-namespace WavyNormalCubeMaps {
- extern std::vector<GLuint> textures;
-
- void init();
-};
-
-#endif // USE_GL_EXTENSIONS
-
-#endif // _CUBEMAPS_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/extensions.cc b/xbmc/screensavers/rsxs-0.9/src/hyperspace/extensions.cc
deleted file mode 100644
index 872fbb5091..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/extensions.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <extensions.hh>
-
-#if USE_GL_EXTENSIONS
-
-namespace Extensions {
- PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
- PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB;
- PFNGLGENPROGRAMSARBPROC glGenProgramsARB;
- PFNGLBINDPROGRAMARBPROC glBindProgramARB;
- PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
-};
-
-#if GLX_ARB_get_proc_address
-
-void Extensions::init() {
- std::string extensions((const char*)glGetString(GL_EXTENSIONS));
- TRACE("Extensions: " << extensions);
-
- std::string::size_type a = 0;
- unsigned int count = 0;
- while (a < extensions.size()) {
- std::string::size_type b = extensions.find(' ', a);
- if (b == std::string::npos) b = extensions.size();
- std::string s(extensions.substr(a, b - a));
- if (
- s == "GL_ARB_multitexture" ||
- s == "GL_ARB_texture_cube_map" ||
- s == "GL_ARB_vertex_program" ||
- s == "GL_ARB_fragment_program"
- )
- count++;
- a = b + 1;
- }
-
- if (count != 4)
- throw Exception("Not all required GL extensions available");
-
- glActiveTextureARB = PFNGLACTIVETEXTUREARBPROC(
- glXGetProcAddressARB((const GLubyte*)"glActiveTextureARB"));
- glDeleteProgramsARB = PFNGLDELETEPROGRAMSARBPROC(
- glXGetProcAddressARB((const GLubyte*)"glDeleteProgramsARB"));
- glGenProgramsARB = PFNGLGENPROGRAMSARBPROC(
- glXGetProcAddressARB((const GLubyte*)"glGenProgramsARB"));
- glBindProgramARB = PFNGLBINDPROGRAMARBPROC(
- glXGetProcAddressARB((const GLubyte*)"glBindProgramARB"));
- glProgramStringARB = PFNGLPROGRAMSTRINGARBPROC(
- glXGetProcAddressARB((const GLubyte*)"glProgramStringARB"));
-}
-
-#else // !GLX_ARB_get_proc_address
-
-void Extensions::init() {
- // This one's easy!
- throw Exception("Can not dynamically get GL procedure addresses");
-}
-
-#endif // !GLX_ARB_get_proc_address
-
-#endif // USE_GL_EXTENSIONS
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/extensions.hh b/xbmc/screensavers/rsxs-0.9/src/hyperspace/extensions.hh
deleted file mode 100644
index 624595ac09..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/extensions.hh
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _EXTENSIONS_HH
-#define _EXTENSIONS_HH
-
-#include <common.hh>
-
-#if GL_ARB_multitexture
-#if GL_ARB_texture_cube_map
-#if GL_ARB_vertex_program
-#if GL_ARB_fragment_program
-#define USE_GL_EXTENSIONS 1
-
-namespace Extensions {
- typedef Common::Exception Exception;
-
- extern PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
- extern PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB;
- extern PFNGLGENPROGRAMSARBPROC glGenProgramsARB;
- extern PFNGLBINDPROGRAMARBPROC glBindProgramARB;
- extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
-
- void init();
-};
-
-#endif // GL_ARB_fragment_program
-#endif // GL_ARB_vertex_program
-#endif // GL_ARB_texture_cube_map
-#endif // GL_ARB_multitexture
-
-#endif // _EXTENSIONS_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/flares.cc b/xbmc/screensavers/rsxs-0.9/src/hyperspace/flares.cc
deleted file mode 100644
index ff7d9dcdaf..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/flares.cc
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <hyperspace.hh>
-#include <flares.hh>
-
-#define FLARESIZE 64
-
-namespace Flares {
- GLuint blob;
-};
-
-namespace Flares {
- GLuint _lists;
- GLuint _flare[4];
-};
-
-void Flares::init() {
- stdx::dim3<GLubyte, 4, FLARESIZE> flareMap[4];
- for (unsigned int i = 0; i < 4; ++i)
- flareMap[i].resize(FLARESIZE);
-
- for (unsigned int i = 0; i < FLARESIZE; ++i) {
- float x = float(int(i) - FLARESIZE / 2) / float(FLARESIZE / 2);
- for (unsigned int j = 0; j < FLARESIZE; ++j) {
- float y = float(int(j) - FLARESIZE / 2) / float(FLARESIZE / 2);
- float temp;
-
- // Basic flare
- flareMap[0](i, j, 0) = 255;
- flareMap[0](i, j, 1) = 255;
- flareMap[0](i, j, 2) = 255;
- temp = 1.0f - ((x * x) + (y * y));
- if (temp > 1.0f) temp = 1.0f;
- if (temp < 0.0f) temp = 0.0f;
- flareMap[0](i, j, 3) = GLubyte(255.0f * temp * temp);
-
- // Flattened sphere
- flareMap[1](i, j, 0) = 255;
- flareMap[1](i, j, 1) = 255;
- flareMap[1](i, j, 2) = 255;
- temp = 2.5f * (1.0f - ((x * x) + (y * y)));
- if (temp > 1.0f) temp = 1.0f;
- if (temp < 0.0f) temp = 0.0f;
- flareMap[1](i, j, 3) = GLubyte(255.0f * temp);
-
- // Torus
- flareMap[2](i, j, 0) = 255;
- flareMap[2](i, j, 1) = 255;
- flareMap[2](i, j, 2) = 255;
- temp = 4.0f * ((x * x) + (y * y)) * (1.0f - ((x * x) + (y * y)));
- if (temp > 1.0f) temp = 1.0f;
- if (temp < 0.0f) temp = 0.0f;
- temp = temp * temp * temp * temp;
- flareMap[2](i, j, 3) = GLubyte(255.0f * temp);
-
- // Kick-ass!
- x = std::abs(x);
- y = std::abs(y);
- float xy = x * y;
- flareMap[3](i, j, 0) = 255;
- flareMap[3](i, j, 1) = 255;
- temp = 0.14f * (1.0f - ((x > y) ? x : y)) / ((xy > 0.05f) ? xy : 0.05f);
- if (temp > 1.0f) temp = 1.0f;
- if (temp < 0.0f) temp = 0.0f;
- flareMap[3](i, j, 2) = GLubyte(255.0f * temp);
- temp = 0.1f * (1.0f - ((x > y) ? x : y)) / ((xy > 0.1f) ? xy : 0.1f);
- if (temp > 1.0f) temp = 1.0f;
- if (temp < 0.0f) temp = 0.0f;
- flareMap[3](i, j, 3) = GLubyte(255.0f * temp);
- }
- }
-
- for (unsigned int i = 0; i < 4; ++i)
- _flare[i] = Common::resources->genTexture(
- GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- 4, FLARESIZE, FLARESIZE, GL_RGBA, GL_UNSIGNED_BYTE,
- &flareMap[i].front(), false
- );
-
- _lists = Common::resources->genLists(4);
- for (unsigned int i = 0; i < 4; ++i) {
- glNewList(_lists + i, GL_COMPILE);
- glBindTexture(GL_TEXTURE_2D, _flare[i]);
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-0.5f, -0.5f, 0.0f);
- glTexCoord2f(1.0f, 0.0f);
- glVertex3f(0.5f, -0.5f, 0.0f);
- glTexCoord2f(0.0f, 1.0f);
- glVertex3f(-0.5f, 0.5f, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(0.5f, 0.5f, 0.0f);
- glEnd();
- glEndList();
- }
-
- blob = _flare[0];
-}
-
-// Draw a flare at a specified (x,y) location on the screen
-// Screen corners are at (0,0) and (1,1)
-void Flares::draw(const Vector& XYZ, const RGBColor& RGB, float alpha) {
- double winX, winY, winZ;
- gluProject(
- XYZ.x(), XYZ.y(), XYZ.z(),
- Hack::modelMat, Hack::projMat, Hack::viewport,
- &winX, &winY, &winZ
- );
- if (winZ > 1.0f)
- return;
-
- // Fade alpha if source is off edge of screen
- float fadeWidth = float(Common::width) * 0.1f;
- if (winY < 0.0f) {
- float temp = fadeWidth + winY;
- if (temp < 0.0f) return;
- alpha *= temp / fadeWidth;
- }
- if (winY > Common::height) {
- float temp = fadeWidth - winY + Common::height;
- if (temp < 0.0f) return;
- alpha *= temp / fadeWidth;
- }
- if (winX < 0) {
- float temp = fadeWidth + winX;
- if (temp < 0.0f) return;
- alpha *= temp / fadeWidth;
- }
- if (winX > Common::width) {
- float temp = fadeWidth - winX + Common::width;
- if (temp < 0.0f) return;
- alpha *= temp / fadeWidth;
- }
-
- float x = (float(winX) / float(Common::width)) * Common::aspectRatio;
- float y = float(winY) / float(Common::height);
-
- // Find lens flare vector
- // This vector runs from the light source through the screen's center
- float dx = 0.5f * Common::aspectRatio - x;
- float dy = 0.5f - y;
-
- glPushAttrib(GL_ENABLE_BIT);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
- glEnable(GL_BLEND);
- glEnable(GL_TEXTURE_2D);
-
- // Setup projection matrix
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- gluOrtho2D(0, Common::aspectRatio, 0, 1.0f);
-
- // Update fractal flickering
- static float flicker = 0.95f;
- flicker += Common::elapsedSecs * (Common::randomFloat(2.0f) - 1.0f);
- if (flicker < 0.9f) flicker = 0.9f;
- if (flicker > 1.1f) flicker = 1.1f;
- alpha *= flicker;
-
- // Draw stuff
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
-
- glLoadIdentity();
- glTranslatef(x, y, 0.0f);
- glScalef(0.1f * flicker, 0.1f * flicker, 1.0f);
- glColor4f(RGB.r(), RGB.g(), RGB.b() * 0.8f, alpha);
- glCallList(_lists + 0);
-
- // wide flare
- glLoadIdentity();
- glTranslatef(x, y, 0.0f);
- glScalef(5.0f * alpha, 0.05f * alpha, 1.0f);
- glColor4f(RGB.r() * 0.3f, RGB.g() * 0.3f, RGB.b(), alpha);
- glCallList(_lists + 0);
-
- // torus
- glLoadIdentity();
- glTranslatef(x, y, 0.0f);
- glScalef(0.5f, 0.2f, 1.0f);
- glColor4f(RGB.r(), RGB.g() * 0.5f, RGB.b() * 0.5f, alpha * 0.4f);
- glCallList(_lists + 2);
-
- // 3 blueish dots
- glLoadIdentity();
- glTranslatef(x + dx * 0.35f, y + dy * 0.35f, 0.0f);
- glScalef(0.06f, 0.06f, 1.0f);
- glColor4f(RGB.r() * 0.85f, RGB.g() * 0.85f, RGB.b(), alpha * 0.5f);
- glCallList(_lists + 1);
-
- glLoadIdentity();
- glTranslatef(x + dx * 0.45f, y + dy * 0.45f, 0.0f);
- glScalef(0.09f, 0.09f, 1.0f);
- glColor4f(RGB.r() * 0.7f, RGB.g() * 0.7f, RGB.b(), alpha * 0.4f);
- glCallList(_lists + 1);
-
- glLoadIdentity();
- glTranslatef(x + dx * 0.55f, y + dy * 0.55f, 0.0f);
- glScalef(0.12f, 0.12f, 1.0f);
- glColor4f(RGB.r() * 0.55f, RGB.g() * 0.55f, RGB.b(), alpha * 0.3f);
- glCallList(_lists + 1);
-
- // 4 more dots
- glLoadIdentity();
- glTranslatef(x + dx * 0.75f, y + dy * 0.75f, 0.0f);
- glScalef(0.14f, 0.07f, 1.0f);
- glColor4f(RGB.r() * 0.3f, RGB.g() * 0.3f, RGB.b() * 0.3f, alpha);
- glCallList(_lists + 3);
-
- glLoadIdentity();
- glTranslatef(x + dx * 0.78f, y + dy * 0.78f, 0.0f);
- glScalef(0.06f, 0.06f, 1.0f);
- glColor4f(RGB.r() * 0.3f, RGB.g() * 0.4f, RGB.b() * 0.4f, alpha * 0.5f);
- glCallList(_lists + 1);
-
- glLoadIdentity();
- glTranslatef(x + dx * 1.25f, y + dy * 1.25f, 0.0f);
- glScalef(0.1f, 0.1f, 1.0f);
- glColor4f(RGB.r() * 0.3f, RGB.g() * 0.4f, RGB.b() * 0.3f, alpha * 0.5f);
- glCallList(_lists + 1);
-
- glLoadIdentity();
- glTranslatef(x + dx * 1.3f, y + dy * 1.3f, 0.0f);
- glScalef(0.07f, 0.07f, 1.0f);
- glColor4f(RGB.r() * 0.6f, RGB.g() * 0.45f, RGB.b() * 0.3f, alpha * 0.5f);
- glCallList(_lists + 1);
-
- // stretched weird flare
- glLoadIdentity();
- glTranslatef(x + dx * 1.45f, y + dy * 1.45f, 0.0f);
- glScalef(0.8f, 0.2f, 1.0f);
- glRotatef(x * 70.0f, 0, 0, 1);
- glColor4f(RGB.r(), RGB.g(), RGB.b(), alpha * 0.4f);
- glCallList(_lists + 3);
-
- // circle
- glLoadIdentity();
- glTranslatef(x + dx * 2.0f, y + dy * 2.0f, 0.0f);
- glScalef(0.3f, 0.3f, 1.0f);
- glColor4f(RGB.r(), RGB.g(), RGB.b(), alpha * 0.2f);
- glCallList(_lists + 1);
-
- // big weird flare
- glLoadIdentity();
- glTranslatef(x + dx * 2.4f, y + dy * 2.4f, 0.0f);
- glRotatef(y * 40.0f, 0, 0, 1);
- glScalef(0.7f, 0.7f, 1.0f);
- glColor4f(RGB.r(), RGB.g(), RGB.b(), alpha * 0.3f);
- glCallList(_lists + 3);
-
- // Unsetup projection matrix
- glPopMatrix();
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
-
- glPopAttrib();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/flares.hh b/xbmc/screensavers/rsxs-0.9/src/hyperspace/flares.hh
deleted file mode 100644
index 975e3c23be..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/flares.hh
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _FLARES_HH
-#define _FLARES_HH
-
-#include <common.hh>
-
-#include <color.hh>
-
-namespace Flares {
- extern GLuint blob;
-
- void init();
- void draw(const Vector&, const RGBColor&, float);
-};
-
-#endif // _FLARES_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/goo.cc b/xbmc/screensavers/rsxs-0.9/src/hyperspace/goo.cc
deleted file mode 100644
index 72aba8928e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/goo.cc
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <goo.hh>
-#include <hyperspace.hh>
-#include <implicit.hh>
-#include <nebula.hh>
-#include <vector.hh>
-
-namespace Goo {
- int _resolution;
- float _unitSize;
- float _volumeSize;
- int _arraySize;
-
- std::vector<Implicit> _surface;
- std::vector<bool> _useSurface;
-
- float _centerX, _centerZ;
- float _shiftX, _shiftZ;
-
- float _goo[4];
- float _gooPhase[4] = { 0.0f, 1.0f, 2.0f, 3.0f };
- float _gooSpeed[4] = {
- 0.1f + Common::randomFloat(0.4f),
- 0.1f + Common::randomFloat(0.4f),
- 0.1f + Common::randomFloat(0.4f),
- 0.1f + Common::randomFloat(0.4f)
- };
- float _gooRGB[4];
-
- float function(const Vector&);
-};
-
-#define AT(x, y) ((x) * _arraySize + (y))
-
-void Goo::init() {
- _volumeSize = 2.0f;
- _resolution = (Hack::resolution < 5 ? 5 : Hack::resolution);
- _unitSize = _volumeSize / float(_resolution);
- _arraySize = 2 * int(0.99f + Hack::fogDepth / _volumeSize);
-
- Implicit::init(_resolution, _resolution, _resolution, _unitSize);
-
- stdx::construct_n(_surface, _arraySize * _arraySize, &function);
- stdx::construct_n(_useSurface, _arraySize * _arraySize, false);
-}
-
-void Goo::update(float heading, float fov) {
- float halfFov = 0.5f * fov;
-
- _centerX = _unitSize * float(int(0.5f + Hack::camera.x() / _unitSize));
- _centerZ = _unitSize * float(int(0.5f + Hack::camera.z() / _unitSize));
-
- float clip[3][2];
- clip[0][0] = std::cos(heading + halfFov);
- clip[0][1] = -std::sin(heading + halfFov);
- clip[1][0] = -std::cos(heading - halfFov);
- clip[1][1] = std::sin(heading - halfFov);
- clip[2][0] = std::sin(heading);
- clip[2][1] = -std::cos(heading);
-
- for (int i = 0; i < _arraySize; ++i) {
- for (int j = 0; j < _arraySize; ++j) {
- _shiftX = _volumeSize * (0.5f + float(int(i) - int(_arraySize) / 2));
- _shiftZ = _volumeSize * (0.5f + float(int(j) - int(_arraySize) / 2));
- if (_shiftX * clip[0][0] + _shiftZ * clip[0][1] > _volumeSize * -M_SQRT2) {
- if (_shiftX * clip[1][0] + _shiftZ * clip[1][1] > _volumeSize * -M_SQRT2) {
- if (_shiftX * clip[2][0] + _shiftZ * clip[2][1] < Hack::fogDepth + _volumeSize * M_SQRT2) {
- _shiftX += _centerX;
- _shiftZ += _centerZ;
- _surface[AT(i, j)].update(0.4f);
- _useSurface[AT(i, j)] = true;
- }
- }
- }
- }
- }
-
- // calculate color
- static float gooRGBphase[3] = { -0.1f, -0.1f, -0.1f };
- static float gooRGBspeed[3] = {
- Common::randomFloat(0.02f) + 0.02f,
- Common::randomFloat(0.02f) + 0.02f,
- Common::randomFloat(0.02f) + 0.02f
- };
- for (int i = 0; i < 3; ++i) {
- gooRGBphase[i] += gooRGBspeed[i] * Common::elapsedTime;
- if (gooRGBphase[i] >= M_PI * 2.0f) gooRGBphase[i] -= M_PI * 2.0f;
- _gooRGB[i] = std::sin(gooRGBphase[i]);
- if (_gooRGB[i] < 0.0f) _gooRGB[i] = 0.0f;
- }
-
- // update goo function constants
- for (int i = 0; i < 4; ++i) {
- _gooPhase[i] += _gooSpeed[i] * Common::elapsedTime;
- if (_gooPhase[i] >= M_PI * 2.0f) _gooPhase[i] -= M_PI * 2.0f;
- _goo[i] = 0.25f * std::cos(_gooPhase[i]);
- }
-}
-
-void Goo::draw() {
- glPushAttrib(GL_ENABLE_BIT);
- Nebula::use();
- if (Hack::shaders)
- _gooRGB[3] = Hack::lerp;
- else
- _gooRGB[3] = 1.0f;
-
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
- glEnable(GL_BLEND);
- glColor4fv(_gooRGB);
-
- for (int i = 0; i < _arraySize; ++i) {
- for (int j = 0; j < _arraySize; ++j) {
- if (_useSurface[AT(i, j)]) {
- float shiftX = _centerX + _volumeSize * (0.5f + float(int(i) - int(_arraySize) / 2));
- float shiftZ = _centerZ + _volumeSize * (0.5f + float(int(j) - int(_arraySize) / 2));
- glPushMatrix();
- glTranslatef(shiftX, 0.0f, shiftZ);
- _surface[AT(i, j)].draw();
- glPopMatrix();
- _useSurface[AT(i, j)] = false;
- }
- }
- }
- glPopAttrib();
-}
-
-float Goo::function(const Vector& XYZ) {
- float pX = XYZ.x() + _shiftX;
- float pZ = XYZ.z() + _shiftZ;
- float camX = pX - Hack::camera.x();
- float camZ = pZ - Hack::camera.z();
-
- return
- // This first term defines upper and lower surfaces.
- XYZ.y() * XYZ.y() * 1.25f
- // These terms make the surfaces wavy.
- + _goo[0] * std::cos(pX - 2.71f * XYZ.y())
- + _goo[1] * std::cos(4.21f * XYZ.y() + pZ)
- + _goo[2] * std::cos(1.91f * pX - 1.67f * pZ)
- + _goo[3] * std::cos(1.53f * pX + 1.11f * XYZ.y() + 2.11f * pZ)
- // The last term creates a bubble around the eyepoint so it doesn't
- // punch through the surface.
- - 0.1f / (camX * camX + XYZ.y() * XYZ.y() + camZ * camZ);
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/goo.hh b/xbmc/screensavers/rsxs-0.9/src/hyperspace/goo.hh
deleted file mode 100644
index a3deb28477..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/goo.hh
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _GOO_HH
-#define _GOO_HH
-
-#include <common.hh>
-
-namespace Goo {
- void init();
- void update(float, float);
- void draw();
-};
-
-#endif // _GOO_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/hyperspace.cc b/xbmc/screensavers/rsxs-0.9/src/hyperspace/hyperspace.cc
deleted file mode 100644
index e195df179e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/hyperspace.cc
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <extensions.hh>
-#include <flares.hh>
-#include <goo.hh>
-#include <hack.hh>
-#include <nebula.hh>
-#include <particle.hh>
-#include <spline.hh>
-#include <starburst.hh>
-#include <tunnel.hh>
-
-namespace Hack {
- unsigned int numStars = 1000;
- float starSize = 10.0f;
- unsigned int depth = 5;
- float fov = 50.0f;
- float speed = 10.0f;
- unsigned int resolution = 10;
- bool shaders = true;
-};
-
-namespace Hack {
- unsigned int frames;
- unsigned int current;
-
- float fogDepth;
- Vector camera, dir;
- float unroll;
- float lerp;
-
- int viewport[4];
- double projMat[16];
- double modelMat[16];
-};
-
-namespace Hack {
- enum Arguments {
- ARG_STARS = 1,
- ARG_SIZE,
- ARG_DEPTH,
- ARG_FOV,
- ARG_SPEED,
- ARG_RESOLUTION,
- ARG_SHADERS = 0x100, ARG_NO_SHADERS
- };
-
- std::vector<StretchedParticle> _stars;
- StretchedParticle* _sun;
-
- float gooFunction(const Vector&);
- float nextFrame();
-
- error_t parse(int, char*, struct argp_state*);
-};
-
-error_t Hack::parse(int key, char* arg, struct argp_state* state) {
- switch (key) {
- case ARG_STARS:
- if (Common::parseArg(arg, numStars, 0u, 10000u))
- argp_failure(state, EXIT_FAILURE, 0,
- "stars must be between 0 and 10000");
- return 0;
- case ARG_SIZE:
- if (Common::parseArg(arg, starSize, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "star size must be between 1 and 100");
- return 0;
- case ARG_DEPTH:
- if (Common::parseArg(arg, depth, 1u, 10u))
- argp_failure(state, EXIT_FAILURE, 0,
- "depth must be between 1 and 10");
- return 0;
- case ARG_FOV:
- if (Common::parseArg(arg, fov, 10.0f, 150.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "field of view must be between 10 and 150");
- return 0;
- case ARG_SPEED:
- if (Common::parseArg(arg, speed, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "speed must be between 1 and 100");
- return 0;
- case ARG_RESOLUTION:
- if (Common::parseArg(arg, resolution, 4u, 20u))
- argp_failure(state, EXIT_FAILURE, 0,
- "resolution must be between 4 and 20");
- return 0;
- case ARG_SHADERS:
- shaders = true;
- return 0;
- case ARG_NO_SHADERS:
- shaders = false;
- return 0;
- default:
- return ARGP_ERR_UNKNOWN;
- }
-}
-
-const struct argp* Hack::getParser() {
- static struct argp_option options[] = {
- { NULL, 0, NULL, 0, "Hyperspace options:" },
- { "stars", ARG_STARS, "NUM", 0,
- "Number of stars (0-10000, default = 1000)" },
- { "size", ARG_SIZE, "NUM", 0,
- "Star size (1-100, default = 10)" },
- { "depth", ARG_DEPTH, "NUM", 0, "Depth (1-10, default = 5)" },
- { "fov", ARG_FOV, "NUM", 0, "Field of view (10-150, default = 90)" },
- { "speed", ARG_SPEED, "NUM", 0, "Speed (1-100, default = 10)" },
- { "resolution", ARG_RESOLUTION, "NUM", 0,
- "Resolution (4-20, default = 10)" },
- { "shaders", ARG_SHADERS, NULL, OPTION_HIDDEN,
- "Disable shaders" },
- { "no-shaders", ARG_NO_SHADERS, NULL, OPTION_ALIAS },
- {}
- };
- static struct argp parser =
- { options, parse, NULL, "Soar through wormholes in liquid spacetime." };
- return &parser;
-}
-
-std::string Hack::getShortName() { return "hyperspace"; }
-std::string Hack::getName() { return "Hyperspace"; }
-
-float Hack::nextFrame() {
- static float time = 0.0f;
- time += Common::elapsedTime;
-
- // loop frames every 2 seconds
- static float frameTime = 2.0f / float(frames);
-
- while (time > frameTime) {
- time -= frameTime;
- current++;
- if (current == frames) current = 0;
- }
-
- return time / frameTime;
-}
-
-void Hack::start() {
- glViewport(0, 0, Common::width, Common::height);
- viewport[0] = 0;
- viewport[1] = 0;
- viewport[2] = Common::width;
- viewport[3] = Common::height;
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(fov, Common::aspectRatio, 0.001f, 200.0f);
- glGetDoublev(GL_PROJECTION_MATRIX, projMat);
- glMatrixMode(GL_MODELVIEW);
-
- try {
- Shaders::init();
- shaders = true;
- } catch (...) {
- shaders = false;
- }
- Hack::frames = shaders ? 20 : 60;
-
- glDisable(GL_DEPTH_TEST);
- glEnable(GL_BLEND);
- glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
- glEnable(GL_TEXTURE_2D);
- glDisable(GL_LIGHTING);
-
- Flares::init();
- Spline::init(depth * 2 + 6);
- Tunnel::init();
-
- fogDepth = depth * 2.0f - 2.0f / float(resolution);
- Goo::init();
-
- _stars.reserve(numStars);
- for (unsigned int i = 0; i < numStars; ++i) {
- RGBColor color(
- 0.5f + Common::randomFloat(0.5f),
- 0.5f + Common::randomFloat(0.5f),
- 0.5f + Common::randomFloat(0.5f)
- );
- switch (Common::randomInt(3)) {
- case 0: color.r() = 1.0f; break;
- case 1: color.g() = 1.0f; break;
- case 2: color.b() = 1.0f; break;
- }
- _stars.push_back(StretchedParticle(
- Vector(
- Common::randomFloat(2.0f * fogDepth) - fogDepth,
- Common::randomFloat(4.0f) - 2.0f,
- Common::randomFloat(2.0f * fogDepth) - fogDepth
- ),
- Common::randomFloat(starSize * 0.001f) + starSize * 0.001f,
- color, fov
- ));
- }
-
- _sun = new StretchedParticle(
- Vector(0.0f, 2.0f, 0.0f), starSize * 0.004f,
- RGBColor(1.0f, 1.0f, 1.0f), fov
- );
- Common::resources->manage(_sun);
-
- StarBurst::init();
- Nebula::init();
- current = 0;
-
- glEnable(GL_FOG);
- float fog_color[4] = { 0.0f, 0.0f, 0.0f, 1.0f };
- glFogfv(GL_FOG_COLOR, fog_color);
- glFogf(GL_FOG_MODE, GL_LINEAR);
- glFogf(GL_FOG_START, fogDepth * 0.7f);
- glFogf(GL_FOG_END, fogDepth);
-}
-
-void Hack::tick() {
- glMatrixMode(GL_MODELVIEW);
-
- // Camera movements
- static float heading[3] = { 0.0f, 0.0f, 0.0f }; // current, target, and last
- static bool headingChange = true;
- static float headingChangeTime[2] = { 20.0f, 0.0f }; // total, elapsed
- static float roll[3] = { 0.0f, 0.0f, 0.0f }; // current, target, and last
- static bool rollChange = true;
- static float rollChangeTime[2] = { 1.0f, 0.0f }; // total, elapsed
- headingChangeTime[1] += Common::elapsedTime;
- if( headingChangeTime[1] >= headingChangeTime[0]) { // Choose new direction
- headingChangeTime[0] = Common::randomFloat(15.0f) + 5.0f;
- headingChangeTime[1] = 0.0f;
- heading[2] = heading[1]; // last = target
- if (headingChange) {
- // face forward most of the time
- if (Common::randomInt(6))
- heading[1] = 0.0f;
- // face backward the rest of the time
- else if (Common::randomInt(2))
- heading[1] = M_PI;
- else
- heading[1] = -M_PI;
- headingChange = false;
- } else
- headingChange = true;
- }
- float t = headingChangeTime[1] / headingChangeTime[0];
- t = 0.5f * (1.0f - std::cos(M_PI * t));
- heading[0] = heading[1] * t + heading[2] * (1.0f - t);
- rollChangeTime[1] += Common::elapsedTime;
- if (rollChangeTime[1] >= rollChangeTime[0]) { // Choose new roll angle
- rollChangeTime[0] = Common::randomFloat(5.0f) + 10.0f;
- rollChangeTime[1] = 0.0f;
- roll[2] = roll[1]; // last = target
- if (rollChange) {
- roll[1] = Common::randomFloat(M_PI * 4.0f) - M_PI * 2.0f;
- rollChange = false;
- } else
- rollChange = true;
- }
- t = rollChangeTime[1] / rollChangeTime[0];
- t = 0.5f * (1.0f - std::cos(M_PI * t));
- roll[0] = roll[1] * t + roll[2] * (1.0f - t);
-
- Spline::moveAlongPath(speed * Common::elapsedTime * 0.03f);
- Spline::update(Common::elapsedTime);
- camera = Spline::at(depth + 2, Spline::step);
- dir = Spline::direction(depth + 2, Spline::step);
- float pathAngle = std::atan2(-dir.x(), -dir.z());
-
- glLoadIdentity();
- glRotatef(-roll[0] * R2D, 0, 0, 1);
- glRotatef((-pathAngle - heading[0]) * R2D, 0, 1, 0);
- glTranslatef(-camera.x(), -camera.y(), -camera.z());
- glGetDoublev(GL_MODELVIEW_MATRIX, modelMat);
- unroll = roll[0] * R2D;
-
- // calculate diagonal fov
- float diagFov = 0.5f * fov * D2R;
- diagFov = std::tan(diagFov);
- diagFov = std::sqrt(diagFov * diagFov + (diagFov * Common::aspectRatio * diagFov * Common::aspectRatio));
- diagFov = 2.0f * std::atan(diagFov);
-
- // clear
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT);
-
- // pick animated texture frame
- lerp = Hack::nextFrame();
-
- // draw stars
- glEnable(GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, Flares::blob);
- for (
- std::vector<StretchedParticle>::iterator i = _stars.begin();
- i < _stars.end();
- ++i
- ) {
- i->update();
- i->draw();
- }
-
- // draw goo
- Goo::update(pathAngle + heading[0], diagFov);
- Goo::draw();
-
- // update starburst
- StarBurst::update();
- StarBurst::draw();
-
- // draw tunnel
- Tunnel::draw();
-
- // draw sun with lens flare
- glDisable(GL_FOG);
- static Vector flarePos(0.0f, 2.0f, 0.0f);
- glBindTexture(GL_TEXTURE_2D, Flares::blob);
- _sun->draw();
- float alpha = 0.5f - 0.005f * (flarePos - camera).length();
- if (alpha > 0.0f)
- Flares::draw(flarePos, RGBColor(1.0f, 1.0f, 1.0f), alpha);
- glEnable(GL_FOG);
-
- Common::flush();
-}
-
-void Hack::reshape() {
- glViewport(0, 0, Common::width, Common::height);
- viewport[0] = 0;
- viewport[1] = 0;
- viewport[2] = Common::width;
- viewport[3] = Common::height;
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(fov, Common::aspectRatio, 0.001f, 200.0f);
- glGetDoublev(GL_PROJECTION_MATRIX, projMat);
- glMatrixMode(GL_MODELVIEW);
-}
-
-void Hack::stop() {}
-
-void Hack::keyPress(char c, const KeySym&) {
- switch (c) {
- case 3: case 27:
- case 'q': case 'Q':
- Common::running = false;
- break;
- }
-}
-
-void Hack::keyRelease(char, const KeySym&) {}
-void Hack::pointerMotion(int, int) {}
-void Hack::buttonPress(unsigned int) {}
-void Hack::buttonRelease(unsigned int) {}
-void Hack::pointerEnter() {}
-void Hack::pointerLeave() {}
-
-#define _LINUX
-#include "../../../addons/include/xbmc_scr_dll.h"
-
-extern "C" {
-
-ADDON_STATUS Create(void* hdl, void* props)
-{
- if (!props)
- return STATUS_UNKNOWN;
-
- SCR_PROPS* scrprops = (SCR_PROPS*)props;
-
- Common::width = scrprops->width;
- Common::height = scrprops->height;
- Common::aspectRatio = float(Common::width) / float(Common::height);
-
- return STATUS_OK;
-}
-
-void Start()
-{
- Hack::start();
-}
-
-void Render()
-{
- Hack::tick();
-}
-
-void Stop()
-{
- Hack::stop();
-}
-
-void Destroy()
-{
-}
-
-ADDON_STATUS GetStatus()
-{
- return STATUS_OK;
-}
-
-bool HasSettings()
-{
- return false;
-}
-
-unsigned int GetSettings(StructSetting ***sSet)
-{
- return 0;
-}
-
-ADDON_STATUS SetSetting(const char *settingName, const void *settingValue)
-{
- return STATUS_OK;
-}
-
-void FreeSettings()
-{
-}
-
-void GetInfo(SCR_INFO *info)
-{
-}
-
-void Remove()
-{
-}
-
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/hyperspace.hh b/xbmc/screensavers/rsxs-0.9/src/hyperspace/hyperspace.hh
deleted file mode 100644
index 72a32dab6e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/hyperspace.hh
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _HYPERSPACE_HH
-#define _HYPERSPACE_HH
-
-#include <common.hh>
-
-#include <vector.hh>
-
-namespace Hack {
- extern unsigned int resolution;
- extern bool shaders;
-
- extern unsigned int frames;
- extern unsigned int current;
-
- extern float fogDepth;
- extern Vector camera, dir;
- extern float unroll;
- extern float lerp;
-
- extern int viewport[4];
- extern double projMat[16];
- extern double modelMat[16];
-};
-
-#endif // _HYPERSPACE_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/nebula.cc b/xbmc/screensavers/rsxs-0.9/src/hyperspace/nebula.cc
deleted file mode 100644
index 495c3ff1f5..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/nebula.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <cubemaps.hh>
-#include <hyperspace.hh>
-#include <nebula.hh>
-#include <pngimage.hh>
-
-namespace Nebula {
- GLuint _texture;
-};
-
-void Nebula::init() {
- PNG png("nebula.png");
-
-#if USE_GL_EXTENSIONS
- if (Hack::shaders) {
- _texture = Common::resources->genCubeMapTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE,
- png
- );
- WavyNormalCubeMaps::init();
- } else
-#endif // USE_GL_EXTENSIONS
- {
- unsigned int h = png.height();
- unsigned int w = png.width();
- float halfH = float(h) / 2.0f;
- float halfW = float(w) / 2.0f;
-
- stdx::dim3<float, 3> _nebulaMap(w, h);
- for (unsigned int i = 0; i < h; ++i) {
- float y = (float(i) - halfH) / halfH;
- for (unsigned int j = 0; j < w; ++j) {
- float x = (float(j) - halfW) / halfW;
- float temp = Common::clamp(
- (x * x) + (y * y),
- 0.0f, 1.0f
- );
- RGBColor color(png(i, j));
- _nebulaMap(i, j, 0) = color.r() * temp;
- _nebulaMap(i, j, 1) = color.g() * temp;
- _nebulaMap(i, j, 2) = color.b() * temp;
- }
- }
- _texture = Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- 3, w, h, GL_RGB, GL_FLOAT, &_nebulaMap.front()
- );
- glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
- glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
- }
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/nebula.hh b/xbmc/screensavers/rsxs-0.9/src/hyperspace/nebula.hh
deleted file mode 100644
index 03f04eef0b..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/nebula.hh
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _NEBULA_HH
-#define _NEBULA_HH
-
-#include <common.hh>
-
-#include <cubemaps.hh>
-#include <extensions.hh>
-#include <hyperspace.hh>
-#include <shaders.hh>
-
-namespace Nebula {
- typedef Common::Exception Exception;
-
- void init();
- float update();
-
- extern GLuint _texture;
-
- inline void use() {
-#if USE_GL_EXTENSIONS
- if (Hack::shaders) {
- glDisable(GL_TEXTURE_2D);
- glEnable(GL_TEXTURE_CUBE_MAP_ARB);
- Extensions::glActiveTextureARB(GL_TEXTURE2_ARB);
- glBindTexture(
- GL_TEXTURE_CUBE_MAP_ARB,
- _texture
- );
- Extensions::glActiveTextureARB(GL_TEXTURE1_ARB);
- glBindTexture(
- GL_TEXTURE_CUBE_MAP_ARB,
- WavyNormalCubeMaps::textures[(Hack::current + 1) % Hack::frames]
- );
- Extensions::glActiveTextureARB(GL_TEXTURE0_ARB);
- glBindTexture(
- GL_TEXTURE_CUBE_MAP_ARB,
- WavyNormalCubeMaps::textures[Hack::current]
- );
- Extensions::glBindProgramARB(
- GL_VERTEX_PROGRAM_ARB,
- Shaders::gooVP
- );
- glEnable(GL_VERTEX_PROGRAM_ARB);
- Extensions::glBindProgramARB(
- GL_FRAGMENT_PROGRAM_ARB,
- Shaders::gooFP
- );
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
- } else
-#endif // USE_GL_EXTENSIONS
- {
- glBindTexture(GL_TEXTURE_2D, _texture);
- glEnable(GL_TEXTURE_2D);
- glEnable(GL_TEXTURE_GEN_S);
- glEnable(GL_TEXTURE_GEN_T);
- }
- }
-};
-
-#endif // _NEBULA_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/nebula.png b/xbmc/screensavers/rsxs-0.9/src/hyperspace/nebula.png
deleted file mode 100644
index b9c3a37add..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/nebula.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/particle.cc b/xbmc/screensavers/rsxs-0.9/src/hyperspace/particle.cc
deleted file mode 100644
index 56e4ff4a41..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/particle.cc
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <hyperspace.hh>
-#include <particle.hh>
-
-StretchedParticle::StretchedParticle(
- const Vector& XYZ, float radius, const RGBColor& color, float fov) :
- _XYZ(XYZ), _lastXYZ(XYZ), _radius(radius),
- _color(color), _fov(fov), _moved(true) {
- _lastScreenPos[0] = _lastScreenPos[1] = 0.0f;
-}
-
-void StretchedParticle::update() {
- Vector temp(_XYZ - Hack::camera);
- if (temp.x() > Hack::fogDepth) {
- _XYZ.x() = _XYZ.x() - Hack::fogDepth * 2.0f;
- _lastXYZ.x() = _lastXYZ.x() - Hack::fogDepth * 2.0f;
- }
- if (temp.x() < -Hack::fogDepth) {
- _XYZ.x() = _XYZ.x() + Hack::fogDepth * 2.0f;
- _lastXYZ.x() = _lastXYZ.x() + Hack::fogDepth * 2.0f;
- }
- if (temp.z() > Hack::fogDepth) {
- _XYZ.z() = _XYZ.z() - Hack::fogDepth * 2.0f;
- _lastXYZ.z() = _lastXYZ.z() - Hack::fogDepth * 2.0f;
- }
- if (temp.z() < -Hack::fogDepth) {
- _XYZ.z() = _XYZ.z() + Hack::fogDepth * 2.0f;
- _lastXYZ.z() = _lastXYZ.z() + Hack::fogDepth * 2.0f;
- }
-}
-
-void StretchedParticle::draw() {
- double winX, winY, winZ;
- gluProject(
- _XYZ.x(), _XYZ.y(), _XYZ.z(),
- Hack::modelMat, Hack::projMat, Hack::viewport,
- &winX, &winY, &winZ
- );
-
- double screenPos[2];
- if (winZ > 0.0f) {
- screenPos[0] = winX;
- screenPos[1] = winY;
- } else {
- screenPos[0] = _lastScreenPos[0];
- screenPos[1] = _lastScreenPos[1];
- }
-
- Vector drawXYZ((_XYZ + _lastXYZ) * 0.5f);
- _lastXYZ = _XYZ;
-
- if (_moved) {
- // Window co-ords are screwed, so skip it
- _moved = false;
- } else {
- float sd[2]; // screen difference, position difference
- sd[0] = float(screenPos[0] - _lastScreenPos[0]);
- sd[1] = float(screenPos[1] - _lastScreenPos[1]);
-
- Vector pd(Hack::camera - drawXYZ);
- float n = pd.normalize();
- RotationMatrix bbMat = RotationMatrix::lookAt(pd, Vector(), Vector(0, 1, 0));
-
- float stretch = 0.0015f * std::sqrt(sd[0] * sd[0] + sd[1] * sd[1]) * n / _radius;
- if (stretch < 1.0f) stretch = 1.0f;
- if (stretch > 0.5f / _radius) stretch = 0.5f / _radius;
- glPushMatrix();
- glTranslatef(drawXYZ.x(), drawXYZ.y(), drawXYZ.z());
- glMultMatrixf(bbMat.get());
- glRotatef(R2D * std::atan2(sd[1], sd[0]) + Hack::unroll, 0, 0, 1);
- glScalef(stretch, 1.0f, 1.0f);
- float darkener = stretch * 0.5f;
- if (darkener < 1.0f) darkener = 1.0f;
- // draw colored aura
- glColor3f(_color.r() / darkener, _color.g() / darkener, _color.b() / darkener);
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-_radius, -_radius, 0.0f);
- glTexCoord2f(1.0f, 0.0f);
- glVertex3f(_radius, -_radius, 0.0f);
- glTexCoord2f(0.0f, 1.0f);
- glVertex3f(-_radius, _radius, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(_radius, _radius, 0.0f);
- glEnd();
- // draw white center
- glColor3f(1.0f / darkener, 1.0f / darkener, 1.0f / darkener);
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-_radius * 0.3f, -_radius * 0.3f, 0.0f);
- glTexCoord2f(1.0f, 0.0f);
- glVertex3f(_radius * 0.3f, -_radius * 0.3f, 0.0f);
- glTexCoord2f(0.0f, 1.0f);
- glVertex3f(-_radius * 0.3f, _radius * 0.3f, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(_radius * 0.3f, _radius * 0.3f, 0.0f);
- glEnd();
- glPopMatrix();
- }
-
- _lastScreenPos[0] = screenPos[0];
- _lastScreenPos[1] = screenPos[1];
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/particle.hh b/xbmc/screensavers/rsxs-0.9/src/hyperspace/particle.hh
deleted file mode 100644
index f22a99a6fa..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/particle.hh
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _PARTICLE_H
-#define _PARTICLE_H
-
-#include <common.hh>
-
-#include <color.hh>
-#include <vector.hh>
-
-class StretchedParticle : public ResourceManager::Resource<void> {
-private:
- Vector _XYZ, _lastXYZ;
- float _radius;
- RGBColor _color;
- float _fov;
-
- double _lastScreenPos[2];
- bool _moved;
-public:
- StretchedParticle(const Vector&, float, const RGBColor&, float);
- void operator()() const {}
-
- void update();
- void draw();
-
- const Vector& getPos() const { return _XYZ; }
- void setPos(const Vector& XYZ) {
- _XYZ = _lastXYZ = XYZ; _moved = true;
- }
- void offsetPos(const Vector& XYZ) { _XYZ += XYZ; }
-
- void setColor(const RGBColor& RGB) { _color = RGB; }
-};
-
-#endif // _PARTICLE_H
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/shaders.cc b/xbmc/screensavers/rsxs-0.9/src/hyperspace/shaders.cc
deleted file mode 100644
index 46c8b5b24f..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/shaders.cc
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <extensions.hh>
-#include <shaders.hh>
-
-namespace Shaders {
- GLuint gooVP, gooFP, tunnelVP, tunnelFP;
-};
-
-#if USE_GL_EXTENSIONS
-
-static std::string gooVPasm(
- "!!ARBvp1.0\n"
-
- "PARAM mvp[4] = { state.matrix.mvp };\n"
- "PARAM mvit[4] = { state.matrix.modelview.invtrans };\n"
-
- "TEMP oPos, fogtemp;\n"
-
- "DP4 oPos.x, mvp[0], vertex.position;\n"
- "DP4 oPos.y, mvp[1], vertex.position;\n"
- "DP4 oPos.z, mvp[2], vertex.position;\n"
- "DP4 oPos.w, mvp[3], vertex.position;\n"
- "MOV result.position, oPos;\n"
-
- "MOV result.color, vertex.color;\n"
-
- "MOV result.texcoord[0], vertex.normal;\n"
-
- // vector pointing at eye
- "SUB result.texcoord[1], mvit[3], vertex.position;\n"
-
- "SUB fogtemp, state.fog.params.z, oPos.z;\n"
- "MUL result.fogcoord.x, fogtemp.x, state.fog.params.w;\n"
-
- "END\n"
-);
-
-static std::string gooFPasm(
- "!!ARBfp1.0\n"
-
- "TEMP total, temp, eye_vec, norm, ref_vec, cube_vec, alpha;\n"
-
- // get normal from normal map
- "TEX norm, fragment.texcoord[0], texture[0], CUBE;\n"
- // remap to {-1, 1}
- "MAD norm, norm, 2.0, -1.0;\n"
- // get normal from normal map
- "TEX temp, fragment.texcoord[0], texture[1], CUBE;\n"
- // remap to {-1, 1}
- "MAD temp, temp, 2.0, -1.0;\n"
- // lerp between normals
- "LRP norm, fragment.color.a, temp, norm;\n"
-
- // normalize eye vector
- "DP3 temp.x, fragment.texcoord[1], fragment.texcoord[1];\n"
- "RSQ temp.x, temp.x;\n"
- "MUL eye_vec, fragment.texcoord[1], temp.x;\n"
-
- // calculate reflection vector
- "DP3 temp.x, eye_vec, norm;\n"
- "MUL temp.x, temp.x, 2.0;\n"
- "MUL temp, norm, temp.x;\n"
- "SUB ref_vec, temp, eye_vec;\n"
-
- // use reflection vector to find fragment color
- "TEX total, ref_vec, texture[2], CUBE;\n"
-
- // modulate with vertex color
- "MUL_SAT total, total, fragment.color;\n"
-
- // fresnel alpha
- "DP3 alpha.a, norm, eye_vec;\n"
- "ABS alpha.a, alpha.a;\n"
- "SUB alpha.a, 1.0, alpha.a;\n"
- "MUL_SAT total.a, alpha.a, alpha.a;\n"
-
- // fog
- "LRP result.color, fragment.fogcoord.x, total, state.fog.color;\n"
-
- "END\n"
-);
-
-static std::string tunnelVPasm(
- "!!ARBvp1.0\n"
-
- "PARAM mvp[4] = { state.matrix.mvp };\n"
-
- "TEMP temppos, fogtemp;\n"
-
- "DP4 result.position.x, mvp[0], vertex.position;\n"
- "DP4 result.position.y, mvp[1], vertex.position;\n"
- "DP4 temppos.z, mvp[2], vertex.position;\n"
- "MOV result.position.z, temppos.z;\n"
- "DP4 result.position.w, mvp[3], vertex.position;\n"
-
- "MOV result.color, vertex.color;\n"
- "MOV result.texcoord[0], vertex.texcoord[0];\n"
-
- "SUB fogtemp, state.fog.params.z, temppos.z;\n"
- "MUL result.fogcoord.x, fogtemp.x, state.fog.params.w;\n"
-
- "END\n"
-);
-
-static std::string tunnelFPasm(
- "!!ARBfp1.0\n"
-
- "TEMP temp, vertcolor, color, tex0, tex1, coord;\n"
-
- // texture
- "TEX tex0, fragment.texcoord[0], texture[0], 2D;\n"
- "TEX tex1, fragment.texcoord[0], texture[1], 2D;\n"
- "LRP tex0, fragment.color.a, tex1, tex0;\n"
- "MUL color, tex0, fragment.color;\n"
-
- // higher resolution texture
- "MUL coord, fragment.texcoord[0], 3.0;\n"
- "TEX tex0, coord, texture[0], 2D;\n"
- "TEX tex1, coord, texture[1], 2D;\n"
- "LRP tex0, fragment.color.a, tex1, tex0;\n"
- "MUL tex0, tex0, 0.5;\n"
- "MUL vertcolor, fragment.color, fragment.color;\n"
- "MAD color, tex0, vertcolor, color;\n"
-
- // set alpha
- "MOV color.a, 1.0;\n"
-
- // fog
- "LRP result.color, fragment.fogcoord.x, color, state.fog.color;\n"
-
- "END\n"
-);
-
-class Program : public ResourceManager::Resource<GLuint> {
-private:
- GLuint _program;
-public:
- Program(
- GLenum target, GLenum format, const std::string& program
- ) {
- Extensions::glGenProgramsARB(1, &_program);
- Extensions::glBindProgramARB(target, _program);
- Extensions::glProgramStringARB(
- target, format, program.length(), program.c_str()
- );
- }
- ~Program() { Extensions::glDeleteProgramsARB(1, &_program); }
- GLuint operator()() const { return _program; }
-};
-
-void Shaders::init() {
- Extensions::init();
-
- gooVP = Common::resources->manage(new Program(
- GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, gooVPasm
- ));
- gooFP = Common::resources->manage(new Program(
- GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, gooFPasm
- ));
-
- tunnelVP = Common::resources->manage(new Program(
- GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, tunnelVPasm
- ));
- tunnelFP = Common::resources->manage(new Program(
- GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, tunnelFPasm
- ));
-}
-
-#else // !USE_GL_EXTENSIONS
-
-void Shaders::init() {
- throw Common::Exception("No shader support");
-}
-
-#endif // !USE_GL_EXTENSIONS
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/shaders.hh b/xbmc/screensavers/rsxs-0.9/src/hyperspace/shaders.hh
deleted file mode 100644
index 91655fe53e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/shaders.hh
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _SHADERS_H
-#define _SHADERS_H
-
-#include <common.hh>
-
-namespace Shaders {
- extern GLuint gooVP, gooFP, tunnelVP, tunnelFP;
-
- void init();
-};
-
-#endif // _SHADERS_H
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/spline.cc b/xbmc/screensavers/rsxs-0.9/src/hyperspace/spline.cc
deleted file mode 100644
index 1314b53e4d..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/spline.cc
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <spline.hh>
-#include <vector.hh>
-
-namespace Spline {
- unsigned int points;
- float step;
-
- std::vector<float> _phase;
- std::vector<float> _rate;
- std::vector<Vector> _moveXYZ;
- std::vector<Vector> _baseXYZ;
- std::vector<Vector> _XYZ;
- std::vector<Vector> _baseDir;
- std::vector<Vector> _dir;
-
- Vector interpolate(const Vector&, const Vector&, const Vector&, const Vector&, float);
-};
-
-void Spline::init(unsigned int length) {
- // 6 is the minimum number of points necessary for a tunnel to have one segment
- points = (length < 6 ? 6 : length);
- step = 0.0f;
-
- stdx::construct_n(_phase, points);
- stdx::construct_n(_rate, points);
- stdx::construct_n(_moveXYZ, points);
- stdx::construct_n(_baseXYZ, points);
- stdx::construct_n(_XYZ, points);
- stdx::construct_n(_baseDir, points);
- stdx::construct_n(_dir, points);
-
- _baseXYZ[points - 2].z() = 4.0f;
-
- for (unsigned int i = 0; i < points; ++i)
- makeNewPoint();
-}
-
-void Spline::makeNewPoint() {
- // shift points to rear of path
- std::rotate(_baseXYZ.begin(), _baseXYZ.begin() + 1, _baseXYZ.end());
- std::rotate(_moveXYZ.begin(), _moveXYZ.begin() + 1, _moveXYZ.end());
- std::rotate(_XYZ.begin(), _XYZ.begin() + 1, _XYZ.end());
- std::rotate(_phase.begin(), _phase.begin() + 1, _phase.end());
- std::rotate(_rate.begin(), _rate.begin() + 1, _rate.end());
-
- // make vector to new point
- int lastPoint = points - 1;
- float tempX = _baseXYZ[lastPoint - 1].x() - _baseXYZ[lastPoint - 2].x();
- float tempZ = _baseXYZ[lastPoint - 1].z() - _baseXYZ[lastPoint - 2].z();
-
- // find good angle
- float turnAngle;
- float pathAngle = std::atan2(tempX, tempZ);
- float distSquared =
- _baseXYZ[lastPoint].x() * _baseXYZ[lastPoint].x() +
- _baseXYZ[lastPoint].z() * _baseXYZ[lastPoint].z();
- if (distSquared > 10000.0f) {
- float angleToCenter = std::atan2(-_baseXYZ[lastPoint].x(), -_baseXYZ[lastPoint].z());
- turnAngle = angleToCenter - pathAngle;
- if (turnAngle > M_PI)
- turnAngle -= M_PI * 2.0f;
- if (turnAngle < -M_PI)
- turnAngle += M_PI * 2.0f;
- turnAngle = Common::clamp(turnAngle, -0.7f, 0.7f);
- } else
- turnAngle = Common::randomFloat(1.4f) - 0.7f;
-
- // rotate new point to some new position
- float ca = std::cos(turnAngle);
- float sa = std::cos(turnAngle);
- _baseXYZ[lastPoint].set(tempX * ca + tempZ * sa, 0.0f, tempX * -sa + tempZ * ca);
-
- // normalize and set length of vector
- // make it at least length 2, which is the grid size of the goo
- float lengthener = (Common::randomFloat(6.0f) + 2.0f) / _baseXYZ[lastPoint].length();
- _baseXYZ[lastPoint] *= lengthener;
-
- // make new movement vector proportional to base vector
- _moveXYZ[lastPoint].set(
- Common::randomFloat(0.25f) * -_baseXYZ[lastPoint].z(),
- 0.3f,
- Common::randomFloat(0.25f) * -_baseXYZ[lastPoint].x()
- );
-
- // add vector to previous point to get new point
- _baseXYZ[lastPoint] += Vector(
- _baseXYZ[lastPoint - 1].x(),
- 0.0f,
- _baseXYZ[lastPoint - 1].z()
- );
-
- // make new phase and movement rate
- _phase[lastPoint] = Common::randomFloat(M_PI * 2);
- _rate[lastPoint] = Common::randomFloat(1.0f);
-
- // reset base direction vectors
- _baseDir.front() = _baseXYZ[1] - _baseXYZ[points - 1];
- std::transform(
- _baseXYZ.begin() + 2, _baseXYZ.end(),
- _baseXYZ.begin(), _baseDir.begin() + 1,
- std::minus<Vector>()
- );
- _baseDir.back() = _baseXYZ[0] - _baseXYZ[points - 2];
-}
-
-Vector Spline::at(unsigned int section, float where) {
- section = Common::clamp(section, 1u, points - 3);
-
- return interpolate(_XYZ[section - 1], _XYZ[section], _XYZ[section + 1], _XYZ[section + 2], where);
-}
-
-Vector Spline::direction(unsigned int section, float where) {
- section = Common::clamp(section, 1u, points - 3);
-
- Vector direction(interpolate(_dir[section - 1], _dir[section], _dir[section + 1], _dir[section + 2], where));
- direction.normalize();
- return direction;
-}
-
-// Here's a little calculus that takes 4 points
-// and interpolates smoothly between the second and third
-// depending on the value of where which can be 0.0 to 1.0.
-// The slope at b is estimated using a and c. The slope at c
-// is estimated using b and d.
-Vector Spline::interpolate(const Vector& a, const Vector& b, const Vector& c, const Vector& d, float where) {
- return
- (((b * 3.0f) + d - a - (c * 3.0f)) * (where * where * where)) * 0.5f +
- (((a * 2.0f) - (b * 5.0f) + (c * 4.0f) - d) * (where * where)) * 0.5f +
- ((c - a) * where) * 0.5f +
- b;
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/spline.hh b/xbmc/screensavers/rsxs-0.9/src/hyperspace/spline.hh
deleted file mode 100644
index 1a85135891..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/spline.hh
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _SPLINE_HH
-#define _SPLINE_HH
-
-#include <common.hh>
-
-#include <vector.hh>
-
-namespace Spline {
- extern unsigned int points;
- extern float step;
-
- void init(unsigned int);
-
- Vector at(unsigned int, float);
- Vector direction(unsigned int, float);
-
- void makeNewPoint();
- inline void moveAlongPath(float increment) {
- step += increment;
- while (step >= 1.0f) {
- step -= 1.0f;
- makeNewPoint();
- }
- }
-
- extern std::vector<float> _phase;
- extern std::vector<float> _rate;
- extern std::vector<Vector> _moveXYZ;
- extern std::vector<Vector> _baseXYZ;
- extern std::vector<Vector> _XYZ;
- extern std::vector<Vector> _baseDir;
- extern std::vector<Vector> _dir;
-
- inline void update(float multiplier) {
- // calculate xyz positions and direction vectors
- _phase[0] += _rate[0] * multiplier;
- _XYZ[0] = _baseXYZ[0] + _moveXYZ[0] * std::cos(_phase[0]);
- _phase[1] += _rate[1] * multiplier;
- _XYZ[1] = _baseXYZ[1] + _moveXYZ[1] * std::cos(_phase[1]);
- for (unsigned int i = 2; i < points; ++i) {
- _phase[i] += _rate[i] * multiplier;
- _XYZ[i] = _baseXYZ[i] + _moveXYZ[i] * std::cos(_phase[i]);
- _dir[i - 1] = _XYZ[i] - _XYZ[i - 2];
- }
- _dir[points - 1] = _XYZ[0] - _XYZ[points - 2];
- _dir[0] = _XYZ[1] - _XYZ[points - 1];
- }
-};
-
-#endif // _SPLINE_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/starburst.cc b/xbmc/screensavers/rsxs-0.9/src/hyperspace/starburst.cc
deleted file mode 100644
index c21a0e6641..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/starburst.cc
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <flares.hh>
-#include <hyperspace.hh>
-#include <nebula.hh>
-#include <particle.hh>
-#include <shaders.hh>
-#include <starburst.hh>
-
-#define STARBURST_COUNT 200
-
-namespace StarBurst {
- std::vector<StretchedParticle> _stars;
- bool _active[STARBURST_COUNT];
- UnitVector _velocity[STARBURST_COUNT];
- float _size;
- Vector _pos;
-
- GLuint _list;
-
- void drawStars();
-};
-
-void StarBurst::init() {
- for (unsigned int i = 0; i < STARBURST_COUNT; ++i) {
- _stars.push_back(StretchedParticle(
- Vector(), 0.03f, RGBColor(1.0f, 1.0f, 1.0f), 0.0f
- ));
- _active[i] = false;
- _velocity[i] = UnitVector(Vector(
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f
- ));
- }
-
- _list = Common::resources->genLists(1);
- glNewList(_list, GL_COMPILE);
- for (unsigned int j = 0; j < 32; ++j) {
- float cj = std::cos(float(j) * M_PI * 2.0f / 32.0f);
- float sj = std::sin(float(j) * M_PI * 2.0f / 32.0f);
- float cjj = std::cos(float(j + 1) * M_PI * 2.0f / 32.0f);
- float sjj = std::sin(float(j + 1) * M_PI * 2.0f / 32.0f);
- glBegin(GL_TRIANGLE_STRIP);
- for (unsigned int i = 0; i <= 32; ++i) {
- float ci = std::cos(float(i) * M_PI * 2.0f / 32.0f);
- float si = std::sin(float(i) * M_PI * 2.0f / 32.0f);
- glNormal3f(sj * ci, cj, sj * si);
- glVertex3f(sj * ci, cj, sj * si);
- glNormal3f(sjj * ci, cjj, sjj * si);
- glVertex3f(sjj * ci, cjj, sjj * si);
- }
- glEnd();
- }
- glEndList();
-
- _size = 4.0f;
-}
-
-void StarBurst::drawStars() {
- // draw stars
- glEnable(GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, Flares::blob);
- for (unsigned int i = 0; i < STARBURST_COUNT; ++i) {
- _stars[i].offsetPos(_velocity[i] * Common::elapsedTime);
- float distance = (_stars[i].getPos() - Hack::camera).length();
- if (distance > Hack::fogDepth) _active[i] = false;
- if (_active[i]) _stars[i].draw();
- }
-}
-
-void StarBurst::restart(const Vector& XYZ) {
- // don't restart if any star is still active
- for (unsigned int i = 0; i < STARBURST_COUNT; ++i)
- if (_active[i])
- return;
- // or if flare hasn't faded out completely
- if (_size < 3.0f)
- return;
-
- RGBColor RGB(
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f)
- );
- switch (Common::randomInt(3)) {
- case 0: RGB.r() = 1.0f; break;
- case 1: RGB.g() = 1.0f; break;
- case 2: RGB.b() = 1.0f; break;
- }
-
- for (unsigned int i = 0; i < STARBURST_COUNT; ++i) {
- _active[i] = true;
- _stars[i].setPos(XYZ);
- _stars[i].setColor(RGB);
- }
-
- _size = 0.0f;
- _pos = XYZ;
-}
-
-void StarBurst::update() {
- static float starBurstTime = Common::randomFloat(180.0f) + 180.0f; // burst after 3-6 minutes
- starBurstTime -= Common::elapsedTime;
- if (starBurstTime <= 0.0f) {
- Vector pos(
- Hack::camera.x() + (Hack::dir.x() * Hack::fogDepth * 0.5f) +
- Common::randomFloat(Hack::fogDepth * 0.5f) - Hack::fogDepth * 0.25f,
- Common::randomFloat(2.0f) - 1.0f,
- Hack::camera.z() + (Hack::dir.z() * Hack::fogDepth * 0.5f) +
- Common::randomFloat(Hack::fogDepth * 0.5f) - Hack::fogDepth * 0.25f
- );
- StarBurst::restart(pos); // it won't actually restart unless it's ready to
- starBurstTime = Common::randomFloat(540.0f) + 60.0f; // burst again within 1-10 minutes
- }
-}
-
-void StarBurst::draw() {
- drawStars();
-
- _size += Common::elapsedTime * 0.5f;
- if (_size >= 3.0f)
- return;
-
- // draw flare
- float brightness = 1.0f - (_size / 3.0f);
- if (brightness > 0.0f)
- Flares::draw(_pos, RGBColor(1.0f, 1.0f, 1.0f), brightness);
-
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(_size, _size, _size);
-
- // draw sphere
- glPushAttrib(GL_ENABLE_BIT);
- Nebula::use();
-
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
- glEnable(GL_BLEND);
- glColor4f(brightness, brightness, brightness, (Hack::shaders ? Hack::lerp : 1.0f));
- glCallList(_list);
- glPopAttrib();
- glPopMatrix();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/starburst.hh b/xbmc/screensavers/rsxs-0.9/src/hyperspace/starburst.hh
deleted file mode 100644
index 48def510df..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/starburst.hh
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _STARBURST_H
-#define _STARBURST_H
-
-#include <common.hh>
-
-#include <vector.hh>
-
-namespace StarBurst {
- void init();
-
- void restart(const Vector&);
- void update();
- void draw();
-};
-
-#endif // _STARBURST_H
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/tunnel.cc b/xbmc/screensavers/rsxs-0.9/src/hyperspace/tunnel.cc
deleted file mode 100644
index a9e552c800..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/tunnel.cc
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <caustic.hh>
-#include <color.hh>
-#include <spline.hh>
-#include <tunnel.hh>
-#include <vector.hh>
-
-#define TUNNEL_RESOLUTION 20
-
-namespace Tunnel {
- unsigned int _numSections;
- unsigned int _section;
-
- float _radius;
- float _widthOffset;
- float _texSpin;
-
- stdx::dim3<Vector, TUNNEL_RESOLUTION + 1, TUNNEL_RESOLUTION + 1> _v;
- stdx::dim3<Vector, TUNNEL_RESOLUTION + 1, TUNNEL_RESOLUTION + 1> _t;
- stdx::dim3<RGBColor, TUNNEL_RESOLUTION + 1, TUNNEL_RESOLUTION + 1> _c;
-
- float _loH, _loS, _loL;
- float _hiH, _hiS, _hiL;
-
- void make();
-};
-
-void Tunnel::init() {
- CausticTextures::init();
-
- _radius = 0.1f;
- _widthOffset = 0.0f;
- _texSpin = 0.0f;
-
- _numSections = Spline::points - 5;
- _section = 0;
-
- _v.resize(_numSections);
- _t.resize(_numSections);
- _c.resize(_numSections);
-
- _loH = _loS = _hiH = _hiS = 0.0f;
- _loL = _hiL = M_PI;
-}
-
-void Tunnel::make() {
- _widthOffset += Common::elapsedTime * 1.5f;
- while (_widthOffset >= M_PI * 2.0f)
- _widthOffset -= M_PI * 2.0f;
- _texSpin += Common::elapsedTime * 0.1f;
- while (_texSpin >= M_PI * 2.0f)
- _texSpin -= M_PI * 2.0f;
-
- _loH += Common::elapsedTime * 0.04f;
- _hiH += Common::elapsedTime * 0.15f;
- _loS += Common::elapsedTime * 0.04f;
- _hiS += Common::elapsedTime;
- _loL += Common::elapsedTime * 0.04f;
- _hiL += Common::elapsedTime * 0.5f;
-
- while (_loH > M_PI * 2.0f) _loH -= M_PI * 2.0f;
- while (_hiH > M_PI * 2.0f) _hiH -= M_PI * 2.0f;
- while (_loS > M_PI * 2.0f) _loS -= M_PI * 2.0f;
- while (_hiS > M_PI * 2.0f) _hiS -= M_PI * 2.0f;
- while (_loL > M_PI * 2.0f) _loL -= M_PI * 2.0f;
- while (_hiL > M_PI * 2.0f) _hiL -= M_PI * 2.0f;
-
- unsigned int n = _numSections;
- for (unsigned int k = 0; k < n; ++k) {
- // create new vertex data for this section
- for (unsigned int i = 0; i <= TUNNEL_RESOLUTION; ++i) {
- float where = float(i) / float(TUNNEL_RESOLUTION);
-
- Vector pos(Spline::at(k + 2, where));
- Vector dir(Spline::direction(k + 2, where));
- RotationMatrix rot(RotationMatrix::lookAt(Vector(), dir, Vector(0.0f, 1.0f, 0.0f)));
-
- for (unsigned int j = 0; j <= TUNNEL_RESOLUTION; ++j) {
- float angle = float(j) * M_PI * 2.0f / float(TUNNEL_RESOLUTION);
- Vector vertex(rot.transform(Vector(
- (_radius + _radius * 0.5f * std::cos(2.0f * pos.x() + _widthOffset)) * std::cos(angle),
- (_radius + _radius * 0.5f * std::cos(pos.z() + _widthOffset)) * std::sin(angle),
- 0.0f
- )));
-
- // set vertex coordinates
- _v(k, i, j) = pos + vertex;
-
- // set texture coordinates
- _t(k, i, j).x() = 4.0f * float(i) / float(TUNNEL_RESOLUTION);
- _t(k, i, j).y() = float(j) / float(TUNNEL_RESOLUTION) + std::cos(_texSpin);
-
- // set colors
- HSLColor HSL(
- 2.0f * std::cos(0.1f * _v(k, i, j).x() + _loH) - 1.0f,
- 0.25f * (std::cos(0.013f * _v(k, i, j).y() - _loS)
- + std::cos(_v(k, i, j).z() + _hiS) + 2.0f),
- 2.0f * std::cos(0.01f * _v(k, i, j).z() + _loL)
- + std::cos(0.4f * _v(k, i, j).x() - _hiL)
- + 0.3f * std::cos(4.0f * (_v(k, i, j).x() + _v(k, i, j).y() + _v(k, i, j).z()))
- );
- HSL.clamp();
- if (HSL.s() > 0.7f) HSL.s() = 0.7f;
- _c(k, i, j) = RGBColor(HSL);
- }
- }
- }
-}
-
-void Tunnel::draw() {
- Tunnel::make();
-
- glPushAttrib(GL_ENABLE_BIT);
- glEnable(GL_TEXTURE_2D);
- CausticTextures::use();
-
- unsigned int n = _numSections;
- if (Hack::shaders) {
- for (unsigned int k = 0; k < n; ++k) {
- for (unsigned int i = 0; i < TUNNEL_RESOLUTION; ++i) {
- glBegin(GL_TRIANGLE_STRIP);
- for (unsigned int j = 0; j <= TUNNEL_RESOLUTION; ++j) {
- glColor4f(_c(k, i + 1, j).r(), _c(k, i + 1, j).g(), _c(k, i + 1, j).b(), Hack::lerp);
- glTexCoord2fv(_t(k, i + 1, j).get());
- glVertex3fv(_v(k, i + 1, j).get());
- glColor4f(_c(k, i, j).r(), _c(k, i, j).g(), _c(k, i, j).b(), Hack::lerp);
- glTexCoord2fv(_t(k, i, j).get());
- glVertex3fv(_v(k, i, j).get());
- }
- glEnd();
- }
- }
- } else {
- for (unsigned int k = 0; k < n; ++k) {
- for (unsigned int i = 0; i < TUNNEL_RESOLUTION; ++i) {
- glBegin(GL_TRIANGLE_STRIP);
- for (unsigned int j = 0; j <= TUNNEL_RESOLUTION; ++j) {
- glColor3fv(_c(k, i + 1, j).get());
- glTexCoord2fv(_t(k, i + 1, j).get());
- glVertex3fv(_v(k, i + 1, j).get());
- glColor3fv(_c(k, i, j).get());
- glTexCoord2fv(_t(k, i, j).get());
- glVertex3fv(_v(k, i, j).get());
- }
- glEnd();
- }
- }
- }
-
- glPopAttrib();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/hyperspace/tunnel.hh b/xbmc/screensavers/rsxs-0.9/src/hyperspace/tunnel.hh
deleted file mode 100644
index 1d1b21c296..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/hyperspace/tunnel.hh
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2005 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _TUNNEL_HH
-#define _TUNNEL_HH
-
-#include <common.hh>
-
-namespace Tunnel {
- void init();
-
- void draw();
-};
-
-#endif // _TUNNEL_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/implicit.cc b/xbmc/screensavers/rsxs-0.9/src/implicit.cc
deleted file mode 100644
index 9ac974ad84..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/implicit.cc
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <implicit.hh>
-#include <vector.hh>
-
-unsigned int Implicit::_width, Implicit::_height, Implicit::_length;
-unsigned int Implicit::_width1, Implicit::_height1, Implicit::_length1;
-Vector Implicit::_lbf;
-float Implicit::_cw;
-
-unsigned int Implicit::_cubeTable[256][17];
-bool Implicit::_crawlTable[256][6];
-
-#define WHL(X, Y, Z) (((X) * _height1 + (Y)) * _length1 + (Z))
-
-void Implicit::init(
- unsigned int width, unsigned int height, unsigned int length, float cw
-) {
- _width = width;
- _height = height;
- _length = length;
- _width1 = width + 1;
- _height1 = height + 1;
- _length1 = length + 1;
- _lbf = Vector(width, height, length) * cw * -0.5;
- _cw = cw;
-
- static unsigned int ec[12][2] = {
- { 0, 1 }, { 0, 2 }, { 1, 3 }, { 2, 3 }, { 0, 4 }, { 1, 5 },
- { 2, 6 }, { 3, 7 }, { 4, 5 }, { 4, 6 }, { 5, 7 }, { 6, 7 }
- };
- static unsigned int next[8][12] = {
- {
- 1, 4, UINT_MAX, UINT_MAX,
- 0, UINT_MAX, UINT_MAX, UINT_MAX,
- UINT_MAX, UINT_MAX, UINT_MAX, UINT_MAX
- },
- {
- 5, UINT_MAX, 0, UINT_MAX,
- UINT_MAX, 2, UINT_MAX, UINT_MAX,
- UINT_MAX, UINT_MAX, UINT_MAX, UINT_MAX
- },
- {
- UINT_MAX, 3, UINT_MAX, 6,
- UINT_MAX, UINT_MAX, 1, UINT_MAX,
- UINT_MAX, UINT_MAX, UINT_MAX, UINT_MAX
- },
- {
- UINT_MAX, UINT_MAX, 7, 2,
- UINT_MAX, UINT_MAX, UINT_MAX, 3,
- UINT_MAX, UINT_MAX, UINT_MAX, UINT_MAX
- },
- {
- UINT_MAX, UINT_MAX, UINT_MAX, UINT_MAX,
- 9, UINT_MAX, UINT_MAX, UINT_MAX,
- 4, 8, UINT_MAX, UINT_MAX
- },
- {
- UINT_MAX, UINT_MAX, UINT_MAX, UINT_MAX,
- UINT_MAX, 8, UINT_MAX, UINT_MAX,
- 10, UINT_MAX, 5, UINT_MAX
- },
- {
- UINT_MAX, UINT_MAX, UINT_MAX, UINT_MAX,
- UINT_MAX, UINT_MAX, 11, UINT_MAX,
- UINT_MAX, 6, UINT_MAX, 9
- },
- {
- UINT_MAX, UINT_MAX, UINT_MAX, UINT_MAX,
- UINT_MAX, UINT_MAX, UINT_MAX, 10,
- UINT_MAX, UINT_MAX, 11, 7
- }
- };
-
- for (unsigned int i = 0; i < 256; ++i) {
- // impCubeTables::makeTriStripPatterns
- bool vertices[8]; // true if on low side of gradient (outside of surface)
- for (unsigned int j = 0; j < 8; ++j)
- vertices[j] = i & (1 << j);
-
- bool edges[12];
- bool edgesDone[12];
- for (unsigned int j = 0; j < 12; ++j) {
- edges[j] = vertices[ec[j][0]] ^ vertices[ec[j][1]];
- edgesDone[j] = false;
- }
-
- unsigned int totalCount = 0;
-
- // Construct lists of edges that form triangle strips
- // try starting from each edge (no need to try last 2 edges)
- for (unsigned int j = 0; j < 10; ++j) {
- unsigned int edgeList[7];
- unsigned int edgeCount = 0;
- for (
- unsigned int currentEdge = j;
- edges[currentEdge] && !edgesDone[currentEdge];
- ) {
- edgeList[edgeCount++] = currentEdge;
- edgesDone[currentEdge] = true;
- unsigned int currentVertex = vertices[ec[currentEdge][0]] ?
- ec[currentEdge][0] : ec[currentEdge][1];
- currentEdge = next[currentVertex][currentEdge];
- while (!edges[currentEdge]) {
- currentVertex = (currentVertex != ec[currentEdge][0]) ?
- ec[currentEdge][0] : ec[currentEdge][1];
- currentEdge = next[currentVertex][currentEdge];
- }
- }
- if (edgeCount) {
- _cubeTable[i][totalCount++] = edgeCount;
- switch (edgeCount) {
- case 3:
- _cubeTable[i][totalCount++] = edgeList[0];
- _cubeTable[i][totalCount++] = edgeList[1];
- _cubeTable[i][totalCount++] = edgeList[2];
- break;
- case 4:
- _cubeTable[i][totalCount++] = edgeList[0];
- _cubeTable[i][totalCount++] = edgeList[1];
- _cubeTable[i][totalCount++] = edgeList[3];
- _cubeTable[i][totalCount++] = edgeList[2];
- break;
- case 5:
- _cubeTable[i][totalCount++] = edgeList[0];
- _cubeTable[i][totalCount++] = edgeList[1];
- _cubeTable[i][totalCount++] = edgeList[4];
- _cubeTable[i][totalCount++] = edgeList[2];
- _cubeTable[i][totalCount++] = edgeList[3];
- break;
- case 6:
- _cubeTable[i][totalCount++] = edgeList[0];
- _cubeTable[i][totalCount++] = edgeList[1];
- _cubeTable[i][totalCount++] = edgeList[5];
- _cubeTable[i][totalCount++] = edgeList[2];
- _cubeTable[i][totalCount++] = edgeList[4];
- _cubeTable[i][totalCount++] = edgeList[3];
- break;
- case 7:
- _cubeTable[i][totalCount++] = edgeList[0];
- _cubeTable[i][totalCount++] = edgeList[1];
- _cubeTable[i][totalCount++] = edgeList[6];
- _cubeTable[i][totalCount++] = edgeList[2];
- _cubeTable[i][totalCount++] = edgeList[5];
- _cubeTable[i][totalCount++] = edgeList[3];
- _cubeTable[i][totalCount++] = edgeList[4];
- break;
- }
- _cubeTable[i][totalCount] = 0;
- }
- }
-
- // impCubeTables::makeCrawlDirections
- _crawlTable[i][0] = edges[0] || edges[1] || edges[2] || edges[3];
- _crawlTable[i][1] = edges[8] || edges[9] || edges[10] || edges[11];
- _crawlTable[i][2] = edges[0] || edges[4] || edges[5] || edges[8];
- _crawlTable[i][3] = edges[3] || edges[6] || edges[7] || edges[11];
- _crawlTable[i][4] = edges[1] || edges[4] || edges[6] || edges[9];
- _crawlTable[i][5] = edges[2] || edges[5] || edges[7] || edges[10];
- }
-}
-
-Implicit::Implicit(ImplicitField field) : _serial(0), _field(field) {
- stdx::construct_n(_info, _width1 * _height1 * _length1);
- for (unsigned int i = 0; i < _width1; ++i) {
- for (unsigned int j = 0; j < _height1; ++j) {
- for (unsigned int k = 0; k < _length1; ++k) {
- unsigned int xyz = WHL(i, j, k);
- _info[xyz].cube.serial = 0;
- _info[xyz].corner.serial = 0;
- _info[xyz].corner.XYZ = _lbf + Vector(i, j, k) * _cw;
- _info[xyz].edge[X_AXIS].serial = 0;
- _info[xyz].edge[Y_AXIS].serial = 0;
- _info[xyz].edge[Z_AXIS].serial = 0;
- }
- }
- }
-}
-
-void Implicit::update(float threshold, const CrawlPointVector& crawlPoints) {
- _threshold = threshold;
-
- ++_serial;
-
- _vertices.reset();
- _indices.reset();
- _lengths.reset();
-
- // crawl from every crawl point to create the surface
- CrawlPointVector::const_iterator e = crawlPoints.end();
- for (
- CrawlPointVector::const_iterator it = crawlPoints.begin();
- it != e;
- ++it
- ) {
- // find cube corresponding to crawl point
- Vector cube((*it - _lbf) / _cw);
- unsigned int x = Common::clamp((unsigned int)cube.x(), 0u, _width - 1);
- unsigned int y = Common::clamp((unsigned int)cube.y(), 0u, _height - 1);
- unsigned int z = Common::clamp((unsigned int)cube.z(), 0u, _length - 1);
-
- while (true) {
- unsigned int xyz = WHL(x, y, z);
-
- if (_info[xyz].cube.serial == _serial)
- break; // escape if a finished cube
-
- // find mask for this cube
- unsigned char mask = calculateCube(xyz);
-
- if (mask == 255)
- break; // escape if outside surface
-
- if (mask == 0) {
- // this cube is inside volume
- _info[xyz].cube.serial = _serial;
- if (--x < 0)
- break;
- } else {
- crawl(x, y, z);
- break;
- }
- }
- }
-}
-
-void Implicit::update(float threshold) {
- _threshold = threshold;
-
- ++_serial;
-
- _vertices.reset();
- _indices.reset();
- _lengths.reset();
-
- // find gradient value at every corner
- unsigned int xyz = 0;
- for (unsigned int i = 0; i < _width; ++i) {
- for (unsigned int j = 0; j < _height; ++j) {
- for (unsigned int k = 0; k < _length; ++k) {
- calculateCube(xyz);
- polygonize(xyz);
- ++xyz;
- }
- ++xyz;
- }
- xyz += _length1;
- }
-}
-
-#define LBF 0x01
-#define LBN 0x02
-#define LTF 0x04
-#define LTN 0x08
-#define RBF 0x10
-#define RBN 0x20
-#define RTF 0x40
-#define RTN 0x80
-
-unsigned char Implicit::calculateCube(unsigned int xyz) {
- unsigned char mask = 0;
- if (_info[xyz + WHL(0, 0, 0)].corner.serial != _serial) {
- _info[xyz + WHL(0, 0, 0)].corner.value = _field(_info[xyz + WHL(0, 0, 0)].corner.XYZ);
- _info[xyz + WHL(0, 0, 0)].corner.serial = _serial;
- }
- if (_info[xyz + WHL(0, 0, 0)].corner.value < _threshold)
- mask |= LBF;
- if (_info[xyz + WHL(0, 0, 1)].corner.serial != _serial) {
- _info[xyz + WHL(0, 0, 1)].corner.value = _field(_info[xyz + WHL(0, 0, 1)].corner.XYZ);
- _info[xyz + WHL(0, 0, 1)].corner.serial = _serial;
- }
- if (_info[xyz + WHL(0, 0, 1)].corner.value < _threshold)
- mask |= LBN;
- if (_info[xyz + WHL(0, 1, 0)].corner.serial != _serial) {
- _info[xyz + WHL(0, 1, 0)].corner.value = _field(_info[xyz + WHL(0, 1, 0)].corner.XYZ);
- _info[xyz + WHL(0, 1, 0)].corner.serial = _serial;
- }
- if (_info[xyz + WHL(0, 1, 0)].corner.value < _threshold)
- mask |= LTF;
- if (_info[xyz + WHL(0, 1, 1)].corner.serial != _serial) {
- _info[xyz + WHL(0, 1, 1)].corner.value = _field(_info[xyz + WHL(0, 1, 1)].corner.XYZ);
- _info[xyz + WHL(0, 1, 1)].corner.serial = _serial;
- }
- if (_info[xyz + WHL(0, 1, 1)].corner.value < _threshold)
- mask |= LTN;
- if (_info[xyz + WHL(1, 0, 0)].corner.serial != _serial) {
- _info[xyz + WHL(1, 0, 0)].corner.value = _field(_info[xyz + WHL(1, 0, 0)].corner.XYZ);
- _info[xyz + WHL(1, 0, 0)].corner.serial = _serial;
- }
- if (_info[xyz + WHL(1, 0, 0)].corner.value < _threshold)
- mask |= RBF;
- if (_info[xyz + WHL(1, 0, 1)].corner.serial != _serial) {
- _info[xyz + WHL(1, 0, 1)].corner.value = _field(_info[xyz + WHL(1, 0, 1)].corner.XYZ);
- _info[xyz + WHL(1, 0, 1)].corner.serial = _serial;
- }
- if (_info[xyz + WHL(1, 0, 1)].corner.value < _threshold)
- mask |= RBN;
- if (_info[xyz + WHL(1, 1, 0)].corner.serial != _serial) {
- _info[xyz + WHL(1, 1, 0)].corner.value = _field(_info[xyz + WHL(1, 1, 0)].corner.XYZ);
- _info[xyz + WHL(1, 1, 0)].corner.serial = _serial;
- }
- if (_info[xyz + WHL(1, 1, 0)].corner.value < _threshold)
- mask |= RTF;
- if (_info[xyz + WHL(1, 1, 1)].corner.serial != _serial) {
- _info[xyz + WHL(1, 1, 1)].corner.value = _field(_info[xyz + WHL(1, 1, 1)].corner.XYZ);
- _info[xyz + WHL(1, 1, 1)].corner.serial = _serial;
- }
- if (_info[xyz + WHL(1, 1, 1)].corner.value < _threshold)
- mask |= RTN;
-
- _info[xyz].cube.mask = mask;
- return mask;
-}
-
-void Implicit::crawl(unsigned int x, unsigned int y, unsigned int z) {
- unsigned int xyz = WHL(x, y, z);
- if (_info[xyz].cube.serial == _serial)
- return;
-
- unsigned char mask = calculateCube(xyz);
-
- if (mask == 0 || mask == 255)
- return;
-
- // polygonize this cube if it intersects surface
- polygonize(xyz);
-
- // mark this cube as completed
- _info[xyz].cube.serial = _serial;
-
- // polygonize adjacent cubes
- if (_crawlTable[mask][0] && x > 0)
- crawl(x - 1, y, z);
- if (_crawlTable[mask][1] && x < _width - 1)
- crawl(x + 1, y, z);
- if (_crawlTable[mask][2] && y > 0)
- crawl(x, y - 1, z);
- if (_crawlTable[mask][3] && y < _height - 1)
- crawl(x, y + 1, z);
- if (_crawlTable[mask][4] && z > 0)
- crawl(x, y, z - 1);
- if (_crawlTable[mask][5] && z < _length - 1)
- crawl(x, y, z + 1);
-}
-
-// polygonize an individual cube
-void Implicit::polygonize(unsigned int xyz) {
- unsigned char mask = _info[xyz].cube.mask;
-
- unsigned int counter = 0;
- unsigned int numEdges = _cubeTable[mask][counter];
-
- while (numEdges != 0) {
- _lengths.push_back(numEdges);
- for (unsigned int i = 0; i < numEdges; ++i) {
- // generate vertex position and normal data
- switch (_cubeTable[mask][i + counter + 1]) {
- case 0:
- addVertex(Z_AXIS, xyz + WHL(0, 0, 0));
- break;
- case 1:
- addVertex(Y_AXIS, xyz + WHL(0, 0, 0));
- break;
- case 2:
- addVertex(Y_AXIS, xyz + WHL(0, 0, 1));
- break;
- case 3:
- addVertex(Z_AXIS, xyz + WHL(0, 1, 0));
- break;
- case 4:
- addVertex(X_AXIS, xyz + WHL(0, 0, 0));
- break;
- case 5:
- addVertex(X_AXIS, xyz + WHL(0, 0, 1));
- break;
- case 6:
- addVertex(X_AXIS, xyz + WHL(0, 1, 0));
- break;
- case 7:
- addVertex(X_AXIS, xyz + WHL(0, 1, 1));
- break;
- case 8:
- addVertex(Z_AXIS, xyz + WHL(1, 0, 0));
- break;
- case 9:
- addVertex(Y_AXIS, xyz + WHL(1, 0, 0));
- break;
- case 10:
- addVertex(Y_AXIS, xyz + WHL(1, 0, 1));
- break;
- case 11:
- addVertex(Z_AXIS, xyz + WHL(1, 1, 0));
- break;
- }
- }
- counter += numEdges + 1;
- numEdges = _cubeTable[mask][counter];
- }
-}
-
-void Implicit::addVertex(Axis axis, unsigned int xyz) {
- const Info::Corner& corner = _info[xyz].corner;
- Info::Edge& edge = _info[xyz].edge[axis];
- if (edge.serial == _serial) {
- _indices.push_back(edge.index);
- return;
- }
-
- // find position of vertex along this edge
- edge.serial = _serial;
- _indices.push_back(edge.index = _vertices.size());
- struct VertexData data;
- switch (axis) {
- case X_AXIS:
- data.x = corner.XYZ.x() +
- _cw * ((_threshold - corner.value)
- / (_info[xyz + WHL(1, 0, 0)].corner.value - corner.value)),
- data.y = corner.XYZ.y();
- data.z = corner.XYZ.z();
- break;
- case 1: // y-axis
- data.x = corner.XYZ.x();
- data.y = corner.XYZ.y() +
- _cw * ((_threshold - corner.value)
- / (_info[xyz + WHL(0, 1, 0)].corner.value - corner.value));
- data.z = corner.XYZ.z();
- break;
- case 2: // z-axis
- data.x = corner.XYZ.x();
- data.y = corner.XYZ.y();
- data.z = corner.XYZ.z() +
- _cw * ((_threshold - corner.value)
- / (_info[xyz + WHL(0, 0, 1)].corner.value - corner.value));
- break;
- default:
- abort();
- }
-
- // find normal vector at vertex along this edge
- // first find normal vector origin value
- Vector pos(data.x, data.y, data.z);
- float no = _field(pos);
- // then find values at slight displacements and subtract
- data.nx = _field(pos - Vector(0.01f, 0.0f, 0.0f)) - no;
- data.ny = _field(pos - Vector(0.0f, 0.01f, 0.0f)) - no;
- data.nz = _field(pos - Vector(0.0f, 0.0f, 0.01f)) - no;
- float normalizer = 1.0f / std::sqrt(data.nx * data.nx + data.ny * data.ny + data.nz * data.nz);
- data.nx *= normalizer;
- data.ny *= normalizer;
- data.nz *= normalizer;
-
- // Add this vertex to surface
- _vertices.push_back(data);
-}
-
-void Implicit::draw(GLenum mode) const {
- glInterleavedArrays(GL_N3F_V3F, 0, _vertices.begin());
- LazyVector<unsigned int>::const_iterator index = _indices.begin();
- LazyVector<unsigned int>::const_iterator e = _lengths.end();
- for (LazyVector<unsigned int>::const_iterator it = _lengths.begin(); it < e; ++it) {
- glDrawElements(mode, *it, GL_UNSIGNED_INT, index);
- index += *it;
- }
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/implicit.hh b/xbmc/screensavers/rsxs-0.9/src/implicit.hh
deleted file mode 100644
index e12c127d4a..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/implicit.hh
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _IMPLICIT_HH
-#define _IMPLICIT_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <memory>
-#include <vector.hh>
-
-typedef float (*ImplicitField)(const Vector&);
-typedef std::list<Vector> CrawlPointVector;
-
-template <typename T> class LazyVector {
-private:
- T* _data;
- unsigned int _used, _capacity;
-public:
- LazyVector() : _data(new T[1000]), _used(0), _capacity(1000) {}
- LazyVector(const LazyVector& lv) : _data(new T[lv._capacity]),
- _used(lv._used), _capacity(lv._capacity) {
- std::copy(lv._data, lv._data + _used, _data);
- }
- ~LazyVector() { delete[] _data; }
-
- void reset() { _used = 0; }
- unsigned int size() const { return _used; }
-
- typedef const T* const_iterator;
- const T* begin() const { return _data; }
- const T* end() const { return _data + _used; }
-
- void push_back(const T& v) {
- if (_used == _capacity) {
- _capacity += 1000;
- T* temp = new T[_capacity];
- std::uninitialized_copy(_data, _data + _used, temp);
- delete[] _data;
- _data = temp;
- }
- _data[_used++] = v;
- }
-};
-
-enum Axis {
- X_AXIS,
- Y_AXIS,
- Z_AXIS
-};
-
-class Implicit : public ResourceManager::Resource<void> {
-private:
- static unsigned int _width, _height, _length;
- static unsigned int _width1, _height1, _length1;
- static Vector _lbf;
- static float _cw;
-
- static unsigned int _cubeTable[256][17];
- static bool _crawlTable[256][6];
-public:
- static void init(unsigned int, unsigned int, unsigned int, float);
- void operator()() const {}
-private:
- struct Info {
- struct Cube {
- unsigned int serial;
- unsigned char mask;
- } cube;
- struct Corner {
- unsigned int serial;
- float value;
- Vector XYZ;
- } corner;
- struct Edge {
- unsigned int serial;
- unsigned int index;
- } edge[3];
- };
- std::vector<Info> _info;
-
- struct VertexData {
- float nx, ny, nz;
- float x, y, z;
- };
-
- unsigned int _serial;
-
- ImplicitField _field;
- float _threshold;
-
- LazyVector<VertexData> _vertices;
- LazyVector<unsigned int> _indices;
- LazyVector<unsigned int> _lengths;
-
- inline unsigned char calculateCube(unsigned int);
- inline void crawl(unsigned int, unsigned int, unsigned int);
- inline void polygonize(unsigned int);
- inline void addVertex(Axis, unsigned int);
-public:
- Implicit(ImplicitField);
-
- void update(float, const CrawlPointVector&);
- void update(float);
- void draw(GLenum = GL_TRIANGLE_STRIP) const;
-};
-
-#endif // _IMPLICIT_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/Makefile.am b/xbmc/screensavers/rsxs-0.9/src/lattice/Makefile.am
deleted file mode 100644
index 6f4876eca8..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-include $(srcdir)/../Makefile.common
-
-rs_lattice_SOURCES = $(COMMON) $(VECTOR) $(IMAGE) camera.hh lattice.cc \
- lattice.hh resources.cc resources.hh
-
-AM_CPPFLAGS += $(IMAGE_CPPFLAGS)
-AM_CXXFLAGS += $(IMAGE_CXXFLAGS)
-AM_LDFLAGS += $(IMAGE_LDFLAGS)
-rs_lattice_LDADD = $(LIBMISC) $(X_LIBS) $(OPENGL_LIBS) $(IMAGE_LIBS)
-
-hack_PROGRAMS = rs-lattice
-
-latticedatadir = $(pkgdatadir)/lattice
-dist_latticedata_DATA = brass.png chrome.png circuits.png crystal.png \
- doughnuts.png ghostly.png industrial1.png industrial2.png shiny.png
-
-uninstall-hook:
- -rmdir $(latticedatadir)
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/brass.png b/xbmc/screensavers/rsxs-0.9/src/lattice/brass.png
deleted file mode 100644
index 84db6453b6..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/brass.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/camera.hh b/xbmc/screensavers/rsxs-0.9/src/lattice/camera.hh
deleted file mode 100644
index 65d1539156..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/camera.hh
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _CAMERA_HH
-#define _CAMERA_HH
-
-#include <common.hh>
-
-#include <vector.hh>
-
-namespace Camera {
- float _farPlane;
- Vector _cullVec[4]; // vectors perpendicular to viewing volume planes
-
- void set(const float* m, float farPlane) {
- _farPlane = farPlane;
-
- float temp;
-
- // bottom and planes' vectors
- temp = std::atan(1.0f / m[5]);
- _cullVec[0].set(0.0f, std::cos(temp), -std::sin(temp));
- _cullVec[1].set(0.0f, -std::cos(temp), -std::sin(temp));
-
- // left and right planes' vectors
- temp = std::atan(1.0f / m[0]);
- _cullVec[2].set(std::cos(temp), 0.0f, -std::sin(temp));
- _cullVec[3].set(-std::cos(temp), 0.0f,-std::sin(temp));
- }
-
- bool isVisible(const Vector& pos, float radius) {
- return
- pos.z() >= -(_farPlane + radius) &&
- Vector::dot(pos, _cullVec[0]) >= -radius &&
- Vector::dot(pos, _cullVec[1]) >= -radius &&
- Vector::dot(pos, _cullVec[2]) >= -radius &&
- Vector::dot(pos, _cullVec[3]) >= -radius;
- }
-};
-
-#endif // _CAMERA_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/chrome.png b/xbmc/screensavers/rsxs-0.9/src/lattice/chrome.png
deleted file mode 100644
index 1f3e6bc21f..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/chrome.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/circuits.png b/xbmc/screensavers/rsxs-0.9/src/lattice/circuits.png
deleted file mode 100644
index 47fc923e74..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/circuits.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/crystal.png b/xbmc/screensavers/rsxs-0.9/src/lattice/crystal.png
deleted file mode 100644
index 5cdeda5d57..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/crystal.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/doughnuts.png b/xbmc/screensavers/rsxs-0.9/src/lattice/doughnuts.png
deleted file mode 100644
index 18a435b233..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/doughnuts.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/ghostly.png b/xbmc/screensavers/rsxs-0.9/src/lattice/ghostly.png
deleted file mode 100644
index faef0d9b5c..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/ghostly.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/industrial1.png b/xbmc/screensavers/rsxs-0.9/src/lattice/industrial1.png
deleted file mode 100644
index 1bb6015930..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/industrial1.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/industrial2.png b/xbmc/screensavers/rsxs-0.9/src/lattice/industrial2.png
deleted file mode 100644
index 591f57ccda..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/industrial2.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/lattice.cc b/xbmc/screensavers/rsxs-0.9/src/lattice/lattice.cc
deleted file mode 100644
index 70c991c9c6..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/lattice.cc
+++ /dev/null
@@ -1,868 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <camera.hh>
-#include <common.hh>
-#include <hack.hh>
-#include <lattice.hh>
-#include <resources.hh>
-#include <vector.hh>
-
-// Important: See XXX below
-#define LATSIZE 10u
-
-namespace Hack {
- unsigned int longitude = 16;
- unsigned int latitude = 8;
- float thickness = 50.0f;
- unsigned int density = 50;
- unsigned int depth = 4;
- float fov = 90.0;
- unsigned int pathRand = 7;
- float speed = 10.0f;
- LinkType linkType = UNKNOWN_LINKS;
- std::vector<Texture> textures;
- bool smooth = false;
- bool fog = true;
- bool widescreen = false;
-};
-
-namespace Hack {
- enum Arguments {
- ARG_LATITUDE = 1,
- ARG_LONGITUDE,
- ARG_THICKNESS,
- ARG_DENSITY,
- ARG_DEPTH,
- ARG_FOV,
- ARG_RANDOMNESS,
- ARG_SPEED,
- ARG_SHININESS,
- ARG_PLAIN,
- ARG_TEXTURE,
- ARG_SMOOTH = 0x100, ARG_NO_SMOOTH,
- ARG_FOG = 0x200, ARG_NO_FOG,
- ARG_WIDESCREEN = 0x300, ARG_NO_WIDESCREEN,
- ARG_INDUSTRIAL_TEXTURE = 0x400, ARG_CRYSTAL_TEXTURE,
- ARG_CHROME_TEXTURE, ARG_BRASS_TEXTURE,
- ARG_SHINY_TEXTURE, ARG_GHOSTLY_TEXTURE,
- ARG_CIRCUITS_TEXTURE, ARG_DOUGHNUTS_TEXTURE,
- ARG_RANDOM_TEXTURE,
- ARG_SOLID_LINKS = 0x500, ARG_TRANSLUCENT_LINKS, ARG_HOLLOW_LINKS,
- ARG_SPHEREMAP = 0x600, ARG_NO_SPHEREMAP,
- ARG_COLORED = 0x700, ARG_NO_COLORED,
- ARG_MODULATE = 0x800, ARG_NO_MODULATE
- };
-
- GLuint _lattice[LATSIZE][LATSIZE][LATSIZE];
-
- // Border points and direction vectors where camera can cross
- // from cube to cube
- const float _bPnt[][6] = {
- { 0.5f , -0.25f, 0.25f, 1.0f , 0.0f , 0.0f },
- { 0.5f , 0.25f, -0.25f, 1.0f , 0.0f , 0.0f },
- { -0.25f, 0.5f , 0.25f, 0.0f , 1.0f , 0.0f },
- { 0.25f, 0.5f , -0.25f, 0.0f , 1.0f , 0.0f },
- { -0.25f, -0.25f, 0.5f , 0.0f , 0.0f , 1.0f },
- { 0.25f, 0.25f, 0.5f , 0.0f , 0.0f , 1.0f },
- { 0.5f , -0.5f , -0.5f , 1.0f , -1.0f , -1.0f },
- { 0.5f , 0.5f , -0.5f , 1.0f , 1.0f , -1.0f },
- { 0.5f , -0.5f , 0.5f , 1.0f , -1.0f , 1.0f },
- { 0.5f , 0.5f , 0.5f , 1.0f , 1.0f , 1.0f }
- };
- float _path[7][6];
- const unsigned int _transitions[][6] = {
- { 1, 2, 12, 4, 14, 8 },
- { 0, 3, 15, 7, 7, 7 },
- { 3, 4, 14, 0, 7, 16 },
- { 2, 1, 15, 7, 7, 7 },
- { 5, 10, 12, 17, 17, 17 },
- { 4, 3, 13, 11, 9, 17 },
- { 12, 4, 10, 17, 17, 17 },
- { 2, 0, 14, 8, 16, 19 },
- { 1, 3, 15, 7, 7, 7 },
- { 4, 10, 12, 17, 17, 17 },
- { 11, 4, 12, 17, 17, 17 },
- { 10, 5, 15, 13, 17, 18 },
- { 13, 10, 4, 17, 17, 17 },
- { 12, 1, 11, 5, 6, 17 },
- { 15, 2, 12, 0, 7, 19 },
- { 14, 3, 1, 7, 7, 7 },
- { 3, 1, 15, 7, 7, 7 },
- { 5, 11, 13, 6, 9, 18 },
- { 10, 4, 12, 17, 17, 17 },
- { 15, 1, 3, 7, 7, 7 }
- };
- int _globalXYZ[3];
- unsigned int _lastBorder;
- unsigned int _segments;
-
- unsigned int latticeMod(int);
- float interpolate(float, float, float, float, float);
- void reconfigure();
-
- void setLinkType(LinkType);
- error_t parse(int, char*, struct argp_state*);
-};
-
-// Modulus function for picking the correct element of lattice array
-unsigned int Hack::latticeMod(int x) {
- if (x < 0)
- return (LATSIZE - (-x % LATSIZE)) % LATSIZE;
- else
- return x % LATSIZE;
-}
-
-// start point, start slope, end point, end slope, position (0.0 - 1.0)
-// returns point somewhere along a smooth curve between the start point
-// and end point
-float Hack::interpolate(float a, float b, float c, float d, float where) {
- float q = 2.0f * (a - c) + b + d;
- float r = 3.0f * (c - a) - 2.0f * b - d;
- return (where * where * where * q) + (where * where * r) + (where * b) + a;
-}
-
-void Hack::reconfigure() {
- // End of old path = start of new path
- for (unsigned int i = 0; i < 6; ++i)
- _path[0][i] = _path[_segments][i];
-
- // determine if direction of motion is positive or negative
- // update global position
- bool positive;
- if (_lastBorder < 6) {
- if ((_path[0][3] + _path[0][4] + _path[0][5]) > 0.0f) {
- positive = true;
- ++_globalXYZ[_lastBorder / 2];
- } else {
- positive = false;
- --_globalXYZ[_lastBorder / 2];
- }
- } else {
- if (_path[0][3] > 0.0f) {
- positive = true;
- ++_globalXYZ[0];
- } else {
- positive = false;
- --_globalXYZ[0];
- }
- if (_path[0][4] > 0.0f)
- ++_globalXYZ[1];
- else
- --_globalXYZ[1];
- if (_path[0][5] > 0.0f)
- ++_globalXYZ[2];
- else
- --_globalXYZ[2];
- }
-
- if (!Common::randomInt(11 - pathRand)) { // Change directions
- if (!positive)
- _lastBorder += 10;
- unsigned int newBorder = _transitions[_lastBorder][Common::randomInt(6)];
- positive = false;
- if (newBorder < 10)
- positive = true;
- else
- newBorder -= 10;
- for (unsigned int i = 0; i < 6; ++i) // set the new border point
- _path[1][i] = _bPnt[newBorder][i];
- if (!positive) { // flip everything if direction is negative
- if (newBorder < 6)
- _path[1][newBorder / 2] *= -1.0f;
- else
- for (unsigned int i = 0; i < 3; ++i)
- _path[1][i] *= -1.0f;
- for (unsigned int i = 3; i < 6; ++i)
- _path[1][i] *= -1.0f;
- }
- for (unsigned int i = 0; i < 3; ++i) // reposition the new border
- _path[1][i] += _globalXYZ[i];
- _lastBorder = newBorder;
- _segments = 1;
- } else { // Just keep going straight
- unsigned int newBorder = _lastBorder;
- for (unsigned int i = 0; i < 6; ++i)
- _path[1][i] = _bPnt[newBorder][i];
- unsigned int i = newBorder / 2;
- if (!positive) {
- if (newBorder < 6)
- _path[1][i] *= -1.0f;
- else {
- _path[1][0] *= -1.0f;
- _path[1][1] *= -1.0f;
- _path[1][2] *= -1.0f;
- }
- _path[1][3] *= -1.0f;
- _path[1][4] *= -1.0f;
- _path[1][5] *= -1.0f;
- }
- for (unsigned int j = 0; j < 3; ++j) {
- _path[1][j] += _globalXYZ[j];
- if ((newBorder < 6) && (j != 1))
- _path[1][j] += Common::randomFloat(0.15f) - 0.075f;
- }
- if (newBorder >= 6)
- _path[1][0] += Common::randomFloat(0.1f) - 0.05f;
- _segments = 1;
- }
-}
-
-void Hack::setLinkType(LinkType lt) {
- if (linkType == lt)
- return;
- if (linkType != UNKNOWN_LINKS) {
- static char* linkTypeOption[3] = { "--solid", "--translucent", "--hollow" };
- WARN("Overriding " << linkTypeOption[linkType] << " with " <<
- linkTypeOption[lt]);
- }
- linkType = lt;
-}
-
-error_t Hack::parse(int key, char* arg, struct argp_state* state) {
- static float shininess = 50.0f;
- static bool sphereMap = false;
- static bool colored = true;
- static bool modulate = true;
-
-retry:
- switch (key) {
- case ARG_LATITUDE:
- if (Common::parseArg(arg, latitude, 2u, 100u))
- argp_failure(state, EXIT_FAILURE, 0,
- "latitudinal divisions must be between 2 and 100");
- return 0;
- case ARG_LONGITUDE:
- if (Common::parseArg(arg, longitude, 4u, 100u))
- argp_failure(state, EXIT_FAILURE, 0,
- "longitudinal divisions must be between 4 and 100");
- return 0;
- case ARG_THICKNESS:
- if (Common::parseArg(arg, thickness, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "torus thickness must be between 1 and 100");
- return 0;
- case ARG_DENSITY:
- if (Common::parseArg(arg, density, 1u, 100u))
- argp_failure(state, EXIT_FAILURE, 0,
- "lattice density must be between 1 and 100");
- return 0;
- case ARG_DEPTH:
- if (Common::parseArg(arg, depth, 1u, LATSIZE - 2))
- argp_failure(state, EXIT_FAILURE, 0,
- "lattice depth must be between 1 and %d", LATSIZE - 2);
- return 0;
- case ARG_FOV:
- if (Common::parseArg(arg, fov, 10.0f, 150.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "field of view must be between 10 and 150");
- return 0;
- case ARG_RANDOMNESS:
- if (Common::parseArg(arg, pathRand, 1u, 10u))
- argp_failure(state, EXIT_FAILURE, 0,
- "path randomness must be between 1 and 10");
- return 0;
- case ARG_SPEED:
- speed = std::strtod(arg, NULL);
- if (speed < 1.0f || speed > 100.0f)
- argp_failure(state, EXIT_FAILURE, 0,
- "camera speed must be between 1 and 100");
- return 0;
- case ARG_SHININESS:
- if (Common::parseArg(arg, shininess, 0.0f, 128.0f, -1.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "shininess must be -1 (to disable lighting), or between 0 and 128");
- return 0;
- case ARG_PLAIN:
- {
- Texture texture = { "", shininess, sphereMap, colored, modulate };
- textures.push_back(texture);
- }
- return 0;
- case ARG_TEXTURE:
- {
- Texture texture = { arg, shininess, sphereMap, colored, modulate };
- textures.push_back(texture);
- }
- return 0;
- case ARG_SMOOTH:
- smooth = true;
- return 0;
- case ARG_NO_SMOOTH:
- smooth = false;
- return 0;
- case ARG_FOG:
- fog = true;
- return 0;
- case ARG_NO_FOG:
- fog = false;
- return 0;
- case ARG_WIDESCREEN:
- widescreen = true;
- return 0;
- case ARG_NO_WIDESCREEN:
- widescreen = false;
- return 0;
- case ARG_INDUSTRIAL_TEXTURE:
- setLinkType(SOLID_LINKS);
- shininess = 0.0f;
- sphereMap = false;
- colored = false;
- modulate = true;
- {
- Texture texture = { "industrial1.png",
- shininess, sphereMap, colored, modulate };
- textures.push_back(texture);
- }
- {
- Texture texture = { "industrial2.png",
- shininess, sphereMap, colored, modulate };
- textures.push_back(texture);
- }
- return 0;
- case ARG_CRYSTAL_TEXTURE:
- setLinkType(TRANSLUCENT_LINKS);
- shininess = 10.0f;
- sphereMap = true;
- colored = false;
- modulate = true;
- {
- Texture texture = { "crystal.png",
- shininess, sphereMap, colored, modulate };
- textures.push_back(texture);
- }
- return 0;
- case ARG_CHROME_TEXTURE:
- setLinkType(SOLID_LINKS);
- shininess = -1.0f;
- sphereMap = true;
- colored = false;
- modulate = true;
- {
- Texture texture = { "chrome.png",
- shininess, sphereMap, colored, modulate };
- textures.push_back(texture);
- }
- return 0;
- case ARG_BRASS_TEXTURE:
- setLinkType(SOLID_LINKS);
- shininess = -1.0f;
- sphereMap = true;
- colored = false;
- modulate = true;
- {
- Texture texture = { "brass.png",
- shininess, sphereMap, colored, modulate };
- textures.push_back(texture);
- }
- return 0;
- case ARG_SHINY_TEXTURE:
- setLinkType(SOLID_LINKS);
- shininess = 50.0f;
- sphereMap = true;
- colored = true;
- modulate = false;
- {
- Texture texture = { "shiny.png",
- shininess, sphereMap, colored, modulate };
- textures.push_back(texture);
- }
- return 0;
- case ARG_GHOSTLY_TEXTURE:
- setLinkType(TRANSLUCENT_LINKS);
- shininess = -1.0f;
- sphereMap = true;
- colored = true;
- modulate = true;
- {
- Texture texture = { "ghostly.png",
- shininess, sphereMap, colored, modulate };
- textures.push_back(texture);
- }
- return 0;
- case ARG_CIRCUITS_TEXTURE:
- setLinkType(HOLLOW_LINKS);
- shininess = 50.0f;
- sphereMap = false;
- colored = true;
- modulate = true;
- {
- Texture texture = { "circuits.png",
- shininess, sphereMap, colored, modulate };
- textures.push_back(texture);
- }
- return 0;
- case ARG_DOUGHNUTS_TEXTURE:
- setLinkType(SOLID_LINKS);
- shininess = 50.0f;
- sphereMap = false;
- colored = true;
- modulate = false;
- {
- Texture texture = { "doughnuts.png",
- shininess, sphereMap, colored, modulate };
- textures.push_back(texture);
- }
- return 0;
- case ARG_RANDOM_TEXTURE:
- key = Common::randomInt(8) + ARG_INDUSTRIAL_TEXTURE;
- goto retry;
- case ARG_SOLID_LINKS:
- setLinkType(SOLID_LINKS);
- return 0;
- case ARG_TRANSLUCENT_LINKS:
- setLinkType(TRANSLUCENT_LINKS);
- return 0;
- case ARG_HOLLOW_LINKS:
- setLinkType(HOLLOW_LINKS);
- return 0;
- case ARG_SPHEREMAP:
- sphereMap = true;
- return 0;
- case ARG_NO_SPHEREMAP:
- sphereMap = false;
- return 0;
- case ARG_COLORED:
- colored = true;
- return 0;
- case ARG_NO_COLORED:
- colored = false;
- return 0;
- case ARG_MODULATE:
- modulate = true;
- return 0;
- case ARG_NO_MODULATE:
- modulate = false;
- return 0;
- case ARGP_KEY_FINI:
- if (linkType == UNKNOWN_LINKS)
- linkType = SOLID_LINKS;
- if (textures.empty()) {
- Texture texture = { "", shininess, sphereMap, colored, modulate };
- textures.push_back(texture);
- }
- default:
- return ARGP_ERR_UNKNOWN;
- }
-}
-
-const struct argp* Hack::getParser() {
- static struct argp_option options[] = {
- { NULL, 0, NULL, 0, "Lattice options:" },
- { "density", ARG_DENSITY, "NUM", 0, "Lattice density (1-100, default = 50)" },
- // XXX 8 = LATSIZE - 2
- { "depth", ARG_DEPTH, "NUM", 0, "Lattice depth (1-8, default = 4)" },
- { "fog", ARG_FOG, NULL, OPTION_HIDDEN, "Disable depth fogging" },
- { "no-fog", ARG_NO_FOG, NULL, OPTION_ALIAS },
- { NULL, 0, NULL, 0, "Torus options:" },
- { "latitude", ARG_LATITUDE, "NUM", 0,
- "Latitudinal divisions on each torus (2-100, default = 8)" },
- { "longitude", ARG_LONGITUDE, "NUM", 0,
- "Longitudinal divisions on each torus (4-100, default = 16)" },
- { "thickness", ARG_THICKNESS, "NUM", 0,
- "Thickness of each torus (1-100, default = 50)" },
- { "smooth", ARG_SMOOTH, NULL, 0, "Enable smooth shading" },
- { "no-smooth", ARG_NO_SMOOTH, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { NULL, 0, NULL, 0, "Rendering options:" },
- { "solid", ARG_SOLID_LINKS, NULL, 0,
- "Surface rendering mode (default = solid)" },
- { "translucent", ARG_TRANSLUCENT_LINKS, NULL, OPTION_ALIAS },
- { "hollow", ARG_HOLLOW_LINKS, NULL, OPTION_ALIAS },
- { "These options define the global rendering scheme for the surfaces of the"
- " toruses. If more than one of these options are specified, the last"
- " will take precedence.", 0, NULL, OPTION_DOC | OPTION_NO_USAGE },
- { NULL, 0, NULL, 0, "Surface options:" },
- { "shininess", ARG_SHININESS, "NUM", 0,
- "Degree of specular reflection (0-128, -1 to disable lighting, default"
- " = 50)" },
- { "spheremap", ARG_SPHEREMAP, NULL, 0,
- "Enable environment mapping of surface texture" },
- { "no-spheremap", ARG_NO_SPHEREMAP, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { "colored", ARG_COLORED, NULL, 0,
- "Colorize (or whiten) the surfaces (default = colored)" },
- { "white", ARG_NO_COLORED, NULL, OPTION_ALIAS },
- { "no-colored", ARG_NO_COLORED, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { "no-white", ARG_COLORED, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { "modulate", ARG_MODULATE, NULL, 0,
- "Modulate the surface color with the texture, or paste the texture over"
- " the color as a decal (default = modulate)" },
- { "decal", ARG_NO_MODULATE, NULL, OPTION_ALIAS },
- { "no-modulate", ARG_NO_MODULATE, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { "no-decal", ARG_MODULATE, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { NULL, 0, NULL, 0, "" },
- { "plain", ARG_PLAIN, NULL, 0, "Plain surface" },
- { "texture", ARG_TEXTURE, "FILE", 0, "PNG image surface" },
- { "Any of these options may be specified multiple times. Each --plain and"
- " --texture option defines a group of toruses that are rendered in the"
- " same manner. Any --shininess, --solid, --translucent, --hollow and"
- " --spheremap options must precede the --plain or --texture they are"
- " to affect.", 0, NULL, OPTION_DOC | OPTION_NO_USAGE },
- { NULL, 0, NULL, 0, "Predefined surfaces:" },
- { "random", ARG_RANDOM_TEXTURE, NULL, 0,
- "Randomly choose a predefined surface" },
- { NULL, 0, NULL, 0, "" },
- { "industrial", ARG_INDUSTRIAL_TEXTURE, NULL, 0 },
- { "crystal", ARG_CRYSTAL_TEXTURE, NULL, 0 },
- { "chrome", ARG_CHROME_TEXTURE, NULL, 0 },
- { "brass", ARG_BRASS_TEXTURE, NULL, 0 },
- { "shiny", ARG_SHINY_TEXTURE, NULL, 0 },
- { "ghostly", ARG_GHOSTLY_TEXTURE, NULL, 0 },
- { "circuits", ARG_CIRCUITS_TEXTURE, NULL, 0 },
- { "donuts", ARG_DOUGHNUTS_TEXTURE, NULL, 0 },
- { "doughnuts", ARG_DOUGHNUTS_TEXTURE, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { "Each of these selects one of the rendering options (--solid,"
- " --translucent, and --hollow) and defines one or more torus groups.",
- 0, NULL, OPTION_DOC | OPTION_NO_USAGE },
- { NULL, 0, NULL, 0, "View options:" },
- { "fov", ARG_FOV, "NUM", 0, "Field of view (10-150, default = 90)" },
- { "randomness", ARG_RANDOMNESS, "NUM", 0,
- "Path randomness (1-10, default = 7)" },
- { "speed", ARG_SPEED, "NUM", 0, "Camera speed (1-100, default = 10)" },
- { "widescreen", ARG_WIDESCREEN, NULL, 0, "Enable widescreen view" },
- { "no-widescreen", ARG_NO_WIDESCREEN, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- {}
- };
- static struct argp parser = {
- options, parse, NULL,
- "Fly through an infinite lattice of interlocking rings."
- };
- return &parser;
-}
-
-std::string Hack::getShortName() { return "lattice"; }
-std::string Hack::getName() { return "Lattice"; }
-
-void Hack::start() {
- if (widescreen)
- glViewport(
- 0, Common::height / 2 - Common::width / 4,
- Common::width, Common::width / 2
- );
- else
- glViewport(0, 0, Common::width, Common::height);
-
- Resources::init();
-
- glFrontFace(GL_CCW);
- glEnable(GL_CULL_FACE);
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- float mat[16] = {
- std::cos(fov * 0.5f * D2R) / std::sin(fov * 0.5f * D2R), 0.0f, 0.0f, 0.0f,
- 0.0f, 0.0, 0.0f, 0.0f,
- 0.0f, 0.0f, -1.0f - 0.02f / float(depth), -1.0f,
- 0.0f, 0.0f, -(0.02f + 0.0002f / float(depth)), 0.0f
- };
- if (widescreen)
- mat[5] = mat[0] * 2.0f;
- else
- mat[5] = mat[0] * Common::aspectRatio;
- glLoadMatrixf(mat);
- Camera::set(mat, float(depth));
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- if (fog) {
- glEnable(GL_FOG);
- float fog_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};
- glFogfv(GL_FOG_COLOR, fog_color);
- glFogf(GL_FOG_MODE, GL_LINEAR);
- glFogf(GL_FOG_START, float(depth) * 0.3f);
- glFogf(GL_FOG_END, float(depth) - 0.1f);
- }
-
- // Initialize lattice objects and their positions in the lattice array
- for (unsigned int i = 0; i < LATSIZE; ++i)
- for (unsigned int j = 0; j < LATSIZE; ++j)
- for (unsigned int k = 0; k < LATSIZE; ++k)
- _lattice[i][j][k] = Resources::lists + Common::randomInt(NUMOBJECTS);
-
- _globalXYZ[0] = 0;
- _globalXYZ[1] = 0;
- _globalXYZ[2] = 0;
-
- // Set up first path section
- _path[0][0] = 0.0f;
- _path[0][1] = 0.0f;
- _path[0][2] = 0.0f;
- _path[0][3] = 0.0f;
- _path[0][4] = 0.0f;
- _path[0][5] = 0.0f;
- unsigned int j = Common::randomInt(12);
- unsigned int k = j % 6;
- for (unsigned int i = 0; i < 6; ++i)
- _path[1][i] = _bPnt[k][i];
- if (j > 5) { // If we want to head in a negative direction
- unsigned int i = k / 2; // then we need to flip along the appropriate axis
- _path[1][i] *= -1.0f;
- _path[1][i + 3] *= -1.0f;
- }
- _lastBorder = k;
- _segments = 1;
-}
-
-void Hack::tick() {
- static float where = 0.0f; // Position on path
- static unsigned int seg = 0; // Section of path
- where += speed * 0.05f * Common::elapsedSecs;
- if (where >= 1.0f) {
- where -= 1.0f;
- seg++;
- }
- if (seg >= _segments) {
- seg = 0;
- reconfigure();
- }
-
- static Vector oldXYZ(0.0f, 0.0f, 0.0f);
- static UnitVector oldDir(Vector(0.0f, 0.0f, -1.0f));
- static Vector oldAngVel(0.0f, 0.0f, 0.0f);
-
- // Calculate position
- Vector XYZ(
- interpolate(_path[seg][0], _path[seg][3],
- _path[seg + 1][0], _path[seg + 1][3], where),
- interpolate(_path[seg][1], _path[seg][4],
- _path[seg + 1][1], _path[seg + 1][4], where),
- interpolate(_path[seg][2], _path[seg][5],
- _path[seg + 1][2], _path[seg + 1][5], where)
- );
-
- static float maxSpin = 0.0025f * speed;
- static float rotationInertia = 0.007f * speed;
-
- // Do rotation stuff
- UnitVector dir(XYZ - oldXYZ); // Direction of motion
- Vector angVel(Vector::cross(dir, oldDir)); // Desired axis of rotation
- float temp = Vector::dot(oldDir, dir);
- if (temp < -1.0f) temp = -1.0f;
- if (temp > +1.0f) temp = +1.0f;
- float angle = Common::clamp(
- float(std::acos(temp)), // Desired turn angle
- -maxSpin, maxSpin
- );
- angVel *= angle; // Desired angular velocity
- Vector tempVec(angVel - oldAngVel); // Change in angular velocity
- // Don't let angular velocity change too much
- float distance = tempVec.length();
- if (distance > rotationInertia * Common::elapsedSecs) {
- tempVec *= (rotationInertia * Common::elapsedSecs) / distance;
- angVel = oldAngVel + tempVec;
- }
-
- static float flymodeChange = 20.0f;
- static int flymode = 1;
-
- flymodeChange -= Common::elapsedSecs;
- if (flymodeChange <= 1.0f) // prepare to transition
- angVel *= flymodeChange;
- if (flymodeChange <= 0.0f) { // transition from one fly mode to the other?
- flymode = Common::randomInt(4);
- flymodeChange = Common::randomFloat(float(150 - speed)) + 5.0f;
- }
- tempVec = angVel; // Recompute desired rotation
- angle = tempVec.normalize();
-
- static UnitQuat quat;
-
- if (flymode) // fly normal (straight)
- quat.multiplyBy(UnitQuat(angle, tempVec));
- else // don't fly normal (go backwards and stuff)
- quat.preMultiplyBy(UnitQuat(angle, tempVec));
-
- // Roll
- static float rollChange = Common::randomFloat(10.0f) + 2.0f;
- static float rollAcc = 0.0f;
- static float rollVel = 0.0f;
- rollChange -= Common::elapsedSecs;
- if (rollChange <= 0.0f) {
- rollAcc = Common::randomFloat(0.02f * speed) - (0.01f * speed);
- rollChange = Common::randomFloat(10.0f) + 2.0f;
- }
- rollVel += rollAcc * Common::elapsedSecs;
- if (rollVel > (0.04f * speed) && rollAcc > 0.0f)
- rollAcc = 0.0f;
- if (rollVel < (-0.04f * speed) && rollAcc < 0.0f)
- rollAcc = 0.0f;
- quat.multiplyBy(UnitQuat(rollVel * Common::elapsedSecs, oldDir));
-
- RotationMatrix rotMat(quat);
-
- // Save old stuff
- oldXYZ = XYZ;
- oldDir = Vector(
- -rotMat.get()[2],
- -rotMat.get()[6],
- -rotMat.get()[10]
- );
- oldAngVel = angVel;
-
- // Apply transformations
- glLoadMatrixf(rotMat.get());
- glTranslatef(-XYZ.x(), -XYZ.y(), -XYZ.z());
-
- // Render everything
- static int drawDepth = depth + 2;
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- for (int i = _globalXYZ[0] - drawDepth;
- i <= _globalXYZ[0] + drawDepth; ++i) {
- for (int j = _globalXYZ[1] - drawDepth;
- j <= _globalXYZ[1] + drawDepth; ++j) {
- for (int k = _globalXYZ[2] - drawDepth;
- k <= _globalXYZ[2] + drawDepth; ++k) {
- Vector tempVec(Vector(i, j, k) - XYZ);
- // transformed position
- Vector tPos(rotMat.transform(tempVec));
- if (Camera::isVisible(tPos, 0.9f)) {
- unsigned int indexX = latticeMod(i);
- unsigned int indexY = latticeMod(j);
- unsigned int indexZ = latticeMod(k);
- // draw it
- glPushMatrix();
- glTranslatef(float(i), float(j), float(k));
- glCallList(_lattice[indexX][indexY][indexZ]);
- glPopMatrix();
- }
- }
- }
- }
-
- Common::flush();
-}
-
-void Hack::reshape() {
- if (widescreen)
- glViewport(0, Common::height / 2 - Common::width / 4,
- Common::width, Common::width / 2);
- else
- glViewport(0, 0, Common::width, Common::height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- float mat[16] = {
- std::cos(fov * 0.5f * D2R) / std::sin(fov * 0.5f * D2R), 0.0f, 0.0f, 0.0f,
- 0.0f, 0.0, 0.0f, 0.0f,
- 0.0f, 0.0f, -1.0f - 0.02f / float(depth), -1.0f,
- 0.0f, 0.0f, -(0.02f + 0.0002f / float(depth)), 0.0f
- };
- if (widescreen)
- mat[5] = mat[0] * 2.0f;
- else
- mat[5] = mat[0] * Common::aspectRatio;
- glLoadMatrixf(mat);
- Camera::set(mat, float(depth));
- glMatrixMode(GL_MODELVIEW);
-}
-
-void Hack::stop() {}
-
-void Hack::keyPress(char c, const KeySym&) {
- switch (c) {
- case 3: case 27:
- case 'q': case 'Q':
- Common::running = false;
- break;
- }
-}
-
-void Hack::keyRelease(char, const KeySym&) {}
-void Hack::pointerMotion(int, int) {}
-void Hack::buttonPress(unsigned int) {}
-void Hack::buttonRelease(unsigned int) {}
-void Hack::pointerEnter() {}
-void Hack::pointerLeave() {}
-
-#define _LINUX
-#include "../../../addons/include/xbmc_scr_dll.h"
-
-extern "C" {
-
-ADDON_STATUS Create(void* hdl, void* props)
-{
- if (!props)
- return STATUS_UNKNOWN;
-
- SCR_PROPS* scrprops = (SCR_PROPS*)props;
-
- Common::width = scrprops->width;
- Common::height = scrprops->height;
- Common::aspectRatio = float(Common::width) / float(Common::height);
-
- return STATUS_OK;
-}
-
-void Start()
-{
- Hack::start();
-}
-
-void Render()
-{
- Hack::tick();
-}
-
-void Stop()
-{
- Hack::stop();
-}
-
-void Destroy()
-{
-}
-
-ADDON_STATUS GetStatus()
-{
- return STATUS_OK;
-}
-
-bool HasSettings()
-{
- return false;
-}
-
-unsigned int GetSettings(StructSetting ***sSet)
-{
- return 0;
-}
-
-ADDON_STATUS SetSetting(const char *settingName, const void *settingValue)
-{
- return STATUS_OK;
-}
-
-void FreeSettings()
-{
-}
-
-void GetInfo(SCR_INFO *info)
-{
-}
-
-void Remove()
-{
-}
-
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/lattice.hh b/xbmc/screensavers/rsxs-0.9/src/lattice/lattice.hh
deleted file mode 100644
index d5fe815cdd..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/lattice.hh
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _LATTICE_HH
-#define _LATTICE_HH
-
-#include <common.hh>
-
-namespace Hack {
- enum LinkType {
- UNKNOWN_LINKS = -1,
- SOLID_LINKS,
- TRANSLUCENT_LINKS,
- HOLLOW_LINKS
- };
-
- struct Texture {
- std::string filename;
- float shininess;
- bool sphereMap;
- bool colored;
- bool modulate;
- };
-
- extern unsigned int longitude;
- extern unsigned int latitude;
- extern float thickness;
- extern unsigned int density;
- extern unsigned int depth;
- extern float fov;
- extern unsigned int pathRand;
- extern float speed;
- extern LinkType linkType;
- extern std::vector<Texture> textures;
- extern bool smooth;
- extern bool fog;
- extern bool widescreen;
-};
-
-#endif // _LATTICE_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/resources.cc b/xbmc/screensavers/rsxs-0.9/src/lattice/resources.cc
deleted file mode 100644
index a5456d0059..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/resources.cc
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <lattice.hh>
-#include <pngimage.hh>
-#include <resource.hh>
-#include <resources.hh>
-
-namespace Resources {
- GLuint lists;
-
- struct TextureData {
- unsigned int texture;
- float shininess;
- bool sphereMap;
- bool colored;
- bool modulate;
- };
-
- std::vector<TextureData> _textures;
-
- void makeTorus(float, float);
-};
-
-void Resources::makeTorus(float centerRadius, float thickRadius) {
- // Smooth shading?
- if (Hack::smooth)
- glShadeModel(GL_SMOOTH);
- else
- glShadeModel(GL_FLAT);
-
- // Initialize texture stuff
- float vStep = 1.0f / float(Hack::latitude);
- float uStep = float(int((centerRadius / thickRadius) + 0.5f)) /
- float(Hack::longitude);
- float v2 = 0.0f;
-
- for (unsigned int i = 0; i < Hack::latitude; ++i) {
- float temp = M_PI * 2.0f * float(i) / float(Hack::latitude);
- float cosn = std::cos(temp);
- float sinn = std::sin(temp);
- temp = M_PI * 2.0f * float(i + 1) / float(Hack::latitude);
- float cosnn = std::cos(temp);
- float sinnn = std::sin(temp);
- float r = centerRadius + thickRadius * cosn;
- float rr = centerRadius + thickRadius * cosnn;
- float z = thickRadius * sinn;
- float zz = thickRadius * sinnn;
- if (!Hack::smooth) { // Redefine normals for flat shaded model
- temp = M_PI * 2.0f * (float(i) + 0.5f) / float(Hack::latitude);
- cosn = cosnn = std::cos(temp);
- sinn = sinnn = std::sin(temp);
- }
- float v1 = v2;
- v2 += vStep;
- float u = 0.0f;
- float oldcosa = 0.0f, oldsina = 0.0f, oldncosa = 0.0f, oldnsina = 0.0f;
- float oldcosn = 0.0f, oldcosnn = 0.0f, oldsinn = 0.0f, oldsinnn = 0.0f;
- glBegin(GL_TRIANGLE_STRIP);
- for (unsigned int j = 0; j < Hack::longitude; ++j) {
- temp = M_PI * 2.0f * float(j) / float(Hack::longitude);
- float cosa = std::cos(temp);
- float sina = std::sin(temp);
- float ncosa, nsina;
- if (Hack::smooth) {
- ncosa = cosa;
- nsina = sina;
- } else { // Redefine longitudinal component of normal for flat shading
- temp = M_PI * 2.0f * (float(j) - 0.5f) / float(Hack::longitude);
- ncosa = std::cos(temp);
- nsina = std::sin(temp);
- }
- if (j == 0) { // Save first values for end of circular tri-strip
- oldcosa = cosa;
- oldsina = sina;
- oldncosa = ncosa;
- oldnsina = nsina;
- oldcosn = cosn;
- oldcosnn = cosnn;
- oldsinn = sinn;
- oldsinnn = sinnn;
- }
- glNormal3f(cosnn * ncosa, cosnn * nsina, sinnn);
- glTexCoord2f(u, v2);
- glVertex3f(cosa * rr, sina * rr, zz);
- glNormal3f(cosn * ncosa, cosn * nsina, sinn);
- glTexCoord2f(u, v1);
- glVertex3f(cosa * r, sina * r, z);
- u += uStep; // update u texture coordinate
- }
- // Finish off circular tri-strip with saved first values
- glNormal3f(oldcosnn * oldncosa, oldcosnn * oldnsina, oldsinnn);
- glTexCoord2f(u, v2);
- glVertex3f(oldcosa * rr, oldsina * rr, zz);
- glNormal3f(oldcosn * oldncosa, oldcosn * oldnsina, oldsinn);
- glTexCoord2f(u, v1);
- glVertex3f(oldcosa * r, oldsina * r, z);
- glEnd();
- }
-}
-
-void Resources::init() {
- glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
- glEnable(GL_LIGHT0);
- float ambient[4] = {0.0f, 0.0f, 0.0f, 0.0f};
- float diffuse[4] = {1.0f, 1.0f, 1.0f, 0.0f};
- float specular[4] = {1.0f, 1.0f, 1.0f, 0.0f};
- float position[4] = {400.0f, 300.0f, 500.0f, 0.0f};
- glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
- glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
- glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
- glLightfv(GL_LIGHT0, GL_POSITION, position);
- glEnable(GL_COLOR_MATERIAL);
- glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
- glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
-
- for (
- std::vector<Hack::Texture>::const_iterator it = Hack::textures.begin();
- it != Hack::textures.end();
- ++it
- ) {
- TextureData data;
- data.shininess = it->shininess;
- data.sphereMap = it->sphereMap;
- data.colored = it->colored;
- data.modulate = it->modulate;
-
- if (it->filename != "") {
- PNG png(it->filename, !data.modulate);
- data.texture = Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- png
- );
- if (Hack::linkType == Hack::SOLID_LINKS)
- if (!data.modulate && !png.hasAlphaChannel())
- data.colored = false;
- } else
- data.texture = 0;
- _textures.push_back(data);
- }
-
- switch (Hack::linkType) {
- case Hack::SOLID_LINKS:
- glDisable(GL_BLEND);
- glEnable(GL_DEPTH_TEST);
- break;
- case Hack::TRANSLUCENT_LINKS:
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
- glEnable(GL_BLEND);
- glDisable(GL_DEPTH_TEST);
- break;
- case Hack::HOLLOW_LINKS:
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
- glEnable(GL_DEPTH_TEST);
- break;
- default:
- throw Common::Exception("Invalid linkType");
- }
-
- unsigned int d = 0;
- float thickness = Hack::thickness * 0.001f;
- lists = Common::resources->genLists(NUMOBJECTS);
- for (unsigned int i = 0; i < NUMOBJECTS; ++i) {
- glNewList(lists + i, GL_COMPILE);
- const TextureData& data =
- _textures[Common::randomInt(Hack::textures.size())];
-
- if (data.shininess >= 0.0f) {
- glEnable(GL_LIGHTING);
- // Add 0.0f to convert -0.0f into +0.0f, else GL complains
- glMaterialf(GL_FRONT, GL_SHININESS, 0.0f + data.shininess);
- glColorMaterial(GL_FRONT, GL_SPECULAR);
- } else
- glDisable(GL_LIGHTING);
- glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
-
- if (data.texture) {
- if (data.sphereMap) {
- glEnable(GL_TEXTURE_GEN_S);
- glEnable(GL_TEXTURE_GEN_T);
- } else {
- glDisable(GL_TEXTURE_GEN_S);
- glDisable(GL_TEXTURE_GEN_T);
- }
- glEnable(GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, data.texture);
- if (data.modulate)
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- else
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
- } else
- glDisable(GL_TEXTURE_2D);
-
- if (!data.colored)
- glColor3f(1.0f, 1.0f, 1.0f);
- if (d < Hack::density) {
- glPushMatrix();
- if (data.colored)
- glColor3f(
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f)
- );
- glTranslatef(-0.25f, -0.25f, -0.25f);
- if (Common::randomInt(2))
- glRotatef(180.0f, 1, 0, 0);
- makeTorus(0.36f - thickness, thickness);
- glPopMatrix();
- }
- d = (d + 37) % 100;
- if (d < Hack::density) {
- glPushMatrix();
- if (data.colored)
- glColor3f(
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f)
- );
- glTranslatef(0.25f, -0.25f, -0.25f);
- if (Common::randomInt(2))
- glRotatef(90.0f, 1, 0, 0);
- else
- glRotatef(-90.0f, 1, 0, 0);
- makeTorus(0.36f - thickness, thickness);
- glPopMatrix();
- }
- d = (d + 37) % 100;
- if (d < Hack::density) {
- glPushMatrix();
- if (data.colored)
- glColor3f(
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f)
- );
- glTranslatef(0.25f, -0.25f, 0.25f);
- if (Common::randomInt(2))
- glRotatef(90.0f, 0, 1, 0);
- else
- glRotatef(-90.0f, 0, 1, 0);
- makeTorus(0.36f - thickness, thickness);
- glPopMatrix();
- }
- d = (d + 37) % 100;
- if (d < Hack::density) {
- glPushMatrix();
- if (data.colored)
- glColor3f(
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f)
- );
- glTranslatef(0.25f, 0.25f, 0.25f);
- if (Common::randomInt(2))
- glRotatef(180.0f, 1, 0, 0);
- makeTorus(0.36f - thickness, thickness);
- glPopMatrix();
- }
- d = (d + 37) % 100;
- if (d < Hack::density) {
- glPushMatrix();
- if (data.colored)
- glColor3f(
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f)
- );
- glTranslatef(-0.25f, 0.25f, 0.25f);
- if (Common::randomInt(2))
- glRotatef(90.0f, 1, 0, 0);
- else
- glRotatef(-90.0f, 1, 0, 0);
- makeTorus(0.36f - thickness, thickness);
- glPopMatrix();
- }
- d = (d + 37) % 100;
- if (d < Hack::density) {
- glPushMatrix();
- if (data.colored)
- glColor3f(
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f),
- Common::randomFloat(1.0f)
- );
- glTranslatef(-0.25f, 0.25f, -0.25f);
- if (Common::randomInt(2))
- glRotatef(90.0f, 0, 1, 0);
- else
- glRotatef(-90.0f, 0, 1, 0);
- makeTorus(0.36f - thickness, thickness);
- glPopMatrix();
- }
- glEndList();
- d = (d + 37) % 100;
- }
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/resources.hh b/xbmc/screensavers/rsxs-0.9/src/lattice/resources.hh
deleted file mode 100644
index eeea2c6787..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/resources.hh
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _RESOURCES_HH
-#define _RESOURCES_HH
-
-#include <common.hh>
-
-#define NUMOBJECTS 10
-
-namespace Resources {
- extern unsigned int lists;
-
- void init();
-};
-
-#endif // _RESOURCES_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/lattice/shiny.png b/xbmc/screensavers/rsxs-0.9/src/lattice/shiny.png
deleted file mode 100644
index 94525e337b..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/lattice/shiny.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/oggsound.cc b/xbmc/screensavers/rsxs-0.9/src/oggsound.cc
deleted file mode 100644
index 37b9d42266..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/oggsound.cc
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#if HAVE_SOUND
-
-#include <cerrno>
-#include <dlopen.hh>
-#include <oggsound.hh>
-
-#include <vorbis/vorbisfile.h>
-
-namespace OV {
-#if USE_DLOPEN
- typedef int (*CLEAR)(OggVorbis_File *vf);
- CLEAR ov_clear;
- typedef vorbis_info * (*INFO)(OggVorbis_File *vf,int link);
- INFO ov_info;
- typedef int (*OPEN)(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
- OPEN ov_open;
- typedef ogg_int64_t (*PCM_TOTAL)(OggVorbis_File *vf,int i);
- PCM_TOTAL ov_pcm_total;
- typedef long (*READ)(OggVorbis_File *vf,char *buffer,int length,
- int bigendianp,int word,int sgned,int *bitstream);
- READ ov_read;
- typedef long (*SEEKABLE)(OggVorbis_File *vf);
- SEEKABLE ov_seekable;
- typedef long (*STREAMS)(OggVorbis_File *vf);
- STREAMS ov_streams;
-#else
- using ::ov_clear;
- using ::ov_info;
- using ::ov_open;
- using ::ov_pcm_total;
- using ::ov_read;
- using ::ov_seekable;
- using ::ov_streams;
-#endif
-};
-
-void OGG::load(FILE* in) {
- OggVorbis_File ovf;
- int result;
-
- if ((result = OV::ov_open(in, &ovf, NULL, 0)) != 0) {
- switch (result) {
- case OV_EREAD:
- throw Exception("Could not read file");
- case OV_ENOTVORBIS:
- throw Exception("Not an Ogg Vorbis file");
- case OV_EVERSION:
- throw Exception("Ogg Vorbis version mismatch");
- case OV_EBADHEADER:
- throw Exception("Error in Ogg Vorbis header");
- case OV_EFAULT:
- throw Exception("Internal Ogg Vorbis fault");
- default:
- throw Exception(
- stdx::oss() << "Unknown Ogg Vorbis error (" << result << ")"
- );
- }
- }
-
- try {
- if (!OV::ov_seekable(&ovf))
- throw Exception("Ogg Vorbis file not seekable");
-
- if (OV::ov_streams(&ovf) != 1)
- throw Exception("Multi-streamed Ogg Vorbis files not yet supported");
-
- vorbis_info* vi = OV::ov_info(&ovf, -1);
- ALenum format;
- switch (vi->channels) {
- case 1:
- format = AL_FORMAT_MONO16;
- break;
- case 2:
- format = AL_FORMAT_STEREO16;
- break;
- default:
- throw Exception(
- stdx::oss() << "Unsupported number of channels: " << vi->channels
- );
- }
- if (long((unsigned int)vi->rate) != vi->rate)
- throw Exception(
- stdx::oss() << "Unsupported sample rate: " << vi->rate
- );
-
- std::vector<char> buffer(vi->channels * 2 * OV::ov_pcm_total(&ovf, -1));
- std::vector<char>::iterator pos = buffer.begin();
- while (true) {
- int ignored;
- long result = OV::ov_read(&ovf, &*pos, buffer.end() - pos, 0, 2, 1, &ignored);
- if (result < 0)
- throw Exception("Ogg Vorbis file corrupted");
- if (result == 0)
- break;
- pos += result;
- if (pos > buffer.end())
- throw Exception("libvorbisfile overshot the buffer");
- }
-
- _buffer = Common::resources->manage(new Buffer(
- format, &buffer.front(), pos - buffer.begin(), vi->rate
- ));
-
- OV::ov_clear(&ovf);
- } catch (...) {
- OV::ov_clear(&ovf);
- throw;
- }
-}
-
-OGG::OGG(
- const std::string& filename, float ref, float delay
-) : Sound(ref, delay) {
-#if USE_DLOPEN
- try {
- const Library* libvorbisfile = Common::resources->manage(new Library("libvorbisfile"));
- OV::ov_clear = (OV::CLEAR)(*libvorbisfile)("ov_clear");
- OV::ov_info = (OV::INFO)(*libvorbisfile)("ov_info");
- OV::ov_open = (OV::OPEN)(*libvorbisfile)("ov_open");
- OV::ov_pcm_total = (OV::PCM_TOTAL)(*libvorbisfile)("ov_pcm_total");
- OV::ov_read = (OV::READ)(*libvorbisfile)("ov_read");
- OV::ov_seekable = (OV::SEEKABLE)(*libvorbisfile)("ov_seekable");
- OV::ov_streams = (OV::STREAMS)(*libvorbisfile)("ov_streams");
- } catch (Common::Exception e) {
- throw Sound::Unavailable();
- }
-#endif
-
- if (filename.empty())
- throw Exception("Empty filename");
-
- FILE* in = NULL;
- if (filename[0] != '/')
- in = std::fopen((Common::resourceDir + '/' + filename).c_str(), "rb");
-
- if (!in)
- in = std::fopen(filename.c_str(), "rb");
-
- if (!in)
- throw Exception(std::strerror(errno));
-
- load(in);
- // File is closed by ov_clear
-}
-
-#endif // HAVE_SOUND
diff --git a/xbmc/screensavers/rsxs-0.9/src/oggsound.hh b/xbmc/screensavers/rsxs-0.9/src/oggsound.hh
deleted file mode 100644
index 5df75b7650..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/oggsound.hh
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _OGGSOUND_HH
-#define _OGGSOUND_HH
-
-#include <common.hh>
-
-#include <sound.hh>
-
-#if HAVE_SOUND
-
-class OGG : public Sound {
-public:
- typedef Common::Exception Exception;
-private:
- void load(FILE*);
-public:
- OGG(const std::string&, float, float = 0.0f);
-};
-
-#else // !HAVE_SOUND
-
-class OGG : public Sound {
-public:
- OGG(const std::string&, float, float = 0.0f) {}
-};
-
-#endif // !HAVE_SOUND
-
-#endif // _OGGSOUND_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/plasma/Makefile.am b/xbmc/screensavers/rsxs-0.9/src/plasma/Makefile.am
deleted file mode 100644
index 17a82e3dbc..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/plasma/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-include $(srcdir)/../Makefile.common
-
-rs_plasma_SOURCES = $(COMMON) plasma.cc plasma.hh
-rs_plasma_LDADD = $(LIBMISC) $(X_LIBS) $(OPENGL_LIBS)
-
-hack_PROGRAMS = rs-plasma
diff --git a/xbmc/screensavers/rsxs-0.9/src/plasma/plasma.cc b/xbmc/screensavers/rsxs-0.9/src/plasma/plasma.cc
deleted file mode 100644
index 89ef745b92..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/plasma/plasma.cc
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <hack.hh>
-#include <plasma.hh>
-
-#define NUMCONSTS 18
-#define MAXTEXSIZE 1024
-
-namespace Hack {
- float zoom = 10.0f;
- float focus = 30.0f;
- float speed = 20.0f;
- unsigned int resolution = 20;
-};
-
-namespace Hack {
- enum Arguments {
- ARG_ZOOM = 1,
- ARG_FOCUS,
- ARG_SPEED,
- ARG_RESOLUTION
- };
-
- float _wide;
- float _high;
- float _c[NUMCONSTS]; // constant
- float _ct[NUMCONSTS]; // temporary value of constant
- float _cv[NUMCONSTS]; // velocity of constant
- stdx::dim2<std::pair<float, float> > _position;
- stdx::dim2<RGBColor> _plasma;
- unsigned int _texSize;
- unsigned int _plasmaWidth;
- unsigned int _plasmaHeight;
- stdx::dim3<float, 3> _plasmaMap;
-
- float _maxDiff;
- float _texRight;
- float _texTop;
-
- static inline float absTrunc(float f) {
- if (f >= 0.0f)
- return f <= 1.0f ? f : 1.0f;
- else
- return f >= -1.0f ? -f : 1.0f;
- }
-
- error_t parse(int, char*, struct argp_state*);
-};
-
-error_t Hack::parse(int key, char* arg, struct argp_state* state) {
- switch (key) {
- case ARG_ZOOM:
- if (Common::parseArg(arg, zoom, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "magnification must be between 1 and 100");
- return 0;
- case ARG_FOCUS:
- if (Common::parseArg(arg, focus, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "plasma focus must be between 1 and 100");
- return 0;
- case ARG_SPEED:
- if (Common::parseArg(arg, speed, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "plasma speed must be between 1 and 100");
- return 0;
- case ARG_RESOLUTION:
- if (Common::parseArg(arg, resolution, 1u, 100u))
- argp_failure(state, EXIT_FAILURE, 0,
- "plama resolution must be between 1 and 100");
- return 0;
- default:
- return ARGP_ERR_UNKNOWN;
- }
-}
-
-const struct argp* Hack::getParser() {
- static struct argp_option options[] = {
- { NULL, 0, NULL, 0, "Plasma options:" },
- { "zoom", ARG_ZOOM, "NUM", 0, "Magnification (1-100, default = 10)" },
- { "focus", ARG_FOCUS, "NUM", 0, "Plasma focus (1-100, default = 30)" },
- { "speed", ARG_SPEED, "NUM", 0, "Plasma speed (1-100, default = 20)" },
- { "resolution", ARG_RESOLUTION, "NUM", 0,
- "Plasma resolution (1-100, default = 20)" },
- {}
- };
- static struct argp parser =
- { options, parse, NULL, "Draws gooey colorful plasma stuff." };
- return &parser;
-}
-
-std::string Hack::getShortName() { return "plasma"; }
-std::string Hack::getName() { return "Plasma"; }
-
-void Hack::start() {
- glViewport(0, 0, Common::width, Common::height);
-
- if (Common::aspectRatio >= 1.0f) {
- _wide = 30.0f / zoom;
- _high = _wide / Common::aspectRatio;
- } else {
- _high = 30.0f / zoom;
- _wide = _high * Common::aspectRatio;
- }
-/*
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluOrtho2D(0.0f, 1.0f, 0.0f, 1.0f);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-*/
- // Set resolution of plasma
- if (Common::aspectRatio >= 1.0f)
- _plasmaHeight = (resolution * MAXTEXSIZE) / 100;
- else
- _plasmaHeight = (unsigned int)(
- float(resolution * MAXTEXSIZE) *
- Common::aspectRatio * 0.01f
- );
-
- _plasmaWidth = (unsigned int)(float(_plasmaHeight) / Common::aspectRatio);
-
- // Set resolution of texture
- _texSize = 16;
- if (Common::aspectRatio >= 1.0f)
- while (_plasmaHeight > _texSize) _texSize *= 2;
- else
- while (_plasmaWidth > _texSize) _texSize *= 2;
-
- // Initialize memory and positions
- _position.resize(_plasmaWidth, _plasmaHeight);
- _plasma.resize(_plasmaWidth, _plasmaHeight);
- _plasmaMap.resize(_texSize, _texSize);
- for (unsigned int i = 0; i < _plasmaHeight; ++i)
- for (unsigned int j = 0; j < _plasmaWidth; ++j)
- _position(i, j) =
- std::make_pair(
- (i * _wide) / float(_plasmaHeight - 1) - (_wide * 0.5f),
- (j * _high) /
- (float(_plasmaHeight) / Common::aspectRatio - 1.0f) -
- (_high * 0.5f)
- );
-
- // Initialize constants
- for (unsigned int i = 0; i < NUMCONSTS; ++i) {
- _c[i] = 0.0f;
- _ct[i] = Common::randomFloat(M_PI * 2.0f);
- _cv[i] = Common::randomFloat(0.005f * speed) + 0.0001f;
- }
-
- // Make texture
- glBindTexture(GL_TEXTURE_2D, 1000);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
- glTexImage2D(GL_TEXTURE_2D, 0, 3, _texSize, _texSize, 0,
- GL_RGB, GL_FLOAT, &_plasmaMap.front());
- //glEnable(GL_TEXTURE_2D);
- //glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
- //glPixelStorei(GL_UNPACK_ROW_LENGTH, _texSize);
-
- focus = focus / 50.0f + 0.3f;
- _maxDiff = 0.004f * speed;
-
- // The "- 1" cuts off right and top edges to get rid of blending to black
- _texRight = float(_plasmaHeight - 1) / float(_texSize);
- _texTop = _texRight / Common::aspectRatio;
-
- // Clear the error flag
- glGetError();
-}
-
-void Hack::tick() {
- int origRowLength;
-
- glViewport(0, 0, Common::width, Common::height);
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- gluOrtho2D(0.0f, 1.0f, 0.0f, 1.0f);
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
- glBindTexture(GL_TEXTURE_2D, 1000);
- glEnable(GL_TEXTURE_2D);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
- glGetIntegerv(GL_UNPACK_ROW_LENGTH, &origRowLength);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, _texSize);
-
- // Update constants
- for(unsigned int i = 0; i < NUMCONSTS; ++i) {
- _ct[i] += _cv[i];
- if (_ct[i] > M_PI * 2.0f)
- _ct[i] -= M_PI * 2.0f;
- _c[i] = std::sin(_ct[i]) * focus;
- }
-
- // Update colors
- for (unsigned int i = 0; i < _plasmaHeight; ++i) {
- for (unsigned int j = 0; j < _plasmaWidth; ++j) {
- RGBColor& plasma(_plasma(i, j));
- RGBColor RGB(plasma);
- std::pair<float, float>& pos(_position(i, j));
-
- // Calculate vertex colors
- plasma.set(
- 0.7f
- * (_c[0] * pos.first + _c[1] * pos.second
- + _c[2] * (pos.first * pos.first + 1.0f)
- + _c[3] * pos.first * pos.second
- + _c[4] * RGB.g() + _c[5] * RGB.b()),
- 0.7f
- * (_c[6] * pos.first + _c[7] * pos.second
- + _c[8] * pos.first * pos.first
- + _c[9] * (pos.second * pos.second - 1.0f)
- + _c[10] * RGB.r() + _c[11] * RGB.b()),
- 0.7f
- * (_c[12] * pos.first + _c[13] * pos.second
- + _c[14] * (1.0f - pos.first * pos.second)
- + _c[15] * pos.second * pos.second
- + _c[16] * RGB.r() + _c[17] * RGB.g())
- );
-
- // Don't let the colors change too much
- float temp = plasma.r() - RGB.r();
- if (temp > _maxDiff)
- plasma.r() = RGB.r() + _maxDiff;
- if (temp < -_maxDiff)
- plasma.r() = RGB.r() - _maxDiff;
- temp = plasma.g() - RGB.g();
- if (temp > _maxDiff)
- plasma.g() = RGB.g() + _maxDiff;
- if (temp < -_maxDiff)
- plasma.g() = RGB.g() - _maxDiff;
- temp = plasma.b() - RGB.b();
- if (temp > _maxDiff)
- plasma.b() = RGB.b() + _maxDiff;
- if (temp < -_maxDiff)
- plasma.b() = RGB.b() - _maxDiff;
-
- // Put colors into texture
- _plasmaMap(i, j, 0) = absTrunc(plasma.r());
- _plasmaMap(i, j, 1) = absTrunc(plasma.g());
- _plasmaMap(i, j, 2) = absTrunc(plasma.b());
- }
- }
-
- // Update texture
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,
- _plasmaWidth, _plasmaHeight, GL_RGB, GL_FLOAT, &_plasmaMap.front());
-
- // Draw it
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(0.0f, 0.0f);
- glVertex2f(0.0f, 0.0f);
- glTexCoord2f(0.0f, _texRight);
- glVertex2f(1.0f, 0.0f);
- glTexCoord2f(_texTop, 0.0f);
- glVertex2f(0.0f, 1.0f);
- glTexCoord2f(_texTop, _texRight);
- glVertex2f(1.0f, 1.0f);
- glEnd();
-
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
- glPixelStorei(GL_UNPACK_ROW_LENGTH, origRowLength);
-
- //Common::flush();
-
- // Clear the error flag
- glGetError();
-}
-
-void Hack::reshape() {
- glViewport(0, 0, Common::width, Common::height);
-}
-
-void Hack::stop() {}
-
-void Hack::keyPress(char c, const KeySym&) {
- switch (c) {
- case 3: case 27:
- case 'q': case 'Q':
- Common::running = false;
- break;
- }
-}
-
-void Hack::keyRelease(char, const KeySym&) {}
-void Hack::pointerMotion(int, int) {}
-void Hack::buttonPress(unsigned int) {}
-void Hack::buttonRelease(unsigned int) {}
-void Hack::pointerEnter() {}
-void Hack::pointerLeave() {}
-
-#define _LINUX
-#include "../../../addons/include/xbmc_scr_dll.h"
-
-extern "C" {
-
-ADDON_STATUS ADDON_Create(void* hdl, void* props)
-{
- if (!props)
- return ADDON_STATUS_UNKNOWN;
-
- SCR_PROPS* scrprops = (SCR_PROPS*)props;
-
- Common::width = scrprops->width;
- Common::height = scrprops->height;
- Common::aspectRatio = float(Common::width) / float(Common::height);
-
- return ADDON_STATUS_OK;
-}
-
-void Start()
-{
- Hack::start();
-}
-
-void Render()
-{
- Hack::tick();
-}
-
-void ADDON_Stop()
-{
- Hack::stop();
-}
-
-void ADDON_Destroy()
-{
-}
-
-ADDON_STATUS ADDON_GetStatus()
-{
- return ADDON_STATUS_OK;
-}
-
-bool ADDON_HasSettings()
-{
- return false;
-}
-
-unsigned int ADDON_GetSettings(ADDON_StructSetting ***sSet)
-{
- return 0;
-}
-
-ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue)
-{
- return ADDON_STATUS_OK;
-}
-
-void ADDON_FreeSettings()
-{
-}
-
-void ADDON_Announce(const char *flag, const char *sender, const char *message, const void *data)
-{
-}
-
-void GetInfo(SCR_INFO *info)
-{
-}
-
-void Remove()
-{
-}
-
-}
-
diff --git a/xbmc/screensavers/rsxs-0.9/src/plasma/plasma.hh b/xbmc/screensavers/rsxs-0.9/src/plasma/plasma.hh
deleted file mode 100644
index 44b5fb4194..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/plasma/plasma.hh
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _PLASMA_HH
-#define _PLASMA_HH
-
-#include <common.hh>
-
-namespace Hack {
- extern float zoom;
- extern float focus;
- extern float speed;
- extern unsigned int resolution;
-};
-
-#endif // _PLASMA_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/pngimage.cc b/xbmc/screensavers/rsxs-0.9/src/pngimage.cc
deleted file mode 100644
index b862085852..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/pngimage.cc
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#if HAVE_PNG_H
- #include <png.h>
-#endif
-
-#if HAVE_SETJMP_H
- #include <setjmp.h>
-#endif
-
-#include <cerrno>
-#include <color.hh>
-#include <pngimage.hh>
-#include <cstring>
-
-void PNG::load(FILE* in, bool fullColor) {
- png_byte sig[8];
- int sigBytes = fread(sig, 1, 8, in);
-
- if (png_sig_cmp(sig, 0, sigBytes))
- throw Exception("Not a PNG file");
-
- png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING,
- NULL, NULL, NULL);
- if (!png)
- throw Exception("Could not create PNG read structure");
- png_infop pngInfo = png_create_info_struct(png);
- if (!pngInfo)
- throw Exception("Could not create PNG info structure");
-
- try {
- if (setjmp(png_jmpbuf(png)))
- throw Exception("PNG could not be decoded");
-
- png_init_io(png, in);
- png_set_sig_bytes(png, sigBytes);
-
- png_read_info(png, pngInfo);
-
- if (png_get_color_type(png, pngInfo) == PNG_COLOR_TYPE_PALETTE)
- png_set_palette_to_rgb(png);
- if (
- (png_get_color_type(png, pngInfo) == PNG_COLOR_TYPE_GRAY) &&
- png_get_bit_depth(png, pngInfo) < 8
- )
- png_set_expand_gray_1_2_4_to_8(png);
- if (png_get_valid(png, pngInfo, PNG_INFO_tRNS))
- png_set_tRNS_to_alpha(png);
- if (fullColor)
- png_set_gray_to_rgb(png);
- if (png_get_bit_depth(png, pngInfo) < 8)
- png_set_packing(png);
- png_read_update_info(png, pngInfo);
-
- _width = png_get_image_width(png, pngInfo);
- _height = png_get_image_height(png, pngInfo);
-
- switch (png_get_color_type(png, pngInfo)) {
- case PNG_COLOR_TYPE_GRAY:
- _format = GL_LUMINANCE;
- _bytesPerPixel = 1;
- _hasAlphaChannel = false;
- break;
- case PNG_COLOR_TYPE_RGB:
- _format = GL_RGB;
- _bytesPerPixel = 3;
- _hasAlphaChannel = false;
- break;
- case PNG_COLOR_TYPE_RGBA:
- _format = GL_RGBA;
- _bytesPerPixel = 4;
- _hasAlphaChannel = true;
- break;
- case PNG_COLOR_TYPE_GA:
- _format = GL_LUMINANCE_ALPHA;
- _bytesPerPixel = 2;
- _hasAlphaChannel = true;
- break;
- default:
- throw Exception("Unhandled image type");
- }
- switch (png_get_bit_depth(png, pngInfo)) {
- case 8:
- _type = GL_UNSIGNED_BYTE;
- break;
- case 16:
- _type = GL_UNSIGNED_SHORT;
- _bytesPerPixel *= 2;
- break;
- default:
- throw Exception("Unhandled image depth");
- }
- _numComponents = png_get_channels(png, pngInfo);
-
- GLint alignment;
- glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
- _rowLength =
- ((_width * _bytesPerPixel + alignment - 1) / alignment) * alignment;
- _data = new uint8_t[_height * _rowLength];
- png_bytep* rows = new png_bytep[_height];
- for (GLsizei i = 0; i < _height; ++i)
- rows[i] = _data + _rowLength * i;
- png_read_image(png, rows);
- delete[] rows;
-
- png_read_end(png, NULL);
- png_destroy_read_struct(&png, &pngInfo, NULL);
- } catch (...) {
- png_destroy_read_struct(&png, &pngInfo, NULL);
- throw;
- }
-}
-
-PNG::PNG(const std::string& filename, bool fullColor) {
- if (filename.empty())
- throw Exception("Empty filename");
-
- FILE* in = NULL;
- if (filename[0] != '/')
- in = std::fopen((Common::resourceDir + '/' + filename).c_str(), "rb");
-
- if (!in)
- in = std::fopen(filename.c_str(), "rb");
-
- if (!in)
- throw Exception(stdx::oss() << filename << ": " << std::strerror(errno));
-
- try {
- load(in, fullColor);
- } catch (Exception e) {
- throw Exception(stdx::oss() << filename << ": " << e);
- }
- std::fclose(in);
-}
-
-PNG::~PNG() {
- if (_data) delete[] _data;
-}
-
-const RGBColor PNG::operator()(GLsizei x, GLsizei y) const {
- if (x >= _width || y >= _height)
- return RGBColor();
-
- uint8_t* pos = _data + _rowLength * y + _bytesPerPixel * x;
- if (_type == GL_UNSIGNED_BYTE) {
- switch (_format) {
- case GL_LUMINANCE:
- case GL_LUMINANCE_ALPHA:
- {
- float l = float(*pos) / 255.0f;
- return RGBColor(l, l, l);
- }
- case GL_RGB:
- case GL_RGBA:
- {
- float r = float(pos[0]) / 255.0f;
- float g = float(pos[1]) / 255.0f;
- float b = float(pos[2]) / 255.0f;
- return RGBColor(r, g, b);
- }
- default:
- return RGBColor();
- }
- } else {
- switch (_format) {
- case GL_LUMINANCE:
- case GL_LUMINANCE_ALPHA:
- {
- float l = float((unsigned int)(pos[0]) * 255 + pos[1]) / 65535.0f;
- return RGBColor(l, l, l);
- }
- case GL_RGB:
- case GL_RGBA:
- {
- float r = float((unsigned int)(pos[0]) * 255 + pos[1]) / 65535.0f;
- float g = float((unsigned int)(pos[2]) * 255 + pos[3]) / 65535.0f;
- float b = float((unsigned int)(pos[4]) * 255 + pos[5]) / 65535.0f;
- return RGBColor(r, g, b);
- }
- default:
- return RGBColor();
- }
- }
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/pngimage.hh b/xbmc/screensavers/rsxs-0.9/src/pngimage.hh
deleted file mode 100644
index 306e752e64..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/pngimage.hh
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _PNGIMAGE_HH
-#define _PNGIMAGE_HH
-
-#include <common.hh>
-
-#if HAVE_STDINT_H
- #include <stdint.h>
-#endif
-
-#include <color.hh>
-#include <cstdio>
-
-class PNG {
-public:
- typedef std::string Exception;
-private:
- GLint _numComponents;
- GLsizei _width;
- GLsizei _height;
- GLenum _format;
- GLenum _type;
- uint8_t* _data;
-
- bool _hasAlphaChannel;
-
- unsigned int _bytesPerPixel;
- unsigned int _rowLength;
-
- void load(FILE*, bool);
-public:
- PNG(const std::string&, bool = false);
- ~PNG();
-
- GLint numComponents() const { return _numComponents; }
- unsigned int width() const { return _width; }
- unsigned int height() const { return _height; }
- GLenum format() const { return _format; }
- GLenum type() const { return _type; }
- const GLvoid* data() const { return _data; }
-
- bool hasAlphaChannel() const { return _hasAlphaChannel; }
- const RGBColor operator()(GLsizei, GLsizei) const;
-};
-
-#endif // _PNGIMAGE_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/resource.hh b/xbmc/screensavers/rsxs-0.9/src/resource.hh
deleted file mode 100644
index 4e58c26001..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/resource.hh
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _RESOURCE_HH
-#define _RESOURCE_HH
-
-#include <common.hh>
-
-#include <pngimage.hh>
-
-class ResourceManager {
-public:
- typedef Common::Exception Exception;
-private:
- class _ResourceBase {
- protected:
- _ResourceBase() {}
- public:
- virtual ~_ResourceBase() {}
- };
- std::list<_ResourceBase*> _resources;
-public:
- template <typename Ret>
- class Resource : public _ResourceBase {
- protected:
- Resource() {}
- public:
- virtual ~Resource() {}
- virtual Ret operator()() const = 0;
- };
-public:
- template <typename Ret>
- Ret manage(Resource<Ret> *resource) {
- _resources.push_front(resource);
- return (*resource)();
- }
-private:
- class DisplayLists : public Resource<GLuint> {
- private:
- GLuint _base;
- GLsizei _num;
- public:
- DisplayLists(GLsizei num) : _base(glGenLists(num)), _num(num) {
- if (_base == 0) throw Exception("No more available GL display lists");
- }
- ~DisplayLists() { glDeleteLists(_base, _num); }
- GLuint operator()() const { return _base; }
- };
-
- class Texture : public Resource<GLuint> {
- private:
- GLuint _texture;
- public:
- Texture(GLenum target, GLenum minFilter, GLenum magFilter, GLenum wrapS, GLenum wrapT) {
- glGenTextures(1, &_texture);
- glBindTexture(target, _texture);
- glTexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilter);
- glTexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilter);
- glTexParameteri(target, GL_TEXTURE_WRAP_S, wrapS);
- glTexParameteri(target, GL_TEXTURE_WRAP_T, wrapT);
- }
- ~Texture() { glDeleteTextures(1, &_texture); }
- GLuint operator()() const { return _texture; }
- };
-public:
- ~ResourceManager() { stdx::destroy_all_ptr(_resources); }
-
- GLuint genLists(GLsizei num) {
- return manage(new DisplayLists(num));
- }
-
- GLuint genTexture(
- GLenum minFilter, GLenum magFilter, GLenum wrapS, GLenum wrapT
- ) {
- return manage(new Texture(
- GL_TEXTURE_2D, minFilter, magFilter, wrapS, wrapT
- ));
- }
-
- GLuint genTexture(
- GLenum minFilter, GLenum magFilter, GLenum wrapS, GLenum wrapT,
- GLint numComponents, GLsizei width, GLsizei height,
- GLenum format, GLenum type, const GLvoid* data, bool mipmap = true
- ) {
- GLuint result = genTexture(minFilter, magFilter, wrapS, wrapT);
- if (mipmap)
- gluBuild2DMipmaps(
- GL_TEXTURE_2D, numComponents, width, height,
- format, type, data
- );
- else
- glTexImage2D(
- GL_TEXTURE_2D, 0, numComponents, width, height, 0,
- format, type, data
- );
- return result;
- }
-
- GLuint genTexture(
- GLenum minFilter, GLenum magFilter, GLenum wrapS, GLenum wrapT,
- const PNG& png, bool mipmap = true
- ) {
- return genTexture(
- minFilter, magFilter, wrapS, wrapT,
- png.numComponents(), png.width(), png.height(),
- png.format(), png.type(), png.data(), mipmap
- );
- }
-
-#ifdef GL_ARB_texture_cube_map
-
- GLuint genCubeMapTexture(
- GLenum minFilter, GLenum magFilter, GLenum wrapS, GLenum wrapT
- ) {
- return manage(new Texture(
- GL_TEXTURE_CUBE_MAP_ARB, minFilter, magFilter, wrapS, wrapT
- ));
- }
-
- GLuint genCubeMapTexture(
- GLenum minFilter, GLenum magFilter, GLenum wrapS, GLenum wrapT,
- GLint numComponents, GLsizei width, GLsizei height,
- GLenum format, GLenum type, const GLvoid* data, bool mipmap = true
- ) {
- GLuint result = genCubeMapTexture(minFilter, magFilter, wrapS, wrapT);
- if (mipmap) {
- gluBuild2DMipmaps(
- GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, numComponents, width, height,
- format, type, data
- );
- gluBuild2DMipmaps(
- GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, numComponents, width, height,
- format, type, data
- );
- gluBuild2DMipmaps(
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, numComponents, width, height,
- format, type, data
- );
- gluBuild2DMipmaps(
- GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, numComponents, width, height,
- format, type, data
- );
- gluBuild2DMipmaps(
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, numComponents, width, height,
- format, type, data
- );
- gluBuild2DMipmaps(
- GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, numComponents, width, height,
- format, type, data
- );
- } else {
- glTexImage2D(
- GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, 0, numComponents, width, height, 0,
- format, type, data
- );
- glTexImage2D(
- GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, 0, numComponents, width, height, 0,
- format, type, data
- );
- glTexImage2D(
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, 0, numComponents, width, height, 0,
- format, type, data
- );
- glTexImage2D(
- GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, 0, numComponents, width, height, 0,
- format, type, data
- );
- glTexImage2D(
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, 0, numComponents, width, height, 0,
- format, type, data
- );
- glTexImage2D(
- GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, 0, numComponents, width, height, 0,
- format, type, data
- );
- }
- return result;
- }
-
- GLuint genCubeMapTexture(
- GLenum minFilter, GLenum magFilter, GLenum wrapS, GLenum wrapT,
- const PNG& png, bool mipmap = true
- ) {
- return genCubeMapTexture(
- minFilter, magFilter, wrapS, wrapT,
- png.numComponents(), png.width(), png.height(),
- png.format(), png.type(), png.data()
- );
- }
-
-#endif // GL_ARB_texture_cube_map
-};
-
-#endif // _RESOURCE_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/Makefile.am b/xbmc/screensavers/rsxs-0.9/src/skyrocket/Makefile.am
deleted file mode 100644
index c8a2fd6a72..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-include $(srcdir)/../Makefile.common
-
-rs_skyrocket_SOURCES = $(COMMON) $(COLOR) $(VECTOR) $(IMAGE) $(SOUND) $(DLOPEN) \
- bee.cc bee.hh bigmama.cc bigmama.hh bomb.cc bomb.hh explosion.cc \
- explosion.hh flares.cc flares.hh fountain.cc fountain.hh meteor.cc \
- meteor.hh overlay.cc overlay.hh particle.hh resources.cc resources.hh \
- rocket.cc rocket.hh shockwave.cc shockwave.hh skyrocket.cc skyrocket.hh \
- smoke.cc smoke.hh spinner.cc spinner.hh star.cc star.hh streamer.cc \
- streamer.hh stretcher.cc stretcher.hh sucker.cc sucker.hh world.cc world.hh
-
-AM_CPPFLAGS += $(LIBLTDL_CPPFLAGS) $(IMAGE_CPPFLAGS) $(SOUND_CPPFLAGS)
-AM_CXXFLAGS += $(IMAGE_CXXFLAGS) $(SOUND_CXXFLAGS)
-AM_LDFLAGS += $(IMAGE_LDFLAGS) $(SOUND_LDFLAGS)
-rs_skyrocket_LDADD = $(LIBMISC) $(LIBLTDL) $(X_LIBS) $(OPENGL_LIBS) $(IMAGE_LIBS) $(SOUND_LIBS)
-
-hack_PROGRAMS = rs-skyrocket
-
-skyrocketdatadir = $(pkgdatadir)/skyrocket
-dist_skyrocketdata_DATA = cloud.png earth-far.png earth-light.png \
- earth-near.png moon.png smoke1.png smoke2.png smoke3.png smoke4.png \
- smoke5.png
-if SOUND
-dist_skyrocketdata_DATA += boom1.ogg boom2.ogg boom3.ogg boom4.ogg \
- launch1.ogg launch2.ogg nuke.ogg popper.ogg suck.ogg whistle.ogg
-endif SOUND
-
-uninstall-hook:
- -rmdir $(skyrocketdatadir)
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/bee.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/bee.cc
deleted file mode 100644
index f95692dfd3..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/bee.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <bee.hh>
-#include <resources.hh>
-#include <skyrocket.hh>
-#include <star.hh>
-#include <vector.hh>
-
-void Bee::update() {
- _remaining -= Common::elapsedTime;
-
- if (_remaining <= 0.0f || _pos.y() <= 0.0f) {
- _depth = DEAD_DEPTH;
- ++Hack::numDead;
- return;
- }
-
- _vel.y() -= Common::elapsedTime * 32.0f;
- _vel += Vector(
- std::cos(_accel.x()),
- std::cos(_accel.y()) - 0.2f,
- std::cos(_accel.z())
- ) * 800.0f * Common::elapsedTime;
- _pos += _vel * Common::elapsedTime;
- _pos.x() +=
- (0.1f - 0.00175f * _pos.y() + 0.0000011f * _pos.y() * _pos.y()) *
- Hack::wind * Common::elapsedTime;
-
- float temp = (_lifetime - _remaining) / _lifetime;
- _brightness = 1.0f - temp * temp * temp * temp;
-
- _accel += _accelSpeed * Common::elapsedTime;
- if (_accel.x() > M_PI)
- _accel.x() -= 2.0f * M_PI;
- if (_accel.y() > M_PI)
- _accel.y() -= 2.0f * M_PI;
- if (_accel.z() > M_PI)
- _accel.z() -= 2.0f * M_PI;
-
- Vector step(_pos - _sparkPos);
- float distance = step.normalize();
-
- if (distance > 10.0f) {
- unsigned int n = (unsigned int)(distance / 10.0f);
- step *= 10.0f;
- for (unsigned int i = 0; i < n; ++i) {
- Hack::pending.push_back(new Star(_sparkPos,
- Vector(
- Common::randomFloat(100.0f) - 20.0f,
- Common::randomFloat(100.0f) - 20.0f,
- Common::randomFloat(100.0f) - 20.0f
- ) - _vel * 0.5f, 0.612f, Common::randomFloat(0.1f) + 0.15f, _RGB, 7.0f,
- false, Resources::DisplayLists::flares + 3
- ));
- _sparkPos += step;
- }
- }
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-};
-
-void Bee::updateCameraOnly() {
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Bee::draw() const {
- if (_depth < 0.0f)
- return;
-
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(10.0f, 10.0f, 10.0f);
- glMultMatrixf(Hack::cameraMat.get());
- glColor4f(_RGB.r(), _RGB.g(), _RGB.b(), _brightness);
- glCallList(Resources::DisplayLists::flares);
- glPopMatrix();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/bee.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/bee.hh
deleted file mode 100644
index e77f7c823f..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/bee.hh
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _BEE_HH
-#define _BEE_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <particle.hh>
-#include <vector.hh>
-
-class Bee : public Particle {
-private:
- RGBColor _RGB;
- float _brightness;
-
- Vector _accel;
- Vector _accelSpeed;
-
- Vector _sparkPos;
-public:
- Bee(const Vector& pos, const Vector& vel, const RGBColor& RGB) :
- Particle(pos, vel, 0.3f, Common::randomFloat(1.0f) + 2.5f),
- _RGB(RGB), _accel(
- Common::randomFloat(M_PI * 2),
- Common::randomFloat(M_PI * 2),
- Common::randomFloat(M_PI * 2)
- ), _accelSpeed(
- Common::randomFloat(M_PI * 2),
- Common::randomFloat(M_PI * 2),
- Common::randomFloat(M_PI * 2)
- ), _sparkPos(_pos) {}
-
- void update();
- void updateCameraOnly();
- void draw() const;
-};
-
-#endif // _BEE_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/bigmama.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/bigmama.cc
deleted file mode 100644
index bc2bcf54bf..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/bigmama.cc
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <bigmama.hh>
-#include <color.hh>
-#include <resources.hh>
-#include <skyrocket.hh>
-#include <star.hh>
-#include <vector.hh>
-
-BigMama::BigMama(const Vector& pos, const Vector& vel) :
- Particle(pos, vel, 0.612f, 5.0f) {
- Hack::pending.push_back(new Star(_pos, _vel + Vector(0.0f, 15.0f, 0.0f),
- 0.0f, 3.0f, RGBColor(1.0f, 1.0f, 0.9f), 400.0f));
- Hack::pending.push_back(new Star(_pos, _vel - Vector(0.0f, 15.0f, 0.0f),
- 0.0f, 3.0f, RGBColor(1.0f, 1.0f, 0.9f), 400.0f));
- Hack::pending.push_back(new Star(_pos, _vel + Vector(0.0f, 45.0f, 0.0f),
- 0.0f, 3.5f, RGBColor(1.0f, 1.0f, 0.6f), 400.0f));
- Hack::pending.push_back(new Star(_pos, _vel - Vector(0.0f, 45.0f, 0.0f),
- 0.0f, 3.5f, RGBColor(1.0f, 1.0f, 0.6f), 400.0f));
- Hack::pending.push_back(new Star(_pos, _vel + Vector(0.0f, 75.0f, 0.0f),
- 0.0f, 4.0f, RGBColor(1.0f, 0.5f, 0.3f), 400.0f));
- Hack::pending.push_back(new Star(_pos, _vel - Vector(0.0f, 75.0f, 0.0f),
- 0.0f, 4.0f, RGBColor(1.0f, 0.5f, 0.3f), 400.0f));
- Hack::pending.push_back(new Star(_pos, _vel + Vector(0.0f, 105.0f, 0.0f),
- 0.0f, 4.5f, RGBColor(1.0f, 0.0f, 0.0f), 400.0f));
- Hack::pending.push_back(new Star(_pos, _vel - Vector(0.0f, 105.0f, 0.0f),
- 0.0f, 4.5f, RGBColor(1.0f, 0.0f, 0.0f), 400.0f));
-
- RGBColor RGB(Particle::randomColor());
-
- for (unsigned int i = 0; i < 75; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- velocity *= 600.0f + Common::randomFloat(50.0f);
- velocity += _vel;
-
- Hack::pending.push_back(new Star(_pos, velocity, 0.612f,
- Common::randomFloat(2.0f) + 2.0f, RGB, 30.0f));
- }
-
- RGB = Particle::randomColor();
-
- for (unsigned int i = 0; i < 50; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- 0.0f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- velocity.x() *= 1000.0f + Common::randomFloat(100.0f);
- velocity.y() += Common::randomFloat(100.0f) - 50.0f;
- velocity.z() *= 1000.0f + Common::randomFloat(100.0f);
- velocity += _vel;
-
- Hack::pending.push_back(new Star(_pos, velocity, 0.612f,
- Common::randomFloat(6.0f) + 3.0f, RGB, 100.0f));
- }
-
- if (Hack::volume > 0.0f)
- Resources::Sounds::nuke->play(_pos);
-}
-
-void BigMama::update() {
- _remaining -= Common::elapsedTime;
-
- if (_remaining <= 0.0f || _pos.y() <= 0.0f) {
- _depth = DEAD_DEPTH;
- ++Hack::numDead;
- return;
- }
-
- _vel.y() -= Common::elapsedTime * 32.0f;
- _pos += _vel * Common::elapsedTime;
- _pos.x() +=
- (0.1f - 0.00175f * _pos.y() + 0.0000011f * _pos.y() * _pos.y()) *
- Hack::wind * Common::elapsedTime;
-
- float life = _remaining / _lifetime;
- _brightness = life * 2.0f - 1.0f;
- if (_brightness < 0.0f)
- _brightness = 0.0f;
- _size += 1500.0f * Common::elapsedTime;
-
- Hack::superFlare(_pos, RGBColor(0.6f, 0.6f, 1.0f), _brightness);
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void BigMama::updateCameraOnly() {
- Hack::superFlare(_pos, RGBColor(0.6f, 0.6f, 1.0f), _brightness);
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void BigMama::draw() const {
- if (_depth < 0.0f)
- return;
-
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(_size, _size, _size);
- glMultMatrixf(Hack::cameraMat.get());
- glColor4f(0.6f, 0.6f, 1.0f, _brightness);
- glCallList(Resources::DisplayLists::flares + 2);
- glPopMatrix();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/bigmama.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/bigmama.hh
deleted file mode 100644
index b29f7d632c..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/bigmama.hh
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _BIGMAMA_HH
-#define _BIGMAMA_HH
-
-#include <common.hh>
-
-#include <particle.hh>
-#include <vector.hh>
-
-class BigMama : public Particle {
-private:
- float _size;
- float _brightness;
-public:
- BigMama(const Vector&, const Vector&);
-
- void update();
- void updateCameraOnly();
- void draw() const;
-};
-
-#endif // _BIGMAMA_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/bomb.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/bomb.cc
deleted file mode 100644
index 1c7f2e7920..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/bomb.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <bomb.hh>
-#include <color.hh>
-#include <explosion.hh>
-#include <skyrocket.hh>
-#include <star.hh>
-#include <vector.hh>
-
-void Bomb::update() {
- _remaining -= Common::elapsedTime;
-
- bool alive = _remaining > 0.0f && _pos.y() >= 0.0f;
- if (!alive) {
- switch (_bombType) {
- case BOMB_STARS:
- Hack::pending.push_back(new Explosion(_pos, _vel,
- Explosion::EXPLODE_STARS_FROM_BOMB, _RGB));
- break;
- case BOMB_STREAMERS:
- Hack::pending.push_back(new Explosion(_pos, _vel,
- Explosion::EXPLODE_STREAMERS_FROM_BOMB, _RGB));
- break;
- case BOMB_METEORS:
- Hack::pending.push_back(new Explosion(_pos, _vel,
- Explosion::EXPLODE_METEORS_FROM_BOMB, _RGB));
- break;
- case BOMB_CRACKER:
- Hack::pending.push_back(new Star(_pos, _vel, 0.4f, 0.2f,
- RGBColor(1.0f, 0.8f, 0.6f), Common::randomFloat(3.0f) + 7.0f));
- break;
- }
- _depth = DEAD_DEPTH;
- ++Hack::numDead;
- return;
- }
-
- _vel.y() -= Common::elapsedTime * 32.0f;
- _pos += _vel * Common::elapsedTime;
- _pos.x() +=
- (0.1f - 0.00175f * _pos.y() + 0.0000011f * _pos.y() * _pos.y()) *
- Hack::wind * Common::elapsedTime;
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Bomb::updateCameraOnly() {
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Bomb::draw() const {
- // Invisible!
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/bomb.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/bomb.hh
deleted file mode 100644
index 115556f4e6..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/bomb.hh
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _BOMB_HH
-#define _BOMB_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <particle.hh>
-#include <vector.hh>
-
-class Bomb : public Particle {
-public:
- enum Type {
- BOMB_STARS,
- BOMB_STREAMERS,
- BOMB_METEORS,
- BOMB_CRACKER
- };
-private:
- RGBColor _RGB;
-
- Type _bombType;
-public:
- Bomb(const Vector& pos, const Vector& vel, Type bombType,
- const RGBColor& RGB = RGBColor()) :
- Particle(pos, vel, 0.4f,
- (bombType == BOMB_CRACKER) ?
- 4.0f * (0.5f - std::sin(Common::randomFloat(M_PI))) + 4.5f :
- Common::randomFloat(1.5f) + 3.0f
- ), _RGB(RGB), _bombType(bombType) {}
-
- void update();
- void updateCameraOnly();
- void draw() const;
-};
-
-#endif // _BOMB_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/boom1.ogg b/xbmc/screensavers/rsxs-0.9/src/skyrocket/boom1.ogg
deleted file mode 100644
index ef666ecca1..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/boom1.ogg
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/boom2.ogg b/xbmc/screensavers/rsxs-0.9/src/skyrocket/boom2.ogg
deleted file mode 100644
index 7d86f48b41..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/boom2.ogg
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/boom3.ogg b/xbmc/screensavers/rsxs-0.9/src/skyrocket/boom3.ogg
deleted file mode 100644
index c8fd52eed8..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/boom3.ogg
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/boom4.ogg b/xbmc/screensavers/rsxs-0.9/src/skyrocket/boom4.ogg
deleted file mode 100644
index 9ddbbe82fb..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/boom4.ogg
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/cloud.png b/xbmc/screensavers/rsxs-0.9/src/skyrocket/cloud.png
deleted file mode 100644
index a535a2bb2b..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/cloud.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/earth-far.png b/xbmc/screensavers/rsxs-0.9/src/skyrocket/earth-far.png
deleted file mode 100644
index 5f66e2fe89..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/earth-far.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/earth-light.png b/xbmc/screensavers/rsxs-0.9/src/skyrocket/earth-light.png
deleted file mode 100644
index 6d33ea6573..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/earth-light.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/earth-near.png b/xbmc/screensavers/rsxs-0.9/src/skyrocket/earth-near.png
deleted file mode 100644
index bdf5fafb3a..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/earth-near.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/explosion.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/explosion.cc
deleted file mode 100644
index 2667a6a63e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/explosion.cc
+++ /dev/null
@@ -1,608 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <bee.hh>
-#include <bomb.hh>
-#include <color.hh>
-#include <explosion.hh>
-#include <meteor.hh>
-#include <resources.hh>
-#include <skyrocket.hh>
-#include <star.hh>
-#include <streamer.hh>
-#include <vector.hh>
-
-void Explosion::popSphere(
- unsigned int n, float speed, const RGBColor& RGB
-) const {
- for (unsigned int i = 0; i < n; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- velocity *= speed + Common::randomFloat(50.0f);
- velocity += _vel;
-
- Hack::pending.push_back(new Star(_pos, velocity, 0.612f,
- Common::randomFloat(1.0f) + 2.0f, RGB, 30.0f,
- Common::randomInt(100) < int(Hack::explosionSmoke)));
- }
-}
-
-void Explosion::popSplitSphere(
- unsigned int n, float speed, const RGBColor& RGB1, const RGBColor& RGB2
-) const {
- Vector planeNormal(
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f
- );
- planeNormal.normalize();
-
- for (unsigned int i = 0; i < n; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- velocity *= speed + Common::randomFloat(50.0f);
- velocity += _vel;
-
- Hack::pending.push_back(new Star(_pos, velocity, 0.612f,
- Common::randomFloat(1.0f) + 2.0f,
- Vector::dot(planeNormal, velocity) > 0.0f ? RGB1 : RGB2, 30.0f,
- Common::randomInt(100) < int(Hack::explosionSmoke)));
- }
-}
-
-void Explosion::popMultiColorSphere(
- unsigned int n, float speed, const RGBColor RGB[3]
-) const {
- for (unsigned int i = 0; i < n; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- velocity *= speed + Common::randomFloat(50.0f);
- velocity += _vel;
-
- Hack::pending.push_back(new Star(_pos, velocity, 0.612f,
- Common::randomFloat(1.0f) + 2.0f, RGB[i % 3], 30.0f,
- Common::randomInt(100) < int(Hack::explosionSmoke)));
- }
-}
-
-void Explosion::popRing(
- unsigned int n, float speed, const RGBColor& RGB
-) const {
- float heading = Common::randomFloat(M_PI);
- float pitch = Common::randomFloat(M_PI);
- float ch = std::cos(heading);
- float sh = std::sin(heading);
- float cp = std::cos(pitch);
- float sp = std::sin(pitch);
-
- for (unsigned int i = 0; i < n; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- float r0 = velocity.x();
- float r1 = velocity.z();
- velocity.y() = sp * r1;
- velocity.z() = cp * r1;
- velocity.x() = ch * r0 + sh * sp * r1;
- velocity.y() = -sh * r0 + ch * sp * r1;
-
- velocity *= speed;
- velocity += Vector(
- Common::randomFloat(50.0f),
- Common::randomFloat(50.0f),
- Common::randomFloat(50.0f)
- ) + _vel;
-
- Hack::pending.push_back(new Star(_pos, velocity, 0.612f,
- Common::randomFloat(1.0f) + 2.0f, RGB, 30.0f,
- Common::randomInt(100) < int(Hack::explosionSmoke)));
- }
-}
-
-void Explosion::popStreamers(
- unsigned int n, float speed, const RGBColor& RGB
-) const {
- for (unsigned int i = 0; i < n; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- velocity *= speed + Common::randomFloat(50.0f);
- velocity += _vel;
-
- Hack::pending.push_back(new Streamer(_pos, velocity, 0.612f,
- Common::randomFloat(1.0f) + 3.0f, RGB, 30.0f));
- }
-}
-
-void Explosion::popMeteors(
- unsigned int n, float speed, const RGBColor& RGB
-) const {
- for (unsigned int i = 0; i < n; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- velocity *= speed + Common::randomFloat(50.0f);
- velocity += _vel;
-
- Hack::pending.push_back(new Meteor(_pos, velocity, 0.612f,
- Common::randomFloat(1.0f) + 3.0f, RGB, 20.0f));
- }
-}
-
-void Explosion::popStarBombs(
- unsigned int n, float speed, const RGBColor& RGB
-) const {
- for (unsigned int i = 0; i < n; ++i) {
- Vector velocity(
- Common::randomFloat(speed * 2) - speed,
- Common::randomFloat(speed * 2) - speed,
- Common::randomFloat(speed * 2) - speed
- );
- velocity += _vel;
-
- Hack::pending.push_back(new Bomb(_pos, velocity, Bomb::BOMB_STARS,
- RGB));
- }
-}
-
-void Explosion::popStreamerBombs(
- unsigned int n, float speed, const RGBColor& RGB
-) const {
- for (unsigned int i = 0; i < n; ++i) {
- Vector velocity(
- Common::randomFloat(speed * 2) - speed,
- Common::randomFloat(speed * 2) - speed,
- Common::randomFloat(speed * 2) - speed
- );
- velocity += _vel;
-
- Hack::pending.push_back(new Bomb(_pos, velocity, Bomb::BOMB_STREAMERS,
- RGB));
- }
-}
-
-void Explosion::popMeteorBombs(
- unsigned int n, float speed, const RGBColor& RGB
-) const {
- for (unsigned int i = 0; i < n; ++i) {
- Vector velocity(
- Common::randomFloat(speed * 2) - speed,
- Common::randomFloat(speed * 2) - speed,
- Common::randomFloat(speed * 2) - speed
- );
- velocity += _vel;
-
- Hack::pending.push_back(new Bomb(_pos, velocity, Bomb::BOMB_METEORS,
- RGB));
- }
-}
-
-void Explosion::popCrackerBombs(unsigned int n, float speed) const {
- for (unsigned int i = 0; i < n; ++i) {
- Vector velocity(
- Common::randomFloat(speed * 2) - speed,
- Common::randomFloat(speed * 2) - speed,
- Common::randomFloat(speed * 2) - speed
- );
- velocity += _vel;
-
- Hack::pending.push_back(new Bomb(_pos, velocity, Bomb::BOMB_CRACKER));
- }
-}
-
-void Explosion::popBees(
- unsigned int n, float speed, const RGBColor& RGB
-) const {
- for (unsigned int i = 0; i < n; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity *= speed;
- velocity += _vel;
-
- Hack::pending.push_back(new Bee(_pos, velocity, RGB));
- }
-}
-
-Explosion::Explosion(
- const Vector& pos, const Vector& vel, Type explosionType,
- const RGBColor& RGB, float lifetime
-) : Particle(pos, vel, 0.612f, lifetime), _RGB(RGB), _size(100.0f) {
- switch (explosionType) {
- case EXPLODE_SPHERE:
- _RGB = Particle::randomColor();
- if (!Common::randomInt(10))
- popSphere(225, 1000.0f, _RGB);
- else
- popSphere(175, Common::randomFloat(100.0f) + 400.0f, _RGB);
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_SPLIT_SPHERE:
- {
- RGBColor RGB1 = Particle::randomColor();
- RGBColor RGB2 = Particle::randomColor();
- _RGB = (RGB1 + RGB2) / 2;
- if (!Common::randomInt(10))
- popSplitSphere(225, 1000.0f, RGB1, RGB2);
- else
- popSplitSphere(175, Common::randomFloat(100.0f) + 400.0f, RGB1, RGB2);
- }
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_MULTICOLORED_SPHERE:
- {
- RGBColor RGB[] = {
- Particle::randomColor(),
- Particle::randomColor(),
- Particle::randomColor()
- };
- _RGB = (RGB[0] + RGB[1] + RGB[2]) / 3;
- if (!Common::randomInt(10))
- popMultiColorSphere(225, 1000.0f, RGB);
- else
- popMultiColorSphere(175, Common::randomFloat(100.0f) + 400.0f, RGB);
- }
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_RING:
- _RGB = Particle::randomColor();
- popRing(70, Common::randomFloat(100.0f) + 400.0f, _RGB);
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_DOUBLE_SPHERE:
- {
- RGBColor RGB1 = Particle::randomColor();
- RGBColor RGB2 = Particle::randomColor();
- _RGB = (RGB1 + RGB2) / 2;
- popSphere(90, Common::randomFloat(50.0f) + 200.0f, RGB1);
- popSphere(150, Common::randomFloat(100.0f) + 500.0f, RGB2);
- }
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_SPHERE_INSIDE_RING:
- {
- RGBColor RGB1 = Particle::randomColor();
- RGBColor RGB2 = Particle::randomColor();
- _RGB = (RGB1 + RGB2) / 2;
- popSphere(150, Common::randomFloat(50.0f) + 200.0f, RGB1);
- popRing(70, Common::randomFloat(100.0f) + 500.0f, RGB2);
- }
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_STREAMERS:
- _RGB = Particle::randomColor();
- popStreamers(40, Common::randomFloat(100.0f) + 400.0f, _RGB);
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_METEORS:
- _RGB = Particle::randomColor();
- popMeteors(40, Common::randomFloat(100.0f) + 400.0f, _RGB);
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_STARS_INSIDE_STREAMERS:
- {
- RGBColor RGB1 = Particle::randomColor();
- RGBColor RGB2 = Particle::randomColor();
- _RGB = (RGB1 + RGB2) / 2;
- popSphere(90, Common::randomFloat(50.0f) + 200.0f, RGB1);
- popStreamers(25, Common::randomFloat(100.0f) + 500.0f, RGB2);
- }
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_STARS_INSIDE_METEORS:
- {
- RGBColor RGB1 = Particle::randomColor();
- RGBColor RGB2 = Particle::randomColor();
- _RGB = (RGB1 + RGB2) / 2;
- popSphere(90, Common::randomFloat(50.0f) + 200.0f, RGB1);
- popMeteors(25, Common::randomFloat(100.0f) + 500.0f, RGB2);
- }
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_STREAMERS_INSIDE_STARS:
- {
- RGBColor RGB1 = Particle::randomColor();
- RGBColor RGB2 = Particle::randomColor();
- _RGB = (RGB1 + RGB2) / 2;
- popStreamers(20, Common::randomFloat(100.0f) + 450.0f, RGB1);
- popSphere(150, Common::randomFloat(50.0f) + 500.0f, RGB2);
- }
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_METEORS_INSIDE_STARS:
- {
- RGBColor RGB1 = Particle::randomColor();
- RGBColor RGB2 = Particle::randomColor();
- _RGB = (RGB1 + RGB2) / 2;
- popMeteors(20, Common::randomFloat(100.0f) + 450.0f, RGB1);
- popSphere(150, Common::randomFloat(50.0f) + 500.0f, RGB2);
- }
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_STAR_BOMBS:
- _RGB = Particle::randomColor();
- popStarBombs(8, Common::randomFloat(100.0f) + 300.0f, _RGB);
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_STREAMER_BOMBS:
- _RGB = Particle::randomColor();
- popStreamerBombs(8, Common::randomFloat(100.0f) + 300.0f, _RGB);
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_METEOR_BOMBS:
- _RGB = Particle::randomColor();
- popMeteorBombs(8, Common::randomFloat(100.0f) + 300.0f, _RGB);
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_CRACKER_BOMBS:
- _RGB = Particle::randomColor();
- popCrackerBombs(250, Common::randomFloat(50.0f) + 150.0f);
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- Resources::Sounds::popper->play(_pos);
- }
- break;
- case EXPLODE_BEES:
- _RGB = Particle::randomColor();
- popBees(30, 10.0f, _RGB);
- if (Hack::volume > 0.0f && Common::randomInt(2))
- Resources::Sounds::whistle->play(_pos);
- break;
- case EXPLODE_FLASH:
- _RGB.set(1.0f, 1.0f, 1.0f);
- _size = 150.0f;
- if (Hack::volume > 0.0f) {
- Resources::Sounds::boom4->play(_pos);
- if (Common::randomInt(2))
- Resources::Sounds::whistle->play(_pos);
- }
- break;
- case EXPLODE_SUCKER:
- case EXPLODE_BIGMAMA:
- _size = 200.0f;
- break;
- case EXPLODE_SHOCKWAVE:
- _size = 300.0f;
- break;
- case EXPLODE_STRETCHER:
- _size = 400.0f;
- break;
- case EXPLODE_STARS_FROM_BOMB:
- _RGB = Particle::randomColor();
- popSphere(30, 100.0f, _RGB);
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_STREAMERS_FROM_BOMB:
- _RGB = Particle::randomColor();
- popStreamers(10, 100.0f, _RGB);
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- case EXPLODE_METEORS_FROM_BOMB:
- _RGB = Particle::randomColor();
- popMeteors(10, 100.0f, _RGB);
- if (Hack::volume > 0.0f) {
- switch (Common::randomInt(4)) {
- case 0: Resources::Sounds::boom1->play(_pos); break;
- case 1: Resources::Sounds::boom2->play(_pos); break;
- case 2: Resources::Sounds::boom3->play(_pos); break;
- case 3: Resources::Sounds::boom4->play(_pos); break;
- }
- }
- break;
- default:
- WARN("Unknown explosion type: " << explosionType);
- break;
- }
-}
-
-void Explosion::update() {
- _remaining -= Common::elapsedTime;
-
- if (_remaining <= 0.0f || _pos.y() <= 0.0f) {
- _depth = DEAD_DEPTH;
- ++Hack::numDead;
- return;
- }
-
- float life = _remaining / _lifetime;
- _brightness = life * life;
-
- Hack::illuminate(_pos, _RGB, _brightness, 640000.0f, 2560000.0f);
- Hack::flare(_pos, _RGB, _brightness);
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Explosion::updateCameraOnly() {
- Hack::flare(_pos, _RGB, _brightness);
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Explosion::draw() const {
- if (_depth < 0.0f)
- return;
-
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(_size, _size, _size);
- glScalef(_brightness, _brightness, _brightness);
- glMultMatrixf(Hack::cameraMat.get());
- glColor4f(_RGB.r(), _RGB.g(), _RGB.b(), _brightness);
- glCallList(Resources::DisplayLists::flares);
- glPopMatrix();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/explosion.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/explosion.hh
deleted file mode 100644
index 5d12433280..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/explosion.hh
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _EXPLOSION_HH
-#define _EXPLOSION_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <particle.hh>
-#include <vector.hh>
-
-class Explosion : public Particle {
-public:
- enum Type {
- EXPLODE_NONE = -1,
- EXPLODE_SPHERE,
- EXPLODE_SPLIT_SPHERE,
- EXPLODE_MULTICOLORED_SPHERE,
- EXPLODE_RING,
- EXPLODE_DOUBLE_SPHERE,
- EXPLODE_SPHERE_INSIDE_RING,
- EXPLODE_STREAMERS,
- EXPLODE_METEORS,
- EXPLODE_STARS_INSIDE_STREAMERS,
- EXPLODE_STARS_INSIDE_METEORS,
- EXPLODE_STREAMERS_INSIDE_STARS,
- EXPLODE_METEORS_INSIDE_STARS,
- EXPLODE_STAR_BOMBS,
- EXPLODE_STREAMER_BOMBS,
- EXPLODE_METEOR_BOMBS,
- EXPLODE_CRACKER_BOMBS,
- EXPLODE_BEES,
- EXPLODE_FLASH,
- EXPLODE_SPINNER,
- EXPLODE_SUCKER,
- EXPLODE_SHOCKWAVE,
- EXPLODE_STRETCHER,
- EXPLODE_BIGMAMA,
- EXPLODE_STARS_FROM_BOMB,
- EXPLODE_STREAMERS_FROM_BOMB,
- EXPLODE_METEORS_FROM_BOMB
- };
-private:
- RGBColor _RGB;
- float _size;
- float _brightness;
-
- void popSphere(unsigned int, float, const RGBColor&) const;
- void popSplitSphere(unsigned int, float, const RGBColor&, const RGBColor&) const;
- void popMultiColorSphere(unsigned int, float, const RGBColor[3]) const;
- void popRing(unsigned int, float, const RGBColor&) const;
- void popStreamers(unsigned int, float, const RGBColor&) const;
- void popMeteors(unsigned int, float, const RGBColor&) const;
- void popStarBombs(unsigned int, float, const RGBColor&) const;
- void popStreamerBombs(unsigned int, float, const RGBColor&) const;
- void popMeteorBombs(unsigned int, float, const RGBColor&) const;
- void popCrackerBombs(unsigned int, float) const;
- void popBees(unsigned int, float, const RGBColor&) const;
-public:
- Explosion(
- const Vector&, const Vector&, Type,
- const RGBColor& = RGBColor(), float lifetime = 0.5f
- );
-
- void update();
- void updateCameraOnly();
- void draw() const;
-};
-
-#endif // _EXPLOSION_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/flares.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/flares.cc
deleted file mode 100644
index d86e51ab1d..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/flares.cc
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <flares.hh>
-#include <resources.hh>
-
-// Draw a flare at a specified (x,y) location on the screen
-// Screen corners are at (0,0) and (1,1)
-void Flares::draw(float x, float y, const RGBColor& RGB, float alpha) {
- // Fade alpha if source is off edge of screen
- float fadeWidth = float(Common::width) / 10.0f;
- if (y < 0.0f) {
- float temp = fadeWidth + y;
- if (temp < 0.0f)
- return;
- alpha *= temp / fadeWidth;
- }
- if (y > Common::height) {
- float temp = fadeWidth - y + Common::height;
- if (temp < 0.0f)
- return;
- alpha *= temp / fadeWidth;
- }
- if (x < 0) {
- float temp = fadeWidth + x;
- if (temp < 0.0f)
- return;
- alpha *= temp / fadeWidth;
- }
- if (x > Common::width) {
- float temp = fadeWidth - x + Common::width;
- if (temp < 0.0f)
- return;
- alpha *= temp / fadeWidth;
- }
-
- // Find lens flare vector
- // This vector runs from the light source through the screen's center
- float dx = 0.5f * Common::aspectRatio - x;
- float dy = 0.5f - y;
-
- glPushAttrib(GL_COLOR_BUFFER_BIT);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
-
- // Setup projection matrix
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- gluOrtho2D(0, Common::aspectRatio, 0, 1.0f);
-
- // Draw stuff
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
-
- glLoadIdentity();
- glTranslatef(x + dx * 0.05f, y + dy * 0.05f, 0.0f);
- glScalef(0.065f, 0.065f, 0.065f);
- glColor4f(RGB.r(), RGB.g(), RGB.b(), alpha * 0.4f);
- glCallList(Resources::DisplayLists::flares + 2);
-
- glLoadIdentity();
- glTranslatef(x + dx * 0.15f, y + dy * 0.15f, 0.0f);
- glScalef(0.04f, 0.04f, 0.04f);
- glColor4f(RGB.r() * 0.9f, RGB.g() * 0.9f, RGB.b(), alpha * 0.9f);
- glCallList(Resources::DisplayLists::flares + 1);
-
- glLoadIdentity();
- glTranslatef(x + dx * 0.25f, y + dy * 0.25f, 0.0f);
- glScalef(0.06f, 0.06f, 0.06f);
- glColor4f(RGB.r() * 0.8f, RGB.g() * 0.8f, RGB.b(), alpha * 0.9f);
- glCallList(Resources::DisplayLists::flares + 1);
-
- glLoadIdentity();
- glTranslatef(x + dx * 0.35f, y + dy * 0.35f, 0.0f);
- glScalef(0.08f, 0.08f, 0.08f);
- glColor4f(RGB.r() * 0.7f, RGB.g() * 0.7f, RGB.b(), alpha * 0.9f);
- glCallList(Resources::DisplayLists::flares + 1);
-
- glLoadIdentity();
- glTranslatef(x + dx * 1.25f, y + dy * 1.25f, 0.0f);
- glScalef(0.05f, 0.05f, 0.05f);
- glColor4f(RGB.r(), RGB.g() * 0.6f, RGB.b() * 0.6f, alpha * 0.9f);
- glCallList(Resources::DisplayLists::flares + 1);
-
- glLoadIdentity();
- glTranslatef(x + dx * 1.65f, y + dy * 1.65f, 0.0f);
- glRotatef(x, 0, 0, 1);
- glScalef(0.3f, 0.3f, 0.3f);
- glColor4f(RGB.r(), RGB.g(), RGB.b(), alpha);
- glCallList(Resources::DisplayLists::flares + 3);
-
- glLoadIdentity();
- glTranslatef(x + dx * 1.85f, y + dy * 1.85f, 0.0f);
- glScalef(0.04f, 0.04f, 0.04f);
- glColor4f(RGB.r(), RGB.g() * 0.6f, RGB.b() * 0.6f, alpha * 0.9f);
- glCallList(Resources::DisplayLists::flares + 1);
-
- glLoadIdentity();
- glTranslatef(x + dx * 2.2f, y + dy * 2.2f, 0.0f);
- glScalef(0.3f, 0.3f, 0.3f);
- glColor4f(RGB.r(), RGB.g(), RGB.b(), alpha * 0.7f);
- glCallList(Resources::DisplayLists::flares + 1);
-
- glLoadIdentity();
- glTranslatef(x + dx * 2.5f, y + dy * 2.5f, 0.0f);
- glScalef(0.6f, 0.6f, 0.6f);
- glColor4f(RGB.r(), RGB.g(), RGB.b(), alpha * 0.8f);
- glCallList(Resources::DisplayLists::flares + 3);
-
- glPopMatrix();
-
- // Unsetup projection matrix
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopAttrib();
-}
-
-// super bright elongated glow for sucker, shockwave, stretcher, and bigmama
-void Flares::drawSuper(float x, float y, const RGBColor& RGB, float alpha) {
- // Fade alpha if source is off edge of screen
- float fadeWidth = float(Common::width) / 10.0f;
- if (y < 0.0f) {
- float temp = fadeWidth + y;
- if (temp < 0.0f)
- return;
- alpha *= temp / fadeWidth;
- }
- if (y > Common::height) {
- float temp = fadeWidth - y + Common::height;
- if (temp < 0.0f)
- return;
- alpha *= temp / fadeWidth;
- }
- if (x < 0) {
- float temp = fadeWidth + x;
- if (temp < 0.0f)
- return;
- alpha *= temp / fadeWidth;
- }
- if (x > Common::width) {
- float temp = fadeWidth - x + Common::width;
- if (temp < 0.0f)
- return;
- alpha *= temp / fadeWidth;
- }
-
- glPushAttrib(GL_COLOR_BUFFER_BIT);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
-
- // Setup projection matrix
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- gluOrtho2D(0, Common::aspectRatio, 0, 1.0f);
-
- // Draw stuff
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
-
- glLoadIdentity();
- glTranslatef(x, y, 0.0f);
- glScalef(2.0f * alpha, 0.08f, 0.0f);
- glColor4f(RGB.r(), RGB.g(), RGB.b(), alpha);
- glCallList(Resources::DisplayLists::flares + 0);
-
- glLoadIdentity();
- glTranslatef(x, y, 0.0f);
- glScalef(0.4f, 0.35f * alpha + 0.05f, 1.0f);
- glColor4f(RGB.r(), RGB.g(), RGB.b(), alpha * 0.4f);
- glCallList(Resources::DisplayLists::flares + 2);
-
- glPopMatrix();
-
- // Unsetup projection matrix
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopAttrib();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/flares.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/flares.hh
deleted file mode 100644
index 9745f95198..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/flares.hh
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _FLARES_HH
-#define _FLARES_HH
-
-#include <common.hh>
-
-#include <color.hh>
-
-namespace Flares {
- void draw(float, float, const RGBColor&, float);
- void drawSuper(float, float, const RGBColor&, float);
-};
-
-#endif // _FLARES_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/fountain.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/fountain.cc
deleted file mode 100644
index 1b5d3efff7..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/fountain.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <fountain.hh>
-#include <resources.hh>
-#include <skyrocket.hh>
-#include <star.hh>
-#include <vector.hh>
-
-void Fountain::update() {
- _remaining -= Common::elapsedTime;
-
- if (_remaining <= 0.0f) {
- _depth = DEAD_DEPTH;
- ++Hack::numDead;
- return;
- }
-
- float life = _remaining / _lifetime;
- _brightness = life * life;
- float temp = _lifetime - _remaining;
- if (temp < 0.5f)
- _brightness *= temp * 2.0f;
-
- _starTimer += Common::elapsedTime * _brightness *
- (Common::randomFloat(10.0f) + 10.0f);
- unsigned int stars = (unsigned int)_starTimer;
- _starTimer -= float(stars);
- for (unsigned int i = 0; i < stars; i++) {
- Vector starPos(
- 0.0f, Common::randomFloat(Common::elapsedTime * 100.0f), 0.0f
- );
- starPos += _pos;
- if (starPos.y() > 50.0f) starPos.y() = 50.0f;
- Hack::pending.push_back(new Star(starPos, Vector(
- Common::randomFloat(20.0f) - 10.0f,
- Common::randomFloat(30.0f) + 100.0f,
- Common::randomFloat(20.0f) - 10.0f
- ), 0.342f, Common::randomFloat(1.0f) + 2.0f, _RGB, 10.0f));
- }
-
- Hack::illuminate(_pos, _RGB, _brightness, 40000.0f, 0.0f);
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Fountain::updateCameraOnly() {
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Fountain::draw() const {
- if (_depth < 0.0f)
- return;
-
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(30.0f, 30.0f, 30.0f);
- glMultMatrixf(Hack::cameraMat.get());
- glColor4f(_RGB.r(), _RGB.g(), _RGB.b(), _brightness);
- glCallList(Resources::DisplayLists::flares);
- glPopMatrix();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/fountain.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/fountain.hh
deleted file mode 100644
index 886ed61bdc..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/fountain.hh
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _FOUNTAIN_HH
-#define _FOUNTAIN_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <particle.hh>
-#include <resources.hh>
-#include <skyrocket.hh>
-#include <vector.hh>
-
-class Fountain : public Particle {
-private:
- RGBColor _RGB;
- float _brightness;
-
- float _starTimer;
-public:
- Fountain() : Particle(
- Vector(
- Common::randomFloat(300.0f) - 150.0f,
- 5.0f,
- Common::randomFloat(300.0f) - 150.0f
- ), Vector(), 0.0f, Common::randomFloat(5.0f) + 10.0f
- ), _RGB(Particle::randomColor()), _brightness(0.0f), _starTimer(0.0f) {
- if (Hack::volume > 0.0f) {
- if (Common::randomInt(2))
- Resources::Sounds::launch1->play(_pos);
- else
- Resources::Sounds::launch2->play(_pos);
- }
- }
-
- void update();
- void updateCameraOnly();
- void draw() const;
-};
-
-#endif // _FOUNTAIN_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/launch1.ogg b/xbmc/screensavers/rsxs-0.9/src/skyrocket/launch1.ogg
deleted file mode 100644
index 75948eac91..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/launch1.ogg
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/launch2.ogg b/xbmc/screensavers/rsxs-0.9/src/skyrocket/launch2.ogg
deleted file mode 100644
index e5c6ccd2db..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/launch2.ogg
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/meteor.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/meteor.cc
deleted file mode 100644
index a2470faefc..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/meteor.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <meteor.hh>
-#include <resources.hh>
-#include <skyrocket.hh>
-#include <star.hh>
-#include <vector.hh>
-
-void Meteor::update() {
- _remaining -= Common::elapsedTime;
-
- if (_remaining <= 0.0f || _pos.y() <= 0.0f) {
- _depth = DEAD_DEPTH;
- ++Hack::numDead;
- return;
- }
-
- _vel.y() -= Common::elapsedTime * 32.0f;
- _pos += _vel * Common::elapsedTime;
- _pos.x() +=
- (0.1f - 0.00175f * _pos.y() + 0.0000011f * _pos.y() * _pos.y()) *
- Hack::wind * Common::elapsedTime;
-
- float temp = (_lifetime - _remaining) / _lifetime;
- _brightness = 1.0f - temp * temp * temp * temp;
-
- Vector step(_pos - _sparkPos);
- float distance = step.normalize();
-
- if (distance > 10.0f) {
- unsigned int n = (unsigned int)(distance / 10.0f);
- step *= 10.0f;
- for (unsigned int i = 0; i < n; ++i) {
- Hack::pending.push_back(new Star(_sparkPos,
- _vel + Vector(
- Common::randomFloat(40.0f) - 20.0f,
- Common::randomFloat(40.0f) - 20.0f,
- Common::randomFloat(40.0f) - 20.0f
- ), 2.0f, Common::randomFloat(0.5f) + 1.5f, _RGB, 10.0f
- ));
- _sparkPos += step;
- }
- }
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Meteor::updateCameraOnly() {
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Meteor::draw() const {
- if (_depth < 0.0f)
- return;
-
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(_size, _size, _size);
- glMultMatrixf(Hack::cameraMat.get());
- glColor4f(_RGB.r(), _RGB.g(), _RGB.b(), _brightness);
- glCallList(Resources::DisplayLists::flares);
- glPopMatrix();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/meteor.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/meteor.hh
deleted file mode 100644
index f7544471a7..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/meteor.hh
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _METEOR_HH
-#define _METEOR_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <particle.hh>
-#include <vector.hh>
-
-class Meteor : public Particle {
-private:
- RGBColor _RGB;
- float _size;
- float _brightness;
-
- Vector _sparkPos;
-public:
- Meteor(
- const Vector& pos, const Vector& vel,
- float drag, float lifetime, const RGBColor& RGB, float size
- ) : Particle(pos, vel, drag, lifetime),
- _RGB(RGB), _size(size), _sparkPos(_pos) {}
-
- void update();
- void updateCameraOnly();
- void draw() const;
-};
-
-#endif // _METEOR_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/moon.png b/xbmc/screensavers/rsxs-0.9/src/skyrocket/moon.png
deleted file mode 100644
index 5d3b753d75..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/moon.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/nuke.ogg b/xbmc/screensavers/rsxs-0.9/src/skyrocket/nuke.ogg
deleted file mode 100644
index ad8fa7e190..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/nuke.ogg
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/overlay.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/overlay.cc
deleted file mode 100644
index e885c8cffe..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/overlay.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <overlay.hh>
-#include <resource.hh>
-
-namespace Overlay {
- unsigned int _lists;
- float _age;
- float _brightness;
-
- typedef std::list<unsigned int> OverlayList;
- OverlayList _overlayList;
-};
-
-void Overlay::init() {
- _lists = Common::resources->genLists(96);
- Font font = XLoadFont(Common::display,
- "-adobe-helvetica-bold-r-*-*-*-180-*-*-*-*-*-*");
- glXUseXFont(font, ' ', 96, _lists);
- XUnloadFont(Common::display, font);
-}
-
-void Overlay::set(const std::string& s) {
- _overlayList.clear();
- for (std::string::const_iterator it = s.begin(); it != s.end(); ++it)
- _overlayList.push_back(_lists + (*it & 0x7f) - ' ');
- _age = 0.0f;
-}
-
-void Overlay::update() {
- if (_overlayList.empty())
- return;
-
- _age += Common::elapsedSecs;
- if (_age < 2.0f)
- _brightness = 1.0f;
- else {
- _brightness = 1.0f - (_age - 2.0f) * 4.0f;
- if (_brightness <= 0.0f)
- _overlayList.clear();
- }
-}
-
-void Overlay::draw() {
- if (_overlayList.empty())
- return;
-
- glPushAttrib(GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glDisable(GL_TEXTURE_2D);
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- gluOrtho2D(0, Common::width, Common::height, 0);
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
- glColor4f(1.0f, 1.0f, 1.0f, _brightness);
- glRasterPos2i(20, Common::height - 20);
- std::for_each(
- _overlayList.begin(), _overlayList.end(),
- std::pointer_to_unary_function<unsigned int, void>(&glCallList)
- );
- glPopMatrix();
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glPopAttrib();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/overlay.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/overlay.hh
deleted file mode 100644
index 10cc018459..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/overlay.hh
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _OVERLAY_HH
-#define _OVERLAY_HH
-
-#include <common.hh>
-
-namespace Overlay {
- void init();
-
- void set(const std::string&);
-
- void update();
- void draw();
-};
-
-#endif // _OVERLAY_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/particle.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/particle.hh
deleted file mode 100644
index 7135c1b1a3..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/particle.hh
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _PARTICLE_HH
-#define _PARTICLE_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <vector.hh>
-
-#define DEAD_DEPTH (-1000000.0f)
-#define PARTICLE_DEAD (1 << 0)
-#define PARTICLE_ROCKET (1 << 1)
-
-class Particle {
-protected:
- Vector _pos;
- Vector _vel;
- float _drag;
-
- float _lifetime;
- float _remaining;
-
- float _depth;
-
- static RGBColor randomColor() {
- switch (Common::randomInt(6)) {
- case 0:
- return RGBColor(
- 1.0f, Common::randomFloat(1.0f), Common::randomFloat(0.2f)
- );
- case 1:
- return RGBColor(
- 1.0f, Common::randomFloat(0.2f), Common::randomFloat(1.0f)
- );
- case 2:
- return RGBColor(
- Common::randomFloat(1.0f), 1.0f, Common::randomFloat(0.2f)
- );
- case 3:
- return RGBColor(
- Common::randomFloat(0.2f), 1.0f, Common::randomFloat(1.0f)
- );
- case 4:
- return RGBColor(
- Common::randomFloat(1.0f), Common::randomFloat(0.2f), 1.0f
- );
- default:
- return RGBColor(
- Common::randomFloat(0.2f), Common::randomFloat(1.0f), 1.0f
- );
- }
- }
-
- Particle(
- const Vector& pos, const Vector& vel, float drag, float lifetime
- ) : _pos(pos), _vel(vel), _drag(drag), _lifetime(lifetime),
- _remaining(lifetime) {}
-public:
- virtual ~Particle() {}
-
- virtual void update() = 0;
- virtual void updateCameraOnly() = 0;
- virtual void draw() const = 0;
-
- bool operator<(const Particle& other) const {
- return _depth > other._depth;
- }
- virtual void illuminate(
- const Vector&, const RGBColor&, float, float
- ) {}
- virtual void suck(const Vector& pos, float factor) {
- if (_remaining <= 0.0f)
- return;
-
- Vector diff(pos - _pos);
- float dSquared = diff.lengthSquared();
- if (dSquared < 250000.0f && dSquared > 0.0f) {
- diff.normalize();
- _vel += diff * (250000.0f - dSquared) * factor;
- }
- }
- virtual void shock(const Vector& pos, float factor) {
- if (_remaining <= 0.0f)
- return;
-
- Vector diff(_pos - pos);
- float dSquared = diff.lengthSquared();
- if (dSquared < 640000.0f && dSquared > 0.0f) {
- diff.normalize();
- _vel += diff * (640000.0f - dSquared) * factor;
- }
- }
- virtual void stretch(const Vector& pos, float factor) {
- if (_remaining <= 0.0f)
- return;
-
- Vector diff(pos - _pos);
- float dSquared = diff.lengthSquared();
- if (dSquared < 640000.0f && dSquared > 0.0f) {
- diff.normalize();
- float temp = (640000.0f - dSquared) * factor;
- _vel.x() += diff.x() * temp * 5.0f;
- _vel.y() -= diff.y() * temp;
- _vel.z() += diff.z() * temp * 5.0f;
- }
- }
-};
-
-#endif // _PARTICLE_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/popper.ogg b/xbmc/screensavers/rsxs-0.9/src/skyrocket/popper.ogg
deleted file mode 100644
index 2754eddf47..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/popper.ogg
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/resources.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/resources.cc
deleted file mode 100644
index 8ce0476824..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/resources.cc
+++ /dev/null
@@ -1,800 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <oggsound.hh>
-#include <pngimage.hh>
-#include <resources.hh>
-#include <skyrocket.hh>
-#include <vector.hh>
-
-#define STARTEXSIZE 512
-#define MOONGLOWTEXSIZE 128
-#define FLARESIZE 128
-#define STARMESH 12
-
-namespace Resources {
- namespace Sounds {
- Sound* boom1;
- Sound* boom2;
- Sound* boom3;
- Sound* boom4;
- Sound* launch1;
- Sound* launch2;
- Sound* nuke;
- Sound* popper;
- Sound* suck;
- Sound* whistle;
-
- void _init();
- };
-
- namespace Textures {
- GLuint cloud;
- GLuint stars;
- GLuint moon;
- GLuint moonGlow;
- GLuint sunset;
- GLuint earthNear;
- GLuint earthFar;
- GLuint earthLight;
- GLuint smoke[5];
- GLuint flare[4];
-
- void makeHeights(unsigned int, unsigned int, unsigned int*);
- void _init();
- };
-
- namespace DisplayLists {
- GLuint flares;
- GLuint rocket;
- GLuint smokes;
- GLuint stars;
- GLuint moon;
- GLuint moonGlow;
- GLuint sunset;
- GLuint earthNear;
- GLuint earthFar;
- GLuint earthLight;
-
- void _init();
- };
-
- void init(float, const Vector&, const Vector&, const UnitQuat&);
-};
-
-void Resources::Sounds::_init() {
- boom1 = new OGG("boom1.ogg", 1000.0f); Common::resources->manage(boom1);
- boom2 = new OGG("boom2.ogg", 1000.0f); Common::resources->manage(boom2);
- boom3 = new OGG("boom3.ogg", 1000.0f); Common::resources->manage(boom3);
- boom4 = new OGG("boom4.ogg", 1200.0f); Common::resources->manage(boom4);
- launch1 = new OGG("launch1.ogg", 10.0f); Common::resources->manage(launch1);
- launch2 = new OGG("launch2.ogg", 10.0f); Common::resources->manage(launch2);
- nuke = new OGG("nuke.ogg", 2000.0f); Common::resources->manage(nuke);
- popper = new OGG("popper.ogg", 700.0f, 2.5f); Common::resources->manage(popper);
- suck = new OGG("suck.ogg", 1500.0f); Common::resources->manage(suck);
- whistle = new OGG("whistle.ogg", 700.0f); Common::resources->manage(whistle);
-}
-
-void Resources::Textures::makeHeights(unsigned int first, unsigned int last,
- unsigned int* h) {
- unsigned int diff = last - first;
- if (diff <= 1) return;
- unsigned int middle = first + (last - first) / 2;
- int newHeight = (int(h[first]) + int(h[last])) / 2 +
- Common::randomInt(diff / 2) - (diff / 4);
- h[middle] = (newHeight < 1) ? 1 : newHeight;
-
- makeHeights(first, middle, h);
- makeHeights(middle, last, h);
-}
-
-void Resources::Textures::_init() {
- // Initialize cloud texture object even if clouds are not turned on.
- // Sunsets and shockwaves can also use cloud texture.
- PNG cloudPNG("cloud.png");
- cloud = Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- cloudPNG
- );
-
- if (Hack::starDensity > 0) {
- stdx::dim3<float, 3, STARTEXSIZE> starMap(STARTEXSIZE);
-
- for (unsigned int i = 0; i < (Hack::starDensity * 20); ++i) {
- unsigned int u = Common::randomInt(STARTEXSIZE - 4) + 2;
- unsigned int v = Common::randomInt(STARTEXSIZE - 4) + 2;
- RGBColor RGB(
- 0.8627f + Common::randomFloat(0.1373f),
- 0.8627f + Common::randomFloat(0.1373f),
- 0.8627f + Common::randomFloat(0.1373f)
- );
- switch (Common::randomInt(3)) {
- case 0: RGB.r() = 1.0f; break;
- case 1: RGB.g() = 1.0f; break;
- case 2: RGB.b() = 1.0f; break;
- }
- switch (Common::randomInt(6)) { // different stars
- case 0: case 1: case 2: // small
- starMap(u, v, 0) = RGB.r() / 2.0f;
- starMap(u, v, 1) = RGB.g() / 2.0f;
- starMap(u, v, 2) = RGB.b() / 2.0f;
- RGB /= 3 + Common::randomInt(6);
- starMap(u + 1, v, 0) = starMap(u - 1, v, 0) =
- starMap(u, v + 1, 0) = starMap(u, v - 1, 0) = RGB.r();
- starMap(u + 1, v, 1) = starMap(u - 1, v, 1) =
- starMap(u, v + 1, 1) = starMap(u, v - 1, 1) = RGB.g();
- starMap(u + 1, v, 2) = starMap(u - 1, v, 2) =
- starMap(u, v + 1, 2) = starMap(u, v - 1, 2) = RGB.b();
- break;
- case 3: case 4: // medium
- starMap(u, v, 0) = RGB.r();
- starMap(u, v, 1) = RGB.g();
- starMap(u, v, 2) = RGB.b();
- RGB /= 2;
- starMap(u + 1, v, 0) = starMap(u - 1, v, 0) =
- starMap(u, v + 1, 0) = starMap(u, v - 1, 0) = RGB.r();
- starMap(u + 1, v, 1) = starMap(u - 1, v, 1) =
- starMap(u, v + 1, 1) = starMap(u, v - 1, 1) = RGB.g();
- starMap(u + 1, v, 2) = starMap(u - 1, v, 2) =
- starMap(u, v + 1, 2) = starMap(u, v - 1, 2) = RGB.b();
- break;
- case 5: // large
- starMap(u, v, 0) = RGB.r();
- starMap(u, v, 1) = RGB.g();
- starMap(u, v, 2) = RGB.b();
- starMap(u + 1, v + 1, 0) = starMap(u - 1, v + 1, 0) =
- starMap(u + 1, v - 1, 0) = starMap(u - 1, v - 1, 0) =
- RGB.r() / 4.0f;
- starMap(u + 1, v + 1, 1) = starMap(u - 1, v + 1, 1) =
- starMap(u + 1, v - 1, 1) = starMap(u - 1, v - 1, 1) =
- RGB.g() / 4.0f;
- starMap(u + 1, v + 1, 2) = starMap(u - 1, v + 1, 2) =
- starMap(u + 1, v - 1, 2) = starMap(u - 1, v - 1, 2) =
- RGB.b() / 4.0f;
- RGB *= 0.75;
- starMap(u + 1, v, 0) = starMap(u - 1, v, 0) =
- starMap(u, v + 1, 0) = starMap(u, v - 1, 0) = RGB.r();
- starMap(u + 1, v, 1) = starMap(u - 1, v, 1) =
- starMap(u, v + 1, 1) = starMap(u, v - 1, 1) = RGB.g();
- starMap(u + 1, v, 2) = starMap(u - 1, v, 2) =
- starMap(u, v + 1, 2) = starMap(u, v - 1, 2) = RGB.b();
- }
- }
- stars = Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- 3, STARTEXSIZE, STARTEXSIZE, GL_RGB, GL_FLOAT, &starMap.front()
- );
- }
-
- if (Hack::drawMoon) {
- moon = Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- PNG("moon.png")
- );
-
- if (Hack::moonGlow > 0.0f) {
- stdx::dim3<float, 4, MOONGLOWTEXSIZE> moonGlowMap(MOONGLOWTEXSIZE);
-
- for (unsigned int i = 0; i < MOONGLOWTEXSIZE; ++i) {
- for (unsigned int j = 0; j < MOONGLOWTEXSIZE; ++j) {
- float u = 2 * float(i) / float(MOONGLOWTEXSIZE) - 1;
- float v = 2 * float(j) / float(MOONGLOWTEXSIZE) - 1;
- float temp1 = Common::clamp(
- 4.0f * ((u * u) + (v * v)) * (1.0f - ((u * u) + (v * v))),
- 0.0f, 1.0f
- );
- temp1 = temp1 * temp1 * temp1 * temp1;
- u *= 1.2f;
- v *= 1.2f;
- float temp2 = Common::clamp(
- 4.0f * ((u * u) + (v * v)) * (1.0f - ((u * u) + (v * v))),
- 0.0f, 1.0f
- );
- temp2 = temp2 * temp2 * temp2 * temp2;
- u *= 1.25f;
- v *= 1.25f;
- float temp3 = Common::clamp(
- 4.0f * ((u * u) + (v * v)) * (1.0f - ((u * u) + (v * v))),
- 0.0f, 1.0f
- );
- temp3 = temp3 * temp3 * temp3 * temp3;
- moonGlowMap(i, j, 0) = temp1 * 0.4f + temp2 * 0.4f + temp3 * 0.48f;
- moonGlowMap(i, j, 1) = temp1 * 0.4f + temp2 * 0.48f + temp3 * 0.38f;
- moonGlowMap(i, j, 2) = temp1 * 0.48f + temp2 * 0.4f + temp3 * 0.38f;
- moonGlowMap(i, j, 3) = temp1 * 0.48f + temp2 * 0.48f + temp3 * 0.48f;
- }
- }
- moonGlow = Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- 4, MOONGLOWTEXSIZE, MOONGLOWTEXSIZE, GL_RGBA, GL_FLOAT,
- &moonGlowMap.front()
- );
- }
- }
-
- if (Hack::drawSunset) {
- RGBColor RGB;
- if (Common::randomInt(3))
- RGB.r() = 0.2353f + Common::randomFloat(0.1647f);
- else
- RGB.r() = Common::randomFloat(0.4f);
- RGB.g() = Common::randomFloat(RGB.r());
- if (RGB.g() < 0.0196f)
- RGB.b() = 0.0392f - Common::randomFloat(RGB.r());
-
- stdx::dim3<float, 3> sunsetMap(cloudPNG.width(), cloudPNG.height());
- for (unsigned int i = 0; i < cloudPNG.width(); ++i) {
- for (unsigned int j = 0; j < cloudPNG.height(); ++j) {
- sunsetMap(i, j, 0) = RGB.r();
- sunsetMap(i, j, 1) = RGB.g();
- sunsetMap(i, j, 2) = RGB.b();
- }
- }
-
- // Maybe clouds in sunset
- if (Common::randomInt(3)) {
- unsigned int xOffset = Common::randomInt(cloudPNG.width());
- unsigned int yOffset = Common::randomInt(cloudPNG.height());
- for (unsigned int i = 0; i < cloudPNG.width(); ++i) {
- for (unsigned int j = 0; j < cloudPNG.height(); ++j) {
- unsigned int x = (i + xOffset) % cloudPNG.width();
- unsigned int y = (j + yOffset) % cloudPNG.height();
- float cloudInfluence = cloudPNG(x, y).g();
- sunsetMap(i, j, 0) *= cloudInfluence;
- cloudInfluence *= cloudPNG(x, y).r();
- sunsetMap(i, j, 1) *= cloudInfluence;
- }
- }
- }
-
- std::vector<unsigned int> mountains(cloudPNG.width() + 1);
- mountains[0] = mountains[cloudPNG.width()] = Common::randomInt(10) + 5;
- makeHeights(0, cloudPNG.width(), &mountains.front());
- for (unsigned int i = 0; i < cloudPNG.width(); ++i) {
- for (unsigned int j = 0; j <= mountains[i]; ++j)
- sunsetMap(i, j, 0) = sunsetMap(i, j, 1) = sunsetMap(i, j, 2) = 0.0f;
- sunsetMap(i, mountains[i] + 1, 0) /= 4.0f;
- sunsetMap(i, mountains[i] + 1, 1) /= 4.0f;
- sunsetMap(i, mountains[i] + 1, 2) /= 4.0f;
- sunsetMap(i, mountains[i] + 2, 0) /= 2.0f;
- sunsetMap(i, mountains[i] + 2, 1) /= 2.0f;
- sunsetMap(i, mountains[i] + 2, 2) /= 2.0f;
- sunsetMap(i, mountains[i] + 3, 0) *= 0.75f;
- sunsetMap(i, mountains[i] + 3, 1) *= 0.75f;
- sunsetMap(i, mountains[i] + 3, 2) *= 0.75f;
- }
-
- sunset = Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_CLAMP, GL_CLAMP,
- 3, cloudPNG.width(), cloudPNG.height(), GL_RGB, GL_FLOAT,
- &sunsetMap.front()
- );
- }
-
- if (Hack::drawEarth) {
- earthNear = Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_CLAMP, GL_CLAMP,
- PNG("earth-near.png")
- );
- earthFar = Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_CLAMP, GL_CLAMP,
- PNG("earth-far.png")
- );
- earthLight = Common::resources->genTexture(
- GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_CLAMP, GL_CLAMP,
- PNG("earth-light.png")
- );
- }
-
- for (unsigned int i = 0; i < 5; i++) {
- smoke[i] = Common::resources->genTexture(
- GL_NEAREST, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- PNG(stdx::oss() << "smoke" << (char)(i + '1') << ".png")
- );
- }
-
- stdx::dim3<GLubyte, 4, FLARESIZE> flareMap[4];
- for (unsigned int i = 0; i < 4; ++i)
- flareMap[i].resize(FLARESIZE);
-
- for (int i = 0; i < FLARESIZE; ++i) {
- for (int j = 0; j < FLARESIZE; ++j) {
- float x = float(i - FLARESIZE / 2) / float(FLARESIZE / 2);
- float y = float(j - FLARESIZE / 2) / float(FLARESIZE / 2);
- float temp;
-
- // Basic flare
- flareMap[0](i, j, 0) = 255;
- flareMap[0](i, j, 1) = 255;
- flareMap[0](i, j, 2) = 255;
- temp = Common::clamp(
- 1.0f - ((x * x) + (y * y)),
- 0.0f, 1.0f
- );
- flareMap[0](i, j, 3) = GLubyte(255.0f * temp * temp);
-
- // Flattened sphere
- flareMap[1](i, j, 0) = 255;
- flareMap[1](i, j, 1) = 255;
- flareMap[1](i, j, 2) = 255;
- temp = Common::clamp(
- 2.5f * (1.0f - ((x * x) + (y * y))),
- 0.0f, 1.0f
- );
- flareMap[1](i, j, 3) = GLubyte(255.0f * temp);
-
- // Torus
- flareMap[2](i, j, 0) = 255;
- flareMap[2](i, j, 1) = 255;
- flareMap[2](i, j, 2) = 255;
- temp = Common::clamp(
- 4.0f * ((x * x) + (y * y)) * (1.0f - ((x * x) + (y * y))),
- 0.0f, 1.0f
- );
- temp = temp * temp * temp * temp;
- flareMap[2](i, j, 3) = GLubyte(255.0f * temp);
-
- // Kick-ass!
- x = std::abs(x);
- y = std::abs(y);
- float xy = x * y;
- flareMap[3](i, j, 0) = 255;
- flareMap[3](i, j, 1) = 255;
- temp = Common::clamp(
- 0.14f * (1.0f - ((x > y) ? x : y)) / ((xy > 0.05f) ? xy : 0.05f),
- 0.0f, 1.0f
- );
- flareMap[3](i, j, 2) = GLubyte(255.0f * temp);
- temp = Common::clamp(
- 0.1f * (1.0f - ((x > y) ? x : y)) / ((xy > 0.1f) ? xy : 0.1f),
- 0.0f, 1.0f
- );
- flareMap[3](i, j, 3) = GLubyte(255.0f * temp);
- }
- }
-
- for (unsigned int i = 0; i < 4; ++i)
- flare[i] = Common::resources->genTexture(
- GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- 4, FLARESIZE, FLARESIZE, GL_RGBA, GL_UNSIGNED_BYTE,
- &flareMap[i].front(), false
- );
-}
-
-void Resources::DisplayLists::_init() {
- flares = Common::resources->genLists(4);
- for (unsigned int i = 0; i < 4; ++i) {
- glNewList(flares + i, GL_COMPILE);
- glBindTexture(GL_TEXTURE_2D, Resources::Textures::flare[i]);
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-0.5f, -0.5f, 0.0f);
- glTexCoord2f(1.0f, 0.0f);
- glVertex3f(0.5f, -0.5f, 0.0f);
- glTexCoord2f(0.0f, 1.0f);
- glVertex3f(-0.5f, 0.5f, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(0.5f, 0.5f, 0.0f);
- glEnd();
- glEndList();
- }
-
- rocket = Common::resources->genLists(1);
- glNewList(rocket, GL_COMPILE);
- // Draw rocket (10-sided cylinder)
- glBegin(GL_TRIANGLE_STRIP);
- glVertex3f(0.075f, 0.0f, 0.0f);
- glVertex3f(0.075f, 1.0f, 0.0f);
- glVertex3f(0.060676f, 0.0f, 0.033504f);
- glVertex3f(0.060676f, 1.0f, 0.033504f);
- glVertex3f(0.023176f, 0.0f, 0.071329f);
- glVertex3f(0.023176f, 1.0f, 0.071329f);
- glVertex3f(-0.023176f, 0.0f, 0.071329f);
- glVertex3f(-0.023176f, 1.0f, 0.071329f);
- glVertex3f(-0.060676f, 0.0f, 0.033504f);
- glVertex3f(-0.060676f, 1.0f, 0.033504f);
- glVertex3f(-0.075f, 0.0f, 0.0f);
- glVertex3f(-0.075f, 1.0f, 0.0f);
- glVertex3f(-0.060676f, 0.0f, -0.033504f);
- glVertex3f(-0.060676f, 1.0f, -0.033504f);
- glVertex3f(-0.023176f, 0.0f, -0.071329f);
- glVertex3f(-0.023176f, 1.0f, -0.071329f);
- glVertex3f(0.023176f, 0.0f, -0.071329f);
- glVertex3f(0.023176f, 1.0f, -0.071329f);
- glVertex3f(0.060676f, 0.0f, -0.033504f);
- glVertex3f(0.060676f, 1.0f, -0.033504f);
- glVertex3f(0.075f, 0.0f, 0.0f);
- glVertex3f(0.075f, 1.0f, 0.0f);
- glEnd();
- // bottom of rocket
- glBegin(GL_TRIANGLE_STRIP);
- glVertex3f(0.075f, 0.0f, 0.0f);
- glVertex3f(0.060676f, 0.0f, 0.033504f);
- glVertex3f(0.060676f, 0.0f, -0.033504f);
- glVertex3f(0.023176f, 0.0f, 0.071329f);
- glVertex3f(0.023176f, 0.0f, -0.071329f);
- glVertex3f(-0.023176f, 0.0f, 0.071329f);
- glVertex3f(-0.023176f, 0.0f, -0.071329f);
- glVertex3f(-0.060676f, 0.0f, 0.033504f);
- glVertex3f(-0.060676f, 0.0f, -0.033504f);
- glVertex3f(-0.075f, 0.0f, 0.0f);
- glEnd();
- // top of rocket
- glBegin(GL_TRIANGLE_STRIP);
- glVertex3f(0.075f, 1.0f, 0.0f);
- glVertex3f(0.060676f, 1.0f, -0.033504f);
- glVertex3f(0.060676f, 1.0f, 0.033504f);
- glVertex3f(0.023176f, 1.0f, -0.071329f);
- glVertex3f(0.023176f, 1.0f, 0.071329f);
- glVertex3f(-0.023176f, 1.0f, -0.071329f);
- glVertex3f(-0.023176f, 1.0f, 0.071329f);
- glVertex3f(-0.060676f, 1.0f, -0.033504f);
- glVertex3f(-0.060676f, 1.0f, 0.033504f);
- glVertex3f(-0.075f, 1.0f, 0.0f);
- glEnd();
- glEndList();
-
- smokes = Common::resources->genLists(5);
- for (unsigned int i = 0; i < 5; i++) {
- glNewList(smokes + i, GL_COMPILE);
- glBindTexture(GL_TEXTURE_2D, Resources::Textures::smoke[i]);
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-0.5f, -0.5f, 0.0f);
- glTexCoord2f(1.0f, 0.0f);
- glVertex3f(0.5f, -0.5f, 0.0f);
- glTexCoord2f(0.0f, 1.0f);
- glVertex3f(-0.5f, 0.5f, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(0.5f, 0.5f, 0.0f);
- glEnd();
- glEndList();
- }
-
- if (Hack::starDensity > 0) {
- Vector starPos[STARMESH + 1][STARMESH / 2];
- float starCoord[STARMESH + 1][STARMESH / 2][2];
- float starBrightness[STARMESH + 1][STARMESH / 2];
- for (unsigned int j = 0; j < STARMESH / 2; ++j) {
- float y = std::sin(M_PI_2 * float(j) / float(STARMESH / 2));
- for (unsigned int i = 0; i <= STARMESH; ++i) {
- float x = std::cos(M_PI * 2 * float(i) / float(STARMESH)) *
- std::cos(M_PI_2 * float(j) / float(STARMESH / 2));
- float z = std::sin(M_PI * 2 * float(i) / float(STARMESH)) *
- std::cos(M_PI_2 * float(j) / float(STARMESH / 2));
- starPos[i][j].set(
- x * 20000.0f,
- 1500.0f + 18500.0f * y,
- z * 20000.0f
- );
- starCoord[i][j][0] = 1.2f * x * (2.5f - y);
- starCoord[i][j][1] = 1.2f * z * (2.5f - y);
- starBrightness[i][j] = (starPos[i][j].y() < 1501.0f) ? 0.0f : 1.0f;
- }
- }
-
- stars = Common::resources->genLists(1);
- glNewList(stars, GL_COMPILE);
- glBindTexture(GL_TEXTURE_2D, Resources::Textures::stars);
- for (unsigned int j = 0; j < (STARMESH / 2 - 1); ++j) {
- glBegin(GL_TRIANGLE_STRIP);
- for (unsigned int i = 0; i <= STARMESH; ++i) {
- glColor3f(
- starBrightness[i][j + 1],
- starBrightness[i][j + 1],
- starBrightness[i][j + 1]
- );
- glTexCoord2fv(starCoord[i][j + 1]);
- glVertex3fv(starPos[i][j + 1].get());
- glColor3f(
- starBrightness[i][j],
- starBrightness[i][j],
- starBrightness[i][j]
- );
- glTexCoord2fv(starCoord[i][j]);
- glVertex3fv(starPos[i][j].get());
- }
- glEnd();
- }
- glBegin(GL_TRIANGLE_FAN);
- glColor3f(1.0f, 1.0f, 1.0f);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(0.0f, 20000.0f, 0.0f);
- for (unsigned int i = 0; i <= STARMESH; ++i) {
- glColor3f(
- starBrightness[i][STARMESH / 2 - 1],
- starBrightness[i][STARMESH / 2 - 1],
- starBrightness[i][STARMESH / 2 - 1]
- );
- glTexCoord2fv(starCoord[i][STARMESH / 2 - 1]);
- glVertex3fv(starPos[i][STARMESH / 2 - 1].get());
- }
- glEnd();
- glEndList();
- }
-
- if (Hack::drawMoon) {
- moon = Common::resources->genLists(1);
- glNewList(moon, GL_COMPILE);
- glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- glBindTexture(GL_TEXTURE_2D, Resources::Textures::moon);
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-800.0f, -800.0f, 0.0f);
- glTexCoord2f(1.0f, 0.0f);
- glVertex3f(800.0f, -800.0f, 0.0f);
- glTexCoord2f(0.0f, 1.0f);
- glVertex3f(-800.0f, 800.0f, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(800.0f, 800.0f, 0.0f);
- glEnd();
- glEndList();
-
- if (Hack::moonGlow > 0.0f) {
- moonGlow = Common::resources->genLists(1);
- glNewList(moonGlow, GL_COMPILE);
- glBindTexture(GL_TEXTURE_2D, Resources::Textures::moonGlow);
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-7000.0f, -7000.0f, 0.0f);
- glTexCoord2f(1.0f, 0.0f);
- glVertex3f(7000.0f, -7000.0f, 0.0f);
- glTexCoord2f(0.0f, 1.0f);
- glVertex3f(-7000.0f, 7000.0f, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(7000.0f, 7000.0f, 0.0f);
- glEnd();
- glEndList();
- }
- }
-
- if (Hack::drawSunset) {
- float vert[6] = { 0.0f, 7654.0f, 8000.0f, 14142.0f, 18448.0f, 20000.0f };
- sunset = Common::resources->genLists(1);
- glNewList(sunset, GL_COMPILE);
- glBindTexture(GL_TEXTURE_2D, Resources::Textures::sunset);
- glBegin(GL_TRIANGLE_STRIP);
- glColor3f(0.0f, 0.0f, 0.0f);
- glTexCoord2f(1.0f, 0.0f);
- glVertex3f(vert[0], vert[2], vert[5]);
- glColor3f(0.0f, 0.0f, 0.0f);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(vert[0], vert[0], vert[5]);
- glColor3f(0.0f, 0.0f, 0.0f);
- glTexCoord2f(1.0f, 0.125f);
- glVertex3f(-vert[1], vert[2], vert[4]);
- glColor3f(0.25f, 0.25f, 0.25f);
- glTexCoord2f(0.0f, 0.125f);
- glVertex3f(-vert[1], vert[0], vert[4]);
- glColor3f(0.0f, 0.0f, 0.0f);
- glTexCoord2f(1.0f, 0.25f);
- glVertex3f(-vert[3], vert[2], vert[3]);
- glColor3f(0.5f, 0.5f, 0.5f);
- glTexCoord2f(0.0f, 0.25f);
- glVertex3f(-vert[3], vert[0], vert[3]);
- glColor3f(0.0f, 0.0f, 0.0f);
- glTexCoord2f(1.0f, 0.375f);
- glVertex3f(-vert[4], vert[2], vert[1]);
- glColor3f(0.75f, 0.75f, 0.75f);
- glTexCoord2f(0.0f, 0.375f);
- glVertex3f(-vert[4], vert[0], vert[1]);
- glColor3f(0.0f, 0.0f, 0.0f);
- glTexCoord2f(1.0f, 0.5f);
- glVertex3f(-vert[5], vert[2], vert[0]);
- glColor3f(1.0f, 1.0f, 1.0f);
- glTexCoord2f(0.0f, 0.5f);
- glVertex3f(-vert[5], vert[0], vert[0]);
- glColor3f(0.0f, 0.0f, 0.0f);
- glTexCoord2f(1.0f, 0.625f);
- glVertex3f(-vert[4], vert[2], -vert[1]);
- glColor3f(0.75f, 0.75f, 0.75f);
- glTexCoord2f(0.0f, 0.625f);
- glVertex3f(-vert[4], vert[0], -vert[1]);
- glColor3f(0.0f, 0.0f, 0.0f);
- glTexCoord2f(1.0f, 0.75f);
- glVertex3f(-vert[3], vert[2], -vert[3]);
- glColor3f(0.5f, 0.5f, 0.5f);
- glTexCoord2f(0.0f, 0.75f);
- glVertex3f(-vert[3], vert[0], -vert[3]);
- glColor3f(0.0f, 0.0f, 0.0f);
- glTexCoord2f(1.0f, 0.875f);
- glVertex3f(-vert[1], vert[2], -vert[4]);
- glColor3f(0.25f, 0.25f, 0.25f);
- glTexCoord2f(0.0f, 0.875f);
- glVertex3f(-vert[1], vert[0], -vert[4]);
- glColor3f(0.0f, 0.0f, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(vert[0], vert[2], -vert[5]);
- glColor3f(0.0f, 0.0f, 0.0f);
- glTexCoord2f(0.0f, 1.0f);
- glVertex3f(vert[0], vert[0], -vert[5]);
- glEnd();
- glEndList();
- }
-
- if (Hack::drawEarth) {
- float lit[] = {
- Hack::ambient * 0.01f,
- Hack::ambient * 0.01f,
- Hack::ambient * 0.01f
- };
- float unlit[] = { 0.0f, 0.0f, 0.0f };
- float vert[] = { 839.68f, 8396.8f };
- float tex[] = { 0.0f, 0.45f, 0.55f, 1.0f };
- earthNear = Common::resources->genLists(1);
- glNewList(earthNear, GL_COMPILE);
- glColor3fv(lit);
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(tex[0], tex[0]);
- glVertex3f(-vert[0], 0.0f, -vert[0]);
- glTexCoord2f(tex[0], tex[3]);
- glVertex3f(-vert[0], 0.0f, vert[0]);
- glTexCoord2f(tex[3], tex[0]);
- glVertex3f(vert[0], 0.0f, -vert[0]);
- glTexCoord2f(tex[3], tex[3]);
- glVertex3f(vert[0], 0.0f, vert[0]);
- glEnd();
- glEndList();
- earthFar = Common::resources->genLists(1);
- glNewList(earthFar, GL_COMPILE);
- glBegin(GL_TRIANGLE_STRIP);
- glColor3fv(lit);
- glTexCoord2f(tex[1], tex[1]);
- glVertex3f(-vert[0], 0.0f, -vert[0]);
- glTexCoord2f(tex[2], tex[1]);
- glVertex3f(vert[0], 0.0f, -vert[0]);
- glColor3fv(unlit);
- glTexCoord2f(tex[0], tex[0]);
- glVertex3f(-vert[1], 0.0f, -vert[1]);
- glTexCoord2f(tex[3], tex[0]);
- glVertex3f(vert[1], 0.0f, -vert[1]);
- glEnd();
- glBegin(GL_TRIANGLE_STRIP);
- glColor3fv(lit);
- glTexCoord2f(tex[1], tex[2]);
- glVertex3f(-vert[0], 0.0f, vert[0]);
- glTexCoord2f(tex[1], tex[1]);
- glVertex3f(-vert[0], 0.0f, -vert[0]);
- glColor3fv(unlit);
- glTexCoord2f(tex[0], tex[3]);
- glVertex3f(-vert[1], 0.0f, vert[1]);
- glTexCoord2f(tex[0], tex[0]);
- glVertex3f(-vert[1], 0.0f, -vert[1]);
- glEnd();
- glBegin(GL_TRIANGLE_STRIP);
- glColor3fv(lit);
- glTexCoord2f(tex[2], tex[2]);
- glVertex3f(vert[0], 0.0f, vert[0]);
- glTexCoord2f(tex[1], tex[2]);
- glVertex3f(-vert[0], 0.0f, vert[0]);
- glColor3fv(unlit);
- glTexCoord2f(tex[3], tex[3]);
- glVertex3f(vert[1], 0.0f, vert[1]);
- glTexCoord2f(tex[0], tex[3]);
- glVertex3f(-vert[1], 0.0f, vert[1]);
- glEnd();
- glBegin(GL_TRIANGLE_STRIP);
- glColor3fv(lit);
- glTexCoord2f(tex[2], tex[1]);
- glVertex3f(vert[0], 0.0f, -vert[0]);
- glTexCoord2f(tex[2], tex[2]);
- glVertex3f(vert[0], 0.0f, vert[0]);
- glColor3fv(unlit);
- glTexCoord2f(tex[3], tex[0]);
- glVertex3f(vert[1], 0.0f, -vert[1]);
- glTexCoord2f(tex[3], tex[3]);
- glVertex3f(vert[1], 0.0f, vert[1]);
- glEnd();
- glEndList();
- earthLight = Common::resources->genLists(1);
- glNewList(earthLight, GL_COMPILE);
- lit[0] = lit[1] = lit[2] = 0.4f;
- glColor3fv(lit);
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(tex[1], tex[1]);
- glVertex3f(-vert[0], 0.0f, -vert[0]);
- glTexCoord2f(tex[1], tex[2]);
- glVertex3f(-vert[0], 0.0f, vert[0]);
- glTexCoord2f(tex[2], tex[1]);
- glVertex3f(vert[0], 0.0f, -vert[0]);
- glTexCoord2f(tex[2], tex[2]);
- glVertex3f(vert[0], 0.0f, vert[0]);
- glEnd();
- glBegin(GL_TRIANGLE_STRIP);
- glColor3fv(lit);
- glTexCoord2f(tex[1], tex[1]);
- glVertex3f(-vert[0], 0.0f, -vert[0]);
- glTexCoord2f(tex[2], tex[1]);
- glVertex3f(vert[0], 0.0f, -vert[0]);
- glColor3fv(unlit);
- glTexCoord2f(tex[0], tex[0]);
- glVertex3f(-vert[1], 0.0f, -vert[1]);
- glTexCoord2f(tex[3], tex[0]);
- glVertex3f(vert[1], 0.0f, -vert[1]);
- glEnd();
- glBegin(GL_TRIANGLE_STRIP);
- glColor3fv(lit);
- glTexCoord2f(tex[1], tex[2]);
- glVertex3f(-vert[0], 0.0f, vert[0]);
- glTexCoord2f(tex[1], tex[1]);
- glVertex3f(-vert[0], 0.0f, -vert[0]);
- glColor3fv(unlit);
- glTexCoord2f(tex[0], tex[3]);
- glVertex3f(-vert[1], 0.0f, vert[1]);
- glTexCoord2f(tex[0], tex[0]);
- glVertex3f(-vert[1], 0.0f, -vert[1]);
- glEnd();
- glBegin(GL_TRIANGLE_STRIP);
- glColor3fv(lit);
- glTexCoord2f(tex[2], tex[2]);
- glVertex3f(vert[0], 0.0f, vert[0]);
- glTexCoord2f(tex[1], tex[2]);
- glVertex3f(-vert[0], 0.0f, vert[0]);
- glColor3fv(unlit);
- glTexCoord2f(tex[3], tex[3]);
- glVertex3f(vert[1], 0.0f, vert[1]);
- glTexCoord2f(tex[0], tex[3]);
- glVertex3f(-vert[1], 0.0f, vert[1]);
- glEnd();
- glBegin(GL_TRIANGLE_STRIP);
- glColor3fv(lit);
- glTexCoord2f(tex[2], tex[1]);
- glVertex3f(vert[0], 0.0f, -vert[0]);
- glTexCoord2f(tex[2], tex[2]);
- glVertex3f(vert[0], 0.0f, vert[0]);
- glColor3fv(unlit);
- glTexCoord2f(tex[3], tex[0]);
- glVertex3f(vert[1], 0.0f, -vert[1]);
- glTexCoord2f(tex[3], tex[3]);
- glVertex3f(vert[1], 0.0f, vert[1]);
- glEnd();
- glEndList();
- }
-}
-
-void Resources::init() {
- if (Hack::volume > 0.0f) {
- try {
- Sound::init(
- Hack::openalSpec, Hack::volume, Hack::speedOfSound,
- &Hack::cameraPos, &Hack::cameraVel, &Hack::cameraDir
- );
- } catch (Sound::Unavailable e) {
- Hack::volume = 0.0f;
- } catch (Common::Exception e) {
- WARN(e);
- Hack::volume = 0.0f;
- }
- }
- if (Hack::volume > 0.0f) {
- try {
- Sounds::_init();
- } catch (Sound::Unavailable e) {
- Hack::volume = 0.0f;
- }
- }
- Textures::_init();
- DisplayLists::_init();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/resources.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/resources.hh
deleted file mode 100644
index c5c95581ff..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/resources.hh
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _RESOURCES_HH
-#define _RESOURCES_HH
-
-#include <common.hh>
-
-#include <sound.hh>
-#include <vector.hh>
-
-#define CLOUDMESH 48
-
-namespace Resources {
- namespace Sounds {
- extern Sound* boom1;
- extern Sound* boom2;
- extern Sound* boom3;
- extern Sound* boom4;
- extern Sound* launch1;
- extern Sound* launch2;
- extern Sound* nuke;
- extern Sound* popper;
- extern Sound* suck;
- extern Sound* whistle;
- };
-
- namespace Textures {
- extern GLuint cloud;
- extern GLuint stars;
- extern GLuint moon;
- extern GLuint moonGlow;
- extern GLuint sunset;
- extern GLuint earthNear;
- extern GLuint earthFar;
- extern GLuint earthLight;
- extern GLuint smoke[5];
- extern GLuint flare[4];
- };
-
- namespace DisplayLists {
- extern GLuint flares;
- extern GLuint rocket;
- extern GLuint smokes;
- extern GLuint stars;
- extern GLuint moon;
- extern GLuint moonGlow;
- extern GLuint sunset;
- extern GLuint earthNear;
- extern GLuint earthFar;
- extern GLuint earthLight;
- };
-
- void init();
-};
-
-#endif // _RESOURCES_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/rocket.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/rocket.cc
deleted file mode 100644
index e2951f1975..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/rocket.cc
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <explosion.hh>
-#include <resources.hh>
-#include <rocket.hh>
-#include <skyrocket.hh>
-#include <smoke.hh>
-#include <spinner.hh>
-#include <star.hh>
-#include <stretcher.hh>
-#include <sucker.hh>
-#include <vector.hh>
-
-Rocket::Rocket(Explosion::Type explosionType) :
- Particle(
- Vector(
- Common::randomFloat(200.0f) - 100.0f,
- 5.0f,
- Common::randomFloat(200.0f) - 100.0f
- ), Vector(0.0f, 60.0f, 0.0f), 0.281f, // terminal velocity = 50 ft/s
- Common::randomFloat(2.0f) + 5.0f
- ), _RGB(
- Common::randomFloat(0.7f) + 0.3f,
- Common::randomFloat(0.7f) + 0.3f,
- 0.3f
- ), _brightness(0.0f),
- _thrust(Common::randomFloat(100.0f) + 200.0f),
- _thrustLifetime(_lifetime * (Common::randomFloat(0.1f) + 0.6f)),
- _spin(Common::randomFloat(2.0f * M_PI) - M_PI),
- _rotation(Common::randomFloat(std::abs(_spin) * 0.6f)),
- _direction(UnitQuat::heading(Common::randomFloat(M_PI * 2))),
- _smokePos(_pos), _starPos(_pos),
- _explosionType(explosionType) {
- // Crash the occasional rocket
- if (!Common::randomInt(200)) {
- _spin = 0.0f;
- _rotation = Common::randomFloat(M_PI / 2.0f) + M_PI / 3.0f;
- }
- ++Hack::numRockets;
-
- if (Hack::volume > 0.0f) {
- if (Common::randomInt(2))
- Resources::Sounds::launch1->play(_pos);
- else
- Resources::Sounds::launch2->play(_pos);
- }
-}
-
-void Rocket::update() {
- _remaining -= Common::elapsedTime;
-
- bool alive = _remaining > 0.0f && _pos.y() >= 0.0f;
- if (!alive) {
- switch (_explosionType) {
- case Explosion::EXPLODE_SPINNER:
- Hack::pending.push_back(new Spinner(_pos, _vel));
- break;
- case Explosion::EXPLODE_SUCKER:
- Hack::pending.push_back(new Sucker(_pos, _vel));
- Hack::pending.push_back(new Explosion(_pos, _vel,
- Explosion::EXPLODE_SUCKER, RGBColor(1.0f, 1.0f, 1.0f), 4.0f));
- break;
- case Explosion::EXPLODE_STRETCHER:
- Hack::pending.push_back(new Stretcher(_pos, _vel));
- Hack::pending.push_back(new Explosion(_pos, _vel,
- Explosion::EXPLODE_STRETCHER, RGBColor(1.0f, 1.0f, 1.0f), 4.0f));
- break;
- default:
- Hack::pending.push_back(new Explosion(_pos, _vel, _explosionType));
- break;
- }
- _depth = DEAD_DEPTH;
- --Hack::numRockets;
- ++Hack::numDead;
- return;
- }
-
- if (_remaining + _thrustLifetime > _lifetime) {
- _brightness += 2.0f * Common::elapsedTime;
- if (_brightness > 1.0f)
- _brightness = 1.0f;
- } else {
- _brightness -= Common::elapsedTime;
- if (_brightness < 0.0f)
- _brightness = 0.0f;
- }
-
- _direction.multiplyBy(UnitQuat::heading(_spin * Common::elapsedTime));
- _direction.multiplyBy(UnitQuat::pitch(_rotation * Common::elapsedTime));
- _directionMat = RotationMatrix(_direction);
-
- if (_remaining + _thrustLifetime > _lifetime)
- _vel += _direction.up() * _thrust * Common::elapsedTime;
-
- _vel.y() -= Common::elapsedTime * 32.0f;
- float temp = 1.0f / (1.0f + _drag * Common::elapsedTime);
- _vel *= temp * temp;
-
- _pos += _vel * Common::elapsedTime;
- _pos.x() +=
- (0.1f - 0.00175f * _pos.y() + 0.0000011f * _pos.y() * _pos.y()) *
- Hack::wind * Common::elapsedTime;
-
- Vector step(_pos - _smokePos);
- float distance = step.normalize();
-
- if (Hack::smoke && distance > 2.0f) {
- unsigned int n = (unsigned int)(distance / 2.0f);
- step *= 2.0f;
- if (_remaining + _thrustLifetime > _lifetime) {
- // exhaustDirection is the exhaust direction and velocity
- Vector exhaustDirection(step * -_thrust *
- (_remaining + _thrustLifetime - _lifetime) / _lifetime);
- for (unsigned int i = 0; i < n; ++i) {
- Hack::pending.push_back(new Smoke(_smokePos,
- exhaustDirection + Vector(
- Common::randomFloat(20.0f) - 10.0f,
- Common::randomFloat(20.0f) - 10.0f,
- Common::randomFloat(20.0f) - 10.0f
- )));
- _smokePos += step;
- }
- } else {
- for (unsigned int i = 0; i < n; ++i) {
- Hack::pending.push_back(new Smoke(_smokePos,
- Vector(
- Common::randomFloat(20.0f) - 10.0f,
- Common::randomFloat(20.0f) - 10.0f,
- Common::randomFloat(20.0f) - 10.0f
- )));
- _smokePos += step;
- }
- }
- }
-
- step = _pos - _starPos;
- distance = step.normalize();
-
- if (_remaining + _thrustLifetime > _lifetime && distance > 2.5f) {
- // starDirection is the star direction and velocity
- Vector starDirection(_vel);
- starDirection.normalize();
- starDirection *= _thrust * (_lifetime - _thrustLifetime - _remaining) /
- _lifetime;
- unsigned int n = (unsigned int)(distance / 2.5f);
- step *= 2.5f;
- for (unsigned int i = 0; i < n; ++i) {
- Hack::pending.push_back(new Star(_starPos + Common::randomFloat(1.0f),
- starDirection + Vector(
- Common::randomFloat(60.0f) - 30.0f,
- Common::randomFloat(60.0f) - 30.0f,
- Common::randomFloat(60.0f) - 30.0f
- ), 0.612f, Common::randomFloat(0.2f) + 0.1f, _RGB,
- 8.0f * _remaining / _lifetime, false,
- Resources::DisplayLists::flares + 3)
- );
- _starPos += step;
- }
- }
-
- Hack::illuminate(_pos, _RGB, _brightness, 40000.0f, 0.0f);
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Rocket::updateCameraOnly() {
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Rocket::draw() const {
- if (_depth < 0.0f)
- return;
-
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(3.0f, 3.0f, 3.0f);
- glMultMatrixf(_directionMat.get());
- glDisable(GL_TEXTURE_2D);
- glColor4f(
- _RGB.r() + Hack::ambient * 0.005f,
- _RGB.g() + Hack::ambient * 0.005f,
- _RGB.b() + Hack::ambient * 0.005f,
- _brightness
- );
- glCallList(Resources::DisplayLists::rocket);
- glEnable(GL_TEXTURE_2D);
- glPopMatrix();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/rocket.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/rocket.hh
deleted file mode 100644
index 4a5fcc9865..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/rocket.hh
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _ROCKET_HH
-#define _ROCKET_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <explosion.hh>
-#include <particle.hh>
-#include <vector.hh>
-
-class Rocket : public Particle {
-private:
- RGBColor _RGB;
- float _brightness;
-
- float _thrust;
- float _thrustLifetime;
- float _spin;
- float _rotation;
- UnitQuat _direction;
- RotationMatrix _directionMat;
-
- Vector _smokePos;
- Vector _starPos;
-
- Explosion::Type _explosionType;
-public:
- Rocket(Explosion::Type);
-
- void update();
- void updateCameraOnly();
- void draw() const;
-};
-
-#endif // _ROCKET_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/shockwave.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/shockwave.cc
deleted file mode 100644
index 95225c0bb5..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/shockwave.cc
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <resources.hh>
-#include <shockwave.hh>
-#include <skyrocket.hh>
-#include <star.hh>
-#include <vector.hh>
-
-Vector Shockwave::_geom[7][WAVESTEPS + 1];
-
-void Shockwave::init() {
- _geom[0][0].set(1.0f, 0.0f, 0.0f);
- _geom[1][0].set(0.985f, 0.035f, 0.0f);
- _geom[2][0].set(0.95f, 0.05f, 0.0f);
- _geom[3][0].set(0.85f, 0.05f, 0.0f);
- _geom[4][0].set(0.75f, 0.035f, 0.0f);
- _geom[5][0].set(0.65f, 0.01f, 0.0f);
- _geom[6][0].set(0.5f, 0.0f, 0.0f);
-
- for (unsigned int i = 1; i <= WAVESTEPS; ++i) {
- float ch = std::cos(M_PI * 2.0f * (float(i) / float(WAVESTEPS)));
- float sh = std::sin(M_PI * 2.0f * (float(i) / float(WAVESTEPS)));
- for (unsigned int j = 0; j < 7; ++j)
- _geom[j][i].set(
- ch * _geom[j][0].x(),
- _geom[j][0].y(),
- sh * _geom[j][0].x()
- );
- }
-}
-
-Shockwave::Shockwave(const Vector& pos, const Vector& vel) :
- Particle(pos, vel, 0.612f, 5.0f), _size(0.0f) {
- RGBColor RGB(Particle::randomColor());
- for (unsigned int i = 0; i < 75; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- velocity *= 100.0f + Common::randomFloat(10.0f);
- velocity += _vel;
-
- Hack::pending.push_back(new Star(_pos, velocity, 0.612f,
- Common::randomFloat(2.0f) + 2.0f, RGB, 100.0f));
- }
-
- RGB = Particle::randomColor();
- for (unsigned int i = 0; i < 150; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- Common::randomFloat(0.03f) - 0.005f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- velocity *= 500.0f + Common::randomFloat(30.0f);
- velocity += _vel;
-
- Hack::pending.push_back(new Star(_pos, velocity, 0.612f,
- Common::randomFloat(2.0f) + 3.0f, RGB, 50.0f));
- }
-
- if (Hack::volume > 0.0f)
- Resources::Sounds::nuke->play(_pos);
-}
-
-void Shockwave::update() {
- _remaining -= Common::elapsedTime;
-
- if (_remaining <= 0.0f || _pos.y() <= 0.0f) {
- _depth = DEAD_DEPTH;
- ++Hack::numDead;
- return;
- }
-
- _vel.y() -= Common::elapsedTime * 32.0f;
- _pos += _vel * Common::elapsedTime;
- _pos.x() +=
- (0.1f - 0.00175f * _pos.y() + 0.0000011f * _pos.y() * _pos.y()) *
- Hack::wind * Common::elapsedTime;
-
- _life = _remaining / _lifetime;
- _size += 400.0f * _life;
-
- Hack::shock(_pos, (1.0f - _life) * 0.002f * Common::elapsedTime);
- Hack::superFlare(_pos, RGBColor(1.0f, 1.0f, 1.0f), _life);
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Shockwave::updateCameraOnly() {
- Hack::superFlare(_pos, RGBColor(1.0f, 1.0f, 1.0f), _life);
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Shockwave::draw() const {
- if (_depth < 0.0f)
- return;
-
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(_size, _size, _size);
- drawShockwave(_life, float(std::sqrt(_size)) * 0.08f);
- if (_life > 0.7f) {
- glMultMatrixf(Hack::cameraMat.get());
- glScalef(5.0f, 5.0f, 5.0f);
- glColor4f(1.0f, _life, 1.0f, (_life - 0.7f) * 3.333f);
- glCallList(Resources::DisplayLists::flares + 2);
- }
- glPopMatrix();
-}
-
-void Shockwave::drawShockwave(float temperature, float texMove) const {
- float temp;
- float alphas[7];
- if (temperature > 0.5f) {
- temp = 1.0f;
- alphas[0] = 1.0f; alphas[1] = 0.9f; alphas[2] = 0.8f;
- alphas[3] = 0.7f; alphas[4] = 0.5f; alphas[5] = 0.3f;
- alphas[6] = 0.0f;
- } else {
- temp = temperature * 2.0f;
- alphas[0] = temp; alphas[1] = temp * 0.9f; alphas[2] = temp * 0.8f;
- alphas[3] = temp * 0.7f; alphas[4] = temp * 0.5f; alphas[5] = temp * 0.3f;
- alphas[6] = 0.0f;
- }
- RGBColor colors[7];
- for (unsigned int i = 0; i < 6; ++i)
- colors[i].set(1.0f, temp, temperature);
-
- glPushAttrib(GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT);
- glDisable(GL_CULL_FACE);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
- glBindTexture(GL_TEXTURE_2D, Resources::Textures::cloud);
-
- // draw bottom of shockwave
- for (unsigned int i = 0; i < 6; ++i) {
- float v1 = float(i + 1) * 0.07f - texMove;
- float v2 = float(i) * 0.07f - texMove;
- glBegin(GL_TRIANGLE_STRIP);
- for (unsigned int j = 0; j <= WAVESTEPS; ++j) {
- float u = (float(j) / float(WAVESTEPS)) * 10.0f;
- glColor4f(colors[i + 1].r(), colors[i + 1].g(),
- colors[i + 1].b(), alphas[i + 1]);
- glTexCoord2f(u, v1);
- glVertex3fv(_geom[i + 1][j].get());
- glColor4f(colors[i].r(), colors[i].g(), colors[i].b(),
- alphas[i]);
- glTexCoord2f(u, v2);
- glVertex3fv(_geom[i][j].get());
- }
- glEnd();
- }
-
- // keep colors a little warmer on top (more green)
- if (temperature < 0.5f)
- for (unsigned int i = 1; i < 6; ++i)
- colors[i].g() = temperature + 0.5f;
-
- // draw top of shockwave
- for (unsigned int i = 0; i < 6; ++i) {
- float v1 = float(i) * 0.07f - texMove;
- float v2 = float(i + 1) * 0.07f - texMove;
- glBegin(GL_TRIANGLE_STRIP);
- for (unsigned int j = 0; j <= WAVESTEPS; ++j) {
- float u = (float(j) / float(WAVESTEPS)) * 10.0f;
- glColor4f(colors[i + 1].r(), colors[i + 1].g(),
- colors[i + 1].b(), alphas[i + 1]);
- glTexCoord2f(u, v1);
- glVertex3fv(_geom[i + 1][j].get());
- glColor4f(colors[i].r(), colors[i].g(), colors[i].b(),
- alphas[i]);
- glTexCoord2f(u, v2);
- glVertex3fv(_geom[i][j].get());
- }
- glEnd();
- }
-
- glPopAttrib();
-}
-
-void Shockwave::shock(const Vector&, float) {
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/shockwave.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/shockwave.hh
deleted file mode 100644
index c342c675ac..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/shockwave.hh
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _SHOCKWAVE_HH
-#define _SHOCKWAVE_HH
-
-#include <common.hh>
-
-#include <particle.hh>
-#include <vector.hh>
-
-#define WAVESTEPS 40
-
-class Shockwave : public Particle {
-private:
- static Vector _geom[7][WAVESTEPS + 1];
-
- float _size;
- float _life;
-public:
- Shockwave(const Vector&, const Vector&);
-
- static void init();
-
- void update();
- void updateCameraOnly();
- void draw() const;
- void drawShockwave(float, float) const;
- void shock(const Vector&, float);
-};
-
-#endif // _SHOCKWAVE_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/skyrocket.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/skyrocket.cc
deleted file mode 100644
index f27421f7e5..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/skyrocket.cc
+++ /dev/null
@@ -1,925 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <explosion.hh>
-#include <flares.hh>
-#include <fountain.hh>
-#include <overlay.hh>
-#include <resources.hh>
-#include <rocket.hh>
-#include <shockwave.hh>
-#include <skyrocket.hh>
-#include <smoke.hh>
-#include <world.hh>
-#include <vector.hh>
-
-namespace Hack {
- bool drawMoon = true;
- bool drawClouds = true;
- bool drawEarth = true;
- bool drawIllumination = true;
- bool drawSunset;
-
- unsigned int maxRockets = 8;
-
- unsigned int starDensity = 20;
- float moonGlow = 20.0f;
- float ambient = 10.0f;
- float flares = 20.0f;
-
- float smoke = 5.0f;
- unsigned int explosionSmoke = 0;
-
- float wind = 20.0f;
-
-#if HAVE_SOUND
- float volume = 100.0f;
-#else
- float volume = 0.0f;
-#endif
- std::string openalSpec("");
- float speedOfSound = 1130.0f;
-};
-
-namespace Hack {
- enum Arguments {
- ARG_ROCKETS = 1,
- ARG_SMOKE,
- ARG_EXPLOSIONSMOKE,
- ARG_STARS,
- ARG_HALO,
- ARG_AMBIENT,
- ARG_WIND,
- ARG_FLARES,
- ARG_VOLUME,
- ARG_OPENAL_SPEC,
- ARG_SPEED_OF_SOUND,
- ARG_MOON = 0x100, ARG_NO_MOON,
- ARG_CLOUDS = 0x200, ARG_NO_CLOUDS,
- ARG_EARTH = 0x300, ARG_NO_EARTH,
- ARG_GLOW = 0x400, ARG_NO_GLOW
- };
-
- bool _action;
-
- enum CameraMode {
- CAMERA_FIXED,
- CAMERA_AUTO,
- CAMERA_MANUAL
- } _cameraMode;
- float _cameraTimeTotal;
- float _cameraTimeElapsed;
-
- Vector _cameraStartPos;
- RotationMatrix _cameraStartDir;
- Vector _cameraEndPos;
- RotationMatrix _cameraEndDir;
-
- Vector _cameraTransPos;
- UnitQuat _cameraTransDir;
- float _cameraTransAngle;
- UnitVector _cameraTransAxis;
-
- Vector cameraPos;
- Vector cameraVel;
- RotationMatrix cameraMat;
- RotationMatrix _cameraMatInv;
- UnitQuat cameraDir;
- float _cameraSpeed;
-
- int _viewport[4];
- double _projectionMat[16];
- double _modelMat[16];
-
- int _mouseX, _mouseY;
- bool _leftButton, _middleButton, _rightButton;
- bool _mouseInWindow;
- float _mouseIdleTime;
-
- Explosion::Type _userDefinedExplosion;
-
- std::vector<Particle*> _particles;
- std::vector<Particle*> pending;
- struct _ParticleSorter :
- public std::binary_function<const Particle*, const Particle*, bool>
- {
- bool operator()(const Particle* a, const Particle* b) {
- return *a < *b;
- }
- } ParticleSorter;
- unsigned int numDead;
- unsigned int numRockets;
-
- std::list<_Illumination> _illuminationList;
- std::list<_Flare> _flareList;
- std::list<_Flare> _superFlareList;
- std::list<_Influence> _suckList;
- std::list<_Influence> _shockList;
- std::list<_Influence> _stretchList;
-
- bool frameToggle;
-
- void newCameraTarget();
- void firstCamera();
- void newCamera();
- void chainCamera();
- void crashChainCamera();
-
- error_t parse(int, char*, struct argp_state*);
-};
-
-error_t Hack::parse(int key, char* arg, struct argp_state* state) {
- switch (key) {
- case ARG_ROCKETS:
- if (Common::parseArg(arg, maxRockets, 1u, 100u))
- argp_failure(state, EXIT_FAILURE, 0,
- "maximum number of rockets must be between 1 and 100");
- return 0;
- case ARG_SMOKE:
- if (Common::parseArg(arg, smoke, 0.0f, 60.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "smoke lifetime must be between 0 and 60");
- return 0;
- case ARG_EXPLOSIONSMOKE:
- if (Common::parseArg(arg, explosionSmoke, 0u, 100u))
- argp_failure(state, EXIT_FAILURE, 0,
- "amount of explosion smoke must be between 0 and 100");
- return 0;
- case ARG_STARS:
- if (Common::parseArg(arg, starDensity, 0u, 100u))
- argp_failure(state, EXIT_FAILURE, 0,
- "star field density must be between 0 and 100");
- return 0;
- case ARG_HALO:
- if (Common::parseArg(arg, moonGlow, 0.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "moon halo intensity must be between 0 and 100");
- return 0;
- case ARG_AMBIENT:
- if (Common::parseArg(arg, ambient, 0.0f, 50.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "ambient illumination must be between 0 and 50");
- return 0;
- case ARG_WIND:
- if (Common::parseArg(arg, ambient, 0.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "wind speed must be between 0 and 100");
- return 0;
- case ARG_FLARES:
- if (Common::parseArg(arg, flares, 0.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "lens flare brightness must be between 0 and 100");
- return 0;
- case ARG_VOLUME:
- if (Common::parseArg(arg, volume, 0.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "audio volume must be between 0 and 100");
- return 0;
- case ARG_OPENAL_SPEC:
- openalSpec = arg;
- return 0;
- case ARG_SPEED_OF_SOUND:
- if (Common::parseArg(arg, speedOfSound, 500.0f, 40000.0f, 0.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "speed of sound must be 0, or between 500 and 40000");
- return 0;
- case ARG_MOON:
- drawMoon = true;
- return 0;
- case ARG_NO_MOON:
- drawMoon = false;
- return 0;
- case ARG_CLOUDS:
- drawClouds = true;
- return 0;
- case ARG_NO_CLOUDS:
- drawClouds = false;
- return 0;
- case ARG_EARTH:
- drawEarth = true;
- return 0;
- case ARG_NO_EARTH:
- drawEarth = false;
- return 0;
- case ARG_GLOW:
- drawIllumination = true;
- return 0;
- case ARG_NO_GLOW:
- drawIllumination = false;
- return 0;
- case ARGP_KEY_FINI:
- drawSunset = Common::randomInt(4) == 0;
- return 0;
- default:
- return ARGP_ERR_UNKNOWN;
- }
-}
-
-const struct argp* Hack::getParser() {
- static struct argp_option options[] = {
- { NULL, 0, NULL, 0, "Rocket options:" },
- { "rockets", ARG_ROCKETS, "NUM", 0,
- "Maximum number of rockets (1-100, default = 8)" },
- { NULL, 0, NULL, 0, "" },
- { "smoke", ARG_SMOKE, "NUM", 0, "Smoke lifetime (0-60, default = 5)" },
- { "explosionsmoke", ARG_EXPLOSIONSMOKE, "NUM", 0,
- "Amount of smoke from explosions (0-100, default = 0)" },
- { NULL, 0, NULL, 0, "Environment options:" },
- { "no-moon", ARG_NO_MOON, NULL, 0, "Do not draw the moon" },
- { "moon", ARG_MOON, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { "no-clouds", ARG_NO_CLOUDS, NULL, 0, "Do not draw clouds" },
- { "clouds", ARG_CLOUDS, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { "no-earth", ARG_NO_EARTH, NULL, 0, "Do not draw the earth" },
- { "earth", ARG_EARTH, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { "no-glow", ARG_NO_GLOW, NULL, 0,
- "Disable illumination of smoke and clouds by rockets and explosions" },
- { "glow", ARG_GLOW, NULL, OPTION_ALIAS | OPTION_HIDDEN },
- { NULL, 0, NULL, 0, "" },
- { "stars", ARG_STARS, "NUM", 0,
- "Density of star field (0-100, default = 20)" },
- { "halo", ARG_HALO, "NUM", 0,
- "Intensity of moon halo (0-100, default = 20)" },
- { "ambient", ARG_AMBIENT, "NUM", 0,
- "Ambient illumination (0-50, default = 10)" },
- { "wind", ARG_WIND, "NUM", 0, "Wind speed (0-100, default = 20)" },
- { NULL, 0, NULL, 0, "Other options:" },
- { "flares", ARG_FLARES, "NUM", 0,
- "Lens flare brightness (0-100, default = 20)" },
-#if HAVE_SOUND
- { "volume", ARG_VOLUME, "NUM", 0, "Audio volume (0-100, default = 100)" },
- { "openal-spec", ARG_OPENAL_SPEC, "SPEC", OPTION_HIDDEN },
- { "speed-of-sound", ARG_SPEED_OF_SOUND, "FPS", OPTION_HIDDEN },
-#else
- { "volume", ARG_VOLUME, "NUM", OPTION_HIDDEN },
- { "openal-spec", ARG_OPENAL_SPEC, "SPEC", OPTION_HIDDEN },
- { "speed-of-sound", ARG_SPEED_OF_SOUND, "FPS", OPTION_HIDDEN },
-#endif
- {}
- };
- static struct argp parser = {
- options, parse, NULL, "The mother of all fireworks screensavers."
- };
- return &parser;
-}
-
-std::string Hack::getShortName() { return "skyrocket"; }
-std::string Hack::getName() { return "Skyrocket"; }
-
-void Hack::newCameraTarget() {
- _cameraEndPos.set(
- Common::randomFloat(6000.0f) - 3000.0f,
- Common::randomFloat(1700.0f) + 5.0f,
- Common::randomFloat(6000.0f) - 3000.0f
- );
- _cameraTransPos = _cameraEndPos - _cameraStartPos;
- _cameraEndDir = RotationMatrix::lookAt(
- _cameraEndPos,
- Vector(
- Common::randomFloat(1000.0f) - 500.0f,
- Common::randomFloat(1100.0f) + 200.0f,
- Common::randomFloat(1000.0f) - 500.0f
- ),
- Vector(0.0f, 1.0f, 0.0f)
- ).inverted();
- _cameraTransDir =
- UnitQuat(RotationMatrix(_cameraStartDir).transposed() * _cameraEndDir);
- _cameraTransDir.toAngleAxis(&_cameraTransAngle, &_cameraTransAxis);
-}
-
-void Hack::firstCamera() {
- _cameraTimeTotal = 20.0f;
- _cameraTimeElapsed = 0.0f;
-
- {
- _cameraStartPos.set(
- Common::randomFloat(1000.0f) + 5000.0f,
- 5.0f,
- Common::randomFloat(4000.0f) - 2000.0f
- );
- _cameraStartDir = RotationMatrix::lookAt(
- _cameraStartPos,
- Vector(0.0f, 1200.0f, 0.0f),
- Vector(0.0f, 1.0f, 0.0f)
- ).inverted();
- }
-
- {
- _cameraEndPos.set(
- Common::randomFloat(3000.0f),
- 400.0f,
- Common::randomFloat(3000.0f) - 1500.0f
- );
- _cameraTransPos = _cameraEndPos - _cameraStartPos;
- _cameraEndDir = RotationMatrix::lookAt(
- _cameraEndPos,
- Vector(0.0f, 1200.0f, 0.0f),
- Vector(0.0f, 1.0f, 0.0f)
- ).inverted();
- _cameraTransDir = UnitQuat(
- RotationMatrix(_cameraStartDir).transposed() * _cameraEndDir);
- _cameraTransDir.toAngleAxis(&_cameraTransAngle, &_cameraTransAxis);
- }
-}
-
-void Hack::newCamera() {
- _cameraTimeTotal = Common::randomFloat(25.0f) + 5.0f;
- _cameraTimeElapsed = 0.0f;
-
- _cameraStartPos.set(
- Common::randomFloat(6000.0f) - 3000.0f,
- Common::randomFloat(1700.0f) + 5.0f,
- Common::randomFloat(6000.0f) - 3000.0f
- );
- _cameraStartDir = RotationMatrix::lookAt(
- _cameraStartPos,
- Vector(
- Common::randomFloat(1000.0f) - 500.0f,
- Common::randomFloat(1100.0f) + 200.0f,
- Common::randomFloat(1000.0f) - 500.0f
- ),
- Vector(0.0f, 1.0f, 0.0f)
- ).inverted();
- newCameraTarget();
-}
-
-void Hack::chainCamera() {
- _cameraTimeTotal = Common::randomFloat(25.0f) + 5.0f;
- _cameraTimeElapsed = 0.0f;
-
- _cameraStartPos = _cameraEndPos;
- _cameraStartDir = _cameraEndDir;
- newCameraTarget();
-}
-
-void Hack::crashChainCamera() {
- _cameraTimeTotal = Common::randomFloat(2.0f) + 2.0f;
- _cameraTimeElapsed = 0.0f;
-
- _cameraStartPos = cameraPos;
- _cameraStartDir = _cameraMatInv;
- _cameraEndPos.set(
- _cameraStartPos.x() + Common::randomFloat(800.0f) - 400.0f,
- Common::randomFloat(400.0f) + 600.0f,
- _cameraStartPos.z() + Common::randomFloat(800.0f) - 400.0f
- );
- _cameraTransPos = _cameraEndPos - _cameraStartPos;
- _cameraEndDir = RotationMatrix::lookAt(
- _cameraEndPos,
- _cameraStartPos,
- Vector(0.0f, 1.0f, 0.0f)
- ).inverted();
- _cameraTransDir =
- UnitQuat(RotationMatrix(_cameraStartDir).transposed() * _cameraEndDir);
- _cameraTransDir.toAngleAxis(&_cameraTransAngle, &_cameraTransAxis);
-}
-
-void Hack::start() {
- _action = true;
- _cameraMode = CAMERA_AUTO;
- _userDefinedExplosion = Explosion::EXPLODE_NONE;
-
- firstCamera();
-
- _mouseX = Common::centerX;
- _mouseY = Common::centerY;
- _leftButton = _middleButton = _rightButton = _mouseInWindow = false;
- _mouseInWindow = false;
- _mouseIdleTime = 0.0f;
-
- glViewport(0, 0, Common::width, Common::height);
- glGetIntegerv(GL_VIEWPORT, _viewport);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(90.0, Common::aspectRatio, 1.0, 10000);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_TEXTURE_2D);
- glFrontFace(GL_CCW);
- glEnable(GL_CULL_FACE);
-
- Resources::init();
- Shockwave::init();
- Smoke::init();
- World::init();
- Overlay::init();
-}
-
-void Hack::reshape() {}
-
-void Hack::tick() {
- // build viewing matrix
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(60.0f, Common::aspectRatio, 1.0f, 40000.0f);
- glGetDoublev(GL_PROJECTION_MATRIX, _projectionMat);
-
- // Build modelview matrix
- // Don't use gluLookAt() because it's easier to find the billboard matrix
- // if we know the heading and pitch
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- switch (_cameraMode) {
- case CAMERA_FIXED:
- cameraVel.set(0.0f, 0.0f, 0.0f);
- break;
- case CAMERA_AUTO:
- {
- _cameraTimeElapsed += Common::elapsedSecs;
- if (_cameraTimeElapsed >= _cameraTimeTotal) {
- if (!Common::randomInt(30))
- newCamera();
- else
- chainCamera();
- }
-
- // change camera position and angle
- float cameraStep = 0.5f *
- (1.0f - std::cos(_cameraTimeElapsed / _cameraTimeTotal * M_PI));
- Vector lastPos(cameraPos);
- cameraPos = _cameraStartPos + _cameraTransPos * cameraStep;
- cameraVel = cameraPos - lastPos;
- cameraDir = _cameraStartDir;
- cameraDir.multiplyBy(
- UnitQuat(_cameraTransAngle * cameraStep, _cameraTransAxis)
- );
- cameraMat = RotationMatrix(cameraDir);
- _cameraMatInv = cameraMat.inverted();
- }
- break;
- case CAMERA_MANUAL:
- {
- float dx = float(
- int(Common::centerX) - int(_mouseX)) /
- float(Common::width);
- dx *= (dx < 0.0f) ? -dx : dx;
- float dy = float(
- int(Common::centerY) - int(_mouseY)) /
- float(Common::height);
- dy *= (dy < 0.0f) ? -dy : dy;
- if (_leftButton)
- _cameraSpeed += Common::elapsedSecs * 400.0f;
- if (_rightButton)
- _cameraSpeed -= Common::elapsedSecs * 400.0f;
- if (_middleButton)
- _cameraSpeed = 0.0f;
- _cameraSpeed = Common::clamp(_cameraSpeed, -1500.0f, 1500.0f);
- cameraDir.multiplyBy(
- UnitQuat::heading(2.0f * Common::elapsedSecs * Common::aspectRatio * dx)
- );
- cameraDir.multiplyBy(
- UnitQuat::roll(5.0f * Common::elapsedSecs * Common::aspectRatio * dx)
- );
- cameraDir.multiplyBy(
- UnitQuat::pitch(5.0f * Common::elapsedSecs * dy)
- );
- cameraMat = RotationMatrix(cameraDir);
- _cameraMatInv = cameraMat.inverted();
- cameraVel = cameraDir.forward() * _cameraSpeed * Common::elapsedSecs;
- cameraPos += cameraVel;
- if (drawEarth && cameraPos.y() < 5.0f) {
- _particles.push_back(new Explosion(
- Vector(cameraPos.x(), 50.0f, cameraPos.z()),
- Vector(0.0f, 200.0f, 0.0f),
- Explosion::EXPLODE_SPHERE)
- );
- _particles.push_back(new Explosion(
- Vector(cameraPos.x(), 1.0f, cameraPos.z()),
- Vector(0.0f, 20.0f, 0.0f),
- Explosion::EXPLODE_FLASH)
- );
- _cameraMode = CAMERA_AUTO;
- Overlay::set("Automatic camera");
- crashChainCamera();
- }
- }
- break;
- }
-
- glMultMatrixf(_cameraMatInv.get());
- glTranslatef(-cameraPos.x(), -cameraPos.y(), -cameraPos.z());
- glGetDoublev(GL_MODELVIEW_MATRIX, _modelMat);
-
- glClear(GL_COLOR_BUFFER_BIT);
-
- if (_action) {
- World::update();
-
- static float rocketSpacing = 10.0f / float(maxRockets);
- static float changeRocketTimer = 20.0f;
- changeRocketTimer -= Common::elapsedTime;
- if (changeRocketTimer <= 0.0f) {
- float temp = Common::randomFloat(4.0f);
- rocketSpacing = (temp * temp) + (10.0f / float(maxRockets));
- changeRocketTimer = Common::randomFloat(30.0f) + 10.0f;
- }
-
- static float rocketTimer = 0.0f;
- rocketTimer -= Common::elapsedTime;
- if (
- (rocketTimer <= 0.0f) ||
- (_userDefinedExplosion != Explosion::EXPLODE_NONE)
- ) {
- if (numRockets < maxRockets) {
- if (_userDefinedExplosion != Explosion::EXPLODE_NONE)
- _particles.push_back(new Rocket(_userDefinedExplosion));
- else if (Common::randomInt(30)) {
- unsigned int dist = Common::randomInt(5602);
- _particles.push_back(new Rocket(
- (dist < 1200) ? Explosion::EXPLODE_SPHERE :
- (dist < 2400) ? Explosion::EXPLODE_SPLIT_SPHERE :
- (dist < 2680) ? Explosion::EXPLODE_MULTICOLORED_SPHERE :
- (dist < 2980) ? Explosion::EXPLODE_RING :
- (dist < 3280) ? Explosion::EXPLODE_DOUBLE_SPHERE :
- (dist < 3580) ? Explosion::EXPLODE_SPHERE_INSIDE_RING :
- (dist < 3820) ? Explosion::EXPLODE_STREAMERS :
- (dist < 4060) ? Explosion::EXPLODE_METEORS :
- (dist < 4170) ? Explosion::EXPLODE_STARS_INSIDE_STREAMERS :
- (dist < 4280) ? Explosion::EXPLODE_STARS_INSIDE_METEORS :
- (dist < 4390) ? Explosion::EXPLODE_STREAMERS_INSIDE_STARS :
- (dist < 4500) ? Explosion::EXPLODE_METEORS_INSIDE_STARS :
- (dist < 4720) ? Explosion::EXPLODE_STAR_BOMBS :
- (dist < 4940) ? Explosion::EXPLODE_STREAMER_BOMBS :
- (dist < 5160) ? Explosion::EXPLODE_METEOR_BOMBS :
- (dist < 5270) ? Explosion::EXPLODE_CRACKER_BOMBS :
- (dist < 5380) ? Explosion::EXPLODE_BEES :
- (dist < 5490) ? Explosion::EXPLODE_FLASH :
- (dist < 5600) ? Explosion::EXPLODE_SPINNER :
- (dist < 5601) ? Explosion::EXPLODE_SUCKER :
- Explosion::EXPLODE_STRETCHER
- ));
- } else {
- _particles.push_back(new Fountain());
- if (Common::randomInt(2))
- _particles.push_back(new Fountain());
- }
- }
- if (maxRockets > 0)
- rocketTimer = Common::randomFloat(rocketSpacing);
- else
- rocketTimer = 60.0f; // arbitrary number since no rockets ever fire
- if (_userDefinedExplosion != Explosion::EXPLODE_NONE) {
- _userDefinedExplosion = Explosion::EXPLODE_NONE;
- rocketTimer = 20.0f;
- }
- }
-
- _particles.insert(_particles.end(), pending.begin(), pending.end());
- pending.clear();
-
- numDead = 0;
- stdx::call_all_ptr(_particles, &Particle::update);
- std::sort(_particles.begin(), _particles.end(), ParticleSorter);
-
- std::vector<Particle*>::iterator afterAlive(_particles.end() - numDead);
- stdx::destroy_each_ptr(afterAlive, _particles.end());
- _particles.erase(afterAlive, _particles.end());
-
- std::vector<Particle*>::iterator begin1(_particles.begin());
- std::vector<Particle*>::iterator end1(_particles.end());
- std::list<_Illumination>::iterator begin2(_illuminationList.begin());
- std::list<_Illumination>::iterator end2(_illuminationList.end());
- std::list<_Influence>::iterator begin3(_suckList.begin());
- std::list<_Influence>::iterator end3(_suckList.end());
- std::list<_Influence>::iterator begin4(_shockList.begin());
- std::list<_Influence>::iterator end4(_shockList.end());
- std::list<_Influence>::iterator begin5(_stretchList.begin());
- std::list<_Influence>::iterator end5(_stretchList.end());
- for (std::vector<Particle*>::iterator it1 = begin1; it1 != end1; ++it1) {
- for (std::list<_Illumination>::iterator it2 = begin2; it2 != end2; ++it2)
- (*it1)->illuminate(it2->pos, it2->RGB,
- it2->brightness, it2->smokeDistanceSquared);
- for (std::list<_Influence>::iterator it3 = begin3; it3 != end3; ++it3)
- (*it1)->suck(it3->pos, it3->factor);
- for (std::list<_Influence>::iterator it4 = begin4; it4 != end4; ++it4)
- (*it1)->shock(it4->pos, it4->factor);
- for (std::list<_Influence>::iterator it5 = begin5; it5 != end5; ++it5)
- (*it1)->stretch(it5->pos, it5->factor);
- }
- _illuminationList.clear();
- _suckList.clear();
- _shockList.clear();
- _stretchList.clear();
- } else {
- stdx::call_all_ptr(_particles, &Particle::updateCameraOnly);
- std::sort(_particles.begin(), _particles.end(), ParticleSorter);
- }
- World::draw();
-
- glEnable(GL_BLEND);
- stdx::call_all_ptr(_particles, &Particle::draw);
-
- if (flares > 0.0f) {
- std::list<_Flare>::iterator begin(_flareList.begin());
- std::list<_Flare>::iterator end(_flareList.end());
- for (std::list<_Flare>::iterator it = begin; it != end; ++it)
- Flares::draw(it->x, it->y, it->RGB, it->alpha);
- begin = _superFlareList.begin();
- end = _superFlareList.end();
- for (std::list<_Flare>::iterator it = begin; it != end; ++it)
- Flares::drawSuper(it->x, it->y, it->RGB, it->alpha);
- }
- _flareList.clear();
- _superFlareList.clear();
-
- if (volume) Sound::update();
-
- Overlay::update();
- Overlay::draw();
-
- Common::flush();
-
- frameToggle = !frameToggle;
-}
-
-void Hack::stop() {
- stdx::destroy_all_ptr(pending);
- stdx::destroy_all_ptr(_particles);
-}
-
-void Hack::keyPress(char c, const KeySym&) {
- switch (c) {
- case 3: case 27:
- Common::running = false;
- break;
- case 'a': case 'A':
- _action = !_action;
- if (_action) {
- Common::speed = 1.0f;
- Overlay::set("Action continuing");
- } else {
- Common::speed = 0.0f;
- Overlay::set("Action paused");
- }
- break;
- case 'c': case 'C':
- _cameraMode = (_cameraMode == CAMERA_FIXED) ? CAMERA_AUTO : CAMERA_FIXED;
- if (_cameraMode == CAMERA_AUTO)
- Overlay::set("Automatic camera");
- else
- Overlay::set("Fixed camera");
- break;
- case 'm': case 'M':
- _cameraMode = (_cameraMode == CAMERA_MANUAL) ? CAMERA_AUTO : CAMERA_MANUAL;
- if (_cameraMode == CAMERA_AUTO) {
- Overlay::set("Automatic camera");
- _cameraEndPos = cameraPos;
- _cameraEndDir = _cameraMatInv;
- chainCamera();
- } else {
- Overlay::set("Mouse-controlled camera");
- _cameraSpeed = 100.0f;
- }
- break;
- case 'n': case 'N':
- Overlay::set("New camera");
- newCamera();
- break;
- case 's': case 'S':
- {
- static bool slowMotion = false;
- slowMotion = !slowMotion;
- if (slowMotion) {
- Common::speed = 0.125;
- Overlay::set("Slow-motion");
- } else {
- Common::speed = 1.0f;
- Overlay::set("Normal speed");
- }
- }
- break;
- case '1':
- _userDefinedExplosion = Explosion::EXPLODE_SPHERE;
- Overlay::set("Sphere of stars");
- break;
- case '2':
- _userDefinedExplosion = Explosion::EXPLODE_SPLIT_SPHERE;
- Overlay::set("Split sphere of stars");
- break;
- case '3':
- _userDefinedExplosion = Explosion::EXPLODE_MULTICOLORED_SPHERE;
- Overlay::set("Multicolored sphere of stars");
- break;
- case '4':
- _userDefinedExplosion = Explosion::EXPLODE_RING;
- Overlay::set("Ring of stars");
- break;
- case '5':
- _userDefinedExplosion = Explosion::EXPLODE_DOUBLE_SPHERE;
- Overlay::set("Double-sphere of stars");
- break;
- case '6':
- _userDefinedExplosion = Explosion::EXPLODE_SPHERE_INSIDE_RING;
- Overlay::set("Sphere of stars inside ring of stars");
- break;
- case '7':
- _userDefinedExplosion = Explosion::EXPLODE_STREAMERS;
- Overlay::set("Sphere of streamers");
- break;
- case '8':
- _userDefinedExplosion = Explosion::EXPLODE_METEORS;
- Overlay::set("Sphere of meteors");
- break;
- case '9':
- _userDefinedExplosion = Explosion::EXPLODE_STARS_INSIDE_STREAMERS;
- Overlay::set("Sphere of stars inside sphere of streamers");
- break;
- case '0':
- _userDefinedExplosion = Explosion::EXPLODE_STARS_INSIDE_METEORS;
- Overlay::set("Sphere of stars inside sphere of meteors");
- break;
- case 'q': case 'Q':
- _userDefinedExplosion = Explosion::EXPLODE_STREAMERS_INSIDE_STARS;
- Overlay::set("Sphere of streamers inside sphere of stars");
- break;
- case 'w': case 'W':
- _userDefinedExplosion = Explosion::EXPLODE_METEORS_INSIDE_STARS;
- Overlay::set("Sphere of meteors inside sphere of stars");
- break;
- case 'e': case 'E':
- _userDefinedExplosion = Explosion::EXPLODE_STAR_BOMBS;
- Overlay::set("Star bombs");
- break;
- case 'r': case 'R':
- _userDefinedExplosion = Explosion::EXPLODE_STREAMER_BOMBS;
- Overlay::set("Streamer bombs");
- break;
- case 't': case 'T':
- _userDefinedExplosion = Explosion::EXPLODE_METEOR_BOMBS;
- Overlay::set("Meteor bombs");
- break;
- case 'y': case 'Y':
- _userDefinedExplosion = Explosion::EXPLODE_CRACKER_BOMBS;
- Overlay::set("Cracker bombs");
- break;
- case 'u': case 'U':
- _userDefinedExplosion = Explosion::EXPLODE_BEES;
- Overlay::set("Bees");
- break;
- case 'i': case 'I':
- _userDefinedExplosion = Explosion::EXPLODE_FLASH;
- Overlay::set("Flash-bang");
- break;
- case 'o': case 'O':
- _userDefinedExplosion = Explosion::EXPLODE_SPINNER;
- Overlay::set("Spinner");
- break;
- case '{':
- _userDefinedExplosion = Explosion::EXPLODE_SUCKER;
- Overlay::set("Sucker and shockwave");
- break;
- case '}':
- _userDefinedExplosion = Explosion::EXPLODE_STRETCHER;
- Overlay::set("Stretcher and Big Mama");
- break;
- case '/':
- TRACE("Particles: " << _particles.size());
- break;
- }
-}
-
-void Hack::keyRelease(char, const KeySym&) {}
-
-void Hack::pointerMotion(int x, int y) {
- _mouseX = x;
- _mouseY = y;
- _mouseIdleTime = 0.0f;
-}
-
-void Hack::buttonPress(unsigned int button) {
- switch (button) {
- case Button1:
- _leftButton = true;
- break;
- case Button2:
- _middleButton = true;
- break;
- case Button3:
- _rightButton = true;
- break;
- }
- _mouseIdleTime = 0.0f;
-}
-
-void Hack::buttonRelease(unsigned int button) {
- switch (button) {
- case Button1:
- _leftButton = false;
- break;
- case Button2:
- _middleButton = false;
- break;
- case Button3:
- _rightButton = false;
- break;
- }
- _mouseIdleTime = 0.0f;
-}
-
-void Hack::pointerEnter() {
- _mouseInWindow = true;
- _mouseIdleTime = 0.0f;
-}
-
-void Hack::pointerLeave() {
- _mouseInWindow = false;
- _mouseIdleTime = 0.0f;
-}
-
-#define _LINUX
-#include "../../../addons/include/xbmc_scr_dll.h"
-
-extern "C" {
-
-ADDON_STATUS Create(void* hdl, void* props)
-{
- if (!props)
- return STATUS_UNKNOWN;
-
- SCR_PROPS* scrprops = (SCR_PROPS*)props;
-
- Common::width = scrprops->width;
- Common::height = scrprops->height;
- Common::aspectRatio = float(Common::width) / float(Common::height);
-
- return STATUS_OK;
-}
-
-void Start()
-{
- Hack::start();
-}
-
-void Render()
-{
- Hack::tick();
-}
-
-void Stop()
-{
- Hack::stop();
-}
-
-void Destroy()
-{
-}
-
-ADDON_STATUS GetStatus()
-{
- return STATUS_OK;
-}
-
-bool HasSettings()
-{
- return false;
-}
-
-unsigned int GetSettings(StructSetting ***sSet)
-{
- return 0;
-}
-
-ADDON_STATUS SetSetting(const char *settingName, const void *settingValue)
-{
- return STATUS_OK;
-}
-
-void Remove()
-{
-}
-
-void FreeSettings()
-{
-}
-
-void GetInfo(SCR_INFO *info)
-{
-}
-
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/skyrocket.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/skyrocket.hh
deleted file mode 100644
index 1b2e6a1aa3..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/skyrocket.hh
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _SKYROCKET_HH
-#define _SKYROCKET_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <hack.hh>
-#include <vector.hh>
-
-// User-supplied parameters
-namespace Hack {
- extern bool drawMoon;
- extern bool drawClouds;
- extern bool drawEarth;
- extern bool drawIllumination;
- extern bool drawSunset;
-
- extern unsigned int maxRockets;
-
- extern unsigned int starDensity;
- extern float moonGlow;
- extern float ambient;
- extern float flares;
-
- extern float smoke;
- extern unsigned int explosionSmoke;
-
- extern float wind;
-
- extern float volume;
- extern std::string openalSpec;
- extern float speedOfSound;
-};
-
-#include <particle.hh>
-#include <smoke.hh>
-#include <world.hh>
-
-// Public stuff
-namespace Hack {
- extern std::vector<Particle*> pending;
- extern unsigned int numDead;
- extern unsigned int numRockets;
-
- extern Vector cameraPos;
- extern Vector cameraVel;
- extern UnitQuat cameraDir;
- extern RotationMatrix cameraMat;
-
- extern bool frameToggle;
-
- inline void illuminate(
- const Vector&, const RGBColor&,
- float, float, float
- );
- inline void flare(const Vector&, const RGBColor&, float);
- inline void superFlare(const Vector&, const RGBColor&, float);
- inline void suck(const Vector&, float);
- inline void shock(const Vector&, float);
- inline void stretch(const Vector&, float);
-};
-
-// Private stuff
-namespace Hack {
- extern int _viewport[4];
- extern double _projectionMat[16];
- extern double _modelMat[16];
-
- struct _Illumination {
- Vector pos;
- RGBColor RGB;
- float brightness;
- float smokeDistanceSquared;
- };
- extern std::list<_Illumination> _illuminationList;
-
- struct _Flare {
- float x;
- float y;
- RGBColor RGB;
- float alpha;
- };
- extern std::list<_Flare> _flareList;
- extern std::list<_Flare> _superFlareList;
-
- struct _Influence {
- Vector pos;
- float factor;
- };
- extern std::list<_Influence> _suckList;
- extern std::list<_Influence> _shockList;
- extern std::list<_Influence> _stretchList;
-};
-
-inline void Hack::illuminate(
- const Vector& pos, const RGBColor& RGB,
- float brightness, float smokeDistanceSquared,
- float cloudDistanceSquared
-) {
- if (!drawIllumination)
- return;
-
- RGBColor newRGB(RGB * 0.6f + 0.4f);
-
- if (smokeDistanceSquared > 0.0f) {
- _Illumination ill = { pos, RGB, brightness, smokeDistanceSquared };
- _illuminationList.push_back(ill);
- }
-
- if (drawClouds && cloudDistanceSquared > 0.0f)
- World::illuminateClouds(
- pos, newRGB, brightness, cloudDistanceSquared
- );
-}
-
-inline void Hack::flare(
- const Vector& pos, const RGBColor& RGB, float brightness
-) {
- Vector diff(pos - cameraPos);
- UnitVector forwards(cameraDir.forward());
- if (Vector::dot(diff, forwards) <= 1.0f)
- return;
-
- double winX, winY, winZ;
- gluProject(
- pos.x(), pos.y(), pos.z(),
- _modelMat, _projectionMat, _viewport,
- &winX, &winY, &winZ
- );
-
- float attenuation = 1.0f - diff.length() * 0.0001f;
- if (attenuation < 0.0f)
- attenuation = 0.0f;
- _Flare flare = {
- winX * Common::aspectRatio / Common::width,
- winY / Common::height,
- RGB,
- brightness * flares * 0.01f * attenuation
- };
- _flareList.push_back(flare);
-}
-
-inline void Hack::superFlare(
- const Vector& pos, const RGBColor& RGB, float brightness
-) {
- Vector diff(pos - cameraPos);
- UnitVector forwards(cameraDir.forward());
- if (Vector::dot(diff, forwards) <= 1.0f)
- return;
-
- double winX, winY, winZ;
- gluProject(
- pos.x(), pos.y(), pos.z(),
- _modelMat, _projectionMat, _viewport,
- &winX, &winY, &winZ
- );
-
- float attenuation = 1.0f - diff.length() * 0.00005f;
- if (attenuation < 0.0f)
- attenuation = 0.0f;
- float temp = 1.0f - (brightness - 0.5f) * flares * 0.02f;
- _Flare flare = {
- winX * Common::aspectRatio / Common::width,
- winY / Common::height,
- RGB,
- (1.0f - temp * temp * temp * temp) * attenuation
- };
- _flareList.push_back(flare);
-}
-
-inline void Hack::suck(const Vector& pos, float factor) {
- _Influence suck = { pos, factor };
- _suckList.push_back(suck);
-}
-
-inline void Hack::shock(const Vector& pos, float factor) {
- _Influence shock = { pos, factor };
- _shockList.push_back(shock);
-}
-
-inline void Hack::stretch(const Vector& pos, float factor) {
- _Influence stretch = { pos, factor };
- _stretchList.push_back(stretch);
-}
-
-#endif // _SKYROCKET_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke.cc
deleted file mode 100644
index 2b89bac681..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <skyrocket.hh>
-#include <smoke.hh>
-#include <vector.hh>
-
-float Smoke::_times[] = { 0.4f, 0.8f, 0.4f, 2.0f, 0.4f, 0.8f, 0.4f, 4.0f };
-unsigned int Smoke::_timeIndex;
-
-void Smoke::update() {
- if (Hack::frameToggle != _frameToggle) {
- _addedRGB.set(0.0f, 0.0f, 0.0f);
- _frameToggle = Hack::frameToggle;
- }
-
- _remaining -= Common::elapsedTime;
- if (_remaining <= 0.0f || _pos.y() < 0.0f) {
- _depth = DEAD_DEPTH;
- ++Hack::numDead;
- return;
- }
-
- _pos += _vel * Common::elapsedTime;
- _pos.x() +=
- (0.1f - 0.00175f * _pos.y() + 0.0000011f * _pos.y() * _pos.y()) *
- Hack::wind * Common::elapsedTime;
-
- _brightness = _remaining / _lifetime * 0.7f;
- _size += (30.0f - _size) * (1.2f * Common::elapsedTime);
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Smoke::updateCameraOnly() {
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Smoke::draw() const {
- if (_depth < 0.0f)
- return;
-
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(_size, _size, _size);
- glMultMatrixf(Hack::cameraMat.get());
- glColor4f(
- _RGB.r() + _addedRGB.r(),
- _RGB.g() + _addedRGB.g(),
- _RGB.b() + _addedRGB.b(),
- _brightness
- );
- glCallList(_list);
- glPopMatrix();
-}
-
-void Smoke::illuminate(const Vector& pos, const RGBColor& RGB,
- float brightness, float smokeDistanceSquared) {
- if (Hack::frameToggle != _frameToggle) {
- _addedRGB.set(0.0f, 0.0f, 0.0f);
- _frameToggle = Hack::frameToggle;
- }
- float dSquared = (_pos - pos).lengthSquared();
- if (dSquared < smokeDistanceSquared) {
- float temp = (smokeDistanceSquared - dSquared) / smokeDistanceSquared;
- temp *= temp * brightness;
- _addedRGB += RGB * temp;
- }
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke.hh
deleted file mode 100644
index d20aac4f31..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke.hh
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _SMOKE_HH
-#define _SMOKE_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <particle.hh>
-#include <resources.hh>
-#include <skyrocket.hh>
-#include <vector.hh>
-
-class Smoke : public Particle {
-private:
- RGBColor _RGB;
- RGBColor _addedRGB;
- float _brightness;
- float _size;
- unsigned int _list;
- bool _frameToggle;
-
- static float _times[8];
- static unsigned int _timeIndex;
-public:
- static void init() {
- for (unsigned int i = 0; i < 7; ++i)
- if (_times[i] > Hack::smoke)
- _times[i] = Hack::smoke;
- _times[7] = Hack::smoke;
- }
-
- Smoke(const Vector& pos, const Vector& vel) :
- Particle(pos, vel, 2.0f, _times[_timeIndex]), _RGB(
- 0.01f * Hack::ambient,
- 0.01f * Hack::ambient,
- 0.01f * Hack::ambient
- ), _addedRGB(0.0f, 0.0f, 0.0f), _size(0.1f),
- _list(Resources::DisplayLists::smokes + Common::randomInt(5)),
- _frameToggle(false)
- {
- _timeIndex = (_timeIndex + 1) % 8;
- }
-
- void update();
- void updateCameraOnly();
- void draw() const;
-
- void illuminate(const Vector&, const RGBColor&, float, float);
-};
-
-#endif // _SMOKE_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke1.png b/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke1.png
deleted file mode 100644
index a816fc0e24..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke1.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke2.png b/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke2.png
deleted file mode 100644
index b2c2d3e938..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke2.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke3.png b/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke3.png
deleted file mode 100644
index 9e02b108aa..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke3.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke4.png b/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke4.png
deleted file mode 100644
index 65b0bcb60c..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke4.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke5.png b/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke5.png
deleted file mode 100644
index f87de6a254..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/smoke5.png
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/spinner.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/spinner.cc
deleted file mode 100644
index e541f6c9d0..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/spinner.cc
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <resources.hh>
-#include <skyrocket.hh>
-#include <spinner.hh>
-#include <star.hh>
-#include <vector.hh>
-
-void Spinner::update() {
- _remaining -= Common::elapsedTime;
-
- if (_remaining <= 0.0f || _pos.y() < 0.0f) {
- _depth = DEAD_DEPTH;
- ++Hack::numDead;
- return;
- }
-
- float life = _remaining / _lifetime;
- _brightness = life * life;
- float temp = _lifetime - _remaining;
- if (temp < 0.5f)
- _brightness *= temp * 2.0f;
-
- _vel.y() -= Common::elapsedTime * 32.0f;
- _pos += _vel * Common::elapsedTime;
- _pos.x() +=
- (0.1f - 0.00175f * _pos.y() + 0.0000011f * _pos.y() * _pos.y()) *
- Hack::wind * Common::elapsedTime;
-
- Vector crossVector(Vector::cross(Vector(1.0f, 0.0f, 0.0f), _spinAxis));
- crossVector.normalize();
- crossVector *= 400.0f;
-
- float dr = _radialVelocity * Common::elapsedTime;
- _starTimer += Common::elapsedTime * _brightness *
- (Common::randomFloat(10.0f) + 90.0f);
- unsigned int stars = (unsigned int)(_starTimer);
- _starTimer -= float(stars);
- for (unsigned int i = 0; i < stars; ++i) {
- Hack::pending.push_back(new Star(_pos, _vel - RotationMatrix(
- UnitQuat(
- _radialPosition + Common::randomFloat(dr),
- _spinAxis
- )
- ).transform(crossVector) + Vector(
- Common::randomFloat(20.0f) - 10.0f,
- Common::randomFloat(20.0f) - 10.0f,
- Common::randomFloat(20.0f) - 10.0f
- ), 0.612f, Common::randomFloat(0.5f) + 1.5f, _RGB, 15.0f));
- }
- _radialPosition += dr;
- if (_radialPosition > M_PI * 2)
- _radialPosition -= M_PI * 2;
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Spinner::updateCameraOnly() {
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Spinner::draw() const {
- if (_depth < 0.0f)
- return;
-
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(20.0f, 20.0f, 20.0f);
- glMultMatrixf(Hack::cameraMat.get());
- glColor4f(_RGB.r(), _RGB.g(), _RGB.b(), _brightness);
- glCallList(Resources::DisplayLists::flares);
- glPopMatrix();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/spinner.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/spinner.hh
deleted file mode 100644
index 4be017952b..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/spinner.hh
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _SPINNER_HH
-#define _SPINNER_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <particle.hh>
-#include <resources.hh>
-#include <skyrocket.hh>
-#include <vector.hh>
-
-class Spinner : public Particle {
-private:
- RGBColor _RGB;
- float _brightness;
-
- float _radialVelocity;
- float _radialPosition;
- UnitVector _spinAxis;
-
- float _starTimer;
-public:
- Spinner(const Vector& pos, const Vector& vel) :
- Particle(pos, vel, 0.612f, // terminal velocity = 20 ft/s
- Common::randomFloat(2.0f) + 6.0f
- ), _RGB(Particle::randomColor()), _brightness(0.0f),
- _radialVelocity(Common::randomFloat(3.0f) + 12.0f),
- _radialPosition(0.0f),
- _spinAxis(UnitVector::of(
- Vector(
- Common::randomFloat(2.0f) - 1.0f,
- Common::randomFloat(2.0f) - 1.0f,
- Common::randomFloat(2.0f) - 1.0f
- )
- )), _starTimer(0.0f)
- {
- if (Hack::volume > 0.0f) {
- if (Common::randomInt(2))
- Resources::Sounds::launch1->play(_pos);
- else
- Resources::Sounds::launch2->play(_pos);
- }
- }
-
- void update();
- void updateCameraOnly();
- void draw() const;
-};
-
-#endif // _SPINNER_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/star.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/star.cc
deleted file mode 100644
index e1600149ee..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/star.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <skyrocket.hh>
-#include <star.hh>
-#include <smoke.hh>
-#include <vector.hh>
-
-void Star::update() {
- _remaining -= Common::elapsedTime;
-
- if (_remaining <= 0.0f || _pos.y() <= 0.0f) {
- _depth = DEAD_DEPTH;
- ++Hack::numDead;
- return;
- }
-
- _vel.y() -= Common::elapsedTime * 32.0f;
- _pos += _vel * Common::elapsedTime;
- _pos.x() +=
- (0.1f - 0.00175f * _pos.y() + 0.0000011f * _pos.y() * _pos.y()) *
- Hack::wind * Common::elapsedTime;
-
- float temp = (_lifetime - _remaining) / _lifetime;
- _brightness = 1.0f - temp * temp * temp * temp;
-
- if (_smoker && Hack::smoke) {
- Vector step(_pos - _smokePos);
- float distance = step.normalize();
-
- if (distance > 2.0f) {
- unsigned int n = (unsigned int)(distance / 2.0f);
- step *= 2.0f;
- for (unsigned int i = 0; i < n; ++i) {
- Hack::pending.push_back(new Smoke(_smokePos,
- Vector(
- Common::randomFloat(20.0f) - 10.0f,
- Common::randomFloat(20.0f) - 10.0f,
- Common::randomFloat(20.0f) - 10.0f
- ))
- );
- _smokePos += step;
- }
- }
- }
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Star::updateCameraOnly() {
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Star::draw() const {
- if (_depth < 0.0f)
- return;
-
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(_size, _size, _size);
- glMultMatrixf(Hack::cameraMat.get());
- glColor4f(_RGB.r(), _RGB.g(), _RGB.b(), _brightness);
- glCallList(_list);
- glPopMatrix();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/star.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/star.hh
deleted file mode 100644
index 1ed98c5966..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/star.hh
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _STAR_HH
-#define _STAR_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <particle.hh>
-#include <resources.hh>
-#include <vector.hh>
-
-class Star : public Particle {
-private:
- RGBColor _RGB;
- float _size;
- float _brightness;
-
- bool _smoker;
- Vector _smokePos;
-
- unsigned int _list;
-public:
- Star(
- const Vector& pos, const Vector& vel, float drag, float lifetime,
- const RGBColor& RGB, float size, bool smoker = false,
- unsigned int list = Resources::DisplayLists::flares
- ) :
- Particle(pos, vel, drag, lifetime), _RGB(RGB), _size(size),
- _smoker(smoker), _smokePos(_pos), _list(list) {}
-
- void update();
- void updateCameraOnly();
- void draw() const;
-};
-
-#endif // _STAR_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/streamer.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/streamer.cc
deleted file mode 100644
index c56fe27f1c..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/streamer.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <resources.hh>
-#include <star.hh>
-#include <streamer.hh>
-#include <skyrocket.hh>
-#include <vector.hh>
-
-void Streamer::update() {
- _remaining -= Common::elapsedTime;
-
- if (_remaining <= 0.0f || _pos.y() <= 0.0f) {
- _depth = DEAD_DEPTH;
- ++Hack::numDead;
- return;
- }
-
- _vel.y() -= Common::elapsedTime * 32.0f;
- _pos += _vel * Common::elapsedTime;
- _pos.x() +=
- (0.1f - 0.00175f * _pos.y() + 0.0000011f * _pos.y() * _pos.y()) *
- Hack::wind * Common::elapsedTime;
-
- float temp = (_lifetime - _remaining) / _lifetime;
- _brightness = 1.0f - temp * temp * temp * temp;
-
- Vector step(_pos - _sparkPos);
- float distance = step.normalize();
-
- if (distance > 25.0f) {
- unsigned int n = (unsigned int)(distance / 25.0f);
- step *= 25.0f;
- for (unsigned int i = 0; i < n; ++i) {
- Hack::pending.push_back(new Star(_sparkPos,
- _vel + Vector(
- Common::randomFloat(80.0f) - 40.0f,
- Common::randomFloat(80.0f) - 40.0f,
- Common::randomFloat(80.0f) - 40.0f
- ), 2.5f, Common::randomFloat(2.0f) + 1.0f, RGBColor(1.0f, 0.8f, 0.6f),
- Common::randomFloat(8.0f) + 4.0f
- ));
- _sparkPos += step;
- }
- }
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Streamer::updateCameraOnly() {
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Streamer::draw() const {
- if (_depth < 0.0f)
- return;
-
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(_size, _size, _size);
- glMultMatrixf(Hack::cameraMat.get());
- glColor4f(_RGB.r(), _RGB.g(), _RGB.b(), _brightness);
- glCallList(Resources::DisplayLists::flares);
- glPopMatrix();
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/streamer.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/streamer.hh
deleted file mode 100644
index 5630afac1e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/streamer.hh
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _STREAMER_HH
-#define _STREAMER_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <particle.hh>
-#include <vector.hh>
-
-class Streamer : public Particle {
-private:
- RGBColor _RGB;
- float _size;
- float _brightness;
-
- Vector _sparkPos;
-public:
- Streamer(
- const Vector& pos, const Vector& vel, float drag, float lifetime,
- const RGBColor& RGB, float size
- ) : Particle(pos, vel, drag, lifetime), _RGB(RGB), _size(size),
- _sparkPos(_pos) {}
-
- void update();
- void updateCameraOnly();
- void draw() const;
-};
-
-#endif // _STREAMER_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/stretcher.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/stretcher.cc
deleted file mode 100644
index b7e4aac8e9..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/stretcher.cc
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <bigmama.hh>
-#include <color.hh>
-#include <explosion.hh>
-#include <resources.hh>
-#include <skyrocket.hh>
-#include <star.hh>
-#include <stretcher.hh>
-#include <vector.hh>
-
-Stretcher::Stretcher(const Vector& pos, const Vector& vel) :
- Particle(pos, vel, 0.612f, 4.0f) {
- RGBColor RGB(Particle::randomColor());
-
- for (unsigned int i = 0; i < 80; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- 0.0f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- velocity.x() *= 400.0f + Common::randomFloat(30.0f);
- velocity.y() += Common::randomFloat(70.0f) - 35.0f;
- velocity.z() *= 400.0f + Common::randomFloat(30.0f);
- velocity += _vel;
-
- Hack::pending.push_back(new Star(_pos, velocity, 0.612f,
- Common::randomFloat(2.0f) + 2.0f, RGB, 30.0f));
- }
-
- RGB = Particle::randomColor();
-
- for (unsigned int i = 0; i < 80; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- 0.0f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- velocity.x() *= 700.0f + Common::randomFloat(50.0f);
- velocity.y() += Common::randomFloat(70.0f) - 35.0f;
- velocity.z() *= 700.0f + Common::randomFloat(50.0f);
- velocity += _vel;
-
- Hack::pending.push_back(new Star(_pos, velocity, 0.612f,
- Common::randomFloat(2.0f) + 2.0f, RGB, 30.0f));
- }
-
- RGB = Particle::randomColor();
-
- for (unsigned int i = 0; i < 80; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- 0.0f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- velocity.x() *= 550.0f + Common::randomFloat(40.0f);
- velocity.y() += Common::randomFloat(70.0f) - 35.0f;
- velocity.z() *= 550.0f + Common::randomFloat(40.0f);
- velocity += _vel;
-
- Hack::pending.push_back(new Star(_pos, velocity, 0.612f,
- Common::randomFloat(2.0f) + 2.0f, RGB, 30.0f));
- }
-
- if (Hack::volume > 0.0f)
- Resources::Sounds::suck->play(_pos);
-}
-
-void Stretcher::update() {
- _remaining -= Common::elapsedTime;
-
- if (_remaining <= 0.0f || _pos.y() <= 0.0f) {
- Hack::pending.push_back(new BigMama(_pos, _vel));
- Hack::pending.push_back(new Explosion(_pos, _vel,
- Explosion::EXPLODE_BIGMAMA, RGBColor(1.0f, 1.0f, 1.0f), 2.5f));
- _depth = DEAD_DEPTH;
- ++Hack::numDead;
- return;
- }
-
- _vel.y() -= Common::elapsedTime * 32.0f;
- _pos += _vel * Common::elapsedTime;
- _pos.x() +=
- (0.1f - 0.00175f * _pos.y() + 0.0000011f * _pos.y() * _pos.y()) *
- Hack::wind * Common::elapsedTime;
-
- float life = _remaining / _lifetime;
- _brightness = 1.0f - ((1.0f - life) * (1.0f - life));
- _size = 400.0f * _brightness;
-
- Hack::stretch(_pos, (1.0f - life) * 0.002f * Common::elapsedTime);
- Hack::superFlare(_pos, RGBColor(1.0f, 1.0f, 1.0f), _brightness);
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Stretcher::updateCameraOnly() {
- Hack::superFlare(_pos, RGBColor(1.0f, 1.0f, 1.0f), _brightness);
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Stretcher::draw() const {
- if (_depth < 0.0f)
- return;
-
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(_size, _size, _size);
- glMultMatrixf(Hack::cameraMat.get());
- glColor4f(1.0f, 1.0f, 1.0f, _brightness);
- glCallList(Resources::DisplayLists::flares + 3);
- glPopMatrix();
-}
-
-void Stretcher::stretch(const Vector&, float) {
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/stretcher.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/stretcher.hh
deleted file mode 100644
index bb53e04f07..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/stretcher.hh
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _STRETCHER_HH
-#define _STRETCHER_HH
-
-#include <common.hh>
-
-#include <particle.hh>
-#include <vector.hh>
-
-class Stretcher : public Particle {
-private:
- float _size;
- float _brightness;
-public:
- Stretcher(const Vector&, const Vector&);
-
- void update();
- void updateCameraOnly();
- void draw() const;
- void stretch(const Vector&, float);
-};
-
-#endif // _STRETCHER_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/suck.ogg b/xbmc/screensavers/rsxs-0.9/src/skyrocket/suck.ogg
deleted file mode 100644
index 2fde3d8cb3..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/suck.ogg
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/sucker.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/sucker.cc
deleted file mode 100644
index 4e5b9d61e2..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/sucker.cc
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <explosion.hh>
-#include <resources.hh>
-#include <shockwave.hh>
-#include <skyrocket.hh>
-#include <star.hh>
-#include <sucker.hh>
-#include <vector.hh>
-
-Sucker::Sucker(const Vector& pos, const Vector& vel) :
- Particle(pos, vel, 0.612f, 4.0f) {
- RGBColor RGB(Particle::randomColor());
- float heading = Common::randomFloat(M_PI);
- float pitch = Common::randomFloat(M_PI);
- float ch = std::cos(heading);
- float sh = std::sin(heading);
- float cp = std::cos(pitch);
- float sp = std::sin(pitch);
-
- for (unsigned int i = 0; i < 90; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- 0.0f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- float rx = velocity.x();
- float rz = velocity.z();
- float ry = sp * rz;
- rz = cp * rz;
- float temp = rx;
- rx = ch * temp + sh * ry;
- ry = -sh * temp + ch * ry;
- rx *= 350.0f + Common::randomFloat(30.0f);
- ry *= 350.0f + Common::randomFloat(30.0f);
- rz *= 350.0f + Common::randomFloat(30.0f);
-
- velocity = Vector(rx, ry, rz) + _vel;
-
- Hack::pending.push_back(new Star(_pos, velocity, 0.612f,
- Common::randomFloat(2.0f) + 2.0f, RGB, 30.0f));
- }
-
- RGB = Particle::randomColor();
- heading = Common::randomFloat(M_PI);
- pitch = Common::randomFloat(M_PI);
- ch = std::cos(heading);
- sh = std::sin(heading);
- cp = std::cos(pitch);
- sp = std::sin(pitch);
-
- for (unsigned int i = 0; i < 90; ++i) {
- Vector velocity(
- Common::randomFloat(1.0f) - 0.5f,
- 0.0f,
- Common::randomFloat(1.0f) - 0.5f
- );
- velocity.normalize();
- float rx = velocity.x();
- float rz = velocity.z();
- float ry = sp * rz;
- rz = cp * rz;
- float temp = rx;
- rx = ch * temp + sh * ry;
- ry = -sh * temp + ch * ry;
- rx *= 600.0f + Common::randomFloat(50.0f);
- ry *= 600.0f + Common::randomFloat(50.0f);
- rz *= 600.0f + Common::randomFloat(50.0f);
-
- Hack::pending.push_back(new Star(_pos, velocity, 0.612f,
- Common::randomFloat(2.0f) + 2.0f, RGB, 30.0f));
- }
-
- if (Hack::volume > 0.0f)
- Resources::Sounds::suck->play(_pos);
-}
-
-void Sucker::update() {
- _remaining -= Common::elapsedTime;
-
- if (_remaining <= 0.0f || _pos.y() <= 0.0f) {
- Hack::pending.push_back(new Shockwave(_pos, _vel));
- Hack::pending.push_back(new Explosion(_pos, _vel,
- Explosion::EXPLODE_SHOCKWAVE, RGBColor(1.0f, 1.0f, 1.0f), 3.0f));
- _depth = DEAD_DEPTH;
- ++Hack::numDead;
- return;
- }
-
- _vel.y() -= Common::elapsedTime * 32.0f;
- _pos += _vel * Common::elapsedTime;
- _pos.x() +=
- (0.1f - 0.00175f * _pos.y() + 0.0000011f * _pos.y() * _pos.y()) *
- Hack::wind * Common::elapsedTime;
-
- _brightness = _remaining / _lifetime;
- _size = 250.0f * _brightness;
-
- Hack::suck(_pos, (1.0f - _brightness) * 0.01f * Common::elapsedTime);
- Hack::superFlare(_pos, RGBColor(1.0f, 1.0f, 1.0f), _brightness);
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Sucker::updateCameraOnly() {
- Hack::superFlare(_pos, RGBColor(1.0f, 1.0f, 1.0f), _brightness);
-
- Vector diff(Hack::cameraPos - _pos);
- _depth = diff.x() * Hack::cameraMat.get(8) +
- diff.y() * Hack::cameraMat.get(9) +
- diff.z() * Hack::cameraMat.get(10);
-}
-
-void Sucker::draw() const {
- if (_depth < 0.0f)
- return;
-
- glPushMatrix();
- glTranslatef(_pos.x(), _pos.y(), _pos.z());
- glScalef(_size, _size, _size);
- glMultMatrixf(Hack::cameraMat.get());
- glColor4f(1.0f, 1.0f, 1.0f, _brightness);
- glCallList(Resources::DisplayLists::flares + 2);
- glPopMatrix();
-}
-
-void Sucker::suck(const Vector&, float) {
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/sucker.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/sucker.hh
deleted file mode 100644
index bbe04a9920..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/sucker.hh
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _SUCKER_HH
-#define _SUCKER_HH
-
-#include <common.hh>
-
-#include <particle.hh>
-#include <vector.hh>
-
-class Sucker : public Particle {
-private:
- float _size;
- float _brightness;
-public:
- Sucker(const Vector&, const Vector&);
-
- void update();
- void updateCameraOnly();
- void draw() const;
- void suck(const Vector&, float);
-};
-
-#endif // _SUCKER_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/whistle.ogg b/xbmc/screensavers/rsxs-0.9/src/skyrocket/whistle.ogg
deleted file mode 100644
index 876cc60461..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/whistle.ogg
+++ /dev/null
Binary files differ
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/world.cc b/xbmc/screensavers/rsxs-0.9/src/skyrocket/world.cc
deleted file mode 100644
index 866305bd0e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/world.cc
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <skyrocket.hh>
-#include <resources.hh>
-#include <vector.hh>
-#include <world.hh>
-
-namespace World {
- Vector _cloudPos[CLOUDMESH + 1][CLOUDMESH + 1];
- float _cloudCoord[CLOUDMESH + 1][CLOUDMESH + 1][2];
- float _cloudBrightness[CLOUDMESH + 1][CLOUDMESH + 1];
- RGBColor _cloudColor[CLOUDMESH + 1][CLOUDMESH + 1];
-};
-
-void World::init() {
- if (Hack::drawClouds) {
- for (unsigned int j = 0; j <= CLOUDMESH; ++j) {
- for (unsigned int i = 0; i <= CLOUDMESH; ++i) {
- _cloudPos[i][j].x() = 40000.0f * float(i) / float(CLOUDMESH) - 20000.0f;
- _cloudPos[i][j].z() = 40000.0f * float(j) / float(CLOUDMESH) - 20000.0f;
- float x = std::abs(2 * float(i) / float(CLOUDMESH) - 1);
- float z = std::abs(2 * float(j) / float(CLOUDMESH) - 1);
- _cloudPos[i][j].y() = 2000.0f - 1000.0f * float(x * x + z * z);
- _cloudCoord[i][j][0] = -float(i) / float(CLOUDMESH / 6);
- _cloudCoord[i][j][1] = -float(j) / float(CLOUDMESH / 6);
- _cloudBrightness[i][j] = (_cloudPos[i][j].y() - 1000.0f) *
- 0.00001f * Hack::ambient;
- if (_cloudBrightness[i][j] < 0.0f)
- _cloudBrightness[i][j] = 0.0f;
- }
- }
- }
-}
-
-void World::update() {
- if (Hack::drawClouds) {
- // Blow clouds (particles should get the same drift at 2000 feet)
- // Maximum wind is 100 and texture repeats every 6666.67 feet
- // so 100 * 0.00015 * 6666.67 = 100 ft/sec maximum windspeed.
- static float cloudShift = 0.0f;
- cloudShift += 0.00015f * Hack::wind * Common::elapsedTime;
- if (cloudShift > 1.0f)
- cloudShift -= 1.0f;
- for (unsigned int j = 0; j <= CLOUDMESH; ++j) {
- for (unsigned int i = 0; i <= CLOUDMESH; ++i) {
- _cloudColor[i][j].set(
- _cloudBrightness[i][j],
- _cloudBrightness[i][j],
- _cloudBrightness[i][j]
- ); // darken clouds
- _cloudCoord[i][j][0] = -float(i) * 1.0f / float(CLOUDMESH / 6) + cloudShift;
- }
- }
- }
-}
-
-void World::draw() {
- static float moonRotation = Common::randomFloat(360.0f);
- static float moonHeight = Common::randomFloat(40.0f) + 20.0f;
-
- glMatrixMode(GL_MODELVIEW);
-
- if (Hack::starDensity > 0) {
- glPushAttrib(GL_COLOR_BUFFER_BIT);
- glDisable(GL_BLEND);
- glCallList(Resources::DisplayLists::stars);
- glPopAttrib();
- }
-
- if (Hack::drawMoon) {
- glPushMatrix();
- glRotatef(moonRotation, 0, 1, 0);
- glRotatef(moonHeight, 1, 0, 0);
- glTranslatef(0.0f, 0.0f, -20000.0f);
- glCallList(Resources::DisplayLists::moon);
- glPopMatrix();
- }
-
- if (Hack::drawClouds) {
- glPushMatrix();
- glBindTexture(GL_TEXTURE_2D, Resources::Textures::cloud);
- glTranslatef(0.0f, 0.0f, 0.0f);
- for (unsigned int j = 0; j < CLOUDMESH; ++j) {
- glBegin(GL_TRIANGLE_STRIP);
- for (unsigned int i = 0; i <= CLOUDMESH; ++i) {
- glColor3fv(_cloudColor[i][j + 1].get());
- glTexCoord2fv(_cloudCoord[i][j + 1]);
- glVertex3fv(_cloudPos[i][j + 1].get());
- glColor3fv(_cloudColor[i][j].get());
- glTexCoord2fv(_cloudCoord[i][j]);
- glVertex3fv(_cloudPos[i][j].get());
- }
- glEnd();
- }
- glPopMatrix();
- }
-
- if (Hack::drawSunset) {
- glPushAttrib(GL_COLOR_BUFFER_BIT);
- glBlendFunc(GL_ONE, GL_ONE);
- glCallList(Resources::DisplayLists::sunset);
- glPopAttrib();
- }
-
- if (Hack::drawMoon && Hack::moonGlow > 0.0f) {
- glPushAttrib(GL_COLOR_BUFFER_BIT);
- glPushMatrix();
- float glow = Hack::moonGlow * 0.005f; // half of max possible value
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
- glRotatef(moonRotation, 0, 1, 0);
- glRotatef(moonHeight, 1, 0, 0);
- glTranslatef(0.0f, 0.0f, -20000.0f);
- glColor4f(1.0f, 1.0f, 1.0f, glow);
- glCallList(Resources::DisplayLists::moonGlow);
- glScalef(6000.0f, 6000.0f, 6000.0f);
- glColor4f(1.0f, 1.0f, 1.0f, glow * 0.7f);
- glCallList(Resources::DisplayLists::flares);
- glPopMatrix();
- glPopAttrib();
- }
-
- if (Hack::drawEarth) {
- glPushAttrib(GL_COLOR_BUFFER_BIT);
- glPushMatrix();
- glDisable(GL_BLEND);
- glBindTexture(GL_TEXTURE_2D, Resources::Textures::earthNear);
- glCallList(Resources::DisplayLists::earthNear);
- glBindTexture(GL_TEXTURE_2D, Resources::Textures::earthFar);
- glCallList(Resources::DisplayLists::earthFar);
- if (Hack::ambient <= 30.0f) {
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE);
- glBindTexture(GL_TEXTURE_2D, Resources::Textures::earthLight);
- glCallList(Resources::DisplayLists::earthLight);
- }
- glPopMatrix();
- glPopAttrib();
- }
-}
-
-void World::illuminateClouds(
- const Vector& pos, const RGBColor& newRGB,
- float brightness, float cloudDistanceSquared
-) {
- float cloudDistance = std::sqrt(cloudDistanceSquared);
-
- unsigned int south =
- (unsigned int)(
- (pos.z() - cloudDistance) * 0.00005f *
- float(CLOUDMESH / 2) + CLOUDMESH / 2
- );
- unsigned int north =
- (unsigned int)(
- (pos.z() + cloudDistance) * 0.00005f *
- float(CLOUDMESH / 2) + 0.5f + CLOUDMESH / 2
- );
- unsigned int west =
- (unsigned int)(
- (pos.x() - cloudDistance) * 0.00005f *
- float(CLOUDMESH / 2) + CLOUDMESH / 2
- );
- unsigned int east =
- (unsigned int)(
- (pos.x() + cloudDistance) * 0.00005f *
- float(CLOUDMESH / 2) + 0.5f + CLOUDMESH / 2
- );
- for (unsigned int i = west; i <= east; ++i) {
- for (unsigned int j = south; j <= north; ++j) {
- float dSquared = (_cloudPos[i][j] - pos).lengthSquared();
- if (dSquared < cloudDistanceSquared) {
- float temp = (cloudDistanceSquared - dSquared) / cloudDistanceSquared;
- temp *= temp * brightness;
- _cloudColor[i][j] += newRGB * temp;
- _cloudColor[i][j].clamp();
- }
- }
- }
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/skyrocket/world.hh b/xbmc/screensavers/rsxs-0.9/src/skyrocket/world.hh
deleted file mode 100644
index eeeefe9887..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/skyrocket/world.hh
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _WORLD_HH
-#define _WORLD_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <vector.hh>
-
-namespace World {
- void init();
-
- void update();
- void draw();
-
- void illuminateClouds(const Vector&, const RGBColor&, float, float);
-};
-
-#endif // _WORLD_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/solarwinds/Makefile.am b/xbmc/screensavers/rsxs-0.9/src/solarwinds/Makefile.am
deleted file mode 100644
index 689a67b7d1..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/solarwinds/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-include $(srcdir)/../Makefile.common
-
-rs_solarwinds_SOURCES = $(COMMON) $(COLOR) $(VECTOR) solarwinds.cc \
- solarwinds.hh wind.cc wind.hh
-rs_solarwinds_LDADD = $(LIBMISC) $(X_LIBS) $(OPENGL_LIBS)
-
-hack_PROGRAMS = rs-solarwinds
diff --git a/xbmc/screensavers/rsxs-0.9/src/solarwinds/Makefile.xbmc b/xbmc/screensavers/rsxs-0.9/src/solarwinds/Makefile.xbmc
deleted file mode 100644
index 18e2d7f484..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/solarwinds/Makefile.xbmc
+++ /dev/null
@@ -1,4 +0,0 @@
-plasma.xbs: solarwinds.o wind.o
- g++ -shared -o SolarWinds.xbs ../common.o solarwinds.o wind.o ../../lib/libmisc.a -lXmu
-# cp SolarWinds.xbs /home/yuvalt/XBMC/screensavers/
- cp SolarWinds.xbs ../../../../../XBMC/screensavers/
diff --git a/xbmc/screensavers/rsxs-0.9/src/solarwinds/solarwinds.cc b/xbmc/screensavers/rsxs-0.9/src/solarwinds/solarwinds.cc
deleted file mode 100644
index 323bb7efa4..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/solarwinds/solarwinds.cc
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <color.hh>
-#include <hack.hh>
-#include <solarwinds.hh>
-#include <vector.hh>
-#include <wind.hh>
-
-namespace Hack {
- unsigned int numWinds = 1;
- unsigned int numEmitters = 30;
- unsigned int numParticles = 2000;
- GeometryType geometry = LIGHTS_GEOMETRY;
- float size = 50.0f;
- float windSpeed = 20.0f;
- float emitterSpeed = 15.0f;
- float particleSpeed = 10.0f;
- float blur = 40.0f;
-};
-
-namespace Hack {
- enum Arguments {
- ARG_WINDS = 1,
- ARG_PARTICLES,
- ARG_EMITTERS,
- ARG_SIZE,
- ARG_SPEED,
- ARG_EMITTERSPEED,
- ARG_WINDSPEED,
- ARG_BLUR,
- ARG_LIGHTS_GEOMETRY = 0x100, ARG_POINTS_GEOMETRY, ARG_LINES_GEOMETRY
- };
-
- std::vector<Wind> _winds;
-
- error_t parse(int, char*, struct argp_state*);
-};
-
-error_t Hack::parse(int key, char* arg, struct argp_state* state) {
- switch (key) {
- case ARG_WINDS:
- if (Common::parseArg(arg, numWinds, 1u, 10u))
- argp_failure(state, EXIT_FAILURE, 0,
- "number of solar winds must be between 1 and 10");
- return 0;
- case ARG_PARTICLES:
- if (Common::parseArg(arg, numParticles, 1u, 10000u))
- argp_failure(state, EXIT_FAILURE, 0,
- "particles per wind must be between 1 and 10000");
- return 0;
- case ARG_EMITTERS:
- if (Common::parseArg(arg, numEmitters, 1u, 1000u))
- argp_failure(state, EXIT_FAILURE, 0,
- "emitters per wind must be between 1 and 1000");
- return 0;
- case ARG_SIZE:
- if (Common::parseArg(arg, size, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "particle size must be between 1 and 100");
- return 0;
- case ARG_SPEED:
- if (Common::parseArg(arg, particleSpeed, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "particle speed must be between 1 and 100");
- return 0;
- case ARG_EMITTERSPEED:
- if (Common::parseArg(arg, emitterSpeed, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "emitter speed must be between 1 and 100");
- return 0;
- case ARG_WINDSPEED:
- if (Common::parseArg(arg, windSpeed, 1.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "wind speed must be between 1 and 100");
- return 0;
- case ARG_BLUR:
- if (Common::parseArg(arg, blur, 0.0f, 100.0f))
- argp_failure(state, EXIT_FAILURE, 0,
- "motion blur must be between 1 and 100");
- return 0;
- case ARG_LIGHTS_GEOMETRY:
- geometry = LIGHTS_GEOMETRY;
- return 0;
- case ARG_POINTS_GEOMETRY:
- geometry = POINTS_GEOMETRY;
- return 0;
- case ARG_LINES_GEOMETRY:
- geometry = LINES_GEOMETRY;
- return 0;
- default:
- return ARGP_ERR_UNKNOWN;
- }
-}
-
-const struct argp* Hack::getParser() {
- static struct argp_option options[] = {
- { NULL, 0, NULL, 0, "Wind options:" },
- { "winds", ARG_WINDS, "NUM", 0, "Number of solar winds (1-10, default = 1)" },
- { "particles", ARG_PARTICLES, "NUM", 0,
- "Particles per wind (1-10000, default = 2000)" },
- { "emitters", ARG_EMITTERS, "NUM", 0,
- "Emitters per wind (1-1000, default = 30)" },
- { "windspeed", ARG_WINDSPEED, "NUM", 0, "Wind speed (1-100, default = 20)" },
- { NULL, 0, NULL, 0, "Particle options:" },
- { "size", ARG_SIZE, "NUM", 0, "Particle size (1-100, default = 50)" },
- { "lights", ARG_LIGHTS_GEOMETRY, NULL, 0,
- "Particle geometry (default = lights)" },
- { "points", ARG_POINTS_GEOMETRY, NULL, OPTION_ALIAS },
- { "lines", ARG_LINES_GEOMETRY, NULL, OPTION_ALIAS },
- { "speed", ARG_SPEED, "NUM", 0, "Particle speed (1-100, default = 10)" },
- { NULL, 0, NULL, 0, "Emitter options:" },
- { "emitterspeed", ARG_EMITTERSPEED, "NUM", 0,
- "Emitter speed (1-100, default = 15)" },
- { NULL, 0, NULL, 0, "Other options:" },
- { "blur", ARG_BLUR, "NUM", 0, "Motion blur (0-100, default = 40)" },
- {}
- };
- static struct argp parser = {
- options, parse, NULL, "Another color and movement particle effect."
- };
- return &parser;
-}
-
-std::string Hack::getShortName() { return "solarwinds"; }
-std::string Hack::getName() { return "Solar Winds"; }
-
-void Hack::start() {
-/*
- glViewport(0, 0, Common::width, Common::height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(90.0, Common::aspectRatio, 1.0, 10000);
- glTranslatef(0.0, 0.0, -15.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-*/
-
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT);
-
- if (geometry == LIGHTS_GEOMETRY)
- glBlendFunc(GL_ONE, GL_ONE);
- else
- // Necessary for point and line smoothing (I don't know why)
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
- glEnable(GL_BLEND);
- Wind::init();
-
- // Initialize surfaces
- _winds.resize(numWinds);
-
- // Clear the GL error
- glGetError();
-}
-
-void Hack::reshape() {
- glViewport(0, 0, Common::width, Common::height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(90.0, Common::aspectRatio, 1.0, 10000);
- glTranslatef(0.0, 0.0, -15.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-}
-
-void Hack::tick() {
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- gluPerspective(90.0, Common::aspectRatio, 1.0, 10000);
- glTranslatef(0.0, 0.0, -15.0);
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
-
- glEnable(GL_TEXTURE_2D);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- if (!blur) {
- glClear(GL_COLOR_BUFFER_BIT);
- } else {
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glColor4f(0.0f, 0.0f, 0.0f, 0.5f - (blur * 0.0049f));
- glBegin(GL_QUADS);
- glVertex3f(-40.0f, -17.0f, 0.0f);
- glVertex3f(40.0f, -17.0f, 0.0f);
- glVertex3f(40.0f, 17.0f, 0.0f);
- glVertex3f(-40.0f, 17.0f, 0.0f);
- glEnd();
- if (geometry == LIGHTS_GEOMETRY)
- glBlendFunc(GL_ONE, GL_ONE);
- else
- // Necessary for point and line smoothing (I don't know why)
- // Maybe it's just my video card...
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
- }
-
- // Update surfaces
- stdx::call_all(_winds, &Wind::update);
-
- // Common::flush();
-
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
-
- // Clear the GL error
- glGetError();
-}
-
-void Hack::stop() {}
-
-void Hack::keyPress(char c, const KeySym&) {
- switch (c) {
- case 3: case 27:
- case 'q': case 'Q':
- Common::running = false;
- break;
- }
-}
-
-void Hack::keyRelease(char, const KeySym&) {}
-void Hack::pointerMotion(int, int) {}
-void Hack::buttonPress(unsigned int) {}
-void Hack::buttonRelease(unsigned int) {}
-void Hack::pointerEnter() {}
-void Hack::pointerLeave() {}
-
-#define _LINUX
-#include "../../../addons/include/xbmc_scr_dll.h"
-
-extern "C" {
-
-ADDON_STATUS ADDON_Create(void* hdl, void* props)
-{
- if (!props)
- return ADDON_STATUS_UNKNOWN;
-
- SCR_PROPS* scrprops = (SCR_PROPS*)props;
-
- Common::width = scrprops->width;
- Common::height = scrprops->height;
- Common::aspectRatio = float(Common::width) / float(Common::height);
- Common::resources = new ResourceManager;
-
- return ADDON_STATUS_OK;
-}
-
-void Start()
-{
- Hack::start();
-}
-
-void Render()
-{
- Hack::tick();
-}
-
-void ADDON_Stop()
-{
- Hack::stop();
-}
-
-void ADDON_Destroy()
-{
- delete Common::resources;
-}
-
-ADDON_STATUS ADDON_GetStatus()
-{
- return ADDON_STATUS_OK;
-}
-
-bool ADDON_HasSettings()
-{
- return false;
-}
-
-unsigned int ADDON_GetSettings(ADDON_StructSetting ***sSet)
-{
- return 0;
-}
-
-ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue)
-{
- return ADDON_STATUS_OK;
-}
-
-void ADDON_FreeSettings()
-{
-}
-
-void ADDON_Announce(const char *flag, const char *sender, const char *message, const void *data)
-{
-}
-
-void GetInfo(SCR_INFO *info)
-{
-}
-
-void Remove()
-{
-}
-
-}
-
diff --git a/xbmc/screensavers/rsxs-0.9/src/solarwinds/solarwinds.hh b/xbmc/screensavers/rsxs-0.9/src/solarwinds/solarwinds.hh
deleted file mode 100644
index 24996719e5..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/solarwinds/solarwinds.hh
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _SOLARWINDS_HH
-#define _SOLARWINDS_HH
-
-#include <common.hh>
-
-namespace Hack {
- enum GeometryType {
- LIGHTS_GEOMETRY,
- POINTS_GEOMETRY,
- LINES_GEOMETRY
- };
-
- extern unsigned int numWinds;
- extern unsigned int numEmitters;
- extern unsigned int numParticles;
- extern GeometryType geometry;
- extern float size;
- extern float windSpeed;
- extern float emitterSpeed;
- extern float particleSpeed;
- extern float blur;
-};
-
-#endif // _SOLARWINDS_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/solarwinds/wind.cc b/xbmc/screensavers/rsxs-0.9/src/solarwinds/wind.cc
deleted file mode 100644
index a7e15fc949..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/solarwinds/wind.cc
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#include <climits>
-#include <solarwinds.hh>
-#include <resource.hh>
-#include <wind.hh>
-
-#define LIGHTSIZE 64
-
-GLuint Wind::_list;
-GLuint Wind::_texture;
-
-void Wind::init() {
- switch (Hack::geometry) {
- case Hack::LIGHTS_GEOMETRY:
- {
- GLubyte light[LIGHTSIZE][LIGHTSIZE];
- for (int i = 0; i < LIGHTSIZE; ++i) {
- for(int j = 0; j < LIGHTSIZE; ++j) {
- float x = float(i - LIGHTSIZE / 2) / float(LIGHTSIZE / 2);
- float y = float(j - LIGHTSIZE / 2) / float(LIGHTSIZE / 2);
- float temp = Common::clamp(
- 1.0f - float(std::sqrt((x * x) + (y * y))),
- 0.0f, 1.0f
- );
- light[i][j] = GLubyte(255.0f * temp);
- }
- }
- _texture = Common::resources->genTexture(
- GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT,
- 1, LIGHTSIZE, LIGHTSIZE, GL_LUMINANCE, GL_UNSIGNED_BYTE, light,
- false
- );
- glEnable(GL_TEXTURE_2D);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- float temp = 0.02f * Hack::size;
- _list = Common::resources->genLists(1);
- glNewList(_list, GL_COMPILE);
- glBindTexture(GL_TEXTURE_2D, _texture);
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-temp, -temp, 0.0f);
- glTexCoord2f(1.0f, 0.0f);
- glVertex3f(temp, -temp, 0.0f);
- glTexCoord2f(0.0f, 1.0f);
- glVertex3f(-temp, temp, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(temp, temp, 0.0f);
- glEnd();
- glEndList();
- }
- break;
- case Hack::POINTS_GEOMETRY:
- glEnable(GL_POINT_SMOOTH);
- glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
- break;
- case Hack::LINES_GEOMETRY:
- glEnable(GL_LINE_SMOOTH);
- glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
- break;
- }
-}
-
-Wind::Wind() {
- for (unsigned int i = 0; i < Hack::numEmitters; ++i)
- _emitters.push_back(Vector(
- Common::randomFloat(60.0f) - 30.0f,
- Common::randomFloat(60.0f) - 30.0f,
- Common::randomFloat(30.0f) - 15.0f
- ));
-
- _particlesXYZ.resize(Hack::numParticles, Vector(0.0f, 0.0f, 100.0f));
- _particlesRGB.resize(Hack::numParticles, RGBColor());
-
- _whichParticle = 0;
-
- if (Hack::geometry == Hack::LINES_GEOMETRY) {
- _lineList.resize(Hack::numParticles, std::make_pair(UINT_MAX, UINT_MAX));
- for (unsigned int i = 0; i < Hack::numEmitters; ++i)
- _lastParticle.push_back(i);
- }
-
- for (unsigned int i = 0; i < NUMCONSTS; ++i) {
- _ct[i] = Common::randomFloat(M_PI * 2.0f);
- _cv[i] = Common::randomFloat(
- 0.00005f * float(Hack::windSpeed) * float(Hack::windSpeed)
- ) + 0.00001f * float(Hack::windSpeed) * float(Hack::windSpeed);
- }
-}
-
-void Wind::update() {
- // update constants
- for (unsigned int i = 0; i < NUMCONSTS; ++i) {
- _ct[i] += _cv[i];
- if (_ct[i] > M_PI * 2.0f)
- _ct[i] -= M_PI * 2.0f;
- _c[i] = std::cos(_ct[i]);
- }
-
- static float eVel = Hack::emitterSpeed * 0.01f;
-
- // calculate emissions
- for (unsigned int i = 0; i < Hack::numEmitters; ++i) {
- // emitter moves toward viewer
- _emitters[i].z() += eVel;
- if (_emitters[i].z() > 15.0f) // reset emitter
- _emitters[i].set(
- Common::randomFloat(60.0f) - 30.0f,
- Common::randomFloat(60.0f) - 30.0f,
- -15.0f
- );
- _particlesXYZ[_whichParticle] = _emitters[i];
- if (Hack::geometry == Hack::LINES_GEOMETRY) {
- // link particles to form lines
- if (_lineList[_whichParticle].first != UINT_MAX)
- _lineList[_lineList[_whichParticle].first].second = UINT_MAX;
- _lineList[_whichParticle].first = UINT_MAX;
- if (_emitters[i].z() == -15.0f)
- _lineList[_whichParticle].second = UINT_MAX;
- else
- _lineList[_whichParticle].second = _lastParticle[i];
- _lineList[_lastParticle[i]].first = _whichParticle;
- _lastParticle[i] = _whichParticle;
- }
- ++_whichParticle;
- if (_whichParticle >= Hack::numParticles)
- _whichParticle = 0;
- }
-
- // calculate particle positions and colors
- // first modify constants that affect colors
- _c[6] *= 9.0f / Hack::particleSpeed;
- _c[7] *= 9.0f / Hack::particleSpeed;
- _c[8] *= 9.0f / Hack::particleSpeed;
- // then update each particle
- static float pVel = Hack::particleSpeed * 0.01f;
- for (unsigned int i = 0; i < Hack::numParticles; ++i) {
- // store old positions
- float x = _particlesXYZ[i].x();
- float y = _particlesXYZ[i].y();
- float z = _particlesXYZ[i].z();
- // make new positions
- _particlesXYZ[i].set(
- x + (_c[0] * y + _c[1] * z) * pVel,
- y + (_c[2] * z + _c[3] * x) * pVel,
- z + (_c[4] * x + _c[5] * y) * pVel
- );
- // calculate colors
- _particlesRGB[i].set(
- std::abs((_particlesXYZ[i].x() - x) * _c[6]),
- std::abs((_particlesXYZ[i].y() - y) * _c[7]),
- std::abs((_particlesXYZ[i].z() - z) * _c[8])
- );
- // clamp colors
- _particlesRGB[i].clamp();
- }
-
- static float pointSize = 0.04f * Hack::size;
- static float lineSize = 0.005f * Hack::size;
-
- // draw particles
- switch (Hack::geometry) {
- case Hack::LIGHTS_GEOMETRY:
- for (unsigned int i = 0; i < Hack::numParticles; ++i) {
- glColor3fv(_particlesRGB[i].get());
- glPushMatrix();
- glTranslatef(
- _particlesXYZ[i].x(),
- _particlesXYZ[i].y(),
- _particlesXYZ[i].z()
- );
- glCallList(_list);
- glPopMatrix();
- }
- break;
- case Hack::POINTS_GEOMETRY:
- for (unsigned int i = 0; i < Hack::numParticles; ++i) {
- float temp = _particlesXYZ[i].z() + 40.0f;
- if (temp < 0.01f) temp = 0.01f;
- glPointSize(pointSize * temp);
- glBegin(GL_POINTS);
- glColor3fv(_particlesRGB[i].get());
- glVertex3fv(_particlesXYZ[i].get());
- glEnd();
- }
- break;
- case Hack::LINES_GEOMETRY:
- {
- for (unsigned int i = 0; i < Hack::numParticles; ++i) {
- float temp = _particlesXYZ[i].z() + 40.0f;
- if (temp < 0.01f) temp = 0.01f;
- glLineWidth(lineSize * temp);
- glBegin(GL_LINES);
- if (_lineList[i].second != UINT_MAX) {
- glColor3fv(_particlesRGB[i].get());
- if (_lineList[i].first == UINT_MAX)
- glColor3f(0.0f, 0.0f, 0.0f);
- glVertex3fv(_particlesXYZ[i].get());
- glColor3fv(_particlesRGB[_lineList[i].second].get());
- if (_lineList[_lineList[i].second].second == UINT_MAX)
- glColor3f(0.0f, 0.0f, 0.0f);
- glVertex3fv(_particlesXYZ[_lineList[i].second].get());
- }
- glEnd();
- }
- }
- break;
- }
-}
diff --git a/xbmc/screensavers/rsxs-0.9/src/solarwinds/wind.hh b/xbmc/screensavers/rsxs-0.9/src/solarwinds/wind.hh
deleted file mode 100644
index e4dd4b784e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/solarwinds/wind.hh
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _WIND_HH
-#define _WIND_HH
-
-#include <common.hh>
-
-#include <color.hh>
-#include <vector.hh>
-
-#define NUMCONSTS 9
-
-class Wind {
-private:
- static GLuint _list;
- static GLuint _texture;
-
- std::vector<Vector> _emitters;
- std::vector<Vector> _particlesXYZ;
- std::vector<RGBColor> _particlesRGB;
- std::vector<std::pair<unsigned int, unsigned int> > _lineList;
- std::vector<unsigned int> _lastParticle;
- unsigned int _whichParticle;
- float _c[NUMCONSTS];
- float _ct[NUMCONSTS];
- float _cv[NUMCONSTS];
-public:
- static void init();
-
- Wind();
-
- void update();
-};
-
-#endif // _WIND_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/sound.cc b/xbmc/screensavers/rsxs-0.9/src/sound.cc
deleted file mode 100644
index eb81e8a01f..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/sound.cc
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#include <common.hh>
-
-#if HAVE_SOUND
-
-#if HAVE_UNISTD_H
- #include <unistd.h>
-#endif
-#include <sound.hh>
-
-#include <dlopen.hh>
-
-ALCdevice* Sound::_device;
-ALCcontext* Sound::_context;
-std::list<Source*> Sound::_inactive, Sound::_active;
-
-float Sound::_speedOfSound;
-const Vector* Sound::_cameraPos;
-const Vector* Sound::_cameraVel;
-const UnitQuat* Sound::_cameraDir;
-
-#if USE_DLOPEN
- #define AL_FUNC(T, F) T F;
-#else
- #define AL_FUNC(T, F) using ::F;
-#endif
-namespace AL {
- AL_FUNC(LPALCCLOSEDEVICE, alcCloseDevice);
- AL_FUNC(LPALCCREATECONTEXT, alcCreateContext);
- AL_FUNC(LPALCDESTROYCONTEXT, alcDestroyContext);
- AL_FUNC(LPALCGETCURRENTCONTEXT, alcGetCurrentContext);
- AL_FUNC(LPALCMAKECONTEXTCURRENT, alcMakeContextCurrent);
- AL_FUNC(LPALCOPENDEVICE, alcOpenDevice);
- AL_FUNC(LPALCPROCESSCONTEXT, alcProcessContext);
-
- AL_FUNC(LPALBUFFERDATA, alBufferData);
- AL_FUNC(LPALDELETEBUFFERS, alDeleteBuffers);
- AL_FUNC(LPALDELETESOURCES, alDeleteSources);
- AL_FUNC(LPALDISTANCEMODEL, alDistanceModel);
- AL_FUNC(LPALGENBUFFERS, alGenBuffers);
- AL_FUNC(LPALGENSOURCES, alGenSources);
- AL_FUNC(LPALGETSOURCEI, alGetSourcei);
- AL_FUNC(LPALLISTENERF, alListenerf);
- AL_FUNC(LPALLISTENERFV, alListenerfv);
- AL_FUNC(LPALSOURCEF, alSourcef);
- AL_FUNC(LPALSOURCEFV, alSourcefv);
- AL_FUNC(LPALSOURCEI, alSourcei);
- AL_FUNC(LPALSOURCEPAUSE, alSourcePause);
- AL_FUNC(LPALSOURCEPLAY, alSourcePlay);
- AL_FUNC(LPALSOURCEREWIND, alSourceRewind);
-};
-
-Buffer::Buffer(
- ALenum format, const ALvoid* data, ALsizei size, ALuint frequency
-) {
- AL::alGenBuffers(1, &_buffer);
- AL::alBufferData(_buffer, format, data, size, frequency);
-}
-
-Buffer::~Buffer() { AL::alDeleteBuffers(1, &_buffer); }
-
-class Device : public ResourceManager::Resource<ALCdevice*> {
-private:
- ALCdevice* _device;
-public:
- Device(const std::string& spec) {
- _device = AL::alcOpenDevice(spec.c_str());
- if (!_device) {
- // Sleep for a moment before trying again
- sleep(1);
- _device = AL::alcOpenDevice(spec.c_str());
- if (!_device)
- throw ResourceManager::Exception(
- stdx::oss() << "Could not open AL device: " <<
- (spec.length() ? spec : "(default)")
- );
- }
- }
- ~Device() { AL::alcCloseDevice(_device); }
- ALCdevice* operator()() const { return _device; }
-};
-
-class Context : public ResourceManager::Resource<ALCcontext*> {
-private:
- ALCcontext* _prev;
- ALCcontext* _context;
-public:
- Context(ALCdevice* device) : _prev(AL::alcGetCurrentContext()) {
- _context = AL::alcCreateContext(device, NULL);
- if (!_context)
- throw ResourceManager::Exception("Could not create AL context");
- AL::alcMakeContextCurrent(_context);
- }
- ~Context() {
- AL::alcMakeContextCurrent(_prev);
- AL::alcDestroyContext(_context);
- }
- ALCcontext* operator()() const { return _context; }
-};
-
-class Source : public ResourceManager::Resource<ALuint> {
-private:
- ALuint _source;
- Vector _pos;
- float _time;
-public:
- Source() { AL::alGenSources(1, &_source); }
- ~Source() { AL::alDeleteSources(1, &_source); }
- ALuint operator()() const { return _source; }
-
- void start(ALuint buffer, const Vector& pos, float ref, float delay) {
- AL::alSourceRewind(_source);
- AL::alSourcei(_source, AL_BUFFER, buffer);
- AL::alSourcef(_source, AL_GAIN, 1.0f);
- AL::alSourcef(_source, AL_REFERENCE_DISTANCE, ref);
- AL::alSourcef(_source, AL_ROLLOFF_FACTOR, 1.0f);
- AL::alSourcei(_source, AL_LOOPING, AL_FALSE);
- AL::alSourcefv(_source, AL_POSITION, (float*)_pos.get());
- _pos = pos;
- _time = -delay;
- }
-
- bool update() {
- _time += Common::elapsedTime;
- if (_time < 0.0f) return false;
-
- // Do doppler effects manually due to OpenAL bugs
- float soundTime = _time;
- if (Sound::_speedOfSound) {
- Vector toCamera(*Sound::_cameraPos - _pos);
- float vls = Vector::dot(toCamera, *Sound::_cameraVel / Common::elapsedSecs) / toCamera.length();
- if (vls > Sound::_speedOfSound) vls = Sound::_speedOfSound;
- float factor = (Sound::_speedOfSound - vls) / Sound::_speedOfSound;
- AL::alSourcef(_source, AL_PITCH, Common::speed * factor);
- soundTime -= toCamera.length() / Sound::_speedOfSound;
- }
-
- ALenum state = 0x1234;
- AL::alGetSourcei(_source, AL_SOURCE_STATE, &state);
- switch (state) {
- case AL_INITIAL:
- case AL_PAUSED:
- if (Common::speed > 0.0f && soundTime >= 0.0f)
- AL::alSourcePlay(_source);
- break;
- case AL_PLAYING:
- if (Common::speed == 0.0f || soundTime < 0.0f)
- AL::alSourcePause(_source);
- break;
- case AL_STOPPED:
- return false;
- }
-
- return true;
- }
-};
-
-void Sound::init(
- const std::string& spec, float volume, float speedOfSound,
- const Vector* cameraPos, const Vector* cameraVel, const UnitQuat* cameraDir
-) {
-#if USE_DLOPEN
- try {
- const Library* libopenal = Common::resources->manage(new Library("libopenal"));
- AL::alcCloseDevice = (LPALCCLOSEDEVICE)(*libopenal)("alcCloseDevice");
- AL::alcCreateContext = (LPALCCREATECONTEXT)(*libopenal)("alcCreateContext");
- AL::alcDestroyContext = (LPALCDESTROYCONTEXT)(*libopenal)("alcDestroyContext");
- AL::alcGetCurrentContext = (LPALCGETCURRENTCONTEXT)(*libopenal)("alcGetCurrentContext");
- AL::alcMakeContextCurrent = (LPALCMAKECONTEXTCURRENT)(*libopenal)("alcMakeContextCurrent");
- AL::alcOpenDevice = (LPALCOPENDEVICE)(*libopenal)("alcOpenDevice");
- AL::alcProcessContext = (LPALCPROCESSCONTEXT)(*libopenal)("alcProcessContext");
- AL::alBufferData = (LPALBUFFERDATA)(*libopenal)("alBufferData");
- AL::alDeleteBuffers = (LPALDELETEBUFFERS)(*libopenal)("alDeleteBuffers");
- AL::alDeleteSources = (LPALDELETESOURCES)(*libopenal)("alDeleteSources");
- AL::alDistanceModel = (LPALDISTANCEMODEL)(*libopenal)("alDistanceModel");
- AL::alGenBuffers = (LPALGENBUFFERS)(*libopenal)("alGenBuffers");
- AL::alGenSources = (LPALGENSOURCES)(*libopenal)("alGenSources");
- AL::alGetSourcei = (LPALGETSOURCEI)(*libopenal)("alGetSourcei");
- AL::alListenerf = (LPALLISTENERF)(*libopenal)("alListenerf");
- AL::alListenerfv = (LPALLISTENERFV)(*libopenal)("alListenerfv");
- AL::alSourcef = (LPALSOURCEF)(*libopenal)("alSourcef");
- AL::alSourcefv = (LPALSOURCEFV)(*libopenal)("alSourcefv");
- AL::alSourcei = (LPALSOURCEI)(*libopenal)("alSourcei");
- AL::alSourcePause = (LPALSOURCEPAUSE)(*libopenal)("alSourcePause");
- AL::alSourcePlay = (LPALSOURCEPLAY)(*libopenal)("alSourcePlay");
- AL::alSourceRewind = (LPALSOURCEREWIND)(*libopenal)("alSourceRewind");
- } catch (Common::Exception e) {
- throw Unavailable();
- }
-#endif // USE_DLOPEN
-
- _device = Common::resources->manage(new Device(spec));
- _context = Common::resources->manage(new Context(_device));
-
- for (unsigned int i = 0; i < SOURCES; ++i) {
- Source* source = new Source();
- Common::resources->manage(source);
- _inactive.push_back(source);
- }
-
- AL::alDistanceModel(AL_INVERSE_DISTANCE);
- AL::alListenerf(AL_GAIN, volume * 0.01f);
- _speedOfSound = speedOfSound;
- _cameraPos = cameraPos;
- _cameraVel = cameraVel;
- _cameraDir = cameraDir;
-}
-
-void Sound::update() {
- Vector forward(_cameraDir->forward());
- Vector up(_cameraDir->up());
- float orientation[] = {
- forward.x(), forward.y(), forward.z(),
- up.x(), up.y(), up.z()
- };
-
- AL::alListenerfv(AL_POSITION, (float*)_cameraPos->get());
- AL::alListenerfv(AL_ORIENTATION, orientation);
-
- for (
- std::list<Source*>::iterator it = _active.begin();
- it != _active.end();
- ) {
- if (!(*it)->update()) {
- _inactive.push_back(*it);
- it = _active.erase(it);
- continue;
- }
- ++it;
- }
-
- AL::alcProcessContext(_context);
-}
-
-void Sound::play(const Vector& pos) {
- Source* source;
- if (_inactive.empty()) {
- /* Kill the oldest source */
- source = _active.front();
- _active.pop_front();
- } else {
- source = _inactive.front();
- _inactive.pop_front();
- }
- _active.push_back(source);
- source->start(_buffer, pos, _ref, _delay);
-}
-
-Sound::Sound(float ref, float delay) : _ref(ref), _delay(delay) {}
-
-#endif // HAVE_SOUND
diff --git a/xbmc/screensavers/rsxs-0.9/src/sound.hh b/xbmc/screensavers/rsxs-0.9/src/sound.hh
deleted file mode 100644
index 19bd0b8bc6..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/sound.hh
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _SOUND_HH
-#define _SOUND_HH
-
-#include <common.hh>
-
-#include <vector.hh>
-
-#if HAVE_SOUND
-
-#include <AL/al.h>
-#include <AL/alc.h>
-
-#define SOURCES 32
-
-class Source;
-
-class Buffer : public ResourceManager::Resource<ALuint> {
-private:
- ALuint _buffer;
-public:
- Buffer(ALenum, const ALvoid*, ALsizei, ALuint);
- ~Buffer();
- ALuint operator()() const { return _buffer; }
-};
-
-class Sound : public ResourceManager::Resource<void> {
-private:
- static ALCdevice* _device;
- static ALCcontext* _context;
- static std::list<Source*> _inactive, _active;
-
- static float _speedOfSound;
- static const Vector* _cameraPos;
- static const Vector* _cameraVel;
- static const UnitQuat* _cameraDir;
-
- friend class Source;
-
- float _ref;
- float _delay;
-protected:
- ALuint _buffer;
-
- Sound(float, float);
-public:
- class Unavailable {};
-
- static void init(
- const std::string&, float, float,
- const Vector*, const Vector*, const UnitQuat*
- );
- static void update();
- void operator()() const {}
- void play(const Vector&);
-};
-
-#else // !HAVE_SOUND
-
-class Sound : public ResourceManager::Resource<void> {
-public:
- class Unavailable {};
-
- static void init(
- const std::string&, float, float,
- const Vector*, const Vector*, const UnitQuat*
- ) {
- throw Common::Exception("No sound support");
- }
- static void update() {}
- void operator()() const {}
- void play(const Vector&) {}
-};
-
-#endif // !HAVE_SOUND
-
-#endif // _SOUND_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/vector.hh b/xbmc/screensavers/rsxs-0.9/src/vector.hh
deleted file mode 100644
index ca6fa159dd..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/vector.hh
+++ /dev/null
@@ -1,797 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-#ifndef _VECTOR_HH
-#define _VECTOR_HH
-
-#include <common.hh>
-
-#define R2D (180.0f / M_PI)
-#define D2R (M_PI / 180.0f)
-
-template <typename T>
-class VectorBase {
-protected:
- T _v[3];
-public:
- VectorBase(const T* v) {
- set(v[0], v[1], v[2]);
- }
-
- VectorBase(const T& x, const T& y, const T& z) {
- set(x, y, z);
- }
-
- void set(const T& x, const T& y, const T& z) {
- _v[0] = x;
- _v[1] = y;
- _v[2] = z;
- }
-
- const T& x() const { return _v[0]; }
- T& x() { return _v[0]; }
- const T& y() const { return _v[1]; }
- T& y() { return _v[1]; }
- const T& z() const { return _v[2]; }
- T& z() { return _v[2]; }
-
- const T* get() const {
- return _v;
- }
-
- T lengthSquared() const {
- return _v[0] * _v[0] + _v[1] * _v[1] + _v[2] * _v[2];
- }
-};
-
-class Vector : public VectorBase<float> {
-public:
- Vector(const float* v) : VectorBase<float>(v) {}
-
- Vector(float x = 0.0f, float y = 0.0f, float z = 0.0f)
- : VectorBase<float>(x, y, z) {}
-
- float length() const {
- return std::sqrt(lengthSquared());
- }
-
- float normalize() {
- float l = length();
- if (l == 0.0f)
- return 0.0f;
- _v[0] /= l;
- _v[1] /= l;
- _v[2] /= l;
- return l;
- }
-
- Vector operator+(const Vector& v) const {
- return Vector(_v[0] + v._v[0], _v[1] + v._v[1], _v[2] + v._v[2]);
- }
-
- Vector operator-(const Vector& v) const {
- return Vector(_v[0] - v._v[0], _v[1] - v._v[1], _v[2] - v._v[2]);
- }
-
- Vector operator*(float f) const {
- return Vector(_v[0] * f, _v[1] * f, _v[2] * f);
- }
-
- Vector operator/(float f) const {
- return Vector(_v[0] / f, _v[1] / f, _v[2] / f);
- }
-
- Vector& operator+=(const Vector& v) {
- _v[0] += v._v[0];
- _v[1] += v._v[1];
- _v[2] += v._v[2];
- return *this;
- }
-
- Vector& operator-=(const Vector& v) {
- _v[0] -= v._v[0];
- _v[1] -= v._v[1];
- _v[2] -= v._v[2];
- return *this;
- }
-
- Vector& operator*=(float f) {
- _v[0] *= f;
- _v[1] *= f;
- _v[2] *= f;
- return *this;
- }
-
- Vector& operator/=(float f) {
- _v[0] /= f;
- _v[1] /= f;
- _v[2] /= f;
- return *this;
- }
-
- static float dot(const Vector& a, const Vector& b) {
- return a.x() * b.x() + a.y() * b.y() + a.z() * b.z();
- }
-
- static Vector cross(const Vector& a, const Vector& b) {
- return Vector(
- a.y() * b.z() - b.y() * a.z(),
- a.z() * b.x() - b.z() * a.x(),
- a.x() * b.y() - b.x() * a.y()
- );
- };
-};
-
-class UVector : public VectorBase<unsigned int> {
-public:
- UVector(const unsigned int* v) : VectorBase<unsigned int>(v) {}
-
- UVector(unsigned int x = 0, unsigned int y = 0, unsigned int z = 0)
- : VectorBase<unsigned int>(x, y, z) {}
-
- UVector operator+(const UVector& v) const {
- return UVector(_v[0] + v._v[0], _v[1] + v._v[1], _v[2] + v._v[2]);
- }
-
- UVector operator-(const UVector& v) const {
- return UVector(_v[0] - v._v[0], _v[1] - v._v[1], _v[2] - v._v[2]);
- }
-
- UVector& operator+=(const UVector& v) {
- _v[0] += v._v[0];
- _v[1] += v._v[1];
- _v[2] += v._v[2];
- return *this;
- }
-
- UVector& operator-=(const UVector& v) {
- _v[0] -= v._v[0];
- _v[1] -= v._v[1];
- _v[2] -= v._v[2];
- return *this;
- }
-};
-
-class UnitVector : public Vector {
-protected:
- using Vector::set;
- using Vector::length;
- using Vector::lengthSquared;
- using Vector::normalize;
-
- UnitVector(const float* v) {
- set(v[0], v[1], v[2]);
- }
-
- UnitVector(float x, float y, float z) {
- set(x, y, z);
- }
-
- friend class Vector;
- friend class RotationMatrix;
- friend class UnitQuat;
-public:
- UnitVector(const Vector& v) {
- float l = v.length();
- if (l == 0.0f)
- set(1.0f, 0.0f, 0.0f);
- else
- set(v.x() / l, v.y() / l, v.z() / l);
- }
-
- UnitVector() {
- set(1.0f, 0.0f, 0.0f);
- }
-
- static UnitVector of(const Vector& v) {
- float l = v.length();
- if (l == 0.0f)
- return UnitVector();
- return UnitVector(
- v.x() / l,
- v.y() / l,
- v.z() / l
- );
- }
-};
-
-class Matrix {
-protected:
- float _m[16];
-public:
- Matrix(
- float m0 = 1.0f, float m1 = 0.0f, float m2 = 0.0f, float m3 = 0.0f,
- float m4 = 0.0f, float m5 = 1.0f, float m6 = 0.0f, float m7 = 0.0f,
- float m8 = 0.0f, float m9 = 0.0f, float m10 = 1.0f, float m11 = 0.0f,
- float m12 = 0.0f, float m13 = 0.0f, float m14 = 0.0f, float m15 = 1.0f
- ) {
- _m[0] = m0; _m[1] = m1; _m[2] = m2; _m[3] = m3;
- _m[4] = m4; _m[5] = m5; _m[6] = m6; _m[7] = m7;
- _m[8] = m8; _m[9] = m9; _m[10] = m10; _m[11] = m11;
- _m[12] = m12; _m[13] = m13; _m[14] = m14; _m[15] = m15;
- }
-
- float get(int i) const {
- return _m[i];
- }
-
- const float* get() const {
- return _m;
- }
-
- Matrix transposed() const {
- return Matrix(
- _m[0], _m[4], _m[8], _m[12],
- _m[1], _m[5], _m[9], _m[13],
- _m[2], _m[6], _m[10], _m[14],
- _m[3], _m[7], _m[11], _m[15]
- );
- }
-
- Vector transform(const Vector& v) const {
- float w = _m[3] * v.x() + _m[7] * v.y() + _m[11] * v.z() + _m[15];
- return Vector(
- (_m[0] * v.x() + _m[4] * v.y() + _m[8] * v.z() + _m[12]) / w,
- (_m[1] * v.x() + _m[5] * v.y() + _m[9] * v.z() + _m[13]) / w,
- (_m[2] * v.x() + _m[6] * v.y() + _m[10] * v.z() + _m[14]) / w
- );
- }
-
- Matrix operator*(const Matrix& m) const {
- return Matrix(
- _m[0] * m._m[0] + _m[1] * m._m[4] +
- _m[2] * m._m[8] + _m[3] * m._m[12],
- _m[0] * m._m[1] + _m[1] * m._m[5] +
- _m[2] * m._m[9] + _m[3] * m._m[13],
- _m[0] * m._m[2] + _m[1] * m._m[6] +
- _m[2] * m._m[10] + _m[3] * m._m[14],
- _m[0] * m._m[3] + _m[1] * m._m[7] +
- _m[2] * m._m[11] + _m[3] * m._m[15]
- ,
- _m[4] * m._m[0] + _m[5] * m._m[4] +
- _m[6] * m._m[8] + _m[7] * m._m[12],
- _m[4] * m._m[1] + _m[5] * m._m[5] +
- _m[6] * m._m[9] + _m[7] * m._m[13],
- _m[4] * m._m[2] + _m[5] * m._m[6] +
- _m[6] * m._m[10] + _m[7] * m._m[14],
- _m[4] * m._m[3] + _m[5] * m._m[7] +
- _m[6] * m._m[11] + _m[7] * m._m[15]
- ,
- _m[8] * m._m[0] + _m[9] * m._m[4] +
- _m[10] * m._m[8] + _m[11] * m._m[12],
- _m[8] * m._m[1] + _m[9] * m._m[5] +
- _m[10] * m._m[9] + _m[11] * m._m[13],
- _m[8] * m._m[2] + _m[9] * m._m[6] +
- _m[10] * m._m[10] + _m[11] * m._m[14],
- _m[8] * m._m[3] + _m[9] * m._m[7] +
- _m[10] * m._m[11] + _m[11] * m._m[15]
- ,
- _m[12] * m._m[0] + _m[13] * m._m[4] +
- _m[14] * m._m[8] + _m[15] * m._m[12],
- _m[12] * m._m[1] + _m[13] * m._m[5] +
- _m[14] * m._m[9] + _m[15] * m._m[13],
- _m[12] * m._m[2] + _m[13] * m._m[6] +
- _m[14] * m._m[10] + _m[15] * m._m[14],
- _m[12] * m._m[3] + _m[13] * m._m[7] +
- _m[14] * m._m[11] + _m[15] * m._m[15]
- );
- }
-};
-
-class TranslationMatrix : public Matrix {
-protected:
- float _dx, _dy, _dz;
-public:
- TranslationMatrix(float dx = 0.0f, float dy = 0.0f, float dz = 0.0f) :
- Matrix(
- 1.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 1.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 1.0f, 0.0f,
- dz, dy, dz, 1.0f
- ), _dx(dx), _dy(dy), _dz(dz) {}
-
- TranslationMatrix inverted() const {
- return TranslationMatrix(-_dx, -_dy, -_dz);
- }
-
- Vector transform(const Vector& v) const {
- return v + Vector(_dx, _dy, _dz);
- }
-
- TranslationMatrix operator*(const TranslationMatrix& m) const {
- return TranslationMatrix(_dx + m._dx, _dy + m._dy, _dz + m._dz);
- }
-};
-
-class ScalingMatrix : public Matrix {
-protected:
- float _sx, _sy, _sz;
-public:
- ScalingMatrix(float sx = 0.0f, float sy = 0.0f, float sz = 0.0f) :
- Matrix(
- sx, 0.0f, 0.0f, 0.0f,
- 0.0f, sy, 0.0f, 0.0f,
- 0.0f, 0.0f, sz, 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f
- ), _sx(sx), _sy(sy), _sz(sz) {}
-
- ScalingMatrix inverted() const {
- return ScalingMatrix(-_sx, -_sy, -_sz);
- }
-
- ScalingMatrix transposed() const {
- return ScalingMatrix(*this);
- }
-
- Vector transform(const Vector& v) const {
- return Vector(_sx * v.x(), _sy * v.y(), _sz * v.z());
- }
-
- ScalingMatrix operator*(const ScalingMatrix& m) const {
- return ScalingMatrix(_sx + m._sx, _sy + m._sy, _sz + m._sz);
- }
-};
-
-class ShearingMatrix : public Matrix {
-protected:
- float _sxy, _sxz, _syx, _syz, _szx, _szy;
-public:
- ShearingMatrix(
- float sxy = 0.0f, float sxz = 0.0f,
- float syx = 0.0f, float syz = 0.0f,
- float szx = 0.0f, float szy = 0.0f
- ) :
- Matrix(
- 1.0f, sxy, sxz, 0.0f,
- syx, 1.0f, syz, 0.0f,
- szx, szy, 1.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f
- ),
- _sxy(sxy), _sxz(sxz), _syx(syx),
- _syz(syz), _szx(szx), _szy(szy) {}
-
- ShearingMatrix transposed() const {
- return ShearingMatrix(_syx, _szx, _sxy, _szy, _sxz, _syz);
- }
-
- Vector transform(const Vector& v) const {
- return Vector(
- v.x() + _syx * v.y() + _szx * v.z(),
- v.y() + _sxy * v.x() + _szy * v.z(),
- v.z() + _sxz * v.x() + _syz * v.y()
- );
- }
-};
-
-class RotationMatrix : public Matrix {
-protected:
- RotationMatrix(
- float m0, float m1, float m2,
- float m4, float m5, float m6,
- float m8, float m9, float m10
- ) : Matrix(
- m0, m1, m2, 0.0f,
- m4, m5, m6, 0.0f,
- m8, m9, m10, 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f
- ) {}
-
- RotationMatrix(const Vector& x, const Vector& y, const Vector& z) :
- Matrix(
- x.x(), x.y(), x.z(), 0.0f,
- y.x(), y.y(), y.z(), 0.0f,
- z.x(), z.y(), z.z(), 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f
- ) {}
-
- friend class UnitQuat;
-public:
- RotationMatrix() :
- Matrix(
- 1.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 1.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 1.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f
- ) {}
-
- // Emulate gluLookAt
- static RotationMatrix lookAt(
- const Vector& eye, const Vector& center, const Vector& up
- ) {
- Vector f(eye - center);
- f.normalize();
- Vector x(Vector::cross(up, f));
- x.normalize();
- return RotationMatrix(x, Vector::cross(f, x), f);
- }
-
- static RotationMatrix heading(float a) {
- float sa = std::sin(a);
- float ca = std::cos(a);
-
- return RotationMatrix(
- 1.0f, 0.0f, 0.0f,
- 0.0f, ca, -sa,
- 0.0f, sa, ca
- );
- }
-
- static RotationMatrix pitch(float a) {
- float sa = std::sin(a);
- float ca = std::cos(a);
-
- return RotationMatrix(
- ca, 0.0f, -sa,
- 0.0f, 1.0f, 0.0f,
- sa, 0.0f, ca
- );
- }
-
- static RotationMatrix roll(float a) {
- float sa = std::sin(a);
- float ca = std::cos(a);
-
- return RotationMatrix(
- ca, -sa, 0.0f,
- sa, ca, 0.0f,
- 0.0f, 0.0f, 1.0f
- );
- }
-
- RotationMatrix inverted() const {
- return RotationMatrix(
- _m[0], _m[4], _m[8],
- _m[1], _m[5], _m[9],
- _m[2], _m[6], _m[10]
- );
- }
-
- RotationMatrix transposed() const {
- return RotationMatrix(
- _m[0], _m[4], _m[8],
- _m[1], _m[5], _m[9],
- _m[2], _m[6], _m[10]
- );
- }
-
- Vector transform(const Vector& v) const {
- return Vector(
- _m[0] * v.x() + _m[4] * v.y() + _m[8] * v.z(),
- _m[1] * v.x() + _m[5] * v.y() + _m[9] * v.z(),
- _m[2] * v.x() + _m[6] * v.y() + _m[10] * v.z()
- );
- }
-
- UnitVector transform(const UnitVector& v) const {
- return UnitVector(
- _m[0] * v.x() + _m[4] * v.y() + _m[8] * v.z(),
- _m[1] * v.x() + _m[5] * v.y() + _m[9] * v.z(),
- _m[2] * v.x() + _m[6] * v.y() + _m[10] * v.z()
- );
- }
-
- RotationMatrix operator*(const RotationMatrix& m) const {
- return RotationMatrix(
- _m[0] * m._m[0] + _m[1] * m._m[4] + _m[2] * m._m[8],
- _m[0] * m._m[1] + _m[1] * m._m[5] + _m[2] * m._m[9],
- _m[0] * m._m[2] + _m[1] * m._m[6] + _m[2] * m._m[10]
- ,
- _m[4] * m._m[0] + _m[5] * m._m[4] + _m[6] * m._m[8],
- _m[4] * m._m[1] + _m[5] * m._m[5] + _m[6] * m._m[9],
- _m[4] * m._m[2] + _m[5] * m._m[6] + _m[6] * m._m[10]
- ,
- _m[8] * m._m[0] + _m[9] * m._m[4] + _m[10] * m._m[8],
- _m[8] * m._m[1] + _m[9] * m._m[5] + _m[10] * m._m[9],
- _m[8] * m._m[2] + _m[9] * m._m[6] + _m[10] * m._m[10]
- );
- }
-};
-
-class UnitQuat {
-protected:
- float _q[4];
- unsigned int _renormalizeCount;
-
- // These two are internal, since they do not guarantee length == 1
- UnitQuat(float x, float y, float z, float w) : _renormalizeCount(0) {
- _q[0] = x;
- _q[1] = y;
- _q[2] = z;
- _q[3] = w;
- }
-
- void set(float x, float y, float z, float w) {
- _q[0] = x;
- _q[1] = y;
- _q[2] = z;
- _q[3] = w;
- }
-public:
- UnitQuat() : _renormalizeCount(0) {
- _q[0] = _q[1] = _q[2] = 0.0f;
- _q[3] = 1.0f;
- }
-
- UnitQuat(float a, const UnitVector& axis) : _renormalizeCount(0) {
- a *= 0.5f;
- float sinA = std::sin(a);
- set(
- sinA * axis.x(),
- sinA * axis.y(),
- sinA * axis.z(),
- std::cos(a)
- );
- }
-
- UnitQuat(const RotationMatrix& r) : _renormalizeCount(0) {
- float trace = r.get(0) + r.get(5) + r.get(10) + 1.0f;
- if (trace > 0) {
- float s = 2.0f * std::sqrt(trace);
- set(
- (r.get(9) - r.get(6)) / s,
- (r.get(2) - r.get(8)) / s,
- (r.get(4) - r.get(1)) / s,
- s / 4.0f
- );
- } else {
- if (r.get(0) > r.get(5)) {
- if (r.get(0) > r.get(10)) {
- // r.get(0) is largest
- float s = 2.0f *
- std::sqrt(1.0f + r.get(0) - r.get(5) - r.get(10));
- set(
- s / 4.0f,
- (r.get(1) + r.get(4)) / s,
- (r.get(2) + r.get(8)) / s,
- (r.get(9) - r.get(6)) / s
- );
- } else {
- // r.get(10) is largest
- float s = 2.0f *
- std::sqrt(1.0f + r.get(10) - r.get(0) - r.get(5));
- set(
- (r.get(2) + r.get(8)) / s,
- (r.get(6) + r.get(9)) / s,
- s / 4,
- (r.get(4) - r.get(1)) / s
- );
- }
- } else {
- if (r.get(5) > r.get(10)) {
- // r.get(5) is largest
- float s = 2.0f *
- std::sqrt(1.0f + r.get(5) - r.get(0) - r.get(10));
- set(
- (r.get(1) + r.get(4)) / s,
- s / 4,
- (r.get(6) + r.get(9)) / s,
- (r.get(2) - r.get(8)) / s
- );
- } else {
- // r.get(10) is largest
- float s = 2.0f *
- std::sqrt(1.0f + r.get(10) - r.get(0) - r.get(5));
- set(
- (r.get(2) + r.get(8)) / s,
- (r.get(6) + r.get(9)) / s,
- s / 4,
- (r.get(4) - r.get(1)) / s
- );
- }
- }
- }
- }
-
- operator RotationMatrix() const {
- float wx = _q[3] * _q[0] * 2.0f;
- float wy = _q[3] * _q[1] * 2.0f;
- float wz = _q[3] * _q[2] * 2.0f;
- float xx = _q[0] * _q[0] * 2.0f;
- float xy = _q[0] * _q[1] * 2.0f;
- float xz = _q[0] * _q[2] * 2.0f;
- float yy = _q[1] * _q[1] * 2.0f;
- float yz = _q[1] * _q[2] * 2.0f;
- float zz = _q[2] * _q[2] * 2.0f;
-
- return RotationMatrix(
- 1.0f - yy - zz, xy + wz, xz - wy,
- xy - wz, 1.0f - xx - zz, yz + wx,
- xz + wy, yz - wx, 1.0f - xx - yy
- );
- }
-
- void toAngleAxis(float* a, UnitVector* axis) const {
- *a = 2.0f * std::acos(_q[3]);
- float sinA = std::sqrt(1.0f - _q[3] * _q[3]);
- if (std::abs(sinA) < 0.00001f)
- axis->set(1.0f, 0.0f, 0.0f);
- else
- axis->set(
- _q[0] / sinA,
- _q[1] / sinA,
- _q[2] / sinA
- );
- }
-
- UnitVector forward() const {
- float wx = _q[3] * _q[0] * 2.0f;
- float wy = _q[3] * _q[1] * 2.0f;
- float xx = _q[0] * _q[0] * 2.0f;
- float xz = _q[0] * _q[2] * 2.0f;
- float yy = _q[1] * _q[1] * 2.0f;
- float yz = _q[1] * _q[2] * 2.0f;
-
- return UnitVector(-xz - wy, -yz + wx, -1.0f + xx + yy);
- }
-
- UnitVector backward() const {
- float wx = _q[3] * _q[0] * 2.0f;
- float wy = _q[3] * _q[1] * 2.0f;
- float xx = _q[0] * _q[0] * 2.0f;
- float xz = _q[0] * _q[2] * 2.0f;
- float yy = _q[1] * _q[1] * 2.0f;
- float yz = _q[1] * _q[2] * 2.0f;
-
- return UnitVector(xz + wy, yz - wx, 1.0f - xx - yy);
- }
-
- UnitVector left() const {
- float wy = _q[3] * _q[1] * 2.0f;
- float wz = _q[3] * _q[2] * 2.0f;
- float xy = _q[0] * _q[1] * 2.0f;
- float xz = _q[0] * _q[2] * 2.0f;
- float yy = _q[1] * _q[1] * 2.0f;
- float zz = _q[2] * _q[2] * 2.0f;
-
- return UnitVector(-1.0f + yy + zz, -xy - wz, -xz + wy);
- }
-
- UnitVector right() const {
- float wy = _q[3] * _q[1] * 2.0f;
- float wz = _q[3] * _q[2] * 2.0f;
- float xy = _q[0] * _q[1] * 2.0f;
- float xz = _q[0] * _q[2] * 2.0f;
- float yy = _q[1] * _q[1] * 2.0f;
- float zz = _q[2] * _q[2] * 2.0f;
-
- return UnitVector(1.0f - yy - zz, xy + wz, xz - wy);
- }
-
- UnitVector up() const {
- float wx = _q[3] * _q[0] * 2.0f;
- float wz = _q[3] * _q[2] * 2.0f;
- float xx = _q[0] * _q[0] * 2.0f;
- float xy = _q[0] * _q[1] * 2.0f;
- float yz = _q[1] * _q[2] * 2.0f;
- float zz = _q[2] * _q[2] * 2.0f;
-
- return UnitVector(xy - wz, 1.0f - xx - zz, yz + wx);
- }
-
- UnitVector down() const {
- float wx = _q[3] * _q[0] * 2.0f;
- float wz = _q[3] * _q[2] * 2.0f;
- float xx = _q[0] * _q[0] * 2.0f;
- float xy = _q[0] * _q[1] * 2.0f;
- float yz = _q[1] * _q[2] * 2.0f;
- float zz = _q[2] * _q[2] * 2.0f;
-
- return UnitVector(-xy + wz, -1.0f + xx + zz, -yz + wx);
- }
-
- float getX() const {
- return _q[0];
- }
-
- float getY() const {
- return _q[1];
- }
-
- float getZ() const {
- return _q[2];
- }
-
- float getW() const {
- return _q[3];
- }
-
- void multiplyBy(const UnitQuat& q) {
- float tempX = _q[0];
- float tempY = _q[1];
- float tempZ = _q[2];
- float tempW = _q[3];
-
- _q[0] = tempW * q._q[0] + q._q[3] * tempX
- + tempY * q._q[2] - q._q[1] * tempZ;
- _q[1] = tempW * q._q[1] + q._q[3] * tempY
- + tempZ * q._q[0] - q._q[2] * tempX;
- _q[2] = tempW * q._q[2] + q._q[3] * tempZ
- + tempX * q._q[1] - q._q[0] * tempY;
- _q[3] = tempW * q._q[3]
- - tempX * q._q[0]
- - tempY * q._q[1]
- - tempZ * q._q[2];
-
- if (++_renormalizeCount == 5) {
- float length = std::sqrt(
- _q[0] * _q[0] +
- _q[1] * _q[1] +
- _q[2] * _q[2] +
- _q[3] * _q[3]
- );
- _q[0] /= length;
- _q[1] /= length;
- _q[2] /= length;
- _q[3] /= length;
- _renormalizeCount = 0;
- }
- }
-
- void preMultiplyBy(const UnitQuat& q) {
- float tempX = _q[0];
- float tempY = _q[1];
- float tempZ = _q[2];
- float tempW = _q[3];
-
- _q[0] = q._q[3] * tempX + tempW * q._q[0]
- + q._q[1] * tempZ - tempY * q._q[2];
- _q[1] = q._q[3] * tempY + tempW * q._q[1]
- + q._q[2] * tempX - tempZ * q._q[0];
- _q[2] = q._q[3] * tempZ + tempW * q._q[2]
- + q._q[0] * tempY - tempX * q._q[1];
- _q[3] = q._q[3] * tempW
- - q._q[0] * tempX
- - q._q[1] * tempY
- - q._q[2] * tempZ;
-
- if (++_renormalizeCount == 5) {
- float length = std::sqrt(
- _q[0] * _q[0] +
- _q[1] * _q[1] +
- _q[2] * _q[2] +
- _q[3] * _q[3]
- );
- _q[0] /= length;
- _q[1] /= length;
- _q[2] /= length;
- _q[3] /= length;
- _renormalizeCount = 0;
- }
- }
-
- static UnitQuat pitch(float a) {
- a *= 0.5f;
- return UnitQuat(std::sin(a), 0.0f, 0.0f, std::cos(a));
- }
-
- static UnitQuat heading(float a) {
- a *= 0.5f;
- return UnitQuat(0.0f, std::sin(a), 0.0f, std::cos(a));
- }
-
- static UnitQuat roll(float a) {
- a *= 0.5f;
- return UnitQuat(0.0f, 0.0f, std::sin(a), std::cos(a));
- }
-};
-
-#endif // _VECTOR_HH
diff --git a/xbmc/screensavers/rsxs-0.9/src/vroot.hh b/xbmc/screensavers/rsxs-0.9/src/vroot.hh
deleted file mode 100644
index de06b1047e..0000000000
--- a/xbmc/screensavers/rsxs-0.9/src/vroot.hh
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Really Slick XScreenSavers
- * Copyright (C) 2002-2006 Michael Chapman
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************
- *
- * This is a Linux port of the Really Slick Screensavers,
- * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
- */
-
-/*
- * Changed declaration of i to unsigned int so g++ doesn't give a warning.
- * -- Michael Chapman, 17 Nov 2002
- * Filename and wrapper #ifndef update.
- * -- Michael Chapman, 22 Jun 2003
- *
- * -- Michael Chapman, 17 Nov 2002
- */
-
-/*****************************************************************************/
-/** Copyright 1991 by Andreas Stolcke **/
-/** Copyright 1990 by Solbourne Computer Inc. **/
-/** Longmont, Colorado **/
-/** **/
-/** All Rights Reserved **/
-/** **/
-/** Permission to use, copy, modify, and distribute this software and **/
-/** its documentation for any purpose and without fee is hereby **/
-/** granted, provided that the above copyright notice appear in all **/
-/** copies and that both that copyright notice and this permis- **/
-/** sion notice appear in supporting documentation, and that the **/
-/** name of Solbourne not be used in advertising **/
-/** in publicity pertaining to distribution of the software without **/
-/** specific, written prior permission. **/
-/** **/
-/** ANDREAS STOLCKE AND SOLBOURNE COMPUTER INC. DISCLAIMS ALL WARRANTIES **/
-/** WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF **/
-/** MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ANDREAS STOLCKE **/
-/** OR SOLBOURNE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL **/
-/** DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
-/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
-/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
-/** OR PERFORMANCE OF THIS SOFTWARE. **/
-/*****************************************************************************/
-/*
- * vroot.h -- Virtual Root Window handling header file
- *
- * This header file redefines the X11 macros RootWindow and DefaultRootWindow,
- * making them look for a virtual root window as provided by certain `virtual'
- * window managers like swm and tvtwm. If none is found, the ordinary root
- * window is returned, thus retaining backward compatibility with standard
- * window managers.
- * The function implementing the virtual root lookup remembers the result of
- * its last invocation to avoid overhead in the case of repeated calls
- * on the same display and screen arguments.
- * The lookup code itself is taken from Tom LaStrange's ssetroot program.
- *
- * Most simple root window changing X programs can be converted to using
- * virtual roots by just including
- *
- * #include <X11/vroot.h>
- *
- * after all the X11 header files. It has been tested on such popular
- * X clients as xphoon, xfroot, xloadimage, and xaqua.
- * It also works with the core clients xprop, xwininfo, xwd, and editres
- * (and is necessary to get those clients working under tvtwm).
- * It does NOT work with xsetroot; get the xsetroot replacement included in
- * the tvtwm distribution instead.
- *
- * Andreas Stolcke <stolcke@ICSI.Berkeley.EDU>, 9/7/90
- * - replaced all NULL's with properly cast 0's, 5/6/91
- * - free children list (suggested by Mark Martin <mmm@cetia.fr>), 5/16/91
- * - include X11/Xlib.h and support RootWindowOfScreen, too 9/17/91
- */
-
-#ifndef _VROOT_HH
-#define _VROOT_HH
-
-#if !defined(lint) && !defined(SABER)
-static const char vroot_rcsid[] =
- "#Id: vroot.h,v 1.4 1991/09/30 19:23:16 stolcke Exp stolcke #";
-#endif
-
-#include <X11/X.h>
-#include <X11/Xatom.h>
-#include <X11/Xlib.h>
-
-static Window
-#ifdef __STDC__ /* ANSIfication added by jwz, to avoid superfluous warnings. */
-VirtualRootWindowOfScreen(Screen *screen)
-#else /* !__STDC__ */
-VirtualRootWindowOfScreen(screen) Screen *screen;
-#endif /* !__STDC__ */
-{
- static Screen *save_screen = (Screen *)0;
- static Window root = (Window)0;
-
- if (screen != save_screen) {
- Display *dpy = DisplayOfScreen(screen);
- Atom __SWM_VROOT = None;
- unsigned int i;
- Window rootReturn, parentReturn, *children;
- unsigned int numChildren;
-
- root = RootWindowOfScreen(screen);
-
- /* go look for a virtual root */
- __SWM_VROOT = XInternAtom(dpy, "__SWM_VROOT", False);
- if (XQueryTree(dpy, root, &rootReturn, &parentReturn,
- &children, &numChildren)) {
- for (i = 0; i < numChildren; i++) {
- Atom actual_type;
- int actual_format;
- unsigned long nitems, bytesafter;
- unsigned char *newRoot = (unsigned char *)0;
-
- if (XGetWindowProperty(dpy, children[i],
- __SWM_VROOT, 0, 1, False, XA_WINDOW,
- &actual_type, &actual_format,
- &nitems, &bytesafter, &newRoot) == Success
- && newRoot) {
- root = *(Window *)newRoot;
- break;
- }
- }
- if (children)
- XFree((char *)children);
- }
-
- save_screen = screen;
- }
-
- return root;
-}
-
-#undef RootWindowOfScreen
-#define RootWindowOfScreen(s) VirtualRootWindowOfScreen(s)
-
-#undef RootWindow
-#define RootWindow(dpy,screen) \
- VirtualRootWindowOfScreen(ScreenOfDisplay(dpy,screen))
-
-#undef DefaultRootWindow
-#define DefaultRootWindow(dpy) \
- VirtualRootWindowOfScreen(DefaultScreenOfDisplay(dpy))
-
-#endif /* _VROOT_HH */
diff --git a/xbmc/screensavers/rsxs-0.9/xbmc/Makefile.in b/xbmc/screensavers/rsxs-0.9/xbmc/Makefile.in
deleted file mode 100644
index 684adc25f4..0000000000
--- a/xbmc/screensavers/rsxs-0.9/xbmc/Makefile.in
+++ /dev/null
@@ -1,58 +0,0 @@
-ARCH=@ARCH@
-CXXFLAGS=-fPIC
-
-.PHONY: compile
-
-OUTDIR=@abs_top_srcdir@/addons
-RSXS=..
-
-DIRS=$(RSXS)
-
-RSXS-OBJS=$(RSXS)/src/common.o $(RSXS)/src/color.o $(RSXS)/lib/libmisc.a
-
-SOLARWINDS-OUT=$(OUTDIR)/screensaver.rsxs.solarwinds/Solarwinds.xbs
-SOLARWINDS-DEP=$(RSXS)/src/solarwinds/rs-solarwinds
-
-PLASMA-OUT=$(OUTDIR)/screensaver.rsxs.plasma/Plasma.xbs
-PLASMA-DEP=$(RSXS)/src/plasma/rs-plasma
-
-EUPHORIA-OUT=$(OUTDIR)/screensaver.rsxs.euphoria/Euphoria.xbs
-EUPHORIA-DEP=$(RSXS)/src/euphoria/rs-euphoria
-
-CLEAN_FILES=$(SOLARWINDS-OUT) $(PLASMA-OUT) $(EUPHORIA-OUT)
-
-all: $(SOLARWINDS-OUT) $(PLASMA-OUT) $(EUPHORIA-OUT);
-
-$(SOLARWINDS-OUT): $(SOLARWINDS-DEP)
-ifeq ($(findstring osx,$(ARCH)), osx)
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -flat_namespace -undefined dynamic_lookup \
- -o $(SOLARWINDS-OUT) $(RSXS)/src/solarwinds/*.o $(RSXS-OBJS)
-else
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(SOLARWINDS-OUT) $(RSXS)/src/solarwinds/*.o $(RSXS-OBJS) -lXmu -lGL -lX11 -lGLU
-endif
-
-$(PLASMA-OUT): $(PLASMA-DEP)
-ifeq ($(findstring osx,$(ARCH)), osx)
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -flat_namespace -undefined dynamic_lookup \
- -o $(PLASMA-OUT) $(RSXS)/src/plasma/*.o $(RSXS-OBJS)
-else
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(PLASMA-OUT) $(RSXS)/src/plasma/*.o $(RSXS-OBJS) -lXmu -lGL -lX11 -lGLU
-endif
-
-$(EUPHORIA-OUT): $(EUPHORIA-DEP)
-ifeq ($(findstring osx,$(ARCH)), osx)
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -flat_namespace -undefined dynamic_lookup \
- -o $(EUPHORIA-OUT) $(RSXS)/src/euphoria/*.o $(RSXS)/src/pngimage.o $(RSXS-OBJS) -lpng
-else
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(EUPHORIA-OUT) $(RSXS)/src/euphoria/*.o $(RSXS)/src/pngimage.o $(RSXS-OBJS) -lXmu -lpng -lGL -lX11 -lGLU
-endif
-
-$(SOLARWINDS-DEP) : $(RSXS)
-$(PLASMA-DEP) : $(RSXS)
-$(EUPHORIA-DEP) : $(RSXS)
-
-$(RSXS): compile
- $(MAKE) -C $(RSXS)
-
-include @abs_top_srcdir@/Makefile.include
-