Changeset 9576 for trunk/src/gdi32/blit.cpp
- Timestamp:
- Jan 1, 2003, 5:32:07 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/blit.cpp
r9558 r9576 1 /* $Id: blit.cpp,v 1.4 2 2002-12-28 14:01:37 sandervl Exp $ */1 /* $Id: blit.cpp,v 1.43 2003-01-01 16:32:07 sandervl Exp $ */ 2 2 3 3 /* … … 15 15 #include <string.h> 16 16 #include <cpuhlp.h> 17 #include "misc.h" 17 #include <winuser32.h> 18 #include <dbglog.h> 18 19 #include "dibsect.h" 19 20 #include "rgbcvt.h" … … 250 251 char *newBits = NULL; 251 252 253 if(startscan != 0 || lines != abs(info->bmiHeader.biHeight)) { 254 dprintf(("WARNING: SetDIBitsToDevice: startscan != 0 || lines != abs(info->bmiHeader.biHeight")); 255 } 256 252 257 //If upside down, reverse scanlines and call SetDIBitsToDevice again 253 258 // if(info->bmiHeader.biHeight < 0 && info->bmiHeader.biBitCount != 8 && info->bmiHeader.biCompression == 0) { … … 257 262 // upside down 258 263 INT rc = -1; 259 BITMAPINFO newInfo;260 newInfo.bmiHeader = info->bmiHeader;261 long lLineByte = ((newInfo.bmiHeader.biWidth * (info->bmiHeader.biBitCount == 15 ? 16 : info->bmiHeader.biBitCount) + 31) / 32) * 4; 262 long lHeight = -newInfo.bmiHeader.biHeight;263 newInfo.bmiHeader.biHeight = -info->bmiHeader.biHeight;264 long lLineByte = DIB_GetDIBWidthBytes(info->bmiHeader.biWidth, info->bmiHeader.biBitCount); 265 long lHeight = -info->bmiHeader.biHeight; 266 267 //TODO: doesn't work if memory is readonly!! 268 ((BITMAPINFO *)info)->bmiHeader.biHeight = -info->bmiHeader.biHeight; 264 269 265 270 char *newBits = (char *)malloc( lLineByte * lHeight ); … … 273 278 } 274 279 //We only convert the necessary data so xSrc & ySrc are now 0 275 rc = SetDIBitsToDevice( hdc, xDest, yDest, cx, cy, 0, 0, startscan, lines, (void *)newBits, &newInfo, coloruse );280 rc = SetDIBitsToDevice( hdc, xDest, yDest, cx, cy, 0, 0, startscan, lines, (void *)newBits, info, coloruse ); 276 281 free( newBits ); 277 282 } 278 283 else DebugInt3(); 284 285 //TODO: doesn't work if memory is readonly!! 286 ((BITMAPINFO *)info)->bmiHeader.biHeight = -info->bmiHeader.biHeight; 279 287 280 288 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.