Ignore:
Timestamp:
Nov 12, 1999, 12:38:45 PM (26 years ago)
Author:
sandervl
Message:

DIBSection changes, EB's file io additions, Jens Weissner's changes to several dlls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/dibsect.cpp

    r1686 r1710  
    1 /* $Id: dibsect.cpp,v 1.7 1999-11-10 14:15:23 sandervl Exp $ */
     1/* $Id: dibsect.cpp,v 1.8 1999-11-12 11:38:38 sandervl Exp $ */
    22
    33/*
     
    2020#include "dibsect.h"
    2121
     22HWND WIN32API WindowFromDC(HDC hdc);
     23HWND Win32ToOS2Handle(HWND hwnd);
     24
     25BOOL    APIENTRY _GpiEnableYInversion (HPS hps, LONG lHeight);
     26
     27inline BOOL APIENTRY GpiEnableYInversion (HPS hps, LONG lHeight)
     28{
     29 BOOL yyrc;
     30 USHORT sel = RestoreOS2FS();
     31
     32    yyrc = _GpiEnableYInversion(hps, lHeight);
     33    SetFS(sel);
     34
     35    return yyrc;
     36}
     37
     38
    2239//NOTE:
    2340//This is not a complete solution for CreateDIBSection, but enough for Quake 2!
     
    147164//******************************************************************************
    148165//******************************************************************************
    149 #if 1
    150166BOOL DIBSection::BitBlt(HDC hdcDest, int nXdest, int nYdest, int nWidth,
    151167                        int nHeight, int nXsrc, int nYsrc, DWORD Rop)
    152168{
    153  HWND   hwndDest = WinWindowFromDC(hdcDest);
    154169 HPS    hps = (HPS)hdcDest;
    155170 POINTL point[4];
    156171 LONG   rc;
    157172
    158   dprintf(("DIBSection::BitBlt %X %x (%d,%d) to (%d,%d) (%d,%d) rop %x\n", hdcDest, hwndDest, nXdest, nYdest, nWidth, nHeight, nXsrc, nYsrc, Rop));
    159 
     173  HWND hwndDest = WindowFromDC(hdcDest);
     174  hwndDest = Win32ToOS2Handle(hwndDest);
    160175  if(hwndDest != 0) {
    161176         hps = WinGetPS(hwndDest);
     
    165180        return(FALSE);
    166181  }
     182
     183  dprintf(("DIBSection::BitBlt %X %x (%d,%d) to (%d,%d) (%d,%d) rop %x\n", hdcDest, hwndDest, nXdest, nYdest, nWidth, nHeight, nXsrc, nYsrc, Rop));
    167184
    168185  point[0].x = nXdest;
     
    182199  else  point[3].y = nYsrc + nHeight;
    183200
    184 #if 0
     201#if 1
    185202  if(fFlip & FLIP_VERT) {
    186     ULONG y;
    187         y = point[0].y;
    188         point[0].y = point[1].y;
    189         point[1].y = y;
     203        GpiEnableYInversion(hps, nHeight);
    190204  }
    191205
     
    209223  return(FALSE);
    210224}
    211 #else
    212 BOOL DIBSection::BitBlt(HDC hdcDest, int nXdest, int nYdest, int nWidth,
    213                         int nHeight, int nXsrc, int nYsrc, DWORD Rop)
    214 {
    215  HPS    hps = (HPS)hdcDest;
    216  POINTL point[4];
    217  LONG   rc;
    218 
    219   if(hps == 0) {
    220         eprintf(("DIBSection::BitBlt, hps == 0"));
    221         return(FALSE);
    222   }
    223 
    224 //  dprintf(("DIBSection::BitBlt (%d,%d) to (%d,%d) (%d,%d)\n", nXsrc, nYsrc, nXdest, nYdest, nXdest+ nWidth, nYdest + nHeight));
    225   point[0].x = nXdest;
    226   point[0].y = nYdest;
    227   point[1].x = nXdest + nWidth - 1;
    228   point[1].y = nYdest + nHeight - 1;
    229   point[2].x = nXsrc;
    230   point[2].y = nYsrc;
    231   if(nXsrc + nWidth > pOS2bmp->cx) {
    232         point[3].x = pOS2bmp->cx;
    233   }
    234   else  point[3].x = nXsrc + nWidth;
    235 
    236   if(nYsrc + nHeight > pOS2bmp->cy) {
    237         point[3].y = pOS2bmp->cy;
    238   }
    239   else  point[3].y = nYsrc + nHeight;
    240 
    241   rc = GpiDrawBits(hps, bmpBits, pOS2bmp, 4, &point[0], ROP_SRCCOPY, BBO_OR);
    242 //  dprintf(("DIBSection::BitBlt %X (%d,%d) (%d,%d) to (%d,%d) (%d,%d) returned %d\n", hps, point[0].x, point[0].y, point[1].x, point[1].y, point[2].x, point[2].y, point[3].x, point[3].y, rc));
    243 
    244   if(rc == GPI_OK)
    245         return(TRUE);
    246   dprintf(("DIBSection::BitBlt %X (%d,%d) (%d,%d) to (%d,%d) (%d,%d) returned %d\n", hps, point[0].x, point[0].y, point[1].x, point[1].y, point[2].x, point[2].y, point[3].x, point[3].y, rc));
    247   dprintf(("WinGetLastError returned %X\n", WinGetLastError(WinQueryAnchorBlock(hwndParent)) & 0xFFFF));
    248   return(FALSE);
    249 }
    250 #endif
    251225//******************************************************************************
    252226//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.