home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d158 / yachtc3.lha / YachtC3 / src / endless.h < prev    next >
C/C++ Source or Header  |  1988-10-02  |  12KB  |  357 lines

  1.    static char *textline [MAXLINES+4] = {
  2. "Players",
  3. " ",
  4. "Aces       ",
  5. "Twos       ",
  6. "Threes     ",
  7. "Fours      ",
  8. "Fives      ",
  9. "Sixes      ",
  10. " ",
  11. "Upper Total",
  12. "Bonus      ",
  13. " ",
  14. "3 of a Kind",
  15. "4 of a Kind",
  16. "Full House ",
  17. "Sm Straight",
  18. "Lg Straight",
  19. "Yacht      ",
  20. "Yarboro    ",
  21. " ",
  22. "Lower Total",
  23. " ",
  24. "Grand Total",
  25. "  One   ",
  26. "  Two   ",
  27. " Three  ",
  28. "  Four  "};
  29.  
  30. #define INDENT    20
  31. #define INDENT2   16
  32. /* ****************** Pre-initialized Intuition Structures************* */
  33.  
  34.  
  35. struct TextAttr StdFont =
  36.    {
  37.    "topaz.font",              /* Font Name */
  38.    TOPAZ_SIXTY,               /* Font Height */
  39.    FS_NORMAL,                 /* Style */
  40.    FPF_ROMFONT,               /* Preferences */
  41.    };
  42.  
  43. /************* Images structures ***************/
  44.  
  45. struct Image Blank =
  46. {
  47.    0,0,         /* left, top */
  48.    BLANKW,BLANKH,1,      /* width, height, depth */
  49.    NULL,         /* image data */
  50.    0x00,0x01,      /* PlanePick, PlaneOnOff */
  51.    NULL,         /* NextImage */
  52.  
  53. };
  54. /* An array of six image structs, holding the images of each die
  55.    face, from 1-6 */
  56.  
  57. struct Image DieImage []={
  58. {
  59.    DIEHOFF,DIEVOFF,   /* left, top */
  60.    DIEW,DIEH,1,      /* width, height, depth */
  61.    NULL,            /* dummy image data--to be filled in after image data
  62.                        is moved to chip memory */
  63.    YELP-REDP,REDP,         /* PlanePick, PlaneOnOff */
  64.    NULL            /* NextImage */
  65.  
  66. },
  67.  
  68.  
  69. {DIEHOFF,DIEVOFF,DIEW,DIEH,1,NULL,YELP-REDP,REDP,NULL},   /*die images 1-5 */
  70. {DIEHOFF,DIEVOFF,DIEW,DIEH,1,NULL,YELP-REDP,REDP,NULL},
  71. {DIEHOFF,DIEVOFF,DIEW,DIEH,1,NULL,YELP-REDP,REDP,NULL},
  72. {DIEHOFF,DIEVOFF,DIEW,DIEH,1,NULL,YELP-REDP,REDP,NULL},
  73. {DIEHOFF,DIEVOFF,DIEW,DIEH,1,NULL,YELP-REDP,REDP,NULL},
  74.  
  75.  
  76. };
  77.  
  78. /*******Here come da Gadgets ********/
  79.  
  80. struct Gadget DieGadg [6] ={
  81. {
  82.    NULL,                  /* Next Gadget */
  83.    BLANKL,BLANKT,            /* Left Edge, Top Edge */
  84.    BLANKW,BLANKH,            /* Width, Height */
  85.    GADGHIMAGE + GADGIMAGE,      /*Flags--highlight type, render type */
  86.    NULL,                  /* Activation flags */
  87.    BOOLGADGET,               /* Gadget type */
  88.    (APTR)&DieImage[5],         /* Image structure for drawing gadget */
  89.    (APTR)&Blank,            /* Alternate image for highlighting */
  90.    NULL,                  /* Intuitext structure for gadget text */
  91.    NULL,                  /* Mutual exclude, non-functional */
  92.    NULL,                  /* Special info for proportional, string */
  93.    NULL,
  94.  
  95.          /* Gadget ID/*
  96.    NULL,                  /* User Data */
  97. },
  98.  
  99. {&DieGadg[0],BLANKL,BLANKS+BLANKT,BLANKW,BLANKH,   /* DieGadg 1-4 */
  100. GADGHIMAGE + GADGIMAGE,NULL,BOOLGADGET,
  101. (APTR)&DieImage[5],(APTR)&Blank,NULL,NULL,NULL,NULL,NULL},
  102.  
  103. {&DieGadg[1],BLANKL,(2*BLANKS)+BLANKT,BLANKW,BLANKH,
  104. GADGHIMAGE + GADGIMAGE,NULL,BOOLGADGET,
  105. (APTR)&DieImage[5],(APTR)&Blank,NULL,NULL,NULL,NULL,NULL},
  106.  
  107. {&DieGadg[2],BLANKL,(3*BLANKS)+BLANKT,BLANKW,BLANKH,
  108. GADGHIMAGE + GADGIMAGE,NULL,BOOLGADGET,
  109. (APTR)&DieImage[5],(APTR)&Blank,NULL,NULL,NULL,NULL,NULL},
  110.  
  111. {&DieGadg[3],BLANKL,(4*BLANKS)+BLANKT,BLANKW,BLANKH,
  112. GADGHIMAGE + GADGIMAGE,NULL,BOOLGADGET,
  113. (APTR)&DieImage[5],(APTR)&Blank,NULL,NULL,NULL,NULL,NULL},
  114.  
  115. };
  116.  
  117. struct IntuiText RollText =
  118.    {YELP-REDP,REDP,JAM2,0,7,&StdFont," ROLL",NULL};
  119.  
  120. struct Gadget ButtonGadget =
  121. {
  122.    &DieGadg[4],                  /* Next Gadget */
  123.    BLANKL,(5*BLANKS)+BLANKT,   /* Left Edge, Top Edge */
  124.    BLANKW,BLANKH,            /* Width, Height */
  125.    GADGHCOMP + GADGIMAGE+ GADGDISABLED,       /*Flags--highlight type, render type */
  126.    RELVERIFY,                /* Activation flags */
  127.    BOOLGADGET,               /* Gadget type */
  128.    (APTR)&Blank,            /* Image structure for drawing gadget */
  129.    NULL,                  /* Alternate image for highlighting */
  130.    &RollText,             /* Intuitext structure for gadget text */
  131.    NULL,                  /* Mutual exclude, non-functional */
  132.    NULL,                  /* Special info for proportional, string */
  133.    NULL,                  /* Gadget ID/*
  134.    NULL,                  /* User Data */
  135. };
  136.  
  137. struct Gadget ScoreGadget ={
  138.    &ButtonGadget,            /* Next Gadget */
  139.    VLINL+4,HLINT+(2*HLINS)-5,   /* Left Edge, Top Edge */
  140.    VLINS-6,(17*HLINS),         /* Width, Height */
  141.    GADGHNONE,               /*Flags--highlight type, render type */
  142.    RELVERIFY,               /* Activation flags */
  143.    BOOLGADGET,               /* Gadget type */
  144.    NULL,                  /* Image structure for drawing gadget */
  145.    NULL,                  /* Alternate image for highlighting */
  146.    NULL,             /* Intuitext structure for gadget text */
  147.    NULL,                  /* Mutual exclude, non-functional */
  148.    NULL,                  /* Special info for proportional, string */
  149.    NULL,                  /* Gadget ID/*
  150.    NULL                  /* User Data */
  151. };
  152. /************* finally, the Menus and their ITexts *************/
  153.  
  154. struct IntuiText AboutText [11] = {
  155.  
  156.    {BLUP,BGRP,JAM2,INDENT,9,&StdFont,
  157.    "                                             ",NULL},
  158.    {BLUP,BGRP,JAM2,INDENT,18,&StdFont,
  159.    "                    YachtC                   ",&AboutText[0]},
  160.  
  161.    {BLUP,BGRP,JAM2,INDENT,27,&StdFont,
  162.    "       Copyright 1985 by Sheldon Leemon      ",&AboutText[1]},
  163.  
  164.    {BLUP,BGRP,JAM2,INDENT,36,&StdFont,
  165.    "                                             ",&AboutText[2]},
  166.  
  167.    {BLUP,BGRP,JAM2,INDENT,45,&StdFont,
  168.    "  You may copy and distribute this program   ",&AboutText[3]},
  169.  
  170.    {BLUP,BGRP,JAM2,INDENT,54,&StdFont,
  171.    "  freely (i.e. for no money), but any kind   ",&AboutText[4]},
  172.  
  173.    {BLUP,BGRP,JAM2,INDENT,63,&StdFont,
  174.    "  of commercial exploitation is a no-no.     ",&AboutText[5]},
  175.  
  176.    {BLUP,BGRP,JAM2,INDENT,72,&StdFont,
  177.    "  **** Version 3.0  by Mark Schretlen ****   ",&AboutText[6]},
  178.  
  179.    {BLUP,BGRP,JAM2,INDENT,81,&StdFont,
  180.    "  of Calgary (Sound from Steve A.Bennett's   ",&AboutText[7]},
  181.  
  182.    {BLUP,BGRP,JAM2,INDENT,90,&StdFont,
  183.    "  scales source) Thankyou Sheldon & Steve.   ",&AboutText[8]},
  184.  
  185.    {BLUP,BGRP,JAM2,INDENT,98,&StdFont,
  186.    "                                             ",&AboutText[9]},
  187.  
  188. };
  189.  
  190. struct IntuiText InstructText [14] = {
  191.  
  192.    {BLUP,BGRP,JAM2,INDENT2,9,&StdFont,
  193.    "                                              ",NULL},
  194.  
  195.    {BLUP,BGRP,JAM2,INDENT2,18,&StdFont,
  196.    "                 Instructions                 ",&InstructText[0]},
  197.  
  198.    {BLUP,BGRP,JAM2,INDENT2,27,&StdFont,
  199.    "                                              ",&InstructText[1]},
  200.  
  201.    {BLUP,BGRP,JAM2,INDENT2,36,&StdFont,
  202.    "  To start game, select 1-4 Player game from  ",&InstructText[2]},
  203.  
  204.    {BLUP,BGRP,JAM2,INDENT2,45,&StdFont,
  205.    "  the Project menu.  Each  player gets up to  ",&InstructText[3]},
  206.  
  207.    {BLUP,BGRP,JAM2,INDENT2,54,&StdFont,
  208.    "  3 rolls of the  dice to make the best hand  ",&InstructText[4]},
  209.  
  210.    {BLUP,BGRP,JAM2,INDENT2,63,&StdFont,
  211.    "  possible.  Click on the  dice you  wish to  ",&InstructText[5]},
  212.  
  213.    {BLUP,BGRP,JAM2,INDENT2,72,&StdFont,
  214.    "  change, then click on the button below the  ",&InstructText[6]},
  215.  
  216.    {BLUP,BGRP,JAM2,INDENT2,81,&StdFont,
  217.    "  dice to roll.  If you  are satisfied  with  ",&InstructText[7]},
  218.  
  219.    {BLUP,BGRP,JAM2,INDENT2,90,&StdFont,
  220.    "  your hand, and wish to score, click on the  ",&InstructText[8]},
  221.  
  222.    {BLUP,BGRP,JAM2,INDENT2,99,&StdFont,
  223.    "  button  without  blanking  any  dice.  All  ",&InstructText[9]},
  224.  
  225.    {BLUP,BGRP,JAM2,INDENT2,108,&StdFont,
  226.    "  possible scores will appear in red on  the  ",&InstructText[10]},
  227.  
  228.    {BLUP,BGRP,JAM2,INDENT2,117,&StdFont,
  229.    "  scorepad.  Click on the one you want.       ",&InstructText[11]},
  230.  
  231.    {BLUP,BGRP,JAM2,INDENT2,126,&StdFont,
  232.    "                                              ",&InstructText[12]},
  233.  
  234. };
  235.  
  236. struct IntuiText OKText =
  237.    {BLUP,BGRP,JAM2,6,3,&StdFont," Proceed ",NULL};
  238.  
  239.  
  240.  
  241. struct IntuiText Menu0IText [] = {
  242.  
  243.    {
  244.    BLUP,BGRP,JAM2,      /* Front Pen, Back Pen, Draw Mode */
  245.    0,0,            /* Left Edge, Top Edge */
  246.    &StdFont,         /* pointer to Text Font */
  247.    " Start 1-Player Game ",   /* text of Menu Item */
  248.    NULL            /* pointer to next IText */
  249.    },
  250.  
  251.    {BLUP,BGRP,JAM2,0,0,&StdFont," Start 2-Player Game ",NULL },
  252.    {BLUP,BGRP,JAM2,0,0,&StdFont," Start 3-Player Game ",NULL },
  253.    {BLUP,BGRP,JAM2,0,0,&StdFont," Start 4-Player Game ",NULL },
  254. };
  255.  
  256. struct IntuiText Menu1IText [] = {
  257.    {BLUP,BGRP,JAM2,0,0,&StdFont," Instructions ",NULL },
  258.    {BLUP,BGRP,JAM2,0,0,&StdFont," About YachtC ",NULL },
  259. };
  260.  
  261. struct MenuItem Menu0Item[4] = {
  262.    {
  263.    &Menu0Item[1],         /* pointer to next Item */
  264.    0,0,210,9,      /* Left, Top, Width, Height */
  265.    ITEMTEXT | ITEMENABLED | HIGHCOMP,   /* Flags */
  266.    0,            /* no mutual exclude */
  267.    (APTR)&Menu0IText[0],   /* Render info */
  268.    NULL,NULL,NULL,         /*Alt Image, Command (amiga) char, subitem*/
  269.    MENUNULL      /* next select */
  270.    },
  271.  
  272.    {&Menu0Item[2],0,9,210,9,ITEMTEXT | ITEMENABLED | HIGHCOMP,
  273.    0,(APTR)&Menu0IText[1],NULL,NULL,NULL,MENUNULL},
  274.  
  275.    {&Menu0Item[3],0,18,210,9,ITEMTEXT | ITEMENABLED | HIGHCOMP,
  276.    0,(APTR)&Menu0IText[2],NULL,NULL,NULL,MENUNULL},
  277.  
  278.    {NULL,0,27,210,9,ITEMTEXT | ITEMENABLED | HIGHCOMP,
  279.    0,(APTR)&Menu0IText[3],NULL,NULL,NULL,MENUNULL}
  280. };
  281.  
  282. struct MenuItem Menu1Item[2] = {
  283.  
  284.    {&Menu1Item[1],0,0,140,9,ITEMTEXT | ITEMENABLED | HIGHCOMP,
  285.    0,(APTR)&Menu1IText[0],NULL,NULL,NULL,MENUNULL},
  286.  
  287.    {NULL,0,9,140,9,ITEMTEXT | ITEMENABLED | HIGHCOMP,
  288.    0,(APTR)&Menu1IText[1],NULL,NULL,NULL,MENUNULL}
  289.  
  290. };
  291.  
  292.  
  293. struct Menu BdMenu [2] = {
  294.    {
  295.    &BdMenu[1],      /* ptr to next Menu */
  296.    40,0,90,0,   /* left,top,width,height--top and height ignored */
  297.    MENUENABLED,   /* Flags */
  298.    " Start  ",   /* menu title */
  299.    &Menu0Item[0]   /* First Item in list */
  300.    },
  301.  
  302. {NULL,160,0,130,0,MENUENABLED," Information ",&Menu1Item[0]}
  303.  
  304. };
  305.  
  306. /* ********Pre-initialized NewScreen and NewWindow Structures*********** */
  307.  
  308.    struct NewScreen NewBdScr =
  309.       {
  310.       0,0,               /* LeftEdge (always=0),TopEdge */
  311.       640,200,3,
  312.  
  313.   /* Width, Height, Depth */
  314.       PURP,GRNP,         /* DetailPen and BlockPen */
  315.       HIRES,            /* special display modes */
  316.       CUSTOMSCREEN,         /* Screen Type */
  317.       &StdFont,            /* Pointer to Custom font structure*/
  318.       NULL,               /* Pointer to title text */
  319.       NULL,               /* Pointer to Screen Gadgets */
  320.       NULL,               /* Pointer to CustomBitMap */
  321.       };
  322.  
  323.  
  324. struct NewWindow NewBoardWindow =
  325.    {
  326.    0,0,         /* Left Edge, Top Edge */
  327.    640,200,      /* Width, Height */
  328.    BLUP,YELP,      /* Block Pen, Detail Pen */
  329.    GADGETUP + CLOSEWINDOW + MENUPICK,         /* IDCMP Flags */
  330.    SMART_REFRESH + ACTIVATE +WINDOWDEPTH
  331.    + BORDERLESS + WINDOWCLOSE,               /* Flags */
  332.    &ScoreGadget,  /* Pointer to First Gadget */
  333.    NULL,          /* Pointer to Check Mark Image */
  334.    "                     YachtC (V3.0)               ",  /* Title */
  335.    NULL,          /* Pointer to Screen structure */
  336.    NULL,         /* Pointer to custom Bit Map */
  337.    0,0,         /* Minimum Width, Height */
  338.    0,0,         /* Maximum Width, Height */
  339.    CUSTOMSCREEN   /* Type of Screen it resides on */
  340.    };
  341. struct NewWindow BackWindow =
  342.    {
  343.    0,0,         /* Left Edge, Top Edge */
  344.    640,200,      /* Width, Height */
  345.    BLUP,YELP,      /* Block Pen, Detail Pen */
  346.    NULL,         /* IDCMP Flags */
  347.    BACKDROP |  BORDERLESS,               /* Flags */
  348.    NULL,  /* Pointer to First Gadget */
  349.    NULL,          /* Pointer to Check Mark Image */
  350.    "                             ",  /* Title */
  351.    NULL,          /* Pointer to Screen structure */
  352.    NULL,         /* Pointer to custom Bit Map */
  353.    0,0,         /* Minimum Width, Height */
  354.    0,0,         /* Maximum Width, Height */
  355.    CUSTOMSCREEN   /* Type of Screen it resides on */
  356.    };
  357.