Пример #1
0
static cell_t sm_ResetConVar(IPluginContext *pContext, const cell_t *params)
{
	Handle_t hndl = static_cast<Handle_t>(params[1]);
	HandleError err;
	ConVar *pConVar;

	if ((err=g_ConVarManager.ReadConVarHandle(hndl, &pConVar))
		!= HandleError_None)
	{
		return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
	}

	pConVar->Revert();
	
#if SOURCE_ENGINE < SE_ORANGEBOX
	/* Should we replicate it? */
	if (params[3] && IsFlagSet(pConVar, FCVAR_REPLICATED))
	{
		ReplicateConVar(pConVar);
	}

	/* Should we notify clients? */
	if (params[4] && IsFlagSet(pConVar, FCVAR_NOTIFY))
	{
		NotifyConVar(pConVar);
	}
#endif

	return 1;
}
Пример #2
0
bool CSector::CanSleep(bool fCheckAdjacents) const
{
	ADDTOCALLSTACK_INTENSIVE("CSector::CanSleep");
	if ( (g_Cfg._iSectorSleepDelay == 0) || IsFlagSet(SECF_NoSleep) )
		return false;	// never sleep
    if (m_Chars_Active.GetClientsNumber() > 0)
        return false;	// has at least one client, no sleep
	if ( IsFlagSet(SECF_InstaSleep) )
		return true;	// no active client inside, instant sleep
    
    if (fCheckAdjacents)
    {
        for (int i = 0; i < (int)DIR_QTY; ++i)// Check for adjacent's sectors sleeping allowance.
        {
            const CSector *pAdjacent = GetAdjacentSector((DIR_TYPE)i);    // set this as the last sector to avoid this code in the adjacent one and return if it can sleep or not instead of searching its adjacents.
            /*
            * Only check if this sector exist and it's not the last checked (sectors in the edges of the map doesn't have adjacent on those directions)
            * && Only check if the sector isn't sleeping (IsSleeping()) and then check if CanSleep().
            */
            if (!pAdjacent)
            {
                continue;
            }
            if (!pAdjacent->IsSleeping() || !pAdjacent->CanSleep(false))
            {
                return false;   // assume the base sector can't sleep.
            }
        }
    }

	//default behaviour;
	return ((g_World.GetCurrentTime().GetTimeRaw() - GetLastClientTime()) > g_Cfg._iSectorSleepDelay); // Sector Sleep timeout.
}
Пример #3
0
// ----------------------------------------------------------------------- //
//
//	ROUTINE:	CLTWnd::OnMouseMove
//
//	PURPOSE:	This is the actual mouse move handler
//
// ----------------------------------------------------------------------- //
BOOL CLTWnd::OnMouseMove(int xPos, int yPos)
{
	// Update the cursor's position on us
	m_xCursor = xPos - GetWindowLeft();
	m_yCursor = yPos - GetWindowTop();

	// Handle draggage if necessary
	if(s_pWndCapture == this)
	{
		if(IsFlagSet(LTWF_DRAGGABLE))
		{
			OnDrag(xPos,yPos);
		}
		else
		if(IsFlagSet(LTWF_PARENTDRAG))
		{
			// Drag our parent
			// Find our parent
			CLTWnd* pWnd = this;
			CLTWnd* pParent = m_pParentWnd;
			while(pWnd->IsFlagSet(LTWF_FIXEDCHILD) && pParent)
			{
				pWnd = pParent;
				pParent = pWnd->GetParent();
			}
			pWnd->OnDrag(xPos,yPos);
		}
	}

	return(this != s_pMainWnd);
}
Пример #4
0
//--------------------------------------------------------------------------------------------------
// Name: SetActive
// Desc: Sets active status
//--------------------------------------------------------------------------------------------------
void CGameEffect::SetActive(bool isActive)
{
	FX_ASSERT_MESSAGE(IsFlagSet(GAME_EFFECT_INITIALISED),"Effect changing active status without being initialised first");
	FX_ASSERT_MESSAGE((IsFlagSet(GAME_EFFECT_RELEASED)==false),"Effect changing active status after being released");

	SetFlag(GAME_EFFECT_ACTIVE,isActive);
	GAME_FX_SYSTEM.RegisterEffect(this); // Re-register effect with game effects system
}//-------------------------------------------------------------------------------------------------
Пример #5
0
void ConsoleVariableType::SetBool(bool value, bool replicate, bool notify) {
	ConVarInstance->SetValue(value ? 1 : 0);

#if SOURCE_ENGINE < SE_ORANGEBOX
	if(replicate && IsFlagSet(ConVarInstance, FCVAR_REPLICATED)) {
		ReplicateConVar(ConVarInstance);
	}

	if(notify && IsFlagSet(ConVarInstance, FCVAR_NOTIFY)) {
		NotifyConVar(ConVarInstance);
	}
#endif
}
Пример #6
0
void ConsoleVariableType::Reset(bool replicate, bool notify) {
	ConVarInstance->Revert();

#if SOURCE_ENGINE < SE_ORANGEBOX
	if(replicate && IsFlagSet(ConVarInstance, FCVAR_REPLICATED)) {
		ReplicateConVar(ConVarInstance);
	}

	if(notify && IsFlagSet(ConVarInstance, FCVAR_NOTIFY)) {
		NotifyConVar(ConVarInstance);
	}
#endif
}
void plAgeLinkStruct::Write( hsStream * s, hsResMgr* m)
{
    s->WriteLE( fFlags );
    if ( IsFlagSet( kHasAgeInfo ) )
        fAgeInfo.Write( s,m );
    if ( IsFlagSet( kHasLinkingRules ) )
        s->WriteLE( fLinkingRules );
    if ( IsFlagSet( kHasSpawnPt ) )
        fSpawnPoint.Write( s );
    if ( IsFlagSet( kHasAmCCR ) )
        s->WriteLE( fAmCCR );
    if ( IsFlagSet( kHasParentAgeFilename ) )
        plMsgStdStringHelper::Poke(fParentAgeFilename,s);
}
void plNetServerSessionInfo::Write(hsStream* s, hsResMgr*)
{
    s->WriteLE(fFlags);
    if (IsFlagSet(kHasServerName))
        plMsgStdStringHelper::Poke(fServerName,s);
    if (IsFlagSet(kHasServerType))
        s->WriteLE(fServerType);
    if (IsFlagSet(kHasServerAddr))
        plMsgStdStringHelper::Poke(fServerAddr,s);
    if (IsFlagSet(kHasServerPort))
        s->WriteLE(fServerPort);
    if (IsFlagSet(kHasServerGuid))
        fServerGuid.Write(s);
}
bool plNetServerSessionInfo::IsEqualTo(const plNetServerSessionInfo * other) const
{
    bool match = true;
    if (match && IsFlagSet(kHasServerGuid) && other->IsFlagSet(kHasServerGuid))
        match = match && fServerGuid.IsEqualTo(other->GetServerGuid());
    if (match && IsFlagSet(kHasServerName) && other->IsFlagSet(kHasServerName))
        match = match && (stricmp(fServerName.c_str(),other->fServerName.c_str())==0);
    if (match && IsFlagSet(kHasServerType) && other->IsFlagSet(kHasServerType))
        match = match && fServerType==other->fServerType;
    if (match && IsFlagSet(kHasServerAddr) && other->IsFlagSet(kHasServerAddr))
        match = match && (stricmp(fServerAddr.c_str(),other->fServerAddr.c_str())==0);
    if (match && IsFlagSet(kHasServerPort) && other->IsFlagSet(kHasServerPort))
        match = match && fServerPort==other->fServerPort;
    return match;
}
Пример #10
0
//--------------------------------------------------------------------------------------------------
// Name: Initialise
// Desc: Initializes game effect
//--------------------------------------------------------------------------------------------------
void CGameEffect::Initialise(const SGameEffectParams* gameEffectParams)
{
#if DEBUG_GAME_FX_SYSTEM
	m_debugName = GetName(); // Store name so it can be accessed in destructor and debugging
#endif

	if(!IsFlagSet(GAME_EFFECT_INITIALISED))
	{
		SGameEffectParams params;
		if(gameEffectParams)
		{
			params = *gameEffectParams;
		}

		SetFlag(GAME_EFFECT_AUTO_UPDATES_WHEN_ACTIVE,params.autoUpdatesWhenActive);
		SetFlag(GAME_EFFECT_AUTO_UPDATES_WHEN_NOT_ACTIVE,params.autoUpdatesWhenNotActive);
		SetFlag(GAME_EFFECT_AUTO_RELEASE,params.autoRelease);
		SetFlag(GAME_EFFECT_AUTO_DELETE,params.autoDelete);

		GAME_FX_SYSTEM.RegisterEffect(this);

		SetFlag(GAME_EFFECT_INITIALISED,true);
		SetFlag(GAME_EFFECT_RELEASED,false);
	}
}//-------------------------------------------------------------------------------------------------
Пример #11
0
bool Entity::Update( float ticks ) throw(std::exception)
{
    if ( IsFlagSet( Entity::F_ENABLE )) {
        DoUpdate(ticks);
    }
    return false;
}
Пример #12
0
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *value - 
//-----------------------------------------------------------------------------
void ConVar::InternalSetFloatValue( float fNewValue )
{
	if ( fNewValue == m_fValue )
		return;

	if ( IsFlagSet( FCVAR_MATERIAL_THREAD_MASK ) )
	{
		if ( g_pCVar && !g_pCVar->IsMaterialThreadSetAllowed() )
		{
			g_pCVar->QueueMaterialThreadSetValue( this, fNewValue );
			return;
		}
	}

	Assert( m_pParent == this ); // Only valid for root convars.

	// Check bounds
	ClampValue( fNewValue );

	// Redetermine value
	float flOldValue = m_fValue;
	m_fValue		= fNewValue;
	m_nValue		= ( int )m_fValue;

	if ( !( m_nFlags & FCVAR_NEVER_AS_STRING ) )
	{
		char tempVal[ 32 ];
		Q_snprintf( tempVal, sizeof( tempVal), "%f", m_fValue );
		ChangeStringValue( tempVal, flOldValue );
	}
	else
	{
		Assert( !m_fnChangeCallback );
	}
}
Пример #13
0
// ---------------------------------------------------------
// CNSmlCmdsBase::StatusToUnsupportedCommandL()
// Makes status data to unsupported or illegal SyncML command
// ---------------------------------------------------------
EXPORT_C void CNSmlCmdsBase::StatusToUnsupportedCommandL( TBool aIllegal, const TDesC8& aCmd, const SmlPcdata_t* aCmdRef, Flag_t aFlags )
	{
	if ( iStatusToServer )
		{
		TInt statusID( 0 );
		statusID = iStatusToServer->CreateNewStatusElementL(); 
		iStatusToServer->SetCmdRefL( statusID, aCmdRef );
		iStatusToServer->SetCmdL( statusID, aCmd ); 
		if ( iStatusToServerNoResponse || IsFlagSet( aFlags, SmlNoResp_f ) )
			{
			iStatusToServer->SetNoResponse( statusID, ETrue );
			}
		else
			{
			iStatusToServer->SetNoResponse( statusID, EFalse );
			}
		if ( aIllegal )
			{
			iStatusToServer->SetStatusCodeL( statusID, TNSmlError::ESmlStatusCommandFailed );
			}
		else
			{
			iStatusToServer->SetStatusCodeL( statusID, TNSmlError::ESmlStatusOptFeatureNotSupported );
			}
		}
	}
