Changeset 3161 for trunk/src


Ignore:
Timestamp:
Mar 18, 2000, 10:17:58 PM (25 years ago)
Author:
mike
Message:

Fixed callconvention bug, added src transblt code

File:
1 edited

Legend:

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

    r2987 r3161  
    1 /* $Id: OS2SURFACE.CPP,v 1.24 2000-03-03 19:21:24 hugh Exp $ */
     1/* $Id: OS2SURFACE.CPP,v 1.25 2000-03-18 21:17:58 mike Exp $ */
    22
    33/*
     
    16651665//******************************************************************************
    16661666// Internal callbacks uses by destructor
    1667 int DestroyRects(LPVOID lpItem, DWORD dwRes)
     1667INT CALLBACK DestroyRects(LPVOID lpItem, DWORD dwRes)
    16681668{
    16691669  DDRectangle *pItem = (DDRectangle*) lpItem;
     
    16721672}
    16731673
    1674 int ReleaseSurfaces(LPVOID lpItem, DWORD dwRes)
     1674INT CALLBACK ReleaseSurfaces(LPVOID lpItem, DWORD dwRes)
    16751675{
    16761676  OS2IDirectDrawSurface *pSurf;
     
    17221722  {
    17231723    DPA_DestroyCallback( DPA_LockedRects,
    1724                          (DPAENUMPROC)DestroyRects,
     1724                         DestroyRects,
    17251725                         0);
    17261726  }
     
    17501750  {
    17511751    DPA_DestroyCallback( DPA_SurfaceMipMaps,
    1752                          (DPAENUMPROC)ReleaseSurfaces,
     1752                         ReleaseSurfaces,
    17531753                         0);
    17541754  }
     
    17571757  {
    17581758    DPA_DestroyCallback( DPA_SurfaceAttached,
    1759                          (DPAENUMPROC)ReleaseSurfaces,
     1759                         ReleaseSurfaces,
    17601760                         0);
    17611761  }
     
    22962296    {
    22972297      delete pIRectDest;
    2298       #ifdef DEBUG
    2299         dprintf(("DDRAW: Blt: Dest Surface partly locked\n"));
    2300       #endif
     2298      dprintf(("DDRAW: Blt: Dest Surface partly locked\n"));
    23012299      return(DDERR_SURFACEBUSY);
    23022300    }
     
    23802378  if(NULL==src)
    23812379  {
    2382     #ifdef DEBUG
    2383       dprintf(("DDRAW: Unsupported sourceless FX operation. Flags = 0x%04X\n",dwFlags));
    2384     #endif
     2380    dprintf(("DDRAW: Unsupported sourceless FX operation. Flags = 0x%04X\n",dwFlags));
     2381
    23852382    return DD_OK;
    23862383  }
     
    24792476    {
    24802477      delete pIRectSrc;
    2481       #ifdef DEBUG
    2482         dprintf(("DDRAW: Blt: Src Surface partly locked\n"));
    2483       #endif
     2478      dprintf(("DDRAW: Blt: Src Surface partly locked\n"));
     2479
    24842480      return(DDERR_SURFACEBUSY);
    24852481    }
     
    24892485      ( (NULL==lpSrcRect) && (NULL!=lpDestRect) ) )
    24902486  {
    2491     #ifdef DEBUG
    2492       dprintf(("DDRAW: Blitting with scaleing\n Not supported.\n"));
    2493     #endif
     2487    dprintf(("DDRAW: Blitting with scaleing\n Not supported.\n"));
     2488
    24942489    return DDERR_NOSTRETCHHW;
    24952490  }
     
    29942989          else
    29952990          {
     2991            // This will be be slow maybe move to ASM ?
     2992            // using MMX should be much faster
     2993            switch(dest->dwBytesPPDive)
     2994            {
     2995              case 1:
     2996                while(BlitHeight--)
     2997                {
     2998                  x = 0;
     2999                  while(x<BlitWidth)
     3000                  {
     3001                    if(pSrcPos[x] != (char) dwSrcColor)
     3002                    {
     3003                      pBltPos[x] = pSrcPos[x];
     3004                    }
     3005                    x++;
     3006                  }
     3007                  pBltPos += dwPitch;
     3008                  pSrcPos += src->dwPitchDB;
     3009                }
     3010                break;
     3011              case 2:
     3012                while(BlitHeight--)
     3013                {
     3014                  x = 0;
     3015                  while(x<BlitWidth)
     3016                  {
     3017                    if(((USHORT*)pSrcPos)[x] != (USHORT) dwSrcColor)
     3018                    {
     3019                      ((USHORT*)pBltPos)[x] = ((USHORT*)pSrcPos)[x];
     3020                    }
     3021                    x++;
     3022                  }
     3023                  pBltPos += dwPitch;
     3024                  pSrcPos += src->dwPitchDB;
     3025                }
     3026                break;
     3027              case 3:
     3028              {
     3029                char *pSC, *pDC;
     3030                pSC = (char*)&dwSrcColor;
     3031                pDC = (char*)&dwDestColor;
     3032                BlitWidth *=3;
     3033
     3034                while(BlitHeight--)
     3035                {
     3036                  x = 0;
     3037
     3038                  while(x<BlitWidth)
     3039                  {
     3040                    if( (pSrcPos[x]   != pSC[1]) &&
     3041                        (pSrcPos[x+1] != pSC[2]) &&
     3042                        (pSrcPos[x+2] != pSC[3])
     3043                      )
     3044                    {
     3045                       pBltPos[x] = pSrcPos[x];
     3046                       pBltPos[x+1] = pSrcPos[x+2];
     3047                       pBltPos[x+1] = pSrcPos[x+2];
     3048                    }
     3049                    x +=3;
     3050                  }
     3051                  pBltPos += dwPitch;
     3052                  pSrcPos += src->dwPitchDB;
     3053                }
     3054                break;
     3055              }
     3056              case 4:
     3057                while(BlitHeight--)
     3058                {
     3059                  x = 0;
     3060                  while(x<BlitWidth)
     3061                  {
     3062                    if(((DWORD*)pSrcPos)[x] != dwSrcColor)
     3063                    {
     3064                      ((DWORD*)pBltPos)[x] = ((DWORD*)pSrcPos)[x];
     3065                    }
     3066                    x++;
     3067                  }
     3068                  pBltPos += dwPitch;
     3069                  pSrcPos += src->dwPitchDB;
     3070                }
     3071                break;
     3072            }  // End switch
    29963073            // Only Source colorkey
    29973074          }
Note: See TracChangeset for help on using the changeset viewer.