Changeset 9966 for trunk/src/gdi32/dibsect.cpp
- Timestamp:
- Apr 1, 2003, 5:57:05 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/dibsect.cpp
r9762 r9966 1 /* $Id: dibsect.cpp,v 1.6 4 2003-02-06 19:20:03sandervl Exp $ */1 /* $Id: dibsect.cpp,v 1.65 2003-04-01 15:57:05 sandervl Exp $ */ 2 2 3 3 /* … … 31 31 #define DBG_LOCALLOG DBG_dibsect 32 32 #include "dbglocal.h" 33 33 34 34 35 //****************************************************************************** … … 83 84 this->dwOffset = dwOffset; 84 85 if(hSection) { 85 bmpBits = (char *)MapViewOfFile(hSection, FILE_MAP_ALL_ACCESS_W, 0, dwOffset, bmpsize*pbmi->biHeight );86 bmpBits = (char *)MapViewOfFile(hSection, FILE_MAP_ALL_ACCESS_W, 0, dwOffset, bmpsize*pbmi->biHeight - dwOffset); 86 87 if(!bmpBits) { 87 88 dprintf(("Dibsection: mapViewOfFile %x failed!", hSection)); … … 522 523 #else 523 524 point[2].y = nYsrc; 524 point[3].y = nYsrc + nSrcHeight - 1;525 point[3].y = nYsrc + nSrcHeight; 525 526 #endif 526 527 … … 555 556 fRestoryYInversion = TRUE; 556 557 } 558 #else 559 dprintf(("Sync destination dibsection: hdc y inversion = %d", GpiQueryYInversion(hdc))); 557 560 #endif 558 561 … … 591 594 break; 592 595 } 596 #ifndef INVERT 597 if(!(fFlip & FLIP_VERT)) { 598 #else 593 599 if(fFlip & FLIP_VERT) { 600 #endif 594 601 //manually reverse bitmap data 595 602 char *src = bmpBits + (pOS2bmp->cy-1)*dibinfo.dsBm.bmWidthBytes; … … 683 690 } 684 691 } 685 #endif 686 692 #else 693 dprintf(("Sync destination dibsection: hdc y inversion = %d", GpiQueryYInversion(hdc))); 694 #endif 695 696 #ifndef INVERT 697 if(!(fFlip & FLIP_VERT)) { 698 #else 687 699 if(fFlip & FLIP_VERT) { 700 #endif 688 701 destBuf = bmpBitsDblBuffer + nYdest*dibinfo.dsBm.bmWidthBytes; 689 702 … … 695 708 tmphdr->cbImage = dibinfo.dsBm.bmHeight*dibinfo.dsBm.bmWidthBytes; 696 709 697 rc = GpiQueryBitmapBits(hdc, nYdest, nDestHeight, destBuf, 710 #ifdef INVERT 711 int dest = dibinfo.dsBm.bmHeight - nYdest - nDestHeight; 712 #else 713 int dest = nYdest; 714 #endif 715 rc = GpiQueryBitmapBits(hdc, dest, nDestHeight, destBuf, 698 716 tmphdr); 699 717 if(rc == GPI_ALTERROR) { … … 719 737 720 738 destBuf = GetDIBObject() + nYdest*dibinfo.dsBm.bmWidthBytes; 739 740 #ifdef INVERT 741 int dest = dibinfo.dsBm.bmHeight - nYdest - nDestHeight; 742 #else 743 int dest = nYdest; 744 #endif 721 745 rc = GpiQueryBitmapBits(hdc, nYdest, nDestHeight, destBuf, 722 746 tmphdr); … … 736 760 737 761 if(dibinfo.dsBitfields[1] == 0x3E0) {//RGB 555? 738 dprintf(("DIBSection::sync: convert RGB 565 to RGB 555"));739 740 destBuf = GetDIBObject() + nYdest*dibinfo.dsBm.bmWidthBytes;741 742 if(CPUFeatures & CPUID_MMX) {762 dprintf(("DIBSection::sync: convert RGB 565 to RGB 555")); 763 764 destBuf = GetDIBObject() + nYdest*dibinfo.dsBm.bmWidthBytes; 765 766 if(CPUFeatures & CPUID_MMX) { 743 767 RGB565to555MMX((WORD *)destBuf, (WORD *)destBuf, (nDestHeight*dibinfo.dsBm.bmWidthBytes)/sizeof(WORD)); 744 }745 elseRGB565to555((WORD *)destBuf, (WORD *)destBuf, (nDestHeight*dibinfo.dsBm.bmWidthBytes)/sizeof(WORD));768 } 769 else RGB565to555((WORD *)destBuf, (WORD *)destBuf, (nDestHeight*dibinfo.dsBm.bmWidthBytes)/sizeof(WORD)); 746 770 } 747 771 748 772 free(tmphdr); 749 773 if(rc != nDestHeight) { 750 dprintf(("!WARNING!: GpiQueryBitmapBits returned %d instead of %d scanlines", rc, nDestHeight));774 dprintf(("!WARNING!: GpiQueryBitmapBits returned %d instead of %d scanlines", rc, nDestHeight)); 751 775 } 752 776
Note:
See TracChangeset
for help on using the changeset viewer.