[comp.windows.news] psPyro, Now Colorised for your late night enjoyment!

hugh@hoptoad.uucp (Hugh Daniel) (06/01/89)

  I got Eric's fireworks program this evening, and just HAD to see
how it would look on my color Mac!  Alass it did not have any color,
so I added it, but first I gave it Technicolor!  I think the Technicolor
is best, so this diff (which is long because it is a context diff so
that folks with out patch can see where I did what) is shiped with
Technicolor commented into the code.


                ||ugh Daniel
hugh@toad.com                   Grasshopper  Group,  +1 415/668-5998
hugh@xanadu.com			1996 Hayes St. San Francisco CA94117


*** psPyro.psh	Thu Jun  1 01:42:56 1989
--- nuPyro.psh	Thu Jun  1 01:48:25 1989
***************
*** 1,5 ****
--- 1,32 ----
  #! /usr/NeWS/bin/psh
  
+ %% For Color systems use this
+ /setacolor { % num -> -
+ 	{
+ 	 0		{ 0 setgray }
+ 	 1		{ random random random setrgbcolor }
+ 	 2		{ 1 .1 0 setrgbcolor }	% Red Rocket trail
+ 	 3		{ .86 .86 0 setrgbcolor } % Yellow ground flash
+ 	 /Default	{ random random random setrgbcolor }
+ 	} case
+ } def
+ 
+ %% For Technicolor displays that dont fade from memory!
+ %% Note: It would help to clear the display now and then.
+ %% Just uncomment the next three lines.
+ /setacolor { % num -> -
+ 	pop random random random setrgbcolor
+ } def
+ 
+ %% For Black & White (Monocrome machines) uncomment the next 7 lines
+ %/setacolor { % num -> -
+ %	{
+ %		0		{ 0 setgray }
+ %		1 2 3		{ 1 setgray }
+ %		/Default	{ random setgray }
+ %	} case
+ %} def
+ 
  %
  %  psPyro, a user extensible fireworks display screen saver.
  %
***************
*** 83,89 ****
  
      gsave
        5 {
!         1 setgray
  
          4 {
            draw_one_quarter
--- 110,116 ----
  
      gsave
        5 {
!         1 setacolor
  
          4 {
            draw_one_quarter
***************
*** 97,103 ****
  
      gsave
        5 {
!         0 setgray
  
          4 {
            draw_one_quarter
--- 124,130 ----
  
      gsave
        5 {
!         0 setacolor
  
          4 {
            draw_one_quarter
***************
*** 128,134 ****
  
        6 {
          1.4 dup scale
!         1 setgray
          little_delay
          draw_circle
        } repeat
--- 155,161 ----
  
        6 {
          1.4 dup scale
!         1 setacolor
          little_delay
          draw_circle
        } repeat
***************
*** 137,143 ****
      gsave
        6 {
          1.4 dup scale
!         0 setgray
          little_delay
          draw_circle
        } repeat
--- 164,170 ----
      gsave
        6 {
          1.4 dup scale
!         0 setacolor
          little_delay
          draw_circle
        } repeat
***************
*** 167,173 ****
      gsave
        4 {
          1.4 dup scale
!         1 setgray
          little_delay little_delay
          draw_star
        } repeat
--- 194,200 ----
      gsave
        4 {
          1.4 dup scale
!         1 setacolor
          little_delay little_delay
          draw_star
        } repeat
***************
*** 176,182 ****
      gsave
        4 {
          1.4 dup scale
!         0 setgray
          little_delay
          draw_star
        } repeat
--- 203,209 ----
      gsave
        4 {
          1.4 dup scale
!         0 setacolor
          little_delay
          draw_star
        } repeat
***************
*** 200,211 ****
      gsave
        4 {
          1.4 dup scale
!         1 setgray
          little_delay
          draw_dot
        } repeat
  
!       0 setgray
        little_delay
        draw_dot
      grestore
--- 227,238 ----
      gsave
        4 {
          1.4 dup scale
!         1 setacolor
          little_delay
          draw_dot
        } repeat
  
!       0 setacolor
        little_delay
        draw_dot
      grestore
***************
*** 228,239 ****
      gsave
        4 {
          1.4 dup scale
!         random setgray
          little_delay
          draw_dot
        } repeat
  
!       0 setgray
        little_delay
        draw_dot
      grestore
--- 255,266 ----
      gsave
        4 {
          1.4 dup scale
!         random setacolor
          little_delay
          draw_dot
        } repeat
  
!       0 setacolor
        little_delay
        draw_dot
      grestore
***************
*** 304,313 ****
    /theta exch def
  
    % erase the first degree from the previous trail
!   0 setgray
    0 0 1 theta 1 sub theta arc stroke
  
!   1 setgray
  
    theta 1 theta trail_length add 1 sub {
      0 0 1
--- 331,340 ----
    /theta exch def
  
    % erase the first degree from the previous trail
!   0 setacolor
    0 0 1 theta 1 sub theta arc stroke
  
!   2 setacolor
  
    theta 1 theta trail_length add 1 sub {
      0 0 1
***************
*** 322,328 ****
  %
  /animate_trail { % - => -
    % draw the first trail instance
!   1 setgray
  
    0 1 trail_length 1 sub {
      0 0 1
--- 349,355 ----
  %
  /animate_trail { % - => -
    % draw the first trail instance
!   2 setacolor
  
    0 1 trail_length 1 sub {
      0 0 1
***************
*** 338,344 ****
    } for
  
    % remove the last trail instance
!   0 setgray
  
    explosion_angle 1 explosion_angle trail_length add 1 sub {
      0 0 1
--- 365,371 ----
    } for
  
    % remove the last trail instance
!   0 setacolor
  
    explosion_angle 1 explosion_angle trail_length add 1 sub {
      0 0 1
***************
*** 454,465 ****
        } if
  
        % create the firing of the firework
!       1 setgray
        trail_width 2 div 0 20 0 180 arc fill
  
        little_delay
  
!       0 setgray
        trail_width 2 div 0 20 0 180 arc fill
  
        % create the firework trail
--- 481,492 ----
        } if
  
        % create the firing of the firework
!       3 setacolor
        trail_width 2 div 0 20 0 180 arc fill
  
        little_delay
  
!       0 setacolor
        trail_width 2 div 0 20 0 180 arc fill
  
        % create the firework trail
***************
*** 549,563 ****
  
  % wait for a mouse movement or click to end the fireworks display
  createevent dup begin
!   /Name [
!           /LeftMouseButton
!           /MiddleMouseButton
!           /RightMouseButton
!           /MouseDragged
!         ] def
    /Canvas sky def
  end expressinterest
  awaitevent
  currentprocess killprocessgroup
- 
-
--- 576,592 ----
  
  % wait for a mouse movement or click to end the fireworks display
  createevent dup begin
! % Note: I dont know why this does Not get us keyboard events -HD
! % Note: I have removed the /MouseDragged as it was to easy to jog
! %	the mouse and louse a good Technicolor display!
!   /Name 200 dict dup begin
! 	0 1 127 { dup def } for
! 	/LeftMouseButton dup def
! 	/MiddleMouseButton dup def
! 	/RightMouseButton dup def
!   end def
!   /Action  /DownTransition def
    /Canvas sky def
  end expressinterest
  awaitevent
  currentprocess killprocessgroup