home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / networking / dnet / dnet2.3.2 / amiga / suplib / initdeemunw.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-29  |  1.1 KB  |  53 lines

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