Changeset 3777 for trunk/src


Ignore:
Timestamp:
Jun 29, 2000, 11:28:36 PM (25 years ago)
Author:
mike
Message:

Changed SurfGetDC behavior slightly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ddraw/OS2SURFACE.CPP

    r3161 r3777  
    1 /* $Id: OS2SURFACE.CPP,v 1.25 2000-03-18 21:17:58 mike Exp $ */
     1/* $Id: OS2SURFACE.CPP,v 1.26 2000-06-29 21:28:36 mike Exp $ */
    22
    33/*
    4  * Direct/X Surface class implementaion
     4 * DirectDraw Surface class implementaion
    55 *
    66 * Copyright 1999 Markus Montkowski
     7 * Copyright 2000 Michal Necasek
    78 *
    89 * Project Odin Software License can be found in LICENSE.TXT
     
    302303
    303304#define CBM_CREATEDIB   0x02L   /* create DIB bitmap */
     305
    304306#ifdef DEBUG
    305 
    306307// ******************************************************************************
    307308// *    internal helper functions from WINE
     
    536537  _dump_DDPIXELFORMAT(pf->dwFlags);
    537538  dprintf(("DDRAW: dwFourCC : %ld\n", pf->dwFourCC));
    538   dprintf(("DDRAW: RBG bit cbout : %ld\n", pf->dwRGBBitCount));
     539  dprintf(("DDRAW: RBG bit count : %ld\n", pf->dwRGBBitCount));
    539540  dprintf(("DDRAW: Masks : R %08lx  G %08lx  B %08lx  A %08lx\n",
    540541       pf->dwRBitMask, pf->dwGBitMask, pf->dwBBitMask, pf->dwRGBAlphaBitMask));
     
    721722  if(NULL==DPA_SurfaceMipMaps)
    722723  {
    723     #ifdef DEBUG
    724       dprintf(("DDRAW: Internal : Error creating DPA for MipMaps\n"));
    725     #endif
     724    dprintf(("DDRAW: Internal : Error creating DPA for MipMaps\n"));
    726725    lastError = DDERR_OUTOFMEMORY ;
    727726    return;
     
    731730  if(NULL==DPA_SurfaceAttached)
    732731  {
    733     #ifdef DEBUG
    734       dprintf(("DDRAW: Internal : Error creating DPA for attached surfaces\n"));
    735     #endif
     732    dprintf(("DDRAW: Internal : Error creating DPA for attached surfaces\n"));
    736733    lastError = DDERR_OUTOFMEMORY ;
    737734    return;
     
    741738  if(NULL==DPA_LockedRects)
    742739  {
    743     #ifdef DEBUG
    744       dprintf(("DDRAW: Internal : Error creating DPA for Locked Rectangles\n"));
    745     #endif
     740    dprintf(("DDRAW: Internal : Error creating DPA for Locked Rectangles\n"));
    746741    lastError = DDERR_OUTOFMEMORY ;
    747742    return;
     
    751746  if(NULL==DPA_SurfacePrivateData)
    752747  {
    753     #ifdef DEBUG
    754       dprintf(("DDRAW: Internal : Error creating DPA for priva surface Data\n"));
    755     #endif
     748    dprintf(("DDRAW: Internal : Error creating DPA for private surface Data\n"));
    756749    lastError = DDERR_OUTOFMEMORY ;
    757750    return;
     
    784777          break;
    785778        default:
    786           dprintf(("DDRAW: Unsupported System ColorDeapth %d",lpDraw->dCaps.ulDepth));
     779          dprintf(("DDRAW: Unsupported System ColorDepth %d",lpDraw->dCaps.ulDepth));
    787780          BltSolid  = NULL;
    788781          ColorConv = NULL;
     
    815808          break;
    816809        default:
    817           dprintf(("DDRAW: Unsupported System ColorDeapth %d",lpDraw->dCaps.ulDepth));
     810          dprintf(("DDRAW: Unsupported System ColorDepth %d",lpDraw->dCaps.ulDepth));
    818811          BltSolid  = NULL;
    819812          ColorConv = NULL;
     
    846839          break;
    847840        default:
    848           dprintf(("DDRAW: Unsupported System ColorDeapth %d",lpDraw->dCaps.ulDepth));
     841          dprintf(("DDRAW: Unsupported System ColorDepth %d",lpDraw->dCaps.ulDepth));
    849842          BltSolid  = NULL;
    850843          ColorConv = NULL;
     
    877870          break;
    878871        default:
    879           dprintf(("DDRAW: Unsupported System ColorDeapth %d",lpDraw->dCaps.ulDepth));
     872          dprintf(("DDRAW: Unsupported System ColorDepth %d",lpDraw->dCaps.ulDepth));
    880873          BltSolid  = NULL;
    881874          ColorConv = NULL;
     
    885878      break;
    886879    default:
    887       dprintf(("DDRAW: Unsupported DX ColorDeapth %d",lpDraw->GetScreenBpp()));
     880      dprintf(("DDRAW: Unsupported DX ColorDepth %d",lpDraw->GetScreenBpp()));
    888881      BltSolid  = NULL;
    889882      ColorConv = NULL;
     
    902895    if( surfaceType & DDSCAPS_PRIMARYSURFACE)
    903896    {
    904       #ifdef DEBUG
    905         dprintf(("DDRAW: Primary surface!\n"));
    906       #endif
    907 
     897      dprintf(("DDRAW: Primary surface!\n"));
    908898      if( lpDraw->HasPrimarySurface())
    909899      {
    910         #ifdef DEBUG
    911           dprintf(("DDRAW: Primary surface already exits!\n"));
    912         #endif
     900        dprintf(("DDRAW: Primary surface already exits!\n"));
    913901        lastError = DDERR_PRIMARYSURFACEALREADYEXISTS;
    914902        return;
     
    931919      if( lpDraw->dCaps.ulDepth == lpDraw->GetScreenBpp() )
    932920      {
    933         dprintf(("DDRAW: DirectScreenAccess possible\n"));
     921        dprintf(("DDRAW: Direct Screen Access possible\n"));
    934922
    935923        // Yes so direct access to framebuffer is possible
     
    946934        // and blit to the real framebuffer on Unlock to do color conversion
    947935
    948         dprintf( ("Need Color conversation %d => %d Bit\n",
     936        dprintf( ("Need Color conversion %d => %d Bit\n",
    949937                  lpDraw->GetScreenBpp(),
    950938                  lpDraw->dCaps.ulDepth
     
    967955      // Update passed in and local Surface description
    968956
    969       #ifdef DEBUG
    970         dprintf(("DDRAW: Setting up Surface\n"));
    971       #endif
     957      dprintf(("DDRAW: Setting up Surface\n"));
    972958      DDSurfaceDesc.dwFlags     |= DDSD_WIDTH | DDSD_HEIGHT |
    973959                                   DDSD_PITCH | DDSD_LPSURFACE |
     
    10631049          dprintf(("DDRAW: Unsupported Complex Surface\n"));
    10641050          #ifdef DEBUG
    1065             _dump_DDSCAPS(DDSurfaceDesc.dwFlags);
     1051          _dump_DDSCAPS(DDSurfaceDesc.dwFlags);
    10661052          #endif
    10671053          lastError = DDERR_OUTOFMEMORY;
     
    14191405  DWORD *pPal24;
    14201406  WORD  *pPal16;
    1421   #ifdef DEBUG
    1422     dprintf(("DDRAW: ColorFill with %08X\n", dwFillColor));
    1423   #endif
     1407  dprintf(("DDRAW: ColorFill with %08X\n", dwFillColor));
    14241408
    14251409  if(NULL!=lpDestRect)
     
    14431427  //dprintf(("DDRAW: 0x%08X (%d/%d) at\n", pLine,FillWidth,FillHeight));
    14441428
    1445   // Better safe then sorry
    1446   if(FillHeight<=0)
     1429  // Better safe than sorry
     1430  if (FillHeight <= 0)
    14471431    return(DD_OK);
    14481432
     
    16541638      break;
    16551639    default:
    1656       #ifdef DEBUG
    16571640        dprintf( ("Unexpected Screen Bitdepth %d\n",
    16581641                  lpDraw->dCaps.ulDepth));
    1659       #endif
    16601642      break;
    16611643  }
     
    18011783    else
    18021784    {
    1803       dprintf(("DDRAW: We are oe of many buffers\n"));
     1785      dprintf(("DDRAW: We are one of many buffers\n"));
    18041786      DDSurfaceDesc.ddsCaps.dwCaps &=  ~DDSCAPS_BACKBUFFER ;
    18051787      DDSurfaceDesc.ddsCaps.dwCaps |=  DDSCAPS_FLIP;
     
    18331815  if(IsEqualGUID(riid, IID_IDirectDrawSurface))
    18341816  {
    1835     *ppvObj = &me->Vtbl2;  // ToDo DO a real V1 table
     1817    *ppvObj = &me->lpVtbl;  // ToDo DO a real V1 table
    18361818    rc = DD_OK;
    18371819    goto RetFn;
     
    18391821  if(IsEqualGUID(riid, IID_IDirectDrawSurface2))
    18401822  {
    1841     *ppvObj = &me->Vtbl2;
     1823    *ppvObj = &me->lpVtbl2;
    18421824    rc = DD_OK;
    18431825    goto RetFn;
     
    18701852 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    18711853
    1872   #ifdef DEBUG
    1873     dprintf(("DDRAW: OS2IDirectDrawSurface::SurfAddRef %d\n", me->Referenced+1));
    1874   #endif
     1854  dprintf(("DDRAW: OS2IDirectDrawSurface::SurfAddRef %d\n", me->Referenced+1));
    18751855
    18761856  return ++me->Referenced;
     
    18821862 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    18831863
    1884   #ifdef DEBUG
    1885     dprintf(("DDRAW: OS2IDirectDrawSurface::SurfRelease %d\n", me->Referenced-1));
    1886     dprintf(("DDRAW: OS2IDirectDrawSurface::Surface %X\n", me));
    1887   #endif
     1864  dprintf(("DDRAW: OS2IDirectDrawSurface::SurfRelease %d\n", me->Referenced-1));
     1865  dprintf(("DDRAW: OS2IDirectDrawSurface::Surface %X\n", me));
    18881866  if(me->Referenced)
    18891867  {
     
    19081886{
    19091887
    1910   #ifdef DEBUG
    1911     dprintf(("DDRAW: SurfAddAttachedSurface\n"));
    1912   #endif
     1888  dprintf(("DDRAW: SurfAddAttachedSurface\n"));
    19131889  return SurfAddAttachedSurface4(This, (LPDIRECTDRAWSURFACE4)lpDDSurface);
    19141890}
     
    19181894{
    19191895
    1920   #ifdef DEBUG
    1921     dprintf(("DDRAW: SurfAddAttachedSurface\n"));
    1922   #endif
     1896  dprintf(("DDRAW: SurfAddAttachedSurface\n"));
    19231897  return SurfAddAttachedSurface4(This, (LPDIRECTDRAWSURFACE4)lpDDSurface);
    19241898}
     
    19321906  int rc;
    19331907
    1934   #ifdef DEBUG
    1935     dprintf(("DDRAW: SurfAddAttachedSurface4\n"));
    1936   #endif
     1908  dprintf(("DDRAW: SurfAddAttachedSurface4\n"));
    19371909
    19381910  if (NULL==lpDDSurface)
     
    19431915  if(AttachedSurface->IsImplicitSurface())
    19441916  {
    1945     #ifdef DEBUG
    1946      dprintf(("DDRAW: Internal : Can't attach an implicit created surface to an other surface\n"));
    1947     #endif
     1917    dprintf(("DDRAW: Internal : Can't attach an implicitly created surface to another surface\n"));
    19481918    return(DDERR_CANNOTATTACHSURFACE);
    19491919  }
     
    19511921  if(This == AttachedSurface)
    19521922  {
    1953     #ifdef DEBUG
    1954      dprintf(("DDRAW: Can't attach an surface to itself\n"));
    1955     #endif
     1923    dprintf(("DDRAW: Can't attach a surface to itself\n"));
    19561924    return(DDERR_CANNOTATTACHSURFACE);
    19571925  }
     
    19761944        else
    19771945        {
    1978           #ifdef DEBUG
    1979             dprintf(("DDRAW: Internal : Error attaching to MipMap\n"));
    1980           #endif
     1946          dprintf(("DDRAW: Internal : Error attaching to MipMap\n"));
    19811947          return(DDERR_CANNOTATTACHSURFACE);
    19821948        }
     
    19841950      else
    19851951      {
    1986         #ifdef DEBUG
    1987           dprintf(("DDRAW: Target Surface isn't a MipMap\n"));
    1988         #endif
     1952        dprintf(("DDRAW: Target Surface isn't a MipMap\n"));
    19891953        return(DDERR_CANNOTATTACHSURFACE);
    19901954      }
     
    20021966      else
    20031967      {
    2004         #ifdef DEBUG
    2005           dprintf(("DDRAW: Internal : Error attaching to general Set\n"));
    2006         #endif
     1968        dprintf(("DDRAW: Internal : Error attaching to general Set\n"));
    20071969        return(DDERR_CANNOTATTACHSURFACE);
    20081970      }
     
    20171979       )
    20181980    {
    2019       #ifdef DEBUG
    2020         dprintf(("DDRAW: Surfaces don't have same dimensions\n"));
    2021       #endif
     1981      dprintf(("DDRAW: Surfaces don't have equal dimensions\n"));
    20221982      return(DDERR_CANNOTATTACHSURFACE);
    20231983    }
     
    20281988        if( (AttachedSurface->GetFrontBuffer()!=NULL) || (AttachedSurface->BackBuffer!= NULL))
    20291989        {
    2030           #ifdef DEBUG
    2031             dprintf(("DDRAW: Surfaces already has a front/backbuffer\n"));
    2032           #endif
     1990          dprintf(("DDRAW: Surface already has a front/backbuffer\n"));
    20331991          return(DDERR_SURFACEALREADYATTACHED);
    20341992        }
     
    20632021        else
    20642022        {
    2065           #ifdef DEBUG
    2066             dprintf(("DDRAW: Can't attach backbuffer to anything but a frontbuffer\n"));
    2067           #endif
    2068          return(DDERR_CANNOTATTACHSURFACE);
     2023          dprintf(("DDRAW: Can't attach backbuffer to anything but a frontbuffer\n"));
     2024          return(DDERR_CANNOTATTACHSURFACE);
    20692025        }
    20702026      }
     
    20872043            else
    20882044            {
    2089               #ifdef DEBUG
    2090                 dprintf(("DDRAW: Internal : Error attaching to MipMap\n"));
    2091               #endif
     2045              dprintf(("DDRAW: Internal : Error attaching to MipMap\n"));
    20922046              return(DDERR_CANNOTATTACHSURFACE);
    20932047            }
     
    20952049          else
    20962050          {
    2097             #ifdef DEBUG
    2098               dprintf(("DDRAW: Tagget Surface isn't a MipMap\n"));
    2099             #endif
     2051            dprintf(("DDRAW: Target Surface isn't a MipMap\n"));
    21002052           return(DDERR_CANNOTATTACHSURFACE);
    21012053          }
     
    21112063          else
    21122064          {
    2113             #ifdef DEBUG
    2114               dprintf(("DDRAW: Internal : Error attaching to general Set\n"));
    2115             #endif
     2065            dprintf(("DDRAW: Internal : Error attaching to general Set\n"));
    21162066            return(DDERR_CANNOTATTACHSURFACE);
    21172067          }
     
    21272077HRESULT __stdcall SurfAddOverlayDirtyRect(THIS, LPRECT)
    21282078{
    2129   #ifdef DEBUG
    2130     dprintf(("DDRAW: SurfAddOverlayDirtyRect Not implemented by M$ in V 6.0! \n"));
    2131   #endif
     2079  dprintf(("DDRAW: SurfAddOverlayDirtyRect Not implemented by M$ in DX 6.0!\n"));
    21322080
    21332081  return(DD_OK);
     
    22962244    {
    22972245      delete pIRectDest;
    2298       dprintf(("DDRAW: Blt: Dest Surface partly locked\n"));
     2246      dprintf(("DDRAW: Blt: Dest Surface partially locked\n"));
    22992247      return(DDERR_SURFACEBUSY);
    23002248    }
     
    24852433      ( (NULL==lpSrcRect) && (NULL!=lpDestRect) ) )
    24862434  {
    2487     dprintf(("DDRAW: Blitting with scaleing\n Not supported.\n"));
     2435    dprintf(("DDRAW: Blitting with scaling\n Not supported.\n"));
    24882436
    24892437    return DDERR_NOSTRETCHHW;
     
    31963144HRESULT __stdcall SurfBltBatch(THIS, LPDDBLTBATCH, DWORD, DWORD )
    31973145{
    3198   #ifdef DEBUG
    3199     dprintf(("DDRAW: SurfBltBatch Not implemented by M$\n"));
    3200   #endif
     3146  dprintf(("DDRAW: SurfBltBatch Not implemented by M$\n"));
    32013147
    32023148  return(DD_OK);
     
    32513197  DWORD dwDestColor, dwSrcColor, BlitWidth, BlitHeight,x,y;
    32523198
    3253   #ifdef DEBUG
    3254     dprintf(("DDRAW: SurfBltFast4 %08X at(%d/%d) onto %08X with flags %08X\n",src, dwX,dwY, dest, dwTrans));
    3255   #endif
     3199  dprintf(("DDRAW: SurfBltFast4 %08X at(%d/%d) onto %08X with flags %08X\n",src, dwX,dwY, dest, dwTrans));
    32563200
    32573201  if( (NULL==lpDDSrcSurface) ||
     
    35863530{
    35873531  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    3588   #ifdef DEBUG
    3589     dprintf(("DDRAW: SurfDeleteAttachedSurface\n"));
    3590   #endif
     3532  dprintf(("DDRAW: SurfDeleteAttachedSurface\n"));
    35913533
    35923534  return(SurfDeleteAttachedSurface4(me, dwFlags, (LPDIRECTDRAWSURFACE4)lpDDSurface));
     
    35973539{
    35983540  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    3599   #ifdef DEBUG
    3600     dprintf(("DDRAW: SurfDeleteAttachedSurface\n"));
    3601   #endif
     3541  dprintf(("DDRAW: SurfDeleteAttachedSurface\n"));
    36023542
    36033543  return(SurfDeleteAttachedSurface4(me, dwFlags, (LPDIRECTDRAWSURFACE4)lpDDSurface));
     
    36143554
    36153555  BOOL Found = FALSE;
    3616   #ifdef DEBUG
    3617     dprintf(("DDRAW: SurfDeleteAttachedSurface\n"));
    3618   #endif
     3556  dprintf(("DDRAW: SurfDeleteAttachedSurface\n"));
    36193557
    36203558  if((0!=dwFlags)||(NULL==lpDDSurface))
     
    37563694{
    37573695  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    3758   #ifdef DEBUG
    3759     dprintf(("DDRAW: SurfEnumAttachedSurfaces\n"));
    3760   #endif
     3696  dprintf(("DDRAW: SurfEnumAttachedSurfaces\n"));
    37613697
    37623698  return(SurfEnumAttachedSurfaces4(me,lpContext, (LPDDENUMSURFACESCALLBACK2) lpCallBack));
     
    37723708  HRESULT rc;
    37733709
    3774   #ifdef DEBUG
    3775     dprintf(("DDRAW: SurfEnumAttachedSurfaces\n"));
    3776   #endif
     3710  dprintf(("DDRAW: SurfEnumAttachedSurfaces\n"));
    37773711  if (NULL==lpCallBack)
    37783712    return (DDERR_INVALIDPARAMS);
     
    39423876  else
    39433877  {
    3944     #ifdef DEBUG
    3945       dprintf(("DDRAW: Memory Flipchain"));
    3946     #endif
     3878    dprintf(("DDRAW: Memory Flipchain"));
    39473879    // Memory Flipchain
    39483880    //
     
    39953927{
    39963928  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    3997   #ifdef DEBUG
    3998     dprintf(("DDRAW: SurfGetAttachedSurface\n"));
    3999   #endif
     3929  dprintf(("DDRAW: SurfGetAttachedSurface\n"));
    40003930
    40013931  return(SurfGetAttachedSurface4(me, (LPDDSCAPS2)lpDDCaps , (LPDIRECTDRAWSURFACE4*)lpDDSurf));
     
    40073937{
    40083938  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    4009   #ifdef DEBUG
    4010     dprintf(("DDRAW: SurfGetAttachedSurface3\n"));
    4011   #endif
     3939  dprintf(("DDRAW: SurfGetAttachedSurface3\n"));
    40123940
    40133941  return(SurfGetAttachedSurface4(me, (LPDDSCAPS2)lpDDCaps , (LPDIRECTDRAWSURFACE4*)lpDDSurf));
     
    41044032HRESULT __stdcall SurfGetBltStatus(THIS This, DWORD)
    41054033{
    4106   #ifdef DEBUG
    4107     dprintf(("DDRAW: SurfGetBltStatus\n"));
    4108   #endif
     4034  dprintf(("DDRAW: SurfGetBltStatus\n"));
    41094035
    41104036  return(DD_OK);
     
    41164042  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    41174043
    4118   #ifdef DEBUG
    4119     dprintf(("DDRAW: SurfGetCaps\n"));
    4120   #endif
     4044  dprintf(("DDRAW: SurfGetCaps\n"));
    41214045
    41224046  if(NULL==lpDDCaps)
     
    41344058{
    41354059  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    4136   #ifdef DEBUG
    4137     dprintf(("DDRAW: SurfGetCaps4\n"));
    4138   #endif
     4060  dprintf(("DDRAW: SurfGetCaps4\n"));
    41394061
    41404062  if(NULL==lpDDCaps)
     
    41454067    _dump_DDSCAPS(lpDDCaps->dwCaps);
    41464068    _dump_DDSCAPS2(lpDDCaps->dwCaps2);
    4147 
    41484069  #endif
    41494070
     
    41564077  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    41574078
    4158   #ifdef DEBUG
    4159     dprintf(("DDRAW: SurfGetClipper\n"));
    4160   #endif
     4079  dprintf(("DDRAW: SurfGetClipper\n"));
    41614080
    41624081  if(me->lpClipper)
     
    41734092{
    41744093  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    4175 
    4176 #ifdef DEBUG
    41774094  dprintf(("DDRAW: SurfGetColorKey\n"));
    4178 #endif
    41794095
    41804096  if ((0==dwFlags) || (NULL==lpDDColKey))
     
    42054121 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    42064122 DDSURFACEDESC2        LockedSurfaceDesc;
    4207  HRESULT rc;
     4123 HRESULT               rc;
     4124 BITMAPINFOHEADER      bmihHdr;
    42084125 BITMAP bmpSurface;
    42094126 struct
     
    42134130 } BitmapInfo;
    42144131
    4215   #ifdef DEBUG
    4216     dprintf(("DDRAW: SurfGetDC\n"));
    4217   #endif
    4218 
    4219   if (NULL==hdc)
     4132  dprintf(("DDRAW: SurfGetDC\n"));
     4133
     4134  if (hdc == NULL)
    42204135    return(DDERR_INVALIDPARAMS);
    42214136
     
    42354150    if(me->hdcImage == NULL)
    42364151    {
    4237       #ifdef DEBUG
    4238         dprintf(("DDRAW: Can't create compatible DC!\n"));
    4239       #endif
     4152      dprintf(("DDRAW: Can't create compatible DC!\n"));
    42404153      me->Vtbl.Unlock(me,NULL);
    42414154      rc = DDERR_GENERIC;
    42424155    }
    4243     InverseDC(me->hdcImage, LockedSurfaceDesc.dwHeight);
    4244   }
    4245 
    4246   if( (DD_OK==rc) &&
    4247       (me->hbmImage == NULL) )
    4248   {
     4156  }
     4157
     4158  if( (DD_OK==rc) && (me->hbmImage == NULL) )
     4159  {
     4160    OS2IDirectDrawPalette *ddpal = NULL;
     4161
    42494162    dprintf( ("Trying to create Bitmap (%d/%d) at %d Bit\n",
    4250               LockedSurfaceDesc.lPitch/ (LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount>>3),
     4163              LockedSurfaceDesc.dwWidth,
    42514164              LockedSurfaceDesc.dwHeight,
    42524165              LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount
    42534166            ));
    4254     #if 0
     4167    #if 1
    42554168    memset(&BitmapInfo, 0, sizeof(BitmapInfo));
    4256     BitmapInfo.bmiHead.biSize   = sizeof(BITMAPINFOHEADER);
    4257     BitmapInfo.bmiHead.biWidth  = LockedSurfaceDesc.lPitch/ (LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount>>3);
    4258     BitmapInfo.bmiHead.biHeight = LockedSurfaceDesc.dwHeight;
    4259     BitmapInfo.bmiHead.biPlanes = 1;
    4260     BitmapInfo.bmiHead.biBitCount    = LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount;
     4169    BitmapInfo.bmiHead.biSize     = sizeof(BITMAPINFOHEADER);
     4170    BitmapInfo.bmiHead.biWidth    = LockedSurfaceDesc.dwWidth;
     4171    BitmapInfo.bmiHead.biHeight   = LockedSurfaceDesc.dwHeight;
     4172    BitmapInfo.bmiHead.biPlanes   = 1;
     4173    BitmapInfo.bmiHead.biBitCount = LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount;
     4174    memset(&bmihHdr, 0, sizeof(bmihHdr));
     4175    bmihHdr.biSize     = sizeof(BITMAPINFOHEADER);
     4176    bmihHdr.biWidth    = LockedSurfaceDesc.dwWidth;
     4177    bmihHdr.biHeight   = LockedSurfaceDesc.dwHeight;
     4178    bmihHdr.biPlanes   = 1;
     4179    bmihHdr.biBitCount = LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount;
    42614180    #else
    42624181    bmpSurface.bmType       = 0;
     
    42744193        break;
    42754194      case 8:
    4276         #if 0
     4195        #if 1
    42774196        BitmapInfo.bmiHead.biCompression = BI_RGB;
    4278         GetSystemPaletteEntries(me->hdcImage,0,255,(PPALETTEENTRY)&BitmapInfo.bmiCols[0]);
     4197        if (me->lpPalette != NULL)
     4198           ddpal = me->lpPalette;
     4199        if ((me->FrontBuffer != NULL) && (me->FrontBuffer->lpPalette != NULL))
     4200           ddpal = me->FrontBuffer->lpPalette;
     4201        if (ddpal != NULL) {
     4202           ddpal->Vtbl.GetEntries((IDirectDrawPalette*)ddpal,
     4203              0, 0, 256, (PPALETTEENTRY)&BitmapInfo.bmiCols[0]);
     4204        }
     4205        else {
     4206           dprintf(("DDRAW: Using default palette\n"));
     4207           for (DWORD i = 0; i < 256; i++) {
     4208              BitmapInfo.bmiCols[i].rgbBlue  = DefaultPalette[i*3+2];
     4209              BitmapInfo.bmiCols[i].rgbGreen = DefaultPalette[i*3+1];
     4210              BitmapInfo.bmiCols[i].rgbRed   = DefaultPalette[i*3];
     4211              BitmapInfo.bmiCols[i].rgbReserved = 0;
     4212           }
     4213        }
    42794214        me->hbmImage = CreateDIBitmap( me->hdcImage,
    4280                                        NULL,
    4281                                        CBM_CREATEDIB,
     4215                                       &bmihHdr,
     4216                                       CBM_INIT,
    42824217                                       LockedSurfaceDesc.lpSurface,
    42834218                                       (PBITMAPINFO)&BitmapInfo,
     
    43004235                                       LockedSurfaceDesc.lpSurface,
    43014236                                       (PBITMAPINFO)&BitmapInfo,
    4302                                        DIB_RGB_COLORS);
     4237                                       DIB_RGB_COLORS );
    43034238        #else
    43044239        bmpSurface.bmBitsPixel  = 24;
     
    43074242        break;
    43084243      default:
    4309         #ifdef DEBUG
    4310           dprintf( ("Unexptected BitCount %d \n",
     4244        dprintf( ("Unexpected BitCount %d \n",
    43114245                    LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount));
    4312         #endif
    43134246        me->hbmImage=NULL;
    43144247    } // end switch (me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)
     
    43164249    if(me->hbmImage == NULL)
    43174250    {
    4318       #ifdef DEBUG
    4319         dprintf(("DDRAW: Can't create bitmap!\n"));
    4320       #endif
     4251      dprintf(("DDRAW: Can't create bitmap!\n"));
    43214252      DeleteDC(me->hdcImage);
    43224253      me->hdcImage = NULL;
     
    43274258  else
    43284259  {
    4329     if( (DD_OK==rc) &&
    4330         (me->dwLastDCUnique != me->dwUniqueValue) )
    4331     {
    4332       #ifdef DEBUG
    4333         dprintf(("DDRAW: The Surface was locked/unlocked after the last DC was created =>Update Bitmap!\n"));
    4334       #endif
     4260    if( (DD_OK==rc) && (me->dwLastDCUnique != me->dwUniqueValue) )
     4261    {
     4262      dprintf(("DDRAW: The Surface was locked/unlocked after the last DC was created =>Update Bitmap!\n"));
    43354263
    43364264      memset(&BitmapInfo,0, sizeof(BitmapInfo));
    43374265      BitmapInfo.bmiHead.biSize     = sizeof(BITMAPINFOHEADER);
    4338       BitmapInfo.bmiHead.biWidth    = LockedSurfaceDesc.lPitch/ (LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount>>3);
     4266      BitmapInfo.bmiHead.biWidth    = LockedSurfaceDesc.dwWidth;
    43394267      BitmapInfo.bmiHead.biHeight   = LockedSurfaceDesc.dwHeight;
    43404268      BitmapInfo.bmiHead.biPlanes   = 1;
     
    43674295          break;
    43684296        default:
    4369           #ifdef DEBUG
    4370             dprintf(("DDRAW: Unexptected BitCount %d => Bitmap not updated!\n",LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount));
    4371           #endif
     4297          dprintf(("DDRAW: Unexpected BitCount %d => Bitmap not updated!\n",LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount));
    43724298          break;
    43734299      } // end switch (me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)
     
    43784304  // Allways select the bitmap into the DC! No matter if the old or a new one
    43794305
    4380   if(DD_OK==rc)
    4381   {
    4382     if((me->hgdiOld = SelectObject(me->hdcImage, me->hbmImage)) == NULL)
    4383     {
    4384       #ifdef DEBUG
    4385         dprintf(("DDRAW: Can't select bitmap into dc!\n"));
    4386       #endif
     4306  if (DD_OK==rc)
     4307  {
     4308    if ((me->hgdiOld = SelectObject(me->hdcImage, me->hbmImage)) == NULL)
     4309    {
     4310      dprintf(("DDRAW: Can't select bitmap into DC!\n"));
    43874311      DeleteDC(me->hdcImage);
    43884312      me->hdcImage = NULL;
     
    44044328HRESULT __stdcall SurfGetFlipStatus(THIS This, DWORD dwFlags)
    44054329{
    4406   #ifdef DEBUG
    4407     dprintf(("DDRAW: SurfGetFlipStatus\n"));
    4408   #endif
     4330  dprintf(("DDRAW: SurfGetFlipStatus\n"));
    44094331
    44104332  if( (DDGFS_CANFLIP!=dwFlags) && (DDGFS_ISFLIPDONE!=dwFlags) )
     
    44184340{
    44194341  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    4420   #ifdef DEBUG
    4421     dprintf(("DDRAW: SurfGetOverlayPosition\n"));
    4422   #endif
     4342  dprintf(("DDRAW: SurfGetOverlayPosition\n"));
    44234343
    44244344  // Maybe simply return dderr_notsupported as we retun a max overlay value of 0 in the caps ?
     
    44474367 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    44484368
    4449   #ifdef DEBUG
    4450     dprintf(("DDRAW: SurfGetPalette\n"));
    4451   #endif
     4369  dprintf(("DDRAW: SurfGetPalette\n"));
    44524370
    44534371  if(me->lpPalette)
     
    44654383  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    44664384
    4467   #ifdef DEBUG
    4468     dprintf(("DDRAW: SurfGetPixelFormat\n"));
    4469   #endif
     4385  dprintf(("DDRAW: SurfGetPixelFormat\n"));
    44704386
    44714387  if(NULL==lpPixelFormat)
     
    44844400  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    44854401
    4486   #ifdef DEBUG
    4487     dprintf(("DDRAW: SurfGetSurfaceDesc\n"));
    4488   #endif
     4402  dprintf(("DDRAW: SurfGetSurfaceDesc\n"));
    44894403
    44904404  if((lpSurface == NULL)||(lpSurface->dwSize != sizeof(DDSURFACEDESC)) )
     
    45034417  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    45044418
    4505   #ifdef DEBUG
    4506     dprintf(("DDRAW: SurfGetSurfaceDesc4\n"));
    4507   #endif
     4419  dprintf(("DDRAW: SurfGetSurfaceDesc4\n"));
    45084420
    45094421  if((lpSurface == NULL)||(lpSurface->dwSize != sizeof(DDSURFACEDESC2)) )
     
    45204432HRESULT __stdcall SurfInitialize(THIS, LPDIRECTDRAW, LPDDSURFACEDESC)
    45214433{
    4522   #ifdef DEBUG
    4523     dprintf(("DDRAW: SurfInitialize\n"));
    4524   #endif
     4434  dprintf(("DDRAW: SurfInitialize\n"));
    45254435
    45264436  return(DDERR_ALREADYINITIALIZED); // Init is done during creation see M$ Doc
     
    45304440HRESULT __stdcall SurfInitialize4(THIS, LPDIRECTDRAW, LPDDSURFACEDESC2)
    45314441{
    4532   #ifdef DEBUG
    4533     dprintf(("DDRAW: SurfInitialize\n"));
    4534   #endif
     4442  dprintf(("DDRAW: SurfInitialize\n"));
    45354443
    45364444  return(DDERR_ALREADYINITIALIZED); // Init is done during creation see M$ Doc
     
    45444452  // if  they are preserved if switching to a FS DOS/OS2 session
    45454453  //
    4546   #ifdef DEBUG
    4547     dprintf(("DDRAW: SurfIsLost\n"));
    4548   #endif
     4454  dprintf(("DDRAW: SurfIsLost\n"));
    45494455
    45504456  return(DD_OK);
     
    45614467  HRESULT rc;
    45624468
    4563   #ifdef DEBUG
    4564     dprintf(("DDRAW: SurfLock %d %08X %d %d\n", (int)lpRect, (int)lpSurfaceDesc, dwFlags, hEvent));
    4565   #endif
     4469  dprintf(("DDRAW: SurfLock %d %08X %d %d\n", (int)lpRect, (int)lpSurfaceDesc, dwFlags, hEvent));
    45664470
    45674471  if((NULL==lpSurfaceDesc)||(NULL!=hEvent))
     
    46064510  HRESULT rc;
    46074511
    4608   #ifdef DEBUG
    4609     dprintf( ("SurfLock4 %08X %08X %08X %d %d\n",
    4610               me,
    4611               (int)lpRect,
    4612               (int)lpSurfaceDesc,
    4613               dwFlags,
    4614               hEvent) );
    4615   #endif
     4512  dprintf( ("SurfLock4 %08X %08X %08X %d %d\n",
     4513            me,
     4514            (int)lpRect,
     4515            (int)lpSurfaceDesc,
     4516            dwFlags,
     4517            hEvent) );
    46164518
    46174519  if( (NULL==lpSurfaceDesc) ||
     
    46414543    if (NULL==lpRect)
    46424544    {
    4643       // If anything is locked we can't locke the complete surface
    4644       dprintf(("DDRAW: Surface has locked Rectangles, and we want to complete lock it\n"));
     4545      // If anything is locked we can't lock the complete surface
     4546      dprintf(("DDRAW: Surface has locked Rectangles and we want to completely lock it\n"));
    46454547      Found = TRUE;
    46464548    }
     
    46504552      // be locked so check for this
    46514553
    4652       dprintf(("DDRAW: Surface has locked Rectangles, check if the overlap\n"));
     4554      dprintf(("DDRAW: Surface has locked Rectangles, check if they overlap\n"));
    46534555
    46544556      i=0;
     
    46724574    {
    46734575      delete pIRectNew;
    4674       #ifdef DEBUG
    4675         dprintf(("DDRAW: SurfLock4: Surface already locked\n\n"));
    4676       #endif
     4576      dprintf(("DDRAW: SurfLock4: Surface already locked\n\n"));
    46774577      rc = DDERR_SURFACEBUSY;
    46784578    }
     
    46894589                                  (lpRect->top * me->dwPitchFB) +
    46904590                                  (lpRect->left * (lpSurfaceDesc->ddpfPixelFormat.dwRGBBitCount>>3)));
    4691       #ifdef DEBUG
    4692         dprintf(("DDRAW: SurfLock4 %08X (x,y) = (%d,%d)\n\n", lpSurfaceDesc->lpSurface, lpRect->top, lpRect->left));
    4693       #endif
     4591      dprintf(("DDRAW: SurfLock4 %08X (x,y) = (%d,%d)\n\n", lpSurfaceDesc->lpSurface, lpRect->top, lpRect->left));
    46944592    }
    46954593    else
    46964594    {
    4697       #ifdef DEBUG
    4698         dprintf(("DDRAW: SurfLock4 %08X \n\n", lpSurfaceDesc->lpSurface));
    4699       #endif
     4595      dprintf(("DDRAW: SurfLock4 %08X \n\n", lpSurfaceDesc->lpSurface));
    47004596    }
    47014597    // Add the rectangle to the list of locked rectangles
     
    47274623 int i,rc;
    47284624
    4729   #ifdef DEBUG
    4730     dprintf(("DDRAW: SurfReleaseDC\n"));
    4731   #endif
     4625  dprintf(("DDRAW: SurfReleaseDC\n"));
    47324626
    47334627  if(hdc != me->hdcImage)
     
    47594653                      (PBITMAPINFO)&BitmapInfo,
    47604654                      DIB_RGB_COLORS);
     4655//      BitmapInfo.bmiHead.biHeight = -BitmapInfo.bmiHead.biHeight;
    47614656      dprintf( ("GetDIBits rc=%d\n Size   :%d\n Width  :%d\n Height :%d\n"
    47624657                " Planes :%d\n BitCount :%d\nLastEror = %d\nPixel[0,0] = 0x%02X\n",
     
    47694664                GetLastError(),
    47704665                ((char*)me->DDSurfaceDesc.lpSurface)[0]));
     4666
    47714667      rc = GetDIBits( hdc,
    47724668                      me->hbmImage,
     
    47974693      break;
    47984694    default:
    4799       #ifdef DEBUG
    4800         dprintf(("DDRAW: Unexptected BitCount %d => Surface unlocked but no data copied back\n",me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount));
    4801       #endif
     4695      dprintf(("DDRAW: Unexpected BitCount %d => Surface unlocked but no data copied back\n",me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount));
    48024696      // we might could keep the surface locked and return an error but this is more "safe"
    48034697      break;
     
    48244718HRESULT __stdcall SurfRestore(THIS)
    48254719{
    4826   #ifdef DEBUG
    4827     dprintf(("DDRAW: SurfRestore\n"));
    4828   #endif
     4720  dprintf(("DDRAW: SurfRestore\n"));
    48294721
    48304722  return(DD_OK);
     
    48364728 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    48374729
    4838   #ifdef DEBUG
    4839     dprintf(("DDRAW: SurfSetClipper\n"));
    4840   #endif
     4730  dprintf(("DDRAW: SurfSetClipper\n"));
    48414731
    48424732  if(lpClipper == NULL)
     
    49254815  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    49264816
    4927   #ifdef DEBUG
    4928     dprintf(("DDRAW: SurfSetOverlayPosition\n"));
    4929   #endif
     4817  dprintf(("DDRAW: SurfSetOverlayPosition\n"));
    49304818
    49314819  if( (me->DDSurfaceDesc.dwFlags & DDSD_CAPS) &&
     
    49544842  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    49554843
    4956   #ifdef DEBUG
    4957     dprintf(("DDRAW: SurfSetPalette\n"));
    4958   #endif
     4844  dprintf(("DDRAW: SurfSetPalette\n"));
    49594845
    49604846  if(lpPalette == NULL)
     
    50174903  HRESULT rc;
    50184904
    5019   #ifdef DEBUG
    5020     dprintf(("DDRAW: SurfUnlock at %08X\n",lpSurfaceData));
    5021   #endif
     4905  dprintf(("DDRAW: SurfUnlock at %08X\n",lpSurfaceData));
    50224906
    50234907  if(me->fLocked == FALSE)
    50244908  {
    5025     #ifdef DEBUG
    5026       dprintf(("DDRAW: Surface not locked!\n"));
    5027     #endif
     4909    dprintf(("DDRAW: Surface not locked!\n"));
    50284910    return(DDERR_NOTLOCKED);
    50294911  }
    5030 
    5031   #ifdef DEBUG
    5032     dprintf(("DDRAW: Start Emuneration of Locked Rects\n"));
    5033   #endif
    50344912
    50354913  i=0;
     
    50414919    // this pointer in the locked rects DPA to unlock the right rect.
    50424920
    5043     while(i<DPA_GetPtrCount(me->DPA_LockedRects) && !Found)
     4921    while(i < DPA_GetPtrCount(me->DPA_LockedRects) && !Found)
    50444922    {
    50454923      pIRectEnum = (DDRectangle*)DPA_FastGetPtr(me->DPA_LockedRects,i);
     
    50554933      if(!Found)
    50564934      {
    5057         #ifdef DEBUG
    5058           dprintf(("DDRAW: Not Found, try Next rect\n"));
    5059         #endif
     4935        dprintf(("DDRAW: Not Found, try Next rect\n"));
    50604936        i++;
    50614937      }
    5062       #ifdef DEBUG
    50634938      else
    50644939      {
    50654940        dprintf(("DDRAW: Found Rect\n"));
    50664941      }
    5067       #endif
    50684942    }
    50694943  }
     
    50904964      if(!Found)
    50914965      {
    5092         #ifdef DEBUG
    5093           dprintf(("DDRAW: Not Found, try Next rect\n"));
    5094         #endif
     4966        dprintf(("DDRAW: Not Found, try Next rect\n"));
    50954967        i++;
    50964968      }
    5097       #ifdef DEBUG
    50984969      else
    50994970      {
    51004971        dprintf(("DDRAW: Found Rect\n"));
    51014972      }
    5102       #endif
    51034973    }
    51044974    delete pIRectUnlock;
     
    51074977  if(!Found)
    51084978  {
    5109     #ifdef DEBUG
    5110       dprintf(("DDRAW: Rectangle not locked, wrong Rect!\n\n"));
    5111     #endif
     4979    dprintf(("DDRAW: Rectangle not locked, wrong Rect!\n\n"));
    51124980    rc = DDERR_INVALIDRECT;
    51134981  }
    51144982  else
    51154983  {
    5116     #ifdef DEBUG
    5117       dprintf(("DDRAW: Remove Rect %d from Seq.\n",i));
    5118     #endif
     4984    dprintf(("DDRAW: Remove Rect %d from Seq.\n",i));
    51194985
    51204986    DPA_DeletePtr(me->DPA_LockedRects,i);
    51214987
    5122     #ifdef DEBUG
    5123       dprintf(("DDRAW: Test if locked Rects main\n"));
    5124     #endif
     4988    dprintf(("DDRAW: Test if locked Rects main\n"));
    51254989
    51264990    if(0==DPA_GetPtrCount(me->DPA_LockedRects))  // Do we have unlocked last rectangle
    51274991    {
    5128       #ifdef DEBUG
    5129         dprintf(("DDRAW: No Locked Rects left for surface\n"));
    5130       #endif
     4992      dprintf(("DDRAW: No Locked Rects left for surface\n"));
    51314993      me->fLocked = FALSE;
    51324994    }
     
    51395001    if(me->pFrameBuffer != me->pDiveBuffer)
    51405002    {
    5141       #ifdef DEBUG
    5142         dprintf(( "ColorConversion Needed %08X != %08X\n",
    5143                   me->pFrameBuffer,
    5144                   me->pDiveBuffer));
    5145       #endif
     5003      dprintf(( "ColorConversion Needed %08X != %08X\n",
     5004                me->pFrameBuffer,
     5005                me->pDiveBuffer));
    51465006      if(NULL!=lpSurfaceData)
    51475007      {
     
    51585018      }
    51595019    }
    5160     #ifdef DEBUG
    51615020    else
    51625021      dprintf( ("No ColorConversion Needed"));
    5163     #endif
    51645022
    51655023    // delete tne DDRectobject of the found rectangle
     
    51935051  HRESULT rc;
    51945052
    5195   #ifdef DEBUG
    5196     dprintf(("DDRAW: SurfUnlock4\n"));
    5197   #endif
     5053  dprintf(("DDRAW: SurfUnlock4\n"));
    51985054
    51995055  if(me->fLocked == FALSE)
    52005056  {
    5201     #ifdef DEBUG
    5202       dprintf(("DDRAW: Surface not locked!\n"));
    5203     #endif
     5057    dprintf(("DDRAW: Surface not locked!\n"));
    52045058    return(DDERR_NOTLOCKED);
    52055059  }
     
    52255079            pIRectUnlock->Right() ));
    52265080
    5227   #ifdef DEBUG
    5228     dprintf(("DDRAW: Start Emuneration of Locked Rects\n"));
    5229   #endif
     5081  dprintf(("DDRAW: Start Enumeration of Locked Rects\n"));
    52305082
    52315083  i=0;
     
    52425094    if(!Found)
    52435095    {
    5244       #ifdef DEBUG
    5245         dprintf(("DDRAW: Not Found, try Next rect\n"));
    5246       #endif
     5096      dprintf(("DDRAW: Not Found, try Next rect\n"));
    52475097      i++;
    52485098    }
    5249     #ifdef DEBUG
    52505099    else
    52515100    {
    52525101      dprintf(("DDRAW: Found Rect\n"));
    52535102    }
    5254     #endif
    52555103  }
    52565104
     
    52605108    if(NULL==lpSurfaceRect)
    52615109    {
    5262       #ifdef DEBUG
    5263         dprintf(("DDRAW: Rectangle not locked, wrong Rect!\n\n"));
    5264       #endif
     5110      dprintf(("DDRAW: Rectangle not locked, wrong Rect!\n\n"));
    52655111      return(DDERR_INVALIDRECT);
    52665112    }
     
    52705116  else
    52715117  {
    5272     #ifdef DEBUG
    5273       dprintf(("DDRAW: Remove Rect from Seq.\n"));
    5274     #endif
     5118    dprintf(("DDRAW: Remove Rect from Seq.\n"));
    52755119
    52765120    DPA_DeletePtr(me->DPA_LockedRects,i);
     
    52785122    if(0==DPA_GetPtrCount(me->DPA_LockedRects))  // Do we have unlocked last rectangle
    52795123    {
    5280       #ifdef DEBUG
    5281         dprintf(("DDRAW: No Locked Rects left for surface\n"));
    5282       #endif
     5124      dprintf(("DDRAW: No Locked Rects left for surface\n"));
    52835125      me->fLocked = FALSE;
    52845126    }
     
    52865128    if(me->pFrameBuffer != me->pDiveBuffer)
    52875129    {
    5288       #ifdef DEBUG
    5289         dprintf(( "ColorConversion Needed %08X != %08X\n",
    5290                   me->pFrameBuffer,
    5291                   me->pDiveBuffer));
    5292       #endif
     5130      dprintf(( "ColorConversion Needed %08X != %08X\n",
     5131                me->pFrameBuffer,
     5132                me->pDiveBuffer));
    52935133      me->ColorConversion(lpSurfaceRect);
    52945134    }
     
    53065146HRESULT __stdcall SurfUpdateOverlay(THIS This, LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX)
    53075147{
    5308   #ifdef DEBUG
    5309     dprintf(("DDRAW: SurfUpdateOverlay\n"));
    5310   #endif
     5148  dprintf(("DDRAW: SurfUpdateOverlay\n"));
    53115149  return(DD_OK);
    53125150}
     
    53155153HRESULT __stdcall SurfUpdateOverlay3(THIS This, LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX)
    53165154{
    5317   #ifdef DEBUG
    5318     dprintf(("DDRAW: SurfUpdateOverlay\n"));
    5319   #endif
     5155  dprintf(("DDRAW: SurfUpdateOverlay\n"));
    53205156  return(DD_OK);
    53215157}
     
    53245160HRESULT __stdcall SurfUpdateOverlay4(THIS, LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX)
    53255161{
    5326   #ifdef DEBUG
    5327     dprintf(("DDRAW: SurfUpdateOverlay\n"));
    5328   #endif
     5162  dprintf(("DDRAW: SurfUpdateOverlay\n"));
    53295163  return(DD_OK);
    53305164}
     
    53335167HRESULT __stdcall SurfUpdateOverlayDisplay(THIS, DWORD)
    53345168{
    5335   #ifdef DEBUG
    5336     dprintf(("DDRAW: SurfUpdateOverlayDisplay\n"));
    5337   #endif
     5169  dprintf(("DDRAW: SurfUpdateOverlayDisplay\n"));
    53385170  return(DD_OK);
    53395171}
     
    53425174HRESULT __stdcall SurfUpdateOverlayZOrder(THIS, DWORD, LPDIRECTDRAWSURFACE2)
    53435175{
    5344   #ifdef DEBUG
    5345     dprintf(("DDRAW: SurfUpdateOverlayZOrder\n"));
    5346   #endif
     5176  dprintf(("DDRAW: SurfUpdateOverlayZOrder\n"));
    53475177  return(DD_OK);
    53485178}
     
    53515181HRESULT __stdcall SurfUpdateOverlayZOrder3(THIS, DWORD, LPDIRECTDRAWSURFACE3)
    53525182{
    5353   #ifdef DEBUG
    5354     dprintf(("DDRAW: SurfUpdateOverlayZOrder\n"));
    5355   #endif
     5183  dprintf(("DDRAW: SurfUpdateOverlayZOrder\n"));
    53565184  return(DD_OK);
    53575185}
     
    53605188HRESULT __stdcall SurfUpdateOverlayZOrder4(THIS, DWORD, LPDIRECTDRAWSURFACE4)
    53615189{
    5362   #ifdef DEBUG
    5363     dprintf(("DDRAW: SurfUpdateOverlayZOrder4\n"));
    5364   #endif
     5190  dprintf(("DDRAW: SurfUpdateOverlayZOrder4\n"));
    53655191  return(DD_OK);
    53665192}
     
    53715197 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    53725198
    5373   #ifdef DEBUG
    5374     dprintf(("DDRAW: SurfGetDDInterface\n"));
    5375   #endif
     5199  dprintf(("DDRAW: SurfGetDDInterface\n"));
    53765200  *lplpDirectDraw = (LPVOID FAR *)me->lpDraw;
    53775201  return(DD_OK);
     
    53845208  // If we implement this for the None dive buffers with a pdd the we must change
    53855209  // from malloc to DosAllocMem and use OBJ_TILE flag
    5386   #ifdef DEBUG
    5387     dprintf(("DDRAW: SurfPageLock\n"));
    5388   #endif
     5210  dprintf(("DDRAW: SurfPageLock\n"));
    53895211  return(DD_OK);
    53905212}
     
    53935215HRESULT __stdcall SurfPageUnlock(THIS, DWORD)
    53945216{
    5395   #ifdef DEBUG
    5396     dprintf(("DDRAW: SurfPageUnlock\n"));
    5397   #endif
     5217  dprintf(("DDRAW: SurfPageUnlock\n"));
    53985218  return(DD_OK);
    53995219}
     
    54045224HRESULT __stdcall SurfSetSurfaceDesc(THIS This, LPDDSURFACEDESC lpSurfDesc, DWORD dwFlags)
    54055225{
    5406   #ifdef DEBUG
    5407     dprintf(("DDRAW: SurfSetSurfaceDesc\n"));
    5408   #endif
     5226  dprintf(("DDRAW: SurfSetSurfaceDesc\n"));
    54095227
    54105228  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
     
    54515269HRESULT __stdcall SurfSetSurfaceDesc4(THIS This, LPDDSURFACEDESC2 lpSurfDesc, DWORD dwFlags)
    54525270{
    5453   #ifdef DEBUG
    5454     dprintf(("DDRAW: SurfSetSurfaceDesc4\n"));
    5455   #endif
     5271  dprintf(("DDRAW: SurfSetSurfaceDesc4\n"));
    54565272
    54575273  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
     
    55095325  HRESULT rc;
    55105326
    5511   #ifdef DEBUG
    5512     dprintf(("DDRAW: SurfSetPrivateData\n"));
    5513   #endif
     5327  dprintf(("DDRAW: SurfSetPrivateData\n"));
    55145328
    55155329  if(NULL==me)
     
    56925506  BOOL bFound = FALSE;
    56935507
    5694   #ifdef DEBUG
    5695     dprintf(("DDRAW: SurfGetPrivateData\n"));
    5696   #endif
     5508  dprintf(("DDRAW: SurfGetPrivateData\n"));
    56975509
    56985510  if(NULL==me)
     
    57525564  BOOL bFound = FALSE;
    57535565
    5754   #ifdef DEBUG
    5755     dprintf(("DDRAW: SurfFreePrivateData\n"));
    5756   #endif
     5566  dprintf(("DDRAW: SurfFreePrivateData\n"));
    57575567
    57585568  if(NULL==me)
     
    57975607HRESULT __stdcall SurfGetUniquenessValue(THIS This, LPDWORD lpValue)
    57985608{
    5799   #ifdef DEBUG
    5800     dprintf(("DDRAW: SurfGetUniquenessValue\n"));
    5801   #endif
     5609  dprintf(("DDRAW: SurfGetUniquenessValue\n"));
    58025610  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
    58035611  if (NULL==lpValue)
     
    58165624
    58175625
    5818   #ifdef DEBUG
    5819     dprintf(("DDRAW: SurfChangeUniquenessValue\n"));
    5820   #endif
     5626  dprintf(("DDRAW: SurfChangeUniquenessValue\n"));
    58215627  me->dwUniqueValue++;
    58225628
Note: See TracChangeset for help on using the changeset viewer.