- Timestamp:
- Nov 9, 2000, 7:16:57 PM (25 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/dibitmap.cpp
r4484 r4574 1 /* $Id: dibitmap.cpp,v 1.1 0 2000-10-16 11:01:47sandervl Exp $ */1 /* $Id: dibitmap.cpp,v 1.11 2000-11-09 18:16:56 sandervl Exp $ */ 2 2 3 3 /* … … 29 29 HBITMAP rc; 30 30 31 //SvL: Completely wrong result when creating a 1bpp bitmap here (converted 32 // to 8bpp by Open32) 33 if(lpbmih->biBitCount == 1) { 34 dprintf(("WARNING: CreateDIBitmap doesn't handle 1bpp bitmaps very well!!!!!")); 35 } 36 31 37 //TEMPORARY HACK TO PREVENT CRASH IN OPEN32 (WSeB GA) 32 38 … … 78 84 { 79 85 dprintf(("GDI32: CreateDisardableBitmap\n")); 80 return O32_CreateCompatibleBitmap(hDC, nWidth, nHeight);86 return CreateCompatibleBitmap(hDC, nWidth, nHeight); 81 87 } 82 88 //****************************************************************************** … … 154 160 // and use it to set the DIBColorTable 155 161 nrcolors = GetPaletteEntries( hpalCur, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal); 156 dsect->SetDIBColorTable(0, nrcolors, ( RGBQUAD*)&Pal);162 dsect->SetDIBColorTable(0, nrcolors, (LPPALETTEENTRY)&Pal); 157 163 158 164 // Restore the DC Palette -
trunk/src/gdi32/dibsect.cpp
r4450 r4574 1 /* $Id: dibsect.cpp,v 1.4 1 2000-10-07 11:39:16 sandervl Exp $ */1 /* $Id: dibsect.cpp,v 1.42 2000-11-09 18:16:56 sandervl Exp $ */ 2 2 3 3 /* … … 395 395 //****************************************************************************** 396 396 //****************************************************************************** 397 int DIBSection::SetDIBColorTable(int startIdx, int cEntries, PALETTEENTRY *palentry) 398 { 399 int i; 400 401 if(startIdx + cEntries > (1 << pOS2bmp->cBitCount)) 402 { 403 dprintf(("DIBSection::SetDIBColorTable, invalid nr of entries %d %d\n", startIdx, cEntries)); 404 return(0); 405 } 406 407 for(i=startIdx;i<cEntries;i++) 408 { 409 pOS2bmp->argbColor[i].fcOptions = 0; 410 pOS2bmp->argbColor[i].bBlue = palentry[i].peBlue; 411 pOS2bmp->argbColor[i].bGreen = palentry[i].peGreen; 412 pOS2bmp->argbColor[i].bRed = palentry[i].peRed; 413 } 414 415 return(cEntries); 416 } 417 //****************************************************************************** 418 //****************************************************************************** 397 419 BOOL DIBSection::BitBlt(HDC hdcDest, int nXdest, int nYdest, int nDestWidth, 398 420 int nDestHeight, int nXsrc, int nYsrc, … … 428 450 429 451 if(fFrameWindowDC) { 430 GetWindowRect(hwndDest, &rect);452 GetWindowRect(hwndDest, &rect); 431 453 } 432 454 else GetClientRect(hwndDest, &rect); … … 488 510 } 489 511 */ 512 #ifdef INVERT 490 513 oldyinversion = GpiQueryYInversion(hps); 491 514 if(oldyinversion != 0) { … … 493 516 fRestoryYInversion = TRUE; 494 517 } 518 #endif 519 520 #ifdef DEBUG 521 RECTL rcltemp; 522 GreGetDCOrigin(hps, (PPOINTL)&rcltemp); 523 dprintf(("origin (%d,%d) yinv %d", rcltemp.xLeft, rcltemp.yBottom, oldyinversion)); 524 #endif 495 525 496 526 if(fFlip & FLIP_HOR) … … 572 602 destdib->sync(hps, nYdest, nDestHeight); 573 603 } 604 #ifdef INVERT 574 605 //restore old y inversion height 575 606 if(fRestoryYInversion) GpiEnableYInversion(hps, oldyinversion); 607 #endif 576 608 SetLastError(ERROR_SUCCESS_W); 577 609 578 610 return(TRUE); 579 611 } 612 #ifdef INVERT 580 613 if(fRestoryYInversion) GpiEnableYInversion(hps, oldyinversion); 614 #endif 581 615 582 616 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)); -
trunk/src/gdi32/dibsect.h
r4447 r4574 1 /* $Id: dibsect.h,v 1.2 1 2000-10-07 09:03:50 hughExp $ */1 /* $Id: dibsect.h,v 1.22 2000-11-09 18:16:56 sandervl Exp $ */ 2 2 3 3 /* … … 17 17 BYTE rgbReserved; 18 18 } RGBQUAD, *LPRGBQUAD; 19 20 typedef struct tagPALETTEENTRY 21 { 22 BYTE peRed, peGreen, peBlue, peFlags; 23 } PALETTEENTRY, *PPALETTEENTRY, *LPPALETTEENTRY; 24 19 25 #else 20 26 #define BITMAPINFO2 DWORD … … 94 100 void sync(DWORD xDst, DWORD yDst, DWORD widthDst, DWORD heightDst, PVOID bits); 95 101 int SetDIBColorTable(int startIdx, int cEntries, RGBQUAD *rgb); 102 int SetDIBColorTable(int startIdx, int cEntries, PALETTEENTRY *rgb); 96 103 97 104 int SetDIBits(HDC hdc, HBITMAP hbitmap, UINT startscan, UINT -
trunk/src/gdi32/gdi32.cpp
r4557 r4574 1 /* $Id: gdi32.cpp,v 1. 59 2000-11-05 18:48:21sandervl Exp $ */1 /* $Id: gdi32.cpp,v 1.60 2000-11-09 18:16:57 sandervl Exp $ */ 2 2 3 3 /* … … 22 22 #include "oslibgpi.h" 23 23 #include "oslibgdi.h" 24 #include <dcdata.h> 25 #include <win32wnd.h> 24 26 25 27 #define DBG_LOCALLOG DBG_gdi32 … … 85 87 //****************************************************************************** 86 88 //****************************************************************************** 87 ODINFUNCTION1(BOOL, DeleteDC, HDC, hdc)88 {89 return O32_DeleteDC(hdc);90 }91 //******************************************************************************92 //******************************************************************************93 89 HBRUSH WIN32API CreatePatternBrush(HBITMAP arg1) 94 90 { … … 137 133 dprintf(("CreateCompatibleDC %X returned %x", hdc, newHdc)); 138 134 return newHdc; 135 } 136 //****************************************************************************** 137 //****************************************************************************** 138 ODINFUNCTION1(BOOL, DeleteDC, HDC, hdc) 139 { 140 pDCData pHps = (pDCData)OSLibGpiQueryDCData((HPS)hdc); 141 if(!pHps) 142 { 143 dprintf(("WARNING: DeleteDC %x; invalid hdc!", hdc)); 144 SetLastError(ERROR_INVALID_HANDLE); 145 return 0; 146 } 147 SetLastError(ERROR_SUCCESS); 148 //Must call ReleaseDC for window dcs 149 if(pHps->hdcType == TYPE_1) { 150 return ReleaseDC(OS2ToWin32Handle(pHps->hwnd), hdc); 151 } 152 153 return O32_DeleteDC(hdc); 139 154 } 140 155 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.