home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / commodities / superdark / blankers / fracblank.dark.c < prev    next >
C/C++ Source or Header  |  1993-03-10  |  14KB  |  715 lines

  1.   /* Fichier clock.dark.c                */
  2. /* Module appele par le programme principal    */
  3. /* pour effectuer un effet defini..appele par    */
  4. /* loadseg                    */
  5. #include    <exec/types.h>
  6. #include    <exec/ports.h>
  7. #include    <graphics/display.h>
  8. #include    <graphics/gfxbase.h>
  9. #include    <intuition/intuition.h>
  10. #include    <hardware/custom.h>
  11. #include    <math.h>
  12. #include    "/includes/struct.h"
  13. #include    "/includes/tom_gadget.h"
  14.  
  15. #define    WIDTH    640
  16. #define    HEIGHT    256
  17. #define    SGN(x)    ((x)<0?-1:1)
  18. #define    ABS(x)    ((x)<0?(-(x)):(x))
  19.  
  20. char    buffer[100];
  21. extern    struct my_data    *p_info;
  22. extern    char    *pr_buff;
  23. extern    struct    GfxBase    *GfxBase;
  24.  
  25. char    *p_text_info="Fracblank\nBased on a Program From ???\nAdapted and Modified!\n";
  26.  
  27. #define reg register
  28. extern    void __asm MultiPlot(reg __a0 struct Screen *,reg __d0 WORD, reg __d1 WORD,reg __d2 WORD);
  29. extern    void __asm MonoPlot(    reg __a0 PLANEPTR,
  30.                 reg __d0 WORD,
  31.                 reg __d1 WORD,
  32.                 reg __d2 WORD,
  33.                 reg __d3 WORD,
  34.                 reg __d4 WORD);
  35.  
  36. char    *p_modes[]={"Monochrome","Static Colors","Dynamic Colors",0};
  37. char    *p_type[]={"RealPlane","CosmicFlame","RandoM",0};
  38. int    duree=10;
  39.  
  40. struct    tom_gadget    my_gadg[]={
  41.     {"_Mode",    CYCLE,     60,  20,200,12, 0,0,0,0,(char *)p_modes},
  42.     {"T_empo",    SLIDER,    60,  40,200,12, 0,10,100,0,NULL},
  43.     {"T_ype",    MX,           170, 55,100,20, 3,10,100,0,(char *)p_type},
  44.     {0,        END_LISTE,  0,  0,   0, 0, 0,0,0,0,0}};
  45.  
  46. struct NewScreen NewBlankerScreen ={
  47.     0,0,
  48.     WIDTH,HEIGHT,
  49.     4,0,1,MODE_640,CUSTOMSCREEN,
  50.     NULL,NULL,NULL,NULL};
  51.  
  52. ULONG    count_col,count;
  53.  
  54. #ifndef custom
  55. #define custom (*(struct Custom *)0xDFF000)
  56. #endif    /* custom */
  57.  
  58. struct Screen        *BlankScreen;
  59.  
  60.  
  61.     /* sin -45° = cos -45° (saves precious calculation time). */
  62.  
  63. #define deg45    (-0.707106781)
  64. enum    {    COLOUR_MONO,COLOUR_STATIC,COLOUR_CYCLE};
  65.  
  66.     /* Rainbow colour table. */
  67.  
  68. UWORD             Table[75];
  69.  
  70.     /* No colours at all. */
  71.  
  72. UWORD             Black[32];
  73.     /* The colours of a rainbow (well, with a bit of imagination, just
  74.      * 32 colours in this rainbow for now).
  75.      */
  76.  
  77. UWORD Rainbow[32] =
  78. {
  79.     0x0000,0x0F00,0x0F30,0x0F50,
  80.     0x0F70,0x0F90,0x0FB0,0x0FD0,
  81.     0x0FF0,0x0DF0,0x0BF0,0x09F0,
  82.     0x07F0,0x05F0,0x03F0,0x00F0,
  83.     0x00D1,0x00B3,0x0095,0x0077,
  84.     0x0059,0x003B,0x001D,0x000F,
  85.     0x010F,0x030F,0x050F,0x070F,
  86.     0x090F,0x0B0F,0x0D0F,0x0F0F
  87. };
  88.     /* Some kind of a semaphore to tell the blank task to stop drawing. */
  89.  
  90. BYTE             StopDrawing    = FALSE;
  91.  
  92.     /* Cosmic flame fractal parameters. */
  93.  
  94. #define MAXFLAMELEVEL    20
  95. #define MAXTOTALPOINTS    20000
  96.  
  97.     /* Declarations for cosmic flame blanker code. */
  98.  
  99. float             Flame[2][3][2];
  100. WORD             FlameLevel,
  101.              FlameAlternateForm,
  102.              FlameModulo;
  103. UWORD             FlameColourTable[32];
  104. BYTE             FlameWheel,
  105.              FlameColour;
  106. PLANEPTR         FlamePlane;
  107. ULONG             FlamePoints;
  108.  
  109.  
  110.     /* Random(ULONG MaxValue):
  111.      *
  112.      *    Simple random number generation routine.
  113.      */
  114.  
  115. ULONG __regargs
  116. Random(ULONG MaxValue)
  117. {
  118.     STATIC ULONG RandomSeed = 0xDEAD0123;
  119.  
  120.     RandomSeed = RandomSeed * custom . vhposr + 0xE153766F;
  121.  
  122.     return(RandomSeed % MaxValue);
  123. }
  124.  
  125. void    my_printf(rp,x,y,texte)
  126. struct RastPort    *rp;
  127. int    x,y;
  128. char    *texte;
  129. {
  130.     SetAPen(rp,1);
  131.     Move(rp,x,y);
  132.     Text(rp,texte,strlen(texte));
  133. }
  134. void    new_param(float    *a,float    *b,float    *c,float    *mag)
  135. {
  136.     *a = (float)(Random(700) + 5) / 100.0;
  137.     *b = (float)(Random(190) + 5) / 100.0;
  138.     *c = (float)(Random( 90) + 5) / 100.0;
  139.  
  140.     *mag = (float)(1 << (Random(6) + 2)) * deg45;
  141. }
  142.  
  143.     /* RealPlane():
  144.      *
  145.      *    Draw real plane fractals.
  146.      */
  147.  
  148. VOID
  149. RealPlane()
  150. {
  151.     STATIC BYTE Wheel = 0;
  152.     UBYTE    flg_end;
  153.     UWORD    Count = 0;
  154.     UWORD    Colours[32],OffsetX = BlankScreen -> Width >> 1,OffsetY = BlankScreen -> Height >> 1;
  155.     float    x,y,yy,a,b,c,sx,sy,mag;
  156.     int    count_bis;
  157.     struct RastPort    *RPort;
  158.     WORD         i,NewBit = 0;
  159.     BYTE         Colour = 1,Plus = 1;
  160.  
  161.     x=0;
  162.     y=0;
  163.     count_bis=100;
  164.  
  165.     /* Provide starting numbers for the fractal
  166.      * parameters.
  167.      */
  168.     new_param(&a,&b,&c,&mag);
  169.  
  170.     Colours[0] = 0;
  171.     flg_end=tst_end();
  172.     /* Are we running in monochrome mode? */
  173.  
  174.     if(my_gadg[0].value == COLOUR_MONO)
  175.     {
  176.         UWORD        Modulo    = BlankScreen -> RastPort . BitMap -> BytesPerRow;
  177.         PLANEPTR    Plane    = BlankScreen -> RastPort . BitMap -> Planes[0];
  178.  
  179.             /* Set up the screen colour table. */
  180.  
  181.         Colours[1] = Table[Wheel];
  182.         LoadRGB4(&BlankScreen -> ViewPort,Colours,2);
  183.  
  184.             /* Go into fractal generation loop. */
  185.  
  186.         while(flg_end==FALSE){
  187.  
  188.                 /* The original formula looks like
  189.                  * this:
  190.                  *                                    ½
  191.                  *    x = y - SIGN(x) × ABS(b × x - c)
  192.                  *    y = a - x
  193.                  *
  194.                  * I have split the calculation into
  195.                  * several steps to save time and
  196.                  * variables.
  197.                  */
  198.  
  199.             yy = a - x;
  200.  
  201.             if(x < 0)
  202.                 x = y + sqrt(fabs(b * x - c));
  203.             else
  204.                 x = y - sqrt(fabs(b * x - c));
  205.  
  206.             y = yy;
  207.  
  208.                 /* The resulting image appears to have
  209.                  * been rotated by 45°, so we'll
  210.                  * rotate the pixel coordinates by -45°
  211.                  *
  212.                  *    x =  x × cos(alpha) + y × sin(alpha)
  213.                  *    y = -x × sin(alpha) + y × cos(alpha)
  214.                  *
  215.                  * We also magnify the image (i.e. the
  216.                  * distribution of pixels) in the following
  217.                  * lines.
  218.                  */
  219.  
  220.             sx = 2*mag * ( x + y);
  221.             sy = mag * (-x + y);
  222.  
  223.                 /* If the pixel happens to reside within
  224.                  * the boundaries of the screen, draw it.
  225.                  */
  226.  
  227.             MonoPlot(Plane,(WORD)(sx) + OffsetX,(WORD)(sy) + OffsetY,Modulo,BlankScreen -> Width,BlankScreen -> Height);
  228.             count_bis--;
  229.             if(count_bis==0){
  230.  
  231.                 count_bis=100;
  232.                 flg_end=tst_end();
  233.                 Count++;
  234.                 if(Count%10){
  235.  
  236.                     Colours[1] = Table[Wheel];
  237.                     LoadRGB4(&BlankScreen -> ViewPort,Colours,2);
  238.                     Wheel = (Wheel + 1) % 75;
  239.                 }
  240.                 /* Change the pattern? */
  241.                 if(Count%duree==0){
  242.                     flg_end=TRUE;
  243.                 }
  244.             }
  245.         }
  246.     }else{
  247.         RPort = &BlankScreen -> RastPort;
  248.  
  249.         for(i = 1 ; i < 32 ; i++)
  250.             Colours[i] = Table[(Wheel + i) % 75];
  251.  
  252.         if(my_gadg[0].value == COLOUR_CYCLE)
  253.             LoadRGB4(&BlankScreen -> ViewPort,Colours,32);
  254.         else
  255.             LoadRGB4(&BlankScreen -> ViewPort,Rainbow,32);
  256.  
  257.         Wheel = (Wheel + 1) % 75;
  258.  
  259.  
  260.         while(flg_end==FALSE){
  261.             flg_end=tst_end();
  262.             yy = a - x;
  263.  
  264.             if(x < 0){
  265.                 x = y + sqrt(fabs(b * x - c));
  266.             }else{
  267.                 x = y - sqrt(fabs(b * x - c));
  268.             }
  269.             y = yy;
  270.  
  271.             sx = mag * 2.0 * ( x + y);
  272.             sy = mag * 1.0 * (-x + y);
  273.             MultiPlot(BlankScreen,(WORD)(sx) + OffsetX,(WORD)(sy) + OffsetY,Colour | NewBit);
  274.  
  275.             count_bis--;
  276.             if(count_bis==0){
  277.                 count_bis=100;
  278.                 /* Oh well, it's not that easy to
  279.                  * produce decent colour values for
  280.                  * the pixels to be rendered.
  281.                  *
  282.                  * The following statement will change
  283.                  * the current drawing pen after exactly
  284.                  * 1200 pixels have been rendered and will
  285.                  * pick a new colour between 1 and 31.
  286.                  */
  287.                Count++;
  288.  
  289.                if(Count%12==0)
  290.                {
  291.                 if(NewBit)
  292.                 {
  293.                     NewBit = 0;
  294.  
  295.                     Colour += Plus;
  296.  
  297.                     if(!Colour)
  298.                     {
  299.                         Plus    = 1;
  300.                         Colour    = 2;
  301.                     }
  302.                     else
  303.                     {
  304.                         if(Colour == 32)
  305.                         {
  306.                             Plus    = -1;
  307.                             Colour    = 30;
  308.                         }
  309.                     }
  310.                 }
  311.                 else
  312.                     NewBit = 0x20;
  313.                 }
  314.                   if(Count%6==0){
  315.                 for(i = 1 ; i < 32 ; i++)
  316.                     Colours[i] = Table[(Wheel + i) % 75];
  317.  
  318.                 if(my_gadg[0].value == COLOUR_CYCLE)
  319.                     LoadRGB4(&BlankScreen -> ViewPort,Colours,32);
  320.  
  321.                 Wheel = (Wheel + 1) % 75;
  322.                }
  323.                if(Count%duree==0){
  324.                 flg_end=TRUE;
  325.                }
  326.             }
  327.         }
  328.     }
  329. }
  330.  
  331.     /* RecurseMono(float x,float y,WORD Level):
  332.      *
  333.      *    Cosmic flame calculation routine (monochrome).
  334.      */
  335.  
  336. BYTE
  337. RecurseMono(float x,float y,WORD Level)
  338. {
  339.  
  340.     if(count==0){
  341.         return(FALSE);
  342.     }
  343.     if(tst_end()!=FALSE){
  344.         StopDrawing    = TRUE;
  345.     }
  346.     if(StopDrawing)
  347.     {
  348.         FlameLevel    = 0;
  349.         StopDrawing    = FALSE;
  350.  
  351.         return(FALSE);
  352.     }
  353.  
  354.         /* ^E tells the blanker to rotate the
  355.          * colours.
  356.          */
  357.     count--;
  358.     count_col--;
  359.     if(count_col==0)
  360.     {
  361.         count_col=200;
  362.  
  363.         FlameColourTable[1] = Table[FlameWheel];
  364.  
  365.         LoadRGB4(&BlankScreen -> ViewPort,FlameColourTable,2);
  366.  
  367.         FlameWheel = (FlameWheel + 1) % 75;
  368.     }
  369.     if(Level >= MAXFLAMELEVEL)
  370.     {
  371.         if((FlamePoints++) > MAXTOTALPOINTS)
  372.             return(FALSE);
  373.         else
  374.             MonoPlot(FlamePlane,(WORD)((BlankScreen -> Width >> 1) * (x + 1.0)),(WORD)((BlankScreen -> Height >> 1) * (y + 1.0)),FlameModulo,BlankScreen -> Width,BlankScreen -> Height);
  375.     }
  376.     else
  377.     {
  378.         float    nx,ny;
  379.         WORD    i;
  380.  
  381.         for(i = 0 ; i < 2 ; i++)
  382.         {
  383.             nx = Flame[0][0][i] * x + Flame[0][1][i] * y + Flame[0][2][i];
  384.             ny = Flame[1][0][i] * x + Flame[1][1][i] * y + Flame[1][2][i];
  385.  
  386.             if(i < FlameAlternateForm)
  387.             {
  388.                 nx = sin(nx);
  389.                 ny = sin(ny);
  390.             }
  391.  
  392.             if(!StopDrawing)
  393.             {
  394.                 if(!RecurseMono(nx,ny,Level + 1))
  395.                     return(FALSE);
  396.             }
  397.             else
  398.                 return(FALSE);
  399.         }
  400.     }
  401.  
  402.     return(TRUE);
  403. }
  404.  
  405.     /* RecurseColour(float x,float y,WORD Level):
  406.      *
  407.      *    Cosmic flame calculation routine (colour).
  408.      */
  409.  
  410. BYTE
  411. RecurseColour(float x,float y,WORD Level)
  412. {
  413.     if(count==0){
  414.         return(FALSE);
  415.     }
  416.     if(tst_end()!=FALSE){
  417.         StopDrawing    = TRUE;
  418.     }
  419.         /* Are we to shut down? */
  420.  
  421.     if(StopDrawing)
  422.     {
  423.         FlameLevel    = 0;
  424.         StopDrawing    = FALSE;
  425.  
  426.         return(FALSE);
  427.     }
  428.  
  429.         /* ^E tells the blanker to rotate the
  430.          * colours.
  431.          */
  432.     count--;
  433.     count_col--;
  434.     if(count_col==0)
  435.     {
  436.         count_col=200;
  437.         if(my_gadg[0].value == COLOUR_CYCLE)
  438.         {
  439.             WORD i;
  440.  
  441.             for(i = 1 ; i < 32 ; i++)
  442.                 FlameColourTable[i] = Table[(FlameWheel + i) % 75];
  443.  
  444.             LoadRGB4(&BlankScreen -> ViewPort,FlameColourTable,32);
  445.  
  446.             FlameWheel = (FlameWheel + 1) % 75;
  447.         }
  448.     }
  449.     if(Level >= MAXFLAMELEVEL)
  450.     {
  451.         if((FlamePoints++) > MAXTOTALPOINTS)
  452.             return(FALSE);
  453.         else
  454.             MultiPlot(BlankScreen,(WORD)((BlankScreen -> Width >> 1) * (x + 1.0)),(WORD)((BlankScreen -> Height >> 1) * (y + 1.0)),FlameColour + 1);
  455.     }
  456.     else
  457.     {
  458.         float    nx,ny;
  459.         WORD    i;
  460.  
  461.         for(i = 0 ; i < 2 ; i++)
  462.         {
  463.             nx = Flame[0][0][i] * x + Flame[0][1][i] * y + Flame[0][2][i];
  464.             ny = Flame[1][0][i] * x + Flame[1][1][i] * y + Flame[1][2][i];
  465.  
  466.             if(i < FlameAlternateForm)
  467.             {
  468.                 nx = sin(nx);
  469.                 ny = sin(ny);
  470.             }
  471.  
  472.             if(!StopDrawing)
  473.             {
  474.                 if(!RecurseColour(nx,ny,Level + 1))
  475.                     return(FALSE);
  476.             }
  477.             else
  478.                 return(FALSE);
  479.         }
  480.     }
  481.  
  482.     return(TRUE);
  483. }
  484.  
  485.     /* CosmicFlame():
  486.      *
  487.      *    The cosmic flame screen blanker.
  488.      *
  489.      *    xlock.c - X11 client to lock a display and show a screen saver.
  490.      *
  491.      *    Copyright (c) 1988-91 by Patrick J. Naughton.
  492.      *
  493.      *    Permission to use, copy, modify, and distribute this software and its
  494.      *    documentation for any purpose and without fee is hereby granted,
  495.      *    provided that the above copyright notice appear in all copies and that
  496.      *    both that copyright notice and this permission notice appear in
  497.      *    supporting documentation.
  498.      */
  499.  
  500. VOID
  501. CosmicFlame()
  502. {
  503.     WORD i,j,k;
  504.  
  505.     count_col=20;
  506.     count=duree*200;
  507.  
  508.         /* Monochrome mode? */
  509.  
  510.     if(my_gadg[0].value == COLOUR_MONO)
  511.     {
  512.         BYTE Alternate = FALSE;
  513.  
  514.             /* Initialize defaults. */
  515.  
  516.         FlameModulo    = BlankScreen -> RastPort . BitMap -> BytesPerRow;
  517.         FlamePlane    = BlankScreen -> RastPort . BitMap -> Planes[0];
  518.  
  519.         FlameWheel    = 0;
  520.  
  521.             /* Set up the screen colour table. */
  522.  
  523.         FlameColourTable[0] = 0;
  524.         FlameColourTable[1] = Table[FlameWheel];
  525.  
  526.         LoadRGB4(&BlankScreen -> ViewPort,FlameColourTable,2);
  527.  
  528.         FlameLevel    = 0;
  529.  
  530.             /* Go into fractal generation loop. */
  531.         while((tst_end()==FALSE)&&(count!=0)){
  532.             if(!((FlameLevel++) % 20))
  533.             {
  534.                 LoadRGB4(&BlankScreen -> ViewPort,Black,2);
  535.  
  536.                 SetRast(&BlankScreen -> RastPort,0);
  537.  
  538.                 LoadRGB4(&BlankScreen -> ViewPort,FlameColourTable,2);
  539.  
  540.                 Alternate = !Alternate;
  541.             }
  542.  
  543.             if(Alternate)
  544.                 FlameAlternateForm = 0;
  545.             else
  546.                 FlameAlternateForm = Random(2) + 2;
  547.  
  548.             for(k = 0 ; k < 2 ; k++)
  549.             {
  550.                 for(i = 0 ; i < 2 ; i++)
  551.                 {
  552.                     for(j = 0; j < 3; j++)
  553.                         Flame[i][j][k] = ((float)Random(1024)) / 512.0 - 1.0;
  554.                 }
  555.             }
  556.  
  557.             FlamePoints = 0;
  558.  
  559.             RecurseMono(0.0,0.0,0);
  560.         }
  561.     }
  562.     else
  563.     {
  564.         BYTE Alternate = FALSE,Plus;
  565.  
  566.         FlameWheel = Random(75);
  567.  
  568.         FlameColourTable[0] = 0x000;
  569.  
  570.         for(i = 1 ; i < 32 ; i++)
  571.             FlameColourTable[i] = Table[(FlameWheel + i) % 75];
  572.  
  573.         if(my_gadg[0].value == COLOUR_CYCLE)
  574.             LoadRGB4(&BlankScreen -> ViewPort,FlameColourTable,32);
  575.         else
  576.             LoadRGB4(&BlankScreen -> ViewPort,Rainbow,32);
  577.  
  578.         FlameWheel    = (FlameWheel + 1) % 75;
  579.  
  580.         FlameColour    = Random(63);
  581.         Plus        = 1;
  582.  
  583.         FlameLevel    = 0;
  584.  
  585.             /* Go into fractal generation loop. */
  586.  
  587.         while((tst_end()==FALSE)&&(count!=0)){
  588.             if(!((FlameLevel++) % 20))
  589.             {
  590.                 LoadRGB4(&BlankScreen -> ViewPort,Black,32);
  591.  
  592.                 SetRast(&BlankScreen -> RastPort,0);
  593.  
  594.                 if(my_gadg[0].value == COLOUR_CYCLE)
  595.                     LoadRGB4(&BlankScreen -> ViewPort,FlameColourTable,32);
  596.                 else
  597.                     LoadRGB4(&BlankScreen -> ViewPort,Rainbow,32);
  598.  
  599.                 Alternate = !Alternate;
  600.             }
  601.             else
  602.             {
  603.                 if(FlameColour == 62)
  604.                     Plus = -1;
  605.  
  606.                 if(FlameColour == 0)
  607.                     Plus = 1;
  608.  
  609.                 FlameColour += Plus;
  610.             }
  611.  
  612.             if(Alternate)
  613.                 FlameAlternateForm = 0;
  614.             else
  615.                 FlameAlternateForm = Random(2) + 2;
  616.  
  617.             for(k = 0 ; k < 2 ; k++)
  618.             {
  619.                 for(i = 0 ; i < 2 ; i++)
  620.                 {
  621.                     for(j = 0; j < 3; j++)
  622.                         Flame[i][j][k] = ((float)Random(1024)) / 512.0 - 1.0;
  623.                 }
  624.             }
  625.  
  626.             FlamePoints = 0;
  627.  
  628.             RecurseColour(0.0,0.0,0);
  629.         }
  630.     }
  631. }
  632.  
  633. /* Put here your own code */
  634. /* But don't remember     */
  635.  
  636. void    __saveds    dark()
  637. {
  638.     int    num;
  639.  
  640.     duree=my_gadg[1].value*20;
  641.  
  642.     BlankScreen=(struct Screen *)OpenScreen(&NewBlankerScreen);
  643.     SetRast (&BlankScreen->RastPort,0);
  644.     if(BlankScreen!=0){
  645.         FreeSprite (0);
  646.         GfxBase->SpriteReserved|=1;
  647.         do{
  648.             /* Mode aleatoire ? */
  649.             if(my_gadg[2].value==2){
  650.                 num=rand()%2;
  651.             }else{
  652.                 num=my_gadg[2].value;
  653.             }
  654.             SetRast(&BlankScreen->RastPort,0);
  655.             StopDrawing=FALSE;
  656.             switch(num){
  657.                 case 0:
  658.                     RealPlane();
  659.                     break;
  660.                 case 1:
  661.                     CosmicFlame();
  662.                     break;
  663.                 default:
  664.                     break;
  665.             }
  666.         }while(tst_end()==FALSE);
  667.         CloseScreen(BlankScreen);
  668.     }
  669.  
  670. }
  671. void    proc_init()
  672. {
  673.  
  674.     WORD    i,c = 0,r = 15,g = 0,b = 0;
  675.  
  676.         /* Create a table of rainbow colours. */
  677.  
  678.     for(i = 0 ; i < 16 ; i++)
  679.         Table[c++] = (r << 8) | ((g++) << 4) | b;
  680.  
  681.     g = 15;
  682.     r--;
  683.  
  684.     for(i = 0 ; i < 15 ; i++)
  685.         Table[c++] = ((r--) << 8) | (g << 4) | b;
  686.  
  687.     r = 0;
  688.     g--;
  689.     b++;
  690.  
  691.     for(i = 0 ; i < 15 ; i++)
  692.         Table[c++] = (r << 8) | ((g--) << 4) | (b++);
  693.  
  694.     g = 0;
  695.     b = 15;
  696.     r++;
  697.  
  698.     for(i = 0 ; i < 15 ; i++)
  699.         Table[c++] = ((r++) << 8) | (g << 4) | b;
  700.  
  701.     r = 15;
  702.     b--;
  703.  
  704.     for(i = 0 ; i < 14 ; i++)
  705.         Table[c++] = (r << 8) | (g << 4) | (b--);
  706.  
  707. }
  708.  
  709. void    proc_save()
  710. {
  711. }
  712. void    proc_end()
  713. {
  714. }
  715.