- Timestamp:
- Jun 3, 2001, 4:52:47 PM (24 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/blit.cpp
r5870 r5901 1 /* $Id: blit.cpp,v 1.3 0 2001-06-02 07:24:38sandervl Exp $ */1 /* $Id: blit.cpp,v 1.31 2001-06-03 14:52:46 sandervl Exp $ */ 2 2 3 3 /* … … 23 23 24 24 static ULONG QueryPaletteSize(BITMAPINFOHEADER *pBHdr); 25 staticULONG CalcBitmapSize(ULONG cBits, LONG cx, LONG cy);25 ULONG CalcBitmapSize(ULONG cBits, LONG cx, LONG cy); 26 26 27 27 //****************************************************************************** … … 452 452 break; 453 453 } 454 455 454 if(bitfields[1] == 0x3E0) 456 455 {//RGB 555? … … 582 581 //****************************************************************************** 583 582 //****************************************************************************** 584 staticULONG CalcBitmapSize(ULONG cBits, LONG cx, LONG cy)583 ULONG CalcBitmapSize(ULONG cBits, LONG cx, LONG cy) 585 584 { 586 585 ULONG alignment; -
trunk/src/gdi32/dibitmap.cpp
r5866 r5901 1 /* $Id: dibitmap.cpp,v 1. 19 2001-06-01 12:29:25sandervl Exp $ */1 /* $Id: dibitmap.cpp,v 1.20 2001-06-03 14:52:47 sandervl Exp $ */ 2 2 3 3 /* … … 15 15 #include <string.h> 16 16 #include <misc.h> 17 #include <cpuhlp.h> 17 18 #include <winuser32.h> 18 19 #include "dibsect.h" 20 #include "rgbcvt.h" 19 21 20 22 #define DBG_LOCALLOG DBG_dibitmap 21 23 #include "dbglocal.h" 24 25 ULONG CalcBitmapSize(ULONG cBits, LONG cx, LONG cy); 22 26 23 27 //****************************************************************************** … … 296 300 #endif 297 301 298 // set proper color masks !302 // set proper color masks 299 303 switch(lpbi->bmiHeader.biBitCount) { 300 304 case 16: //RGB 565 301 305 ((DWORD*)(lpbi->bmiColors))[0] = 0xF800; 302 ((DWORD*)(lpbi->bmiColors))[1] = 0x0 7E0;306 ((DWORD*)(lpbi->bmiColors))[1] = 0x03E0; 303 307 ((DWORD*)(lpbi->bmiColors))[2] = 0x001F; 304 308 break; … … 310 314 break; 311 315 } 316 if(lpvBits && lpbi->bmiHeader.biBitCount == 16 && ((DWORD*)(lpbi->bmiColors))[1] == 0x3E0) 317 {//RGB 555? 318 dprintf(("RGB 565->555 conversion required")); 319 320 int imgsize = CalcBitmapSize(lpbi->bmiHeader.biBitCount, 321 lpbi->bmiHeader.biWidth, lpbi->bmiHeader.biHeight); 322 323 if(CPUFeatures & CPUID_MMX) { 324 RGB565to555MMX((WORD *)lpvBits, (WORD *)lpvBits, imgsize/sizeof(WORD)); 325 } 326 else RGB565to555((WORD *)lpvBits, (WORD *)lpvBits, imgsize/sizeof(WORD)); 327 } 328 312 329 //WGSS/Open32 returns 0 when querying the bitmap info; must return nr of scanlines 313 330 //as 0 signals failure -
trunk/src/gdi32/dibsect.cpp
r5825 r5901 1 /* $Id: dibsect.cpp,v 1.5 2 2001-05-29 09:45:21sandervl Exp $ */1 /* $Id: dibsect.cpp,v 1.53 2001-06-03 14:52:47 sandervl Exp $ */ 2 2 3 3 /* … … 746 746 memcpy(pOS2bmp, tmphdr, os2bmphdrsize); 747 747 748 #if 0749 748 if(dibinfo.dsBitfields[1] == 0x3E0) {//RGB 555? 750 749 dprintf(("DIBSection::sync: convert RGB 565 to RGB 555")); … … 757 756 else RGB565to555((WORD *)destBuf, (WORD *)destBuf, (nDestHeight*dibinfo.dsBm.bmWidthBytes)/sizeof(WORD)); 758 757 } 759 #endif 758 760 759 free(tmphdr); 761 760 if(rc != nDestHeight) { -
trunk/src/gdi32/palette.cpp
r5825 r5901 1 /* $Id: palette.cpp,v 1. 9 2001-05-29 09:45:21sandervl Exp $ */1 /* $Id: palette.cpp,v 1.10 2001-06-03 14:52:47 sandervl Exp $ */ 2 2 3 3 /* … … 58 58 rc = O32_RealizePalette(hdc); 59 59 dprintf(("GDI32: RealizePalette %x returned %d", hdc, rc)); 60 if(rc && DIBSection::getSection() != NULL) 61 { 62 DIBSection *dsect = DIBSection::findHDC(hdc); 63 if(dsect) 64 { 65 dsect->sync(hdc, 0, dsect->GetHeight()); 66 } 67 } 60 68 return rc; 61 69 } … … 85 93 dprintf(("GDI32: SelectPalette (0x%08X, 0x%08X, 0x%08X)", hdc, hPalette, bForceBackground)); 86 94 hPal = O32_SelectPalette(hdc, hPalette, bForceBackground); 87 88 //hack for beyond compare buttons (+ other apps)89 //seems to select old palette into dc before unselecting dib section90 if(bForceBackground != -1 && DIBSection::getSection() != NULL)91 {92 DIBSection *dsect = DIBSection::findHDC(hdc);93 if(dsect)94 {95 dsect->sync(hdc, 0, dsect->GetHeight());96 }97 }98 95 return hPal; 99 96 }
Note:
See TracChangeset
for help on using the changeset viewer.