- Timestamp:
- Sep 6, 1999, 11:40:08 PM (26 years ago)
- Location:
- trunk/src/ddraw
- Files:
-
- 4 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 } -
trunk/src/ddraw/OS2PALETTE.CPP
r587 r850 50 50 memcpy((char *)os2pal, (char *)lpColorTable, palsize*sizeof(PALETTEENTRY)); 51 51 52 WriteLog("Init CC PalTable"); 52 53 for(DWORD i=0;i<dwSize;i++) 53 54 { … … 55 56 ((lpColorTable[i].peGreen>>2) <<5) + 56 57 ((lpColorTable[i].peRed>>3) << 11); 58 WriteLog( " # %d : RGB=%02X/%02X/%02X => %04X\n", 59 i, 60 lpColorTable[i].peRed, 61 lpColorTable[i].peGreen, 62 lpColorTable[i].peBlue, 63 aPal16[i]); 57 64 aPal24[i] = (lpColorTable[i].peBlue <<8) + 58 65 (lpColorTable[i].peGreen<<16) + … … 193 200 dwNumEntries*sizeof(PALETTEENTRY)); 194 201 202 WriteLog("Setting up CC Palentries:\n"); 195 203 for(DWORD i=0;i<dwNumEntries;i++) 196 204 { … … 198 206 ((lpNewEntries[i].peGreen>>2) <<5) + 199 207 ((lpNewEntries[i].peRed>>3) << 11); 208 WriteLog( " # %d : RGB=%02X/%02X/%02X => %04X\n", 209 dwBase+i, 210 lpNewEntries[i].peRed, 211 lpNewEntries[i].peGreen, 212 lpNewEntries[i].peBlue, 213 me->aPal16[dwBase+i]); 200 214 me->aPal24[dwBase+i] = (lpNewEntries[i].peBlue <<8) + 201 215 (lpNewEntries[i].peGreen<<16) + … … 213 227 ((OS2IDirectDrawSurface*)((OS2IDirectDraw*)me->lpDraw)->pPrimSurf)->ColorConversion(NULL);; 214 228 } 215 /*216 if(NULL!=me->hDiveCC)217 {218 DiveSetSourcePalette( me->hDiveCC,219 dwBase,220 dwNumEntries,221 (PBYTE)lpNewEntries);222 223 }224 else225 {226 // Only usefull if system and game are in 8bit mode227 // 16bit games don't use palettes and setting the Phys palette228 // in >8Bit Modes has no effect.229 230 if(me->fAttachedToPrimary)231 me->SetPhysPalette();232 }233 */234 229 return(DD_OK); 235 230 } -
trunk/src/ddraw/OS2SURFACE.CPP
r587 r850 17 17 #include "asmutil.h" 18 18 #include <winerror.h> 19 19 #include <os2win.h> 20 20 #ifndef __WATCOMC__ 21 21 #include <builtin.h> … … 24 24 extern FOURCC SupportedFourCCs[]; 25 25 // ToDo: Move the following 2 defines in the right WINE headers. 26 BYTE DefaultPalette[] = { 0x00,0x00,0x00, // 0 27 0x80,0x00,0x00, // 1 28 0x00,0x80,0x00, // 2 29 0x80,0x80,0x00, // 3 30 0x00,0x00,0x80, // 4 31 0x80,0x00,0x80, // 5 32 0x00,0x80,0x80, // 6 33 0xC0,0xC0,0xC0, // 7 34 0xC0,0xDC,0xC0, // 8 35 0xA6,0xCA,0xF0, // 9 36 0x04,0x04,0x04, // 10 37 0x08,0x08,0x08, // 11 38 0x0C,0x0C,0x0C, // 12 39 0x11,0x11,0x11, // 13 40 0x16,0x16,0x16, // 14 41 0x1C,0x1C,0x1C, // 15 42 0x22,0x22,0x22, // 16 43 0x29,0x29,0x29, // 17 44 0x55,0x55,0x55, // 18 45 0x4D,0x4D,0x4D, 46 0x42,0x42,0x42, 47 0x39,0x39,0x39, 48 0x81,0x81,0x81, 49 0x81,0x00,0x00, 50 0x00,0x81,0x00, 51 0x81,0x81,0x00, 52 0x00,0x00,0x81, 53 0x81,0x00,0x81, 54 0x00,0x81,0x81, 55 0x33,0x00,0x00, 56 0x66,0x00,0x00, 57 0x99,0x00,0x00, 58 0xCC,0x00,0x00, 59 0x00,0x33,0x00, 60 0x33,0x33,0x00, 61 0x66,0x33,0x00, 62 0x99,0x33,0x00, 63 0xCC,0x33,0x00, 64 0xFF,0x33,0x00, 65 0x00,0x66,0x00, 66 0x33,0x66,0x00, 67 0x66,0x66,0x00, 68 0x99,0x66,0x00, 69 0xCC,0x66,0x00, 70 0xFF,0x66,0x00, 71 0x00,0x99,0x00, 72 0x33,0x99,0x00, 73 0x66,0x99,0x00, 74 0x99,0x99,0x00, 75 0xCC,0x99,0x00, 76 0xFF,0x99,0x00, 77 0x00,0xCC,0x00, 78 0x33,0xCC,0x00, 79 0x66,0xCC,0x00, 80 0x99,0xCC,0x00, 81 0xCC,0xCC,0x00, 82 0xFF,0xCC,0x00, 83 0x66,0xFF,0x00, 84 0x99,0xFF,0x00, 85 0xCC,0xFF,0x00, 86 0x00,0x00,0x33, 87 0x33,0x00,0x33, 88 0x66,0x00,0x33, 89 0x99,0x00,0x33, 90 0xCC,0x00,0x33, 91 0xFF,0x00,0x33, 92 0x00,0x33,0x33, 93 0x33,0x33,0x33, 94 0x66,0x33,0x33, 95 0x99,0x33,0x33, 96 0xCC,0x33,0x33, 97 0xFF,0x33,0x33, 98 0x00,0x66,0x33, 99 0x33,0x66,0x33, 100 0x66,0x66,0x33, 101 0x99,0x66,0x33, 102 0xCC,0x66,0x33, 103 0xFF,0x66,0x33, 104 0x00,0x99,0x33, 105 0x33,0x99,0x33, 106 0x66,0x99,0x33, 107 0x99,0x99,0x33, 108 0xCC,0x99,0x33, 109 0xFF,0x99,0x33, 110 0x00,0xCC,0x33, 111 0x33,0xCC,0x33, 112 0x66,0xCC,0x33, 113 0x99,0xCC,0x33, 114 0xCC,0xCC,0x33, 115 0xFF,0xCC,0x33, 116 0x33,0xFF,0x33, 117 0x66,0xFF,0x33, 118 0x99,0xFF,0x33, 119 0xCC,0xFF,0x33, 120 0xFF,0xFF,0x33, 121 0x00,0x00,0x66, 122 0x33,0x00,0x66, 123 0x66,0x00,0x66, 124 0x99,0x00,0x66, 125 0xCC,0x00,0x66, 126 0xFF,0x00,0x66, 127 0x00,0x33,0x66, 128 0x33,0x33,0x66, 129 0x66,0x33,0x66, 130 0x99,0x33,0x66, 131 0xCC,0x33,0x66, 132 0xFF,0x33,0x66, 133 0x00,0x66,0x66, 134 0x33,0x66,0x66, 135 0x66,0x66,0x66, 136 0x99,0x66,0x66, 137 0xCC,0x66,0x66, 138 0x00,0x99,0x66, 139 0x33,0x99,0x66, 140 0x66,0x99,0x66, 141 0x99,0x99,0x66, 142 0xCC,0x99,0x66, 143 0xFF,0x99,0x66, 144 0x00,0xCC,0x66, 145 0x33,0xCC,0x66, 146 0x99,0xCC,0x66, 147 0xCC,0xCC,0x66, 148 0xFF,0xCC,0x66, 149 0x00,0xFF,0x66, 150 0x33,0xFF,0x66, 151 0x99,0xFF,0x66, 152 0xCC,0xFF,0x66, 153 0xFF,0x00,0xCC, 154 0xCC,0x00,0xFF, 155 0x00,0x99,0x99, 156 0x99,0x33,0x99, 157 0x99,0x00,0x99, 158 0xCC,0x00,0x99, 159 0x00,0x00,0x99, 160 0x33,0x33,0x99, 161 0x66,0x00,0x99, 162 0xCC,0x33,0x99, 163 0xFF,0x00,0x99, 164 0x00,0x66,0x99, 165 0x33,0x33,0x99, 166 0x33,0x66,0x99, 167 0x66,0x33,0x99, 168 0x99,0x33,0x99, 169 0xCC,0x66,0x99, 170 0xFF,0x33,0x99, 171 0x33,0x99,0x99, 172 0x66,0x99,0x99, 173 0x99,0x99,0x99, 174 0xCC,0x99,0x99, 175 0xFF,0x99,0x99, 176 0x00,0xCC,0x99, 177 0x33,0xCC,0x99, 178 0x66,0xCC,0x66, 179 0x99,0xCC,0x99, 180 0xCC,0xCC,0x99, 181 0xFF,0xCC,0x99, 182 0x00,0xFF,0x99, 183 0x33,0xFF,0x99, 184 0x66,0xCC,0x99, 185 0x99,0xFF,0x99, 186 0xCC,0xFF,0x99, 187 0xFF,0xFF,0x99, 188 0x00,0x00,0xCC, 189 0x33,0x00,0x99, 190 0x66,0x00,0xCC, 191 0x99,0x00,0xCC, 192 0xCC,0x00,0xCC, 193 0x00,0x33,0x99, 194 0x33,0x33,0xCC, 195 0x66,0x33,0xCC, 196 0x99,0x33,0xCC, 197 0xCC,0x33,0xCC, 198 0xFF,0x33,0xCC, 199 0x00,0x66,0xCC, 200 0x33,0x66,0xCC, 201 0x66,0x66,0x99, 202 0x99,0x66,0xCC, 203 0xCC,0x66,0xCC, 204 0xFF,0x66,0x99, 205 0x00,0x99,0xCC, 206 0x33,0x99,0xCC, 207 0x66,0x99,0xCC, 208 0x99,0x99,0xCC, 209 0xCC,0x99,0xCC, 210 0xFF,0x99,0xCC, 211 0x00,0xCC,0xCC, 212 0x33,0xCC,0xCC, 213 0x66,0xCC,0xCC, 214 0x99,0xCC,0xCC, 215 0xCC,0xCC,0xCC, 216 0xFF,0xCC,0xCC, 217 0x00,0xFF,0xCC, 218 0x33,0xFF,0xCC, 219 0x66,0xFF,0x99, 220 0x99,0xFF,0xCC, 221 0xCC,0xFF,0xCC, 222 0xFF,0xFF,0xCC, 223 0x33,0x00,0xCC, 224 0x66,0x00,0xFF, 225 0x99,0x00,0xFF, 226 0x00,0x33,0xCC, 227 0x33,0x33,0xFF, 228 0x66,0x33,0xFF, 229 0x99,0x33,0xFF, 230 0xCC,0x33,0xFF, 231 0xFF,0x33,0xFF, 232 0x00,0x66,0xFF, 233 0x33,0x66,0xFF, 234 0x66,0x66,0xCC, 235 0x99,0x66,0xFF, 236 0xCC,0x66,0xFF, 237 0xFF,0x66,0xCC, 238 0x00,0x99,0xFF, 239 0x33,0x99,0xFF, 240 0x66,0x99,0xFF, 241 0x99,0x99,0xFF, 242 0xCC,0x99,0xFF, 243 0xFF,0x99,0xFF, 244 0x00,0xCC,0xFF, 245 0x33,0xCC,0xFF, 246 0x66,0xCC,0xFF, 247 0x99,0xCC,0xFF, 248 0xCC,0xCC,0xFF, 249 0xFF,0xCC,0xFF, 250 0x33,0xFF,0xFF, 251 0x66,0xFF,0xCC, 252 0x99,0xFF,0xFF, 253 0xCC,0xFF,0xFF, 254 0xFF,0x66,0x66, 255 0x66,0xFF,0x66, 256 0xFF,0xFF,0x66, 257 0x66,0x66,0xFF, 258 0xFF,0x66,0xFF, 259 0x66,0xFF,0xFF, 260 0xC1,0xC1,0xC1, 261 0x5F,0x5F,0x5F, 262 0x77,0x77,0x77, 263 0x86,0x86,0x86, 264 0x96,0x96,0x96, 265 0xCB,0xCB,0xCB, 266 0xB2,0xB2,0xB2, 267 0xD7,0xD7,0xD7, 268 0xDD,0xDD,0xDD, 269 0xE3,0xE3,0xE3, 270 0xEA,0xEA,0xEA, 271 0xF1,0xF1,0xF1, 272 0xF8,0xF8,0xF8, 273 0xFF,0xFB,0xF0, 274 0xA0,0xA0,0xA4, 275 0x80,0x80,0x80, 276 0xFF,0x00,0x00, 277 0x00,0xFF,0x00, 278 0xFF,0xFF,0x00, 279 0x00,0x00,0xFF, 280 0xFF,0x00,0xFF, 281 // 0x00,0xFF,0xFF, 282 0xFF,0xFF,0xFF}; 283 284 WORD wDefaultPalete16[256]; 285 BOOL fPalInit=FALSE; 26 286 27 287 #define CBM_CREATEDIB 0x02L /* create DIB bitmap */ … … 113 373 if (flags[i].mask & flagmask) 114 374 WriteLog("%s ",flags[i].name); 375 WriteLog("\n"); 115 376 } 116 377 … … 411 672 // Check if OS/2 is running in the requested colormode 412 673 674 diveBufNr = DIVE_BUFFER_SCREEN; 413 675 if( lpDraw->dCaps.ulDepth == lpDraw->GetScreenBpp() ) 414 676 { … … 417 679 // Yes so direct access to framebuffer is possible 418 680 419 diveBufNr = DIVE_BUFFER_SCREEN;420 681 pFrameBuffer = lpDraw->GetFrameBuffer(); 421 682 pDiveBuffer = pFrameBuffer; … … 557 818 558 819 BackBuffer = new OS2IDirectDrawSurface(lpDraw, &ComplexSurfaceDesc, TRUE, TRUE); 820 559 821 if (BackBuffer->GetLastError()==DD_OK) 560 822 { 823 WriteLog("created backbuffer"); 561 824 // Our Primary Buffer is also the frontbuffer of a flipchain 562 DDSurfaceDesc.dwFlags |= DDSCAPS_FRONTBUFFER | DDSCAPS_FLIP; 825 DDSurfaceDesc.ddsCaps.dwCaps |= DDSCAPS_FRONTBUFFER | DDSCAPS_FLIP; 826 lpDDSurfaceDesc->ddsCaps.dwCaps |= DDSCAPS_FRONTBUFFER | DDSCAPS_FLIP; 563 827 BackBuffer->SetFrontBuffer(this); 828 } 829 else 830 { 831 WriteLog("Error creating backbuffer"); 564 832 } 565 833 } … … 810 1078 { 811 1079 WriteLog("with DIVE\n"); 812 // This surface is part of flipchain with the primary surface use dive to alloc 1080 // This surface is part of flipchain with the primary surface use dive to assoc memory 1081 pDiveBuffer = (char*)malloc( lpDDSurfaceDesc->dwHeight * 1082 dwPitchDB); 813 1083 diveBufNr = 0; 814 DiveAllocImageBuffer( hDive, 815 &diveBufNr, 816 lpDraw->dCaps.fccColorEncoding, 817 lpDDSurfaceDesc->dwWidth, 818 lpDDSurfaceDesc->dwHeight, 819 dwPitchDB, 820 (PBYTE)pDiveBuffer); 1084 rc = DiveAllocImageBuffer( hDive, 1085 &diveBufNr, 1086 lpDraw->dCaps.fccColorEncoding, 1087 lpDDSurfaceDesc->dwWidth, 1088 lpDDSurfaceDesc->dwHeight, 1089 dwPitchDB, 1090 (PBYTE)pDiveBuffer); 1091 WriteLog("rc = 0x%08X\n",rc); 821 1092 } 822 1093 else … … 952 1223 953 1224 DWORD *pColor, dwColor,y; 954 955 #ifdef DEBUG 956 WriteLog("ColorFill\n"); 1225 DWORD *pPal24; 1226 WORD *pPal16; 1227 #ifdef DEBUG 1228 WriteLog("ColorFill with %08X\n", dwFillColor); 957 1229 #endif 958 1230 … … 971 1243 else 972 1244 { 1245 WriteLog("Fill all at addr "); 973 1246 FillWidth = width; 974 1247 FillHeight = height -1; 975 1248 pLine = pDiveBuffer; 976 1249 } 977 1250 WriteLog("0x%08X (%d/%d) at\n", pLine,FillWidth,FillHeight); 1251 1252 if(pDiveBuffer!=pFrameBuffer) 1253 { 1254 if( (NULL== lpDraw->pPrimSurf) || 1255 (NULL== ((OS2IDirectDrawSurface*)lpDraw->pPrimSurf)->lpPalette) ) 1256 { 1257 if(!fPalInit) 1258 { 1259 for(DWORD i=0;i<256;i++) 1260 { 1261 wDefaultPalete16[i] = (DefaultPalette[i*3+2]>>3) + 1262 ((DefaultPalette[i*3+1]>>2) <<5) + 1263 ((DefaultPalette[i*3]>>3) << 11); 1264 WriteLog( " # %d : RGB=%02X/%02X/%02X => %04X\n", 1265 i, 1266 DefaultPalette[i*3], 1267 DefaultPalette[i*3+1], 1268 DefaultPalette[i*3+2], 1269 wDefaultPalete16[i]); 1270 // aPal24[i] = (lpColorTable[i].peBlue <<8) + 1271 // (lpColorTable[i].peGreen<<16) + 1272 // (lpColorTable[i].peRed<<24); 1273 } 1274 fPalInit = TRUE; 1275 } 1276 pPal16 = &wDefaultPalete16[0]; 1277 } 1278 else 1279 { 1280 pPal16 = ((OS2IDirectDrawSurface*)lpDraw->pPrimSurf)->lpPalette->aPal16; 1281 pPal24 = ((OS2IDirectDrawSurface*)lpDraw->pPrimSurf)->lpPalette->aPal24; 1282 } 1283 } 978 1284 979 1285 switch(dwBytesPPDive) 980 1286 { 981 1287 case 1: 1288 WriteLog("8 Bit\n"); 982 1289 dwColor = (dwFillColor<<24) + (dwFillColor<<16) + 983 1290 (dwFillColor<<8) + (dwFillColor); … … 988 1295 pFillPos = (char*) (&pColor[i-1]); 989 1296 for(i=0;i<FillWidth % 4;i++) 990 pFillPos[i] = (UCHAR) dwColor;1297 pFillPos[i] = (UCHAR) dwColor; 991 1298 } 992 1299 break; 993 1300 case 2: 1301 WriteLog("16 Bit\n"); 1302 if(pDiveBuffer!=pFrameBuffer) 1303 { 1304 if(8==lpDraw->GetScreenBpp()) 1305 dwFillColor = pPal16[dwFillColor]; 1306 } 994 1307 dwColor = (dwFillColor<<16) + (dwFillColor); 1308 WriteLog("Fill with 0x%08X\n",dwColor); 995 1309 for(i=0,pColor = (DWORD*)pLine;i<(FillWidth/2);i++) 996 1310 pColor[i] = dwColor; … … 1002 1316 break; 1003 1317 case 3: 1318 WriteLog("24 Bit\n"); 1319 1004 1320 dwColor = (dwFillColor<<8); 1005 1321 for(i=0 ; i<FillWidth ; i++) … … 1010 1326 break; 1011 1327 case 4: 1328 WriteLog("32 Bit\n"); 1012 1329 dwColor = dwFillColor; 1013 1330 for(i=0,pColor = (DWORD*)pLine;i<FillWidth;i++) … … 1023 1340 1024 1341 pFillPos = pLine + dwPitchDB; 1025 1342 FillWidth = FillWidth*dwBytesPPDive;; 1026 1343 for( y=0;y<FillHeight;y++,pFillPos+=dwPitchDB) 1027 1344 { … … 1190 1507 WORD *pPal16; 1191 1508 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; 1509 if( (NULL== lpDraw->pPrimSurf) || 1510 (NULL== ((OS2IDirectDrawSurface*)lpDraw->pPrimSurf)->lpPalette) ) 1511 { 1512 if(!fPalInit) 1513 { 1514 for(DWORD i=0;i<256;i++) 1515 { 1516 wDefaultPalete16[i] = (DefaultPalette[i*3+2]>>3) + 1517 ((DefaultPalette[i*3+1]>>2) <<5) + 1518 ((DefaultPalette[i*3]>>3) << 11); 1519 WriteLog( " # %d : RGB=%02X/%02X/%02X => %04X\n", 1520 i, 1521 DefaultPalette[i*3], 1522 DefaultPalette[i*3+1], 1523 DefaultPalette[i*3+2], 1524 wDefaultPalete16[i]); 1525 // aPal24[i] = (lpColorTable[i].peBlue <<8) + 1526 // (lpColorTable[i].peGreen<<16) + 1527 // (lpColorTable[i].peRed<<24); 1528 } 1529 fPalInit = TRUE; 1530 } 1531 pPal16 = &wDefaultPalete16[0]; 1532 } 1533 else 1534 { 1535 pPal16 = ((OS2IDirectDrawSurface*)lpDraw->pPrimSurf)->lpPalette->aPal16; 1536 pPal24 = ((OS2IDirectDrawSurface*)lpDraw->pPrimSurf)->lpPalette->aPal24; 1202 1537 } 1203 1538 … … 1244 1579 if(8==lpDraw->GetScreenBpp()) 1245 1580 { 1246 pPal16 = ((OS2IDirectDrawSurface*)lpDraw->pPrimSurf)->lpPalette->aPal16;1247 1581 WriteLog("8->16Bit CC\n"); 1248 1582 for(y=0;CCheight;CCheight--,y++) 1249 1583 { 1250 WriteLog("Converting Line %d\n",y);1251 1584 for(x=0;x<width;x++) 1252 1585 { … … 1269 1602 else 1270 1603 { 1271 WriteLog("%d -> 16Bit Not implemented",lpDraw->GetScreenBpp());1604 WriteLog("%d ->24Bit Not implemented",lpDraw->GetScreenBpp()); 1272 1605 } 1273 1606 break; … … 1279 1612 else 1280 1613 { 1281 WriteLog("%d -> 16Bit Not implemented",lpDraw->GetScreenBpp());1614 WriteLog("%d ->32Bit Not implemented",lpDraw->GetScreenBpp()); 1282 1615 } 1283 1616 break; … … 1470 1803 if (NULL==NewFBuffer) 1471 1804 { 1805 1806 WriteLog("Remove Frontbuffer\n"); 1807 1472 1808 // The real Frontbuffer was removed check if I'm now the one 1473 1809 if(NULL!=BackBuffer) 1474 1810 { 1811 WriteLog("We have the a backbuffer so we're the Frontbuffer\n"); 1812 NextFlip = BackBuffer; 1475 1813 DDSurfaceDesc.ddsCaps.dwCaps &= ~DDSCAPS_BACKBUFFER; 1476 1814 DDSurfaceDesc.ddsCaps.dwCaps |= DDSCAPS_FRONTBUFFER; … … 1480 1818 { 1481 1819 // Flipchain is destroyed 1820 WriteLog("No longer part of a flipchain\n"); 1482 1821 DDSurfaceDesc.ddsCaps.dwCaps &= ~(DDSCAPS_BACKBUFFER | DDSCAPS_FLIP); 1483 1822 } … … 1485 1824 else 1486 1825 { 1826 WriteLog("Set new Frontbuffer to 0x%08X\n",NewFBuffer); 1487 1827 if(NULL==NewFBuffer->GetFrontBuffer()) 1488 1828 { 1829 WriteLog("We're the 1st backbuffer\n"); 1489 1830 DDSurfaceDesc.ddsCaps.dwCaps |= DDSCAPS_BACKBUFFER | DDSCAPS_FLIP; 1831 FrontBuffer->NextFlip = this; 1490 1832 } 1491 1833 else 1492 1834 { 1835 WriteLog("We are oe of many buffers\n"); 1493 1836 DDSurfaceDesc.ddsCaps.dwCaps &= ~DDSCAPS_BACKBUFFER ; 1494 1837 DDSurfaceDesc.ddsCaps.dwCaps |= DDSCAPS_FLIP; … … 1770 2113 } 1771 2114 } 1772 2115 WriteLog("Surface attached\n"); 1773 2116 return(DD_OK); 1774 2117 } … … 3273 3616 LPVOID Data; 3274 3617 char *pcrFB,*pcFB,*pcrDB,*pcDB; 3618 ULONG rc; 3275 3619 3276 3620 #ifdef DEBUG … … 3284 3628 WriteLog("Flip called on none Frontbuffer/Flip surface\n Flags:\n"); 3285 3629 _dump_DDSCAPS(me->DDSurfaceDesc.ddsCaps.dwCaps); 3630 WriteLog("\n"); 3286 3631 #endif 3287 3632 return(DDERR_NOTFLIPPABLE); … … 3290 3635 if(NULL!=lpDDSurf) 3291 3636 { 3637 #ifdef DEBUG 3638 WriteLog("Check if Surface is in Flipchain!\n"); 3639 #endif 3640 3292 3641 // We got an override surface check if it is in the flipchain 3293 3642 FlipSurface = (OS2IDirectDrawSurface*) lpDDSurf; … … 3307 3656 } 3308 3657 else 3658 { 3309 3659 FlipSurface = me->NextFlip; // Take the next Surface in the Flipchain 3310 3660 #ifdef DEBUG 3661 WriteLog("Next Surface @ 0x%08X\n",FlipSurface); 3662 #endif 3663 } 3311 3664 3312 3665 if((me->fLocked)||(FlipSurface->fLocked)) … … 3320 3673 if(-1 != me->diveBufNr) 3321 3674 { 3675 #ifdef DEBUG 3676 WriteLog("DIVE Flipchain"); 3677 #endif 3678 3322 3679 // we got some DIVE surfaces 3323 3680 // On Dive Buffers More then Double buffering won't get any perf. gain … … 3325 3682 // Doulebuffering should work best. 3326 3683 3327 DiveBlitImage(me->hDive, FlipSurface->diveBufNr, me->diveBufNr); 3684 rc = DiveBlitImage(me->hDive, FlipSurface->diveBufNr, me->diveBufNr); 3685 3686 #ifdef DEBUG 3687 WriteLog("DiveBlitImage rc = 0x%08X\n"); 3688 #endif 3328 3689 3329 3690 if(NULL==lpDDSurf) … … 3335 3696 else 3336 3697 { 3698 #ifdef DEBUG 3699 WriteLog("Memory Flipchain"); 3700 #endif 3337 3701 // Memory Flipchain 3338 3702 // … … 3346 3710 // Memory: 11 22 33 22 33 11 3347 3711 // 3712 3348 3713 Data = me->DDSurfaceDesc.lpSurface; 3349 3714 pcrFB = me->pFBreal; … … 3583 3948 DDSURFACEDESC2 LockedSurfaceDesc; 3584 3949 HRESULT rc; 3950 BITMAP bmpSurface; 3585 3951 struct 3586 3952 { … … 3622 3988 (me->hbmImage == NULL) ) 3623 3989 { 3990 WriteLog( "Trying to create Bitmap (%d/%d) at %d Bit\n", 3991 LockedSurfaceDesc.lPitch/ (LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount>>3), 3992 LockedSurfaceDesc.dwHeight, 3993 LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount 3994 ); 3995 #if 0 3624 3996 memset(&BitmapInfo, 0, sizeof(BitmapInfo)); 3625 3997 BitmapInfo.bmiHead.biSize = sizeof(BITMAPINFOHEADER); … … 3628 4000 BitmapInfo.bmiHead.biPlanes = 1; 3629 4001 BitmapInfo.bmiHead.biBitCount = LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount; 4002 #else 4003 bmpSurface.bmType = 0; 4004 bmpSurface.bmWidth = LockedSurfaceDesc.dwWidth; 4005 bmpSurface.bmHeight = LockedSurfaceDesc.dwHeight; 4006 bmpSurface.bmWidthBytes = LockedSurfaceDesc.lPitch; 4007 bmpSurface.bmPlanes = 1; 4008 bmpSurface.bmBits = LockedSurfaceDesc.lpSurface; 4009 #endif 3630 4010 switch(LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount) 3631 4011 { 3632 4012 case 1: 3633 4013 case 4: 4014 WriteLog("1/4 Bit Not yet supported\n"); 4015 break; 3634 4016 case 8: 4017 #if 0 3635 4018 BitmapInfo.bmiHead.biCompression = BI_RGB; 3636 4019 GetSystemPaletteEntries(me->hdcImage,0,255,(PPALETTEENTRY)&BitmapInfo.bmiCols[0]); … … 3641 4024 (PBITMAPINFO)&BitmapInfo, 3642 4025 DIB_RGB_COLORS); 4026 #else 4027 bmpSurface.bmBitsPixel = 8; 4028 me->hbmImage = CreateBitmapIndirect( &bmpSurface); 4029 #endif 3643 4030 break; 3644 4031 case 16: 3645 4032 case 32: 3646 BitmapInfo.bmiHead.biCompression = BI_BITFIELDS; 3647 BitmapInfo.bmiHead.biClrUsed = 3; 3648 *((DWORD *) &(BitmapInfo.bmiCols[0])) = LockedSurfaceDesc.ddpfPixelFormat.dwRBitMask; 3649 *((DWORD *) &(BitmapInfo.bmiCols[1])) = LockedSurfaceDesc.ddpfPixelFormat.dwGBitMask; 3650 *((DWORD *) &(BitmapInfo.bmiCols[2])) = LockedSurfaceDesc.ddpfPixelFormat.dwBBitMask; 3651 me->hbmImage = CreateDIBitmap(me->hdcImage,NULL,CBM_CREATEDIB,LockedSurfaceDesc.lpSurface, 3652 (PBITMAPINFO)&BitmapInfo,DIB_RGB_COLORS); 4033 WriteLog("16/32 Bit not supported by OS/2"); 3653 4034 break; 3654 4035 case 24: 4036 #if 0 3655 4037 BitmapInfo.bmiHead.biCompression = BI_RGB; 3656 me->hbmImage = CreateDIBitmap(me->hdcImage,NULL,CBM_CREATEDIB,LockedSurfaceDesc.lpSurface, 3657 (PBITMAPINFO)&BitmapInfo,DIB_RGB_COLORS); 4038 me->hbmImage = CreateDIBitmap( me->hdcImage, 4039 NULL, 4040 CBM_CREATEDIB, 4041 LockedSurfaceDesc.lpSurface, 4042 (PBITMAPINFO)&BitmapInfo, 4043 DIB_RGB_COLORS); 4044 #else 4045 bmpSurface.bmBitsPixel = 24; 4046 me->hbmImage = CreateBitmapIndirect( &bmpSurface); 4047 #endif 3658 4048 break; 3659 4049 default: 3660 4050 #ifdef DEBUG 3661 WriteLog("Unexptected BitCount %d \n",LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount); 4051 WriteLog( "Unexptected BitCount %d \n", 4052 LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount); 3662 4053 #endif 3663 4054 me->hbmImage=NULL; … … 4066 4457 RGBQUAD bmiCols[256]; 4067 4458 } BitmapInfo; 4068 int i; 4459 BITMAP bmpData; 4460 char szError[256]; 4461 int i,rc; 4069 4462 4070 4463 #ifdef DEBUG … … 4075 4468 return(DDERR_INVALIDOBJECT); 4076 4469 4470 #if 1 4077 4471 //unselect our bitmap 4078 4472 SelectObject(me->hdcImage, me->hgdiOld); 4079 4080 4473 memset(&BitmapInfo,0, sizeof(BitmapInfo)); 4081 4474 BitmapInfo.bmiHead.biSize = sizeof(BITMAPINFOHEADER); … … 4083 4476 BitmapInfo.bmiHead.biHeight = me->DDSurfaceDesc.dwHeight; 4084 4477 BitmapInfo.bmiHead.biPlanes = 1; 4085 BitmapInfo.bmiHead.biBitCount = me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount;4478 BitmapInfo.bmiHead.biBitCount = 0; // me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount; 4086 4479 4087 4480 switch(me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount) … … 4091 4484 case 8: 4092 4485 BitmapInfo.bmiHead.biCompression = BI_RGB; 4093 GetSystemPaletteEntries(me->hdcImage,0,255,(PPALETTEENTRY)&BitmapInfo.bmiCols[0]); 4094 GetDIBits(hdc, me->hbmImage, 0, me->DDSurfaceDesc.dwHeight, 4486 //GetSystemPaletteEntries(me->hdcImage,0,255,(PPALETTEENTRY)&BitmapInfo.bmiCols[0]); 4487 rc = GetDIBits(hdc, me->hbmImage, 0, me->DDSurfaceDesc.dwHeight, 4488 NULL,(PBITMAPINFO)&BitmapInfo,DIB_PAL_COLORS); 4489 WriteLog( "GetDIBits rc=%d\n Size :%d\n Width :%d\n Height :%d\n" 4490 " Planes :%d\n BitCount :%d\nLastEror = %d\n", 4491 rc, 4492 BitmapInfo.bmiHead.biSize, 4493 BitmapInfo.bmiHead.biWidth, 4494 BitmapInfo.bmiHead.biHeight, 4495 BitmapInfo.bmiHead.biPlanes, 4496 BitmapInfo.bmiHead.biBitCount, 4497 GetLastError()); 4498 /* 4499 rc = GetDIBits(hdc, me->hbmImage, 0, me->DDSurfaceDesc.dwHeight, 4095 4500 me->DDSurfaceDesc.lpSurface,(PBITMAPINFO)&BitmapInfo,DIB_PAL_COLORS); 4501 WriteLog( "GetDIBits rc=%d\n LastEror = %d\n", 4502 rc, 4503 GetLastError()); 4504 */ 4096 4505 break; 4097 4506 case 16: … … 4117 4526 break; 4118 4527 } // end switch (me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount) 4119 4528 #else 4529 4530 rc = GetObjectA( me->hbmImage, 4531 sizeof(BITMAP), 4532 &bmpData); 4533 WriteLog( "GetObject returned rc=%d\n BitmapInfo:\n Size:(%dx%d)\n Pitch: %d\n Bits %d\n @mem %08X", 4534 rc, 4535 bmpData.bmWidth, bmpData.bmHeight, 4536 bmpData.bmWidthBytes, 4537 bmpData.bmBitsPixel, 4538 bmpData.bmBits); 4539 #endif 4120 4540 me->Vtbl.Unlock(me,NULL); 4121 4541 me->dwLastDCUnique = me->dwUniqueValue; // Store this to see if the surface was locked after we released the DC -
trunk/src/ddraw/ddraw.CPP
r522 r850 94 94 NULL); 95 95 96 WriteLog("Callback returned ");96 WriteLog("Callback returned\n"); 97 97 return rc; 98 98 }
Note:
See TracChangeset
for help on using the changeset viewer.