|
From: <no...@us...> - 2003-07-21 19:11:23
|
Log Message:
-----------
Fixed source so plugins that rely on window messages in software mode function.
Modified Files:
--------------
/cvsroot/decaldev/source/Inject:
Inject.cpp
Manager.cpp
Manager.h
Revision Data
-------------
Index: Inject.cpp
===================================================================
RCS file: /cvsroot/decaldev/source/Inject/Inject.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- Inject.cpp 20 Jun 2003 06:39:54 -0000 1.22
+++ Inject.cpp 21 Jul 2003 19:11:22 -0000 1.23
@@ -264,6 +264,9 @@
pDDHook->setObject( pDD );
pDDHook->QueryInterface( IID_IDirectDraw, reinterpret_cast< void ** >( lplpDD ) );
+
+ if( !CheckForHardwareMode( ) )
+ cManager::_p->enableSoftwareMode( );
return hRes;
}
Index: Manager.cpp
===================================================================
RCS file: /cvsroot/decaldev/source/Inject/Manager.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- Manager.cpp 20 Jun 2003 06:39:54 -0000 1.72
+++ Manager.cpp 21 Jul 2003 19:11:22 -0000 1.73
@@ -50,7 +50,8 @@
m_bContainer( false ),
m_bXMLViewViewer( false ),
m_hDecalDLL( NULL ),
- m_eAlphaBlendMode( eAlphaBlendSoftware )
+ m_eAlphaBlendMode( eAlphaBlendSoftware ),
+ m_bSoftware( false )
{
// Start the decal object
::CoInitialize( NULL );
@@ -153,7 +154,7 @@
m_pRootSite->create( &lp, NULL, pRootLayer );
}
- m_bInitialized = true;
+ m_bInitialized = true;
// Set the blending Mode from the Registry
{
@@ -379,10 +380,15 @@
_ASSERTE( FALSE );
}
+void cManager::enableSoftwareMode( )
+{
+ m_bSoftware = true;
+}
+
LRESULT cManager::localWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
-/* if((uMsg==WM_NCACTIVATE))/* || (uMsg==WM_ACTIVATE) || (uMsg==WM_ACTIVATEAPP) || (uMsg==WM_KILLFOCUS))*/
-/* return 0;*/
+/* if((uMsg==WM_NCACTIVATE))/* || (uMsg==WM_ACTIVATE) || (uMsg==WM_ACTIVATEAPP) || (uMsg==WM_KILLFOCUS))
+ return 0;*/
// When destory comes through, shut down the decal object
if ( uMsg == WM_DESTROY )
@@ -393,7 +399,7 @@
return ::CallWindowProc( m_pfnOld, m_hMain, uMsg, wParam, lParam );
}
- if(( m_pRootSite == NULL) || ((m_p3DDevice == NULL) && ( !m_bContainer ) ))
+ if( ( m_pRootSite == NULL ) || ( ( m_p3DDevice == NULL ) && ( !m_bContainer ) && ( !m_bSoftware ) ) )
// Quick return when we aren't initialized
return ::CallWindowProc( m_pfnOld, m_hMain, uMsg, wParam, lParam );
@@ -412,6 +418,10 @@
return 0;
}
}
+
+ // Return if there is no 3D Device
+ if( m_p3DDevice == NULL )
+ return ::CallWindowProc( m_pfnOld, m_hMain, uMsg, wParam, lParam );
if( uMsg >= WM_MOUSEFIRST && uMsg < WM_MOUSELAST )
{
Index: Manager.h
===================================================================
RCS file: /cvsroot/decaldev/source/Inject/Manager.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- Manager.h 18 Mar 2003 06:53:33 -0000 1.30
+++ Manager.h 21 Jul 2003 19:11:22 -0000 1.31
@@ -150,6 +150,7 @@
LPVOID m_lpSurface;
HMODULE m_hDecalDLL;
+ bool m_bSoftware;
public:
static CComObject< cManager > *_p;
@@ -161,6 +162,7 @@
void createSurface( LPSIZE psz, IDirectDrawSurface4 **ppSurf );
void convertVersion( LPTSTR szVersion, DWORD &dwVersionMajor, DWORD &dwVersionMinor );
+ void enableSoftwareMode( );
public:
STDMETHOD(get_Hooks)(/*[out, retval]*/ IACHooks * *pVal);
|