Changeset 850 for trunk/src/ddraw/OS2DDRAW.CPP
- Timestamp:
- Sep 6, 1999, 11:40:08 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ddraw/OS2DDRAW.CPP
r587 r850 38 38 DWORD dwVSize, dwVType; 39 39 ULONG rc; 40 FOURCC fccModes[100]; 40 41 41 42 // Setup table for 3d devices … … 139 140 else 140 141 { 141 WriteLog("DiveOpen OK \n");142 WriteLog("DiveOpen OK Framebuufer at 0x%08X\n",pFrameBuffer); 142 143 } 143 144 memset( &dCaps, … … 145 146 sizeof(DIVE_CAPS) ); 146 147 dCaps.ulStructLen = sizeof(DIVE_CAPS); 148 dCaps.ulFormatLength = 100; 149 dCaps.pFormatData = &fccModes[0]; 147 150 148 151 rc = DiveQueryCaps( &dCaps, 149 152 DIVE_BUFFER_SCREEN); 153 154 WriteLog("DiveQueryCaps rc=0x%08X\n",rc); 150 155 151 156 … … 168 173 if(hDive) 169 174 DiveClose(hDive); 170 if(hDiveColorConv)171 DiveClose(hDiveColorConv);172 175 173 176 // Safty call in case the program did set the pal to all black … … 753 756 HRESULT __stdcall DrawGetCaps(THIS, LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) 754 757 { 758 DWORD dwSize; 759 755 760 #ifdef DEBUG 756 761 WriteLog("DDGetCaps of "); … … 766 771 WriteLog("Driver\n"); 767 772 768 if(sizeof(DDCAPS)!=lpDDDriverCaps->dwSize) 769 { 770 WriteLog("Size Not Set\n"); 773 if( (sizeof(DDCAPS)!=lpDDDriverCaps->dwSize) && 774 (sizeof(DDCAPS_DX5)!=lpDDDriverCaps->dwSize) && 775 (sizeof(DDCAPS_DX3)!=lpDDDriverCaps->dwSize) ) 776 { 777 WriteLog( "Size %d Not supported ", 778 lpDDDriverCaps->dwSize); 771 779 return(DDERR_INVALIDPARAMS); 772 780 } 773 781 // Clear structure so we only have to set the supported flags 774 782 775 776 memset(lpDDDriverCaps,0,sizeof(DDCAPS)); 783 dwSize = lpDDDriverCaps->dwSize; 784 memset( lpDDDriverCaps, 785 0, 786 lpDDDriverCaps->dwSize); 777 787 778 788 779 789 // Reset the size 780 lpDDDriverCaps->dwSize = sizeof(DDCAPS);790 lpDDDriverCaps->dwSize = dwSize; 781 791 782 792 // Now report the CAPs back which we support … … 789 799 790 800 lpDDDriverCaps->dwCaps2 = DDCAPS2_CERTIFIED | // Who cares so say yes 791 DDCAPS2_CANRENDERWINDOWED | // Better check for Voodoo ?!801 //DDCAPS2_CANRENDERWINDOWED | // Better check for Voodoo ?! 792 802 DDCAPS2_COPYFOURCC | // yepp memcpy will do this 793 803 DDCAPS2_NONLOCALVIDMEM | // All surfaces are in memory … … 803 813 DDPCAPS_VSYNC | // Vsync yet 804 814 DDPCAPS_PRIMARYSURFACE; // 805 lpDDDriverCaps->dwVidMemTotal = 2048*1024;// total video memory806 lpDDDriverCaps->dwVidMemFree = 2048*1024;// total free video memory815 lpDDDriverCaps->dwVidMemTotal = 4096*1024; // total video memory 816 lpDDDriverCaps->dwVidMemFree = 4096*1024; // total free video memory 807 817 lpDDDriverCaps->dwNumFourCCCodes; // number of supported FOURCC codes 808 lpDDDriverCaps->dwRops[DD_ROP_SPACE]; // supported raster ops 818 /* 819 ToDo: must finde out ow the array is used for this 820 lpDDDriverCaps->dwRops[DD_ROP_SPACE] = SRCCOPY | 821 BLACKNESS | 822 WHITENESS; // Raster OPs implemented 823 */ 809 824 lpDDDriverCaps->dwSVBCaps = DDCAPS_BLT | // We do blitting 810 825 DDCAPS_BLTCOLORFILL | // We do colorfills … … 812 827 DDCAPS_COLORKEYHWASSIST; 813 828 lpDDDriverCaps->dwSVBCKeyCaps = DDCKEYCAPS_SRCBLT; // Only source transparent blitting 814 lpDDDriverCaps->dwSVBFXCaps; // . 815 lpDDDriverCaps->dwSVBRops[DD_ROP_SPACE]; // . 829 lpDDDriverCaps->dwSVBFXCaps = DDCAPS_BLT | // We do blitting 830 DDCAPS_BLTCOLORFILL | // We do colorfills 831 DDCAPS_COLORKEY | // We support Colorkeying 832 DDCAPS_COLORKEYHWASSIST; 833 /* 834 ToDo: must finde out ow the array is used for this 835 lpDDDriverCaps->dwSVBRops[DD_ROP_SPACE] = SRCCOPY | 836 BLACKNESS | 837 WHITENESS; // Raster OPs implemented 838 */ 816 839 lpDDDriverCaps->dwVSBCaps = DDCAPS_BLT | // We do blitting 817 840 DDCAPS_BLTCOLORFILL | // We do colorfills … … 819 842 DDCAPS_COLORKEYHWASSIST; 820 843 lpDDDriverCaps->dwVSBCKeyCaps = DDCKEYCAPS_SRCBLT; // Only source transparent blitting 821 lpDDDriverCaps->dwVSBFXCaps; // . 822 lpDDDriverCaps->dwVSBRops[DD_ROP_SPACE]; // . 844 lpDDDriverCaps->dwVSBFXCaps = DDCAPS_BLT | // We do blitting 845 DDCAPS_BLTCOLORFILL | // We do colorfills 846 DDCAPS_COLORKEY | // We support Colorkeying 847 DDCAPS_COLORKEYHWASSIST; 848 /* 849 ToDo: must finde out ow the array is used for this 850 lpDDDriverCaps->dwVSBRops[DD_ROP_SPACE] = SRCCOPY | 851 BLACKNESS | 852 WHITENESS; // Raster OPs implemented 853 */ 823 854 lpDDDriverCaps->dwSSBCaps = DDCAPS_BLT | // We do blitting 824 855 DDCAPS_BLTCOLORFILL | // We do colorfills … … 826 857 DDCAPS_COLORKEYHWASSIST; 827 858 lpDDDriverCaps->dwSSBCKeyCaps = DDCKEYCAPS_SRCBLT; // Only source transparent blitting 828 lpDDDriverCaps->dwSSBFXCaps; // . 829 lpDDDriverCaps->dwSSBRops[DD_ROP_SPACE]; // . 830 lpDDDriverCaps->dwSVBCaps2 = DDCAPS2_CANRENDERWINDOWED | // Better check for Voodoo ?! 831 DDCAPS2_COPYFOURCC | // yepp memcpy will do this 832 DDCAPS2_WIDESURFACES; // Any size you want! 833 lpDDDriverCaps->dwNLVBCaps = DDCAPS_BLT | // We do blitting 834 DDCAPS_BLTCOLORFILL | // We do colorfills 835 DDCAPS_COLORKEY | // We support Colorkeying 836 DDCAPS_COLORKEYHWASSIST; 837 lpDDDriverCaps->dwNLVBCaps2 = DDCAPS2_CANRENDERWINDOWED | // Better check for Voodoo ?! 838 DDCAPS2_COPYFOURCC | // yepp memcpy will do this 839 DDCAPS2_WIDESURFACES; // Any size you want! 840 lpDDDriverCaps->dwNLVBCKeyCaps = DDCKEYCAPS_SRCBLT; // Only source transparent blitting 841 lpDDDriverCaps->dwNLVBFXCaps; // . 842 lpDDDriverCaps->dwNLVBRops[DD_ROP_SPACE];// . 843 DDSCAPS2 ddsCaps; // general surface caps 859 lpDDDriverCaps->dwSSBFXCaps = DDCAPS_BLT | // We do blitting 860 DDCAPS_BLTCOLORFILL | // We do colorfills 861 DDCAPS_COLORKEY | // We support Colorkeying 862 DDCAPS_COLORKEYHWASSIST; 863 /* 864 ToDo: must finde out ow the array is used for this 865 lpDDDriverCaps->dwSSBRops[SRCCOPY] = 1; 866 lpDDDriverCaps->dwSSBRops[BLACKNESS] = 1; 867 lpDDDriverCaps->dwSSBRops[WHITENESS] = 1; // Raster OPs implemented 868 */ 869 // These are ony in >DX5 870 if(dwSize>sizeof(DDCAPS_DX3)) 871 { 872 lpDDDriverCaps->dwSVBCaps2 = //DDCAPS2_CANRENDERWINDOWED | // Better check for Voodoo ?! 873 DDCAPS2_COPYFOURCC | // yepp memcpy will do this 874 DDCAPS2_WIDESURFACES; // Any size you want! 875 lpDDDriverCaps->dwNLVBCaps = DDCAPS_BLT | // We do blitting 876 DDCAPS_BLTCOLORFILL | // We do colorfills 877 DDCAPS_COLORKEY | // We support Colorkeying 878 DDCAPS_COLORKEYHWASSIST; 879 lpDDDriverCaps->dwNLVBCaps2 = //DDCAPS2_CANRENDERWINDOWED | // Better check for Voodoo ?! 880 DDCAPS2_COPYFOURCC | // yepp memcpy will do this 881 DDCAPS2_WIDESURFACES; // Any size you want! 882 lpDDDriverCaps->dwNLVBCKeyCaps = DDCKEYCAPS_SRCBLT; // Only source transparent blitting 883 lpDDDriverCaps->dwNLVBFXCaps = DDCAPS_BLT | // We do blitting 884 DDCAPS_BLTCOLORFILL | // We do colorfills 885 DDCAPS_COLORKEY | // We support Colorkeying 886 DDCAPS_COLORKEYHWASSIST; 887 lpDDDriverCaps->dwNLVBRops[DD_ROP_SPACE];// ToDo: Again the array ... 888 889 // General Surface caps only in DX6 890 if(dwSize>sizeof(DDCAPS_DX5)) 891 { 892 lpDDDriverCaps->ddsCaps.dwCaps = DDSCAPS_ALPHA | DDSCAPS_BACKBUFFER | 893 DDSCAPS_COMPLEX | DDSCAPS_FLIP | 894 DDSCAPS_FRONTBUFFER | DDSCAPS_LOCALVIDMEM | 895 DDSCAPS_NONLOCALVIDMEM | DDSCAPS_OFFSCREENPLAIN | 896 // DDSCAPS_OVERLAY | 897 DDSCAPS_PALETTE | DDSCAPS_PRIMARYSURFACE | 898 DDSCAPS_SYSTEMMEMORY |DDSCAPS_VIDEOMEMORY | 899 DDSCAPS_VISIBLE; 900 901 #ifdef USE_OPENGL 902 lpDDDriverCaps->dwCaps |= DDCAPS_3D | DDCAPS_ZBLTS; 903 // ToDO find and put the value for DDCAPS2_NO2DDURING3DSCENE in ddraw.h 904 // lpDDDriverCaps->dwCaps2 |= DDCAPS2_NO2DDURING3DSCENE; 905 lpDDDriverCaps->ddsCaps.dwCaps |= DDSCAPS_3DDEVICE | DDSCAPS_MIPMAP | 906 DDSCAPS_TEXTURE | DDSCAPS_ZBUFFER; 907 #endif 908 } 909 } 910 844 911 845 912 } … … 1344 1411 ULONG rc; 1345 1412 OS2IDirectDraw *me = (OS2IDirectDraw *)This; 1413 SETUP_BLITTER sBlt; 1346 1414 1347 1415 #ifdef DEBUG … … 1352 1420 me->screenheight = dwHeight; 1353 1421 me->screenbpp = dwBPP; 1354 if(me->screenbpp!=me->dCaps.ulDepth) 1355 { 1356 rc = DiveOpen( &me->hDiveColorConv, 1357 FALSE, 1358 0); 1359 WriteLog("Screen in different mode than requested, open addional DIVE instance(rc=%X)\n\n",rc); 1360 1361 } 1362 // _interrupt(3); 1422 1423 memset(&sBlt,0,sizeof(sBlt)); 1424 sBlt.ulStructLen = sizeof(sBlt); 1425 sBlt.fccSrcColorFormat = FOURCC_SCRN; 1426 sBlt.ulSrcWidth = dwWidth; 1427 sBlt.ulSrcHeight = dwHeight; 1428 sBlt.ulSrcPosX = 0; 1429 sBlt.ulSrcPosY = 0; 1430 sBlt.fccDstColorFormat = FOURCC_SCRN; 1431 sBlt.ulDstWidth = dwWidth; 1432 sBlt.ulDstHeight = dwHeight; 1433 sBlt.lDstPosX = 0; 1434 sBlt.lDstPosY = 0; 1435 sBlt.lScreenPosX = 0; 1436 sBlt.lScreenPosY = me->dCaps.ulVerticalResolution-dwHeight; 1437 sBlt.ulNumDstRects = DIVE_FULLY_VISIBLE; 1438 1439 rc = DiveSetupBlitter( me->hDive, 1440 &sBlt); 1441 1363 1442 return(DD_OK); 1364 1443 } … … 1370 1449 ULONG rc; 1371 1450 OS2IDirectDraw *me = (OS2IDirectDraw *)This; 1451 SETUP_BLITTER sBlt; 1372 1452 1373 1453 #ifdef DEBUG … … 1377 1457 me->screenheight = dwHeight; 1378 1458 me->screenbpp = dwBPP; 1379 if(me->screenbpp!=me->dCaps.ulDepth) 1380 { 1381 rc = DiveOpen( &me->hDiveColorConv, 1382 FALSE, 1383 0); 1384 WriteLog("Screen in different mode than requested, open addional DIVE instance(rc=%X)\n\n",rc); 1385 1386 } 1387 // _interrupt(3); 1459 1460 memset(&sBlt,0,sizeof(sBlt)); 1461 sBlt.ulStructLen = sizeof(sBlt); 1462 sBlt.fccSrcColorFormat = FOURCC_SCRN; 1463 sBlt.ulSrcWidth = dwWidth; 1464 sBlt.ulSrcHeight = dwHeight; 1465 sBlt.ulSrcPosX = 0; 1466 sBlt.ulSrcPosY = 0; 1467 sBlt.fccDstColorFormat = FOURCC_SCRN; 1468 sBlt.ulDstWidth = dwWidth; 1469 sBlt.ulDstHeight = dwHeight; 1470 sBlt.lDstPosX = 0; 1471 sBlt.lDstPosY = 0; 1472 sBlt.lScreenPosX = 0; 1473 sBlt.lScreenPosY = me->dCaps.ulVerticalResolution-dwHeight; 1474 sBlt.ulNumDstRects = DIVE_FULLY_VISIBLE; 1475 1476 rc = DiveSetupBlitter( me->hDive, 1477 &sBlt); 1478 1388 1479 return(DD_OK); 1389 1480 }
Note:
See TracChangeset
for help on using the changeset viewer.