Пример #14
0
HRESULT
MFTDecoder::SetMediaTypes(IMFMediaType* aInputType,
                          const GUID& aOutputSubType)
{
  mOutputSubtype = aOutputSubType;

  // Set the input type to the one the caller gave us...
  HRESULT hr = mDecoder->SetInputType(0, aInputType, 0);
  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

  hr = SetDecoderOutputType();
  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

  hr = mDecoder->GetInputStreamInfo(0, &mInputStreamInfo);
  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

  hr = mDecoder->GetOutputStreamInfo(0, &mOutputStreamInfo);
  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

  mMFTProvidesOutputSamples = IsFlagSet(mOutputStreamInfo.dwFlags, MFT_OUTPUT_STREAM_PROVIDES_SAMPLES);

  hr = SendMFTMessage(MFT_MESSAGE_NOTIFY_BEGIN_STREAMING, 0);
  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

  hr = SendMFTMessage(MFT_MESSAGE_NOTIFY_START_OF_STREAM, 0);
  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

  return S_OK;
}
Пример #15
0
// ---------------------------------------------------------
// CNSmlCmdsBase::StatusDataToCommandL()
// Save status data to command
// ---------------------------------------------------------
EXPORT_C TInt CNSmlCmdsBase::StatusDataToCommandL( const TDesC8& aCmd, const SmlPcdata_t* aCmdID, TUint aFlags, const SmlItem_t* aItem, TNSmlError::TNSmlSyncMLStatusCode aStatusCode, const TDesC8* aStatusItem )
	{
	TInt statusID( 0 );
	statusID = iStatusToServer->CreateNewStatusElementL(); 
	iStatusToServer->SetCmdRefL( statusID, aCmdID );
	iStatusToServer->SetCmdL( statusID, aCmd ); 
	if ( iStatusToServerNoResponse || IsFlagSet( aFlags, SmlNoResp_f ) )
		{
		iStatusToServer->SetNoResponse( statusID, ETrue );
		}
	else
		{
		iStatusToServer->SetNoResponse( statusID, EFalse );
		}
	if ( aItem )
		{
		iStatusToServer->AddTargetRefL( statusID, aItem->target );
		iStatusToServer->AddSourceRefL( statusID, aItem->source );
		}
	if ( aStatusItem )
		{
		SmlPcdata_t* data = NULL;
		PcdataNewL( data, *aStatusItem );
		CleanupStack::PushL( data );
		iStatusToServer->AddItemDataL( statusID, data );
		CleanupStack::PopAndDestroy(); //data
		}
	iStatusToServer->SetStatusCodeL( statusID, aStatusCode );
	return statusID;
	}
