[ros-diffs] [greatlrd] 23162: framebuf Implement DdCreateSurface not tested. Bugfix the prototyped.

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Wed Jul 19 01:56:48 CEST 2006


Author: greatlrd
Date: Wed Jul 19 03:56:48 2006
New Revision: 23162

URL: http://svn.reactos.org/svn/reactos?rev=23162&view=rev
Log:
framebuf
Implement DdCreateSurface not tested. 
Bugfix the prototyped. 

Modified:
    trunk/reactos/drivers/video/displays/framebuf/dd.c
    trunk/reactos/drivers/video/displays/framebuf/framebuf.h

Modified: trunk/reactos/drivers/video/displays/framebuf/dd.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/framebuf/dd.c?rev=23162&r1=23161&r2=23162&view=diff
==============================================================================
--- trunk/reactos/drivers/video/displays/framebuf/dd.c (original)
+++ trunk/reactos/drivers/video/displays/framebuf/dd.c Wed Jul 19 03:56:48 2006
@@ -68,9 +68,49 @@
 }
 
 DWORD CALLBACK 
-DdCreateSurface(PDD_CREATESURFACEDATA lpCreateSurface)
+DdCreateSurface(LPDDHAL_CREATESURFACEDATA pcsd)
 {
-	lpCreateSurface->ddRVal = DDERR_GENERIC;
-    return DDHAL_DRIVER_NOTHANDLED;
+	int i;
+	
+	if (pcsd->dwSCnt == 1)
+	{
+		pcsd->ddRVal = DDERR_GENERIC;
+        return DDHAL_DRIVER_NOTHANDLED;
+	}
+
+	
+	for (i=0; i<(int)pcsd->dwSCnt; i++)
+    {               
+		pcsd->lplpSList[i]->lpGbl->lPitch = (DWORD)(pcsd->lplpSList[i]->lpGbl->wWidth * 
+			                                (pcsd->lplpSList[i]->lpGbl->ddpfSurface.dwRGBBitCount / 8));
+       
+		pcsd->lplpSList[i]->lpGbl->dwBlockSizeX = pcsd->lplpSList[i]->lpGbl->lPitch * 
+			                                      (DWORD)(pcsd->lplpSList[i]->lpGbl->wHeight);
+
+        pcsd->lplpSList[i]->lpGbl->dwBlockSizeY = 1;
+        
+        if ( pcsd->lplpSList[i] ->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
+        {
+			/* We maybe should alloc it with EngAlloc 
+			   for now we trusting ddraw alloc it        */			
+            pcsd->lplpSList[i]->lpGbl->fpVidMem = 0;
+        }
+        else
+        {
+			
+			/* We maybe should alloc it with EngAlloc 
+			   for now we trusting ddraw alloc it        */			
+            pcsd->lplpSList[i]->lpGbl->fpVidMem = DDHAL_PLEASEALLOC_BLOCKSIZE;
+        }
+
+        pcsd->lpDDSurfaceDesc->lPitch = pcsd->lplpSList[i]->lpGbl->lPitch;
+        pcsd->lpDDSurfaceDesc->dwFlags |= DDSD_PITCH;
+       
+    } // for i
+
+
+	    
+	pcsd->ddRVal = DD_OK;
+    return DDHAL_DRIVER_HANDLED;
 }
 

Modified: trunk/reactos/drivers/video/displays/framebuf/framebuf.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/framebuf/framebuf.h?rev=23162&r1=23161&r2=23162&view=diff
==============================================================================
--- trunk/reactos/drivers/video/displays/framebuf/framebuf.h (original)
+++ trunk/reactos/drivers/video/displays/framebuf/framebuf.h Wed Jul 19 03:56:48 2006
@@ -82,7 +82,7 @@
 DdCanCreateSurface( LPDDHAL_CANCREATESURFACEDATA pccsd );
 
 DWORD CALLBACK 
-DdCreateSurface(PDD_CREATESURFACEDATA lpCreateSurface);
+DdCreateSurface(LPDDHAL_CREATESURFACEDATA pcsd);
 
 VOID STDCALL
 DrvDisableDirectDraw(




More information about the Ros-diffs mailing list