Changeset 5291 for trunk/src/ddraw/new/OS2SURFACE.CPP
- Timestamp:
- Mar 9, 2001, 11:48:48 PM (25 years ago)
- File:
-
- 1 edited
-
trunk/src/ddraw/new/OS2SURFACE.CPP (modified) (157 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ddraw/new/OS2SURFACE.CPP
r4326 r5291 1 /* $Id: OS2SURFACE.CPP,v 1. 2 2000-09-25 20:54:01mike Exp $ */1 /* $Id: OS2SURFACE.CPP,v 1.3 2001-03-09 22:48:48 mike Exp $ */ 2 2 3 3 /* 4 * Direct /XSurface class implementaion4 * DirectDraw Surface class implementaion 5 5 * 6 6 * Copyright 1999 Markus Montkowski 7 * Copyright 2000 Michal Necasek 7 8 * 8 9 * Project Odin Software License can be found in LICENSE.TXT … … 302 303 303 304 #define CBM_CREATEDIB 0x02L /* create DIB bitmap */ 305 304 306 #ifdef DEBUG 305 306 307 // ****************************************************************************** 307 308 // * internal helper functions from WINE … … 536 537 _dump_DDPIXELFORMAT(pf->dwFlags); 537 538 dprintf(("DDRAW: dwFourCC : %ld\n", pf->dwFourCC)); 538 dprintf(("DDRAW: RBG bit c bout : %ld\n", pf->dwRGBBitCount));539 dprintf(("DDRAW: RBG bit count : %ld\n", pf->dwRGBBitCount)); 539 540 dprintf(("DDRAW: Masks : R %08lx G %08lx B %08lx A %08lx\n", 540 541 pf->dwRBitMask, pf->dwGBitMask, pf->dwBBitMask, pf->dwRGBAlphaBitMask)); … … 559 560 560 561 { 561 ULONG rc; 562 DWORD i; 563 DIVE_CAPS dCaps; 562 DWORD rc; 564 563 DDSURFACEDESC2 ComplexSurfaceDesc; 565 OS2IDirectDrawSurface *AttachedSurface;566 564 OS2IDirectDrawSurface *MipMapSurface; 567 565 … … 721 719 if(NULL==DPA_SurfaceMipMaps) 722 720 { 723 #ifdef DEBUG 724 dprintf(("DDRAW: Internal : Error creating DPA for MipMaps\n")); 725 #endif 721 dprintf(("DDRAW: Internal : Error creating DPA for MipMaps\n")); 726 722 lastError = DDERR_OUTOFMEMORY ; 727 723 return; … … 747 743 if(NULL==DPA_SurfacePrivateData) 748 744 { 749 dprintf(("DDRAW: Internal : Error creating DPA for priva surface Data\n"));745 dprintf(("DDRAW: Internal : Error creating DPA for private surface Data\n")); 750 746 lastError = DDERR_OUTOFMEMORY ; 751 747 return; … … 778 774 break; 779 775 default: 780 dprintf(("DDRAW: Unsupported System ColorDe apth %d",lpDraw->dCaps.ulDepth));776 dprintf(("DDRAW: Unsupported System ColorDepth %d",lpDraw->dCaps.ulDepth)); 781 777 BltSolid = NULL; 782 778 ColorConv = NULL; … … 809 805 break; 810 806 default: 811 dprintf(("DDRAW: Unsupported System ColorDe apth %d",lpDraw->dCaps.ulDepth));807 dprintf(("DDRAW: Unsupported System ColorDepth %d",lpDraw->dCaps.ulDepth)); 812 808 BltSolid = NULL; 813 809 ColorConv = NULL; … … 840 836 break; 841 837 default: 842 dprintf(("DDRAW: Unsupported System ColorDe apth %d",lpDraw->dCaps.ulDepth));838 dprintf(("DDRAW: Unsupported System ColorDepth %d",lpDraw->dCaps.ulDepth)); 843 839 BltSolid = NULL; 844 840 ColorConv = NULL; … … 871 867 break; 872 868 default: 873 dprintf(("DDRAW: Unsupported System ColorDe apth %d",lpDraw->dCaps.ulDepth));869 dprintf(("DDRAW: Unsupported System ColorDepth %d",lpDraw->dCaps.ulDepth)); 874 870 BltSolid = NULL; 875 871 ColorConv = NULL; … … 879 875 break; 880 876 default: 881 dprintf(("DDRAW: Unsupported DX ColorDe apth %d",lpDraw->GetScreenBpp()));877 dprintf(("DDRAW: Unsupported DX ColorDepth %d",lpDraw->GetScreenBpp())); 882 878 BltSolid = NULL; 883 879 ColorConv = NULL; … … 896 892 if( surfaceType & DDSCAPS_PRIMARYSURFACE) 897 893 { 898 #ifdef DEBUG 899 dprintf(("DDRAW: Primary surface!\n")); 900 #endif 901 894 dprintf(("DDRAW: Primary surface!\n")); 902 895 if( lpDraw->HasPrimarySurface()) 903 896 { 904 #ifdef DEBUG 905 dprintf(("DDRAW: Primary surface already exits!\n")); 906 #endif 897 dprintf(("DDRAW: Primary surface already exits!\n")); 907 898 lastError = DDERR_PRIMARYSURFACEALREADYEXISTS; 908 899 return; … … 925 916 if( lpDraw->dCaps.ulDepth == lpDraw->GetScreenBpp() ) 926 917 { 927 dprintf(("DDRAW: Direct ScreenAccess possible\n"));918 dprintf(("DDRAW: Direct Screen Access possible\n")); 928 919 929 920 // Yes so direct access to framebuffer is possible … … 940 931 // and blit to the real framebuffer on Unlock to do color conversion 941 932 942 dprintf( ("Need Color convers ation %d => %d Bit\n",933 dprintf( ("Need Color conversion %d => %d Bit\n", 943 934 lpDraw->GetScreenBpp(), 944 935 lpDraw->dCaps.ulDepth … … 962 953 963 954 dprintf(("DDRAW: Setting up Surface\n")); 964 965 955 DDSurfaceDesc.dwFlags |= DDSD_WIDTH | DDSD_HEIGHT | 966 956 DDSD_PITCH | DDSD_LPSURFACE | … … 1056 1046 dprintf(("DDRAW: Unsupported Complex Surface\n")); 1057 1047 #ifdef DEBUG 1058 _dump_DDSCAPS(DDSurfaceDesc.dwFlags);1048 _dump_DDSCAPS(DDSurfaceDesc.dwFlags); 1059 1049 #endif 1060 1050 lastError = DDERR_OUTOFMEMORY; … … 1409 1399 { 1410 1400 1411 int i,FillWidth, FillHeight, Top, Left;1401 int FillWidth, FillHeight, Top, Left; 1412 1402 DWORD *pPal24; 1413 1403 WORD *pPal16; 1414 #ifdef DEBUG 1415 dprintf(("DDRAW: ColorFill with %08X\n", dwFillColor)); 1416 #endif 1404 dprintf(("DDRAW: ColorFill with %08X\n", dwFillColor)); 1417 1405 1418 1406 if(NULL!=lpDestRect) … … 1436 1424 //dprintf(("DDRAW: 0x%08X (%d/%d) at\n", pLine,FillWidth,FillHeight)); 1437 1425 1438 // Better safe th en sorry1439 if (FillHeight<=0)1426 // Better safe than sorry 1427 if (FillHeight <= 0) 1440 1428 return(DD_OK); 1441 1429 … … 1647 1635 break; 1648 1636 default: 1649 #ifdef DEBUG1650 1637 dprintf( ("Unexpected Screen Bitdepth %d\n", 1651 1638 lpDraw->dCaps.ulDepth)); 1652 #endif1653 1639 break; 1654 1640 } … … 1677 1663 OS2IDirectDrawSurface::~OS2IDirectDrawSurface() 1678 1664 { 1679 OS2IDirectDrawSurface *AttachedSurface;1680 1681 1665 1682 1666 if(DDSurfaceDesc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) … … 1755 1739 1756 1740 lpDraw->Vtbl.Release(lpDraw); 1757 1758 } 1741 } 1742 1759 1743 //****************************************************************************** 1760 1744 //****************************************************************************** … … 1794 1778 else 1795 1779 { 1796 dprintf(("DDRAW: We are o e of many buffers\n"));1780 dprintf(("DDRAW: We are one of many buffers\n")); 1797 1781 DDSurfaceDesc.ddsCaps.dwCaps &= ~DDSCAPS_BACKBUFFER ; 1798 1782 DDSurfaceDesc.ddsCaps.dwCaps |= DDSCAPS_FLIP; … … 1807 1791 //****************************************************************************** 1808 1792 //****************************************************************************** 1809 HRESULT __stdcallSurfQueryInterface(THIS This, REFIID riid, LPVOID FAR * ppvObj)1793 HRESULT WIN32API SurfQueryInterface(THIS This, REFIID riid, LPVOID FAR * ppvObj) 1810 1794 { 1811 1795 // ToDo: Add Interface handling for D3D Textures … … 1826 1810 if(IsEqualGUID(riid, IID_IDirectDrawSurface)) 1827 1811 { 1828 *ppvObj = &me-> Vtbl2; // ToDo DO a real V1 table1812 *ppvObj = &me->lpVtbl; // ToDo DO a real V1 table 1829 1813 rc = DD_OK; 1830 1814 goto RetFn; … … 1832 1816 if(IsEqualGUID(riid, IID_IDirectDrawSurface2)) 1833 1817 { 1834 *ppvObj = &me-> Vtbl2;1818 *ppvObj = &me->lpVtbl2; 1835 1819 rc = DD_OK; 1836 1820 goto RetFn; … … 1859 1843 //****************************************************************************** 1860 1844 //****************************************************************************** 1861 ULONG __stdcallSurfAddRef(THIS This)1845 ULONG WIN32API SurfAddRef(THIS This) 1862 1846 { 1863 1847 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 1864 1848 1865 #ifdef DEBUG 1866 dprintf(("DDRAW: OS2IDirectDrawSurface::SurfAddRef %d\n", me->Referenced+1)); 1867 #endif 1849 dprintf(("DDRAW: OS2IDirectDrawSurface::SurfAddRef %d\n", me->Referenced+1)); 1868 1850 1869 1851 return ++me->Referenced; … … 1871 1853 //****************************************************************************** 1872 1854 //****************************************************************************** 1873 ULONG __stdcallSurfRelease(THIS This)1855 ULONG WIN32API SurfRelease(THIS This) 1874 1856 { 1875 1857 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 1876 1858 1877 #ifdef DEBUG 1878 dprintf(("DDRAW: OS2IDirectDrawSurface::SurfRelease %d\n", me->Referenced-1)); 1879 dprintf(("DDRAW: OS2IDirectDrawSurface::Surface %X\n", me)); 1880 #endif 1859 dprintf(("DDRAW: OS2IDirectDrawSurface::SurfRelease %d\n", me->Referenced-1)); 1860 dprintf(("DDRAW: OS2IDirectDrawSurface::Surface %X\n", me)); 1881 1861 if(me->Referenced) 1882 1862 { … … 1898 1878 //****************************************************************************** 1899 1879 //****************************************************************************** 1900 HRESULT __stdcall SurfAddAttachedSurface(THIS This, LPDIRECTDRAWSURFACE2 lpDDSurface) 1901 { 1902 1903 #ifdef DEBUG 1904 dprintf(("DDRAW: SurfAddAttachedSurface\n")); 1905 #endif 1880 HRESULT WIN32API SurfAddAttachedSurface(THIS This, LPDIRECTDRAWSURFACE2 lpDDSurface) 1881 { 1882 1883 dprintf(("DDRAW: SurfAddAttachedSurface\n")); 1906 1884 return SurfAddAttachedSurface4(This, (LPDIRECTDRAWSURFACE4)lpDDSurface); 1907 1885 } 1908 1886 //****************************************************************************** 1909 1887 //****************************************************************************** 1910 HRESULT __stdcall SurfAddAttachedSurface3(THIS This, LPDIRECTDRAWSURFACE3 lpDDSurface) 1911 { 1912 1913 #ifdef DEBUG 1914 dprintf(("DDRAW: SurfAddAttachedSurface\n")); 1915 #endif 1888 HRESULT WIN32API SurfAddAttachedSurface3(THIS This, LPDIRECTDRAWSURFACE3 lpDDSurface) 1889 { 1890 1891 dprintf(("DDRAW: SurfAddAttachedSurface\n")); 1916 1892 return SurfAddAttachedSurface4(This, (LPDIRECTDRAWSURFACE4)lpDDSurface); 1917 1893 } 1918 1894 //****************************************************************************** 1919 1895 //****************************************************************************** 1920 HRESULT __stdcallSurfAddAttachedSurface4(THIS This, LPDIRECTDRAWSURFACE4 lpDDSurface)1896 HRESULT WIN32API SurfAddAttachedSurface4(THIS This, LPDIRECTDRAWSURFACE4 lpDDSurface) 1921 1897 { 1922 1898 OS2IDirectDrawSurface *AttachedSurface; … … 1925 1901 int rc; 1926 1902 1927 #ifdef DEBUG 1928 dprintf(("DDRAW: SurfAddAttachedSurface4\n")); 1929 #endif 1903 dprintf(("DDRAW: SurfAddAttachedSurface4\n")); 1930 1904 1931 1905 if (NULL==lpDDSurface) … … 1936 1910 if(AttachedSurface->IsImplicitSurface()) 1937 1911 { 1938 #ifdef DEBUG 1939 dprintf(("DDRAW: Internal : Can't attach an implicit created surface to an other surface\n")); 1940 #endif 1912 dprintf(("DDRAW: Internal : Can't attach an implicitly created surface to another surface\n")); 1941 1913 return(DDERR_CANNOTATTACHSURFACE); 1942 1914 } … … 1944 1916 if(This == AttachedSurface) 1945 1917 { 1946 #ifdef DEBUG 1947 dprintf(("DDRAW: Can't attach an surface to itself\n")); 1948 #endif 1918 dprintf(("DDRAW: Can't attach a surface to itself\n")); 1949 1919 return(DDERR_CANNOTATTACHSURFACE); 1950 1920 } … … 1969 1939 else 1970 1940 { 1971 #ifdef DEBUG 1972 dprintf(("DDRAW: Internal : Error attaching to MipMap\n")); 1973 #endif 1941 dprintf(("DDRAW: Internal : Error attaching to MipMap\n")); 1974 1942 return(DDERR_CANNOTATTACHSURFACE); 1975 1943 } … … 1977 1945 else 1978 1946 { 1979 #ifdef DEBUG 1980 dprintf(("DDRAW: Target Surface isn't a MipMap\n")); 1981 #endif 1947 dprintf(("DDRAW: Target Surface isn't a MipMap\n")); 1982 1948 return(DDERR_CANNOTATTACHSURFACE); 1983 1949 } … … 1995 1961 else 1996 1962 { 1997 #ifdef DEBUG 1998 dprintf(("DDRAW: Internal : Error attaching to general Set\n")); 1999 #endif 1963 dprintf(("DDRAW: Internal : Error attaching to general Set\n")); 2000 1964 return(DDERR_CANNOTATTACHSURFACE); 2001 1965 } … … 2010 1974 ) 2011 1975 { 2012 #ifdef DEBUG 2013 dprintf(("DDRAW: Surfaces don't have same dimensions\n")); 2014 #endif 1976 dprintf(("DDRAW: Surfaces don't have equal dimensions\n")); 2015 1977 return(DDERR_CANNOTATTACHSURFACE); 2016 1978 } … … 2021 1983 if( (AttachedSurface->GetFrontBuffer()!=NULL) || (AttachedSurface->BackBuffer!= NULL)) 2022 1984 { 2023 #ifdef DEBUG 2024 dprintf(("DDRAW: Surfaces already has a front/backbuffer\n")); 2025 #endif 1985 dprintf(("DDRAW: Surface already has a front/backbuffer\n")); 2026 1986 return(DDERR_SURFACEALREADYATTACHED); 2027 1987 } … … 2056 2016 else 2057 2017 { 2058 #ifdef DEBUG 2059 dprintf(("DDRAW: Can't attach backbuffer to anything but a frontbuffer\n")); 2060 #endif 2061 return(DDERR_CANNOTATTACHSURFACE); 2018 dprintf(("DDRAW: Can't attach backbuffer to anything but a frontbuffer\n")); 2019 return(DDERR_CANNOTATTACHSURFACE); 2062 2020 } 2063 2021 } … … 2080 2038 else 2081 2039 { 2082 #ifdef DEBUG 2083 dprintf(("DDRAW: Internal : Error attaching to MipMap\n")); 2084 #endif 2040 dprintf(("DDRAW: Internal : Error attaching to MipMap\n")); 2085 2041 return(DDERR_CANNOTATTACHSURFACE); 2086 2042 } … … 2088 2044 else 2089 2045 { 2090 #ifdef DEBUG 2091 dprintf(("DDRAW: Tagget Surface isn't a MipMap\n")); 2092 #endif 2046 dprintf(("DDRAW: Target Surface isn't a MipMap\n")); 2093 2047 return(DDERR_CANNOTATTACHSURFACE); 2094 2048 } … … 2104 2058 else 2105 2059 { 2106 #ifdef DEBUG 2107 dprintf(("DDRAW: Internal : Error attaching to general Set\n")); 2108 #endif 2060 dprintf(("DDRAW: Internal : Error attaching to general Set\n")); 2109 2061 return(DDERR_CANNOTATTACHSURFACE); 2110 2062 } … … 2118 2070 //****************************************************************************** 2119 2071 //****************************************************************************** 2120 HRESULT __stdcall SurfAddOverlayDirtyRect(THIS, LPRECT) 2121 { 2122 #ifdef DEBUG 2123 dprintf(("DDRAW: SurfAddOverlayDirtyRect Not implemented by M$ in V 6.0! \n")); 2124 #endif 2072 HRESULT WIN32API SurfAddOverlayDirtyRect(THIS, LPRECT) 2073 { 2074 dprintf(("DDRAW: SurfAddOverlayDirtyRect Not implemented by M$ in DX 6.0!\n")); 2125 2075 2126 2076 return(DD_OK); … … 2128 2078 //****************************************************************************** 2129 2079 //****************************************************************************** 2130 HRESULT __stdcallSurfBlt(THIS This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE2 lpDDSrcSurface,2080 HRESULT WIN32API SurfBlt(THIS This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, 2131 2081 LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) 2132 2082 { … … 2140 2090 //****************************************************************************** 2141 2091 //****************************************************************************** 2142 HRESULT __stdcallSurfBlt3(THIS This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE3 lpDDSrcSurface,2092 HRESULT WIN32API SurfBlt3(THIS This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, 2143 2093 LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) 2144 2094 { … … 2152 2102 //****************************************************************************** 2153 2103 //****************************************************************************** 2154 HRESULT __stdcallSurfBlt4(THIS This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE4 lpDDSrcSurface,2104 HRESULT WIN32API SurfBlt4(THIS This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, 2155 2105 LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) 2156 2106 { … … 2170 2120 OS2IDirectDrawSurface *src = (OS2IDirectDrawSurface *)lpDDSrcSurface; 2171 2121 2172 HRESULT rc; 2173 ULONG ulColor, *pColor; 2174 RECTL cliprect; 2175 2176 int x, y, i, j, BlitWidth, BlitHeight; 2122 int x, i, BlitWidth, BlitHeight; 2177 2123 PALETTEENTRY SysPal[257]; 2178 2124 PLOGPALETTE pLogPal = (PLOGPALETTE) SysPal; … … 2185 2131 2186 2132 #ifdef DEBUG 2187 dprintf(("DDRAW: SurfBlt4 To Surf %08X, from Surf %08X , flags %08X", dest, src, dwFlags));2133 dprintf(("DDRAW: SurfBlt4 To Surf %08X, from Surf %08X\n",dest,src)); 2188 2134 if ( (NULL!=lpDestRect)&& (NULL!=lpSrcRect)) 2189 2135 dprintf(("DDRAW: SurfBlt4 to (%d,%d)(%d,%d) at %08X from (%d,%d)(%d,%d) at %08X\n", lpDestRect->left, lpDestRect->top, … … 2289 2235 { 2290 2236 delete pIRectDest; 2291 dprintf(("DDRAW: Blt: Dest Surface part ly locked\n"));2237 dprintf(("DDRAW: Blt: Dest Surface partially locked\n")); 2292 2238 return(DDERR_SURFACEBUSY); 2293 2239 } … … 2474 2420 } 2475 2421 } 2476 /* 2422 2477 2423 if( ( (NULL==lpDestRect) && (NULL!=lpSrcRect) ) || 2478 2424 ( (NULL==lpSrcRect) && (NULL!=lpDestRect) ) ) 2479 2425 { 2480 dprintf(("DDRAW: Blitting with scal eing\n Not supported.\n"));2481 2482 return DDERR_NOSTRETCHHW;2426 dprintf(("DDRAW: Blitting with scaling\n Not supported.\n")); 2427 2428 // return DDERR_NOSTRETCHHW; 2483 2429 } 2484 2430 … … 2492 2438 return DDERR_NOSTRETCHHW; 2493 2439 } 2494 */ 2440 2495 2441 if (dest->DDSurfaceDesc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) 2496 2442 { … … 2593 2539 { 2594 2540 // copy from the screen to a buffer 2595 dprintf(("DDRAW: Screen to buffer"));2596 2541 2597 2542 if( (NULL==lpDestRect) && … … 2659 2604 { 2660 2605 // DIVE => DIVE or Mem => Dive can be handelt in the same way 2661 dprintf(("DDRAW: Buffer to screen"));2662 2606 2663 2607 if( (src->pDiveBuffer == dest->pDiveBuffer) && … … 2725 2669 { 2726 2670 DWORD dwFx; 2727 DWORD dwSrcColor, dwDestColor;2728 2671 2729 2672 dwFlags &= ~DDBLT_DDFX; // remove the handled flag … … 3189 3132 //****************************************************************************** 3190 3133 //****************************************************************************** 3191 HRESULT __stdcall SurfBltBatch(THIS, LPDDBLTBATCH, DWORD, DWORD ) 3192 { 3193 #ifdef DEBUG 3194 dprintf(("DDRAW: SurfBltBatch Not implemented by M$\n")); 3195 #endif 3134 HRESULT WIN32API SurfBltBatch(THIS, LPDDBLTBATCH, DWORD, DWORD ) 3135 { 3136 dprintf(("DDRAW: SurfBltBatch Not implemented by M$\n")); 3196 3137 3197 3138 return(DD_OK); … … 3199 3140 //****************************************************************************** 3200 3141 //****************************************************************************** 3201 HRESULT __stdcallSurfBltFast( THIS This ,3142 HRESULT WIN32API SurfBltFast( THIS This , 3202 3143 DWORD dwX, 3203 3144 DWORD dwY, … … 3216 3157 //****************************************************************************** 3217 3158 //****************************************************************************** 3218 HRESULT __stdcallSurfBltFast3(THIS This ,3159 HRESULT WIN32API SurfBltFast3(THIS This , 3219 3160 DWORD dwX, 3220 3161 DWORD dwY, … … 3233 3174 //****************************************************************************** 3234 3175 //****************************************************************************** 3235 HRESULT __stdcallSurfBltFast4( THIS This,3176 HRESULT WIN32API SurfBltFast4( THIS This, 3236 3177 DWORD dwX, 3237 3178 DWORD dwY, … … 3244 3185 RECTL SrcRect; 3245 3186 char *pBltPos, *pSrcPos; 3246 DWORD dwDestColor, dwSrcColor, BlitWidth, BlitHeight, x,y;3187 DWORD dwDestColor, dwSrcColor, BlitWidth, BlitHeight, x; 3247 3188 3248 3189 dprintf(("DDRAW: SurfBltFast4 %08X at(%d/%d) onto %08X with flags %08X\n",src, dwX,dwY, dest, dwTrans)); 3249 3190 3250 if( (NULL ==lpDDSrcSurface) ||3251 ( dwX<0) || (dwY<0) ||3252 (dwX >dest->width) ||3253 (dwY >dest->height))3191 if( (NULL == lpDDSrcSurface) || 3192 ((LONG)dwX < 0) || ((LONG)dwY < 0) || 3193 (dwX > dest->width) || 3194 (dwY > dest->height)) 3254 3195 { 3255 3196 dprintf(("DDRAW: Invalid Parameters %08X, %d %d", lpDDSrcSurface ,dest->width , dest->height)); … … 3257 3198 } 3258 3199 3259 if (NULL !=lpSrcRect)3200 if (NULL != lpSrcRect) 3260 3201 { 3261 3202 memcpy(&SrcRect,lpSrcRect,sizeof(RECTL) ); … … 3285 3226 if(DDBLTFAST_NOCOLORKEY == dwTrans ) 3286 3227 { 3287 dprintf(( "Solid Blit, %d pels wide=> %d bytes per line\n",3228 dprintf(( "Solid Blit, %d bits => %d bytes per line\n", 3288 3229 (SrcRect.right - SrcRect.left), 3289 3230 BlitWidth) ); 3290 3231 #ifdef USE_ASM 3291 3232 BltRec(pBltPos, pSrcPos, BlitWidth, BlitHeight, 3292 dest->dwPitchDB, src->dwPitchDB); 3233 dest->dwPitchDB, 3234 src->dwPitchDB); 3293 3235 #else 3294 3236 // Solid Blit 3295 3237 while(1) 3296 3238 { 3297 memcpy(pBltPos, pSrcPos,BlitWidth);3239 memcpy(pBltPos,pSrcPos,BlitWidth); 3298 3240 pBltPos += dest->dwPitchDB; 3299 3241 pSrcPos += src->dwPitchDB; … … 3308 3250 dprintf(("DDRAW: TransBlit\n")); 3309 3251 3310 if (dwTrans & DDBLTFAST_SRCCOLORKEY)3252 if(dwTrans & DDBLTFAST_SRCCOLORKEY) 3311 3253 { 3312 3254 dprintf(("DDRAW: Trans SRC\n")); … … 3416 3358 { 3417 3359 case 1: 3418 if (CPUHasMMX())3419 while (BlitHeight--)3360 if (CPUHasMMX()) 3361 while (BlitHeight--) 3420 3362 { 3421 3363 BlitColorKey8MMX((PBYTE)pBltPos,(PBYTE)pSrcPos,dwSrcColor,BlitWidth); … … 3424 3366 } 3425 3367 else 3426 while (BlitHeight--)3368 while (BlitHeight--) 3427 3369 { 3428 3370 BlitColorKey8((PBYTE)pBltPos,(PBYTE)pSrcPos,dwSrcColor,BlitWidth); … … 3433 3375 case 2: 3434 3376 3435 if (CPUHasMMX())3377 if (CPUHasMMX()) 3436 3378 while(BlitHeight--) 3437 3379 { … … 3481 3423 else 3482 3424 { 3483 if (dwTrans & DDBLTFAST_DESTCOLORKEY)3425 if (dwTrans & DDBLTFAST_DESTCOLORKEY) 3484 3426 { 3485 3427 dprintf(("DDRAW: DestColorKey\n")); … … 3571 3513 // dest->Vtbl4->ChangeUniquenessValue(dest); 3572 3514 3573 return(DD_OK); 3574 } 3575 3576 //****************************************************************************** 3577 //****************************************************************************** 3578 HRESULT __stdcall SurfDeleteAttachedSurface(THIS This, DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSurface) 3515 return DD_OK; 3516 } 3517 //****************************************************************************** 3518 //****************************************************************************** 3519 HRESULT WIN32API SurfDeleteAttachedSurface(THIS This, DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSurface) 3579 3520 { 3580 3521 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 3583 3524 return(SurfDeleteAttachedSurface4(me, dwFlags, (LPDIRECTDRAWSURFACE4)lpDDSurface)); 3584 3525 } 3585 3586 //****************************************************************************** 3587 //****************************************************************************** 3588 HRESULT __stdcall SurfDeleteAttachedSurface3(THIS This, DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSurface) 3526 //****************************************************************************** 3527 //****************************************************************************** 3528 HRESULT WIN32API SurfDeleteAttachedSurface3(THIS This, DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSurface) 3589 3529 { 3590 3530 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 3591 #ifdef DEBUG 3592 dprintf(("DDRAW: SurfDeleteAttachedSurface\n")); 3593 #endif 3531 dprintf(("DDRAW: SurfDeleteAttachedSurface\n")); 3594 3532 3595 3533 return(SurfDeleteAttachedSurface4(me, dwFlags, (LPDIRECTDRAWSURFACE4)lpDDSurface)); … … 3597 3535 //****************************************************************************** 3598 3536 //****************************************************************************** 3599 HRESULT __stdcallSurfDeleteAttachedSurface4(THIS This, DWORD dwFlags , LPDIRECTDRAWSURFACE4 lpDDSurface)3537 HRESULT WIN32API SurfDeleteAttachedSurface4(THIS This, DWORD dwFlags , LPDIRECTDRAWSURFACE4 lpDDSurface) 3600 3538 { 3601 3539 … … 3606 3544 3607 3545 BOOL Found = FALSE; 3608 #ifdef DEBUG 3609 dprintf(("DDRAW: SurfDeleteAttachedSurface\n")); 3610 #endif 3546 dprintf(("DDRAW: SurfDeleteAttachedSurface\n")); 3611 3547 3612 3548 if((0!=dwFlags)||(NULL==lpDDSurface)) … … 3745 3681 //****************************************************************************** 3746 3682 //****************************************************************************** 3747 HRESULT __stdcallSurfEnumAttachedSurfaces(THIS This, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpCallBack)3683 HRESULT WIN32API SurfEnumAttachedSurfaces(THIS This, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpCallBack) 3748 3684 { 3749 3685 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 3750 #ifdef DEBUG 3751 dprintf(("DDRAW: SurfEnumAttachedSurfaces\n")); 3752 #endif 3686 dprintf(("DDRAW: SurfEnumAttachedSurfaces\n")); 3753 3687 3754 3688 return(SurfEnumAttachedSurfaces4(me,lpContext, (LPDDENUMSURFACESCALLBACK2) lpCallBack)); … … 3756 3690 //****************************************************************************** 3757 3691 //****************************************************************************** 3758 HRESULT __stdcallSurfEnumAttachedSurfaces4(THIS This, LPVOID lpContext ,LPDDENUMSURFACESCALLBACK2 lpCallBack)3692 HRESULT WIN32API SurfEnumAttachedSurfaces4(THIS This, LPVOID lpContext ,LPDDENUMSURFACESCALLBACK2 lpCallBack) 3759 3693 { 3760 3694 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 3764 3698 HRESULT rc; 3765 3699 3766 #ifdef DEBUG 3767 dprintf(("DDRAW: SurfEnumAttachedSurfaces\n")); 3768 #endif 3700 dprintf(("DDRAW: SurfEnumAttachedSurfaces\n")); 3769 3701 if (NULL==lpCallBack) 3770 3702 return (DDERR_INVALIDPARAMS); … … 3816 3748 //****************************************************************************** 3817 3749 //****************************************************************************** 3818 HRESULT __stdcallSurfEnumOverlayZOrders(THIS, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK)3750 HRESULT WIN32API SurfEnumOverlayZOrders(THIS, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) 3819 3751 { 3820 3752 dprintf(("DDRAW: SurfEnumOverlayZOrders\n")); … … 3824 3756 //****************************************************************************** 3825 3757 //****************************************************************************** 3826 HRESULT __stdcallSurfEnumOverlayZOrders4(THIS, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK2)3758 HRESULT WIN32API SurfEnumOverlayZOrders4(THIS, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK2) 3827 3759 { 3828 3760 dprintf(("DDRAW: SurfEnumOverlayZOrders\n")); … … 3832 3764 //****************************************************************************** 3833 3765 //****************************************************************************** 3834 HRESULT __stdcallSurfFlip(THIS This, LPDIRECTDRAWSURFACE2 lpDDSurf, DWORD dwFlags)3766 HRESULT WIN32API SurfFlip(THIS This, LPDIRECTDRAWSURFACE2 lpDDSurf, DWORD dwFlags) 3835 3767 { 3836 3768 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 3842 3774 //****************************************************************************** 3843 3775 //****************************************************************************** 3844 HRESULT __stdcallSurfFlip3(THIS This, LPDIRECTDRAWSURFACE3 lpDDSurf, DWORD dwFlags)3776 HRESULT WIN32API SurfFlip3(THIS This, LPDIRECTDRAWSURFACE3 lpDDSurf, DWORD dwFlags) 3845 3777 { 3846 3778 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 3852 3784 //****************************************************************************** 3853 3785 //****************************************************************************** 3854 HRESULT __stdcallSurfFlip4(THIS This, LPDIRECTDRAWSURFACE4 lpDDSurf, DWORD dwFlags)3786 HRESULT WIN32API SurfFlip4(THIS This, LPDIRECTDRAWSURFACE4 lpDDSurf, DWORD dwFlags) 3855 3787 { 3856 3788 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 3859 3791 LPVOID Data; 3860 3792 char *pcrFB,*pcFB,*pcrDB,*pcDB; 3861 ULONG rc;3862 3793 3863 3794 dprintf(("DDRAW: SurfFlip4\n")); … … 3907 3838 } 3908 3839 3909 if (-1 != me->diveBufNr)3840 if (-1 != me->diveBufNr) 3910 3841 { 3911 3842 //dprintf(("DDRAW: DIVE Flipchain DiveBuffer #%d",FlipSurface->diveBufNr)); … … 3934 3865 else 3935 3866 { 3936 #ifdef DEBUG 3937 dprintf(("DDRAW: Memory Flipchain")); 3938 #endif 3867 dprintf(("DDRAW: Memory Flipchain")); 3939 3868 // Memory Flipchain 3940 3869 // … … 3960 3889 me->pDiveBuffer = FlipSurface->pDiveBuffer; 3961 3890 3962 if (NULL==lpDDSurf)3963 { 3964 while (NULL!=FlipSurface->BackBuffer)3891 if (NULL==lpDDSurf) 3892 { 3893 while (NULL!=FlipSurface->BackBuffer) 3965 3894 { 3966 3895 FlipSurface->DDSurfaceDesc.lpSurface = FlipSurface->BackBuffer->DDSurfaceDesc.lpSurface; … … 3979 3908 } 3980 3909 3981 return(DD_OK); 3982 } 3983 //****************************************************************************** 3984 //****************************************************************************** 3985 HRESULT __stdcall SurfGetAttachedSurface(THIS This, LPDDSCAPS lpDDCaps, 3910 return DD_OK; 3911 } 3912 3913 //****************************************************************************** 3914 //****************************************************************************** 3915 HRESULT WIN32API SurfGetAttachedSurface(THIS This, LPDDSCAPS lpDDCaps, 3986 3916 LPDIRECTDRAWSURFACE2 FAR * lpDDSurf) 3987 3917 { 3988 3918 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 3989 #ifdef DEBUG 3990 dprintf(("DDRAW: SurfGetAttachedSurface\n")); 3991 #endif 3919 dprintf(("DDRAW: SurfGetAttachedSurface\n")); 3992 3920 3993 3921 return(SurfGetAttachedSurface4(me, (LPDDSCAPS2)lpDDCaps , (LPDIRECTDRAWSURFACE4*)lpDDSurf)); … … 3995 3923 //****************************************************************************** 3996 3924 //****************************************************************************** 3997 HRESULT __stdcallSurfGetAttachedSurface3(THIS This, LPDDSCAPS lpDDCaps,3925 HRESULT WIN32API SurfGetAttachedSurface3(THIS This, LPDDSCAPS lpDDCaps, 3998 3926 LPDIRECTDRAWSURFACE3 FAR * lpDDSurf) 3999 3927 { 4000 3928 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4001 #ifdef DEBUG 4002 dprintf(("DDRAW: SurfGetAttachedSurface3\n")); 4003 #endif 3929 dprintf(("DDRAW: SurfGetAttachedSurface3\n")); 4004 3930 4005 3931 return(SurfGetAttachedSurface4(me, (LPDDSCAPS2)lpDDCaps , (LPDIRECTDRAWSURFACE4*)lpDDSurf)); … … 4007 3933 //****************************************************************************** 4008 3934 //****************************************************************************** 4009 HRESULT __stdcallSurfGetAttachedSurface4(THIS This, LPDDSCAPS2 lpDDCaps,3935 HRESULT WIN32API SurfGetAttachedSurface4(THIS This, LPDDSCAPS2 lpDDCaps, 4010 3936 LPDIRECTDRAWSURFACE4 FAR * lpDDSurf) 4011 3937 { … … 4094 4020 //****************************************************************************** 4095 4021 //****************************************************************************** 4096 HRESULT __stdcall SurfGetBltStatus(THIS This, DWORD) 4097 { 4098 #ifdef DEBUG 4099 dprintf(("DDRAW: SurfGetBltStatus\n")); 4100 #endif 4022 HRESULT WIN32API SurfGetBltStatus(THIS This, DWORD) 4023 { 4024 dprintf(("DDRAW: SurfGetBltStatus\n")); 4101 4025 4102 4026 return(DD_OK); … … 4104 4028 //****************************************************************************** 4105 4029 //****************************************************************************** 4106 HRESULT __stdcallSurfGetCaps(THIS This, LPDDSCAPS lpDDCaps)4030 HRESULT WIN32API SurfGetCaps(THIS This, LPDDSCAPS lpDDCaps) 4107 4031 { 4108 4032 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4109 4033 4110 #ifdef DEBUG 4111 dprintf(("DDRAW: SurfGetCaps\n")); 4112 #endif 4034 dprintf(("DDRAW: SurfGetCaps\n")); 4113 4035 4114 4036 if(NULL==lpDDCaps) … … 4123 4045 //****************************************************************************** 4124 4046 //****************************************************************************** 4125 HRESULT __stdcallSurfGetCaps4(THIS This, LPDDSCAPS2 lpDDCaps)4047 HRESULT WIN32API SurfGetCaps4(THIS This, LPDDSCAPS2 lpDDCaps) 4126 4048 { 4127 4049 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4128 #ifdef DEBUG 4129 dprintf(("DDRAW: SurfGetCaps4\n")); 4130 #endif 4050 dprintf(("DDRAW: SurfGetCaps4\n")); 4131 4051 4132 4052 if(NULL==lpDDCaps) … … 4137 4057 _dump_DDSCAPS(lpDDCaps->dwCaps); 4138 4058 _dump_DDSCAPS2(lpDDCaps->dwCaps2); 4139 4140 4059 #endif 4141 4060 … … 4144 4063 //****************************************************************************** 4145 4064 //****************************************************************************** 4146 HRESULT __stdcallSurfGetClipper(THIS This, LPDIRECTDRAWCLIPPER FAR *lplpClipper)4065 HRESULT WIN32API SurfGetClipper(THIS This, LPDIRECTDRAWCLIPPER FAR *lplpClipper) 4147 4066 { 4148 4067 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4149 4068 4150 #ifdef DEBUG 4151 dprintf(("DDRAW: SurfGetClipper\n")); 4152 #endif 4069 dprintf(("DDRAW: SurfGetClipper\n")); 4153 4070 4154 4071 if(me->lpClipper) … … 4162 4079 //****************************************************************************** 4163 4080 //****************************************************************************** 4164 HRESULT __stdcallSurfGetColorKey(THIS This, DWORD dwFlags, LPDDCOLORKEY lpDDColKey)4081 HRESULT WIN32API SurfGetColorKey(THIS This, DWORD dwFlags, LPDDCOLORKEY lpDDColKey) 4165 4082 { 4166 4083 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4167 4168 #ifdef DEBUG4169 4084 dprintf(("DDRAW: SurfGetColorKey\n")); 4170 #endif4171 4085 4172 4086 if ((0==dwFlags) || (NULL==lpDDColKey)) … … 4193 4107 //****************************************************************************** 4194 4108 //****************************************************************************** 4195 HRESULT __stdcallSurfGetDC(THIS This, HDC FAR *hdc)4109 HRESULT WIN32API SurfGetDC(THIS This, HDC FAR *hdc) 4196 4110 { 4197 4111 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4198 4112 DDSURFACEDESC2 LockedSurfaceDesc; 4199 HRESULT rc; 4113 HRESULT rc; 4114 BITMAPINFOHEADER bmihHdr; 4200 4115 BITMAP bmpSurface; 4201 4116 struct … … 4205 4120 } BitmapInfo; 4206 4121 4207 #ifdef DEBUG 4208 dprintf(("DDRAW: SurfGetDC\n")); 4209 #endif 4210 4211 if (NULL==hdc) 4122 dprintf(("DDRAW: SurfGetDC\n")); 4123 4124 if (hdc == NULL) 4212 4125 return(DDERR_INVALIDPARAMS); 4213 4126 … … 4227 4140 if(me->hdcImage == NULL) 4228 4141 { 4229 #ifdef DEBUG 4230 dprintf(("DDRAW: Can't create compatible DC!\n")); 4231 #endif 4142 dprintf(("DDRAW: Can't create compatible DC!\n")); 4232 4143 me->Vtbl.Unlock(me,NULL); 4233 4144 rc = DDERR_GENERIC; 4234 4145 } 4235 InverseDC(me->hdcImage, LockedSurfaceDesc.dwHeight);4236 } 4237 4238 if( (DD_OK==rc) &&4239 (me->hbmImage == NULL) )4240 { 4146 } 4147 4148 if( (DD_OK==rc) && (me->hbmImage == NULL) ) 4149 { 4150 OS2IDirectDrawPalette *ddpal = NULL; 4151 4241 4152 dprintf( ("Trying to create Bitmap (%d/%d) at %d Bit\n", 4242 LockedSurfaceDesc. lPitch/ (LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount>>3),4153 LockedSurfaceDesc.dwWidth, 4243 4154 LockedSurfaceDesc.dwHeight, 4244 4155 LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount 4245 4156 )); 4246 #if 04157 #if 1 4247 4158 memset(&BitmapInfo, 0, sizeof(BitmapInfo)); 4248 BitmapInfo.bmiHead.biSize = sizeof(BITMAPINFOHEADER); 4249 BitmapInfo.bmiHead.biWidth = LockedSurfaceDesc.lPitch/ (LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount>>3); 4250 BitmapInfo.bmiHead.biHeight = LockedSurfaceDesc.dwHeight; 4251 BitmapInfo.bmiHead.biPlanes = 1; 4252 BitmapInfo.bmiHead.biBitCount = LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount; 4159 BitmapInfo.bmiHead.biSize = sizeof(BITMAPINFOHEADER); 4160 BitmapInfo.bmiHead.biWidth = LockedSurfaceDesc.dwWidth; 4161 BitmapInfo.bmiHead.biHeight = LockedSurfaceDesc.dwHeight; 4162 BitmapInfo.bmiHead.biPlanes = 1; 4163 BitmapInfo.bmiHead.biBitCount = (WORD)LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount; 4164 memset(&bmihHdr, 0, sizeof(bmihHdr)); 4165 bmihHdr.biSize = sizeof(BITMAPINFOHEADER); 4166 bmihHdr.biWidth = LockedSurfaceDesc.dwWidth; 4167 bmihHdr.biHeight = LockedSurfaceDesc.dwHeight; 4168 bmihHdr.biPlanes = 1; 4169 bmihHdr.biBitCount = (WORD)LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount; 4253 4170 #else 4254 4171 bmpSurface.bmType = 0; … … 4266 4183 break; 4267 4184 case 8: 4268 #if 04185 #if 1 4269 4186 BitmapInfo.bmiHead.biCompression = BI_RGB; 4270 GetSystemPaletteEntries(me->hdcImage,0,255,(PPALETTEENTRY)&BitmapInfo.bmiCols[0]); 4187 if (me->lpPalette != NULL) 4188 ddpal = me->lpPalette; 4189 if ((me->FrontBuffer != NULL) && (me->FrontBuffer->lpPalette != NULL)) 4190 ddpal = me->FrontBuffer->lpPalette; 4191 if (ddpal != NULL) { 4192 ddpal->Vtbl.GetEntries((IDirectDrawPalette*)ddpal, 4193 0, 0, 256, (PPALETTEENTRY)&BitmapInfo.bmiCols[0]); 4194 } 4195 else { 4196 dprintf(("DDRAW: Using default palette\n")); 4197 for (DWORD i = 0; i < 256; i++) { 4198 BitmapInfo.bmiCols[i].rgbBlue = DefaultPalette[i*3+2]; 4199 BitmapInfo.bmiCols[i].rgbGreen = DefaultPalette[i*3+1]; 4200 BitmapInfo.bmiCols[i].rgbRed = DefaultPalette[i*3]; 4201 BitmapInfo.bmiCols[i].rgbReserved = 0; 4202 } 4203 } 4271 4204 me->hbmImage = CreateDIBitmap( me->hdcImage, 4272 NULL,4273 CBM_ CREATEDIB,4205 &bmihHdr, 4206 CBM_INIT, 4274 4207 LockedSurfaceDesc.lpSurface, 4275 4208 (PBITMAPINFO)&BitmapInfo, … … 4292 4225 LockedSurfaceDesc.lpSurface, 4293 4226 (PBITMAPINFO)&BitmapInfo, 4294 DIB_RGB_COLORS );4227 DIB_RGB_COLORS ); 4295 4228 #else 4296 4229 bmpSurface.bmBitsPixel = 24; … … 4299 4232 break; 4300 4233 default: 4301 #ifdef DEBUG 4302 dprintf( ("Unexptected BitCount %d \n", 4234 dprintf( ("Unexpected BitCount %d \n", 4303 4235 LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)); 4304 #endif4305 4236 me->hbmImage=NULL; 4306 4237 } // end switch (me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount) … … 4308 4239 if(me->hbmImage == NULL) 4309 4240 { 4310 #ifdef DEBUG 4311 dprintf(("DDRAW: Can't create bitmap!\n")); 4312 #endif 4241 dprintf(("DDRAW: Can't create bitmap!\n")); 4313 4242 DeleteDC(me->hdcImage); 4314 4243 me->hdcImage = NULL; … … 4319 4248 else 4320 4249 { 4321 if( (DD_OK==rc) && 4322 (me->dwLastDCUnique != me->dwUniqueValue) ) 4323 { 4324 #ifdef DEBUG 4325 dprintf(("DDRAW: The Surface was locked/unlocked after the last DC was created =>Update Bitmap!\n")); 4326 #endif 4250 if( (DD_OK==rc) && (me->dwLastDCUnique != me->dwUniqueValue) ) 4251 { 4252 dprintf(("DDRAW: The Surface was locked/unlocked after the last DC was created =>Update Bitmap!\n")); 4327 4253 4328 4254 memset(&BitmapInfo,0, sizeof(BitmapInfo)); 4329 4255 BitmapInfo.bmiHead.biSize = sizeof(BITMAPINFOHEADER); 4330 BitmapInfo.bmiHead.biWidth = LockedSurfaceDesc. lPitch/ (LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount>>3);4256 BitmapInfo.bmiHead.biWidth = LockedSurfaceDesc.dwWidth; 4331 4257 BitmapInfo.bmiHead.biHeight = LockedSurfaceDesc.dwHeight; 4332 4258 BitmapInfo.bmiHead.biPlanes = 1; 4333 BitmapInfo.bmiHead.biBitCount = LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount;4259 BitmapInfo.bmiHead.biBitCount = (WORD)LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount; 4334 4260 4335 4261 switch(LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount) … … 4359 4285 break; 4360 4286 default: 4361 #ifdef DEBUG 4362 dprintf(("DDRAW: Unexptected BitCount %d => Bitmap not updated!\n",LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)); 4363 #endif 4287 dprintf(("DDRAW: Unexpected BitCount %d => Bitmap not updated!\n",LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)); 4364 4288 break; 4365 4289 } // end switch (me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount) … … 4370 4294 // Allways select the bitmap into the DC! No matter if the old or a new one 4371 4295 4372 if(DD_OK==rc) 4373 { 4374 if((me->hgdiOld = SelectObject(me->hdcImage, me->hbmImage)) == NULL) 4375 { 4376 #ifdef DEBUG 4377 dprintf(("DDRAW: Can't select bitmap into dc!\n")); 4378 #endif 4296 if (DD_OK==rc) 4297 { 4298 if ((me->hgdiOld = SelectObject(me->hdcImage, me->hbmImage)) == NULL) 4299 { 4300 dprintf(("DDRAW: Can't select bitmap into DC!\n")); 4379 4301 DeleteDC(me->hdcImage); 4380 4302 me->hdcImage = NULL; … … 4394 4316 //****************************************************************************** 4395 4317 //****************************************************************************** 4396 HRESULT __stdcall SurfGetFlipStatus(THIS This, DWORD dwFlags) 4397 { 4398 #ifdef DEBUG 4399 dprintf(("DDRAW: SurfGetFlipStatus\n")); 4400 #endif 4318 HRESULT WIN32API SurfGetFlipStatus(THIS This, DWORD dwFlags) 4319 { 4320 dprintf(("DDRAW: SurfGetFlipStatus\n")); 4401 4321 4402 4322 if( (DDGFS_CANFLIP!=dwFlags) && (DDGFS_ISFLIPDONE!=dwFlags) ) … … 4407 4327 //****************************************************************************** 4408 4328 //****************************************************************************** 4409 HRESULT __stdcallSurfGetOverlayPosition(THIS This, LPLONG lplX, LPLONG lplY)4329 HRESULT WIN32API SurfGetOverlayPosition(THIS This, LPLONG lplX, LPLONG lplY) 4410 4330 { 4411 4331 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4412 #ifdef DEBUG 4413 dprintf(("DDRAW: SurfGetOverlayPosition\n")); 4414 #endif 4332 dprintf(("DDRAW: SurfGetOverlayPosition\n")); 4415 4333 4416 4334 // Maybe simply return dderr_notsupported as we retun a max overlay value of 0 in the caps ? … … 4435 4353 //****************************************************************************** 4436 4354 //****************************************************************************** 4437 HRESULT __stdcallSurfGetPalette(THIS This, LPDIRECTDRAWPALETTE FAR *lplpPalette)4355 HRESULT WIN32API SurfGetPalette(THIS This, LPDIRECTDRAWPALETTE FAR *lplpPalette) 4438 4356 { 4439 4357 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4440 4358 4441 #ifdef DEBUG 4442 dprintf(("DDRAW: SurfGetPalette\n")); 4443 #endif 4359 dprintf(("DDRAW: SurfGetPalette\n")); 4444 4360 4445 4361 if(me->lpPalette) … … 4453 4369 //****************************************************************************** 4454 4370 //****************************************************************************** 4455 HRESULT __stdcallSurfGetPixelFormat(THIS This, LPDDPIXELFORMAT lpPixelFormat)4371 HRESULT WIN32API SurfGetPixelFormat(THIS This, LPDDPIXELFORMAT lpPixelFormat) 4456 4372 { 4457 4373 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4458 4374 4459 #ifdef DEBUG 4460 dprintf(("DDRAW: SurfGetPixelFormat\n")); 4461 #endif 4375 dprintf(("DDRAW: SurfGetPixelFormat %x %x", This, lpPixelFormat)); 4462 4376 4463 4377 if(NULL==lpPixelFormat) … … 4472 4386 //****************************************************************************** 4473 4387 //****************************************************************************** 4474 HRESULT __stdcallSurfGetSurfaceDesc(THIS This, LPDDSURFACEDESC lpSurface)4388 HRESULT WIN32API SurfGetSurfaceDesc(THIS This, LPDDSURFACEDESC lpSurface) 4475 4389 { 4476 4390 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4477 4391 4478 #ifdef DEBUG 4479 dprintf(("DDRAW: SurfGetSurfaceDesc\n")); 4480 #endif 4392 dprintf(("DDRAW: SurfGetSurfaceDesc\n")); 4481 4393 4482 4394 if((lpSurface == NULL)||(lpSurface->dwSize != sizeof(DDSURFACEDESC)) ) … … 4491 4403 //****************************************************************************** 4492 4404 //****************************************************************************** 4493 HRESULT __stdcallSurfGetSurfaceDesc4(THIS This, LPDDSURFACEDESC2 lpSurface)4405 HRESULT WIN32API SurfGetSurfaceDesc4(THIS This, LPDDSURFACEDESC2 lpSurface) 4494 4406 { 4495 4407 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4496 4408 4497 #ifdef DEBUG 4498 dprintf(("DDRAW: SurfGetSurfaceDesc4\n")); 4499 #endif 4409 dprintf(("DDRAW: SurfGetSurfaceDesc4\n")); 4500 4410 4501 4411 if((lpSurface == NULL)||(lpSurface->dwSize != sizeof(DDSURFACEDESC2)) ) … … 4510 4420 //****************************************************************************** 4511 4421 //****************************************************************************** 4512 HRESULT __stdcall SurfInitialize(THIS, LPDIRECTDRAW, LPDDSURFACEDESC) 4513 { 4514 #ifdef DEBUG 4515 dprintf(("DDRAW: SurfInitialize\n")); 4516 #endif 4422 HRESULT WIN32API SurfInitialize(THIS, LPDIRECTDRAW, LPDDSURFACEDESC) 4423 { 4424 dprintf(("DDRAW: SurfInitialize\n")); 4517 4425 4518 4426 return(DDERR_ALREADYINITIALIZED); // Init is done during creation see M$ Doc … … 4520 4428 //****************************************************************************** 4521 4429 //****************************************************************************** 4522 HRESULT __stdcall SurfInitialize4(THIS, LPDIRECTDRAW, LPDDSURFACEDESC2) 4523 { 4524 #ifdef DEBUG 4525 dprintf(("DDRAW: SurfInitialize\n")); 4526 #endif 4430 HRESULT WIN32API SurfInitialize4(THIS, LPDIRECTDRAW, LPDDSURFACEDESC2) 4431 { 4432 dprintf(("DDRAW: SurfInitialize\n")); 4527 4433 4528 4434 return(DDERR_ALREADYINITIALIZED); // Init is done during creation see M$ Doc … … 4530 4436 //****************************************************************************** 4531 4437 //****************************************************************************** 4532 HRESULT __stdcallSurfIsLost(THIS)4438 HRESULT WIN32API SurfIsLost(THIS) 4533 4439 { 4534 4440 // We don't loose any surface ;) … … 4536 4442 // if they are preserved if switching to a FS DOS/OS2 session 4537 4443 // 4538 #ifdef DEBUG 4539 dprintf(("DDRAW: SurfIsLost\n")); 4540 #endif 4444 dprintf(("DDRAW: SurfIsLost\n")); 4541 4445 4542 4446 return(DD_OK); … … 4544 4448 //****************************************************************************** 4545 4449 //****************************************************************************** 4546 HRESULT __stdcallSurfLock( THIS This,4450 HRESULT WIN32API SurfLock( THIS This, 4547 4451 LPRECT lpRect, 4548 4452 LPDDSURFACEDESC lpSurfaceDesc, … … 4553 4457 HRESULT rc; 4554 4458 4555 #ifdef DEBUG 4556 dprintf(("DDRAW: SurfLock %d %08X %d %d\n", (int)lpRect, (int)lpSurfaceDesc, dwFlags, hEvent)); 4557 #endif 4459 dprintf(("DDRAW: SurfLock %d %08X %d %d\n", (int)lpRect, (int)lpSurfaceDesc, dwFlags, hEvent)); 4558 4460 4559 4461 if((NULL==lpSurfaceDesc)||(NULL!=hEvent)) … … 4581 4483 //****************************************************************************** 4582 4484 //****************************************************************************** 4583 HRESULT __stdcallSurfLock4( THIS This,4485 HRESULT WIN32API SurfLock4( THIS This, 4584 4486 LPRECT lpRect, 4585 4487 LPDDSURFACEDESC2 lpSurfaceDesc, … … 4592 4494 4593 4495 BOOL Found; 4594 ULONG nrScanLines;4595 char *pBuffer;4596 4496 DDRectangle *pIRectCurrent,*pIRectNew; 4597 static int times = 0;4598 4497 HRESULT rc; 4599 4498 4600 #ifdef DEBUG 4601 dprintf( ("SurfLock4 %08X %08X %08X %d %d\n", 4602 me, 4603 (int)lpRect, 4604 (int)lpSurfaceDesc, 4605 dwFlags, 4606 hEvent) ); 4607 #endif 4499 dprintf( ("SurfLock4 %08X %08X %08X %d %d\n", 4500 me, 4501 (int)lpRect, 4502 (int)lpSurfaceDesc, 4503 dwFlags, 4504 hEvent) ); 4608 4505 4609 4506 if( (NULL==lpSurfaceDesc) || … … 4633 4530 if (NULL==lpRect) 4634 4531 { 4635 // If anything is locked we can't lock ethe complete surface4636 dprintf(("DDRAW: Surface has locked Rectangles , and we want to completelock it\n"));4532 // If anything is locked we can't lock the complete surface 4533 dprintf(("DDRAW: Surface has locked Rectangles and we want to completely lock it\n")); 4637 4534 Found = TRUE; 4638 4535 } … … 4642 4539 // be locked so check for this 4643 4540 4644 dprintf(("DDRAW: Surface has locked Rectangles, check if the overlap\n"));4541 dprintf(("DDRAW: Surface has locked Rectangles, check if they overlap\n")); 4645 4542 4646 4543 i=0; … … 4664 4561 { 4665 4562 delete pIRectNew; 4666 #ifdef DEBUG 4667 dprintf(("DDRAW: SurfLock4: Surface already locked\n\n")); 4668 #endif 4563 dprintf(("DDRAW: SurfLock4: Surface already locked\n\n")); 4669 4564 rc = DDERR_SURFACEBUSY; 4670 4565 } … … 4681 4576 (lpRect->top * me->dwPitchFB) + 4682 4577 (lpRect->left * (lpSurfaceDesc->ddpfPixelFormat.dwRGBBitCount>>3))); 4683 #ifdef DEBUG 4684 dprintf(("DDRAW: SurfLock4 %08X (x,y) = (%d,%d)\n\n", lpSurfaceDesc->lpSurface, lpRect->top, lpRect->left)); 4685 #endif 4578 dprintf(("DDRAW: SurfLock4 %08X (x,y) = (%d,%d)\n\n", lpSurfaceDesc->lpSurface, lpRect->top, lpRect->left)); 4686 4579 } 4687 4580 else 4688 4581 { 4689 #ifdef DEBUG 4690 dprintf(("DDRAW: SurfLock4 %08X \n\n", lpSurfaceDesc->lpSurface)); 4691 #endif 4582 dprintf(("DDRAW: SurfLock4 %08X \n\n", lpSurfaceDesc->lpSurface)); 4692 4583 } 4693 4584 // Add the rectangle to the list of locked rectangles … … 4707 4598 //****************************************************************************** 4708 4599 //****************************************************************************** 4709 HRESULT __stdcallSurfReleaseDC(THIS This, HDC hdc)4600 HRESULT WIN32API SurfReleaseDC(THIS This, HDC hdc) 4710 4601 { 4711 4602 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 4715 4606 RGBQUAD bmiCols[256]; 4716 4607 } BitmapInfo; 4717 BITMAP bmpData; 4718 char szError[256]; 4719 int i,rc; 4720 4721 #ifdef DEBUG 4722 dprintf(("DDRAW: SurfReleaseDC\n")); 4723 #endif 4608 // BITMAP bmpData; 4609 int rc; 4610 4611 dprintf(("DDRAW: SurfReleaseDC\n")); 4724 4612 4725 4613 if(hdc != me->hdcImage) … … 4751 4639 (PBITMAPINFO)&BitmapInfo, 4752 4640 DIB_RGB_COLORS); 4641 // BitmapInfo.bmiHead.biHeight = -BitmapInfo.bmiHead.biHeight; 4753 4642 dprintf( ("GetDIBits rc=%d\n Size :%d\n Width :%d\n Height :%d\n" 4754 4643 " Planes :%d\n BitCount :%d\nLastEror = %d\nPixel[0,0] = 0x%02X\n", … … 4761 4650 GetLastError(), 4762 4651 ((char*)me->DDSurfaceDesc.lpSurface)[0])); 4652 4763 4653 rc = GetDIBits( hdc, 4764 4654 me->hbmImage, … … 4789 4679 break; 4790 4680 default: 4791 #ifdef DEBUG 4792 dprintf(("DDRAW: Unexptected BitCount %d => Surface unlocked but no data copied back\n",me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)); 4793 #endif 4681 dprintf(("DDRAW: Unexpected BitCount %d => Surface unlocked but no data copied back\n",me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)); 4794 4682 // we might could keep the surface locked and return an error but this is more "safe" 4795 4683 break; … … 4814 4702 //****************************************************************************** 4815 4703 //****************************************************************************** 4816 HRESULT __stdcall SurfRestore(THIS) 4817 { 4818 #ifdef DEBUG 4819 dprintf(("DDRAW: SurfRestore\n")); 4820 #endif 4704 HRESULT WIN32API SurfRestore(THIS) 4705 { 4706 dprintf(("DDRAW: SurfRestore\n")); 4821 4707 4822 4708 return(DD_OK); … … 4824 4710 //****************************************************************************** 4825 4711 //****************************************************************************** 4826 HRESULT __stdcallSurfSetClipper(THIS This, LPDIRECTDRAWCLIPPER lpClipper)4712 HRESULT WIN32API SurfSetClipper(THIS This, LPDIRECTDRAWCLIPPER lpClipper) 4827 4713 { 4828 4714 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4829 4715 4830 #ifdef DEBUG 4831 dprintf(("DDRAW: SurfSetClipper\n")); 4832 #endif 4716 dprintf(("DDRAW: SurfSetClipper %x %x", This, lpClipper)); 4833 4717 4834 4718 if(lpClipper == NULL) … … 4861 4745 //****************************************************************************** 4862 4746 //****************************************************************************** 4863 HRESULT __stdcallSurfSetColorKey(THIS This, DWORD dwFlags, LPDDCOLORKEY lpDDColKey)4747 HRESULT WIN32API SurfSetColorKey(THIS This, DWORD dwFlags, LPDDCOLORKEY lpDDColKey) 4864 4748 { 4865 4749 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 4913 4797 //****************************************************************************** 4914 4798 //****************************************************************************** 4915 HRESULT __stdcallSurfSetOverlayPosition(THIS This, LONG lX, LONG lY)4799 HRESULT WIN32API SurfSetOverlayPosition(THIS This, LONG lX, LONG lY) 4916 4800 { 4917 4801 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4918 4802 4919 #ifdef DEBUG 4920 dprintf(("DDRAW: SurfSetOverlayPosition\n")); 4921 #endif 4803 dprintf(("DDRAW: SurfSetOverlayPosition\n")); 4922 4804 4923 4805 if( (me->DDSurfaceDesc.dwFlags & DDSD_CAPS) && … … 4942 4824 //****************************************************************************** 4943 4825 //****************************************************************************** 4944 HRESULT __stdcallSurfSetPalette(THIS This, LPDIRECTDRAWPALETTE lpPalette)4826 HRESULT WIN32API SurfSetPalette(THIS This, LPDIRECTDRAWPALETTE lpPalette) 4945 4827 { 4946 4828 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4947 4829 4948 #ifdef DEBUG 4949 dprintf(("DDRAW: SurfSetPalette\n")); 4950 #endif 4830 dprintf(("DDRAW: SurfSetPalette\n")); 4951 4831 4952 4832 if(lpPalette == NULL) … … 4999 4879 //****************************************************************************** 5000 4880 //****************************************************************************** 5001 HRESULT __stdcallSurfUnlock(THIS This, LPVOID lpSurfaceData)4881 HRESULT WIN32API SurfUnlock(THIS This, LPVOID lpSurfaceData) 5002 4882 { 5003 4883 … … 5009 4889 HRESULT rc; 5010 4890 5011 #ifdef DEBUG 5012 dprintf(("DDRAW: SurfUnlock at %08X\n",lpSurfaceData)); 5013 #endif 4891 dprintf(("DDRAW: SurfUnlock at %08X\n",lpSurfaceData)); 5014 4892 5015 4893 if(me->fLocked == FALSE) 5016 4894 { 5017 #ifdef DEBUG 5018 dprintf(("DDRAW: Surface not locked!\n")); 5019 #endif 4895 dprintf(("DDRAW: Surface not locked!\n")); 5020 4896 return(DDERR_NOTLOCKED); 5021 4897 } 5022 5023 #ifdef DEBUG5024 dprintf(("DDRAW: Start Emuneration of Locked Rects\n"));5025 #endif5026 4898 5027 4899 i=0; … … 5033 4905 // this pointer in the locked rects DPA to unlock the right rect. 5034 4906 5035 while(i <DPA_GetPtrCount(me->DPA_LockedRects) && !Found)4907 while(i < DPA_GetPtrCount(me->DPA_LockedRects) && !Found) 5036 4908 { 5037 4909 pIRectEnum = (DDRectangle*)DPA_FastGetPtr(me->DPA_LockedRects,i); … … 5047 4919 if(!Found) 5048 4920 { 5049 #ifdef DEBUG 5050 dprintf(("DDRAW: Not Found, try Next rect\n")); 5051 #endif 4921 dprintf(("DDRAW: Not Found, try Next rect\n")); 5052 4922 i++; 5053 4923 } 5054 #ifdef DEBUG5055 4924 else 5056 4925 { 5057 4926 dprintf(("DDRAW: Found Rect\n")); 5058 4927 } 5059 #endif5060 4928 } 5061 4929 } … … 5082 4950 if(!Found) 5083 4951 { 5084 #ifdef DEBUG 5085 dprintf(("DDRAW: Not Found, try Next rect\n")); 5086 #endif 4952 dprintf(("DDRAW: Not Found, try Next rect\n")); 5087 4953 i++; 5088 4954 } 5089 #ifdef DEBUG5090 4955 else 5091 4956 { 5092 4957 dprintf(("DDRAW: Found Rect\n")); 5093 4958 } 5094 #endif5095 4959 } 5096 4960 delete pIRectUnlock; … … 5099 4963 if(!Found) 5100 4964 { 5101 #ifdef DEBUG 5102 dprintf(("DDRAW: Rectangle not locked, wrong Rect!\n\n")); 5103 #endif 4965 dprintf(("DDRAW: Rectangle not locked, wrong Rect!\n\n")); 5104 4966 rc = DDERR_INVALIDRECT; 5105 4967 } 5106 4968 else 5107 4969 { 5108 #ifdef DEBUG 5109 dprintf(("DDRAW: Remove Rect %d from Seq.\n",i)); 5110 #endif 4970 dprintf(("DDRAW: Remove Rect %d from Seq.\n",i)); 5111 4971 5112 4972 DPA_DeletePtr(me->DPA_LockedRects,i); 5113 4973 5114 #ifdef DEBUG 5115 dprintf(("DDRAW: Test if locked Rects main\n")); 5116 #endif 4974 dprintf(("DDRAW: Test if locked Rects main\n")); 5117 4975 5118 4976 if(0==DPA_GetPtrCount(me->DPA_LockedRects)) // Do we have unlocked last rectangle 5119 4977 { 5120 #ifdef DEBUG 5121 dprintf(("DDRAW: No Locked Rects left for surface\n")); 5122 #endif 4978 dprintf(("DDRAW: No Locked Rects left for surface\n")); 5123 4979 me->fLocked = FALSE; 5124 4980 } … … 5131 4987 if(me->pFrameBuffer != me->pDiveBuffer) 5132 4988 { 5133 #ifdef DEBUG 5134 dprintf(( "ColorConversion Needed %08X != %08X\n", 5135 me->pFrameBuffer, 5136 me->pDiveBuffer)); 5137 #endif 4989 dprintf(( "ColorConversion Needed %08X != %08X\n", 4990 me->pFrameBuffer, 4991 me->pDiveBuffer)); 5138 4992 if(NULL!=lpSurfaceData) 5139 4993 { … … 5150 5004 } 5151 5005 } 5152 #ifdef DEBUG5153 5006 else 5154 5007 dprintf( ("No ColorConversion Needed")); 5155 #endif5156 5008 5157 5009 // delete tne DDRectobject of the found rectangle … … 5169 5021 //****************************************************************************** 5170 5022 //****************************************************************************** 5171 HRESULT __stdcallSurfUnlock4(THIS This, LPRECT lpSurfaceRect)5023 HRESULT WIN32API SurfUnlock4(THIS This, LPRECT lpSurfaceRect) 5172 5024 { 5173 5025 // MS changed the parameter from LPVOID to LPRECT with DX6 … … 5185 5037 HRESULT rc; 5186 5038 5187 #ifdef DEBUG 5188 dprintf(("DDRAW: SurfUnlock4\n")); 5189 #endif 5039 dprintf(("DDRAW: SurfUnlock4\n")); 5190 5040 5191 5041 if(me->fLocked == FALSE) 5192 5042 { 5193 #ifdef DEBUG 5194 dprintf(("DDRAW: Surface not locked!\n")); 5195 #endif 5043 dprintf(("DDRAW: Surface not locked!\n")); 5196 5044 return(DDERR_NOTLOCKED); 5197 5045 } … … 5217 5065 pIRectUnlock->Right() )); 5218 5066 5219 #ifdef DEBUG 5220 dprintf(("DDRAW: Start Emuneration of Locked Rects\n")); 5221 #endif 5067 dprintf(("DDRAW: Start Enumeration of Locked Rects\n")); 5222 5068 5223 5069 i=0; … … 5234 5080 if(!Found) 5235 5081 { 5236 #ifdef DEBUG 5237 dprintf(("DDRAW: Not Found, try Next rect\n")); 5238 #endif 5082 dprintf(("DDRAW: Not Found, try Next rect\n")); 5239 5083 i++; 5240 5084 } 5241 #ifdef DEBUG5242 5085 else 5243 5086 { 5244 5087 dprintf(("DDRAW: Found Rect\n")); 5245 5088 } 5246 #endif5247 5089 } 5248 5090 … … 5252 5094 if(NULL==lpSurfaceRect) 5253 5095 { 5254 #ifdef DEBUG 5255 dprintf(("DDRAW: Rectangle not locked, wrong Rect!\n\n")); 5256 #endif 5096 dprintf(("DDRAW: Rectangle not locked, wrong Rect!\n\n")); 5257 5097 return(DDERR_INVALIDRECT); 5258 5098 } … … 5262 5102 else 5263 5103 { 5264 #ifdef DEBUG 5265 dprintf(("DDRAW: Remove Rect from Seq.\n")); 5266 #endif 5104 dprintf(("DDRAW: Remove Rect from Seq.\n")); 5267 5105 5268 5106 DPA_DeletePtr(me->DPA_LockedRects,i); … … 5270 5108 if(0==DPA_GetPtrCount(me->DPA_LockedRects)) // Do we have unlocked last rectangle 5271 5109 { 5272 #ifdef DEBUG 5273 dprintf(("DDRAW: No Locked Rects left for surface\n")); 5274 #endif 5110 dprintf(("DDRAW: No Locked Rects left for surface\n")); 5275 5111 me->fLocked = FALSE; 5276 5112 } … … 5278 5114 if(me->pFrameBuffer != me->pDiveBuffer) 5279 5115 { 5280 #ifdef DEBUG 5281 dprintf(( "ColorConversion Needed %08X != %08X\n", 5282 me->pFrameBuffer, 5283 me->pDiveBuffer)); 5284 #endif 5116 dprintf(( "ColorConversion Needed %08X != %08X\n", 5117 me->pFrameBuffer, 5118 me->pDiveBuffer)); 5285 5119 me->ColorConversion(lpSurfaceRect); 5286 5120 } … … 5296 5130 //****************************************************************************** 5297 5131 //****************************************************************************** 5298 HRESULT __stdcall SurfUpdateOverlay(THIS This, LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX) 5299 { 5300 #ifdef DEBUG 5301 dprintf(("DDRAW: SurfUpdateOverlay\n")); 5302 #endif 5132 HRESULT WIN32API SurfUpdateOverlay(THIS This, LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX) 5133 { 5134 dprintf(("DDRAW: SurfUpdateOverlay\n")); 5303 5135 return(DD_OK); 5304 5136 } 5305 5137 //****************************************************************************** 5306 5138 //****************************************************************************** 5307 HRESULT __stdcall SurfUpdateOverlay3(THIS This, LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) 5308 { 5309 #ifdef DEBUG 5310 dprintf(("DDRAW: SurfUpdateOverlay\n")); 5311 #endif 5139 HRESULT WIN32API SurfUpdateOverlay3(THIS This, LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) 5140 { 5141 dprintf(("DDRAW: SurfUpdateOverlay\n")); 5312 5142 return(DD_OK); 5313 5143 } 5314 5144 //****************************************************************************** 5315 5145 //****************************************************************************** 5316 HRESULT __stdcall SurfUpdateOverlay4(THIS, LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX) 5317 { 5318 #ifdef DEBUG 5319 dprintf(("DDRAW: SurfUpdateOverlay\n")); 5320 #endif 5146 HRESULT WIN32API SurfUpdateOverlay4(THIS, LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX) 5147 { 5148 dprintf(("DDRAW: SurfUpdateOverlay\n")); 5321 5149 return(DD_OK); 5322 5150 } 5323 5151 //****************************************************************************** 5324 5152 //****************************************************************************** 5325 HRESULT __stdcall SurfUpdateOverlayDisplay(THIS, DWORD) 5326 { 5327 #ifdef DEBUG 5328 dprintf(("DDRAW: SurfUpdateOverlayDisplay\n")); 5329 #endif 5153 HRESULT WIN32API SurfUpdateOverlayDisplay(THIS, DWORD) 5154 { 5155 dprintf(("DDRAW: SurfUpdateOverlayDisplay\n")); 5330 5156 return(DD_OK); 5331 5157 } 5332 5158 //****************************************************************************** 5333 5159 //****************************************************************************** 5334 HRESULT __stdcall SurfUpdateOverlayZOrder(THIS, DWORD, LPDIRECTDRAWSURFACE2) 5335 { 5336 #ifdef DEBUG 5337 dprintf(("DDRAW: SurfUpdateOverlayZOrder\n")); 5338 #endif 5160 HRESULT WIN32API SurfUpdateOverlayZOrder(THIS, DWORD, LPDIRECTDRAWSURFACE2) 5161 { 5162 dprintf(("DDRAW: SurfUpdateOverlayZOrder\n")); 5339 5163 return(DD_OK); 5340 5164 } 5341 5165 //****************************************************************************** 5342 5166 //****************************************************************************** 5343 HRESULT __stdcall SurfUpdateOverlayZOrder3(THIS, DWORD, LPDIRECTDRAWSURFACE3) 5344 { 5345 #ifdef DEBUG 5346 dprintf(("DDRAW: SurfUpdateOverlayZOrder\n")); 5347 #endif 5167 HRESULT WIN32API SurfUpdateOverlayZOrder3(THIS, DWORD, LPDIRECTDRAWSURFACE3) 5168 { 5169 dprintf(("DDRAW: SurfUpdateOverlayZOrder\n")); 5348 5170 return(DD_OK); 5349 5171 } 5350 5172 //****************************************************************************** 5351 5173 //****************************************************************************** 5352 HRESULT __stdcall SurfUpdateOverlayZOrder4(THIS, DWORD, LPDIRECTDRAWSURFACE4) 5353 { 5354 #ifdef DEBUG 5355 dprintf(("DDRAW: SurfUpdateOverlayZOrder4\n")); 5356 #endif 5174 HRESULT WIN32API SurfUpdateOverlayZOrder4(THIS, DWORD, LPDIRECTDRAWSURFACE4) 5175 { 5176 dprintf(("DDRAW: SurfUpdateOverlayZOrder4\n")); 5357 5177 return(DD_OK); 5358 5178 } 5359 5179 //****************************************************************************** 5360 5180 //****************************************************************************** 5361 HRESULT __stdcallSurfGetDDInterface(THIS This, LPVOID FAR *lplpDirectDraw)5181 HRESULT WIN32API SurfGetDDInterface(THIS This, LPVOID FAR *lplpDirectDraw) 5362 5182 { 5363 5183 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 5364 5184 5365 #ifdef DEBUG 5366 dprintf(("DDRAW: SurfGetDDInterface\n")); 5367 #endif 5185 dprintf(("DDRAW: SurfGetDDInterface\n")); 5368 5186 *lplpDirectDraw = (LPVOID FAR *)me->lpDraw; 5369 5187 return(DD_OK); … … 5371 5189 //****************************************************************************** 5372 5190 //****************************************************************************** 5373 HRESULT __stdcallSurfPageLock(THIS, DWORD)5191 HRESULT WIN32API SurfPageLock(THIS, DWORD) 5374 5192 { 5375 5193 // Only used for DMA memory access 5376 5194 // If we implement this for the None dive buffers with a pdd the we must change 5377 5195 // from malloc to DosAllocMem and use OBJ_TILE flag 5378 #ifdef DEBUG 5379 dprintf(("DDRAW: SurfPageLock\n")); 5380 #endif 5196 dprintf(("DDRAW: SurfPageLock\n")); 5381 5197 return(DD_OK); 5382 5198 } 5383 5199 //****************************************************************************** 5384 5200 //****************************************************************************** 5385 HRESULT __stdcall SurfPageUnlock(THIS, DWORD) 5386 { 5387 #ifdef DEBUG 5388 dprintf(("DDRAW: SurfPageUnlock\n")); 5389 #endif 5201 HRESULT WIN32API SurfPageUnlock(THIS, DWORD) 5202 { 5203 dprintf(("DDRAW: SurfPageUnlock\n")); 5390 5204 return(DD_OK); 5391 5205 } … … 5394 5208 // V3 Interface Functions 5395 5209 5396 HRESULT __stdcall SurfSetSurfaceDesc(THIS This, LPDDSURFACEDESC lpSurfDesc, DWORD dwFlags) 5397 { 5398 #ifdef DEBUG 5399 dprintf(("DDRAW: SurfSetSurfaceDesc\n")); 5400 #endif 5210 HRESULT WIN32API SurfSetSurfaceDesc(THIS This, LPDDSURFACEDESC lpSurfDesc, DWORD dwFlags) 5211 { 5212 dprintf(("DDRAW: SurfSetSurfaceDesc\n")); 5401 5213 5402 5214 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 5441 5253 //****************************************************************************** 5442 5254 //****************************************************************************** 5443 HRESULT __stdcall SurfSetSurfaceDesc4(THIS This, LPDDSURFACEDESC2 lpSurfDesc, DWORD dwFlags) 5444 { 5445 #ifdef DEBUG 5446 dprintf(("DDRAW: SurfSetSurfaceDesc4\n")); 5447 #endif 5255 HRESULT WIN32API SurfSetSurfaceDesc4(THIS This, LPDDSURFACEDESC2 lpSurfDesc, DWORD dwFlags) 5256 { 5257 dprintf(("DDRAW: SurfSetSurfaceDesc4\n")); 5448 5258 5449 5259 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 5491 5301 // V4 Interface Functions 5492 5302 5493 HRESULT __stdcallSurfSetPrivateData(THIS This, REFGUID refGUID, LPVOID lpData,5303 HRESULT WIN32API SurfSetPrivateData(THIS This, REFGUID refGUID, LPVOID lpData, 5494 5304 DWORD dwDataSize, DWORD dwFlags) 5495 5305 { … … 5501 5311 HRESULT rc; 5502 5312 5503 #ifdef DEBUG 5504 dprintf(("DDRAW: SurfSetPrivateData\n")); 5505 #endif 5313 dprintf(("DDRAW: SurfSetPrivateData\n")); 5506 5314 5507 5315 if(NULL==me) … … 5676 5484 //****************************************************************************** 5677 5485 //****************************************************************************** 5678 HRESULT __stdcallSurfGetPrivateData(THIS This, REFGUID refGUID, LPVOID lpData, LPDWORD lpDataSize)5486 HRESULT WIN32API SurfGetPrivateData(THIS This, REFGUID refGUID, LPVOID lpData, LPDWORD lpDataSize) 5679 5487 { 5680 5488 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 5684 5492 BOOL bFound = FALSE; 5685 5493 5686 #ifdef DEBUG 5687 dprintf(("DDRAW: SurfGetPrivateData\n")); 5688 #endif 5494 dprintf(("DDRAW: SurfGetPrivateData\n")); 5689 5495 5690 5496 if(NULL==me) … … 5737 5543 //****************************************************************************** 5738 5544 //****************************************************************************** 5739 HRESULT __stdcallSurfFreePrivateData(THIS This, REFGUID refGUID)5545 HRESULT WIN32API SurfFreePrivateData(THIS This, REFGUID refGUID) 5740 5546 { 5741 5547 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 5744 5550 BOOL bFound = FALSE; 5745 5551 5746 #ifdef DEBUG 5747 dprintf(("DDRAW: SurfFreePrivateData\n")); 5748 #endif 5552 dprintf(("DDRAW: SurfFreePrivateData\n")); 5749 5553 5750 5554 if(NULL==me) … … 5787 5591 //****************************************************************************** 5788 5592 //****************************************************************************** 5789 HRESULT __stdcall SurfGetUniquenessValue(THIS This, LPDWORD lpValue) 5790 { 5791 #ifdef DEBUG 5792 dprintf(("DDRAW: SurfGetUniquenessValue\n")); 5793 #endif 5593 HRESULT WIN32API SurfGetUniquenessValue(THIS This, LPDWORD lpValue) 5594 { 5595 dprintf(("DDRAW: SurfGetUniquenessValue\n")); 5794 5596 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 5795 5597 if (NULL==lpValue) … … 5801 5603 //****************************************************************************** 5802 5604 //****************************************************************************** 5803 HRESULT __stdcallSurfChangeUniquenessValue(THIS This)5605 HRESULT WIN32API SurfChangeUniquenessValue(THIS This) 5804 5606 { 5805 5607 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 5808 5610 5809 5611 5810 #ifdef DEBUG 5811 dprintf(("DDRAW: SurfChangeUniquenessValue\n")); 5812 #endif 5612 dprintf(("DDRAW: SurfChangeUniquenessValue\n")); 5813 5613 me->dwUniqueValue++; 5814 5614 … … 5964 5764 DWORD dwTLineStart; // # DWORD in which the first transinfo is 5965 5765 DWORD dwTDWStart; // byte in which the firs transinfo is 5966 DWORD dwTrans; // current transparentvalue 5967 DWORD BlitWidth; 5766 5968 5767 dwTLineLen = 1 + ((pSrcDesc->dwWidth + 31) & ~31); 5969 5768 pdwTLine = (DWORD*)pAlpha + (dwTLineLen* lpSrcRect->top);
Note:
See TracChangeset
for help on using the changeset viewer.
