- Timestamp:
- Jun 8, 2002, 3:12:33 PM (23 years ago)
- Location:
- trunk/src/ddraw
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ddraw/OS2DDRAW.CPP
r8115 r8604 1 /* $Id: OS2DDRAW.CPP,v 1.3 4 2002-03-22 13:49:54sandervl Exp $ */1 /* $Id: OS2DDRAW.CPP,v 1.35 2002-06-08 13:12:33 sandervl Exp $ */ 2 2 3 3 /* … … 48 48 BOOL bUseFSDD = FALSE; 49 49 50 FOURCC SupportedFourCCs[] = {FOURCC_SCRN,FOURCC_LUT8,FOURCC_R565,FOURCC_RGB3,FOURCC_RGB4}; 50 FOURCC SupportedFourCCs[] = {FOURCC_SCRN,FOURCC_LUT8,FOURCC_R565,FOURCC_RGB3,FOURCC_RGB4}; 51 52 #define MAX_DIVE_FOURCC 32 53 int nrOfDiveFourCCs = 0; 54 FOURCC DiveFOURCCs[MAX_DIVE_FOURCC] = {0}; 55 51 56 //****************************************************************************** 52 57 //****************************************************************************** … … 60 65 DWORD dwVSize, dwVType; 61 66 ULONG rc; 62 FOURCC fccModes[100];63 67 64 68 // Setup table for 3d devices … … 198 202 sizeof(DIVE_CAPS) ); 199 203 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); 205 208 206 209 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 } 207 219 208 220 pdwUnknownData[235] = dCaps.ulHorizontalResolution; … … 275 287 FOURCC OS2IDirectDraw::GetScreenFourCC() 276 288 { 277 return SupportedFourCCs[screenbpp>>3]; 289 return SupportedFourCCs[screenbpp>>3]; 290 } 291 //****************************************************************************** 292 //****************************************************************************** 293 BOOL 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; 278 301 } 279 302 //****************************************************************************** … … 1199 1222 // DDCAPS_READSCANLINE | 1200 1223 DDCAPS_BLTFOURCC; 1201 1202 1224 lpDDDriverCaps->dwCaps2 = DDCAPS2_CERTIFIED | // Who cares so say yes 1203 1225 DDCAPS2_CANRENDERWINDOWED | // Better check for Voodoo ?! … … 1218 1240 lpDDDriverCaps->dwVidMemTotal = me->dCaps.ulApertureSize; // total video memory 1219 1241 lpDDDriverCaps->dwVidMemFree = me->dCaps.ulApertureSize; // total free video memory 1242 1220 1243 lpDDDriverCaps->dwNumFourCCCodes = MAX_FOURCC_CODES; // number of supported FOURCC codes 1221 1244 /* … … 1645 1668 HRESULT WIN32API DrawGetFourCCCodes(THIS This, LPDWORD lpNumCodes, LPDWORD lpCodes) 1646 1669 { 1647 // DWORD dwFCC[MAX_FOURCC_CODES] = {FOURCC_LUT8,FOURCC_R565,FOURCC_RGB3,FOURCC_YUY2};1648 1670 DWORD dwFCC[MAX_FOURCC_CODES] = {FOURCC_LUT8,FOURCC_R565,FOURCC_R555,FOURCC_RGB3}; 1649 1671 … … 1655 1677 if(NULL==lpCodes) 1656 1678 { 1679 #ifdef SUPPORT_ALL_DIVE_FOURCCS 1680 *lpNumCodes = nrOfDiveFourCCs; 1681 #else 1657 1682 *lpNumCodes = MAX_FOURCC_CODES; // LUT8, R565, RGB3 are the FourCC we support for now 1683 #endif 1658 1684 } 1659 1685 else 1660 1686 { 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 1661 1695 for(int i=0;(i<MAX_FOURCC_CODES)&&(i<*lpNumCodes);i++) 1662 1696 { … … 1665 1699 } 1666 1700 *lpNumCodes = MAX_FOURCC_CODES; 1701 #endif 1667 1702 } 1668 1703 return(DD_OK); -
trunk/src/ddraw/OS2DDRAW.H
r6950 r8604 1 /* $Id: OS2DDRAW.H,v 1.1 5 2001-10-05 12:33:09sandervl Exp $ */1 /* $Id: OS2DDRAW.H,v 1.16 2002-06-08 13:12:33 sandervl Exp $ */ 2 2 3 3 /* … … 25 25 #undef THIS 26 26 #define THIS VOID* 27 28 //testestest 29 //#define SUPPORT_ALL_DIVE_FOURCCS 30 //testestest 27 31 28 32 #define MAX_FOURCC_CODES 4 … … 75 79 inline int GetScreenBpp() { return screenbpp;} 76 80 FOURCC GetScreenFourCC(); 81 BOOL IsFourCCSupported(FOURCC fourcc); 77 82 // We should be able to use any mode with less or same bits and same or 78 83 // smaller size to be able to report all supported mode in the enum
Note:
See TracChangeset
for help on using the changeset viewer.