[ros-diffs] [greatlrd] 23289: Move some stuff from createsurface to startup.c Bugfix some other stuff

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Tue Jul 25 21:20:50 CEST 2006


Author: greatlrd
Date: Tue Jul 25 23:20:49 2006
New Revision: 23289

URL: http://svn.reactos.org/svn/reactos?rev=23289&view=rev
Log:
Move some stuff from createsurface to startup.c
Bugfix some other stuff

Modified:
    trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
    trunk/reactos/dll/directx/ddraw/startup.c

Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddraw_main.c?rev=23289&r1=23288&r2=23289&view=diff
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Tue Jul 25 23:20:49 2006
@@ -250,8 +250,9 @@
 	
 	if (This->mDdCreatePalette.CreatePalette(&This->mDdCreatePalette) == DDHAL_DRIVER_HANDLED);
     {				
-		if (This->mDdSetMode.ddRVal == DD_OK)
+		if (This->mDdCreatePalette.ddRVal == DD_OK)
 		{
+			
 			Main_DirectDraw_AddRef(iface);
 			return That->lpVtbl->Initialize (*ppPalette, (LPDIRECTDRAW)iface, dwFlags, palent);
 		}
@@ -305,12 +306,9 @@
     That->lpVtbl_v3 = &DDRAW_IDDS3_Thunk_VTable;
 	*ppSurf = (LPDIRECTDRAWSURFACE7)That;
 
-    // FIXME free This->mDDrawGlobal.dsList  on release 
-    This->mDDrawGlobal.dsList = (LPDDRAWI_DDRAWSURFACE_INT)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 
-                                                                            sizeof(DDRAWI_DDRAWSURFACE_INT));        
+             
     That->Owner = (IDirectDrawImpl *)This;
-    That->Owner->mDDrawGlobal.dsList->dwIntRefCnt =1;
-
+    
     /* we alwasy set to use the DirectDrawSurface7_Vtable as internel */
     That->Owner->mDDrawGlobal.dsList->lpVtbl = (PVOID) &DirectDrawSurface7_Vtable;
    
@@ -1101,9 +1099,16 @@
 	This->mDdSetMode.ddRVal = DDERR_NOTPALETTIZED;
 	
     This->mDdSetMode.dwModeIndex = iMode; 
-	This->mDdSetMode.SetMode(&This->mDdSetMode);
-	
-	DdReenableDirectDrawObject(&This->mDDrawGlobal, &dummy);
+	
+	if (This->mDdSetMode.SetMode(&This->mDdSetMode) == DDHAL_DRIVER_HANDLED)
+	{
+		if (This->mDdSetMode.ddRVal == DD_OK)
+			//DdReenableDirectDrawObject(&This->mDDrawGlobal, &dummy);
+		}
+	}
+	
+	
+	
 
 	/* FIXME fill the This->DirectDrawGlobal.vmiData right */		     
      //This->mDDrawGlobal.lpExclusiveOwner->hDC  = (ULONG_PTR)GetDC( (HWND)This->mDDrawGlobal.lpExclusiveOwner->hWnd);  

Modified: trunk/reactos/dll/directx/ddraw/startup.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/startup.c?rev=23289&r1=23288&r2=23289&view=diff
==============================================================================
--- trunk/reactos/dll/directx/ddraw/startup.c (original)
+++ trunk/reactos/dll/directx/ddraw/startup.c Tue Jul 25 23:20:49 2006
@@ -212,6 +212,19 @@
     /* Setup calback struct so we do not need refill same info again */
     This->mDdCreateSurface.lpDD = &This->mDDrawGlobal;    
     This->mDdCanCreateSurface.lpDD = &This->mDDrawGlobal;  
+
+
+    /* Setup global surface */  
+	// FIXME free dsList when we exist
+	This->mDDrawGlobal.dsList = (LPDDRAWI_DDRAWSURFACE_INT)DxHeapMemAlloc(sizeof(DDRAWI_DDRAWSURFACE_INT)); 
+	This->mDDrawGlobal.dsList->dwIntRefCnt =1;
+
+    This->mPrimaryGlobal.dwGlobalFlags = DDRAWISURFGBL_ISGDISURFACE;
+    This->mPrimaryGlobal.lpDD       = &This->mDDrawGlobal;
+    This->mPrimaryGlobal.lpDDHandle = &This->mDDrawGlobal;
+    This->mPrimaryGlobal.wWidth  = (WORD)This->mpModeInfos[0].dwWidth;
+    This->mPrimaryGlobal.wHeight = (WORD)This->mpModeInfos[0].dwHeight;
+    This->mPrimaryGlobal.lPitch  = This->mpModeInfos[0].lPitch;
                   
     return DD_OK;
 }
@@ -364,13 +377,7 @@
   DriverInfo.dwExpectedSize = sizeof(DDHAL_DDMISCELLANEOUSCALLBACKS);
   This->mHALInfo.GetDriverInfo(&DriverInfo);
 
-  /* Setup global surface */   
-  /*This->mPrimaryGlobal.dwGlobalFlags = DDRAWISURFGBL_ISGDISURFACE;
-  This->mPrimaryGlobal.lpDD       = &This->mDDrawGlobal;
-  This->mPrimaryGlobal.lpDDHandle = &This->mDDrawGlobal;
-  This->mPrimaryGlobal.wWidth  = (WORD)This->mpModeInfos[0].dwWidth;
-  This->mPrimaryGlobal.wHeight = (WORD)This->mpModeInfos[0].dwHeight;
-  This->mPrimaryGlobal.lPitch  = This->mpModeInfos[0].lPitch;*/
+  
 
   /* FIXME free it in cleanup */
   // This->mDDrawGlobal.dsList = (LPDDRAWI_DDRAWSURFACE_INT)DxHeapMemAlloc(sizeof(DDRAWI_DDRAWSURFACE_INT)); 




More information about the Ros-diffs mailing list