This patch resolves some trouble with bitmap drawing (DIBs), when the y-axis uses negative mapping (LPtoDP). This makes Aut0CaD r. 14 usable under wine. Please note bug #720, which was closed by this patch and note any problems w. the patch. The second patch is a simple suggestion about a NULL handler. IMHO all NULLs coming from external programs-libs should be handled in a prog. In that case, a NULL causes no harm, but I guess my 'early test' may introduce a minor speedup.
--- ../wine-old1/objects/gdiobj.c Wed Jun 5 01:17:54 2002 +++ objects/gdiobj.c Thu Jun 20 21:40:56 2002 @@ -777,6 +776,9 @@ { GDIOBJHDR *ptr = NULL; + if (!handle) + return NULL; /* Handle NULL (even if M$ wouldn't). Am I right? */ + _EnterSysLevel( &GDI_level ); if (handle & 2) /* GDI heap handle */
--- ../wine-old1/graphics/x11drv/dib.c Wed Jun 5 01:16:58 2002 +++ graphics/x11drv/dib.c Thu Jun 20 21:49:55 2002 @@ -17,6 +17,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + /* Changelog: 20/6/2002 : some hack for partial dib on negative-y axis + * solves bug #720 ! + */ #include "config.h" @@ -4795,9 +4797,11 @@ descr.gc = physDev->gc; descr.xSrc = xSrc; descr.ySrc = tmpheight >= 0 ? lines-(ySrc-startscan)-cy+(oldcy-cy) - : ySrc - startscan; - descr.xDest = dc->DCOrgX + XLPTODP( dc, xDest ); - descr.yDest = dc->DCOrgY + YLPTODP( dc, yDest ) + + : lines-(ySrc-startscan)-cy+(oldcy-cy); + /*: ySrc - startscan; / * 0- */ + /* The hack above was found by trial and error. Report any objections please! */ + descr.xDest = physDev->org.x + XLPTODP( dc, xDest ); + descr.yDest = physDev->org.y + YLPTODP( dc, yDest ) + (tmpheight >= 0 ? oldcy-cy : 0); descr.width = cx; descr.height = cy;