home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 171.lha / SupLib / initdeem.c < prev    next >
Text File  |  1988-04-28  |  1KB  |  48 lines

  1.  
  2. /*
  3.  *  DEEMU NW structure auto init.
  4.  *
  5.  *  Intuition must be openned.
  6.  */
  7.  
  8. typedef struct NewWindow NW;
  9. typedef struct Screen     SCR;
  10.  
  11. InitDeemuNW(ary, nw)
  12. register short *ary;
  13. register NW *nw;
  14. {
  15.     register short alen = ary[3];
  16.     SCR Scr;
  17.  
  18.     if (GetScreenData(&Scr, sizeof(Scr), nw->Type, nw->Screen) == 0) {
  19.     Scr.Width = 320;
  20.     Scr.Height= 200;
  21.     }
  22.     if (alen >= 8) {
  23.     if ((nw->Width   = ary[6]) < 0)
  24.         nw->Width += Scr.Width;
  25.     if ((nw->Height  = ary[7]) < 0)
  26.         nw->Height+= Scr.Height;
  27.     }
  28.     if (alen >= 4) {
  29.     if ((nw->LeftEdge= ary[4]) < 0)
  30.         nw->LeftEdge += Scr.Width - nw->Width;
  31.     if ((nw->TopEdge = ary[5]) < 0)
  32.         nw->TopEdge += Scr.Height - nw->Height;
  33.     }
  34.     if (nw->LeftEdge < 0 || nw->TopEdge < 0 || nw->Width < 0 || nw->Height < 0 ||
  35.     nw->LeftEdge + nw->Width > Scr.Width || nw->TopEdge + nw->Height > Scr.Height) {
  36.  
  37.     nw->LeftEdge = nw->TopEdge = 0;
  38.     nw->Width = 320;
  39.     nw->Height= 100;
  40.     }
  41.     if (alen >= 9)
  42.     nw->DetailPen = ary[8] >> 8;
  43.     if (alen >= 10)
  44.     nw->BlockPen  = ary[8];
  45. }
  46.  
  47.  
  48.