Пример #16
0
/*
*	Get the access rights for the dbinfo object or its variables
*/
OV_DLLFNCEXPORT OV_ACCESS fb_dbinfoclass_getaccess(
	OV_INSTPTR_ov_object		pobj,
	const OV_ELEMENT			*pelem,
	const OV_TICKET				*pticket
) {
	/*
	*	local variables
	*/
	OV_INSTPTR_fb_dbinfoclass	pdbi = Ov_StaticPtrCast(fb_dbinfoclass, pobj);

	/*
	*	switch based on the element's type
	*/
	switch(pelem->elemtype) {
		case OV_ET_VARIABLE:
			if(pelem->elemunion.pvar->v_offset >= offsetof(OV_INST_ov_object,__classinfo)) {

		        if(IsFlagSet(pelem->elemunion.pvar->v_flags, 'i')) {
					return OV_AC_READWRITE;
				}
				return OV_AC_READ;
			}
			break;
		case OV_ET_OBJECT:
			/* Gibt es schon FB-Instanzen? */
			if( pdbi->v_instnumber || pdbi->v_tasknumber || pdbi->v_connnumber ) {
			    return OV_AC_READWRITE;
			}
			return (OV_AC_READWRITE | OV_AC_DELETEABLE);
		default:
			break;
	}
	return ov_object_getaccess(pobj, pelem, pticket);
}
Пример #17
0
  //---------------------------------------------------------------------------
  string_type Value::AsciiDump() const
  {
    stringstream_type ss;

    ss << g_sCmdCode[ GetCode() ];
    ss << _T(" [addr=0x") << std::hex << this << std::dec;
    ss << _T("; pos=") << GetExprPos();
    ss << _T("; type=\"") << GetType() << _T("\"");
    ss << _T("; val=");

    switch(m_cType)
    {
    case 'i': ss << (int_type)m_val.real(); break;
    case 'f': ss << m_val.real(); break;
    case 'm': ss << _T("(matrix)"); break;
    case 's': 
              assert(m_psVal!=nullptr);
              ss << _T("\"") << m_psVal << _T("\""); break;
    }

    ss << ((IsFlagSet(IToken::flVOLATILE)) ? _T("; ") : _T("; not ")) << _T("vol");
    ss << _T("]");

    return ss.str();
  }
