home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d170 / surf.lha / Surf / src / menu_image.c < prev    next >
C/C++ Source or Header  |  1988-11-22  |  5KB  |  178 lines

  1. #include "menuexp.h"
  2.  
  3. /*
  4.  * Menu description for selecting color mapping
  5.  */
  6. static struct IntuiText Specular = {
  7.      0, 1, JAM2, 20, 0, NULL, (UBYTE *)"Specular",  NULL
  8. };
  9.  
  10. static struct IntuiText revtext[] = {
  11.    { 0, 1, JAM2, 2, 0, NULL, (UBYTE *)"Rev. Axis",  NULL },
  12.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"X",   NULL },
  13.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"Y",   NULL }
  14. };
  15.  
  16. static struct IntuiText dithertext[] = {
  17.    { 0, 1, JAM2, 2, 0, NULL, (UBYTE *)"Dither",   NULL },
  18.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"none",   NULL },
  19.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"half",   NULL },
  20.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"full",   NULL }
  21. };
  22.  
  23.  
  24. static struct IntuiText MiscText[] = {
  25.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"Abort Draw",   NULL },
  26.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"Debug",   NULL },
  27.    { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"Flip XY Map", NULL }
  28. };
  29.  
  30. struct MenuItem revitems[] = {
  31.   { &revitems[1], /* next item */
  32.     90, 0, 80 , 10, /* x,y,w,h */
  33.     COLMEMFLAGS| CHECKED,
  34.     2, /* mutual exclude bits */
  35.     (APTR) &revtext[1],  /* grey */
  36.     NULL, /* highlight image */
  37.     'h', /* command byte ? */
  38.     NULL, /* submenu item */
  39.     0 /* next select for select dragging */
  40.     },
  41.   { NULL, /* next item */
  42.     90, 10, 80 , 10, /* x,y,w,h */
  43.     COLMEMFLAGS,
  44.     1, /* mutual exclude bits */
  45.     (APTR) &revtext[2],  /* grey */
  46.     NULL, /* highlight image */
  47.     'h', /* command byte ? */
  48.     NULL, /* submenu item */
  49.     0 /* next select for select dragging */
  50.     }
  51. };
  52.  
  53. struct MenuItem ditheritems[] = {
  54.   { &ditheritems[1], /* next item */
  55.     90, 0, 80 , 10, /* x,y,w,h */
  56.     COLMEMFLAGS,
  57.     2|4, /* mutual exclude bits */
  58.     (APTR) &dithertext[1],  /* grey */
  59.     NULL, /* highlight image */
  60.     'h', /* command byte ? */
  61.     NULL, /* submenu item */
  62.     0 /* next select for select dragging */
  63.     },
  64.   { &ditheritems[2], /* next item */
  65.     90, 10, 80 , 10, /* x,y,w,h */
  66.     COLMEMFLAGS,
  67.     4|1, /* mutual exclude bits */
  68.     (APTR) &dithertext[2],  /* grey */
  69.     NULL, /* highlight image */
  70.     'h', /* command byte ? */
  71.     NULL, /* submenu item */
  72.     0 /* next select for select dragging */
  73.     },
  74.   { NULL, /* next item */
  75.     90, 20, 80 , 10, /* x,y,w,h */
  76.     COLMEMFLAGS| CHECKED,
  77.     1|2, /* mutual exclude bits */
  78.     (APTR) &dithertext[3],  /* grey */
  79.     NULL, /* highlight image */
  80.     'h', /* command byte ? */
  81.     NULL, /* submenu item */
  82.     0 /* next select for select dragging */
  83.     }
  84. };
  85.  
  86.  
  87. #define IMAGE_HITWIDTH 96
  88.  
  89. struct MenuItem imageitems[] = {
  90.   { &imageitems[1], /* next item */
  91.     1, 0, IMAGE_HITWIDTH , 10, /* x,y,w,h */
  92.     COLMEMFLAGS,
  93.     2, /* mutual exclude bits */
  94.     (APTR) &revtext[0],  /* grey */
  95.     NULL, /* highlight image */
  96.     'h', /* command byte ? */
  97.     revitems, /* submenu item */
  98.     0 /* next select for select dragging */
  99.     },
  100.   { &imageitems[2], /* next item */
  101.     1, 10, IMAGE_HITWIDTH , 10, /* x,y,w,h */
  102.     COLMEMFLAGS,
  103.     1, /* mutual exclude bits */
  104.     (APTR) &dithertext[0],     /* red */
  105.     NULL, /* highlight image */
  106.     'h', /* command byte ? */
  107.     ditheritems, /* submenu item */
  108.     0 /* next select for select dragging */
  109.     },
  110.   { &imageitems[3], /* next item */
  111.     1, 20, IMAGE_HITWIDTH , 10, /* x,y,w,h */
  112.     COLMEMFLAGS|MENUTOGGLE,
  113.     0, /* mutual exclude bits */
  114.     (APTR) &Specular,
  115.     NULL, /* highlight image */
  116.     'h', /* command byte ? */
  117.     NULL, /* submenu item */
  118.     0 /* next select for select dragging */
  119.     },
  120.   { &imageitems[4], /* next item */
  121.     1, 30, IMAGE_HITWIDTH , 10, /* x,y,w,h */
  122.     COLMEMFLAGS|MENUTOGGLE,
  123.     0, /* mutual exclude bits */
  124.     (APTR) &MiscText[2], /* Flip XY */
  125.     NULL, /* highlight image */
  126.     'h', /* command byte ? */
  127.     NULL, /* submenu item */
  128.     0 /* next select for select dragging */
  129.     },
  130.   { &imageitems[5], /* next item */
  131.     1, 40, 100 , 10, /* x,y,w,h */
  132.     COLMEMFLAGS| MENUTOGGLE,
  133.     0, /* mutual exclude bits */
  134.     (APTR) &MiscText[0], /* AbortDraw */
  135.     NULL, /* highlight image */
  136.     'h', /* command byte ? */
  137.     NULL, /* submenu item */
  138.     0 /* next select for select dragging */
  139.     },
  140.   { NULL, /* next item */
  141.     1, 50, IMAGE_HITWIDTH, 10, /* x,y,w,h */
  142.     COLMEMFLAGS|MENUTOGGLE,
  143.     0, /* mutual exclude bits */
  144.     (APTR) &MiscText[1],   /* debug */
  145.     NULL, /* highlight image */
  146.     'h', /* command byte ? */
  147.     NULL, /* submenu item */
  148.     0 /* next select for select dragging */
  149.     }
  150. };
  151.  
  152. USHORT *AbortDrawPtr = &imageitems[4].Flags;
  153. USHORT *DebugOnPtr = &imageitems[5].Flags;
  154.  
  155.  
  156. static void MenuSetImage()
  157. {
  158.     if( Selected(revitems[0])) {
  159.         SetRevAxis(0); /* Xaxis */
  160.     }
  161.     else {
  162.         SetRevAxis(1); /* Yaxis */
  163.     }
  164.  
  165.     if( Selected(ditheritems[0])) {
  166.         DitherMask = 0;
  167.     }
  168.     else if (Selected(ditheritems[1] ) ) {
  169.         DitherMask = 4;
  170.     }
  171.     else {
  172.         DitherMask = 7;
  173.     }
  174.     SpecOn = Selected( imageitems[2])?true:false;
  175.     FlipImgPix( Selected(imageitems[3])?true:false);
  176. }
  177.  
  178.