Changeset 10579 for trunk/src


Ignore:
Timestamp:
Apr 13, 2004, 4:17:17 PM (21 years ago)
Author:
sandervl
Message:

updates

Location:
trunk/src
Files:
4 added
2 edited

Legend:

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

    r10558 r10579  
    1 /* $Id: dibitmap.cpp,v 1.43 2004-03-24 16:55:35 sandervl Exp $ */
     1/* $Id: dibitmap.cpp,v 1.44 2004-04-13 14:17:17 sandervl Exp $ */
    22
    33/*
     
    4848        ((BITMAPINFOHEADER *)lpbmih)->biHeight = -lpbmih->biHeight;
    4949
    50         if(lpbInit && fdwInit == CBM_INIT) 
     50        if(lpbInit && fdwInit == CBM_INIT)
    5151        {
    5252            // upside down
     
    5454            long lLineByte = DIB_GetDIBWidthBytes(lpbmih->biWidth, lpbmih->biBitCount);
    5555            long lHeight   = lpbmih->biHeight;
    56    
     56
    5757            newbits = (WORD *)malloc( lLineByte * lHeight );
    5858            if(newbits) {
     
    9595        memcpy(infoLoc, lpbmi, sizeof(BITMAPINFO));
    9696
    97         if(GetDIBColorTable(hdc, 0, biClrUsed, pColors) == 0) 
     97        if(GetDIBColorTable(hdc, 0, biClrUsed, pColors) == 0)
    9898        {
    9999            dprintf(("ERROR: StretchDIBits: GetDIBColorTable failed!!"));
     
    107107        rc = CreateDIBitmap(hdc, lpbmih, fdwInit, lpbInit, (PBITMAPINFO)infoLoc,
    108108                            DIB_RGB_COLORS);
    109    
     109
    110110        return rc;
    111111    }
     
    165165    ((BITMAPINFOHEADER *)lpbmih)->biBitCount = biBitCount;
    166166
    167     if(rc) { 
     167    if(rc) {
    168168        STATS_CreateDIBitmap(rc, hdc, lpbmih, fdwInit, lpbInit, lpbmi, fuUsage);
    169169        if(bitfields[1] == RGB565_GREEN_MASK) {
     
    181181{
    182182    HBITMAP hBitmap;
    183     pDCData pHps; 
     183    pDCData pHps;
    184184
    185185    pHps = (pDCData)OSLibGpiQueryDCData((HPS)hdc);
     
    240240    int     iHeight, iWidth;
    241241    BOOL    fCreateDC = FALSE;
    242    
     242
    243243    dprintf(("GDI32: CreateDIBSection %x %x %x %x %x %d", hdc, pbmi, iUsage, ppvBits, hSection, dwOffset));
    244244
     
    406406{
    407407    int nrlines;
    408     pDCData pHps; 
     408    pDCData pHps;
    409409    HDC hdcMem;
    410410    DWORD biCompression;
     
    436436    //If the app wants bitmap data and upside down, then flip image
    437437    if(lpvBits && lpbi->bmiHeader.biHeight < 0 && (lpbi->bmiHeader.biCompression == BI_RGB ||
    438        lpbi->bmiHeader.biCompression == BI_BITFIELDS)) 
     438       lpbi->bmiHeader.biCompression == BI_BITFIELDS))
    439439    {
    440440        INT rc = -1;
     
    461461        }
    462462        else DebugInt3();
    463  
     463
    464464        //restore height
    465465        lpbi->bmiHeader.biHeight = height;
    466466    }
    467     else {
    468         LONG height = lpbi->bmiHeader.biHeight;
    469 
    470         if(lpbi->bmiHeader.biHeight < 0) {
    471             lpbi->bmiHeader.biHeight = -lpbi->bmiHeader.biHeight;
    472         }
     467    else if (lpbi->bmiHeader.biHeight < 0)
     468    {
     469        LONG cySaved = lpbi->bmiHeader.biHeight;
     470        lpbi->bmiHeader.biHeight = -cySaved;
    473471        nrlines = O32_GetDIBits(hdcMem, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage);
    474 
    475         //restore height
    476         lpbi->bmiHeader.biHeight = height;
    477     }
     472        lpbi->bmiHeader.biHeight = cySaved;
     473    }
     474    else
     475        nrlines = O32_GetDIBits(hdcMem, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage);
    478476
    479477    if(lpvBits) {
     
    528526    //WGSS/Open32 returns 1 when querying the bitmap info; must return nr of scanlines
    529527    //(0 signals failure)
    530     if(lpvBits == NULL) {
    531        if(nrlines != 0)
    532             nrlines = cScanLines;
    533        else dprintf(("GetDIBits failed!!"));
    534     }
     528    #if 0//XP returns 1 just like Open32 does for the query bitmap info header mode.
     529    if (lpvBits == NULL)
     530    {
     531       if (nrlines != 0)
     532           nrlines = cScanLines;
     533       else
     534           dprintf(("GetDIBits failed!!"));
     535    }
     536    #else
     537    if (!nrlines)
     538        dprintf(("GetDIBits failed!!"));
     539    #endif
    535540    return nrlines;
    536541}
     
    621626    //If upside down, reverse scanlines and call SetDIBits again
    622627    if(pBitmapInfo->bmiHeader.biHeight < 0 && (pBitmapInfo->bmiHeader.biCompression == BI_RGB ||
    623        pBitmapInfo->bmiHeader.biCompression == BI_BITFIELDS)) 
     628       pBitmapInfo->bmiHeader.biCompression == BI_BITFIELDS))
    624629    {
    625630        // upside down
  • trunk/src/libwrap/makefile

    r10243 r10579  
    1 # $Id: makefile,v 1.2 2003-09-07 03:55:57 bird Exp $
     1# $Id: makefile,v 1.3 2004-04-13 14:15:54 sandervl Exp $
    22
    33#
     
    16231623$(OBJDIR)\__OpenClipbrd.obj \
    16241624$(OBJDIR)\O32_GetStartupInfo.obj \
    1625 $(OBJDIR)\O32_WaitForInputIdle.obj
     1625$(OBJDIR)\O32_WaitForInputIdle.obj \
     1626$(OBJDIR)\O32_CreateBitmapFromPMHandle.obj \
     1627$(OBJDIR)\O32_CreatePaletteFromPMHandle.obj \
     1628$(OBJDIR)\O32_GetPMHandleFromGDIHandle.obj \
     1629$(OBJDIR)\_WinSetErrorInfo.obj
    16261630
    16271631
     
    16341638!include $(ODIN32_POST_INC)
    16351639
    1636 
     1640       
    16371641#
    16381642# The fast way
     
    32453249O32_GetStartupInfo.asm
    32463250O32_WaitForInputIdle.asm
     3251O32_CreateBitmapFromPMHandle.asm
     3252O32_CreatePaletteFromPMHandle.asm
     3253O32_GetPMHandleFromGDIHandle.asm
     3254_WinSetErrorInfo.asm
    32473255<<KEEP 
Note: See TracChangeset for help on using the changeset viewer.