Пример #18
0
//-----------------------------------------------------------------------------------------------
string_type Variable::AsciiDump() const
{
    stringstream_type ss;

    ss << g_sCmdCode[ GetCode() ];
    ss << _T(" [addr=0x") << std::hex << this << std::dec;
    ss << _T("; id=\"") << GetIdent() << _T("\"");
    ss << _T("; type=\"") << GetType() << _T("\"");
    ss << _T("; val=");

    switch(GetType())
    {
    case 'i':
        ss << (int_type)GetFloat();
        break;
    case 'f':
        ss << GetFloat();
        break;
    case 'm':
        ss << _T("(array)");
        break;
    case 's':
        ss << _T("\"") << GetString() << _T("\"");
        break;
    }

    ss << ((IsFlagSet(IToken::flVOLATILE)) ? _T("; ") : _T("; not ")) << _T("volatile");
    ss << _T("]");

    return ss.str();
}
Пример #19
0
HRESULT
MFTDecoder::SetDecoderOutputType(ConfigureOutputCallback aCallback, void* aData)
{
  NS_ENSURE_TRUE(mDecoder != nullptr, E_POINTER);

  // Iterate the enumerate the output types, until we find one compatible
  // with what we need.
  HRESULT hr;
  RefPtr<IMFMediaType> outputType;
  UINT32 typeIndex = 0;
  while (SUCCEEDED(mDecoder->GetOutputAvailableType(0, typeIndex++, getter_AddRefs(outputType)))) {
    BOOL resultMatch;
    hr = mOutputType->Compare(outputType, MF_ATTRIBUTES_MATCH_OUR_ITEMS, &resultMatch);
    if (SUCCEEDED(hr) && resultMatch == TRUE) {
      if (aCallback) {
        hr = aCallback(outputType, aData);
        NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
      }
      hr = mDecoder->SetOutputType(0, outputType, 0);
      NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

      hr = mDecoder->GetOutputStreamInfo(0, &mOutputStreamInfo);
      NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

      mMFTProvidesOutputSamples = IsFlagSet(mOutputStreamInfo.dwFlags, MFT_OUTPUT_STREAM_PROVIDES_SAMPLES);

      return S_OK;
    }
    outputType = nullptr;
  }
  return E_FAIL;
}
Пример #20
0
inline bool CSector::IsSectorSleeping() const
{
	ADDTOCALLSTACK_INTENSIVE("CSector::IsSectorSleeping");
	if ( IsFlagSet(SECF_NoSleep) )
		return false;	// never sleep

	if ( IsFlagSet(SECF_InstaSleep) )
	{
		if ( m_Chars_Active.HasClients() > 0 )
			return false;	// has at least one client, no sleep
		else
			return true;	// no active client inside, instant sleep
	}

	//default behaviour
	return (-g_World.GetTimeDiff(GetLastClientTime()) > 10 * 60 * TICK_PER_SEC);
}
Пример #21
0
bool PatchFilesResourceSource::ReadNextEntry(ResourceTypeFlags typeFlags, IteratorState &state, ResourceMapEntryAgnostic &entry, std::vector<uint8_t> *optionalRawData)
{
    if (_stillMore && (_hFind == INVALID_HANDLE_VALUE))
    {
        _hFind = FindFirstFile(_gameFolderSpec.c_str(), &_findData);
    }

    _stillMore = _stillMore && (_hFind != INVALID_HANDLE_VALUE);
    bool foundOne = false;
    while (_stillMore && !foundOne)
    {
        if (PathMatchSpec(_findData.cFileName, g_szResourceSpec))
        {
            int number = ResourceNumberFromFileName(_findData.cFileName);
            if (number != -1)
            {
                // We need a valid number.
                // We do need to peek open the file right now.
                ScopedHandle patchFile;
                std::string fullPath = _gameFolder + "\\" + _findData.cFileName;
                patchFile.hFile = CreateFile(fullPath.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
                if (patchFile.hFile != INVALID_HANDLE_VALUE)
                {
                    // Read the first two bytes. The first is the type, the next is the offset.
                    uint8_t word[2];
                    DWORD cbRead;
                    if (ReadFile(patchFile.hFile, &word, sizeof(word), &cbRead, nullptr) && (cbRead == sizeof(word)))
                    {
                        ResourceType type = (ResourceType)(word[0] & 0x7f);
                        if (IsFlagSet(typeFlags, ResourceTypeToFlag(type)))
                        {
                            entry.Number = number;
                            entry.Offset = GetResourceOffsetInFile(word[1]) + 2;    // For the word we just read.
                            entry.Type = type;
                            entry.ExtraData = _nextIndex;
                            entry.PackageNumber = 0;

                            // This is hokey, but we need a way to know the filename for an item
                            _indexToFilename[_nextIndex] = _findData.cFileName;
                            _nextIndex++;
                            foundOne = true;
                        }
                    }
                }
            }
        }

        _stillMore = !!FindNextFile(_hFind, &_findData);
    }

    if (!_stillMore)
    {
        FindClose(_hFind);
        _hFind = INVALID_HANDLE_VALUE;
    }

    return _stillMore || foundOne;
}
void plAgeInfoStruct::Read( hsStream * s, hsResMgr* )
{
    s->LogSubStreamStart("push me");
    s->LogReadLE( &fFlags ,"AgeInfoStruct Flags");
    if ( IsFlagSet( kHasAgeFilename ) ) {
        s->LogSubStreamPushDesc("AgeFilename");
        plMsgStdStringHelper::Peek(fAgeFilename,s);
    }
    if ( IsFlagSet( kHasAgeInstanceName ) ) {
        s->LogSubStreamPushDesc("AgeInstanceName");
        plMsgStdStringHelper::Peek(fAgeInstanceName,s);
    }
    if ( IsFlagSet( kHasAgeInstanceGuid ) ) {
        s->LogSubStreamPushDesc("AgeInstanceGuid");
        fAgeInstanceGuid.Read( s );
    }
    if ( IsFlagSet( kHasAgeUserDefinedName ) ){
        s->LogSubStreamPushDesc("UserDefinedName");
        plMsgStdStringHelper::Peek(fAgeUserDefinedName,s);
    }
    if ( IsFlagSet( kHasAgeSequenceNumber ) ) {
        s->LogReadLE( &fAgeSequenceNumber ,"AgeSequenceNumber");
    }
    if ( IsFlagSet( kHasAgeDescription ) ) {
        s->LogSubStreamPushDesc("AgeDescription");
        plMsgStdStringHelper::Peek(fAgeDescription,s);
    }
    if ( IsFlagSet( kHasAgeLanguage ) ) {
        s->LogReadLE( &fAgeLanguage ,"AgeLanguage");
    }
    UpdateFlags();
    s->LogSubStreamEnd();
}
Пример #23
0
void CWaterGameEffects::OnCameraComingOutOfWater( )
{
	m_waterDropletsAmount = 0.7f;

	if(IsFlagSet(GAME_EFFECT_ACTIVE) == false)
	{
		SetActive( true );
	}
}
Пример #24
0
// ----------------------------------------------------------------------- //
//
//	ROUTINE:	CLTWnd::OnLButtonDown
//
//	PURPOSE:	This is the actual left button down handler
//
// ----------------------------------------------------------------------- //
BOOL CLTWnd::OnLButtonDown(int xPos, int yPos)
{
	// If the window isn't enabled, just return
	if(!m_bEnabled || !m_bVisible)
		return FALSE;

	SetFocus();
	s_pWndCapture = this;

	// Find our parent
	CLTWnd* pWnd = this;
	CLTWnd* pParent = m_pParentWnd;
	while(pWnd->IsFlagSet(LTWF_FIXEDCHILD) && pParent)
	{
		pWnd = pParent;
		pParent = pWnd->GetParent();
	}

	//pWnd->SetFocus();
	//s_pWndCapture = pWnd;

	// If we're draggable, start the draggage
	if(pWnd->IsFlagSet(LTWF_DRAGGABLE))
	{
		pWnd->m_xCursorClick = xPos - pWnd->GetWindowLeft();
		pWnd->m_yCursorClick = yPos - pWnd->GetWindowTop();

		if(pWnd != this)
		{
			// Our parent is draggable, but we're not
			// can our parent be dragged around by us?
			if(!IsFlagSet(LTWF_PARENTDRAG))
			{
				// We can't allow draggage
				return TRUE;
			}
		}

		// Don't allow the mouse to drag us outside of our parent's window
		ASSERT(pWnd->GetParent());
		CRect rcClip;
		// Subtract 1 from the right and the bottom to go from a windows rect to a real rect
		// (0,0,640,480) -> (0,0,639,479)
		pWnd->GetParent()->GetClipRect(&rcClip);
		rcClip.right -= 1;
		rcClip.bottom -= 1;

		g_mouseMgr.SetClipRect(&rcClip,!pWnd->IsFlagSet(LTWF_VDRAG),!pWnd->IsFlagSet(LTWF_HDRAG));

		::MapWindowPoints(g_hMainWnd,NULL,(POINT*)&rcClip,2);
		ClipCursor(&rcClip);

		return TRUE;
	}

	return(this != s_pMainWnd);
}
bool plAgeLinkStruct::IsEqualTo( const plAgeLinkStruct * other ) const
{
    bool match = true;
    if (match && IsFlagSet(kHasAgeInfo) && other->IsFlagSet(kHasAgeInfo))
        match = match && fAgeInfo.IsEqualTo( other->GetAgeInfo() );
    // don't compare linking rules.
    // don't compare SpawnPt
    // don't compare AmCCR
    return match;
}
Пример #26
0
//--------------------------------------------------------------------------------------------------
// Name: Release
// Desc: Releases game effect
//--------------------------------------------------------------------------------------------------
void CGameEffect::Release()
{
	SetFlag(GAME_EFFECT_RELEASING, true);
	if(IsFlagSet(GAME_EFFECT_ACTIVE))
	{
		SetActive(false);
	}
	GAME_FX_SYSTEM.UnRegisterEffect(this);
	SetFlag(GAME_EFFECT_INITIALISED,false);
	SetFlag(GAME_EFFECT_RELEASING, false);
	SetFlag(GAME_EFFECT_RELEASED,true);
}//-------------------------------------------------------------------------------------------------
Пример #27
0
// ----------------------------------------------------------------------- //
//
//	ROUTINE:	CLTWnd::Update
//
//	PURPOSE:	Updates all child windows
//
// ----------------------------------------------------------------------- //
BOOL CLTWnd::Update(float fTimeDelta)
{
	if(IsFlagSet(LTWF_NOUPDATE))
		return FALSE;

	if(IsFlagSet(LTWF_TERM))
	{
		Term();
		return FALSE;
	}

	POSITION pos = m_lstChildren.GetHeadPosition();
	while (pos)
	{
		CLTWnd* pWnd = (CLTWnd*)m_lstChildren.GetNext(pos);
		ASSERT(pWnd);
		if(!pWnd->Update(fTimeDelta))
			return FALSE;
	}
	return TRUE;
}
void plNetServerSessionInfo::Read(hsStream* s, hsResMgr*)
{
    Clear();
    s->LogSubStreamStart("push me");
    s->LogReadLE(&fFlags,"ServerSessionInfo Flags");
    if (IsFlagSet(kHasServerName)){
        s->LogSubStreamPushDesc("ServerName");
        plMsgStdStringHelper::Peek(fServerName,s);
    }
    if (IsFlagSet(kHasServerType))
        s->LogReadLE(&fServerType,"ServerType");
    if (IsFlagSet(kHasServerAddr)){
        s->LogSubStreamPushDesc("ServerAddr");
        plMsgStdStringHelper::Peek(fServerAddr,s);
    }
    if (IsFlagSet(kHasServerPort))
        s->LogReadLE(&fServerPort,"ServerPort");
    if (IsFlagSet(kHasServerGuid)){
        s->LogSubStreamPushDesc("ServerGuid");
        fServerGuid.Read(s);
    }
}
Пример #29
0
//--------------------------------------------------------------------------------------------------
// Name: Explode
// Desc: Spawns explosion
//--------------------------------------------------------------------------------------------------
void CExplosionGameEffect::Explode(SExplosionContainer &explosionContainer)
{
	if(IsFlagSet(GAME_EFFECT_ACTIVE))
	{
		SpawnParticleEffect(explosionContainer);
		SpawnCharacterEffects(explosionContainer);

		if(!m_cutSceneActive)
		{
			SpawnScreenExplosionEffect(explosionContainer);
			QueueMaterialEffect(explosionContainer);
		}
	}
}//-------------------------------------------------------------------------------------------------
Пример #30
0
static void NotifyConVar(ConVar *pConVar) {
	IGameEvent *pEvent = g_Interfaces.GameEventManagerInstance->CreateEvent("server_cvar");
	
	pEvent->SetString("cvarname", pConVar->GetName());
	
	if (IsFlagSet(pConVar, FCVAR_PROTECTED)) {
		pEvent->SetString("cvarvalue", "***PROTECTED***");
	}
	else {
		pEvent->SetString("cvarvalue", pConVar->GetString());
	}

	g_Interfaces.GameEventManagerInstance->FireEvent(pEvent);
}