home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 056.lha / Four / image.c < prev    next >
C/C++ Source or Header  |  1986-11-20  |  2KB  |  82 lines

  1. /* four in a row's image and border structures */
  2.  
  3. #include "imagedata.c"
  4.  
  5. void set_image(), init_image(), set_border(), init_border();
  6.  
  7. struct Image pole, base_top, base_bot,
  8.              ball_1, ball_2, base_ball_1, base_ball_2,
  9.              clear_block, top_square, end_rect,
  10.              rendimage, selectimage,
  11.              top_left, top_right, bot_left;
  12.  
  13. struct Border line1;
  14.  
  15.  
  16. void set_image(image, l, t, w, h, d, data, ppick, ponoff)
  17. struct Image *image;
  18. SHORT l, t, w, h, d, *data;
  19. UBYTE ppick, ponoff;
  20. {
  21.    image-> LeftEdge    =  l;
  22.    image-> TopEdge     =  t;
  23.    image-> Width       =  w;
  24.    image-> Height      =  h;
  25.    image-> Depth       =  d;
  26.    image-> ImageData   =  data;
  27.    image-> PlanePick   =  ppick;
  28.    image-> PlaneOnOff  =  ponoff;
  29.    image-> NextImage   =  NULL;
  30.  
  31.    return;
  32. }
  33.  
  34.  
  35. void init_images()
  36. {
  37.    set_image(&pole, 5, 0, 2, 10, 1, &pole_data[0], 0x0008, 0x0005);
  38.    set_image(&ball_1, 1, 0, 10, 10, 3, &ball_1_data[0], 0x0007, 0x0000);
  39.    set_image(&ball_2, 1, 0, 10, 10, 3, &ball_2_data[0], 0x0007, 0x0000);
  40.    set_image(&base_ball_1, 1,0,10,10,3,&bball_1_data[0],0x0007, 0x0000);
  41.    set_image(&base_ball_2, 1,0,10,10,3,&bball_2_data[0],0x0007, 0x0000);
  42.    set_image(&base_top, 0, 0, MAXX*COLS+10, 10, 0, NULL, 0x0000, 0x0002);
  43.    set_image(&base_bot, 0, 0, MAXX*COLS+30, 20, 0, NULL, 0x0000, 0x0008);
  44.    set_image(&clear_block, 0, 0, MAXX*COLS, MAXY*ROWS, 0, NULL, 0x0, 0x0);
  45.    set_image(&rendimage, 0, 0, 11, 11, 3, &knob_out[0], 0x000b, 0x0000);
  46.    set_image(&selectimage, 0, 0, 11, 11, 3, &knob_in[0], 0x000b, 0x0000);
  47.    set_image(&top_square, 0, 0, 10, 10, 0, NULL, 0x0000, 0x0008);
  48.    set_image(&end_rect, 0, 0, 10, 10, 0, NULL, 0x0000, 0x000a);
  49.    set_image(&top_left, 0, 0, 10, 10, 2, &top_left_data[0], 0x000a, 0x0000);
  50.    set_image(&top_right, 0, 0, 10, 10, 2, &top_right_data[0], 0x000a,0x0000);
  51.    set_image(&bot_left, 0, 0, 10, 10, 2, &bot_left_data[0], 0x000a, 0x0000);
  52.  
  53.    init_border();
  54.  
  55.    return;
  56. }
  57.  
  58.  
  59. void set_border(border, l, t, f, c, p)
  60. struct Border *border;
  61. SHORT l, t, f, c, *p;
  62. {
  63.    border-> LeftEdge    =  l;
  64.    border-> TopEdge     =  t;
  65.    border-> FrontPen    =  f;
  66.    border-> BackPen     =  0;
  67.    border-> DrawMode    =  JAM1;
  68.    border-> Count       =  c;
  69.    border-> XY          =  p;
  70.    border-> NextBorder  =  NULL;
  71.  
  72.    return;
  73. }
  74.  
  75.  
  76. void init_border()
  77. {
  78.    set_border(&line1, XOFF+5, YOFF+8*9+8, 12, 6, &line1_data[0]);
  79.  
  80.    return;
  81. }
  82.