Changeset 1710 for trunk/src/gdi32/dibsect.cpp
- Timestamp:
- Nov 12, 1999, 12:38:45 PM (26 years ago)
- 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:23sandervl Exp $ */1 /* $Id: dibsect.cpp,v 1.8 1999-11-12 11:38:38 sandervl Exp $ */ 2 2 3 3 /* … … 20 20 #include "dibsect.h" 21 21 22 HWND WIN32API WindowFromDC(HDC hdc); 23 HWND Win32ToOS2Handle(HWND hwnd); 24 25 BOOL APIENTRY _GpiEnableYInversion (HPS hps, LONG lHeight); 26 27 inline 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 22 39 //NOTE: 23 40 //This is not a complete solution for CreateDIBSection, but enough for Quake 2! … … 147 164 //****************************************************************************** 148 165 //****************************************************************************** 149 #if 1150 166 BOOL DIBSection::BitBlt(HDC hdcDest, int nXdest, int nYdest, int nWidth, 151 167 int nHeight, int nXsrc, int nYsrc, DWORD Rop) 152 168 { 153 HWND hwndDest = WinWindowFromDC(hdcDest);154 169 HPS hps = (HPS)hdcDest; 155 170 POINTL point[4]; 156 171 LONG rc; 157 172 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); 160 175 if(hwndDest != 0) { 161 176 hps = WinGetPS(hwndDest); … … 165 180 return(FALSE); 166 181 } 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)); 167 184 168 185 point[0].x = nXdest; … … 182 199 else point[3].y = nYsrc + nHeight; 183 200 184 #if 0201 #if 1 185 202 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); 190 204 } 191 205 … … 209 223 return(FALSE); 210 224 } 211 #else212 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 #endif251 225 //****************************************************************************** 252 226 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.