Ignore:
Timestamp:
Aug 4, 1999, 11:25:26 PM (26 years ago)
Author:
hugh
Message:

Updated colorconversion and added some more debugoutput

File:
1 edited

Legend:

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

    r405 r416  
    296296
    297297  hDive                      = lpDirectDraw->GetDiveInstance();
     298  hDiveCC                    = lpDirectDraw->GetCCDiveInstance();
    298299  surfaceType                = DDSCAPS_OFFSCREENPLAIN;
    299300  memcpy((char *)&DDSurfaceDesc, (char *)lpDDSurfaceDesc, sizeof(DDSURFACEDESC2));
     
    10761077  SETUP_BLITTER sBlt;
    10771078  ULONG ulDN1, ulDN2;
    1078 
     1079  ULONG rc;
    10791080  ulDN1 = ulDN2 = 0;
    10801081
     
    11031104  sBlt.ulNumDstRects     = DIVE_FULLY_VISIBLE;
    11041105
    1105   DiveAllocImageBuffer( hDiveCC,
    1106                         &ulDN1,
    1107                         sBlt.fccSrcColorFormat,
    1108                         width,
    1109                         height,
    1110                         dwPitchFB,
    1111                         (PBYTE)pFrameBuffer);
    1112   DiveAllocImageBuffer( hDiveCC,
    1113                         &ulDN2,
    1114                         sBlt.fccDstColorFormat,
    1115                         width,
    1116                         height,
    1117                         dwPitchDB,
    1118                         (PBYTE)pDiveBuffer);
    1119   DiveSetupBlitter(hDiveCC,&sBlt);
    1120   DiveBlitImage(hDiveCC,ulDN1,ulDN2);
    1121   DiveFreeImageBuffer(hDiveCC,ulDN1);
    1122   DiveFreeImageBuffer(hDiveCC,ulDN2);
     1106  rc = DiveAllocImageBuffer( hDiveCC,
     1107                             &ulDN1,
     1108                             sBlt.fccSrcColorFormat,
     1109                             width,
     1110                             height,
     1111                             dwPitchFB,
     1112                             (PBYTE)pFrameBuffer);
     1113  WriteLog("AllocDiveSrc Buffer rc= %X\n",rc);
     1114
     1115  rc = DiveAllocImageBuffer( hDiveCC,
     1116                             &ulDN2,
     1117                             sBlt.fccDstColorFormat,
     1118                             width,
     1119                             height,
     1120                             dwPitchDB,
     1121                             (PBYTE)pDiveBuffer);
     1122  WriteLog("AllocDiveDst Buffer rc= %Xd\n",rc);
     1123
     1124  rc = DiveSetupBlitter( hDiveCC,
     1125                         &sBlt);
     1126  WriteLog("SetupBlitter rc= %X\n",rc);
     1127
     1128  rc = DiveBlitImage( hDiveCC,
     1129                      ulDN1,
     1130                      ulDN2);
     1131
     1132  WriteLog("Blit rc= %X\n",rc);
     1133
     1134  rc = DiveFreeImageBuffer( hDiveCC,
     1135                            ulDN1);
     1136  WriteLog("Free Src rc= %X\n",rc);
     1137
     1138  rc = DiveFreeImageBuffer( hDiveCC,
     1139                            ulDN2);
     1140
     1141  WriteLog("Free dst rc= %X\n",rc);
     1142
    11231143}
    11241144//******************************************************************************
     
    15821602  #ifdef DEBUG
    15831603    if ( (NULL!=lpDestRect)&& (NULL!=lpSrcRect))
    1584       WriteLog("SurfBlt4 to (%d,%d)(%d,%d) from (%d,%d)(%d,%d)\n", lpDestRect->left, lpDestRect->top,
    1585                lpDestRect->right, lpDestRect->bottom, lpSrcRect->left, lpSrcRect->top,
    1586                lpSrcRect->right, lpSrcRect->bottom);
     1604      WriteLog("SurfBlt4 to (%d,%d)(%d,%d) at %08X from (%d,%d)(%d,%d) at %08X\n", lpDestRect->left, lpDestRect->top,
     1605               lpDestRect->right, lpDestRect->bottom, dest, lpSrcRect->left, lpSrcRect->top,
     1606               lpSrcRect->right, lpSrcRect->bottom, src);
     1607
     1608    _dump_DDBLT(dwFlags);
    15871609  #endif
    15881610
     
    16471669  if(dwFlags & DDBLT_COLORFILL)
    16481670  {
     1671    WriteLog("ColorFill\n");
    16491672    if((NULL==lpDDBltFx)||(lpDDBltFx->dwSize!=sizeof(DDBLTFX)) )
    16501673      return DDERR_INVALIDPARAMS;
     
    16601683  if (dwFlags & DDBLT_DEPTHFILL)
    16611684  {
     1685    WriteLog("DepthFill\n");
    16621686  #ifdef USE_OPENGL
    16631687    GLboolean ztest;
     
    17881812  {
    17891813    // Stretching not supported
     1814    WriteLog("No stretched blits\n");
     1815
    17901816    return DDERR_NOSTRETCHHW;
    17911817  }
     
    17931819  if (dest->DDSurfaceDesc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
    17941820  {
     1821    WriteLog("Dest is Primary Surface\n");
    17951822    if(src->DDSurfaceDesc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
    17961823    {
    17971824      // special Type 1 : Bliting between parts of the screen
     1825
     1826      WriteLog("Src is Primary Surface\n");
    17981827
    17991828      if( *pIRectDest == *pIRectSrc)
     
    24142443  char *pBltPos, *pSrcPos;
    24152444  DWORD dwDestColor, dwSrcColor, BlitWidth, BlitHeight,x,y;
    2416   #ifdef DEBUG
    2417     WriteLog("SurfBltFast (%d, %d)\n",dwX,dwY);
     2445
     2446  #ifdef DEBUG
     2447    WriteLog("SurfBltFast4 %08X at(%d/%d) onto %08X with flags %08X\n",src, dwX,dwY, dest, dwTrans);
    24182448  #endif
    24192449
     
    24222452      (dwX>dest->width) ||
    24232453      (dwY>dest->height))
     2454  {
     2455    WriteLog("Invalid Parameters %08X, %d %d", lpDDSrcSurface ,dest->width , dest->height);
    24242456    return DDERR_INVALIDPARAMS;
     2457  }
    24252458
    24262459  if (NULL!=lpSrcRect)
     
    24492482  if(dwTrans & DDBLTFAST_NOCOLORKEY)
    24502483  {
     2484    WriteLog("Solid Blit");
    24512485    #ifdef USE_ASM
    2452     BltRec(pBltPos, pSrcPos, BlitWidth, BlitHeight,
    2453            dest->dwPitchDB,
    2454            src->dwPitchDB);
     2486      BltRec(pBltPos, pSrcPos, BlitWidth, BlitHeight,
     2487             dest->dwPitchDB,
     2488             src->dwPitchDB);
    24552489    #else
    2456     // Solid Blit
    2457     while(1)
    2458     {
    2459       memcpy(pBltPos,pSrcPos,BlitWidth);
    2460       pBltPos += dest->dwPitchDB;
    2461       pSrcPos += src->dwPitchDB;
    2462       if(! (--BlitHeight))
    2463         break;
    2464     }
     2490      // Solid Blit
     2491      while(1)
     2492      {
     2493        memcpy(pBltPos,pSrcPos,BlitWidth);
     2494        pBltPos += dest->dwPitchDB;
     2495        pSrcPos += src->dwPitchDB;
     2496        if(! (--BlitHeight))
     2497          break;
     2498      }
    24652499    #endif
    24662500
     
    24682502  else
    24692503  {
     2504    WriteLog("TransBlit");
     2505
    24702506    if(dwTrans & DDBLTFAST_SRCCOLORKEY)
    24712507    {
     
    36273663
    36283664  #ifdef DEBUG
    3629     WriteLog("SurfLock4 %d %08X %d %d\n", (int)lpRect, (int)lpSurfaceDesc, dwFlags, hEvent);
     3665    WriteLog("SurfLock4 %08X %08X %d %d\n", (int)lpRect, (int)lpSurfaceDesc, dwFlags, hEvent);
    36303666  #endif
    36313667
     
    36523688    {
    36533689      // If anything is locked we can't locke the complete surface
    3654       WriteLog("Surface has locked Rectangles, and we want to complete lock it");
     3690      WriteLog("Surface has locked Rectangles, and we want to complete lock it\n");
    36553691      Found = TRUE;
    36563692    }
     
    36603696      // be locked so check for this
    36613697
    3662       WriteLog("Surface has locked Rectangles, check if the overlap");
     3698      WriteLog("Surface has locked Rectangles, check if the overlap\n");
    36633699
    36643700      i=0;
     
    36833719      delete pIRectNew;
    36843720      #ifdef DEBUG
    3685         WriteLog("SurfLock4: Surface already locked\n");
     3721        WriteLog("SurfLock4: Surface already locked\n\n");
    36863722      #endif
    36873723      return(DDERR_SURFACEBUSY);
     
    36973733                                (lpRect->left * (lpSurfaceDesc->ddpfPixelFormat.dwRGBBitCount>>3)));
    36983734    #ifdef DEBUG
    3699       WriteLog("SurfLock4 %08X (x,y) = (%d,%d)\n", lpSurfaceDesc->lpSurface, lpRect->top, lpRect->left);
     3735      WriteLog("SurfLock4 %08X (x,y) = (%d,%d)\n\n", lpSurfaceDesc->lpSurface, lpRect->top, lpRect->left);
    37003736    #endif
    37013737  }
     
    37033739  {
    37043740    #ifdef DEBUG
    3705       WriteLog("SurfLock4 %08X \n", lpSurfaceDesc->lpSurface);
     3741      WriteLog("SurfLock4 %08X \n\n", lpSurfaceDesc->lpSurface);
    37063742    #endif
    37073743  }
Note: See TracChangeset for help on using the changeset viewer.