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

File:
1 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  }
Note: See TracChangeset for help on using the changeset viewer.