Changeset 587 for trunk/src


Ignore:
Timestamp:
Aug 19, 1999, 8:08:48 PM (26 years ago)
Author:
hugh
Message:

Implemented new colorconversion routine and fixed bug in fastblt function.
Changed the palettehandling code

Location:
trunk/src/ddraw
Files:
6 edited

Legend:

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

    r536 r587  
    2626#define KEY_DIRECT2DRAW "\\Software\\Win32OS2\\Direct2\\Draw"
    2727
    28 FOURCC  SupportedFourCCs[] = {FOURCC_LUT8,FOURCC_R565,FOURCC_RGB3,FOURCC_RGB4};
     28FOURCC  SupportedFourCCs[] = {FOURCC_SCRN,FOURCC_LUT8,FOURCC_R565,FOURCC_RGB3,FOURCC_RGB4};
    2929//******************************************************************************
    3030//******************************************************************************
     
    3232     Referenced(0), lastError(DD_OK),
    3333     pFrameBuffer(NULL), hwndClient(0), screenwidth(640),
    34      screenheight(480), screenbpp(8),PrimaryExists(FALSE)
     34     screenheight(480), screenbpp(8),PrimaryExists(FALSE),pPrimSurf(NULL)
    3535
    3636{
     
    337337    #endif
    338338
    339     newpal = new OS2IDirectDrawPalette(me, palsize, lpColorTable, dwFlags);
     339    newpal = new OS2IDirectDrawPalette((VOID*)me, palsize, lpColorTable, dwFlags);
    340340
    341341    if(newpal == NULL)
     
    754754{
    755755  #ifdef DEBUG
    756     WriteLog("GetCaps\n");
     756    WriteLog("DDGetCaps of ");
    757757  #endif
    758758
     
    764764    // Caller want Driver Caps
    765765
     766    WriteLog("Driver\n");
     767
    766768    if(sizeof(DDCAPS)!=lpDDDriverCaps->dwSize)
     769    {
     770      WriteLog("Size Not Set\n");
    767771      return(DDERR_INVALIDPARAMS);
    768 
     772    }
    769773    // Clear structure so we only have to set the supported flags
    770774
     
    777781
    778782    // Now report the CAPs back which we support
    779    lpDDDriverCaps->dwCaps = DDCAPS_BLT |              // We do blitting
    780                             DDCAPS_BLTCOLORFILL |     // We do colorfills
    781                             DDCAPS_COLORKEY |         // We support Colorkeying
    782                             DDCAPS_COLORKEYHWASSIST | // But we (may) use the CPU
    783                             DDCAPS_GDI |              // Maybe check if we are on Voodoo ?
    784                             DDCAPS_PALETTEVSYNC;      // Got VSync
     783    lpDDDriverCaps->dwCaps = DDCAPS_BLT |              // We do blitting
     784                             DDCAPS_BLTCOLORFILL |     // We do colorfills
     785                             DDCAPS_COLORKEY |         // We support Colorkeying
     786                             DDCAPS_COLORKEYHWASSIST | // But we (may) use the CPU
     787                             DDCAPS_GDI |              // Maybe check if we are on Voodoo ?
     788                             DDCAPS_PALETTEVSYNC;      // Got VSync
    785789
    786790    lpDDDriverCaps->dwCaps2 = DDCAPS2_CERTIFIED |         // Who cares so say yes
     
    843847  if(NULL!=lpDDHELCaps)
    844848  {
    845     // Caler wants HEL Caps
     849    // Caller wants HEL Caps
     850    WriteLog(" HEL\n");
     851
    846852    if(sizeof(DDCAPS)!=lpDDHELCaps->dwSize)
     853    {
     854      WriteLog("Size Not Set\n");
    847855      return(DDERR_INVALIDPARAMS);
     856    }
     857    // Clear structure so we only have to set the supported flags
     858
     859
     860    memset(lpDDHELCaps,0,sizeof(DDCAPS));
     861
     862
     863    // Reset the size
     864    lpDDHELCaps->dwSize = sizeof(DDCAPS);
     865
     866    // Now report the CAPs back which we support
     867    lpDDHELCaps->dwCaps = DDCAPS_BLT |              // We do blitting
     868                             DDCAPS_BLTCOLORFILL |     // We do colorfills
     869                             DDCAPS_COLORKEY |         // We support Colorkeying
     870                             DDCAPS_COLORKEYHWASSIST | // But we (may) use the CPU
     871                             DDCAPS_GDI |              // Maybe check if we are on Voodoo ?
     872                             DDCAPS_PALETTEVSYNC;      // Got VSync
     873
     874    lpDDHELCaps->dwCaps2 = DDCAPS2_CERTIFIED |         // Who cares so say yes
     875                              DDCAPS2_CANRENDERWINDOWED | // Better check for Voodoo ?!
     876                              DDCAPS2_COPYFOURCC |        // yepp memcpy will do this
     877                              DDCAPS2_NONLOCALVIDMEM |    // All surfaces are in memory
     878                              DDCAPS2_WIDESURFACES;       // Any size you want!
     879
     880    lpDDHELCaps->dwCKeyCaps = DDCKEYCAPS_SRCBLT;      // Only source transparent blitting
     881
     882//    lpDDDriverCaps->dwFXCaps = DDFXCAPS_BLTMIRRORUPDOWN; // DIVE supports this, do we also ?
     883                                                         // Maybe later add stretching support?
     884
     885    lpDDHELCaps->dwPalCaps = DDPCAPS_8BIT |          // Only 8 Bits pals
     886                                DDPCAPS_ALLOW256 |      // But all 256 colors
     887                                DDPCAPS_VSYNC  |        // Vsync yet
     888                                DDPCAPS_PRIMARYSURFACE; //
     889    lpDDHELCaps->dwVidMemTotal = 2048*1024;           // total video memory
     890    lpDDHELCaps->dwVidMemFree  = 2048*1024;            // total free video memory
     891    lpDDHELCaps->dwNumFourCCCodes;        // number of supported FOURCC codes
     892    lpDDHELCaps->dwRops[DD_ROP_SPACE];    // supported raster ops
     893    lpDDHELCaps->dwSVBCaps = DDCAPS_BLT |              // We do blitting
     894                                DDCAPS_BLTCOLORFILL |     // We do colorfills
     895                                DDCAPS_COLORKEY |         // We support Colorkeying
     896                                DDCAPS_COLORKEYHWASSIST;
     897    lpDDHELCaps->dwSVBCKeyCaps = DDCKEYCAPS_SRCBLT;      // Only source transparent blitting
     898    lpDDHELCaps->dwSVBFXCaps;             //  .
     899    lpDDHELCaps->dwSVBRops[DD_ROP_SPACE]; //  .
     900    lpDDHELCaps->dwVSBCaps = DDCAPS_BLT |              // We do blitting
     901                                DDCAPS_BLTCOLORFILL |     // We do colorfills
     902                                DDCAPS_COLORKEY |         // We support Colorkeying
     903                                DDCAPS_COLORKEYHWASSIST;
     904    lpDDHELCaps->dwVSBCKeyCaps = DDCKEYCAPS_SRCBLT;      // Only source transparent blitting
     905    lpDDHELCaps->dwVSBFXCaps;             //  .
     906    lpDDHELCaps->dwVSBRops[DD_ROP_SPACE]; //  .
     907    lpDDHELCaps->dwSSBCaps = DDCAPS_BLT |              // We do blitting
     908                                DDCAPS_BLTCOLORFILL |     // We do colorfills
     909                                DDCAPS_COLORKEY |         // We support Colorkeying
     910                                DDCAPS_COLORKEYHWASSIST;
     911    lpDDHELCaps->dwSSBCKeyCaps = DDCKEYCAPS_SRCBLT;      // Only source transparent blitting
     912    lpDDHELCaps->dwSSBFXCaps;            //  .
     913    lpDDHELCaps->dwSSBRops[DD_ROP_SPACE]; //  .
     914    lpDDHELCaps->dwSVBCaps2 = DDCAPS2_CANRENDERWINDOWED | // Better check for Voodoo ?!
     915                                 DDCAPS2_COPYFOURCC |        // yepp memcpy will do this
     916                                 DDCAPS2_WIDESURFACES;       // Any size you want!
     917    lpDDHELCaps->dwNLVBCaps = DDCAPS_BLT |              // We do blitting
     918                                 DDCAPS_BLTCOLORFILL |     // We do colorfills
     919                                 DDCAPS_COLORKEY |         // We support Colorkeying
     920                                 DDCAPS_COLORKEYHWASSIST;
     921    lpDDHELCaps->dwNLVBCaps2 = DDCAPS2_CANRENDERWINDOWED | // Better check for Voodoo ?!
     922                                  DDCAPS2_COPYFOURCC |        // yepp memcpy will do this
     923                                  DDCAPS2_WIDESURFACES;       // Any size you want!
     924    lpDDHELCaps->dwNLVBCKeyCaps = DDCKEYCAPS_SRCBLT;      // Only source transparent blitting
     925    lpDDHELCaps->dwNLVBFXCaps;            //  .
     926    lpDDHELCaps->dwNLVBRops[DD_ROP_SPACE];//  .
    848927
    849928  }
  • trunk/src/ddraw/OS2DDRAW.H

    r422 r587  
    77#define APIENTRY _System
    88#include "divewrap.h"
    9 
    109#define DEBUG 1
    1110#define mmioFOURCC( ch0, ch1, ch2, ch3 )                         \
     
    1312                  ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
    1413#include <fourcc.h>
     14#undef THIS
    1515#define THIS VOID*
    1616class OS2IDirectDraw
     
    4545    // also needed so get all the info we can get
    4646    DIVE_CAPS dCaps;
     47    VOID *pPrimSurf;
    4748
    4849  private:
  • trunk/src/ddraw/OS2PALETTE.CPP

    r522 r587  
    44#include <memory.h>
    55#define INITGUID
     6#include "os2ddraw.h"
     7#include "os2clipper.h"
    68#include "os2palette.h"
     9#include "os2surface.h"
    710#define _OS2WIN_H
    811#define FAR
     
    1114#include <winerror.h>
    1215
    13 //******************************************************************************
    14 //******************************************************************************
    15 OS2IDirectDrawPalette::OS2IDirectDrawPalette( OS2IDirectDraw *lpDirectDraw,
     16#undef THIS
     17#define THIS IDirectDrawPalette*
     18
     19//******************************************************************************
     20//******************************************************************************
     21OS2IDirectDrawPalette::OS2IDirectDrawPalette( VOID *lpDirectDraw,
    1622                                              int palsize,
    1723                                              LPPALETTEENTRY lpColorTable,
     
    1925                                              Referenced(0), os2pal(NULL),
    2026                                              lastError(DD_OK), lpDraw(NULL)
     27
    2128{
    2229  lpVtbl              = &Vtbl;
     
    3037
    3138  lpDraw                        = lpDirectDraw;
    32   lpDraw->Vtbl.AddRef(lpDraw);
    33   hDive                         = lpDirectDraw->GetDiveInstance();
     39  ((OS2IDirectDraw*)lpDraw)->Vtbl.AddRef(lpDraw);
     40  hDive                         = ((OS2IDirectDraw*)lpDirectDraw)->GetDiveInstance();
    3441  dwCaps                        = dwPalFlags;
     42  hDiveCC                       = ((OS2IDirectDraw*)lpDirectDraw)->GetCCDiveInstance();
    3543
    3644  dwSize = palsize;
     
    4149  os2pal = (LPPALETTEENTRY)malloc(palsize*sizeof(PALETTEENTRY));
    4250  memcpy((char *)os2pal, (char *)lpColorTable, palsize*sizeof(PALETTEENTRY));
     51
     52  for(DWORD i=0;i<dwSize;i++)
     53  {
     54    aPal16[i] = (lpColorTable[i].peBlue>>3) +
     55                ((lpColorTable[i].peGreen>>2) <<5) +
     56                ((lpColorTable[i].peRed>>3) << 11);
     57    aPal24[i] = (lpColorTable[i].peBlue <<8) +
     58                (lpColorTable[i].peGreen<<16) +
     59                (lpColorTable[i].peRed<<24);
     60  }
    4361}
    4462//******************************************************************************
     
    4866  if(os2pal)
    4967    free(os2pal);
    50   lpDraw->Vtbl.Release(lpDraw);
     68  ((OS2IDirectDraw*)lpDraw)->Vtbl.Release((OS2IDirectDraw*)lpDraw);
    5169}
    5270//******************************************************************************
     
    175193         dwNumEntries*sizeof(PALETTEENTRY));
    176194
    177   if(me->fAttachedToPrimary)
    178     me->SetPhysPalette();
    179 
     195  for(DWORD i=0;i<dwNumEntries;i++)
     196  {
     197    me->aPal16[dwBase+i] = (lpNewEntries[i].peBlue>>3) +
     198                           ((lpNewEntries[i].peGreen>>2) <<5) +
     199                           ((lpNewEntries[i].peRed>>3) << 11);
     200    me->aPal24[dwBase+i] = (lpNewEntries[i].peBlue <<8) +
     201                           (lpNewEntries[i].peGreen<<16) +
     202                           (lpNewEntries[i].peRed<<24);
     203  }
     204
     205  if(8==((OS2IDirectDraw*)me->lpDraw)->dCaps.ulDepth)
     206  {
     207    if(me->fAttachedToPrimary)
     208      me->SetPhysPalette();
     209  }
     210  else
     211  {
     212    if(NULL!=((OS2IDirectDraw*)me->lpDraw)->pPrimSurf)
     213      ((OS2IDirectDrawSurface*)((OS2IDirectDraw*)me->lpDraw)->pPrimSurf)->ColorConversion(NULL);;
     214  }
     215  /*
     216  if(NULL!=me->hDiveCC)
     217  {
     218    DiveSetSourcePalette( me->hDiveCC,
     219                          dwBase,
     220                          dwNumEntries,
     221                          (PBYTE)lpNewEntries);
     222
     223  }
     224  else
     225  {
     226    // Only usefull if system and game are in 8bit mode
     227    // 16bit games don't use palettes and setting the Phys palette
     228    // in >8Bit Modes has no effect.
     229
     230    if(me->fAttachedToPrimary)
     231      me->SetPhysPalette();
     232  }
     233  */
    180234  return(DD_OK);
    181235}
     
    199253    return;
    200254  fAttachedToPrimary = fNewVal;
     255
     256  /*
    201257  if(fAttachedToPrimary)
    202     SetPhysPalette();
    203 
    204 }
    205 //******************************************************************************
    206 //******************************************************************************
    207 
     258  {
     259    if(NULL!=hDiveCC)
     260      DiveSetSourcePalette( hDiveCC,
     261                            0,
     262                            255,
     263                            (PBYTE)os2pal);
     264    else
     265      SetPhysPalette();
     266  }
     267  */
     268}
     269//******************************************************************************
     270//******************************************************************************
     271
  • trunk/src/ddraw/OS2PALETTE.H

    r422 r587  
    22#define __OS2PALETTE_H__
    33
    4 #include "os2ddraw.h"
    54#include "divewrap.h"
    65#define FAR
     
    2726  IDirectDrawPaletteVtbl  Vtbl;
    2827
    29   OS2IDirectDrawPalette( OS2IDirectDraw *lpDirectDraw,
     28  OS2IDirectDrawPalette( VOID *lpDirectDraw,
    3029                         int palsize,
    3130                         LPPALETTEENTRY lpColorTable,
     
    3837  int           Referenced;
    3938  inline  HRESULT       GetLastError() { return lastError; };
     39  WORD           aPal16[256];
     40  DWORD          aPal24[256];
    4041 private:
    4142
    4243 protected:
    4344  HDIVE          hDive;
     45  HDIVE          hDiveCC;
    4446  HRESULT        lastError;
    4547  LPPALETTEENTRY os2pal;
    46   OS2IDirectDraw *lpDraw;
     48  VOID          *lpDraw;
    4749  DWORD          dwCaps;
    4850  DWORD          dwSize;
  • trunk/src/ddraw/OS2SURFACE.CPP

    r522 r587  
    66                  ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
    77#include <fourcc.h>
     8#define INITGUID
     9#include "os2ddraw.h"
     10#include "os2clipper.h"
     11#include "os2palette.h"
    812#include "os2surface.h"
    913#include "rectangle.h"
     
    154158  WriteLog("\n");
    155159}
     160
     161static void _dump_DDSCAPS2(DWORD flagmask) {
     162  int  i;
     163  const struct {
     164    DWORD  mask;
     165    char  *name;
     166  } flags[] = {
     167#define FE(x) { x, #x},
     168    FE(DDSCAPS2_HARDWAREDEINTERLACE)
     169    FE(DDSCAPS2_HINTANTIALIASING)
     170    FE(DDSCAPS2_HINTDYNAMIC)
     171    FE(DDSCAPS2_HINTSTATIC)
     172    FE(DDSCAPS2_OPAQUE)
     173    FE(DDSCAPS2_TEXTUREMANAGE)
     174  };
     175  for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
     176    if (flags[i].mask & flagmask)
     177      WriteLog("%s ",flags[i].name);
     178  WriteLog("\n");
     179}
     180
    156181
    157182static void _dump_DDSD(DWORD flagmask) {
     
    553578      height = DDSurfaceDesc.dwHeight;
    554579
     580      lpDraw->pPrimSurf = this;
     581
    555582      lastError = DD_OK;
    556583      return;
     
    591618      {
    592619        WriteLog(" Use Screen Format :");
    593         dwBpp = dwBytesPPDive << 3; // No use Screenformat
     620        dwBpp = lpDraw->GetScreenBpp(); // No use Screenformat
    594621        lpDDSurfaceDesc->ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
    595622        lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC = (DWORD) lpDraw->GetScreenFourCC();
     
    740767          dwPitchFB = lpDDSurfaceDesc->dwWidth * (dwBpp<8?1:dwBpp/8);
    741768          dwPitchFB = (dwPitchFB +7) & ~7;  // Align on QWords
    742 
    743769          DDSurfaceDesc.lPitch    = dwPitchFB;
    744770          lpDDSurfaceDesc->lPitch = dwPitchFB;
     
    764790          pFrameBuffer = (char*)(((int)pFBreal + 7) & ~7); // align to QWORD
    765791
    766           WriteLog( " Framebuffer @ %08X QWAligned @ %08X with a Pitch of %d",
     792          WriteLog( " Framebuffer @ %08X QWAligned @ %08X with a Pitch of %d\n",
    767793                    pFBreal, pFrameBuffer, dwPitchFB);
    768794
     
    780806          {
    781807            WriteLog(" Alloc CCBuf ");
     808            dwPitchDB = (lpDDSurfaceDesc->dwWidth * (lpDraw->dCaps.ulDepth/8) +7) & ~7;
    782809            if(Mainchain)
    783810            {
     
    790817                                    lpDDSurfaceDesc->dwWidth,
    791818                                    lpDDSurfaceDesc->dwHeight,
    792                                     (lpDDSurfaceDesc->dwWidth * (lpDraw->dCaps.ulDepth/8) +7) & ~7,
     819                                    dwPitchDB,
    793820                                    (PBYTE)pDiveBuffer);
    794821            }
    795822            else
    796823            {
    797               WriteLog("with malloc");
     824              WriteLog( "with malloc (%dx%d) Pitch %d ",
     825                        lpDDSurfaceDesc->dwHeight,
     826                        lpDDSurfaceDesc->dwWidth,
     827                        dwPitchDB);
    798828              // No so we must create the Divebuffer to do the colortranslation
    799829              // and blit to the real framebuffer on Unlock to do color conversion
    800830              pDiveBuffer = (char*)malloc( lpDDSurfaceDesc->dwHeight *
    801                                    ((lpDDSurfaceDesc->dwWidth * (lpDraw->dCaps.ulDepth/8) +7) & ~7) );
     831                                           dwPitchDB);
    802832            }
     833            WriteLog( "  @ %08X\n", pDiveBuffer);
    803834          }
    804835
     
    11541185void OS2IDirectDrawSurface::ColorConversion(LPRECT lpRect)
    11551186{
     1187  char *pSrc,*pDst,*pSLine,*pDLine;
     1188  DWORD CCwidth,CCheight,x,y;
     1189  DWORD *pPal24;
     1190  WORD  *pPal16;
     1191
     1192  if(NULL== lpDraw->pPrimSurf)
     1193  {
     1194    WriteLog("No Primary Surface! => No CC\n");
     1195    return;
     1196  }
     1197
     1198  if(NULL== ((OS2IDirectDrawSurface*)lpDraw->pPrimSurf)->lpPalette)
     1199  {
     1200    WriteLog("No DDrawpalette defined!=> No CC\n");
     1201    return;
     1202  }
     1203
     1204  if(NULL==lpRect)
     1205  {
     1206    pSrc = pFrameBuffer;
     1207    pDst = pDiveBuffer;
     1208    CCwidth  = width;
     1209    CCheight = height;
     1210  }
     1211  else
     1212  {
     1213    // ToDo: Check why the top/bottom values come in swaped here
     1214    // for now simply reverse them with the following 3 lines
     1215    y = lpRect->top;
     1216    lpRect->top = lpRect->bottom;
     1217    lpRect->bottom = y;
     1218    // end of hack
     1219    pSrc = pFrameBuffer +
     1220           (lpRect->top * dwPitchFB) +
     1221           (lpRect->left* (lpDraw->dCaps.ulDepth/8));
     1222    pDst = pDiveBuffer +
     1223           (lpRect->top * dwPitchDB) +
     1224           (lpRect->left* dwBytesPPDive);
     1225    CCwidth  = lpRect->right - lpRect->left;
     1226    CCheight = lpRect->bottom - lpRect->top;
     1227
     1228  }
     1229
     1230  WriteLog( "H: %d W: %d\n SRC @ %08X\n DST @ %08X\n",
     1231            CCheight, CCwidth, pSrc,pDst);
     1232
     1233  pSLine = pSrc;
     1234  pDLine = pDst;
     1235
     1236  switch(lpDraw->dCaps.ulDepth)
     1237  {
     1238    case 8:
     1239      WriteLog(" 8Bit target CC not implemented\n");
     1240      break;
     1241    case 15:
     1242      WriteLog(" 15 Bit not implemented using 16bit might look ugly\n");
     1243    case 16:
     1244      if(8==lpDraw->GetScreenBpp())
     1245      {
     1246        pPal16 = ((OS2IDirectDrawSurface*)lpDraw->pPrimSurf)->lpPalette->aPal16;
     1247        WriteLog("8->16Bit CC\n");
     1248        for(y=0;CCheight;CCheight--,y++)
     1249        {
     1250          WriteLog("Converting Line %d\n",y);
     1251          for(x=0;x<width;x++)
     1252          {
     1253            *((WORD*)pDLine) = pPal16[pSLine[x]];
     1254          }
     1255          pSLine += dwPitchFB;
     1256          pDLine += dwPitchDB;
     1257        }
     1258      }
     1259      else
     1260      {
     1261        WriteLog("%d ->16Bit Not implemented",lpDraw->GetScreenBpp());
     1262      }
     1263      break;
     1264    case 24:
     1265      if(8==lpDraw->GetScreenBpp())
     1266      {
     1267        WriteLog("8->24Bit CC");
     1268      }
     1269      else
     1270      {
     1271        WriteLog("%d ->16Bit Not implemented",lpDraw->GetScreenBpp());
     1272      }
     1273      break;
     1274    case 32:
     1275      if(8==lpDraw->GetScreenBpp())
     1276      {
     1277        WriteLog("8->32Bit CC");
     1278      }
     1279      else
     1280      {
     1281        WriteLog("%d ->16Bit Not implemented",lpDraw->GetScreenBpp());
     1282      }
     1283      break;
     1284    default:
     1285      #ifdef DEBUG
     1286        WriteLog( "Unexpected Screen Bitdepth %d\n",
     1287                  lpDraw->dCaps.ulDepth);
     1288      #endif
     1289      break;
     1290  }
     1291
     1292/*
    11561293  SETUP_BLITTER sBlt;
    11571294  ULONG ulDN1, ulDN2;
     
    11821319  sBlt.lDstPosY          = sBlt.ulSrcPosY;
    11831320  sBlt.ulNumDstRects     = DIVE_FULLY_VISIBLE;
     1321
     1322  WriteLog( "Colorconversion:\n FCC SRC %08X\n FCC DST %08X\n",
     1323            sBlt.fccSrcColorFormat,
     1324            sBlt.fccDstColorFormat );
    11841325
    11851326  rc = DiveAllocImageBuffer( hDiveCC,
     
    11901331                             dwPitchFB,
    11911332                             (PBYTE)pFrameBuffer);
    1192   WriteLog("AllocDiveSrc Buffer rc= %X\n",rc);
     1333  WriteLog("AllocDiveSrc Buffer rc= 0x%08X\n",rc);
    11931334
    11941335  rc = DiveAllocImageBuffer( hDiveCC,
     
    11991340                             dwPitchDB,
    12001341                             (PBYTE)pDiveBuffer);
    1201   WriteLog("AllocDiveDst Buffer rc= %Xd\n",rc);
     1342  WriteLog("AllocDiveDst Buffer rc= 0x%08X\n",rc);
    12021343
    12031344  rc = DiveSetupBlitter( hDiveCC,
     
    12191360
    12201361  WriteLog("Free dst rc= %X\n",rc);
    1221 
     1362*/
    12221363}
    12231364//******************************************************************************
     
    25712712  BlitWidth  = (SrcRect.right - SrcRect.left) * src->dwBytesPPDive;
    25722713
    2573   if(dwTrans & DDBLTFAST_NOCOLORKEY)
     2714  // Remove unsupported wait flag
     2715  dwTrans &= ~DDBLTFAST_WAIT;
     2716
     2717  if(DDBLTFAST_NOCOLORKEY == dwTrans )
    25742718  {
    25752719    WriteLog("Solid Blit");
     
    25932737  else
    25942738  {
    2595     WriteLog("TransBlit");
     2739    WriteLog("TransBlit\n");
    25962740
    25972741    if(dwTrans & DDBLTFAST_SRCCOLORKEY)
    25982742    {
     2743      WriteLog("Trans SRC\n");
    25992744      // transparent source
    26002745      dwSrcColor = src->DDSurfaceDesc.ddckCKSrcBlt.dwColorSpaceLowValue;
    26012746      if(dwTrans & DDBLTFAST_DESTCOLORKEY)
    26022747      {
     2748        WriteLog("And Dest Colorkey");
    26032749        dwDestColor = dest->DDSurfaceDesc.ddckCKDestBlt.dwColorSpaceLowValue;
    26042750        // Source and dest colorkeying
     
    26972843        // This MMX detection should be moved into OS2Draw
    26982844        // and into the surface constructor a setup for blitting pointers
    2699 
     2845        WriteLog("Only Src ColorKey");
    27002846        switch(dest->dwBytesPPDive)
    27012847        {
     
    27682914      if(dwTrans & DDBLTFAST_DESTCOLORKEY)
    27692915      {
     2916        WriteLog("DestColorKey\n");
     2917
    27702918        dwDestColor = dest->DDSurfaceDesc.ddckCKDestBlt.dwColorSpaceLowValue;
    27712919        switch(dest->dwBytesPPDive)
     
    28442992        }  // End switch
    28452993      }
     2994      else
     2995      {
     2996        WriteLog("Unexpected Flags");
     2997      }
    28462998    }
    28472999  }
     
    33493501
    33503502  lpDDCaps->dwCaps = me->DDSurfaceDesc.ddsCaps.dwCaps;
    3351 
     3503  #ifdef DEBUG
     3504    _dump_DDSCAPS(lpDDCaps->dwCaps);
     3505  #endif
    33523506  return(DD_OK);
    33533507}
     
    33653519
    33663520  memcpy(lpDDCaps, &(me->DDSurfaceDesc.ddsCaps), sizeof(DDSCAPS2) );
     3521  #ifdef DEBUG
     3522    _dump_DDSCAPS(lpDDCaps->dwCaps);
     3523    _dump_DDSCAPS2(lpDDCaps->dwCaps2);
     3524
     3525  #endif
    33673526
    33683527  return(DD_OK);
     
    40984257      // primary surface => doesn't modify physical palette
    40994258      if(me->surfaceType & DDSCAPS_PRIMARYSURFACE)
     4259      {
    41004260        me->lpPalette->SetIsPrimary(FALSE);
    4101 
     4261      }
    41024262      me->lpPalette->Vtbl.Release((IDirectDrawPalette*)me->lpPalette);
    41034263      me->lpPalette = NULL;
     
    41284288
    41294289  if(me->surfaceType & DDSCAPS_PRIMARYSURFACE)
     4290  {
    41304291    me->lpPalette->SetIsPrimary(TRUE);
    4131 
     4292  }
    41324293  me->lpVtbl->ChangeUniquenessValue(me);
    41334294
  • trunk/src/ddraw/OS2SURFACE.H

    r422 r587  
    22#define __OS2SURFACE_H__
    33#define FAR
    4 #define INITGUID
    5 #include "os2ddraw.h"
    6 #include "os2clipper.h"
    7 #include "os2palette.h"
    84#include "divewrap.h"
    95#include <commctrl.h>
Note: See TracChangeset for help on using the changeset viewer.