Author: greatlrd Date: Sun Mar 2 12:19:08 2008 New Revision: 32545
URL: http://svn.reactos.org/svn/reactos?rev=3D32545&view=3Drev Log: Fixed all known issue with DdCreateSurface in gdi32, it works with more tha= t one surface now.
Modified: trunk/reactos/dll/win32/gdi32/misc/gdientry.c
Modified: trunk/reactos/dll/win32/gdi32/misc/gdientry.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/= gdientry.c?rev=3D32545&r1=3D32544&r2=3D32545&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- trunk/reactos/dll/win32/gdi32/misc/gdientry.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/gdientry.c Sun Mar 2 12:19:08 2008 @@ -274,11 +274,11 @@ (PDD_CANCREATESURFACEDATA)CanCreateSurf= ace); } =
- - - - -/* TODO : finish all fixme */ =
+/* + * @implemented + * + * DdCreateSurface + */ DWORD WINAPI DdCreateSurface(LPDDHAL_CREATESURFACEDATA pCreateSurface) @@ -301,6 +301,24 @@ PHANDLE phSurface =3D NULL, puhSurface =3D NULL; ULONG i; LPDDSURFACEDESC pSurfaceDesc =3D NULL; + + /* TODO : Speed optimze, most games/dx apps/program does not want 1 su= rface, they want lest 2 + * so we need incress the stack so it can contain 2 surface instead of= one, this will incress =
+ * the speed of the apps when it trying alloc buffer. How to incress t= he surface stack space + * we need create a own struct for DD_SURFACE_LOCAL DdSurfaceLocal, DD= _SURFACE_MORE DdSurfaceMore + * DD_SURFACE_GLOBAL DdSurfaceGlobal. HANDLE hPrevSurface, hSurface. l= ike + * struct { DD_SURFACE_LOCAL DdSurfaceLocal1, DD_SURFACE_LOCAL DdSurfa= ceLocal2 } + * lest so it contain two surface. maybe 4. we need watch what is most= common here before =
+ * we create the size activate this IF when you start doing the optim= ze and please also + * take report from user which value they got here + */ =
+#if 0 + { + char buffer[1024]; \ + sprintf ( buffer, "Function %s : Optimze max to %d Surface ? (%s:%= d)\n", __FUNCTION__,SurfaceCount,__FILE__,__LINE__ ); + OutputDebugStringA(buffer); + } +#endif =
/* Check how many surfaces there are */ if (SurfaceCount !=3D 1) @@ -475,12 +493,11 @@ lcl->lpSurfMore->ddsCapsEx.dwCaps3 =3D ptmpDdSurfaceMore->= ddsCapsEx.dwCaps3; lcl->lpSurfMore->ddsCapsEx.dwCaps4 =3D ptmpDdSurfaceMore->= ddsCapsEx.dwCaps4; } - /* FIXME count to next SurfaceCount for - ptmpDdSurfaceGlobal =3D pDdSurfaceGlobal; - ptmpDdSurfaceLocal =3D pDdSurfaceLocal; - ptmpDdSurfaceMore =3D pDdSurfaceMore; - we only support one surface create at moment - */ + + /* count to next SurfaceCount */ + ptmpDdSurfaceGlobal =3D (PDD_SURFACE_GLOBAL) (((PBYTE) ((ULONG= _PTR) ptmpDdSurfaceGlobal)) + sizeof(DD_SURFACE_GLOBAL)); + ptmpDdSurfaceLocal =3D (PDD_SURFACE_LOCAL) (((PBYTE) ((ULONG_P= TR) ptmpDdSurfaceLocal)) + sizeof(DD_SURFACE_LOCAL)); + ptmpDdSurfaceMore =3D (PDD_SURFACE_MORE) (((PBYTE) ((ULONG_PTR= ) ptmpDdSurfaceMore)) + sizeof(DD_SURFACE_MORE)); } } =