Changeset 5690 for trunk/src/gdi32/blit.cpp
- Timestamp:
- May 11, 2001, 7:09:45 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/blit.cpp
r5689 r5690 1 /* $Id: blit.cpp,v 1.2 6 2001-05-11 14:59:26sandervl Exp $ */1 /* $Id: blit.cpp,v 1.27 2001-05-11 17:09:45 sandervl Exp $ */ 2 2 3 3 /* … … 160 160 if(bitfields[1] == 0x3E0) 161 161 {//RGB 555? 162 dprintf((" BI_BITFIELDS compression %x %x %x", *bitfields, *(bitfields+1), *(bitfields+2)));162 dprintf(("RGB 555->565 conversion required %x %x %x", bitfields[0], bitfields[1], bitfields[2])); 163 163 164 164 newbits = (WORD *)malloc(imgsize); … … 364 364 //****************************************************************************** 365 365 //****************************************************************************** 366 INT WIN32API StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,366 static INT StretchDIBits_(HDC hdc, INT xDst, INT yDst, INT widthDst, 367 367 INT heightDst, INT xSrc, INT ySrc, INT widthSrc, 368 368 INT heightSrc, const void *bits, … … 452 452 //****************************************************************************** 453 453 //****************************************************************************** 454 INT WIN32API StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, 455 INT heightDst, INT xSrc, INT ySrc, INT widthSrc, 456 INT heightSrc, const void *bits, 457 const BITMAPINFO *info, UINT wUsage, DWORD dwRop ) 458 { 459 460 if(info->bmiHeader.biHeight < 0) { 461 // upside down 462 INT rc = 0; 463 BITMAPINFO newInfo; 464 newInfo.bmiHeader = info->bmiHeader; 465 long lLineByte = ((newInfo.bmiHeader.biWidth * (info->bmiHeader.biBitCount == 15 ? 16 : info->bmiHeader.biBitCount) + 31) / 32) * 4; 466 long lHeight = -newInfo.bmiHeader.biHeight; 467 newInfo.bmiHeader.biHeight = -newInfo.bmiHeader.biHeight; 468 469 char *newBits = (char *)malloc( lLineByte * lHeight ); 470 if(newBits) { 471 unsigned char *pbSrc = (unsigned char *)bits + lLineByte * (lHeight - 1); 472 unsigned char *pbDst = (unsigned char *)newBits; 473 for(int y = 0; y < lHeight; y++) { 474 memcpy( pbDst, pbSrc, lLineByte ); 475 pbDst += lLineByte; 476 pbSrc -= lLineByte; 477 } 478 rc = StretchDIBits_(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc, widthSrc, heightSrc, newBits, info, wUsage, dwRop); 479 free( newBits ); 480 } 481 return rc; 482 } else { 483 return StretchDIBits_(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc, widthSrc, heightSrc, bits, info, wUsage, dwRop); 484 } 485 } 486 //****************************************************************************** 487 //****************************************************************************** 454 488 int WIN32API SetStretchBltMode( HDC arg1, int arg2) 455 489 {
Note:
See TracChangeset
for help on using the changeset viewer.