You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(42) |
Sep
(42) |
Oct
(57) |
Nov
(12) |
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(14) |
Feb
(4) |
Mar
(52) |
Apr
(13) |
May
(89) |
Jun
(38) |
Jul
(5) |
Aug
(32) |
Sep
(68) |
Oct
(27) |
Nov
(2) |
Dec
(13) |
2004 |
Jan
(3) |
Feb
(6) |
Mar
(3) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jeffrey D. <ha...@us...> - 2003-09-26 22:40:35
|
Log Message: ----------- AA -> on for panel + option to turn it off(why would anyone want to turn it off? *shrug* Modified Files: -------------- /cvsroot/decaldev/source/DecalControls: PushButton.cpp PushButton.h Revision Data ------------- Index: PushButton.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/PushButton.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- PushButton.cpp 13 Sep 2003 23:59:01 -0000 1.4 +++ PushButton.cpp 26 Sep 2003 22:40:22 -0000 1.5 @@ -137,53 +137,68 @@ STDMETHODIMP cPushButton::SchemaLoad( IView *pView, IUnknown *pSchema ) { - CComPtr< IPluginSite > pPlugin; - m_pSite->get_PluginSite( &pPlugin ); + CComPtr< IPluginSite > pPlugin; + m_pSite->get_PluginSite( &pPlugin ); - // Load some defaults - pPlugin->CreateFontSchema( 14, 0, pSchema, &m_pFont ); - pPlugin->LoadImageSchema( pSchema, &m_pBackground ); + // Load some defaults + pPlugin->CreateFontSchema( 14, 0, pSchema, &m_pFont ); + pPlugin->LoadImageSchema( pSchema, &m_pBackground ); - MSXML::IXMLDOMElementPtr pElement = pSchema; + MSXML::IXMLDOMElementPtr pElement = pSchema; - _variant_t vFaceColor = pElement->getAttribute( _T( "facecolor" ) ), - vTextColor = pElement->getAttribute( _T( "textcolor" ) ), - vText = pElement->getAttribute( _T( "text" ) ); + _variant_t vFaceColor = pElement->getAttribute( _T( "facecolor" ) ), + vTextColor = pElement->getAttribute( _T( "textcolor" ) ), + vText = pElement->getAttribute( _T( "text" ) ), + vAntialias = pElement->getAttribute( _T( "aa" ) ); - if( vFaceColor.vt != VT_NULL ) - { - try - { - m_nFaceColor = static_cast< long >( vFaceColor ); - m_UseFaceColor = true; // GKusnick: Render 3D outline. - } - catch( ... ) - { - // Type conversion error - _ASSERTE( FALSE ); - } - } + if( vFaceColor.vt != VT_NULL ) + { + try + { + m_nFaceColor = static_cast< long >( vFaceColor ); + m_UseFaceColor = true; // GKusnick: Render 3D outline. + } + catch( ... ) + { + // Type conversion error + _ASSERTE( FALSE ); + } + } - if( vTextColor.vt != VT_NULL ) - { - try - { - m_nTextColor = static_cast< long >( vTextColor ); - } - catch( ... ) - { - // Type conversion error - _ASSERTE( FALSE ); - } - } + if( vTextColor.vt != VT_NULL ) + { + try + { + m_nTextColor = static_cast< long >( vTextColor ); + } + catch( ... ) + { + // Type conversion error + _ASSERTE( FALSE ); + } + } - if( vText.vt != VT_NULL ) - { - _ASSERTE( vText.vt == VT_BSTR ); - m_strText = vText.bstrVal; - } + if( vText.vt != VT_NULL ) + { + _ASSERTE( vText.vt == VT_BSTR ); + m_strText = vText.bstrVal; + } - return S_OK; + m_bAA = true; + if( vAntialias.vt != VT_NULL ) + { + try + { + m_bAA = static_cast< bool >( vAntialias ); + } + catch( ... ) + { + // Type conversion error + _ASSERTE( FALSE ); + } + } + + return S_OK; } STDMETHODIMP cPushButton::MouseEnter(struct MouseState *) @@ -313,7 +328,7 @@ // Next, draw the text POINT ptText = { ( !bPressed ) ? m_ptText.x : m_ptText.x + 1, ( !bPressed ) ? m_ptText.y : m_ptText.y + 1 }; - m_pFont->DrawText( &ptText, m_strText, m_nTextColor, pCanvas ); + m_pFont->DrawTextEx( &ptText, m_strText, m_nTextColor, 0, m_bAA ? eAA : 0, pCanvas ); // Nerfgolem 2001.10.11 // Do not render the 3D outline if there's a background image. Index: PushButton.h =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/PushButton.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- PushButton.h 13 Sep 2003 23:59:01 -0000 1.3 +++ PushButton.h 26 Sep 2003 22:40:22 -0000 1.4 @@ -36,6 +36,7 @@ long m_nFaceColor, m_nTextColor; BOOL m_UseFaceColor; // GKusnick: Render 3D outline. + bool m_bAA; void onCreate(); |
From: Jeffrey D. <ha...@us...> - 2003-09-26 08:51:09
|
Log Message: ----------- Users now have the ability to set antialiasing off for static text (good for transparent views) and specify an outlinecolor for outlined text Modified Files: -------------- /cvsroot/decaldev/source/DecalControls: Static.cpp Static.h Revision Data ------------- Index: Static.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/Static.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Static.cpp 24 Sep 2003 01:28:48 -0000 1.6 +++ Static.cpp 26 Sep 2003 08:50:37 -0000 1.7 @@ -55,89 +55,122 @@ STDMETHODIMP cStatic::SchemaLoad(IView *pView, IUnknown *pSchema) { - CComPtr< IPluginSite > pPlugin; - m_pSite->get_PluginSite( &pPlugin ); + CComPtr< IPluginSite > pPlugin; + m_pSite->get_PluginSite( &pPlugin ); - pPlugin->CreateFontSchema( 14, 0, pSchema, &m_pFont ); + pPlugin->CreateFontSchema( 14, 0, pSchema, &m_pFont ); - MSXML::IXMLDOMElementPtr pElement = pSchema; + MSXML::IXMLDOMElementPtr pElement = pSchema; - _variant_t vText = pElement->getAttribute( _T( "text" ) ), + _variant_t vText = pElement->getAttribute( _T( "text" ) ), vTextColor = pElement->getAttribute( _T( "textcolor" ) ), vWidth = pElement->getAttribute( _T( "width" ) ), vHeight = pElement->getAttribute( _T( "height" ) ), - vJustify = pElement->getAttribute( _T( "justify" ) ); + vJustify = pElement->getAttribute( _T( "justify" ) ), + vOutline = pElement->getAttribute( _T( "outlinecolor" ) ), + vAntialias = pElement->getAttribute( _T( "aa" ) ); - // This is a required element - _ASSERTE( vText.vt == VT_BSTR ); + // This is a required element + _ASSERTE( vText.vt == VT_BSTR ); - // Store the text, assume left justification - m_strText = vText.bstrVal; - m_eJustify = eFontLeft; + // Store the text, assume left justification + m_strText = vText.bstrVal; + m_eJustify = eFontLeft; - // Determine the proper justification - if (vJustify.vt != VT_NULL) - { - _bstr_t bstrJustify = vJustify.bstrVal; - if (::_wcsicmp(L"left", bstrJustify) == 0) - { - m_eJustify = eFontLeft; - } - else if (::_wcsicmp(L"right", bstrJustify) == 0) - { - m_eJustify = eFontRight; - } - else if (::_wcsicmp(L"center", bstrJustify) == 0) - { - m_eJustify = eFontCenter; - } - } + // Determine the proper justification + if (vJustify.vt != VT_NULL) + { + _bstr_t bstrJustify = vJustify.bstrVal; + if (::_wcsicmp(L"left", bstrJustify) == 0) + { + m_eJustify = eFontLeft; + } + else if (::_wcsicmp(L"right", bstrJustify) == 0) + { + m_eJustify = eFontRight; + } + else if (::_wcsicmp(L"center", bstrJustify) == 0) + { + m_eJustify = eFontCenter; + } + } - // Determine the color - if( vTextColor.vt != VT_NULL ) - { - try - { - m_nTextColor = static_cast< long >( vTextColor ); - } - catch( ... ) - { - // Type conversion error - _ASSERTE( FALSE ); - } - } + // Determine the color + if( vTextColor.vt != VT_NULL ) + { + try + { + m_nTextColor = static_cast< long >( vTextColor ); + } + catch( ... ) + { + // Type conversion error + _ASSERTE( FALSE ); + } + } - /* - // Set the width of the static (not same as text width) - if( vWidth.vt != VT_NULL ) - { - try - { - m_nWidth = static_cast< long >( vWidth ); - } - catch( ... ) - { - // Type conversion error - _ASSERTE( FALSE ); - } - } + m_nOutlineColor = 0; + m_bOutline = false; + if( vOutline.vt != VT_NULL ) + { + try + { + m_bOutline = true; + m_nOutlineColor = static_cast< long >( vOutline ); + } + catch( ... ) + { + // Type conversion error + _ASSERTE( FALSE ); + } + } - // Set the height of the static (not same as text height or fontsize) - if( vHeight.vt != VT_NULL ) - { - try - { - m_nHeight = static_cast< long >( vHeight ); - } - catch( ... ) - { - // Type conversion error - _ASSERTE( FALSE ); - } - } - */ + m_bAA = true; + if( vAntialias.vt != VT_NULL ) + { + try + { + m_bAA = static_cast< bool >( vAntialias ); + } + catch( ... ) + { + // Type conversion error + _ASSERTE( FALSE ); + } + } - return S_OK; + + /* + // Set the width of the static (not same as text width) + if( vWidth.vt != VT_NULL ) + { + try + { + m_nWidth = static_cast< long >( vWidth ); + } + catch( ... ) + { + // Type conversion error + _ASSERTE( FALSE ); + } + } + + // Set the height of the static (not same as text height or fontsize) + if( vHeight.vt != VT_NULL ) + { + try + { + m_nHeight = static_cast< long >( vHeight ); + } + catch( ... ) + { + // Type conversion error + _ASSERTE( FALSE ); + } + } + */ + + return S_OK; } STDMETHODIMP cStatic::Render( ICanvas *pCanvas ) @@ -327,5 +360,13 @@ break; } - m_pFont->DrawText( &pt, szText, m_nTextColor, pCanvas ); + long lFlags = 0; + + if( m_bAA ) + lFlags |= eAA; + + if( m_bOutline ) + lFlags |= eOutlined; + + m_pFont->DrawTextEx( &pt, szText, m_nTextColor, m_nOutlineColor, lFlags, pCanvas ); } Index: Static.h =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/Static.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Static.h 22 Sep 2003 02:56:51 -0000 1.4 +++ Static.h 26 Sep 2003 08:50:37 -0000 1.5 @@ -23,7 +23,7 @@ { public: cStatic() - : m_nTextColor( RGB( 0, 0, 0 ) ) + : m_nTextColor( RGB( 0, 0, 0 ) ) { } @@ -32,6 +32,9 @@ CComPtr< IFontCache > m_pFont; _bstr_t m_strText; long m_nTextColor; + long m_nOutlineColor; + bool m_bAA; + bool m_bOutline; //long m_nWidth; //long m_nHeight; eFontJustify m_eJustify; |
From: Jeffrey D. <ha...@us...> - 2003-09-26 08:25:47
|
Log Message: ----------- DrawTextEx - gives options for AA and outlined text Modified Files: -------------- /cvsroot/decaldev/source/Inject: FontCache.cpp FontCache.h Inject.idl Revision Data ------------- Index: FontCache.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/FontCache.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FontCache.cpp 17 Sep 2003 23:08:54 -0000 1.2 +++ FontCache.cpp 26 Sep 2003 08:25:25 -0000 1.3 @@ -81,57 +81,125 @@ STDMETHODIMP cFontCache::DrawText( LPPOINT ppt, BSTR strText, long clr, ICanvas *pCanvas ) { - _ASSERTE( ppt != NULL ); - _ASSERTE( strText != NULL ); - _ASSERTE( pCanvas != NULL ); +/* _ASSERTE( ppt != NULL ); + _ASSERTE( strText != NULL ); + _ASSERTE( pCanvas != NULL ); - if( !checkBuffer() ) - return E_FAIL; + if( !checkBuffer() ) + return E_FAIL; - USES_CONVERSION; + USES_CONVERSION; - LPCTSTR szText = OLE2T( strText ); + LPCTSTR szText = OLE2T( strText ); - // TODO: Draw this a lot faster from a cached bitmap value + // TODO: Draw this a lot faster from a cached bitmap value - HDC hdc; - pCanvas->GetDC( &hdc ); + HDC hdc; + pCanvas->GetDC( &hdc ); - // Draw the text - HFONT hfnt = ::CreateFontIndirect( &m_lf ), - hfntOld = reinterpret_cast< HFONT >( ::SelectObject( hdc, hfnt ) ); + // Draw the text + HFONT hfnt = ::CreateFontIndirect( &m_lf ), + hfntOld = reinterpret_cast< HFONT >( ::SelectObject( hdc, hfnt ) ); - ::SetBkMode( hdc, TRANSPARENT ); - ::SetTextColor( hdc, clr ); - ::SetTextAlign( hdc, TA_TOP | TA_LEFT ); + ::SetBkMode( hdc, TRANSPARENT ); + ::SetTextColor( hdc, clr ); + ::SetTextAlign( hdc, TA_TOP | TA_LEFT ); - LPCSTR szAnsi = OLE2A( strText ); - int cbLength = ::strlen( szAnsi ); + LPCSTR szAnsi = OLE2A( strText ); + int cbLength = ::strlen( szAnsi ); - INT *pDeltas = new INT[ cbLength ]; + INT *pDeltas = new INT[ cbLength ]; - // Fill in the character deltas - const char *i_src = szAnsi; - INT *i_end_deltas = pDeltas + cbLength; - for( INT *i_delta = pDeltas; i_delta != i_end_deltas; ++ i_delta, ++ i_src ) - *i_delta = m_nWidths[ *i_src ].m_nWidth; + // Fill in the character deltas + const char *i_src = szAnsi; + INT *i_end_deltas = pDeltas + cbLength; + for( INT *i_delta = pDeltas; i_delta != i_end_deltas; ++ i_delta, ++ i_src ) + *i_delta = m_nWidths[ *i_src ].m_nWidth; - if( m_bFontSmoothing ) - SystemParametersInfo( SPI_SETFONTSMOOTHING, FALSE, NULL, 0 ); + if( m_bFontSmoothing ) + SystemParametersInfo( SPI_SETFONTSMOOTHING, FALSE, NULL, 0 ); - ::ExtTextOut( hdc, ppt->x, ppt->y, 0, NULL, szAnsi, cbLength, pDeltas ); + ::ExtTextOut( hdc, ppt->x, ppt->y, 0, NULL, szAnsi, cbLength, pDeltas ); - if( m_bFontSmoothing ) - SystemParametersInfo( SPI_SETFONTSMOOTHING, TRUE, NULL, 0 ); + if( m_bFontSmoothing ) + SystemParametersInfo( SPI_SETFONTSMOOTHING, TRUE, NULL, 0 ); - delete[] pDeltas; + delete[] pDeltas; - ::SelectObject( hdc, hfntOld ); - ::DeleteObject( hfnt ); + ::SelectObject( hdc, hfntOld ); + ::DeleteObject( hfnt ); - pCanvas->ReleaseDC(); + pCanvas->ReleaseDC(); - return S_OK; + return S_OK;*/ + return DrawTextEx( ppt, strText, clr, 0, 0, pCanvas ); +} + +STDMETHODIMP cFontCache::DrawTextEx( LPPOINT ppt, BSTR strText, long clr1, long clr2, long lFlags, ICanvas *pCanvas ) +{ + _ASSERTE( ppt != NULL ); + _ASSERTE( strText != NULL ); + _ASSERTE( pCanvas != NULL ); + + if( !checkBuffer() ) + return E_FAIL; + + USES_CONVERSION; + + LPCTSTR szText = OLE2T( strText ); + + // TODO: Draw this a lot faster from a cached bitmap value + + HDC hdc; + pCanvas->GetDC( &hdc ); + + // Draw the text + HFONT hfnt = ::CreateFontIndirect( &m_lf ), + hfntOld = reinterpret_cast< HFONT >( ::SelectObject( hdc, hfnt ) ); + + ::SetBkMode( hdc, TRANSPARENT ); + ::SetTextAlign( hdc, TA_TOP | TA_LEFT ); + + LPCSTR szAnsi = OLE2A( strText ); + int cbLength = ::strlen( szAnsi ); + + INT *pDeltas = new INT[ cbLength ]; + + // Fill in the character deltas + const char *i_src = szAnsi; + INT *i_end_deltas = pDeltas + cbLength; + for( INT *i_delta = pDeltas; i_delta != i_end_deltas; ++ i_delta, ++ i_src ) + *i_delta = m_nWidths[ *i_src ].m_nWidth; + + if( !(lFlags & eAA) ) + if( m_bFontSmoothing ) + SystemParametersInfo( SPI_SETFONTSMOOTHING, FALSE, NULL, 0 ); + + if( lFlags & eOutlined ) + { + ::SetTextColor( hdc, clr2 ); + + ::ExtTextOut( hdc, ppt->x - 1, ppt->y - 1, 0, NULL, szAnsi, cbLength, pDeltas ); + ::ExtTextOut( hdc, ppt->x - 1, ppt->y + 1, 0, NULL, szAnsi, cbLength, pDeltas ); + ::ExtTextOut( hdc, ppt->x + 1, ppt->y - 1, 0, NULL, szAnsi, cbLength, pDeltas ); + ::ExtTextOut( hdc, ppt->x + 1, ppt->y + 1, 0, NULL, szAnsi, cbLength, pDeltas ); + } + + ::SetTextColor( hdc, clr1 ); + ::ExtTextOut( hdc, ppt->x, ppt->y, 0, NULL, szAnsi, cbLength, pDeltas ); + + if( !(lFlags & eAA) ) + if( m_bFontSmoothing ) + SystemParametersInfo( SPI_SETFONTSMOOTHING, TRUE, NULL, 0 ); + + delete[] pDeltas; + + ::SelectObject( hdc, hfntOld ); + ::DeleteObject( hfnt ); + + pCanvas->ReleaseDC(); + + return S_OK; } STDMETHODIMP cFontCache::MeasureText( BSTR strText, LPSIZE pszExt ) Index: FontCache.h =================================================================== RCS file: /cvsroot/decaldev/source/Inject/FontCache.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FontCache.h 17 Sep 2003 23:08:54 -0000 1.2 +++ FontCache.h 26 Sep 2003 08:25:25 -0000 1.3 @@ -43,7 +43,8 @@ public: STDMETHOD(HitTest)(BSTR szText, long nPos, /*[out, retval]*/ long *nIndex); STDMETHOD(MeasureText)( BSTR szText, /*[out]*/ LPSIZE pszExt ); - STDMETHOD(DrawText)( LPPOINT pt, BSTR szText, long clr, ICanvas *pCanvas ); + STDMETHOD(DrawText)( LPPOINT pt, BSTR szText, long clr, ICanvas *pCanvas ); + STDMETHOD(DrawTextEx)( LPPOINT pt, BSTR szText, long clr1, long clr2, long lFlags, ICanvas *pCanvas ); }; #endif //__FONTCACHE_H_ Index: Inject.idl =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Inject.idl,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- Inject.idl 25 Sep 2003 19:50:11 -0000 1.42 +++ Inject.idl 26 Sep 2003 08:25:25 -0000 1.43 @@ -61,6 +61,12 @@ eFontCenter }; +enum eDrawTextExFlags +{ + eAA = 0x1, + eOutlined = 0x2, +}; + enum eDefaultControlType { eCtlButton, @@ -427,6 +433,7 @@ [helpstring("Renders text to a canvas. Only guaranteed to work within the render cycle.")] HRESULT DrawText( LPPOINT pt, BSTR szText, long clr, ICanvas *pTarget ); [helpstring("Returns the width and height of a string of text.")] HRESULT MeasureText(BSTR szText, [out, retval] LPSIZE pszExt); [helpstring("method HitTest")] HRESULT HitTest(BSTR szText, long nPos, [out, retval] long *nIndex); + [helpstring("Renders text to a canvas. Only guaranteed to work within the render cycle.")] HRESULT DrawTextEx( LPPOINT pt, BSTR szText, long clr1, long clr2, long flags, ICanvas *pTarget ); }; [ |
From: BJ H. <par...@us...> - 2003-09-24 16:27:46
|
Log Message: ----------- memory leak in QueryKeyboardMap Modified Files: -------------- /cvsroot/decaldev/source/Inject: Manager.cpp Revision Data ------------- Index: Manager.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Manager.cpp,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- Manager.cpp 27 Aug 2003 19:02:19 -0000 1.75 +++ Manager.cpp 24 Sep 2003 16:27:43 -0000 1.76 @@ -1292,7 +1292,7 @@ HANDLE hFile; - DWORD dwType = REG_SZ; + //DWORD dwType = REG_SZ; DWORD dwLengthPath = MAX_PATH; DWORD dwLengthMap; DWORD dwFileSize; @@ -1344,6 +1344,7 @@ if (!bSuccess) { + delete[] pBuffer; return E_FAIL; } @@ -1370,7 +1371,8 @@ } } } - + delete[] pBuffer; + return S_OK; } |
From: Todd D. P. <ci...@us...> - 2003-09-24 03:51:29
|
Log Message: ----------- sorry module should be zero (0) for background -- just safer that way Modified Files: -------------- /cvsroot/decaldev/source/Inject: Button.cpp Revision Data ------------- Index: Button.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Button.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Button.cpp 24 Sep 2003 03:35:24 -0000 1.3 +++ Button.cpp 24 Sep 2003 03:51:26 -0000 1.4 @@ -60,7 +60,7 @@ POINT pt = { 0, 0 }; - if (m_nBackground != 0) pIcons->DrawIcon( &pt, m_nBackground, m_nModule, pCanvas ); + if (m_nBackground != 0) pIcons->DrawIcon( &pt, m_nBackground, 0, pCanvas ); pIcons->DrawIcon( &pt, nImage, m_nModule, pCanvas ); _ASSERTMEM( _CrtCheckMemory( ) ); |
From: Todd D. P. <ci...@us...> - 2003-09-24 03:35:27
|
Log Message: ----------- the original IButton type now has an optional "backgroud" parameter which can specify an icon in the same moduile as the press and release images that will get draw underneath them. Modified Files: -------------- /cvsroot/decaldev/source/Inject: Button.cpp Button.h Revision Data ------------- Index: Button.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Button.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Button.cpp 29 Sep 2001 02:31:07 -0000 1.2 +++ Button.cpp 24 Sep 2003 03:35:24 -0000 1.3 @@ -60,6 +60,7 @@ POINT pt = { 0, 0 }; + if (m_nBackground != 0) pIcons->DrawIcon( &pt, m_nBackground, m_nModule, pCanvas ); pIcons->DrawIcon( &pt, nImage, m_nModule, pCanvas ); _ASSERTMEM( _CrtCheckMemory( ) ); @@ -174,7 +175,8 @@ _variant_t vModule = pElement->getAttribute( _T( "iconlibrary" ) ), vReleased = pElement->getAttribute( _T( "icon" ) ), vPressed = pElement->getAttribute( _T( "pressedicon" ) ), - vMatte = pElement->getAttribute( _T( "matte" ) ); + vMatte = pElement->getAttribute( _T( "matte" ) ), + vBackground = pElement->getAttribute( _T( "background" ) ); if( vModule.vt == VT_BSTR ) pPlugin->LoadResourceModule( vModule.bstrVal, &m_nModule ); @@ -218,6 +220,23 @@ // Type conversion error _ASSERTE( FALSE ); } + } + + if( vBackground.vt != VT_NULL ) + { + try + { + m_nBackground = static_cast< long >( vBackground ) + 0x06000000; + } + catch( ... ) + { + // Type conversion error + _ASSERTE( FALSE ); + } + } + else + { + m_nBackground = 0; } return S_OK; Index: Button.h =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Button.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Button.h 29 Sep 2001 06:24:22 -0000 1.2 +++ Button.h 24 Sep 2003 03:35:24 -0000 1.3 @@ -28,6 +28,7 @@ long m_nModule; long m_nReleased; long m_nPressed; + long m_nBackground; VARIANT_BOOL m_bPressed, m_bMouseIn; |
From: Todd D. P. <ci...@us...> - 2003-09-24 02:11:56
|
Log Message: ----------- take two -- sorry <algorithm> needs to preceed usage of std Modified Files: -------------- /cvsroot/decaldev/source/DecalControls: StdAfx.h Revision Data ------------- Index: StdAfx.h =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/StdAfx.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- StdAfx.h 24 Sep 2003 02:08:49 -0000 1.7 +++ StdAfx.h 24 Sep 2003 02:11:25 -0000 1.8 @@ -17,6 +17,12 @@ #define NOMINMAX #include <atlbase.h> +#include <list> +#include <vector> +#include <algorithm> +#include <deque> +#include <map> +#include <string> // Keep things backward compatible #if defined(_MSC_VER) && _MSC_VER <= 1200 @@ -32,12 +38,6 @@ extern CComModule _Module; #include <atlcom.h> -#include <list> -#include <vector> -#include <algorithm> -#include <deque> -#include <map> -#include <string> #include "..\Inject\Inject.h" #import <msxml.dll> |
From: Todd D. P. <ci...@us...> - 2003-09-24 02:08:51
|
Log Message: ----------- just keeping things backward compatible compilerwise also figured if we're using std::max might as well use std::min too Modified Files: -------------- /cvsroot/decaldev/source/DecalControls: StdAfx.h Revision Data ------------- Index: StdAfx.h =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/StdAfx.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- StdAfx.h 23 Sep 2003 05:18:30 -0000 1.6 +++ StdAfx.h 24 Sep 2003 02:08:49 -0000 1.7 @@ -13,7 +13,20 @@ #define _WIN32_WINDOWS 0x0410 #define _ATL_APARTMENT_THREADED +// Don't use macros for min() and max()!!! +#define NOMINMAX + #include <atlbase.h> + +// Keep things backward compatible +#if defined(_MSC_VER) && _MSC_VER <= 1200 +#define min std::_cpp_min +#define max std::_cpp_max +#else +using std::min; +using std::max; +#endif + //You may derive a class from CComModule and use it if you want to override //something, but do not change the name of _Module extern CComModule _Module; @@ -27,7 +40,6 @@ #include <string> #include "..\Inject\Inject.h" #import <msxml.dll> -using std::max; #ifdef _CHECKMEM #define _ASSERTMEM(a) _ASSERTE(a) |
From: Todd D. P. <ci...@us...> - 2003-09-24 01:28:51
|
Log Message: ----------- Static text now understands "\n" in the string as a line-break Modified Files: -------------- /cvsroot/decaldev/source/DecalControls: Static.cpp Revision Data ------------- Index: Static.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/Static.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Static.cpp 22 Sep 2003 02:56:51 -0000 1.5 +++ Static.cpp 24 Sep 2003 01:28:48 -0000 1.6 @@ -153,21 +153,95 @@ pPlugin->CreateFont( bstrFontName /*_bstr_t( _T( "Times New Roman" ) )*/, 14, 0, &m_pFont ); } - SIZE Size; - char *token; - _bstr_t strText= m_strText.copy(); - _bstr_t temp=_bstr_t(""); - - POINT ptText = { 0, 0 }; + SIZE Size; + char *token; + POINT ptText = { 0, 0 }; - m_pFont->MeasureText(strText, &Size); - int height = Size.cy; + //_bstr_t strText= m_strText.copy(); + //_bstr_t temp=_bstr_t(""); + // Determine control size RECT rcPos; m_pSite->get_Position(&rcPos); int nWidth = rcPos.right - rcPos.left; int nHeight = rcPos.bottom - rcPos.top; + // Copy the string for parsing + std::string strText((const char *) m_strText); + + // Determine line height + m_pFont->MeasureText(_bstr_t(strText.data()), &Size); + int height = Size.cy; + + // Break it into lines (can't use strtok or we miss blank lines) + std::vector<_bstr_t> lines; + int nStart = 0, nEnd; + bool bDone = false; + while (!bDone) + { + // Get the next CR + nEnd = strText.find("\n", nStart); + if (nEnd == std::string::npos) + { + bDone = true; + nEnd = strText.length(); + } + + // Store the line + lines.push_back(strText.substr(nStart, nEnd - nStart).data()); + + // Move one character beyond + nStart = nEnd + 1; + } + + // Loop through the lines + _bstr_t bstrSpace(" "), bstrEmpty(""); + int nIndex, nLines = lines.size(); + for (nIndex = 0, bDone = false; !bDone && (nIndex < nLines); nIndex++) + { + // Copy the line for parsing + _bstr_t strLine((const char *) lines[nIndex]); + + // Line to be built + _bstr_t strOut = bstrEmpty; + + // Loop through the "words" on the line + for (token = ::strtok((char *) strLine, " "); !bDone && (token != NULL); token = ::strtok(NULL, " ")) + { + _bstr_t bstrToken(token); + + // Measure this token + m_pFont->MeasureText(strOut + bstrToken, &Size); + + // Is this line full??? + if (Size.cx > nWidth) + { + DrawText(&ptText, strOut, pCanvas); + ptText.y += height; + + // Does the next line put us over the top + bDone = ((ptText.y + height) > nHeight) ? true : false; + + // Clear the line + strOut = bstrEmpty; + } + + // Store the token + strOut += bstrToken + bstrSpace; + } + + // Draw as needed + if (!bDone) + { + DrawText(&ptText, strOut, pCanvas); + ptText.y += height; + } + + // Does the next line put us over the top + bDone = ((ptText.y + height) > nHeight) ? true : false; + } + + /* if(Size.cx > nWidth) { for( token = ::strtok( (char*)strText, " " ); token !=NULL; token = ::strtok( NULL, " " ) ) @@ -193,6 +267,7 @@ { DrawText( &ptText, strText, pCanvas ); } + */ return S_OK; } |
From: Jeffrey D. <ha...@us...> - 2003-09-23 07:35:57
|
Log Message: ----------- Solo views can release and won't have a ghost Modified Files: -------------- /cvsroot/decaldev/source/Inject: View.cpp Revision Data ------------- Index: View.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/View.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- View.cpp 17 Sep 2003 23:22:11 -0000 1.22 +++ View.cpp 23 Sep 2003 07:35:24 -0000 1.23 @@ -15,13 +15,19 @@ cView::~cView( ) { m_bActivated = false; - m_pRoot->m_pBars->RemoveBar( m_nViewID ); - m_pPanel->RemoveView( m_nViewID ); - m_pRoot->removeView( this ); - m_pPanel.Release( ); + m_pRoot->m_pBars->RemoveBar( m_nViewID ); + m_pPanel->RemoveView( m_nViewID ); + m_pRoot->removeView( this ); - if( cManager::_p->m_bContainer ) - cManager::_p->clearDestroyList( ); + long nActiveView; + m_pPanel->get_ActiveView( &nActiveView ); + m_pRoot->SelectBar( nActiveView ); + m_pRoot->SelectBar( nActiveView ); + + m_pPanel.Release(); + + if( cManager::_p->m_bContainer ) + cManager::_p->clearDestroyList( ); } long cView::loadSchema( BSTR strSchema, IUnknown **ppRootControl ) @@ -325,11 +331,15 @@ STDMETHODIMP cView::put_Title(BSTR newVal) { - _ASSERTE( newVal != NULL ); + _ASSERTE( newVal != NULL ); - m_VP.label = _bstr_t( newVal ).copy( ); + bool bActivated = m_bActivated; - m_pRoot->m_pBars->put_Bar( m_nViewID, &m_VP ); + m_VP.label = _bstr_t( newVal ).copy( ); + m_pRoot->m_pBars->put_Bar( m_nViewID, &m_VP ); + + if( bActivated ) + m_pPanel->Deactivate(), m_pRoot->SelectBar( m_nViewID ); return S_OK; } @@ -382,10 +392,10 @@ { long nActiveView; m_pPanel->get_ActiveView( &nActiveView ); - + if (nActiveView != m_nViewID) m_pRoot->SelectBar( m_nViewID ); - + return S_OK; } |
From: Jeffrey D. <ha...@us...> - 2003-09-23 05:24:01
|
Log Message: ----------- off by one Modified Files: -------------- /cvsroot/decaldev/source/DecalControls: Slider.cpp Revision Data ------------- Index: Slider.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/Slider.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Slider.cpp 23 Sep 2003 05:18:30 -0000 1.6 +++ Slider.cpp 23 Sep 2003 05:23:58 -0000 1.7 @@ -490,7 +490,7 @@ // I personally like being able to drag the slider // PAST THE EDGE OF THE SLIDE BAR without needing pixel accuracy... - if( pt.x > m_rcBar.right ) + if( pt.x >= m_rcBar.right ) m_nSliderPos = m_nMaximum; Reformat(); |
From: Jeffrey D. <ha...@us...> - 2003-09-23 05:18:46
|
Log Message: ----------- Sliders need love too.. try properties mincolor and maxcolor in XML for fun. Modified Files: -------------- /cvsroot/decaldev/source/DecalControls: Slider.cpp Slider.h StdAfx.h Revision Data ------------- Index: Slider.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/Slider.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Slider.cpp 24 Aug 2002 02:29:43 -0000 1.5 +++ Slider.cpp 23 Sep 2003 05:18:30 -0000 1.6 @@ -11,6 +11,8 @@ m_bGrappled(VARIANT_FALSE), m_nMinimum(0), m_nMaximum(100), + m_nMinSliderColor( RGB(200,0,0) ), + m_nMaxSliderColor( RGB(0,200,0) ), m_nSliderPos(0), m_strTextLeft(NULL), m_strTextRight(NULL), @@ -130,7 +132,8 @@ return S_OK; } -STDMETHODIMP cSlider::SchemaLoad(IView *pView, IUnknown *pSchema) { +STDMETHODIMP cSlider::SchemaLoad(IView *pView, IUnknown *pSchema) +{ // First attempt to load the font CComPtr< IPluginSite > pPlugin; m_pSite->get_PluginSite( &pPlugin ); @@ -140,9 +143,12 @@ MSXML::IXMLDOMElementPtr pElement = pSchema; _variant_t vTextColor = pElement->getAttribute(_T("textcolor")), + vMinSliderColor = pElement->getAttribute(_T("mincolor")), + vMaxSliderColor = pElement->getAttribute(_T("maxcolor")), vVertical = pElement->getAttribute(_T("vertical")), vMaximum = pElement->getAttribute(_T("maximum")), - vMinimum = pElement->getAttribute(_T("minimum")); + vMinimum = pElement->getAttribute(_T("minimum")), + vName = pElement->getAttribute(_T("name")); // Maximum must exist _ASSERTE(vMaximum.vt == VT_INT); @@ -156,6 +162,26 @@ } } + if (vMinSliderColor.vt != VT_NULL) { + try { + _bstr_t szWhat = vMinSliderColor.bstrVal; + m_nMinSliderColor = wcstoul( szWhat, 0, 16 ); + } catch( ... ) { + // Type conversion error + _ASSERTE(FALSE); + } + } + + if (vMaxSliderColor.vt != VT_NULL) { + try { + _bstr_t szWhat = vMaxSliderColor.bstrVal; + m_nMaxSliderColor = wcstoul( szWhat, 0, 16 ); + } catch( ... ) { + // Type conversion error + _ASSERTE(FALSE); + } + } + if (vVertical.vt != VT_NULL) { try { m_bVertical = (static_cast<bool>(vVertical)) ? VARIANT_TRUE : VARIANT_FALSE; @@ -167,7 +193,7 @@ if (vMaximum.vt != VT_NULL) { try { - m_nMaximum = vMaximum.lVal; + m_nMaximum = static_cast<long>(vMaximum); } catch( ... ) { // Type conversion error _ASSERTE(FALSE); @@ -176,13 +202,66 @@ if (vMinimum.vt != VT_NULL) { try { - m_nMinimum = vMinimum.lVal; + m_nMinimum = static_cast<long>(vMinimum); } catch( ... ) { // Type conversion error _ASSERTE(FALSE); } } +/* fprintf( f, "name - %s\n", OLE2A(vName.bstrVal) ); + fprintf( f, "textcolor - %08X\n", m_nTextColor ); + fprintf( f, "mincolor - %08X\n", m_nMinSliderColor ); + fprintf( f, "maxcolor - %08X\n", m_nMaxSliderColor ); + fprintf( f, "vertical - %X\n", m_bVertical ); + fprintf( f, "maximum - %08X\n", m_nMaximum ); + fprintf( f, "minimum - %08X\n\n", m_nMinimum ); */ + +/* // it's a pain in the ass that we need set the min and max for them to work, aye? let's fix it + RECT rc; + m_pSite->get_Position(&rc); + + long siteHHalf = (rc.bottom - rc.top) / 2; + + // The background bar + m_rcBackground.left = 0; + m_rcBackground.top = siteHHalf - 4; + m_rcBackground.bottom = siteHHalf + 6; + m_rcBackground.right = rc.right - rc.left; + + // The middle bar + m_rcBar.top = siteHHalf; + m_rcBar.left = 0; + m_rcBar.bottom = siteHHalf + 3; + m_rcBar.right = rc.right - rc.left; + + // Ensure sane slider position + if (m_nSliderPos < m_nMinimum) + m_nSliderPos = m_nMinimum; + + if (m_nSliderPos > m_nMaximum) + m_nSliderPos = m_nMaximum; + + long siteDiff = abs(m_rcBar.right - m_rcBar.left); + long extentDiff = abs(m_nMaximum - m_nMinimum); + long valDiff = m_nSliderPos - m_nMinimum; + + if (valDiff == 0) { + m_ptSlider.x = m_rcBar.left; + + } else { + long diff = (long)(((float)valDiff / (float)extentDiff) * (float)siteDiff); + + m_ptSlider.x = m_rcBar.left + diff; + + if (m_ptSlider.x >= m_rcBar.right - 6) + m_ptSlider.x = m_rcBar.right - 6; + } + + m_ptSlider.y = siteHHalf - 5; +*/ + +// fclose( f ); return S_OK; } @@ -267,7 +346,12 @@ return S_OK; } -STDMETHODIMP cSlider::Render(ICanvas *pCanvas) { +STDMETHODIMP cSlider::Render(ICanvas *pCanvas) +{ + // intensity to lose or gain for 3d effect + #define COLOR_BAND 20 + + USES_CONVERSION; CComPtr<IPluginSite> pPlugin; m_pSite->get_PluginSite(&pPlugin); @@ -276,19 +360,74 @@ SIZE szIcon = {7, 12}; pPlugin->GetIconCache(&szIcon, &pIcon); -// pCanvas->Fill(&m_rcBackground, RGB(3, 3, 3)); - + // we're averaging color differences w/bias... float fractional = m_nSliderPos / m_nMaximum; - long greenFraction = 80 + (120 * (1 - fractional)); - long redFration = 80 + (120 * fractional); + float lFraction = (1 - fractional) * 2; + float rFraction = fractional * 2; - pCanvas->Fill(&m_rcBar, RGB(redFration, greenFraction, 0)); + long lMinSliderRed = lFraction * (BYTE) m_nMinSliderColor; + long lMinSliderGreen = lFraction * (BYTE) (m_nMinSliderColor >> 8); + long lMinSliderBlue = lFraction * (BYTE) (m_nMinSliderColor >> 16); + + long lMaxSliderRed = rFraction * (BYTE) m_nMaxSliderColor; + long lMaxSliderGreen = rFraction * (BYTE) (m_nMaxSliderColor >> 8); + long lMaxSliderBlue = rFraction * (BYTE) (m_nMaxSliderColor >> 16); + + long lFillColorTop, lFillColorMiddle, lFillColorBottom; + + long lFillColorRed = (lMinSliderRed + lMaxSliderRed) / 2, + lFillColorGreen = (lMinSliderGreen + lMaxSliderGreen) / 2, + lFillColorBlue = (lMinSliderBlue + lMaxSliderBlue) / 2; + + if( m_nMinSliderColor && m_nMaxSliderColor ) // not black .. who would choose all black for both bars anyway? grr. + { + // find the most intense color channel to maul for our evil purposes (we're using std::max here) + long lMax = max( max( lFillColorRed, lFillColorGreen ), lFillColorBlue ); + + // if we're dark, don't overflow + long lOffset = lMax > (COLOR_BAND - 1) ? COLOR_BAND : 0; + long lOffset2 = lMax > (COLOR_BAND - 1) ? 0 : COLOR_BAND; + + // red + if( lMax == lFillColorRed ) + { + lFillColorTop = RGB( lFillColorRed - lOffset, lFillColorGreen, lFillColorBlue ); + lFillColorMiddle = RGB( lFillColorRed + lOffset2, lFillColorGreen, lFillColorBlue ); + lFillColorBottom = RGB( lFillColorRed - lOffset, lFillColorGreen, lFillColorBlue ); + } + + // green + else if( lMax == lFillColorGreen ) + { + lFillColorTop = RGB( lFillColorRed, lFillColorGreen - lOffset, lFillColorBlue ); + lFillColorMiddle = RGB( lFillColorRed, lFillColorGreen + lOffset2, lFillColorBlue ); + lFillColorBottom = RGB( lFillColorRed, lFillColorGreen - lOffset, lFillColorBlue ); + } + + // has to be blue + else + { + lFillColorTop = RGB( lFillColorRed, lFillColorGreen, lFillColorBlue - lOffset ); + lFillColorMiddle = RGB( lFillColorRed, lFillColorGreen, lFillColorBlue + lOffset2 ); + lFillColorBottom = RGB( lFillColorRed, lFillColorGreen, lFillColorBlue - lOffset ); + } + } + + // someone's a GOTH + else + { + lFillColorTop = 0; + lFillColorMiddle = 0x00161616; + lFillColorBottom = 0; + } + + pCanvas->Fill( &m_rcBar, lFillColorMiddle ); RECT topBar = {m_rcBar.left, m_rcBar.top, m_rcBar.right, m_rcBar.top + 1}; - pCanvas->Fill(&topBar, RGB(redFration + 30, greenFraction + 30, 0)); + pCanvas->Fill( &topBar, lFillColorTop ); RECT bottomBar = {m_rcBar.left, m_rcBar.bottom - 1, m_rcBar.right, m_rcBar.bottom}; - pCanvas->Fill(&bottomBar, RGB(redFration - 30, greenFraction - 30, 0)); + pCanvas->Fill( &bottomBar, lFillColorBottom ); pIcon->DrawIcon(&m_ptSlider, 0x06001286, 0, pCanvas); @@ -348,6 +487,11 @@ float pixelValue = (float)((float)(m_nMaximum - m_nMinimum) / (float)(m_rcBar.right - m_rcBar.left)); m_nSliderPos -= ((float)dx * pixelValue); + + // I personally like being able to drag the slider + // PAST THE EDGE OF THE SLIDE BAR without needing pixel accuracy... + if( pt.x > m_rcBar.right ) + m_nSliderPos = m_nMaximum; Reformat(); m_pSite->Invalidate(); Index: Slider.h =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/Slider.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Slider.h 17 Jan 2002 00:09:50 -0000 1.1 +++ Slider.h 23 Sep 2003 05:18:30 -0000 1.2 @@ -35,6 +35,7 @@ long m_nTextColor; float m_nSliderPos; long m_nMinimum, m_nMaximum; + long m_nMinSliderColor, m_nMaxSliderColor; char *m_strTextLeft, *m_strTextRight; Index: StdAfx.h =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/StdAfx.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- StdAfx.h 23 May 2003 02:20:46 -0000 1.5 +++ StdAfx.h 23 Sep 2003 05:18:30 -0000 1.6 @@ -21,11 +21,13 @@ #include <list> #include <vector> +#include <algorithm> #include <deque> #include <map> #include <string> #include "..\Inject\Inject.h" #import <msxml.dll> +using std::max; #ifdef _CHECKMEM #define _ASSERTMEM(a) _ASSERTE(a) |
From: BJ H. <par...@us...> - 2003-09-22 22:25:42
|
Log Message: ----------- final try, this one is tested and works properly. Modified Files: -------------- /cvsroot/decaldev/source/DecalFilters: CharacterStats.cpp Revision Data ------------- Index: CharacterStats.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/CharacterStats.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- CharacterStats.cpp 22 Sep 2003 21:26:27 -0000 1.47 +++ CharacterStats.cpp 22 Sep 2003 22:25:40 -0000 1.48 @@ -244,7 +244,7 @@ // *szPeriod = 0; if ( szLf ) { - *szLf = 0; + *(--szLf) = 0; // seems ac uses /r/n, but strstr for /r didn't work in testing if (*(--szLf) == '.') *szLf = 0; } |
From: BJ H. <par...@us...> - 2003-09-22 21:26:31
|
Log Message: ----------- the real fix for DT and possibly other busted MOTDs. Needs to be tested. Modified Files: -------------- /cvsroot/decaldev/source/DecalFilters: CharacterStats.cpp Revision Data ------------- Index: CharacterStats.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/CharacterStats.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- CharacterStats.cpp 22 Sep 2003 18:59:43 -0000 1.46 +++ CharacterStats.cpp 22 Sep 2003 21:26:27 -0000 1.47 @@ -236,17 +236,18 @@ memcpy(Server, OLE2T( vMess.bstrVal ) + 24, sizeof( Server ) ); - char *szPeriod = strstr( Server, "." ); + //char *szPeriod = strstr( Server, "." ); // para - fix for the ever changing dt motd - char * szCr = strstr( Server, "\r" ); char * szLf = strstr( Server, "\n" ); - if( szPeriod ) - *szPeriod = 0; - if ( szCr ) - *szCr = 0; + //if( szPeriod ) + // *szPeriod = 0; if ( szLf ) + { *szLf = 0; + if (*(--szLf) == '.') + *szLf = 0; + } break; } |
From: BJ H. <par...@us...> - 2003-09-22 18:59:46
|
Log Message: ----------- fix for the ever changing DT motd Modified Files: -------------- /cvsroot/decaldev/source/DecalFilters: CharacterStats.cpp Revision Data ------------- Index: CharacterStats.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/CharacterStats.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- CharacterStats.cpp 13 Sep 2003 17:57:09 -0000 1.45 +++ CharacterStats.cpp 22 Sep 2003 18:59:43 -0000 1.46 @@ -237,8 +237,16 @@ memcpy(Server, OLE2T( vMess.bstrVal ) + 24, sizeof( Server ) ); char *szPeriod = strstr( Server, "." ); + // para - fix for the ever changing dt motd + char * szCr = strstr( Server, "\r" ); + char * szLf = strstr( Server, "\n" ); + if( szPeriod ) *szPeriod = 0; + if ( szCr ) + *szCr = 0; + if ( szLf ) + *szLf = 0; break; } |
From: Todd D. P. <ci...@us...> - 2003-09-22 02:56:53
|
Log Message: ----------- Fixes resizing issues with IStatic. Originally control was caching width and height and ignoring new values, so resizing wouldn't make text appear like it should if clipped. All better now :) Modified Files: -------------- /cvsroot/decaldev/source/DecalControls: Static.cpp Static.h Revision Data ------------- Index: Static.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/Static.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Static.cpp 24 Jul 2002 03:56:34 -0000 1.4 +++ Static.cpp 22 Sep 2003 02:56:51 -0000 1.5 @@ -107,6 +107,7 @@ } } + /* // Set the width of the static (not same as text width) if( vWidth.vt != VT_NULL ) { @@ -134,6 +135,7 @@ _ASSERTE( FALSE ); } } + */ return S_OK; } @@ -161,17 +163,22 @@ m_pFont->MeasureText(strText, &Size); int height = Size.cy; - if(Size.cx > m_nWidth) + RECT rcPos; + m_pSite->get_Position(&rcPos); + int nWidth = rcPos.right - rcPos.left; + int nHeight = rcPos.bottom - rcPos.top; + + if(Size.cx > nWidth) { for( token = ::strtok( (char*)strText, " " ); token !=NULL; token = ::strtok( NULL, " " ) ) { m_pFont->MeasureText(temp + _bstr_t(token), &Size); - if(Size.cx > m_nWidth) + if(Size.cx > nWidth) { DrawText( &ptText, temp, pCanvas ); ptText.y+=height;//14; - if(ptText.y+height>m_nHeight) + if(ptText.y+height>nHeight) return S_OK; temp = _bstr_t(token) + _bstr_t(" "); } @@ -213,6 +220,11 @@ { POINT pt = *ppt; + RECT rcPos; + m_pSite->get_Position(&rcPos); + int nWidth = rcPos.right - rcPos.left; + int nHeight = rcPos.bottom - rcPos.top; + // Act based on justification style switch (m_eJustify) { @@ -220,7 +232,7 @@ { SIZE Size; m_pFont->MeasureText(szText, &Size); - pt.x = m_nWidth - Size.cx; + pt.x = nWidth - Size.cx; } break; @@ -228,7 +240,7 @@ { SIZE Size; m_pFont->MeasureText(szText, &Size); - pt.x = (m_nWidth / 2) - (Size.cx / 2); + pt.x = (nWidth / 2) - (Size.cx / 2); } break; Index: Static.h =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/Static.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Static.h 16 Mar 2002 23:45:19 -0000 1.3 +++ Static.h 22 Sep 2003 02:56:51 -0000 1.4 @@ -32,8 +32,8 @@ CComPtr< IFontCache > m_pFont; _bstr_t m_strText; long m_nTextColor; - long m_nWidth; - long m_nHeight; + //long m_nWidth; + //long m_nHeight; eFontJustify m_eJustify; DECLARE_REGISTRY_RESOURCEID(IDR_STATIC) |
From: Todd D. P. <ci...@us...> - 2003-09-22 01:40:26
|
Log Message: ----------- And now we can force controls to Invalidate. Damned if I know why I didn't add this in before. Modified Files: -------------- /cvsroot/decaldev/source/Inject: Inject.idl SinkImpl.h Revision Data ------------- Index: Inject.idl =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Inject.idl,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- Inject.idl 17 Sep 2003 23:20:18 -0000 1.40 +++ Inject.idl 22 Sep 2003 01:40:22 -0000 1.41 @@ -302,6 +302,7 @@ [helpstring("Release all objects including the ILayerSite")] HRESULT LayerDestroy(); [propget, helpstring("property Position")] HRESULT Position([out, retval] RECT *pVal); [propput, helpstring("property Position")] HRESULT Position([in, out] RECT *newVal); + [helpstring("Invalidate the layer through ILayerSite")] HRESULT Invalidate(); }; [ Index: SinkImpl.h =================================================================== RCS file: /cvsroot/decaldev/source/Inject/SinkImpl.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SinkImpl.h 16 Sep 2001 00:38:16 -0000 1.2 +++ SinkImpl.h 22 Sep 2003 01:40:22 -0000 1.3 @@ -77,6 +77,11 @@ { return m_pSite->get_Position(pVal); } + + STDMETHOD(Invalidate)() + { + return m_pSite->Invalidate(); + } }; class ATL_NO_VTABLE ILayerMouseImpl : public ILayerMouse |
From: John D. <go...@us...> - 2003-09-18 02:55:33
|
Log Message: ----------- Added DamageBonus to WorldObject ID information Modified Files: -------------- /cvsroot/decaldev/source/DecalFilters: DecalFilters.idl World.cpp World.h WorldObject.cpp WorldObject.h Revision Data ------------- Index: DecalFilters.idl =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/DecalFilters.idl,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- DecalFilters.idl 13 Sep 2003 17:57:09 -0000 1.36 +++ DecalFilters.idl 18 Sep 2003 02:55:31 -0000 1.37 @@ -577,6 +577,7 @@ [propget, id(83), helpstring("property FireProt")] HRESULT FireProt([out, retval] float *pVal); [propget, id(84), helpstring("property ElectProt")] HRESULT ElectProt([out, retval] float *pVal); [propget, id(85), helpstring("property RaceReq")] HRESULT RaceReq([out, retval] BSTR *pVal); + [propget, id(86), helpstring("property DamageBonus")] HRESULT DamageBonus([out, retval] float *pVal); }; [ Index: World.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/World.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- World.cpp 14 Sep 2003 19:25:55 -0000 1.55 +++ World.cpp 18 Sep 2003 02:55:31 -0000 1.56 @@ -46,6 +46,7 @@ BSTR strskill ; BSTR strdamage ; BSTR strdamageRange ; +BSTR strdamageBonus ; BSTR strrange ; BSTR strdefenseBonus ; BSTR strattackBonus ; @@ -194,6 +195,7 @@ SysReAllocString( &strskill, L"skill") ; SysReAllocString( &strdamage, L"damage") ; SysReAllocString( &strdamageRange, L"damageRange") ; + SysReAllocString( &strdamageBonus, L"damageBonus") ; SysReAllocString( &strrange, L"range") ; SysReAllocString( &strdefenseBonus, L"defenseBonus") ; SysReAllocString( &strattackBonus, L"attackBonus") ; @@ -356,6 +358,7 @@ SysFreeString(strskill) ; SysFreeString(strdamage) ; SysFreeString(strdamageRange) ; + SysFreeString(strdamageBonus) ; SysFreeString(strrange) ; SysFreeString(strdefenseBonus) ; SysFreeString(strattackBonus) ; @@ -986,6 +989,7 @@ pMembers->get_NextInt(strskill, &(pData->m_EquipSkill)) ; pMembers->get_NextInt(strdamage, &(pData->m_MaxDamage)) ; pMembers->get_NextFloat(strdamageRange, &(pData->m_Variance)) ; + pMembers->get_NextFloat(strdamageBonus, &(pData->m_DamageBonus)) ; pMembers->get_NextFloat(strrange, &(pData->m_Range)) ; pMembers->get_NextFloat(strdefenseBonus, &(pData->m_DefenseBonus)) ; pMembers->get_NextFloat(strattackBonus, &(pData->m_AttackBonus)) ; Index: World.h =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/World.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- World.h 30 Aug 2003 16:57:22 -0000 1.37 +++ World.h 18 Sep 2003 02:55:31 -0000 1.38 @@ -72,6 +72,7 @@ m_fyHeading = 0.0f; m_fzHeading = 0.0f; m_fwHeading = 0.0f; + m_DamageBonus = 0.0f; m_nItemSlots = 0; m_nPackSlots = 0; m_nUsesLeft = 0; @@ -165,6 +166,7 @@ float m_fzHeading; float m_fwHeading; float m_fApproachDistance ; + float m_DamageBonus ; BYTE m_nItemSlots; BYTE m_nPackSlots; WORD m_nUsesLeft; Index: WorldObject.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/WorldObject.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- WorldObject.cpp 30 Aug 2003 16:57:22 -0000 1.23 +++ WorldObject.cpp 18 Sep 2003 02:55:31 -0000 1.24 @@ -652,3 +652,13 @@ return S_OK ; } +STDMETHODIMP cWorldObject::get_DamageBonus(float *pVal) +{ + if (!pVal) { + _ASSERT(FALSE) ; + return E_POINTER ; + } + *pVal = m_p->m_DamageBonus ; + return S_OK ; +} + Index: WorldObject.h =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/WorldObject.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- WorldObject.h 30 Aug 2003 16:57:22 -0000 1.19 +++ WorldObject.h 18 Sep 2003 02:55:31 -0000 1.20 @@ -122,6 +122,7 @@ STDMETHOD(get_FireProt)(/*[out, retval]*/ float *pVal); STDMETHOD(get_ElectProt)(/*[out, retval]*/ float *pVal); STDMETHOD(get_RaceReq)(/*[out, retval]*/ BSTR *pVal); + STDMETHOD(get_DamageBonus)(/*[out, retval]*/ float *pVal); // IWorldObject2 STDMETHOD(get_Flags)(/*[out, retval]*/ long *pVal); |
From: Jeffrey D. <ha...@us...> - 2003-09-17 23:22:24
|
Log Message: ----------- duh moment Modified Files: -------------- /cvsroot/decaldev/source/Inject: View.cpp Revision Data ------------- Index: View.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/View.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- View.cpp 17 Sep 2003 23:20:18 -0000 1.21 +++ View.cpp 17 Sep 2003 23:22:11 -0000 1.22 @@ -475,13 +475,13 @@ { m_bTransparent = true; m_VP.alpha = 255; + } - long nActiveView; - m_pPanel->get_ActiveView( &nActiveView ); + long nActiveView; + m_pPanel->get_ActiveView( &nActiveView ); - if( nActiveView == m_nViewID ) - m_pPanel->ActivateView(m_nViewID, &m_VP, (long*)this); - } + if( nActiveView == m_nViewID ) + m_pPanel->ActivateView(m_nViewID, &m_VP, (long*)this); return S_OK; } |
From: Jeffrey D. <ha...@us...> - 2003-09-17 23:20:51
|
Log Message: ----------- get/put_Transparent properties for views, added a protection clause for put_Alpha if views are transparent Modified Files: -------------- /cvsroot/decaldev/source/Inject: Inject.idl View.cpp View.h Revision Data ------------- Index: Inject.idl =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Inject.idl,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- Inject.idl 17 Sep 2003 23:10:06 -0000 1.39 +++ Inject.idl 17 Sep 2003 23:20:18 -0000 1.40 @@ -623,6 +623,8 @@ [propput, helpstring("property Alpha")] HRESULT Alpha(long Alpha); [propget, helpstring("property Activated")] HRESULT Activated([out, retval] VARIANT_BOOL* pVal); [propput, helpstring("property Activated")] HRESULT Activated([in] VARIANT_BOOL newVal); + [propget, helpstring("property Transparent")] HRESULT Transparent([out, retval] VARIANT_BOOL* pVal); + [propput, helpstring("property Transparent")] HRESULT Transparent([in] VARIANT_BOOL newVal); }; [ Index: View.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/View.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- View.cpp 17 Sep 2003 23:10:06 -0000 1.20 +++ View.cpp 17 Sep 2003 23:20:18 -0000 1.21 @@ -428,6 +428,9 @@ STDMETHODIMP cView::put_Alpha(long Alpha) { + if( m_bTransparent ) + return S_FALSE; + m_VP.alpha = Alpha; long nActiveView; @@ -453,3 +456,32 @@ else return Activate(); } + +STDMETHODIMP cView::get_Transparent(VARIANT_BOOL *pVal) +{ + *pVal = ( m_bTransparent ? VARIANT_TRUE : VARIANT_FALSE ); + return S_OK; +} + +STDMETHODIMP cView::put_Transparent(VARIANT_BOOL newVal) +{ + if( newVal == VARIANT_FALSE ) + { + m_bTransparent = false; + m_VP.alpha = -1; + } + + else + { + m_bTransparent = true; + m_VP.alpha = 255; + + long nActiveView; + m_pPanel->get_ActiveView( &nActiveView ); + + if( nActiveView == m_nViewID ) + m_pPanel->ActivateView(m_nViewID, &m_VP, (long*)this); + } + + return S_OK; +} \ No newline at end of file Index: View.h =================================================================== RCS file: /cvsroot/decaldev/source/Inject/View.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- View.h 17 Sep 2003 23:10:06 -0000 1.10 +++ View.h 17 Sep 2003 23:20:18 -0000 1.11 @@ -81,6 +81,8 @@ STDMETHOD(put_Alpha)(long Alpha); STDMETHOD(get_Activated)(/*[out, retval]*/ VARIANT_BOOL *pVal); STDMETHOD(put_Activated)(/*[in]*/ VARIANT_BOOL newVal); + STDMETHOD(get_Transparent)(/*[out, retval]*/ VARIANT_BOOL *pVal); + STDMETHOD(put_Transparent)(/*[in]*/ VARIANT_BOOL newVal); }; #endif //__VIEW_H_ |
From: Jeffrey D. <ha...@us...> - 2003-09-17 23:11:08
|
Log Message: ----------- Transparent views (yummy!) set \<view (options) transparent=\true\\> in xml Modified Files: -------------- /cvsroot/decaldev/source/Inject: Inject.idl Panel.cpp Panel.h RootLayer.cpp View.cpp View.h Revision Data ------------- Index: Inject.idl =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Inject.idl,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- Inject.idl 27 Aug 2003 19:02:19 -0000 1.38 +++ Inject.idl 17 Sep 2003 23:10:06 -0000 1.39 @@ -42,6 +42,11 @@ eRenderReformatNext = 0x20 }; +enum eViewFlags +{ + eTransparent = 0x01, +}; + enum eFontOptions { eFontBold = 0x01, @@ -538,6 +543,7 @@ [helpstring("method LoadView")] HRESULT LoadView(long nViewID, IView *pView, IUnknown *pSchema); [helpstring("method Deactivate")] HRESULT Deactivate(); [propputref, helpstring("property Sink")] HRESULT Sink([in] IPanelSink* newVal); + [helpstring("method LoadViewEx")] HRESULT LoadViewEx(long nViewID, IView *pView, IUnknown *pSchema, long lViewFlags); }; [ Index: Panel.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Panel.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Panel.cpp 30 May 2003 01:49:29 -0000 1.13 +++ Panel.cpp 17 Sep 2003 23:10:06 -0000 1.14 @@ -18,6 +18,7 @@ m_bSizingXR( false ), m_bSizingYT( false ), m_bSizingYB( false ), +m_bTransparent( false ), m_pcView( NULL ), m_Alpha( 255 ) { @@ -137,8 +138,8 @@ RECT rc_pat = { 0, 0, rc.right - rc.left, rc.bottom - rc.top }; static POINT pt_pat = { 0, 0 }; - - m_pBackground->PatBlt( pCanvas, &rc_pat, &pt_pat ); + if( ! m_bTransparent ) + m_pBackground->PatBlt( pCanvas, &rc_pat, &pt_pat ); // Draw the borders RECT rc_border_top = { 0, 0, rc.right - rc.left, szBorder.cy }, @@ -345,6 +346,20 @@ _ASSERTE( pSchema != NULL ); long nAssigned; + + // Set up the layer - note that it is not visible + return pView->LoadControl( m_pSite, nViewID, pSchema, &nAssigned ); +} + +STDMETHODIMP cPanel::LoadViewEx(long nViewID, IView *pView, IUnknown *pSchema, long lViewFlags) +{ + _ASSERTE( pView != NULL ); + _ASSERTE( pSchema != NULL ); + + long nAssigned; + + if( lViewFlags & eTransparent ) + m_bTransparent = true; // Set up the layer - note that it is not visible return pView->LoadControl( m_pSite, nViewID, pSchema, &nAssigned ); Index: Panel.h =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Panel.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Panel.h 17 Apr 2002 00:26:36 -0000 1.6 +++ Panel.h 17 Sep 2003 23:10:06 -0000 1.7 @@ -50,6 +50,7 @@ bool m_bSizingXR; bool m_bSizingYT; bool m_bSizingYB; + bool m_bTransparent; void hideView(); @@ -72,6 +73,7 @@ // IPanel public: STDMETHOD(LoadView)(long nPlugin, IView *pView, IUnknown *pSchema); + STDMETHOD(LoadViewEx)(long nPlugin, IView *pView, IUnknown *pSchema, long lViewFlags); STDMETHOD(get_ActiveView)(/*[out, retval]*/ long *pVal); STDMETHOD(AddView)(long nPluginID, ILayer *pLayer); STDMETHOD(RemoveView)(long nID); Index: RootLayer.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/RootLayer.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- RootLayer.cpp 14 Mar 2003 04:22:08 -0000 1.6 +++ RootLayer.cpp 17 Sep 2003 23:10:06 -0000 1.7 @@ -164,7 +164,7 @@ pView->m_pRoot = this; pView->m_nViewID = m_nNextViewID ++; - pView->loadSchema( strXML, &pRootControl ); + long lViewFlags = pView->loadSchema( strXML, &pRootControl ); if( pRootControl.p ) { @@ -177,7 +177,7 @@ m_pBars->AddBar( pView->m_nViewID, &pView->m_VP ); // Last, create all the controls - pView->m_pPanel->LoadView( pView->m_nViewID, pView, pRootControl ); + pView->m_pPanel->LoadViewEx( pView->m_nViewID, pView, pRootControl, lViewFlags ); if( cManager::_p->m_bXMLViewViewer ) { @@ -185,6 +185,7 @@ pView->Activate( ); } } + else { pView->Release( ); Index: View.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/View.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- View.cpp 14 Sep 2003 00:12:07 -0000 1.19 +++ View.cpp 17 Sep 2003 23:10:06 -0000 1.20 @@ -24,7 +24,7 @@ cManager::_p->clearDestroyList( ); } -void cView::loadSchema( BSTR strSchema, IUnknown **ppRootControl ) +long cView::loadSchema( BSTR strSchema, IUnknown **ppRootControl ) { USES_CONVERSION; @@ -70,15 +70,17 @@ _ASSERTE( FALSE ); pDoc.Release( ); - return; + return 0; } // Get the root element and check it out - loadSchemaObject( pDoc->documentElement, ppRootControl ); + long lViewFlags = loadSchemaObject( pDoc->documentElement, ppRootControl ); pDoc.Release( ); + + return lViewFlags; } -void cView::loadSchemaObject( IUnknown *pObject, IUnknown **ppRootControl ) +long cView::loadSchemaObject( IUnknown *pObject, IUnknown **ppRootControl ) { MSXML::IXMLDOMElementPtr pRoot = pObject; @@ -91,7 +93,8 @@ vLeft = pRoot->getAttribute( _T( "left" ) ), vTop = pRoot->getAttribute( _T( "top" ) ), vWidth = pRoot->getAttribute( _T( "width" ) ), - vHeight = pRoot->getAttribute( _T( "height" ) ); + vHeight = pRoot->getAttribute( _T( "height" ) ), + vTrans = pRoot->getAttribute( _T( "transparent" ) ); // We *must* have a title _ASSERTE( vTitle.vt == VT_BSTR ); @@ -130,7 +133,15 @@ else m_VP.height = static_cast< long >(vHeight); - m_VP.alpha = -1; + if(vTrans.vt == VT_NULL) + m_bTransparent = false; + else + m_bTransparent = static_cast< bool >( vTrans ); + + if( m_bTransparent ) + m_VP.alpha = 255; + else + m_VP.alpha = -1; m_VP.label = _bstr_t(vTitle.bstrVal).copy(); @@ -140,6 +151,13 @@ _ASSERTE( pControl.GetInterfacePtr() != NULL ); pControl->QueryInterface( ppRootControl ); + + long lViewFlags = 0; + + if( m_bTransparent ) + lViewFlags |= eTransparent; + + return lViewFlags; } STDMETHODIMP cView::get_Control(BSTR strName, IControl **pVal) @@ -197,7 +215,7 @@ STDMETHODIMP cView::LoadControl(ILayerSite *pParent, long nID, IUnknown *pSource, long *pAssignedID) { - // Usual parameter validation + // Usual parameter validation _ASSERTE( pParent != NULL ); _ASSERTE( pSource != NULL ); _ASSERTE( pAssignedID != NULL ); @@ -271,9 +289,9 @@ STDMETHODIMP cView::LoadSchema(BSTR strXMLSchema) { - long nPreviousView; - m_pPanel->get_ActiveView( &nPreviousView ); - m_pPanel->RemoveView( m_nViewID ); + long nPreviousView; + m_pPanel->get_ActiveView( &nPreviousView ); + m_pPanel->RemoveView( m_nViewID ); CComPtr< IUnknown > pRootControl; loadSchema( strXMLSchema, &pRootControl ); @@ -281,8 +299,13 @@ // Set the bar params m_pRoot->m_pBars->put_Bar( m_nViewID, &m_VP ); + long lViewFlags = 0; + + if( m_bTransparent ) + lViewFlags |= eTransparent; + // Last, create all the controls - m_pPanel->LoadView( m_nViewID, this, pRootControl ); + m_pPanel->LoadViewEx( m_nViewID, this, pRootControl, lViewFlags ); if( nPreviousView == m_nViewID ) // Reactivate the view Index: View.h =================================================================== RCS file: /cvsroot/decaldev/source/Inject/View.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- View.h 21 Mar 2003 17:08:27 -0000 1.9 +++ View.h 17 Sep 2003 23:10:06 -0000 1.10 @@ -35,6 +35,7 @@ CComPtr< IPanel > m_pPanel; ViewParams m_VP; + bool m_bTransparent; // Named controls struct cNamedControl @@ -46,8 +47,8 @@ typedef std::list< cNamedControl > cNamedControlList; cNamedControlList m_controls; - void loadSchema( BSTR strText, IUnknown **ppRootControl ); - void loadSchemaObject( IUnknown *pObject, IUnknown **ppRootControl ); + long loadSchema( BSTR strText, IUnknown **ppRootControl ); + long loadSchemaObject( IUnknown *pObject, IUnknown **ppRootControl ); BEGIN_COM_MAP(cView) COM_INTERFACE_ENTRY(IView) |
From: Jeffrey D. <ha...@us...> - 2003-09-17 23:09:14
|
Log Message: ----------- Disable AA/ClearType on Font Cache drawing (otherwise transparent views look really damn ugly) Modified Files: -------------- /cvsroot/decaldev/source/Inject: FontCache.cpp FontCache.h Revision Data ------------- Index: FontCache.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/FontCache.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- FontCache.cpp 18 Aug 2001 19:34:51 -0000 1.1.1.1 +++ FontCache.cpp 17 Sep 2003 23:08:54 -0000 1.2 @@ -116,7 +116,13 @@ for( INT *i_delta = pDeltas; i_delta != i_end_deltas; ++ i_delta, ++ i_src ) *i_delta = m_nWidths[ *i_src ].m_nWidth; + if( m_bFontSmoothing ) + SystemParametersInfo( SPI_SETFONTSMOOTHING, FALSE, NULL, 0 ); + ::ExtTextOut( hdc, ppt->x, ppt->y, 0, NULL, szAnsi, cbLength, pDeltas ); + + if( m_bFontSmoothing ) + SystemParametersInfo( SPI_SETFONTSMOOTHING, TRUE, NULL, 0 ); delete[] pDeltas; Index: FontCache.h =================================================================== RCS file: /cvsroot/decaldev/source/Inject/FontCache.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- FontCache.h 18 Aug 2001 19:34:51 -0000 1.1.1.1 +++ FontCache.h 17 Sep 2003 23:08:54 -0000 1.2 @@ -14,6 +14,8 @@ public: cFontCache() { + m_bFontSmoothing = FALSE; + SystemParametersInfo( SPI_GETFONTSMOOTHING, 0, &m_bFontSmoothing, 0 ); } ~cFontCache(); @@ -23,6 +25,7 @@ short m_nWidth; }; + BOOL m_bFontSmoothing; SIZE m_szCharCell; cCharMetrics m_nWidths[ 256 ]; LOGFONT m_lf; |
From: John D. <go...@us...> - 2003-09-14 19:25:59
|
Log Message: ----------- Fixed IconOutline, verified order of all Flag2 values Modified Files: -------------- /cvsroot/decaldev/source/DecalFilters: World.cpp Revision Data ------------- Index: World.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/World.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- World.cpp 13 Sep 2003 17:57:09 -0000 1.54 +++ World.cpp 14 Sep 2003 19:25:55 -0000 1.55 @@ -238,7 +238,7 @@ SysReAllocString( &strunknown_v0_3, L"unknown_v0_3" ); SysReAllocString( &strunknown_v2, L"unknown_v2" ); SysReAllocString( &strunknown_v4, L"unknown_v4" ); - SysReAllocString( &strunknown_v4, L"unknown_v5" ); + SysReAllocString( &strunknown_v5, L"unknown_v5" ); SysReAllocString( &strunknown_w1, L"unknown_w1" ); SysReAllocString( &strunknown10, L"unknown10" ); SysReAllocString( &strunknown11b, L"unknown11b" ); @@ -1276,6 +1276,12 @@ pCreate->m_Slot.type = 1 ; } + // Missile Type + if (pCreate->m_dwFlags2 & 0x00000100) { + pMembers->get_NextInt(strunknown_w1, &pCreate->m_MissileType); + _DebugLog("\n m_MissileType %x",pCreate->m_MissileType) ; + } + // Value if (pCreate->m_dwFlags2 & 0x00000008) { pMembers->get_NextInt(strvalue, &pCreate->m_dwValue); @@ -1309,14 +1315,9 @@ // Icon Outline if (pCreate->m_dwFlags2 & 0x00000080) { + _DebugLog("\n m_IconOutline:", pCreate->m_IconOutline) ; pMembers->get_NextInt(strunknown_v4, &pCreate->m_IconOutline); - _DebugLog("\n m_IconOutline %x",pCreate->m_IconOutline) ; - } - - // Missile Type - if (pCreate->m_dwFlags2 & 0x00000100) { - pMembers->get_NextInt(strunknown_w1, &pCreate->m_MissileType); - _DebugLog("\n m_MissileType %x",pCreate->m_MissileType) ; + _DebugLog(" %x",pCreate->m_IconOutline) ; } // Equip Type @@ -1429,7 +1430,7 @@ // Hook Type - if (pCreate->m_dwFlags2 & 0x10000000) { + if (pCreate->m_dwFlags2 & 0x20000000) { pMembers->get_NextInt(strunknown11b, &pCreate->m_HookType); _DebugLog("\n m_HookType: %x",pCreate->m_HookType) ; } |
From: Jeffrey D. <ha...@us...> - 2003-09-14 00:12:10
|
Log Message: ----------- GKusnick's changes - remove assert in debug mode for view icons being 0 Modified Files: -------------- /cvsroot/decaldev/source/Inject: View.cpp Revision Data ------------- Index: View.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/View.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- View.cpp 6 Sep 2003 17:28:54 -0000 1.18 +++ View.cpp 14 Sep 2003 00:12:07 -0000 1.19 @@ -97,7 +97,8 @@ _ASSERTE( vTitle.vt == VT_BSTR ); // Fill this into a view param - _ASSERTE( vIcon.vt != VT_NULL ); +// GKusnick: Handle no-icon case without asserting. +// _ASSERTE( vIcon.vt != VT_NULL ); m_VP.icon = ( vIcon.vt != VT_NULL ) ? static_cast< long >( vIcon ) + 0x06000000 : 0; if( vIconModule.vt == VT_BSTR ) |
From: Jeffrey D. <ha...@us...> - 2003-09-14 00:11:41
|
Log Message: ----------- GKusnick's changes - Decal bar shouldn't play hide and seek anymore Modified Files: -------------- /cvsroot/decaldev/source/Inject: BarLayer.cpp Revision Data ------------- Index: BarLayer.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/BarLayer.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- BarLayer.cpp 30 May 2003 01:49:30 -0000 1.14 +++ BarLayer.cpp 14 Sep 2003 00:11:09 -0000 1.15 @@ -211,6 +211,12 @@ nVariableWidth = 308; int nWidth = sz.cx - ( nVariableWidth + 230 + m_TotalDelta ); + // GKusnick: *Really* make sure the Decal bar is always at least 112 pixels wide. + if (nWidth < 112) + { + nWidth = 112; + m_TotalDelta = sz.cx - (308 + 230 + nWidth); + } RECT rc1 = { 230 + m_TotalDelta, 0, 230 + m_TotalDelta + nWidth, 23 }; m_pSite->put_Position( &rc1 ); |