Changeset 2600 for trunk/src/gdi32/blit.cpp
- Timestamp:
- Feb 3, 2000, 12:45:07 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/blit.cpp
r2592 r2600 1 /* $Id: blit.cpp,v 1. 1 2000-02-01 12:53:29sandervl Exp $ */1 /* $Id: blit.cpp,v 1.2 2000-02-02 23:45:06 sandervl Exp $ */ 2 2 3 3 /* … … 71 71 } 72 72 } 73 return rc; 73 74 } 74 75 } … … 85 86 INT result, imgsize, palsize, height, width; 86 87 char *ptr; 88 ULONG compression = 0; 89 WORD *newbits = 0; 87 90 88 91 SetLastError(0); … … 126 129 127 130 //SvL: Ignore BI_BITFIELDS type (SetDIBitsToDevice fails otherwise) 128 if(info->bmiHeader.biCompression == BI_BITFIELDS) 131 if(info->bmiHeader.biCompression == BI_BITFIELDS) { 132 DWORD *bitfields = (DWORD *)info->bmiColors; 133 134 dprintf(("BI_BITFIELDS compression %x %x %x", *bitfields, *(bitfields+1), *(bitfields+2))); 129 135 ((BITMAPINFO *)info)->bmiHeader.biCompression = 0; 136 compression = BI_BITFIELDS; 137 if(*(bitfields+1) == 0x3E0) {//RGB 555? 138 WORD *dstbits, *srcbits; 139 WORD pixel; 140 141 newbits = dstbits = (WORD *)malloc(imgsize); 142 srcbits = (WORD *)bits; 143 for(int i=0;i<imgsize/sizeof(WORD);i++) { 144 pixel = *dstbits = *srcbits++; 145 *dstbits &= 0x1F; 146 pixel &= 0x7FE0; 147 pixel <<= 1; 148 *dstbits = *dstbits | pixel; 149 dstbits++; 150 } 151 bits = newbits; 152 } 153 } 154 130 155 if(info->bmiHeader.biHeight < 0) 131 156 ((BITMAPINFO *)info)->bmiHeader.biHeight = -info->bmiHeader.biHeight; 132 157 133 // result = OSLibSetDIBitsToDevice(hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (PVOID) bits, (WINBITMAPINFOHEADER *)info, coloruse);134 // result = 1;135 158 result = O32_SetDIBitsToDevice(hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (PVOID) bits, (PBITMAPINFO)info, coloruse); 136 159 //SvL: Wrong Open32 return value … … 141 164 dprintf(("GDI32: SetDIBitsToDevice %d %d %d %d %x %d", info->bmiHeader.biWidth, info->bmiHeader.biHeight, info->bmiHeader.biPlanes, info->bmiHeader.biBitCount, info->bmiHeader.biCompression, info->bmiHeader.biSizeImage)); 142 165 166 if(compression == BI_BITFIELDS) { 167 ((BITMAPINFO *)info)->bmiHeader.biCompression = BI_BITFIELDS; 168 if(newbits) free(newbits); 169 } 143 170 return result; 144 171
Note:
See TracChangeset
for help on using the changeset viewer.