home *** CD-ROM | disk | FTP | other *** search
/ Amiga Times / AmigaTimes.iso / programme / trionbbs110 / Trion / docs / RIPdoors / riptest.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-06  |  4.5 KB  |  193 lines

  1.  
  2.  
  3. /*  Trion BBS 'RIPscrip Clidoor Support' test program                   */
  4. /*                                                                      */
  5. /*  V 1.00   08 - Jan - 1998                                            */
  6. /*                                                                      */
  7. /*  (c) Copyright 1995-98 by Paul Spijkerman                            */
  8.  
  9.  
  10.  
  11.  
  12. #include "ripdoor.h"
  13.  
  14.  
  15. int brk(void);
  16. int brk(void)
  17. {
  18.    return(0);
  19. }
  20.  
  21.  
  22.  
  23.  
  24.  
  25. int main(int argc, char **argv)    /* was void */
  26. {
  27.    int t, r, d;
  28.  
  29.    onbreak(brk);
  30.  
  31.    printf("");               /* ClrScr(); */
  32.    printf("!\r\n");           /* RipScrip on, return !! .. rip starts on begin of line */
  33.  
  34.    /* palette: 4 times (black, dark grey, light grey, white) */
  35.    /* SetPalette (00,56,07,63,  00,56,07,63,  00,56,07,63,  00,56,07,63  ); */
  36.  
  37.    /* OnePalette (00, 00); */  /* background BLACK !! */
  38.    /* OnePalette (01, 63); */  /* white */
  39.    /* OnePalette (02, 00); */  /* black */
  40.    /* OnePalette (03, 56); */  /* dark grey */
  41.    /* OnePalette (04, 07); */  /* light grey */
  42.    /* OnePalette (05, 63); */  /* white */
  43.  
  44.    Color(14);
  45.    ripprint( 200 , 15 , "RIPscrip BBS graphics test" );
  46.  
  47.  
  48.    /* Color(15); */
  49.    for (t = 0; t < 10; t++){
  50.       for (r = 0; r < 10; r++){
  51.          d = (r * t) & 15;
  52.          if (d == 0) d = 1;
  53.          Color(d);
  54.          PlotAt(10 + t<<2, 10 + r<<1);
  55.       }
  56.    }
  57.  
  58.    /* Color(15); */
  59.    for (t = 0; t < 15; t++){
  60.       for (r = 0; r < 15; r++){
  61.          d = (r + t) & 15;        /*  d = (r * t) & 15; */
  62.          Color(d);
  63.          PlotAt(10 + t, 30 + r);
  64.       }
  65.    }
  66.  
  67.    GetImage(10,30, 25,45);
  68.    for (r = 0; r < 4; r++){
  69.       for (t = 0; t < 4; t++){
  70.          PutImage( 10+15*t, 45+15*r, 0);
  71.       }
  72.    }
  73.  
  74.  
  75. /*
  76.    Color(2);
  77.    LineAt(101,201,201,101);
  78.    Color(3);
  79.    LineAt(100,100,200,200);
  80. */
  81.  
  82.    for (t = 0; t < 16; t++){
  83.       Color(t);
  84.       LineAt(20,100+t*7,120,200-t*7);
  85.    }
  86.  
  87.  
  88.    Delay(50L);
  89.    GraphicsMode( 01 );              /* 1 = XOR */
  90.    for (t = 0; t < 16; t++){
  91.       Color(t);
  92.       LineAt(20,100+t*7,120,200-t*7);
  93.    }
  94.    GraphicsMode( 00 );
  95.  
  96.  
  97.    for (t = 0; t < 7; t++){
  98.       Color(t);
  99.       d = t << 1;
  100.       Rectangle( 140+d, 50+d, 200-d ,100-d);
  101.    }
  102.    FillStyle( 11, 3);          /* style, color */
  103.    FloodFill( 170, 75, 6);     /* x, y, border */
  104.  
  105.  
  106.    for (t = 0; t < 12; t++){
  107.       Color(t);
  108.       Circle(250,100,10+t*3);
  109.       
  110.    }
  111.  
  112.  
  113.    for (t = 0; t < 12; t++){
  114.       FillStyle(t, t);
  115.       d = 0; /* t << 1; */
  116.       FilledRectangle( 140+d + 40*t, 150+d, 200-d+40*t ,200-d);
  117.    }
  118.  
  119.    CustomFillPattern( 1+16, 2+32, 4+64, 2+32, 1+16, 2+32, 4+64, 2+32 ,15);
  120.    FilledRectangle( 140, 150, 200, 200);
  121.  
  122.    Color(3);
  123.    for (t = 0; t < 5; t++){
  124.       SetLineStyle(t, 255+170*256, 1);
  125.       LineAt(320, 20+t*5, 600, 20+t*5 );
  126.    }
  127.  
  128.    Color(14);
  129.    for (t = 0; t < 5; t++){
  130.       SetLineStyle(t, 255+170*256, 3);
  131.       LineAt(320, 45+t*5, 600, 45+t*5 );
  132.    }
  133.  
  134.    SetLineStyle(0, 0, 1);       /* reset to normal */
  135.  
  136.  
  137.    BezierCurve(0,199,  350,0,  440,0,  639,199, 30 );
  138.  
  139.  
  140.  
  141. /* ButtonStyle( 60, 20, 02, 32+256+512+1024, 3, 15, 8, 15, 8, 7, 0, 1, 14, 7 ); */
  142. /* RipButton  ( 400, 150, 500, 180, '=', 0, "<>Button<>b^M" ); */
  143.  
  144.    ButtonStyle( 0, 0, 02, 32+256+512+1024, 3, 15, 8, 15, 8, 7, 0, 1, 14, 7 );
  145.    RipButton  ( 300, 80, 400, 95, '=', 0, "<>Files<>F^M" );
  146.    RipButton  ( 410, 80, 510, 95, '=', 0, "<>Mail<>M^M" );
  147.    RipButton  ( 520, 80, 620, 95, '=', 0, "<>Doors<>D^M" );
  148.  
  149.  
  150.  
  151.    /* XOR Test */
  152.  
  153.    GraphicsMode( 01 );              /* 1 = XOR */
  154.    for (t = 0; t < 100; t++){
  155.       Color(15);
  156.       LineAt(0,t,600,t);
  157.       LineAt(0,t,600,t);
  158.    }
  159.    GraphicsMode( 00 );
  160.  
  161.  
  162.    Delay(200L);
  163.    endrip();
  164.    printf("!");               /* RipScrip off */
  165.    Delay(50L);
  166.  
  167.    return 0;
  168. }
  169.  
  170.  
  171.  
  172. /*  RIP Palette is 64 EGA kleuren     */
  173. /*  default 16 color RIP palette :    */
  174. /*  Value Color          EGAnr  RGB   */
  175.  
  176. /*  00    Black          0   0x0000  (00 is always background color) */
  177. /*  01    Blue           1   0x000A  */
  178. /*  02    Green          2   0x00A0  */
  179. /*  03    Cyan           3   0x00AA  */
  180. /*  04    Red            4   0x0A00  */
  181. /*  05    Magenta        5   0x0A0A  */
  182. /*  06    Brown          20  0x0A50  ( 7 ?)  */
  183. /*  07    Light Gray     7   0x0AAA  (20 ?)  */
  184. /*  08    Dark  Gray     56  0x0555  */
  185. /*  09    Light Blue     57  0x055F  */
  186. /*  0A    Light Green    58  0x05F5  */
  187. /*  0B    Light Cyan     59  0x05FF  */
  188. /*  0C    Light Red      60  0x0F55  */
  189. /*  0D    Light Magenta  61  0x0F5F  */
  190. /*  0E    Yellow         62  0x0FF5  */
  191. /*  0F    White          63  0x0FFF  */
  192.  
  193.