CPropVariant& CPropVariant::operator=(UInt32 value) { if (vt != VT_UI4) { InternalClear(); vt = VT_UI4; } ulVal = value; return *this; }
CPropVariant& CPropVariant::operator=(UInt64 value) { if (vt != VT_UI8) { InternalClear(); vt = VT_UI8; } uhVal.QuadPart = value; return *this; }
CPropVariant& CPropVariant::operator=(Byte value) { if (vt != VT_UI1) { InternalClear(); vt = VT_UI1; } bVal = value; return *this; }
CPropVariant& CPropVariant::operator=(bool bSrc) { if (vt != VT_BOOL) { InternalClear(); vt = VT_BOOL; } boolVal = bSrc ? VARIANT_TRUE : VARIANT_FALSE; return *this; }
CPropVariant& CPropVariant::operator=(Int16 value) { if (vt != VT_I2) { InternalClear(); vt = VT_I2; } iVal = value; return *this; }
CPropVariant& CPropVariant::operator=(const FILETIME &value) { if (vt != VT_FILETIME) { InternalClear(); vt = VT_FILETIME; } filetime = value; return *this; }
CPropVariant& CPropVariant::operator=(LPCOLESTR lpszSrc) { InternalClear(); vt = VT_BSTR; wReserved1 = 0; bstrVal = ::SysAllocString(lpszSrc); if (bstrVal == NULL && lpszSrc != NULL) { vt = VT_ERROR; scode = E_OUTOFMEMORY; } return *this; }
PropertyVariant& PropertyVariant::operator=(LPCOLESTR lpszSrc) { InternalClear(); vt = VT_BSTR; wReserved1 = 0; bstrVal = ::SysAllocString(lpszSrc); if (bstrVal == NULL && lpszSrc != NULL) { throw kMemException; // vt = VT_ERROR; // scode = E_OUTOFMEMORY; } return *this; }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- CCommanderStatusPanel::CCommanderStatusPanel( void ) : BaseClass( NULL, "CCommanderStatusPanel" ) { m_hFont = m_hFontText = 0; m_nLeftEdge = 0; m_nBottomEdge = 0; // m_pBorder = new vgui::LineBorder( 2, vgui::Color( 127, 127, 127, 255 ) ); // setBorder( m_pBorder ); SetBgColor( Color( 0, 0, 0, 100 ) ); // we need updating vgui::ivgui()->AddTickSignal( GetVPanel() ); InternalClear(); }
CPropVariant& CPropVariant::operator=(const char *s) { InternalClear(); vt = VT_BSTR; wReserved1 = 0; UINT len = (UINT)strlen(s); bstrVal = ::SysAllocStringByteLen(0, (UINT)len * sizeof(OLECHAR)); if (bstrVal == NULL) { vt = VT_ERROR; scode = E_OUTOFMEMORY; } else { for (UINT i = 0; i <= len; i++) bstrVal[i] = s[i]; } return *this; }
void CCommanderStatusPanel::OnTick() { // Simulate alpha float dt = gpGlobals->frametime; float maxmove = 1.0f / ALPHA_ADJUST_TIME; float moverequested = dt * maxmove; float remaining = m_flGoalAlpha - m_flCurrentAlpha; if ( fabs( remaining ) < 0.01f ) if ( m_flCurrentAlpha < 0.01f ) { InternalClear(); return; } if ( moverequested > fabs( remaining ) ) moverequested = fabs( remaining ); if ( remaining > 0.0f ) m_flCurrentAlpha += moverequested; else m_flCurrentAlpha -= moverequested; }