- Timestamp:
- May 29, 2001, 11:45:21 AM (24 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/blit.cpp
r5790 r5825 1 /* $Id: blit.cpp,v 1.2 8 2001-05-24 08:18:45sandervl Exp $ */1 /* $Id: blit.cpp,v 1.29 2001-05-29 09:45:20 sandervl Exp $ */ 2 2 3 3 /* … … 329 329 BOOL rc; 330 330 331 dprintf(("PatBlt %x (%d,%d)(%d,%d) %x", hdc, nXLeft,nYLeft,nWidth,nHeight, dwRop)); 331 332 //CB: Open32 bug: negative width/height not supported! 332 333 if (nWidth < 0) -
trunk/src/gdi32/dibitmap.cpp
r5799 r5825 1 /* $Id: dibitmap.cpp,v 1.1 6 2001-05-25 10:05:28sandervl Exp $ */1 /* $Id: dibitmap.cpp,v 1.17 2001-05-29 09:45:21 sandervl Exp $ */ 2 2 3 3 /* … … 203 203 //****************************************************************************** 204 204 //****************************************************************************** 205 UINT WIN32API GetDIBColorTable( 206 207 { 208 HPALETTE hpal = GetCurrentObject(hdc, OBJ_PAL);205 UINT WIN32API GetDIBColorTable(HDC hdc, UINT uStartIndex, UINT cEntries, 206 RGBQUAD *pColors) 207 { 208 DIBSection *dsect = DIBSection::findHDC(hdc); 209 209 UINT rc; 210 210 int i; 211 211 212 rc = O32_GetPaletteEntries(hpal, 213 uStartIndex, 214 cEntries, 215 (PALETTEENTRY *)pColors); 212 dprintf(("GetDIBColorTable %x %d->%d %x", hdc, uStartIndex, cEntries, pColors)); 213 214 if(dsect) 215 { 216 return(dsect->GetDIBColorTable(uStartIndex, cEntries, pColors)); 217 } 218 //TODO: Is this correct????? 219 // Wine returns 0 if bitmap selected into dc with bpp > 8 220 HPALETTE hpal = GetCurrentObject(hdc, OBJ_PAL); 221 rc = O32_GetPaletteEntries(hpal, uStartIndex, 222 cEntries, (PALETTEENTRY *)pColors); 216 223 for(i=0; 217 224 i<cEntries; … … 230 237 //****************************************************************************** 231 238 UINT WIN32API SetDIBColorTable(HDC hdc, UINT uStartIndex, UINT cEntries, 232 239 RGBQUAD *pColors) 233 240 { 234 241 DIBSection *dsect = DIBSection::findHDC(hdc); 235 242 236 dprintf(("GDI32: SetDIBColorTable \n"));243 dprintf(("GDI32: SetDIBColorTable %x %d,%d %x", hdc, uStartIndex, cEntries, pColors)); 237 244 if(dsect) 238 245 { -
trunk/src/gdi32/dibsect.cpp
r5799 r5825 1 /* $Id: dibsect.cpp,v 1.5 1 2001-05-25 10:05:29sandervl Exp $ */1 /* $Id: dibsect.cpp,v 1.52 2001-05-29 09:45:21 sandervl Exp $ */ 2 2 3 3 /* … … 387 387 int DIBSection::SetDIBColorTable(int startIdx, int cEntries, RGBQUAD *rgb) 388 388 { 389 int i ;389 int i, end; 390 390 391 391 dprintf(("SetDIBColorTable %d %d %x", startIdx, cEntries, rgb)); 392 if(startIdx + cEntries > (1 << pOS2bmp->cBitCount)) 393 { 394 dprintf(("DIBSection::SetDIBColorTable, invalid nr of entries %d %d\n", startIdx, cEntries)); 395 return(0); 392 393 if(pOS2bmp->cBitCount > 8) { 394 dprintf(("DIBSection::SetDIBColorTable: bpp > 8; ignore")); 395 return 0; 396 } 397 398 end = startIdx + cEntries; 399 if(end > (1 << pOS2bmp->cBitCount)) { 400 end = (1 << pOS2bmp->cBitCount); 396 401 } 397 402 398 403 memcpy(&pOS2bmp->argbColor[startIdx], rgb, cEntries*sizeof(RGB2)); 399 404 400 for(i=startIdx;i< cEntries;i++)405 for(i=startIdx;i<end;i++) 401 406 { 402 407 pOS2bmp->argbColor[i].fcOptions = 0; … … 412 417 int DIBSection::SetDIBColorTable(int startIdx, int cEntries, PALETTEENTRY *palentry) 413 418 { 414 int i; 415 416 if(startIdx + cEntries > (1 << pOS2bmp->cBitCount)) 417 { 418 dprintf(("DIBSection::SetDIBColorTable, invalid nr of entries %d %d\n", startIdx, cEntries)); 419 return(0); 420 } 421 422 for(i=startIdx;i<cEntries;i++) 419 int i, end; 420 421 if(pOS2bmp->cBitCount > 8) { 422 dprintf(("DIBSection::SetDIBColorTable: bpp > 8; ignore")); 423 return 0; 424 } 425 426 end = startIdx + cEntries; 427 if(end > (1 << pOS2bmp->cBitCount)) { 428 end = (1 << pOS2bmp->cBitCount); 429 } 430 for(i=startIdx;i<end;i++) 423 431 { 424 432 pOS2bmp->argbColor[i].fcOptions = 0; … … 428 436 } 429 437 430 return(cEntries); 438 return end - startIdx; 439 } 440 //****************************************************************************** 441 //****************************************************************************** 442 int DIBSection::GetDIBColorTable(int startIdx, int cEntries, RGBQUAD *rgb) 443 { 444 int i, end = startIdx + cEntries; 445 446 if(pOS2bmp->cBitCount > 8) { 447 dprintf(("DIBSection::GetDIBColorTable: bpp > 8 -> return 0")); 448 return 0; 449 } 450 if(end > (1 << pOS2bmp->cBitCount)) { 451 end = (1 << pOS2bmp->cBitCount); 452 dprintf(("DIBSection::GetDIBColorTable: %d->%d", startIdx, end)); 453 } 454 memcpy(rgb, &pOS2bmp->argbColor[startIdx], cEntries*sizeof(RGBQUAD)); 455 456 for(i=0;i<cEntries;i++) { 457 rgb[i].rgbReserved = 0; 458 } 459 460 return end - startIdx; 431 461 } 432 462 //****************************************************************************** -
trunk/src/gdi32/dibsect.h
r5390 r5825 1 /* $Id: dibsect.h,v 1.2 4 2001-03-27 20:47:52sandervl Exp $ */1 /* $Id: dibsect.h,v 1.25 2001-05-29 09:45:21 sandervl Exp $ */ 2 2 3 3 /* … … 100 100 void sync(DWORD xDst, DWORD yDst, DWORD widthDst, DWORD heightDst, PVOID bits); 101 101 int SetDIBColorTable(int startIdx, int cEntries, RGBQUAD *rgb); 102 int GetDIBColorTable(int startIdx, int cEntries, RGBQUAD *rgb); 102 103 int SetDIBColorTable(int startIdx, int cEntries, PALETTEENTRY *rgb); 103 104 -
trunk/src/gdi32/palette.cpp
r5799 r5825 1 /* $Id: palette.cpp,v 1. 8 2001-05-25 10:05:29sandervl Exp $ */1 /* $Id: palette.cpp,v 1.9 2001-05-29 09:45:21 sandervl Exp $ */ 2 2 3 3 /* … … 85 85 dprintf(("GDI32: SelectPalette (0x%08X, 0x%08X, 0x%08X)", hdc, hPalette, bForceBackground)); 86 86 hPal = O32_SelectPalette(hdc, hPalette, bForceBackground); 87 if(DIBSection::getSection() != NULL) 87 88 //hack for beyond compare buttons (+ other apps) 89 //seems to select old palette into dc before unselecting dib section 90 if(bForceBackground != -1 && DIBSection::getSection() != NULL) 88 91 { 89 92 DIBSection *dsect = DIBSection::findHDC(hdc);
Note:
See TracChangeset
for help on using the changeset viewer.