Ignore:
Timestamp:
Jan 11, 2004, 12:42:14 PM (22 years ago)
Author:
sandervl
Message:

Update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/dibitmap.cpp

    r10167 r10373  
    1 /* $Id: dibitmap.cpp,v 1.41 2003-07-16 10:46:17 sandervl Exp $ */
     1/* $Id: dibitmap.cpp,v 1.42 2004-01-11 11:42:10 sandervl Exp $ */
    22
    33/*
     
    66 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
    77 * Copyright 1998 Patrick Haller
     8 * Copyright 2002-2003 Innotek Systemberatung GmbH (sandervl@innotek.de)
    89 *
    910 * Project Odin Software License can be found in LICENSE.TXT
     
    320321    if(dsect)
    321322    {
    322         return(dsect->SetDIBColorTable(uStartIndex, cEntries, pColors));
     323         return(dsect->SetDIBColorTable(uStartIndex, cEntries, pColors));
    323324    }
    324325    else return(0);
     
    326327//******************************************************************************
    327328//******************************************************************************
    328 LONG WIN32API GetBitmapBits( HBITMAP hBitmap, LONG arg2, PVOID  arg3)
     329LONG WIN32API GetBitmapBits( HBITMAP hBitmap, LONG arg2, PVOID lpvBits)
    329330{
    330331    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);
    332338}
    333339//******************************************************************************
     
    335341LONG WIN32API SetBitmapBits( HBITMAP hBitmap, LONG arg2, const VOID *  arg3)
    336342{
     343    LONG ret;
     344
    337345    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;
    339349}
    340350//******************************************************************************
     
    364374    dprintf(("GDI32: GetDIBits %x %x %d %d %x %x (biBitCount %d) %d", hdc, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, lpbi->bmiHeader.biBitCount, uUsage));
    365375
    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    }
    389380
    390381    //SvL: WGSS screws up the DC if it's a memory DC
     
    397388    }
    398389    if(pHps->isMemoryPS) {
    399           hdcMem = CreateCompatibleDC(0);
    400     }
    401     else  hdcMem = hdc;
     390         hdcMem = CreateCompatibleDC(0);
     391    }
     392    else hdcMem = hdc;
    402393
    403394    if(lpvBits) {
     
    547538        ret = O32_SetBitmapBits(hBitmap, pBitmapInfo->bmiHeader.biSizeImage, newpix);
    548539
     540        DIBSECTION_MARK_INVALID_BMP(hBitmap);
     541
    549542        free(newpix);
    550543        return ret;
     
    624617    if(newbits) free(newbits);
    625618
    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);
    637620
    638621    return ret;
Note: See TracChangeset for help on using the changeset viewer.