Changeset 5931 for trunk/src


Ignore:
Timestamp:
Jun 8, 2001, 1:03:33 PM (24 years ago)
Author:
sandervl
Message:

rop translation + getdibits fixes

Location:
trunk/src/gdi32
Files:
3 edited

Legend:

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

    r5901 r5931  
    1 /* $Id: dibitmap.cpp,v 1.20 2001-06-03 14:52:47 sandervl Exp $ */
     1/* $Id: dibitmap.cpp,v 1.21 2001-06-08 11:03:32 sandervl Exp $ */
    22
    33/*
     
    286286                       void *lpvBits, PBITMAPINFO lpbi, UINT uUsage)
    287287{
    288  int rc;
     288 int nrlines;
    289289
    290290    dprintf(("GDI32: GetDIBits %x %x %d %d %x %x (biBitCount %d) %d", hdc, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, lpbi->bmiHeader.biBitCount, uUsage));
    291291
    292 #if 1 //def OPEN32
    293292    //SvL: WGSS screws up the DC if it's a memory DC
    294293    //     TODO: Fix in WGSS
    295294    HDC hdcMem = CreateCompatibleDC(0);
    296 #endif
    297     rc = O32_GetDIBits(hdcMem, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage);
    298 #if 1 //def OPEN32
     295
     296    nrlines = O32_GetDIBits(hdcMem, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage);
     297
    299298    DeleteDC(hdcMem);
    300 #endif
    301299
    302300    // set proper color masks
     
    314312       break;
    315313    }
    316     if(lpvBits && lpbi->bmiHeader.biBitCount == 16 && ((DWORD*)(lpbi->bmiColors))[1] == 0x3E0)
     314    if(nrlines && lpvBits && lpbi->bmiHeader.biBitCount == 16 && ((DWORD*)(lpbi->bmiColors))[1] == 0x3E0)
    317315    {//RGB 555?
    318316        dprintf(("RGB 565->555 conversion required"));
    319317
    320318        int imgsize = CalcBitmapSize(lpbi->bmiHeader.biBitCount,
    321                                      lpbi->bmiHeader.biWidth, lpbi->bmiHeader.biHeight);
     319                                     lpbi->bmiHeader.biWidth, nrlines);
    322320
    323321        if(CPUFeatures & CPUID_MMX) {
     
    330328    //as 0 signals failure
    331329    if(lpvBits == NULL) {
    332        rc = cScanLines;
    333     }
    334     dprintf(("GDI32: GetDIBits return rc %d", rc));
    335     return rc;
     330       nrlines = cScanLines;
     331    }
     332    dprintf(("GDI32: GetDIBits returned %d", nrlines));
     333    return nrlines;
    336334}
    337335//******************************************************************************
  • trunk/src/gdi32/dibsect.cpp

    r5901 r5931  
    1 /* $Id: dibsect.cpp,v 1.53 2001-06-03 14:52:47 sandervl Exp $ */
     1/* $Id: dibsect.cpp,v 1.54 2001-06-08 11:03:33 sandervl Exp $ */
    22
    33/*
     
    590590  else  bitmapBits = bmpBits;
    591591
    592   switch(Rop) {
    593       case 0xcc0020: /* SRCCOPY */
    594           Rop = ROP_SRCCOPY;
    595           break;
    596       case 0xee0086: /* SRCPAINT */
    597           Rop = ROP_SRCPAINT;
    598           break;
    599       case 0x8800c6: /* SRCAND */
    600           Rop = ROP_SRCAND;
    601           break;
    602       case 0x660046: /* SRCINVERT */
    603           Rop = ROP_SRCINVERT;
    604           break;
    605       case 0x440328: /* SRCERASE */
    606           Rop = ROP_SRCERASE;
    607           break;
    608       case 0x330008: /* NOTSRCCOPY */
    609           Rop = ROP_NOTSRCCOPY;
    610           break;
    611       case 0x1100a6: /* NOTSRCERASE */
    612           Rop = ROP_NOTSRCERASE;
    613           break;
    614       case 0xc000ca: /* MERGECOPY */
    615           Rop = ROP_MERGECOPY;
    616           break;
    617       case 0xbb0226: /* MERGEPAINT */
    618           Rop = ROP_MERGEPAINT;
    619           break;
    620       case 0xf00021: /* PATCOPY */
    621           Rop = ROP_PATCOPY;
    622           break;
    623       case 0xfb0a09: /* PATPAINT */
    624           Rop = ROP_PATPAINT;
    625           break;
    626       case 0x5a0049: /* PATINVERT */
    627           Rop = ROP_PATINVERT;
    628           break;
    629       case 0x550009: /* DSTINVERT */
    630           Rop = ROP_DSTINVERT;
    631           break;
    632       case 0x000042: /* BLACKNESS */
    633           Rop = ROP_ZERO;
    634           break;
    635       case 0xff0062: /* WHITENESS */
    636           Rop = ROP_ONE;
    637           break;
    638       default:
    639           Rop = ROP_SRCCOPY;
    640           break;
    641   }
     592  //Translate ROP
     593  Rop = Rop >> 16;
    642594
    643595  //SvL: Optimize this.. (don't convert entire bitmap if only a part will be blitted to the dc)
  • trunk/src/gdi32/oslibgdi.cpp

    r2802 r5931  
    1 /* $Id: oslibgdi.cpp,v 1.6 2000-02-16 14:18:11 sandervl Exp $ */
     1/* $Id: oslibgdi.cpp,v 1.7 2001-06-08 11:03:33 sandervl Exp $ */
    22
    33/*
     
    2323#include "dbglocal.h"
    2424
     25#if 0
    2526//******************************************************************************
    2627//******************************************************************************
     
    7071//******************************************************************************
    7172//******************************************************************************
     73#endif
Note: See TracChangeset for help on using the changeset viewer.