Changeset 10373 for trunk/src/gdi32/dibitmap.cpp
- Timestamp:
- Jan 11, 2004, 12:42:14 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/dibitmap.cpp
r10167 r10373 1 /* $Id: dibitmap.cpp,v 1.4 1 2003-07-16 10:46:17sandervl Exp $ */1 /* $Id: dibitmap.cpp,v 1.42 2004-01-11 11:42:10 sandervl Exp $ */ 2 2 3 3 /* … … 6 6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl) 7 7 * Copyright 1998 Patrick Haller 8 * Copyright 2002-2003 Innotek Systemberatung GmbH (sandervl@innotek.de) 8 9 * 9 10 * Project Odin Software License can be found in LICENSE.TXT … … 320 321 if(dsect) 321 322 { 322 return(dsect->SetDIBColorTable(uStartIndex, cEntries, pColors));323 return(dsect->SetDIBColorTable(uStartIndex, cEntries, pColors)); 323 324 } 324 325 else return(0); … … 326 327 //****************************************************************************** 327 328 //****************************************************************************** 328 LONG WIN32API GetBitmapBits( HBITMAP hBitmap, LONG arg2, PVOID arg3)329 LONG WIN32API GetBitmapBits( HBITMAP hBitmap, LONG arg2, PVOID lpvBits) 329 330 { 330 331 dprintf(("GDI32: GetBitmapBits %x", hBitmap)); 331 return O32_GetBitmapBits(hBitmap, arg2, arg3); 332 333 if(lpvBits) 334 { 335 DIBSECTION_CHECK_IF_DIRTY_BMP(hBitmap); 336 } 337 return O32_GetBitmapBits(hBitmap, arg2, lpvBits); 332 338 } 333 339 //****************************************************************************** … … 335 341 LONG WIN32API SetBitmapBits( HBITMAP hBitmap, LONG arg2, const VOID * arg3) 336 342 { 343 LONG ret; 344 337 345 dprintf(("GDI32: SetBitmapBits %x", hBitmap)); 338 return O32_SetBitmapBits(hBitmap, (DWORD)arg2, arg3); 346 ret = O32_SetBitmapBits(hBitmap, (DWORD)arg2, arg3); 347 DIBSECTION_MARK_INVALID_BMP(hBitmap); 348 return ret; 339 349 } 340 350 //****************************************************************************** … … 364 374 dprintf(("GDI32: GetDIBits %x %x %d %d %x %x (biBitCount %d) %d", hdc, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, lpbi->bmiHeader.biBitCount, uUsage)); 365 375 366 #if 0 367 if(lpvBits && DIBSection::getSection() != NULL) 368 { 369 DIBSection *dsect; 370 371 dsect = DIBSection::findObj(hBitmap); 372 if(dsect) { 373 char *bmpBits = dsect->GetDIBObject(); 374 375 if(lpbi->bmiHeader.biBitCount == dsect->GetBitCount() && 376 lpbi->bmiHeader.biWidth > 0) 377 { 378 LONG lLineByte; 379 380 dprintf(("Quick copy from DIB section memory")); 381 lLineByte = DIB_GetDIBWidthBytes(lpbi->bmiHeader.biWidth, lpbi->bmiHeader.biBitCount); 382 383 memcpy(lpvBits, bmpBits+(uStartScan*lLineByte), cScanLines*lLineByte); 384 return cScanLines; 385 } 386 } 387 } 388 #endif 376 if(lpvBits) 377 { 378 DIBSECTION_CHECK_IF_DIRTY_BMP(hBitmap); 379 } 389 380 390 381 //SvL: WGSS screws up the DC if it's a memory DC … … 397 388 } 398 389 if(pHps->isMemoryPS) { 399 400 } 401 else 390 hdcMem = CreateCompatibleDC(0); 391 } 392 else hdcMem = hdc; 402 393 403 394 if(lpvBits) { … … 547 538 ret = O32_SetBitmapBits(hBitmap, pBitmapInfo->bmiHeader.biSizeImage, newpix); 548 539 540 DIBSECTION_MARK_INVALID_BMP(hBitmap); 541 549 542 free(newpix); 550 543 return ret; … … 624 617 if(newbits) free(newbits); 625 618 626 if(DIBSection::getSection() != NULL) 627 { 628 DIBSection *dsect; 629 630 dsect = DIBSection::findObj(hBitmap); 631 if(dsect) { 632 HBITMAP hBmpOld = SelectObject(hdc, hBitmap); 633 dsect->sync(hdc, 0, dsect->GetHeight()); 634 SelectObject(hdc, hBmpOld); 635 } 636 } 619 DIBSECTION_MARK_INVALID_BMP(hBitmap); 637 620 638 621 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.