Changeset 4450 for trunk/src


Ignore:
Timestamp:
Oct 7, 2000, 1:39:16 PM (25 years ago)
Author:
sandervl
Message:

cleanup (layout)

File:
1 edited

Legend:

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

    r4447 r4450  
    1 /* $Id: dibsect.cpp,v 1.40 2000-10-07 09:03:49 hugh Exp $ */
     1/* $Id: dibsect.cpp,v 1.41 2000-10-07 11:39:16 sandervl Exp $ */
    22
    33/*
     
    5252  {
    5353        case 1:
    54           bmpsize = ((bmpsize + 31) & ~31) / 8;
    55           palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2);
    56           os2bmphdrsize += palsize;
    57                 break;
     54            bmpsize = ((bmpsize + 31) & ~31) / 8;
     55            palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2);
     56            os2bmphdrsize += palsize;
     57            break;
    5858        case 4:
    59                 bmpsize = ((bmpsize + 7) & ~7) / 2;
    60           palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2);
    61                 os2bmphdrsize += palsize;
    62                 break;
     59            bmpsize = ((bmpsize + 7) & ~7) / 2;
     60            palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2);
     61            os2bmphdrsize += palsize;
     62            break;
    6363        case 8:
    64           palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2);
    65           os2bmphdrsize += palsize;
    66           bmpsize = (bmpsize + 3) & ~3;
    67                 break;
     64            palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2);
     65            os2bmphdrsize += palsize;
     66            bmpsize = (bmpsize + 3) & ~3;
     67            break;
    6868        case 16:
    69                 bmpsize *= 2;
    70           bmpsize = (bmpsize + 3) & ~3;
    71                 break;
     69            bmpsize *= 2;
     70            bmpsize = (bmpsize + 3) & ~3;
     71            break;
    7272        case 24:
    73                 bmpsize *= 3;
    74           bmpsize = (bmpsize + 3) & ~3;
    75                 break;
     73            bmpsize *= 3;
     74            bmpsize = (bmpsize + 3) & ~3;
     75            break;
    7676        case 32:
    77                 bmpsize *= 4;
    78                 break;
    79   default:
    80     dprintf(("Unsupported nr of bits %d", pbmi->biBitCount));
    81     DebugInt3();
    82     break;
     77            bmpsize *= 4;
     78            break;
     79        default:
     80            dprintf(("Unsupported nr of bits %d", pbmi->biBitCount));
     81            DebugInt3();
     82            break;
    8383   }
    8484
     
    8686   this->dwOffset = dwOffset;
    8787   if(hSection) {
    88   bmpBits = (char *)MapViewOfFile(hSection, FILE_MAP_ALL_ACCESS_W, 0, dwOffset, bmpsize*pbmi->biHeight);
    89   if(!bmpBits) {
    90     dprintf(("Dibsection: mapViewOfFile %x failed!", hSection));
    91     DebugInt3();
    92   }
     88        bmpBits = (char *)MapViewOfFile(hSection, FILE_MAP_ALL_ACCESS_W, 0, dwOffset, bmpsize*pbmi->biHeight);
     89        if(!bmpBits) {
     90            dprintf(("Dibsection: mapViewOfFile %x failed!", hSection));
     91            DebugInt3();
     92        }
    9393   }
    9494   if(!bmpBits) {
    95   DosAllocMem((PPVOID)&bmpBits, bmpsize*pbmi->biHeight, PAG_READ|PAG_WRITE|PAG_COMMIT);
     95        DosAllocMem((PPVOID)&bmpBits, bmpsize*pbmi->biHeight, PAG_READ|PAG_WRITE|PAG_COMMIT);
    9696   }
    9797   memset(bmpBits, 0, bmpsize*pbmi->biHeight);
     
    111111   //SvL: Ignore BI_BITFIELDS_W type (GpiDrawBits fails otherwise)
    112112   if(pOS2bmp->ulCompression == BI_BITFIELDS_W) {
    113   pOS2bmp->ulCompression = 0;
     113        pOS2bmp->ulCompression = 0;
    114114   }
    115115   pOS2bmp->cbImage       = pbmi->biSizeImage;
     
    142142   {
    143143        dibinfo.dsBitfields[0] = dibinfo.dsBitfields[1] = dibinfo.dsBitfields[2] = 0;
    144     if(palsize) {
    145     SetDIBColorTable(0, (1 << pbmi->biBitCount), (RGBQUAD *)(pbmi+1));
    146     }
     144        if(palsize) {
     145            SetDIBColorTable(0, (1 << pbmi->biBitCount), (RGBQUAD *)(pbmi+1));
     146        }
    147147   }
    148148   else {
    149   switch(pbmi->biBitCount)
    150     {
     149        switch(pbmi->biBitCount)
     150        {
    151151           case 16:
    152152                dibinfo.dsBitfields[0] = (pbmi->biCompression == BI_BITFIELDS_W) ? *(DWORD *)pColors : 0x7c00;
     
    165165                dibinfo.dsBitfields[1] = (pbmi->biCompression == BI_BITFIELDS_W) ? *((DWORD *)pColors + 1) : 0xff00;
    166166                dibinfo.dsBitfields[2] = (pbmi->biCompression == BI_BITFIELDS_W) ? *((DWORD *)pColors + 2) : 0xff0000;
    167     if(dibinfo.dsBitfields[0] != 0xff && dibinfo.dsBitfields[1] != 0xff00 && dibinfo.dsBitfields[2] != 0xff0000) {
    168       dprintf(("DIBSection: unsupported bitfields for 32 bits bitmap!!"));
    169     }
     167                if(dibinfo.dsBitfields[0] != 0xff && dibinfo.dsBitfields[1] != 0xff00 && dibinfo.dsBitfields[2] != 0xff0000) {
     168                    dprintf(("DIBSection: unsupported bitfields for 32 bits bitmap!!"));
     169                }
    170170                break;
    171171        }
    172   dprintf(("BI_BITFIELDS_W %x %x %x", dibinfo.dsBitfields[0], dibinfo.dsBitfields[1], dibinfo.dsBitfields[2]));
     172        dprintf(("BI_BITFIELDS_W %x %x %x", dibinfo.dsBitfields[0], dibinfo.dsBitfields[1], dibinfo.dsBitfields[2]));
    173173   }
    174174   //double buffer for rgb 555 dib sections (for conversion) or flipped sections
    175175   if(dibinfo.dsBitfields[1] == 0x03e0 || (fFlip & FLIP_VERT)) {
    176   DosAllocMem((PPVOID)&bmpBitsDblBuffer, bmpsize*pbmi->biHeight, PAG_READ|PAG_WRITE|PAG_COMMIT);
     176        DosAllocMem((PPVOID)&bmpBitsDblBuffer, bmpsize*pbmi->biHeight, PAG_READ|PAG_WRITE|PAG_COMMIT);
    177177   }
    178178
     
    209209
    210210   if(hSection) {
    211   UnmapViewOfFile(bmpBits);
     211        UnmapViewOfFile(bmpBits);
    212212   }
    213213   else
     
    216216
    217217   if(bmpBitsDblBuffer)
    218   DosFreeMem(bmpBitsDblBuffer);
     218        DosFreeMem(bmpBitsDblBuffer);
    219219
    220220   if(pOS2bmp)
     
    284284      pOS2bmp->cBitCount != pbmi->biBitCount)
    285285   {
    286   char *oldbits = bmpBits;
    287   int oldsize = dibinfo.dsBm.bmWidthBytes * dibinfo.dsBm.bmHeight;
    288 
    289   DosAllocMem((PPVOID)&bmpBits, bmpsize*pbmi->biHeight, PAG_READ|PAG_WRITE|PAG_COMMIT);
    290   memcpy(bmpBits, oldbits, min(oldsize, bmpsize*pbmi->biHeight));
    291   DosFreeMem(oldbits);
     286        char *oldbits = bmpBits;
     287        int oldsize = dibinfo.dsBm.bmWidthBytes * dibinfo.dsBm.bmHeight;
     288
     289        DosAllocMem((PPVOID)&bmpBits, bmpsize*pbmi->biHeight, PAG_READ|PAG_WRITE|PAG_COMMIT);
     290        memcpy(bmpBits, oldbits, min(oldsize, bmpsize*pbmi->biHeight));
     291        DosFreeMem(oldbits);
    292292   }
    293293   pOS2bmp    = (BITMAPINFO2 *)realloc(pOS2bmp, os2bmphdrsize);
     
    321321   }
    322322   else {
    323   char *pColors = (char *)pbmi + 1;
    324 
    325   switch(pbmi->biBitCount)
    326     {
     323        char *pColors = (char *)pbmi + 1;
     324
     325        switch(pbmi->biBitCount)
     326        {
    327327           case 16:
    328328                dibinfo.dsBitfields[0] = (pbmi->biCompression == BI_BITFIELDS_W) ? *(DWORD *)pColors : 0x7c00;
     
    341341                dibinfo.dsBitfields[1] = (pbmi->biCompression == BI_BITFIELDS_W) ? *((DWORD *)pColors + 1) : 0xff00;
    342342                dibinfo.dsBitfields[2] = (pbmi->biCompression == BI_BITFIELDS_W) ? *((DWORD *)pColors + 2) : 0xff0000;
    343     if(dibinfo.dsBitfields[0] != 0xff && dibinfo.dsBitfields[1] != 0xff00 && dibinfo.dsBitfields[2] != 0xff0000) {
    344       dprintf(("DIBSection: unsupported bitfields for 32 bits bitmap!!"));
    345     }
     343                if(dibinfo.dsBitfields[0] != 0xff && dibinfo.dsBitfields[1] != 0xff00 && dibinfo.dsBitfields[2] != 0xff0000) {
     344                    dprintf(("DIBSection: unsupported bitfields for 32 bits bitmap!!"));
     345                }
    346346                break;
    347347        }
    348   dprintf(("BI_BITFIELDS_W %x %x %x", dibinfo.dsBitfields[0], dibinfo.dsBitfields[1], dibinfo.dsBitfields[2]));
     348        dprintf(("BI_BITFIELDS_W %x %x %x", dibinfo.dsBitfields[0], dibinfo.dsBitfields[1], dibinfo.dsBitfields[2]));
    349349   }
    350350
    351351   //double buffer for rgb 555 dib sections (for conversion) or flipped sections
    352352   if(dibinfo.dsBitfields[1] == 0x03e0 || (fFlip & FLIP_VERT)) {
    353   if(bmpBitsDblBuffer) {
    354     DosFreeMem(bmpBitsDblBuffer);
    355   }
    356   DosAllocMem((PPVOID)&bmpBitsDblBuffer, dibinfo.dsBm.bmWidthBytes*pbmi->biHeight, PAG_READ|PAG_WRITE|PAG_COMMIT);
     353        if(bmpBitsDblBuffer) {
     354            DosFreeMem(bmpBitsDblBuffer);
     355        }
     356        DosAllocMem((PPVOID)&bmpBitsDblBuffer, dibinfo.dsBm.bmWidthBytes*pbmi->biHeight, PAG_READ|PAG_WRITE|PAG_COMMIT);
    357357   }
    358358
    359359   dprintf(("DIBSection::SetDIBits (%d,%d), %d %d", pbmi->biWidth, pbmi->biHeight, pbmi->biBitCount, pbmi->biCompression));
    360360   if(palsize) {
    361   SetDIBColorTable(0, 1 << pbmi->biBitCount, (RGBQUAD *)(pbmi+1));
     361        SetDIBColorTable(0, 1 << pbmi->biBitCount, (RGBQUAD *)(pbmi+1));
    362362   }
    363363
     
    411411  if(!pHps)
    412412  {
    413       SetLastError(ERROR_INVALID_HANDLE_W);
    414       return FALSE;
     413        SetLastError(ERROR_INVALID_HANDLE_W);
     414        return FALSE;
    415415  }
    416416
    417417  hwndDest = WindowFromDC(hdcDest); //could return desktop window, so check that
    418418  if(hwndDest && pHps->hwnd && !pHps->isClient) {
    419   fFrameWindowDC = TRUE;
     419        fFrameWindowDC = TRUE;
    420420  }
    421421
     
    425425
    426426  if(hwndDest) {
    427   RECT rect;
    428 
    429   if(fFrameWindowDC) {
    430     GetWindowRect(hwndDest, &rect);
    431   }
    432   else  GetClientRect(hwndDest, &rect);
    433   hdcHeight = rect.bottom - rect.top;
    434   hdcWidth  = rect.right - rect.left;
     427        RECT rect;
     428
     429        if(fFrameWindowDC) {
     430            GetWindowRect(hwndDest, &rect);
     431        }
     432        else  GetClientRect(hwndDest, &rect);
     433        hdcHeight = rect.bottom - rect.top;
     434        hdcWidth  = rect.right - rect.left;
    435435  }
    436436  else {
    437     DIBSection *dsect = DIBSection::findHDC(hdcDest);
    438     if(dsect)
    439     {
    440       hdcHeight = dsect->GetHeight();
    441       hdcWidth  = dsect->GetWidth();
    442     }
    443     else
    444     {
    445       hdcHeight = pOS2bmp->cy;
    446       hdcWidth  = pOS2bmp->cx;
    447     }
     437        DIBSection *dsect = DIBSection::findHDC(hdcDest);
     438        if(dsect)
     439        {
     440            hdcHeight = dsect->GetHeight();
     441            hdcWidth  = dsect->GetWidth();
     442        }
     443        else
     444        {
     445            hdcHeight = pOS2bmp->cy;
     446            hdcWidth  = pOS2bmp->cx;
     447        }
    448448  }
    449449
     
    453453
    454454  if(nXdest + nDestWidth > hdcWidth) {
    455     nDestWidth  = hdcWidth - nXdest;
    456     }
     455        nDestWidth  = hdcWidth - nXdest;
     456  }
    457457
    458458  if(nYdest + nDestHeight > hdcHeight) {
    459     nDestHeight = hdcHeight - nYdest;
    460     }
     459        nDestHeight = hdcHeight - nYdest;
     460  }
    461461
    462462  point[0].x = nXdest;
     
    467467  //target rectangle is inclusive-inclusive
    468468  if(nXsrc + nSrcWidth > pOS2bmp->cx) {
    469   nSrcWidth  = pOS2bmp->cx - nXsrc;
     469        nSrcWidth  = pOS2bmp->cx - nXsrc;
    470470  }
    471471  if(nYsrc + nSrcHeight > pOS2bmp->cy) {
    472   nSrcHeight = pOS2bmp->cy - nYsrc;
     472        nSrcHeight = pOS2bmp->cy - nYsrc;
    473473  }
    474474  point[2].x = nXsrc;
     
    490490  oldyinversion = GpiQueryYInversion(hps);
    491491  if(oldyinversion != 0) {
    492   GpiEnableYInversion(hps, 0);
    493   fRestoryYInversion = TRUE;
     492        GpiEnableYInversion(hps, 0);
     493        fRestoryYInversion = TRUE;
    494494  }
    495495
     
    508508  switch(winmode) {
    509509  case BLACKONWHITE_W:
    510   os2mode = BBO_AND;
    511   break;
     510        os2mode = BBO_AND;
     511        break;
    512512  case WHITEONBLACK_W:
    513513  case HALFTONE_W: //TODO:
    514   os2mode = BBO_OR;
    515   break;
     514        os2mode = BBO_OR;
     515        break;
    516516  case COLORONCOLOR_W:
    517   os2mode = BBO_IGNORE;
    518   break;
     517        os2mode = BBO_IGNORE;
     518        break;
    519519  }
    520520  if(fFlip & FLIP_VERT) {
    521   //manually reverse bitmap data
    522   char *src = bmpBits + (pOS2bmp->cy-1)*dibinfo.dsBm.bmWidthBytes;
    523   char *dst = bmpBitsDblBuffer;
    524   for(int i=0;i<pOS2bmp->cy;i++) {
    525     memcpy(dst, src, dibinfo.dsBm.bmWidthBytes);
    526     dst += dibinfo.dsBm.bmWidthBytes;
    527     src -= dibinfo.dsBm.bmWidthBytes;
    528   }
    529   bitmapBits = bmpBitsDblBuffer;
     521        //manually reverse bitmap data
     522        char *src = bmpBits + (pOS2bmp->cy-1)*dibinfo.dsBm.bmWidthBytes;
     523        char *dst = bmpBitsDblBuffer;
     524        for(int i=0;i<pOS2bmp->cy;i++) {
     525            memcpy(dst, src, dibinfo.dsBm.bmWidthBytes);
     526            dst += dibinfo.dsBm.bmWidthBytes;
     527            src -= dibinfo.dsBm.bmWidthBytes;
     528        }
     529        bitmapBits = bmpBitsDblBuffer;
    530530  }
    531531  else  bitmapBits = bmpBits;
     
    535535        dprintf(("DIBSection::BitBlt; convert rgb 555 to 565 (old y inv. = %d)", oldyinversion));
    536536
    537   if(bmpBitsDblBuffer == NULL)
    538     DebugInt3();
    539 
    540     // PH 2000/10/01 - Fix for Beyond Compare 1.9d
    541     // Note: according to documentation, cmImage can be zero for
    542     // RGB- / non-compressed bitmaps.
    543     int iLength = pOS2bmp->cbImage;
    544     if (iLength == 0)
    545       iLength = pOS2bmp->cx * pOS2bmp->cy * (pOS2bmp->cBitCount >> 3);
    546 
    547     if (iLength > 0)
    548     {
    549       if(CPUFeatures & CPUID_MMX)
    550         RGB555to565MMX((WORD *)bmpBitsDblBuffer, (WORD *)bitmapBits, iLength/sizeof(WORD));
    551       else
    552         RGB555to565((WORD *)bmpBitsDblBuffer, (WORD *)bitmapBits, iLength/sizeof(WORD));
    553     }
    554     else
    555     {
    556       dprintf(("GDI32: DIBSect::BitBlt: WARNING! zero-length bitmap! %08xh",
    557                pOS2bmp));
    558     }
    559 
    560 
    561     rc = GpiDrawBits(hps, bmpBitsDblBuffer, pOS2bmp, 4, &point[0], ROP_SRCCOPY, os2mode);
     537        if(bmpBitsDblBuffer == NULL)
     538            DebugInt3();
     539
     540        // PH 2000/10/01 - Fix for Beyond Compare 1.9d
     541        // Note: according to documentation, cmImage can be zero for
     542        // RGB- / non-compressed bitmaps.
     543        int iLength = pOS2bmp->cbImage;
     544        if (iLength == 0)
     545            iLength = pOS2bmp->cx * pOS2bmp->cy * (pOS2bmp->cBitCount >> 3);
     546
     547        if (iLength > 0)
     548        {
     549            if(CPUFeatures & CPUID_MMX)
     550                    RGB555to565MMX((WORD *)bmpBitsDblBuffer, (WORD *)bitmapBits, iLength/sizeof(WORD));
     551            else    RGB555to565((WORD *)bmpBitsDblBuffer, (WORD *)bitmapBits, iLength/sizeof(WORD));
     552        }
     553        else
     554        {
     555            dprintf(("GDI32: DIBSect::BitBlt: WARNING! zero-length bitmap! %08xh", pOS2bmp));
     556        }
     557
     558
     559        rc = GpiDrawBits(hps, bmpBitsDblBuffer, pOS2bmp, 4, &point[0], ROP_SRCCOPY, os2mode);
    562560  }
    563561  else  rc = GpiDrawBits(hps, bitmapBits, pOS2bmp, 4, &point[0], ROP_SRCCOPY, os2mode);
     
    570568*/
    571569  if(rc == GPI_OK) {
    572     DIBSection *destdib = DIBSection::findHDC(hdcDest);
     570        DIBSection *destdib = DIBSection::findHDC(hdcDest);
    573571        if(destdib) {
    574     destdib->sync(hps, nYdest, nDestHeight);
    575         }
    576   //restore old y inversion height
    577   if(fRestoryYInversion) GpiEnableYInversion(hps, oldyinversion);
    578       SetLastError(ERROR_SUCCESS_W);
    579 
    580       return(TRUE);
     572            destdib->sync(hps, nYdest, nDestHeight);
     573        }
     574        //restore old y inversion height
     575        if(fRestoryYInversion) GpiEnableYInversion(hps, oldyinversion);
     576            SetLastError(ERROR_SUCCESS_W);
     577
     578        return(TRUE);
    581579  }
    582580  if(fRestoryYInversion) GpiEnableYInversion(hps, oldyinversion);
     
    618616
    619617  if(fFlip & FLIP_VERT) {
    620     destBuf = bmpBitsDblBuffer + nYdest*dibinfo.dsBm.bmWidthBytes;
     618        destBuf = bmpBitsDblBuffer + nYdest*dibinfo.dsBm.bmWidthBytes;
    621619
    622620        rc = GpiQueryBitmapBits(hdc, nYdest, nDestHeight, destBuf,
    623621                                tmphdr);
    624   //manually reverse bitmap data
    625   char *src = destBuf;
    626   char *dst = GetDIBObject() + (nYdest+nDestHeight-1)*dibinfo.dsBm.bmWidthBytes;
    627   for(int i=0;i<nDestHeight;i++) {
    628     memcpy(dst, src, dibinfo.dsBm.bmWidthBytes);
    629     dst -= dibinfo.dsBm.bmWidthBytes;
    630     src += dibinfo.dsBm.bmWidthBytes;
    631   }
     622        //manually reverse bitmap data
     623        char *src = destBuf;
     624        char *dst = GetDIBObject() + (nYdest+nDestHeight-1)*dibinfo.dsBm.bmWidthBytes;
     625        for(int i=0;i<nDestHeight;i++) {
     626            memcpy(dst, src, dibinfo.dsBm.bmWidthBytes);
     627            dst -= dibinfo.dsBm.bmWidthBytes;
     628            src += dibinfo.dsBm.bmWidthBytes;
     629        }
    632630  }
    633631  else {
    634     destBuf = GetDIBObject() + nYdest*dibinfo.dsBm.bmWidthBytes;
     632        destBuf = GetDIBObject() + nYdest*dibinfo.dsBm.bmWidthBytes;
    635633        rc = GpiQueryBitmapBits(hdc, nYdest, nDestHeight, destBuf,
    636634                          tmphdr);
    637635#ifdef DEBUG_PALETTE
    638   if(rc != GPI_ALTERROR && tmphdr->cBitCount <= 8) {
    639       for(int i=0;i<(1<<tmphdr->cBitCount);i++)
    640       {
    641           dprintf2(("Index %d : 0x%08X\n",i, *((ULONG*)(&tmphdr->argbColor[i])) ));
    642       }
    643   }
     636        if(rc != GPI_ALTERROR && tmphdr->cBitCount <= 8) {
     637            for(int i=0;i<(1<<tmphdr->cBitCount);i++)
     638            {
     639                dprintf2(("Index %d : 0x%08X\n",i, *((ULONG*)(&tmphdr->argbColor[i])) ));
     640            }
     641        }
    644642#endif
    645643  }
     
    647645#if 0
    648646  if(dibinfo.dsBitfields[1] == 0x3E0) {//RGB 555?
    649   dprintf(("DIBSection::sync: convert RGB 565 to RGB 555"));
     647    dprintf(("DIBSection::sync: convert RGB 565 to RGB 555"));
    650648
    651649    destBuf = GetDIBObject() + nYdest*dibinfo.dsBm.bmWidthBytes;
    652650
    653   if(CPUFeatures & CPUID_MMX) {
    654     RGB565to555MMX((WORD *)destBuf, (WORD *)destBuf, (nDestHeight*dibinfo.dsBm.bmWidthBytes)/sizeof(WORD));
    655   }
    656   else    RGB565to555((WORD *)destBuf, (WORD *)destBuf, (nDestHeight*dibinfo.dsBm.bmWidthBytes)/sizeof(WORD));
     651    if(CPUFeatures & CPUID_MMX) {
     652            RGB565to555MMX((WORD *)destBuf, (WORD *)destBuf, (nDestHeight*dibinfo.dsBm.bmWidthBytes)/sizeof(WORD));
     653    }
     654    else    RGB565to555((WORD *)destBuf, (WORD *)destBuf, (nDestHeight*dibinfo.dsBm.bmWidthBytes)/sizeof(WORD));
    657655  }
    658656#endif
    659657  free(tmphdr);
    660658  if(rc != nDestHeight) {
    661   DebugInt3();
     659    DebugInt3();
    662660  }
    663661}
     
    677675   linesize = (widthDst*dibinfo.dsBm.bmWidthBytes)/pOS2bmp->cx;
    678676   for(int i=0;i<heightDst;i++) {
    679   memcpy(destbuf, srcbuf, linesize);
    680   destbuf += dibinfo.dsBm.bmWidthBytes;
    681   srcbuf  += linesize;
     677        memcpy(destbuf, srcbuf, linesize);
     678        destbuf += dibinfo.dsBm.bmWidthBytes;
     679        srcbuf  += linesize;
    682680   }
    683681}
     
    701699    if(dsect->handle == handle)
    702700    {
    703     dibMutex.leave();
     701        dibMutex.leave();
    704702        return(dsect);
    705703    }
     
    718716  while(dsect)
    719717  {
    720     if(dsect->hdc == hdc)
    721     {
    722       return(dsect);
    723     }
    724     dsect = dsect->next;
     718        if(dsect->hdc == hdc)
     719        {
     720            return(dsect);
     721        }
     722        dsect = dsect->next;
    725723  }
    726724  return(NULL);
     
    733731
    734732  if(dsect)
    735     delete dsect;
    736 
     733        delete dsect;
    737734}
    738735//******************************************************************************
     
    746743  if(iSize == sizeof(DIBSECTION))
    747744  {
    748   memcpy(pDIBSection, &dibinfo, sizeof(dibinfo));
     745        memcpy(pDIBSection, &dibinfo, sizeof(dibinfo));
    749746        return sizeof(DIBSECTION);
    750747  }
     
    752749  if(iSize == sizeof(BITMAP_W))
    753750  {
    754   memcpy(dsBm, &dibinfo.dsBm, sizeof(dibinfo.dsBm));
    755   return sizeof(BITMAP_W);
     751        memcpy(dsBm, &dibinfo.dsBm, sizeof(dibinfo.dsBm));
     752        return sizeof(BITMAP_W);
    756753  }
    757754  return 0;
Note: See TracChangeset for help on using the changeset viewer.