Changeset 8604 for trunk/src


Ignore:
Timestamp:
Jun 8, 2002, 3:12:33 PM (23 years ago)
Author:
sandervl
Message:

Print FOURCCs supported by Dive

Location:
trunk/src/ddraw
Files:
2 edited

Legend:

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

    r8115 r8604  
    1 /* $Id: OS2DDRAW.CPP,v 1.34 2002-03-22 13:49:54 sandervl Exp $ */
     1/* $Id: OS2DDRAW.CPP,v 1.35 2002-06-08 13:12:33 sandervl Exp $ */
    22
    33/*
     
    4848BOOL bUseFSDD = FALSE;
    4949
    50 FOURCC  SupportedFourCCs[] = {FOURCC_SCRN,FOURCC_LUT8,FOURCC_R565,FOURCC_RGB3,FOURCC_RGB4};
     50FOURCC SupportedFourCCs[]   = {FOURCC_SCRN,FOURCC_LUT8,FOURCC_R565,FOURCC_RGB3,FOURCC_RGB4};
     51
     52#define MAX_DIVE_FOURCC   32
     53int    nrOfDiveFourCCs              = 0;
     54FOURCC DiveFOURCCs[MAX_DIVE_FOURCC] = {0};
     55
    5156//******************************************************************************
    5257//******************************************************************************
     
    6065  DWORD dwVSize, dwVType;
    6166  ULONG rc;
    62   FOURCC fccModes[100];
    6367
    6468  // Setup table for 3d devices
     
    198202          sizeof(DIVE_CAPS) );
    199203  dCaps.ulStructLen = sizeof(DIVE_CAPS);
    200   dCaps.ulFormatLength = 100;
    201   dCaps.pFormatData = &fccModes[0];
    202 
    203   rc = DiveQueryCaps( &dCaps,
    204                       DIVE_BUFFER_SCREEN);
     204  dCaps.ulFormatLength = sizeof(DiveFOURCCs);
     205  dCaps.pFormatData    = &DiveFOURCCs[0];
     206
     207  rc = DiveQueryCaps( &dCaps, DIVE_BUFFER_SCREEN);
    205208
    206209  dprintf(("DDRAW: DiveQueryCaps rc=0x%08X\n",rc));
     210
     211  FOURCC *pFourCC = (FOURCC *)dCaps.pFormatData;
     212  nrOfDiveFourCCs = dCaps.ulInputFormats;
     213  for(i=0;i<dCaps.ulInputFormats+dCaps.ulOutputFormats;i++) {
     214      if(i < dCaps.ulInputFormats) {
     215           dprintf(("INPUT FOURCC %C%C%C%C", (char)(pFourCC[i]), (char)(pFourCC[i] >> 8), (char)(pFourCC[i] >> 16), (char)(pFourCC[i] >> 24)));
     216      }
     217      else dprintf(("OUTPUT FOURCC %C%C%C%C", (char)(pFourCC[i]), (char)(pFourCC[i] >> 8), (char)(pFourCC[i] >> 16), (char)(pFourCC[i] >> 24)));
     218  }
    207219
    208220  pdwUnknownData[235] = dCaps.ulHorizontalResolution;
     
    275287FOURCC OS2IDirectDraw::GetScreenFourCC()
    276288{
    277   return SupportedFourCCs[screenbpp>>3];
     289    return SupportedFourCCs[screenbpp>>3];
     290}
     291//******************************************************************************
     292//******************************************************************************
     293BOOL OS2IDirectDraw::IsFourCCSupported(FOURCC fourcc)
     294{
     295    for(int i=0;i<nrOfDiveFourCCs;i++) {
     296        if(DiveFOURCCs[i] == fourcc) {
     297            return TRUE;
     298        }
     299    }
     300    return FALSE;
    278301}
    279302//******************************************************************************
     
    11991222//                             DDCAPS_READSCANLINE |
    12001223                             DDCAPS_BLTFOURCC;
    1201 
    12021224    lpDDDriverCaps->dwCaps2 = DDCAPS2_CERTIFIED |         // Who cares so say yes
    12031225                              DDCAPS2_CANRENDERWINDOWED | // Better check for Voodoo ?!
     
    12181240    lpDDDriverCaps->dwVidMemTotal = me->dCaps.ulApertureSize;          // total video memory
    12191241    lpDDDriverCaps->dwVidMemFree  = me->dCaps.ulApertureSize;          // total free video memory
     1242
    12201243    lpDDDriverCaps->dwNumFourCCCodes = MAX_FOURCC_CODES;        // number of supported FOURCC codes
    12211244/*
     
    16451668HRESULT WIN32API DrawGetFourCCCodes(THIS This, LPDWORD lpNumCodes, LPDWORD lpCodes)
    16461669{
    1647 //  DWORD dwFCC[MAX_FOURCC_CODES] = {FOURCC_LUT8,FOURCC_R565,FOURCC_RGB3,FOURCC_YUY2};
    16481670  DWORD dwFCC[MAX_FOURCC_CODES] = {FOURCC_LUT8,FOURCC_R565,FOURCC_R555,FOURCC_RGB3};
    16491671
     
    16551677  if(NULL==lpCodes)
    16561678  {
     1679#ifdef SUPPORT_ALL_DIVE_FOURCCS
     1680    *lpNumCodes = nrOfDiveFourCCs;
     1681#else
    16571682    *lpNumCodes = MAX_FOURCC_CODES; // LUT8, R565, RGB3 are the FourCC we support for now
     1683#endif
    16581684  }
    16591685  else
    16601686  {
     1687#ifdef SUPPORT_ALL_DIVE_FOURCCS
     1688    for(int i=0;(i<nrOfDiveFourCCs)&&(i<*lpNumCodes);i++)
     1689    {
     1690      *lpCodes = DiveFOURCCs[i];
     1691      lpCodes++;
     1692    }
     1693    *lpNumCodes = nrOfDiveFourCCs;
     1694#else
    16611695    for(int i=0;(i<MAX_FOURCC_CODES)&&(i<*lpNumCodes);i++)
    16621696    {
     
    16651699    }
    16661700    *lpNumCodes = MAX_FOURCC_CODES;
     1701#endif
    16671702  }
    16681703  return(DD_OK);
  • trunk/src/ddraw/OS2DDRAW.H

    r6950 r8604  
    1 /* $Id: OS2DDRAW.H,v 1.15 2001-10-05 12:33:09 sandervl Exp $ */
     1/* $Id: OS2DDRAW.H,v 1.16 2002-06-08 13:12:33 sandervl Exp $ */
    22
    33/*
     
    2525#undef THIS
    2626#define THIS VOID*
     27
     28//testestest
     29//#define SUPPORT_ALL_DIVE_FOURCCS
     30//testestest
    2731
    2832#define MAX_FOURCC_CODES        4
     
    7579    inline  int           GetScreenBpp()    { return screenbpp;}
    7680    FOURCC        GetScreenFourCC();
     81    BOOL          IsFourCCSupported(FOURCC fourcc);
    7782    // We should be able to use any mode with less or same bits and same or
    7883    // smaller size to be able to report all supported mode in the enum
Note: See TracChangeset for help on using the changeset viewer.