/* four in a row's image and border structures */

#include "imagedata.c"

void set_image(), init_image(), set_border(), init_border();

struct Image pole, base_top, base_bot,
             ball_1, ball_2, base_ball_1, base_ball_2,
             clear_block, top_square, end_rect,
             rendimage, selectimage,
             top_left, top_right, bot_left;

struct Border line1;


void set_image(image, l, t, w, h, d, data, ppick, ponoff)
struct Image *image;
SHORT l, t, w, h, d, *data;
UBYTE ppick, ponoff;
{
   image-> LeftEdge    =  l;
   image-> TopEdge     =  t;
   image-> Width       =  w;
   image-> Height      =  h;
   image-> Depth       =  d;
   image-> ImageData   =  data;
   image-> PlanePick   =  ppick;
   image-> PlaneOnOff  =  ponoff;
   image-> NextImage   =  NULL;

   return;
}


void init_images()
{
   set_image(&pole, 5, 0, 2, 10, 1, &pole_data[0], 0x0008, 0x0005);
   set_image(&ball_1, 1, 0, 10, 10, 3, &ball_1_data[0], 0x0007, 0x0000);
   set_image(&ball_2, 1, 0, 10, 10, 3, &ball_2_data[0], 0x0007, 0x0000);
   set_image(&base_ball_1, 1,0,10,10,3,&bball_1_data[0],0x0007, 0x0000);
   set_image(&base_ball_2, 1,0,10,10,3,&bball_2_data[0],0x0007, 0x0000);
   set_image(&base_top, 0, 0, MAXX*COLS+10, 10, 0, NULL, 0x0000, 0x0002);
   set_image(&base_bot, 0, 0, MAXX*COLS+30, 20, 0, NULL, 0x0000, 0x0008);
   set_image(&clear_block, 0, 0, MAXX*COLS, MAXY*ROWS, 0, NULL, 0x0, 0x0);
   set_image(&rendimage, 0, 0, 11, 11, 3, &knob_out[0], 0x000b, 0x0000);
   set_image(&selectimage, 0, 0, 11, 11, 3, &knob_in[0], 0x000b, 0x0000);
   set_image(&top_square, 0, 0, 10, 10, 0, NULL, 0x0000, 0x0008);
   set_image(&end_rect, 0, 0, 10, 10, 0, NULL, 0x0000, 0x000a);
   set_image(&top_left, 0, 0, 10, 10, 2, &top_left_data[0], 0x000a, 0x0000);
   set_image(&top_right, 0, 0, 10, 10, 2, &top_right_data[0], 0x000a,0x0000);
   set_image(&bot_left, 0, 0, 10, 10, 2, &bot_left_data[0], 0x000a, 0x0000);

   init_border();

   return;
}


void set_border(border, l, t, f, c, p)
struct Border *border;
SHORT l, t, f, c, *p;
{
   border-> LeftEdge    =  l;
   border-> TopEdge     =  t;
   border-> FrontPen    =  f;
   border-> BackPen     =  0;
   border-> DrawMode    =  JAM1;
   border-> Count       =  c;
   border-> XY          =  p;
   border-> NextBorder  =  NULL;

   return;
}


void init_border()
{
   set_border(&line1, XOFF+5, YOFF+8*9+8, 12, 6, &line1_data[0]);

   return;
}
