Newsgroups: comp.sys.atari.st
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!snorkelwacker.mit.edu!ira.uka.de!fauern!faui43.informatik.uni-erlangen.de!lsmichae
From: lsmichae@immd4.informatik.uni-erlangen.de (Lars Michael)
Subject: vro_cpyfmt() blues
Message-ID: <1991May21.104617.26475@informatik.uni-erlangen.de>
Keywords: ATARI ST, GEM, VDI, C
Organization: CSD., University of Erlangen, Germany
Date: Tue, 21 May 1991 10:46:17 GMT
Lines: 60


I have some problems with the VDI function 'copy raster opaque'.

I tried to save ( and restore later) a rectangular area of the
hi rez screen.

I've used follwing routine:

VOID copy_block(dest_adr, src_adr, x, y, w, h)
 BYTE *dest_adr;
 BYTE *src_adr;
 WORD x, y, w, h;
 
{ WORD line;
  MFDB dest_mfdb;
  MFDB src_mfdb;
  WORD pxyarray[8];
  
  line = (Getrez()==2)?80:160;	/* get number  of Words in scanline */
  src_mfdb.fd_addr = src_adr;
  src_mfdb.fd_w = work_out[0]+1;
  src_mfdb.fd_h = work_out[1]+1;
  src_mfdb.fd_wdwidth = line;
  src_mfdb.fd_stand = 0;	/* use device specific format */
  src_mfdb.fd_nplanes = 4>>Getrez();
  pxyarray[0] = x;
  pxyarray[1] = y;
  pxyarray[2] = x+w+3;
  pxyarray[3] = y+h+3;

  dest_mfdb = src_mfdb;		/* dest_mfdb is identical .. */
  dest_mfdb.fd_addr = dest_adr;	/* except the address */
  pxyarray[4] = x;
  pxyarray[5] = y;
  pxyarray[6] = x+w+3;
  pxyarray[7] = y+h+3;

  (VOID) v_hide_c(VdiHandle);
  vro_cpyfm(VdiHandle, 3, pxyarray, &src_mfdb, &dest_mfdb);
  (VOID) v_show_c(VdiHandle, 0);
}

The routine will be entered by a call like

copy_block(Logbase(), temp, xdial, ydial, wdial, hdial);

Now, can someone tell me, what's wrong ?

---

								Lars

+----------------------------------------+----------------------------------+
|     lsmichae@faui43.uni-erlangen.de    |    | | |                         |
|             Lars Michael               |    | | |   "Down with ATARI,     |
|  Graduate Student of Computer Science  |   /  |  \  Long live the ST !"   |
|    at University of Erlangen/Germany   |  /   |   \                       |
+----------------------------------------+----------------------------------|
|  "May the Schwartz be with you!"                                          |
+---------------------------------------------------------------------------+
